Changeset 209594 in webkit


Ignore:
Timestamp:
Dec 8, 2016 7:30:03 PM (7 years ago)
Author:
fpizlo@apple.com
Message:

Enable concurrent GC on ARM64
https://bugs.webkit.org/show_bug.cgi?id=165643

Reviewed by Saam Barati.

It looks stable enough to enable.

  • assembler/CPU.h:

(JSC::useGCFences): Deleted.

  • bytecode/PolymorphicAccess.cpp:

(JSC::AccessCase::generateImpl):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::reallocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::mutatorFence):
(JSC::AssemblyHelpers::storeButterfly):
(JSC::AssemblyHelpers::nukeStructureAndStoreButterfly):
(JSC::AssemblyHelpers::emitInitializeInlineStorage):
(JSC::AssemblyHelpers::emitInitializeOutOfLineStorage):

  • runtime/Options.cpp:

(JSC::recomputeDependentOptions):

Location:
trunk/Source/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r209576 r209594  
     12016-12-08  Filip Pizlo  <fpizlo@apple.com>
     2
     3        Enable concurrent GC on ARM64
     4        https://bugs.webkit.org/show_bug.cgi?id=165643
     5
     6        Reviewed by Saam Barati.
     7
     8        It looks stable enough to enable.
     9
     10        * assembler/CPU.h:
     11        (JSC::useGCFences): Deleted.
     12        * bytecode/PolymorphicAccess.cpp:
     13        (JSC::AccessCase::generateImpl):
     14        * dfg/DFGSpeculativeJIT.cpp:
     15        (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
     16        (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
     17        * ftl/FTLLowerDFGToB3.cpp:
     18        (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
     19        (JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
     20        (JSC::FTL::DFG::LowerDFGToB3::reallocatePropertyStorage):
     21        (JSC::FTL::DFG::LowerDFGToB3::allocateObject):
     22        * jit/AssemblyHelpers.h:
     23        (JSC::AssemblyHelpers::mutatorFence):
     24        (JSC::AssemblyHelpers::storeButterfly):
     25        (JSC::AssemblyHelpers::nukeStructureAndStoreButterfly):
     26        (JSC::AssemblyHelpers::emitInitializeInlineStorage):
     27        (JSC::AssemblyHelpers::emitInitializeOutOfLineStorage):
     28        * runtime/Options.cpp:
     29        (JSC::recomputeDependentOptions):
     30
    1312016-12-08  Filip Pizlo  <fpizlo@apple.com>
    232
  • trunk/Source/JavaScriptCore/assembler/CPU.h

    r208860 r209594  
    8686}
    8787
    88 inline bool useGCFences()
    89 {
    90     return isX86();
    91 }
    92 
    9388} // namespace JSC
    9489
  • trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp

    r209570 r209594  
    13021302                }
    13031303               
    1304                 if (useGCFences()) {
    1305                     for (size_t offset = oldSize; offset < newSize; offset += sizeof(void*))
    1306                         jit.storePtr(CCallHelpers::TrustedImmPtr(0), CCallHelpers::Address(scratchGPR, -static_cast<ptrdiff_t>(offset + sizeof(JSValue) + sizeof(void*))));
    1307                 }
     1304                for (size_t offset = oldSize; offset < newSize; offset += sizeof(void*))
     1305                    jit.storePtr(CCallHelpers::TrustedImmPtr(0), CCallHelpers::Address(scratchGPR, -static_cast<ptrdiff_t>(offset + sizeof(JSValue) + sizeof(void*))));
    13081306            } else {
    13091307                // Handle the case where we are allocating out-of-line using an operation.
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r209570 r209594  
    74127412    m_jit.addPtr(JITCompiler::TrustedImm32(size + sizeof(IndexingHeader)), scratchGPR1);
    74137413   
    7414     if (useGCFences()) {
    7415         for (ptrdiff_t offset = 0; offset < static_cast<ptrdiff_t>(size); offset += sizeof(void*))
    7416             m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
    7417     }
     7414    for (ptrdiff_t offset = 0; offset < static_cast<ptrdiff_t>(size); offset += sizeof(void*))
     7415        m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
    74187416       
    74197417    addSlowPathGenerator(
    74207418        slowPathCall(slowPath, this, operationAllocatePropertyStorageWithInitialCapacity, scratchGPR1));
    74217419
    7422     if (useGCFences()) {
    7423         m_jit.store32(TrustedImm32(0), JITCompiler::Address(baseGPR, JSCell::structureIDOffset()));
    7424         m_jit.mutatorFence();
    7425     }
    7426 
    7427     m_jit.storePtr(scratchGPR1, JITCompiler::Address(baseGPR, JSObject::butterflyOffset()));
    7428     m_jit.mutatorFence();
     7420    m_jit.store32(TrustedImm32(0), JITCompiler::Address(baseGPR, JSCell::structureIDOffset()));
     7421    m_jit.storeButterfly(scratchGPR1, baseGPR);
    74297422
    74307423    storageResult(scratchGPR1, node);
     
    74727465    m_jit.addPtr(JITCompiler::TrustedImm32(newSize + sizeof(IndexingHeader)), scratchGPR1);
    74737466       
    7474     if (useGCFences()) {
    7475         for (ptrdiff_t offset = oldSize; offset < static_cast<ptrdiff_t>(newSize); offset += sizeof(void*))
    7476             m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
    7477     }
     7467    for (ptrdiff_t offset = oldSize; offset < static_cast<ptrdiff_t>(newSize); offset += sizeof(void*))
     7468        m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
    74787469
    74797470    addSlowPathGenerator(
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r209570 r209594  
    86048604                ValueFromBlock haveButterfly = m_out.anchor(fastButterflyValue);
    86058605               
    8606                 if (useGCFences()) {
    8607                     splatWords(
    8608                         fastButterflyValue,
    8609                         m_out.constInt32(-structure->outOfLineCapacity() - 1),
    8610                         m_out.constInt32(-1),
    8611                         m_out.int64Zero, m_heaps.properties.atAnyNumber());
    8612                 }
     8606                splatWords(
     8607                    fastButterflyValue,
     8608                    m_out.constInt32(-structure->outOfLineCapacity() - 1),
     8609                    m_out.constInt32(-1),
     8610                    m_out.int64Zero, m_heaps.properties.atAnyNumber());
    86138611
    86148612                m_out.store32(vectorLength, fastButterflyValue, m_heaps.Butterfly_vectorLength);
     
    94859483        LValue result = allocatePropertyStorageWithSizeImpl(initialOutOfLineCapacity);
    94869484
    9487         if (useGCFences()) {
    9488             splatWords(
    9489                 result,
    9490                 m_out.constInt32(-initialOutOfLineCapacity - 1), m_out.constInt32(-1),
    9491                 m_out.int64Zero, m_heaps.properties.atAnyNumber());
    9492         }
     9485        splatWords(
     9486            result,
     9487            m_out.constInt32(-initialOutOfLineCapacity - 1), m_out.constInt32(-1),
     9488            m_out.int64Zero, m_heaps.properties.atAnyNumber());
    94939489       
    94949490        nukeStructureAndSetButterfly(result, object);
     
    95209516        }
    95219517       
    9522         if (useGCFences()) {
    9523             splatWords(
    9524                 result,
    9525                 m_out.constInt32(-newSize - 1), m_out.constInt32(-oldSize - 1),
    9526                 m_out.int64Zero, m_heaps.properties.atAnyNumber());
    9527         }
     9518        splatWords(
     9519            result,
     9520            m_out.constInt32(-newSize - 1), m_out.constInt32(-oldSize - 1),
     9521            m_out.int64Zero, m_heaps.properties.atAnyNumber());
    95289522       
    95299523        nukeStructureAndSetButterfly(result, object);
     
    1040210396    {
    1040310397        LValue result = allocateCell(allocator, structure, slowPath);
    10404         if (useGCFences()) {
    10405             splatWords(
    10406                 result,
    10407                 m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8),
    10408                 m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8 + structure->inlineCapacity()),
    10409                 m_out.int64Zero,
    10410                 m_heaps.properties.atAnyNumber());
    10411         }
     10398        splatWords(
     10399            result,
     10400            m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8),
     10401            m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8 + structure->inlineCapacity()),
     10402            m_out.int64Zero,
     10403            m_heaps.properties.atAnyNumber());
    1041210404        m_out.storePtr(butterfly, result, m_heaps.JSObject_butterfly);
    1041310405        return result;
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h

    r209570 r209594  
    13641364    void mutatorFence()
    13651365    {
    1366         if (isX86() || !useGCFences())
     1366        if (isX86())
    13671367            return;
    13681368        Jump ok = jumpIfMutatorFenceNotNeeded();
     
    13731373    void storeButterfly(GPRReg butterfly, GPRReg object)
    13741374    {
    1375         if (isX86() || !useGCFences()) {
     1375        if (isX86()) {
    13761376            storePtr(butterfly, Address(object, JSObject::butterflyOffset()));
    13771377            return;
     
    13901390    void nukeStructureAndStoreButterfly(GPRReg butterfly, GPRReg object)
    13911391    {
    1392         if (isX86() || !useGCFences()) {
     1392        if (isX86()) {
    13931393            or32(TrustedImm32(bitwise_cast<int32_t>(nukedStructureIDBit())), Address(object, JSCell::structureIDOffset()));
    13941394            storePtr(butterfly, Address(object, JSObject::butterflyOffset()));
     
    16381638    void emitInitializeInlineStorage(GPRReg baseGPR, unsigned inlineCapacity)
    16391639    {
    1640         if (!useGCFences())
    1641             return;
    16421640        for (unsigned i = 0; i < inlineCapacity; ++i)
    16431641            storeTrustedValue(JSValue(), Address(baseGPR, JSObject::offsetOfInlineStorage() + i * sizeof(EncodedJSValue)));
     
    16461644    void emitInitializeInlineStorage(GPRReg baseGPR, GPRReg inlineCapacity)
    16471645    {
    1648         if (!useGCFences())
    1649             return;
    16501646        Jump empty = branchTest32(Zero, inlineCapacity);
    16511647        Label loop = label();
     
    16581654    void emitInitializeOutOfLineStorage(GPRReg butterflyGPR, unsigned outOfLineCapacity)
    16591655    {
    1660         if (!useGCFences())
    1661             return;
    16621656        for (unsigned i = 0; i < outOfLineCapacity; ++i)
    16631657            storeTrustedValue(JSValue(), Address(butterflyGPR, -sizeof(IndexingHeader) - (i + 1) * sizeof(EncodedJSValue)));
  • trunk/Source/JavaScriptCore/runtime/Options.cpp

    r209576 r209594  
    333333#endif
    334334   
    335 #if !CPU(X86_64)
     335#if !CPU(X86_64) && !CPU(ARM64)
    336336    Options::useConcurrentGC() = false;
    337337#endif
Note: See TracChangeset for help on using the changeset viewer.