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/objects-inl.h" | 7 #include "src/objects-inl.h" |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 #include "src/wasm/function-body-decoder-impl.h" | 10 #include "src/wasm/function-body-decoder-impl.h" |
(...skipping 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2620 | 2620 |
2621 TEST_F(WasmOpcodeLengthTest, SimdExpressions) { | 2621 TEST_F(WasmOpcodeLengthTest, SimdExpressions) { |
2622 #define TEST_SIMD(name, opcode, sig) \ | 2622 #define TEST_SIMD(name, opcode, sig) \ |
2623 EXPECT_LENGTH_N(2, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); | 2623 EXPECT_LENGTH_N(2, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); |
2624 FOREACH_SIMD_0_OPERAND_OPCODE(TEST_SIMD) | 2624 FOREACH_SIMD_0_OPERAND_OPCODE(TEST_SIMD) |
2625 #undef TEST_SIMD | 2625 #undef TEST_SIMD |
2626 #define TEST_SIMD(name, opcode, sig) \ | 2626 #define TEST_SIMD(name, opcode, sig) \ |
2627 EXPECT_LENGTH_N(3, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); | 2627 EXPECT_LENGTH_N(3, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); |
2628 FOREACH_SIMD_1_OPERAND_OPCODE(TEST_SIMD) | 2628 FOREACH_SIMD_1_OPERAND_OPCODE(TEST_SIMD) |
2629 #undef TEST_SIMD | 2629 #undef TEST_SIMD |
2630 EXPECT_LENGTH_N(6, kSimdPrefix, static_cast<byte>(kExprS32x4Shuffle & 0xff)); | |
2631 EXPECT_LENGTH_N(10, kSimdPrefix, static_cast<byte>(kExprS16x8Shuffle & 0xff)); | |
2632 EXPECT_LENGTH_N(18, kSimdPrefix, static_cast<byte>(kExprS8x16Shuffle & 0xff)); | 2630 EXPECT_LENGTH_N(18, kSimdPrefix, static_cast<byte>(kExprS8x16Shuffle & 0xff)); |
2633 #undef TEST_SIMD | 2631 #undef TEST_SIMD |
2634 // test for bad simd opcode | 2632 // test for bad simd opcode |
2635 EXPECT_LENGTH_N(2, kSimdPrefix, 0xff); | 2633 EXPECT_LENGTH_N(2, kSimdPrefix, 0xff); |
2636 } | 2634 } |
2637 | 2635 |
2638 typedef ZoneVector<ValueType> TypesOfLocals; | 2636 typedef ZoneVector<ValueType> TypesOfLocals; |
2639 | 2637 |
2640 class LocalDeclDecoderTest : public TestWithZone { | 2638 class LocalDeclDecoderTest : public TestWithZone { |
2641 public: | 2639 public: |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2811 EXPECT_EQ(3u, decls.encoded_size); | 2809 EXPECT_EQ(3u, decls.encoded_size); |
2812 EXPECT_EQ(3u, iter.pc_offset()); | 2810 EXPECT_EQ(3u, iter.pc_offset()); |
2813 EXPECT_TRUE(iter.has_next()); | 2811 EXPECT_TRUE(iter.has_next()); |
2814 EXPECT_EQ(kExprI32Const, iter.current()); | 2812 EXPECT_EQ(kExprI32Const, iter.current()); |
2815 iter.next(); | 2813 iter.next(); |
2816 EXPECT_TRUE(iter.has_next()); | 2814 EXPECT_TRUE(iter.has_next()); |
2817 EXPECT_EQ(kExprI32Const, iter.current()); | 2815 EXPECT_EQ(kExprI32Const, iter.current()); |
2818 iter.next(); | 2816 iter.next(); |
2819 EXPECT_FALSE(iter.has_next()); | 2817 EXPECT_FALSE(iter.has_next()); |
2820 } | 2818 } |
OLD | NEW |