<!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>[169793] branches/ftlopt/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/169793">169793</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2014-06-10 21:31:22 -0700 (Tue, 10 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, roll out http://trac.webkit.org/changeset/169786.
It broke a lot of tests on 32-bit.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addCall):
(JSC::DFG::ByteCodeParser::handleCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::canBeKnownFunction):
(JSC::DFG::Node::hasKnownFunction):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::lower):
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
(JSC::FTL::LowerDFGToLLVM::possiblyCompileInlineableNativeCall):
(JSC::FTL::LowerDFGToLLVM::didOverflowStack):
(JSC::FTL::LowerDFGToLLVM::compileNativeCallOrConstruct): Deleted.
* runtime/JSCJSValue.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesftloptSourceJavaScriptCoreChangeLog">branches/ftlopt/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh">branches/ftlopt/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGByteCodeParsercpp">branches/ftlopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGClobberizeh">branches/ftlopt/Source/JavaScriptCore/dfg/DFGClobberize.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGDoesGCcpp">branches/ftlopt/Source/JavaScriptCore/dfg/DFGDoesGC.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGFixupPhasecpp">branches/ftlopt/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGNodeh">branches/ftlopt/Source/JavaScriptCore/dfg/DFGNode.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGNodeTypeh">branches/ftlopt/Source/JavaScriptCore/dfg/DFGNodeType.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp">branches/ftlopt/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGSafeToExecuteh">branches/ftlopt/Source/JavaScriptCore/dfg/DFGSafeToExecute.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp">branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp">branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreftlFTLCapabilitiescpp">branches/ftlopt/Source/JavaScriptCore/ftl/FTLCapabilities.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp">branches/ftlopt/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreruntimeJSCJSValueh">branches/ftlopt/Source/JavaScriptCore/runtime/JSCJSValue.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesftloptSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/ChangeLog (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/ChangeLog        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/ChangeLog        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2014-06-10  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        Unreviewed, roll out http://trac.webkit.org/changeset/169786.
+        It broke a lot of tests on 32-bit.
+
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::addCall):
+        (JSC::DFG::ByteCodeParser::handleCall):
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize):
+        * dfg/DFGDoesGC.cpp:
+        (JSC::DFG::doesGC):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGNode.h:
+        (JSC::DFG::Node::hasHeapPrediction):
+        (JSC::DFG::Node::canBeKnownFunction):
+        (JSC::DFG::Node::hasKnownFunction):
+        * dfg/DFGNodeType.h:
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        (JSC::DFG::PredictionPropagationPhase::propagate):
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::emitCall):
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::emitCall):
+        (JSC::DFG::SpeculativeJIT::compile):
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::lower):
+        (JSC::FTL::LowerDFGToLLVM::compileNode):
+        (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
+        (JSC::FTL::LowerDFGToLLVM::possiblyCompileInlineableNativeCall):
+        (JSC::FTL::LowerDFGToLLVM::didOverflowStack):
+        (JSC::FTL::LowerDFGToLLVM::compileNativeCallOrConstruct): Deleted.
+        * runtime/JSCJSValue.h:
+
</ins><span class="cx"> 2014-06-09  Matthew Mirman  &lt;mmirman@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Added native calling to the FTL and Split the DFG nodes 
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -1872,8 +1872,6 @@
</span><span class="cx">             
</span><span class="cx">     case Call:
</span><span class="cx">     case Construct:
</span><del>-    case NativeCall:
-    case NativeConstruct:
</del><span class="cx">         node-&gt;setCanExit(true);
</span><span class="cx">         clobberWorld(node-&gt;origin.semantic, clobberLimit);
</span><span class="cx">         forNode(node).makeHeapTop();
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -820,7 +820,7 @@
</span><span class="cx">         if (parameterSlots &gt; m_parameterSlots)
</span><span class="cx">             m_parameterSlots = parameterSlots;
</span><span class="cx"> 
</span><del>-        int dummyThisArgument = op == Call || op == NativeCall ? 0 : 1;
</del><ins>+        int dummyThisArgument = op == Call ? 0 : 1;
</ins><span class="cx">         for (int i = 0 + dummyThisArgument; i &lt; argCount; ++i)
</span><span class="cx">             addVarArgChild(get(virtualRegisterForArgument(i, registerOffset)));
</span><span class="cx"> 
</span><span class="lines">@@ -1275,19 +1275,9 @@
</span><span class="cx">         if (function-&gt;isHostFunction()) {
</span><span class="cx">             emitFunctionChecks(callLinkStatus, callTarget, registerOffset, specializationKind);
</span><span class="cx">             knownFunction = function;
</span><del>-
-            if (op == Call) 
-                op = NativeCall;
-            else {
-                ASSERT(op == Construct);
-                op = NativeConstruct;
-            }
</del><span class="cx">         }
</span><del>-
-     Node* call = addCall(result, op, callTarget, argumentCountIncludingThis, registerOffset);
-
-     if (knownFunction) 
-         call-&gt;giveKnownFunction(knownFunction);
</del><ins>+    
+    addCall(result, op, callTarget, argumentCountIncludingThis, registerOffset)-&gt;giveKnownFunction(knownFunction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ByteCodeParser::emitFunctionChecks(const CallLinkStatus&amp; callLinkStatus, Node* callTarget, int registerOffset, CodeSpecializationKind kind)
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGClobberizeh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGClobberize.h (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGClobberize.h        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGClobberize.h        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -200,8 +200,6 @@
</span><span class="cx">     case ArrayPop:
</span><span class="cx">     case Call:
</span><span class="cx">     case Construct:
</span><del>-    case NativeCall:
-    case NativeConstruct:
</del><span class="cx">     case ToPrimitive:
</span><span class="cx">     case In:
</span><span class="cx">     case GetMyArgumentsLengthSafe:
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGDoesGCcpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGDoesGC.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -117,8 +117,6 @@
</span><span class="cx">     case CompareStrictEq:
</span><span class="cx">     case Call:
</span><span class="cx">     case Construct:
</span><del>-    case NativeCall:
-    case NativeConstruct:
</del><span class="cx">     case Breakpoint:
</span><span class="cx">     case ProfileWillCall:
</span><span class="cx">     case ProfileDidCall:
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGFixupPhasecpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -1082,8 +1082,6 @@
</span><span class="cx">         case AllocationProfileWatchpoint:
</span><span class="cx">         case Call:
</span><span class="cx">         case Construct:
</span><del>-        case NativeCall:
-        case NativeConstruct:
</del><span class="cx">         case NewObject:
</span><span class="cx">         case NewArrayBuffer:
</span><span class="cx">         case NewRegexp:
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGNodeh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGNode.h (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGNode.h        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGNode.h        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -978,8 +978,6 @@
</span><span class="cx">         case GetMyArgumentByValSafe:
</span><span class="cx">         case Call:
</span><span class="cx">         case Construct:
</span><del>-        case NativeCall:
-        case NativeConstruct:
</del><span class="cx">         case GetByOffset:
</span><span class="cx">         case MultiGetByOffset:
</span><span class="cx">         case GetClosureVar:
</span><span class="lines">@@ -1010,8 +1008,8 @@
</span><span class="cx">     bool canBeKnownFunction()
</span><span class="cx">     {
</span><span class="cx">         switch (op()) {
</span><del>-        case NativeConstruct:
-        case NativeCall:
</del><ins>+        case Construct:
+        case Call:
</ins><span class="cx">             return true;
</span><span class="cx">         default:
</span><span class="cx">             return false;
</span><span class="lines">@@ -1021,8 +1019,8 @@
</span><span class="cx">     bool hasKnownFunction()
</span><span class="cx">     {
</span><span class="cx">         switch (op()) {
</span><del>-        case NativeConstruct:
-        case NativeCall:
</del><ins>+        case Construct:
+        case Call:
</ins><span class="cx">             return (bool)m_opInfo;
</span><span class="cx">         default:
</span><span class="cx">             return false;
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGNodeTypeh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGNodeType.h (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGNodeType.h        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGNodeType.h        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -215,8 +215,6 @@
</span><span class="cx">     /* Calls. */\
</span><span class="cx">     macro(Call, NodeResultJS | NodeMustGenerate | NodeHasVarArgs | NodeClobbersWorld) \
</span><span class="cx">     macro(Construct, NodeResultJS | NodeMustGenerate | NodeHasVarArgs | NodeClobbersWorld) \
</span><del>-    macro(NativeCall, NodeResultJS | NodeMustGenerate | NodeHasVarArgs | NodeClobbersWorld) \
-    macro(NativeConstruct, NodeResultJS | NodeMustGenerate | NodeHasVarArgs | NodeClobbersWorld) \
</del><span class="cx">     \
</span><span class="cx">     /* Allocations. */\
</span><span class="cx">     macro(NewObject, NodeResultJS) \
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -183,8 +183,6 @@
</span><span class="cx">         case MultiGetByOffset:
</span><span class="cx">         case Call:
</span><span class="cx">         case Construct:
</span><del>-        case NativeCall:
-        case NativeConstruct:
</del><span class="cx">         case GetGlobalVar:
</span><span class="cx">         case GetClosureVar: {
</span><span class="cx">             changed |= setPrediction(node-&gt;getHeapPrediction());
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGSafeToExecuteh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGSafeToExecute.h (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -256,11 +256,7 @@
</span><span class="cx">     case GetGetter:
</span><span class="cx">     case GetSetter:
</span><span class="cx">         return true;
</span><del>-
-    case NativeCall:
-    case NativeConstruct:
-        return false; // TODO: add a check for already checked. 
-
</del><ins>+        
</ins><span class="cx">     case GetByVal:
</span><span class="cx">     case GetIndexedPropertyStorage:
</span><span class="cx">     case GetArrayLength:
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -638,13 +638,12 @@
</span><span class="cx"> 
</span><span class="cx"> void SpeculativeJIT::emitCall(Node* node)
</span><span class="cx"> {
</span><del>-    bool isCall = node-&gt;op() == Call || node-&gt;op() == NativeCall;
-    if (!isCall)
-        ASSERT(node-&gt;op() == Construct || node-&gt;op() == NativeConstruct);
</del><ins>+    if (node-&gt;op() != Call)
+        ASSERT(node-&gt;op() == Construct);
</ins><span class="cx"> 
</span><span class="cx">     // For constructors, the this argument is not passed but we have to make space
</span><span class="cx">     // for it.
</span><del>-    int dummyThisArgument = isCall ? 0 : 1;
</del><ins>+    int dummyThisArgument = node-&gt;op() == Call ? 0 : 1;
</ins><span class="cx"> 
</span><span class="cx">     CallLinkInfo::CallType callType = node-&gt;op() == Call ? CallLinkInfo::Call : CallLinkInfo::Construct;
</span><span class="cx"> 
</span><span class="lines">@@ -4131,8 +4130,6 @@
</span><span class="cx"> 
</span><span class="cx">     case Call:
</span><span class="cx">     case Construct:
</span><del>-    case NativeCall:
-    case NativeConstruct:
</del><span class="cx">         emitCall(node);
</span><span class="cx">         break;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -637,16 +637,14 @@
</span><span class="cx"> 
</span><span class="cx"> void SpeculativeJIT::emitCall(Node* node)
</span><span class="cx"> {
</span><ins>+    if (node-&gt;op() != Call)
+        RELEASE_ASSERT(node-&gt;op() == Construct);
</ins><span class="cx"> 
</span><del>-    bool isCall = node-&gt;op() == Call || node-&gt;op() == NativeCall;
-    if (!isCall)
-        RELEASE_ASSERT(node-&gt;op() == Construct || node-&gt;op() == NativeConstruct);
-
</del><span class="cx">     // For constructors, the this argument is not passed but we have to make space
</span><span class="cx">     // for it.
</span><del>-    int dummyThisArgument = isCall ? 0 : 1;
</del><ins>+    int dummyThisArgument = node-&gt;op() == Call ? 0 : 1;
</ins><span class="cx">     
</span><del>-    CallLinkInfo::CallType callType = isCall ? CallLinkInfo::Call : CallLinkInfo::Construct;
</del><ins>+    CallLinkInfo::CallType callType = node-&gt;op() == Call ? CallLinkInfo::Call : CallLinkInfo::Construct;
</ins><span class="cx">     
</span><span class="cx">     Edge calleeEdge = m_jit.graph().m_varArgChildren[node-&gt;firstChild()];
</span><span class="cx">     JSValueOperand callee(this, calleeEdge);
</span><span class="lines">@@ -4176,8 +4174,6 @@
</span><span class="cx"> 
</span><span class="cx">     case Call:
</span><span class="cx">     case Construct:
</span><del>-    case NativeCall:
-    case NativeConstruct:
</del><span class="cx">         emitCall(node);
</span><span class="cx">         break;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreftlFTLCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/ftl/FTLCapabilities.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -119,8 +119,6 @@
</span><span class="cx">     case StoreBarrierWithNullCheck:
</span><span class="cx">     case Call:
</span><span class="cx">     case Construct:
</span><del>-    case NativeCall:
-    case NativeConstruct:
</del><span class="cx">     case ValueToInt32:
</span><span class="cx">     case Branch:
</span><span class="cx">     case LogicalNot:
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -154,8 +154,13 @@
</span><span class="cx">                 Node* m_node = block-&gt;at(nodeIndex);
</span><span class="cx">                 if (m_node-&gt;hasKnownFunction()) {
</span><span class="cx">                     int numArgs = m_node-&gt;numChildren();
</span><del>-                    if (numArgs &gt; maxNumberOfArguments)
-                        maxNumberOfArguments = numArgs;
</del><ins>+                    NativeFunction func = m_node-&gt;knownFunction()-&gt;nativeFunction();
+                    Dl_info info;
+                    if (dladdr((void*)func, &amp;info)) {
+                        LValue callee = getFunctionBySymbol(info.dli_sname);
+                        if (callee &amp;&amp; numArgs &gt; maxNumberOfArguments)
+                            maxNumberOfArguments = numArgs;
+                    }
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -632,10 +637,6 @@
</span><span class="cx">         case Construct:
</span><span class="cx">             compileCallOrConstruct();
</span><span class="cx">             break;
</span><del>-        case NativeCall:
-        case NativeConstruct:
-            compileNativeCallOrConstruct();
-            break;
</del><span class="cx">         case Jump:
</span><span class="cx">             compileJump();
</span><span class="cx">             break;
</span><span class="lines">@@ -3584,66 +3585,16 @@
</span><span class="cx">         setBoolean(m_out.bitNot(boolify(m_node-&gt;child1())));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void compileNativeCallOrConstruct() 
-    {
-        int dummyThisArgument = m_node-&gt;op() == NativeCall ? 0 : 1;
-        int numPassedArgs = m_node-&gt;numChildren() - 1;
-        int numArgs = numPassedArgs + dummyThisArgument;
-
-        ASSERT(m_node-&gt;hasKnownFunction());
-
-        JSFunction* knownFunction = m_node-&gt;knownFunction();
-        NativeFunction function = knownFunction-&gt;nativeFunction();
-
-        Dl_info info;
-        if (!dladdr((void*)function, &amp;info))
-            ASSERT(false); // if we couldn't find the native function this doesn't bode well.
-
-        LValue callee = getFunctionBySymbol(info.dli_sname);
-
-        bool notInlinable;
-        if ((notInlinable = !callee))
-            callee = m_out.operation(function);
-
-        JSScope* scope = knownFunction-&gt;scopeUnchecked();
-        m_out.storePtr(m_callFrame, m_execStorage, m_heaps.CallFrame_callerFrame);
-        m_out.storePtr(constNull(m_out.intPtr), addressFor(m_execStorage, JSStack::CodeBlock));
-        m_out.storePtr(weakPointer(scope), addressFor(m_execStorage, JSStack::ScopeChain));
-        m_out.storePtr(weakPointer(knownFunction), addressFor(m_execStorage, JSStack::Callee));
-
-        m_out.store64(m_out.constInt64(numArgs), addressFor(m_execStorage, JSStack::ArgumentCount));
-
-        if (dummyThisArgument) 
-            m_out.storePtr(getUndef(m_out.int64), addressFor(m_execStorage, JSStack::ThisArgument));
-        
-        for (int i = 0; i &lt; numPassedArgs; ++i) {
-            m_out.storePtr(lowJSValue(m_graph.varArgChild(m_node, 1 + i)),
-                addressFor(m_execStorage, dummyThisArgument ? JSStack::FirstArgument : JSStack::ThisArgument, i * sizeof(Register)));
-        }
-
-        LValue calleeCallFrame = m_out.address(m_execState, m_heaps.CallFrame_callerFrame).value();
-        m_out.storePtr(m_out.ptrToInt(calleeCallFrame, m_out.intPtr), m_out.absolute(&amp;vm().topCallFrame));
-
-        LType typeCalleeArg;
-        getParamTypes(getElementType(typeOf(callee)), &amp;typeCalleeArg);
-
-        LValue argument = notInlinable 
-            ? m_out.ptrToInt(calleeCallFrame, typeCalleeArg) 
-            : m_out.bitCast(calleeCallFrame, typeCalleeArg);
-        LValue call = vmCall(callee, argument);
-
-        if (Options::verboseCompilation())
-            dataLog(&quot;Native calling: &quot;, info.dli_sname, &quot;\n&quot;);
-
-        setJSValue(call);
-    }
-
</del><span class="cx">     void compileCallOrConstruct()
</span><span class="cx">     {
</span><span class="cx">         int dummyThisArgument = m_node-&gt;op() == Call ? 0 : 1;
</span><span class="cx">         int numPassedArgs = m_node-&gt;numChildren() - 1;
</span><span class="cx">         int numArgs = numPassedArgs + dummyThisArgument;
</span><span class="cx"> 
</span><ins>+        if (m_node-&gt;hasKnownFunction()
+            &amp;&amp; possiblyCompileInlineableNativeCall(dummyThisArgument, numPassedArgs, numArgs))
+            return;
+
</ins><span class="cx">         LValue jsCallee = lowJSValue(m_graph.varArgChild(m_node, 0));
</span><span class="cx"> 
</span><span class="cx">         unsigned stackmapID = m_stackmapIDs++;
</span><span class="lines">@@ -4024,6 +3975,50 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    bool possiblyCompileInlineableNativeCall(int dummyThisArgument, int numPassedArgs, int numArgs)
+    {
+        JSFunction* knownFunction = m_node-&gt;knownFunction();
+        NativeFunction function = knownFunction-&gt;nativeFunction();
+        Dl_info info;
+        if (dladdr((void*)function, &amp;info)) {
+            LValue callee = getFunctionBySymbol(info.dli_sname);
+            LType typeCallee;
+            if (callee &amp;&amp; (typeCallee = typeOf(callee)) &amp;&amp; (typeCallee = getElementType(typeCallee))) {
+
+                JSScope* scope = knownFunction-&gt;scopeUnchecked();
+                m_out.storePtr(m_callFrame, m_execStorage, m_heaps.CallFrame_callerFrame);
+                m_out.storePtr(constNull(m_out.intPtr), addressFor(m_execStorage, JSStack::CodeBlock));
+                m_out.storePtr(weakPointer(scope), addressFor(m_execStorage, JSStack::ScopeChain));
+                m_out.storePtr(weakPointer(knownFunction), addressFor(m_execStorage, JSStack::Callee));
+
+                m_out.store64(m_out.constInt64(numArgs), addressFor(m_execStorage, JSStack::ArgumentCount));
+
+                if (dummyThisArgument) 
+                    m_out.storePtr(getUndef(m_out.int64), addressFor(m_execStorage, JSStack::ThisArgument));
+                
+                for (int i = 0; i &lt; numPassedArgs; ++i) {
+                    m_out.storePtr(lowJSValue(m_graph.varArgChild(m_node, 1 + i)),
+                        addressFor(m_execStorage, dummyThisArgument ? JSStack::FirstArgument : JSStack::ThisArgument, i * sizeof(Register)));
+                }
+
+                LType typeCalleeArg;
+                getParamTypes(typeCallee, &amp;typeCalleeArg);
+                LValue calleeCallFrame = m_out.address(m_execState, m_heaps.CallFrame_callerFrame).value();
+                m_out.storePtr(m_out.ptrToInt(calleeCallFrame, m_out.intPtr), m_out.absolute(&amp;vm().topCallFrame));
+                
+                LValue call = vmCall(callee, 
+                    m_out.bitCast(calleeCallFrame, typeCalleeArg));
+
+                if (Options::verboseCompilation())
+                    dataLog(&quot;Inlining: &quot;, info.dli_sname, &quot;\n&quot;);
+
+                setJSValue(call);
+                return true;
+            }
+        }
+        return false;
+    }
+
</ins><span class="cx">     LValue getFunctionBySymbol(const CString symbol)
</span><span class="cx">     {
</span><span class="cx">         if (!m_ftlState.symbolTable.contains(symbol)) 
</span><span class="lines">@@ -4155,8 +4150,6 @@
</span><span class="cx">                 case PutById:
</span><span class="cx">                 case Call:
</span><span class="cx">                 case Construct:
</span><del>-                case NativeCall:
-                case NativeConstruct:
</del><span class="cx">                     return m_out.below(
</span><span class="cx">                         m_callFrame,
</span><span class="cx">                         m_out.loadPtr(
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreruntimeJSCJSValueh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/runtime/JSCJSValue.h (169792 => 169793)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/runtime/JSCJSValue.h        2014-06-11 04:19:00 UTC (rev 169792)
+++ branches/ftlopt/Source/JavaScriptCore/runtime/JSCJSValue.h        2014-06-11 04:31:22 UTC (rev 169793)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">     JSObject* toObject(ExecState*, JSGlobalObject*) const;
</span><span class="cx"> 
</span><span class="cx">     // Integer conversions.
</span><del>-    JS_EXPORT_PRIVATE double toInteger(ExecState*) const;
</del><ins>+    double toInteger(ExecState*) const;
</ins><span class="cx">     JS_EXPORT_PRIVATE double toIntegerPreserveNaN(ExecState*) const;
</span><span class="cx">     int32_t toInt32(ExecState*) const;
</span><span class="cx">     uint32_t toUInt32(ExecState*) const;
</span></span></pre>
</div>
</div>

</body>
</html>