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

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

Issue 2170773003: [wasm] Remove the explicit count from WASM_BLOCK and WASM_LOOP macros. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « test/unittests/wasm/loop-assignment-analysis-unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "test/unittests/test-utils.h" 5 #include "test/unittests/test-utils.h"
6 6
7 #include "src/wasm/wasm-macro-gen.h" 7 #include "src/wasm/wasm-macro-gen.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 EXPECT_SIZE(5, WASM_IF(WASM_ZERO, WASM_NOP)); 59 EXPECT_SIZE(5, WASM_IF(WASM_ZERO, WASM_NOP));
60 60
61 EXPECT_SIZE(7, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP)); 61 EXPECT_SIZE(7, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP));
62 62
63 EXPECT_SIZE(5, WASM_SELECT(WASM_ZERO, WASM_NOP, WASM_NOP)); 63 EXPECT_SIZE(5, WASM_SELECT(WASM_ZERO, WASM_NOP, WASM_NOP));
64 64
65 EXPECT_SIZE(3, WASM_BR(0)); 65 EXPECT_SIZE(3, WASM_BR(0));
66 EXPECT_SIZE(5, WASM_BR_IF(0, WASM_ZERO)); 66 EXPECT_SIZE(5, WASM_BR_IF(0, WASM_ZERO));
67 67
68 EXPECT_SIZE(3, WASM_BLOCK(1, WASM_NOP)); 68 EXPECT_SIZE(3, WASM_BLOCK(WASM_NOP));
69 EXPECT_SIZE(4, WASM_BLOCK(2, WASM_NOP, WASM_NOP)); 69 EXPECT_SIZE(4, WASM_BLOCK(WASM_NOP, WASM_NOP));
70 EXPECT_SIZE(5, WASM_BLOCK(3, WASM_NOP, WASM_NOP, WASM_NOP)); 70 EXPECT_SIZE(5, WASM_BLOCK(WASM_NOP, WASM_NOP, WASM_NOP));
71 71
72 EXPECT_SIZE(5, WASM_INFINITE_LOOP); 72 EXPECT_SIZE(5, WASM_INFINITE_LOOP);
73 73
74 EXPECT_SIZE(3, WASM_LOOP(1, WASM_NOP)); 74 EXPECT_SIZE(3, WASM_LOOP(WASM_NOP));
75 EXPECT_SIZE(4, WASM_LOOP(2, WASM_NOP, WASM_NOP)); 75 EXPECT_SIZE(4, WASM_LOOP(WASM_NOP, WASM_NOP));
76 EXPECT_SIZE(5, WASM_LOOP(3, WASM_NOP, WASM_NOP, WASM_NOP)); 76 EXPECT_SIZE(5, WASM_LOOP(WASM_NOP, WASM_NOP, WASM_NOP));
77 EXPECT_SIZE(5, WASM_LOOP(1, WASM_BR(0))); 77 EXPECT_SIZE(5, WASM_LOOP(WASM_BR(0)));
78 EXPECT_SIZE(7, WASM_LOOP(1, WASM_BR_IF(0, WASM_ZERO))); 78 EXPECT_SIZE(7, WASM_LOOP(WASM_BR_IF(0, WASM_ZERO)));
79 79
80 EXPECT_SIZE(2, WASM_RETURN0); 80 EXPECT_SIZE(2, WASM_RETURN0);
81 EXPECT_SIZE(4, WASM_RETURN1(WASM_ZERO)); 81 EXPECT_SIZE(4, WASM_RETURN1(WASM_ZERO));
82 82
83 EXPECT_SIZE(1, WASM_UNREACHABLE); 83 EXPECT_SIZE(1, WASM_UNREACHABLE);
84 } 84 }
85 85
86 TEST_F(WasmMacroGenTest, MacroStatements) { 86 TEST_F(WasmMacroGenTest, MacroStatements) {
87 EXPECT_SIZE(10, WASM_WHILE(WASM_I8(0), WASM_NOP)); 87 EXPECT_SIZE(10, WASM_WHILE(WASM_I8(0), WASM_NOP));
88 EXPECT_SIZE(7, WASM_INC_LOCAL(0)); 88 EXPECT_SIZE(7, WASM_INC_LOCAL(0));
(...skipping 17 matching lines...) Expand all
106 EXPECT_SIZE(2, WASM_LOAD_GLOBAL(12)); 106 EXPECT_SIZE(2, WASM_LOAD_GLOBAL(12));
107 EXPECT_SIZE(5, WASM_LOAD_MEM(MachineType::Int32(), WASM_ZERO)); 107 EXPECT_SIZE(5, WASM_LOAD_MEM(MachineType::Int32(), WASM_ZERO));
108 EXPECT_SIZE(5, WASM_LOAD_MEM(MachineType::Float64(), WASM_ZERO)); 108 EXPECT_SIZE(5, WASM_LOAD_MEM(MachineType::Float64(), WASM_ZERO));
109 EXPECT_SIZE(5, WASM_LOAD_MEM(MachineType::Float32(), WASM_ZERO)); 109 EXPECT_SIZE(5, WASM_LOAD_MEM(MachineType::Float32(), WASM_ZERO));
110 110
111 EXPECT_SIZE(3, WASM_NOT(WASM_ZERO)); 111 EXPECT_SIZE(3, WASM_NOT(WASM_ZERO));
112 112
113 EXPECT_SIZE(5, WASM_BRV(1, WASM_ZERO)); 113 EXPECT_SIZE(5, WASM_BRV(1, WASM_ZERO));
114 EXPECT_SIZE(7, WASM_BRV_IF(1, WASM_ZERO, WASM_ZERO)); 114 EXPECT_SIZE(7, WASM_BRV_IF(1, WASM_ZERO, WASM_ZERO));
115 115
116 EXPECT_SIZE(4, WASM_BLOCK(1, WASM_ZERO)); 116 EXPECT_SIZE(4, WASM_BLOCK(WASM_ZERO));
117 EXPECT_SIZE(5, WASM_BLOCK(2, WASM_NOP, WASM_ZERO)); 117 EXPECT_SIZE(5, WASM_BLOCK(WASM_NOP, WASM_ZERO));
118 EXPECT_SIZE(6, WASM_BLOCK(3, WASM_NOP, WASM_NOP, WASM_ZERO)); 118 EXPECT_SIZE(6, WASM_BLOCK(WASM_NOP, WASM_NOP, WASM_ZERO));
119 119
120 EXPECT_SIZE(4, WASM_LOOP(1, WASM_ZERO)); 120 EXPECT_SIZE(4, WASM_LOOP(WASM_ZERO));
121 EXPECT_SIZE(5, WASM_LOOP(2, WASM_NOP, WASM_ZERO)); 121 EXPECT_SIZE(5, WASM_LOOP(WASM_NOP, WASM_ZERO));
122 EXPECT_SIZE(6, WASM_LOOP(3, WASM_NOP, WASM_NOP, WASM_ZERO)); 122 EXPECT_SIZE(6, WASM_LOOP(WASM_NOP, WASM_NOP, WASM_ZERO));
123 } 123 }
124 124
125 TEST_F(WasmMacroGenTest, CallFunction) { 125 TEST_F(WasmMacroGenTest, CallFunction) {
126 EXPECT_SIZE(3, WASM_CALL_FUNCTION0(0)); 126 EXPECT_SIZE(3, WASM_CALL_FUNCTION0(0));
127 EXPECT_SIZE(3, WASM_CALL_FUNCTION0(1)); 127 EXPECT_SIZE(3, WASM_CALL_FUNCTION0(1));
128 EXPECT_SIZE(3, WASM_CALL_FUNCTION0(11)); 128 EXPECT_SIZE(3, WASM_CALL_FUNCTION0(11));
129 129
130 EXPECT_SIZE(5, WASM_CALL_FUNCTION1(0, WASM_ZERO)); 130 EXPECT_SIZE(5, WASM_CALL_FUNCTION1(0, WASM_ZERO));
131 EXPECT_SIZE(7, WASM_CALL_FUNCTION2(1, WASM_ZERO, WASM_ZERO)); 131 EXPECT_SIZE(7, WASM_CALL_FUNCTION2(1, WASM_ZERO, WASM_ZERO));
132 } 132 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO)); 313 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO));
314 } 314 }
315 for (size_t i = 0; i < arraysize(kMemTypes); i++) { 315 for (size_t i = 0; i < arraysize(kMemTypes); i++) {
316 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO, 316 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO,
317 WASM_GET_LOCAL(0))); 317 WASM_GET_LOCAL(0)));
318 } 318 }
319 } 319 }
320 } // namespace wasm 320 } // namespace wasm
321 } // namespace internal 321 } // namespace internal
322 } // namespace v8 322 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/wasm/loop-assignment-analysis-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698