Title: [209594] trunk/Source/_javascript_Core
Revision
209594
Author
fpi...@apple.com
Date
2016-12-08 19:30:03 -0800 (Thu, 08 Dec 2016)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (209593 => 209594)


--- trunk/Source/_javascript_Core/ChangeLog	2016-12-09 03:10:02 UTC (rev 209593)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-12-09 03:30:03 UTC (rev 209594)
@@ -1,5 +1,35 @@
 2016-12-08  Filip Pizlo  <fpi...@apple.com>
 
+        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):
+
+2016-12-08  Filip Pizlo  <fpi...@apple.com>
+
         Disable collectContinuously if not useConcurrentGC
 
         Rubber stamped by Geoffrey Garen.

Modified: trunk/Source/_javascript_Core/assembler/CPU.h (209593 => 209594)


--- trunk/Source/_javascript_Core/assembler/CPU.h	2016-12-09 03:10:02 UTC (rev 209593)
+++ trunk/Source/_javascript_Core/assembler/CPU.h	2016-12-09 03:30:03 UTC (rev 209594)
@@ -85,10 +85,5 @@
     return isX86_64() && Options::useArchitectureSpecificOptimizations();
 }
 
-inline bool useGCFences()
-{
-    return isX86();
-}
-
 } // namespace JSC
 

Modified: trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp (209593 => 209594)


--- trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp	2016-12-09 03:10:02 UTC (rev 209593)
+++ trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp	2016-12-09 03:30:03 UTC (rev 209594)
@@ -1301,10 +1301,8 @@
                     }
                 }
                 
-                if (useGCFences()) {
-                    for (size_t offset = oldSize; offset < newSize; offset += sizeof(void*))
-                        jit.storePtr(CCallHelpers::TrustedImmPtr(0), CCallHelpers::Address(scratchGPR, -static_cast<ptrdiff_t>(offset + sizeof(JSValue) + sizeof(void*))));
-                }
+                for (size_t offset = oldSize; offset < newSize; offset += sizeof(void*))
+                    jit.storePtr(CCallHelpers::TrustedImmPtr(0), CCallHelpers::Address(scratchGPR, -static_cast<ptrdiff_t>(offset + sizeof(JSValue) + sizeof(void*))));
             } else {
                 // Handle the case where we are allocating out-of-line using an operation.
                 RegisterSet extraRegistersToPreserve;

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (209593 => 209594)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2016-12-09 03:10:02 UTC (rev 209593)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2016-12-09 03:30:03 UTC (rev 209594)
@@ -7411,22 +7411,15 @@
     m_jit.emitAllocate(scratchGPR1, allocator, scratchGPR2, scratchGPR3, slowPath);
     m_jit.addPtr(JITCompiler::TrustedImm32(size + sizeof(IndexingHeader)), scratchGPR1);
     
-    if (useGCFences()) {
-        for (ptrdiff_t offset = 0; offset < static_cast<ptrdiff_t>(size); offset += sizeof(void*))
-            m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
-    }
+    for (ptrdiff_t offset = 0; offset < static_cast<ptrdiff_t>(size); offset += sizeof(void*))
+        m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
         
     addSlowPathGenerator(
         slowPathCall(slowPath, this, operationAllocatePropertyStorageWithInitialCapacity, scratchGPR1));
 
-    if (useGCFences()) {
-        m_jit.store32(TrustedImm32(0), JITCompiler::Address(baseGPR, JSCell::structureIDOffset()));
-        m_jit.mutatorFence();
-    }
+    m_jit.store32(TrustedImm32(0), JITCompiler::Address(baseGPR, JSCell::structureIDOffset()));
+    m_jit.storeButterfly(scratchGPR1, baseGPR);
 
-    m_jit.storePtr(scratchGPR1, JITCompiler::Address(baseGPR, JSObject::butterflyOffset()));
-    m_jit.mutatorFence();
-
     storageResult(scratchGPR1, node);
 }
 
@@ -7471,10 +7464,8 @@
     
     m_jit.addPtr(JITCompiler::TrustedImm32(newSize + sizeof(IndexingHeader)), scratchGPR1);
         
-    if (useGCFences()) {
-        for (ptrdiff_t offset = oldSize; offset < static_cast<ptrdiff_t>(newSize); offset += sizeof(void*))
-            m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
-    }
+    for (ptrdiff_t offset = oldSize; offset < static_cast<ptrdiff_t>(newSize); offset += sizeof(void*))
+        m_jit.storePtr(TrustedImmPtr(0), JITCompiler::Address(scratchGPR1, -(offset + sizeof(JSValue) + sizeof(void*))));
 
     addSlowPathGenerator(
         slowPathCall(slowPath, this, operationAllocatePropertyStorage, scratchGPR1, newSize / sizeof(JSValue)));

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (209593 => 209594)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2016-12-09 03:10:02 UTC (rev 209593)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2016-12-09 03:30:03 UTC (rev 209594)
@@ -8603,13 +8603,11 @@
                 
                 ValueFromBlock haveButterfly = m_out.anchor(fastButterflyValue);
                 
-                if (useGCFences()) {
-                    splatWords(
-                        fastButterflyValue,
-                        m_out.constInt32(-structure->outOfLineCapacity() - 1),
-                        m_out.constInt32(-1),
-                        m_out.int64Zero, m_heaps.properties.atAnyNumber());
-                }
+                splatWords(
+                    fastButterflyValue,
+                    m_out.constInt32(-structure->outOfLineCapacity() - 1),
+                    m_out.constInt32(-1),
+                    m_out.int64Zero, m_heaps.properties.atAnyNumber());
 
                 m_out.store32(vectorLength, fastButterflyValue, m_heaps.Butterfly_vectorLength);
                 
@@ -9484,12 +9482,10 @@
         
         LValue result = allocatePropertyStorageWithSizeImpl(initialOutOfLineCapacity);
 
-        if (useGCFences()) {
-            splatWords(
-                result,
-                m_out.constInt32(-initialOutOfLineCapacity - 1), m_out.constInt32(-1),
-                m_out.int64Zero, m_heaps.properties.atAnyNumber());
-        }
+        splatWords(
+            result,
+            m_out.constInt32(-initialOutOfLineCapacity - 1), m_out.constInt32(-1),
+            m_out.int64Zero, m_heaps.properties.atAnyNumber());
         
         nukeStructureAndSetButterfly(result, object);
         return result;
@@ -9519,12 +9515,10 @@
             m_out.storePtr(loaded, m_out.address(m_heaps.properties.atAnyNumber(), result, offset));
         }
         
-        if (useGCFences()) {
-            splatWords(
-                result,
-                m_out.constInt32(-newSize - 1), m_out.constInt32(-oldSize - 1),
-                m_out.int64Zero, m_heaps.properties.atAnyNumber());
-        }
+        splatWords(
+            result,
+            m_out.constInt32(-newSize - 1), m_out.constInt32(-oldSize - 1),
+            m_out.int64Zero, m_heaps.properties.atAnyNumber());
         
         nukeStructureAndSetButterfly(result, object);
         
@@ -10401,14 +10395,12 @@
         LValue allocator, Structure* structure, LValue butterfly, LBasicBlock slowPath)
     {
         LValue result = allocateCell(allocator, structure, slowPath);
-        if (useGCFences()) {
-            splatWords(
-                result,
-                m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8),
-                m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8 + structure->inlineCapacity()),
-                m_out.int64Zero,
-                m_heaps.properties.atAnyNumber());
-        }
+        splatWords(
+            result,
+            m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8),
+            m_out.constInt32(JSFinalObject::offsetOfInlineStorage() / 8 + structure->inlineCapacity()),
+            m_out.int64Zero,
+            m_heaps.properties.atAnyNumber());
         m_out.storePtr(butterfly, result, m_heaps.JSObject_butterfly);
         return result;
     }

Modified: trunk/Source/_javascript_Core/jit/AssemblyHelpers.h (209593 => 209594)


--- trunk/Source/_javascript_Core/jit/AssemblyHelpers.h	2016-12-09 03:10:02 UTC (rev 209593)
+++ trunk/Source/_javascript_Core/jit/AssemblyHelpers.h	2016-12-09 03:30:03 UTC (rev 209594)
@@ -1363,7 +1363,7 @@
     
     void mutatorFence()
     {
-        if (isX86() || !useGCFences())
+        if (isX86())
             return;
         Jump ok = jumpIfMutatorFenceNotNeeded();
         storeFence();
@@ -1372,7 +1372,7 @@
     
     void storeButterfly(GPRReg butterfly, GPRReg object)
     {
-        if (isX86() || !useGCFences()) {
+        if (isX86()) {
             storePtr(butterfly, Address(object, JSObject::butterflyOffset()));
             return;
         }
@@ -1389,7 +1389,7 @@
     
     void nukeStructureAndStoreButterfly(GPRReg butterfly, GPRReg object)
     {
-        if (isX86() || !useGCFences()) {
+        if (isX86()) {
             or32(TrustedImm32(bitwise_cast<int32_t>(nukedStructureIDBit())), Address(object, JSCell::structureIDOffset()));
             storePtr(butterfly, Address(object, JSObject::butterflyOffset()));
             return;
@@ -1637,8 +1637,6 @@
     
     void emitInitializeInlineStorage(GPRReg baseGPR, unsigned inlineCapacity)
     {
-        if (!useGCFences())
-            return;
         for (unsigned i = 0; i < inlineCapacity; ++i)
             storeTrustedValue(JSValue(), Address(baseGPR, JSObject::offsetOfInlineStorage() + i * sizeof(EncodedJSValue)));
     }
@@ -1645,8 +1643,6 @@
 
     void emitInitializeInlineStorage(GPRReg baseGPR, GPRReg inlineCapacity)
     {
-        if (!useGCFences())
-            return;
         Jump empty = branchTest32(Zero, inlineCapacity);
         Label loop = label();
         sub32(TrustedImm32(1), inlineCapacity);
@@ -1657,8 +1653,6 @@
 
     void emitInitializeOutOfLineStorage(GPRReg butterflyGPR, unsigned outOfLineCapacity)
     {
-        if (!useGCFences())
-            return;
         for (unsigned i = 0; i < outOfLineCapacity; ++i)
             storeTrustedValue(JSValue(), Address(butterflyGPR, -sizeof(IndexingHeader) - (i + 1) * sizeof(EncodedJSValue)));
     }

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (209593 => 209594)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2016-12-09 03:10:02 UTC (rev 209593)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2016-12-09 03:30:03 UTC (rev 209594)
@@ -332,7 +332,7 @@
     Options::useFTLJIT() = false;
 #endif
     
-#if !CPU(X86_64)
+#if !CPU(X86_64) && !CPU(ARM64)
     Options::useConcurrentGC() = false;
 #endif
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to