Ignore:
Timestamp:
Jan 31, 2018, 10:57:13 AM (7 years ago)
Author:
[email protected]
Message:

Canonicalize aquiring the JSCell lock.
https://bugs.webkit.org/show_bug.cgi?id=182320

Reviewed by Michael Saboff.

It's currently kinda annoying to figure out where
we aquire the a JSCell's lock. This patch adds a
helper to make it easier to grep...

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedCodeBlock::visitChildren):
(JSC::UnlinkedCodeBlock::setInstructions):
(JSC::UnlinkedCodeBlock::shrinkToFit):

  • runtime/ErrorInstance.cpp:

(JSC::ErrorInstance::finishCreation):
(JSC::ErrorInstance::materializeErrorInfoIfNeeded):
(JSC::ErrorInstance::visitChildren):

  • runtime/JSArray.cpp:

(JSC::JSArray::shiftCountWithArrayStorage):
(JSC::JSArray::unshiftCountWithArrayStorage):

  • runtime/JSCell.h:

(JSC::JSCell::cellLock):

  • runtime/JSObject.cpp:

(JSC::JSObject::visitButterflyImpl):
(JSC::JSObject::convertContiguousToArrayStorage):

  • runtime/JSPropertyNameEnumerator.cpp:

(JSC::JSPropertyNameEnumerator::visitChildren):

  • runtime/SparseArrayValueMap.cpp:

(JSC::SparseArrayValueMap::add):
(JSC::SparseArrayValueMap::remove):
(JSC::SparseArrayValueMap::visitChildren):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/SparseArrayValueMap.cpp

    r222473 r227906  
    7878    size_t capacity;
    7979    {
    80         auto locker = holdLock(*this);
     80        auto locker = holdLock(cellLock());
    8181        SparseArrayEntry entry;
    8282        entry.setWithoutWriteBarrier(jsUndefined());
     
    9696void SparseArrayValueMap::remove(iterator it)
    9797{
    98     auto locker = holdLock(*this);
     98    auto locker = holdLock(cellLock());
    9999    m_map.remove(it);
    100100}
     
    102102void SparseArrayValueMap::remove(unsigned i)
    103103{
    104     auto locker = holdLock(*this);
     104    auto locker = holdLock(cellLock());
    105105    m_map.remove(i);
    106106}
     
    198198{
    199199    Base::visitChildren(thisObject, visitor);
    200    
     200
     201    auto locker = holdLock(thisObject->cellLock());
    201202    SparseArrayValueMap* thisMap = jsCast<SparseArrayValueMap*>(thisObject);
    202     auto locker = holdLock(*thisMap);
    203203    iterator end = thisMap->m_map.end();
    204204    for (iterator it = thisMap->m_map.begin(); it != end; ++it)
Note: See TracChangeset for help on using the changeset viewer.