Changeset 161172 in webkit
- Timestamp:
- Dec 30, 2013, 10:49:49 PM (12 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r161170 r161172 1 2013-12-30 Mark Lam <mark.lam@apple.com> 2 3 CStack: Refactor to split the tracking of the jsStackLimit from the native stackLimit. 4 https://bugs.webkit.org/show_bug.cgi?id=126331. 5 6 Not yet reviewed. 7 8 Previously, when using the C stack for the JS stack, VM::m_jsStackLimit is a union 9 with VM::m_stackLimit. We now separate them into 2 distinct fields but haven't yet 10 changed the computation of the limit values to set them with. 11 12 * interpreter/JSStack.cpp: 13 (JSC::JSStack::updateStackLimit): 14 * runtime/VM.h: 15 * runtime/VMEntryScope.cpp: 16 (JSC::VMEntryScope::VMEntryScope): 17 (JSC::VMEntryScope::~VMEntryScope): 18 (JSC::VMEntryScope::updateStackLimits): 19 (JSC::VMEntryScope::requiredCapacity): 20 * runtime/VMEntryScope.h: 21 1 22 2013-12-30 Mark Lam <mark.lam@apple.com> 2 23 -
branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.cpp
r161169 r161172 206 206 #endif 207 207 if (m_vm.firstEntryScope) 208 m_vm.firstEntryScope->updateStackLimit ();208 m_vm.firstEntryScope->updateStackLimits(); 209 209 } 210 210 -
branches/jsCStack/Source/JavaScriptCore/runtime/VM.h
r161104 r161172 506 506 const ClassInfo* m_initializingObjectClass; 507 507 #endif 508 509 #if ENABLE(LLINT_C_LOOP) 510 struct { 511 void* m_stackLimit; 512 void* m_jsStackLimit; 513 }; 514 #else 515 union { 516 void* m_stackLimit; 517 void* m_jsStackLimit; 518 }; 519 #endif 508 void* m_stackLimit; 509 void* m_jsStackLimit; 520 510 void* m_lastStackTop; 521 511 JSValue m_exception; -
branches/jsCStack/Source/JavaScriptCore/runtime/VMEntryScope.cpp
r161104 r161172 38 38 , m_prevFirstEntryScope(vm.firstEntryScope) 39 39 , m_prevStackLimit(vm.stackLimit()) 40 #if !ENABLE(LLINT_C_LOOP) 41 , m_prevJSStackLimit(vm.jsStackLimit()) 42 #endif 40 43 , m_prevLastStackTop(vm.lastStackTop()) 41 44 { … … 54 57 vm.clearExceptionStack(); 55 58 56 updateStackLimit ();59 updateStackLimits(); 57 60 vm.setLastStackTop(m_stack.origin()); 58 61 } … … 62 65 m_vm.firstEntryScope = m_prevFirstEntryScope; 63 66 m_vm.setStackLimit(m_prevStackLimit); 67 #if !ENABLE(LLINT_C_LOOP) 68 m_vm.setJSStackLimit(m_prevJSStackLimit); 69 #endif 64 70 m_vm.setLastStackTop(m_prevLastStackTop); 65 71 } 66 72 67 void VMEntryScope::updateStackLimit ()73 void VMEntryScope::updateStackLimits() 68 74 { 69 void* limit = m_stack.recursionLimit(requiredCapacity()); 70 m_vm.setStackLimit(limit); 75 #if !ENABLE(LLINT_C_LOOP) 76 void* jsStackLimit = m_stack.recursionLimit(requiredCapacity(JSStackCapacity)); 77 m_vm.setJSStackLimit(jsStackLimit); 78 #endif 79 void* nativeStackLimit = m_stack.recursionLimit(requiredCapacity(NativeStackCapacity)); 80 m_vm.setStackLimit(nativeStackLimit); 71 81 } 72 82 73 size_t VMEntryScope::requiredCapacity( ) const83 size_t VMEntryScope::requiredCapacity(CapacityType type) const 74 84 { 75 Interpreter* interpreter = m_vm.interpreter;85 UNUSED_PARAM(type); 76 86 77 87 // We require a smaller stack budget for the error stack. This is to allow … … 85 95 const size_t errorModeRequiredStack = 64 * KB; 86 96 97 Interpreter* interpreter = m_vm.interpreter; 87 98 size_t requiredCapacity = interpreter->isInErrorHandlingMode() ? errorModeRequiredStack : requiredStack; 88 99 RELEASE_ASSERT(m_stack.size() >= requiredCapacity); -
branches/jsCStack/Source/JavaScriptCore/runtime/VMEntryScope.h
r161104 r161172 41 41 JS_EXPORT_PRIVATE ~VMEntryScope(); 42 42 43 void updateStackLimit ();43 void updateStackLimits(); 44 44 JSGlobalObject* globalObject() const { return m_globalObject; } 45 45 46 46 private: 47 size_t requiredCapacity() const; 47 enum CapacityType { 48 JSStackCapacity, 49 NativeStackCapacity, 50 }; 51 size_t requiredCapacity(CapacityType) const; 48 52 49 53 VM& m_vm; … … 52 56 JSGlobalObject* m_globalObject; 53 57 54 // m_prevFirstEntryScope, m_prevStackLimit & m_prevLastStackTop may belongto a different thread's stack.58 // The following pointers may point to a different thread's stack. 55 59 VMEntryScope* m_prevFirstEntryScope; 56 60 void* m_prevStackLimit; 61 #if !ENABLE(LLINT_C_LOOP) 62 void* m_prevJSStackLimit; 63 #endif 57 64 void* m_prevLastStackTop; 58 65 };
Note:
See TracChangeset
for help on using the changeset viewer.