<!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>[189396] 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/189396">189396</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-09-04 15:47:23 -0700 (Fri, 04 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement the signed division instruction in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=148772

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

This patch implements the signed division instruction in WebAssembly
for 32-bit integers. We use the IDIV instruction on x86 and x86-64 and
use a C function on all other platforms. We throw an exception if
- the denominator is zero, or
- the numerator is -2^31 and the denominator is -1.

* jit/JITOperations.cpp:
* jit/JITOperations.h:
* tests/stress/wasm-arithmetic.js:
(shouldBe):
(shouldThrow):
* tests/stress/wasm-arithmetic.wasm:
* wasm/WASMFunctionCompiler.h:
(JSC::operationDiv):
(JSC::WASMFunctionCompiler::endFunction):
(JSC::WASMFunctionCompiler::buildBinaryI32):
(JSC::WASMFunctionCompiler::appendCall):
(JSC::WASMFunctionCompiler::appendCallWithExceptionCheck):
(JSC::WASMFunctionCompiler::callOperation):
(JSC::WASMFunctionCompiler::throwStackOverflowError): Deleted.
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseExpressionI32):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationsh">trunk/Source/JavaScriptCore/jit/JITOperations.h</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmarithmeticjs">trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.js</a></li>
<li><a href="#trunkSourceJavaScriptCoretestsstresswasmarithmeticwasm">trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.wasm</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionCompilerh">trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionParsercpp">trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (189395 => 189396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-09-04 22:41:32 UTC (rev 189395)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-09-04 22:47:23 UTC (rev 189396)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2015-09-04  Sukolsak Sakshuwong  &lt;sukolsak@gmail.com&gt;
</span><span class="cx"> 
</span><ins>+        Implement the signed division instruction in WebAssembly
+        https://bugs.webkit.org/show_bug.cgi?id=148772
+
+        Reviewed by Geoffrey Garen.
+
+        This patch implements the signed division instruction in WebAssembly
+        for 32-bit integers. We use the IDIV instruction on x86 and x86-64 and
+        use a C function on all other platforms. We throw an exception if
+        - the denominator is zero, or
+        - the numerator is -2^31 and the denominator is -1.
+
+        * jit/JITOperations.cpp:
+        * jit/JITOperations.h:
+        * tests/stress/wasm-arithmetic.js:
+        (shouldBe):
+        (shouldThrow):
+        * tests/stress/wasm-arithmetic.wasm:
+        * wasm/WASMFunctionCompiler.h:
+        (JSC::operationDiv):
+        (JSC::WASMFunctionCompiler::endFunction):
+        (JSC::WASMFunctionCompiler::buildBinaryI32):
+        (JSC::WASMFunctionCompiler::appendCall):
+        (JSC::WASMFunctionCompiler::appendCallWithExceptionCheck):
+        (JSC::WASMFunctionCompiler::callOperation):
+        (JSC::WASMFunctionCompiler::throwStackOverflowError): Deleted.
+        * wasm/WASMFunctionParser.cpp:
+        (JSC::WASMFunctionParser::parseExpressionI32):
+
+2015-09-04  Sukolsak Sakshuwong  &lt;sukolsak@gmail.com&gt;
+
</ins><span class="cx">         Implement the GetLocal and SetLocal instructions in WebAssembly
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=148793
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (189395 => 189396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-09-04 22:41:32 UTC (rev 189395)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-09-04 22:47:23 UTC (rev 189396)
</span><span class="lines">@@ -95,6 +95,19 @@
</span><span class="cx">     vm-&gt;throwException(callerFrame, createStackOverflowError(callerFrame));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBASSEMBLY)
+void JIT_OPERATION operationThrowDivideError(ExecState* exec)
+{
+    VM* vm = &amp;exec-&gt;vm();
+    VMEntryFrame* vmEntryFrame = vm-&gt;topVMEntryFrame;
+    CallFrame* callerFrame = exec-&gt;callerFrame(vmEntryFrame);
+
+    NativeCallFrameTracerWithRestore tracer(vm, vmEntryFrame, callerFrame);
+    ErrorHandlingScope errorScope(*vm);
+    vm-&gt;throwException(callerFrame, createError(callerFrame, ASCIILiteral(&quot;Division by zero or division overflow.&quot;)));
+}
+#endif
+
</ins><span class="cx"> int32_t JIT_OPERATION operationCallArityCheck(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.h (189395 => 189396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-09-04 22:41:32 UTC (rev 189395)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-09-04 22:47:23 UTC (rev 189396)
</span><span class="lines">@@ -245,6 +245,9 @@
</span><span class="cx"> void JIT_OPERATION operationVMHandleException(ExecState*) WTF_INTERNAL;
</span><span class="cx"> 
</span><span class="cx"> void JIT_OPERATION operationThrowStackOverflowError(ExecState*, CodeBlock*) WTF_INTERNAL;
</span><ins>+#if ENABLE(WEBASSEMBLY)
+void JIT_OPERATION operationThrowDivideError(ExecState*) WTF_INTERNAL;
+#endif
</ins><span class="cx"> int32_t JIT_OPERATION operationCallArityCheck(ExecState*) WTF_INTERNAL;
</span><span class="cx"> int32_t JIT_OPERATION operationConstructArityCheck(ExecState*) WTF_INTERNAL;
</span><span class="cx"> EncodedJSValue JIT_OPERATION operationGetById(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmarithmeticjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.js (189395 => 189396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.js        2015-09-04 22:41:32 UTC (rev 189395)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.js        2015-09-04 22:47:23 UTC (rev 189396)
</span><span class="lines">@@ -1,22 +1,71 @@
</span><span class="cx"> //@ skip
</span><span class="cx"> 
</span><ins>+function shouldBe(actual, expected) {
+    if (actual !== expected)
+        throw new Error('bad value: ' + actual);
+}
+
+function shouldThrow(func, message) {
+    var error = null;
+    try {
+        func();
+    } catch (e) {
+        error = e;
+    }
+    if (!error)
+        throw new Error(&quot;not thrown.&quot;);
+    if (String(error) !== message)
+        throw new Error(&quot;bad error: &quot; + String(error));
+}
+
</ins><span class="cx"> /*
</span><span class="cx"> wasm-arithmetic.wasm is generated by pack-asmjs &lt;https://github.com/WebAssembly/polyfill-prototype-1&gt; from the following script:
</span><span class="cx"> 
</span><span class="cx"> function asmModule(global, env, buffer) {
</span><span class="cx">     &quot;use asm&quot;;
</span><span class="cx"> 
</span><del>-    function main() {
-        return (10 + 40) - 8;
</del><ins>+    function addSubtract() {
+        return ((10 + 40) - 8) | 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    function addOverflow() {
+        return (2147483647 + 1) | 0;
+    }
+
+    function divide() {
+        return (42 / 5) | 0;
+    }
+
+    function divideByZero() {
+        return (1 / 0) | 0;
+    }
+
+    function divideOverflow() {
+        return (-2147483648 / -1) | 0;
+    }
+
</ins><span class="cx">     return {
</span><del>-        main: main
</del><ins>+        addSubtract: addSubtract,
+        addOverflow: addOverflow,
+        divide: divide,
+        divideByZero: divideByZero,
+        divideOverflow: divideOverflow,
</ins><span class="cx">     };
</span><span class="cx"> }
</span><span class="cx"> */
</span><span class="cx"> 
</span><span class="cx"> var module = loadWebAssembly(&quot;wasm-arithmetic.wasm&quot;);
</span><del>-var result = module.main();
-if (result != 42)
-    throw &quot;Error: bad result: &quot; + result;
</del><ins>+
+shouldBe(module.addSubtract(), 42);
+
+shouldBe(module.addOverflow(), -2147483648);
+
+shouldBe(module.divide(), 8);
+
+shouldThrow(() =&gt; {
+    module.divideByZero();
+}, &quot;Error: Division by zero or division overflow.&quot;);
+
+shouldThrow(() =&gt; {
+    module.divideOverflow();
+}, &quot;Error: Division by zero or division overflow.&quot;);
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstresswasmarithmeticwasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.wasm (189395 => 189396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.wasm        2015-09-04 22:41:32 UTC (rev 189395)
+++ trunk/Source/JavaScriptCore/tests/stress/wasm-arithmetic.wasm        2015-09-04 22:47:23 UTC (rev 189396)
</span><span class="lines">@@ -1 +1 @@
</span><del>-wasm\xF8\x80\xAA(\xA8main
</del><span class="cx">\ No newline at end of file
</span><ins>+wasm\xD1\x80\xAA(\xA8\x80\xFF\xFF\xFF\xFF\xA1\x80!*\xA5\x80!\xA1\xA0\x80!\x80\x80\x80\x80\xFF\xFF\xFF\xFFaddSubtractaddOverflowdividedivideByZerodivideOverflow
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionCompilerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h (189395 => 189396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h        2015-09-04 22:41:32 UTC (rev 189395)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h        2015-09-04 22:47:23 UTC (rev 189396)
</span><span class="lines">@@ -37,6 +37,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+#if !CPU(X86) &amp;&amp; !CPU(X86_64)
+static int32_t JIT_OPERATION operationDiv(int32_t left, int32_t right)
+{
+    return left / right;
+}
+#endif
+
</ins><span class="cx"> class WASMFunctionCompiler : private CCallHelpers {
</span><span class="cx"> public:
</span><span class="cx">     typedef int Expression;
</span><span class="lines">@@ -108,7 +115,8 @@
</span><span class="cx">         m_stackOverflow.link(this);
</span><span class="cx">         if (maxFrameExtentForSlowPathCall)
</span><span class="cx">             addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
</span><del>-        throwStackOverflowError();
</del><ins>+        setupArgumentsWithExecState(TrustedImmPtr(m_codeBlock));
+        appendCallWithExceptionCheck(operationThrowStackOverflowError);
</ins><span class="cx"> 
</span><span class="cx">         // FIXME: Implement arity check.
</span><span class="cx">         Label arityCheck = label();
</span><span class="lines">@@ -116,6 +124,31 @@
</span><span class="cx">         emitPutImmediateToCallFrameHeader(m_codeBlock, JSStack::CodeBlock);
</span><span class="cx">         jump(m_beginLabel);
</span><span class="cx"> 
</span><ins>+        if (!m_divideErrorJumpList.empty()) {
+            m_divideErrorJumpList.link(this);
+
+            if (maxFrameExtentForSlowPathCall)
+                addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
+            setupArgumentsExecState();
+            appendCallWithExceptionCheck(operationThrowDivideError);
+        }
+
+        if (!m_exceptionChecks.empty()) {
+            m_exceptionChecks.link(this);
+
+            // lookupExceptionHandler is passed two arguments, the VM and the exec (the CallFrame*).
+            move(TrustedImmPtr(vm()), GPRInfo::argumentGPR0);
+            move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR1);
+
+#if CPU(X86)
+            // FIXME: should use the call abstraction, but this is currently in the SpeculativeJIT layer!
+            poke(GPRInfo::argumentGPR0);
+            poke(GPRInfo::argumentGPR1, 1);
+#endif
+            m_calls.append(std::make_pair(call(), FunctionPtr(lookupExceptionHandlerFromCallerFrame).value()));
+            jumpToExceptionHandler();
+        }
+
</ins><span class="cx">         LinkBuffer patchBuffer(*m_vm, *this, m_codeBlock, JITCompilationMustSucceed);
</span><span class="cx"> 
</span><span class="cx">         for (auto iterator : m_calls)
</span><span class="lines">@@ -189,6 +222,25 @@
</span><span class="cx">         case WASMOpExpressionI32::Sub:
</span><span class="cx">             sub32(GPRInfo::regT1, GPRInfo::regT0);
</span><span class="cx">             break;
</span><ins>+        case WASMOpExpressionI32::SDiv: {
+            m_divideErrorJumpList.append(branchTest32(Zero, GPRInfo::regT1));
+            Jump denominatorNotNeg1 = branch32(NotEqual, GPRInfo::regT1, TrustedImm32(-1));
+            m_divideErrorJumpList.append(branch32(Equal, GPRInfo::regT0, TrustedImm32(-2147483647-1)));
+            denominatorNotNeg1.link(this);
+#if CPU(X86) || CPU(X86_64)
+            ASSERT(GPRInfo::regT0 == X86Registers::eax);
+            move(GPRInfo::regT1, X86Registers::ecx);
+            m_assembler.cdq();
+            m_assembler.idivl_r(X86Registers::ecx);
+#else
+            if (maxFrameExtentForSlowPathCall)
+                addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
+            callOperation(operationDiv, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT0);
+            if (maxFrameExtentForSlowPathCall)
+                addPtr(TrustedImm32(maxFrameExtentForSlowPathCall), stackPointerRegister);
+#endif
+            break;
+        }
</ins><span class="cx">         default:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">         }
</span><span class="lines">@@ -216,22 +268,22 @@
</span><span class="cx">         return Address(GPRInfo::callFrameRegister, -(m_numberOfLocals + temporaryIndex + 1) * sizeof(StackSlot));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void throwStackOverflowError()
</del><ins>+    void appendCall(const FunctionPtr&amp; function)
</ins><span class="cx">     {
</span><del>-        setupArgumentsWithExecState(TrustedImmPtr(m_codeBlock));
</del><ins>+        m_calls.append(std::make_pair(call(), function.value()));
+    }
</ins><span class="cx"> 
</span><del>-        m_calls.append(std::make_pair(call(), FunctionPtr(operationThrowStackOverflowError).value()));
</del><ins>+    void appendCallWithExceptionCheck(const FunctionPtr&amp; function)
+    {
+        appendCall(function);
+        m_exceptionChecks.append(emitExceptionCheck());
+    }
</ins><span class="cx"> 
</span><del>-        // lookupExceptionHandlerFromCallerFrame is passed two arguments, the VM and the exec (the CallFrame*).
-        move(TrustedImmPtr(m_vm), GPRInfo::argumentGPR0);
-        move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR1);
-#if CPU(X86)
-        // FIXME: should use the call abstraction, but this is currently in the SpeculativeJIT layer!
-        poke(GPRInfo::argumentGPR0);
-        poke(GPRInfo::argumentGPR1, 1);
-#endif
-        m_calls.append(std::make_pair(call(), FunctionPtr(lookupExceptionHandlerFromCallerFrame).value()));
-        jumpToExceptionHandler();
</del><ins>+    void callOperation(int32_t JIT_OPERATION (*operation)(int32_t, int32_t), GPRReg src1, GPRReg src2, GPRReg dst)
+    {
+        setupArguments(src1, src2);
+        appendCall(operation);
+        move(GPRInfo::returnValueGPR, dst);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned m_stackHeight;
</span><span class="lines">@@ -240,6 +292,8 @@
</span><span class="cx"> 
</span><span class="cx">     Label m_beginLabel;
</span><span class="cx">     Jump m_stackOverflow;
</span><ins>+    JumpList m_divideErrorJumpList;
+    JumpList m_exceptionChecks;
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;std::pair&lt;Call, void*&gt;&gt; m_calls;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp (189395 => 189396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp        2015-09-04 22:41:32 UTC (rev 189395)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp        2015-09-04 22:47:23 UTC (rev 189396)
</span><span class="lines">@@ -430,6 +430,7 @@
</span><span class="cx">             return parseGetLocalExpressionI32(context);
</span><span class="cx">         case WASMOpExpressionI32::Add:
</span><span class="cx">         case WASMOpExpressionI32::Sub:
</span><ins>+        case WASMOpExpressionI32::SDiv:
</ins><span class="cx">             return parseBinaryExpressionI32(context, op);
</span><span class="cx">         case WASMOpExpressionI32::ConstantPoolIndex:
</span><span class="cx">         case WASMOpExpressionI32::GetGlobal:
</span><span class="lines">@@ -460,7 +461,6 @@
</span><span class="cx">         case WASMOpExpressionI32::FromF64:
</span><span class="cx">         case WASMOpExpressionI32::Negate:
</span><span class="cx">         case WASMOpExpressionI32::Mul:
</span><del>-        case WASMOpExpressionI32::SDiv:
</del><span class="cx">         case WASMOpExpressionI32::UDiv:
</span><span class="cx">         case WASMOpExpressionI32::SMod:
</span><span class="cx">         case WASMOpExpressionI32::UMod:
</span></span></pre>
</div>
</div>

</body>
</html>