<!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>[192183] 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/192183">192183</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2015-11-09 16:01:24 -0800 (Mon, 09 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>B3 should be able to compile a program with a double constant
https://bugs.webkit.org/show_bug.cgi?id=151002

Reviewed by Benjamin Poulain.

This implements a bunch of annoying stuff that is necessary to support constants that need a
data section, such as double constants on X86_64:

- B3::Procedure can now tell you what to keep alive in addition to the MacroAssemblerCodeRef.
  We call this the B3::OpaqueByproducts. It's the client's responsibility to keep this alive
  after calling B3::generate().

- Added a new helper for compiling B3 code, called B3::Compilation. Constructing a
  Compilation runs the compiler. Then you can pass around a Compilation the way you would
  have passed around a MacroAssemblerCodeRef.

- Added a constant motion phase, called moveConstants(). This does very simple constant
  hoisting/sinking: it makes sure that each constant is only materialized in one place in
  each basic block. It uses a DataSection, which is a kind of OpaqueByproduct, to store
  double constants.

- The way I wanted to do constant motion is to basically track what constants are of interest
  and then recreate them as needed, so the original Values become irrelevant in the process.
  To do that, I needed an abstraction that is almost identical to the DFG PureValue
  abstraction that we use for CSE. So, I created such a thing, and called it ValueKey. It
  can be used to compare and hash pure Values, and to recreate them as needed.

- Fixed the lowering's handling of constants so that we don't perturb the placement of the
  constant materializations.

* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32):
(JSC::MacroAssemblerX86Common::moveZeroToDouble):
(JSC::MacroAssemblerX86Common::branchDoubleNonZero):
* b3/B3Common.h:
(JSC::B3::isIdentical):
(JSC::B3::isRepresentableAsImpl):
* b3/B3Compilation.cpp: Added.
(JSC::B3::Compilation::Compilation):
(JSC::B3::Compilation::~Compilation):
* b3/B3Compilation.h: Added.
(JSC::B3::Compilation::code):
* b3/B3ConstDoubleValue.h:
(JSC::B3::ConstDoubleValue::accepts): Deleted.
* b3/B3DataSection.cpp: Added.
(JSC::B3::DataSection::DataSection):
(JSC::B3::DataSection::~DataSection):
(JSC::B3::DataSection::dump):
* b3/B3DataSection.h: Added.
(JSC::B3::DataSection::data):
(JSC::B3::DataSection::size):
* b3/B3Generate.cpp:
(JSC::B3::generate):
(JSC::B3::generateToAir):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::imm):
(JSC::B3::Air::LowerToAir::immOrTmp):
(JSC::B3::Air::LowerToAir::fillStackmap):
(JSC::B3::Air::LowerToAir::lower):
(JSC::B3::Air::LowerToAir::immForMove): Deleted.
(JSC::B3::Air::LowerToAir::immOrTmpForMove): Deleted.
* b3/B3MoveConstants.cpp: Added.
(JSC::B3::moveConstants):
* b3/B3MoveConstants.h: Added.
* b3/B3OpaqueByproduct.h: Added.
(JSC::B3::OpaqueByproduct::OpaqueByproduct):
(JSC::B3::OpaqueByproduct::~OpaqueByproduct):
* b3/B3OpaqueByproducts.cpp: Added.
(JSC::B3::OpaqueByproducts::OpaqueByproducts):
(JSC::B3::OpaqueByproducts::~OpaqueByproducts):
(JSC::B3::OpaqueByproducts::add):
(JSC::B3::OpaqueByproducts::dump):
* b3/B3OpaqueByproducts.h: Added.
(JSC::B3::OpaqueByproducts::count):
* b3/B3Opcode.h:
(JSC::B3::constPtrOpcode):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::Procedure):
(JSC::B3::Procedure::dump):
(JSC::B3::Procedure::blocksInPreOrder):
(JSC::B3::Procedure::deleteValue):
(JSC::B3::Procedure::addDataSection):
(JSC::B3::Procedure::addValueIndex):
* b3/B3Procedure.h:
(JSC::B3::Procedure::lastPhaseName):
(JSC::B3::Procedure::byproducts):
(JSC::B3::Procedure::takeByproducts):
* b3/B3Type.h:
* b3/B3Value.cpp:
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::performSubstitution):
* b3/B3Value.h:
* b3/B3ValueKey.cpp: Added.
(JSC::B3::ValueKey::dump):
(JSC::B3::ValueKey::materialize):
* b3/B3ValueKey.h: Added.
(JSC::B3::ValueKey::ValueKey):
(JSC::B3::ValueKey::opcode):
(JSC::B3::ValueKey::type):
(JSC::B3::ValueKey::childIndex):
(JSC::B3::ValueKey::value):
(JSC::B3::ValueKey::doubleValue):
(JSC::B3::ValueKey::operator==):
(JSC::B3::ValueKey::operator!=):
(JSC::B3::ValueKey::hash):
(JSC::B3::ValueKey::operator bool):
(JSC::B3::ValueKey::canMaterialize):
(JSC::B3::ValueKey::isHashTableDeletedValue):
(JSC::B3::ValueKeyHash::hash):
(JSC::B3::ValueKeyHash::equal):
* b3/B3ValueKeyInlines.h: Added.
(JSC::B3::ValueKey::ValueKey):
(JSC::B3::ValueKey::child):
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::Code):
* b3/air/AirCode.h:
(JSC::B3::Air::Code::proc):
(JSC::B3::Air::Code::lastPhaseName):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::compile):
(JSC::B3::invoke):
(JSC::B3::compileAndRun):
(JSC::B3::test42):
(JSC::B3::testBranch):
(JSC::B3::testBranchPtr):
(JSC::B3::testDiamond):
(JSC::B3::testBranchNotEqual):
(JSC::B3::testBranchNotEqualCommute):
(JSC::B3::testBranchNotEqualNotEqual):
(JSC::B3::testBranchEqual):
(JSC::B3::testBranchEqualEqual):
(JSC::B3::testBranchEqualCommute):
(JSC::B3::testBranchEqualEqual1):
(JSC::B3::testBranchFold):
(JSC::B3::testSimpleCheck):
(JSC::B3::testCompare):
(JSC::B3::testReturnDouble):
(JSC::B3::run):</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="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Commonh">trunk/Source/JavaScriptCore/b3/B3Common.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ConstDoubleValueh">trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Generatecpp">trunk/Source/JavaScriptCore/b3/B3Generate.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3LowerToAircpp">trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Opcodeh">trunk/Source/JavaScriptCore/b3/B3Opcode.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Procedurecpp">trunk/Source/JavaScriptCore/b3/B3Procedure.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Procedureh">trunk/Source/JavaScriptCore/b3/B3Procedure.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Typeh">trunk/Source/JavaScriptCore/b3/B3Type.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Valuecpp">trunk/Source/JavaScriptCore/b3/B3Value.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Valueh">trunk/Source/JavaScriptCore/b3/B3Value.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3airAirCodecpp">trunk/Source/JavaScriptCore/b3/air/AirCode.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3airAirCodeh">trunk/Source/JavaScriptCore/b3/air/AirCode.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3airAirOpcodeopcodes">trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3testb3cpp">trunk/Source/JavaScriptCore/b3/testb3.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreb3B3Compilationcpp">trunk/Source/JavaScriptCore/b3/B3Compilation.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Compilationh">trunk/Source/JavaScriptCore/b3/B3Compilation.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3DataSectioncpp">trunk/Source/JavaScriptCore/b3/B3DataSection.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3DataSectionh">trunk/Source/JavaScriptCore/b3/B3DataSection.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3MoveConstantscpp">trunk/Source/JavaScriptCore/b3/B3MoveConstants.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3MoveConstantsh">trunk/Source/JavaScriptCore/b3/B3MoveConstants.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3OpaqueByproducth">trunk/Source/JavaScriptCore/b3/B3OpaqueByproduct.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3OpaqueByproductscpp">trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3OpaqueByproductsh">trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ValueKeycpp">trunk/Source/JavaScriptCore/b3/B3ValueKey.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ValueKeyh">trunk/Source/JavaScriptCore/b3/B3ValueKey.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ValueKeyInlinesh">trunk/Source/JavaScriptCore/b3/B3ValueKeyInlines.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -1,3 +1,147 @@
</span><ins>+2015-11-08  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        B3 should be able to compile a program with a double constant
+        https://bugs.webkit.org/show_bug.cgi?id=151002
+
+        Reviewed by Benjamin Poulain.
+
+        This implements a bunch of annoying stuff that is necessary to support constants that need a
+        data section, such as double constants on X86_64:
+
+        - B3::Procedure can now tell you what to keep alive in addition to the MacroAssemblerCodeRef.
+          We call this the B3::OpaqueByproducts. It's the client's responsibility to keep this alive
+          after calling B3::generate().
+
+        - Added a new helper for compiling B3 code, called B3::Compilation. Constructing a
+          Compilation runs the compiler. Then you can pass around a Compilation the way you would
+          have passed around a MacroAssemblerCodeRef.
+
+        - Added a constant motion phase, called moveConstants(). This does very simple constant
+          hoisting/sinking: it makes sure that each constant is only materialized in one place in
+          each basic block. It uses a DataSection, which is a kind of OpaqueByproduct, to store
+          double constants.
+
+        - The way I wanted to do constant motion is to basically track what constants are of interest
+          and then recreate them as needed, so the original Values become irrelevant in the process.
+          To do that, I needed an abstraction that is almost identical to the DFG PureValue
+          abstraction that we use for CSE. So, I created such a thing, and called it ValueKey. It
+          can be used to compare and hash pure Values, and to recreate them as needed.
+
+        - Fixed the lowering's handling of constants so that we don't perturb the placement of the
+          constant materializations.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::branchConvertDoubleToInt32):
+        (JSC::MacroAssemblerX86Common::moveZeroToDouble):
+        (JSC::MacroAssemblerX86Common::branchDoubleNonZero):
+        * b3/B3Common.h:
+        (JSC::B3::isIdentical):
+        (JSC::B3::isRepresentableAsImpl):
+        * b3/B3Compilation.cpp: Added.
+        (JSC::B3::Compilation::Compilation):
+        (JSC::B3::Compilation::~Compilation):
+        * b3/B3Compilation.h: Added.
+        (JSC::B3::Compilation::code):
+        * b3/B3ConstDoubleValue.h:
+        (JSC::B3::ConstDoubleValue::accepts): Deleted.
+        * b3/B3DataSection.cpp: Added.
+        (JSC::B3::DataSection::DataSection):
+        (JSC::B3::DataSection::~DataSection):
+        (JSC::B3::DataSection::dump):
+        * b3/B3DataSection.h: Added.
+        (JSC::B3::DataSection::data):
+        (JSC::B3::DataSection::size):
+        * b3/B3Generate.cpp:
+        (JSC::B3::generate):
+        (JSC::B3::generateToAir):
+        * b3/B3LowerToAir.cpp:
+        (JSC::B3::Air::LowerToAir::imm):
+        (JSC::B3::Air::LowerToAir::immOrTmp):
+        (JSC::B3::Air::LowerToAir::fillStackmap):
+        (JSC::B3::Air::LowerToAir::lower):
+        (JSC::B3::Air::LowerToAir::immForMove): Deleted.
+        (JSC::B3::Air::LowerToAir::immOrTmpForMove): Deleted.
+        * b3/B3MoveConstants.cpp: Added.
+        (JSC::B3::moveConstants):
+        * b3/B3MoveConstants.h: Added.
+        * b3/B3OpaqueByproduct.h: Added.
+        (JSC::B3::OpaqueByproduct::OpaqueByproduct):
+        (JSC::B3::OpaqueByproduct::~OpaqueByproduct):
+        * b3/B3OpaqueByproducts.cpp: Added.
+        (JSC::B3::OpaqueByproducts::OpaqueByproducts):
+        (JSC::B3::OpaqueByproducts::~OpaqueByproducts):
+        (JSC::B3::OpaqueByproducts::add):
+        (JSC::B3::OpaqueByproducts::dump):
+        * b3/B3OpaqueByproducts.h: Added.
+        (JSC::B3::OpaqueByproducts::count):
+        * b3/B3Opcode.h:
+        (JSC::B3::constPtrOpcode):
+        * b3/B3Procedure.cpp:
+        (JSC::B3::Procedure::Procedure):
+        (JSC::B3::Procedure::dump):
+        (JSC::B3::Procedure::blocksInPreOrder):
+        (JSC::B3::Procedure::deleteValue):
+        (JSC::B3::Procedure::addDataSection):
+        (JSC::B3::Procedure::addValueIndex):
+        * b3/B3Procedure.h:
+        (JSC::B3::Procedure::lastPhaseName):
+        (JSC::B3::Procedure::byproducts):
+        (JSC::B3::Procedure::takeByproducts):
+        * b3/B3Type.h:
+        * b3/B3Value.cpp:
+        (JSC::B3::Value::effects):
+        (JSC::B3::Value::key):
+        (JSC::B3::Value::performSubstitution):
+        * b3/B3Value.h:
+        * b3/B3ValueKey.cpp: Added.
+        (JSC::B3::ValueKey::dump):
+        (JSC::B3::ValueKey::materialize):
+        * b3/B3ValueKey.h: Added.
+        (JSC::B3::ValueKey::ValueKey):
+        (JSC::B3::ValueKey::opcode):
+        (JSC::B3::ValueKey::type):
+        (JSC::B3::ValueKey::childIndex):
+        (JSC::B3::ValueKey::value):
+        (JSC::B3::ValueKey::doubleValue):
+        (JSC::B3::ValueKey::operator==):
+        (JSC::B3::ValueKey::operator!=):
+        (JSC::B3::ValueKey::hash):
+        (JSC::B3::ValueKey::operator bool):
+        (JSC::B3::ValueKey::canMaterialize):
+        (JSC::B3::ValueKey::isHashTableDeletedValue):
+        (JSC::B3::ValueKeyHash::hash):
+        (JSC::B3::ValueKeyHash::equal):
+        * b3/B3ValueKeyInlines.h: Added.
+        (JSC::B3::ValueKey::ValueKey):
+        (JSC::B3::ValueKey::child):
+        * b3/air/AirCode.cpp:
+        (JSC::B3::Air::Code::Code):
+        * b3/air/AirCode.h:
+        (JSC::B3::Air::Code::proc):
+        (JSC::B3::Air::Code::lastPhaseName):
+        * b3/air/AirOpcode.opcodes:
+        * b3/testb3.cpp:
+        (JSC::B3::compile):
+        (JSC::B3::invoke):
+        (JSC::B3::compileAndRun):
+        (JSC::B3::test42):
+        (JSC::B3::testBranch):
+        (JSC::B3::testBranchPtr):
+        (JSC::B3::testDiamond):
+        (JSC::B3::testBranchNotEqual):
+        (JSC::B3::testBranchNotEqualCommute):
+        (JSC::B3::testBranchNotEqualNotEqual):
+        (JSC::B3::testBranchEqual):
+        (JSC::B3::testBranchEqualEqual):
+        (JSC::B3::testBranchEqualCommute):
+        (JSC::B3::testBranchEqualEqual1):
+        (JSC::B3::testBranchFold):
+        (JSC::B3::testSimpleCheck):
+        (JSC::B3::testCompare):
+        (JSC::B3::testReturnDouble):
+        (JSC::B3::run):
+
</ins><span class="cx"> 2015-11-09  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Need a function that will provide Nth argument register
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -288,6 +288,18 @@
</span><span class="cx">                 0F338DFA1BE96AA80013C88F /* B3CCallValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338DF81BE96AA80013C88F /* B3CCallValue.h */; };
</span><span class="cx">                 0F338DFD1BED51270013C88F /* AirSimplifyCFG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338DFB1BED51270013C88F /* AirSimplifyCFG.cpp */; };
</span><span class="cx">                 0F338DFE1BED51270013C88F /* AirSimplifyCFG.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338DFC1BED51270013C88F /* AirSimplifyCFG.h */; };
</span><ins>+                0F338E0B1BF0276C0013C88F /* B3Compilation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338DFF1BF0276C0013C88F /* B3Compilation.cpp */; };
+                0F338E0C1BF0276C0013C88F /* B3Compilation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338E001BF0276C0013C88F /* B3Compilation.h */; };
+                0F338E0D1BF0276C0013C88F /* B3DataSection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338E011BF0276C0013C88F /* B3DataSection.cpp */; };
+                0F338E0E1BF0276C0013C88F /* B3DataSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338E021BF0276C0013C88F /* B3DataSection.h */; };
+                0F338E0F1BF0276C0013C88F /* B3MoveConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338E031BF0276C0013C88F /* B3MoveConstants.cpp */; };
+                0F338E101BF0276C0013C88F /* B3MoveConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338E041BF0276C0013C88F /* B3MoveConstants.h */; };
+                0F338E111BF0276C0013C88F /* B3OpaqueByproduct.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338E051BF0276C0013C88F /* B3OpaqueByproduct.h */; };
+                0F338E121BF0276C0013C88F /* B3OpaqueByproducts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338E061BF0276C0013C88F /* B3OpaqueByproducts.cpp */; };
+                0F338E131BF0276C0013C88F /* B3OpaqueByproducts.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338E071BF0276C0013C88F /* B3OpaqueByproducts.h */; };
+                0F338E141BF0276C0013C88F /* B3ValueKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338E081BF0276C0013C88F /* B3ValueKey.cpp */; };
+                0F338E151BF0276C0013C88F /* B3ValueKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338E091BF0276C0013C88F /* B3ValueKey.h */; };
+                0F338E161BF0276C0013C88F /* B3ValueKeyInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338E0A1BF0276C0013C88F /* B3ValueKeyInlines.h */; };
</ins><span class="cx">                 0F34B14916D42010001CDA5A /* DFGUseKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F34B14716D4200E001CDA5A /* DFGUseKind.cpp */; };
</span><span class="cx">                 0F34B14A16D42013001CDA5A /* DFGUseKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F34B14816D4200E001CDA5A /* DFGUseKind.h */; };
</span><span class="cx">                 0F38B01117CF078000B144D3 /* LLIntEntrypoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F38B00F17CF077F00B144D3 /* LLIntEntrypoint.cpp */; };
</span><span class="lines">@@ -2313,6 +2325,18 @@
</span><span class="cx">                 0F338DF81BE96AA80013C88F /* B3CCallValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3CCallValue.h; path = b3/B3CCallValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F338DFB1BED51270013C88F /* AirSimplifyCFG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirSimplifyCFG.cpp; path = b3/air/AirSimplifyCFG.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F338DFC1BED51270013C88F /* AirSimplifyCFG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirSimplifyCFG.h; path = b3/air/AirSimplifyCFG.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0F338DFF1BF0276C0013C88F /* B3Compilation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3Compilation.cpp; path = b3/B3Compilation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E001BF0276C0013C88F /* B3Compilation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3Compilation.h; path = b3/B3Compilation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E011BF0276C0013C88F /* B3DataSection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3DataSection.cpp; path = b3/B3DataSection.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E021BF0276C0013C88F /* B3DataSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3DataSection.h; path = b3/B3DataSection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E031BF0276C0013C88F /* B3MoveConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3MoveConstants.cpp; path = b3/B3MoveConstants.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E041BF0276C0013C88F /* B3MoveConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3MoveConstants.h; path = b3/B3MoveConstants.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E051BF0276C0013C88F /* B3OpaqueByproduct.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3OpaqueByproduct.h; path = b3/B3OpaqueByproduct.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E061BF0276C0013C88F /* B3OpaqueByproducts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3OpaqueByproducts.cpp; path = b3/B3OpaqueByproducts.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E071BF0276C0013C88F /* B3OpaqueByproducts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3OpaqueByproducts.h; path = b3/B3OpaqueByproducts.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E081BF0276C0013C88F /* B3ValueKey.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3ValueKey.cpp; path = b3/B3ValueKey.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E091BF0276C0013C88F /* B3ValueKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3ValueKey.h; path = b3/B3ValueKey.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338E0A1BF0276C0013C88F /* B3ValueKeyInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3ValueKeyInlines.h; path = b3/B3ValueKeyInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0F34B14716D4200E001CDA5A /* DFGUseKind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGUseKind.cpp; path = dfg/DFGUseKind.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F34B14816D4200E001CDA5A /* DFGUseKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGUseKind.h; path = dfg/DFGUseKind.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F38B00F17CF077F00B144D3 /* LLIntEntrypoint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntEntrypoint.cpp; path = llint/LLIntEntrypoint.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4415,6 +4439,8 @@
</span><span class="cx">                                 0FEC84C01BDACDAC0080FF74 /* B3Common.h */,
</span><span class="cx">                                 0FEC84C11BDACDAC0080FF74 /* B3Commutativity.cpp */,
</span><span class="cx">                                 0FEC84C21BDACDAC0080FF74 /* B3Commutativity.h */,
</span><ins>+                                0F338DFF1BF0276C0013C88F /* B3Compilation.cpp */,
+                                0F338E001BF0276C0013C88F /* B3Compilation.h */,
</ins><span class="cx">                                 0FEC84C31BDACDAC0080FF74 /* B3Const32Value.cpp */,
</span><span class="cx">                                 0FEC84C41BDACDAC0080FF74 /* B3Const32Value.h */,
</span><span class="cx">                                 0FEC84C51BDACDAC0080FF74 /* B3Const64Value.cpp */,
</span><span class="lines">@@ -4426,6 +4452,8 @@
</span><span class="cx">                                 0F338DF41BE93D550013C88F /* B3ConstrainedValue.h */,
</span><span class="cx">                                 0FEC84C91BDACDAC0080FF74 /* B3ControlValue.cpp */,
</span><span class="cx">                                 0FEC84CA1BDACDAC0080FF74 /* B3ControlValue.h */,
</span><ins>+                                0F338E011BF0276C0013C88F /* B3DataSection.cpp */,
+                                0F338E021BF0276C0013C88F /* B3DataSection.h */,
</ins><span class="cx">                                 0FEC85C41BE16F5A0080FF74 /* B3Effects.cpp */,
</span><span class="cx">                                 0FEC85BE1BE167A00080FF74 /* B3Effects.h */,
</span><span class="cx">                                 0FEC84CB1BDACDAC0080FF74 /* B3FrequencyClass.cpp */,
</span><span class="lines">@@ -4445,6 +4473,11 @@
</span><span class="cx">                                 0FEC84D41BDACDAC0080FF74 /* B3LowerToAir.h */,
</span><span class="cx">                                 0FEC84D51BDACDAC0080FF74 /* B3MemoryValue.cpp */,
</span><span class="cx">                                 0FEC84D61BDACDAC0080FF74 /* B3MemoryValue.h */,
</span><ins>+                                0F338E031BF0276C0013C88F /* B3MoveConstants.cpp */,
+                                0F338E041BF0276C0013C88F /* B3MoveConstants.h */,
+                                0F338E051BF0276C0013C88F /* B3OpaqueByproduct.h */,
+                                0F338E061BF0276C0013C88F /* B3OpaqueByproducts.cpp */,
+                                0F338E071BF0276C0013C88F /* B3OpaqueByproducts.h */,
</ins><span class="cx">                                 0FEC84D71BDACDAC0080FF74 /* B3Opcode.cpp */,
</span><span class="cx">                                 0FEC84D81BDACDAC0080FF74 /* B3Opcode.h */,
</span><span class="cx">                                 0FEC84D91BDACDAC0080FF74 /* B3Origin.cpp */,
</span><span class="lines">@@ -4486,6 +4519,9 @@
</span><span class="cx">                                 0FEC84F91BDACDAC0080FF74 /* B3Value.cpp */,
</span><span class="cx">                                 0FEC84FA1BDACDAC0080FF74 /* B3Value.h */,
</span><span class="cx">                                 0FEC84FB1BDACDAC0080FF74 /* B3ValueInlines.h */,
</span><ins>+                                0F338E081BF0276C0013C88F /* B3ValueKey.cpp */,
+                                0F338E091BF0276C0013C88F /* B3ValueKey.h */,
+                                0F338E0A1BF0276C0013C88F /* B3ValueKeyInlines.h */,
</ins><span class="cx">                                 0FEC84FC1BDACDAC0080FF74 /* B3ValueRep.cpp */,
</span><span class="cx">                                 0FEC84FD1BDACDAC0080FF74 /* B3ValueRep.h */,
</span><span class="cx">                                 0FEC85AE1BDB5D5E0080FF74 /* testb3.cpp */,
</span><span class="lines">@@ -6534,6 +6570,7 @@
</span><span class="cx">                                 0FEC85701BDACDC70080FF74 /* AirArg.h in Headers */,
</span><span class="cx">                                 0FEC85721BDACDC70080FF74 /* AirBasicBlock.h in Headers */,
</span><span class="cx">                                 0F338DFA1BE96AA80013C88F /* B3CCallValue.h in Headers */,
</span><ins>+                                0F338E161BF0276C0013C88F /* B3ValueKeyInlines.h in Headers */,
</ins><span class="cx">                                 0FEC85741BDACDC70080FF74 /* AirCCallSpecial.h in Headers */,
</span><span class="cx">                                 0FEC85761BDACDC70080FF74 /* AirCode.h in Headers */,
</span><span class="cx">                                 0F4570391BE44C910062A629 /* AirEliminateDeadCode.h in Headers */,
</span><span class="lines">@@ -6631,6 +6668,7 @@
</span><span class="cx">                                 0FEC85451BDACDAC0080FF74 /* B3ValueInlines.h in Headers */,
</span><span class="cx">                                 0FEC85471BDACDAC0080FF74 /* B3ValueRep.h in Headers */,
</span><span class="cx">                                 52678F8F1A031009006A306D /* BasicBlockLocation.h in Headers */,
</span><ins>+                                0F338E151BF0276C0013C88F /* B3ValueKey.h in Headers */,
</ins><span class="cx">                                 147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
</span><span class="cx">                                 866739D213BFDE710023D87C /* BigInteger.h in Headers */,
</span><span class="cx">                                 0F64B2721A784BAF006E4E66 /* BinarySwitch.h in Headers */,
</span><span class="lines">@@ -6643,6 +6681,7 @@
</span><span class="cx">                                 99DA00A71BD5993100F4575C /* builtins_generate_combined_header.py in Headers */,
</span><span class="cx">                                 99DA00A81BD5993100F4575C /* builtins_generate_combined_implementation.py in Headers */,
</span><span class="cx">                                 99DA00A91BD5993100F4575C /* builtins_generate_separate_header.py in Headers */,
</span><ins>+                                0F338E111BF0276C0013C88F /* B3OpaqueByproduct.h in Headers */,
</ins><span class="cx">                                 99DA00AA1BD5993100F4575C /* builtins_generate_separate_implementation.py in Headers */,
</span><span class="cx">                                 99DA00A31BD5993100F4575C /* builtins_generator.py in Headers */,
</span><span class="cx">                                 99DA00A41BD5993100F4575C /* builtins_model.py in Headers */,
</span><span class="lines">@@ -6959,6 +6998,7 @@
</span><span class="cx">                                 2AC922BC18A16182003CE0FB /* FTLDWARFDebugLineInfo.h in Headers */,
</span><span class="cx">                                 0F9C5E5F18E35F5E00D431C3 /* FTLDWARFRegister.h in Headers */,
</span><span class="cx">                                 0F235BD417178E1C00690C7F /* FTLExitArgument.h in Headers */,
</span><ins>+                                0F338E0C1BF0276C0013C88F /* B3Compilation.h in Headers */,
</ins><span class="cx">                                 0F235BD617178E1C00690C7F /* FTLExitArgumentForOperand.h in Headers */,
</span><span class="cx">                                 0F235BD717178E1C00690C7F /* FTLExitArgumentList.h in Headers */,
</span><span class="cx">                                 0F2B9CF519D0BAC100B1D1B5 /* FTLExitPropertyValue.h in Headers */,
</span><span class="lines">@@ -6985,6 +7025,7 @@
</span><span class="cx">                                 0FEA0A10170513DB00BB722C /* FTLLowerDFGToLLVM.h in Headers */,
</span><span class="cx">                                 A7D89D0217A0B90400773AD8 /* FTLLoweredNodeValue.h in Headers */,
</span><span class="cx">                                 0F2B9CF919D0BAC100B1D1B5 /* FTLOperations.h in Headers */,
</span><ins>+                                0F338E101BF0276C0013C88F /* B3MoveConstants.h in Headers */,
</ins><span class="cx">                                 0FD8A31C17D51F2200CA2C40 /* FTLOSREntry.h in Headers */,
</span><span class="cx">                                 0F235BDD17178E1C00690C7F /* FTLOSRExit.h in Headers */,
</span><span class="cx">                                 0F235BDE17178E1C00690C7F /* FTLOSRExitCompilationInfo.h in Headers */,
</span><span class="lines">@@ -7348,6 +7389,7 @@
</span><span class="cx">                                 86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */,
</span><span class="cx">                                 863B23E00FC6118900703AA4 /* MacroAssemblerCodeRef.h in Headers */,
</span><span class="cx">                                 86C568E111A213EE0007F7F0 /* MacroAssemblerMIPS.h in Headers */,
</span><ins>+                                0F338E0E1BF0276C0013C88F /* B3DataSection.h in Headers */,
</ins><span class="cx">                                 FE68C6371B90DE040042BCB3 /* MacroAssemblerPrinter.h in Headers */,
</span><span class="cx">                                 86AE64A9135E5E1C00963012 /* MacroAssemblerSH4.h in Headers */,
</span><span class="cx">                                 860161E40F3A83C100F84710 /* MacroAssemblerX86.h in Headers */,
</span><span class="lines">@@ -7552,6 +7594,7 @@
</span><span class="cx">                                 5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
</span><span class="cx">                                 0F952ABD1B487A7700C367C5 /* TrackedReferences.h in Headers */,
</span><span class="cx">                                 0F2B670617B6B5AB00A7AE3F /* TypedArrayAdaptors.h in Headers */,
</span><ins>+                                0F338E131BF0276C0013C88F /* B3OpaqueByproducts.h in Headers */,
</ins><span class="cx">                                 0F2B670817B6B5AB00A7AE3F /* TypedArrayController.h in Headers */,
</span><span class="cx">                                 0F4B94DC17B9F07500DD03A4 /* TypedArrayInlines.h in Headers */,
</span><span class="cx">                                 0F2B670917B6B5AB00A7AE3F /* TypedArrays.h in Headers */,
</span><span class="lines">@@ -8209,6 +8252,7 @@
</span><span class="cx">                                 148F21AA107EC53A0042EC2C /* BytecodeGenerator.cpp in Sources */,
</span><span class="cx">                                 7094C4DE1AE439530041A2EE /* BytecodeIntrinsicRegistry.cpp in Sources */,
</span><span class="cx">                                 C2FCAE1217A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp in Sources */,
</span><ins>+                                0F338E0D1BF0276C0013C88F /* B3DataSection.cpp in Sources */,
</ins><span class="cx">                                 65B8392F1BACAD6A0044E824 /* CachedRecovery.cpp in Sources */,
</span><span class="cx">                                 1428082D107EC0570013E7B2 /* CallData.cpp in Sources */,
</span><span class="cx">                                 0F64B2791A7957B2006E4E66 /* CallEdge.cpp in Sources */,
</span><span class="lines">@@ -8225,6 +8269,7 @@
</span><span class="cx">                                 969A07960ED1D3AE00F1F681 /* CodeBlock.cpp in Sources */,
</span><span class="cx">                                 0F8F94401667633000D61971 /* CodeBlockHash.cpp in Sources */,
</span><span class="cx">                                 0FC97F33182020D7002C9B26 /* CodeBlockJettisoningWatchpoint.cpp in Sources */,
</span><ins>+                                0F338E0F1BF0276C0013C88F /* B3MoveConstants.cpp in Sources */,
</ins><span class="cx">                                 0FD8A31317D4326C00CA2C40 /* CodeBlockSet.cpp in Sources */,
</span><span class="cx">                                 A77F1821164088B200640A47 /* CodeCache.cpp in Sources */,
</span><span class="cx">                                 0F8F9446166764F100D61971 /* CodeOrigin.cpp in Sources */,
</span><span class="lines">@@ -8297,6 +8342,7 @@
</span><span class="cx">                                 A7D89CF517A0B8CC00773AD8 /* DFGCriticalEdgeBreakingPhase.cpp in Sources */,
</span><span class="cx">                                 0FFFC95914EF90A600C72532 /* DFGCSEPhase.cpp in Sources */,
</span><span class="cx">                                 0F2FC77216E12F710038D976 /* DFGDCEPhase.cpp in Sources */,
</span><ins>+                                0F338E121BF0276C0013C88F /* B3OpaqueByproducts.cpp in Sources */,
</ins><span class="cx">                                 0F8F2B99172F04FF007DBDA5 /* DFGDesiredIdentifiers.cpp in Sources */,
</span><span class="cx">                                 C2C0F7CD17BBFC5B00464FE4 /* DFGDesiredTransitions.cpp in Sources */,
</span><span class="cx">                                 0FE8534B1723CDA500B618F5 /* DFGDesiredWatchpoints.cpp in Sources */,
</span><span class="lines">@@ -8694,6 +8740,7 @@
</span><span class="cx">                                 0FB5467D14F5CFD6002C2989 /* MethodOfGettingAValueProfile.cpp in Sources */,
</span><span class="cx">                                 E3794E751B77EB97005543AE /* ModuleAnalyzer.cpp in Sources */,
</span><span class="cx">                                 E355F3521B7DC85300C50DC5 /* ModuleLoaderObject.cpp in Sources */,
</span><ins>+                                0F338E0B1BF0276C0013C88F /* B3Compilation.cpp in Sources */,
</ins><span class="cx">                                 14469DE0107EC7E700650446 /* NativeErrorConstructor.cpp in Sources */,
</span><span class="cx">                                 14469DE1107EC7E700650446 /* NativeErrorPrototype.cpp in Sources */,
</span><span class="cx">                                 E33E8D201B9013DE00346B52 /* NativeStdFunctionCell.cpp in Sources */,
</span><span class="lines">@@ -8718,6 +8765,7 @@
</span><span class="cx">                                 93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */,
</span><span class="cx">                                 0FF9CE731B9CD6D0004EDCA6 /* PolymorphicAccess.cpp in Sources */,
</span><span class="cx">                                 0FE834171A6EF97B00D04847 /* PolymorphicCallStubRoutine.cpp in Sources */,
</span><ins>+                                0F338E141BF0276C0013C88F /* B3ValueKey.cpp in Sources */,
</ins><span class="cx">                                 0F98206016BFE38100240D02 /* PreciseJumpTargets.cpp in Sources */,
</span><span class="cx">                                 95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
</span><span class="cx">                                 95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -940,6 +940,11 @@
</span><span class="cx">         failureCases.append(m_assembler.jne());
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void moveZeroToDouble(FPRegisterID reg)
+    {
+        m_assembler.xorpd_rr(reg, reg);
+    }
+
</ins><span class="cx">     Jump branchDoubleNonZero(FPRegisterID reg, FPRegisterID scratch)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(isSSE2Present());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Commonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Common.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Common.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Common.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -40,12 +40,32 @@
</span><span class="cx"> bool shouldSaveIRBeforePhase();
</span><span class="cx"> bool shouldMeasurePhaseTiming();
</span><span class="cx"> 
</span><ins>+template&lt;typename BitsType, typename InputType&gt;
+inline bool isIdentical(InputType left, InputType right)
+{
+    BitsType leftBits = bitwise_cast&lt;BitsType&gt;(left);
+    BitsType rightBits = bitwise_cast&lt;BitsType&gt;(right);
+    return leftBits == rightBits;
+}
+
+inline bool isIdentical(int32_t left, int32_t right)
+{
+    return isIdentical&lt;int32_t&gt;(left, right);
+}
+
+inline bool isIdentical(int64_t left, int64_t right)
+{
+    return isIdentical&lt;int64_t&gt;(left, right);
+}
+
+inline bool isIdentical(double left, double right)
+{
+    return isIdentical&lt;int64_t&gt;(left, right);
+}
+
</ins><span class="cx"> template&lt;typename ResultType, typename InputType, typename BitsType&gt;
</span><span class="cx"> inline bool isRepresentableAsImpl(InputType originalValue)
</span><span class="cx"> {
</span><del>-    // Get the raw bits of the original value.
-    BitsType originalBits = bitwise_cast&lt;BitsType&gt;(originalValue);
-
</del><span class="cx">     // Convert the original value to the desired result type.
</span><span class="cx">     ResultType result = static_cast&lt;ResultType&gt;(originalValue);
</span><span class="cx"> 
</span><span class="lines">@@ -53,10 +73,7 @@
</span><span class="cx">     // using the new type if such round-tripping doesn't lose bits.
</span><span class="cx">     InputType newValue = static_cast&lt;InputType&gt;(result);
</span><span class="cx"> 
</span><del>-    // Get the raw bits of the round-tripped value.
-    BitsType newBits = bitwise_cast&lt;BitsType&gt;(newValue);
-    
-    return originalBits == newBits;
</del><ins>+    return isIdentical&lt;BitsType&gt;(originalValue, newValue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename ResultType&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Compilationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3Compilation.cpp (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Compilation.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3Compilation.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,57 @@
</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;B3Compilation.h&quot;
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3Generate.h&quot;
+#include &quot;B3OpaqueByproducts.h&quot;
+#include &quot;B3Procedure.h&quot;
+#include &quot;CCallHelpers.h&quot;
+#include &quot;JSCInlines.h&quot;
+#include &quot;LinkBuffer.h&quot;
+
+namespace JSC { namespace B3 {
+
+Compilation::Compilation(VM&amp; vm, Procedure&amp; proc)
+{
+    CCallHelpers jit(&amp;vm);
+    generate(proc, jit);
+    LinkBuffer linkBuffer(vm, jit, nullptr);
+
+    m_codeRef = FINALIZE_CODE(linkBuffer, (&quot;B3::Compilation&quot;));
+    m_byproducts = proc.takeByproducts();
+}
+
+Compilation::~Compilation()
+{
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Compilationh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3Compilation.h (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Compilation.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3Compilation.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,72 @@
</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 B3Compilation_h
+#define B3Compilation_h
+
+#if ENABLE(B3_JIT)
+
+#include &quot;MacroAssemblerCodeRef.h&quot;
+#include &lt;wtf/FastMalloc.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
+
+namespace JSC {
+
+class VM;
+
+namespace B3 {
+
+class OpaqueByproducts;
+class Procedure;
+
+// This is a fool-proof API for compiling a Procedure to code and then running that code. You compile
+// a Procedure using this API by doing:
+//
+// std::unique_ptr&lt;Compilation&gt; compilation = std::make_unique&lt;Compilation&gt;(vm, proc);
+//
+// Then you keep the Compilation object alive for as long as you want to be able to run the code. If
+// this API feels too high-level, you can use B3::generate() directly.
+
+class Compilation {
+    WTF_MAKE_NONCOPYABLE(Compilation);
+    WTF_MAKE_FAST_ALLOCATED;
+
+public:
+    JS_EXPORT_PRIVATE Compilation(VM&amp;, Procedure&amp;);
+    JS_EXPORT_PRIVATE ~Compilation();
+
+    MacroAssemblerCodePtr code() const { return m_codeRef.code(); }
+
+private:
+    MacroAssemblerCodeRef m_codeRef;
+    std::unique_ptr&lt;OpaqueByproducts&gt; m_byproducts;
+};
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3Compilation_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ConstDoubleValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><del>-class ConstDoubleValue : public Value {
</del><ins>+class JS_EXPORT_PRIVATE ConstDoubleValue : public Value {
</ins><span class="cx"> public:
</span><span class="cx">     static bool accepts(Opcode opcode) { return opcode == ConstDouble; }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3DataSectioncpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3DataSection.cpp (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3DataSection.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3DataSection.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,52 @@
</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;B3DataSection.h&quot;
+
+#if ENABLE(B3_JIT)
+
+namespace JSC { namespace B3 {
+
+DataSection::DataSection(size_t size)
+    : m_data(fastMalloc(size))
+    , m_size(size)
+{
+}
+
+DataSection::~DataSection()
+{
+    fastFree(m_data);
+}
+
+void DataSection::dump(PrintStream&amp; out) const
+{
+    out.print(&quot;DataSection at &quot;, RawPointer(m_data), &quot; with &quot;, m_size, &quot; bytes.&quot;);
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3DataSectionh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3DataSection.h (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3DataSection.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3DataSection.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,55 @@
</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 B3DataSection_h
+#define B3DataSection_h
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3OpaqueByproduct.h&quot;
+
+namespace JSC { namespace B3 {
+
+class DataSection : public OpaqueByproduct {
+public:
+    DataSection(size_t size);
+    virtual ~DataSection();
+
+    void* data() const { return m_data; }
+    size_t size() const { return m_size; }
+
+    void dump(PrintStream&amp;) const override;
+
+private:
+    void* m_data;
+    size_t m_size;
+};
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3DataSection_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Generatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Generate.cpp (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Generate.cpp        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Generate.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;AirInstInlines.h&quot;
</span><span class="cx"> #include &quot;B3Common.h&quot;
</span><span class="cx"> #include &quot;B3LowerToAir.h&quot;
</span><ins>+#include &quot;B3MoveConstants.h&quot;
</ins><span class="cx"> #include &quot;B3Procedure.h&quot;
</span><span class="cx"> #include &quot;B3ReduceStrength.h&quot;
</span><span class="cx"> #include &quot;B3TimingScope.h&quot;
</span><span class="lines">@@ -44,7 +45,7 @@
</span><span class="cx"> {
</span><span class="cx">     TimingScope timingScope(&quot;generate&quot;);
</span><span class="cx"> 
</span><del>-    Air::Code code;
</del><ins>+    Air::Code code(procedure);
</ins><span class="cx">     generateToAir(procedure, code);
</span><span class="cx">     Air::generate(code, jit);
</span><span class="cx"> }
</span><span class="lines">@@ -70,6 +71,8 @@
</span><span class="cx">     // FIXME: Add more optimizations here.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=150507
</span><span class="cx"> 
</span><ins>+    moveConstants(procedure);
+
</ins><span class="cx">     if (shouldValidateIR())
</span><span class="cx">         validate(procedure);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3LowerToAircpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -440,23 +440,15 @@
</span><span class="cx"> 
</span><span class="cx">     Arg imm(Value* value)
</span><span class="cx">     {
</span><del>-        if (value-&gt;representableAs&lt;int32_t&gt;())
</del><ins>+        if (value-&gt;hasInt() &amp;&amp; value-&gt;representableAs&lt;int32_t&gt;())
</ins><span class="cx">             return Arg::imm(value-&gt;asNumber&lt;int32_t&gt;());
</span><span class="cx">         return Arg();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Arg immForMove(Value* value) {
</del><ins>+    Arg immOrTmp(Value* value)
+    {
</ins><span class="cx">         if (Arg result = imm(value))
</span><span class="cx">             return result;
</span><del>-        if (value-&gt;hasInt64())
-            return Arg::imm64(value-&gt;asInt64());
-        return Arg();
-    }
-
-    Arg immOrTmpForMove(Value* value)
-    {
-        if (Arg result = immForMove(value))
-            return result;
</del><span class="cx">         return tmp(value);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -731,14 +723,21 @@
</span><span class="cx">             Arg arg;
</span><span class="cx">             switch (value.rep().kind()) {
</span><span class="cx">             case ValueRep::Any:
</span><del>-                arg = immOrTmpForMove(value.value());
</del><ins>+                if (imm(value.value()))
+                    arg = imm(value.value());
+                else if (value.value()-&gt;hasInt64())
+                    arg = Arg::imm64(value.value()-&gt;asInt64());
+                else if (value.value()-&gt;hasDouble())
+                    arg = Arg::imm64(bitwise_cast&lt;int64_t&gt;(value.value()-&gt;asDouble()));
+                else
+                    arg = tmp(value.value());
</ins><span class="cx">                 break;
</span><span class="cx">             case ValueRep::SomeRegister:
</span><span class="cx">                 arg = tmp(value.value());
</span><span class="cx">                 break;
</span><span class="cx">             case ValueRep::Register:
</span><span class="cx">                 arg = Tmp(value.rep().reg());
</span><del>-                append(Move, immOrTmpForMove(value.value()), arg);
</del><ins>+                append(Move, immOrTmp(value.value()), arg);
</ins><span class="cx">                 break;
</span><span class="cx">             case ValueRep::StackArgument:
</span><span class="cx">                 arg = Arg::callArg(value.rep().offsetFromSP());
</span><span class="lines">@@ -1152,7 +1151,13 @@
</span><span class="cx">     void lower()
</span><span class="cx">     {
</span><span class="cx">         switch (m_value-&gt;opcode()) {
</span><del>-        case Load:{
</del><ins>+        case B3::Nop: {
+            // Yes, we will totally see Nop's because some phases will replaceWithNop() instead of
+            // properly removing things.
+            return;
+        }
+            
+        case Load: {
</ins><span class="cx">             append(
</span><span class="cx">                 moveForType(m_value-&gt;type()),
</span><span class="cx">                 addr(m_value), tmp(m_value));
</span><span class="lines">@@ -1285,12 +1290,25 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        case Const32:
</del><ins>+        case Const32: {
+            append(Move, imm(m_value), tmp(m_value));
+            return;
+        }
</ins><span class="cx">         case Const64: {
</span><del>-            append(Move, immForMove(m_value), tmp(m_value));
</del><ins>+            if (imm(m_value))
+                append(Move, imm(m_value), tmp(m_value));
+            else
+                append(Move, Arg::imm64(m_value-&gt;asInt64()), tmp(m_value));
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        case ConstDouble: {
+            // We expect that the moveConstants() phase has run.
+            RELEASE_ASSERT(isIdentical(m_value-&gt;asDouble(), 0.0));
+            append(MoveZeroToDouble, tmp(m_value));
+            return;
+        }
+
</ins><span class="cx">         case FramePointer: {
</span><span class="cx">             append(Move, Tmp(GPRInfo::callFrameRegister), tmp(m_value));
</span><span class="cx">             return;
</span><span class="lines">@@ -1354,7 +1372,7 @@
</span><span class="cx">         case Upsilon: {
</span><span class="cx">             Value* value = m_value-&gt;child(0);
</span><span class="cx">             append(
</span><del>-                relaxedMoveForType(value-&gt;type()), immOrTmpForMove(value),
</del><ins>+                relaxedMoveForType(value-&gt;type()), immOrTmp(value),
</ins><span class="cx">                 tmp(m_value-&gt;as&lt;UpsilonValue&gt;()-&gt;phi()));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -1381,9 +1399,16 @@
</span><span class="cx"> 
</span><span class="cx">         case Return: {
</span><span class="cx">             Value* value = m_value-&gt;child(0);
</span><del>-            append(
-                relaxedMoveForType(value-&gt;type()), immOrTmpForMove(value),
-                Tmp(GPRInfo::returnValueGPR));
</del><ins>+            Air::Opcode move;
+            Tmp dest;
+            if (isInt(value-&gt;type())) {
+                move = Move;
+                dest = Tmp(GPRInfo::returnValueGPR);
+            } else {
+                move = MoveDouble;
+                dest = Tmp(FPRInfo::returnValueFPR);
+            }
+            append(move, immOrTmp(value), dest);
</ins><span class="cx">             append(Ret);
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3MoveConstantscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3MoveConstants.cpp (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3MoveConstants.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3MoveConstants.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,170 @@
</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;B3MoveConstants.h&quot;
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3BasicBlockInlines.h&quot;
+#include &quot;B3InsertionSetInlines.h&quot;
+#include &quot;B3MemoryValue.h&quot;
+#include &quot;B3PhaseScope.h&quot;
+#include &quot;B3ProcedureInlines.h&quot;
+#include &quot;B3ValueInlines.h&quot;
+#include &quot;B3ValueKeyInlines.h&quot;
+
+namespace JSC { namespace B3 {
+
+namespace {
+
+class MoveConstants {
+public:
+    MoveConstants(Procedure&amp; proc)
+        : m_proc(proc)
+        , m_insertionSet(proc)
+    {
+    }
+
+    void run()
+    {
+        // Eventually this phase will do smart things. For now, it uses a super simple heuristic: it
+        // places large constants in the block that uses them, and makes sure that each block has
+        // only one materialization for each large constant.
+
+        // FIXME: Implement a better story for constants. At a minimum this should allow the B3
+        // client to specify important constants that always get hoisted. Also, the table used to
+        // hold double constants should have a pointer to it that is hoisted. If we wanted to be more
+        // aggressive, we could make constant materialization be a feature of Air: we could label
+        // some Tmps as being unmaterialized constants and have a late Air phase - post register
+        // allocation - that creates materializations of those constant Tmps by scavenging leftover
+        // registers.
+
+        // First we need to figure out which constants go into the data section. These are non-zero
+        // double constants.
+        for (Value* value : m_proc.values()) {
+            if (!needsMotion(value))
+                continue;
+            m_toRemove.append(value);
+            ValueKey key = value-&gt;key();
+            if (goesInTable(key))
+                m_constTable.add(key, m_constTable.size());
+        }
+        
+        m_dataSection = static_cast&lt;int64_t*&gt;(m_proc.addDataSection(m_constTable.size() * sizeof(int64_t)));
+        for (auto&amp; entry : m_constTable)
+            m_dataSection[entry.value] = entry.key.value();
+        
+        for (BasicBlock* block : m_proc) {
+            m_constants.clear();
+            
+            for (unsigned valueIndex = 0; valueIndex &lt; block-&gt;size(); ++valueIndex) {
+                Value* value = block-&gt;at(valueIndex);
+                for (Value*&amp; child : value-&gt;children()) {
+                    if (!needsMotion(child))
+                        continue;
+
+                    child = materialize(valueIndex, child-&gt;key(), value-&gt;origin());
+                }
+            }
+            
+            m_insertionSet.execute(block);
+        }
+
+        for (Value* toRemove : m_toRemove)
+            toRemove-&gt;replaceWithNop();
+    }
+
+private:
+    Value* materialize(unsigned valueIndex, const ValueKey&amp; key, const Origin&amp; origin)
+    {
+        if (Value* result = m_constants.get(key))
+            return result;
+
+        // Note that we deliberately don't do this in one add() because this is a recursive function
+        // that may rehash the map.
+
+        Value* result;
+        if (goesInTable(key)) {
+            Value* tableBase = materialize(
+                valueIndex,
+                ValueKey(
+                    constPtrOpcode(), pointerType(),
+                    static_cast&lt;int64_t&gt;(bitwise_cast&lt;intptr_t&gt;(m_dataSection))),
+                origin);
+            result = m_insertionSet.insert&lt;MemoryValue&gt;(
+                valueIndex, Load, key.type(), origin, tableBase,
+                sizeof(intptr_t) * m_constTable.get(key));
+        } else
+            result = m_insertionSet.insertValue(valueIndex, key.materialize(m_proc, origin));
+        m_constants.add(key, result);
+        return result;
+    }
+
+    bool goesInTable(const ValueKey&amp; key)
+    {
+        return key.opcode() == ConstDouble &amp;&amp; key != doubleZero();
+    }
+
+    bool needsMotion(const Value* value)
+    {
+        if (!value-&gt;isConstant())
+            return false;
+        
+        // We currently assume that 32-bit int constants are always cheap to materialize.
+        // This is wrong for ARM. We need some abstract query like &quot;isImmediate(int64_t)&quot;. On
+        // ARM64 this would take into account the way that ARM64 can encode large constants.
+        if (value-&gt;hasInt() &amp;&amp; value-&gt;representableAs&lt;int32_t&gt;())
+            return false;
+
+        return true;
+    }
+
+    static ValueKey doubleZero()
+    {
+        return ValueKey(ConstDouble, Double, 0.0);
+    }
+
+    Procedure&amp; m_proc;
+    Vector&lt;Value*&gt; m_toRemove;
+    HashMap&lt;ValueKey, unsigned&gt; m_constTable;
+    int64_t* m_dataSection;
+    HashMap&lt;ValueKey, Value*&gt; m_constants;
+    InsertionSet m_insertionSet;
+};
+
+} // anonymous namespace
+
+void moveConstants(Procedure&amp; proc)
+{
+    PhaseScope phaseScope(proc, &quot;moveConstants&quot;);
+    MoveConstants moveConstants(proc);
+    moveConstants.run();
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3MoveConstantsh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3MoveConstants.h (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3MoveConstants.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3MoveConstants.h        2015-11-10 00:01:24 UTC (rev 192183)
</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 B3MoveConstants_h
+#define B3MoveConstants_h
+
+#if ENABLE(B3_JIT)
+
+namespace JSC { namespace B3 {
+
+class Procedure;
+
+// Moves large constants around, with the goal of placing them in the optimal points in the program.
+
+void moveConstants(Procedure&amp;);
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3MoveConstants_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3OpaqueByproducth"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3OpaqueByproduct.h (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3OpaqueByproduct.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3OpaqueByproduct.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,52 @@
</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 B3OpaqueByproduct_h
+#define B3OpaqueByproduct_h
+
+#if ENABLE(B3_JIT)
+
+#include &lt;wtf/FastMalloc.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
+#include &lt;wtf/PrintStream.h&gt;
+
+namespace JSC { namespace B3 {
+
+class OpaqueByproduct {
+    WTF_MAKE_NONCOPYABLE(OpaqueByproduct);
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    OpaqueByproduct() { }
+    virtual ~OpaqueByproduct() { }
+
+    virtual void dump(PrintStream&amp;) const = 0;
+};
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3OpaqueByproduct_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3OpaqueByproductscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.cpp (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,60 @@
</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;B3OpaqueByproducts.h&quot;
+
+#if ENABLE(B3_JIT)
+
+namespace JSC { namespace B3 {
+
+OpaqueByproducts::OpaqueByproducts()
+{
+}
+
+OpaqueByproducts::~OpaqueByproducts()
+{
+}
+
+void OpaqueByproducts::add(std::unique_ptr&lt;OpaqueByproduct&gt; byproduct)
+{
+    m_byproducts.append(WTF::move(byproduct));
+}
+
+void OpaqueByproducts::dump(PrintStream&amp; out) const
+{
+    out.print(&quot;Byproducts:\n&quot;);
+    if (m_byproducts.isEmpty()) {
+        out.print(&quot;    &lt;empty&gt;\n&quot;);
+        return;
+    }
+    for (auto&amp; byproduct : m_byproducts)
+        out.print(&quot;    &quot;, *byproduct, &quot;\n&quot;);
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3OpaqueByproductsh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.h (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3OpaqueByproducts.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,59 @@
</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 B3OpaqueByproducts_h
+#define B3OpaqueByproducts_h
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3OpaqueByproduct.h&quot;
+#include &lt;memory&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace JSC { namespace B3 {
+
+class OpaqueByproducts {
+    WTF_MAKE_NONCOPYABLE(OpaqueByproducts)
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    OpaqueByproducts();
+    ~OpaqueByproducts();
+
+    size_t count() const { return m_byproducts.size(); }
+    
+    void add(std::unique_ptr&lt;OpaqueByproduct&gt;);
+
+    void dump(PrintStream&amp;) const;
+
+private:
+    Vector&lt;std::unique_ptr&lt;OpaqueByproduct&gt;&gt; m_byproducts;
+};
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3OpaqueByproducts_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Opcodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Opcode.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Opcode.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Opcode.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -209,6 +209,13 @@
</span><span class="cx"> 
</span><span class="cx"> Optional&lt;Opcode&gt; invertedCompare(Opcode, Type);
</span><span class="cx"> 
</span><ins>+inline Opcode constPtrOpcode()
+{
+    if (is64Bit())
+        return Const64;
+    return Const32;
+}
+
</ins><span class="cx"> } } // namespace JSC::B3
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Procedurecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Procedure.cpp (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Procedure.cpp        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Procedure.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -31,12 +31,15 @@
</span><span class="cx"> #include &quot;B3BasicBlockInlines.h&quot;
</span><span class="cx"> #include &quot;B3BasicBlockUtils.h&quot;
</span><span class="cx"> #include &quot;B3BlockWorklist.h&quot;
</span><ins>+#include &quot;B3DataSection.h&quot;
+#include &quot;B3OpaqueByproducts.h&quot;
</ins><span class="cx"> #include &quot;B3ValueInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><span class="cx"> Procedure::Procedure()
</span><span class="cx">     : m_lastPhaseName(&quot;initial&quot;)
</span><ins>+    , m_byproducts(std::make_unique&lt;OpaqueByproducts&gt;())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -107,6 +110,8 @@
</span><span class="cx"> {
</span><span class="cx">     for (BasicBlock* block : *this)
</span><span class="cx">         out.print(deepDump(block));
</span><ins>+    if (m_byproducts-&gt;count())
+        out.print(*m_byproducts);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;BasicBlock*&gt; Procedure::blocksInPreOrder()
</span><span class="lines">@@ -126,6 +131,16 @@
</span><span class="cx">     m_values[value-&gt;index()] = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void* Procedure::addDataSection(size_t size)
+{
+    if (!size)
+        return nullptr;
+    std::unique_ptr&lt;DataSection&gt; dataSection = std::make_unique&lt;DataSection&gt;(size);
+    void* result = dataSection-&gt;data();
+    m_byproducts-&gt;add(WTF::move(dataSection));
+    return result;
+}
+
</ins><span class="cx"> size_t Procedure::addValueIndex()
</span><span class="cx"> {
</span><span class="cx">     if (m_valueIndexFreeList.isEmpty()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Procedureh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Procedure.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Procedure.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Procedure.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><span class="cx"> class BasicBlock;
</span><ins>+class OpaqueByproducts;
</ins><span class="cx"> class Value;
</span><span class="cx"> 
</span><span class="cx"> class Procedure {
</span><span class="lines">@@ -201,6 +202,19 @@
</span><span class="cx"> 
</span><span class="cx">     const char* lastPhaseName() const { return m_lastPhaseName; }
</span><span class="cx"> 
</span><ins>+    void* addDataSection(size_t size);
+
+    OpaqueByproducts&amp; byproducts() { return *m_byproducts; }
+
+    // Below are methods that make sense to call after you have generated code for the procedure.
+
+    // You have to call this method after calling generate(). The code generated by B3::generate()
+    // will require you to keep this object alive for as long as that code is runnable. Usually, this
+    // just keeps alive things like the double constant pool and switch lookup tables. If this sounds
+    // confusing, you should probably be using the B3::Compilation API to compile code. If you use
+    // that API, then you don't have to worry about this.
+    std::unique_ptr&lt;OpaqueByproducts&gt; takeByproducts() { return WTF::move(m_byproducts); }
+
</ins><span class="cx"> private:
</span><span class="cx">     JS_EXPORT_PRIVATE size_t addValueIndex();
</span><span class="cx">     
</span><span class="lines">@@ -208,6 +222,7 @@
</span><span class="cx">     Vector&lt;std::unique_ptr&lt;Value&gt;&gt; m_values;
</span><span class="cx">     Vector&lt;size_t&gt; m_valueIndexFreeList;
</span><span class="cx">     const char* m_lastPhaseName;
</span><ins>+    std::unique_ptr&lt;OpaqueByproducts&gt; m_byproducts;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::B3
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Typeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Type.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Type.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Type.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><del>-enum Type {
</del><ins>+enum Type : int8_t {
</ins><span class="cx">     Void,
</span><span class="cx">     Int32,
</span><span class="cx">     Int64,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.cpp (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.cpp        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Value.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;B3StackSlotValue.h&quot;
</span><span class="cx"> #include &quot;B3UpsilonValue.h&quot;
</span><span class="cx"> #include &quot;B3ValueInlines.h&quot;
</span><ins>+#include &quot;B3ValueKeyInlines.h&quot;
</ins><span class="cx"> #include &lt;wtf/CommaPrinter.h&gt;
</span><span class="cx"> #include &lt;wtf/StringPrintStream.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -356,6 +357,61 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ValueKey Value::key() const
+{
+    switch (opcode()) {
+    case FramePointer:
+        return ValueKey(opcode(), type());
+    case Identity:
+    case SExt8:
+    case SExt16:
+    case SExt32:
+    case ZExt32:
+    case Trunc:
+    case FRound:
+    case IToD:
+    case DToI32:
+    case Check:
+        return ValueKey(opcode(), type(), child(0));
+    case Add:
+    case Sub:
+    case Mul:
+    case ChillDiv:
+    case Mod:
+    case BitAnd:
+    case BitOr:
+    case BitXor:
+    case Shl:
+    case SShr:
+    case ZShr:
+    case Equal:
+    case NotEqual:
+    case LessThan:
+    case GreaterThan:
+    case Above:
+    case Below:
+    case AboveEqual:
+    case BelowEqual:
+    case Div:
+    case CheckAdd:
+    case CheckSub:
+    case CheckMul:
+        return ValueKey(opcode(), type(), child(0), child(1));
+    case Const32:
+        return ValueKey(Const32, type(), static_cast&lt;int64_t&gt;(asInt32()));
+    case Const64:
+        return ValueKey(Const64, type(), asInt64());
+    case ConstDouble:
+        return ValueKey(ConstDouble, type(), asDouble());
+    case ArgumentReg:
+        return ValueKey(
+            ArgumentReg, type(),
+            static_cast&lt;int64_t&gt;(as&lt;ArgumentRegValue&gt;()-&gt;argumentReg().index()));
+    default:
+        return ValueKey();
+    }
+}
+
</ins><span class="cx"> void Value::performSubstitution()
</span><span class="cx"> {
</span><span class="cx">     for (Value*&amp; child : children()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/B3Value.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;B3Opcode.h&quot;
</span><span class="cx"> #include &quot;B3Origin.h&quot;
</span><span class="cx"> #include &quot;B3Type.h&quot;
</span><ins>+#include &quot;B3ValueKey.h&quot;
</ins><span class="cx"> #include &lt;wtf/CommaPrinter.h&gt;
</span><span class="cx"> #include &lt;wtf/FastMalloc.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="lines">@@ -167,9 +168,14 @@
</span><span class="cx">     TriState asTriState() const;
</span><span class="cx">     bool isLikeZero() const { return asTriState() == FalseTriState; }
</span><span class="cx">     bool isLikeNonZero() const { return asTriState() == TrueTriState; }
</span><del>-    
</del><ins>+
</ins><span class="cx">     Effects effects() const;
</span><span class="cx"> 
</span><ins>+    // This returns a ValueKey that describes that this Value returns when it executes. Returns an
+    // empty ValueKey if this Value is impure. Note that an operation that returns Void could still
+    // have a non-empty ValueKey. This happens for example with Check operations.
+    ValueKey key() const;
+
</ins><span class="cx">     // Makes sure that none of the children are Identity's. If a child points to Identity, this will
</span><span class="cx">     // repoint it at the Identity's child. For simplicity, this will follow arbitrarily long chains
</span><span class="cx">     // of Identity's.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ValueKeycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3ValueKey.cpp (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ValueKey.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3ValueKey.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,96 @@
</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;B3ValueKey.h&quot;
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3ArgumentRegValue.h&quot;
+#include &quot;B3ProcedureInlines.h&quot;
+#include &quot;B3ValueInlines.h&quot;
+#include &quot;B3ValueKeyInlines.h&quot;
+
+namespace JSC { namespace B3 {
+
+void ValueKey::dump(PrintStream&amp; out) const
+{
+    out.print(m_type, &quot; &quot;, m_opcode, &quot;(&quot;, u.indices[0], &quot;, &quot;, u.indices[1], &quot;)&quot;);
+}
+
+Value* ValueKey::materialize(Procedure&amp; proc, Origin origin) const
+{
+    switch (opcode()) {
+    case FramePointer:
+        return proc.add&lt;Value&gt;(opcode(), type(), origin);
+    case Identity:
+    case SExt8:
+    case SExt16:
+    case SExt32:
+    case ZExt32:
+    case Trunc:
+    case FRound:
+    case IToD:
+    case DToI32:
+    case Check:
+        return proc.add&lt;Value&gt;(opcode(), type(), origin, child(proc, 0));
+    case Add:
+    case Sub:
+    case Mul:
+    case ChillDiv:
+    case Mod:
+    case BitAnd:
+    case BitOr:
+    case BitXor:
+    case Shl:
+    case SShr:
+    case ZShr:
+    case Equal:
+    case NotEqual:
+    case LessThan:
+    case GreaterThan:
+    case Above:
+    case Below:
+    case AboveEqual:
+    case BelowEqual:
+    case Div:
+        return proc.add&lt;Value&gt;(opcode(), type(), origin, child(proc, 0), child(proc, 1));
+    case Const32:
+        return proc.add&lt;Const32Value&gt;(origin, static_cast&lt;int32_t&gt;(value()));
+    case Const64:
+        return proc.add&lt;Const64Value&gt;(origin, value());
+    case ConstDouble:
+        return proc.add&lt;ConstDoubleValue&gt;(origin, doubleValue());
+    case ArgumentReg:
+        return proc.add&lt;ArgumentRegValue&gt;(origin, Reg::fromIndex(static_cast&lt;unsigned&gt;(value())));
+    default:
+        return nullptr;
+    }
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ValueKeyh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3ValueKey.h (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ValueKey.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3ValueKey.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,181 @@
</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 B3ValueKey_h
+#define B3ValueKey_h
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3HeapRange.h&quot;
+#include &quot;B3Opcode.h&quot;
+#include &quot;B3Origin.h&quot;
+#include &quot;B3Type.h&quot;
+#include &lt;wtf/HashTable.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace JSC { namespace B3 {
+
+class Procedure;
+class Value;
+
+// ValueKeys are useful for CSE. They abstractly describe the value that a Value returns when it
+// executes. Any Value that has the same ValueKey is guaranteed to return the same value, provided
+// that they return a non-empty ValueKey. Operations that have effects, or that can have their
+// behavior affected by other operations' effects, will return an empty ValueKey. You have to use
+// other mechanisms for doing CSE for impure operations.
+
+class ValueKey {
+public:
+    ValueKey()
+    {
+    }
+
+    ValueKey(Opcode opcode, Type type)
+        : m_opcode(opcode)
+        , m_type(type)
+    {
+    }
+
+    ValueKey(Opcode, Type, Value* child);
+
+    ValueKey(Opcode, Type, Value* left, Value* right);
+
+    ValueKey(Opcode opcode, Type type, int64_t value)
+        : m_opcode(opcode)
+        , m_type(type)
+    {
+        u.value = value;
+    }
+
+    ValueKey(Opcode opcode, Type type, double value)
+        : m_opcode(opcode)
+        , m_type(type)
+    {
+        u.doubleValue = value;
+    }
+
+    Opcode opcode() const { return m_opcode; }
+    Type type() const { return m_type; }
+    unsigned childIndex(unsigned index) const { return u.indices[index]; }
+    Value* child(Procedure&amp;, unsigned index) const;
+    int64_t value() const { return u.value; }
+    double doubleValue() const { return u.doubleValue; }
+
+    bool operator==(const ValueKey&amp; other) const
+    {
+        return m_opcode == other.m_opcode
+            &amp;&amp; m_type == other.m_type
+            &amp;&amp; u == other.u;
+    }
+
+    bool operator!=(const ValueKey&amp; other) const
+    {
+        return !(*this == other);
+    }
+
+    unsigned hash() const
+    {
+        return m_opcode + m_type + WTF::IntHash&lt;int64_t&gt;::hash(u.value);
+    }
+
+    explicit operator bool() const { return *this != ValueKey(); }
+
+    void dump(PrintStream&amp;) const;
+
+    bool canMaterialize() const
+    {
+        if (!*this)
+            return false;
+        switch (opcode()) {
+        case CheckAdd:
+        case CheckSub:
+        case CheckMul:
+            return false;
+        default:
+            return true;
+        }
+    }
+
+    // Attempts to materialize the Value for this ValueKey. May return nullptr if the value cannot
+    // be materialized. This happens for CheckAdd and friends. You can use canMaterialize() to check
+    // if your key is materializable.
+    Value* materialize(Procedure&amp;, Origin) const;
+
+    ValueKey(WTF::HashTableDeletedValueType)
+        : m_type { Int32 }
+    {
+    }
+
+    bool isHashTableDeletedValue() const
+    {
+        return *this == ValueKey(WTF::HashTableDeletedValue);
+    }
+        
+private:
+    Opcode m_opcode { Oops };
+    Type m_type { Void };
+    union U {
+        unsigned indices[2];
+        int64_t value;
+        double doubleValue;
+
+        U()
+        {
+            value = 0;
+        }
+
+        bool operator==(const U&amp; other) const
+        {
+            return value == other.value;
+        }
+    } u;
+};
+
+struct ValueKeyHash {
+    static unsigned hash(const ValueKey&amp; key) { return key.hash(); }
+    static bool equal(const ValueKey&amp; a, const ValueKey&amp; b) { return a == b; }
+    static const bool safeToCompareToEmptyOrDeleted = true;
+};
+
+} } // namespace JSC::B3
+
+namespace WTF {
+
+template&lt;typename T&gt; struct DefaultHash;
+template&lt;&gt; struct DefaultHash&lt;JSC::B3::ValueKey&gt; {
+    typedef JSC::B3::ValueKeyHash Hash;
+};
+
+template&lt;typename T&gt; struct HashTraits;
+template&lt;&gt; struct HashTraits&lt;JSC::B3::ValueKey&gt; : public SimpleClassHashTraits&lt;JSC::B3::ValueKey&gt; {
+    static const bool emptyValueIsZero = false;
+};
+
+} // namespace WTF
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3ValueKey_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ValueKeyInlinesh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3ValueKeyInlines.h (0 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ValueKeyInlines.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3ValueKeyInlines.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -0,0 +1,62 @@
</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 B3ValueKeyInlines_h
+#define B3ValueKeyInlines_h
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3Procedure.h&quot;
+#include &quot;B3Value.h&quot;
+#include &quot;B3ValueKey.h&quot;
+
+namespace JSC { namespace B3 {
+
+inline ValueKey::ValueKey(Opcode opcode, Type type, Value* child)
+    : m_opcode(opcode)
+    , m_type(type)
+{
+    u.indices[0] = child-&gt;index();
+}
+
+inline ValueKey::ValueKey(Opcode opcode, Type type, Value* left, Value* right)
+    : m_opcode(opcode)
+    , m_type(type)
+{
+    u.indices[0] = left-&gt;index();
+    u.indices[1] = right-&gt;index();
+}
+
+inline Value* ValueKey::child(Procedure&amp; proc, unsigned index) const
+{
+    return proc.values()[index];
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3ValueKeyInlines_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3airAirCodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/air/AirCode.cpp (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/air/AirCode.cpp        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/air/AirCode.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -34,8 +34,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 { namespace Air {
</span><span class="cx"> 
</span><del>-Code::Code()
-    : m_lastPhaseName(&quot;initial&quot;)
</del><ins>+Code::Code(Procedure&amp; proc)
+    : m_proc(proc)
+    , m_lastPhaseName(&quot;initial&quot;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3airAirCodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/air/AirCode.h (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/air/AirCode.h        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/air/AirCode.h        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -50,9 +50,11 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(Code);
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    Code();
</del><ins>+    Code(Procedure&amp;);
</ins><span class="cx">     ~Code();
</span><span class="cx"> 
</span><ins>+    Procedure&amp; proc() { return m_proc; }
+
</ins><span class="cx">     BasicBlock* addBlock(double frequency = PNaN);
</span><span class="cx"> 
</span><span class="cx">     StackSlot* addStackSlot(unsigned byteSize, StackSlotKind, StackSlotValue* = nullptr);
</span><span class="lines">@@ -293,6 +295,7 @@
</span><span class="cx">     const char* lastPhaseName() const { return m_lastPhaseName; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    Procedure&amp; m_proc; // Some meta-data, like byproducts, is stored in the Procedure.
</ins><span class="cx">     Vector&lt;std::unique_ptr&lt;StackSlot&gt;&gt; m_stackSlots;
</span><span class="cx">     Vector&lt;std::unique_ptr&lt;BasicBlock&gt;&gt; m_blocks;
</span><span class="cx">     Vector&lt;std::unique_ptr&lt;Special&gt;&gt; m_specials;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3airAirOpcodeopcodes"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/air/AirOpcode.opcodes        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -191,6 +191,9 @@
</span><span class="cx">     Tmp, Addr as storeDouble
</span><span class="cx">     Tmp, Index as storeDouble
</span><span class="cx"> 
</span><ins>+MoveZeroToDouble D:F
+    Tmp
+
</ins><span class="cx"> Move64ToDouble U:G, D:F
</span><span class="cx">     Tmp, Tmp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3testb3cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/testb3.cpp (192182 => 192183)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/testb3.cpp        2015-11-09 22:47:12 UTC (rev 192182)
+++ trunk/Source/JavaScriptCore/b3/testb3.cpp        2015-11-10 00:01:24 UTC (rev 192183)
</span><span class="lines">@@ -27,10 +27,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;B3ArgumentRegValue.h&quot;
</span><span class="cx"> #include &quot;B3BasicBlockInlines.h&quot;
</span><ins>+#include &quot;B3Compilation.h&quot;
</ins><span class="cx"> #include &quot;B3Const32Value.h&quot;
</span><span class="cx"> #include &quot;B3ConstPtrValue.h&quot;
</span><span class="cx"> #include &quot;B3ControlValue.h&quot;
</span><del>-#include &quot;B3Generate.h&quot;
</del><span class="cx"> #include &quot;B3MemoryValue.h&quot;
</span><span class="cx"> #include &quot;B3Procedure.h&quot;
</span><span class="cx"> #include &quot;B3StackSlotValue.h&quot;
</span><span class="lines">@@ -67,16 +67,13 @@
</span><span class="cx"> 
</span><span class="cx"> VM* vm;
</span><span class="cx"> 
</span><del>-MacroAssemblerCodeRef compile(Procedure&amp; procedure)
</del><ins>+std::unique_ptr&lt;Compilation&gt; compile(Procedure&amp; procedure)
</ins><span class="cx"> {
</span><del>-    CCallHelpers jit(vm);
-    generate(procedure, jit);
-    LinkBuffer linkBuffer(*vm, jit, nullptr);
-    return FINALIZE_CODE(linkBuffer, (&quot;testb3&quot;));
</del><ins>+    return std::make_unique&lt;Compilation&gt;(*vm, procedure);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T, typename... Arguments&gt;
</span><del>-T invoke(const MacroAssemblerCodeRef&amp; code, Arguments... arguments)
</del><ins>+T invoke(const Compilation&amp; code, Arguments... arguments)
</ins><span class="cx"> {
</span><span class="cx">     T (*function)(Arguments...) = bitwise_cast&lt;T(*)(Arguments...)&gt;(code.code().executableAddress());
</span><span class="cx">     return function(arguments...);
</span><span class="lines">@@ -85,7 +82,7 @@
</span><span class="cx"> template&lt;typename T, typename... Arguments&gt;
</span><span class="cx"> T compileAndRun(Procedure&amp; procedure, Arguments... arguments)
</span><span class="cx"> {
</span><del>-    return invoke&lt;T&gt;(compile(procedure), arguments...);
</del><ins>+    return invoke&lt;T&gt;(*compile(procedure), arguments...);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void test42()
</span><span class="lines">@@ -1833,8 +1830,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 0));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchPtr()
</span><span class="lines">@@ -1858,8 +1855,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 0));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, static_cast&lt;intptr_t&gt;(42)) == 1);
-    CHECK(invoke&lt;int&gt;(code, static_cast&lt;intptr_t&gt;(0)) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, static_cast&lt;intptr_t&gt;(42)) == 1);
+    CHECK(invoke&lt;int&gt;(*code, static_cast&lt;intptr_t&gt;(0)) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testDiamond()
</span><span class="lines">@@ -1891,8 +1888,8 @@
</span><span class="cx">     done-&gt;appendNew&lt;ControlValue&gt;(proc, Return, Origin(), phi);
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchNotEqual()
</span><span class="lines">@@ -1921,8 +1918,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 0));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchNotEqualCommute()
</span><span class="lines">@@ -1951,8 +1948,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 0));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchNotEqualNotEqual()
</span><span class="lines">@@ -1984,8 +1981,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 0));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchEqual()
</span><span class="lines">@@ -2014,8 +2011,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 1));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchEqualEqual()
</span><span class="lines">@@ -2047,8 +2044,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 0));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchEqualCommute()
</span><span class="lines">@@ -2077,8 +2074,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 1));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchEqualEqual1()
</span><span class="lines">@@ -2110,8 +2107,8 @@
</span><span class="cx">         elseCase-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 1));
</span><span class="cx"> 
</span><span class="cx">     auto code = compile(proc);
</span><del>-    CHECK(invoke&lt;int&gt;(code, 42) == 1);
-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 42) == 1);
+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void testBranchFold(int value)
</span><span class="lines">@@ -2397,10 +2394,10 @@
</span><span class="cx">     root-&gt;appendNew&lt;ControlValue&gt;(
</span><span class="cx">         proc, Return, Origin(), root-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), 0));
</span><span class="cx"> 
</span><del>-    MacroAssemblerCodeRef code = compile(proc);
</del><ins>+    auto code = compile(proc);
</ins><span class="cx">     
</span><del>-    CHECK(invoke&lt;int&gt;(code, 0) == 0);
-    CHECK(invoke&lt;int&gt;(code, 1) == 42);
</del><ins>+    CHECK(invoke&lt;int&gt;(*code, 0) == 0);
+    CHECK(invoke&lt;int&gt;(*code, 1) == 42);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename LeftFunctor, typename RightFunctor&gt;
</span><span class="lines">@@ -2650,6 +2647,17 @@
</span><span class="cx">     variants(-left, -right);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void testReturnDouble(double value)
+{
+    Procedure proc;
+    BasicBlock* root = proc.addBlock();
+    root-&gt;appendNew&lt;ControlValue&gt;(
+        proc, Return, Origin(),
+        root-&gt;appendNew&lt;ConstDoubleValue&gt;(proc, Origin(), value));
+
+    CHECK(isIdentical(compileAndRun&lt;double&gt;(proc), value));
+}
+
</ins><span class="cx"> #define RUN(test) do {                          \
</span><span class="cx">         if (!shouldRun(#test))                  \
</span><span class="cx">             break;                              \
</span><span class="lines">@@ -3114,6 +3122,10 @@
</span><span class="cx">     RUN(testLoad&lt;uint16_t&gt;(Load16Z, 1000000000));
</span><span class="cx">     RUN(testLoad&lt;uint16_t&gt;(Load16Z, -1000000000));
</span><span class="cx"> 
</span><ins>+    RUN(testReturnDouble(0.0));
+    RUN(testReturnDouble(-0.0));
+    RUN(testReturnDouble(42.5));
+
</ins><span class="cx">     if (tasks.isEmpty())
</span><span class="cx">         usage();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>