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 #ifndef V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ | 5 #ifndef V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ |
6 #define V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ | 6 #define V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ |
7 | 7 |
| 8 #include "src/compiler/code-assembler.h" |
8 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
9 #include "src/interpreter/interpreter-assembler.h" | 10 #include "src/interpreter/interpreter-assembler.h" |
10 #include "test/unittests/test-utils.h" | 11 #include "test/unittests/test-utils.h" |
11 #include "testing/gmock-support.h" | 12 #include "testing/gmock-support.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 namespace interpreter { | 16 namespace interpreter { |
16 | 17 |
17 using ::testing::Matcher; | 18 using ::testing::Matcher; |
18 | 19 |
| 20 class InterpreterAssemblerTest; |
| 21 |
| 22 class InterpreterAssemblerTestState : public compiler::CodeAssemblerState { |
| 23 public: |
| 24 InterpreterAssemblerTestState(InterpreterAssemblerTest* test, |
| 25 Bytecode bytecode); |
| 26 }; |
| 27 |
19 class InterpreterAssemblerTest : public TestWithIsolateAndZone { | 28 class InterpreterAssemblerTest : public TestWithIsolateAndZone { |
20 public: | 29 public: |
21 InterpreterAssemblerTest() {} | 30 InterpreterAssemblerTest() {} |
22 ~InterpreterAssemblerTest() override {} | 31 ~InterpreterAssemblerTest() override {} |
23 | 32 |
24 class InterpreterAssemblerForTest final : public InterpreterAssembler { | 33 class InterpreterAssemblerForTest final : public InterpreterAssembler { |
25 public: | 34 public: |
26 InterpreterAssemblerForTest( | 35 InterpreterAssemblerForTest( |
27 InterpreterAssemblerTest* test, Bytecode bytecode, | 36 InterpreterAssemblerTestState* state, Bytecode bytecode, |
28 OperandScale operand_scale = OperandScale::kSingle) | 37 OperandScale operand_scale = OperandScale::kSingle) |
29 : InterpreterAssembler(test->isolate(), test->zone(), bytecode, | 38 : InterpreterAssembler(state, bytecode, operand_scale) {} |
30 operand_scale) {} | |
31 ~InterpreterAssemblerForTest() override; | 39 ~InterpreterAssemblerForTest() override; |
32 | 40 |
33 Matcher<compiler::Node*> IsLoad( | 41 Matcher<compiler::Node*> IsLoad( |
34 const Matcher<compiler::LoadRepresentation>& rep_matcher, | 42 const Matcher<compiler::LoadRepresentation>& rep_matcher, |
35 const Matcher<compiler::Node*>& base_matcher, | 43 const Matcher<compiler::Node*>& base_matcher, |
36 const Matcher<compiler::Node*>& index_matcher); | 44 const Matcher<compiler::Node*>& index_matcher); |
37 Matcher<compiler::Node*> IsStore( | 45 Matcher<compiler::Node*> IsStore( |
38 const Matcher<compiler::StoreRepresentation>& rep_matcher, | 46 const Matcher<compiler::StoreRepresentation>& rep_matcher, |
39 const Matcher<compiler::Node*>& base_matcher, | 47 const Matcher<compiler::Node*>& base_matcher, |
40 const Matcher<compiler::Node*>& index_matcher, | 48 const Matcher<compiler::Node*>& index_matcher, |
(...skipping 14 matching lines...) Expand all Loading... |
55 private: | 63 private: |
56 DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest); | 64 DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest); |
57 }; | 65 }; |
58 }; | 66 }; |
59 | 67 |
60 } // namespace interpreter | 68 } // namespace interpreter |
61 } // namespace internal | 69 } // namespace internal |
62 } // namespace v8 | 70 } // namespace v8 |
63 | 71 |
64 #endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ | 72 #endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ |
OLD | NEW |