Rename SetArgument to SetArgumentDefinitely
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2019 20:47:16 +0000 (20:47 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2019 20:47:16 +0000 (20:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196828

Reviewed by Yusuke Suzuki.

This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=196712
where we will introduce a node named SetArgumentMaybe. Doing this refactoring
first will make reviewing that other patch easier.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
(JSC::DFG::CPSRethreadingPhase::specialCaseArguments):
(JSC::DFG::CPSRethreadingPhase::propagatePhis):
(JSC::DFG::CPSRethreadingPhase::computeIsFlushed):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGCommon.h:
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::methodOfGettingAValueProfileFor):
* dfg/DFGGraph.h:
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::initialize):
(JSC::DFG::InPlaceAbstractState::endBasicBlock):
* dfg/DFGLiveCatchVariablePreservationPhase.cpp:
(JSC::DFG::LiveCatchVariablePreservationPhase::handleBlockForTryCatch):
* dfg/DFGMaximalFlushInsertionPhase.cpp:
(JSC::DFG::MaximalFlushInsertionPhase::treatRegularBlock):
(JSC::DFG::MaximalFlushInsertionPhase::treatRootBlock):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.cpp:
(JSC::DFG::Node::hasVariableAccessData):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertPhantomToPhantomLocal):
* dfg/DFGNodeType.h:
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGPhantomInsertionPhase.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::run):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):

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

28 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp
Source/JavaScriptCore/dfg/DFGClobberize.h
Source/JavaScriptCore/dfg/DFGCommon.h
Source/JavaScriptCore/dfg/DFGDoesGC.cpp
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Source/JavaScriptCore/dfg/DFGGraph.cpp
Source/JavaScriptCore/dfg/DFGGraph.h
Source/JavaScriptCore/dfg/DFGInPlaceAbstractState.cpp
Source/JavaScriptCore/dfg/DFGLiveCatchVariablePreservationPhase.cpp
Source/JavaScriptCore/dfg/DFGMaximalFlushInsertionPhase.cpp
Source/JavaScriptCore/dfg/DFGMayExit.cpp
Source/JavaScriptCore/dfg/DFGNode.cpp
Source/JavaScriptCore/dfg/DFGNode.h
Source/JavaScriptCore/dfg/DFGNodeType.h
Source/JavaScriptCore/dfg/DFGOSREntrypointCreationPhase.cpp
Source/JavaScriptCore/dfg/DFGPhantomInsertionPhase.cpp
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp
Source/JavaScriptCore/dfg/DFGSafeToExecute.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/dfg/DFGTypeCheckHoistingPhase.cpp
Source/JavaScriptCore/dfg/DFGValidate.cpp
Source/JavaScriptCore/ftl/FTLCapabilities.cpp

index 642836e..669fc58 100644 (file)
@@ -1,3 +1,71 @@
+2019-04-11  Saam barati  <sbarati@apple.com>
+
+        Rename SetArgument to SetArgumentDefinitely
+        https://bugs.webkit.org/show_bug.cgi?id=196828
+
+        Reviewed by Yusuke Suzuki.
+
+        This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=196712
+        where we will introduce a node named SetArgumentMaybe. Doing this refactoring
+        first will make reviewing that other patch easier.
+
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::handleVarargsInlining):
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        * dfg/DFGCPSRethreadingPhase.cpp:
+        (JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
+        (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
+        (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
+        (JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
+        (JSC::DFG::CPSRethreadingPhase::specialCaseArguments):
+        (JSC::DFG::CPSRethreadingPhase::propagatePhis):
+        (JSC::DFG::CPSRethreadingPhase::computeIsFlushed):
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize):
+        * dfg/DFGCommon.h:
+        * dfg/DFGDoesGC.cpp:
+        (JSC::DFG::doesGC):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGGraph.cpp:
+        (JSC::DFG::Graph::methodOfGettingAValueProfileFor):
+        * dfg/DFGGraph.h:
+        * dfg/DFGInPlaceAbstractState.cpp:
+        (JSC::DFG::InPlaceAbstractState::initialize):
+        (JSC::DFG::InPlaceAbstractState::endBasicBlock):
+        * dfg/DFGLiveCatchVariablePreservationPhase.cpp:
+        (JSC::DFG::LiveCatchVariablePreservationPhase::handleBlockForTryCatch):
+        * dfg/DFGMaximalFlushInsertionPhase.cpp:
+        (JSC::DFG::MaximalFlushInsertionPhase::treatRegularBlock):
+        (JSC::DFG::MaximalFlushInsertionPhase::treatRootBlock):
+        * dfg/DFGMayExit.cpp:
+        * dfg/DFGNode.cpp:
+        (JSC::DFG::Node::hasVariableAccessData):
+        * dfg/DFGNode.h:
+        (JSC::DFG::Node::convertPhantomToPhantomLocal):
+        * dfg/DFGNodeType.h:
+        * dfg/DFGOSREntrypointCreationPhase.cpp:
+        (JSC::DFG::OSREntrypointCreationPhase::run):
+        * dfg/DFGPhantomInsertionPhase.cpp:
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        * dfg/DFGSSAConversionPhase.cpp:
+        (JSC::DFG::SSAConversionPhase::run):
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGTypeCheckHoistingPhase.cpp:
+        (JSC::DFG::TypeCheckHoistingPhase::run):
+        * dfg/DFGValidate.cpp:
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+
 2019-04-11  Truitt Savell  <tsavell@apple.com>
 
         Unreviewed, rolling out r244158.
index f33dc11..cf05921 100644 (file)
@@ -321,9 +321,9 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
         break;
     }
         
-    case SetArgument:
-        // Assert that the state of arguments has been set. SetArgument means that someone set
-        // the argument values out-of-band, and currently this always means setting to a
+    case SetArgumentDefinitely:
+        // Assert that the state of arguments has been set. SetArgumentDefinitely means
+        // that someone set the argument values out-of-band, and currently this always means setting to a
         // non-clear value.
         ASSERT(!m_state.operand(node->local()).isClear());
         break;
index 0626e79..a71d298 100644 (file)
@@ -1829,8 +1829,7 @@ bool ByteCodeParser::handleVarargsInlining(Node* callTargetNode, VirtualRegister
         ensureLocals(VirtualRegister(remappedRegisterOffset).toLocal());
         
         int argumentStart = registerOffset + CallFrame::headerSizeInRegisters;
-        int remappedArgumentStart =
-        m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).offset();
+        int remappedArgumentStart = m_inlineStackTop->remapOperand(VirtualRegister(argumentStart)).offset();
         
         LoadVarargsData* data = m_graph.m_loadVarargsData.add();
         data->start = VirtualRegister(remappedArgumentStart + 1);
@@ -1850,17 +1849,17 @@ bool ByteCodeParser::handleVarargsInlining(Node* callTargetNode, VirtualRegister
         addToGraph(Phantom, callTargetNode);
         
         // In DFG IR before SSA, we cannot insert control flow between after the
-        // LoadVarargs and the last SetArgument. This isn't a problem once we get to DFG
+        // LoadVarargs and the last SetArgumentDefinitely. This isn't a problem once we get to DFG
         // SSA. Fortunately, we also have other reasons for not inserting control flow
         // before SSA.
         
         VariableAccessData* countVariable = newVariableAccessData(VirtualRegister(remappedRegisterOffset + CallFrameSlot::argumentCount));
         // This is pretty lame, but it will force the count to be flushed as an int. This doesn't
-        // matter very much, since our use of a SetArgument and Flushes for this local slot is
+        // matter very much, since our use of a SetArgumentDefinitely and Flushes for this local slot is
         // mostly just a formality.
         countVariable->predict(SpecInt32Only);
         countVariable->mergeIsProfitableToUnbox(true);
-        Node* setArgumentCount = addToGraph(SetArgument, OpInfo(countVariable));
+        Node* setArgumentCount = addToGraph(SetArgumentDefinitely, OpInfo(countVariable));
         m_currentBlock->variablesAtTail.setOperand(countVariable->local(), setArgumentCount);
         
         set(VirtualRegister(argumentStart), get(thisArgument), ImmediateNakedSet);
@@ -1883,7 +1882,7 @@ bool ByteCodeParser::handleVarargsInlining(Node* callTargetNode, VirtualRegister
                 variable->predict(profile.computeUpdatedPrediction(locker));
             }
             
-            Node* setArgument = addToGraph(SetArgument, OpInfo(variable));
+            Node* setArgument = addToGraph(SetArgumentDefinitely, OpInfo(variable));
             m_currentBlock->variablesAtTail.setOperand(variable->local(), setArgument);
         }
     };
@@ -4670,7 +4669,7 @@ void ByteCodeParser::parseBlock(unsigned limit)
         ArgumentsVector& entrypointArguments = addResult.iterator->value;
         entrypointArguments.resize(m_numArguments);
 
-        // We will emit SetArgument nodes. They don't exit, but we're at the top of an op_enter so
+        // We will emit SetArgumentDefinitely nodes. They don't exit, but we're at the top of an op_enter so
         // exitOK = true.
         m_exitOK = true;
         for (unsigned argument = 0; argument < m_numArguments; ++argument) {
@@ -4681,7 +4680,7 @@ void ByteCodeParser::parseBlock(unsigned limit)
             variable->mergeCheckArrayHoistingFailed(
                 m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadIndexingType));
             
-            Node* setArgument = addToGraph(SetArgument, OpInfo(variable));
+            Node* setArgument = addToGraph(SetArgumentDefinitely, OpInfo(variable));
             entrypointArguments[argument] = setArgument;
             m_currentBlock->variablesAtTail.setArgumentFirstTime(argument, setArgument);
         }
@@ -6007,7 +6006,7 @@ void ByteCodeParser::parseBlock(unsigned limit)
             //
             // The nodes that follow here all exit to the following bytecode instruction, not
             // the op_catch. Exiting to op_catch is reserved for when an exception is thrown.
-            // The SetArgument nodes that follow below may exit because we may hoist type checks
+            // The SetArgumentDefinitely nodes that follow below may exit because we may hoist type checks
             // to them. The SetLocal nodes that follow below may exit because we may choose
             // a flush format that speculates on the type of the local.
             m_exitOK = true; 
@@ -6030,7 +6029,7 @@ void ByteCodeParser::parseBlock(unsigned limit)
                     variable->mergeCheckArrayHoistingFailed(
                         m_inlineStackTop->m_exitProfile.hasExitSite(exitBytecodeIndex, BadIndexingType));
 
-                    Node* setArgument = addToGraph(SetArgument, OpInfo(variable));
+                    Node* setArgument = addToGraph(SetArgumentDefinitely, OpInfo(variable));
                     setArgument->origin.forExit = CodeOrigin(exitBytecodeIndex, setArgument->origin.forExit.inlineCallFrame());
                     m_currentBlock->variablesAtTail.setArgumentFirstTime(argument, setArgument);
                     entrypointArguments[argument] = setArgument;
index 46752ff..7989249 100644 (file)
@@ -95,7 +95,7 @@ private:
                     }
                     switch (node->child1()->op()) {
                     case Phi:
-                    case SetArgument:
+                    case SetArgumentDefinitely:
                     case SetLocal:
                         node->convertPhantomToPhantomLocal();
                         break;
@@ -169,16 +169,16 @@ private:
                     m_block->variablesAtTail.atFor<operandKind>(idx) = node;
                     return;
                 }
-                ASSERT(otherNode->op() == SetLocal || otherNode->op() == SetArgument);
+                ASSERT(otherNode->op() == SetLocal || otherNode->op() == SetArgumentDefinitely);
                 break;
             default:
                 break;
             }
             
-            ASSERT(otherNode->op() == SetLocal || otherNode->op() == SetArgument || otherNode->op() == GetLocal);
+            ASSERT(otherNode->op() == SetLocal || otherNode->op() == SetArgumentDefinitely || otherNode->op() == GetLocal);
             ASSERT(otherNode->variableAccessData() == variable);
             
-            if (otherNode->op() == SetArgument) {
+            if (otherNode->op() == SetArgumentDefinitely) {
                 variable->setIsLoadedFrom(true);
                 node->children.setChild1(Edge(otherNode));
                 m_block->variablesAtTail.atFor<operandKind>(idx) = node;
@@ -230,7 +230,7 @@ private:
                 break;
             }
             
-            ASSERT(otherNode->op() == Phi || otherNode->op() == SetLocal || otherNode->op() == SetArgument);
+            ASSERT(otherNode->op() == Phi || otherNode->op() == SetLocal || otherNode->op() == SetArgumentDefinitely);
             
             if (nodeType == PhantomLocal && otherNode->op() == SetLocal) {
                 // PhantomLocal(SetLocal) doesn't make sense. PhantomLocal means: at this
@@ -297,12 +297,12 @@ private:
             // The rules for threaded CPS form:
             // 
             // Head variable: describes what is live at the head of the basic block.
-            // Head variable links may refer to Flush, PhantomLocal, Phi, or SetArgument.
-            // SetArgument may only appear in the root block.
+            // Head variable links may refer to Flush, PhantomLocal, Phi, or SetArgumentDefinitely.
+            // SetArgumentDefinitely may only appear in the root block.
             //
             // Tail variable: the last thing that happened to the variable in the block.
-            // It may be a Flush, PhantomLocal, GetLocal, SetLocal, SetArgument, or Phi.
-            // SetArgument may only appear in the root block. Note that if there ever
+            // It may be a Flush, PhantomLocal, GetLocal, SetLocal, SetArgumentDefinitely, or Phi.
+            // SetArgumentDefinitely may only appear in the root block. Note that if there ever
             // was a GetLocal to the variable, and it was followed by PhantomLocals and
             // Flushes but not SetLocals, then the tail variable will be the GetLocal.
             // This reflects the fact that you only care that the tail variable is a
@@ -311,22 +311,22 @@ private:
             // variable will be a SetLocal and not those subsequent Flushes.
             //
             // Child of GetLocal: the operation that the GetLocal keeps alive. It may be
-            // a Phi from the current block. For arguments, it may be a SetArgument.
+            // a Phi from the current block. For arguments, it may be a SetArgumentDefinitely.
             //
             // Child of SetLocal: must be a value producing node.
             //
             // Child of Flush: it may be a Phi from the current block or a SetLocal. For
-            // arguments it may also be a SetArgument.
+            // arguments it may also be a SetArgumentDefinitely.
             //
             // Child of PhantomLocal: it may be a Phi from the current block. For
-            // arguments it may also be a SetArgument.
+            // arguments it may also be a SetArgumentDefinitely.
             //
             // Children of Phi: other Phis in the same basic block, or any of the
-            // following from predecessor blocks: SetLocal, Phi, or SetArgument. These
-            // are computed by looking at the tail variables of the predecessor  blocks
-            // and either using it directly (if it's a SetLocal, Phi, or SetArgument) or
+            // following from predecessor blocks: SetLocal, Phi, or SetArgumentDefinitely.
+            // These are computed by looking at the tail variables of the predecessor blocks
+            // and either using it directly (if it's a SetLocal, Phi, or SetArgumentDefinitely) or
             // loading that nodes child (if it's a GetLocal, PhanomLocal, or Flush - all
-            // of these will have children that are SetLocal, Phi, or SetArgument).
+            // of these will have children that are SetLocal, Phi, or SetArgumentDefinitely).
             
             switch (node->op()) {
             case GetLocal:
@@ -345,7 +345,7 @@ private:
                 canonicalizeFlushOrPhantomLocal<PhantomLocal>(node);
                 break;
                 
-            case SetArgument:
+            case SetArgumentDefinitely:
                 canonicalizeSet(node);
                 break;
                 
@@ -365,7 +365,7 @@ private:
     
     void specialCaseArguments()
     {
-        // Normally, a SetArgument denotes the start of a live range for a local's value on the stack.
+        // Normally, a SetArgumentDefinitely denotes the start of a live range for a local's value on the stack.
         // But those SetArguments used for the actual arguments to the machine CodeBlock get
         // special-cased. We could have instead used two different node types - one for the arguments
         // at the prologue case, and another for the other uses. But this seemed like IR overkill.
@@ -420,7 +420,7 @@ private:
                 ASSERT(
                     variableInPrevious->op() == SetLocal
                     || variableInPrevious->op() == Phi
-                    || variableInPrevious->op() == SetArgument);
+                    || variableInPrevious->op() == SetArgumentDefinitely);
           
                 if (!currentPhi->child1()) {
                     currentPhi->children.setChild1(Edge(variableInPrevious));
@@ -482,7 +482,7 @@ private:
             Node* node = m_flushedLocalOpWorklist.takeLast();
             switch (node->op()) {
             case SetLocal:
-            case SetArgument:
+            case SetArgumentDefinitely:
                 break;
                 
             case Flush:
index 1a2d4ca..dec1588 100644 (file)
@@ -450,7 +450,7 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu
     case Upsilon:
     case Phi:
     case PhantomLocal:
-    case SetArgument:
+    case SetArgumentDefinitely:
     case Jump:
     case Branch:
     case Switch:
index 233c8eb..e231cfb 100644 (file)
@@ -173,7 +173,7 @@ enum GraphForm {
     // most likely) then it implies that the local is still live but that it need
     // not be stored to the stack necessarily. This implies that Phantom can
     // reference nodes that have no result, as long as those nodes are valid
-    // GetLocal children (i.e. Phi, SetLocal, SetArgument).
+    // GetLocal children (i.e. Phi, SetLocal, SetArgumentDefinitely).
     //
     // LoadStore form also implies that Phis need not have children. By default,
     // they end up having no children if you enter LoadStore using the canonical
index 130edf1..5071d21 100644 (file)
@@ -78,7 +78,7 @@ bool doesGC(Graph& graph, Node* node)
     case Phi:
     case Flush:
     case PhantomLocal:
-    case SetArgument:
+    case SetArgumentDefinitely:
     case ArithBitNot:
     case ArithBitAnd:
     case ArithBitOr:
index 71b91fe..e8aaf28 100644 (file)
@@ -2324,7 +2324,7 @@ private:
 
 #if !ASSERT_DISABLED
         // Have these no-op cases here to ensure that nobody forgets to add handlers for new opcodes.
-        case SetArgument:
+        case SetArgumentDefinitely:
         case JSConstant:
         case LazyJSConstant:
         case DoubleConstant:
index b61d5ba..ca96f64 100644 (file)
@@ -1612,7 +1612,7 @@ MethodOfGettingAValueProfile Graph::methodOfGettingAValueProfileFor(Node* curren
                 if (m_form != SSA && node->local().isArgument()) {
                     int argument = node->local().toArgument();
                     Node* argumentNode = m_rootToArguments.find(block(0))->value[argument];
-                    // FIXME: We should match SetArgument nodes at other entrypoints as well:
+                    // FIXME: We should match SetArgumentDefinitely nodes at other entrypoints as well:
                     // https://bugs.webkit.org/show_bug.cgi?id=175841
                     if (argumentNode && node->variableAccessData() == argumentNode->variableAccessData())
                         return &profiledBlock->valueProfileForArgument(argument);
index 5b0bc2f..e964fac 100644 (file)
@@ -985,7 +985,7 @@ public:
     
     Bag<StorageAccessData> m_storageAccessData;
     
-    // In CPS, this is all of the SetArgument nodes for the arguments in the machine code block
+    // In CPS, this is all of the SetArgumentDefinitely nodes for the arguments in the machine code block
     // that survived DCE. All of them except maybe "this" will survive DCE, because of the Flush
     // nodes. In SSA, this has no meaning. It's empty.
     HashMap<BasicBlock*, ArgumentsVector> m_rootToArguments;
index 115283a..1afb6bc 100644 (file)
@@ -133,7 +133,7 @@ void InPlaceAbstractState::initialize()
                 if (!node)
                     format = FlushedJSValue;
                 else {
-                    ASSERT(node->op() == SetArgument);
+                    ASSERT(node->op() == SetArgumentDefinitely);
                     format = node->variableAccessData()->flushFormat();
                 }
 
@@ -234,7 +234,7 @@ bool InPlaceAbstractState::endBasicBlock()
             
             switch (node->op()) {
             case Phi:
-            case SetArgument:
+            case SetArgumentDefinitely:
             case PhantomLocal:
             case Flush: {
                 // The block transfers the value from head to tail.
index 3b2d9ef..e2b19d6 100644 (file)
@@ -198,7 +198,7 @@ public:
                 currentExceptionHandler = newHandler;
             }
 
-            if (currentExceptionHandler && (node->op() == SetLocal || node->op() == SetArgument)) {
+            if (currentExceptionHandler && (node->op() == SetLocal || node->op() == SetArgumentDefinitely)) {
                 InlineCallFrame* inlineCallFrame = node->origin.semantic.inlineCallFrame();
                 if (inlineCallFrame)
                     seenInlineCallFrames.add(inlineCallFrame);
index 9e08442..57dbea3 100644 (file)
@@ -70,13 +70,13 @@ public:
             for (unsigned i = 0; i < block->size(); i++) {
                 Node* node = block->at(i);
                 bool isPrimordialSetArgument = false;
-                if (node->op() == SetArgument && node->local().isArgument()) {
+                if (node->op() == SetArgumentDefinitely && node->local().isArgument()) {
                     auto iter = m_graph.m_rootToArguments.find(block);
                     if (iter != m_graph.m_rootToArguments.end())
                         isPrimordialSetArgument = node == iter->value[node->local().toArgument()];
                 }
 
-                if (node->op() == SetLocal || (node->op() == SetArgument && !isPrimordialSetArgument)) {
+                if (node->op() == SetLocal || (node->op() == SetArgumentDefinitely && !isPrimordialSetArgument)) {
                     VirtualRegister operand = node->local();
                     VariableAccessData* flushAccessData = currentBlockAccessData.operand(operand);
                     if (!flushAccessData)
@@ -136,7 +136,7 @@ public:
 
         for (unsigned i = 0; i < block->variablesAtTail.numberOfLocals(); i++) {
             VirtualRegister operand = virtualRegisterForLocal(i);
-            DFG_ASSERT(m_graph, nullptr, initialAccessNodes.operand(operand)->op() == Flush); // We should have inserted a Flush before any SetLocal/SetArgument for the local that we are analyzing now.
+            DFG_ASSERT(m_graph, nullptr, initialAccessNodes.operand(operand)->op() == Flush); // We should have inserted a Flush before any SetLocal/SetArgumentDefinitely for the local that we are analyzing now.
             VariableAccessData* accessData = initialAccessData.operand(operand);
             DFG_ASSERT(m_graph, nullptr, accessData);
             insertionSet.insertNode(0, SpecNone, 
index 7ef5c4b..c26203a 100644 (file)
@@ -47,7 +47,7 @@ ExitMode mayExitImpl(Graph& graph, Node* node, StateType& state)
     // This is a carefully curated list of nodes that definitely do not exit. We try to be very
     // conservative when maintaining this list, because adding new node types to it doesn't
     // generally make things a lot better but it might introduce subtle bugs.
-    case SetArgument:
+    case SetArgumentDefinitely:
     case JSConstant:
     case DoubleConstant:
     case LazyJSConstant:
index 3d1c3ba..ef14f44 100644 (file)
@@ -73,7 +73,7 @@ bool Node::hasVariableAccessData(Graph& graph)
         return graph.m_form != SSA;
     case GetLocal:
     case SetLocal:
-    case SetArgument:
+    case SetArgumentDefinitely:
     case Flush:
     case PhantomLocal:
         return true;
index 1c54485..bb761b8 100644 (file)
@@ -683,7 +683,7 @@ public:
 
     void convertPhantomToPhantomLocal()
     {
-        ASSERT(m_op == Phantom && (child1()->op() == Phi || child1()->op() == SetLocal || child1()->op() == SetArgument));
+        ASSERT(m_op == Phantom && (child1()->op() == Phi || child1()->op() == SetLocal || child1()->op() == SetArgumentDefinitely));
         m_op = PhantomLocal;
         m_opInfo = child1()->m_opInfo; // Copy the variableAccessData.
         children.setChild1(Edge());
index 95d13a3..d82b3b5 100644 (file)
@@ -104,7 +104,7 @@ namespace JSC { namespace DFG {
     macro(CheckTierUpAtReturn, NodeMustGenerate) \
     \
     /* Marker for an argument being set at the prologue of a function. */\
-    macro(SetArgument, 0) \
+    macro(SetArgumentDefinitely, 0) \
     \
     /* Marker of location in the IR where we may possibly perform jump replacement to */\
     /* invalidate this code block. */\
index ed52c0b..9e6cc6f 100644 (file)
@@ -117,11 +117,11 @@ public:
         for (int argument = 0; argument < baseline->numParameters(); ++argument) {
             Node* oldNode = target->variablesAtHead.argument(argument);
             if (!oldNode) {
-                // Just for sanity, always have a SetArgument even if it's not needed.
+                // Just for sanity, always have a SetArgumentDefinitely even if it's not needed.
                 oldNode = newArguments[argument];
             }
             Node* node = newRoot->appendNode(
-                m_graph, SpecNone, SetArgument, origin,
+                m_graph, SpecNone, SetArgumentDefinitely, origin,
                 OpInfo(oldNode->variableAccessData()));
             newArguments[argument] = node;
         }
index 3c088a6..0ea2a7e 100644 (file)
@@ -116,7 +116,7 @@ private:
                 break;
 
             case GetLocal:
-            case SetArgument:
+            case SetArgumentDefinitely:
                 m_values.operand(node->local()) = nullptr;
                 break;
                 
index 629dbe4..0fc70d4 100644 (file)
@@ -1251,7 +1251,7 @@ private:
         case ProfileType:
         case ProfileControlFlow:
         case ForceOSRExit:
-        case SetArgument:
+        case SetArgumentDefinitely:
         case SetFunctionName:
         case CheckStructure:
         case CheckCell:
index fa396e8..a3117bf 100644 (file)
@@ -134,7 +134,7 @@ public:
             m_ssaVariableForVariable.add(&variable, ssaVariable);
         }
         
-        // Find all SetLocals and create Defs for them. We handle SetArgument by creating a
+        // Find all SetLocals and create Defs for them. We handle SetArgumentDefinitely by creating a
         // GetLocal, and recording the flush format.
         for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
             BasicBlock* block = m_graph.block(blockIndex);
@@ -145,7 +145,7 @@ public:
             // assignment for every local.
             for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
                 Node* node = block->at(nodeIndex);
-                if (node->op() != SetLocal && node->op() != SetArgument)
+                if (node->op() != SetLocal && node->op() != SetArgumentDefinitely)
                     continue;
                 
                 VariableAccessData* variable = node->variableAccessData();
@@ -154,7 +154,7 @@ public:
                 if (node->op() == SetLocal)
                     childNode = node->child1().node();
                 else {
-                    ASSERT(node->op() == SetArgument);
+                    ASSERT(node->op() == SetArgumentDefinitely);
                     childNode = m_insertionSet.insertNode(
                         nodeIndex, node->variableAccessData()->prediction(),
                         GetStack, node->origin,
@@ -255,12 +255,12 @@ public:
         //
         //   - SetLocal turns into PutStack if it's flushed, or turns into a Check otherwise.
         //
-        //   - Flush loses its children and turns into a Phantom.
+        //   - Flush is removed.
         //
         //   - PhantomLocal becomes Phantom, and its child is whatever is specified by
         //     valueForOperand.
         //
-        //   - SetArgument is removed. Note that GetStack nodes have already been inserted.
+        //   - SetArgumentDefinitely is removed. Note that GetStack nodes have already been inserted.
         Operands<Node*> valueForOperand(OperandsLike, m_graph.block(0)->variablesAtHead);
         for (BasicBlock* block : m_graph.blocksInPreOrder()) {
             valueForOperand.clear();
@@ -388,11 +388,11 @@ public:
                     break;
                 }
                     
-                case SetArgument: {
+                case SetArgumentDefinitely: {
                     node->remove(m_graph);
                     break;
                 }
-                    
+
                 default:
                     break;
                 }
index 1cf15c4..7d7df53 100644 (file)
@@ -197,7 +197,7 @@ bool safeToExecute(AbstractStateType& state, Graph& graph, Node* node, bool igno
     case Phi:
     case Flush:
     case PhantomLocal:
-    case SetArgument:
+    case SetArgumentDefinitely:
     case ArithBitNot:
     case ArithBitAnd:
     case ArithBitOr:
index e841cd2..7111acf 100644 (file)
@@ -1912,7 +1912,7 @@ void SpeculativeJIT::checkArgumentTypes()
             continue;
         }
         
-        ASSERT(node->op() == SetArgument);
+        ASSERT(node->op() == SetArgumentDefinitely);
         ASSERT(node->shouldGenerate());
 
         VariableAccessData* variableAccessData = node->variableAccessData();
index 06f5b60..614ed4d 100644 (file)
@@ -1972,7 +1972,7 @@ void SpeculativeJIT::compile(Node* node)
         break;
     }
 
-    case SetArgument:
+    case SetArgumentDefinitely:
         // This is a no-op; it just marks the fact that the argument is being used.
         // But it may be profitable to use this as a hook to run speculation checks
         // on arguments, thereby allowing us to trivially eliminate such checks if
index f83e550..1d27a8f 100644 (file)
@@ -2071,7 +2071,7 @@ void SpeculativeJIT::compile(Node* node)
         break;
     }
 
-    case SetArgument:
+    case SetArgumentDefinitely:
         // This is a no-op; it just marks the fact that the argument is being used.
         // But it may be profitable to use this as a hook to run speculation checks
         // on arguments, thereby allowing us to trivially eliminate such checks if
index 5249f7d..60fbf89 100644 (file)
@@ -122,10 +122,10 @@ public:
                 // cases where we need to append, we first carefully extract everything we need
                 // from the node, before doing any appending.
                 switch (node->op()) {
-                case SetArgument: {
+                case SetArgumentDefinitely: {
                     // Insert a GetLocal and a CheckStructure immediately following this
-                    // SetArgument, if the variable was a candidate for structure hoisting.
-                    // If the basic block previously only had the SetArgument as its
+                    // SetArgumentDefinitely, if the variable was a candidate for structure hoisting.
+                    // If the basic block previously only had the SetArgumentDefinitely as its
                     // variable-at-tail, then replace it with this GetLocal.
                     VariableAccessData* variable = node->variableAccessData();
                     HashMap<VariableAccessData*, CheckData>::iterator iter = m_map.find(variable);
index abd1ab2..daa3c83 100644 (file)
@@ -493,7 +493,7 @@ private:
                     VALIDATE(
                         (node, edge),
                         edge->op() == SetLocal
-                        || edge->op() == SetArgument
+                        || edge->op() == SetArgumentDefinitely
                         || edge->op() == Flush
                         || edge->op() == Phi);
                     
@@ -504,7 +504,7 @@ private:
                         VALIDATE(
                             (node, edge),
                             edge->op() == SetLocal
-                            || edge->op() == SetArgument
+                            || edge->op() == SetArgumentDefinitely
                             || edge->op() == Flush);
                         
                         continue;
@@ -536,7 +536,7 @@ private:
                         VALIDATE(
                             (local, block->predecessors[k], prevNode),
                             prevNode->op() == SetLocal
-                            || prevNode->op() == SetArgument
+                            || prevNode->op() == SetArgumentDefinitely
                             || prevNode->op() == Phi);
                         if (prevNode == edge.node()) {
                             found = true;
@@ -676,9 +676,9 @@ private:
                         break;
                     setLocalPositions.operand(node->local()) = i;
                     break;
-                case SetArgument:
+                case SetArgumentDefinitely:
                     // This acts like a reset. It's ok to have a second GetLocal for a local in the same
-                    // block if we had a SetArgument for that local.
+                    // block if we had a SetArgumentDefinitely for that local.
                     getLocalPositions.operand(node->local()) = notSet;
                     setLocalPositions.operand(node->local()) = notSet;
                     break;
@@ -739,7 +739,7 @@ private:
                     
                 case GetLocal:
                 case SetLocal:
-                case SetArgument:
+                case SetArgumentDefinitely:
                 case Phantom:
                     VALIDATE((node), !"bad node type for SSA");
                     break;
index 8aeaca7..e729d35 100644 (file)
@@ -56,7 +56,7 @@ inline CapabilityLevel canCompile(Node* node)
     case Phantom:
     case Flush:
     case PhantomLocal:
-    case SetArgument:
+    case SetArgumentDefinitely:
     case Return:
     case ArithBitNot:
     case ArithBitAnd: