Remove StackBounds from JSGlobalData
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 21:36:18 +0000 (21:36 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jan 2012 21:36:18 +0000 (21:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76310

Reviewed by Sam Weinig.

Removed StackBounds and the stack() function from JSGlobalData since it no
longer accessed any members of JSGlobalData.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::gatherFromCurrentThread):
* parser/Parser.cpp:
(JSC::::Parser):
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):
* runtime/JSGlobalData.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105638 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/heap/MachineStackMarker.cpp
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/runtime/JSGlobalData.cpp
Source/JavaScriptCore/runtime/JSGlobalData.h

index e35340d..da15fc6 100644 (file)
@@ -1,3 +1,24 @@
+2012-01-23  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Remove StackBounds from JSGlobalData
+        https://bugs.webkit.org/show_bug.cgi?id=76310
+
+        Reviewed by Sam Weinig.
+
+        Removed StackBounds and the stack() function from JSGlobalData since it no 
+        longer accessed any members of JSGlobalData.
+
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        * heap/MachineStackMarker.cpp:
+        (JSC::MachineThreads::addCurrentThread):
+        (JSC::MachineThreads::gatherFromCurrentThread):
+        * parser/Parser.cpp:
+        (JSC::::Parser):
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::JSGlobalData):
+        * runtime/JSGlobalData.h:
+
 2012-01-23  Gavin Barraclough  <barraclough@apple.com>
 
         Implement a JIT-code aware sampling profiler for JSC
index 631290e..2b1c164 100644 (file)
@@ -217,7 +217,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, ScopeChainNode* s
 #ifndef NDEBUG
     , m_lastOpcodePosition(0)
 #endif
-    , m_stack(m_globalData->stack())
+    , m_stack(wtfThreadData().stack())
     , m_usesExceptions(false)
     , m_expressionTooDeep(false)
 {
@@ -288,7 +288,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, ScopeChainN
 #ifndef NDEBUG
     , m_lastOpcodePosition(0)
 #endif
-    , m_stack(m_globalData->stack())
+    , m_stack(wtfThreadData().stack())
     , m_usesExceptions(false)
     , m_expressionTooDeep(false)
 {
@@ -449,7 +449,7 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, ScopeChainNode* scopeCh
 #ifndef NDEBUG
     , m_lastOpcodePosition(0)
 #endif
-    , m_stack(m_globalData->stack())
+    , m_stack(wtfThreadData().stack())
     , m_usesExceptions(false)
     , m_expressionTooDeep(false)
 {
index f62ee06..fd828d5 100644 (file)
@@ -193,7 +193,7 @@ void MachineThreads::addCurrentThread()
         return;
 
     pthread_setspecific(m_threadSpecific, this);
-    Thread* thread = new Thread(getCurrentPlatformThread(), m_heap->globalData()->stack().origin());
+    Thread* thread = new Thread(getCurrentPlatformThread(), wtfThreadData().stack().origin());
 
     MutexLocker lock(m_registeredThreadsMutex);
 
@@ -257,7 +257,7 @@ void MachineThreads::gatherFromCurrentThread(ConservativeRoots& conservativeRoot
     conservativeRoots.add(registersBegin, registersEnd);
 
     void* stackBegin = stackCurrent;
-    void* stackEnd = m_heap->globalData()->stack().origin();
+    void* stackEnd = wtfThreadData().stack().origin();
     swapIfBackwards(stackBegin, stackEnd);
     conservativeRoots.add(stackBegin, stackEnd);
 }
index 5c2f038..473661c 100644 (file)
@@ -43,7 +43,7 @@ template <typename LexerType>
 Parser<LexerType>::Parser(JSGlobalData* globalData, const SourceCode& source, FunctionParameters* parameters, JSParserStrictness strictness, JSParserMode parserMode)
     : m_globalData(globalData)
     , m_source(&source)
-    , m_stack(globalData->stack())
+    , m_stack(wtfThreadData().stack())
     , m_error(false)
     , m_errorMessage("Parse error")
     , m_allowsIn(true)
index 508c51e..bbe520a 100644 (file)
@@ -162,8 +162,6 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread
 #endif
 {
     interpreter = new Interpreter;
-    if (globalDataType == Default)
-        m_stack = wtfThreadData().stack();
 
     // Need to be careful to keep everything consistent here
     IdentifierTable* existingEntryIdentifierTable = wtfThreadData().setCurrentIdentifierTable(identifierTable);
index e61858e..92817f2 100644 (file)
@@ -223,13 +223,6 @@ namespace JSC {
         bool canUseJIT() { return m_canUseJIT; }
 #endif
 
-        const StackBounds& stack()
-        {
-            return (globalDataType == Default)
-                ? m_stack
-                : wtfThreadData().stack();
-        }
-
         OwnPtr<ParserArena> parserArena;
         OwnPtr<Keywords> keywords;
         Interpreter* interpreter;
@@ -359,7 +352,6 @@ namespace JSC {
 #if ENABLE(JIT) && ENABLE(INTERPRETER)
         bool m_canUseJIT;
 #endif
-        StackBounds m_stack;
 #if ENABLE(GC_VALIDATION)
         bool m_isInitializingObject;
 #endif