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

Unified Diff: src/x87/builtins-x87.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/x64/builtins-x64.cc ('k') | src/x87/interface-descriptors-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/builtins-x87.cc
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc
index 9e13172c852ef516fdb1442eaf7a9e747ef843e5..c90207f04c6f691e0d1a7654ecae116e4be9d26d 100644
--- a/src/x87/builtins-x87.cc
+++ b/src/x87/builtins-x87.cc
@@ -487,21 +487,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));
// TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
// and header removal.
__ add(ebx, Immediate(Code::kHeaderSize - kHeapObjectTag));
@@ -630,10 +624,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,
@@ -655,23 +652,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));
// TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
// and header removal.
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | src/x87/interface-descriptors-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698