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

Unified Diff: src/compiler/interpreter-assembler.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: Adding MIPS based on https://codereview.chromium.org/1257953002/ 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
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/compiler/mips/linkage-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/interpreter-assembler.cc
diff --git a/src/compiler/interpreter-assembler.cc b/src/compiler/interpreter-assembler.cc
index 93d857c0e404560adb34ae364bcf1fb7a38d8cf0..380d653c84a3b6086d4acde2eccf8678805863c2 100644
--- a/src/compiler/interpreter-assembler.cc
+++ b/src/compiler/interpreter-assembler.cc
@@ -89,9 +89,9 @@ Node* InterpreterAssembler::RegisterFrameOffset(int index) {
Node* InterpreterAssembler::RegisterFrameOffset(Node* index) {
- return raw_assembler_->Int32Sub(
+ return raw_assembler_->IntPtrSub(
Int32Constant(kFirstRegisterOffsetFromFp),
- raw_assembler_->Word32Shl(index, Int32Constant(kPointerSizeLog2)));
+ raw_assembler_->WordShl(index, Int32Constant(kPointerSizeLog2)));
}
@@ -127,6 +127,24 @@ Node* InterpreterAssembler::StoreRegister(Node* value, Node* index) {
}
+void InterpreterAssembler::Return() {
+ Node* exit_trampoline_code_object =
+ HeapConstant(Unique<HeapObject>::CreateImmovable(
+ isolate()->builtins()->InterpreterExitTrampoline()));
+ // If the order of the parameters you need to change the call signature below.
+ STATIC_ASSERT(0 == Linkage::kInterpreterBytecodeOffsetParameter);
+ STATIC_ASSERT(1 == Linkage::kInterpreterBytecodeArrayParameter);
+ STATIC_ASSERT(2 == Linkage::kInterpreterDispatchTableParameter);
+ Node* tail_call = graph()->NewNode(
+ common()->TailCall(call_descriptor()), exit_trampoline_code_object,
+ BytecodeOffset(), BytecodeArrayPointer(), DispatchTablePointer(),
+ graph()->start(), graph()->start());
+ schedule()->AddTailCall(raw_assembler_->CurrentBlock(), tail_call);
+ // This should always be the end node.
+ SetEndInput(tail_call);
+}
+
+
Node* InterpreterAssembler::Advance(int delta) {
return raw_assembler_->IntPtrAdd(BytecodeOffset(), Int32Constant(delta));
}
@@ -153,7 +171,6 @@ void InterpreterAssembler::Dispatch() {
new_bytecode_offset, BytecodeArrayPointer(), DispatchTablePointer(),
graph()->start(), graph()->start());
schedule()->AddTailCall(raw_assembler_->CurrentBlock(), tail_call);
-
// This should always be the end node.
SetEndInput(tail_call);
}
@@ -210,6 +227,11 @@ Node* InterpreterAssembler::NumberConstant(double value) {
}
+Node* InterpreterAssembler::HeapConstant(Unique<HeapObject> object) {
+ return raw_assembler_->HeapConstant(object);
+}
+
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/interpreter-assembler.h ('k') | src/compiler/mips/linkage-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698