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

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

Issue 1257543003: [Interpreter] Add more bytecode definitions and add operand types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Preprocessor robust method of describing bytecode operands. Created 5 years, 4 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
« src/interpreter/interpreter.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "test/unittests/compiler/interpreter-assembler-unittest.h" 5 #include "test/unittests/compiler/interpreter-assembler-unittest.h"
6 6
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/node.h" 8 #include "src/compiler/node.h"
9 #include "test/unittests/compiler/compiler-test-utils.h" 9 #include "test/unittests/compiler/compiler-test-utils.h"
10 #include "test/unittests/compiler/node-test-utils.h" 10 #include "test/unittests/compiler/node-test-utils.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 namespace compiler { 14 namespace compiler {
15 15
16 const interpreter::Bytecode kBytecodes[] = { 16 const interpreter::Bytecode kBytecodes[] = {
17 #define DEFINE_BYTECODE(Name, _) interpreter::Bytecode::k##Name, 17 #define DEFINE_BYTECODE(Name, ...) interpreter::Bytecode::k##Name,
18 BYTECODE_LIST(DEFINE_BYTECODE) 18 BYTECODE_LIST(DEFINE_BYTECODE)
19 #undef DEFINE_BYTECODE 19 #undef DEFINE_BYTECODE
20 }; 20 };
21 21
22 22
23 Graph* 23 Graph*
24 InterpreterAssemblerTest::InterpreterAssemblerForTest::GetCompletedGraph() { 24 InterpreterAssemblerTest::InterpreterAssemblerForTest::GetCompletedGraph() {
25 End(); 25 End();
26 return graph(); 26 return graph();
27 } 27 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 next_bytecode_matcher, 89 next_bytecode_matcher,
90 IsParameter(Linkage::kInterpreterDispatchTableParameter), 90 IsParameter(Linkage::kInterpreterDispatchTableParameter),
91 graph->start(), graph->start())); 91 graph->start(), graph->start()));
92 } 92 }
93 } 93 }
94 94
95 95
96 TARGET_TEST_F(InterpreterAssemblerTest, BytecodeArg) { 96 TARGET_TEST_F(InterpreterAssemblerTest, BytecodeArg) {
97 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { 97 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
98 InterpreterAssemblerForTest m(this, bytecode); 98 InterpreterAssemblerForTest m(this, bytecode);
99 int number_of_args = interpreter::Bytecodes::NumberOfArguments(bytecode); 99 int number_of_args = interpreter::Bytecodes::NumberOfOperands(bytecode);
100 for (int i = 0; i < number_of_args; i++) { 100 for (int i = 0; i < number_of_args; i++) {
101 Node* load_arg_node = m.BytecodeArg(i); 101 Node* load_arg_node = m.BytecodeArg(i);
102 EXPECT_THAT(load_arg_node, 102 EXPECT_THAT(load_arg_node,
103 m.IsLoad(kMachUint8, 103 m.IsLoad(kMachUint8,
104 IsParameter(Linkage::kInterpreterBytecodeParameter), 104 IsParameter(Linkage::kInterpreterBytecodeParameter),
105 IsInt32Constant(1 + i))); 105 IsInt32Constant(1 + i)));
106 } 106 }
107 } 107 }
108 } 108 }
109 109
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 IsInt32Sub(IsInt32Constant(m.kFirstRegisterOffsetFromFp), 167 IsInt32Sub(IsInt32Constant(m.kFirstRegisterOffsetFromFp),
168 IsWord32Shl(reg_index_node, 168 IsWord32Shl(reg_index_node,
169 IsInt32Constant(kPointerSizeLog2))), 169 IsInt32Constant(kPointerSizeLog2))),
170 store_value)); 170 store_value));
171 } 171 }
172 } 172 }
173 173
174 } // namespace compiler 174 } // namespace compiler
175 } // namespace internal 175 } // namespace internal
176 } // namespace v8 176 } // namespace v8
OLDNEW
« src/interpreter/interpreter.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698