Changeset 232798 in webkit


Ignore:
Timestamp:
Jun 13, 2018 11:32:56 AM (6 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Always use Nuke & Set procedure for x86
https://bugs.webkit.org/show_bug.cgi?id=186592

Reviewed by Keith Miller.

We always use nukeStructureAndStoreButterfly for Contiguous -> ArrayStorage conversion if the architecture is x86.
By doing so, we can concurrently load structure and butterfly at least in x86 environment even in non-collector
threads.

  • runtime/JSObject.cpp:

(JSC::JSObject::convertContiguousToArrayStorage):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r232788 r232798  
     12018-06-13  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] Always use Nuke & Set procedure for x86
     4        https://bugs.webkit.org/show_bug.cgi?id=186592
     5
     6        Reviewed by Keith Miller.
     7
     8        We always use nukeStructureAndStoreButterfly for Contiguous -> ArrayStorage conversion if the architecture is x86.
     9        By doing so, we can concurrently load structure and butterfly at least in x86 environment even in non-collector
     10        threads.
     11
     12        * runtime/JSObject.cpp:
     13        (JSC::JSObject::convertContiguousToArrayStorage):
     14
    1152018-06-12  Saam Barati  <sbarati@apple.com>
    216
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r232337 r232798  
    13451345    }
    13461346   
    1347     Structure* newStructure = Structure::nonPropertyTransition(vm, structure(vm), transition);
     1347    StructureID oldStructureID = this->structureID();
     1348    Structure* oldStructure = vm.getStructure(oldStructureID);
     1349    Structure* newStructure = Structure::nonPropertyTransition(vm, oldStructure, transition);
    13481350
    13491351    // This has a crazy race with the garbage collector. When changing the butterfly and structure,
     
    13581360    //
    13591361    // Fortunately, we have the JSCell lock for this purpose!
    1360    
    1361     if (vm.heap.mutatorShouldBeFenced()) {
    1362         auto locker = holdLock(cellLock());
    1363         setStructureIDDirectly(nuke(structureID()));
    1364         WTF::storeStoreFence();
    1365         m_butterfly.set(vm, this, newStorage->butterfly());
    1366         WTF::storeStoreFence();
    1367         setStructure(vm, newStructure);
    1368     } else {
    1369         m_butterfly.set(vm, this, newStorage->butterfly());
    1370         setStructure(vm, newStructure);
    1371     }
     1362
     1363    Locker<JSCellLock> locker(NoLockingNecessary);
     1364    if (vm.heap.mutatorShouldBeFenced())
     1365        locker = holdLock(cellLock());
     1366    nukeStructureAndSetButterfly(vm, oldStructureID, newStorage->butterfly());
     1367    setStructure(vm, newStructure);
    13721368   
    13731369    return newStorage;
Note: See TracChangeset for help on using the changeset viewer.