<!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>[226260] 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/226260">226260</a></dd>
<dt>Author</dt> <dd>utatane.tea@gmail.com</dd>
<dt>Date</dt> <dd>2017-12-22 00:19:55 -0800 (Fri, 22 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[DFG] Add JSValueRegsFlushedCallResult
https://bugs.webkit.org/show_bug.cgi?id=181075

Reviewed by Mark Lam.

Add JSValueRegsFlushedCallResult, which is appropriate for the JSValueRegs result
of the function call after flushing. We can remove bunch of `#if USE(JSVALUE32_64)`
code and simplify them.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileFromCharCode):
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithString):
(JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithSymbol):
(JSC::DFG::SpeculativeJIT::compileParseInt):
(JSC::DFG::SpeculativeJIT::emitUntypedBitOp):
(JSC::DFG::SpeculativeJIT::emitUntypedRightShiftBitOp):
(JSC::DFG::SpeculativeJIT::compileValueAdd):
(JSC::DFG::SpeculativeJIT::compileArithMul):
(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileArithRounding):
(JSC::DFG::SpeculativeJIT::compileResolveScopeForHoistingFuncDeclInEval):
(JSC::DFG::SpeculativeJIT::compileGetDynamicVar):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::JSValueRegsFlushedCallResult::JSValueRegsFlushedCallResult):
(JSC::DFG::JSValueRegsFlushedCallResult::regs):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJITcpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJITh">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (226259 => 226260)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2017-12-22 06:25:24 UTC (rev 226259)
+++ trunk/Source/JavaScriptCore/ChangeLog       2017-12-22 08:19:55 UTC (rev 226260)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2017-12-22  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [DFG] Add JSValueRegsFlushedCallResult
+        https://bugs.webkit.org/show_bug.cgi?id=181075
+
+        Reviewed by Mark Lam.
+
+        Add JSValueRegsFlushedCallResult, which is appropriate for the JSValueRegs result
+        of the function call after flushing. We can remove bunch of `#if USE(JSVALUE32_64)`
+        code and simplify them.
+
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compileFromCharCode):
+        (JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithString):
+        (JSC::DFG::SpeculativeJIT::compileGetByValForObjectWithSymbol):
+        (JSC::DFG::SpeculativeJIT::compileParseInt):
+        (JSC::DFG::SpeculativeJIT::emitUntypedBitOp):
+        (JSC::DFG::SpeculativeJIT::emitUntypedRightShiftBitOp):
+        (JSC::DFG::SpeculativeJIT::compileValueAdd):
+        (JSC::DFG::SpeculativeJIT::compileArithMul):
+        (JSC::DFG::SpeculativeJIT::compileArithDiv):
+        (JSC::DFG::SpeculativeJIT::compileArithRounding):
+        (JSC::DFG::SpeculativeJIT::compileResolveScopeForHoistingFuncDeclInEval):
+        (JSC::DFG::SpeculativeJIT::compileGetDynamicVar):
+        * dfg/DFGSpeculativeJIT.h:
+        (JSC::DFG::SpeculativeJIT::callOperation):
+        (JSC::DFG::JSValueRegsFlushedCallResult::JSValueRegsFlushedCallResult):
+        (JSC::DFG::JSValueRegsFlushedCallResult::regs):
+
</ins><span class="cx"> 2017-12-21  Saam Barati  <sbarati@apple.com>
</span><span class="cx"> 
</span><span class="cx">         lowering get_by_val to GetById inside bytecode parser should check for BadType exit kind
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJITcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (226259 => 226260)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp    2017-12-22 06:25:24 UTC (rev 226259)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp       2017-12-22 08:19:55 UTC (rev 226260)
</span><span class="lines">@@ -2255,15 +2255,10 @@
</span><span class="cx">     if (child.useKind() == UntypedUse) {
</span><span class="cx">         JSValueOperand opr(this, child);
</span><span class="cx">         JSValueRegs oprRegs = opr.jsValueRegs();
</span><del>-#if USE(JSVALUE64)
-        GPRTemporary result(this);
-        JSValueRegs resultRegs = JSValueRegs(result.gpr());
-#else
-        GPRTemporary resultTag(this);
-        GPRTemporary resultPayload(this);
-        JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr());
-#endif
</del><ins>+
</ins><span class="cx">         flushRegisters();
</span><ins>+        JSValueRegsFlushedCallResult result(this);
+        JSValueRegs resultRegs = result.regs();
</ins><span class="cx">         callOperation(operationStringFromCharCodeUntyped, resultRegs, oprRegs);
</span><span class="cx">         m_jit.exceptionCheck();
</span><span class="cx">         
</span><span class="lines">@@ -3227,18 +3222,10 @@
</span><span class="cx">     speculateObject(node->child1(), arg1GPR);
</span><span class="cx">     speculateString(node->child2(), arg2GPR);
</span><span class="cx"> 
</span><del>-    GPRFlushedCallResult resultPayload(this);
-    GPRReg resultPayloadGPR = resultPayload.gpr();
-#if USE(JSVALUE64)
-    JSValueRegs resultRegs(resultPayloadGPR);
-#else
-    GPRFlushedCallResult2 resultTag(this);
-    GPRReg resultTagGPR = resultTag.gpr();
-    JSValueRegs resultRegs(resultTagGPR, resultPayloadGPR);
-#endif
-
</del><span class="cx">     flushRegisters();
</span><del>-    callOperation(operationGetByValObjectString, extractResult(resultRegs), arg1GPR, arg2GPR);
</del><ins>+    JSValueRegsFlushedCallResult result(this);
+    JSValueRegs resultRegs = result.regs();
+    callOperation(operationGetByValObjectString, resultRegs, arg1GPR, arg2GPR);
</ins><span class="cx">     m_jit.exceptionCheck();
</span><span class="cx"> 
</span><span class="cx">     jsValueResult(resultRegs, node);
</span><span class="lines">@@ -3255,18 +3242,10 @@
</span><span class="cx">     speculateObject(node->child1(), arg1GPR);
</span><span class="cx">     speculateSymbol(node->child2(), arg2GPR);
</span><span class="cx"> 
</span><del>-    GPRFlushedCallResult resultPayload(this);
-    GPRReg resultPayloadGPR = resultPayload.gpr();
-#if USE(JSVALUE64)
-    JSValueRegs resultRegs(resultPayloadGPR);
-#else
-    GPRFlushedCallResult2 resultTag(this);
-    GPRReg resultTagGPR = resultTag.gpr();
-    JSValueRegs resultRegs(resultTagGPR, resultPayloadGPR);
-#endif
-
</del><span class="cx">     flushRegisters();
</span><del>-    callOperation(operationGetByValObjectSymbol, extractResult(resultRegs), arg1GPR, arg2GPR);
</del><ins>+    JSValueRegsFlushedCallResult result(this);
+    JSValueRegs resultRegs = result.regs();
+    callOperation(operationGetByValObjectSymbol, resultRegs, arg1GPR, arg2GPR);
</ins><span class="cx">     m_jit.exceptionCheck();
</span><span class="cx"> 
</span><span class="cx">     jsValueResult(resultRegs, node);
</span><span class="lines">@@ -3388,72 +3367,57 @@
</span><span class="cx"> void SpeculativeJIT::compileParseInt(Node* node)
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(node->child1().useKind() == UntypedUse || node->child1().useKind() == StringUse);
</span><del>-
-    GPRFlushedCallResult resultPayload(this);
-    GPRReg resultPayloadGPR = resultPayload.gpr();
-#if USE(JSVALUE64)
-    JSValueRegs resultRegs(resultPayloadGPR);
-#else
-    GPRFlushedCallResult2 resultTag(this);
-    GPRReg resultTagGPR = resultTag.gpr();
-    JSValueRegs resultRegs(resultTagGPR, resultPayloadGPR);
-#endif
-
</del><span class="cx">     if (node->child2()) {
</span><span class="cx">         SpeculateInt32Operand radix(this, node->child2());
</span><span class="cx">         GPRReg radixGPR = radix.gpr();
</span><span class="cx">         if (node->child1().useKind() == UntypedUse) {
</span><span class="cx">             JSValueOperand value(this, node->child1());
</span><del>-#if USE(JSVALUE64)
-            auto result = resultRegs.gpr();
-            auto valueReg = value.gpr();
-#else
-            auto result = resultRegs;
-            auto valueReg = value.jsValueRegs();
-#endif
</del><ins>+            JSValueRegs valueRegs = value.jsValueRegs();
</ins><span class="cx"> 
</span><span class="cx">             flushRegisters();
</span><del>-            callOperation(operationParseIntGeneric, result, valueReg, radixGPR);
</del><ins>+            JSValueRegsFlushedCallResult result(this);
+            JSValueRegs resultRegs = result.regs();
+            callOperation(operationParseIntGeneric, resultRegs, valueRegs, radixGPR);
</ins><span class="cx">             m_jit.exceptionCheck();
</span><del>-        } else {
-            SpeculateCellOperand value(this, node->child1());
-            GPRReg valueGPR = value.gpr();
-            speculateString(node->child1(), valueGPR);
</del><ins>+            jsValueResult(resultRegs, node);
+            return;
+        }
</ins><span class="cx"> 
</span><del>-#if USE(JSVALUE64)
-            auto result = resultRegs.gpr();
-#else
-            auto result = resultRegs;
-#endif
</del><ins>+        SpeculateCellOperand value(this, node->child1());
+        GPRReg valueGPR = value.gpr();
+        speculateString(node->child1(), valueGPR);
</ins><span class="cx"> 
</span><del>-            flushRegisters();
-            callOperation(operationParseIntString, result, valueGPR, radixGPR);
-            m_jit.exceptionCheck();
-        }
-    } else {
-        if (node->child1().useKind() == UntypedUse) {
-            JSValueOperand value(this, node->child1());
-#if USE(JSVALUE64)
-            auto result = resultRegs.gpr();
-#else
-            auto result = resultRegs;
-#endif
-            JSValueRegs valueRegs = value.jsValueRegs();
</del><ins>+        flushRegisters();
+        JSValueRegsFlushedCallResult result(this);
+        JSValueRegs resultRegs = result.regs();
+        callOperation(operationParseIntString, resultRegs, valueGPR, radixGPR);
+        m_jit.exceptionCheck();
+        jsValueResult(resultRegs, node);
+        return;
+    }
</ins><span class="cx"> 
</span><del>-            flushRegisters();
-            callOperation(operationParseIntNoRadixGeneric, result, valueRegs);
-            m_jit.exceptionCheck();
-        } else {
-            SpeculateCellOperand value(this, node->child1());
-            GPRReg valueGPR = value.gpr();
-            speculateString(node->child1(), valueGPR);
</del><ins>+    if (node->child1().useKind() == UntypedUse) {
+        JSValueOperand value(this, node->child1());
+        JSValueRegs valueRegs = value.jsValueRegs();
</ins><span class="cx"> 
</span><del>-            flushRegisters();
-            callOperation(operationParseIntStringNoRadix, resultRegs, valueGPR);
-            m_jit.exceptionCheck();
-        }
</del><ins>+        flushRegisters();
+        JSValueRegsFlushedCallResult result(this);
+        JSValueRegs resultRegs = result.regs();
+        callOperation(operationParseIntNoRadixGeneric, resultRegs, valueRegs);
+        m_jit.exceptionCheck();
+        jsValueResult(resultRegs, node);
+        return;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    SpeculateCellOperand value(this, node->child1());
+    GPRReg valueGPR = value.gpr();
+    speculateString(node->child1(), valueGPR);
+
+    flushRegisters();
+    JSValueRegsFlushedCallResult result(this);
+    JSValueRegs resultRegs = result.regs();
+    callOperation(operationParseIntStringNoRadix, resultRegs, valueGPR);
+    m_jit.exceptionCheck();
</ins><span class="cx">     jsValueResult(resultRegs, node);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3520,15 +3484,10 @@
</span><span class="cx">         JSValueOperand right(this, rightChild);
</span><span class="cx">         JSValueRegs leftRegs = left.jsValueRegs();
</span><span class="cx">         JSValueRegs rightRegs = right.jsValueRegs();
</span><del>-#if USE(JSVALUE64)
-        GPRTemporary result(this);
-        JSValueRegs resultRegs = JSValueRegs(result.gpr());
-#else
-        GPRTemporary resultTag(this);
-        GPRTemporary resultPayload(this);
-        JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr());
-#endif
</del><ins>+
</ins><span class="cx">         flushRegisters();
</span><ins>+        JSValueRegsFlushedCallResult result(this);
+        JSValueRegs resultRegs = result.regs();
</ins><span class="cx">         callOperation(snippetSlowPathFunction, resultRegs, leftRegs, rightRegs);
</span><span class="cx">         m_jit.exceptionCheck();
</span><span class="cx"> 
</span><span class="lines">@@ -3667,15 +3626,10 @@
</span><span class="cx">         JSValueOperand right(this, rightChild);
</span><span class="cx">         JSValueRegs leftRegs = left.jsValueRegs();
</span><span class="cx">         JSValueRegs rightRegs = right.jsValueRegs();
</span><del>-#if USE(JSVALUE64)
-        GPRTemporary result(this);
-        JSValueRegs resultRegs = JSValueRegs(result.gpr());
-#else
-        GPRTemporary resultTag(this);
-        GPRTemporary resultPayload(this);
-        JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr());
-#endif
</del><ins>+
</ins><span class="cx">         flushRegisters();
</span><ins>+        JSValueRegsFlushedCallResult result(this);
+        JSValueRegs resultRegs = result.regs();
</ins><span class="cx">         callOperation(snippetSlowPathFunction, resultRegs, leftRegs, rightRegs);
</span><span class="cx">         m_jit.exceptionCheck();
</span><span class="cx"> 
</span><span class="lines">@@ -3807,15 +3761,10 @@
</span><span class="cx">         JSValueOperand right(this, rightChild);
</span><span class="cx">         JSValueRegs leftRegs = left.jsValueRegs();
</span><span class="cx">         JSValueRegs rightRegs = right.jsValueRegs();
</span><del>-#if USE(JSVALUE64)
-        GPRTemporary result(this);
-        JSValueRegs resultRegs = JSValueRegs(result.gpr());
-#else
-        GPRTemporary resultTag(this);
-        GPRTemporary resultPayload(this);
-        JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr());
-#endif
</del><ins>+
</ins><span class="cx">         flushRegisters();
</span><ins>+        JSValueRegsFlushedCallResult result(this);
+        JSValueRegs resultRegs = result.regs();
</ins><span class="cx">         callOperation(operationValueAddNotNumber, resultRegs, leftRegs, rightRegs);
</span><span class="cx">         m_jit.exceptionCheck();
</span><span class="cx">     
</span><span class="lines">@@ -4831,15 +4780,10 @@
</span><span class="cx">             JSValueOperand right(this, rightChild);
</span><span class="cx">             JSValueRegs leftRegs = left.jsValueRegs();
</span><span class="cx">             JSValueRegs rightRegs = right.jsValueRegs();
</span><del>-#if USE(JSVALUE64)
-            GPRTemporary result(this);
-            JSValueRegs resultRegs = JSValueRegs(result.gpr());
-#else
-            GPRTemporary resultTag(this);
-            GPRTemporary resultPayload(this);
-            JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr());
-#endif
</del><ins>+
</ins><span class="cx">             flushRegisters();
</span><ins>+            JSValueRegsFlushedCallResult result(this);
+            JSValueRegs resultRegs = result.regs();
</ins><span class="cx">             callOperation(operationValueMul, resultRegs, leftRegs, rightRegs);
</span><span class="cx">             m_jit.exceptionCheck();
</span><span class="cx"> 
</span><span class="lines">@@ -5013,15 +4957,10 @@
</span><span class="cx">             JSValueOperand right(this, rightChild);
</span><span class="cx">             JSValueRegs leftRegs = left.jsValueRegs();
</span><span class="cx">             JSValueRegs rightRegs = right.jsValueRegs();
</span><del>-#if USE(JSVALUE64)
-            GPRTemporary result(this);
-            JSValueRegs resultRegs = JSValueRegs(result.gpr());
-#else
-            GPRTemporary resultTag(this);
-            GPRTemporary resultPayload(this);
-            JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr());
-#endif
</del><ins>+
</ins><span class="cx">             flushRegisters();
</span><ins>+            JSValueRegsFlushedCallResult result(this);
+            JSValueRegs resultRegs = result.regs();
</ins><span class="cx">             callOperation(operationValueDiv, resultRegs, leftRegs, rightRegs);
</span><span class="cx">             m_jit.exceptionCheck();
</span><span class="cx"> 
</span><span class="lines">@@ -5519,15 +5458,10 @@
</span><span class="cx"> 
</span><span class="cx">     JSValueOperand argument(this, node->child1());
</span><span class="cx">     JSValueRegs argumentRegs = argument.jsValueRegs();
</span><del>-#if USE(JSVALUE64)
-    GPRTemporary result(this);
-    JSValueRegs resultRegs = JSValueRegs(result.gpr());
-#else
-    GPRTemporary resultTag(this);
-    GPRTemporary resultPayload(this);
-    JSValueRegs resultRegs = JSValueRegs(resultPayload.gpr(), resultTag.gpr());
-#endif
</del><ins>+
</ins><span class="cx">     flushRegisters();
</span><ins>+    JSValueRegsFlushedCallResult result(this);
+    JSValueRegs resultRegs = result.regs();
</ins><span class="cx">     J_JITOperation_EJ operation = nullptr;
</span><span class="cx">     if (node->op() == ArithRound)
</span><span class="cx">         operation = operationArithRound;
</span><span class="lines">@@ -10394,21 +10328,12 @@
</span><span class="cx"> {
</span><span class="cx">     SpeculateCellOperand scope(this, node->child1());
</span><span class="cx">     GPRReg scopeGPR = scope.gpr();
</span><del>-#if USE(JSVALUE64)
-    GPRFlushedCallResult result(this);
-    GPRReg resultGPR = result.gpr();
</del><span class="cx">     flushRegisters();
</span><del>-    callOperation(operationResolveScopeForHoistingFuncDeclInEval, resultGPR, scopeGPR, identifierUID(node->identifierNumber()));
</del><ins>+    JSValueRegsFlushedCallResult result(this);
+    JSValueRegs resultRegs = result.regs();
+    callOperation(operationResolveScopeForHoistingFuncDeclInEval, resultRegs, scopeGPR, identifierUID(node->identifierNumber()));
</ins><span class="cx">     m_jit.exceptionCheck();
</span><del>-    jsValueResult(result.gpr(), node);
-#else
-    flushRegisters();
-    GPRFlushedCallResult2 resultTag(this);
-    GPRFlushedCallResult resultPayload(this);
-    callOperation(operationResolveScopeForHoistingFuncDeclInEval, JSValueRegs(resultTag.gpr(), resultPayload.gpr()), scopeGPR, identifierUID(node->identifierNumber()));
-    m_jit.exceptionCheck();
-    jsValueResult(resultTag.gpr(), resultPayload.gpr(), node);
-#endif
</del><ins>+    jsValueResult(resultRegs, node);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void SpeculativeJIT::compileGetDynamicVar(Node* node)
</span><span class="lines">@@ -10415,20 +10340,12 @@
</span><span class="cx"> {
</span><span class="cx">     SpeculateCellOperand scope(this, node->child1());
</span><span class="cx">     GPRReg scopeGPR = scope.gpr();
</span><del>-#if USE(JSVALUE64)
</del><span class="cx">     flushRegisters();
</span><del>-    GPRFlushedCallResult result(this);
-    callOperation(operationGetDynamicVar, result.gpr(), scopeGPR, identifierUID(node->identifierNumber()), node->getPutInfo());
</del><ins>+    JSValueRegsFlushedCallResult result(this);
+    JSValueRegs resultRegs = result.regs();
+    callOperation(operationGetDynamicVar, resultRegs, scopeGPR, identifierUID(node->identifierNumber()), node->getPutInfo());
</ins><span class="cx">     m_jit.exceptionCheck();
</span><del>-    jsValueResult(result.gpr(), node);
-#else
-    flushRegisters();
-    GPRFlushedCallResult2 resultTag(this);
-    GPRFlushedCallResult resultPayload(this);
-    callOperation(operationGetDynamicVar, JSValueRegs(resultTag.gpr(), resultPayload.gpr()), scopeGPR, identifierUID(node->identifierNumber()), node->getPutInfo());
-    m_jit.exceptionCheck();
-    jsValueResult(resultTag.gpr(), resultPayload.gpr(), node);
-#endif
</del><ins>+    jsValueResult(resultRegs, node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SpeculativeJIT::compilePutDynamicVar(Node* node)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h (226259 => 226260)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h      2017-12-22 06:25:24 UTC (rev 226259)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h 2017-12-22 08:19:55 UTC (rev 226260)
</span><span class="lines">@@ -1453,6 +1453,11 @@
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(uid));
</span><span class="cx">         return appendCallSetResult(operation, result);
</span><span class="cx">     }
</span><ins>+    JITCompiler::Call callOperation(J_JITOperation_EJscI operation, JSValueRegs result, GPRReg arg1, UniquedStringImpl* impl)
+    {
+        m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl));
+        return appendCallSetResult(operation, result.payloadGPR());
+    }
</ins><span class="cx">     JITCompiler::Call callOperation(J_JITOperation_EJscI operation, GPRReg result, GPRReg arg1, UniquedStringImpl* impl)
</span><span class="cx">     {
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl));
</span><span class="lines">@@ -1513,6 +1518,11 @@
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, arg2, TrustedImmPtr(impl), TrustedImm32(value));
</span><span class="cx">         return appendCall(operation);
</span><span class="cx">     }
</span><ins>+    JITCompiler::Call callOperation(J_JITOperation_EOIUi operation, JSValueRegs result, GPRReg arg1, UniquedStringImpl* impl, unsigned value)
+    {
+        m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl), TrustedImm32(value));
+        return appendCallSetResult(operation, result.payloadGPR());
+    }
</ins><span class="cx">     JITCompiler::Call callOperation(J_JITOperation_EOIUi operation, GPRReg result, GPRReg arg1, UniquedStringImpl* impl, unsigned value)
</span><span class="cx">     {
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, TrustedImmPtr(impl), TrustedImm32(value));
</span><span class="lines">@@ -1570,6 +1580,11 @@
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, arg2, arg3);
</span><span class="cx">         return appendCallSetResult(operation, result);
</span><span class="cx">     }
</span><ins>+    JITCompiler::Call callOperation(J_JITOperation_EJssZ operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
+    {
+        m_jit.setupArgumentsWithExecState(arg1, arg2);
+        return appendCallSetResult(operation, result.payloadGPR());
+    }
</ins><span class="cx">     JITCompiler::Call callOperation(J_JITOperation_EJssZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
</span><span class="cx">     {
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, arg2);
</span><span class="lines">@@ -1625,9 +1640,14 @@
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, arg2);
</span><span class="cx">         return appendCallSetResult(operation, result);
</span><span class="cx">     }
</span><del>-    JITCompiler::Call callOperation(J_JITOperation_EJZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
</del><ins>+    JITCompiler::Call callOperation(J_JITOperation_EJZ operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
</ins><span class="cx">     {
</span><del>-        m_jit.setupArgumentsWithExecState(arg1, arg2);
</del><ins>+        m_jit.setupArgumentsWithExecState(arg1.payloadGPR(), arg2);
+        return appendCallSetResult(operation, result.payloadGPR());
+    }
+    JITCompiler::Call callOperation(J_JITOperation_EJZ operation, GPRReg result, JSValueRegs arg1, GPRReg arg2)
+    {
+        m_jit.setupArgumentsWithExecState(arg1.payloadGPR(), arg2);
</ins><span class="cx">         return appendCallSetResult(operation, result);
</span><span class="cx">     }
</span><span class="cx">     JITCompiler::Call callOperation(J_JITOperation_EJA operation, JSValueRegs result, JSValueRegs arg1, GPRReg arg2)
</span><span class="lines">@@ -1871,6 +1891,11 @@
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, arg2, arg3, arg4);
</span><span class="cx">         return appendCallSetResult(operation, result);
</span><span class="cx">     }
</span><ins>+    JITCompiler::Call callOperation(J_JITOperation_ECC operation, JSValueRegs result, GPRReg arg1, GPRReg arg2)
+    {
+        m_jit.setupArgumentsWithExecState(arg1, arg2);
+        return appendCallSetResult(operation, result.payloadGPR());
+    }
</ins><span class="cx">     JITCompiler::Call callOperation(J_JITOperation_ECC operation, GPRReg result, GPRReg arg1, GPRReg arg2)
</span><span class="cx">     {
</span><span class="cx">         m_jit.setupArgumentsWithExecState(arg1, arg2);
</span><span class="lines">@@ -3674,7 +3699,37 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+class JSValueRegsFlushedCallResult {
+public:
+    JSValueRegsFlushedCallResult(SpeculativeJIT* jit)
+#if USE(JSVALUE64)
+        : m_gpr(jit)
+#else
+        : m_payloadGPR(jit)
+        , m_tagGPR(jit)
+#endif
+    {
+    }
</ins><span class="cx"> 
</span><ins>+    JSValueRegs regs()
+    {
+#if USE(JSVALUE64)
+        return JSValueRegs { m_gpr.gpr() };
+#else
+        return JSValueRegs { m_tagGPR.gpr(), m_payloadGPR.gpr() };
+#endif
+    }
+
+private:
+#if USE(JSVALUE64)
+    GPRFlushedCallResult m_gpr;
+#else
+    GPRFlushedCallResult m_payloadGPR;
+    GPRFlushedCallResult2 m_tagGPR;
+#endif
+};
+
+
</ins><span class="cx"> // === Speculative Operand types ===
</span><span class="cx"> //
</span><span class="cx"> // SpeculateInt32Operand, SpeculateStrictInt32Operand and SpeculateCellOperand.
</span></span></pre>
</div>
</div>

</body>
</html>