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

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

Issue 1362383002: [Interpreter] Add CallRuntime support to the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm32 debug build check errors. Created 5 years, 2 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 3f05a535b09f6f96b97b6539241574c6839c64b7..8a37c873a1a062d8237f76e005ef7f220eab6b4d 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -503,7 +503,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) {
}
-TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) {
+TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime2) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerForTest m(this, bytecode);
Node* arg1 = m.Int32Constant(2);
@@ -516,6 +516,33 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) {
}
+TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) {
+ 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(kMachPtr, function,
+ IsInt32Constant(offsetof(Runtime::Function, entry)));
+
+ Node* call_runtime = m.CallRuntime(function_id, first_arg, arg_count);
+ EXPECT_THAT(call_runtime,
+ m.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);
@@ -536,7 +563,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallIC) {
TARGET_TEST_F(InterpreterAssemblerTest, CallJS) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerForTest m(this, bytecode);
- Callable builtin = CodeFactory::PushArgsAndCall(isolate());
+ Callable builtin = CodeFactory::InterpreterPushArgsAndCall(isolate());
Node* function = m.Int32Constant(0);
Node* first_arg = m.Int32Constant(1);
Node* arg_count = m.Int32Constant(2);
« no previous file with comments | « test/cctest/interpreter/test-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