<!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>[183072] trunk/Source/JavaScriptCore</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>MovHint should be a strong use
https://bugs.webkit.org/show_bug.cgi?id=143734

Reviewed by Geoffrey Garen.
        
This disables any DCE that assumes equivalence between DFG IR uses and bytecode uses. Doing
so is a major step towards allowing more fancy DFG transformations and also probably fixing
some bugs.
        
Just making MovHint a strong use would also completely disable DCE. So we mitigate this by
introducing a MovHint removal phase that runs in FTL.
        
This is a slight slowdown on Octane/gbemu, but it's basically neutral on suite averages.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeOrigin.cpp:
(JSC::InlineCallFrame::dumpInContext):
* dfg/DFGDCEPhase.cpp:
(JSC::DFG::DCEPhase::fixupBlock):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGEpoch.cpp: Added.
(JSC::DFG::Epoch::dump):
* dfg/DFGEpoch.h: Added.
(JSC::DFG::Epoch::Epoch):
(JSC::DFG::Epoch::first):
(JSC::DFG::Epoch::operator!):
(JSC::DFG::Epoch::next):
(JSC::DFG::Epoch::bump):
(JSC::DFG::Epoch::operator==):
(JSC::DFG::Epoch::operator!=):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGMovHintRemovalPhase.cpp: Added.
(JSC::DFG::performMovHintRemoval):
* dfg/DFGMovHintRemovalPhase.h: Added.
* dfg/DFGNodeType.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* runtime/Options.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeOrigincpp">trunk/Source/JavaScriptCore/bytecode/CodeOrigin.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGDCEPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGDCEPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGDisassemblercpp">trunk/Source/JavaScriptCore/dfg/DFGDisassembler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGMayExitcpp">trunk/Source/JavaScriptCore/dfg/DFGMayExit.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGNodeTypeh">trunk/Source/JavaScriptCore/dfg/DFGNodeType.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGPlancpp">trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJITcpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionsh">trunk/Source/JavaScriptCore/runtime/Options.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoredfgDFGEpochcpp">trunk/Source/JavaScriptCore/dfg/DFGEpoch.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGEpochh">trunk/Source/JavaScriptCore/dfg/DFGEpoch.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGMovHintRemovalPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGMovHintRemovalPhaseh">trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -156,6 +156,7 @@
</span><span class="cx">     dfg/DFGDominators.cpp
</span><span class="cx">     dfg/DFGDriver.cpp
</span><span class="cx">     dfg/DFGEdge.cpp
</span><ins>+    dfg/DFGEpoch.cpp
</ins><span class="cx">     dfg/DFGFailedFinalizer.cpp
</span><span class="cx">     dfg/DFGFinalizer.cpp
</span><span class="cx">     dfg/DFGFixupPhase.cpp
</span><span class="lines">@@ -181,6 +182,7 @@
</span><span class="cx">     dfg/DFGLoopPreHeaderCreationPhase.cpp
</span><span class="cx">     dfg/DFGMayExit.cpp
</span><span class="cx">     dfg/DFGMinifiedNode.cpp
</span><ins>+    dfg/DFGMovHintRemovalPhase.cpp
</ins><span class="cx">     dfg/DFGNaiveDominators.cpp
</span><span class="cx">     dfg/DFGNaturalLoops.cpp
</span><span class="cx">     dfg/DFGNode.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2015-04-19  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        MovHint should be a strong use
+        https://bugs.webkit.org/show_bug.cgi?id=143734
+
+        Reviewed by Geoffrey Garen.
+        
+        This disables any DCE that assumes equivalence between DFG IR uses and bytecode uses. Doing
+        so is a major step towards allowing more fancy DFG transformations and also probably fixing
+        some bugs.
+        
+        Just making MovHint a strong use would also completely disable DCE. So we mitigate this by
+        introducing a MovHint removal phase that runs in FTL.
+        
+        This is a slight slowdown on Octane/gbemu, but it's basically neutral on suite averages.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bytecode/CodeOrigin.cpp:
+        (JSC::InlineCallFrame::dumpInContext):
+        * dfg/DFGDCEPhase.cpp:
+        (JSC::DFG::DCEPhase::fixupBlock):
+        * dfg/DFGDisassembler.cpp:
+        (JSC::DFG::Disassembler::createDumpList):
+        * dfg/DFGEpoch.cpp: Added.
+        (JSC::DFG::Epoch::dump):
+        * dfg/DFGEpoch.h: Added.
+        (JSC::DFG::Epoch::Epoch):
+        (JSC::DFG::Epoch::first):
+        (JSC::DFG::Epoch::operator!):
+        (JSC::DFG::Epoch::next):
+        (JSC::DFG::Epoch::bump):
+        (JSC::DFG::Epoch::operator==):
+        (JSC::DFG::Epoch::operator!=):
+        * dfg/DFGMayExit.cpp:
+        (JSC::DFG::mayExit):
+        * dfg/DFGMovHintRemovalPhase.cpp: Added.
+        (JSC::DFG::performMovHintRemoval):
+        * dfg/DFGMovHintRemovalPhase.h: Added.
+        * dfg/DFGNodeType.h:
+        * dfg/DFGPlan.cpp:
+        (JSC::DFG::Plan::compileInThreadImpl):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * runtime/Options.h:
+
</ins><span class="cx"> 2015-04-21  Basile Clement  &lt;basile_clement@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r182899): icloud.com crashes
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -400,6 +400,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGDominators.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGDriver.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGEdge.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\dfg\DFGEpoch.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGFailedFinalizer.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGFinalizer.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGFixupPhase.cpp&quot; /&gt;
</span><span class="lines">@@ -425,6 +426,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGLoopPreHeaderCreationPhase.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGMayExit.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGMinifiedNode.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\dfg\DFGMovHintRemovalPhase.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGNaiveDominators.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGNaturalLoops.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGNode.cpp&quot; /&gt;
</span><span class="lines">@@ -1081,6 +1083,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGEdge.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGEdgeDominates.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGEdgeUsesStructure.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\dfg\DFGEpoch.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGFailedFinalizer.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGFiltrationResult.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGFinalizer.h&quot; /&gt;
</span><span class="lines">@@ -1115,6 +1118,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGMinifiedGraph.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGMinifiedID.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGMinifiedNode.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\dfg\DFGMovHintRemovalPhase.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGNaiveDominators.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGNaturalLoops.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGNode.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -416,6 +416,10 @@
</span><span class="cx">                 0F8364B7164B0C110053329A /* DFGBranchDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8364B5164B0C0E0053329A /* DFGBranchDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F885E111849A3BE00F1E3FA /* BytecodeUseDef.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F885E101849A3BE00F1E3FA /* BytecodeUseDef.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F893BDB1936E23C001211F4 /* DFGStructureAbstractValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F893BDA1936E23C001211F4 /* DFGStructureAbstractValue.cpp */; };
</span><ins>+                0F8F14331ADF090100ED792C /* DFGEpoch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F142F1ADF090100ED792C /* DFGEpoch.cpp */; };
+                0F8F14341ADF090100ED792C /* DFGEpoch.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F14301ADF090100ED792C /* DFGEpoch.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                0F8F14351ADF090100ED792C /* DFGMovHintRemovalPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F14311ADF090100ED792C /* DFGMovHintRemovalPhase.cpp */; };
+                0F8F14361ADF090100ED792C /* DFGMovHintRemovalPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F14321ADF090100ED792C /* DFGMovHintRemovalPhase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 0F8F2B95172E04A0007DBDA5 /* FTLLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B93172E049E007DBDA5 /* FTLLink.cpp */; };
</span><span class="cx">                 0F8F2B96172E04A3007DBDA5 /* FTLLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F8F2B94172E049E007DBDA5 /* FTLLink.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F8F2B99172F04FF007DBDA5 /* DFGDesiredIdentifiers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F8F2B97172F04FD007DBDA5 /* DFGDesiredIdentifiers.cpp */; };
</span><span class="lines">@@ -2142,6 +2146,10 @@
</span><span class="cx">                 0F8364B5164B0C0E0053329A /* DFGBranchDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGBranchDirection.h; path = dfg/DFGBranchDirection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F885E101849A3BE00F1E3FA /* BytecodeUseDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeUseDef.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F893BDA1936E23C001211F4 /* DFGStructureAbstractValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGStructureAbstractValue.cpp; path = dfg/DFGStructureAbstractValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0F8F142F1ADF090100ED792C /* DFGEpoch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGEpoch.cpp; path = dfg/DFGEpoch.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F8F14301ADF090100ED792C /* DFGEpoch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGEpoch.h; path = dfg/DFGEpoch.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F8F14311ADF090100ED792C /* DFGMovHintRemovalPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGMovHintRemovalPhase.cpp; path = dfg/DFGMovHintRemovalPhase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F8F14321ADF090100ED792C /* DFGMovHintRemovalPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGMovHintRemovalPhase.h; path = dfg/DFGMovHintRemovalPhase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0F8F2B93172E049E007DBDA5 /* FTLLink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = FTLLink.cpp; path = ftl/FTLLink.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F8F2B94172E049E007DBDA5 /* FTLLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FTLLink.h; path = ftl/FTLLink.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F8F2B97172F04FD007DBDA5 /* DFGDesiredIdentifiers.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredIdentifiers.cpp; path = dfg/DFGDesiredIdentifiers.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4906,6 +4914,8 @@
</span><span class="cx">                                 0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */,
</span><span class="cx">                                 A7D9A29117A0BC7400EE2618 /* DFGEdgeDominates.h */,
</span><span class="cx">                                 A7986D5617A0BB1E00A95DD0 /* DFGEdgeUsesStructure.h */,
</span><ins>+                                0F8F142F1ADF090100ED792C /* DFGEpoch.cpp */,
+                                0F8F14301ADF090100ED792C /* DFGEpoch.h */,
</ins><span class="cx">                                 A78A976C179738B8009DF744 /* DFGFailedFinalizer.cpp */,
</span><span class="cx">                                 A78A976D179738B8009DF744 /* DFGFailedFinalizer.h */,
</span><span class="cx">                                 A7BFF3BF179868940002F462 /* DFGFiltrationResult.h */,
</span><span class="lines">@@ -4965,6 +4975,8 @@
</span><span class="cx">                                 0FB4B51016B3A964003F696B /* DFGMinifiedID.h */,
</span><span class="cx">                                 0F2BDC4C1522818300CD8910 /* DFGMinifiedNode.cpp */,
</span><span class="cx">                                 0F2BDC3E1522801700CD8910 /* DFGMinifiedNode.h */,
</span><ins>+                                0F8F14311ADF090100ED792C /* DFGMovHintRemovalPhase.cpp */,
+                                0F8F14321ADF090100ED792C /* DFGMovHintRemovalPhase.h */,
</ins><span class="cx">                                 0FC3CCFA19ADA410006AC72A /* DFGNaiveDominators.cpp */,
</span><span class="cx">                                 0FC3CCFB19ADA410006AC72A /* DFGNaiveDominators.h */,
</span><span class="cx">                                 A737810A1799EA2E00817533 /* DFGNaturalLoops.cpp */,
</span><span class="lines">@@ -5660,6 +5672,7 @@
</span><span class="cx">                                 969A07230ED1CE3300F1F681 /* BytecodeGenerator.h in Headers */,
</span><span class="cx">                                 C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */,
</span><span class="cx">                                 0F666EC0183566F900D017F1 /* BytecodeLivenessAnalysisInlines.h in Headers */,
</span><ins>+                                0F8F14361ADF090100ED792C /* DFGMovHintRemovalPhase.h in Headers */,
</ins><span class="cx">                                 0F885E111849A3BE00F1E3FA /* BytecodeUseDef.h in Headers */,
</span><span class="cx">                                 0F8023EA1613832B00A0BA45 /* ByValInfo.h in Headers */,
</span><span class="cx">                                 BC18C3ED0E16F5CD00B34460 /* CallData.h in Headers */,
</span><span class="lines">@@ -6293,6 +6306,7 @@
</span><span class="cx">                                 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */,
</span><span class="cx">                                 0F34B14C16D43E0D001CDA5A /* PolymorphicAccessStructureList.h in Headers */,
</span><span class="cx">                                 0F9FC8C414E1B60000D52AE0 /* PolymorphicPutByIdList.h in Headers */,
</span><ins>+                                0F8F14341ADF090100ED792C /* DFGEpoch.h in Headers */,
</ins><span class="cx">                                 0F98206116BFE38300240D02 /* PreciseJumpTargets.h in Headers */,
</span><span class="cx">                                 0F2DD8151AB3D8BE00BBB8E8 /* DFGForAllKills.h in Headers */,
</span><span class="cx">                                 868916B0155F286300CB2B9A /* PrivateName.h in Headers */,
</span><span class="lines">@@ -7375,6 +7389,7 @@
</span><span class="cx">                                 0FF054F91AC35B4400E5BE57 /* ExecutableAllocationFuzz.cpp in Sources */,
</span><span class="cx">                                 86E3C61A167BABEE006D760A /* JSValue.mm in Sources */,
</span><span class="cx">                                 0FF8BDEA1AD4CF7100DFE884 /* InferredValue.cpp in Sources */,
</span><ins>+                                0F8F14351ADF090100ED792C /* DFGMovHintRemovalPhase.cpp in Sources */,
</ins><span class="cx">                                 14BD5A320A3E91F600BAF59C /* JSValueRef.cpp in Sources */,
</span><span class="cx">                                 147F39D7107EC37600427A48 /* JSEnvironmentRecord.cpp in Sources */,
</span><span class="cx">                                 86E3C61C167BABEE006D760A /* JSVirtualMachine.mm in Sources */,
</span><span class="lines">@@ -7515,6 +7530,7 @@
</span><span class="cx">                                 A730B6131250068F009D25B1 /* StrictEvalActivation.cpp in Sources */,
</span><span class="cx">                                 14469DEB107EC7E700650446 /* StringConstructor.cpp in Sources */,
</span><span class="cx">                                 14469DEC107EC7E700650446 /* StringObject.cpp in Sources */,
</span><ins>+                                0F8F14331ADF090100ED792C /* DFGEpoch.cpp in Sources */,
</ins><span class="cx">                                 14469DED107EC7E700650446 /* StringPrototype.cpp in Sources */,
</span><span class="cx">                                 0F2D4DEF19832DD3007D4B19 /* TypeSet.cpp in Sources */,
</span><span class="cx">                                 9335F24D12E6765B002B5553 /* StringRecursionChecker.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeOrigincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeOrigin.cpp (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeOrigin.cpp        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/bytecode/CodeOrigin.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -196,8 +196,8 @@
</span><span class="cx">     else
</span><span class="cx">         out.print(&quot;, known callee: &quot;, inContext(calleeRecovery.constant(), context));
</span><span class="cx">     out.print(&quot;, numArgs+this = &quot;, arguments.size());
</span><del>-    out.print(&quot;, stack &lt; loc&quot;, VirtualRegister(stackOffset).toLocal());
-    out.print(&quot;&gt;&quot;);
</del><ins>+    out.print(&quot;, stackOffset = &quot;, stackOffset);
+    out.print(&quot; (&quot;, virtualRegisterForLocal(0), &quot; maps to &quot;, virtualRegisterForLocal(0) + stackOffset, &quot;)&gt;&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InlineCallFrame::dump(PrintStream&amp; out) const
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGDCEPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGDCEPhase.cpp (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGDCEPhase.cpp        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/dfg/DFGDCEPhase.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -143,23 +143,11 @@
</span><span class="cx">                 continue;
</span><span class="cx">                 
</span><span class="cx">             switch (node-&gt;op()) {
</span><del>-            case MovHint: {
-                // Check if the child is dead. MovHint's child would only be a Phantom or
-                // Check if we had just killed it.
-                if (node-&gt;child1()-&gt;op() == Phantom || node-&gt;child1()-&gt;op() == Check) {
-                    node-&gt;setOpAndDefaultFlags(ZombieHint);
-                    node-&gt;child1() = Edge();
-                    break;
-                }
-                break;
-            }
-                
-            case ZombieHint: {
-                // Currently we assume that DCE runs only once.
</del><ins>+            case MovHint:
+            case ZombieHint:
+                // These are not killable. (They once were.)
</ins><span class="cx">                 RELEASE_ASSERT_NOT_REACHED();
</span><del>-                break;
-            }
-            
</del><ins>+                
</ins><span class="cx">             default: {
</span><span class="cx">                 if (node-&gt;flags() &amp; NodeHasVarArgs) {
</span><span class="cx">                     for (unsigned childIdx = node-&gt;firstChild(); childIdx &lt; node-&gt;firstChild() + node-&gt;numChildren(); childIdx++) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGDisassemblercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGDisassembler.cpp (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGDisassembler.cpp        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/dfg/DFGDisassembler.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -112,8 +112,6 @@
</span><span class="cx">         append(result, out, previousOrigin);
</span><span class="cx">         Node* lastNodeForDisassembly = block-&gt;at(0);
</span><span class="cx">         for (size_t i = 0; i &lt; block-&gt;size(); ++i) {
</span><del>-            if (!block-&gt;at(i)-&gt;willHaveCodeGenOrOSR() &amp;&amp; !Options::showAllDFGNodes())
-                continue;
</del><span class="cx">             MacroAssembler::Label currentLabel;
</span><span class="cx">             HashMap&lt;Node*, MacroAssembler::Label&gt;::iterator iter = m_labelForNode.find(block-&gt;at(i));
</span><span class="cx">             if (iter != m_labelForNode.end())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGEpochcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/dfg/DFGEpoch.cpp (0 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGEpoch.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/dfg/DFGEpoch.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;DFGEpoch.h&quot;
+
+#if ENABLE(DFG_JIT)
+
+namespace JSC { namespace DFG {
+
+void Epoch::dump(PrintStream&amp; out) const
+{
+    if (!*this)
+        out.print(&quot;none&quot;);
+    else
+        out.print(m_epoch);
+}
+
+} } // namespace JSC::DFG
+
+#endif // ENABLE(DFG_JIT)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGEpochh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/dfg/DFGEpoch.h (0 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGEpoch.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/dfg/DFGEpoch.h        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef DFGEpoch_h
+#define DFGEpoch_h
+
+#if ENABLE(DFG_JIT)
+
+#include &lt;wtf/PrintStream.h&gt;
+
+namespace JSC { namespace DFG {
+
+// Utility class for epoch-based analyses.
+
+class Epoch {
+public:
+    Epoch()
+        : m_epoch(s_none)
+    {
+    }
+    
+    static Epoch first()
+    {
+        Epoch result;
+        result.m_epoch = s_first;
+        return result;
+    }
+    
+    bool operator!() const
+    {
+        return m_epoch == s_none;
+    }
+    
+    Epoch next() const
+    {
+        Epoch result;
+        result.m_epoch = m_epoch + 1;
+        return result;
+    }
+    
+    void bump()
+    {
+        *this = next();
+    }
+    
+    bool operator==(const Epoch&amp; other) const
+    {
+        return m_epoch == other.m_epoch;
+    }
+    
+    bool operator!=(const Epoch&amp; other) const
+    {
+        return !(*this == other);
+    }
+    
+    void dump(PrintStream&amp;) const;
+    
+private:
+    static const unsigned s_none = 0;
+    static const unsigned s_first = 1;
+    
+    unsigned m_epoch;
+};
+
+} } // namespace JSC::DFG
+
+#endif // ENABLE(DFG_JIT)
+
+#endif // DFGEpoch_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGMayExitcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGMayExit.cpp (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGMayExit.cpp        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/dfg/DFGMayExit.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -59,6 +59,9 @@
</span><span class="cx"> bool mayExit(Graph&amp; graph, Node* node)
</span><span class="cx"> {
</span><span class="cx">     switch (node-&gt;op()) {
</span><ins>+    // This is a carefully curated list of nodes that definitely do not exit. We try to be very
+    // conservative when maintaining this list, because adding new node types to it doesn't
+    // generally make things a lot better but it might introduce insanely subtle bugs.
</ins><span class="cx">     case SetArgument:
</span><span class="cx">     case JSConstant:
</span><span class="cx">     case DoubleConstant:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGMovHintRemovalPhasecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.cpp (0 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -0,0 +1,147 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;DFGMovHintRemovalPhase.h&quot;
+
+#if ENABLE(DFG_JIT)
+
+#include &quot;BytecodeLivenessAnalysisInlines.h&quot;
+#include &quot;DFGEpoch.h&quot;
+#include &quot;DFGForAllKills.h&quot;
+#include &quot;DFGGraph.h&quot;
+#include &quot;DFGInsertionSet.h&quot;
+#include &quot;DFGMayExit.h&quot;
+#include &quot;DFGPhase.h&quot;
+#include &quot;JSCInlines.h&quot;
+#include &quot;OperandsInlines.h&quot;
+
+namespace JSC { namespace DFG {
+
+namespace {
+
+bool verbose = false;
+
+class MovHintRemovalPhase : public Phase {
+public:
+    MovHintRemovalPhase(Graph&amp; graph)
+        : Phase(graph, &quot;MovHint removal&quot;)
+        , m_state(OperandsLike, graph.block(0)-&gt;variablesAtHead)
+        , m_changed(false)
+    {
+    }
+    
+    bool run()
+    {
+        if (verbose) {
+            dataLog(&quot;Graph before MovHint removal:\n&quot;);
+            m_graph.dump();
+        }
+        
+        for (BasicBlock* block : m_graph.blocksInNaturalOrder())
+            handleBlock(block);
+        
+        return m_changed;
+    }
+
+private:
+    void handleBlock(BasicBlock* block)
+    {
+        if (verbose)
+            dataLog(&quot;Handing block &quot;, pointerDump(block), &quot;\n&quot;);
+        
+        // A MovHint is unnecessary if the local dies before it is used. We answer this question by
+        // maintaining the current exit epoch, and associating an epoch with each local. When a
+        // local dies, it gets the current exit epoch. If a MovHint occurs in the same epoch as its
+        // local, then it means there was no exit between the local's death and the MovHint - i.e.
+        // the MovHint is unnecessary.
+        
+        Epoch currentEpoch = Epoch::first();
+        
+        for (unsigned i = m_state.size(); i--;) {
+            VirtualRegister reg = m_state.virtualRegisterForIndex(i);
+            if (m_graph.isLiveInBytecode(reg, block-&gt;last()-&gt;origin.forExit))
+                m_state[i] = currentEpoch;
+            else
+                m_state[i] = Epoch();
+        }
+        
+        if (verbose)
+            dataLog(&quot;    Locals: &quot;, m_state, &quot;\n&quot;);
+        
+        // Assume that blocks after us exit.
+        currentEpoch.bump();
+        
+        for (unsigned nodeIndex = block-&gt;size(); nodeIndex--;) {
+            Node* node = block-&gt;at(nodeIndex);
+            
+            if (node-&gt;op() == MovHint) {
+                Epoch localEpoch = m_state.operand(node-&gt;unlinkedLocal());
+                if (verbose)
+                    dataLog(&quot;    At &quot;, node, &quot;: current = &quot;, currentEpoch, &quot;, local = &quot;, localEpoch, &quot;\n&quot;);
+                if (!localEpoch || localEpoch == currentEpoch) {
+                    node-&gt;setOpAndDefaultFlags(ZombieHint);
+                    node-&gt;child1() = Edge();
+                    m_changed = true;
+                }
+                m_state.operand(node-&gt;unlinkedLocal()) = Epoch();
+            }
+            
+            if (mayExit(m_graph, node))
+                currentEpoch.bump();
+            
+            if (nodeIndex) {
+                forAllKilledOperands(
+                    m_graph, block-&gt;at(nodeIndex - 1)-&gt;origin.forExit, node,
+                    [&amp;] (VirtualRegister reg) {
+                        // This function is a bit sloppy - it might claim to kill a local even if
+                        // it's still live after. We need to protect against that.
+                        if (!!m_state.operand(reg))
+                            return;
+                        
+                        if (verbose)
+                            dataLog(&quot;    Killed operand at &quot;, node, &quot;: &quot;, reg, &quot;\n&quot;);
+                        m_state.operand(reg) = currentEpoch;
+                    });
+            }
+        }
+    }
+    
+    Operands&lt;Epoch&gt; m_state;
+    bool m_changed;
+};
+
+} // anonymous namespace
+    
+bool performMovHintRemoval(Graph&amp; graph)
+{
+    SamplingRegion samplingRegion(&quot;DFG MovHint Removal Phase&quot;);
+    return runPhase&lt;MovHintRemovalPhase&gt;(graph);
+}
+
+} } // namespace JSC::DFG
+
+#endif // ENABLE(DFG_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGMovHintRemovalPhaseh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.h (0 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/dfg/DFGMovHintRemovalPhase.h        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef DFGMovHintRemovalPhase_h
+#define DFGMovHintRemovalPhase_h
+
+#if ENABLE(DFG_JIT)
+
+namespace JSC { namespace DFG {
+
+class Graph;
+
+// Cleans up unnecessary MovHints. A MovHint is necessary if the variable dies before there is an
+// exit.
+
+bool performMovHintRemoval(Graph&amp;);
+
+} } // namespace JSC::DFG
+
+#endif // ENABLE(DFG_JIT)
+
+#endif // DFGMovHintRemovalPhase_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGNodeTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGNodeType.h (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -63,8 +63,8 @@
</span><span class="cx">     macro(KillStack, NodeMustGenerate) \
</span><span class="cx">     macro(GetStack, NodeResultJS) \
</span><span class="cx">     \
</span><del>-    macro(MovHint, 0) \
-    macro(ZombieHint, 0) \
</del><ins>+    macro(MovHint, NodeMustGenerate) \
+    macro(ZombieHint, NodeMustGenerate) \
</ins><span class="cx">     macro(Phantom, NodeMustGenerate) \
</span><span class="cx">     macro(HardPhantom, NodeMustGenerate) /* Like Phantom, but we never remove any of its children. */ \
</span><span class="cx">     macro(Check, NodeMustGenerate) /* Used if we want just a type check but not liveness. Non-checking uses will be removed. */\
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGPlancpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include &quot;DFGLICMPhase.h&quot;
</span><span class="cx"> #include &quot;DFGLivenessAnalysisPhase.h&quot;
</span><span class="cx"> #include &quot;DFGLoopPreHeaderCreationPhase.h&quot;
</span><ins>+#include &quot;DFGMovHintRemovalPhase.h&quot;
</ins><span class="cx"> #include &quot;DFGOSRAvailabilityAnalysisPhase.h&quot;
</span><span class="cx"> #include &quot;DFGOSREntrypointCreationPhase.h&quot;
</span><span class="cx"> #include &quot;DFGObjectAllocationSinkingPhase.h&quot;
</span><span class="lines">@@ -392,6 +393,8 @@
</span><span class="cx">         performCFA(dfg);
</span><span class="cx">         if (Options::validateFTLOSRExitLiveness())
</span><span class="cx">             performResurrectionForValidation(dfg);
</span><ins>+        if (Options::enableMovHintRemoval())
+            performMovHintRemoval(dfg);
</ins><span class="cx">         performDCE(dfg); // We rely on this to kill dead code that won't be recognized as dead by LLVM.
</span><span class="cx">         performStackLayout(dfg);
</span><span class="cx">         performLivenessAnalysis(dfg);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJITcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -1429,31 +1429,9 @@
</span><span class="cx">         m_codeOriginForExitProfile = m_currentNode-&gt;origin.semantic;
</span><span class="cx">         m_lastGeneratedNode = m_currentNode-&gt;op();
</span><span class="cx">         if (!m_currentNode-&gt;shouldGenerate()) {
</span><del>-            switch (m_currentNode-&gt;op()) {
-            case JSConstant:
</del><ins>+            if (belongsInMinifiedGraph(m_currentNode-&gt;op()))
</ins><span class="cx">                 m_minifiedGraph-&gt;append(MinifiedNode::fromNode(m_currentNode));
</span><del>-                break;
-                
-            case SetLocal:
-                RELEASE_ASSERT_NOT_REACHED();
-                break;
-                
-            case MovHint:
-                compileMovHint(m_currentNode);
-                break;
-                
-            case ZombieHint: {
-                recordSetLocal(m_currentNode-&gt;unlinkedLocal(), VirtualRegister(), DataFormatDead);
-                break;
-            }
-
-            default:
-                if (belongsInMinifiedGraph(m_currentNode-&gt;op()))
-                    m_minifiedGraph-&gt;append(MinifiedNode::fromNode(m_currentNode));
-                break;
-            }
</del><span class="cx">         } else {
</span><del>-            
</del><span class="cx">             if (verboseCompilationEnabled()) {
</span><span class="cx">                 dataLogF(
</span><span class="cx">                     &quot;SpeculativeJIT generating Node @%d (bc#%u) at JIT offset 0x%x&quot;,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -1921,9 +1921,15 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">         
</span><del>-    case MovHint:
</del><ins>+    case MovHint: {
+        compileMovHint(m_currentNode);
+        noResult(node);
+        break;
+    }
+        
</ins><span class="cx">     case ZombieHint: {
</span><del>-        DFG_CRASH(m_jit.graph(), node, &quot;Unexpected node&quot;);
</del><ins>+        recordSetLocal(m_currentNode-&gt;unlinkedLocal(), VirtualRegister(), DataFormatDead);
+        noResult(node);
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Options.h (183071 => 183072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.h        2015-04-21 20:06:17 UTC (rev 183071)
+++ trunk/Source/JavaScriptCore/runtime/Options.h        2015-04-21 20:16:18 UTC (rev 183072)
</span><span class="lines">@@ -184,6 +184,7 @@
</span><span class="cx">     v(unsigned, frequentCallThreshold, 2, nullptr) \
</span><span class="cx">     v(double, minimumCallToKnownRate, 0.51, nullptr) \
</span><span class="cx">     v(bool, optimizeNativeCalls, false, nullptr) \
</span><ins>+    v(bool, enableMovHintRemoval, true, nullptr) \
</ins><span class="cx">     v(bool, enableObjectAllocationSinking, true, nullptr) \
</span><span class="cx">     \
</span><span class="cx">     v(bool, enableConcurrentJIT, true, &quot;allows the DFG / FTL compilation in threads other than the executing JS thread&quot;) \
</span></span></pre>
</div>
</div>

</body>
</html>