Title: [262570] trunk/Source/_javascript_Core
Revision
262570
Author
[email protected]
Date
2020-06-04 14:07:42 -0700 (Thu, 04 Jun 2020)

Log Message

Add Options::validateDoesGC() for turning DoesGC validation on/off.
https://bugs.webkit.org/show_bug.cgi?id=212773

Reviewed by Saam Barati.

It will default to on if ASSERT_ENABLED because we want testing to be done with
the validation on.  When needed, we can turn it off if we need to e.g. to
de-clutter disassembly dumps while debugging.

If Options::validateDoesGC() is false, we turn off JIT code emission for this
check, as well as skip the validation checks.  There are still places in C++
code that store to DoesGC::m_value without checking Options::validateDoesGC().
It doesn't hurt to just let these stores proceed, and performance-wise, it's
probably cheaper to just do the store unconditionally than to gate it on a load of
Options::validateDoesGC() first.

Also made it explicit that the check on validateDFGDoesGC is a constexpr check.

* dfg/DFGDoesGCCheck.cpp:
(JSC::DFG::DoesGCCheck::verifyCanGC):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* runtime/OptionsList.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (262569 => 262570)


--- trunk/Source/_javascript_Core/ChangeLog	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-06-04 21:07:42 UTC (rev 262570)
@@ -1,3 +1,37 @@
+2020-06-04  Mark Lam  <[email protected]>
+
+        Add Options::validateDoesGC() for turning DoesGC validation on/off.
+        https://bugs.webkit.org/show_bug.cgi?id=212773
+
+        Reviewed by Saam Barati.
+
+        It will default to on if ASSERT_ENABLED because we want testing to be done with
+        the validation on.  When needed, we can turn it off if we need to e.g. to
+        de-clutter disassembly dumps while debugging.
+
+        If Options::validateDoesGC() is false, we turn off JIT code emission for this
+        check, as well as skip the validation checks.  There are still places in C++
+        code that store to DoesGC::m_value without checking Options::validateDoesGC().
+        It doesn't hurt to just let these stores proceed, and performance-wise, it's
+        probably cheaper to just do the store unconditionally than to gate it on a load of
+        Options::validateDoesGC() first.
+
+        Also made it explicit that the check on validateDFGDoesGC is a constexpr check.
+
+        * dfg/DFGDoesGCCheck.cpp:
+        (JSC::DFG::DoesGCCheck::verifyCanGC):
+        * dfg/DFGOSRExit.cpp:
+        (JSC::DFG::OSRExit::compileExit):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileNode):
+        * ftl/FTLOSRExitCompiler.cpp:
+        (JSC::FTL::compileStub):
+        * runtime/OptionsList.h:
+
 2020-06-04  Ross Kirsling  <[email protected]>
 
         Intl classes should have meaningful @@toStringTag values

Modified: trunk/Source/_javascript_Core/dfg/DFGDoesGCCheck.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/dfg/DFGDoesGCCheck.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/dfg/DFGDoesGCCheck.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -30,6 +30,7 @@
 #include "CodeBlock.h"
 #include "DFGNodeType.h"
 #include "Heap.h"
+#include "Options.h"
 #include "VMInspector.h"
 #include <wtf/DataLog.h>
 
@@ -46,6 +47,9 @@
     // in the header file.
     static_assert(numberOfNodeTypes <= (1 << nodeOpBits));
 
+    if (!Options::validateDoesGC())
+        return;
+
     if (!expectDoesGC()) {
         dataLog("Error: DoesGC failed");
         if (isSpecial()) {

Modified: trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -143,7 +143,7 @@
     VM& vm = callFrame->deprecatedVM();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    if (validateDFGDoesGC) {
+    if constexpr (validateDFGDoesGC) {
         // We're about to exit optimized code. So, there's no longer any optimized
         // code running that expects no GC.
         vm.heap.setDoesGCExpectation(true, DoesGCCheck::Special::DFGOSRExit);
@@ -551,16 +551,18 @@
     }
 
 #if USE(JSVALUE64)
-    if (validateDFGDoesGC) {
-        // We're about to exit optimized code. So, there's no longer any optimized
-        // code running that expects no GC. We need to set this before arguments
-        // materialization below (see emitRestoreArguments()).
+    if constexpr (validateDFGDoesGC) {
+        if (Options::validateDoesGC()) {
+            // We're about to exit optimized code. So, there's no longer any optimized
+            // code running that expects no GC. We need to set this before arguments
+            // materialization below (see emitRestoreArguments()).
 
-        // Even though we set Heap::m_doesGC in compileOSRExit(), we also need
-        // to set it here because compileOSRExit() is only called on the first time
-        // we exit from this site, but all subsequent exits will take this compiled
-        // ramp without calling compileOSRExit() first.
-        jit.store32(CCallHelpers::TrustedImm32(DoesGCCheck::encode(true, DoesGCCheck::Special::DFGOSRExit)), vm.heap.addressOfDoesGC());
+            // Even though we set Heap::m_doesGC in compileOSRExit(), we also need
+            // to set it here because compileOSRExit() is only called on the first time
+            // we exit from this site, but all subsequent exits will take this compiled
+            // ramp without calling compileOSRExit() first.
+            jit.store32(CCallHelpers::TrustedImm32(DoesGCCheck::encode(true, DoesGCCheck::Special::DFGOSRExit)), vm.heap.addressOfDoesGC());
+        }
     }
 #endif
     

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -1807,9 +1807,11 @@
 {
     NodeType op = node->op();
 
-    if (validateDFGDoesGC) {
-        bool expectDoesGC = doesGC(m_jit.graph(), node);
-        m_jit.store32(TrustedImm32(DoesGCCheck::encode(expectDoesGC, node->index(), node->op())), vm().heap.addressOfDoesGC());
+    if constexpr (validateDFGDoesGC) {
+        if (Options::validateDoesGC()) {
+            bool expectDoesGC = doesGC(m_jit.graph(), node);
+            m_jit.store32(TrustedImm32(DoesGCCheck::encode(expectDoesGC, node->index(), node->op())), vm().heap.addressOfDoesGC());
+        }
     }
 
 #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -2136,9 +2136,11 @@
 {
     NodeType op = node->op();
 
-    if (validateDFGDoesGC) {
-        bool expectDoesGC = doesGC(m_jit.graph(), node);
-        m_jit.store32(TrustedImm32(DoesGCCheck::encode(expectDoesGC, node->index(), node->op())), vm().heap.addressOfDoesGC());
+    if constexpr (validateDFGDoesGC) {
+        if (Options::validateDoesGC()) {
+            bool expectDoesGC = doesGC(m_jit.graph(), node);
+            m_jit.store32(TrustedImm32(DoesGCCheck::encode(expectDoesGC, node->index(), node->op())), vm().heap.addressOfDoesGC());
+        }
     }
 
 #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -702,9 +702,11 @@
         if (Options::validateAbstractInterpreterState())
             validateAIState(m_node);
 
-        if (validateDFGDoesGC) {
-            bool expectDoesGC = doesGC(m_graph, m_node);
-            m_out.store(m_out.constInt32(DoesGCCheck::encode(expectDoesGC, m_node->index(), m_node->op())), m_out.absolute(vm().heap.addressOfDoesGC()));
+        if constexpr (validateDFGDoesGC) {
+            if (Options::validateDoesGC()) {
+                bool expectDoesGC = doesGC(m_graph, m_node);
+                m_out.store(m_out.constInt32(DoesGCCheck::encode(expectDoesGC, m_node->index(), m_node->op())), m_out.absolute(vm().heap.addressOfDoesGC()));
+            }
         }
 
         switch (m_node->op()) {

Modified: trunk/Source/_javascript_Core/ftl/FTLOSRExitCompiler.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/ftl/FTLOSRExitCompiler.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/ftl/FTLOSRExitCompiler.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -206,16 +206,18 @@
 
     saveAllRegisters(jit, registerScratch);
     
-    if (validateDFGDoesGC) {
-        // We're about to exit optimized code. So, there's no longer any optimized
-        // code running that expects no GC. We need to set this before object
-        // materialization below.
+    if constexpr (validateDFGDoesGC) {
+        if (Options::validateDoesGC()) {
+            // We're about to exit optimized code. So, there's no longer any optimized
+            // code running that expects no GC. We need to set this before object
+            // materialization below.
 
-        // Even though we set Heap::m_doesGC in compileFTLOSRExit(), we also need
-        // to set it here because compileFTLOSRExit() is only called on the first time
-        // we exit from this site, but all subsequent exits will take this compiled
-        // ramp without calling compileFTLOSRExit() first.
-        jit.store32(CCallHelpers::TrustedImm32(DoesGCCheck::encode(true, DoesGCCheck::Special::FTLOSRExit)), vm.heap.addressOfDoesGC());
+            // Even though we set Heap::m_doesGC in compileFTLOSRExit(), we also need
+            // to set it here because compileFTLOSRExit() is only called on the first time
+            // we exit from this site, but all subsequent exits will take this compiled
+            // ramp without calling compileFTLOSRExit() first.
+            jit.store32(CCallHelpers::TrustedImm32(DoesGCCheck::encode(true, DoesGCCheck::Special::FTLOSRExit)), vm.heap.addressOfDoesGC());
+        }
     }
 
     // Bring the stack back into a sane form and assert that it's sane.
@@ -545,7 +547,7 @@
 
     VM& vm = callFrame->deprecatedVM();
 
-    if (validateDFGDoesGC) {
+    if constexpr (validateDFGDoesGC) {
         // We're about to exit optimized code. So, there's no longer any optimized
         // code running that expects no GC.
         vm.heap.setDoesGCExpectation(true, DoesGCCheck::Special::FTLOSRExit);

Modified: trunk/Source/_javascript_Core/heap/CompleteSubspace.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/CompleteSubspace.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/CompleteSubspace.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -119,7 +119,7 @@
 
 void* CompleteSubspace::tryAllocateSlow(VM& vm, size_t size, GCDeferralContext* deferralContext)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm.heap.verifyCanGC();
 
     sanitizeStackForVM(vm);
@@ -155,7 +155,7 @@
 
 void* CompleteSubspace::reallocatePreciseAllocationNonVirtual(VM& vm, HeapCell* oldCell, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm.heap.verifyCanGC();
 
     // The following conditions are met in Butterfly for example.

Modified: trunk/Source/_javascript_Core/heap/CompleteSubspaceInlines.h (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/CompleteSubspaceInlines.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/CompleteSubspaceInlines.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -32,7 +32,7 @@
 
 ALWAYS_INLINE void* CompleteSubspace::allocateNonVirtual(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm.heap.verifyCanGC();
 
     if (Allocator allocator = allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists))

Modified: trunk/Source/_javascript_Core/heap/DeferGC.h (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/DeferGC.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/DeferGC.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -44,7 +44,7 @@
     
     ~DeferGC()
     {
-        if (validateDFGDoesGC)
+        if constexpr (validateDFGDoesGC)
             m_heap.verifyCanGC();
         m_heap.decrementDeferralDepthAndGCIfNeeded();
     }

Modified: trunk/Source/_javascript_Core/heap/GCDeferralContextInlines.h (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/GCDeferralContextInlines.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/GCDeferralContextInlines.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -37,7 +37,7 @@
 
 ALWAYS_INLINE GCDeferralContext::~GCDeferralContext()
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         m_heap.verifyCanGC();
 
     if (UNLIKELY(m_shouldGC))

Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/Heap.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -1063,7 +1063,7 @@
 
 void Heap::collectNow(Synchronousness synchronousness, GCRequest request)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     switch (synchronousness) {
@@ -1096,7 +1096,7 @@
 
 void Heap::collectAsync(GCRequest request)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     if (!m_isSafeToCollect)
@@ -1120,7 +1120,7 @@
 
 void Heap::collectSync(GCRequest request)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     if (!m_isSafeToCollect)
@@ -1783,7 +1783,7 @@
 
 void Heap::stopIfNecessarySlow()
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     while (stopIfNecessarySlow(m_worldState.load())) { }
@@ -1798,7 +1798,7 @@
 
 bool Heap::stopIfNecessarySlow(unsigned oldState)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     RELEASE_ASSERT(oldState & hasAccessBit);
@@ -2600,7 +2600,7 @@
 void Heap::collectIfNecessaryOrDefer(GCDeferralContext* deferralContext)
 {
     ASSERT(deferralContext || isDeferred() || !DisallowGC::isInEffectOnCurrentThread());
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     if (!m_isSafeToCollect)

Modified: trunk/Source/_javascript_Core/heap/HeapInlines.h (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/HeapInlines.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/HeapInlines.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -235,7 +235,7 @@
 
 inline void Heap::acquireAccess()
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     if (m_worldState.compareExchangeWeak(0, hasAccessBit))
@@ -262,7 +262,7 @@
 
 inline void Heap::stopIfNecessary()
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         verifyCanGC();
 
     if (mayNeedToStop())

Modified: trunk/Source/_javascript_Core/heap/LocalAllocatorInlines.h (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/LocalAllocatorInlines.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/LocalAllocatorInlines.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,7 +32,7 @@
 
 ALWAYS_INLINE void* LocalAllocator::allocate(Heap& heap, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         heap.verifyCanGC();
     return m_freeList.allocate(
         [&] () -> HeapCell* {

Modified: trunk/Source/_javascript_Core/heap/PreciseAllocation.cpp (262569 => 262570)


--- trunk/Source/_javascript_Core/heap/PreciseAllocation.cpp	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/heap/PreciseAllocation.cpp	2020-06-04 21:07:42 UTC (rev 262570)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -42,7 +42,7 @@
 
 PreciseAllocation* PreciseAllocation::tryCreate(Heap& heap, size_t size, Subspace* subspace, unsigned indexInSpace)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         heap.verifyCanGC();
 
     size_t adjustedAlignmentAllocationSize = headerSize() + size + halfAlignment;
@@ -122,7 +122,7 @@
 
 PreciseAllocation* PreciseAllocation::createForLowerTier(Heap& heap, size_t size, Subspace* subspace, uint8_t lowerTierIndex)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         heap.verifyCanGC();
 
     size_t adjustedAlignmentAllocationSize = headerSize() + size + halfAlignment;

Modified: trunk/Source/_javascript_Core/runtime/JSString.h (262569 => 262570)


--- trunk/Source/_javascript_Core/runtime/JSString.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/runtime/JSString.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -732,7 +732,7 @@
 
 ALWAYS_INLINE JSString* jsSingleCharacterString(VM& vm, UChar c)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm.heap.verifyCanGC();
     if (c <= maxSingleCharacterString)
         return vm.smallStrings.singleCharacterString(c);
@@ -762,7 +762,7 @@
 
 ALWAYS_INLINE AtomString JSString::toAtomString(JSGlobalObject* globalObject) const
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm().heap.verifyCanGC();
     if (isRope())
         return static_cast<const JSRopeString*>(this)->resolveRopeToAtomString(globalObject);
@@ -771,7 +771,7 @@
 
 ALWAYS_INLINE RefPtr<AtomStringImpl> JSString::toExistingAtomString(JSGlobalObject* globalObject) const
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm().heap.verifyCanGC();
     if (isRope())
         return static_cast<const JSRopeString*>(this)->resolveRopeToExistingAtomString(globalObject);
@@ -782,7 +782,7 @@
 
 inline const String& JSString::value(JSGlobalObject* globalObject) const
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm().heap.verifyCanGC();
     if (isRope())
         return static_cast<const JSRopeString*>(this)->resolveRope(globalObject);
@@ -792,7 +792,7 @@
 inline const String& JSString::tryGetValue(bool allocationAllowed) const
 {
     if (allocationAllowed) {
-        if (validateDFGDoesGC)
+        if constexpr (validateDFGDoesGC)
             vm().heap.verifyCanGC();
         if (isRope()) {
             // Pass nullptr for the JSGlobalObject so that resolveRope does not throw in the event of an OOM error.
@@ -982,7 +982,7 @@
 
 ALWAYS_INLINE StringView JSRopeString::unsafeView(JSGlobalObject* globalObject) const
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm().heap.verifyCanGC();
     if (isSubstring()) {
         auto& base = substringBase()->valueInternal();
@@ -995,7 +995,7 @@
 
 ALWAYS_INLINE StringViewWithUnderlyingString JSRopeString::viewWithUnderlyingString(JSGlobalObject* globalObject) const
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm().heap.verifyCanGC();
     if (isSubstring()) {
         auto& base = substringBase()->valueInternal();
@@ -1009,7 +1009,7 @@
 
 ALWAYS_INLINE StringView JSString::unsafeView(JSGlobalObject* globalObject) const
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm().heap.verifyCanGC();
     if (isRope())
         return static_cast<const JSRopeString*>(this)->unsafeView(globalObject);

Modified: trunk/Source/_javascript_Core/runtime/OptionsList.h (262569 => 262570)


--- trunk/Source/_javascript_Core/runtime/OptionsList.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/runtime/OptionsList.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -153,6 +153,7 @@
     v(Bool, logCompilationChanges, false, Normal, nullptr) \
     v(Bool, useProbeOSRExit, false, Normal, nullptr) \
     v(Bool, printEachOSRExit, false, Normal, nullptr) \
+    v(Bool, validateDoesGC, ASSERT_ENABLED, Normal, nullptr) \
     v(Bool, validateGraph, false, Normal, nullptr) \
     v(Bool, validateGraphAtEachPhase, false, Normal, nullptr) \
     v(Bool, verboseValidationFailure, false, Normal, nullptr) \

Modified: trunk/Source/_javascript_Core/runtime/RegExpMatchesArray.h (262569 => 262570)


--- trunk/Source/_javascript_Core/runtime/RegExpMatchesArray.h	2020-06-04 21:07:36 UTC (rev 262569)
+++ trunk/Source/_javascript_Core/runtime/RegExpMatchesArray.h	2020-06-04 21:07:42 UTC (rev 262570)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2008-2019 Apple Inc. All Rights Reserved.
+ *  Copyright (C) 2008-2020 Apple Inc. All Rights Reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -63,7 +63,7 @@
     VM& vm, JSGlobalObject* globalObject, JSString* input, const String& inputValue,
     RegExp* regExp, unsigned startOffset, MatchResult& result)
 {
-    if (validateDFGDoesGC)
+    if constexpr (validateDFGDoesGC)
         vm.heap.verifyCanGC();
 
     Vector<int, 32> subpatternResults;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to