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

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: 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
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..339b61b5b9832aeb5f0fb27805aefc8f0f6cff56 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -619,6 +619,34 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) {
}
+TARGET_TEST_F(InterpreterAssemblerTest, CallRuntimePair) {
+ TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
+ InterpreterAssemblerForTest m(this, bytecode);
+ Callable builtin = CodeFactory::InterpreterCEntryPair(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), _, _));
+ }
+}
+
+
TARGET_TEST_F(InterpreterAssemblerTest, CallIC) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerForTest m(this, bytecode);

Powered by Google App Engine
This is Rietveld 408576698