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

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

Issue 1568493002: [Interpreter] Add support for calling runtime functions which return a pair. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michi's review comments. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/interpreter-assembler-unittest.cc
diff --git a/test/unittests/compiler/interpreter-assembler-unittest.cc b/test/unittests/compiler/interpreter-assembler-unittest.cc
index 1e49b08e80d46b07c67aee6d2d3a861b41beb09f..f57ca05b3f16630d96fe6f620c4910f13fdb67ad 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -350,6 +350,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, BytecodeOperand) {
break;
case interpreter::OperandType::kMaybeReg8:
case interpreter::OperandType::kReg8:
+ case interpreter::OperandType::kRegPair8:
EXPECT_THAT(m.BytecodeOperandReg(i),
m.IsBytecodeOperandSignExtended(offset));
break;
@@ -592,29 +593,33 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime2) {
TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) {
+ const int kResultSizes[] = {1, 2};
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
- InterpreterAssemblerForTest m(this, bytecode);
- Callable builtin = CodeFactory::InterpreterCEntry(isolate());
-
- Node* function_id = m.Int32Constant(0);
- Node* first_arg = m.Int32Constant(1);
- Node* arg_count = m.Int32Constant(2);
-
- Matcher<Node*> function_table = IsExternalConstant(
- ExternalReference::runtime_function_table_address(isolate()));
- Matcher<Node*> function = IsIntPtrAdd(
- function_table,
- IsInt32Mul(function_id, IsInt32Constant(sizeof(Runtime::Function))));
- Matcher<Node*> function_entry =
- m.IsLoad(MachineType::Pointer(), function,
- IsInt32Constant(offsetof(Runtime::Function, entry)));
-
- Node* call_runtime = m.CallRuntime(function_id, first_arg, arg_count);
- EXPECT_THAT(
- call_runtime,
- IsCall(_, IsHeapConstant(builtin.code()), arg_count, first_arg,
- function_entry,
- IsParameter(Linkage::kInterpreterContextParameter), _, _));
+ TRACED_FOREACH(int, result_size, kResultSizes) {
+ InterpreterAssemblerForTest m(this, bytecode);
+ Callable builtin = CodeFactory::InterpreterCEntry(isolate(), result_size);
+
+ Node* function_id = m.Int32Constant(0);
+ Node* first_arg = m.Int32Constant(1);
+ Node* arg_count = m.Int32Constant(2);
+
+ Matcher<Node*> function_table = IsExternalConstant(
+ ExternalReference::runtime_function_table_address(isolate()));
+ Matcher<Node*> function = IsIntPtrAdd(
+ function_table,
+ IsInt32Mul(function_id, IsInt32Constant(sizeof(Runtime::Function))));
+ Matcher<Node*> function_entry =
+ m.IsLoad(MachineType::Pointer(), function,
+ IsInt32Constant(offsetof(Runtime::Function, entry)));
+
+ Node* call_runtime =
+ m.CallRuntime(function_id, first_arg, arg_count, result_size);
+ EXPECT_THAT(
+ call_runtime,
+ IsCall(_, IsHeapConstant(builtin.code()), arg_count, first_arg,
+ function_entry,
+ IsParameter(Linkage::kInterpreterContextParameter), _, _));
+ }
}
}
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698