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

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: Rebase. 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
« no previous file with comments | « 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 "src/unique.h" 9 #include "src/unique.h"
10 #include "test/unittests/compiler/compiler-test-utils.h" 10 #include "test/unittests/compiler/compiler-test-utils.h"
11 #include "test/unittests/compiler/node-test-utils.h" 11 #include "test/unittests/compiler/node-test-utils.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 namespace compiler { 15 namespace compiler {
16 16
17 const interpreter::Bytecode kBytecodes[] = { 17 const interpreter::Bytecode kBytecodes[] = {
18 #define DEFINE_BYTECODE(Name, _) interpreter::Bytecode::k##Name, 18 #define DEFINE_BYTECODE(Name, ...) interpreter::Bytecode::k##Name,
19 BYTECODE_LIST(DEFINE_BYTECODE) 19 BYTECODE_LIST(DEFINE_BYTECODE)
20 #undef DEFINE_BYTECODE 20 #undef DEFINE_BYTECODE
21 }; 21 };
22 22
23 23
24 Graph* 24 Graph*
25 InterpreterAssemblerTest::InterpreterAssemblerForTest::GetCompletedGraph() { 25 InterpreterAssemblerTest::InterpreterAssemblerForTest::GetCompletedGraph() {
26 End(); 26 End();
27 return graph(); 27 return graph();
28 } 28 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 tail_call_node, 120 tail_call_node,
121 IsTailCall(m.call_descriptor(), IsHeapConstant(exit_trampoline), 121 IsTailCall(m.call_descriptor(), IsHeapConstant(exit_trampoline),
122 IsParameter(Linkage::kInterpreterBytecodeOffsetParameter), 122 IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
123 IsParameter(Linkage::kInterpreterBytecodeArrayParameter), 123 IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
124 IsParameter(Linkage::kInterpreterDispatchTableParameter), 124 IsParameter(Linkage::kInterpreterDispatchTableParameter),
125 graph->start(), graph->start())); 125 graph->start(), graph->start()));
126 } 126 }
127 } 127 }
128 128
129 129
130 TARGET_TEST_F(InterpreterAssemblerTest, BytecodeArg) { 130 TARGET_TEST_F(InterpreterAssemblerTest, BytecodeOperand) {
131 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { 131 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
132 InterpreterAssemblerForTest m(this, bytecode); 132 InterpreterAssemblerForTest m(this, bytecode);
133 int number_of_args = interpreter::Bytecodes::NumberOfArguments(bytecode); 133 int number_of_operands = interpreter::Bytecodes::NumberOfOperands(bytecode);
134 for (int i = 0; i < number_of_args; i++) { 134 for (int i = 0; i < number_of_operands; i++) {
135 Node* load_arg_node = m.BytecodeArg(i); 135 Node* load_arg_node = m.BytecodeOperand(i);
136 EXPECT_THAT( 136 EXPECT_THAT(
137 load_arg_node, 137 load_arg_node,
138 m.IsLoad( 138 m.IsLoad(
139 kMachUint8, 139 kMachUint8,
140 IsParameter(Linkage::kInterpreterBytecodeArrayParameter), 140 IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
141 IsIntPtrAdd( 141 IsIntPtrAdd(
142 IsParameter(Linkage::kInterpreterBytecodeOffsetParameter), 142 IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
143 IsInt32Constant(1 + i)))); 143 IsInt32Constant(1 + i))));
144 } 144 }
145 } 145 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 IsIntPtrSub(IsInt32Constant(m.kFirstRegisterOffsetFromFp), 205 IsIntPtrSub(IsInt32Constant(m.kFirstRegisterOffsetFromFp),
206 IsWordShl(reg_index_node, 206 IsWordShl(reg_index_node,
207 IsInt32Constant(kPointerSizeLog2))), 207 IsInt32Constant(kPointerSizeLog2))),
208 store_value)); 208 store_value));
209 } 209 }
210 } 210 }
211 211
212 } // namespace compiler 212 } // namespace compiler
213 } // namespace internal 213 } // namespace internal
214 } // namespace v8 214 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698