Changeset 153357 in webkit


Ignore:
Timestamp:
Jul 25, 2013 5:13:13 PM (11 years ago)
Author:
andersca@apple.com
Message:

ASSERT(m_vm->apiLock().currentThreadIsHoldingLock()); fails for Safari on current ToT
https://bugs.webkit.org/show_bug.cgi?id=119108

Reviewed by Mark Hahnenberg.

Add a currentThreadIsHoldingAPILock() function to VM that checks if the current thread is the exclusive API thread.

  • heap/CopiedSpace.cpp:

(JSC::CopiedSpace::tryAllocateSlowCase):

  • heap/Heap.cpp:

(JSC::Heap::protect):
(JSC::Heap::unprotect):
(JSC::Heap::collect):

  • heap/MarkedAllocator.cpp:

(JSC::MarkedAllocator::allocateSlowCase):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

  • runtime/VM.h:

(JSC::VM::currentThreadIsHoldingAPILock):

Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r153354 r153357  
     12013-07-25  Anders Carlsson  <andersca@apple.com>
     2
     3        ASSERT(m_vm->apiLock().currentThreadIsHoldingLock()); fails for Safari on current ToT
     4        https://bugs.webkit.org/show_bug.cgi?id=119108
     5
     6        Reviewed by Mark Hahnenberg.
     7
     8        Add a currentThreadIsHoldingAPILock() function to VM that checks if the current thread is the exclusive API thread.
     9
     10        * heap/CopiedSpace.cpp:
     11        (JSC::CopiedSpace::tryAllocateSlowCase):
     12        * heap/Heap.cpp:
     13        (JSC::Heap::protect):
     14        (JSC::Heap::unprotect):
     15        (JSC::Heap::collect):
     16        * heap/MarkedAllocator.cpp:
     17        (JSC::MarkedAllocator::allocateSlowCase):
     18        * runtime/JSGlobalObject.cpp:
     19        (JSC::JSGlobalObject::init):
     20        * runtime/VM.h:
     21        (JSC::VM::currentThreadIsHoldingAPILock):
     22
    1232013-07-25  Zan Dobersek  <zdobersek@igalia.com>
    224
  • trunk/Source/JavaScriptCore/heap/CopiedSpace.cpp

    r148696 r153357  
    7070        return tryAllocateOversize(bytes, outPtr);
    7171   
    72     ASSERT(m_heap->vm()->apiLock().currentThreadIsHoldingLock());
     72    ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock());
    7373    m_heap->didAllocate(m_allocator.currentCapacity());
    7474
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r153247 r153357  
    168168static inline bool isValidSharedInstanceThreadState(VM* vm)
    169169{
    170     return vm->apiLock().currentThreadIsHoldingLock();
     170    return vm->currentThreadIsHoldingAPILock();
    171171}
    172172
     
    335335{
    336336    ASSERT(k);
    337     ASSERT(m_vm->apiLock().currentThreadIsHoldingLock());
     337    ASSERT(m_vm->currentThreadIsHoldingAPILock());
    338338
    339339    if (!k.isCell())
     
    346346{
    347347    ASSERT(k);
    348     ASSERT(m_vm->apiLock().currentThreadIsHoldingLock());
     348    ASSERT(m_vm->currentThreadIsHoldingAPILock());
    349349
    350350    if (!k.isCell())
     
    712712    RELEASE_ASSERT(!m_deferralDepth);
    713713    GCPHASE(Collect);
    714     ASSERT(vm()->apiLock().currentThreadIsHoldingLock());
     714    ASSERT(vm()->currentThreadIsHoldingAPILock());
    715715    RELEASE_ASSERT(vm()->identifierTable == wtfThreadData().currentIdentifierTable());
    716716    ASSERT(m_isSafeToCollect);
  • trunk/Source/JavaScriptCore/heap/MarkedAllocator.cpp

    r153169 r153357  
    7171void* MarkedAllocator::allocateSlowCase(size_t bytes)
    7272{
    73     ASSERT(m_heap->vm()->apiLock().currentThreadIsHoldingLock());
     73    ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock());
    7474#if COLLECT_ON_EVERY_ALLOCATION
    7575    m_heap->collectAllGarbage();
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r153244 r153357  
    138138void JSGlobalObject::init(JSObject* thisValue)
    139139{
    140     ASSERT(vm().apiLock().currentThreadIsHoldingLock());
     140    ASSERT(vm().currentThreadIsHoldingAPILock());
    141141
    142142    setGlobalThis(vm(), thisValue);
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r153331 r153357  
    469469        }
    470470
     471        bool currentThreadIsHoldingAPILock() const
     472        {
     473            return m_apiLock->currentThreadIsHoldingLock() || exclusiveThread == currentThread();
     474        }
     475
    471476        JSLock& apiLock() { return *m_apiLock; }
    472477        CodeCache* codeCache() { return m_codeCache.get(); }
Note: See TracChangeset for help on using the changeset viewer.