<!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>[189844] 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/189844">189844</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-09-15 20:52:20 -0700 (Tue, 15 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix asm.js errors in WebAssembly tests
https://bugs.webkit.org/show_bug.cgi?id=149203

Patch by Sukolsak Sakshuwong &lt;sukolsak@gmail.com&gt; on 2015-09-15
Reviewed by Geoffrey Garen.

Our WebAssembly implementation uses asm.js for testing. Using Firefox to
parse asm.js reveals many errors that are not caught by pack-asmjs. For
example,
- asm.js does not allow the use of the multiplication operator (*) to
  multiply two integers, because the result can be so large that some
  lower bits of precision are lost. Math.imul is used instead.
- an int variable must be coerced to either signed (via x|0) or unsigned
  (via x&gt;&gt;&gt;0) before it's returned.

* tests/stress/wasm-arithmetic-int32.js:
* tests/stress/wasm-calls.js:
* tests/stress/wasm-control-flow.js:
* tests/stress/wasm-globals.js:
* tests/stress/wasm-locals.js:
* tests/stress/wasm-relational.js:
* tests/stress/wasm/control-flow.wasm:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmcontrolflowwasm">trunk/Source/JavaScriptCore/tests/stress/wasm/control-flow.wasm</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmarithmeticint32js">trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic-int32.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmcallsjs">trunk/Source/JavaScriptCore/tests/stress/wasm-calls.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmcontrolflowjs">trunk/Source/JavaScriptCore/tests/stress/wasm-control-flow.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmglobalsjs">trunk/Source/JavaScriptCore/tests/stress/wasm-globals.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmlocalsjs">trunk/Source/JavaScriptCore/tests/stress/wasm-locals.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmrelationaljs">trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-09-15  Sukolsak Sakshuwong  &lt;sukolsak@gmail.com&gt;
+
+        Fix asm.js errors in WebAssembly tests
+        https://bugs.webkit.org/show_bug.cgi?id=149203
+
+        Reviewed by Geoffrey Garen.
+
+        Our WebAssembly implementation uses asm.js for testing. Using Firefox to
+        parse asm.js reveals many errors that are not caught by pack-asmjs. For
+        example,
+        - asm.js does not allow the use of the multiplication operator (*) to
+          multiply two integers, because the result can be so large that some
+          lower bits of precision are lost. Math.imul is used instead.
+        - an int variable must be coerced to either signed (via x|0) or unsigned
+          (via x&gt;&gt;&gt;0) before it's returned.
+
+        * tests/stress/wasm-arithmetic-int32.js:
+        * tests/stress/wasm-calls.js:
+        * tests/stress/wasm-control-flow.js:
+        * tests/stress/wasm-globals.js:
+        * tests/stress/wasm-locals.js:
+        * tests/stress/wasm-relational.js:
+        * tests/stress/wasm/control-flow.wasm:
+
</ins><span class="cx"> 2015-09-15  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Add ShadowRoot interface and Element.prototype.attachShadow
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmcontrolflowwasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm/control-flow.wasm (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm/control-flow.wasm        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm/control-flow.wasm        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><del>-wasm6 \x81\x80\xA5&lt;\xC0\xA0\xA1\xA0\x81&lt;\xC0\xA0\xA1\xA0\x81\x80\xA5&lt;\xC0\xA0\xA1\xA2\x81&lt;\xC0\xA0\xA1\xA2\x82\x80\xA1.\xC0\xA0.\xC1\xA0\xA1\xA2.\xC1\xA0\xA3\xA4\x824\xC1\xA5\x80\xC0\xA1\x81\xC1\xA1\xC0\x82\xA1.\xC1\xA2\x80\xC0\xA1\x81\xC1\xA1\xC0\x824\xC1\xA5.\xC1\xA2\x81\xA3\x80\xC0\xA1\x81\xC1\xA1\xC0\x834\xC1\xA5\x82\xA04¢\x80\xC0\xA1\x82¡\x81\xC1\xA1\xC0\x82\x80\xC0\xA1\x81\xC1\xA14\xC1\xA0\xC0\x82.\xC1\xA2\x80\xC0\xA1\x81\xC1\xA1\xA1\xC0\x82.\xC1\xA2\x81\xA3\x80\xC0\xA1\x81\xC1\xA14\xC1\xA5\xC0\x81\x80\xA1\x80\xA2\xA0\xC0\x81.\xC0\xA1\x80\xA1\x80\xA2\xA0\xC0\x81\x80\xA1\x80\xA2\x80\xA3\xA0\x80\xA4\xA0\xC0\x81\x80\xA1\x80\xA2\x80\xA3\xA0\x80\xA4\xA0\xC0\x834\xC1\xA5\x82\xA04¢\x80\xC0\xA1.\xC0\xA8\x82¡\x81\xC1\xA1\xC0\x81\xC0\x81\xA1\x81\xA2\
 x81\xA3\xC1\x81\xC0\x81\xC1\xE8\x81\xC1d\x81\xC1\xAA\x81\xC1\xA1\xC1ifTrueifFalseifElseTrueifElseFalseifInIfwhileLoopwhileBreakwhileContinuewhileInWhiledoLoop        doBreak
</del><ins>+wasmT \x81\x80\xA5&lt;\xC0\xA0\xA1\xA0\x81&lt;\xC0\xA0\xA1\xA0\x81\x80\xA5&lt;\xC0\xA0\xA1\xA2\xA0\x81&lt;\xC0\xA0\xA1\xA2\xA0\x82\x80\xA1.\xC0\xA0.\xC1\xA0\xA1\xA2.\xC1\xA0\xA3\xA4\xA0\x824\xC1\xA5\x80\xC0\xA1\x81\xC1\xA1\xC0\x82\xA1.\xC1\xA2\x80\xC0\xA1\x81\xC1\xA1\xC0\x824\xC1\xA5.\xC1\xA2\x81\xA3\x80\xC0\xA1\x81\xC1\xA1\xC0\x834\xC1\xA5\x82\xA04¢\x80\xC0\xA1\x82¡\x81\xC1\xA1\xC0\x82\x80\xC0\xA1\x81\xC1\xA14\xC1\xA0\xC0\x82.\xC1\xA2\x80\xC0\xA1\x81\xC1\xA1\xA1\xC0\x82.\xC1\xA2\x81\xA3\x80\xC0\xA1\x81\xC1\xA14\xC1\xA5\xC0\x81\x80\xA1\x80\xA2\xA0\xC0\x81.\xC0\xA1\x80\xA1\x80\xA2\xA0\xC0\x81\x80\xA1\x80\xA2\x80\xA3\xA0\x80\xA4\xA0\xC0\x81\x80\xA1\x80\xA2\x80\xA3\xA0\x80\xA4\xA0\xC0\x834\xC1\xA5\x82\xA04¢\x80\xC0\xA1.\xC0\xA8\x82¡\x81\xC1\xA1\xC0\x81\xC0\x81\xA1
 \x81\xA2\x81\xA3\xC1\x81\xC0\x81\xC1\xE8\x81\xC1d\x81\xC1\xAA\x81\xC1\xA1\xC1ifTrueifFalseifElseTrueifElseFalseifInIfwhileLoopwhileBreakwhileContinuewhileInWhiledoLoop        doBreak
</ins><span class="cx"> doContinue labelBreak labelContinue labelInLabelBreakInnerlabelInLabelBreakOuterwhileInWhileBreakOuterswitchCaseswitchFallThrough
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmarithmeticint32js"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic-int32.js (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic-int32.js        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic-int32.js        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -25,11 +25,12 @@
</span><span class="cx">     &quot;use asm&quot;;
</span><span class="cx"> 
</span><span class="cx">     var clz32 = global.Math.clz32;
</span><ins>+    var imul = global.Math.imul;
</ins><span class="cx">     var abs = global.Math.abs;
</span><span class="cx"> 
</span><span class="cx">     function negate(x) {
</span><span class="cx">         x = x | 0;
</span><del>-        return -x;
</del><ins>+        return (-x) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function add(x, y) {
</span><span class="lines">@@ -47,7 +48,7 @@
</span><span class="cx">     function multiply(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        return (x * y) | 0;
</del><ins>+        return imul(x, y) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function divide(x, y) {
</span><span class="lines">@@ -112,7 +113,7 @@
</span><span class="cx">     function logicalRightShift(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        return x &gt;&gt;&gt; y;
</del><ins>+        return (x &gt;&gt;&gt; y) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function countLeadingZeros(x) {
</span><span class="lines">@@ -127,7 +128,7 @@
</span><span class="cx"> 
</span><span class="cx">     function absolute(x) {
</span><span class="cx">         x = x | 0;
</span><del>-        return abs(x | 0);
</del><ins>+        return abs(x | 0) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmcallsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-calls.js (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-calls.js        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-calls.js        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -11,6 +11,7 @@
</span><span class="cx"> function asmModule(global, imports, buffer) {
</span><span class="cx">     &quot;use asm&quot;;
</span><span class="cx"> 
</span><ins>+    var imul = global.Math.imul;
</ins><span class="cx">     var sum = imports.sum;
</span><span class="cx">     var max = imports.max;
</span><span class="cx"> 
</span><span class="lines">@@ -24,27 +25,27 @@
</span><span class="cx">     function gcd(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        if (y == 0)
-            return x;
-        return gcd(y, (x | 0) % (y | 0)) | 0;
</del><ins>+        if ((y | 0) == 0)
+            return x | 0;
+        return gcd(y, ((x | 0) % (y | 0)) | 0) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function lcm(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        return (((x * y) | 0) / (gcd(x, y) | 0)) | 0;
</del><ins>+        return (imul(x, y) / (gcd(x, y) | 0)) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function callSum(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        return sum(x, y) | 0;
</del><ins>+        return sum(x | 0, y | 0) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function callMax(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        return max(x, y) | 0;
</del><ins>+        return max(x | 0, y | 0) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmcontrolflowjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-control-flow.js (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-control-flow.js        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-control-flow.js        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx">             return 1;
</span><span class="cx">         else
</span><span class="cx">             return 2;
</span><ins>+        return 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function ifElseFalse() {
</span><span class="lines">@@ -41,22 +42,24 @@
</span><span class="cx">             return 1;
</span><span class="cx">         else
</span><span class="cx">             return 2;
</span><ins>+        return 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function ifInIf() {
</span><span class="cx">         var x = 0, y = 0;
</span><span class="cx">         x = 1;
</span><del>-        if (x == 0) {
-            if (y == 0)
</del><ins>+        if ((x | 0) == 0) {
+            if ((y | 0) == 0)
</ins><span class="cx">                 return 1;
</span><span class="cx">             else
</span><span class="cx">                 return 2;
</span><span class="cx">         } else {
</span><del>-            if (y == 0)
</del><ins>+            if ((y | 0) == 0)
</ins><span class="cx">                 return 3;
</span><span class="cx">             else
</span><span class="cx">                 return 4;
</span><span class="cx">         }
</span><ins>+        return 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function whileLoop() {
</span><span class="lines">@@ -65,31 +68,31 @@
</span><span class="cx">             x = (x + 1) | 0;
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         }
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function whileBreak() {
</span><span class="cx">         var x = 0, i = 0;
</span><span class="cx">         while (1) {
</span><del>-            if (i == 2)
</del><ins>+            if ((i | 0) == 2)
</ins><span class="cx">                 break;
</span><span class="cx">             x = (x + 1) | 0;
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         }
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function whileContinue() {
</span><span class="cx">         var x = 0, i = 0;
</span><span class="cx">         while ((i | 0) &lt; 5) {
</span><del>-            if (i == 2) {
</del><ins>+            if ((i | 0) == 2) {
</ins><span class="cx">                 i = 3;
</span><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx">             x = (x + 1) | 0;
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         }
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function whileInWhile() {
</span><span class="lines">@@ -102,7 +105,7 @@
</span><span class="cx">             }
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         }
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function doLoop() {
</span><span class="lines">@@ -111,31 +114,31 @@
</span><span class="cx">             x = (x + 1) | 0;
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         } while ((i | 0) &lt; 0);
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function doBreak() {
</span><span class="cx">         var x = 0, i = 0;
</span><span class="cx">         do {
</span><del>-            if (i == 2)
</del><ins>+            if ((i | 0) == 2)
</ins><span class="cx">                 break;
</span><span class="cx">             x = (x + 1) | 0;
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         } while (1);
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function doContinue() {
</span><span class="cx">         var x = 0, i = 0;
</span><span class="cx">         do {
</span><del>-            if (i == 2) {
</del><ins>+            if ((i | 0) == 2) {
</ins><span class="cx">                 i = 3;
</span><span class="cx">                 continue;
</span><span class="cx">             }
</span><span class="cx">             x = (x + 1) | 0;
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         } while ((i | 0) &lt; 5);
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function labelBreak() {
</span><span class="lines">@@ -145,19 +148,19 @@
</span><span class="cx">             break label;
</span><span class="cx">             x = 2;
</span><span class="cx">         } while (0);
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function labelContinue() {
</span><span class="cx">         var x = 0;
</span><span class="cx">         label: do {
</span><del>-            if (x == 1)
</del><ins>+            if ((x | 0) == 1)
</ins><span class="cx">                 break label;
</span><span class="cx">             x = 1;
</span><span class="cx">             continue label;
</span><span class="cx">             x = 2;
</span><span class="cx">         } while (0);
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function labelInLabelBreakInner() {
</span><span class="lines">@@ -171,7 +174,7 @@
</span><span class="cx">             } while (0);
</span><span class="cx">             x = 4;
</span><span class="cx">         } while (0);
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function labelInLabelBreakOuter() {
</span><span class="lines">@@ -185,7 +188,7 @@
</span><span class="cx">             } while (0);
</span><span class="cx">             x = 4;
</span><span class="cx">         } while (0);
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function whileInWhileBreakOuter() {
</span><span class="lines">@@ -195,19 +198,19 @@
</span><span class="cx">             j = 0;
</span><span class="cx">             while ((j | 0) &lt; 2) {
</span><span class="cx">                 x = (x + 1) | 0;
</span><del>-                if (x == 8)
</del><ins>+                if ((x | 0) == 8)
</ins><span class="cx">                     break label;
</span><span class="cx">                 j = (j + 1) | 0;
</span><span class="cx">             }
</span><span class="cx">             i = (i + 1) | 0;
</span><span class="cx">         }
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function switchCase(x) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         var y = 0;
</span><del>-        switch (x) {
</del><ins>+        switch (x | 0) {
</ins><span class="cx">         case 0:
</span><span class="cx">             y = 1;
</span><span class="cx">             break;
</span><span class="lines">@@ -218,13 +221,13 @@
</span><span class="cx">             y = 3;
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-        return y;
</del><ins>+        return y | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function switchFallThrough(x) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         var y = 0;
</span><del>-        switch (x) {
</del><ins>+        switch (x | 0) {
</ins><span class="cx">         case 3:
</span><span class="cx">             y = (y + 1000) | 0;
</span><span class="cx">         case 2:
</span><span class="lines">@@ -234,7 +237,7 @@
</span><span class="cx">         default:
</span><span class="cx">             y = (y + 1) | 0;
</span><span class="cx">         }
</span><del>-        return y;
</del><ins>+        return y | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmglobalsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-globals.js (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-globals.js        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-globals.js        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">     var z = 0.0;
</span><span class="cx"> 
</span><span class="cx">     function getX() {
</span><del>-        return x;
</del><ins>+        return x | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function getY() {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmlocalsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-locals.js (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-locals.js        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-locals.js        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx">         y = y | 0;
</span><span class="cx">         var result = 0;
</span><span class="cx">         result = (x + y) | 0;
</span><del>-        return result;
</del><ins>+        return result | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function add1(x) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmrelationaljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js (189843 => 189844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js        2015-09-16 03:46:46 UTC (rev 189843)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-relational.js        2015-09-16 03:52:20 UTC (rev 189844)
</span><span class="lines">@@ -11,16 +11,18 @@
</span><span class="cx"> function asmModule(global, env, buffer) {
</span><span class="cx">     &quot;use asm&quot;;
</span><span class="cx"> 
</span><ins>+    var fround = global.Math.fround;
+
</ins><span class="cx">     function equal(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        return (x == y) | 0;
</del><ins>+        return ((x | 0) == (y | 0)) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function notEqual(x, y) {
</span><span class="cx">         x = x | 0;
</span><span class="cx">         y = y | 0;
</span><del>-        return (x != y) | 0;
</del><ins>+        return ((x | 0) != (y | 0)) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     function lessThan(x, y) {
</span></span></pre>
</div>
</div>

</body>
</html>