Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: test/unittests/wasm/wasm-macro-gen-unittest.cc

Issue 2361053004: Revert of [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/unittests/wasm/module-decoder-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/wasm-macro-gen-unittest.cc
diff --git a/test/unittests/wasm/wasm-macro-gen-unittest.cc b/test/unittests/wasm/wasm-macro-gen-unittest.cc
index 0399835d010ad0f0fc56631b2eea09a7db4f53f5..2b782f5dc7e7b8b7468ad65a2e94edcbb425a694 100644
--- a/test/unittests/wasm/wasm-macro-gen-unittest.cc
+++ b/test/unittests/wasm/wasm-macro-gen-unittest.cc
@@ -56,44 +56,45 @@
EXPECT_SIZE(7, WASM_STORE_MEM(MachineType::Int32(), WASM_ZERO, WASM_ZERO));
- EXPECT_SIZE(6, WASM_IF(WASM_ZERO, WASM_NOP));
-
- EXPECT_SIZE(8, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP));
+ EXPECT_SIZE(5, WASM_IF(WASM_ZERO, WASM_NOP));
+
+ EXPECT_SIZE(7, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP));
EXPECT_SIZE(5, WASM_SELECT(WASM_ZERO, WASM_NOP, WASM_NOP));
- EXPECT_SIZE(2, WASM_BR(0));
- EXPECT_SIZE(4, WASM_BR_IF(0, WASM_ZERO));
-
- EXPECT_SIZE(4, WASM_BLOCK(WASM_NOP));
- EXPECT_SIZE(5, WASM_BLOCK(WASM_NOP, WASM_NOP));
- EXPECT_SIZE(6, WASM_BLOCK(WASM_NOP, WASM_NOP, WASM_NOP));
+ EXPECT_SIZE(3, WASM_BR(0));
+ EXPECT_SIZE(5, WASM_BR_IF(0, WASM_ZERO));
+
+ EXPECT_SIZE(3, WASM_BLOCK(WASM_NOP));
+ EXPECT_SIZE(4, WASM_BLOCK(WASM_NOP, WASM_NOP));
+ EXPECT_SIZE(5, WASM_BLOCK(WASM_NOP, WASM_NOP, WASM_NOP));
EXPECT_SIZE(5, WASM_INFINITE_LOOP);
- EXPECT_SIZE(4, WASM_LOOP(WASM_NOP));
- EXPECT_SIZE(5, WASM_LOOP(WASM_NOP, WASM_NOP));
- EXPECT_SIZE(6, WASM_LOOP(WASM_NOP, WASM_NOP, WASM_NOP));
+ EXPECT_SIZE(3, WASM_LOOP(WASM_NOP));
+ EXPECT_SIZE(4, WASM_LOOP(WASM_NOP, WASM_NOP));
+ EXPECT_SIZE(5, WASM_LOOP(WASM_NOP, WASM_NOP, WASM_NOP));
EXPECT_SIZE(5, WASM_LOOP(WASM_BR(0)));
EXPECT_SIZE(7, WASM_LOOP(WASM_BR_IF(0, WASM_ZERO)));
- EXPECT_SIZE(1, WASM_RETURN0);
- EXPECT_SIZE(3, WASM_RETURN1(WASM_ZERO));
+ EXPECT_SIZE(2, WASM_RETURN0);
+ EXPECT_SIZE(4, WASM_RETURN1(WASM_ZERO));
EXPECT_SIZE(1, WASM_UNREACHABLE);
}
TEST_F(WasmMacroGenTest, MacroStatements) {
- EXPECT_SIZE(11, WASM_WHILE(WASM_I8(0), WASM_NOP));
+ EXPECT_SIZE(10, WASM_WHILE(WASM_I8(0), WASM_NOP));
EXPECT_SIZE(7, WASM_INC_LOCAL(0));
EXPECT_SIZE(7, WASM_INC_LOCAL_BY(0, 3));
- EXPECT_SIZE(2, WASM_CONTINUE(0));
+ EXPECT_SIZE(3, WASM_BREAK(0));
+ EXPECT_SIZE(3, WASM_CONTINUE(0));
}
TEST_F(WasmMacroGenTest, BrTable) {
- EXPECT_SIZE(5, WASM_BR_TABLE(WASM_ZERO, 1, BR_TARGET(0)));
- EXPECT_SIZE(6, WASM_BR_TABLE(WASM_ZERO, 2, BR_TARGET(0), BR_TARGET(0)));
+ EXPECT_SIZE(9, WASM_BR_TABLE(WASM_ZERO, 1, BR_TARGET(1)));
+ EXPECT_SIZE(11, WASM_BR_TABLEV(WASM_ZERO, WASM_ZERO, 1, BR_TARGET(1)));
}
TEST_F(WasmMacroGenTest, Expressions) {
@@ -109,34 +110,43 @@
EXPECT_SIZE(3, WASM_NOT(WASM_ZERO));
- EXPECT_SIZE(4, WASM_BRV(1, WASM_ZERO));
- EXPECT_SIZE(6, WASM_BRV_IF(1, WASM_ZERO, WASM_ZERO));
-
- EXPECT_SIZE(5, WASM_BLOCK(WASM_ZERO));
- EXPECT_SIZE(6, WASM_BLOCK(WASM_NOP, WASM_ZERO));
- EXPECT_SIZE(7, WASM_BLOCK(WASM_NOP, WASM_NOP, WASM_ZERO));
-
- EXPECT_SIZE(5, WASM_LOOP(WASM_ZERO));
- EXPECT_SIZE(6, WASM_LOOP(WASM_NOP, WASM_ZERO));
- EXPECT_SIZE(7, WASM_LOOP(WASM_NOP, WASM_NOP, WASM_ZERO));
+ EXPECT_SIZE(5, WASM_BRV(1, WASM_ZERO));
+ EXPECT_SIZE(7, WASM_BRV_IF(1, WASM_ZERO, WASM_ZERO));
+
+ EXPECT_SIZE(4, WASM_BLOCK(WASM_ZERO));
+ EXPECT_SIZE(5, WASM_BLOCK(WASM_NOP, WASM_ZERO));
+ EXPECT_SIZE(6, WASM_BLOCK(WASM_NOP, WASM_NOP, WASM_ZERO));
+
+ EXPECT_SIZE(4, WASM_LOOP(WASM_ZERO));
+ EXPECT_SIZE(5, WASM_LOOP(WASM_NOP, WASM_ZERO));
+ EXPECT_SIZE(6, WASM_LOOP(WASM_NOP, WASM_NOP, WASM_ZERO));
}
TEST_F(WasmMacroGenTest, CallFunction) {
- EXPECT_SIZE(2, WASM_CALL_FUNCTION0(0));
- EXPECT_SIZE(2, WASM_CALL_FUNCTION0(1));
- EXPECT_SIZE(2, WASM_CALL_FUNCTION0(11));
-
- EXPECT_SIZE(4, WASM_CALL_FUNCTION(0, WASM_ZERO));
- EXPECT_SIZE(6, WASM_CALL_FUNCTION(1, WASM_ZERO, WASM_ZERO));
+ EXPECT_SIZE(3, WASM_CALL_FUNCTION0(0));
+ EXPECT_SIZE(3, WASM_CALL_FUNCTION0(1));
+ EXPECT_SIZE(3, WASM_CALL_FUNCTION0(11));
+
+ EXPECT_SIZE(5, WASM_CALL_FUNCTION1(0, WASM_ZERO));
+ EXPECT_SIZE(7, WASM_CALL_FUNCTION2(1, WASM_ZERO, WASM_ZERO));
+}
+
+TEST_F(WasmMacroGenTest, CallImport) {
+ EXPECT_SIZE(3, WASM_CALL_IMPORT0(0));
+ EXPECT_SIZE(3, WASM_CALL_IMPORT0(1));
+ EXPECT_SIZE(3, WASM_CALL_IMPORT0(11));
+
+ EXPECT_SIZE(5, WASM_CALL_IMPORT1(0, WASM_ZERO));
+ EXPECT_SIZE(7, WASM_CALL_IMPORT2(1, WASM_ZERO, WASM_ZERO));
}
TEST_F(WasmMacroGenTest, CallIndirect) {
- EXPECT_SIZE(4, WASM_CALL_INDIRECT0(0, WASM_ZERO));
- EXPECT_SIZE(4, WASM_CALL_INDIRECT0(1, WASM_ZERO));
- EXPECT_SIZE(4, WASM_CALL_INDIRECT0(11, WASM_ZERO));
-
- EXPECT_SIZE(6, WASM_CALL_INDIRECT1(0, WASM_ZERO, WASM_ZERO));
- EXPECT_SIZE(8, WASM_CALL_INDIRECT2(1, WASM_ZERO, WASM_ZERO, WASM_ZERO));
+ EXPECT_SIZE(5, WASM_CALL_INDIRECT0(0, WASM_ZERO));
+ EXPECT_SIZE(5, WASM_CALL_INDIRECT0(1, WASM_ZERO));
+ EXPECT_SIZE(5, WASM_CALL_INDIRECT0(11, WASM_ZERO));
+
+ EXPECT_SIZE(7, WASM_CALL_INDIRECT1(0, WASM_ZERO, WASM_ZERO));
+ EXPECT_SIZE(9, WASM_CALL_INDIRECT2(1, WASM_ZERO, WASM_ZERO, WASM_ZERO));
}
TEST_F(WasmMacroGenTest, Int32Ops) {
« no previous file with comments | « test/unittests/wasm/module-decoder-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698