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