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

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

Issue 1245133002: [interpreter] Add Interpreter{Entry,Exit}Trampoline builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@oth_bytecode_array
Patch Set: Modified to deal with seperate BytecodeArray and BytecodeOffset registers Created 5 years, 5 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
« src/arm/builtins-arm.cc ('K') | « src/interpreter/interpreter.cc ('k') | no next file » | 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 7bc91ce994e2698ae7fe854ff6f73dc50eef9ca9..b6955d99162a72bf8fa9ba488d8f36974f956159 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -6,6 +6,7 @@
#include "src/compiler/graph.h"
#include "src/compiler/node.h"
+#include "src/unique.h"
#include "test/unittests/compiler/compiler-test-utils.h"
#include "test/unittests/compiler/node-test-utils.h"
@@ -86,6 +87,32 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) {
}
+TARGET_TEST_F(InterpreterAssemblerTest, Return) {
+ TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
+ InterpreterAssemblerForTest m(this, bytecode);
+ m.Return();
+ Graph* graph = m.GetCompletedGraph();
+
+ Node* end = graph->end();
+ EXPECT_EQ(1, end->InputCount());
+ Node* tail_call_node = end->InputAt(0);
+
+ EXPECT_EQ(CallDescriptor::kInterpreterDispatch,
+ m.call_descriptor()->kind());
+ Matcher<Unique<HeapObject>> exit_trampoline(
+ Unique<HeapObject>::CreateImmovable(
+ isolate()->builtins()->InterpreterExitTrampoline()));
+ EXPECT_THAT(
+ tail_call_node,
+ IsTailCall(m.call_descriptor(), IsHeapConstant(exit_trampoline),
+ IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ IsParameter(Linkage::kInterpreterDispatchTableParameter),
+ graph->start(), graph->start()));
+ }
+}
+
+
TARGET_TEST_F(InterpreterAssemblerTest, BytecodeArg) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
InterpreterAssemblerForTest m(this, bytecode);
« src/arm/builtins-arm.cc ('K') | « src/interpreter/interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698