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

Unified Diff: src/interpreter/interpreter-assembler.cc

Issue 1882073002: [Interpreter] Make dispatch table point to code entry instead of code objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix visiting dispatch table. Created 4 years, 8 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/interpreter/interpreter-assembler.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index a0b508eefc0926cd9c29b8b0c41ce2037308076b..f5961b7e53a0d83aa2474b564f4cd63dcf8f0d48 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -559,17 +559,22 @@ void InterpreterAssembler::DispatchTo(Node* new_bytecode_offset) {
TraceBytecodeDispatch(target_bytecode);
}
- // TODO(rmcilroy): Create a code target dispatch table to avoid conversion
- // from code object on every dispatch.
- Node* target_code_object =
+ Node* target_code_entry =
Load(MachineType::Pointer(), DispatchTableRawPointer(),
WordShl(target_bytecode, IntPtrConstant(kPointerSizeLog2)));
- DispatchToBytecodeHandler(target_code_object, new_bytecode_offset);
+ DispatchToBytecodeHandlerEntry(target_code_entry, new_bytecode_offset);
}
void InterpreterAssembler::DispatchToBytecodeHandler(Node* handler,
Node* bytecode_offset) {
+ Node* handler_entry =
+ IntPtrAdd(handler, IntPtrConstant(Code::kHeaderSize - kHeapObjectTag));
+ DispatchToBytecodeHandlerEntry(handler_entry, bytecode_offset);
+}
+
+void InterpreterAssembler::DispatchToBytecodeHandlerEntry(
+ Node* handler_entry, Node* bytecode_offset) {
if (FLAG_trace_ignition) {
TraceBytecode(Runtime::kInterpreterTraceBytecodeExit);
}
@@ -578,7 +583,7 @@ void InterpreterAssembler::DispatchToBytecodeHandler(Node* handler,
Node* args[] = {GetAccumulatorUnchecked(), RegisterFileRawPointer(),
bytecode_offset, BytecodeArrayTaggedPointer(),
DispatchTableRawPointer(), GetContext()};
- TailCall(descriptor, handler, args, 0);
+ TailCallBytecodeDispatch(descriptor, handler_entry, args);
}
void InterpreterAssembler::DispatchWide(OperandScale operand_scale) {
@@ -613,11 +618,11 @@ void InterpreterAssembler::DispatchWide(OperandScale operand_scale) {
base_index = nullptr;
}
Node* target_index = IntPtrAdd(base_index, next_bytecode);
- Node* target_code_object =
+ Node* target_code_entry =
Load(MachineType::Pointer(), DispatchTableRawPointer(),
WordShl(target_index, kPointerSizeLog2));
- DispatchToBytecodeHandler(target_code_object, next_bytecode_offset);
+ DispatchToBytecodeHandlerEntry(target_code_entry, next_bytecode_offset);
}
void InterpreterAssembler::InterpreterReturn() {
« no previous file with comments | « src/interpreter/interpreter-assembler.h ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698