Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1595)

Side by Side Diff: test/unittests/interpreter/interpreter-assembler-unittest.h

Issue 1783483002: [interpreter] Add support for scalable operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tests. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/machine-operator.h" 8 #include "src/compiler/machine-operator.h"
9 #include "src/interpreter/interpreter-assembler.h" 9 #include "src/interpreter/interpreter-assembler.h"
10 #include "test/unittests/test-utils.h" 10 #include "test/unittests/test-utils.h"
11 #include "testing/gmock-support.h" 11 #include "testing/gmock-support.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 namespace interpreter { 15 namespace interpreter {
16 16
17 using ::testing::Matcher; 17 using ::testing::Matcher;
18 18
19 class InterpreterAssemblerTest : public TestWithIsolateAndZone { 19 class InterpreterAssemblerTest : public TestWithIsolateAndZone {
20 public: 20 public:
21 InterpreterAssemblerTest() {} 21 InterpreterAssemblerTest() {}
22 ~InterpreterAssemblerTest() override {} 22 ~InterpreterAssemblerTest() override {}
23 23
24 class InterpreterAssemblerForTest final : public InterpreterAssembler { 24 class InterpreterAssemblerForTest final : public InterpreterAssembler {
25 public: 25 public:
26 InterpreterAssemblerForTest(InterpreterAssemblerTest* test, 26 InterpreterAssemblerForTest(InterpreterAssemblerTest* test,
27 Bytecode bytecode) 27 Bytecode bytecode, int operand_scale = 1)
28 : InterpreterAssembler(test->isolate(), test->zone(), bytecode) {} 28 : InterpreterAssembler(test->isolate(), test->zone(), bytecode,
29 operand_scale) {}
29 ~InterpreterAssemblerForTest() override {} 30 ~InterpreterAssemblerForTest() override {}
30 31
31 Matcher<compiler::Node*> IsLoad( 32 Matcher<compiler::Node*> IsLoad(
32 const Matcher<compiler::LoadRepresentation>& rep_matcher, 33 const Matcher<compiler::LoadRepresentation>& rep_matcher,
33 const Matcher<compiler::Node*>& base_matcher, 34 const Matcher<compiler::Node*>& base_matcher,
34 const Matcher<compiler::Node*>& index_matcher); 35 const Matcher<compiler::Node*>& index_matcher);
35 Matcher<compiler::Node*> IsStore( 36 Matcher<compiler::Node*> IsStore(
36 const Matcher<compiler::StoreRepresentation>& rep_matcher, 37 const Matcher<compiler::StoreRepresentation>& rep_matcher,
37 const Matcher<compiler::Node*>& base_matcher, 38 const Matcher<compiler::Node*>& base_matcher,
38 const Matcher<compiler::Node*>& index_matcher, 39 const Matcher<compiler::Node*>& index_matcher,
39 const Matcher<compiler::Node*>& value_matcher); 40 const Matcher<compiler::Node*>& value_matcher);
40 41
41 Matcher<compiler::Node*> IsBytecodeOperand(int offset); 42 Matcher<compiler::Node*> IsUnsignedByteOperand(int offset);
42 Matcher<compiler::Node*> IsBytecodeOperandSignExtended(int offset); 43 Matcher<compiler::Node*> IsSignedByteOperand(int offset);
43 Matcher<compiler::Node*> IsBytecodeOperandShort(int offset); 44 Matcher<compiler::Node*> IsUnsignedShortOperand(int offset);
44 Matcher<compiler::Node*> IsBytecodeOperandShortSignExtended(int offset); 45 Matcher<compiler::Node*> IsSignedShortOperand(int offset);
46 Matcher<compiler::Node*> IsUnsignedQuadOperand(int offset);
47 Matcher<compiler::Node*> IsSignedQuadOperand(int offset);
48
49 Matcher<compiler::Node*> IsSignedOperand(int offset,
50 OperandSize operand_size);
51 Matcher<compiler::Node*> IsUnsignedOperand(int offset,
52 OperandSize operand_size);
45 53
46 using InterpreterAssembler::graph; 54 using InterpreterAssembler::graph;
47 55
48 private: 56 private:
49 DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest); 57 DISALLOW_COPY_AND_ASSIGN(InterpreterAssemblerForTest);
50 }; 58 };
51 }; 59 };
52 60
53 } // namespace interpreter 61 } // namespace interpreter
54 } // namespace internal 62 } // namespace internal
55 } // namespace v8 63 } // namespace v8
56 64
57 #endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_ 65 #endif // V8_UNITTESTS_INTERPRETER_INTERPRETER_ASSEMBLER_UNITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698