Title: [209923] trunk
Revision
209923
Author
keith_mil...@apple.com
Date
2016-12-16 09:53:26 -0800 (Fri, 16 Dec 2016)

Log Message

i64.eqz should use an Int64 zero
https://bugs.webkit.org/show_bug.cgi?id=165942

Reviewed by Mark Lam.

JSTests:

* wasm/wasm.json:

Source/_javascript_Core:

This patch fixes i64.eqz, which was using an Int32 zero
for the comparison previously. This patch also, adds
printing opcodes names in verbose mode.

* wasm/WasmFunctionParser.h:
* wasm/generateWasmOpsHeader.py:
* wasm/wasm.json:

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (209922 => 209923)


--- trunk/JSTests/ChangeLog	2016-12-16 17:40:00 UTC (rev 209922)
+++ trunk/JSTests/ChangeLog	2016-12-16 17:53:26 UTC (rev 209923)
@@ -1,3 +1,12 @@
+2016-12-16  Keith Miller  <keith_mil...@apple.com>
+
+        i64.eqz should use an Int64 zero
+        https://bugs.webkit.org/show_bug.cgi?id=165942
+
+        Reviewed by Mark Lam.
+
+        * wasm/wasm.json:
+
 2016-12-15  Keith Miller  <keith_mil...@apple.com>
 
         Fix validation of non-void if blocks with no else

Modified: trunk/JSTests/wasm/wasm.json (209922 => 209923)


--- trunk/JSTests/wasm/wasm.json	2016-12-16 17:40:00 UTC (rev 209922)
+++ trunk/JSTests/wasm/wasm.json	2016-12-16 17:53:26 UTC (rev 209923)
@@ -147,7 +147,7 @@
         "i64.clz":             { "category": "arithmetic", "value": 121, "return": ["i64"],      "parameter": ["i64"],                  "immediate": [], "b3op": "Clz"          },
         "i64.ctz":             { "category": "arithmetic", "value": 122, "return": ["i64"],      "parameter": ["i64"],                  "immediate": []                         },
         "i64.popcnt":          { "category": "arithmetic", "value": 123, "return": ["i64"],      "parameter": ["i64"],                  "immediate": []                         },
-        "i64.eqz":             { "category": "comparison", "value":  80, "return": ["bool"],     "parameter": ["i64"],                  "immediate": [], "b3op": "Equal(i32(0), @0)" },
+        "i64.eqz":             { "category": "comparison", "value":  80, "return": ["bool"],     "parameter": ["i64"],                  "immediate": [], "b3op": "Equal(i64(0), @0)" },
         "f32.add":             { "category": "arithmetic", "value": 146, "return": ["f32"],      "parameter": ["f32", "f32"],           "immediate": [], "b3op": "Add"          },
         "f32.sub":             { "category": "arithmetic", "value": 147, "return": ["f32"],      "parameter": ["f32", "f32"],           "immediate": [], "b3op": "Sub"          },
         "f32.mul":             { "category": "arithmetic", "value": 148, "return": ["f32"],      "parameter": ["f32", "f32"],           "immediate": [], "b3op": "Mul"          },

Modified: trunk/Source/_javascript_Core/ChangeLog (209922 => 209923)


--- trunk/Source/_javascript_Core/ChangeLog	2016-12-16 17:40:00 UTC (rev 209922)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-12-16 17:53:26 UTC (rev 209923)
@@ -1,3 +1,18 @@
+2016-12-16  Keith Miller  <keith_mil...@apple.com>
+
+        i64.eqz should use an Int64 zero
+        https://bugs.webkit.org/show_bug.cgi?id=165942
+
+        Reviewed by Mark Lam.
+
+        This patch fixes i64.eqz, which was using an Int32 zero
+        for the comparison previously. This patch also, adds
+        printing opcodes names in verbose mode.
+
+        * wasm/WasmFunctionParser.h:
+        * wasm/generateWasmOpsHeader.py:
+        * wasm/wasm.json:
+
 2016-12-15  Darin Adler  <da...@apple.com>
 
         Use asString instead of toWTFString, toString, or getString when we already checked isString

Modified: trunk/Source/_javascript_Core/wasm/WasmFunctionParser.h (209922 => 209923)


--- trunk/Source/_javascript_Core/wasm/WasmFunctionParser.h	2016-12-16 17:40:00 UTC (rev 209922)
+++ trunk/Source/_javascript_Core/wasm/WasmFunctionParser.h	2016-12-16 17:53:26 UTC (rev 209923)
@@ -132,7 +132,7 @@
         WASM_PARSER_FAIL_IF(!isValidOpType(op), "invalid opcode ", op);
 
         if (verbose) {
-            dataLogLn("processing op (", m_unreachableBlocks, "): ",  RawPointer(reinterpret_cast<void*>(op)), " at offset: ", RawPointer(reinterpret_cast<void*>(m_offset)));
+            dataLogLn("processing op (", m_unreachableBlocks, "): ",  RawPointer(reinterpret_cast<void*>(op)), ", ", makeString(static_cast<OpType>(op)), " at offset: ", RawPointer(reinterpret_cast<void*>(m_offset)));
             m_context.dump(m_controlStack, m_expressionStack);
         }
 

Modified: trunk/Source/_javascript_Core/wasm/generateWasmOpsHeader.py (209922 => 209923)


--- trunk/Source/_javascript_Core/wasm/generateWasmOpsHeader.py	2016-12-16 17:40:00 UTC (rev 209922)
+++ trunk/Source/_javascript_Core/wasm/generateWasmOpsHeader.py	2016-12-16 17:53:26 UTC (rev 209923)
@@ -264,6 +264,17 @@
     return false;
 }
 
+#define CREATE_CASE(name, id, b3type, inc) case name: return #name;
+inline const char* makeString(OpType op)
+{
+    switch (op) {
+    FOR_EACH_WASM_OP(CREATE_CASE)
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+    return nullptr;
+}
+#undef CREATE_CASE
+
 } } // namespace JSC::Wasm
 
 #endif // ENABLE(WEBASSEMBLY)

Modified: trunk/Source/_javascript_Core/wasm/wasm.json (209922 => 209923)


--- trunk/Source/_javascript_Core/wasm/wasm.json	2016-12-16 17:40:00 UTC (rev 209922)
+++ trunk/Source/_javascript_Core/wasm/wasm.json	2016-12-16 17:53:26 UTC (rev 209923)
@@ -147,7 +147,7 @@
         "i64.clz":             { "category": "arithmetic", "value": 121, "return": ["i64"],      "parameter": ["i64"],                  "immediate": [], "b3op": "Clz"          },
         "i64.ctz":             { "category": "arithmetic", "value": 122, "return": ["i64"],      "parameter": ["i64"],                  "immediate": []                         },
         "i64.popcnt":          { "category": "arithmetic", "value": 123, "return": ["i64"],      "parameter": ["i64"],                  "immediate": []                         },
-        "i64.eqz":             { "category": "comparison", "value":  80, "return": ["bool"],     "parameter": ["i64"],                  "immediate": [], "b3op": "Equal(i32(0), @0)" },
+        "i64.eqz":             { "category": "comparison", "value":  80, "return": ["bool"],     "parameter": ["i64"],                  "immediate": [], "b3op": "Equal(i64(0), @0)" },
         "f32.add":             { "category": "arithmetic", "value": 146, "return": ["f32"],      "parameter": ["f32", "f32"],           "immediate": [], "b3op": "Add"          },
         "f32.sub":             { "category": "arithmetic", "value": 147, "return": ["f32"],      "parameter": ["f32", "f32"],           "immediate": [], "b3op": "Sub"          },
         "f32.mul":             { "category": "arithmetic", "value": 148, "return": ["f32"],      "parameter": ["f32", "f32"],           "immediate": [], "b3op": "Mul"          },
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to