<!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>[169864] 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/169864">169864</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2014-06-11 17:25:01 -0700 (Wed, 11 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre> Readded native calling to the FTL and Split the DFG nodes
Call and Construct into NativeCall and NativeConstruct
to better represent their semantics.
https://bugs.webkit.org/show_bug.cgi?id=133660
Reviewed by Filip Pizlo.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
Added NativeCall and NativeConstruct case
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addCall): added NativeCall case.
(JSC::DFG::ByteCodeParser::handleCall):
set to return NativeCall or NativeConstruct instead of Call or Construct
in the presence of a native function.
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize): added NativeCall and NativeConstruct case.
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC): added NativeCall and NativeConstruct case.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): added NativeCall and NativeConstruct case.
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction): added NativeCall and NativeConstruct case.
(JSC::DFG::Node::canBeKnownFunction): changed to NativeCall and NativeConstruct.
(JSC::DFG::Node::hasKnownFunction): changed to NativeCall and NativeConstruct.
* dfg/DFGNodeType.h: added NativeCall and NativeConstruct.
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate): added NativeCall and NativeConstruct case.
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute): added NativeCall and NativeConstruct case.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall): ditto
(JSC::DFG::SpeculativeJIT::compile): ditto
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall): ditto
(JSC::DFG::SpeculativeJIT::compile): ditto
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile): ditto
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::lower): ditto
(JSC::FTL::LowerDFGToLLVM::compileNode): ditto.
(JSC::FTL::LowerDFGToLLVM::compileNativeCallOrConstruct): Added.
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct): removed NativeCall and NativeConstruct functionality.
(JSC::FTL::LowerDFGToLLVM::didOverflowStack): added NativeCall and NativeConstruct case.
* runtime/JSCJSValue.h: added JS_EXPORT_PRIVATE to toInteger as it is apparently needed.
Patch by Matthew Mirman <mmirman@apple.com> on 2014-06-11</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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/ChangeLog        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/ChangeLog        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -1,5 +1,53 @@
</span><span class="cx"> 2014-06-11 Matthew Mirman <mmirman@apple.com>
</span><span class="cx">
</span><ins>+ Readded native calling to the FTL and Split the DFG nodes
+ Call and Construct into NativeCall and NativeConstruct
+ to better represent their semantics.
+ https://bugs.webkit.org/show_bug.cgi?id=133660
+
+ Reviewed by Filip Pizlo.
+
+ * dfg/DFGAbstractInterpreterInlines.h:
+ (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
+ Added NativeCall and NativeConstruct case
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::addCall): added NativeCall case.
+ (JSC::DFG::ByteCodeParser::handleCall):
+ set to return NativeCall or NativeConstruct instead of Call or Construct
+ in the presence of a native function.
+ * dfg/DFGClobberize.h:
+ (JSC::DFG::clobberize): added NativeCall and NativeConstruct case.
+ * dfg/DFGDoesGC.cpp:
+ (JSC::DFG::doesGC): added NativeCall and NativeConstruct case.
+ * dfg/DFGFixupPhase.cpp:
+ (JSC::DFG::FixupPhase::fixupNode): added NativeCall and NativeConstruct case.
+ * dfg/DFGNode.h:
+ (JSC::DFG::Node::hasHeapPrediction): added NativeCall and NativeConstruct case.
+ (JSC::DFG::Node::canBeKnownFunction): changed to NativeCall and NativeConstruct.
+ (JSC::DFG::Node::hasKnownFunction): changed to NativeCall and NativeConstruct.
+ * dfg/DFGNodeType.h: added NativeCall and NativeConstruct.
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ (JSC::DFG::PredictionPropagationPhase::propagate): added NativeCall and NativeConstruct case.
+ * dfg/DFGSafeToExecute.h:
+ (JSC::DFG::safeToExecute): added NativeCall and NativeConstruct case.
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::emitCall): ditto
+ (JSC::DFG::SpeculativeJIT::compile): ditto
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::emitCall): ditto
+ (JSC::DFG::SpeculativeJIT::compile): ditto
+ * ftl/FTLCapabilities.cpp:
+ (JSC::FTL::canCompile): ditto
+ * ftl/FTLLowerDFGToLLVM.cpp:
+ (JSC::FTL::LowerDFGToLLVM::lower): ditto
+ (JSC::FTL::LowerDFGToLLVM::compileNode): ditto.
+ (JSC::FTL::LowerDFGToLLVM::compileNativeCallOrConstruct): Added.
+ (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct): removed NativeCall and NativeConstruct functionality.
+ (JSC::FTL::LowerDFGToLLVM::didOverflowStack): added NativeCall and NativeConstruct case.
+ * runtime/JSCJSValue.h: added JS_EXPORT_PRIVATE to toInteger as it is apparently needed.
+
+2014-06-11 Matthew Mirman <mmirman@apple.com>
+
</ins><span class="cx"> Ensured Native Calls and Construct and associated checks
</span><span class="cx"> are only emitted during ftl mode.
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=133718
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -1871,6 +1871,8 @@
</span><span class="cx">
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><span class="cx"> node->setCanExit(true);
</span><span class="cx"> clobberWorld(node->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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -649,7 +649,7 @@
</span><span class="cx"> if (parameterSlots > m_parameterSlots)
</span><span class="cx"> m_parameterSlots = parameterSlots;
</span><span class="cx">
</span><del>- int dummyThisArgument = op == Call ? 0 : 1;
</del><ins>+ int dummyThisArgument = op == Call || op == NativeCall ? 0 : 1;
</ins><span class="cx"> for (int i = 0 + dummyThisArgument; i < argCount; ++i)
</span><span class="cx"> addVarArgChild(get(virtualRegisterForArgument(i, registerOffset)));
</span><span class="cx">
</span><span class="lines">@@ -1068,10 +1068,19 @@
</span><span class="cx"> if (function && function->isHostFunction()) {
</span><span class="cx"> emitFunctionChecks(callLinkStatus, callTarget, registerOffset, specializationKind);
</span><span class="cx"> knownFunction = function;
</span><ins>+
+ if (op == Call)
+ op = NativeCall;
+ else {
+ ASSERT(op == Construct);
+ op = NativeConstruct;
+ }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>-
- addCall(result, op, callTarget, argumentCountIncludingThis, registerOffset)->giveKnownFunction(knownFunction);
</del><ins>+ Node* call = addCall(result, op, callTarget, argumentCountIncludingThis, registerOffset);
+
+ if (knownFunction)
+ call->giveKnownFunction(knownFunction);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ByteCodeParser::emitFunctionChecks(const CallLinkStatus& 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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGClobberize.h        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGClobberize.h        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -199,6 +199,8 @@
</span><span class="cx"> case ArrayPop:
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -116,6 +116,8 @@
</span><span class="cx"> case CompareStrictEq:
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -1082,6 +1082,8 @@
</span><span class="cx"> case AllocationProfileWatchpoint:
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGNode.h        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGNode.h        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -992,6 +992,8 @@
</span><span class="cx"> case GetMyArgumentByValSafe:
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><span class="cx"> case GetByOffset:
</span><span class="cx"> case MultiGetByOffset:
</span><span class="cx"> case GetClosureVar:
</span><span class="lines">@@ -1022,8 +1024,8 @@
</span><span class="cx"> bool canBeKnownFunction()
</span><span class="cx"> {
</span><span class="cx"> switch (op()) {
</span><del>- case Construct:
- case Call:
</del><ins>+ case NativeConstruct:
+ case NativeCall:
</ins><span class="cx"> return true;
</span><span class="cx"> default:
</span><span class="cx"> return false;
</span><span class="lines">@@ -1033,8 +1035,8 @@
</span><span class="cx"> bool hasKnownFunction()
</span><span class="cx"> {
</span><span class="cx"> switch (op()) {
</span><del>- case Construct:
- case Call:
</del><ins>+ case NativeConstruct:
+ case NativeCall:
</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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGNodeType.h        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGNodeType.h        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -211,6 +211,8 @@
</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><ins>+ macro(NativeCall, NodeResultJS | NodeMustGenerate | NodeHasVarArgs | NodeClobbersWorld) \
+ macro(NativeConstruct, NodeResultJS | NodeMustGenerate | NodeHasVarArgs | NodeClobbersWorld) \
</ins><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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -182,6 +182,8 @@
</span><span class="cx"> case MultiGetByOffset:
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><span class="cx"> case GetGlobalVar:
</span><span class="cx"> case GetClosureVar: {
</span><span class="cx"> changed |= setPrediction(node->getHeapPrediction());
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoredfgDFGSafeToExecuteh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/dfg/DFGSafeToExecute.h (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -255,7 +255,11 @@
</span><span class="cx"> case GetGetter:
</span><span class="cx"> case GetSetter:
</span><span class="cx"> return true;
</span><del>-
</del><ins>+
+ case NativeCall:
+ case NativeConstruct:
+ return false; // TODO: add a check for already checked. https://bugs.webkit.org/show_bug.cgi?id=133769
+
</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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -639,14 +639,15 @@
</span><span class="cx">
</span><span class="cx"> void SpeculativeJIT::emitCall(Node* node)
</span><span class="cx"> {
</span><del>- if (node->op() != Call)
</del><ins>+ bool isCall = node->op() == Call;
+ if (!isCall)
</ins><span class="cx"> ASSERT(node->op() == Construct);
</span><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 = node->op() == Call ? 0 : 1;
</del><ins>+ int dummyThisArgument = isCall ? 0 : 1;
</ins><span class="cx">
</span><del>- CallLinkInfo::CallType callType = node->op() == Call ? CallLinkInfo::Call : CallLinkInfo::Construct;
</del><ins>+ CallLinkInfo::CallType callType = isCall ? CallLinkInfo::Call : CallLinkInfo::Construct;
</ins><span class="cx">
</span><span class="cx"> Edge calleeEdge = m_jit.graph().m_varArgChildren[node->firstChild()];
</span><span class="cx"> JSValueOperand callee(this, calleeEdge);
</span><span class="lines">@@ -4591,7 +4592,8 @@
</span><span class="cx"> // This is a no-op.
</span><span class="cx"> noResult(node);
</span><span class="cx"> break;
</span><del>-
</del><ins>+
+
</ins><span class="cx"> case Unreachable:
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> break;
</span><span class="lines">@@ -4610,6 +4612,8 @@
</span><span class="cx"> case ArithIMul:
</span><span class="cx"> case MultiGetByOffset:
</span><span class="cx"> case MultiPutByOffset:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -625,14 +625,16 @@
</span><span class="cx">
</span><span class="cx"> void SpeculativeJIT::emitCall(Node* node)
</span><span class="cx"> {
</span><del>- if (node->op() != Call)
</del><ins>+
+ bool isCall = node->op() == Call;
+ if (!isCall)
</ins><span class="cx"> RELEASE_ASSERT(node->op() == Construct);
</span><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 = node->op() == Call ? 0 : 1;
</del><ins>+ int dummyThisArgument = isCall ? 0 : 1;
</ins><span class="cx">
</span><del>- CallLinkInfo::CallType callType = node->op() == Call ? CallLinkInfo::Call : CallLinkInfo::Construct;
</del><ins>+ CallLinkInfo::CallType callType = isCall ? CallLinkInfo::Call : CallLinkInfo::Construct;
</ins><span class="cx">
</span><span class="cx"> Edge calleeEdge = m_jit.graph().m_varArgChildren[node->firstChild()];
</span><span class="cx"> JSValueOperand callee(this, calleeEdge);
</span><span class="lines">@@ -4654,7 +4656,9 @@
</span><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> break;
</span><span class="cx"> #endif // ENABLE(FTL_JIT)
</span><del>-
</del><ins>+
+ case NativeCall:
+ case NativeConstruct:
</ins><span class="cx"> case LastNodeType:
</span><span class="cx"> case Phi:
</span><span class="cx"> case Upsilon:
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreftlFTLCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/ftl/FTLCapabilities.cpp (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -118,6 +118,8 @@
</span><span class="cx"> case StoreBarrierWithNullCheck:
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -154,13 +154,8 @@
</span><span class="cx"> Node* m_node = block->at(nodeIndex);
</span><span class="cx"> if (m_node->hasKnownFunction()) {
</span><span class="cx"> int numArgs = m_node->numChildren();
</span><del>- NativeFunction func = m_node->knownFunction()->nativeFunction();
- Dl_info info;
- if (dladdr((void*)func, &info)) {
- LValue callee = getFunctionBySymbol(info.dli_sname);
- if (callee && numArgs > maxNumberOfArguments)
- maxNumberOfArguments = numArgs;
- }
</del><ins>+ if (numArgs > maxNumberOfArguments)
+ maxNumberOfArguments = numArgs;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -634,6 +629,10 @@
</span><span class="cx"> case Construct:
</span><span class="cx"> compileCallOrConstruct();
</span><span class="cx"> break;
</span><ins>+ case NativeCall:
+ case NativeConstruct:
+ compileNativeCallOrConstruct();
+ break;
</ins><span class="cx"> case Jump:
</span><span class="cx"> compileJump();
</span><span class="cx"> break;
</span><span class="lines">@@ -3577,16 +3576,66 @@
</span><span class="cx"> setBoolean(m_out.bitNot(boolify(m_node->child1())));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ void compileNativeCallOrConstruct()
+ {
+ int dummyThisArgument = m_node->op() == NativeCall ? 0 : 1;
+ int numPassedArgs = m_node->numChildren() - 1;
+ int numArgs = numPassedArgs + dummyThisArgument;
+
+ ASSERT(m_node->hasKnownFunction());
+
+ JSFunction* knownFunction = m_node->knownFunction();
+ NativeFunction function = knownFunction->nativeFunction();
+
+ Dl_info info;
+ if (!dladdr((void*)function, &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->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 < 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(&vm().topCallFrame));
+
+ LType typeCalleeArg;
+ getParamTypes(getElementType(typeOf(callee)), &typeCalleeArg);
+
+ LValue argument = notInlinable
+ ? m_out.ptrToInt(calleeCallFrame, typeCalleeArg)
+ : m_out.bitCast(calleeCallFrame, typeCalleeArg);
+ LValue call = vmCall(callee, argument);
+
+ if (Options::verboseCompilation())
+ dataLog("Native calling: ", info.dli_sname, "\n");
+
+ setJSValue(call);
+ }
+
</ins><span class="cx"> void compileCallOrConstruct()
</span><span class="cx"> {
</span><span class="cx"> int dummyThisArgument = m_node->op() == Call ? 0 : 1;
</span><span class="cx"> int numPassedArgs = m_node->numChildren() - 1;
</span><span class="cx"> int numArgs = numPassedArgs + dummyThisArgument;
</span><span class="cx">
</span><del>- if (m_node->hasKnownFunction()
- && possiblyCompileInlineableNativeCall(dummyThisArgument, numPassedArgs, numArgs))
- return;
-
</del><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">@@ -3967,50 +4016,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>- bool possiblyCompileInlineableNativeCall(int dummyThisArgument, int numPassedArgs, int numArgs)
- {
- JSFunction* knownFunction = m_node->knownFunction();
- NativeFunction function = knownFunction->nativeFunction();
- Dl_info info;
- if (dladdr((void*)function, &info)) {
- LValue callee = getFunctionBySymbol(info.dli_sname);
- LType typeCallee;
- if (callee && (typeCallee = typeOf(callee)) && (typeCallee = getElementType(typeCallee))) {
-
- JSScope* scope = knownFunction->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 < 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, &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(&vm().topCallFrame));
-
- LValue call = vmCall(callee,
- m_out.bitCast(calleeCallFrame, typeCalleeArg));
-
- if (Options::verboseCompilation())
- dataLog("Inlining: ", info.dli_sname, "\n");
-
- setJSValue(call);
- return true;
- }
- }
- return false;
- }
-
</del><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">@@ -4142,6 +4147,8 @@
</span><span class="cx"> case PutById:
</span><span class="cx"> case Call:
</span><span class="cx"> case Construct:
</span><ins>+ case NativeCall:
+ case NativeConstruct:
</ins><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 (169863 => 169864)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/runtime/JSCJSValue.h        2014-06-12 00:14:27 UTC (rev 169863)
+++ branches/ftlopt/Source/JavaScriptCore/runtime/JSCJSValue.h        2014-06-12 00:25:01 UTC (rev 169864)
</span><span class="lines">@@ -241,7 +241,7 @@
</span><span class="cx"> JSObject* toObject(ExecState*, JSGlobalObject*) const;
</span><span class="cx">
</span><span class="cx"> // Integer conversions.
</span><del>- double toInteger(ExecState*) const;
</del><ins>+ JS_EXPORT_PRIVATE 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>