<!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>[167189] trunk</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/167189">167189</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2014-04-12 16:01:33 -0700 (Sat, 12 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Math.fround() should be an intrinsic
https://bugs.webkit.org/show_bug.cgi?id=131583

Source/JavaScriptCore: 

Reviewed by Geoffrey Garen.
        
Makes programs that use Math.fround() run up to 6x faster.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsic):
* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::performNodeCSE):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileArithFRound):
* runtime/Intrinsic.h:
* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):

LayoutTests: 

Reviewed by Geoffrey Garen.
        
This test runs 4.4635x faster with the intrinsic.

* js/regress/fround-expected.txt: Added.
* js/regress/fround.html: Added.
* js/regress/script-tests/fround.js: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh">trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp">trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGCSEPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGClobberizeh">trunk/Source/JavaScriptCore/dfg/DFGClobberize.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGFixupPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGNodeTypeh">trunk/Source/JavaScriptCore/dfg/DFGNodeType.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSafeToExecuteh">trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLCapabilitiescpp">trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp">trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntrinsich">trunk/Source/JavaScriptCore/runtime/Intrinsic.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMathObjectcpp">trunk/Source/JavaScriptCore/runtime/MathObject.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsregressfroundexpectedtxt">trunk/LayoutTests/js/regress/fround-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjsregressfroundhtml">trunk/LayoutTests/js/regress/fround.html</a></li>
<li><a href="#trunkLayoutTestsjsregressscripttestsfroundjs">trunk/LayoutTests/js/regress/script-tests/fround.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/LayoutTests/ChangeLog        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-04-12  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        Math.fround() should be an intrinsic
+        https://bugs.webkit.org/show_bug.cgi?id=131583
+
+        Reviewed by Geoffrey Garen.
+        
+        This test runs 4.4635x faster with the intrinsic.
+
+        * js/regress/fround-expected.txt: Added.
+        * js/regress/fround.html: Added.
+        * js/regress/script-tests/fround.js: Added.
+
</ins><span class="cx"> 2014-04-12  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         [SOUP] Libsoup internal credential setting should be controlled by loader decision
</span></span></pre></div>
<a id="trunkLayoutTestsjsregressfroundexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/fround-expected.txt (0 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/fround-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/regress/fround-expected.txt        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+JSRegress/fround
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressfroundhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/fround.html (0 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/fround.html                                (rev 0)
+++ trunk/LayoutTests/js/regress/fround.html        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/regress-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;script-tests/fround.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/regress-post.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsjsregressscripttestsfroundjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/regress/script-tests/fround.js (0 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/regress/script-tests/fround.js                                (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/fround.js        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+(function() {
+    var x = Math.fround(42.5);
+    for (var i = 0; i &lt; 3000000; ++i)
+        x = Math.fround(Math.fround(Math.fround(i + 0.5) * 2.1353562) + x);
+    
+    if (x != 9609154658304)
+        throw &quot;Error: bad result: &quot; + x;
+})();
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -1,5 +1,42 @@
</span><span class="cx"> 2014-04-12  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Math.fround() should be an intrinsic
+        https://bugs.webkit.org/show_bug.cgi?id=131583
+
+        Reviewed by Geoffrey Garen.
+        
+        Makes programs that use Math.fround() run up to 6x faster.
+
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::handleIntrinsic):
+        * dfg/DFGCSEPhase.cpp:
+        (JSC::DFG::CSEPhase::performNodeCSE):
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGNodeType.h:
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        (JSC::DFG::PredictionPropagationPhase::propagate):
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::compileNode):
+        (JSC::FTL::LowerDFGToLLVM::compileArithFRound):
+        * runtime/Intrinsic.h:
+        * runtime/MathObject.cpp:
+        (JSC::MathObject::finishCreation):
+
+2014-04-12  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
</ins><span class="cx">         FTL should use stackmap register liveness
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=130791
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -727,6 +727,16 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">         
</span><ins>+    case ArithFRound: {
+        JSValue child = forNode(node-&gt;child1()).value();
+        if (child &amp;&amp; child.isNumber()) {
+            setConstant(node, jsNumber(static_cast&lt;float&gt;(child.asNumber())));
+            break;
+        }
+        forNode(node).setType(SpecDouble);
+        break;
+    }
+        
</ins><span class="cx">     case ArithSin: {
</span><span class="cx">         JSValue child = forNode(node-&gt;child1()).value();
</span><span class="cx">         if (child &amp;&amp; child.isNumber()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -1706,6 +1706,14 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">         
</span><ins>+    case FRoundIntrinsic: {
+        if (argumentCountIncludingThis != 2)
+            return false;
+        VirtualRegister operand = virtualRegisterForArgument(1, registerOffset);
+        set(VirtualRegister(resultOperand), addToGraph(ArithFRound, get(operand)));
+        return true;
+    }
+        
</ins><span class="cx">     case DFGTrue: {
</span><span class="cx">         set(VirtualRegister(resultOperand), getJSConstantForValue(jsBoolean(true)));
</span><span class="cx">         return true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGCSEPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -1128,6 +1128,7 @@
</span><span class="cx">         case ArithMin:
</span><span class="cx">         case ArithMax:
</span><span class="cx">         case ArithSqrt:
</span><ins>+        case ArithFRound:
</ins><span class="cx">         case ArithSin:
</span><span class="cx">         case ArithCos:
</span><span class="cx">         case StringCharAt:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGClobberizeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGClobberize.h (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGClobberize.h        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGClobberize.h        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx">     case ArithMin:
</span><span class="cx">     case ArithMax:
</span><span class="cx">     case ArithSqrt:
</span><ins>+    case ArithFRound:
</ins><span class="cx">     case ArithSin:
</span><span class="cx">     case ArithCos:
</span><span class="cx">     case GetScope:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGFixupPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -291,6 +291,7 @@
</span><span class="cx">         }
</span><span class="cx">             
</span><span class="cx">         case ArithSqrt:
</span><ins>+        case ArithFRound:
</ins><span class="cx">         case ArithSin:
</span><span class="cx">         case ArithCos: {
</span><span class="cx">             fixEdge&lt;NumberUse&gt;(node-&gt;child1());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGNodeTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGNodeType.h (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -127,6 +127,7 @@
</span><span class="cx">     macro(ArithAbs, NodeResultNumber) \
</span><span class="cx">     macro(ArithMin, NodeResultNumber) \
</span><span class="cx">     macro(ArithMax, NodeResultNumber) \
</span><ins>+    macro(ArithFRound, NodeResultNumber) \
</ins><span class="cx">     macro(ArithSqrt, NodeResultNumber) \
</span><span class="cx">     macro(ArithSin, NodeResultNumber) \
</span><span class="cx">     macro(ArithCos, NodeResultNumber) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -321,6 +321,7 @@
</span><span class="cx">         }
</span><span class="cx">             
</span><span class="cx">         case ArithSqrt:
</span><ins>+        case ArithFRound:
</ins><span class="cx">         case ArithSin:
</span><span class="cx">         case ArithCos: {
</span><span class="cx">             changed |= setPrediction(SpecDouble);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSafeToExecuteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -150,6 +150,7 @@
</span><span class="cx">     case ArithMin:
</span><span class="cx">     case ArithMax:
</span><span class="cx">     case ArithSqrt:
</span><ins>+    case ArithFRound:
</ins><span class="cx">     case ArithSin:
</span><span class="cx">     case ArithCos:
</span><span class="cx">     case ValueAdd:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -2247,6 +2247,17 @@
</span><span class="cx">         doubleResult(result.fpr(), node);
</span><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+        
+    case ArithFRound: {
+        SpeculateDoubleOperand op1(this, node-&gt;child1());
+        FPRTemporary result(this, op1);
+        
+        m_jit.convertDoubleToFloat(op1.fpr(), result.fpr());
+        m_jit.convertFloatToDouble(result.fpr(), result.fpr());
+        
+        doubleResult(result.fpr(), node);
+        break;
+    }
</ins><span class="cx"> 
</span><span class="cx">     case ArithSin: {
</span><span class="cx">         SpeculateDoubleOperand op1(this, node-&gt;child1());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -2579,6 +2579,17 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">         
</span><ins>+    case ArithFRound: {
+        SpeculateDoubleOperand op1(this, node-&gt;child1());
+        FPRTemporary result(this, op1);
+        
+        m_jit.convertDoubleToFloat(op1.fpr(), result.fpr());
+        m_jit.convertFloatToDouble(result.fpr(), result.fpr());
+        
+        doubleResult(result.fpr(), node);
+        break;
+    }
+
</ins><span class="cx">     case ArithSin: {
</span><span class="cx">         SpeculateDoubleOperand op1(this, node-&gt;child1());
</span><span class="cx">         FPRReg op1FPR = op1.fpr();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -87,6 +87,7 @@
</span><span class="cx">     case ArithSin:
</span><span class="cx">     case ArithCos:
</span><span class="cx">     case ArithSqrt:
</span><ins>+    case ArithFRound:
</ins><span class="cx">     case ArithNegate:
</span><span class="cx">     case UInt32ToNumber:
</span><span class="cx">     case Int32ToDouble:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -351,6 +351,9 @@
</span><span class="cx">         case ArithSqrt:
</span><span class="cx">             compileArithSqrt();
</span><span class="cx">             break;
</span><ins>+        case ArithFRound:
+            compileArithFRound();
+            break;
</ins><span class="cx">         case ArithNegate:
</span><span class="cx">             compileArithNegate();
</span><span class="cx">             break;
</span><span class="lines">@@ -1385,6 +1388,12 @@
</span><span class="cx"> 
</span><span class="cx">     void compileArithSqrt() { setDouble(m_out.doubleSqrt(lowDouble(m_node-&gt;child1()))); }
</span><span class="cx">     
</span><ins>+    void compileArithFRound()
+    {
+        LValue floatValue = m_out.fpCast(lowDouble(m_node-&gt;child1()), m_out.floatType);
+        setDouble(m_out.fpCast(floatValue, m_out.doubleType));
+    }
+    
</ins><span class="cx">     void compileArithNegate()
</span><span class="cx">     {
</span><span class="cx">         switch (m_node-&gt;child1().useKind()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntrinsich"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Intrinsic.h (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Intrinsic.h        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/runtime/Intrinsic.h        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx">     RegExpTestIntrinsic,
</span><span class="cx">     StringPrototypeValueOfIntrinsic,
</span><span class="cx">     IMulIntrinsic,
</span><ins>+    FRoundIntrinsic,
</ins><span class="cx">     ArrayIteratorNextValueIntrinsic,
</span><span class="cx">     ArrayIteratorNextKeyIntrinsic,
</span><span class="cx">     ArrayIteratorNextGenericIntrinsic,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMathObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MathObject.cpp (167188 => 167189)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MathObject.cpp        2014-04-12 21:06:17 UTC (rev 167188)
+++ trunk/Source/JavaScriptCore/runtime/MathObject.cpp        2014-04-12 23:01:33 UTC (rev 167189)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;exp&quot;), 1, mathProtoFuncExp, ExpIntrinsic, DontEnum | Function);
</span><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;expm1&quot;), 1, mathProtoFuncExpm1, NoIntrinsic, DontEnum | Function);
</span><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;floor&quot;), 1, mathProtoFuncFloor, FloorIntrinsic, DontEnum | Function);
</span><del>-    putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;fround&quot;), 1, mathProtoFuncFround, NoIntrinsic, DontEnum | Function);
</del><ins>+    putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;fround&quot;), 1, mathProtoFuncFround, FRoundIntrinsic, DontEnum | Function);
</ins><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;hypot&quot;), 2, mathProtoFuncHypot, NoIntrinsic, DontEnum | Function);
</span><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;log&quot;), 1, mathProtoFuncLog, LogIntrinsic, DontEnum | Function);
</span><span class="cx">     putDirectNativeFunctionWithoutTransition(vm, globalObject, Identifier(&amp;vm, &quot;log10&quot;), 1, mathProtoFuncLog10, NoIntrinsic, DontEnum | Function);
</span></span></pre>
</div>
</div>

</body>
</html>