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

Unified Diff: src/ia32/builtins-ia32.cc

Issue 1887493004: [Interpreter] No longer require context machine register in bytecode handlers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_dispatch
Patch Set: Fix x87 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/compiler/linkage.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/builtins-ia32.cc
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
index e70e94c8b6b2b62cddb3e6bc3d0d6f5b07499c3a..098bb6b2da5c00ae1d44ab72b2f846c8212e77ec 100644
--- a/src/ia32/builtins-ia32.cc
+++ b/src/ia32/builtins-ia32.cc
@@ -597,21 +597,15 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp));
__ mov(kInterpreterBytecodeOffsetRegister,
Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag));
- __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address(
- masm->isolate())));
-
- // Push dispatch table as a stack located parameter to the bytecode handler.
- DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
- __ push(ebx);
+ __ mov(kInterpreterDispatchTableRegister,
+ Immediate(ExternalReference::interpreter_dispatch_table_address(
+ masm->isolate())));
// Dispatch to the first bytecode handler for the function.
- __ movzx_b(eax, Operand(kInterpreterBytecodeArrayRegister,
+ __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, times_1, 0));
- __ mov(ebx, Operand(ebx, eax, times_pointer_size, 0));
- // Restore undefined_value in accumulator (eax)
- // TODO(rmcilroy): Remove this once we move the dispatch table back into a
- // register.
- __ mov(eax, Immediate(masm->isolate()->factory()->undefined_value()));
+ __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx,
+ times_pointer_size, 0));
__ call(ebx);
// Even though the first bytecode handler was called, we will never return.
@@ -737,10 +731,13 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
- // Initialize register file register.
+ // Initialize register file register and dispatch table register.
__ mov(kInterpreterRegisterFileRegister, ebp);
__ add(kInterpreterRegisterFileRegister,
Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp));
+ __ mov(kInterpreterDispatchTableRegister,
+ Immediate(ExternalReference::interpreter_dispatch_table_address(
+ masm->isolate())));
// Get the bytecode array pointer from the frame.
__ mov(kInterpreterBytecodeArrayRegister,
@@ -762,23 +759,11 @@ static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) {
InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer));
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
- // Push dispatch table as a stack located parameter to the bytecode handler.
- __ mov(ebx, Immediate(ExternalReference::interpreter_dispatch_table_address(
- masm->isolate())));
- DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot);
- __ Pop(esi);
- __ Push(ebx);
- __ Push(esi);
-
// Dispatch to the target bytecode.
- __ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister,
+ __ movzx_b(ebx, Operand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister, times_1, 0));
- __ mov(ebx, Operand(ebx, esi, times_pointer_size, 0));
-
- // Get the context from the frame.
- __ mov(kContextRegister,
- Operand(kInterpreterRegisterFileRegister,
- InterpreterFrameConstants::kContextFromRegisterPointer));
+ __ mov(ebx, Operand(kInterpreterDispatchTableRegister, ebx,
+ times_pointer_size, 0));
__ jmp(ebx);
}
« no previous file with comments | « src/compiler/linkage.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698