OLD | NEW |
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 EXPECT_SIZE(5, WASM_F32(10000.0f)); | 42 EXPECT_SIZE(5, WASM_F32(10000.0f)); |
43 EXPECT_SIZE(5, WASM_F32(-9828934.0f)); | 43 EXPECT_SIZE(5, WASM_F32(-9828934.0f)); |
44 | 44 |
45 EXPECT_SIZE(9, WASM_F64(1.5)); | 45 EXPECT_SIZE(9, WASM_F64(1.5)); |
46 EXPECT_SIZE(9, WASM_F64(10200.0)); | 46 EXPECT_SIZE(9, WASM_F64(10200.0)); |
47 EXPECT_SIZE(9, WASM_F64(-9818934.0)); | 47 EXPECT_SIZE(9, WASM_F64(-9818934.0)); |
48 } | 48 } |
49 | 49 |
50 TEST_F(WasmMacroGenTest, Statements) { | 50 TEST_F(WasmMacroGenTest, Statements) { |
51 EXPECT_SIZE(1, WASM_NOP); | 51 EXPECT_SIZE(1, WASM_NOP); |
52 EXPECT_SIZE(1, WASM_END); | |
53 | 52 |
54 EXPECT_SIZE(4, WASM_SET_LOCAL(0, WASM_ZERO)); | 53 EXPECT_SIZE(4, WASM_SET_LOCAL(0, WASM_ZERO)); |
55 | 54 |
56 EXPECT_SIZE(4, WASM_SET_GLOBAL(0, WASM_ZERO)); | 55 EXPECT_SIZE(4, WASM_SET_GLOBAL(0, WASM_ZERO)); |
57 | 56 |
58 EXPECT_SIZE(7, WASM_STORE_MEM(MachineType::Int32(), WASM_ZERO, WASM_ZERO)); | 57 EXPECT_SIZE(7, WASM_STORE_MEM(MachineType::Int32(), WASM_ZERO, WASM_ZERO)); |
59 | 58 |
60 EXPECT_SIZE(6, WASM_IF(WASM_ZERO, WASM_NOP)); | 59 EXPECT_SIZE(6, WASM_IF(WASM_ZERO, WASM_NOP)); |
61 | 60 |
62 EXPECT_SIZE(8, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP)); | 61 EXPECT_SIZE(8, WASM_IF_ELSE(WASM_ZERO, WASM_NOP, WASM_NOP)); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO)); | 303 EXPECT_SIZE(5, WASM_LOAD_MEM_OFFSET(kMemTypes[i], 11, WASM_ZERO)); |
305 } | 304 } |
306 for (size_t i = 0; i < arraysize(kMemTypes); i++) { | 305 for (size_t i = 0; i < arraysize(kMemTypes); i++) { |
307 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO, | 306 EXPECT_SIZE(7, WASM_STORE_MEM_OFFSET(kMemTypes[i], 13, WASM_ZERO, |
308 WASM_GET_LOCAL(0))); | 307 WASM_GET_LOCAL(0))); |
309 } | 308 } |
310 } | 309 } |
311 } // namespace wasm | 310 } // namespace wasm |
312 } // namespace internal | 311 } // namespace internal |
313 } // namespace v8 | 312 } // namespace v8 |
OLD | NEW |