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

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

<h3>Log Message</h3>
<pre>B3 opcodes should leave room for flags
https://bugs.webkit.org/show_bug.cgi?id=162692

Reviewed by Keith Miller.
Source/JavaScriptCore:


It used to be that the main thing that determined what a Value did was the opcode. The
Opcode was how you knew what subclass of Value you had. The opcode told you what the Value
actually did. This change replaces Opcode with Kind, which is a tuple of opcode and other
stuff.
        
Opcodes are great, and that's how most compilers work. But opcodes are one-dimensional. Here
is how this manifests. Say you have an opcode, like Load. You will be happy if your IR has
one Load opcode. But then, you might add Load8S/Load8Z/Load16S/Load16Z opcodes, as we have
done in B3. B3 has one dimension of Load opcodes, which determines something like the C type
of the load. But in the very near future, we will want to add two more dimensions to Loads:
        
- A flag to say if the load traps.
- A flag to say if the load has acquire semantics.
        
Mapping these three dimensions (type, trap, acquire) onto the one-dimensional Opcode space
would create mayham: Load8S, Load8STrap, Load8SAcquire, Load8STrapAcquire, Load8Z,
Load8ZTrap, etc.
        
This happens in other parts of the IR. For example, we have a dimension of arithmetic
operations: add, sub, mul, div, mod, etc. Then we have the chill flag. But since opcodes
are one-dimensional, that means having ChillDiv and ChillMod, and tons of places in the
compiler that case on both Div and ChillDiv, or case on both Mod and ChillMod, since they
are only interested in the kind of arithmetic being done and not the chillness.
        
Though the examples all involve bits (chill or not, trapping or not, etc), I can imagine
other properties that behave more like small enums, like if we fill out more memory ordering
modes other than just &quot;acquire? yes/no&quot;. There will eventually have to be something like a
std::memory_order associated with memory accesses.
        
One approach to this problem is to have a Value subclass that contains fields with the meta
data. I don't like this for two reasons:
        
- In bug 162688, I want to make trapping memory accesses have stackmaps. This means that a
  trapping memory access would have a different Value subclass than a non-trapping memory
  access. So, this meta-data needs to channel into ValueType::accepts(). Currently that
  takes Opcode and nothing else.
        
- Compiler IRs are all about making common tasks easy. If it becomes commonplace for opcodes
  to require a custom Value subclass just for a bit then that's not very easy.
        
This change addresses this problem by making the compiler pass around Kinds rather than
Opcodes. A Kind contains an Opcode as well as any number of opcode-specific bits. This
change demonstrates how Kind should be used by converting chillness to it. Kind has
hasIsChill(), isChill(), and setIsChill() methods. hasIsChill() is true only for Div and
Mod. setIsChill() asserts if !hasIsChill(). If you want to create a Chill Div, you say
chill(Div). IR dumps will print it like this:

    Int32 @38 = Div&lt;Chill&gt;(@36, @37, DFG:@24, ControlDependent)
        
Where &quot;Div&lt;Chill&gt;&quot; is how a Kind that hasExtraBits() dumps itself. If a Kind does not
hasExtraBits() (the normal case) then it dumps like a normal Opcode (without the &quot;&lt;&gt;&quot;).
        
I replaced many uses of Opcode with Kind. New code has to be mindful that Opcode may not be
the right way to summarize what a value does, and so in many cases it's better to carry
around a Kind instead - especially if you will use it to stamp out new Values. Opcode is no
longer sufficient to perform a dynamic Value cast, since that code now uses Kind. ValueKey
now wants a Kind instead of an Opcode. All Value constructors now take Kind instead of
Opcode. But most opcodes don't get any extra Kind bits, and so the code that operates on
those opcodes is largely unchanged.
        
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3ArgumentRegValue.h:
* b3/B3CCallValue.h:
* b3/B3CheckValue.cpp:
(JSC::B3::CheckValue::convertToAdd):
(JSC::B3::CheckValue::CheckValue):
* b3/B3CheckValue.h:
(JSC::B3::CheckValue::accepts):
* b3/B3Const32Value.h:
* b3/B3Const64Value.h:
* b3/B3ConstDoubleValue.h:
* b3/B3ConstFloatValue.h:
* b3/B3FenceValue.h:
* b3/B3Kind.cpp: Added.
(JSC::B3::Kind::dump):
* b3/B3Kind.h: Added.
(JSC::B3::Kind::Kind):
(JSC::B3::Kind::opcode):
(JSC::B3::Kind::setOpcode):
(JSC::B3::Kind::hasExtraBits):
(JSC::B3::Kind::hasIsChill):
(JSC::B3::Kind::isChill):
(JSC::B3::Kind::setIsChill):
(JSC::B3::Kind::operator==):
(JSC::B3::Kind::operator!=):
(JSC::B3::Kind::hash):
(JSC::B3::Kind::isHashTableDeletedValue):
(JSC::B3::chill):
(JSC::B3::KindHash::hash):
(JSC::B3::KindHash::equal):
* b3/B3LowerMacros.cpp:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/B3MemoryValue.h:
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3PatchpointValue.h:
(JSC::B3::PatchpointValue::accepts):
* b3/B3ReduceStrength.cpp:
* b3/B3SlotBaseValue.h:
* b3/B3StackmapValue.cpp:
(JSC::B3::StackmapValue::StackmapValue):
* b3/B3StackmapValue.h:
* b3/B3SwitchValue.h:
(JSC::B3::SwitchValue::accepts):
* b3/B3UpsilonValue.h:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::dump):
(JSC::B3::Value::deepDump):
(JSC::B3::Value::invertedCompare):
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::typeFor):
(JSC::B3::Value::badKind):
(JSC::B3::Value::badOpcode): Deleted.
* b3/B3Value.h:
* b3/B3ValueInlines.h:
(JSC::B3::Value::as):
* b3/B3ValueKey.cpp:
(JSC::B3::ValueKey::dump):
(JSC::B3::ValueKey::materialize):
* b3/B3ValueKey.h:
(JSC::B3::ValueKey::ValueKey):
(JSC::B3::ValueKey::kind):
(JSC::B3::ValueKey::opcode):
(JSC::B3::ValueKey::operator==):
(JSC::B3::ValueKey::hash):
* b3/B3ValueKeyInlines.h:
(JSC::B3::ValueKey::ValueKey):
* b3/B3VariableValue.cpp:
(JSC::B3::VariableValue::VariableValue):
* b3/B3VariableValue.h:
* b3/testb3.cpp:
(JSC::B3::testChillDiv):
(JSC::B3::testChillDivTwice):
(JSC::B3::testChillDiv64):
(JSC::B3::testChillModArg):
(JSC::B3::testChillModArgs):
(JSC::B3::testChillModImms):
(JSC::B3::testChillModArg32):
(JSC::B3::testChillModArgs32):
(JSC::B3::testChillModImms32):
(JSC::B3::testSwitchChillDiv):
(JSC::B3::testEntrySwitchWithCommonPaths):
(JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::chillDiv):
(JSC::FTL::Output::chillMod):

Websites/webkit.org:

        
Updated the documentation to talk about Kind and the isChill bit, and to remove
ChillDiv/ChillMod.

* docs/b3/intermediate-representation.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ArgumentRegValueh">trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3CCallValueh">trunk/Source/JavaScriptCore/b3/B3CCallValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3CheckValuecpp">trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3CheckValueh">trunk/Source/JavaScriptCore/b3/B3CheckValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Const32Valueh">trunk/Source/JavaScriptCore/b3/B3Const32Value.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Const64Valueh">trunk/Source/JavaScriptCore/b3/B3Const64Value.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ConstDoubleValueh">trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ConstFloatValueh">trunk/Source/JavaScriptCore/b3/B3ConstFloatValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3FenceValueh">trunk/Source/JavaScriptCore/b3/B3FenceValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3LowerMacroscpp">trunk/Source/JavaScriptCore/b3/B3LowerMacros.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3LowerToAircpp">trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3MemoryValueh">trunk/Source/JavaScriptCore/b3/B3MemoryValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Opcodecpp">trunk/Source/JavaScriptCore/b3/B3Opcode.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Opcodeh">trunk/Source/JavaScriptCore/b3/B3Opcode.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3PatchpointValueh">trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ReduceStrengthcpp">trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3SlotBaseValueh">trunk/Source/JavaScriptCore/b3/B3SlotBaseValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3StackmapValuecpp">trunk/Source/JavaScriptCore/b3/B3StackmapValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3StackmapValueh">trunk/Source/JavaScriptCore/b3/B3StackmapValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3SwitchValueh">trunk/Source/JavaScriptCore/b3/B3SwitchValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3UpsilonValueh">trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Validatecpp">trunk/Source/JavaScriptCore/b3/B3Validate.cpp</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="#trunkSourceJavaScriptCoreb3B3ValueInlinesh">trunk/Source/JavaScriptCore/b3/B3ValueInlines.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>
<li><a href="#trunkSourceJavaScriptCoreb3B3VariableValuecpp">trunk/Source/JavaScriptCore/b3/B3VariableValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3VariableValueh">trunk/Source/JavaScriptCore/b3/B3VariableValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3testb3cpp">trunk/Source/JavaScriptCore/b3/testb3.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOutputcpp">trunk/Source/JavaScriptCore/ftl/FTLOutput.cpp</a></li>
<li><a href="#trunkWebsiteswebkitorgChangeLog">trunk/Websites/webkit.org/ChangeLog</a></li>
<li><a href="#trunkWebsiteswebkitorgdocsb3intermediaterepresentationhtml">trunk/Websites/webkit.org/docs/b3/intermediate-representation.html</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreb3B3Kindcpp">trunk/Source/JavaScriptCore/b3/B3Kind.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Kindh">trunk/Source/JavaScriptCore/b3/B3Kind.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -133,6 +133,7 @@
</span><span class="cx">     b3/B3HeapRange.cpp
</span><span class="cx">     b3/B3InferSwitches.cpp
</span><span class="cx">     b3/B3InsertionSet.cpp
</span><ins>+    b3/B3Kind.cpp
</ins><span class="cx">     b3/B3LegalizeMemoryOffsets.cpp
</span><span class="cx">     b3/B3LowerMacros.cpp
</span><span class="cx">     b3/B3LowerMacrosAfterOptimizations.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -1,3 +1,162 @@
</span><ins>+2016-09-28  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        B3 opcodes should leave room for flags
+        https://bugs.webkit.org/show_bug.cgi?id=162692
+
+        Reviewed by Keith Miller.
+
+        It used to be that the main thing that determined what a Value did was the opcode. The
+        Opcode was how you knew what subclass of Value you had. The opcode told you what the Value
+        actually did. This change replaces Opcode with Kind, which is a tuple of opcode and other
+        stuff.
+        
+        Opcodes are great, and that's how most compilers work. But opcodes are one-dimensional. Here
+        is how this manifests. Say you have an opcode, like Load. You will be happy if your IR has
+        one Load opcode. But then, you might add Load8S/Load8Z/Load16S/Load16Z opcodes, as we have
+        done in B3. B3 has one dimension of Load opcodes, which determines something like the C type
+        of the load. But in the very near future, we will want to add two more dimensions to Loads:
+        
+        - A flag to say if the load traps.
+        - A flag to say if the load has acquire semantics.
+        
+        Mapping these three dimensions (type, trap, acquire) onto the one-dimensional Opcode space
+        would create mayham: Load8S, Load8STrap, Load8SAcquire, Load8STrapAcquire, Load8Z,
+        Load8ZTrap, etc.
+        
+        This happens in other parts of the IR. For example, we have a dimension of arithmetic
+        operations: add, sub, mul, div, mod, etc. Then we have the chill flag. But since opcodes
+        are one-dimensional, that means having ChillDiv and ChillMod, and tons of places in the
+        compiler that case on both Div and ChillDiv, or case on both Mod and ChillMod, since they
+        are only interested in the kind of arithmetic being done and not the chillness.
+        
+        Though the examples all involve bits (chill or not, trapping or not, etc), I can imagine
+        other properties that behave more like small enums, like if we fill out more memory ordering
+        modes other than just &quot;acquire? yes/no&quot;. There will eventually have to be something like a
+        std::memory_order associated with memory accesses.
+        
+        One approach to this problem is to have a Value subclass that contains fields with the meta
+        data. I don't like this for two reasons:
+        
+        - In bug 162688, I want to make trapping memory accesses have stackmaps. This means that a
+          trapping memory access would have a different Value subclass than a non-trapping memory
+          access. So, this meta-data needs to channel into ValueType::accepts(). Currently that
+          takes Opcode and nothing else.
+        
+        - Compiler IRs are all about making common tasks easy. If it becomes commonplace for opcodes
+          to require a custom Value subclass just for a bit then that's not very easy.
+        
+        This change addresses this problem by making the compiler pass around Kinds rather than
+        Opcodes. A Kind contains an Opcode as well as any number of opcode-specific bits. This
+        change demonstrates how Kind should be used by converting chillness to it. Kind has
+        hasIsChill(), isChill(), and setIsChill() methods. hasIsChill() is true only for Div and
+        Mod. setIsChill() asserts if !hasIsChill(). If you want to create a Chill Div, you say
+        chill(Div). IR dumps will print it like this:
+
+            Int32 @38 = Div&lt;Chill&gt;(@36, @37, DFG:@24, ControlDependent)
+        
+        Where &quot;Div&lt;Chill&gt;&quot; is how a Kind that hasExtraBits() dumps itself. If a Kind does not
+        hasExtraBits() (the normal case) then it dumps like a normal Opcode (without the &quot;&lt;&gt;&quot;).
+        
+        I replaced many uses of Opcode with Kind. New code has to be mindful that Opcode may not be
+        the right way to summarize what a value does, and so in many cases it's better to carry
+        around a Kind instead - especially if you will use it to stamp out new Values. Opcode is no
+        longer sufficient to perform a dynamic Value cast, since that code now uses Kind. ValueKey
+        now wants a Kind instead of an Opcode. All Value constructors now take Kind instead of
+        Opcode. But most opcodes don't get any extra Kind bits, and so the code that operates on
+        those opcodes is largely unchanged.
+        
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * b3/B3ArgumentRegValue.h:
+        * b3/B3CCallValue.h:
+        * b3/B3CheckValue.cpp:
+        (JSC::B3::CheckValue::convertToAdd):
+        (JSC::B3::CheckValue::CheckValue):
+        * b3/B3CheckValue.h:
+        (JSC::B3::CheckValue::accepts):
+        * b3/B3Const32Value.h:
+        * b3/B3Const64Value.h:
+        * b3/B3ConstDoubleValue.h:
+        * b3/B3ConstFloatValue.h:
+        * b3/B3FenceValue.h:
+        * b3/B3Kind.cpp: Added.
+        (JSC::B3::Kind::dump):
+        * b3/B3Kind.h: Added.
+        (JSC::B3::Kind::Kind):
+        (JSC::B3::Kind::opcode):
+        (JSC::B3::Kind::setOpcode):
+        (JSC::B3::Kind::hasExtraBits):
+        (JSC::B3::Kind::hasIsChill):
+        (JSC::B3::Kind::isChill):
+        (JSC::B3::Kind::setIsChill):
+        (JSC::B3::Kind::operator==):
+        (JSC::B3::Kind::operator!=):
+        (JSC::B3::Kind::hash):
+        (JSC::B3::Kind::isHashTableDeletedValue):
+        (JSC::B3::chill):
+        (JSC::B3::KindHash::hash):
+        (JSC::B3::KindHash::equal):
+        * b3/B3LowerMacros.cpp:
+        * b3/B3LowerToAir.cpp:
+        (JSC::B3::Air::LowerToAir::lower):
+        * b3/B3MemoryValue.h:
+        * b3/B3Opcode.cpp:
+        (WTF::printInternal):
+        * b3/B3Opcode.h:
+        * b3/B3PatchpointValue.h:
+        (JSC::B3::PatchpointValue::accepts):
+        * b3/B3ReduceStrength.cpp:
+        * b3/B3SlotBaseValue.h:
+        * b3/B3StackmapValue.cpp:
+        (JSC::B3::StackmapValue::StackmapValue):
+        * b3/B3StackmapValue.h:
+        * b3/B3SwitchValue.h:
+        (JSC::B3::SwitchValue::accepts):
+        * b3/B3UpsilonValue.h:
+        * b3/B3Validate.cpp:
+        * b3/B3Value.cpp:
+        (JSC::B3::Value::dump):
+        (JSC::B3::Value::deepDump):
+        (JSC::B3::Value::invertedCompare):
+        (JSC::B3::Value::effects):
+        (JSC::B3::Value::key):
+        (JSC::B3::Value::typeFor):
+        (JSC::B3::Value::badKind):
+        (JSC::B3::Value::badOpcode): Deleted.
+        * b3/B3Value.h:
+        * b3/B3ValueInlines.h:
+        (JSC::B3::Value::as):
+        * b3/B3ValueKey.cpp:
+        (JSC::B3::ValueKey::dump):
+        (JSC::B3::ValueKey::materialize):
+        * b3/B3ValueKey.h:
+        (JSC::B3::ValueKey::ValueKey):
+        (JSC::B3::ValueKey::kind):
+        (JSC::B3::ValueKey::opcode):
+        (JSC::B3::ValueKey::operator==):
+        (JSC::B3::ValueKey::hash):
+        * b3/B3ValueKeyInlines.h:
+        (JSC::B3::ValueKey::ValueKey):
+        * b3/B3VariableValue.cpp:
+        (JSC::B3::VariableValue::VariableValue):
+        * b3/B3VariableValue.h:
+        * b3/testb3.cpp:
+        (JSC::B3::testChillDiv):
+        (JSC::B3::testChillDivTwice):
+        (JSC::B3::testChillDiv64):
+        (JSC::B3::testChillModArg):
+        (JSC::B3::testChillModArgs):
+        (JSC::B3::testChillModImms):
+        (JSC::B3::testChillModArg32):
+        (JSC::B3::testChillModArgs32):
+        (JSC::B3::testChillModImms32):
+        (JSC::B3::testSwitchChillDiv):
+        (JSC::B3::testEntrySwitchWithCommonPaths):
+        (JSC::B3::testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint):
+        * ftl/FTLOutput.cpp:
+        (JSC::FTL::Output::chillDiv):
+        (JSC::FTL::Output::chillMod):
+
</ins><span class="cx"> 2016-09-29  Saam Barati  &lt;sbarati@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         We don't properly propagate non-simple-parameter-list when parsing a setter
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -726,6 +726,8 @@
</span><span class="cx">                 0FDB2CEA174896C7007B3C1B /* ConcurrentJITLock.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0FDDBFB51666EED800C55FEF /* DFGVariableAccessDataDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDDBFB21666EED500C55FEF /* DFGVariableAccessDataDump.cpp */; };
</span><span class="cx">                 0FDDBFB61666EEDA00C55FEF /* DFGVariableAccessDataDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDDBFB31666EED500C55FEF /* DFGVariableAccessDataDump.h */; };
</span><ins>+                0FDF67D21D9C6D27001B9825 /* B3Kind.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDF67D11D9C6086001B9825 /* B3Kind.h */; };
+                0FDF67D31D9C6D2A001B9825 /* B3Kind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF67D01D9C6086001B9825 /* B3Kind.cpp */; };
</ins><span class="cx">                 0FDF70851D3F2C2200927449 /* AirLowerEntrySwitch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF70831D3F2C1F00927449 /* AirLowerEntrySwitch.cpp */; };
</span><span class="cx">                 0FDF70861D3F2C2500927449 /* AirLowerEntrySwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDF70841D3F2C1F00927449 /* AirLowerEntrySwitch.h */; };
</span><span class="cx">                 0FE050141AA9091100D33B33 /* ArgumentsMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE0500C1AA9091100D33B33 /* ArgumentsMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2983,6 +2985,8 @@
</span><span class="cx">                 0FDB2CE9174896C7007B3C1B /* ConcurrentJITLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConcurrentJITLock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FDDBFB21666EED500C55FEF /* DFGVariableAccessDataDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGVariableAccessDataDump.cpp; path = dfg/DFGVariableAccessDataDump.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FDDBFB31666EED500C55FEF /* DFGVariableAccessDataDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGVariableAccessDataDump.h; path = dfg/DFGVariableAccessDataDump.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0FDF67D01D9C6086001B9825 /* B3Kind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3Kind.cpp; path = b3/B3Kind.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0FDF67D11D9C6086001B9825 /* B3Kind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3Kind.h; path = b3/B3Kind.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0FDF70831D3F2C1F00927449 /* AirLowerEntrySwitch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirLowerEntrySwitch.cpp; path = b3/air/AirLowerEntrySwitch.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FDF70841D3F2C1F00927449 /* AirLowerEntrySwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirLowerEntrySwitch.h; path = b3/air/AirLowerEntrySwitch.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FE0500C1AA9091100D33B33 /* ArgumentsMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArgumentsMode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4877,6 +4881,8 @@
</span><span class="cx">                                 0FEC85B41BE1462F0080FF74 /* B3InsertionSet.cpp */,
</span><span class="cx">                                 0FEC85B51BE1462F0080FF74 /* B3InsertionSet.h */,
</span><span class="cx">                                 0FEC85B61BE1462F0080FF74 /* B3InsertionSetInlines.h */,
</span><ins>+                                0FDF67D01D9C6086001B9825 /* B3Kind.cpp */,
+                                0FDF67D11D9C6086001B9825 /* B3Kind.h */,
</ins><span class="cx">                                 436E54511C468E5F00B5AF73 /* B3LegalizeMemoryOffsets.cpp */,
</span><span class="cx">                                 436E54521C468E5F00B5AF73 /* B3LegalizeMemoryOffsets.h */,
</span><span class="cx">                                 0F338E191BF286EA0013C88F /* B3LowerMacros.cpp */,
</span><span class="lines">@@ -7740,6 +7746,7 @@
</span><span class="cx">                                 0F64EAF31C4ECD0600621E9B /* AirArgInlines.h in Headers */,
</span><span class="cx">                                 A5EA710519F6DE740098F5EC /* generate_objc_configuration_header.py in Headers */,
</span><span class="cx">                                 DC69B99D1D15F914002E3C00 /* B3InferSwitches.h in Headers */,
</span><ins>+                                0FDF67D21D9C6D27001B9825 /* B3Kind.h in Headers */,
</ins><span class="cx">                                 A5EA710619F6DE760098F5EC /* generate_objc_configuration_implementation.py in Headers */,
</span><span class="cx">                                 0F7C39FF1C90C55B00480151 /* DFGOpInfo.h in Headers */,
</span><span class="cx">                                 A5EA710719F6DE780098F5EC /* generate_objc_protocol_type_conversions_header.py in Headers */,
</span><span class="lines">@@ -9095,6 +9102,7 @@
</span><span class="cx">                                 0FFFC95914EF90A600C72532 /* DFGCSEPhase.cpp in Sources */,
</span><span class="cx">                                 0F2FC77216E12F710038D976 /* DFGDCEPhase.cpp in Sources */,
</span><span class="cx">                                 0F338E121BF0276C0013C88F /* B3OpaqueByproducts.cpp in Sources */,
</span><ins>+                                0FDF67D31D9C6D2A001B9825 /* B3Kind.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></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ArgumentRegValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE ArgumentRegValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == ArgumentReg; }
</del><ins>+    static bool accepts(Kind kind) { return kind == ArgumentReg; }
</ins><span class="cx">     
</span><span class="cx">     ~ArgumentRegValue();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3CCallValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3CCallValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3CCallValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3CCallValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE CCallValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == CCall; }
</del><ins>+    static bool accepts(Kind kind) { return kind == CCall; }
</ins><span class="cx"> 
</span><span class="cx">     ~CCallValue();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3CheckValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> void CheckValue::convertToAdd()
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(opcode() == CheckAdd || opcode() == CheckSub || opcode() == CheckMul);
</span><del>-    m_opcode = CheckAdd;
</del><ins>+    m_kind = CheckAdd;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Value* CheckValue::cloneImpl() const
</span><span class="lines">@@ -46,21 +46,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Use this form for CheckAdd, CheckSub, and CheckMul.
</span><del>-CheckValue::CheckValue(Opcode opcode, Origin origin, Value* left, Value* right)
-    : StackmapValue(CheckedOpcode, opcode, left-&gt;type(), origin)
</del><ins>+CheckValue::CheckValue(Kind kind, Origin origin, Value* left, Value* right)
+    : StackmapValue(CheckedOpcode, kind, left-&gt;type(), origin)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(B3::isInt(type()));
</span><span class="cx">     ASSERT(left-&gt;type() == right-&gt;type());
</span><del>-    ASSERT(opcode == CheckAdd || opcode == CheckSub || opcode == CheckMul);
</del><ins>+    ASSERT(kind == CheckAdd || kind == CheckSub || kind == CheckMul);
</ins><span class="cx">     append(ConstrainedValue(left, ValueRep::WarmAny));
</span><span class="cx">     append(ConstrainedValue(right, ValueRep::WarmAny));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Use this form for Check.
</span><del>-CheckValue::CheckValue(Opcode opcode, Origin origin, Value* predicate)
-    : StackmapValue(CheckedOpcode, opcode, Void, origin)
</del><ins>+CheckValue::CheckValue(Kind kind, Origin origin, Value* predicate)
+    : StackmapValue(CheckedOpcode, kind, Void, origin)
</ins><span class="cx"> {
</span><del>-    ASSERT(opcode == Check);
</del><ins>+    ASSERT(kind == Check);
</ins><span class="cx">     append(ConstrainedValue(predicate, ValueRep::WarmAny));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3CheckValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3CheckValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3CheckValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3CheckValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,9 +33,9 @@
</span><span class="cx"> 
</span><span class="cx"> class CheckValue : public StackmapValue {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode)
</del><ins>+    static bool accepts(Kind kind)
</ins><span class="cx">     {
</span><del>-        switch (opcode) {
</del><ins>+        switch (kind.opcode()) {
</ins><span class="cx">         case CheckAdd:
</span><span class="cx">         case CheckSub:
</span><span class="cx">         case CheckMul:
</span><span class="lines">@@ -57,10 +57,10 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><span class="cx">     // Use this form for CheckAdd, CheckSub, and CheckMul.
</span><del>-    JS_EXPORT_PRIVATE CheckValue(Opcode, Origin, Value* left, Value* right);
</del><ins>+    JS_EXPORT_PRIVATE CheckValue(Kind, Origin, Value* left, Value* right);
</ins><span class="cx"> 
</span><span class="cx">     // Use this form for Check.
</span><del>-    JS_EXPORT_PRIVATE CheckValue(Opcode, Origin, Value* predicate);
</del><ins>+    JS_EXPORT_PRIVATE CheckValue(Kind, Origin, Value* predicate);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::B3
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const32Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const32Value.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const32Value.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3Const32Value.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE Const32Value : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == Const32; }
</del><ins>+    static bool accepts(Kind kind) { return kind == Const32; }
</ins><span class="cx">     
</span><span class="cx">     ~Const32Value();
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const64Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const64Value.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const64Value.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3Const64Value.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE Const64Value : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == Const64; }
</del><ins>+    static bool accepts(Kind kind) { return kind == Const64; }
</ins><span class="cx">     
</span><span class="cx">     ~Const64Value();
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ConstDoubleValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE ConstDoubleValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == ConstDouble; }
</del><ins>+    static bool accepts(Kind kind) { return kind == ConstDouble; }
</ins><span class="cx">     
</span><span class="cx">     ~ConstDoubleValue();
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ConstFloatValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ConstFloatValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ConstFloatValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ConstFloatValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE ConstFloatValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == ConstFloat; }
</del><ins>+    static bool accepts(Kind kind) { return kind == ConstFloat; }
</ins><span class="cx"> 
</span><span class="cx">     ~ConstFloatValue();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3FenceValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3FenceValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3FenceValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3FenceValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE FenceValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == Fence; }
</del><ins>+    static bool accepts(Kind kind) { return kind == Fence; }
</ins><span class="cx">     
</span><span class="cx">     ~FenceValue();
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Kindcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3Kind.cpp (0 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Kind.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3Kind.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2016 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;B3Kind.h&quot;
+
+#if ENABLE(B3_JIT)
+
+#include &lt;wtf/CommaPrinter.h&gt;
+
+namespace JSC { namespace B3 {
+
+void Kind::dump(PrintStream&amp; out) const
+{
+    out.print(m_opcode);
+    if (!hasExtraBits())
+        return;
+    
+    CommaPrinter comma;
+    out.print(&quot;&lt;&quot;);
+    if (isChill())
+        out.print(comma, &quot;Chill&quot;);
+    out.print(&quot;&gt;&quot;);
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Kindh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3Kind.h (0 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Kind.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3Kind.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -0,0 +1,196 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 B3Kind_h
+#define B3Kind_h
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3Opcode.h&quot;
+#include &lt;wtf/HashTable.h&gt;
+#include &lt;wtf/PrintStream.h&gt;
+
+namespace JSC { namespace B3 {
+
+// A Kind is a terse summary of what a Value does. There is a fixed number of possible
+// Kinds. Kind is a tuple of Opcode (see B3Opcode.h) and some extra bits. Most opcodes don't
+// get any extra bits, and those bits must remain zero if the Kind's opcode field is set to
+// one of those opcodes. The purpose of Kind is to be like an opcode in other IRs, but to
+// be multidimensional. For example, a Load has many dimensions of customization that we may
+// eventually implement. A Load can have different alignments, alignment failure modes,
+// temporality modes, trapping modes, ordering modes, etc. It's fine to put such flags into
+// subclasses of Value, but in some cases that would be overkill, particularly since if you
+// did that for a pure value then you'd also have to thread it through ValueKey. It's much
+// easier to put it in Kind, and then your extra bit will get carried around by everyone who
+// knows how to carry around Kinds. Most importantly, putting flags into Kind allows you to
+// use them as part of B3::Value's dynamic cast facility. For example we could have a
+// trapping Load that uses a Value subclass that has a stackmap while non-trapping Loads
+// continue to use the normal MemoryValue.
+//
+// Note that any code in the compiler that transcribes IR (like a strength reduction that
+// replaces an Add with a different Add, or even with a different opcode entirely) will
+// probably drop unknown bits by default. This is definitely not correct for many bits (like
+// isChill for Div/Mod and all of the envisioned Load/Store flags), so if you add a new bit
+// you will probably have to audit the compiler to make sure that phases that transcribe
+// your opcode do the right thing with your bit.
+
+class Kind {
+public:
+    Kind(Opcode opcode)
+        : m_opcode(opcode)
+    {
+        u.bits = 0;
+    }
+    
+    Kind()
+        : Kind(Oops)
+    {
+    }
+    
+    Opcode opcode() const { return m_opcode; }
+    void setOpcode(Opcode opcode) { m_opcode = opcode; }
+    
+    bool hasExtraBits() const { return !!u.bits; }
+    
+    // Chill bit. This applies to division-based arithmetic ops, which may trap on some
+    // platforms or exhibit bizarre behavior when passed certain inputs. The non-chill
+    // version will behave as unpredictably as it wants. For example, it's legal to
+    // constant-fold Div(x, 0) to any value or to replace it with any effectful operation.
+    // But when it's chill, that means that the semantics when it would have trapped are
+    // the JS semantics. For example, Div&lt;Chill&gt;(@a, @b) means:
+    //
+    //     ((a | 0) / (b | 0)) | 0
+    //
+    // And Mod&lt;Chill&gt;(a, b) means:
+    //
+    //     ((a | 0) % (b | 0)) | 0
+    //
+    // Note that Div&lt;Chill&gt; matches exactly how ARM handles integer division.
+    bool hasIsChill() const
+    {
+        switch (m_opcode) {
+        case Div:
+        case Mod:
+            return true;
+        default:
+            return false;
+        }
+    }
+    bool isChill() const
+    {
+        return hasIsChill() &amp;&amp; u.isChill;
+    }
+    void setIsChill(bool isChill)
+    {
+        ASSERT(hasIsChill());
+        u.isChill = isChill;
+    }
+    
+    // Rules for adding new properties:
+    // - Put the accessors here.
+    // - hasBlah() should check if the opcode allows for your property.
+    // - blah() returns a default value if !hasBlah()
+    // - setBlah() asserts if !hasBlah()
+    // - Try not to increase the size of Kind too much. But it wouldn't be the end of the
+    //   world if it bloated to 64 bits.
+    
+    bool operator==(const Kind&amp; other) const
+    {
+        return m_opcode == other.m_opcode
+            &amp;&amp; u.bits == other.u.bits;
+    }
+    
+    bool operator!=(const Kind&amp; other) const
+    {
+        return !(*this == other);
+    }
+    
+    void dump(PrintStream&amp;) const;
+    
+    unsigned hash() const
+    {
+        // It's almost certainly more important that this hash function is cheap to compute than
+        // anything else. We can live with some kind hash collisions.
+        return m_opcode + u.bits * 111;
+    }
+    
+    Kind(WTF::HashTableDeletedValueType)
+        : m_opcode(Oops)
+    {
+        u.bits = 1;
+    }
+    
+    bool isHashTableDeletedValue() const
+    {
+        return *this == Kind(WTF::HashTableDeletedValue);
+    }
+    
+private:
+    Opcode m_opcode;
+    union {
+        bool isChill;
+        uint16_t bits;
+    } u;
+};
+
+// For every flag 'foo' you add, it's customary to create a Kind B3::foo(Kind) function that makes
+// a kind with the flag set. For example, for chill, this lets us say:
+//
+//     block-&gt;appendNew&lt;Value&gt;(m_proc, chill(Mod), Origin(), a, b);
+//
+// That looks pretty slick. Let's keep it that way.
+
+inline Kind chill(Kind kind)
+{
+    kind.setIsChill(true);
+    return kind;
+}
+
+struct KindHash {
+    static unsigned hash(const Kind&amp; key) { return key.hash(); }
+    static bool equal(const Kind&amp; a, const Kind&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::Kind&gt; {
+    typedef JSC::B3::KindHash Hash;
+};
+
+template&lt;typename T&gt; struct HashTraits;
+template&lt;&gt; struct HashTraits&lt;JSC::B3::Kind&gt; : public SimpleClassHashTraits&lt;JSC::B3::Kind&gt; {
+    static const bool emptyValueIsZero = false;
+};
+
+} // namespace WTF
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3Kind_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3LowerMacroscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3LowerMacros.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3LowerMacros.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3LowerMacros.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -83,6 +83,41 @@
</span><span class="cx">             m_origin = m_value-&gt;origin();
</span><span class="cx">             switch (m_value-&gt;opcode()) {
</span><span class="cx">             case Mod: {
</span><ins>+                if (m_value-&gt;isChill()) {
+                    if (isARM64()) {
+                        BasicBlock* before = m_blockInsertionSet.splitForward(m_block, m_index, &amp;m_insertionSet);
+                        BasicBlock* zeroDenCase = m_blockInsertionSet.insertBefore(m_block);
+                        BasicBlock* normalModCase = m_blockInsertionSet.insertBefore(m_block);
+
+                        before-&gt;replaceLastWithNew&lt;Value&gt;(m_proc, Branch, m_origin, m_value-&gt;child(1));
+                        before-&gt;setSuccessors(
+                            FrequentedBlock(normalModCase, FrequencyClass::Normal),
+                            FrequentedBlock(zeroDenCase, FrequencyClass::Rare));
+
+                        Value* divResult = normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, chill(Div), m_origin, m_value-&gt;child(0), m_value-&gt;child(1));
+                        Value* multipliedBack = normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, Mul, m_origin, divResult, m_value-&gt;child(1));
+                        Value* result = normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, Sub, m_origin, m_value-&gt;child(0), multipliedBack);
+                        UpsilonValue* normalResult = normalModCase-&gt;appendNew&lt;UpsilonValue&gt;(m_proc, m_origin, result);
+                        normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, Jump, m_origin);
+                        normalModCase-&gt;setSuccessors(FrequentedBlock(m_block));
+
+                        UpsilonValue* zeroResult = zeroDenCase-&gt;appendNew&lt;UpsilonValue&gt;(
+                            m_proc, m_origin,
+                            zeroDenCase-&gt;appendIntConstant(m_proc, m_value, 0));
+                        zeroDenCase-&gt;appendNew&lt;Value&gt;(m_proc, Jump, m_origin);
+                        zeroDenCase-&gt;setSuccessors(FrequentedBlock(m_block));
+
+                        Value* phi = m_insertionSet.insert&lt;Value&gt;(m_index, Phi, m_value-&gt;type(), m_origin);
+                        normalResult-&gt;setPhi(phi);
+                        zeroResult-&gt;setPhi(phi);
+                        m_value-&gt;replaceWithIdentity(phi);
+                        before-&gt;updatePredecessorsAfter();
+                        m_changed = true;
+                    } else
+                        makeDivisionChill(Mod);
+                    break;
+                }
+                
</ins><span class="cx">                 double (*fmodDouble)(double, double) = fmod;
</span><span class="cx">                 if (m_value-&gt;type() == Double) {
</span><span class="cx">                     Value* functionAddress = m_insertionSet.insert&lt;ConstPtrValue&gt;(m_index, m_origin, fmodDouble);
</span><span class="lines">@@ -106,7 +141,7 @@
</span><span class="cx">                     m_value-&gt;replaceWithIdentity(result);
</span><span class="cx">                     m_changed = true;
</span><span class="cx">                 } else if (isARM64()) {
</span><del>-                    Value* divResult = m_insertionSet.insert&lt;Value&gt;(m_index, ChillDiv, m_origin, m_value-&gt;child(0), m_value-&gt;child(1));
</del><ins>+                    Value* divResult = m_insertionSet.insert&lt;Value&gt;(m_index, chill(Div), m_origin, m_value-&gt;child(0), m_value-&gt;child(1));
</ins><span class="cx">                     Value* multipliedBack = m_insertionSet.insert&lt;Value&gt;(m_index, Mul, m_origin, divResult, m_value-&gt;child(1));
</span><span class="cx">                     Value* result = m_insertionSet.insert&lt;Value&gt;(m_index, Sub, m_origin, m_value-&gt;child(0), multipliedBack);
</span><span class="cx">                     m_value-&gt;replaceWithIdentity(result);
</span><span class="lines">@@ -114,46 +149,12 @@
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><del>-            case ChillDiv: {
-                makeDivisionChill(Div);
</del><ins>+            case Div: {
+                if (m_value-&gt;isChill())
+                    makeDivisionChill(Div);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            case ChillMod: {
-                if (isARM64()) {
-                    BasicBlock* before = m_blockInsertionSet.splitForward(m_block, m_index, &amp;m_insertionSet);
-                    BasicBlock* zeroDenCase = m_blockInsertionSet.insertBefore(m_block);
-                    BasicBlock* normalModCase = m_blockInsertionSet.insertBefore(m_block);
-
-                    before-&gt;replaceLastWithNew&lt;Value&gt;(m_proc, Branch, m_origin, m_value-&gt;child(1));
-                    before-&gt;setSuccessors(
-                        FrequentedBlock(normalModCase, FrequencyClass::Normal),
-                        FrequentedBlock(zeroDenCase, FrequencyClass::Rare));
-
-                    Value* divResult = normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, ChillDiv, m_origin, m_value-&gt;child(0), m_value-&gt;child(1));
-                    Value* multipliedBack = normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, Mul, m_origin, divResult, m_value-&gt;child(1));
-                    Value* result = normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, Sub, m_origin, m_value-&gt;child(0), multipliedBack);
-                    UpsilonValue* normalResult = normalModCase-&gt;appendNew&lt;UpsilonValue&gt;(m_proc, m_origin, result);
-                    normalModCase-&gt;appendNew&lt;Value&gt;(m_proc, Jump, m_origin);
-                    normalModCase-&gt;setSuccessors(FrequentedBlock(m_block));
-
-                    UpsilonValue* zeroResult = zeroDenCase-&gt;appendNew&lt;UpsilonValue&gt;(
-                        m_proc, m_origin,
-                        zeroDenCase-&gt;appendIntConstant(m_proc, m_value, 0));
-                    zeroDenCase-&gt;appendNew&lt;Value&gt;(m_proc, Jump, m_origin);
-                    zeroDenCase-&gt;setSuccessors(FrequentedBlock(m_block));
-
-                    Value* phi = m_insertionSet.insert&lt;Value&gt;(m_index, Phi, m_value-&gt;type(), m_origin);
-                    normalResult-&gt;setPhi(phi);
-                    zeroResult-&gt;setPhi(phi);
-                    m_value-&gt;replaceWithIdentity(phi);
-                    before-&gt;updatePredecessorsAfter();
-                    m_changed = true;
-                } else
-                    makeDivisionChill(Mod);
-                break;
-            }
-
</del><span class="cx">             case Switch: {
</span><span class="cx">                 SwitchValue* switchValue = m_value-&gt;as&lt;SwitchValue&gt;();
</span><span class="cx">                 Vector&lt;SwitchCase&gt; cases;
</span><span class="lines">@@ -188,7 +189,7 @@
</span><span class="cx">         if (isARM64())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        // We implement &quot;res = ChillDiv/ChillMod(num, den)&quot; as follows:
</del><ins>+        // We implement &quot;res = Div&lt;Chill&gt;/Mod&lt;Chill&gt;(num, den)&quot; as follows:
</ins><span class="cx">         //
</span><span class="cx">         //     if (den + 1 &lt;=_unsigned 1) {
</span><span class="cx">         //         if (!den) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3LowerToAircpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -1846,10 +1846,9 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        case ChillDiv:
-            RELEASE_ASSERT(isARM64());
-            FALLTHROUGH;
</del><span class="cx">         case Div: {
</span><ins>+            if (m_value-&gt;isChill())
+                RELEASE_ASSERT(isARM64());
</ins><span class="cx"> #if CPU(X86) || CPU(X86_64)
</span><span class="cx">             if (isInt(m_value-&gt;type())) {
</span><span class="cx">                 lowerX86Div();
</span><span class="lines">@@ -1865,6 +1864,7 @@
</span><span class="cx"> 
</span><span class="cx">         case Mod: {
</span><span class="cx">             RELEASE_ASSERT(isX86());
</span><ins>+            RELEASE_ASSERT(!m_value-&gt;isChill());
</ins><span class="cx"> #if CPU(X86) || CPU(X86_64)
</span><span class="cx">             lowerX86Div();
</span><span class="cx">             append(Move, Tmp(X86Registers::edx), tmp(m_value));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3MemoryValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3MemoryValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3MemoryValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3MemoryValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -37,9 +37,9 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE MemoryValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode)
</del><ins>+    static bool accepts(Kind kind)
</ins><span class="cx">     {
</span><del>-        switch (opcode) {
</del><ins>+        switch (kind.opcode()) {
</ins><span class="cx">         case Load8Z:
</span><span class="cx">         case Load8S:
</span><span class="cx">         case Load16Z:
</span><span class="lines">@@ -54,9 +54,9 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static bool isStore(Opcode opcode)
</del><ins>+    static bool isStore(Kind kind)
</ins><span class="cx">     {
</span><del>-        switch (opcode) {
</del><ins>+        switch (kind.opcode()) {
</ins><span class="cx">         case Store8:
</span><span class="cx">         case Store16:
</span><span class="cx">         case Store:
</span><span class="lines">@@ -66,9 +66,9 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static bool isLoad(Opcode opcode)
</del><ins>+    static bool isLoad(Kind kind)
</ins><span class="cx">     {
</span><del>-        return accepts(opcode) &amp;&amp; !isStore(opcode);
</del><ins>+        return accepts(kind) &amp;&amp; !isStore(kind);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ~MemoryValue();
</span><span class="lines">@@ -94,13 +94,13 @@
</span><span class="cx"> 
</span><span class="cx">     // Use this form for Load (but not Load8Z, Load8S, or any of the Loads that have a suffix that
</span><span class="cx">     // describes the returned type).
</span><del>-    MemoryValue(Opcode opcode, Type type, Origin origin, Value* pointer, int32_t offset = 0)
-        : Value(CheckedOpcode, opcode, type, origin, pointer)
</del><ins>+    MemoryValue(Kind kind, Type type, Origin origin, Value* pointer, int32_t offset = 0)
+        : Value(CheckedOpcode, kind, type, origin, pointer)
</ins><span class="cx">         , m_offset(offset)
</span><span class="cx">         , m_range(HeapRange::top())
</span><span class="cx">     {
</span><span class="cx">         if (!ASSERT_DISABLED) {
</span><del>-            switch (opcode) {
</del><ins>+            switch (kind.opcode()) {
</ins><span class="cx">             case Load:
</span><span class="cx">                 break;
</span><span class="cx">             case Load8Z:
</span><span class="lines">@@ -121,19 +121,19 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Use this form for loads where the return type is implied.
</span><del>-    MemoryValue(Opcode opcode, Origin origin, Value* pointer, int32_t offset = 0)
-        : MemoryValue(opcode, Int32, origin, pointer, offset)
</del><ins>+    MemoryValue(Kind kind, Origin origin, Value* pointer, int32_t offset = 0)
+        : MemoryValue(kind, Int32, origin, pointer, offset)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Use this form for stores.
</span><del>-    MemoryValue(Opcode opcode, Origin origin, Value* value, Value* pointer, int32_t offset = 0)
-        : Value(CheckedOpcode, opcode, Void, origin, value, pointer)
</del><ins>+    MemoryValue(Kind kind, Origin origin, Value* value, Value* pointer, int32_t offset = 0)
+        : Value(CheckedOpcode, kind, Void, origin, value, pointer)
</ins><span class="cx">         , m_offset(offset)
</span><span class="cx">         , m_range(HeapRange::top())
</span><span class="cx">     {
</span><span class="cx">         if (!ASSERT_DISABLED) {
</span><del>-            switch (opcode) {
</del><ins>+            switch (kind.opcode()) {
</ins><span class="cx">             case Store8:
</span><span class="cx">             case Store16:
</span><span class="cx">             case Store:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Opcodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Opcode.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Opcode.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3Opcode.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -128,12 +128,6 @@
</span><span class="cx">     case Neg:
</span><span class="cx">         out.print(&quot;Neg&quot;);
</span><span class="cx">         return;
</span><del>-    case ChillDiv:
-        out.print(&quot;ChillDiv&quot;);
-        return;
-    case ChillMod:
-        out.print(&quot;ChillMod&quot;);
-        return;
</del><span class="cx">     case BitAnd:
</span><span class="cx">         out.print(&quot;BitAnd&quot;);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Opcodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Opcode.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Opcode.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3Opcode.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,6 +33,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><ins>+// Warning: In B3, an Opcode is just one part of a Kind. Kind is used the way that an opcode
+// would be used in simple IRs. See B3Kind.h.
+
</ins><span class="cx"> enum Opcode : int16_t {
</span><span class="cx">     // A no-op that returns Void, useful for when you want to remove a value.
</span><span class="cx">     Nop,
</span><span class="lines">@@ -83,8 +86,6 @@
</span><span class="cx">     Neg,
</span><span class="cx"> 
</span><span class="cx">     // Integer math.
</span><del>-    ChillDiv, // doesn't trap ever, behaves like JS (x/y)|0.
-    ChillMod, // doesn't trap ever, behaves like JS (x%y)|0.
</del><span class="cx">     BitAnd,
</span><span class="cx">     BitOr,
</span><span class="cx">     BitXor,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3PatchpointValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> public:
</span><span class="cx">     typedef StackmapValue Base;
</span><span class="cx">     
</span><del>-    static bool accepts(Opcode opcode) { return opcode == Patchpoint; }
</del><ins>+    static bool accepts(Kind kind) { return kind == Patchpoint; }
</ins><span class="cx"> 
</span><span class="cx">     ~PatchpointValue();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ReduceStrengthcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -648,10 +648,9 @@
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         case Div:
</span><del>-        case ChillDiv:
</del><span class="cx">             // Turn this: Div(constant1, constant2)
</span><span class="cx">             // Into this: constant1 / constant2
</span><del>-            // Note that this uses ChillDiv semantics. That's fine, because the rules for Div
</del><ins>+            // Note that this uses Div&lt;Chill&gt; semantics. That's fine, because the rules for Div
</ins><span class="cx">             // are strictly weaker: it has corner cases where it's allowed to do anything it
</span><span class="cx">             // likes.
</span><span class="cx">             if (replaceWithNewValue(m_value-&gt;child(0)-&gt;divConstant(m_proc, m_value-&gt;child(1))))
</span><span class="lines">@@ -737,10 +736,9 @@
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         case Mod:
</span><del>-        case ChillMod:
</del><span class="cx">             // Turn this: Mod(constant1, constant2)
</span><span class="cx">             // Into this: constant1 / constant2
</span><del>-            // Note that this uses ChillMod semantics.
</del><ins>+            // Note that this uses Mod&lt;Chill&gt; semantics.
</ins><span class="cx">             if (replaceWithNewValue(m_value-&gt;child(0)-&gt;modConstant(m_proc, m_value-&gt;child(1))))
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="lines">@@ -774,19 +772,8 @@
</span><span class="cx">                     //                = -2^31 - -2^31
</span><span class="cx">                     //                = 0
</span><span class="cx"> 
</span><del>-                    Opcode divOpcode;
-                    switch (m_value-&gt;opcode()) {
-                    case Mod:
-                        divOpcode = Div;
-                        break;
-                    case ChillMod:
-                        divOpcode = ChillDiv;
-                        break;
-                    default:
-                        divOpcode = Oops;
-                        RELEASE_ASSERT_NOT_REACHED();
-                        break;
-                    }
</del><ins>+                    Kind divKind = Div;
+                    divKind.setIsChill(m_value-&gt;isChill());
</ins><span class="cx"> 
</span><span class="cx">                     replaceWithIdentity(
</span><span class="cx">                         m_insertionSet.insert&lt;Value&gt;(
</span><span class="lines">@@ -795,7 +782,7 @@
</span><span class="cx">                             m_insertionSet.insert&lt;Value&gt;(
</span><span class="cx">                                 m_index, Mul, m_value-&gt;origin(),
</span><span class="cx">                                 m_insertionSet.insert&lt;Value&gt;(
</span><del>-                                    m_index, divOpcode, m_value-&gt;origin(),
</del><ins>+                                    m_index, divKind, m_value-&gt;origin(),
</ins><span class="cx">                                     m_value-&gt;child(0), m_value-&gt;child(1)),
</span><span class="cx">                                 m_value-&gt;child(1))));
</span><span class="cx">                     break;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3SlotBaseValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3SlotBaseValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3SlotBaseValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3SlotBaseValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE SlotBaseValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == SlotBase; }
</del><ins>+    static bool accepts(Kind kind) { return kind == SlotBase; }
</ins><span class="cx"> 
</span><span class="cx">     ~SlotBaseValue();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3StackmapValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3StackmapValue.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3StackmapValue.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3StackmapValue.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -83,10 +83,10 @@
</span><span class="cx">         &quot;, lateClobbered = &quot;, m_lateClobbered, &quot;, usedRegisters = &quot;, m_usedRegisters);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-StackmapValue::StackmapValue(CheckedOpcodeTag, Opcode opcode, Type type, Origin origin)
-    : Value(CheckedOpcode, opcode, type, origin)
</del><ins>+StackmapValue::StackmapValue(CheckedOpcodeTag, Kind kind, Type type, Origin origin)
+    : Value(CheckedOpcode, kind, type, origin)
</ins><span class="cx"> {
</span><del>-    ASSERT(accepts(opcode));
</del><ins>+    ASSERT(accepts(kind));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::B3
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3StackmapValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3StackmapValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3StackmapValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3StackmapValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -43,10 +43,10 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE StackmapValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode)
</del><ins>+    static bool accepts(Kind kind)
</ins><span class="cx">     {
</span><span class="cx">         // This needs to include opcodes of all subclasses.
</span><del>-        switch (opcode) {
</del><ins>+        switch (kind.opcode()) {
</ins><span class="cx">         case CheckAdd:
</span><span class="cx">         case CheckSub:
</span><span class="cx">         case CheckMul:
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx">     void dumpChildren(CommaPrinter&amp;, PrintStream&amp;) const override;
</span><span class="cx">     void dumpMeta(CommaPrinter&amp;, PrintStream&amp;) const override;
</span><span class="cx"> 
</span><del>-    StackmapValue(CheckedOpcodeTag, Opcode, Type, Origin);
</del><ins>+    StackmapValue(CheckedOpcodeTag, Kind, Type, Origin);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class CheckSpecial;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3SwitchValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3SwitchValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3SwitchValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3SwitchValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> class SwitchValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == Switch; }
</del><ins>+    static bool accepts(Kind kind) { return kind == Switch; }
</ins><span class="cx"> 
</span><span class="cx">     ~SwitchValue();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3UpsilonValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE UpsilonValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == Upsilon; }
</del><ins>+    static bool accepts(Kind kind) { return kind == Upsilon; }
</ins><span class="cx"> 
</span><span class="cx">     ~UpsilonValue();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Validatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Validate.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Validate.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3Validate.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -131,44 +131,54 @@
</span><span class="cx">             switch (value-&gt;opcode()) {
</span><span class="cx">             case Nop:
</span><span class="cx">             case Fence:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Identity:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(0)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() != Void, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Const32:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Const64:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int64, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case ConstDouble:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Double, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case ConstFloat:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Float, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Set:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == value-&gt;as&lt;VariableValue&gt;()-&gt;variable()-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Get:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;as&lt;VariableValue&gt;()-&gt;variable()-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case SlotBase:
</span><span class="cx">             case FramePointer:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == pointerType(), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case ArgumentReg:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(
</span><span class="cx">                     (value-&gt;as&lt;ArgumentRegValue&gt;()-&gt;argumentReg().isGPR() ? pointerType() : Double)
</span><span class="lines">@@ -181,6 +191,18 @@
</span><span class="cx">             case Mod:
</span><span class="cx">             case BitAnd:
</span><span class="cx">             case BitXor:
</span><ins>+                switch (value-&gt;opcode()) {
+                case Div:
+                case Mod:
+                    if (value-&gt;isChill()) {
+                        VALIDATE(value-&gt;opcode() == Div || value-&gt;opcode() == Mod, (&quot;At &quot;, *value));
+                        VALIDATE(isInt(value-&gt;type()), (&quot;At &quot;, *value));
+                    }
+                    break;
+                default:
+                    VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
+                    break;
+                }
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(0)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(1)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="lines">@@ -187,13 +209,13 @@
</span><span class="cx">                 VALIDATE(value-&gt;type() != Void, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Neg:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(0)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() != Void, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><del>-            case ChillDiv:
-            case ChillMod:
</del><span class="cx">             case BitOr:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(0)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(1)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="lines">@@ -202,6 +224,7 @@
</span><span class="cx">             case Shl:
</span><span class="cx">             case SShr:
</span><span class="cx">             case ZShr:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(0)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(1)-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="lines">@@ -208,6 +231,7 @@
</span><span class="cx">                 VALIDATE(isInt(value-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case BitwiseCast:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() != value-&gt;child(0)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(
</span><span class="lines">@@ -219,6 +243,7 @@
</span><span class="cx">                 break;
</span><span class="cx">             case SExt8:
</span><span class="cx">             case SExt16:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="lines">@@ -225,16 +250,19 @@
</span><span class="cx">                 break;
</span><span class="cx">             case SExt32:
</span><span class="cx">             case ZExt32:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int64, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Clz:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Trunc:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == Int64, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="lines">@@ -243,26 +271,31 @@
</span><span class="cx">             case Ceil:
</span><span class="cx">             case Floor:
</span><span class="cx">             case Sqrt:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isFloat(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isFloat(value-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case IToD:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Double, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case IToF:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Float, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case FloatToDouble:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == Float, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Double, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case DoubleToFloat:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == Double, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Float, (&quot;At &quot;, *value));
</span><span class="lines">@@ -273,6 +306,7 @@
</span><span class="cx">             case GreaterThan:
</span><span class="cx">             case LessEqual:
</span><span class="cx">             case GreaterEqual:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == value-&gt;child(1)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="lines">@@ -281,6 +315,7 @@
</span><span class="cx">             case Below:
</span><span class="cx">             case AboveEqual:
</span><span class="cx">             case BelowEqual:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == value-&gt;child(1)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="lines">@@ -287,6 +322,7 @@
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case EqualOrUnordered:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == value-&gt;child(1)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isFloat(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="lines">@@ -293,6 +329,7 @@
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Select:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 3, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == value-&gt;child(1)-&gt;type(), (&quot;At &quot;, *value));
</span><span class="lines">@@ -302,6 +339,7 @@
</span><span class="cx">             case Load8S:
</span><span class="cx">             case Load16Z:
</span><span class="cx">             case Load16S:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == pointerType(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="lines">@@ -308,6 +346,7 @@
</span><span class="cx">                 validateStackAccess(value);
</span><span class="cx">                 break;
</span><span class="cx">             case Load:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == pointerType(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() != Void, (&quot;At &quot;, *value));
</span><span class="lines">@@ -315,6 +354,7 @@
</span><span class="cx">                 break;
</span><span class="cx">             case Store8:
</span><span class="cx">             case Store16:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == Int32, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(1)-&gt;type() == pointerType(), (&quot;At &quot;, *value));
</span><span class="lines">@@ -322,6 +362,7 @@
</span><span class="cx">                 validateStackAccess(value);
</span><span class="cx">                 break;
</span><span class="cx">             case Store:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(1)-&gt;type() == pointerType(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="lines">@@ -328,10 +369,12 @@
</span><span class="cx">                 validateStackAccess(value);
</span><span class="cx">                 break;
</span><span class="cx">             case CCall:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() &gt;= 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;child(0)-&gt;type() == pointerType(), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Patchpoint:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 if (value-&gt;type() == Void)
</span><span class="cx">                     VALIDATE(value-&gt;as&lt;PatchpointValue&gt;()-&gt;resultConstraint == ValueRep::WarmAny, (&quot;At &quot;, *value));
</span><span class="cx">                 else {
</span><span class="lines">@@ -354,6 +397,7 @@
</span><span class="cx">             case CheckAdd:
</span><span class="cx">             case CheckSub:
</span><span class="cx">             case CheckMul:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() &gt;= 2, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(1)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="lines">@@ -362,6 +406,7 @@
</span><span class="cx">                 validateStackmap(value);
</span><span class="cx">                 break;
</span><span class="cx">             case Check:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() &gt;= 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;as&lt;StackmapValue&gt;()-&gt;constrainedChild(0).rep() == ValueRep::WarmAny, (&quot;At &quot;, *value));
</span><span class="lines">@@ -368,6 +413,7 @@
</span><span class="cx">                 validateStackmap(value);
</span><span class="cx">                 break;
</span><span class="cx">             case Upsilon:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;as&lt;UpsilonValue&gt;()-&gt;phi(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;as&lt;UpsilonValue&gt;()-&gt;phi()-&gt;opcode() == Phi, (&quot;At &quot;, *value));
</span><span class="lines">@@ -375,25 +421,30 @@
</span><span class="cx">                 VALIDATE(valueInProc.contains(value-&gt;as&lt;UpsilonValue&gt;()-&gt;phi()), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Phi:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() != Void, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Jump:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(valueOwner.get(value)-&gt;numSuccessors() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Oops:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(!valueOwner.get(value)-&gt;numSuccessors(), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Return:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() &lt;= 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(!valueOwner.get(value)-&gt;numSuccessors(), (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Branch:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="lines">@@ -400,6 +451,7 @@
</span><span class="cx">                 VALIDATE(valueOwner.get(value)-&gt;numSuccessors() == 2, (&quot;At &quot;, *value));
</span><span class="cx">                 break;
</span><span class="cx">             case Switch: {
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(value-&gt;numChildren() == 1, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(isInt(value-&gt;child(0)-&gt;type()), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="lines">@@ -417,6 +469,7 @@
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             case EntrySwitch:
</span><ins>+                VALIDATE(!value-&gt;kind().hasExtraBits(), (&quot;At &quot;, *value));
</ins><span class="cx">                 VALIDATE(!value-&gt;numChildren(), (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(value-&gt;type() == Void, (&quot;At &quot;, *value));
</span><span class="cx">                 VALIDATE(valueOwner.get(value)-&gt;numSuccessors() == m_procedure.numEntrypoints(), (&quot;At &quot;, *value));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3Value.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> {
</span><span class="cx">     bool isConstant = false;
</span><span class="cx"> 
</span><del>-    switch (m_opcode) {
</del><ins>+    switch (opcode()) {
</ins><span class="cx">     case Const32:
</span><span class="cx">         out.print(&quot;$&quot;, asInt32(), &quot;(&quot;);
</span><span class="cx">         isConstant = true;
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Value::deepDump(const Procedure* proc, PrintStream&amp; out) const
</span><span class="cx"> {
</span><del>-    out.print(m_type, &quot; &quot;, dumpPrefix, m_index, &quot; = &quot;, m_opcode);
</del><ins>+    out.print(m_type, &quot; &quot;, dumpPrefix, m_index, &quot; = &quot;, m_kind);
</ins><span class="cx"> 
</span><span class="cx">     out.print(&quot;(&quot;);
</span><span class="cx">     CommaPrinter comma;
</span><span class="lines">@@ -437,8 +437,10 @@
</span><span class="cx"> {
</span><span class="cx">     if (!numChildren())
</span><span class="cx">         return nullptr;
</span><del>-    if (Optional&lt;Opcode&gt; invertedOpcode = B3::invertedCompare(opcode(), child(0)-&gt;type()))
</del><ins>+    if (Optional&lt;Opcode&gt; invertedOpcode = B3::invertedCompare(opcode(), child(0)-&gt;type())) {
+        ASSERT(!kind().hasExtraBits());
</ins><span class="cx">         return proc.add&lt;Value&gt;(*invertedOpcode, type(), origin(), children());
</span><ins>+    }
</ins><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -532,8 +534,6 @@
</span><span class="cx">     case Sub:
</span><span class="cx">     case Mul:
</span><span class="cx">     case Neg:
</span><del>-    case ChillDiv:
-    case ChillMod:
</del><span class="cx">     case BitAnd:
</span><span class="cx">     case BitOr:
</span><span class="cx">     case BitXor:
</span><span class="lines">@@ -642,7 +642,7 @@
</span><span class="cx"> {
</span><span class="cx">     switch (opcode()) {
</span><span class="cx">     case FramePointer:
</span><del>-        return ValueKey(opcode(), type());
</del><ins>+        return ValueKey(kind(), type());
</ins><span class="cx">     case Identity:
</span><span class="cx">     case Abs:
</span><span class="cx">     case Ceil:
</span><span class="lines">@@ -661,14 +661,12 @@
</span><span class="cx">     case Check:
</span><span class="cx">     case BitwiseCast:
</span><span class="cx">     case Neg:
</span><del>-        return ValueKey(opcode(), type(), child(0));
</del><ins>+        return ValueKey(kind(), type(), child(0));
</ins><span class="cx">     case Add:
</span><span class="cx">     case Sub:
</span><span class="cx">     case Mul:
</span><span class="cx">     case Div:
</span><span class="cx">     case Mod:
</span><del>-    case ChillDiv:
-    case ChillMod:
</del><span class="cx">     case BitAnd:
</span><span class="cx">     case BitOr:
</span><span class="cx">     case BitXor:
</span><span class="lines">@@ -687,9 +685,9 @@
</span><span class="cx">     case CheckAdd:
</span><span class="cx">     case CheckSub:
</span><span class="cx">     case CheckMul:
</span><del>-        return ValueKey(opcode(), type(), child(0), child(1));
</del><ins>+        return ValueKey(kind(), type(), child(0), child(1));
</ins><span class="cx">     case Select:
</span><del>-        return ValueKey(opcode(), type(), child(0), child(1), child(2));
</del><ins>+        return ValueKey(kind(), type(), child(0), child(1), child(2));
</ins><span class="cx">     case Const32:
</span><span class="cx">         return ValueKey(Const32, type(), static_cast&lt;int64_t&gt;(asInt32()));
</span><span class="cx">     case Const64:
</span><span class="lines">@@ -738,9 +736,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Type Value::typeFor(Opcode opcode, Value* firstChild, Value* secondChild)
</del><ins>+Type Value::typeFor(Kind kind, Value* firstChild, Value* secondChild)
</ins><span class="cx"> {
</span><del>-    switch (opcode) {
</del><ins>+    switch (kind.opcode()) {
</ins><span class="cx">     case Identity:
</span><span class="cx">     case Add:
</span><span class="cx">     case Sub:
</span><span class="lines">@@ -748,8 +746,6 @@
</span><span class="cx">     case Div:
</span><span class="cx">     case Mod:
</span><span class="cx">     case Neg:
</span><del>-    case ChillDiv:
-    case ChillMod:
</del><span class="cx">     case BitAnd:
</span><span class="cx">     case BitOr:
</span><span class="cx">     case BitXor:
</span><span class="lines">@@ -820,9 +816,9 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Value::badOpcode(Opcode opcode, unsigned numArgs)
</del><ins>+void Value::badKind(Kind kind, unsigned numArgs)
</ins><span class="cx"> {
</span><del>-    dataLog(&quot;Bad opcode &quot;, opcode, &quot; with &quot;, numArgs, &quot; args.\n&quot;);
</del><ins>+    dataLog(&quot;Bad kind &quot;, kind, &quot; with &quot;, numArgs, &quot; args.\n&quot;);
</ins><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3Value.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include &quot;AirArg.h&quot;
</span><span class="cx"> #include &quot;B3Effects.h&quot;
</span><span class="cx"> #include &quot;B3FrequentedBlock.h&quot;
</span><del>-#include &quot;B3Opcode.h&quot;
</del><ins>+#include &quot;B3Kind.h&quot;
</ins><span class="cx"> #include &quot;B3Origin.h&quot;
</span><span class="cx"> #include &quot;B3SparseCollection.h&quot;
</span><span class="cx"> #include &quot;B3Type.h&quot;
</span><span class="lines">@@ -54,15 +54,21 @@
</span><span class="cx"> 
</span><span class="cx">     static const char* const dumpPrefix;
</span><span class="cx"> 
</span><del>-    static bool accepts(Opcode) { return true; }
</del><ins>+    static bool accepts(Kind) { return true; }
</ins><span class="cx"> 
</span><span class="cx">     virtual ~Value();
</span><span class="cx"> 
</span><span class="cx">     unsigned index() const { return m_index; }
</span><span class="cx">     
</span><del>-    // Note that the opcode is immutable, except for replacing values with:
</del><ins>+    // Note that the kind is immutable, except for replacing values with:
</ins><span class="cx">     // Identity, Nop, Oops, Jump, and Phi. See below for replaceWithXXX() methods.
</span><del>-    Opcode opcode() const { return m_opcode; }
</del><ins>+    Kind kind() const { return m_kind; }
+    
+    Opcode opcode() const { return kind().opcode(); }
+    
+    // It's good practice to mirror Kind methods here, so you can say value-&gt;isBlah()
+    // instead of value-&gt;kind().isBlah().
+    bool isChill() const { return kind().isChill(); }
</ins><span class="cx"> 
</span><span class="cx">     Origin origin() const { return m_origin; }
</span><span class="cx">     void setOrigin(Origin origin) { m_origin = origin; }
</span><span class="lines">@@ -131,8 +137,8 @@
</span><span class="cx">     //     things
</span><span class="cx">     // }
</span><span class="cx">     //
</span><del>-    // This will return null if this opcode() != ArgumentReg. This works because this returns nullptr
-    // if T::accepts(opcode()) returns false.
</del><ins>+    // This will return null if this kind() != ArgumentReg. This works because this returns nullptr
+    // if T::accepts(kind()) returns false.
</ins><span class="cx">     template&lt;typename T&gt;
</span><span class="cx">     T* as();
</span><span class="cx">     template&lt;typename T&gt;
</span><span class="lines">@@ -141,7 +147,7 @@
</span><span class="cx">     // What follows are a bunch of helpers for inspecting and modifying values. Note that we have a
</span><span class="cx">     // bunch of different idioms for implementing such helpers. You can use virtual methods, and
</span><span class="cx">     // override from the various Value subclasses. You can put the method inside Value and make it
</span><del>-    // non-virtual, and the implementation can switch on opcode. The method could be inline or not.
</del><ins>+    // non-virtual, and the implementation can switch on kind. The method could be inline or not.
</ins><span class="cx">     // If a method is specific to some Value subclass, you could put it in the subclass, or you could
</span><span class="cx">     // put it on Value anyway. It's fine to pick whatever feels right, and we shouldn't restrict
</span><span class="cx">     // ourselves to any particular idiom.
</span><span class="lines">@@ -158,8 +164,8 @@
</span><span class="cx">     virtual Value* checkSubConstant(Procedure&amp;, const Value* other) const;
</span><span class="cx">     virtual Value* checkMulConstant(Procedure&amp;, const Value* other) const;
</span><span class="cx">     virtual Value* checkNegConstant(Procedure&amp;) const;
</span><del>-    virtual Value* divConstant(Procedure&amp;, const Value* other) const; // This chooses ChillDiv semantics for integers.
-    virtual Value* modConstant(Procedure&amp;, const Value* other) const; // This chooses ChillMod semantics.
</del><ins>+    virtual Value* divConstant(Procedure&amp;, const Value* other) const; // This chooses Div&lt;Chill&gt; semantics for integers.
+    virtual Value* modConstant(Procedure&amp;, const Value* other) const; // This chooses Mod&lt;Chill&gt; semantics.
</ins><span class="cx">     virtual Value* bitAndConstant(Procedure&amp;, const Value* other) const;
</span><span class="cx">     virtual Value* bitOrConstant(Procedure&amp;, const Value* other) const;
</span><span class="cx">     virtual Value* bitXorConstant(Procedure&amp;, const Value* other) const;
</span><span class="lines">@@ -273,10 +279,10 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx">     friend class SparseCollection&lt;Value&gt;;
</span><span class="cx"> 
</span><del>-    // Checks that this opcode is valid for use with B3::Value.
-    ALWAYS_INLINE static void checkOpcode(Opcode opcode, unsigned numArgs)
</del><ins>+    // Checks that this kind is valid for use with B3::Value.
+    ALWAYS_INLINE static void checkKind(Kind kind, unsigned numArgs)
</ins><span class="cx">     {
</span><del>-        switch (opcode) {
</del><ins>+        switch (kind.opcode()) {
</ins><span class="cx">         case FramePointer:
</span><span class="cx">         case Nop:
</span><span class="cx">         case Phi:
</span><span class="lines">@@ -284,11 +290,11 @@
</span><span class="cx">         case Oops:
</span><span class="cx">         case EntrySwitch:
</span><span class="cx">             if (UNLIKELY(numArgs))
</span><del>-                badOpcode(opcode, numArgs);
</del><ins>+                badKind(kind, numArgs);
</ins><span class="cx">             break;
</span><span class="cx">         case Return:
</span><span class="cx">             if (UNLIKELY(numArgs &gt; 1))
</span><del>-                badOpcode(opcode, numArgs);
</del><ins>+                badKind(kind, numArgs);
</ins><span class="cx">             break;
</span><span class="cx">         case Identity:
</span><span class="cx">         case Neg:
</span><span class="lines">@@ -309,7 +315,7 @@
</span><span class="cx">         case BitwiseCast:
</span><span class="cx">         case Branch:
</span><span class="cx">             if (UNLIKELY(numArgs != 1))
</span><del>-                badOpcode(opcode, numArgs);
</del><ins>+                badKind(kind, numArgs);
</ins><span class="cx">             break;
</span><span class="cx">         case Add:
</span><span class="cx">         case Sub:
</span><span class="lines">@@ -316,8 +322,6 @@
</span><span class="cx">         case Mul:
</span><span class="cx">         case Div:
</span><span class="cx">         case Mod:
</span><del>-        case ChillDiv:
-        case ChillMod:
</del><span class="cx">         case BitAnd:
</span><span class="cx">         case BitOr:
</span><span class="cx">         case BitXor:
</span><span class="lines">@@ -336,14 +340,14 @@
</span><span class="cx">         case BelowEqual:
</span><span class="cx">         case EqualOrUnordered:
</span><span class="cx">             if (UNLIKELY(numArgs != 2))
</span><del>-                badOpcode(opcode, numArgs);
</del><ins>+                badKind(kind, numArgs);
</ins><span class="cx">             break;
</span><span class="cx">         case Select:
</span><span class="cx">             if (UNLIKELY(numArgs != 3))
</span><del>-                badOpcode(opcode, numArgs);
</del><ins>+                badKind(kind, numArgs);
</ins><span class="cx">             break;
</span><span class="cx">         default:
</span><del>-            badOpcode(opcode, numArgs);
</del><ins>+            badKind(kind, numArgs);
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -357,8 +361,8 @@
</span><span class="cx">     // Instantiate values via Procedure.
</span><span class="cx">     // This form requires specifying the type explicitly:
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-    explicit Value(CheckedOpcodeTag, Opcode opcode, Type type, Origin origin, Value* firstChild, Arguments... arguments)
-        : m_opcode(opcode)
</del><ins>+    explicit Value(CheckedOpcodeTag, Kind kind, Type type, Origin origin, Value* firstChild, Arguments... arguments)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">         , m_origin(origin)
</span><span class="cx">         , m_children{ firstChild, arguments... }
</span><span class="lines">@@ -365,8 +369,8 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     // This form is for specifying the type explicitly when the opcode has no children:
</span><del>-    explicit Value(CheckedOpcodeTag, Opcode opcode, Type type, Origin origin)
-        : m_opcode(opcode)
</del><ins>+    explicit Value(CheckedOpcodeTag, Kind kind, Type type, Origin origin)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">         , m_origin(origin)
</span><span class="cx">     {
</span><span class="lines">@@ -373,9 +377,9 @@
</span><span class="cx">     }
</span><span class="cx">     // This form is for those opcodes that can infer their type from the opcode and first child:
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-    explicit Value(CheckedOpcodeTag, Opcode opcode, Origin origin, Value* firstChild)
-        : m_opcode(opcode)
-        , m_type(typeFor(opcode, firstChild))
</del><ins>+    explicit Value(CheckedOpcodeTag, Kind kind, Origin origin, Value* firstChild)
+        : m_kind(kind)
+        , m_type(typeFor(kind, firstChild))
</ins><span class="cx">         , m_origin(origin)
</span><span class="cx">         , m_children{ firstChild }
</span><span class="cx">     {
</span><span class="lines">@@ -382,9 +386,9 @@
</span><span class="cx">     }
</span><span class="cx">     // This form is for those opcodes that can infer their type from the opcode and first and second child:
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-    explicit Value(CheckedOpcodeTag, Opcode opcode, Origin origin, Value* firstChild, Value* secondChild, Arguments... arguments)
-        : m_opcode(opcode)
-        , m_type(typeFor(opcode, firstChild, secondChild))
</del><ins>+    explicit Value(CheckedOpcodeTag, Kind kind, Origin origin, Value* firstChild, Value* secondChild, Arguments... arguments)
+        : m_kind(kind)
+        , m_type(typeFor(kind, firstChild, secondChild))
</ins><span class="cx">         , m_origin(origin)
</span><span class="cx">         , m_children{ firstChild, secondChild, arguments... }
</span><span class="cx">     {
</span><span class="lines">@@ -391,22 +395,22 @@
</span><span class="cx">     }
</span><span class="cx">     // This form is for those opcodes that can infer their type from the opcode alone, and that don't
</span><span class="cx">     // take any arguments:
</span><del>-    explicit Value(CheckedOpcodeTag, Opcode opcode, Origin origin)
-        : m_opcode(opcode)
-        , m_type(typeFor(opcode, nullptr))
</del><ins>+    explicit Value(CheckedOpcodeTag, Kind kind, Origin origin)
+        : m_kind(kind)
+        , m_type(typeFor(kind, nullptr))
</ins><span class="cx">         , m_origin(origin)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     // Use this form for varargs.
</span><del>-    explicit Value(CheckedOpcodeTag, Opcode opcode, Type type, Origin origin, const AdjacencyList&amp; children)
-        : m_opcode(opcode)
</del><ins>+    explicit Value(CheckedOpcodeTag, Kind kind, Type type, Origin origin, const AdjacencyList&amp; children)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">         , m_origin(origin)
</span><span class="cx">         , m_children(children)
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    explicit Value(CheckedOpcodeTag, Opcode opcode, Type type, Origin origin, AdjacencyList&amp;&amp; children)
-        : m_opcode(opcode)
</del><ins>+    explicit Value(CheckedOpcodeTag, Kind kind, Type type, Origin origin, AdjacencyList&amp;&amp; children)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">         , m_origin(origin)
</span><span class="cx">         , m_children(WTFMove(children))
</span><span class="lines">@@ -416,52 +420,52 @@
</span><span class="cx">     // This is the constructor you end up actually calling, if you're instantiating Value
</span><span class="cx">     // directly.
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-        explicit Value(Opcode opcode, Type type, Origin origin)
-        : Value(CheckedOpcode, opcode, type, origin)
</del><ins>+        explicit Value(Kind kind, Type type, Origin origin)
+        : Value(CheckedOpcode, kind, type, origin)
</ins><span class="cx">     {
</span><del>-        checkOpcode(opcode, 0);
</del><ins>+        checkKind(kind, 0);
</ins><span class="cx">     }
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-        explicit Value(Opcode opcode, Type type, Origin origin, Value* firstChild, Arguments&amp;&amp;... arguments)
-        : Value(CheckedOpcode, opcode, type, origin, firstChild, std::forward&lt;Arguments&gt;(arguments)...)
</del><ins>+        explicit Value(Kind kind, Type type, Origin origin, Value* firstChild, Arguments&amp;&amp;... arguments)
+        : Value(CheckedOpcode, kind, type, origin, firstChild, std::forward&lt;Arguments&gt;(arguments)...)
</ins><span class="cx">     {
</span><del>-        checkOpcode(opcode, 1 + sizeof...(arguments));
</del><ins>+        checkKind(kind, 1 + sizeof...(arguments));
</ins><span class="cx">     }
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-        explicit Value(Opcode opcode, Type type, Origin origin, const AdjacencyList&amp; children)
-        : Value(CheckedOpcode, opcode, type, origin, children)
</del><ins>+        explicit Value(Kind kind, Type type, Origin origin, const AdjacencyList&amp; children)
+        : Value(CheckedOpcode, kind, type, origin, children)
</ins><span class="cx">     {
</span><del>-        checkOpcode(opcode, children.size());
</del><ins>+        checkKind(kind, children.size());
</ins><span class="cx">     }
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-        explicit Value(Opcode opcode, Type type, Origin origin, AdjacencyList&amp;&amp; children)
-        : Value(CheckedOpcode, opcode, type, origin, WTFMove(children))
</del><ins>+        explicit Value(Kind kind, Type type, Origin origin, AdjacencyList&amp;&amp; children)
+        : Value(CheckedOpcode, kind, type, origin, WTFMove(children))
</ins><span class="cx">     {
</span><del>-        checkOpcode(opcode, m_children.size());
</del><ins>+        checkKind(kind, m_children.size());
</ins><span class="cx">     }
</span><span class="cx">     template&lt;typename... Arguments&gt;
</span><del>-        explicit Value(Opcode opcode, Origin origin, Arguments&amp;&amp;... arguments)
-        : Value(CheckedOpcode, opcode, origin, std::forward&lt;Arguments&gt;(arguments)...)
</del><ins>+        explicit Value(Kind kind, Origin origin, Arguments&amp;&amp;... arguments)
+        : Value(CheckedOpcode, kind, origin, std::forward&lt;Arguments&gt;(arguments)...)
</ins><span class="cx">     {
</span><del>-        checkOpcode(opcode, sizeof...(arguments));
</del><ins>+        checkKind(kind, sizeof...(arguments));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    friend class CheckValue; // CheckValue::convertToAdd() modifies m_opcode.
</del><ins>+    friend class CheckValue; // CheckValue::convertToAdd() modifies m_kind.
</ins><span class="cx">     
</span><del>-    static Type typeFor(Opcode, Value* firstChild, Value* secondChild = nullptr);
</del><ins>+    static Type typeFor(Kind, Value* firstChild, Value* secondChild = nullptr);
</ins><span class="cx"> 
</span><span class="cx">     // This group of fields is arranged to fit in 64 bits.
</span><span class="cx"> protected:
</span><span class="cx">     unsigned m_index { UINT_MAX };
</span><span class="cx"> private:
</span><del>-    Opcode m_opcode;
</del><ins>+    Kind m_kind;
</ins><span class="cx">     Type m_type;
</span><span class="cx">     
</span><span class="cx">     Origin m_origin;
</span><span class="cx">     AdjacencyList m_children;
</span><span class="cx"> 
</span><del>-    JS_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH static void badOpcode(Opcode, unsigned);
</del><ins>+    JS_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH static void badKind(Kind, unsigned);
</ins><span class="cx"> 
</span><span class="cx"> public:
</span><span class="cx">     BasicBlock* owner { nullptr }; // computed by Procedure::resetValueOwners().
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ValueInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ValueInlines.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ValueInlines.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ValueInlines.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> template&lt;typename T&gt;
</span><span class="cx"> inline T* Value::as()
</span><span class="cx"> {
</span><del>-    if (T::accepts(opcode()))
</del><ins>+    if (T::accepts(kind()))
</ins><span class="cx">         return static_cast&lt;T*&gt;(this);
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ValueKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ValueKey.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ValueKey.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ValueKey.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ValueKey::dump(PrintStream&amp; out) const
</span><span class="cx"> {
</span><del>-    out.print(m_type, &quot; &quot;, m_opcode, &quot;(&quot;, u.indices[0], &quot;, &quot;, u.indices[1], &quot;, &quot;, u.indices[2], &quot;)&quot;);
</del><ins>+    out.print(m_type, &quot; &quot;, m_kind, &quot;(&quot;, u.indices[0], &quot;, &quot;, u.indices[1], &quot;, &quot;, u.indices[2], &quot;)&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Value* ValueKey::materialize(Procedure&amp; proc, Origin origin) const
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> {
</span><span class="cx">     switch (opcode()) {
</span><span class="cx">     case FramePointer:
</span><del>-        return proc.add&lt;Value&gt;(opcode(), type(), origin);
</del><ins>+        return proc.add&lt;Value&gt;(kind(), type(), origin);
</ins><span class="cx">     case Identity:
</span><span class="cx">     case Sqrt:
</span><span class="cx">     case SExt8:
</span><span class="lines">@@ -72,11 +72,10 @@
</span><span class="cx">     case FloatToDouble:
</span><span class="cx">     case DoubleToFloat:
</span><span class="cx">     case Check:
</span><del>-        return proc.add&lt;Value&gt;(opcode(), type(), origin, child(proc, 0));
</del><ins>+        return proc.add&lt;Value&gt;(kind(), type(), origin, child(proc, 0));
</ins><span class="cx">     case Add:
</span><span class="cx">     case Sub:
</span><span class="cx">     case Mul:
</span><del>-    case ChillDiv:
</del><span class="cx">     case Mod:
</span><span class="cx">     case BitAnd:
</span><span class="cx">     case BitOr:
</span><span class="lines">@@ -93,9 +92,9 @@
</span><span class="cx">     case AboveEqual:
</span><span class="cx">     case BelowEqual:
</span><span class="cx">     case Div:
</span><del>-        return proc.add&lt;Value&gt;(opcode(), type(), origin, child(proc, 0), child(proc, 1));
</del><ins>+        return proc.add&lt;Value&gt;(kind(), type(), origin, child(proc, 0), child(proc, 1));
</ins><span class="cx">     case Select:
</span><del>-        return proc.add&lt;Value&gt;(opcode(), type(), origin, child(proc, 0), child(proc, 1), child(proc, 2));
</del><ins>+        return proc.add&lt;Value&gt;(kind(), type(), origin, child(proc, 0), child(proc, 1), child(proc, 2));
</ins><span class="cx">     case Const32:
</span><span class="cx">         return proc.add&lt;Const32Value&gt;(origin, static_cast&lt;int32_t&gt;(value()));
</span><span class="cx">     case Const64:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ValueKeyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ValueKey.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ValueKey.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ValueKey.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #if ENABLE(B3_JIT)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;B3HeapRange.h&quot;
</span><del>-#include &quot;B3Opcode.h&quot;
</del><ins>+#include &quot;B3Kind.h&quot;
</ins><span class="cx"> #include &quot;B3Origin.h&quot;
</span><span class="cx"> #include &quot;B3Type.h&quot;
</span><span class="cx"> #include &lt;wtf/HashTable.h&gt;
</span><span class="lines">@@ -50,34 +50,34 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ValueKey(Opcode opcode, Type type)
-        : m_opcode(opcode)
</del><ins>+    ValueKey(Kind kind, Type type)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ValueKey(Opcode, Type, Value* child);
</del><ins>+    ValueKey(Kind, Type, Value* child);
</ins><span class="cx"> 
</span><del>-    ValueKey(Opcode, Type, Value* left, Value* right);
</del><ins>+    ValueKey(Kind, Type, Value* left, Value* right);
</ins><span class="cx"> 
</span><del>-    ValueKey(Opcode, Type, Value* a, Value* b, Value* c);
</del><ins>+    ValueKey(Kind, Type, Value* a, Value* b, Value* c);
</ins><span class="cx"> 
</span><del>-    ValueKey(Opcode opcode, Type type, int64_t value)
-        : m_opcode(opcode)
</del><ins>+    ValueKey(Kind kind, Type type, int64_t value)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">     {
</span><span class="cx">         u.value = value;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ValueKey(Opcode opcode, Type type, double value)
-        : m_opcode(opcode)
</del><ins>+    ValueKey(Kind kind, Type type, double value)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">     {
</span><span class="cx">         u.doubleValue = value;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ValueKey(Opcode opcode, Type type, float value)
-        : m_opcode(opcode)
</del><ins>+    ValueKey(Kind kind, Type type, float value)
+        : m_kind(kind)
</ins><span class="cx">         , m_type(type)
</span><span class="cx">     {
</span><span class="cx">         u.floatValue = value;
</span><span class="lines">@@ -85,7 +85,8 @@
</span><span class="cx"> 
</span><span class="cx">     static ValueKey intConstant(Type type, int64_t value);
</span><span class="cx"> 
</span><del>-    Opcode opcode() const { return m_opcode; }
</del><ins>+    Kind kind() const { return m_kind; }
+    Opcode opcode() const { return kind().opcode(); }
</ins><span class="cx">     Type type() const { return m_type; }
</span><span class="cx">     unsigned childIndex(unsigned index) const { return u.indices[index]; }
</span><span class="cx">     Value* child(Procedure&amp;, unsigned index) const;
</span><span class="lines">@@ -95,7 +96,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool operator==(const ValueKey&amp; other) const
</span><span class="cx">     {
</span><del>-        return m_opcode == other.m_opcode
</del><ins>+        return m_kind == other.m_kind
</ins><span class="cx">             &amp;&amp; m_type == other.m_type
</span><span class="cx">             &amp;&amp; u == other.u;
</span><span class="cx">     }
</span><span class="lines">@@ -107,7 +108,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned hash() const
</span><span class="cx">     {
</span><del>-        return m_opcode + m_type + WTF::IntHash&lt;int32_t&gt;::hash(u.indices[0]) + u.indices[1] + u.indices[2];
</del><ins>+        return m_kind.hash() + m_type + WTF::IntHash&lt;int32_t&gt;::hash(u.indices[0]) + u.indices[1] + u.indices[2];
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     explicit operator bool() const { return *this != ValueKey(); }
</span><span class="lines">@@ -149,7 +150,7 @@
</span><span class="cx">     }
</span><span class="cx">         
</span><span class="cx"> private:
</span><del>-    Opcode m_opcode { Oops };
</del><ins>+    Kind m_kind;
</ins><span class="cx">     Type m_type { Void };
</span><span class="cx">     union U {
</span><span class="cx">         unsigned indices[3];
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ValueKeyInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ValueKeyInlines.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ValueKeyInlines.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3ValueKeyInlines.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -33,15 +33,15 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><del>-inline ValueKey::ValueKey(Opcode opcode, Type type, Value* child)
-    : m_opcode(opcode)
</del><ins>+inline ValueKey::ValueKey(Kind kind, Type type, Value* child)
+    : m_kind(kind)
</ins><span class="cx">     , m_type(type)
</span><span class="cx"> {
</span><span class="cx">     u.indices[0] = child-&gt;index();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline ValueKey::ValueKey(Opcode opcode, Type type, Value* left, Value* right)
-    : m_opcode(opcode)
</del><ins>+inline ValueKey::ValueKey(Kind kind, Type type, Value* left, Value* right)
+    : m_kind(kind)
</ins><span class="cx">     , m_type(type)
</span><span class="cx"> {
</span><span class="cx">     u.indices[0] = left-&gt;index();
</span><span class="lines">@@ -48,8 +48,8 @@
</span><span class="cx">     u.indices[1] = right-&gt;index();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline ValueKey::ValueKey(Opcode opcode, Type type, Value* a, Value* b, Value* c)
-    : m_opcode(opcode)
</del><ins>+inline ValueKey::ValueKey(Kind kind, Type type, Value* a, Value* b, Value* c)
+    : m_kind(kind)
</ins><span class="cx">     , m_type(type)
</span><span class="cx"> {
</span><span class="cx">     u.indices[0] = a-&gt;index();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3VariableValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3VariableValue.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3VariableValue.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3VariableValue.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -46,18 +46,18 @@
</span><span class="cx">     return new VariableValue(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-VariableValue::VariableValue(Opcode opcode, Origin origin, Variable* variable, Value* value)
-    : Value(CheckedOpcode, opcode, Void, origin, value)
</del><ins>+VariableValue::VariableValue(Kind kind, Origin origin, Variable* variable, Value* value)
+    : Value(CheckedOpcode, kind, Void, origin, value)
</ins><span class="cx">     , m_variable(variable)
</span><span class="cx"> {
</span><del>-    ASSERT(opcode == Set);
</del><ins>+    ASSERT(kind == Set);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-VariableValue::VariableValue(Opcode opcode, Origin origin, Variable* variable)
-    : Value(CheckedOpcode, opcode, variable-&gt;type(), origin)
</del><ins>+VariableValue::VariableValue(Kind kind, Origin origin, Variable* variable)
+    : Value(CheckedOpcode, kind, variable-&gt;type(), origin)
</ins><span class="cx">     , m_variable(variable)
</span><span class="cx"> {
</span><del>-    ASSERT(opcode == Get);
</del><ins>+    ASSERT(kind == Get);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::B3
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3VariableValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3VariableValue.h (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3VariableValue.h        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/B3VariableValue.h        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE VariableValue : public Value {
</span><span class="cx"> public:
</span><del>-    static bool accepts(Opcode opcode) { return opcode == Get || opcode == Set; }
</del><ins>+    static bool accepts(Kind kind) { return kind == Get || kind == Set; }
</ins><span class="cx"> 
</span><span class="cx">     ~VariableValue();
</span><span class="cx"> 
</span><span class="lines">@@ -50,10 +50,10 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><span class="cx">     // Use this for Set.
</span><del>-    VariableValue(Opcode, Origin, Variable*, Value*);
</del><ins>+    VariableValue(Kind, Origin, Variable*, Value*);
</ins><span class="cx"> 
</span><span class="cx">     // Use this for Get.
</span><del>-    VariableValue(Opcode, Origin, Variable*);
</del><ins>+    VariableValue(Kind, Origin, Variable*);
</ins><span class="cx"> 
</span><span class="cx">     Variable* m_variable;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3testb3cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/testb3.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/testb3.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/b3/testb3.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -9976,7 +9976,7 @@
</span><span class="cx">         root-&gt;appendNewControlValue(
</span><span class="cx">             proc, Return, Origin(),
</span><span class="cx">             root-&gt;appendNew&lt;Value&gt;(
</span><del>-                proc, ChillDiv, Origin(),
</del><ins>+                proc, chill(Div), Origin(),
</ins><span class="cx">                 root-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">                     proc, Trunc, Origin(),
</span><span class="cx">                     root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR0)),
</span><span class="lines">@@ -9995,7 +9995,7 @@
</span><span class="cx">         root-&gt;appendNewControlValue(
</span><span class="cx">             proc, Return, Origin(),
</span><span class="cx">             root-&gt;appendNew&lt;Value&gt;(
</span><del>-                proc, ChillDiv, Origin(),
</del><ins>+                proc, chill(Div), Origin(),
</ins><span class="cx">                 root-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), num),
</span><span class="cx">                 root-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), den)));
</span><span class="cx">         
</span><span class="lines">@@ -10013,7 +10013,7 @@
</span><span class="cx">         root-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">             proc, Add, Origin(),
</span><span class="cx">             root-&gt;appendNew&lt;Value&gt;(
</span><del>-                proc, ChillDiv, Origin(),
</del><ins>+                proc, chill(Div), Origin(),
</ins><span class="cx">                 root-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">                     proc, Trunc, Origin(),
</span><span class="cx">                     root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR0)),
</span><span class="lines">@@ -10021,7 +10021,7 @@
</span><span class="cx">                     proc, Trunc, Origin(),
</span><span class="cx">                     root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR1))),
</span><span class="cx">             root-&gt;appendNew&lt;Value&gt;(
</span><del>-                proc, ChillDiv, Origin(),
</del><ins>+                proc, chill(Div), Origin(),
</ins><span class="cx">                 root-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">                     proc, Trunc, Origin(),
</span><span class="cx">                     root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR2)),
</span><span class="lines">@@ -10045,7 +10045,7 @@
</span><span class="cx">         root-&gt;appendNewControlValue(
</span><span class="cx">             proc, Return, Origin(),
</span><span class="cx">             root-&gt;appendNew&lt;Value&gt;(
</span><del>-                proc, ChillDiv, Origin(),
</del><ins>+                proc, chill(Div), Origin(),
</ins><span class="cx">                 root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR0),
</span><span class="cx">                 root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR1)));
</span><span class="cx">         
</span><span class="lines">@@ -10060,7 +10060,7 @@
</span><span class="cx">         root-&gt;appendNewControlValue(
</span><span class="cx">             proc, Return, Origin(),
</span><span class="cx">             root-&gt;appendNew&lt;Value&gt;(
</span><del>-                proc, ChillDiv, Origin(),
</del><ins>+                proc, chill(Div), Origin(),
</ins><span class="cx">                 root-&gt;appendNew&lt;Const64Value&gt;(proc, Origin(), num),
</span><span class="cx">                 root-&gt;appendNew&lt;Const64Value&gt;(proc, Origin(), den)));
</span><span class="cx">         
</span><span class="lines">@@ -10179,7 +10179,7 @@
</span><span class="cx">     BasicBlock* root = proc.addBlock();
</span><span class="cx"> 
</span><span class="cx">     Value* argument = root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR0);
</span><del>-    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, ChillMod, Origin(), argument, argument);
</del><ins>+    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, chill(Mod), Origin(), argument, argument);
</ins><span class="cx">     root-&gt;appendNewControlValue(proc, Return, Origin(), result);
</span><span class="cx"> 
</span><span class="cx">     CHECK(!compileAndRun&lt;int64_t&gt;(proc, value));
</span><span class="lines">@@ -10192,7 +10192,7 @@
</span><span class="cx"> 
</span><span class="cx">     Value* argument1 = root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR0);
</span><span class="cx">     Value* argument2 = root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR1);
</span><del>-    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, ChillMod, Origin(), argument1, argument2);
</del><ins>+    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, chill(Mod), Origin(), argument1, argument2);
</ins><span class="cx">     root-&gt;appendNewControlValue(proc, Return, Origin(), result);
</span><span class="cx"> 
</span><span class="cx">     CHECK(compileAndRun&lt;int64_t&gt;(proc, numerator, denominator) == chillMod(numerator, denominator));
</span><span class="lines">@@ -10205,7 +10205,7 @@
</span><span class="cx"> 
</span><span class="cx">     Value* argument1 = root-&gt;appendNew&lt;Const64Value&gt;(proc, Origin(), numerator);
</span><span class="cx">     Value* argument2 = root-&gt;appendNew&lt;Const64Value&gt;(proc, Origin(), denominator);
</span><del>-    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, ChillMod, Origin(), argument1, argument2);
</del><ins>+    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, chill(Mod), Origin(), argument1, argument2);
</ins><span class="cx">     root-&gt;appendNewControlValue(proc, Return, Origin(), result);
</span><span class="cx"> 
</span><span class="cx">     CHECK(compileAndRun&lt;int64_t&gt;(proc, numerator, denominator) == chillMod(numerator, denominator));
</span><span class="lines">@@ -10218,7 +10218,7 @@
</span><span class="cx"> 
</span><span class="cx">     Value* argument = root-&gt;appendNew&lt;Value&gt;(proc, Trunc, Origin(),
</span><span class="cx">         root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR0));
</span><del>-    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, ChillMod, Origin(), argument, argument);
</del><ins>+    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, chill(Mod), Origin(), argument, argument);
</ins><span class="cx">     root-&gt;appendNewControlValue(proc, Return, Origin(), result);
</span><span class="cx"> 
</span><span class="cx">     CHECK(!compileAndRun&lt;int32_t&gt;(proc, value));
</span><span class="lines">@@ -10233,7 +10233,7 @@
</span><span class="cx">         root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR0));
</span><span class="cx">     Value* argument2 = root-&gt;appendNew&lt;Value&gt;(proc, Trunc, Origin(),
</span><span class="cx">         root-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR1));
</span><del>-    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, ChillMod, Origin(), argument1, argument2);
</del><ins>+    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, chill(Mod), Origin(), argument1, argument2);
</ins><span class="cx">     root-&gt;appendNewControlValue(proc, Return, Origin(), result);
</span><span class="cx"> 
</span><span class="cx">     CHECK(compileAndRun&lt;int32_t&gt;(proc, numerator, denominator) == chillMod(numerator, denominator));
</span><span class="lines">@@ -10246,7 +10246,7 @@
</span><span class="cx"> 
</span><span class="cx">     Value* argument1 = root-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), numerator);
</span><span class="cx">     Value* argument2 = root-&gt;appendNew&lt;Const32Value&gt;(proc, Origin(), denominator);
</span><del>-    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, ChillMod, Origin(), argument1, argument2);
</del><ins>+    Value* result = root-&gt;appendNew&lt;Value&gt;(proc, chill(Mod), Origin(), argument1, argument2);
</ins><span class="cx">     root-&gt;appendNewControlValue(proc, Return, Origin(), result);
</span><span class="cx"> 
</span><span class="cx">     CHECK(compileAndRun&lt;int32_t&gt;(proc, numerator, denominator) == chillMod(numerator, denominator));
</span><span class="lines">@@ -10313,7 +10313,7 @@
</span><span class="cx">         newBlock-&gt;appendNewControlValue(
</span><span class="cx">             proc, Return, Origin(),
</span><span class="cx">             newBlock-&gt;appendNew&lt;Value&gt;(
</span><del>-                proc, ChillDiv, Origin(), (i &amp; 1) ? right : left, (i &amp; 1) ? left : right));
</del><ins>+                proc, chill(Div), Origin(), (i &amp; 1) ? right : left, (i &amp; 1) ? left : right));
</ins><span class="cx">         
</span><span class="cx">         switchValue-&gt;appendCase(SwitchCase(gap * i, FrequentedBlock(newBlock)));
</span><span class="cx">     }
</span><span class="lines">@@ -12674,7 +12674,7 @@
</span><span class="cx">     end-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">         proc, Return, Origin(),
</span><span class="cx">         end-&gt;appendNew&lt;Value&gt;(
</span><del>-            proc, ChillMod, Origin(),
</del><ins>+            proc, chill(Mod), Origin(),
</ins><span class="cx">             phi, end-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">                 proc, Trunc, Origin(),
</span><span class="cx">                 end-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR2))));
</span><span class="lines">@@ -12791,7 +12791,7 @@
</span><span class="cx">     end-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">         proc, Return, Origin(),
</span><span class="cx">         end-&gt;appendNew&lt;Value&gt;(
</span><del>-            proc, ChillMod, Origin(),
</del><ins>+            proc, chill(Mod), Origin(),
</ins><span class="cx">             phi, end-&gt;appendNew&lt;Value&gt;(
</span><span class="cx">                 proc, Trunc, Origin(),
</span><span class="cx">                 end-&gt;appendNew&lt;ArgumentRegValue&gt;(proc, Origin(), GPRInfo::argumentGPR2))));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOutputcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOutput.cpp (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOutput.cpp        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Source/JavaScriptCore/ftl/FTLOutput.cpp        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx"> 
</span><span class="cx"> LValue Output::chillDiv(LValue left, LValue right)
</span><span class="cx"> {
</span><del>-    return m_block-&gt;appendNew&lt;B3::Value&gt;(m_proc, B3::ChillDiv, origin(), left, right);
</del><ins>+    return m_block-&gt;appendNew&lt;B3::Value&gt;(m_proc, chill(B3::Div), origin(), left, right);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LValue Output::mod(LValue left, LValue right)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> 
</span><span class="cx"> LValue Output::chillMod(LValue left, LValue right)
</span><span class="cx"> {
</span><del>-    return m_block-&gt;appendNew&lt;B3::Value&gt;(m_proc, B3::ChillMod, origin(), left, right);
</del><ins>+    return m_block-&gt;appendNew&lt;B3::Value&gt;(m_proc, chill(B3::Mod), origin(), left, right);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LValue Output::neg(LValue value)
</span></span></pre></div>
<a id="trunkWebsiteswebkitorgChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Websites/webkit.org/ChangeLog (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/ChangeLog        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Websites/webkit.org/ChangeLog        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-09-28  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        B3 opcodes should leave room for flags
+        https://bugs.webkit.org/show_bug.cgi?id=162692
+
+        Reviewed by Keith Miller.
+        
+        Updated the documentation to talk about Kind and the isChill bit, and to remove
+        ChillDiv/ChillMod.
+
+        * docs/b3/intermediate-representation.html:
+
</ins><span class="cx"> 2016-09-27  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update style guide for #pragma once
</span></span></pre></div>
<a id="trunkWebsiteswebkitorgdocsb3intermediaterepresentationhtml"></a>
<div class="modfile"><h4>Modified: trunk/Websites/webkit.org/docs/b3/intermediate-representation.html (206594 => 206595)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Websites/webkit.org/docs/b3/intermediate-representation.html        2016-09-29 18:44:14 UTC (rev 206594)
+++ trunk/Websites/webkit.org/docs/b3/intermediate-representation.html        2016-09-29 18:44:53 UTC (rev 206595)
</span><span class="lines">@@ -78,9 +78,14 @@
</span><span class="cx">     &lt;h2&gt;Values&lt;/h2&gt;
</span><span class="cx"> 
</span><span class="cx">     &lt;p&gt;Variables, and the instructions that define them, are represented using the Value object.
</span><del>-      The Value object has a return type, an opcode, and zero or more children.  Children are
</del><ins>+      The Value object has a return type, a kind, and zero or more children.  Children are
</ins><span class="cx">       references to other Values.  Those values are used as input to the instruction that
</span><span class="cx">       computes this value.&lt;/p&gt;
</span><ins>+    
+    &lt;p&gt;The value kind is a combination of an opcode and optional flags. The flags allow a single
+      opcode to have many variants. For example, Div and Mod may have the Chill flag set to indicate
+      that they should not trap on corner cases.&lt;/p&gt;
+    
</ins><span class="cx">     &lt;p&gt;Values also have a unique 32-bit index that is used as the name.&lt;/p&gt;
</span><span class="cx">     
</span><span class="cx">     &lt;p&gt;Example:&lt;/p&gt;
</span><span class="lines">@@ -231,14 +236,30 @@
</span><span class="cx">         according to the IEEE 854 spec.&lt;/dd&gt;
</span><span class="cx"> 
</span><span class="cx">       &lt;dt&gt;T Div(T, T)&lt;/dt&gt;
</span><del>-      &lt;dd&gt;Works with any type except Void.  For integer types, this represents signed division
-        with round-to-zero.  Its behavior is undefined for x/0 or -2&lt;sup&gt;31&lt;/sup&gt;/-1.  For floating
-        point types, this represents division according to the IEEE 854 spec.&lt;/dd&gt;
</del><ins>+      &lt;dd&gt;
+        &lt;p&gt;Works with any type except Void.  For integer types, this represents signed
+          division with round-to-zero.  By default, its behavior is undefined for x/0 or
+          -2&lt;sup&gt;31&lt;/sup&gt;/-1.  For floating point types, this represents division according
+          to the IEEE 854 spec.&lt;/p&gt;
+        &lt;p&gt;Integer Div may have the Chill flag set. You can create a Chill Div by saying
+          &lt;code&gt;chill(Div)&lt;/code&gt; instead of &lt;code&gt;Div&lt;/code&gt;; the former creates a Kind
+          that has Div as the opcode and has the Chill bit set. An operation is said to be
+          chill if it returns a sensible value whenever its non-chill form would have had
+          undefined behavior. Chill Div turns x/0 into 0 and -2&lt;sup&gt;31&lt;/sup&gt;/-1 into
+          -2&lt;sup&gt;31&lt;/sup&gt;. We recognize this in IR because it's exactly the semantics of
+          division on ARM64, and it's also exactly the semantics that JavaScript wants for
+          &quot;(x/y)|0&quot;.&lt;/p&gt;
+      &lt;/dd&gt;
</ins><span class="cx"> 
</span><span class="cx">       &lt;dt&gt;T Mod(T, T)&lt;/dt&gt;
</span><del>-      &lt;dd&gt;Works with any type except Void.  For integer types, this represents signed modulo.
-        Its behavior is undefined for x%0 or -2&lt;sup&gt;31&lt;/sup&gt;%-1.  For floating point types, this
-        represents modulo according to &quot;fmod()&quot;.&lt;/dd&gt;
</del><ins>+      &lt;dd&gt;
+        &lt;p&gt;Works with any type except Void.  For integer types, this represents signed
+          modulo. By default, its behavior is undefined for x%0 or -2&lt;sup&gt;31&lt;/sup&gt;%-1.  For
+          floating point types, this represents modulo according to &quot;fmod()&quot;.&lt;/p&gt;
+        &lt;p&gt;Integer Mod may have the Chill flag set. You can create a Chill Mod by saying
+          &lt;code&gt;chill(Mod)&lt;/code&gt;. Chill Mod turns x%0 into 0 and -2&lt;sup&gt;31&lt;/sup&gt;%-1 into
+          0.&lt;/p&gt;
+      &lt;/dd&gt;
</ins><span class="cx"> 
</span><span class="cx">       &lt;dt&gt;T Neg(T)&lt;/dt&gt;
</span><span class="cx">       &lt;dd&gt;Works with any type except Void.  For integer types, this represents twos-complement
</span><span class="lines">@@ -245,17 +266,6 @@
</span><span class="cx">         negation.  For floating point types, this represents negation according to the IEEE
</span><span class="cx">         spec.&lt;/dd&gt;
</span><span class="cx"> 
</span><del>-      &lt;dt&gt;T ChillDiv(T, T)&lt;/dt&gt;
-      &lt;dd&gt;Chill division.  Valid for Int32 and Int64.  An operation is said to be chill if it
-        returns a sensible value whenever its non-chill form would have had undefined behavior.
-        ChillDiv turns x/0 into 0 and -2&lt;sup&gt;31&lt;/sup&gt;/-1 into -2&lt;sup&gt;31&lt;/sup&gt;.  This is a separate opcode
-        because it's exactly the semantics of division on ARM64, and it's also exactly the
-        semantics that JavaScript wants for &quot;(x/y)|0&quot;.&lt;/dd&gt;
-
-      &lt;dt&gt;T ChillMod(T, T)&lt;/dt&gt;
-      &lt;dd&gt;Chill modulo.  Valid for Int32 and Int64.  ChllMod turns x%0 into 0 and
-        -2&lt;sup&gt;31&lt;/sup&gt;%-1 into 0.&lt;/dd&gt;
-
</del><span class="cx">       &lt;dt&gt;T BitAnd(T, T)&lt;/dt&gt;
</span><span class="cx">       &lt;dd&gt;Bitwise and.  Valid for Int32 and Int64.&lt;/dd&gt;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>