Rename HardPhantom to MustGenerate.
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 19:25:10 +0000 (19:25 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 19:25:10 +0000 (19:25 +0000)
Rubber stamped by Geoffrey Garen.

We are steadily moving towards Phantom just being a backend hack in the DFG. HardPhantom
is more than that; it's a utility for forcing the execution of otherwise killable nodes.
NodeMustGenerate is the flag we use to indicate that something isn't killable. So this
node should just be called MustGenerate.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDCEPhase.cpp:
(JSC::DFG::DCEPhase::run):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::tryToRelaxRepresentation):
* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::insertMustAdd):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGNode.h:
(JSC::DFG::Node::willHaveCodeGenOrOSR):
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
(JSC::DFG::ObjectAllocationSinkingPhase::handleNode):
* dfg/DFGPhantomCanonicalizationPhase.cpp:
(JSC::DFG::PhantomCanonicalizationPhase::run):
* dfg/DFGPhantomRemovalPhase.cpp:
(JSC::DFG::PhantomRemovalPhase::run):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks):
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks):
* dfg/DFGVarargsForwardingPhase.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGArgumentsEliminationPhase.cpp
Source/JavaScriptCore/dfg/DFGClobberize.h
Source/JavaScriptCore/dfg/DFGDCEPhase.cpp
Source/JavaScriptCore/dfg/DFGDoesGC.cpp
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Source/JavaScriptCore/dfg/DFGIntegerCheckCombiningPhase.cpp
Source/JavaScriptCore/dfg/DFGMayExit.cpp
Source/JavaScriptCore/dfg/DFGNode.h
Source/JavaScriptCore/dfg/DFGNodeType.h
Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
Source/JavaScriptCore/dfg/DFGPhantomCanonicalizationPhase.cpp
Source/JavaScriptCore/dfg/DFGPhantomRemovalPhase.cpp
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
Source/JavaScriptCore/dfg/DFGSafeToExecute.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/dfg/DFGTypeCheckHoistingPhase.cpp
Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp
Source/JavaScriptCore/ftl/FTLCapabilities.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

index 1f11184..1c23fd1 100644 (file)
@@ -1,3 +1,56 @@
+2015-04-23  Filip Pizlo  <fpizlo@apple.com>
+
+        Rename HardPhantom to MustGenerate.
+
+        Rubber stamped by Geoffrey Garen.
+        
+        We are steadily moving towards Phantom just being a backend hack in the DFG. HardPhantom
+        is more than that; it's a utility for forcing the execution of otherwise killable nodes.
+        NodeMustGenerate is the flag we use to indicate that something isn't killable. So this
+        node should just be called MustGenerate.
+
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
+        * dfg/DFGArgumentsEliminationPhase.cpp:
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize):
+        * dfg/DFGDCEPhase.cpp:
+        (JSC::DFG::DCEPhase::run):
+        * dfg/DFGDoesGC.cpp:
+        (JSC::DFG::doesGC):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        (JSC::DFG::FixupPhase::tryToRelaxRepresentation):
+        * dfg/DFGIntegerCheckCombiningPhase.cpp:
+        (JSC::DFG::IntegerCheckCombiningPhase::insertMustAdd):
+        * dfg/DFGMayExit.cpp:
+        (JSC::DFG::mayExit):
+        * dfg/DFGNode.h:
+        (JSC::DFG::Node::willHaveCodeGenOrOSR):
+        * dfg/DFGNodeType.h:
+        * dfg/DFGObjectAllocationSinkingPhase.cpp:
+        (JSC::DFG::ObjectAllocationSinkingPhase::handleNode):
+        * dfg/DFGPhantomCanonicalizationPhase.cpp:
+        (JSC::DFG::PhantomCanonicalizationPhase::run):
+        * dfg/DFGPhantomRemovalPhase.cpp:
+        (JSC::DFG::PhantomRemovalPhase::run):
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        (JSC::DFG::PredictionPropagationPhase::propagate):
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGTypeCheckHoistingPhase.cpp:
+        (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks):
+        (JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks):
+        * dfg/DFGVarargsForwardingPhase.cpp:
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::compileNode):
+
 2015-04-23  Jordan Harband  <ljharb@gmail.com>
 
         Implement `Object.assign`
index 7625e23..71f81d2 100644 (file)
@@ -2068,7 +2068,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
     case ProfileType:
     case ProfileControlFlow:
     case Phantom:
-    case HardPhantom:
+    case MustGenerate:
     case CountExecution:
     case CheckTierUpInLoop:
     case CheckTierUpAtReturn:
index 5efb602..2f6f3cf 100644 (file)
@@ -161,7 +161,7 @@ private:
 
                 case Phantom:
                 case Check:
-                case HardPhantom:
+                case MustGenerate:
                 case MovHint:
                 case PutHint:
                     break;
index a0fb090..890c9dc 100644 (file)
@@ -115,7 +115,7 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu
         
     case Identity:
     case Phantom:
-    case HardPhantom:
+    case MustGenerate:
     case Check:
     case ExtractOSREntryLocal:
     case CheckStructureImmediate:
index d1e3e58..97e0c57 100644 (file)
@@ -71,7 +71,7 @@ public:
             cleanVariables(m_graph.m_arguments);
         }
         
-        // Just do a basic HardPhantom/Phantom/Check clean-up.
+        // Just do a basic MustGenerate/Phantom/Check clean-up.
         for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
             BasicBlock* block = m_graph.block(blockIndex);
             if (!block)
@@ -82,7 +82,7 @@ public:
                 Node* node = block->at(sourceIndex++);
                 switch (node->op()) {
                 case Check:
-                case HardPhantom:
+                case MustGenerate:
                 case Phantom:
                     if (node->children.isEmpty())
                         continue;
index 682d486..3646075 100644 (file)
@@ -55,7 +55,7 @@ bool doesGC(Graph& graph, Node* node)
     case MovHint:
     case ZombieHint:
     case Phantom:
-    case HardPhantom:
+    case MustGenerate:
     case Upsilon:
     case Phi:
     case Flush:
index 3dc2b5a..6998be9 100644 (file)
@@ -1027,7 +1027,7 @@ private:
         case ConstantStoragePointer:
         case DoubleAsInt32:
         case ValueToInt32:
-        case HardPhantom: // HardPhantom would be trivial to handle but anyway we assert that we won't see it here yet.
+        case MustGenerate: // MustGenerate would be trivial to handle but anyway we assert that we won't see it here yet.
         case DoubleRep:
         case ValueRep:
         case Int52Rep:
@@ -2011,7 +2011,7 @@ private:
         case MovHint:
         case Phantom:
         case Check:
-        case HardPhantom:
+        case MustGenerate:
             DFG_NODE_DO_TO_CHILDREN(m_graph, m_currentNode, fixEdgeRepresentation);
             break;
             
index b840c53..607ae8c 100644 (file)
@@ -390,7 +390,7 @@ private:
     {
         Node* result = insertAdd(nodeIndex, origin, source, addend);
         m_insertionSet.insertNode(
-            nodeIndex, SpecNone, HardPhantom, origin, result->defaultEdge());
+            nodeIndex, SpecNone, MustGenerate, origin, result->defaultEdge());
         return result;
     }
     
index f2a1cc0..c142744 100644 (file)
@@ -71,7 +71,7 @@ bool mayExit(Graph& graph, Node* node)
     case Flush:
     case Phantom:
     case Check:
-    case HardPhantom:
+    case MustGenerate:
     case GetLocal:
     case LoopHint:
     case Phi:
index 5bd8c4a..bec5813 100644 (file)
@@ -1543,7 +1543,7 @@ struct Node {
         case ZombieHint:
             return true;
         case Phantom:
-        case HardPhantom:
+        case MustGenerate:
             return child1().useKindUnchecked() != UntypedUse || child2().useKindUnchecked() != UntypedUse || child3().useKindUnchecked() != UntypedUse;
         default:
             return shouldGenerate();
index d91230f..f82d912 100644 (file)
@@ -66,7 +66,7 @@ namespace JSC { namespace DFG {
     macro(MovHint, NodeMustGenerate) \
     macro(ZombieHint, NodeMustGenerate) \
     macro(Phantom, NodeMustGenerate) \
-    macro(HardPhantom, NodeMustGenerate) /* Like Phantom, but we never remove any of its children. */ \
+    macro(MustGenerate, NodeMustGenerate) /* Utility node for making soem not-usually-NodeMustGenerate node become like NodeMustGenerate. */ \
     macro(Check, NodeMustGenerate) /* Used if we want just a type check but not liveness. Non-checking uses will be removed. */\
     macro(Upsilon, NodeRelevantToOSR) \
     macro(Phi, NodeRelevantToOSR) \
index e3d68cc..4636f7d 100644 (file)
@@ -768,7 +768,7 @@ private:
         case MovHint:
         case Phantom:
         case Check:
-        case HardPhantom:
+        case MustGenerate:
         case StoreBarrier:
         case StoreBarrierWithNullCheck:
         case PutHint:
index 3a2cf5e..91184b1 100644 (file)
@@ -38,7 +38,7 @@
 namespace JSC { namespace DFG {
 
 static const NodeFlags NodeNeedsPhantom = NodeMiscFlag1;
-static const NodeFlags NodeNeedsHardPhantom = NodeMiscFlag2;
+static const NodeFlags NodeNeedsMustGenerate = NodeMiscFlag2;
 
 class PhantomCanonicalizationPhase : public Phase {
 public:
@@ -51,7 +51,7 @@ public:
     {
         ASSERT(m_graph.m_form == SSA);
         
-        m_graph.clearFlagsOnAllNodes(NodeNeedsPhantom | NodeNeedsHardPhantom | NodeRelevantToOSR);
+        m_graph.clearFlagsOnAllNodes(NodeNeedsPhantom | NodeNeedsMustGenerate | NodeRelevantToOSR);
         m_graph.mergeRelevantToOSR();
         
         for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
@@ -63,13 +63,13 @@ public:
             unsigned targetIndex = 0;
             while (sourceIndex < block->size()) {
                 Node* node = block->at(sourceIndex++);
-                if (node->op() == HardPhantom || node->op() == Phantom || node->op() == Check) {
+                if (node->op() == MustGenerate || node->op() == Phantom || node->op() == Check) {
                     for (unsigned i = 0; i < AdjacencyList::Size; ++i) {
                         Edge edge = node->children.child(i);
                         if (!edge)
                             break;
-                        if (node->op() == HardPhantom)
-                            edge->mergeFlags(NodeNeedsHardPhantom);
+                        if (node->op() == MustGenerate)
+                            edge->mergeFlags(NodeNeedsMustGenerate);
                         if ((edge->flags() & NodeRelevantToOSR) && node->op() == Phantom) {
                             // A Phantom on a node that is RelevantToOSR means that we need to keep
                             // a Phantom on this node instead of just having a Check.
@@ -101,9 +101,9 @@ public:
             
             for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
                 Node* node = block->at(nodeIndex);
-                if (node->flags() & NodeNeedsHardPhantom) {
+                if (node->flags() & NodeNeedsMustGenerate) {
                     insertionSet.insertNode(
-                        nodeIndex + 1, SpecNone, HardPhantom, node->origin, node->defaultEdge());
+                        nodeIndex + 1, SpecNone, MustGenerate, node->origin, node->defaultEdge());
                 } else if (node->flags() & NodeNeedsPhantom) {
                     insertionSet.insertNode(
                         nodeIndex + 1, SpecNone, Phantom, node->origin, node->defaultEdge());
index 8591b73..b843eed 100644 (file)
@@ -147,7 +147,7 @@ public:
                     break;
                 }
                     
-                case HardPhantom: {
+                case MustGenerate: {
                     if (node->children.isEmpty()) {
                         m_graph.m_allocator.free(node);
                         continue;
index 91a7f67..feb0a78 100644 (file)
@@ -534,7 +534,7 @@ private:
         case InvalidationPoint:
         case CheckInBounds:
         case ValueToInt32:
-        case HardPhantom:
+        case MustGenerate:
         case DoubleRep:
         case ValueRep:
         case Int52Rep:
index fbf6557..daa4ef8 100644 (file)
@@ -125,7 +125,7 @@ bool safeToExecute(AbstractStateType& state, Graph& graph, Node* node)
     case MovHint:
     case ZombieHint:
     case Phantom:
-    case HardPhantom:
+    case MustGenerate:
     case Upsilon:
     case Phi:
     case Flush:
index 4d16de9..37f4462 100644 (file)
@@ -4617,7 +4617,7 @@ void SpeculativeJIT::compile(Node* node)
         break;
 
     case Phantom:
-    case HardPhantom:
+    case MustGenerate:
     case Check:
         DFG_NODE_DO_TO_CHILDREN(m_jit.graph(), node, speculate);
         noResult(node);
index d4ade4b..698dc58 100644 (file)
@@ -4334,7 +4334,7 @@ void SpeculativeJIT::compile(Node* node)
         break;
 
     case Phantom:
-    case HardPhantom:
+    case MustGenerate:
     case Check:
         DFG_NODE_DO_TO_CHILDREN(m_jit.graph(), node, speculate);
         noResult(node);
index d0875b5..2f008a4 100644 (file)
@@ -244,7 +244,7 @@ private:
                 case GetIndexedPropertyStorage:
                 case GetTypedArrayByteOffset:
                 case Phantom:
-                case HardPhantom:
+                case MustGenerate:
                 case MovHint:
                 case MultiGetByOffset:
                 case MultiPutByOffset:
@@ -337,7 +337,7 @@ private:
                 case GetArrayLength:
                 case GetIndexedPropertyStorage:
                 case Phantom:
-                case HardPhantom:
+                case MustGenerate:
                 case MovHint:
                 case MultiGetByOffset:
                 case MultiPutByOffset:
index e27f4d5..62e30ed 100644 (file)
@@ -92,7 +92,7 @@ private:
             switch (node->op()) {
             case Phantom:
             case Check:
-            case HardPhantom:
+            case MustGenerate:
             case MovHint:
             case PutHint:
             case LoadVarargs:
@@ -214,7 +214,7 @@ private:
             switch (node->op()) {
             case Phantom:
             case Check:
-            case HardPhantom:
+            case MustGenerate:
             case MovHint:
             case PutHint:
                 // We don't need to change anything with these.
index 6802500..0daca76 100644 (file)
@@ -52,7 +52,7 @@ inline CapabilityLevel canCompile(Node* node)
     case MovHint:
     case ZombieHint:
     case Phantom:
-    case HardPhantom:
+    case MustGenerate:
     case Flush:
     case PhantomLocal:
     case SetArgument:
index 948d56d..90cb9aa 100644 (file)
@@ -464,7 +464,7 @@ private:
             compilePutStack();
             break;
         case Phantom:
-        case HardPhantom:
+        case MustGenerate:
         case Check:
             compilePhantom();
             break;