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