<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[260803] trunk/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/260803">260803</a></dd>
<dt>Author</dt> <dd>keith_miller@apple.com</dd>
<dt>Date</dt> <dd>2020-04-27 17:51:50 -0700 (Mon, 27 Apr 2020)</dd>
</dl>

<h3>Log Message</h3>
<pre>OSR Exit compiler should know and print the exiting DFG node's index
https://bugs.webkit.org/show_bug.cgi?id=210998

Reviewed by Mark Lam.

The only interesting thing here is that we set the node to index 0 if there is no node.
AFAICT, we only don't have a node when we are checking arguments.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::OSRExit):
(JSC::DFG::operationCompileOSRExit):
* dfg/DFGOSRExitBase.h:
(JSC::DFG::OSRExitBase::OSRExitBase):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
(JSC::FTL::DFG::LowerDFGToB3::blessSpeculation):
* ftl/FTLOSRExit.cpp:
(JSC::FTL::OSRExitDescriptor::emitOSRExit):
(JSC::FTL::OSRExitDescriptor::emitOSRExitLater):
(JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
(JSC::FTL::OSRExit::OSRExit):
* ftl/FTLOSRExit.h:
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOSRExitcpp">trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOSRExitBaseh">trunk/Source/JavaScriptCore/dfg/DFGOSRExitBase.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLLowerDFGToB3cpp">trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOSRExitcpp">trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOSRExith">trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOSRExitCompilercpp">trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandlecpp">trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandleh">trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/ChangeLog       2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2020-04-27  Keith Miller  <keith_miller@apple.com>
+
+        OSR Exit compiler should know and print the exiting DFG node's index
+        https://bugs.webkit.org/show_bug.cgi?id=210998
+
+        Reviewed by Mark Lam.
+
+        The only interesting thing here is that we set the node to index 0 if there is no node.
+        AFAICT, we only don't have a node when we are checking arguments.
+
+        * dfg/DFGOSRExit.cpp:
+        (JSC::DFG::OSRExit::OSRExit):
+        (JSC::DFG::operationCompileOSRExit):
+        * dfg/DFGOSRExitBase.h:
+        (JSC::DFG::OSRExitBase::OSRExitBase):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileInvalidationPoint):
+        (JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
+        (JSC::FTL::DFG::LowerDFGToB3::blessSpeculation):
+        * ftl/FTLOSRExit.cpp:
+        (JSC::FTL::OSRExitDescriptor::emitOSRExit):
+        (JSC::FTL::OSRExitDescriptor::emitOSRExitLater):
+        (JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
+        (JSC::FTL::OSRExit::OSRExit):
+        * ftl/FTLOSRExit.h:
+        * ftl/FTLOSRExitCompiler.cpp:
+        (JSC::FTL::compileStub):
+
</ins><span class="cx"> 2020-04-27  Saam Barati  <sbarati@apple.com>
</span><span class="cx"> 
</span><span class="cx">         compilePeepHoleBigInt32Branch needs to handle all conditions
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOSRExitcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp   2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp      2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> namespace JSC { namespace DFG {
</span><span class="cx"> 
</span><span class="cx"> OSRExit::OSRExit(ExitKind kind, JSValueSource jsValueSource, MethodOfGettingAValueProfile valueProfile, SpeculativeJIT* jit, unsigned streamIndex, unsigned recoveryIndex)
</span><del>-    : OSRExitBase(kind, jit->m_origin.forExit, jit->m_origin.semantic, jit->m_origin.wasHoisted)
</del><ins>+    : OSRExitBase(kind, jit->m_origin.forExit, jit->m_origin.semantic, jit->m_origin.wasHoisted, jit->m_currentNode ? jit->m_currentNode->index() : 0)
</ins><span class="cx">     , m_jsValueSource(jsValueSource)
</span><span class="cx">     , m_valueProfile(valueProfile)
</span><span class="cx">     , m_recoveryIndex(recoveryIndex)
</span><span class="lines">@@ -209,8 +209,8 @@
</span><span class="cx">         exit.m_code = FINALIZE_CODE_IF(
</span><span class="cx">             shouldDumpDisassembly() || Options::verboseOSR() || Options::verboseDFGOSRExit(),
</span><span class="cx">             patchBuffer, OSRExitPtrTag,
</span><del>-            "DFG OSR exit #%u (%s, %s) from %s, with operands = %s",
-                exitIndex, toCString(exit.m_codeOrigin).data(),
</del><ins>+            "DFG OSR exit #%u (D@%u, %s, %s) from %s, with operands = %s",
+                exitIndex, exit.m_dfgNodeIndex, toCString(exit.m_codeOrigin).data(),
</ins><span class="cx">                 exitKindToString(exit.m_kind), toCString(*codeBlock).data(),
</span><span class="cx">                 toCString(ignoringContext<DumpContext>(operands)).data());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOSRExitBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOSRExitBase.h (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOSRExitBase.h 2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/dfg/DFGOSRExitBase.h    2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -39,11 +39,12 @@
</span><span class="cx"> // and the FTL.
</span><span class="cx"> 
</span><span class="cx"> struct OSRExitBase {
</span><del>-    OSRExitBase(ExitKind kind, CodeOrigin origin, CodeOrigin originForProfile, bool wasHoisted)
</del><ins>+    OSRExitBase(ExitKind kind, CodeOrigin origin, CodeOrigin originForProfile, bool wasHoisted, uint32_t dfgNodeIndex)
</ins><span class="cx">         : m_kind(kind)
</span><span class="cx">         , m_wasHoisted(wasHoisted)
</span><span class="cx">         , m_codeOrigin(origin)
</span><span class="cx">         , m_codeOriginForExitProfile(originForProfile)
</span><ins>+        , m_dfgNodeIndex(dfgNodeIndex)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(m_codeOrigin.isSet());
</span><span class="cx">         ASSERT(m_codeOriginForExitProfile.isSet());
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx">     CodeOrigin m_codeOrigin;
</span><span class="cx">     CodeOrigin m_codeOriginForExitProfile;
</span><span class="cx">     CallSiteIndex m_exceptionHandlerCallSiteIndex;
</span><ins>+    uint32_t m_dfgNodeIndex;
</ins><span class="cx"> 
</span><span class="cx">     ALWAYS_INLINE bool isExceptionHandler() const
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLLowerDFGToB3cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp      2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp 2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -353,6 +353,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             m_node = nullptr;
</span><ins>+            m_nodeIndexInGraph = 0;
</ins><span class="cx">             m_origin = NodeOrigin(CodeOrigin(BytecodeIndex(0)), CodeOrigin(BytecodeIndex(0)), true);
</span><span class="cx"> 
</span><span class="cx">             // Check Arguments.
</span><span class="lines">@@ -511,8 +512,8 @@
</span><span class="cx">         m_state.reset();
</span><span class="cx">         m_state.beginBasicBlock(m_highBlock);
</span><span class="cx">         
</span><del>-        for (m_nodeIndex = 0; m_nodeIndex < m_highBlock->size(); ++m_nodeIndex) {
-            if (!compileNode(m_nodeIndex))
</del><ins>+        for (unsigned nodeIndex = 0; nodeIndex < m_highBlock->size(); ++nodeIndex) {
+            if (!compileNode(nodeIndex))
</ins><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -675,6 +676,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         m_node = m_highBlock->at(nodeIndex);
</span><ins>+        m_nodeIndexInGraph = m_node->index();
</ins><span class="cx">         m_origin = m_node->origin;
</span><span class="cx">         m_out.setOrigin(m_node);
</span><span class="cx">         
</span><span class="lines">@@ -10814,6 +10816,7 @@
</span><span class="cx">         
</span><span class="cx">         State* state = &m_ftlState;
</span><span class="cx"> 
</span><ins>+        auto nodeIndex = m_nodeIndexInGraph;
</ins><span class="cx">         patchpoint->setGenerator(
</span><span class="cx">             [=] (CCallHelpers& jit, const B3::StackmapGenerationParams& params) {
</span><span class="cx">                 // The MacroAssembler knows more about this than B3 does. The watchpointLabel() method
</span><span class="lines">@@ -10822,7 +10825,7 @@
</span><span class="cx">                 CCallHelpers::Label label = jit.watchpointLabel();
</span><span class="cx"> 
</span><span class="cx">                 RefPtr<OSRExitHandle> handle = descriptor->emitOSRExitLater(
</span><del>-                    *state, UncountableInvalidation, origin, params);
</del><ins>+                    *state, UncountableInvalidation, origin, params, nodeIndex, 0);
</ins><span class="cx"> 
</span><span class="cx">                 RefPtr<JITCode> jitCode = state->jitCode.get();
</span><span class="cx"> 
</span><span class="lines">@@ -13880,6 +13883,7 @@
</span><span class="cx">         Node* node = m_node;
</span><span class="cx">         JSValue child1Constant = m_state.forNode(m_node->child1()).value();
</span><span class="cx"> 
</span><ins>+        auto nodeIndex = m_nodeIndexInGraph;
</ins><span class="cx">         patchpoint->setGenerator(
</span><span class="cx">             [=] (CCallHelpers& jit, const StackmapGenerationParams& params) {
</span><span class="cx">                 AllowMacroScratchRegisterUsage allowScratch(jit);
</span><span class="lines">@@ -13896,7 +13900,7 @@
</span><span class="cx">                 for (unsigned i = 0; i < domJIT->numFPScratchRegisters; ++i)
</span><span class="cx">                     fpScratch.append(params.fpScratch(i));
</span><span class="cx"> 
</span><del>-                RefPtr<OSRExitHandle> handle = exitDescriptor->emitOSRExitLater(*state, BadType, origin, params, osrExitArgumentOffset);
</del><ins>+                RefPtr<OSRExitHandle> handle = exitDescriptor->emitOSRExitLater(*state, BadType, origin, params, nodeIndex, osrExitArgumentOffset);
</ins><span class="cx"> 
</span><span class="cx">                 SnippetParams domJITParams(*state, params, node, nullptr, WTFMove(regs), WTFMove(gpScratch), WTFMove(fpScratch));
</span><span class="cx">                 CCallHelpers::JumpList failureCases = domJIT->generator()->run(jit, domJITParams);
</span><span class="lines">@@ -18586,7 +18590,7 @@
</span><span class="cx">         HandlerInfo* exceptionHandler;
</span><span class="cx">         bool willCatchException = m_graph.willCatchExceptionInMachineFrame(m_origin.forExit, opCatchOrigin, exceptionHandler);
</span><span class="cx">         if (!willCatchException)
</span><del>-            return PatchpointExceptionHandle::defaultHandle(m_ftlState);
</del><ins>+            return PatchpointExceptionHandle::defaultHandle(m_ftlState, m_nodeIndexInGraph);
</ins><span class="cx"> 
</span><span class="cx">         dataLogLnIf(verboseCompilationEnabled(), "    Patchpoint exception OSR exit #", m_ftlState.jitCode->osrExitDescriptors.size(), " with availability: ", availabilityMap());
</span><span class="cx"> 
</span><span class="lines">@@ -18609,7 +18613,7 @@
</span><span class="cx">             ValueRep::LateColdAny);
</span><span class="cx"> 
</span><span class="cx">         return PatchpointExceptionHandle::create(
</span><del>-            m_ftlState, exitDescriptor, origin, offset, *exceptionHandler);
</del><ins>+            m_ftlState, exitDescriptor, origin, m_nodeIndexInGraph, offset, *exceptionHandler);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     LBasicBlock lowBlock(DFG::BasicBlock* block)
</span><span class="lines">@@ -18688,10 +18692,11 @@
</span><span class="cx">         value->appendColdAnys(buildExitArguments(exitDescriptor, origin.forExit, lowValue));
</span><span class="cx"> 
</span><span class="cx">         State* state = &m_ftlState;
</span><ins>+        auto nodeIndex = m_nodeIndexInGraph;
</ins><span class="cx">         value->setGenerator(
</span><span class="cx">             [=] (CCallHelpers& jit, const B3::StackmapGenerationParams& params) {
</span><span class="cx">                 exitDescriptor->emitOSRExit(
</span><del>-                    *state, kind, origin, jit, params, 0);
</del><ins>+                    *state, kind, origin, jit, params, nodeIndex, 0);
</ins><span class="cx">             });
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -19186,7 +19191,7 @@
</span><span class="cx">     LBasicBlock m_nextLowBlock;
</span><span class="cx"> 
</span><span class="cx">     NodeOrigin m_origin;
</span><del>-    unsigned m_nodeIndex;
</del><ins>+    unsigned m_nodeIndexInGraph { 0 };
</ins><span class="cx">     Node* m_node;
</span><span class="cx"> 
</span><span class="cx">     // These are used for validating AI state.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOSRExitcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp   2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp      2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -65,10 +65,10 @@
</span><span class="cx"> 
</span><span class="cx"> Ref<OSRExitHandle> OSRExitDescriptor::emitOSRExit(
</span><span class="cx">     State& state, ExitKind exitKind, const NodeOrigin& nodeOrigin, CCallHelpers& jit,
</span><del>-    const StackmapGenerationParams& params, unsigned offset)
</del><ins>+    const StackmapGenerationParams& params, uint32_t dfgNodeIndex, unsigned offset)
</ins><span class="cx"> {
</span><span class="cx">     Ref<OSRExitHandle> handle =
</span><del>-        prepareOSRExitHandle(state, exitKind, nodeOrigin, params, offset);
</del><ins>+        prepareOSRExitHandle(state, exitKind, nodeOrigin, params, dfgNodeIndex, offset);
</ins><span class="cx">     handle->emitExitThunk(state, jit);
</span><span class="cx">     return handle;
</span><span class="cx"> }
</span><span class="lines">@@ -75,10 +75,10 @@
</span><span class="cx"> 
</span><span class="cx"> Ref<OSRExitHandle> OSRExitDescriptor::emitOSRExitLater(
</span><span class="cx">     State& state, ExitKind exitKind, const NodeOrigin& nodeOrigin,
</span><del>-    const StackmapGenerationParams& params, unsigned offset)
</del><ins>+    const StackmapGenerationParams& params, uint32_t dfgNodeIndex, unsigned offset)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr<OSRExitHandle> handle =
</span><del>-        prepareOSRExitHandle(state, exitKind, nodeOrigin, params, offset);
</del><ins>+        prepareOSRExitHandle(state, exitKind, nodeOrigin, params, dfgNodeIndex, offset);
</ins><span class="cx">     params.addLatePath(
</span><span class="cx">         [handle, &state] (CCallHelpers& jit) {
</span><span class="cx">             handle->emitExitThunk(state, jit);
</span><span class="lines">@@ -88,11 +88,11 @@
</span><span class="cx"> 
</span><span class="cx"> Ref<OSRExitHandle> OSRExitDescriptor::prepareOSRExitHandle(
</span><span class="cx">     State& state, ExitKind exitKind, const NodeOrigin& nodeOrigin,
</span><del>-    const StackmapGenerationParams& params, unsigned offset)
</del><ins>+    const StackmapGenerationParams& params, uint32_t dfgNodeIndex, unsigned offset)
</ins><span class="cx"> {
</span><span class="cx">     unsigned index = state.jitCode->osrExit.size();
</span><span class="cx">     OSRExit& exit = state.jitCode->osrExit.alloc(
</span><del>-        this, exitKind, nodeOrigin.forExit, nodeOrigin.semantic, nodeOrigin.wasHoisted);
</del><ins>+        this, exitKind, nodeOrigin.forExit, nodeOrigin.semantic, nodeOrigin.wasHoisted, dfgNodeIndex);
</ins><span class="cx">     Ref<OSRExitHandle> handle = adoptRef(*new OSRExitHandle(index, exit));
</span><span class="cx">     for (unsigned i = offset; i < params.size(); ++i)
</span><span class="cx">         exit.m_valueReps.append(params[i]);
</span><span class="lines">@@ -102,8 +102,8 @@
</span><span class="cx"> 
</span><span class="cx"> OSRExit::OSRExit(
</span><span class="cx">     OSRExitDescriptor* descriptor, ExitKind exitKind, CodeOrigin codeOrigin,
</span><del>-    CodeOrigin codeOriginForExitProfile, bool wasHoisted)
-    : OSRExitBase(exitKind, codeOrigin, codeOriginForExitProfile, wasHoisted)
</del><ins>+    CodeOrigin codeOriginForExitProfile, bool wasHoisted, uint32_t dfgNodeIndex)
+    : OSRExitBase(exitKind, codeOrigin, codeOriginForExitProfile, wasHoisted, dfgNodeIndex)
</ins><span class="cx">     , m_descriptor(descriptor)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOSRExith"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h     2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h        2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">     // this call, the OSRExit is simply ready to go.
</span><span class="cx">     Ref<OSRExitHandle> emitOSRExit(
</span><span class="cx">         State&, ExitKind, const DFG::NodeOrigin&, CCallHelpers&, const B3::StackmapGenerationParams&,
</span><del>-        unsigned offset = 0);
</del><ins>+        uint32_t dfgNodeIndex, unsigned offset);
</ins><span class="cx"> 
</span><span class="cx">     // In some cases you want an OSRExit to come into existence, but you don't want to emit it right now.
</span><span class="cx">     // This will emit the OSR exit in a late path. You can't be sure exactly when that will happen, but
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">     // eventually gets access to its label.
</span><span class="cx">     Ref<OSRExitHandle> emitOSRExitLater(
</span><span class="cx">         State&, ExitKind, const DFG::NodeOrigin&, const B3::StackmapGenerationParams&,
</span><del>-        unsigned offset = 0);
</del><ins>+        uint32_t dfgNodeIndex, unsigned offset);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // This is the low-level interface. It will create a handle representing the desire to emit code for
</span><span class="lines">@@ -112,11 +112,11 @@
</span><span class="cx">     // that the above two APIs are written in terms of this and OSRExitHandle::emitExitThunk().
</span><span class="cx">     Ref<OSRExitHandle> prepareOSRExitHandle(
</span><span class="cx">         State&, ExitKind, const DFG::NodeOrigin&, const B3::StackmapGenerationParams&,
</span><del>-        unsigned offset = 0);
</del><ins>+        uint32_t dfgNodeIndex, unsigned offset);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct OSRExit : public DFG::OSRExitBase {
</span><del>-    OSRExit(OSRExitDescriptor*, ExitKind, CodeOrigin, CodeOrigin codeOriginForExitProfile, bool wasHoisted);
</del><ins>+    OSRExit(OSRExitDescriptor*, ExitKind, CodeOrigin, CodeOrigin codeOriginForExitProfile, bool wasHoisted, uint32_t dfgNodeIndex);
</ins><span class="cx"> 
</span><span class="cx">     OSRExitDescriptor* m_descriptor;
</span><span class="cx">     MacroAssemblerCodeRef<OSRExitPtrTag> m_code;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOSRExitCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp   2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp      2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -532,8 +532,8 @@
</span><span class="cx">     exit.m_code = FINALIZE_CODE_IF(
</span><span class="cx">         shouldDumpDisassembly() || Options::verboseOSR() || Options::verboseFTLOSRExit(),
</span><span class="cx">         patchBuffer, OSRExitPtrTag,
</span><del>-        "FTL OSR exit #%u (%s, %s) from %s, with operands = %s",
-            exitID, toCString(exit.m_codeOrigin).data(),
</del><ins>+        "FTL OSR exit #%u (D@%u, %s, %s) from %s, with operands = %s",
+            exitID, exit.m_dfgNodeIndex, toCString(exit.m_codeOrigin).data(),
</ins><span class="cx">             exitKindToString(exit.m_kind), toCString(*codeBlock).data(),
</span><span class="cx">             toCString(ignoringContext<DumpContext>(exit.m_descriptor->m_values)).data()
</span><span class="cx">         );
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp 2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp    2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -39,17 +39,17 @@
</span><span class="cx"> using namespace DFG;
</span><span class="cx"> 
</span><span class="cx"> Ref<PatchpointExceptionHandle> PatchpointExceptionHandle::create(
</span><del>-    State& state, OSRExitDescriptor* descriptor, NodeOrigin origin, unsigned offset,
</del><ins>+    State& state, OSRExitDescriptor* descriptor, NodeOrigin origin, unsigned dfgNodeIndex, unsigned offset,
</ins><span class="cx">     const HandlerInfo& handler)
</span><span class="cx"> {
</span><del>-    return adoptRef(*new PatchpointExceptionHandle(state, descriptor, origin, offset, handler));
</del><ins>+    return adoptRef(*new PatchpointExceptionHandle(state, descriptor, origin, dfgNodeIndex, offset, handler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<PatchpointExceptionHandle> PatchpointExceptionHandle::defaultHandle(State& state)
</del><ins>+RefPtr<PatchpointExceptionHandle> PatchpointExceptionHandle::defaultHandle(State& state, unsigned dfgNodeIndex)
</ins><span class="cx"> {
</span><span class="cx">     if (!state.defaultExceptionHandle) {
</span><span class="cx">         state.defaultExceptionHandle = adoptRef(
</span><del>-            new PatchpointExceptionHandle(state, nullptr, NodeOrigin(), 0, HandlerInfo()));
</del><ins>+            new PatchpointExceptionHandle(state, nullptr, NodeOrigin(), dfgNodeIndex, 0, HandlerInfo()));
</ins><span class="cx">     }
</span><span class="cx">     return state.defaultExceptionHandle;
</span><span class="cx"> }
</span><span class="lines">@@ -98,11 +98,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PatchpointExceptionHandle::PatchpointExceptionHandle(
</span><del>-    State& state, OSRExitDescriptor* descriptor, NodeOrigin origin, unsigned offset,
</del><ins>+    State& state, OSRExitDescriptor* descriptor, NodeOrigin origin, unsigned dfgNodeIndex, unsigned offset,
</ins><span class="cx">     const HandlerInfo& handler)
</span><span class="cx">     : m_state(state)
</span><span class="cx">     , m_descriptor(descriptor)
</span><span class="cx">     , m_origin(origin)
</span><ins>+    , m_dfgNodeIndex(dfgNodeIndex)
</ins><span class="cx">     , m_offset(offset)
</span><span class="cx">     , m_handler(handler)
</span><span class="cx"> {
</span><span class="lines">@@ -112,7 +113,7 @@
</span><span class="cx">     ExitKind kind, const B3::StackmapGenerationParams& params)
</span><span class="cx"> {
</span><span class="cx">     return m_descriptor->emitOSRExitLater(
</span><del>-        m_state, kind, m_origin, params, m_offset);
</del><ins>+        m_state, kind, m_origin, params, m_dfgNodeIndex, m_offset);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::FTL
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h (260802 => 260803)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h   2020-04-28 00:35:45 UTC (rev 260802)
+++ trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h      2020-04-28 00:51:50 UTC (rev 260803)
</span><span class="lines">@@ -52,9 +52,9 @@
</span><span class="cx"> class PatchpointExceptionHandle : public ThreadSafeRefCounted<PatchpointExceptionHandle> {
</span><span class="cx"> public:
</span><span class="cx">     static Ref<PatchpointExceptionHandle> create(
</span><del>-        State&, OSRExitDescriptor*, DFG::NodeOrigin, unsigned offset, const HandlerInfo&);
</del><ins>+        State&, OSRExitDescriptor*, DFG::NodeOrigin, unsigned dfgNodeIndex, unsigned offset, const HandlerInfo&);
</ins><span class="cx"> 
</span><del>-    static RefPtr<PatchpointExceptionHandle> defaultHandle(State&);
</del><ins>+    static RefPtr<PatchpointExceptionHandle> defaultHandle(State&, unsigned dfgNodeIndex);
</ins><span class="cx">     
</span><span class="cx">     ~PatchpointExceptionHandle();
</span><span class="cx"> 
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PatchpointExceptionHandle(
</span><del>-        State&, OSRExitDescriptor*, DFG::NodeOrigin, unsigned offset, const HandlerInfo&);
</del><ins>+        State&, OSRExitDescriptor*, DFG::NodeOrigin, unsigned dfgNodeIndex, unsigned offset, const HandlerInfo&);
</ins><span class="cx"> 
</span><span class="cx">     Ref<OSRExitHandle> createHandle(ExitKind, const B3::StackmapGenerationParams&);
</span><span class="cx"> 
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx">     State& m_state;
</span><span class="cx">     OSRExitDescriptor* m_descriptor;
</span><span class="cx">     DFG::NodeOrigin m_origin;
</span><ins>+    unsigned m_dfgNodeIndex;
</ins><span class="cx">     unsigned m_offset;
</span><span class="cx">     HandlerInfo m_handler;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>