Commit 9400df8f authored by ggaren@apple.com's avatar ggaren@apple.com

2012-09-01 Geoffrey Garen <ggaren@apple.com>

        Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.

            Shrink activation objects by half
            https://bugs.webkit.org/show_bug.cgi?id=95591

            Reviewed by Sam Weinig.

        * runtime/JSActivation.cpp:
        (JSC::JSActivation::JSActivation):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::JSGlobalObject):
        (JSC::JSGlobalObject::setGlobalThis):
        (JSC):
        (JSC::JSGlobalObject::visitChildren):
        * runtime/JSGlobalObject.h:
        (JSGlobalObject):
        (JSC::JSScope::globalThis):
        (JSC):
        (JSC::JSGlobalObject::globalThis):
        * runtime/JSNameScope.h:
        (JSC::JSNameScope::JSNameScope):
        * runtime/JSScope.cpp:
        (JSC::JSScope::visitChildren):
        * runtime/JSScope.h:
        (JSScope):
        (JSC::JSScope::JSScope):
        (JSC::JSScope::globalObject):
        (JSC::JSScope::globalData):
        * runtime/JSSegmentedVariableObject.h:
        (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
        * runtime/JSSymbolTableObject.h:
        (JSC::JSSymbolTableObject::JSSymbolTableObject):
        * runtime/JSVariableObject.h:
        (JSC::JSVariableObject::JSVariableObject):
        * runtime/JSWithScope.h:
        (JSC::JSWithScope::JSWithScope):
        * runtime/StrictEvalActivation.cpp:
        (JSC::StrictEvalActivation::StrictEvalActivation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0f515a65
2012-09-01 Geoffrey Garen <ggaren@apple.com>
Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
Shrink activation objects by half
https://bugs.webkit.org/show_bug.cgi?id=95591
Reviewed by Sam Weinig.
* runtime/JSActivation.cpp:
(JSC::JSActivation::JSActivation):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::JSGlobalObject):
(JSC::JSGlobalObject::setGlobalThis):
(JSC):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSGlobalObject):
(JSC::JSScope::globalThis):
(JSC):
(JSC::JSGlobalObject::globalThis):
* runtime/JSNameScope.h:
(JSC::JSNameScope::JSNameScope):
* runtime/JSScope.cpp:
(JSC::JSScope::visitChildren):
* runtime/JSScope.h:
(JSScope):
(JSC::JSScope::JSScope):
(JSC::JSScope::globalObject):
(JSC::JSScope::globalData):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
* runtime/JSSymbolTableObject.h:
(JSC::JSSymbolTableObject::JSSymbolTableObject):
* runtime/JSVariableObject.h:
(JSC::JSVariableObject::JSVariableObject):
* runtime/JSWithScope.h:
(JSC::JSWithScope::JSWithScope):
* runtime/StrictEvalActivation.cpp:
(JSC::StrictEvalActivation::StrictEvalActivation):
2012-09-01 Geoffrey Garen <ggaren@apple.com>
Rolled back out a piece of <http://trac.webkit.org/changeset/127293>
......
......@@ -46,8 +46,6 @@ JSActivation::JSActivation(CallFrame* callFrame, FunctionExecutable* functionExe
callFrame->globalData(),
callFrame->lexicalGlobalObject()->activationStructure(),
callFrame->registers(),
callFrame->lexicalGlobalObject(),
callFrame->globalThisValue(),
callFrame->scope()
)
, m_registerArray(callFrame->globalData(), this, 0)
......
......@@ -109,7 +109,7 @@ static const int initialTickCountThreshold = 255;
static const int preferredScriptCheckTimeInterval = 1000;
JSGlobalObject::JSGlobalObject(JSGlobalData& globalData, Structure* structure, const GlobalObjectMethodTable* globalObjectMethodTable)
: Base(globalData, structure, this, this, 0)
: Base(globalData, structure, 0)
, m_masqueradesAsUndefinedWatchpoint(adoptRef(new WatchpointSet(InitializedWatching)))
, m_weakRandom(Options::forceWeakRandomSeed() ? Options::forcedWeakRandomSeed() : static_cast<unsigned>(randomNumber() * (std::numeric_limits<unsigned>::max() + 1.0)))
, m_evalEnabled(true)
......@@ -131,6 +131,11 @@ void JSGlobalObject::destroy(JSCell* cell)
static_cast<JSGlobalObject*>(cell)->JSGlobalObject::~JSGlobalObject();
}
void JSGlobalObject::setGlobalThis(JSGlobalData& globalData, JSObject* globalThis)
{
m_globalThis.set(globalData, this, globalThis);
}
void JSGlobalObject::init(JSObject* thisValue)
{
ASSERT(globalData().apiLock().currentThreadIsHoldingLock());
......@@ -352,6 +357,7 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
Base::visitChildren(thisObject, visitor);
visitor.append(&thisObject->m_globalThis);
visitor.append(&thisObject->m_methodCallDummy);
visitor.append(&thisObject->m_regExpConstructor);
......
......@@ -94,6 +94,7 @@ namespace JSC {
Register m_globalCallFrame[RegisterFile::CallFrameHeaderSize];
WriteBarrier<JSObject> m_globalThis;
WriteBarrier<JSObject> m_methodCallDummy;
WriteBarrier<RegExpConstructor> m_regExpConstructor;
......@@ -309,6 +310,7 @@ namespace JSC {
void resetPrototype(JSGlobalData&, JSValue prototype);
JSGlobalData& globalData() const { return *Heap::heap(this)->globalData(); }
JSObject* globalThis() const;
static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
......@@ -353,6 +355,7 @@ namespace JSC {
// FIXME: Fold reset into init.
JS_EXPORT_PRIVATE void init(JSObject* thisValue);
void reset(JSValue prototype);
void setGlobalThis(JSGlobalData&, JSObject* globalThis);
void createThrowTypeError(ExecState*);
......@@ -493,6 +496,16 @@ namespace JSC {
return true;
}
inline JSObject* JSScope::globalThis()
{
return globalObject()->globalThis();
}
inline JSObject* JSGlobalObject::globalThis() const
{
return m_globalThis.get();
}
} // namespace JSC
#endif // JSGlobalObject_h
......@@ -69,8 +69,6 @@ private:
exec->globalData(),
exec->lexicalGlobalObject()->nameScopeStructure(),
reinterpret_cast<Register*>(&m_registerStore + 1),
exec->lexicalGlobalObject(),
exec->globalThisValue(),
exec->scope()
)
{
......
......@@ -44,8 +44,6 @@ void JSScope::visitChildren(JSCell* cell, SlotVisitor& visitor)
Base::visitChildren(thisObject, visitor);
visitor.append(&thisObject->m_next);
visitor.append(&thisObject->m_globalObject);
visitor.append(&thisObject->m_globalThis);
}
bool JSScope::isDynamicScope(bool& requiresDynamicChecks) const
......
......@@ -73,25 +73,18 @@ public:
JSGlobalObject* globalObject();
JSGlobalData* globalData();
JSObject* globalThis();
void setGlobalThis(JSGlobalData&, JSObject*);
protected:
JSScope(JSGlobalData&, Structure*, JSGlobalObject*, JSObject* globalThis, JSScope* next);
JSScope(JSGlobalData&, Structure*, JSScope* next);
static const unsigned StructureFlags = OverridesVisitChildren | Base::StructureFlags;
private:
JSGlobalData* m_globalData;
WriteBarrier<JSScope> m_next;
WriteBarrier<JSGlobalObject> m_globalObject;
WriteBarrier<JSObject> m_globalThis;
};
inline JSScope::JSScope(JSGlobalData& globalData, Structure* structure, JSGlobalObject* globalObject, JSObject* globalThis, JSScope* next)
inline JSScope::JSScope(JSGlobalData& globalData, Structure* structure, JSScope* next)
: Base(globalData, structure)
, m_globalData(&globalData)
, m_next(globalData, this, next, WriteBarrier<JSScope>::MayBeNull)
, m_globalObject(globalData, this, globalObject)
, m_globalThis(globalData, this, globalThis)
{
}
......@@ -133,22 +126,12 @@ inline JSScope* JSScope::next()
inline JSGlobalObject* JSScope::globalObject()
{
return m_globalObject.get();
return structure()->globalObject();
}
inline JSGlobalData* JSScope::globalData()
{
return m_globalData;
}
inline JSObject* JSScope::globalThis()
{
return m_globalThis.get();
}
inline void JSScope::setGlobalThis(JSGlobalData& globalData, JSObject* globalThis)
{
m_globalThis.set(globalData, this, globalThis);
return Heap::heap(this)->globalData();
}
inline Register& Register::operator=(JSScope* scope)
......
......@@ -82,8 +82,8 @@ public:
protected:
static const unsigned StructureFlags = OverridesVisitChildren | JSSymbolTableObject::StructureFlags;
JSSegmentedVariableObject(JSGlobalData& globalData, Structure* structure, JSGlobalObject* globalObject, JSObject* globalThis, JSScope* scope)
: JSSymbolTableObject(globalData, structure, globalObject, globalThis, scope)
JSSegmentedVariableObject(JSGlobalData& globalData, Structure* structure, JSScope* scope)
: JSSymbolTableObject(globalData, structure, scope)
{
}
......
......@@ -49,8 +49,8 @@ public:
protected:
static const unsigned StructureFlags = IsEnvironmentRecord | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
JSSymbolTableObject(JSGlobalData& globalData, Structure* structure, JSGlobalObject* globalObject, JSObject* globalThis, JSScope* scope)
: Base(globalData, structure, globalObject, globalThis, scope)
JSSymbolTableObject(JSGlobalData& globalData, Structure* structure, JSScope* scope)
: Base(globalData, structure, scope)
{
}
......
......@@ -60,11 +60,9 @@ namespace JSC {
JSGlobalData& globalData,
Structure* structure,
Register* registers,
JSGlobalObject* globalObject,
JSObject* globalThis,
JSScope* scope
)
: Base(globalData, structure, globalObject, globalThis, scope)
: Base(globalData, structure, scope)
, m_registers(reinterpret_cast<WriteBarrierBase<Unknown>*>(registers))
{
}
......
......@@ -67,8 +67,6 @@ private:
: Base(
exec->globalData(),
exec->lexicalGlobalObject()->withScopeStructure(),
exec->lexicalGlobalObject(),
exec->globalThisValue(),
exec->scope()
)
, m_object(exec->globalData(), this, object)
......@@ -79,8 +77,6 @@ private:
: Base(
exec->globalData(),
exec->lexicalGlobalObject()->withScopeStructure(),
exec->lexicalGlobalObject(),
exec->globalThisValue(),
next
)
, m_object(exec->globalData(), this, object)
......
......@@ -38,8 +38,6 @@ StrictEvalActivation::StrictEvalActivation(ExecState* exec)
: Base(
exec->globalData(),
exec->lexicalGlobalObject()->strictEvalActivationStructure(),
exec->lexicalGlobalObject(),
exec->globalThisValue(),
exec->scope()
)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment