Changeset 163661 in webkit
- Timestamp:
- Feb 7, 2014 4:24:13 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r163648 r163661 1 2014-02-07 Mark Lam <mark.lam@apple.com> 2 3 Fix bug in stack limit adjustments in JSLock. 4 <https://webkit.org/b/128406> 5 6 Reviewed by Geoffrey Garen. 7 8 1. JSLock::unlock() was only clearing the VM::stackPointerAtEntry when 9 m_vm->stackPointerAtVMEntry == entryStackPointer. FYI, 10 entryStackPointer is a field in JSLock. 11 12 When DropAllLocks::~DropAllLocks() will call JSLock::grabAllLocks() 13 to relock the JSLock, JSLock::grabAllLocks() will set a new 14 entryStackPointer value. Thereafter, DropAllLocks::~DropAllLocks() will 15 restore the saved VM::stackPointerAtEntry, which will now defer from 16 the JSLock's entryStackPointer value. 17 18 It turns out that when m_vm->stackPointerAtVMEntry was initialized, 19 it was set to whatever value entryStackPointer is set to. At no time 20 do we ever expect the 2 values to differ. The only time it differs is 21 when this bug manifests. 22 23 The fix is to remove the entryStackPointer field in JSLock and its uses 24 altogether. 25 26 2. DropAllLocks was unconditionally clearing VM::stackPointerAtEntry in 27 its constructor instead of letting JSLock::unlock() do the clearing. 28 29 However, DropAllLocks will not actually drop locks if it isn't required 30 to (e.g. when alwaysDropLocks is DontAlwaysDropLocks), and when we've 31 already drop locks once (i.e. JSLock::m_lockDropDepth is not 0). 32 33 We should not have cleared VM::stackPointerAtEntry here if we don't 34 actually drop the locks. 35 36 * runtime/JSLock.cpp: 37 (JSC::JSLock::unlock): 38 (JSC::JSLock::DropAllLocks::DropAllLocks): 39 1 40 2014-02-07 Joseph Pecoraro <pecoraro@apple.com> 2 41 -
trunk/Source/JavaScriptCore/runtime/JSLock.cpp
r163214 r163661 143 143 144 144 if (!m_lockCount) { 145 if (m_vm && m_vm->stackPointerAtVMEntry == entryStackPointer) {145 if (m_vm) { 146 146 m_vm->stackPointerAtVMEntry = nullptr; 147 147 m_vm->updateStackLimitWithReservedZoneSize(wtfThreadData().savedReservedZoneSize()); … … 313 313 threadData.setSavedReservedZoneSize(m_vm->reservedZoneSize()); 314 314 315 m_vm->stackPointerAtVMEntry = nullptr;316 317 315 if (alwaysDropLocks) 318 316 m_lockCount = m_vm->apiLock().dropAllLocksUnconditionally(spinLock); … … 338 336 threadData.setSavedReservedZoneSize(m_vm->reservedZoneSize()); 339 337 340 m_vm->stackPointerAtVMEntry = nullptr;341 342 338 if (alwaysDropLocks) 343 339 m_lockCount = m_vm->apiLock().dropAllLocksUnconditionally(spinLock);
Note: See TracChangeset
for help on using the changeset viewer.