Ignore:
Timestamp:
Feb 9, 2022, 5:50:04 PM (3 years ago)
Author:
[email protected]
Message:

Use local variable pointer for concurrently load value
https://bugs.webkit.org/show_bug.cgi?id=236387

Reviewed by Saam Barati.

Consistently using local pointer to load member fields in

  1. WriteBarrierStructureID
  2. JSString's fiber
  3. Weak
  4. WriteBarrier<SomeKindOfCell>

to encourage compilers not to load the field twice.

  • heap/Weak.cpp:

(JSC::weakClearSlowCase):

  • heap/Weak.h:

(JSC::Weak::isHashTableEmptyValue const):
(JSC::Weak::unsafeImpl const):
(JSC::Weak::clear):
(JSC::Weak::impl const):

  • heap/WeakInlines.h:

(JSC::Weak<T>::isHashTableDeletedValue const):
(JSC:: const):
(JSC::Weak<T>::operator const):
(JSC::Weak<T>::get const):
(JSC::Weak<T>::leakImpl):

  • runtime/JSString.cpp:

(JSC::JSString::dumpToStream):
(JSC::JSString::estimatedSize):
(JSC::JSString::visitChildrenImpl):

  • runtime/JSString.h:

(JSC::JSString::fiberConcurrently const):
(JSC::JSString::is8Bit const):
(JSC::JSString::length const):
(JSC::JSString::tryGetValueImpl const):
(JSC::JSString::isSubstring const):

  • runtime/WriteBarrier.h:

(JSC::WriteBarrierBase::get const):
(JSC::WriteBarrierBase::operator* const):
(JSC::WriteBarrierBase::operator-> const):
(JSC::WriteBarrierBase::operator bool const):
(JSC::WriteBarrierBase::operator! const):
(JSC::WriteBarrierBase::unvalidatedGet const):
(JSC::WriteBarrierBase::cell const):
(JSC::WriteBarrierStructureID::get const):
(JSC::WriteBarrierStructureID::operator* const):
(JSC::WriteBarrierStructureID::operator-> const):
(JSC::WriteBarrierStructureID::operator bool const):
(JSC::WriteBarrierStructureID::operator! const):
(JSC::WriteBarrierStructureID::unvalidatedGet const):

File:
1 edited

Legend:

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

    r288537 r289515  
    6969    const JSString* thisObject = jsCast<const JSString*>(cell);
    7070    out.printf("<%p, %s, [%u], ", thisObject, thisObject->className(vm), thisObject->length());
    71     uintptr_t pointer = thisObject->m_fiber;
     71    uintptr_t pointer = thisObject->fiberConcurrently();
    7272    if (pointer & isRopeInPointer) {
    7373        if (pointer & JSRopeString::isSubstringInPointer)
     
    104104{
    105105    JSString* thisObject = asString(cell);
    106     uintptr_t pointer = thisObject->m_fiber;
     106    uintptr_t pointer = thisObject->fiberConcurrently();
    107107    if (pointer & isRopeInPointer)
    108108        return Base::estimatedSize(cell, vm);
     
    117117    Base::visitChildren(thisObject, visitor);
    118118   
    119     uintptr_t pointer = thisObject->m_fiber;
     119    uintptr_t pointer = thisObject->fiberConcurrently();
    120120    if (pointer & isRopeInPointer) {
    121121        if (pointer & JSRopeString::isSubstringInPointer) {
Note: See TracChangeset for help on using the changeset viewer.