Changeset 161170 in webkit
- Timestamp:
- Dec 30, 2013 9:41:48 PM (10 years ago)
- Location:
- branches/jsCStack/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/jsCStack/Source/JavaScriptCore/ChangeLog
r161169 r161170 1 2013-12-30 Mark Lam <mark.lam@apple.com> 2 3 CStack: Fix JSStack::ensureCapacity() to match LLINT and JIT stack checks. 4 https://bugs.webkit.org/show_bug.cgi?id=126328. 5 6 Not yet reviewed. 7 8 Also removed the now unused JSSTack::topOfStackForCapacityCheck(). 9 10 * interpreter/JSStack.h: 11 * interpreter/JSStackInlines.h: 12 (JSC::JSStack::ensureCapacityFor): 13 1 14 2013-12-30 Mark Lam <mark.lam@apple.com> 2 15 -
branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h
r161169 r161170 128 128 inline Register* topOfFrameFor(CallFrame*); 129 129 inline Register* topOfStack(); 130 inline Register* topOfStackForCapacityCheck();131 130 132 131 #if ENABLE(LLINT_C_LOOP) -
branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h
r161038 r161170 40 40 #else 41 41 ASSERT(wtfThreadData().stack().isGrowingDownward()); 42 Register* topOfStack = topOfStackForCapacityCheck(); 43 if (newTopOfStack > topOfStack) 44 return true; 45 size_t neededCapacity = (topOfStack - newTopOfStack) * sizeof(Register); 46 return m_vm.isSafeToRecurse(neededCapacity); 47 #endif 48 } 49 50 inline Register* JSStack::topOfStackForCapacityCheck() 51 { 52 #if !ENABLE(LLINT_C_LOOP) 53 // We're trying to get an estimate of the top of the stack for the purpose 54 // of a capacity check. If m_topCallFrame is 0, then we can't calculate an 55 // accurate top of stack value. Just use the current stack position as an 56 // estimate for the top of the stack from where JS code will start executing. 57 // This is conservative, but it will be safe. 58 if (!m_topCallFrame) { 59 Register* p = reinterpret_cast<Register*>(&p); 60 return p; 61 } 62 #endif 63 return topOfStack() + 1; 42 return newTopOfStack >= m_vm.jsStackLimit(); 43 #endif 64 44 } 65 45
Note: See TracChangeset
for help on using the changeset viewer.