| 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_COMPILER_INTERPRETER_ASSEMBLER_UNITTEST_H_ | 5 #ifndef V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ |
| 6 #define V8_UNITTESTS_COMPILER_INTERPRETER_ASSEMBLER_UNITTEST_H_ | 6 #define V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ |
| 7 | 7 |
| 8 #include "src/compiler/interpreter-assembler.h" | |
| 9 #include "src/compiler/linkage.h" | |
| 10 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.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 compiler { | 15 namespace interpreter { |
| 17 | 16 |
| 18 using ::testing::Matcher; | 17 using ::testing::Matcher; |
| 19 | 18 |
| 20 class InterpreterAssemblerTest : public TestWithIsolateAndZone { | 19 class InterpreterAssemblerTest : public TestWithIsolateAndZone { |
| 21 public: | 20 public: |
| 22 InterpreterAssemblerTest() {} | 21 InterpreterAssemblerTest() {} |
| 23 ~InterpreterAssemblerTest() override {} | 22 ~InterpreterAssemblerTest() override {} |
| 24 | 23 |
| 25 class InterpreterAssemblerForTest final : public InterpreterAssembler { | 24 class InterpreterAssemblerForTest final : public InterpreterAssembler { |
| 26 public: | 25 public: |
| 27 InterpreterAssemblerForTest(InterpreterAssemblerTest* test, | 26 InterpreterAssemblerForTest(InterpreterAssemblerTest* test, |
| 28 interpreter::Bytecode bytecode) | 27 Bytecode bytecode) |
| 29 : InterpreterAssembler(test->isolate(), test->zone(), bytecode) {} | 28 : InterpreterAssembler(test->isolate(), test->zone(), bytecode) {} |
| 30 ~InterpreterAssemblerForTest() override {} | 29 ~InterpreterAssemblerForTest() override {} |
| 31 | 30 |
| 32 Matcher<Node*> IsLoad(const Matcher<LoadRepresentation>& rep_matcher, | 31 Matcher<compiler::Node*> IsLoad( |
| 33 const Matcher<Node*>& base_matcher, | 32 const Matcher<compiler::LoadRepresentation>& rep_matcher, |
| 34 const Matcher<Node*>& index_matcher); | 33 const Matcher<compiler::Node*>& base_matcher, |
| 35 Matcher<Node*> IsStore(const Matcher<StoreRepresentation>& rep_matcher, | 34 const Matcher<compiler::Node*>& index_matcher); |
| 36 const Matcher<Node*>& base_matcher, | 35 Matcher<compiler::Node*> IsStore( |
| 37 const Matcher<Node*>& index_matcher, | 36 const Matcher<compiler::StoreRepresentation>& rep_matcher, |
| 38 const Matcher<Node*>& value_matcher); | 37 const Matcher<compiler::Node*>& base_matcher, |
| 38 const Matcher<compiler::Node*>& index_matcher, |
| 39 const Matcher<compiler::Node*>& value_matcher); |
| 39 | 40 |
| 40 Matcher<Node*> IsBytecodeOperand(int offset); | 41 Matcher<compiler::Node*> IsBytecodeOperand(int offset); |
| 41 Matcher<Node*> IsBytecodeOperandSignExtended(int offset); | 42 Matcher<compiler::Node*> IsBytecodeOperandSignExtended(int offset); |
| 42 Matcher<Node*> IsBytecodeOperandShort(int offset); | 43 Matcher<compiler::Node*> IsBytecodeOperandShort(int offset); |
| 43 Matcher<Node*> IsBytecodeOperandShortSignExtended(int offset); | 44 Matcher<compiler::Node*> IsBytecodeOperandShortSignExtended(int offset); |
| 44 | 45 |
| 45 using InterpreterAssembler::call_descriptor; | |
| 46 using InterpreterAssembler::graph; | 46 using InterpreterAssembler::graph; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest); | 49 DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest); |
| 50 }; | 50 }; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace compiler | 53 } // namespace interpreter |
| 54 } // namespace internal | 54 } // namespace internal |
| 55 } // namespace v8 | 55 } // namespace v8 |
| 56 | 56 |
| 57 #endif // V8_UNITTESTS_COMPILER_INTERPRETER_ASSEMBLER_UNITTEST_H_ | 57 #endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ |
| OLD | NEW |