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

Unified Diff: test/cctest/interpreter/test-interpreter.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/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index deeb0baafd978e3f175639af8ccc47575ab8af13..d87f244318af3704fe3421e617976e7e4db33219 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -1289,3 +1289,25 @@ TEST(InterpreterTestIn) {
CHECK_EQ(return_value->BooleanValue(), expected_value);
}
}
+
+
+TEST(InterpreterCallRuntime) {
+ HandleAndZoneScope handles;
+
+ BytecodeArrayBuilder builder(handles.main_isolate(), handles.main_zone());
+ builder.set_locals_count(2);
+ builder.set_parameter_count(1);
+ builder.LoadLiteral(Smi::FromInt(15))
+ .StoreAccumulatorInRegister(Register(0))
+ .LoadLiteral(Smi::FromInt(40))
+ .StoreAccumulatorInRegister(Register(1))
+ .CallRuntime(Runtime::kAdd, Register(0), 2)
+ .Return();
+ Handle<BytecodeArray> bytecode_array = builder.ToBytecodeArray();
+
+ InterpreterTester tester(handles.main_isolate(), bytecode_array);
+ auto callable = tester.GetCallable<>();
+
+ Handle<Object> return_val = callable().ToHandleChecked();
+ CHECK_EQ(Smi::cast(*return_val), Smi::FromInt(55));
+}
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/unittests/compiler/interpreter-assembler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698