Changeset 171558 in webkit


Ignore:
Timestamp:
Jul 24, 2014 4:56:34 PM (10 years ago)
Author:
Joseph Pecoraro
Message:

JSLock release should only modify the AtomicStringTable if it modified in acquire
https://bugs.webkit.org/show_bug.cgi?id=135143

Reviewed by Darin Adler.

  • runtime/JSLock.cpp:

(JSC::JSLock::JSLock):
Initialize the member variable to nullptr.

(JSC::JSLock::willDestroyVM):
Update style to use nullptr instead of 0.

(JSC::JSLock::willReleaseLock):
We should only reset the thread data's atomic string table if
didAcquireLock changed it. m_entryAtomicStringTable will have
been set by didAcquireLock if it changed, or nullptr if it didn't.
This way we are sure we are balanced, regardless of m_vm changes.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r171557 r171558  
     12014-07-24  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        JSLock release should only modify the AtomicStringTable if it modified in acquire
     4        https://bugs.webkit.org/show_bug.cgi?id=135143
     5
     6        Reviewed by Darin Adler.
     7
     8        * runtime/JSLock.cpp:
     9        (JSC::JSLock::JSLock):
     10        Initialize the member variable to nullptr.
     11
     12        (JSC::JSLock::willDestroyVM):
     13        Update style to use nullptr instead of 0.
     14
     15        (JSC::JSLock::willReleaseLock):
     16        We should only reset the thread data's atomic string table if
     17        didAcquireLock changed it. m_entryAtomicStringTable will have
     18        been set by didAcquireLock if it changed, or nullptr if it didn't.
     19        This way we are sure we are balanced, regardless of m_vm changes.
     20
    1212014-07-24  Peyton Randolph  <prandolph@apple.com>
    222
  • trunk/Source/JavaScriptCore/runtime/JSLock.cpp

    r171474 r171558  
    8484    , m_hasExclusiveThread(false)
    8585    , m_vm(vm)
     86    , m_entryAtomicStringTable(nullptr)
    8687{
    8788}
     
    9495{
    9596    ASSERT_UNUSED(vm, m_vm == vm);
    96     m_vm = 0;
     97    m_vm = nullptr;
    9798}
    9899
     
    140141    m_vm->setLastStackTop(threadData.savedLastStackTop());
    141142
     143    ASSERT(!m_entryAtomicStringTable);
    142144    m_entryAtomicStringTable = threadData.setCurrentAtomicStringTable(m_vm->atomicStringTable());
     145    ASSERT(m_entryAtomicStringTable);
     146
    143147    m_vm->heap.machineThreads().addCurrentThread();
    144148}
     
    171175        m_vm->setStackPointerAtVMEntry(nullptr);
    172176
    173     wtfThreadData().setCurrentAtomicStringTable(m_entryAtomicStringTable);
     177    if (m_entryAtomicStringTable) {
     178        wtfThreadData().setCurrentAtomicStringTable(m_entryAtomicStringTable);
     179        m_entryAtomicStringTable = nullptr;
     180    }
    174181}
    175182
Note: See TracChangeset for help on using the changeset viewer.