Title: [127363] trunk/Source/_javascript_Core
Revision
127363
Author
[email protected]
Date
2012-09-01 00:45:01 -0700 (Sat, 01 Sep 2012)

Log Message

2012-09-01  Geoffrey Garen  <[email protected]>

        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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (127362 => 127363)


--- trunk/Source/_javascript_Core/ChangeLog	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-09-01 07:45:01 UTC (rev 127363)
@@ -1,5 +1,46 @@
 2012-09-01  Geoffrey Garen  <[email protected]>
 
+        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  <[email protected]>
+
         Rolled back out a piece of <http://trac.webkit.org/changeset/127293>
         because it broke Window inspector tests.
 

Modified: trunk/Source/_javascript_Core/runtime/JSActivation.cpp (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSActivation.cpp	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSActivation.cpp	2012-09-01 07:45:01 UTC (rev 127363)
@@ -46,8 +46,6 @@
         callFrame->globalData(),
         callFrame->lexicalGlobalObject()->activationStructure(),
         callFrame->registers(),
-        callFrame->lexicalGlobalObject(),
-        callFrame->globalThisValue(),
         callFrame->scope()
     )
     , m_registerArray(callFrame->globalData(), this, 0)

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp	2012-09-01 07:45:01 UTC (rev 127363)
@@ -109,7 +109,7 @@
 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 @@
     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 @@
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     Base::visitChildren(thisObject, visitor);
 
+    visitor.append(&thisObject->m_globalThis);
     visitor.append(&thisObject->m_methodCallDummy);
 
     visitor.append(&thisObject->m_regExpConstructor);

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.h (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.h	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.h	2012-09-01 07:45:01 UTC (rev 127363)
@@ -94,6 +94,7 @@
 
         Register m_globalCallFrame[RegisterFile::CallFrameHeaderSize];
 
+        WriteBarrier<JSObject> m_globalThis;
         WriteBarrier<JSObject> m_methodCallDummy;
 
         WriteBarrier<RegExpConstructor> m_regExpConstructor;
@@ -309,6 +310,7 @@
         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 @@
         // 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 @@
         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 (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSNameScope.h	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSNameScope.h	2012-09-01 07:45:01 UTC (rev 127363)
@@ -69,8 +69,6 @@
             exec->globalData(),
             exec->lexicalGlobalObject()->nameScopeStructure(),
             reinterpret_cast<Register*>(&m_registerStore + 1),
-            exec->lexicalGlobalObject(),
-            exec->globalThisValue(),
             exec->scope()
         )
     {

Modified: trunk/Source/_javascript_Core/runtime/JSScope.cpp (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSScope.cpp	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSScope.cpp	2012-09-01 07:45:01 UTC (rev 127363)
@@ -44,8 +44,6 @@
 
     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 (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSScope.h	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSScope.h	2012-09-01 07:45:01 UTC (rev 127363)
@@ -73,25 +73,18 @@
     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,24 +126,14 @@
 
 inline JSGlobalObject* JSScope::globalObject()
 { 
-    return m_globalObject.get();
+    return structure()->globalObject();
 }
 
 inline JSGlobalData* JSScope::globalData()
 { 
-    return m_globalData;
+    return Heap::heap(this)->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 (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.h	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSSegmentedVariableObject.h	2012-09-01 07:45:01 UTC (rev 127363)
@@ -82,8 +82,8 @@
 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)
     {
     }
 

Modified: trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h	2012-09-01 07:45:01 UTC (rev 127363)
@@ -49,8 +49,8 @@
 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)
     {
     }
 

Modified: trunk/Source/_javascript_Core/runtime/JSVariableObject.h (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSVariableObject.h	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSVariableObject.h	2012-09-01 07:45:01 UTC (rev 127363)
@@ -60,11 +60,9 @@
             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))
         {
         }

Modified: trunk/Source/_javascript_Core/runtime/JSWithScope.h (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/JSWithScope.h	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/JSWithScope.h	2012-09-01 07:45:01 UTC (rev 127363)
@@ -67,8 +67,6 @@
         : Base(
             exec->globalData(),
             exec->lexicalGlobalObject()->withScopeStructure(),
-            exec->lexicalGlobalObject(),
-            exec->globalThisValue(),
             exec->scope()
         )
         , m_object(exec->globalData(), this, object)
@@ -79,8 +77,6 @@
         : Base(
             exec->globalData(),
             exec->lexicalGlobalObject()->withScopeStructure(),
-            exec->lexicalGlobalObject(),
-            exec->globalThisValue(),
             next
         )
         , m_object(exec->globalData(), this, object)

Modified: trunk/Source/_javascript_Core/runtime/StrictEvalActivation.cpp (127362 => 127363)


--- trunk/Source/_javascript_Core/runtime/StrictEvalActivation.cpp	2012-09-01 07:38:12 UTC (rev 127362)
+++ trunk/Source/_javascript_Core/runtime/StrictEvalActivation.cpp	2012-09-01 07:45:01 UTC (rev 127363)
@@ -38,8 +38,6 @@
     : Base(
         exec->globalData(),
         exec->lexicalGlobalObject()->strictEvalActivationStructure(),
-        exec->lexicalGlobalObject(),
-        exec->globalThisValue(),
         exec->scope()
     )
 {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to