<!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>[214838] 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/214838">214838</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2017-04-03 14:07:01 -0700 (Mon, 03 Apr 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move the Liveness&lt;&gt; adapters from AirLiveness.h to AirLivenessAdapter.h.

Rubber stamped by Keith Miller.
        
This will make it easier to write other code that uses those adapters.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirLiveness.h:
(JSC::B3::Air::LivenessAdapter::LivenessAdapter): Deleted.
(JSC::B3::Air::LivenessAdapter::blockSize): Deleted.
(JSC::B3::Air::LivenessAdapter::forEachUse): Deleted.
(JSC::B3::Air::LivenessAdapter::forEachDef): Deleted.
(JSC::B3::Air::TmpLivenessAdapter::TmpLivenessAdapter): Deleted.
(JSC::B3::Air::TmpLivenessAdapter::numIndices): Deleted.
(JSC::B3::Air::TmpLivenessAdapter::acceptsBank): Deleted.
(JSC::B3::Air::TmpLivenessAdapter::acceptsRole): Deleted.
(JSC::B3::Air::TmpLivenessAdapter::valueToIndex): Deleted.
(JSC::B3::Air::TmpLivenessAdapter::indexToValue): Deleted.
(JSC::B3::Air::StackSlotLivenessAdapter::StackSlotLivenessAdapter): Deleted.
(JSC::B3::Air::StackSlotLivenessAdapter::numIndices): Deleted.
(JSC::B3::Air::StackSlotLivenessAdapter::acceptsBank): Deleted.
(JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): Deleted.
(JSC::B3::Air::StackSlotLivenessAdapter::valueToIndex): Deleted.
(JSC::B3::Air::StackSlotLivenessAdapter::indexToValue): Deleted.
* b3/air/AirLivenessAdapter.h: Added.
(JSC::B3::Air::LivenessAdapter::LivenessAdapter):
(JSC::B3::Air::LivenessAdapter::blockSize):
(JSC::B3::Air::LivenessAdapter::forEachUse):
(JSC::B3::Air::LivenessAdapter::forEachDef):
(JSC::B3::Air::TmpLivenessAdapter::TmpLivenessAdapter):
(JSC::B3::Air::TmpLivenessAdapter::numIndices):
(JSC::B3::Air::TmpLivenessAdapter::acceptsBank):
(JSC::B3::Air::TmpLivenessAdapter::acceptsRole):
(JSC::B3::Air::TmpLivenessAdapter::valueToIndex):
(JSC::B3::Air::TmpLivenessAdapter::indexToValue):
(JSC::B3::Air::StackSlotLivenessAdapter::StackSlotLivenessAdapter):
(JSC::B3::Air::StackSlotLivenessAdapter::numIndices):
(JSC::B3::Air::StackSlotLivenessAdapter::acceptsBank):
(JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole):
(JSC::B3::Air::StackSlotLivenessAdapter::valueToIndex):
(JSC::B3::Air::StackSlotLivenessAdapter::indexToValue):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3airAirLivenessh">trunk/Source/JavaScriptCore/b3/air/AirLiveness.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreb3airAirLivenessAdapterh">trunk/Source/JavaScriptCore/b3/air/AirLivenessAdapter.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (214837 => 214838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2017-04-03 21:03:52 UTC (rev 214837)
+++ trunk/Source/JavaScriptCore/ChangeLog        2017-04-03 21:07:01 UTC (rev 214838)
</span><span class="lines">@@ -1,5 +1,49 @@
</span><span class="cx"> 2017-04-03  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move the Liveness&lt;&gt; adapters from AirLiveness.h to AirLivenessAdapter.h.
+
+        Rubber stamped by Keith Miller.
+        
+        This will make it easier to write other code that uses those adapters.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * b3/air/AirLiveness.h:
+        (JSC::B3::Air::LivenessAdapter::LivenessAdapter): Deleted.
+        (JSC::B3::Air::LivenessAdapter::blockSize): Deleted.
+        (JSC::B3::Air::LivenessAdapter::forEachUse): Deleted.
+        (JSC::B3::Air::LivenessAdapter::forEachDef): Deleted.
+        (JSC::B3::Air::TmpLivenessAdapter::TmpLivenessAdapter): Deleted.
+        (JSC::B3::Air::TmpLivenessAdapter::numIndices): Deleted.
+        (JSC::B3::Air::TmpLivenessAdapter::acceptsBank): Deleted.
+        (JSC::B3::Air::TmpLivenessAdapter::acceptsRole): Deleted.
+        (JSC::B3::Air::TmpLivenessAdapter::valueToIndex): Deleted.
+        (JSC::B3::Air::TmpLivenessAdapter::indexToValue): Deleted.
+        (JSC::B3::Air::StackSlotLivenessAdapter::StackSlotLivenessAdapter): Deleted.
+        (JSC::B3::Air::StackSlotLivenessAdapter::numIndices): Deleted.
+        (JSC::B3::Air::StackSlotLivenessAdapter::acceptsBank): Deleted.
+        (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): Deleted.
+        (JSC::B3::Air::StackSlotLivenessAdapter::valueToIndex): Deleted.
+        (JSC::B3::Air::StackSlotLivenessAdapter::indexToValue): Deleted.
+        * b3/air/AirLivenessAdapter.h: Added.
+        (JSC::B3::Air::LivenessAdapter::LivenessAdapter):
+        (JSC::B3::Air::LivenessAdapter::blockSize):
+        (JSC::B3::Air::LivenessAdapter::forEachUse):
+        (JSC::B3::Air::LivenessAdapter::forEachDef):
+        (JSC::B3::Air::TmpLivenessAdapter::TmpLivenessAdapter):
+        (JSC::B3::Air::TmpLivenessAdapter::numIndices):
+        (JSC::B3::Air::TmpLivenessAdapter::acceptsBank):
+        (JSC::B3::Air::TmpLivenessAdapter::acceptsRole):
+        (JSC::B3::Air::TmpLivenessAdapter::valueToIndex):
+        (JSC::B3::Air::TmpLivenessAdapter::indexToValue):
+        (JSC::B3::Air::StackSlotLivenessAdapter::StackSlotLivenessAdapter):
+        (JSC::B3::Air::StackSlotLivenessAdapter::numIndices):
+        (JSC::B3::Air::StackSlotLivenessAdapter::acceptsBank):
+        (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole):
+        (JSC::B3::Air::StackSlotLivenessAdapter::valueToIndex):
+        (JSC::B3::Air::StackSlotLivenessAdapter::indexToValue):
+
+2017-04-03  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
</ins><span class="cx">         WTF::Liveness should have an API that focuses on actions at instruction boundaries
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=170407
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (214837 => 214838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2017-04-03 21:03:52 UTC (rev 214837)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2017-04-03 21:07:01 UTC (rev 214838)
</span><span class="lines">@@ -118,6 +118,7 @@
</span><span class="cx">                 0F15CD231BA5F9860031FFD3 /* PutByIdFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15CD211BA5F9860031FFD3 /* PutByIdFlags.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F15F15F14B7A73E005DE37D /* CommonSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F1725FF1B48719A00AC3A55 /* DFGMinifiedGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F1725FE1B48719A00AC3A55 /* DFGMinifiedGraph.cpp */; };
</span><ins>+                0F1829691E92EE54005B1EA8 /* AirLivenessAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F1829681E92EE51005B1EA8 /* AirLivenessAdapter.h */; };
</ins><span class="cx">                 0F18D3CF1B55A6E0002C5C9F /* DFGAdaptiveStructureWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18D3CD1B55A6E0002C5C9F /* DFGAdaptiveStructureWatchpoint.cpp */; };
</span><span class="cx">                 0F18D3D01B55A6E0002C5C9F /* DFGAdaptiveStructureWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F18D3CE1B55A6E0002C5C9F /* DFGAdaptiveStructureWatchpoint.h */; };
</span><span class="cx">                 0F190CAC189D82F6000AE5F0 /* ProfilerJettisonReason.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F190CAA189D82F6000AE5F0 /* ProfilerJettisonReason.cpp */; };
</span><span class="lines">@@ -2652,6 +2653,7 @@
</span><span class="cx">                 0F15CD211BA5F9860031FFD3 /* PutByIdFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PutByIdFlags.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonSlowPaths.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F1725FE1B48719A00AC3A55 /* DFGMinifiedGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGMinifiedGraph.cpp; path = dfg/DFGMinifiedGraph.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0F1829681E92EE51005B1EA8 /* AirLivenessAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirLivenessAdapter.h; path = b3/air/AirLivenessAdapter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0F18D3CD1B55A6E0002C5C9F /* DFGAdaptiveStructureWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGAdaptiveStructureWatchpoint.cpp; path = dfg/DFGAdaptiveStructureWatchpoint.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F18D3CE1B55A6E0002C5C9F /* DFGAdaptiveStructureWatchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAdaptiveStructureWatchpoint.h; path = dfg/DFGAdaptiveStructureWatchpoint.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F190CAA189D82F6000AE5F0 /* ProfilerJettisonReason.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfilerJettisonReason.cpp; path = profiler/ProfilerJettisonReason.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5610,6 +5612,7 @@
</span><span class="cx">                                 0FDF67D41D9DC43E001B9825 /* AirKind.cpp */,
</span><span class="cx">                                 0FDF67D51D9DC43E001B9825 /* AirKind.h */,
</span><span class="cx">                                 2684D4371C00161C0081D663 /* AirLiveness.h */,
</span><ins>+                                0F1829681E92EE51005B1EA8 /* AirLivenessAdapter.h */,
</ins><span class="cx">                                 0FE34C171C4B39AE0003A512 /* AirLogRegisterPressure.cpp */,
</span><span class="cx">                                 0FE34C181C4B39AE0003A512 /* AirLogRegisterPressure.h */,
</span><span class="cx">                                 0F6183251C45BF070072450B /* AirLowerAfterRegAlloc.cpp */,
</span><span class="lines">@@ -9110,6 +9113,7 @@
</span><span class="cx">                                 0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */,
</span><span class="cx">                                 7C008CE7187631B600955C24 /* Microtask.h in Headers */,
</span><span class="cx">                                 86C568E211A213EE0007F7F0 /* MIPSAssembler.h in Headers */,
</span><ins>+                                0F1829691E92EE54005B1EA8 /* AirLivenessAdapter.h in Headers */,
</ins><span class="cx">                                 C4703CD7192844CC0013FBEA /* models.py in Headers */,
</span><span class="cx">                                 E3794E761B77EB97005543AE /* ModuleAnalyzer.h in Headers */,
</span><span class="cx">                                 E355F3531B7DC85300C50DC5 /* ModuleLoaderPrototype.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3airAirLivenessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/air/AirLiveness.h (214837 => 214838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/air/AirLiveness.h        2017-04-03 21:03:52 UTC (rev 214837)
+++ trunk/Source/JavaScriptCore/b3/air/AirLiveness.h        2017-04-03 21:07:01 UTC (rev 214838)
</span><span class="lines">@@ -27,124 +27,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(B3_JIT)
</span><span class="cx"> 
</span><del>-#include &quot;AirBasicBlock.h&quot;
-#include &quot;AirCFG.h&quot;
-#include &quot;AirCode.h&quot;
-#include &quot;AirInstInlines.h&quot;
-#include &quot;AirStackSlot.h&quot;
-#include &quot;AirTmpInlines.h&quot;
</del><ins>+#include &quot;AirLivenessAdapter.h&quot;
</ins><span class="cx"> #include &lt;wtf/Liveness.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 { namespace Air {
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename Adapter&gt;
</span><del>-struct LivenessAdapter {
-    typedef Air::CFG CFG;
-    
-    LivenessAdapter(Code&amp; code)
-        : code(code)
-    {
-    }
-    
-    unsigned blockSize(BasicBlock* block)
-    {
-        return block-&gt;size();
-    }
-    
-    template&lt;typename Func&gt;
-    void forEachUse(BasicBlock* block, size_t instBoundaryIndex, const Func&amp; func)
-    {
-        if (Inst* prevInst = block-&gt;get(instBoundaryIndex - 1)) {
-            prevInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
-                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
-                    if (Arg::isLateUse(role)
-                        &amp;&amp; Adapter::acceptsBank(bank)
-                        &amp;&amp; Adapter::acceptsRole(role))
-                        func(Adapter::valueToIndex(thing));
-                });
-        }
-        
-        if (Inst* nextInst = block-&gt;get(instBoundaryIndex)) {
-            nextInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
-                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
-                    if (Arg::isEarlyUse(role)
-                        &amp;&amp; Adapter::acceptsBank(bank)
-                        &amp;&amp; Adapter::acceptsRole(role))
-                        func(Adapter::valueToIndex(thing));
-                });
-        }
-    }
-    
-    template&lt;typename Func&gt;
-    void forEachDef(BasicBlock* block, size_t instBoundaryIndex, const Func&amp; func)
-    {
-        if (Inst* prevInst = block-&gt;get(instBoundaryIndex - 1)) {
-            prevInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
-                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
-                    if (Arg::isLateDef(role)
-                        &amp;&amp; Adapter::acceptsBank(bank)
-                        &amp;&amp; Adapter::acceptsRole(role))
-                        func(Adapter::valueToIndex(thing));
-                });
-        }
-        
-        if (Inst* nextInst = block-&gt;get(instBoundaryIndex)) {
-            nextInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
-                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
-                    if (Arg::isEarlyDef(role)
-                        &amp;&amp; Adapter::acceptsBank(bank)
-                        &amp;&amp; Adapter::acceptsRole(role))
-                        func(Adapter::valueToIndex(thing));
-                });
-        }
-    }
-
-    Code&amp; code;
-};
-
-template&lt;Bank adapterBank, Arg::Temperature minimumTemperature = Arg::Cold&gt;
-struct TmpLivenessAdapter : LivenessAdapter&lt;TmpLivenessAdapter&lt;adapterBank, minimumTemperature&gt;&gt; {
-    typedef LivenessAdapter&lt;TmpLivenessAdapter&lt;adapterBank, minimumTemperature&gt;&gt; Base;
-    
-    static constexpr const char* name = &quot;TmpLiveness&quot;;
-    typedef Tmp Thing;
-
-    TmpLivenessAdapter(Code&amp; code)
-        : Base(code)
-    {
-    }
-
-    unsigned numIndices()
-    {
-        unsigned numTmps = Base::code.numTmps(adapterBank);
-        return AbsoluteTmpMapper&lt;adapterBank&gt;::absoluteIndex(numTmps);
-    }
-    static bool acceptsBank(Bank bank) { return bank == adapterBank; }
-    static bool acceptsRole(Arg::Role role) { return Arg::temperature(role) &gt;= minimumTemperature; }
-    static unsigned valueToIndex(Tmp tmp) { return AbsoluteTmpMapper&lt;adapterBank&gt;::absoluteIndex(tmp); }
-    static Tmp indexToValue(unsigned index) { return AbsoluteTmpMapper&lt;adapterBank&gt;::tmpFromAbsoluteIndex(index); }
-};
-
-struct StackSlotLivenessAdapter : LivenessAdapter&lt;StackSlotLivenessAdapter&gt; {
-    static constexpr const char* name = &quot;StackSlotLiveness&quot;;
-    typedef StackSlot* Thing;
-
-    StackSlotLivenessAdapter(Code&amp; code)
-        : LivenessAdapter(code)
-    {
-    }
-
-    unsigned numIndices()
-    {
-        return code.stackSlots().size();
-    }
-    static bool acceptsBank(Bank) { return true; }
-    static bool acceptsRole(Arg::Role) { return true; }
-    static unsigned valueToIndex(StackSlot* stackSlot) { return stackSlot-&gt;index(); }
-    StackSlot* indexToValue(unsigned index) { return code.stackSlots()[index]; }
-};
-
-template&lt;typename Adapter&gt;
</del><span class="cx"> class Liveness : public WTF::Liveness&lt;Adapter&gt; {
</span><span class="cx"> public:
</span><span class="cx">     Liveness(Code&amp; code)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3airAirLivenessAdapterh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/air/AirLivenessAdapter.h (0 => 214838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/air/AirLivenessAdapter.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/air/AirLivenessAdapter.h        2017-04-03 21:07:01 UTC (rev 214838)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+/*
+ * Copyright (C) 2015-2017 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.
+ */
+
+#pragma once
+
+#if ENABLE(B3_JIT)
+
+#include &quot;AirBasicBlock.h&quot;
+#include &quot;AirCFG.h&quot;
+#include &quot;AirCode.h&quot;
+#include &quot;AirInstInlines.h&quot;
+#include &quot;AirStackSlot.h&quot;
+#include &quot;AirTmpInlines.h&quot;
+
+namespace JSC { namespace B3 { namespace Air {
+
+template&lt;typename Adapter&gt;
+struct LivenessAdapter {
+    typedef Air::CFG CFG;
+    
+    LivenessAdapter(Code&amp; code)
+        : code(code)
+    {
+    }
+    
+    unsigned blockSize(BasicBlock* block)
+    {
+        return block-&gt;size();
+    }
+    
+    template&lt;typename Func&gt;
+    void forEachUse(BasicBlock* block, size_t instBoundaryIndex, const Func&amp; func)
+    {
+        if (Inst* prevInst = block-&gt;get(instBoundaryIndex - 1)) {
+            prevInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
+                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
+                    if (Arg::isLateUse(role)
+                        &amp;&amp; Adapter::acceptsBank(bank)
+                        &amp;&amp; Adapter::acceptsRole(role))
+                        func(Adapter::valueToIndex(thing));
+                });
+        }
+        
+        if (Inst* nextInst = block-&gt;get(instBoundaryIndex)) {
+            nextInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
+                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
+                    if (Arg::isEarlyUse(role)
+                        &amp;&amp; Adapter::acceptsBank(bank)
+                        &amp;&amp; Adapter::acceptsRole(role))
+                        func(Adapter::valueToIndex(thing));
+                });
+        }
+    }
+    
+    template&lt;typename Func&gt;
+    void forEachDef(BasicBlock* block, size_t instBoundaryIndex, const Func&amp; func)
+    {
+        if (Inst* prevInst = block-&gt;get(instBoundaryIndex - 1)) {
+            prevInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
+                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
+                    if (Arg::isLateDef(role)
+                        &amp;&amp; Adapter::acceptsBank(bank)
+                        &amp;&amp; Adapter::acceptsRole(role))
+                        func(Adapter::valueToIndex(thing));
+                });
+        }
+        
+        if (Inst* nextInst = block-&gt;get(instBoundaryIndex)) {
+            nextInst-&gt;forEach&lt;typename Adapter::Thing&gt;(
+                [&amp;] (typename Adapter::Thing&amp; thing, Arg::Role role, Bank bank, Width) {
+                    if (Arg::isEarlyDef(role)
+                        &amp;&amp; Adapter::acceptsBank(bank)
+                        &amp;&amp; Adapter::acceptsRole(role))
+                        func(Adapter::valueToIndex(thing));
+                });
+        }
+    }
+
+    Code&amp; code;
+};
+
+template&lt;Bank adapterBank, Arg::Temperature minimumTemperature = Arg::Cold&gt;
+struct TmpLivenessAdapter : LivenessAdapter&lt;TmpLivenessAdapter&lt;adapterBank, minimumTemperature&gt;&gt; {
+    typedef LivenessAdapter&lt;TmpLivenessAdapter&lt;adapterBank, minimumTemperature&gt;&gt; Base;
+    
+    static constexpr const char* name = &quot;TmpLiveness&quot;;
+    typedef Tmp Thing;
+
+    TmpLivenessAdapter(Code&amp; code)
+        : Base(code)
+    {
+    }
+
+    unsigned numIndices()
+    {
+        unsigned numTmps = Base::code.numTmps(adapterBank);
+        return AbsoluteTmpMapper&lt;adapterBank&gt;::absoluteIndex(numTmps);
+    }
+    static bool acceptsBank(Bank bank) { return bank == adapterBank; }
+    static bool acceptsRole(Arg::Role role) { return Arg::temperature(role) &gt;= minimumTemperature; }
+    static unsigned valueToIndex(Tmp tmp) { return AbsoluteTmpMapper&lt;adapterBank&gt;::absoluteIndex(tmp); }
+    static Tmp indexToValue(unsigned index) { return AbsoluteTmpMapper&lt;adapterBank&gt;::tmpFromAbsoluteIndex(index); }
+};
+
+struct StackSlotLivenessAdapter : LivenessAdapter&lt;StackSlotLivenessAdapter&gt; {
+    static constexpr const char* name = &quot;StackSlotLiveness&quot;;
+    typedef StackSlot* Thing;
+
+    StackSlotLivenessAdapter(Code&amp; code)
+        : LivenessAdapter(code)
+    {
+    }
+
+    unsigned numIndices()
+    {
+        return code.stackSlots().size();
+    }
+    static bool acceptsBank(Bank) { return true; }
+    static bool acceptsRole(Arg::Role) { return true; }
+    static unsigned valueToIndex(StackSlot* stackSlot) { return stackSlot-&gt;index(); }
+    StackSlot* indexToValue(unsigned index) { return code.stackSlots()[index]; }
+};
+
+} } } // namespace JSC::B3::Air
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre>
</div>
</div>

</body>
</html>