Title: [127304] trunk/Source/_javascript_Core
Revision
127304
Author
[email protected]
Date
2012-08-31 13:10:09 -0700 (Fri, 31 Aug 2012)

Log Message

Not reviewed.

Rolled out http://trac.webkit.org/changeset/127293 because it broke
inspector tests on Windows.

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

    Reviewed by Sam Weinig.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (127303 => 127304)


--- trunk/Source/_javascript_Core/ChangeLog	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-08-31 20:10:09 UTC (rev 127304)
@@ -1,5 +1,17 @@
 2012-08-31  Geoffrey Garen  <[email protected]>
 
+        Not reviewed.
+
+        Rolled out http://trac.webkit.org/changeset/127293 because it broke
+        inspector tests on Windows.
+
+            Shrink activation objects by half
+            https://bugs.webkit.org/show_bug.cgi?id=95591
+
+            Reviewed by Sam Weinig.
+
+2012-08-31  Geoffrey Garen  <[email protected]>
+
         Shrink activation objects by half
         https://bugs.webkit.org/show_bug.cgi?id=95591
 

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractState.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -1171,7 +1171,7 @@
         
     case CreateActivation:
         node.setCanExit(false);
-        forNode(nodeIndex).set(m_codeBlock->globalObjectFor(node.codeOrigin)->activationStructure());
+        forNode(nodeIndex).set(m_graph.m_globalData.activationStructure.get());
         m_haveStructures = true;
         break;
         

Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/heap/MarkedBlock.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -45,7 +45,7 @@
     , m_cellsNeedDestruction(cellsNeedDestruction)
     , m_onlyContainsStructures(onlyContainsStructures)
     , m_state(New) // All cells start out unmarked.
-    , m_weakSet(heap->globalData())
+    , m_weakSet(heap)
 {
     ASSERT(heap);
     HEAP_LOG_BLOCK_STATE_TRANSITION(this);

Modified: trunk/Source/_javascript_Core/heap/MarkedBlock.h (127303 => 127304)


--- trunk/Source/_javascript_Core/heap/MarkedBlock.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/heap/MarkedBlock.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -121,7 +121,6 @@
         void lastChanceToFinalize();
 
         Heap* heap() const;
-        JSGlobalData* globalData() const;
         WeakSet& weakSet();
         
         enum SweepMode { SweepOnly, SweepToFreeList };
@@ -263,11 +262,6 @@
         return m_weakSet.heap();
     }
 
-    inline JSGlobalData* MarkedBlock::globalData() const
-    {
-        return m_weakSet.globalData();
-    }
-
     inline WeakSet& MarkedBlock::weakSet()
     {
         return m_weakSet;

Modified: trunk/Source/_javascript_Core/heap/WeakSet.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/heap/WeakSet.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/heap/WeakSet.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -27,7 +27,6 @@
 #include "WeakSet.h"
 
 #include "Heap.h"
-#include "JSGlobalData.h"
 
 namespace JSC {
 
@@ -74,7 +73,7 @@
 WeakBlock::FreeCell* WeakSet::addAllocator()
 {
     WeakBlock* block = WeakBlock::create();
-    heap()->didAllocate(WeakBlock::blockSize);
+    m_heap->didAllocate(WeakBlock::blockSize);
     m_blocks.append(block);
     WeakBlock::SweepResult sweepResult = block->takeSweepResult();
     ASSERT(!sweepResult.isNull() && sweepResult.freeList);

Modified: trunk/Source/_javascript_Core/heap/WeakSet.h (127303 => 127304)


--- trunk/Source/_javascript_Core/heap/WeakSet.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/heap/WeakSet.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -38,12 +38,11 @@
     static WeakImpl* allocate(JSValue, WeakHandleOwner* = 0, void* context = 0);
     static void deallocate(WeakImpl*);
 
-    WeakSet(JSGlobalData*);
+    WeakSet(Heap*);
     ~WeakSet();
     void lastChanceToFinalize();
 
     Heap* heap() const;
-    JSGlobalData* globalData() const;
 
     bool isEmpty() const;
 
@@ -62,19 +61,19 @@
     WeakBlock::FreeCell* m_allocator;
     WeakBlock* m_nextAllocator;
     DoublyLinkedList<WeakBlock> m_blocks;
-    JSGlobalData* m_globalData;
+    Heap* m_heap;
 };
 
-inline WeakSet::WeakSet(JSGlobalData* globalData)
+inline WeakSet::WeakSet(Heap* heap)
     : m_allocator(0)
     , m_nextAllocator(0)
-    , m_globalData(globalData)
+    , m_heap(heap)
 {
 }
 
-inline JSGlobalData* WeakSet::globalData() const
+inline Heap* WeakSet::heap() const
 {
-    return m_globalData;
+    return m_heap;
 }
 
 inline bool WeakSet::isEmpty() const

Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -1591,12 +1591,12 @@
         Jump activationNotCreated;
         if (checkTopLevel)
             activationNotCreated = branchTestPtr(Zero, addressFor(m_codeBlock->activationRegister()));
-        addSlowCase(checkStructure(regT0, m_codeBlock->globalObject()->activationStructure()));
+        addSlowCase(checkStructure(regT0, m_globalData->activationStructure.get()));
         loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
         activationNotCreated.link(this);
     }
     while (skip--) {
-        addSlowCase(checkStructure(regT0, m_codeBlock->globalObject()->activationStructure()));
+        addSlowCase(checkStructure(regT0, m_globalData->activationStructure.get()));
         loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
     }
     emit_op_resolve_global(currentInstruction, true);

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (127303 => 127304)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2012-08-31 20:10:09 UTC (rev 127304)
@@ -1022,9 +1022,8 @@
 
 _llint_op_resolve_global_dynamic:
     traceExecution()
-    loadp CodeBlock[cfr], t3
-    loadp CodeBlock::m_globalObject[t3], t3
-    loadp JSGlobalObject::m_activationStructure[t3], t3
+    loadp JITStackFrame::globalData[sp], t3
+    loadp JSGlobalData::activationStructure[t3], t3
     getScope(
         20[PC],
         macro (scope, scratch)

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (127303 => 127304)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2012-08-31 20:10:09 UTC (rev 127304)
@@ -873,9 +873,8 @@
 
 _llint_op_resolve_global_dynamic:
     traceExecution()
-    loadp CodeBlock[cfr], t3
-    loadp CodeBlock::m_globalObject[t3], t3
-    loadp JSGlobalObject::m_activationStructure[t3], t3
+    loadp JITStackFrame::globalData[sp], t3
+    loadp JSGlobalData::activationStructure[t3], t3
     getScope(
         40[PB, PC, 8],
         macro (scope, scratch)

Modified: trunk/Source/_javascript_Core/runtime/JSActivation.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSActivation.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSActivation.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -44,8 +44,10 @@
 JSActivation::JSActivation(CallFrame* callFrame, FunctionExecutable* functionExecutable)
     : Base(
         callFrame->globalData(),
-        callFrame->lexicalGlobalObject()->activationStructure(),
+        callFrame->globalData().activationStructure.get(),
         callFrame->registers(),
+        callFrame->lexicalGlobalObject(),
+        callFrame->globalThisValue(),
         callFrame->scope()
     )
     , m_registerArray(callFrame->globalData(), this, 0)

Modified: trunk/Source/_javascript_Core/runtime/JSActivation.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSActivation.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSActivation.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -96,11 +96,11 @@
         size_t registerArraySizeInBytes();
 
         StorageBarrier m_registerArray; // Independent copy of registers, used when a variable object copies its registers out of the register file.
-        unsigned m_numCapturedArgs;
-        unsigned m_numCapturedVars : 28;
+        int m_numCapturedArgs;
+        int m_numCapturedVars : 30;
         bool m_isTornOff : 1;
         bool m_requiresDynamicChecks : 1;
-        unsigned m_argumentsRegister : 2;
+        int m_argumentsRegister;
     };
 
     JSActivation* asActivation(JSValue);

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -188,13 +188,17 @@
     IdentifierTable* existingEntryIdentifierTable = wtfThreadData().setCurrentIdentifierTable(identifierTable);
     structureStructure.set(*this, Structure::createStructure(*this));
     debuggerActivationStructure.set(*this, DebuggerActivation::createStructure(*this, 0, jsNull()));
+    activationStructure.set(*this, JSActivation::createStructure(*this, 0, jsNull()));
     interruptedExecutionErrorStructure.set(*this, InterruptedExecutionError::createStructure(*this, 0, jsNull()));
     terminatedExecutionErrorStructure.set(*this, TerminatedExecutionError::createStructure(*this, 0, jsNull()));
+    nameScopeStructure.set(*this, JSNameScope::createStructure(*this, 0, jsNull()));
+    strictEvalActivationStructure.set(*this, StrictEvalActivation::createStructure(*this, 0, jsNull()));
     stringStructure.set(*this, JSString::createStructure(*this, 0, jsNull()));
     notAnObjectStructure.set(*this, JSNotAnObject::createStructure(*this, 0, jsNull()));
     propertyNameIteratorStructure.set(*this, JSPropertyNameIterator::createStructure(*this, 0, jsNull()));
     getterSetterStructure.set(*this, GetterSetter::createStructure(*this, 0, jsNull()));
     apiWrapperStructure.set(*this, JSAPIValueWrapper::createStructure(*this, 0, jsNull()));
+    JSScopeStructure.set(*this, JSScope::createStructure(*this, 0, jsNull()));
     executableStructure.set(*this, ExecutableBase::createStructure(*this, 0, jsNull()));
     nativeExecutableStructure.set(*this, NativeExecutable::createStructure(*this, 0, jsNull()));
     evalExecutableStructure.set(*this, EvalExecutable::createStructure(*this, 0, jsNull()));
@@ -203,6 +207,7 @@
     regExpStructure.set(*this, RegExp::createStructure(*this, 0, jsNull()));
     sharedSymbolTableStructure.set(*this, SharedSymbolTable::createStructure(*this, 0, jsNull()));
     structureChainStructure.set(*this, StructureChain::createStructure(*this, 0, jsNull()));
+    withScopeStructure.set(*this, JSWithScope::createStructure(*this, 0, jsNull()));
 
     wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable);
 

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -228,13 +228,17 @@
         
         Strong<Structure> structureStructure;
         Strong<Structure> debuggerActivationStructure;
+        Strong<Structure> activationStructure;
         Strong<Structure> interruptedExecutionErrorStructure;
         Strong<Structure> terminatedExecutionErrorStructure;
+        Strong<Structure> nameScopeStructure;
+        Strong<Structure> strictEvalActivationStructure;
         Strong<Structure> stringStructure;
         Strong<Structure> notAnObjectStructure;
         Strong<Structure> propertyNameIteratorStructure;
         Strong<Structure> getterSetterStructure;
         Strong<Structure> apiWrapperStructure;
+        Strong<Structure> JSScopeStructure;
         Strong<Structure> executableStructure;
         Strong<Structure> nativeExecutableStructure;
         Strong<Structure> evalExecutableStructure;
@@ -243,6 +247,7 @@
         Strong<Structure> regExpStructure;
         Strong<Structure> sharedSymbolTableStructure;
         Strong<Structure> structureChainStructure;
+        Strong<Structure> withScopeStructure;
 
         IdentifierTable* identifierTable;
         CommonIdentifiers* propertyNames;
@@ -469,11 +474,6 @@
     }
 #endif
 
-    inline Heap* WeakSet::heap() const
-    {
-        return &m_globalData->heap;
-    }
-
 } // namespace JSC
 
 #endif // JSGlobalData_h

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -30,6 +30,10 @@
 #include "config.h"
 #include "JSGlobalObject.h"
 
+#include "JSCallbackConstructor.h"
+#include "JSCallbackFunction.h"
+#include "JSCallbackObject.h"
+
 #include "Arguments.h"
 #include "ArrayConstructor.h"
 #include "ArrayPrototype.h"
@@ -38,25 +42,18 @@
 #include "CodeBlock.h"
 #include "DateConstructor.h"
 #include "DatePrototype.h"
-#include "Debugger.h"
 #include "Error.h"
 #include "ErrorConstructor.h"
 #include "ErrorPrototype.h"
 #include "FunctionConstructor.h"
 #include "FunctionPrototype.h"
 #include "GetterSetter.h"
-#include "Interpreter.h"
-#include "JSActivation.h"
 #include "JSBoundFunction.h"
-#include "JSCallbackConstructor.h"
-#include "JSCallbackFunction.h"
-#include "JSCallbackObject.h"
 #include "JSFunction.h"
 #include "JSGlobalObjectFunctions.h"
 #include "JSLock.h"
-#include "JSNameScope.h"
 #include "JSONObject.h"
-#include "JSWithScope.h"
+#include "Interpreter.h"
 #include "Lookup.h"
 #include "MathObject.h"
 #include "NameConstructor.h"
@@ -73,9 +70,9 @@
 #include "RegExpMatchesArray.h"
 #include "RegExpObject.h"
 #include "RegExpPrototype.h"
-#include "StrictEvalActivation.h"
 #include "StringConstructor.h"
 #include "StringPrototype.h"
+#include "Debugger.h"
 
 #include "JSGlobalObject.lut.h"
 
@@ -109,7 +106,7 @@
 static const int preferredScriptCheckTimeInterval = 1000;
 
 JSGlobalObject::JSGlobalObject(JSGlobalData& globalData, Structure* structure, const GlobalObjectMethodTable* globalObjectMethodTable)
-    : Base(globalData, structure, 0)
+    : Base(globalData, structure, this, this, 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,11 +128,6 @@
     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());
@@ -216,11 +208,6 @@
     m_objectPrototype->putDirectAccessor(exec->globalData(), exec->propertyNames().underscoreProto, protoAccessor, Accessor | DontEnum);
     m_functionPrototype->structure()->setPrototypeWithoutTransition(exec->globalData(), m_objectPrototype.get());
 
-    m_nameScopeStructure.set(exec->globalData(), this, JSNameScope::createStructure(exec->globalData(), this, jsNull()));
-    m_activationStructure.set(exec->globalData(), this, JSActivation::createStructure(exec->globalData(), this, jsNull()));
-    m_strictEvalActivationStructure.set(exec->globalData(), this, StrictEvalActivation::createStructure(exec->globalData(), this, jsNull()));
-    m_withScopeStructure.set(exec->globalData(), this, JSWithScope::createStructure(exec->globalData(), this, jsNull()));
-
     m_emptyObjectStructure.set(exec->globalData(), this, m_objectPrototype->inheritorID(exec->globalData()));
     m_nullPrototypeObjectStructure.set(exec->globalData(), this, createEmptyObjectStructure(exec->globalData(), this, jsNull()));
 
@@ -357,7 +344,6 @@
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
-    visitor.append(&thisObject->m_globalThis);
     visitor.append(&thisObject->m_methodCallDummy);
 
     visitor.append(&thisObject->m_regExpConstructor);
@@ -384,10 +370,6 @@
     visitor.append(&thisObject->m_regExpPrototype);
     visitor.append(&thisObject->m_errorPrototype);
 
-    visitor.append(&thisObject->m_withScopeStructure);
-    visitor.append(&thisObject->m_strictEvalActivationStructure);
-    visitor.append(&thisObject->m_activationStructure);
-    visitor.append(&thisObject->m_nameScopeStructure);
     visitor.append(&thisObject->m_argumentsStructure);
     visitor.append(&thisObject->m_arrayStructure);
     visitor.append(&thisObject->m_booleanObjectStructure);

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -94,7 +94,6 @@
 
         Register m_globalCallFrame[RegisterFile::CallFrameHeaderSize];
 
-        WriteBarrier<JSObject> m_globalThis;
         WriteBarrier<JSObject> m_methodCallDummy;
 
         WriteBarrier<RegExpConstructor> m_regExpConstructor;
@@ -121,10 +120,6 @@
         WriteBarrier<RegExpPrototype> m_regExpPrototype;
         WriteBarrier<ErrorPrototype> m_errorPrototype;
 
-        WriteBarrier<Structure> m_withScopeStructure;
-        WriteBarrier<Structure> m_strictEvalActivationStructure;
-        WriteBarrier<Structure> m_activationStructure;
-        WriteBarrier<Structure> m_nameScopeStructure;
         WriteBarrier<Structure> m_argumentsStructure;
         WriteBarrier<Structure> m_arrayStructure;
         WriteBarrier<Structure> m_booleanObjectStructure;
@@ -253,10 +248,6 @@
 
         JSObject* methodCallDummy() const { return m_methodCallDummy.get(); }
 
-        Structure* withScopeStructure() const { return m_withScopeStructure.get(); }
-        Structure* strictEvalActivationStructure() const { return m_strictEvalActivationStructure.get(); }
-        Structure* activationStructure() const { return m_activationStructure.get(); }
-        Structure* nameScopeStructure() const { return m_nameScopeStructure.get(); }
         Structure* argumentsStructure() const { return m_argumentsStructure.get(); }
         Structure* arrayStructure() const { return m_arrayStructure.get(); }
         Structure* booleanObjectStructure() const { return m_booleanObjectStructure.get(); }
@@ -310,7 +301,6 @@
         void resetPrototype(JSGlobalData&, JSValue prototype);
 
         JSGlobalData& globalData() const { return *Heap::heap(this)->globalData(); }
-        JSObject* globalThis() const;
 
         static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
         {
@@ -355,7 +345,6 @@
         // FIXME: Fold reset into init.
         JS_EXPORT_PRIVATE void init(JSObject* thisValue);
         void reset(JSValue prototype);
-        void setGlobalThis(JSGlobalData&, JSObject* globalThis);
 
         void createThrowTypeError(ExecState*);
 
@@ -496,16 +485,6 @@
         return true;
     }
 
-    inline JSObject* JSScope::globalThis()
-    { 
-        return globalObject()->globalThis();
-    }
-
-    inline JSObject* JSGlobalObject::globalThis() const
-    { 
-        return m_globalThis.get();
-    }
-
 } // namespace JSC
 
 #endif // JSGlobalObject_h

Modified: trunk/Source/_javascript_Core/runtime/JSNameScope.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSNameScope.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSNameScope.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -26,7 +26,6 @@
 #ifndef JSNameScope_h
 #define JSNameScope_h
 
-#include "JSGlobalObject.h"
 #include "JSVariableObject.h"
 
 namespace JSC {
@@ -67,8 +66,10 @@
     JSNameScope(ExecState* exec)
         : Base(
             exec->globalData(),
-            exec->lexicalGlobalObject()->nameScopeStructure(),
+            exec->globalData().nameScopeStructure.get(),
             reinterpret_cast<Register*>(&m_registerStore + 1),
+            exec->lexicalGlobalObject(),
+            exec->globalThisValue(),
             exec->scope()
         )
     {

Modified: trunk/Source/_javascript_Core/runtime/JSScope.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSScope.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSScope.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -44,6 +44,8 @@
 
     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

Modified: trunk/Source/_javascript_Core/runtime/JSScope.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSScope.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSScope.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -73,18 +73,25 @@
     JSGlobalObject* globalObject();
     JSGlobalData* globalData();
     JSObject* globalThis();
+    void setGlobalThis(JSGlobalData&, JSObject*);
 
 protected:
-    JSScope(JSGlobalData&, Structure*, JSScope* next);
+    JSScope(JSGlobalData&, Structure*, JSGlobalObject*, JSObject* globalThis, 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, JSScope* next)
+inline JSScope::JSScope(JSGlobalData& globalData, Structure* structure, JSGlobalObject* globalObject, JSObject* globalThis, 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)
 {
 }
 
@@ -126,14 +133,24 @@
 
 inline JSGlobalObject* JSScope::globalObject()
 { 
-    return structure()->globalObject();
+    return m_globalObject.get();
 }
 
 inline JSGlobalData* JSScope::globalData()
 { 
-    return MarkedBlock::blockFor(this)->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);
+}
+
 inline Register& Register::operator=(JSScope* scope)
 {
     *this = JSValue(scope);

Modified: trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -82,8 +82,8 @@
 protected:
     static const unsigned StructureFlags = OverridesVisitChildren | JSSymbolTableObject::StructureFlags;
 
-    JSSegmentedVariableObject(JSGlobalData& globalData, Structure* structure, JSScope* scope)
-        : JSSymbolTableObject(globalData, structure, scope)
+    JSSegmentedVariableObject(JSGlobalData& globalData, Structure* structure, JSGlobalObject* globalObject, JSObject* globalThis, JSScope* scope)
+        : JSSymbolTableObject(globalData, structure, globalObject, globalThis, scope)
     {
     }
 

Modified: trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -49,8 +49,8 @@
 protected:
     static const unsigned StructureFlags = IsEnvironmentRecord | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
     
-    JSSymbolTableObject(JSGlobalData& globalData, Structure* structure, JSScope* scope)
-        : Base(globalData, structure, scope)
+    JSSymbolTableObject(JSGlobalData& globalData, Structure* structure, JSGlobalObject* globalObject, JSObject* globalThis, JSScope* scope)
+        : Base(globalData, structure, globalObject, globalThis, scope)
     {
     }
 

Modified: trunk/Source/_javascript_Core/runtime/JSVariableObject.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSVariableObject.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSVariableObject.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -60,9 +60,11 @@
             JSGlobalData& globalData,
             Structure* structure,
             Register* registers,
+            JSGlobalObject* globalObject,
+            JSObject* globalThis,
             JSScope* scope
         )
-            : Base(globalData, structure, scope)
+            : Base(globalData, structure, globalObject, globalThis, scope)
             , m_registers(reinterpret_cast<WriteBarrierBase<Unknown>*>(registers))
         {
         }

Modified: trunk/Source/_javascript_Core/runtime/JSWithScope.h (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/JSWithScope.h	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/JSWithScope.h	2012-08-31 20:10:09 UTC (rev 127304)
@@ -26,7 +26,7 @@
 #ifndef JSWithScope_h
 #define JSWithScope_h
 
-#include "JSGlobalObject.h"
+#include "JSScope.h"
 
 namespace JSC {
 
@@ -66,7 +66,9 @@
     JSWithScope(ExecState* exec, JSObject* object)
         : Base(
             exec->globalData(),
-            exec->lexicalGlobalObject()->withScopeStructure(),
+            exec->globalData().withScopeStructure.get(),
+            exec->lexicalGlobalObject(),
+            exec->globalThisValue(),
             exec->scope()
         )
         , m_object(exec->globalData(), this, object)
@@ -76,7 +78,9 @@
     JSWithScope(ExecState* exec, JSObject* object, JSScope* next)
         : Base(
             exec->globalData(),
-            exec->lexicalGlobalObject()->withScopeStructure(),
+            exec->globalData().withScopeStructure.get(),
+            exec->lexicalGlobalObject(),
+            exec->globalThisValue(),
             next
         )
         , m_object(exec->globalData(), this, object)

Modified: trunk/Source/_javascript_Core/runtime/StrictEvalActivation.cpp (127303 => 127304)


--- trunk/Source/_javascript_Core/runtime/StrictEvalActivation.cpp	2012-08-31 19:51:17 UTC (rev 127303)
+++ trunk/Source/_javascript_Core/runtime/StrictEvalActivation.cpp	2012-08-31 20:10:09 UTC (rev 127304)
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "StrictEvalActivation.h"
 
-#include "JSGlobalObject.h"
-
 namespace JSC {
 
 ASSERT_HAS_TRIVIAL_DESTRUCTOR(StrictEvalActivation);
@@ -37,7 +35,9 @@
 StrictEvalActivation::StrictEvalActivation(ExecState* exec)
     : Base(
         exec->globalData(),
-        exec->lexicalGlobalObject()->strictEvalActivationStructure(),
+        exec->globalData().strictEvalActivationStructure.get(),
+        exec->lexicalGlobalObject(),
+        exec->globalThisValue(),
         exec->scope()
     )
 {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to