Title: [252502] trunk/Source/_javascript_Core
Revision
252502
Author
[email protected]
Date
2019-11-15 14:10:07 -0800 (Fri, 15 Nov 2019)

Log Message

Rename InPlaceAbstractState's m_foundConstant to m_shouldTryConstantFolding.
https://bugs.webkit.org/show_bug.cgi?id=204244

Reviewed by Saam Barati.

m_shouldTryConstantFolding is a more accurate description of what this flag really
means i.e. that the AbstractInterpreter thinks that we may benefit from constant
folding, and therefore, should attempt it.  It doesn't always mean that it found
constants to be folded.  It also doesn't guarantee that the constant folding phase
will succeed in folding any constants.

* dfg/DFGAbstractInterpreter.h:
(JSC::DFG::AbstractInterpreter::setConstant):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAtTailAbstractState.h:
(JSC::DFG::AtTailAbstractState::setShouldTryConstantFolding):
(JSC::DFG::AtTailAbstractState::setFoundConstants): Deleted.
* dfg/DFGBasicBlock.cpp:
(JSC::DFG::BasicBlock::BasicBlock):
* dfg/DFGBasicBlock.h:
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::run):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::beginBasicBlock):
(JSC::DFG::InPlaceAbstractState::initialize):
(JSC::DFG::InPlaceAbstractState::endBasicBlock):
* dfg/DFGInPlaceAbstractState.h:
(JSC::DFG::InPlaceAbstractState::setShouldTryConstantFolding):
(JSC::DFG::InPlaceAbstractState::setFoundConstants): Deleted.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (252501 => 252502)


--- trunk/Source/_javascript_Core/ChangeLog	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-11-15 22:10:07 UTC (rev 252502)
@@ -1,3 +1,36 @@
+2019-11-15  Mark Lam  <[email protected]>
+
+        Rename InPlaceAbstractState's m_foundConstant to m_shouldTryConstantFolding.
+        https://bugs.webkit.org/show_bug.cgi?id=204244
+
+        Reviewed by Saam Barati.
+
+        m_shouldTryConstantFolding is a more accurate description of what this flag really
+        means i.e. that the AbstractInterpreter thinks that we may benefit from constant
+        folding, and therefore, should attempt it.  It doesn't always mean that it found
+        constants to be folded.  It also doesn't guarantee that the constant folding phase
+        will succeed in folding any constants.
+
+        * dfg/DFGAbstractInterpreter.h:
+        (JSC::DFG::AbstractInterpreter::setConstant):
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
+        * dfg/DFGAtTailAbstractState.h:
+        (JSC::DFG::AtTailAbstractState::setShouldTryConstantFolding):
+        (JSC::DFG::AtTailAbstractState::setFoundConstants): Deleted.
+        * dfg/DFGBasicBlock.cpp:
+        (JSC::DFG::BasicBlock::BasicBlock):
+        * dfg/DFGBasicBlock.h:
+        * dfg/DFGConstantFoldingPhase.cpp:
+        (JSC::DFG::ConstantFoldingPhase::run):
+        * dfg/DFGInPlaceAbstractState.cpp:
+        (JSC::DFG::InPlaceAbstractState::beginBasicBlock):
+        (JSC::DFG::InPlaceAbstractState::initialize):
+        (JSC::DFG::InPlaceAbstractState::endBasicBlock):
+        * dfg/DFGInPlaceAbstractState.h:
+        (JSC::DFG::InPlaceAbstractState::setShouldTryConstantFolding):
+        (JSC::DFG::InPlaceAbstractState::setFoundConstants): Deleted.
+
 2019-11-14  Saam Barati  <[email protected]>
 
         Make gcSafeMemcpy/gcSafeMemmove/gcSafeZeroMemory work properly on arm64_32

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreter.h (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreter.h	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreter.h	2019-11-15 22:10:07 UTC (rev 252502)
@@ -247,7 +247,7 @@
     void setConstant(Node* node, FrozenValue value)
     {
         setBuiltInConstant(node, value);
-        m_state.setFoundConstants(true);
+        m_state.setShouldTryConstantFolding(true);
     }
     
     ALWAYS_INLINE void filterByType(Edge& edge, SpeculatedType type);

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2019-11-15 22:10:07 UTC (rev 252502)
@@ -369,7 +369,7 @@
     case Identity: {
         setForNode(node, forNode(node->child1()));
         if (forNode(node).value())
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         break;
     }
         
@@ -385,7 +385,7 @@
         // The value in the local should already be checked.
         DFG_ASSERT(m_graph, node, value.isType(typeFilterFor(variableAccessData->flushFormat())));
         if (value.value())
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         setForNode(node, value);
         break;
     }
@@ -396,7 +396,7 @@
         // The value in the local should already be checked.
         DFG_ASSERT(m_graph, node, value.isType(typeFilterFor(data->format)));
         if (value.value())
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         setForNode(node, value);
         break;
     }
@@ -597,7 +597,7 @@
         AbstractValue& value = forNode(node);
         value = forNode(node->child1());
         if (node->child1().useKind() == UntypedUse && !(value.m_type & ~SpecBoolean))
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         if (value.m_type & SpecBoolean) {
             value.merge(SpecBoolInt32);
             value.filter(~SpecBoolean);
@@ -819,7 +819,7 @@
         }
 
         if (numberOfRemovedChildren)
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         setForNode(node, m_vm.stringStructure.get());
         break;
     }
@@ -1271,7 +1271,7 @@
 
         SpeculatedType typeMaybeNormalized = (SpecFullNumber & ~SpecInt32Only);
         if (!(forNode(node->child1()).m_type & typeMaybeNormalized)) {
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             forNode(node) = forNode(node->child1());
             break;
         }
@@ -1903,7 +1903,7 @@
             };
 
             if (isNonStringCellConstant(left) || isNonStringCellConstant(right)) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 setNonCellTypeForNode(node, SpecBoolean);
                 break;
             }
@@ -2334,13 +2334,13 @@
                     if (argumentIndex < inlineCallFrame->argumentCountIncludingThis - 1) {
                         setForNode(node, m_state.operand(
                             virtualRegisterForArgument(argumentIndex + 1) + inlineCallFrame->stackOffset));
-                        m_state.setFoundConstants(true);
+                        m_state.setShouldTryConstantFolding(true);
                         break;
                     }
                 } else {
                     if (argumentIndex < m_state.numberOfArguments() - 1) {
                         setForNode(node, m_state.argument(argumentIndex + 1));
-                        m_state.setFoundConstants(true);
+                        m_state.setShouldTryConstantFolding(true);
                         break;
                     }
                 }
@@ -2361,7 +2361,7 @@
                 result.merge(SpecOther);
             
             if (result.value())
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
             
             setForNode(node, result);
             break;
@@ -2479,7 +2479,7 @@
         ASSERT(node->child1().useKind() == UntypedUse);
         
         if (!(forNode(node->child1()).m_type & ~(SpecFullNumber | SpecBoolean | SpecString | SpecSymbol | SpecBigInt))) {
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             didFoldClobberWorld();
             setForNode(node, forNode(node->child1()));
             break;
@@ -2502,7 +2502,7 @@
         ASSERT(node->child1().useKind() == UntypedUse);
 
         if (!(forNode(node->child1()).m_type & ~SpecBytecodeNumber)) {
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             didFoldClobberWorld();
             setForNode(node, forNode(node->child1()));
             break;
@@ -2540,7 +2540,7 @@
         if (radixValue && radixValue.isInt32()) {
             int32_t radix = radixValue.asInt32();
             if (2 <= radix && radix <= 36) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 didFoldClobberWorld();
                 setForNode(node, m_graph.m_vm.stringStructure.get());
                 break;
@@ -2641,7 +2641,7 @@
         ToThisResult result = isToThisAnIdentity(m_vm, strictMode, source);
         switch (result) {
         case ToThisResult::Identity:
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             destination = source;
             break;
         case ToThisResult::Undefined:
@@ -2648,7 +2648,7 @@
             setConstant(node, jsUndefined());
             break;
         case ToThisResult::GlobalThis:
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             destination.setType(m_graph, SpecObject);
             break;
         case ToThisResult::Dynamic:
@@ -2671,7 +2671,7 @@
                         if (Structure* structure = rareData->objectAllocationStructure()) {
                             m_graph.freeze(rareData);
                             m_graph.watchpoints().addLazily(rareData->allocationProfileWatchpointSet());
-                            m_state.setFoundConstants(true);
+                            m_state.setShouldTryConstantFolding(true);
                             didFoldClobberWorld();
                             setForNode(node, structure);
                             break;
@@ -2689,7 +2689,7 @@
         JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
         if (JSValue base = forNode(node->child1()).m_value) {
             if (base == (node->isInternalPromise() ? globalObject->internalPromiseConstructor() : globalObject->promiseConstructor())) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 didFoldClobberWorld();
                 setForNode(node, node->isInternalPromise() ? globalObject->internalPromiseStructure() : globalObject->promiseStructure());
                 break;
@@ -2704,7 +2704,7 @@
                             && rareData->allocationProfileWatchpointSet().isStillValid()) {
                             m_graph.freeze(rareData);
                             m_graph.watchpoints().addLazily(rareData->allocationProfileWatchpointSet());
-                            m_state.setFoundConstants(true);
+                            m_state.setShouldTryConstantFolding(true);
                             didFoldClobberWorld();
                             setForNode(node, structure);
                             break;
@@ -2733,7 +2733,7 @@
                                 && rareData->allocationProfileWatchpointSet().isStillValid()) {
                                 m_graph.freeze(rareData);
                                 m_graph.watchpoints().addLazily(rareData->allocationProfileWatchpointSet());
-                                m_state.setFoundConstants(true);
+                                m_state.setShouldTryConstantFolding(true);
                                 didFoldClobberWorld();
                                 setForNode(node, structure);
                                 return true;
@@ -2790,7 +2790,7 @@
                 structure = m_vm.structureCache.emptyObjectStructureConcurrently(globalObject, base.getObject(), JSFinalObject::defaultInlineCapacity());
             
             if (structure) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 if (node->child1().useKind() == UntypedUse)
                     didFoldClobberWorld();
                 setForNode(node, structure);
@@ -2811,7 +2811,7 @@
                 if (auto* rareData = structure->rareDataConcurrently()) {
                     if (!!rareData->cachedOwnKeysConcurrently()) {
                         if (m_graph.isWatchingHavingABadTimeWatchpoint(node)) {
-                            m_state.setFoundConstants(true);
+                            m_state.setShouldTryConstantFolding(true);
                             didFoldClobberWorld();
                             setTypeForNode(node, SpecArray);
                             break;
@@ -2832,7 +2832,7 @@
         AbstractValue& destination = forNode(node);
 
         if (!(source.m_type & ~SpecObject)) {
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             if (node->op() == ToObject)
                 didFoldClobberWorld();
             destination = source;
@@ -3091,7 +3091,7 @@
                             value, status[i].offset(), m_state.structureClobberState()));
                 }
             
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 didFoldClobberWorld();
                 forNode(node) = result;
                 break;
@@ -3144,7 +3144,7 @@
         // more efficient. We currently don't.
         
         if (value.m_structure.isSubsetOf(set))
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
 
         SpeculatedType admittedTypes = SpecNone;
         switch (node->child1().useKind()) {
@@ -3169,7 +3169,7 @@
 
         bool mayBeEmpty = value.m_type & SpecEmpty;
         if (!mayBeEmpty)
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
 
         SpeculatedType admittedTypes = mayBeEmpty ? SpecEmpty : SpecNone;
         filter(value, node->structureSet(), admittedTypes);
@@ -3186,7 +3186,7 @@
         if (value.value()) {
             if (Structure* structure = jsDynamicCast<Structure*>(m_vm, value.value())) {
                 if (set.contains(m_graph.registerStructure(structure))) {
-                    m_state.setFoundConstants(true);
+                    m_state.setShouldTryConstantFolding(true);
                     break;
                 }
             }
@@ -3206,7 +3206,7 @@
                     allGood = false;
                 });
             if (allGood) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 break;
             }
         }
@@ -3224,7 +3224,7 @@
         if (!forNode(node->child1()).m_structure.isClear()) {
             if (forNode(node->child1()).m_structure.onlyStructure() == node->transition()->next) {
                 didFoldClobberStructures();
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
             } else {
                 observeTransition(
                     clobberLimit, node->transition()->previous, node->transition()->next);
@@ -3249,7 +3249,7 @@
         JSValue constant = forNode(node->child1()).value();
         if (constant) {
             if (constant.isCell() && constant.asCell()->inherits(m_vm, node->classInfo())) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 ASSERT(constant);
                 break;
             }
@@ -3258,7 +3258,7 @@
         AbstractValue& value = forNode(node->child1());
 
         if (value.m_structure.isSubClassOf(node->classInfo()))
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
 
         filterClassInfo(value, node->classInfo());
         break;
@@ -3283,7 +3283,7 @@
     }
     case CheckArray: {
         if (node->arrayMode().alreadyChecked(m_graph, node, forNode(node->child1()))) {
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             break;
         }
         switch (node->arrayMode().type()) {
@@ -3343,7 +3343,7 @@
     case Arrayify: {
         if (node->arrayMode().alreadyChecked(m_graph, node, forNode(node->child1()))) {
             didFoldClobberStructures();
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             break;
         }
         ASSERT(node->arrayMode().conversion() == Array::Convert);
@@ -3354,7 +3354,7 @@
     case ArrayifyToStructure: {
         AbstractValue& value = forNode(node->child1());
         if (value.m_structure.isSubsetOf(RegisteredStructureSet(node->structure())))
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         clobberStructures();
         
         // We have a bunch of options of how to express the abstract set at this point. Let set S
@@ -3391,7 +3391,7 @@
         JSArrayBufferView* view = m_graph.tryGetFoldableView(
             forNode(node->child1()).m_value, node->arrayMode());
         if (view)
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         clearForNode(node);
         break;
     }
@@ -3482,7 +3482,7 @@
 
         setForNode(node, value);
         if (value.m_value)
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         break;
     }
         
@@ -3509,9 +3509,9 @@
         // contradiction then there must always be a contradiction even if subsequent passes don't
         // realize it. This is the case here.
         
-        // Ordinarily you have to be careful with calling setFoundConstants()
+        // Ordinarily you have to be careful with calling setShouldTryConstantFolding()
         // because of the effect on compile times, but this node is FTL-only.
-        m_state.setFoundConstants(true);
+        m_state.setShouldTryConstantFolding(true);
         
         AbstractValue base = forNode(node->child1());
         RegisteredStructureSet baseSet;
@@ -3555,9 +3555,9 @@
         RegisteredStructureSet newSet;
         TransitionVector transitions;
         
-        // Ordinarily you have to be careful with calling setFoundConstants()
+        // Ordinarily you have to be careful with calling setShouldTryConstantFolding()
         // because of the effect on compile times, but this node is FTL-only.
-        m_state.setFoundConstants(true);
+        m_state.setShouldTryConstantFolding(true);
         
         AbstractValue base = forNode(node->child1());
         AbstractValue originalValue = forNode(node->child2());
@@ -3619,7 +3619,7 @@
     case CheckCell: {
         JSValue value = forNode(node->child1()).value();
         if (value == node->cellOperand()->value()) {
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             ASSERT(value);
             break;
         }
@@ -3631,7 +3631,7 @@
     case CheckNotEmpty: {
         AbstractValue& value = forNode(node->child1());
         if (!(value.m_type & SpecEmpty)) {
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
             break;
         }
         
@@ -3648,7 +3648,7 @@
         if (childConstant) {
             ASSERT(childConstant.isString());
             if (asString(childConstant)->tryGetValueImpl() == uid) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 break;
             }
         }
@@ -3661,7 +3661,7 @@
         JSValue left = forNode(node->child1()).value();
         JSValue right = forNode(node->child2()).value();
         if (left && right && left.isInt32() && right.isInt32() && static_cast<uint32_t>(left.asInt32()) < static_cast<uint32_t>(right.asInt32()))
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
 
         // We claim we result in Int32. It's not really important what our result is (though we
         // don't want to claim we may result in the empty value), other nodes with data flow edges
@@ -3703,7 +3703,7 @@
                 }
 
                 if (status.numVariants() == 1 || m_graph.m_plan.isFTL())
-                    m_state.setFoundConstants(true);
+                    m_state.setShouldTryConstantFolding(true);
                 
                 didFoldClobberWorld();
                 observeTransitions(clobberLimit, transitions);
@@ -3752,7 +3752,7 @@
                 JSString* string = asString(constant);
                 const StringImpl* impl = string->tryGetValueImpl();
                 if (impl && impl->isAtom())
-                    m_state.setFoundConstants(true);
+                    m_state.setShouldTryConstantFolding(true);
             }
         }
 
@@ -3877,7 +3877,7 @@
         for (MatchStructureVariant& variant : node->matchStructureData().variants) {
             RegisteredStructure structure = variant.structure;
             if (!base.contains(structure)) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 continue;
             }
             
@@ -3909,7 +3909,7 @@
         // The state of this node would have already been decided, but it may have become a
         // constant, in which case we'd like to know.
         if (forNode(node).m_value)
-            m_state.setFoundConstants(true);
+            m_state.setShouldTryConstantFolding(true);
         break;
         
     case Upsilon: {
@@ -3987,7 +3987,7 @@
         ASSERT(bits);
         if (bits == ImplementsDefaultHasInstance) {
             if (abstractValue.m_type == SpecFunctionWithDefaultHasInstance) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 break;
             }
         }
@@ -3998,7 +3998,7 @@
                 // and we can read its inline type info flags. These flags don't change over the
                 // object's lifetime.
                 if ((value.asCell()->inlineTypeFlags() & bits) == bits) {
-                    m_state.setFoundConstants(true);
+                    m_state.setShouldTryConstantFolding(true);
                     break;
                 }
             }
@@ -4010,7 +4010,7 @@
                 ok &= (structure->typeInfo().inlineTypeFlags() & bits) == bits;
             });
             if (ok) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 break;
             }
         }
@@ -4029,7 +4029,7 @@
 
             if (radix.isNumber()
                 && (radix.asNumber() == 0 || radix.asNumber() == 10)) {
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
                 if (node->child1().useKind() == UntypedUse)
                     didFoldClobberWorld();
                 setNonCellTypeForNode(node, SpecInt32Only);
@@ -4061,7 +4061,7 @@
             if (!edge)
                 return;
             if (edge.isProved() || edge.willNotHaveCheck())
-                m_state.setFoundConstants(true);
+                m_state.setShouldTryConstantFolding(true);
         });
         break;
     }

Modified: trunk/Source/_javascript_Core/dfg/DFGAtTailAbstractState.h (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGAtTailAbstractState.h	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGAtTailAbstractState.h	2019-11-15 22:10:07 UTC (rev 252502)
@@ -165,7 +165,7 @@
     void setStructureClobberState(StructureClobberState state) { RELEASE_ASSERT(state == m_block->cfaStructureClobberStateAtTail); }
     void setIsValid(bool isValid) { m_block->cfaDidFinish = isValid; }
     void setBranchDirection(BranchDirection) { }
-    void setFoundConstants(bool) { }
+    void setShouldTryConstantFolding(bool) { }
 
     void trustEdgeProofs() { m_trustEdgeProofs = true; }
     void dontTrustEdgeProofs() { m_trustEdgeProofs = false; }

Modified: trunk/Source/_javascript_Core/dfg/DFGBasicBlock.cpp (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGBasicBlock.cpp	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGBasicBlock.cpp	2019-11-15 22:10:07 UTC (rev 252502)
@@ -40,7 +40,6 @@
     , cfaBranchDirection(InvalidBranchDirection)
     , cfaHasVisited(false)
     , cfaShouldRevisit(false)
-    , cfaFoundConstants(false)
     , cfaDidFinish(true)
     , intersectionOfCFAHasVisited(true)
     , isOSRTarget(false)

Modified: trunk/Source/_javascript_Core/dfg/DFGBasicBlock.h (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGBasicBlock.h	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGBasicBlock.h	2019-11-15 22:10:07 UTC (rev 252502)
@@ -187,7 +187,7 @@
     BranchDirection cfaBranchDirection;
     bool cfaHasVisited;
     bool cfaShouldRevisit;
-    bool cfaFoundConstants;
+    bool cfaThinksShouldTryConstantFolding { false };
     bool cfaDidFinish;
     bool intersectionOfCFAHasVisited;
     bool isOSRTarget;

Modified: trunk/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp	2019-11-15 22:10:07 UTC (rev 252502)
@@ -58,7 +58,7 @@
         bool changed = false;
 
         for (BasicBlock* block : m_graph.blocksInNaturalOrder()) {
-            if (block->cfaFoundConstants)
+            if (block->cfaThinksShouldTryConstantFolding)
                 changed |= foldConstants(block);
         }
         

Modified: trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp	2019-11-15 22:10:07 UTC (rev 252502)
@@ -84,7 +84,7 @@
     basicBlock->cfaShouldRevisit = false;
     basicBlock->cfaHasVisited = true;
     m_isValid = true;
-    m_foundConstants = false;
+    m_shouldTryConstantFolding = false;
     m_branchDirection = InvalidBranchDirection;
     m_structureClobberState = basicBlock->cfaStructureClobberStateAtHead;
 }
@@ -114,7 +114,7 @@
     for (BasicBlock* entrypoint : m_graph.m_roots) {
         entrypoint->cfaShouldRevisit = true;
         entrypoint->cfaHasVisited = false;
-        entrypoint->cfaFoundConstants = false;
+        entrypoint->cfaThinksShouldTryConstantFolding = false;
         entrypoint->cfaStructureClobberStateAtHead = StructuresAreWatched;
         entrypoint->cfaStructureClobberStateAtTail = StructuresAreWatched;
 
@@ -172,7 +172,7 @@
         ASSERT(block->isReachable);
         block->cfaShouldRevisit = false;
         block->cfaHasVisited = false;
-        block->cfaFoundConstants = false;
+        block->cfaThinksShouldTryConstantFolding = false;
         block->cfaStructureClobberStateAtHead = StructuresAreWatched;
         block->cfaStructureClobberStateAtTail = StructuresAreWatched;
         for (size_t i = 0; i < block->valuesAtHead.numberOfArguments(); ++i) {
@@ -202,7 +202,7 @@
     
     BasicBlock* block = m_block; // Save the block for successor merging.
     
-    block->cfaFoundConstants = m_foundConstants;
+    block->cfaThinksShouldTryConstantFolding = m_shouldTryConstantFolding;
     block->cfaDidFinish = m_isValid;
     block->cfaBranchDirection = m_branchDirection;
     

Modified: trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.h (252501 => 252502)


--- trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.h	2019-11-15 21:57:24 UTC (rev 252501)
+++ trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.h	2019-11-15 22:10:07 UTC (rev 252502)
@@ -257,7 +257,7 @@
     // block. But, the last time we did it, it was a 1% SunSpider regression:
     // https://bugs.webkit.org/show_bug.cgi?id=133947
     // So, we should probably keep this method.
-    void setFoundConstants(bool foundConstants) { m_foundConstants = foundConstants; }
+    void setShouldTryConstantFolding(bool tryConstantFolding) { m_shouldTryConstantFolding = tryConstantFolding; }
 
     void setProofStatus(Edge& edge, ProofStatus status)
     {
@@ -282,9 +282,9 @@
     Operands<AbstractValue> m_variables;
     FastBitVector m_activeVariables;
     BasicBlock* m_block;
-    
-    bool m_foundConstants;
-    
+
+    bool m_shouldTryConstantFolding;
+
     bool m_isValid;
     AbstractInterpreterClobberState m_clobberState;
     StructureClobberState m_structureClobberState;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to