<!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>[206756] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206756">206756</a></dd>
<dt>Author</dt> <dd>jfbastien@apple.com</dd>
<dt>Date</dt> <dd>2016-10-03 15:43:37 -0700 (Mon, 03 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Auto-generate WASMOps.h, share with testing JSON file
https://bugs.webkit.org/show_bug.cgi?id=162870
Reviewed by Keith Miller.
JSTests:
* stress/wasm/to-c++.js: Added. Generates WASMOps.h, siilar to the current one but with more data.
(const.opcode_iterator):
(opcode_macroizer):
* stress/wasm/wasm.json: Added. Data from 0xC binary format version.
Source/JavaScriptCore:
Add a few new opcodes, but keep this mostly as-is for now. I want
to generate smarter code but will do so in a later update to
reduce disruption.
* wasm/WASMOps.h: auto-generated from ./JSTests/stress/wasm/to-c++.js</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJSTestsChangeLog">trunk/JSTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionParserh">trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMOpsh">trunk/Source/JavaScriptCore/wasm/WASMOps.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/JSTests/stress/wasm/</li>
<li><a href="#trunkJSTestsstresswasmgeneratewasmopsheaderjs">trunk/JSTests/stress/wasm/generate-wasmops-header.js</a></li>
<li><a href="#trunkJSTestsstresswasmwasmjson">trunk/JSTests/stress/wasm/wasm.json</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JSTests/ChangeLog (206755 => 206756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/ChangeLog        2016-10-03 22:32:11 UTC (rev 206755)
+++ trunk/JSTests/ChangeLog        2016-10-03 22:43:37 UTC (rev 206756)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-03 JF Bastien <jfbastien@apple.com>
+
+ Auto-generate WASMOps.h, share with testing JSON file
+ https://bugs.webkit.org/show_bug.cgi?id=162870
+
+ Reviewed by Keith Miller.
+
+ * stress/wasm/to-c++.js: Added. Generates WASMOps.h, siilar to the current one but with more data.
+ (const.opcode_iterator):
+ (opcode_macroizer):
+ * stress/wasm/wasm.json: Added. Data from 0xC binary format version.
+
</ins><span class="cx"> 2016-10-03 Saam Barati <sbarati@apple.com>
</span><span class="cx">
</span><span class="cx"> MapHash should speculate on the type of its child node
</span></span></pre></div>
<a id="trunkJSTestsstresswasmgeneratewasmopsheaderjs"></a>
<div class="addfile"><h4>Added: trunk/JSTests/stress/wasm/generate-wasmops-header.js (0 => 206756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/stress/wasm/generate-wasmops-header.js         (rev 0)
+++ trunk/JSTests/stress/wasm/generate-wasmops-header.js        2016-10-03 22:43:37 UTC (rev 206756)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+// Use the JSON description of WebAssembly to generate the JavaScriptCore's WASMOps.h.
+
+const jsonFile = 'wasm.json';
+const wasm = JSON.parse(read(jsonFile));
+const opcodes = wasm.opcode;
+
+// Iterate through opcodes which match filter.
+const opcodeIterator = (filter) => {
+ return function*() {
+ for (let op in opcodes)
+ if (filter(opcodes[op]))
+ yield {name: op, opcode: opcodes[op]};
+ };
+};
+
+// WebAssembly opcode name to C++ name suitable for JSC.
+const toCpp = name => {
+ const camelCase = name.replace(/([^a-z0-9].)/g, c => c[1].toUpperCase());
+ const CamelCase = camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
+ return CamelCase;
+};
+
+const cppMacro = (wasmOpcode, value, b3Opcode) => " \\\n macro(" + toCpp(wasmOpcode) + ", 0x" + parseInt(value).toString(16) + ", " + b3Opcode + ")";
+
+function* opcodeMacroizer(filter) {
+ for (let op of opcodeIterator(filter)())
+ yield cppMacro(op.name, op.opcode.value, op.opcode.b3op || "Oops");
+}
+
+const defines = [
+ "#define FOR_EACH_WASM_SPECIAL_OP(macro)",
+ ...opcodeMacroizer(op => op.category === "special"),
+ "\n\n#define FOR_EACH_WASM_CONTROL_FLOW_OP(macro)",
+ ...opcodeMacroizer(op => op.category === "control"),
+ "\n\n#define FOR_EACH_WASM_UNARY_OP(macro)",
+ ...opcodeMacroizer(op => op.category === "arithmetic" && op.parameter.length === 1),
+ "\n\n#define FOR_EACH_WASM_BINARY_OP(macro)",
+ ...opcodeMacroizer(op => (op.category === "arithmetic" || op.category === "comparison") && op.parameter.length === 2),
+ "\n\n"].join("");
+
+const template = `/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. \`\`AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This file is auto-generated using ${jsonFile}.
+
+#pragma once
+
+#if ENABLE(WEBASSEMBLY)
+
+namespace JSC { namespace WASM {
+
+${defines}
+
+#define FOR_EACH_WASM_OP(macro) \\
+ FOR_EACH_WASM_SPECIAL_OP(macro) \\
+ FOR_EACH_WASM_CONTROL_FLOW_OP(macro) \\
+ FOR_EACH_WASM_UNARY_OP(macro) \\
+ FOR_EACH_WASM_BINARY_OP(macro)
+
+#define CREATE_ENUM_VALUE(name, id, b3op) name = id,
+
+enum OpType : uint8_t {
+ FOR_EACH_WASM_OP(CREATE_ENUM_VALUE)
+};
+
+enum class BinaryOpType : uint8_t {
+ FOR_EACH_WASM_BINARY_OP(CREATE_ENUM_VALUE)
+};
+
+enum class UnaryOpType : uint8_t {
+ FOR_EACH_WASM_UNARY_OP(CREATE_ENUM_VALUE)
+};
+
+#undef CREATE_ENUM_VALUE
+
+inline bool isControlOp(OpType op)
+{
+ switch (op) {
+#define CREATE_CASE(name, id, b3op) case OpType::name:
+ FOR_EACH_WASM_CONTROL_FLOW_OP(CREATE_CASE)
+ return true;
+#undef CREATE_CASE
+ default:
+ break;
+ }
+ return false;
+}
+
+} } // namespace JSC::WASM
+
+#endif // ENABLE(WEBASSEMBLY)
+`;
+
+print(template);
</ins></span></pre></div>
<a id="trunkJSTestsstresswasmwasmjson"></a>
<div class="addfile"><h4>Added: trunk/JSTests/stress/wasm/wasm.json (0 => 206756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JSTests/stress/wasm/wasm.json         (rev 0)
+++ trunk/JSTests/stress/wasm/wasm.json        2016-10-03 22:43:37 UTC (rev 206756)
</span><span class="lines">@@ -0,0 +1,219 @@
</span><ins>+{
+ "comments": ["This file describes the WebAssembly ISA.",
+ "Scripts in this folder auto-generate C++ code for JavaScriptCore as well as the testing DSL which WebKit's WebAssembly tests use.",
+ "When you update this file you need to re-generate the C++ code: jsc ./JSTests/stress/wasm/generate-wasmops-header.js > ./Source/JavaScriptCore/wasm/WASMOps.h"
+ ],
+ "preamble": {
+ "magic number": { "type": "uint32", "value": 1836278016, "description": "NULL character followed by 'asm'" },
+ "version": { "type": "uint32", "value": 12, "description": "Version number, will be reset to 1 for MVP" }
+ },
+ "value_type" : {
+ "i32": { "type": "uint8", "value": 1 },
+ "i64": { "type": "uint8", "value": 2 },
+ "f32": { "type": "uint8", "value": 3 },
+ "f64": { "type": "uint8", "value": 4 }
+ },
+ "inline_signature_type" : {
+ "void": { "type": "uint8", "value": 0 },
+ "i32": { "type": "uint8", "value": 1 },
+ "i64": { "type": "uint8", "value": 2 },
+ "f32": { "type": "uint8", "value": 3 },
+ "f64": { "type": "uint8", "value": 4 }
+ },
+ "external_kind": {
+ "Function": { "type": "uint8", "value": 0 },
+ "Table": { "type": "uint8", "value": 1 },
+ "Memory": { "type": "uint8", "value": 2 },
+ "Global": { "type": "uint8", "value": 3 }
+ },
+ "section" : {
+ "Type": { "type": "varuint7", "value": 1, "description": "Function signature declarations" },
+ "Import": { "type": "varuint7", "value": 2, "description": "Import declarations" },
+ "Function": { "type": "varuint7", "value": 3, "description": "Function declarations" },
+ "Table": { "type": "varuint7", "value": 4, "description": "Indirect function table and other tables" },
+ "Memory": { "type": "varuint7", "value": 5, "description": "Memory attributes" },
+ "Global": { "type": "varuint7", "value": 6, "description": "Global declarations" },
+ "Export": { "type": "varuint7", "value": 7, "description": "Exports" },
+ "Start": { "type": "varuint7", "value": 8, "description": "Start function declaration" },
+ "Element": { "type": "varuint7", "value": 9, "description": "Elements section" },
+ "Code": { "type": "varuint7", "value": 10, "description": "Function bodies (code)" },
+ "Data": { "type": "varuint7", "value": 11, "description": "Data segments" }
+ },
+ "opcode": {
+ "unreachable": { "category": "control", "value": 0, "return": [], "parameter": [], "immediate": [], "description": "trap immediately" },
+ "block": { "category": "control", "value": 1, "return": ["any*"], "parameter": [], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin a sequence of expressions, yielding 0 or 1 values" },
+ "loop": { "category": "control", "value": 2, "return": ["any*"], "parameter": [], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin a block which can also form control flow loops" },
+ "if": { "category": "control", "value": 3, "return": ["any*"], "parameter": ["bool"], "immediate": [{"name": "sig", "type": "inline_signature_type"}], "description": "begin if expression" },
+ "else": { "category": "control", "value": 4, "return": ["any*"], "parameter": [], "immediate": [], "description": "begin else expression of if" },
+ "select": { "category": "control", "value": 5, "return": ["any"], "parameter": ["any", "any", "bool"], "immediate": [], "description": "select one of two values based on condition" },
+ "br": { "category": "control", "value": 6, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "break that targets an outer nested block" },
+ "br_if": { "category": "control", "value": 7, "return": [], "parameter": [], "immediate": [{"name": "relative_depth", "type": "varuint32"}], "description": "conditional break that targets an outer nested block" },
+ "br_table": { "category": "control", "value": 8, "return": [], "parameter": [], "immediate": [{"name": "target_count", "type": "varuint32", "description": "number of entries in the target_table"},
+ {"name": "target_table", "type": "varuint32*", "description": "target entries that indicate an outer block or loop to which to break"},
+ {"name": "default_target", "type": "varuint32", "description": "an outer block or loop to which to break in the default case"}],
+ "description": "branch table control flow construct" },
+ "return": { "category": "control", "value": 9, "return": [], "parameter": [], "immediate": [], "description": "return zero or one value from this function" },
+ "drop": { "category": "control", "value": 11, "return": [], "parameter": ["any"], "immediate": [], "description": "ignore value" },
+ "nop": { "category": "control", "value": 10, "return": [], "parameter": [], "immediate": [], "description": "no operation" },
+ "end": { "category": "control", "value": 15, "return": [], "parameter": [], "immediate": [], "description": "end a block, loop, or if" },
+ "i32.const": { "category": "special", "value": 16, "return": ["i32"], "parameter": [], "immediate": [{"name": "value", "type": "varint32"}], "description": "a constant value interpreted as i32" },
+ "i64.const": { "category": "special", "value": 17, "return": ["i64"], "parameter": [], "immediate": [{"name": "value", "type": "varint64"}], "description": "a constant value interpreted as i64" },
+ "f64.const": { "category": "special", "value": 18, "return": ["f32"], "parameter": [], "immediate": [{"name": "value", "type": "uint64"}], "description": "a constant value interpreted as f64" },
+ "f32.const": { "category": "special", "value": 19, "return": ["f64"], "parameter": [], "immediate": [{"name": "value", "type": "uint32"}], "description": "a constant value interpreted as f32" },
+ "get_local": { "category": "special", "value": 20, "return": ["any"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "read a local variable or parameter" },
+ "set_local": { "category": "special", "value": 21, "return": ["any"], "parameter": [], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter" },
+ "tee_local": { "category": "special", "value": 25, "return": ["any"], "parameter": ["any"], "immediate": [{"name": "local_index", "type": "varuint32"}], "description": "write a local variable or parameter and return the same value" },
+ "get_global": { "category": "special", "value": 187, "return": ["any"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "read a global variable" },
+ "set_global": { "category": "special", "value": 188, "return": ["any"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "write a global variable" },
+ "call": { "category": "call", "value": 22, "return": ["any"], "parameter": ["any*"], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "call a function by its index" },
+ "call_indirect": { "category": "call", "value": 23, "return": ["any"], "parameter": ["any*"], "immediate": [{"name": "type_index", "type": "varuint32"}], "description": "call a function indirect with an expected signature" },
+ "i32.load8_s": { "category": "memory", "value": 32, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load8_u": { "category": "memory", "value": 33, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load16_s": { "category": "memory", "value": 34, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load16_u": { "category": "memory", "value": 35, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load8_s": { "category": "memory", "value": 36, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load8_u": { "category": "memory", "value": 37, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load16_s": { "category": "memory", "value": 38, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load16_u": { "category": "memory", "value": 39, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load32_s": { "category": "memory", "value": 40, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load32_u": { "category": "memory", "value": 41, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.load": { "category": "memory", "value": 42, "return": ["i32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i64.load": { "category": "memory", "value": 43, "return": ["i64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "f32.load": { "category": "memory", "value": 44, "return": ["f32"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "f64.load": { "category": "memory", "value": 45, "return": ["f64"], "parameter": ["addr"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "load from memory" },
+ "i32.store8": { "category": "memory", "value": 46, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i32.store16": { "category": "memory", "value": 47, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store8": { "category": "memory", "value": 48, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store16": { "category": "memory", "value": 49, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store32": { "category": "memory", "value": 50, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i32.store": { "category": "memory", "value": 51, "return": [], "parameter": ["addr", "i32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "i64.store": { "category": "memory", "value": 52, "return": [], "parameter": ["addr", "i64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "f32.store": { "category": "memory", "value": 53, "return": [], "parameter": ["addr", "f32"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "f64.store": { "category": "memory", "value": 54, "return": [], "parameter": ["addr", "f64"], "immediate": [{"name": "flags", "type": "varuint32"}, {"name": "offset", "type": "varuint32"}], "description": "store to memory" },
+ "current_memory": { "category": "operation", "value": 59, "return": ["size"], "parameter": [], "immediate": [], "description": "query the size of memory" },
+ "grow_memory": { "category": "operation", "value": 57, "return": ["size"], "parameter": ["size"], "immediate": [], "description": "grow the size of memory" },
+ "i32.add": { "category": "arithmetic", "value": 64, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "Add" },
+ "i32.sub": { "category": "arithmetic", "value": 65, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "Sub" },
+ "i32.mul": { "category": "arithmetic", "value": 66, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "Mul" },
+ "i32.div_s": { "category": "arithmetic", "value": 67, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "Div" },
+ "i32.div_u": { "category": "arithmetic", "value": 68, "return": ["i32"], "parameter": ["i32", "i32"] },
+ "i32.rem_s": { "category": "arithmetic", "value": 69, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "Mod" },
+ "i32.rem_u": { "category": "arithmetic", "value": 70, "return": ["i32"], "parameter": ["i32", "i32"] },
+ "i32.and": { "category": "arithmetic", "value": 71, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "BitAnd" },
+ "i32.or": { "category": "arithmetic", "value": 72, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "BitOr" },
+ "i32.xor": { "category": "arithmetic", "value": 73, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "BitXor" },
+ "i32.shl": { "category": "arithmetic", "value": 74, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "Shl" },
+ "i32.shr_u": { "category": "arithmetic", "value": 75, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "SShr" },
+ "i32.shr_s": { "category": "arithmetic", "value": 76, "return": ["i32"], "parameter": ["i32", "i32"], "b3op": "ZShr" },
+ "i32.rotr": { "category": "arithmetic", "value": 182, "return": ["i32"], "parameter": ["i32", "i32"] },
+ "i32.rotl": { "category": "arithmetic", "value": 183, "return": ["i32"], "parameter": ["i32", "i32"] },
+ "i32.eq": { "category": "comparison", "value": 77, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "Equal" },
+ "i32.ne": { "category": "comparison", "value": 78, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "NotEqual" },
+ "i32.lt_s": { "category": "comparison", "value": 79, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "LessThan" },
+ "i32.le_s": { "category": "comparison", "value": 80, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "LessEqual" },
+ "i32.lt_u": { "category": "comparison", "value": 81, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "Below" },
+ "i32.le_u": { "category": "comparison", "value": 82, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "BelowEqual" },
+ "i32.gt_s": { "category": "comparison", "value": 83, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "GreaterThan" },
+ "i32.ge_s": { "category": "comparison", "value": 84, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "GreaterEqual" },
+ "i32.gt_u": { "category": "comparison", "value": 85, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "Above" },
+ "i32.ge_u": { "category": "comparison", "value": 86, "return": ["bool"], "parameter": ["i32", "i32"], "b3op": "AboveEqual" },
+ "i32.clz": { "category": "arithmetic", "value": 87, "return": ["i32"], "parameter": ["i32"], "b3op": "Clz" },
+ "i32.ctz": { "category": "arithmetic", "value": 88, "return": ["i32"], "parameter": ["i32"] },
+ "i32.popcnt": { "category": "arithmetic", "value": 89, "return": ["i32"], "parameter": ["i32"] },
+ "i32.eqz": { "category": "comparison", "value": 90, "return": ["bool"], "parameter": ["i32"] },
+ "i64.add": { "category": "arithmetic", "value": 91, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "Add" },
+ "i64.sub": { "category": "arithmetic", "value": 92, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "Sub" },
+ "i64.mul": { "category": "arithmetic", "value": 93, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "Mul" },
+ "i64.div_s": { "category": "arithmetic", "value": 94, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "Div" },
+ "i64.div_u": { "category": "arithmetic", "value": 95, "return": ["i64"], "parameter": ["i64", "i64"] },
+ "i64.rem_s": { "category": "arithmetic", "value": 96, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "Mod" },
+ "i64.rem_u": { "category": "arithmetic", "value": 97, "return": ["i64"], "parameter": ["i64", "i64"] },
+ "i64.and": { "category": "arithmetic", "value": 98, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "BitAnd" },
+ "i64.or": { "category": "arithmetic", "value": 99, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "BitOr" },
+ "i64.xor": { "category": "arithmetic", "value": 100, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "BitXor" },
+ "i64.shl": { "category": "arithmetic", "value": 101, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "Shl" },
+ "i64.shr_u": { "category": "arithmetic", "value": 102, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "SShr" },
+ "i64.shr_s": { "category": "arithmetic", "value": 103, "return": ["i64"], "parameter": ["i64", "i64"], "b3op": "ZShr" },
+ "i64.rotr": { "category": "arithmetic", "value": 184, "return": ["i64"], "parameter": ["i64", "i64"] },
+ "i64.rotl": { "category": "arithmetic", "value": 185, "return": ["i64"], "parameter": ["i64", "i64"] },
+ "i64.eq": { "category": "comparison", "value": 104, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "Equal" },
+ "i64.ne": { "category": "comparison", "value": 105, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "NotEqual" },
+ "i64.lt_s": { "category": "comparison", "value": 106, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "LessThan" },
+ "i64.le_s": { "category": "comparison", "value": 107, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "LessEqual" },
+ "i64.lt_u": { "category": "comparison", "value": 108, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "Below" },
+ "i64.le_u": { "category": "comparison", "value": 109, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "BelowEqual" },
+ "i64.gt_s": { "category": "comparison", "value": 110, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "GreaterThan" },
+ "i64.ge_s": { "category": "comparison", "value": 111, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "GreaterEqual" },
+ "i64.gt_u": { "category": "comparison", "value": 112, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "Above" },
+ "i64.ge_u": { "category": "comparison", "value": 113, "return": ["bool"], "parameter": ["i64", "i64"], "b3op": "AboveEqual" },
+ "i64.clz": { "category": "arithmetic", "value": 114, "return": ["i64"], "parameter": ["i64"], "b3op": "Clz" },
+ "i64.ctz": { "category": "arithmetic", "value": 115, "return": ["i64"], "parameter": ["i64"] },
+ "i64.popcnt": { "category": "arithmetic", "value": 116, "return": ["i64"], "parameter": ["i64"] },
+ "i64.eqz": { "category": "comparison", "value": 186, "return": ["bool"], "parameter": ["i64"] },
+ "f32.add": { "category": "arithmetic", "value": 117, "return": ["f32"], "parameter": ["f32", "f32"] },
+ "f32.sub": { "category": "arithmetic", "value": 118, "return": ["f32"], "parameter": ["f32", "f32"] },
+ "f32.mul": { "category": "arithmetic", "value": 119, "return": ["f32"], "parameter": ["f32", "f32"] },
+ "f32.div": { "category": "arithmetic", "value": 120, "return": ["f32"], "parameter": ["f32", "f32"] },
+ "f32.min": { "category": "arithmetic", "value": 121, "return": ["f32"], "parameter": ["f32", "f32"] },
+ "f32.max": { "category": "arithmetic", "value": 122, "return": ["f32"], "parameter": ["f32", "f32"] },
+ "f32.abs": { "category": "arithmetic", "value": 123, "return": ["f32"], "parameter": ["f32"] },
+ "f32.neg": { "category": "arithmetic", "value": 124, "return": ["f32"], "parameter": ["f32"] },
+ "f32.copysign": { "category": "arithmetic", "value": 125, "return": ["f32"], "parameter": ["f32"] },
+ "f32.ceil": { "category": "arithmetic", "value": 126, "return": ["f32"], "parameter": ["f32"] },
+ "f32.floor": { "category": "arithmetic", "value": 127, "return": ["f32"], "parameter": ["f32"] },
+ "f32.trunc": { "category": "arithmetic", "value": 128, "return": ["f32"], "parameter": ["f32"] },
+ "f32.nearest": { "category": "arithmetic", "value": 129, "return": ["f32"], "parameter": ["f32"] },
+ "f32.sqrt": { "category": "arithmetic", "value": 130, "return": ["f32"], "parameter": ["f32"] },
+ "f32.eq": { "category": "comparison", "value": 131, "return": ["bool"], "parameter": ["f32", "f32"] },
+ "f32.ne": { "category": "comparison", "value": 132, "return": ["bool"], "parameter": ["f32", "f32"] },
+ "f32.lt": { "category": "comparison", "value": 133, "return": ["bool"], "parameter": ["f32", "f32"] },
+ "f32.le": { "category": "comparison", "value": 134, "return": ["bool"], "parameter": ["f32", "f32"] },
+ "f32.gt": { "category": "comparison", "value": 135, "return": ["bool"], "parameter": ["f32", "f32"] },
+ "f32.ge": { "category": "comparison", "value": 136, "return": ["bool"], "parameter": ["f32", "f32"] },
+ "f64.add": { "category": "arithmetic", "value": 137, "return": ["f64"], "parameter": ["f64", "f64"] },
+ "f64.sub": { "category": "arithmetic", "value": 138, "return": ["f64"], "parameter": ["f64", "f64"] },
+ "f64.mul": { "category": "arithmetic", "value": 139, "return": ["f64"], "parameter": ["f64", "f64"] },
+ "f64.div": { "category": "arithmetic", "value": 140, "return": ["f64"], "parameter": ["f64", "f64"] },
+ "f64.min": { "category": "arithmetic", "value": 141, "return": ["f64"], "parameter": ["f64", "f64"] },
+ "f64.max": { "category": "arithmetic", "value": 142, "return": ["f64"], "parameter": ["f64", "f64"] },
+ "f64.abs": { "category": "arithmetic", "value": 143, "return": ["f64"], "parameter": ["f64"] },
+ "f64.neg": { "category": "arithmetic", "value": 144, "return": ["f64"], "parameter": ["f64"] },
+ "f64.copysign": { "category": "arithmetic", "value": 145, "return": ["f64"], "parameter": ["f64"] },
+ "f64.ceil": { "category": "arithmetic", "value": 146, "return": ["f64"], "parameter": ["f64"] },
+ "f64.floor": { "category": "arithmetic", "value": 147, "return": ["f64"], "parameter": ["f64"] },
+ "f64.trunc": { "category": "arithmetic", "value": 148, "return": ["f64"], "parameter": ["f64"] },
+ "f64.nearest": { "category": "arithmetic", "value": 149, "return": ["f64"], "parameter": ["f64"] },
+ "f64.sqrt": { "category": "arithmetic", "value": 150, "return": ["f64"], "parameter": ["f64"] },
+ "f64.eq": { "category": "comparison", "value": 151, "return": ["bool"], "parameter": ["f64", "f64"] },
+ "f64.ne": { "category": "comparison", "value": 152, "return": ["bool"], "parameter": ["f64", "f64"] },
+ "f64.lt": { "category": "comparison", "value": 153, "return": ["bool"], "parameter": ["f64", "f64"] },
+ "f64.le": { "category": "comparison", "value": 154, "return": ["bool"], "parameter": ["f64", "f64"] },
+ "f64.gt": { "category": "comparison", "value": 155, "return": ["bool"], "parameter": ["f64", "f64"] },
+ "f64.ge": { "category": "comparison", "value": 156, "return": ["bool"], "parameter": ["f64", "f64"] },
+ "i32.trunc_s/f32": { "category": "conversion", "value": 157, "return": ["i32"], "parameter": ["f32"] },
+ "i32.trunc_s/f64": { "category": "conversion", "value": 158, "return": ["i32"], "parameter": ["f64"] },
+ "i32.trunc_u/f32": { "category": "conversion", "value": 159, "return": ["i32"], "parameter": ["f32"] },
+ "i32.trunc_u/f64": { "category": "conversion", "value": 160, "return": ["i32"], "parameter": ["f64"] },
+ "i32.wrap/i64": { "category": "conversion", "value": 161, "return": ["i32"], "parameter": ["i64"] },
+ "i64.trunc_s/f32": { "category": "conversion", "value": 162, "return": ["i64"], "parameter": ["f32"] },
+ "i64.trunc_s/f64": { "category": "conversion", "value": 163, "return": ["i64"], "parameter": ["f64"] },
+ "i64.trunc_u/f32": { "category": "conversion", "value": 164, "return": ["i64"], "parameter": ["f32"] },
+ "i64.trunc_u/f64": { "category": "conversion", "value": 165, "return": ["i64"], "parameter": ["f64"] },
+ "i64.extend_s/i32": { "category": "conversion", "value": 166, "return": ["i64"], "parameter": ["i32"] },
+ "i64.extend_u/i32": { "category": "conversion", "value": 167, "return": ["i64"], "parameter": ["i32"] },
+ "f32.convert_s/i32": { "category": "conversion", "value": 168, "return": ["f32"], "parameter": ["i32"] },
+ "f32.convert_u/i32": { "category": "conversion", "value": 169, "return": ["f32"], "parameter": ["i32"] },
+ "f32.convert_s/i64": { "category": "conversion", "value": 170, "return": ["f32"], "parameter": ["i64"] },
+ "f32.convert_u/i64": { "category": "conversion", "value": 171, "return": ["f32"], "parameter": ["i64"] },
+ "f32.demote/f64": { "category": "conversion", "value": 172, "return": ["f32"], "parameter": ["f64"] },
+ "f32.reinterpret/i32": { "category": "conversion", "value": 173, "return": ["f32"], "parameter": ["i32"] },
+ "f64.convert_s/i32": { "category": "conversion", "value": 174, "return": ["f64"], "parameter": ["i32"] },
+ "f64.convert_u/i32": { "category": "conversion", "value": 175, "return": ["f64"], "parameter": ["i32"] },
+ "f64.convert_s/i64": { "category": "conversion", "value": 176, "return": ["f64"], "parameter": ["i64"] },
+ "f64.convert_u/i64": { "category": "conversion", "value": 177, "return": ["f64"], "parameter": ["i64"] },
+ "f64.promote/f32": { "category": "conversion", "value": 178, "return": ["f64"], "parameter": ["f32"] },
+ "f64.reinterpret/i64": { "category": "conversion", "value": 179, "return": ["f64"], "parameter": ["i64"] },
+ "i32.reinterpret/f32": { "category": "conversion", "value": 180, "return": ["i32"], "parameter": ["f32"] },
+ "i64.reinterpret/f64": { "category": "conversion", "value": 181, "return": ["i64"], "parameter": ["f64"] }
+ }
+}
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (206755 => 206756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-10-03 22:32:11 UTC (rev 206755)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-10-03 22:43:37 UTC (rev 206756)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-10-03 JF Bastien <jfbastien@apple.com>
+
+ Auto-generate WASMOps.h, share with testing JSON file
+ https://bugs.webkit.org/show_bug.cgi?id=162870
+
+ Reviewed by Keith Miller.
+
+ Add a few new opcodes, but keep this mostly as-is for now. I want
+ to generate smarter code but will do so in a later update to
+ reduce disruption.
+
+ * wasm/WASMOps.h: auto-generated from ./JSTests/stress/wasm/to-c++.js
+
</ins><span class="cx"> 2016-10-03 Michael Saboff <msaboff@apple.com>
</span><span class="cx">
</span><span class="cx"> Creating pcToOriginMap in FTL shouldn't insert unnecessary NOPs
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h (206755 => 206756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h        2016-10-03 22:32:11 UTC (rev 206755)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h        2016-10-03 22:43:37 UTC (rev 206756)
</span><span class="lines">@@ -214,14 +214,14 @@
</span><span class="cx"> return m_context.addElse(m_controlStack.last());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- case OpType::Branch:
- case OpType::BranchIf: {
</del><ins>+ case OpType::Br:
+ case OpType::BrIf: {
</ins><span class="cx"> uint32_t target;
</span><span class="cx"> if (!parseVarUInt32(target) || target >= m_controlStack.size())
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> ExpressionType condition = Context::emptyExpression;
</span><del>- if (op == OpType::BranchIf)
</del><ins>+ if (op == OpType::BrIf)
</ins><span class="cx"> condition = m_expressionStack.takeLast();
</span><span class="cx"> else
</span><span class="cx"> m_unreachableBlocks = 1;
</span><span class="lines">@@ -245,6 +245,19 @@
</span><span class="cx"> return m_context.endBlock(data, m_expressionStack);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ case OpType::Unreachable:
+ case OpType::Select:
+ case OpType::BrTable:
+ case OpType::Nop:
+ case OpType::Drop:
+ case OpType::I64Const:
+ case OpType::F32Const:
+ case OpType::F64Const:
+ case OpType::TeeLocal:
+ case OpType::GetGlobal:
+ case OpType::SetGlobal:
+ // FIXME: Not yet implemented.
+ return false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Unknown opcode.
</span><span class="lines">@@ -284,8 +297,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // two immediate cases
</span><del>- case OpType::Branch:
- case OpType::BranchIf: {
</del><ins>+ case OpType::Br:
+ case OpType::BrIf: {
</ins><span class="cx"> uint32_t unused;
</span><span class="cx"> if (!parseVarUInt32(unused))
</span><span class="cx"> return false;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMOpsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WASMOps.h (206755 => 206756)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMOps.h        2016-10-03 22:32:11 UTC (rev 206755)
+++ trunk/Source/JavaScriptCore/wasm/WASMOps.h        2016-10-03 22:43:37 UTC (rev 206756)
</span><span class="lines">@@ -23,6 +23,8 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+// This file is auto-generated using wasm.json.
+
</ins><span class="cx"> #pragma once
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="lines">@@ -30,29 +32,54 @@
</span><span class="cx"> namespace JSC { namespace WASM {
</span><span class="cx">
</span><span class="cx"> #define FOR_EACH_WASM_SPECIAL_OP(macro) \
</span><del>- macro(I32Const, 0x10, NA) \
- macro(GetLocal, 0x14, NA) \
- macro(SetLocal, 0x15, NA)
</del><ins>+ macro(I32Const, 0x10, Oops) \
+ macro(I64Const, 0x11, Oops) \
+ macro(F64Const, 0x12, Oops) \
+ macro(F32Const, 0x13, Oops) \
+ macro(GetLocal, 0x14, Oops) \
+ macro(SetLocal, 0x15, Oops) \
+ macro(TeeLocal, 0x19, Oops) \
+ macro(GetGlobal, 0xbb, Oops) \
+ macro(SetGlobal, 0xbc, Oops)
</ins><span class="cx">
</span><span class="cx"> #define FOR_EACH_WASM_CONTROL_FLOW_OP(macro) \
</span><del>- macro(Block, 0x01, NA) \
- macro(Loop, 0x02, NA) \
- macro(If, 0x03, NA) \
- macro(Else, 0x04, NA) \
- macro(Branch, 0x06, NA) \
- macro(BranchIf, 0x07, NA) \
- macro(Return, 0x09, NA) \
- macro(End, 0x0f, NA)
</del><ins>+ macro(Unreachable, 0x0, Oops) \
+ macro(Block, 0x1, Oops) \
+ macro(Loop, 0x2, Oops) \
+ macro(If, 0x3, Oops) \
+ macro(Else, 0x4, Oops) \
+ macro(Select, 0x5, Oops) \
+ macro(Br, 0x6, Oops) \
+ macro(BrIf, 0x7, Oops) \
+ macro(BrTable, 0x8, Oops) \
+ macro(Return, 0x9, Oops) \
+ macro(Drop, 0xb, Oops) \
+ macro(Nop, 0xa, Oops) \
+ macro(End, 0xf, Oops)
</ins><span class="cx">
</span><span class="cx"> #define FOR_EACH_WASM_UNARY_OP(macro) \
</span><span class="cx"> macro(I32Clz, 0x57, Clz) \
</span><del>- /* macro(I32Ctz, 0x58) */ \
- /* macro(I32PopCnt, 0x59) */ \
- /* macro(I32Eqz, 0x5a) */ \
</del><ins>+ macro(I32Ctz, 0x58, Oops) \
+ macro(I32Popcnt, 0x59, Oops) \
</ins><span class="cx"> macro(I64Clz, 0x72, Clz) \
</span><del>- /* macro(I64Ctz, 0x73) */ \
- /* macro(I64PopCnt, 0x74) */ \
- /* macro(I64Eqz, 0xba) */
</del><ins>+ macro(I64Ctz, 0x73, Oops) \
+ macro(I64Popcnt, 0x74, Oops) \
+ macro(F32Abs, 0x7b, Oops) \
+ macro(F32Neg, 0x7c, Oops) \
+ macro(F32Copysign, 0x7d, Oops) \
+ macro(F32Ceil, 0x7e, Oops) \
+ macro(F32Floor, 0x7f, Oops) \
+ macro(F32Trunc, 0x80, Oops) \
+ macro(F32Nearest, 0x81, Oops) \
+ macro(F32Sqrt, 0x82, Oops) \
+ macro(F64Abs, 0x8f, Oops) \
+ macro(F64Neg, 0x90, Oops) \
+ macro(F64Copysign, 0x91, Oops) \
+ macro(F64Ceil, 0x92, Oops) \
+ macro(F64Floor, 0x93, Oops) \
+ macro(F64Trunc, 0x94, Oops) \
+ macro(F64Nearest, 0x95, Oops) \
+ macro(F64Sqrt, 0x96, Oops)
</ins><span class="cx">
</span><span class="cx"> #define FOR_EACH_WASM_BINARY_OP(macro) \
</span><span class="cx"> macro(I32Add, 0x40, Add) \
</span><span class="lines">@@ -59,9 +86,9 @@
</span><span class="cx"> macro(I32Sub, 0x41, Sub) \
</span><span class="cx"> macro(I32Mul, 0x42, Mul) \
</span><span class="cx"> macro(I32DivS, 0x43, Div) \
</span><del>- /* macro(I32DivU, 0x44) */ \
</del><ins>+ macro(I32DivU, 0x44, Oops) \
</ins><span class="cx"> macro(I32RemS, 0x45, Mod) \
</span><del>- /* macro(I32RemU, 0x46, Mod) */ \
</del><ins>+ macro(I32RemU, 0x46, Oops) \
</ins><span class="cx"> macro(I32And, 0x47, BitAnd) \
</span><span class="cx"> macro(I32Or, 0x48, BitOr) \
</span><span class="cx"> macro(I32Xor, 0x49, BitXor) \
</span><span class="lines">@@ -68,8 +95,8 @@
</span><span class="cx"> macro(I32Shl, 0x4a, Shl) \
</span><span class="cx"> macro(I32ShrU, 0x4b, SShr) \
</span><span class="cx"> macro(I32ShrS, 0x4c, ZShr) \
</span><del>- /* macro(I32RotR, 0xb6) */ \
- /* macro(I32RotL, 0xb7) */ \
</del><ins>+ macro(I32Rotr, 0xb6, Oops) \
+ macro(I32Rotl, 0xb7, Oops) \
</ins><span class="cx"> macro(I32Eq, 0x4d, Equal) \
</span><span class="cx"> macro(I32Ne, 0x4e, NotEqual) \
</span><span class="cx"> macro(I32LtS, 0x4f, LessThan) \
</span><span class="lines">@@ -84,9 +111,9 @@
</span><span class="cx"> macro(I64Sub, 0x5c, Sub) \
</span><span class="cx"> macro(I64Mul, 0x5d, Mul) \
</span><span class="cx"> macro(I64DivS, 0x5e, Div) \
</span><del>- /* macro(I64DivU, 0x5f) */ \
</del><ins>+ macro(I64DivU, 0x5f, Oops) \
</ins><span class="cx"> macro(I64RemS, 0x60, Mod) \
</span><del>- /* macro(I64RemU, 0x61) */ \
</del><ins>+ macro(I64RemU, 0x61, Oops) \
</ins><span class="cx"> macro(I64And, 0x62, BitAnd) \
</span><span class="cx"> macro(I64Or, 0x63, BitOr) \
</span><span class="cx"> macro(I64Xor, 0x64, BitXor) \
</span><span class="lines">@@ -93,8 +120,8 @@
</span><span class="cx"> macro(I64Shl, 0x65, Shl) \
</span><span class="cx"> macro(I64ShrU, 0x66, SShr) \
</span><span class="cx"> macro(I64ShrS, 0x67, ZShr) \
</span><del>- /* macro(I64RotR, 0xb8) */ \
- /* macro(I64RotL, 0xb9) */ \
</del><ins>+ macro(I64Rotr, 0xb8, Oops) \
+ macro(I64Rotl, 0xb9, Oops) \
</ins><span class="cx"> macro(I64Eq, 0x68, Equal) \
</span><span class="cx"> macro(I64Ne, 0x69, NotEqual) \
</span><span class="cx"> macro(I64LtS, 0x6a, LessThan) \
</span><span class="lines">@@ -101,8 +128,37 @@
</span><span class="cx"> macro(I64LeS, 0x6b, LessEqual) \
</span><span class="cx"> macro(I64LtU, 0x6c, Below) \
</span><span class="cx"> macro(I64LeU, 0x6d, BelowEqual) \
</span><ins>+ macro(I64GtS, 0x6e, GreaterThan) \
+ macro(I64GeS, 0x6f, GreaterEqual) \
+ macro(I64GtU, 0x70, Above) \
+ macro(I64GeU, 0x71, AboveEqual) \
+ macro(F32Add, 0x75, Oops) \
+ macro(F32Sub, 0x76, Oops) \
+ macro(F32Mul, 0x77, Oops) \
+ macro(F32Div, 0x78, Oops) \
+ macro(F32Min, 0x79, Oops) \
+ macro(F32Max, 0x7a, Oops) \
+ macro(F32Eq, 0x83, Oops) \
+ macro(F32Ne, 0x84, Oops) \
+ macro(F32Lt, 0x85, Oops) \
+ macro(F32Le, 0x86, Oops) \
+ macro(F32Gt, 0x87, Oops) \
+ macro(F32Ge, 0x88, Oops) \
+ macro(F64Add, 0x89, Oops) \
+ macro(F64Sub, 0x8a, Oops) \
+ macro(F64Mul, 0x8b, Oops) \
+ macro(F64Div, 0x8c, Oops) \
+ macro(F64Min, 0x8d, Oops) \
+ macro(F64Max, 0x8e, Oops) \
+ macro(F64Eq, 0x97, Oops) \
+ macro(F64Ne, 0x98, Oops) \
+ macro(F64Lt, 0x99, Oops) \
+ macro(F64Le, 0x9a, Oops) \
+ macro(F64Gt, 0x9b, Oops) \
+ macro(F64Ge, 0x9c, Oops)
</ins><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx"> #define FOR_EACH_WASM_OP(macro) \
</span><span class="cx"> FOR_EACH_WASM_SPECIAL_OP(macro) \
</span><span class="cx"> FOR_EACH_WASM_CONTROL_FLOW_OP(macro) \
</span><span class="lines">@@ -141,3 +197,4 @@
</span><span class="cx"> } } // namespace JSC::WASM
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(WEBASSEMBLY)
</span><ins>+
</ins></span></pre>
</div>
</div>
</body>
</html>