| 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 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2628 | 2628 |
| 2629 TEST_F(WasmOpcodeLengthTest, SimdExpressions) { | 2629 TEST_F(WasmOpcodeLengthTest, SimdExpressions) { |
| 2630 #define TEST_SIMD(name, opcode, sig) \ | 2630 #define TEST_SIMD(name, opcode, sig) \ |
| 2631 EXPECT_LENGTH_N(2, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); | 2631 EXPECT_LENGTH_N(2, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); |
| 2632 FOREACH_SIMD_0_OPERAND_OPCODE(TEST_SIMD) | 2632 FOREACH_SIMD_0_OPERAND_OPCODE(TEST_SIMD) |
| 2633 #undef TEST_SIMD | 2633 #undef TEST_SIMD |
| 2634 #define TEST_SIMD(name, opcode, sig) \ | 2634 #define TEST_SIMD(name, opcode, sig) \ |
| 2635 EXPECT_LENGTH_N(3, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); | 2635 EXPECT_LENGTH_N(3, kSimdPrefix, static_cast<byte>(kExpr##name & 0xff)); |
| 2636 FOREACH_SIMD_1_OPERAND_OPCODE(TEST_SIMD) | 2636 FOREACH_SIMD_1_OPERAND_OPCODE(TEST_SIMD) |
| 2637 #undef TEST_SIMD | 2637 #undef TEST_SIMD |
| 2638 EXPECT_LENGTH_N(6, kSimdPrefix, static_cast<byte>(kExprS32x4Shuffle & 0xff)); |
| 2639 EXPECT_LENGTH_N(10, kSimdPrefix, static_cast<byte>(kExprS16x8Shuffle & 0xff)); |
| 2640 EXPECT_LENGTH_N(18, kSimdPrefix, static_cast<byte>(kExprS8x16Shuffle & 0xff)); |
| 2641 #undef TEST_SIMD |
| 2638 // test for bad simd opcode | 2642 // test for bad simd opcode |
| 2639 EXPECT_LENGTH_N(2, kSimdPrefix, 0xff); | 2643 EXPECT_LENGTH_N(2, kSimdPrefix, 0xff); |
| 2640 } | 2644 } |
| 2641 | 2645 |
| 2642 typedef ZoneVector<ValueType> TypesOfLocals; | 2646 typedef ZoneVector<ValueType> TypesOfLocals; |
| 2643 | 2647 |
| 2644 class LocalDeclDecoderTest : public TestWithZone { | 2648 class LocalDeclDecoderTest : public TestWithZone { |
| 2645 public: | 2649 public: |
| 2646 v8::internal::AccountingAllocator allocator; | 2650 v8::internal::AccountingAllocator allocator; |
| 2647 | 2651 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2819 iter.next(); | 2823 iter.next(); |
| 2820 EXPECT_TRUE(iter.has_next()); | 2824 EXPECT_TRUE(iter.has_next()); |
| 2821 EXPECT_EQ(kExprI32Const, iter.current()); | 2825 EXPECT_EQ(kExprI32Const, iter.current()); |
| 2822 iter.next(); | 2826 iter.next(); |
| 2823 EXPECT_FALSE(iter.has_next()); | 2827 EXPECT_FALSE(iter.has_next()); |
| 2824 } | 2828 } |
| 2825 | 2829 |
| 2826 } // namespace wasm | 2830 } // namespace wasm |
| 2827 } // namespace internal | 2831 } // namespace internal |
| 2828 } // namespace v8 | 2832 } // namespace v8 |
| OLD | NEW |