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

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

<h3>Log Message</h3>
<pre>B3::Values that have effects should allow specification of custom HeapRanges
https://bugs.webkit.org/show_bug.cgi?id=150535

Reviewed by Benjamin Poulain.

Add a Effects field to calls and patchpoints. Add a HeapRange to MemoryValues.

In the process, I created a class for the CCall opcode, so that it has somewhere to put
the Effects field.

While doing this, I realized that we didn't have a good way of ensuring that an opcode
that requires a specific subclass was actually created with that subclass. So, I added
assertions for this.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3ArgumentRegValue.h:
* b3/B3CCallValue.cpp: Added.
* b3/B3CCallValue.h: Added.
* b3/B3CheckValue.h:
* b3/B3Const32Value.h:
* b3/B3Const64Value.h:
* b3/B3ConstDoubleValue.h:
(JSC::B3::ConstDoubleValue::ConstDoubleValue):
* b3/B3ControlValue.h:
* b3/B3Effects.h:
(JSC::B3::Effects::forCall):
(JSC::B3::Effects::mustExecute):
* b3/B3MemoryValue.h:
* b3/B3PatchpointValue.h:
* b3/B3StackSlotValue.h:
* b3/B3UpsilonValue.h:
* b3/B3Value.cpp:
(JSC::B3::Value::effects):
(JSC::B3::Value::dumpMeta):
(JSC::B3::Value::checkOpcode):
(JSC::B3::Value::typeFor):
* b3/B3Value.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3ArgumentRegValueh">trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3CheckValuecpp">trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp</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="#trunkSourceJavaScriptCoreb3B3ControlValueh">trunk/Source/JavaScriptCore/b3/B3ControlValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Effectsh">trunk/Source/JavaScriptCore/b3/B3Effects.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3MemoryValueh">trunk/Source/JavaScriptCore/b3/B3MemoryValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3PatchpointValuecpp">trunk/Source/JavaScriptCore/b3/B3PatchpointValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3PatchpointValueh">trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3StackSlotValueh">trunk/Source/JavaScriptCore/b3/B3StackSlotValue.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="#trunkSourceJavaScriptCoreb3B3UpsilonValueh">trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Valuecpp">trunk/Source/JavaScriptCore/b3/B3Value.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3Valueh">trunk/Source/JavaScriptCore/b3/B3Value.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreb3B3CCallValuecpp">trunk/Source/JavaScriptCore/b3/B3CCallValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreb3B3CCallValueh">trunk/Source/JavaScriptCore/b3/B3CCallValue.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2015-11-03  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        B3::Values that have effects should allow specification of custom HeapRanges
+        https://bugs.webkit.org/show_bug.cgi?id=150535
+
+        Reviewed by Benjamin Poulain.
+
+        Add a Effects field to calls and patchpoints. Add a HeapRange to MemoryValues.
+
+        In the process, I created a class for the CCall opcode, so that it has somewhere to put
+        the Effects field.
+
+        While doing this, I realized that we didn't have a good way of ensuring that an opcode
+        that requires a specific subclass was actually created with that subclass. So, I added
+        assertions for this.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * b3/B3ArgumentRegValue.h:
+        * b3/B3CCallValue.cpp: Added.
+        * b3/B3CCallValue.h: Added.
+        * b3/B3CheckValue.h:
+        * b3/B3Const32Value.h:
+        * b3/B3Const64Value.h:
+        * b3/B3ConstDoubleValue.h:
+        (JSC::B3::ConstDoubleValue::ConstDoubleValue):
+        * b3/B3ControlValue.h:
+        * b3/B3Effects.h:
+        (JSC::B3::Effects::forCall):
+        (JSC::B3::Effects::mustExecute):
+        * b3/B3MemoryValue.h:
+        * b3/B3PatchpointValue.h:
+        * b3/B3StackSlotValue.h:
+        * b3/B3UpsilonValue.h:
+        * b3/B3Value.cpp:
+        (JSC::B3::Value::effects):
+        (JSC::B3::Value::dumpMeta):
+        (JSC::B3::Value::checkOpcode):
+        (JSC::B3::Value::typeFor):
+        * b3/B3Value.h:
+
+2015-11-03  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
</ins><span class="cx">         B3::Stackmap should be a superclass of B3::PatchpointValue and B3::CheckValue rather than being one of their members
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=150831
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -280,6 +280,8 @@
</span><span class="cx">                 0F300B7C18AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F300B7A18AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.h */; };
</span><span class="cx">                 0F32BD101BB34F190093A57F /* HeapHelperPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F32BD0E1BB34F190093A57F /* HeapHelperPool.cpp */; };
</span><span class="cx">                 0F32BD111BB34F190093A57F /* HeapHelperPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F32BD0F1BB34F190093A57F /* HeapHelperPool.h */; };
</span><ins>+                0F338DF91BE96AA80013C88F /* B3CCallValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338DF71BE96AA80013C88F /* B3CCallValue.cpp */; };
+                0F338DFA1BE96AA80013C88F /* B3CCallValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338DF81BE96AA80013C88F /* B3CCallValue.h */; };
</ins><span class="cx">                 0F338DF11BE93AD10013C88F /* B3StackmapValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338DEF1BE93AD10013C88F /* B3StackmapValue.cpp */; };
</span><span class="cx">                 0F338DF21BE93AD10013C88F /* B3StackmapValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F338DF01BE93AD10013C88F /* B3StackmapValue.h */; };
</span><span class="cx">                 0F338DF51BE93D550013C88F /* B3ConstrainedValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F338DF31BE93D550013C88F /* B3ConstrainedValue.cpp */; };
</span><span class="lines">@@ -2301,6 +2303,8 @@
</span><span class="cx">                 0F300B7A18AB1B1400A6D72E /* DFGIntegerCheckCombiningPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGIntegerCheckCombiningPhase.h; path = dfg/DFGIntegerCheckCombiningPhase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F32BD0E1BB34F190093A57F /* HeapHelperPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapHelperPool.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F32BD0F1BB34F190093A57F /* HeapHelperPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapHelperPool.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0F338DF71BE96AA80013C88F /* B3CCallValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3CCallValue.cpp; path = b3/B3CCallValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F338DF81BE96AA80013C88F /* B3CCallValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3CCallValue.h; path = b3/B3CCallValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0F338DEF1BE93AD10013C88F /* B3StackmapValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3StackmapValue.cpp; path = b3/B3StackmapValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F338DF01BE93AD10013C88F /* B3StackmapValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = B3StackmapValue.h; path = b3/B3StackmapValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F338DF31BE93D550013C88F /* B3ConstrainedValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = B3ConstrainedValue.cpp; path = b3/B3ConstrainedValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4397,6 +4401,8 @@
</span><span class="cx">                                 0FEC84B81BDACDAC0080FF74 /* B3BasicBlockInlines.h */,
</span><span class="cx">                                 0FEC84B91BDACDAC0080FF74 /* B3BasicBlockUtils.h */,
</span><span class="cx">                                 0FEC84BA1BDACDAC0080FF74 /* B3BlockWorklist.h */,
</span><ins>+                                0F338DF71BE96AA80013C88F /* B3CCallValue.cpp */,
+                                0F338DF81BE96AA80013C88F /* B3CCallValue.h */,
</ins><span class="cx">                                 0FEC84BB1BDACDAC0080FF74 /* B3CheckSpecial.cpp */,
</span><span class="cx">                                 0FEC84BC1BDACDAC0080FF74 /* B3CheckSpecial.h */,
</span><span class="cx">                                 0FEC84BD1BDACDAC0080FF74 /* B3CheckValue.cpp */,
</span><span class="lines">@@ -6521,6 +6527,7 @@
</span><span class="cx">                                 0FEC856E1BDACDC70080FF74 /* AirAllocateStack.h in Headers */,
</span><span class="cx">                                 0FEC85701BDACDC70080FF74 /* AirArg.h in Headers */,
</span><span class="cx">                                 0FEC85721BDACDC70080FF74 /* AirBasicBlock.h in Headers */,
</span><ins>+                                0F338DFA1BE96AA80013C88F /* B3CCallValue.h in Headers */,
</ins><span class="cx">                                 0FEC85741BDACDC70080FF74 /* AirCCallSpecial.h in Headers */,
</span><span class="cx">                                 0FEC85761BDACDC70080FF74 /* AirCode.h in Headers */,
</span><span class="cx">                                 0F4570391BE44C910062A629 /* AirEliminateDeadCode.h in Headers */,
</span><span class="lines">@@ -8836,6 +8843,7 @@
</span><span class="cx">                                 14E84F9E14EE1ACC00D6D5D4 /* WeakBlock.cpp in Sources */,
</span><span class="cx">                                 14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */,
</span><span class="cx">                                 A7CA3AE317DA41AE006538AF /* WeakMapConstructor.cpp in Sources */,
</span><ins>+                                0F338DF91BE96AA80013C88F /* B3CCallValue.cpp in Sources */,
</ins><span class="cx">                                 A7CA3AEB17DA5168006538AF /* WeakMapData.cpp in Sources */,
</span><span class="cx">                                 A7CA3AE517DA41AE006538AF /* WeakMapPrototype.cpp in Sources */,
</span><span class="cx">                                 14E84FA014EE1ACC00D6D5D4 /* WeakSet.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ArgumentRegValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3ArgumentRegValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><span class="cx">     ArgumentRegValue(unsigned index, Origin origin, Reg reg)
</span><del>-        : Value(index, ArgumentReg, reg.isGPR() ? pointerType() : Double, origin)
</del><ins>+        : Value(index, CheckedOpcode, ArgumentReg, reg.isGPR() ? pointerType() : Double, origin)
</ins><span class="cx">         , m_reg(reg)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(reg.isSet());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3CCallValuecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3CCallValue.cpp (0 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3CCallValue.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3CCallValue.cpp        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;B3CCallValue.h&quot;
+
+#if ENABLE(B3_JIT)
+
+namespace JSC { namespace B3 {
+
+CCallValue::~CCallValue()
+{
+}
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3CCallValueh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/b3/B3CCallValue.h (0 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3CCallValue.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/b3/B3CCallValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef B3CCallValue_h
+#define B3CCallValue_h
+
+#if ENABLE(B3_JIT)
+
+#include &quot;B3Effects.h&quot;
+#include &quot;B3Value.h&quot;
+
+namespace JSC { namespace B3 {
+
+class JS_EXPORT_PRIVATE CCallValue : public Value {
+public:
+    static bool accepts(Opcode opcode) { return opcode == CCall; }
+
+    ~CCallValue();
+
+    Effects effects;
+
+private:
+    friend class Procedure;
+
+    template&lt;typename... Arguments&gt;
+    CCallValue(unsigned index, Type type, Origin origin, Arguments... arguments)
+        : Value(index, CheckedOpcode, CCall, type, origin, arguments...)
+        , effects(Effects::forCall())
+    {
+    }
+};
+
+} } // namespace JSC::B3
+
+#endif // ENABLE(B3_JIT)
+
+#endif // B3CCallValue_h
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3CheckValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3CheckValue.cpp        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> // Use this form for CheckAdd, CheckSub, and CheckMul.
</span><span class="cx"> CheckValue::CheckValue(unsigned index, Opcode opcode, Origin origin, Value* left, Value* right)
</span><del>-    : StackmapValue(index, opcode, left-&gt;type(), origin)
</del><ins>+    : StackmapValue(index, CheckedOpcode, opcode, 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><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> 
</span><span class="cx"> // Use this form for Check.
</span><span class="cx"> CheckValue::CheckValue(unsigned index, Opcode opcode, Origin origin, Value* predicate)
</span><del>-    : StackmapValue(index, opcode, Void, origin)
</del><ins>+    : StackmapValue(index, CheckedOpcode, opcode, Void, origin)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(opcode == Check);
</span><span class="cx">     append(predicate);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const32Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const32Value.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const32Value.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3Const32Value.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><span class="cx">     Const32Value(unsigned index, Origin origin, int32_t value)
</span><del>-        : Value(index, Const32, Int32, origin)
</del><ins>+        : Value(index, CheckedOpcode, Const32, Int32, origin)
</ins><span class="cx">         , m_value(value)
</span><span class="cx">     {
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Const64Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Const64Value.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Const64Value.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3Const64Value.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><span class="cx">     Const64Value(unsigned index, Origin origin, int64_t value)
</span><del>-        : Value(index, Const64, Int64, origin)
</del><ins>+        : Value(index, CheckedOpcode, Const64, Int64, origin)
</ins><span class="cx">         , m_value(value)
</span><span class="cx">     {
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ConstDoubleValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3ConstDoubleValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><span class="cx">     ConstDoubleValue(unsigned index, Origin origin, double value)
</span><del>-        : Value(index, ConstDouble, Double, origin)
</del><ins>+        : Value(index, CheckedOpcode, ConstDouble, Double, origin)
</ins><span class="cx">         , m_value(value)
</span><span class="cx">     {
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3ControlValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3ControlValue.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3ControlValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3ControlValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx">     ControlValue(unsigned index, Opcode opcode, Type type, Origin origin, Arguments... arguments)
</span><span class="cx">         : Value(index, opcode, type, origin, arguments...)
</span><span class="cx">     {
</span><ins>+        ASSERT(accepts(opcode));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Subclasses will populate this.
</span><span class="lines">@@ -105,21 +106,21 @@
</span><span class="cx"> 
</span><span class="cx">     // Use this for Oops.
</span><span class="cx">     ControlValue(unsigned index, Opcode opcode, Origin origin)
</span><del>-        : Value(index, opcode, Void, origin)
</del><ins>+        : Value(index, CheckedOpcode, opcode, Void, origin)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(opcode == Oops);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Use this for Return.
</span><span class="cx">     ControlValue(unsigned index, Opcode opcode, Origin origin, Value* result)
</span><del>-        : Value(index, opcode, Void, origin, result)
</del><ins>+        : Value(index, CheckedOpcode, opcode, Void, origin, result)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(opcode == Return);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Use this for Jump.
</span><span class="cx">     ControlValue(unsigned index, Opcode opcode, Origin origin, const FrequentedBlock&amp; target)
</span><del>-        : Value(index, opcode, Void, origin)
</del><ins>+        : Value(index, CheckedOpcode, opcode, Void, origin)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(opcode == Jump);
</span><span class="cx">         m_successors.append(target);
</span><span class="lines">@@ -129,7 +130,7 @@
</span><span class="cx">     ControlValue(
</span><span class="cx">         unsigned index, Opcode opcode, Origin origin, Value* predicate,
</span><span class="cx">         const FrequentedBlock&amp; yes, const FrequentedBlock&amp; no)
</span><del>-        : Value(index, opcode, Void, origin, predicate)
</del><ins>+        : Value(index, CheckedOpcode, opcode, Void, origin, predicate)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(opcode == Branch);
</span><span class="cx">         m_successors.append(yes);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Effectsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Effects.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Effects.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3Effects.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -55,6 +55,16 @@
</span><span class="cx">     HeapRange writes;
</span><span class="cx">     HeapRange reads;
</span><span class="cx"> 
</span><ins>+    static Effects forCall()
+    {
+        Effects result;
+        result.exitsSideways = true;
+        result.controlDependent = true;
+        result.writes = HeapRange::top();
+        result.reads = HeapRange::top();
+        return result;
+    }
+
</ins><span class="cx">     bool mustExecute() const
</span><span class="cx">     {
</span><span class="cx">         return terminal || exitsSideways || writesSSAState || writes;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3MemoryValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3MemoryValue.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3MemoryValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3MemoryValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -28,14 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(B3_JIT)
</span><span class="cx"> 
</span><ins>+#include &quot;B3HeapRange.h&quot;
</ins><span class="cx"> #include &quot;B3Value.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><del>-// FIXME: Add alias analysis to these by allowing the client to associate an integer range to the
-// value. Two operations may access the same memory if their ranges overlaps.
-// https://bugs.webkit.org/show_bug.cgi?id=150535
-
</del><span class="cx"> class JS_EXPORT_PRIVATE MemoryValue : public Value {
</span><span class="cx"> public:
</span><span class="cx">     static bool accepts(Opcode opcode)
</span><span class="lines">@@ -62,6 +59,9 @@
</span><span class="cx">     int32_t offset() const { return m_offset; }
</span><span class="cx">     void setOffset(int32_t offset) { m_offset = offset; }
</span><span class="cx"> 
</span><ins>+    const HeapRange&amp; range() const { return m_range; }
+    void setRange(const HeapRange&amp; range) { m_range = range; }
+
</ins><span class="cx">     size_t accessByteSize() const;
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -75,8 +75,9 @@
</span><span class="cx">     MemoryValue(
</span><span class="cx">         unsigned index, Opcode opcode, Type type, Origin origin, Value* pointer,
</span><span class="cx">         int32_t offset = 0)
</span><del>-        : Value(index, opcode, type, origin, pointer)
</del><ins>+        : Value(index, CheckedOpcode, opcode, type, origin, pointer)
</ins><span class="cx">         , m_offset(offset)
</span><ins>+        , m_range(HeapRange::top())
</ins><span class="cx">     {
</span><span class="cx">         if (!ASSERT_DISABLED) {
</span><span class="cx">             switch (opcode) {
</span><span class="lines">@@ -113,8 +114,9 @@
</span><span class="cx">     MemoryValue(
</span><span class="cx">         unsigned index, Opcode opcode, Origin origin, Value* value, Value* pointer,
</span><span class="cx">         int32_t offset = 0)
</span><del>-        : Value(index, opcode, Void, origin, value, pointer)
</del><ins>+        : Value(index, CheckedOpcode, opcode, Void, origin, value, pointer)
</ins><span class="cx">         , m_offset(offset)
</span><ins>+        , m_range(HeapRange::top())
</ins><span class="cx">     {
</span><span class="cx">         if (!ASSERT_DISABLED) {
</span><span class="cx">             switch (opcode) {
</span><span class="lines">@@ -131,6 +133,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     int32_t m_offset { 0 };
</span><ins>+    HeapRange m_range;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::B3
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3PatchpointValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3PatchpointValue.cpp (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3PatchpointValue.cpp        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3PatchpointValue.cpp        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PatchpointValue::PatchpointValue(unsigned index, Type type, Origin origin)
</span><del>-    : StackmapValue(index, Patchpoint, type, origin)
</del><ins>+    : StackmapValue(index, CheckedOpcode, Patchpoint, type, origin)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3PatchpointValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3PatchpointValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -28,7 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(B3_JIT)
</span><span class="cx"> 
</span><ins>+#include &quot;B3Effects.h&quot;
</ins><span class="cx"> #include &quot;B3StackmapValue.h&quot;
</span><ins>+#include &quot;B3Value.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace B3 {
</span><span class="cx"> 
</span><span class="lines">@@ -38,6 +40,8 @@
</span><span class="cx"> 
</span><span class="cx">     ~PatchpointValue();
</span><span class="cx"> 
</span><ins>+    Effects effects;
+
</ins><span class="cx"> private:
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3StackSlotValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3StackSlotValue.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3StackSlotValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3StackSlotValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><span class="cx">     StackSlotValue(unsigned index, Origin origin, unsigned byteSize, StackSlotKind kind)
</span><del>-        : Value(index, StackSlot, pointerType(), origin)
</del><ins>+        : Value(index, CheckedOpcode, StackSlot, pointerType(), origin)
</ins><span class="cx">         , m_byteSize(byteSize)
</span><span class="cx">         , m_kind(kind)
</span><span class="cx">         , m_offsetFromFP(0)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3StackmapValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3StackmapValue.cpp (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3StackmapValue.cpp        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3StackmapValue.cpp        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -78,9 +78,10 @@
</span><span class="cx">         &quot;, usedRegisters = &quot;, m_usedRegisters);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-StackmapValue::StackmapValue(unsigned index, Opcode opcode, Type type, Origin origin)
-    : Value(index, opcode, type, origin)
</del><ins>+StackmapValue::StackmapValue(unsigned index, CheckedOpcodeTag, Opcode opcode, Type type, Origin origin)
+    : Value(index, CheckedOpcode, opcode, type, origin)
</ins><span class="cx"> {
</span><ins>+    ASSERT(accepts(opcode));
</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 (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3StackmapValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3StackmapValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -176,7 +176,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(unsigned index, Opcode, Type, Origin);
</del><ins>+    StackmapValue(unsigned index, CheckedOpcodeTag, Opcode, Type, Origin);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class CheckSpecial;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3UpsilonValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3UpsilonValue.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     // the Upsilons without the Phi, then create the Phi, then go back and tell the Upsilons about
</span><span class="cx">     // the Phi. This allows you to emit code in its natural order.
</span><span class="cx">     UpsilonValue(unsigned index, Origin origin, Value* value, Value* phi = nullptr)
</span><del>-        : Value(index, Upsilon, Void, origin, value)
</del><ins>+        : Value(index, CheckedOpcode, Upsilon, Void, origin, value)
</ins><span class="cx">         , m_phi(phi)
</span><span class="cx">     {
</span><span class="cx">         if (phi) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.cpp (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.cpp        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3Value.cpp        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -28,6 +28,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(B3_JIT)
</span><span class="cx"> 
</span><ins>+#include &quot;B3ArgumentRegValue.h&quot;
+#include &quot;B3CCallValue.h&quot;
+#include &quot;B3ControlValue.h&quot;
+#include &quot;B3MemoryValue.h&quot;
+#include &quot;B3StackSlotValue.h&quot;
+#include &quot;B3UpsilonValue.h&quot;
</ins><span class="cx"> #include &quot;B3ValueInlines.h&quot;
</span><span class="cx"> #include &lt;wtf/CommaPrinter.h&gt;
</span><span class="cx"> #include &lt;wtf/StringPrintStream.h&gt;
</span><span class="lines">@@ -241,26 +247,21 @@
</span><span class="cx">     case Load16S:
</span><span class="cx">     case LoadFloat:
</span><span class="cx">     case Load:
</span><del>-        // FIXME: MemoryValue should have a HeapRange.
-        // https://bugs.webkit.org/show_bug.cgi?id=150535
-        result.reads = HeapRange::top();
</del><ins>+        result.reads = as&lt;MemoryValue&gt;()-&gt;range();
</ins><span class="cx">         result.controlDependent = true;
</span><span class="cx">         break;
</span><span class="cx">     case Store8:
</span><span class="cx">     case Store16:
</span><span class="cx">     case StoreFloat:
</span><span class="cx">     case Store:
</span><del>-        // FIXME: MemoryValue should have a HeapRange.
-        // https://bugs.webkit.org/show_bug.cgi?id=150535
-        result.writes = HeapRange::top();
</del><ins>+        result.writes = as&lt;MemoryValue&gt;()-&gt;range();
</ins><span class="cx">         result.controlDependent = true;
</span><span class="cx">         break;
</span><span class="cx">     case CCall:
</span><ins>+        result = as&lt;CCallValue&gt;()-&gt;effects;
+        break;
</ins><span class="cx">     case Patchpoint:
</span><del>-        result.reads = HeapRange::top();
-        result.writes = HeapRange::top();
-        result.exitsSideways = true;
-        result.controlDependent = true;
</del><ins>+        result = as&lt;PatchpointValue&gt;()-&gt;effects;
</ins><span class="cx">         break;
</span><span class="cx">     case CheckAdd:
</span><span class="cx">     case CheckSub:
</span><span class="lines">@@ -297,6 +298,23 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !ASSERT_DISABLED
+void Value::checkOpcode(Opcode opcode)
+{
+    ASSERT(!ArgumentRegValue::accepts(opcode));
+    ASSERT(!CCallValue::accepts(opcode));
+    ASSERT(!CheckValue::accepts(opcode));
+    ASSERT(!Const32Value::accepts(opcode));
+    ASSERT(!Const64Value::accepts(opcode));
+    ASSERT(!ConstDoubleValue::accepts(opcode));
+    ASSERT(!ControlValue::accepts(opcode));
+    ASSERT(!MemoryValue::accepts(opcode));
+    ASSERT(!PatchpointValue::accepts(opcode));
+    ASSERT(!StackSlotValue::accepts(opcode));
+    ASSERT(!UpsilonValue::accepts(opcode));
+}
+#endif // !ASSERT_DISABLED
+
</ins><span class="cx"> Type Value::typeFor(Opcode opcode, Value* firstChild)
</span><span class="cx"> {
</span><span class="cx">     switch (opcode) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreb3B3Valueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/b3/B3Value.h (191993 => 191994)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/b3/B3Value.h        2015-11-04 00:13:27 UTC (rev 191993)
+++ trunk/Source/JavaScriptCore/b3/B3Value.h        2015-11-04 00:28:23 UTC (rev 191994)
</span><span class="lines">@@ -159,15 +159,24 @@
</span><span class="cx"> protected:
</span><span class="cx">     virtual void dumpChildren(CommaPrinter&amp;, PrintStream&amp;) const;
</span><span class="cx">     virtual void dumpMeta(CommaPrinter&amp;, PrintStream&amp;) const;
</span><del>-    
</del><ins>+
</ins><span class="cx"> private:
</span><span class="cx">     friend class Procedure;
</span><span class="cx"> 
</span><ins>+    // Checks that this opcode is valid for use with B3::Value.
+#if ASSERT_DISABLED
+    static void checkOpcode(Opcode) { }
+#else
+    static void checkOpcode(Opcode);
+#endif
+
</ins><span class="cx"> protected:
</span><ins>+    enum CheckedOpcodeTag { CheckedOpcode };
+    
</ins><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(unsigned index, Opcode opcode, Type type, Origin origin, Value* firstChild, Arguments... arguments)
</del><ins>+    explicit Value(unsigned index, CheckedOpcodeTag, Opcode opcode, Type type, Origin origin, Value* firstChild, Arguments... arguments)
</ins><span class="cx">         : m_index(index)
</span><span class="cx">         , m_opcode(opcode)
</span><span class="cx">         , m_type(type)
</span><span class="lines">@@ -176,7 +185,7 @@
</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(unsigned index, Opcode opcode, Type type, Origin origin)
</del><ins>+    explicit Value(unsigned index, CheckedOpcodeTag, Opcode opcode, Type type, Origin origin)
</ins><span class="cx">         : m_index(index)
</span><span class="cx">         , m_opcode(opcode)
</span><span class="cx">         , m_type(type)
</span><span class="lines">@@ -185,7 +194,7 @@
</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(unsigned index, Opcode opcode, Origin origin, Value* firstChild, Arguments... arguments)
</del><ins>+    explicit Value(unsigned index, CheckedOpcodeTag, Opcode opcode, Origin origin, Value* firstChild, Arguments... arguments)
</ins><span class="cx">         : m_index(index)
</span><span class="cx">         , m_opcode(opcode)
</span><span class="cx">         , m_type(typeFor(opcode, firstChild))
</span><span class="lines">@@ -195,7 +204,7 @@
</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(unsigned index, Opcode opcode, Origin origin)
</del><ins>+    explicit Value(unsigned index, CheckedOpcodeTag, Opcode opcode, Origin origin)
</ins><span class="cx">         : m_index(index)
</span><span class="cx">         , m_opcode(opcode)
</span><span class="cx">         , m_type(typeFor(opcode, nullptr))
</span><span class="lines">@@ -203,7 +212,7 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     // Use this form for varargs.
</span><del>-    explicit Value(unsigned index, Opcode opcode, Type type, Origin origin, const AdjacencyList&amp; children)
</del><ins>+    explicit Value(unsigned index, CheckedOpcodeTag, Opcode opcode, Type type, Origin origin, const AdjacencyList&amp; children)
</ins><span class="cx">         : m_index(index)
</span><span class="cx">         , m_opcode(opcode)
</span><span class="cx">         , m_type(type)
</span><span class="lines">@@ -211,7 +220,7 @@
</span><span class="cx">         , m_children(children)
</span><span class="cx">     {
</span><span class="cx">     }
</span><del>-    explicit Value(unsigned index, Opcode opcode, Type type, Origin origin, AdjacencyList&amp;&amp; children)
</del><ins>+    explicit Value(unsigned index, CheckedOpcodeTag, Opcode opcode, Type type, Origin origin, AdjacencyList&amp;&amp; children)
</ins><span class="cx">         : m_index(index)
</span><span class="cx">         , m_opcode(opcode)
</span><span class="cx">         , m_type(type)
</span><span class="lines">@@ -220,6 +229,15 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // This is the constructor you end up actually calling, if you're instantiating Value
+    // directly.
+    template&lt;typename... Arguments&gt;
+    explicit Value(unsigned index, Opcode opcode, Arguments&amp;&amp;... arguments)
+        : Value(index, CheckedOpcode, opcode, std::forward&lt;Arguments&gt;(arguments)...)
+    {
+        checkOpcode(opcode);
+    }
+
</ins><span class="cx"> private:
</span><span class="cx">     static Type typeFor(Opcode, Value* firstChild);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>