From c14c1b9d42217fa82063511cf76b7e428a9bd5a6 Mon Sep 17 00:00:00 2001 From: "zhengxing.li" Date: Tue, 19 Apr 2016 22:07:51 -0700 Subject: [PATCH] X87: [Interpreter] Remove register file register and replace with LoadParentFramePointer. port 623ad7de882019dff10168ef53bd539f01ef5b93 (r35618) original commit message: Removes the register file machine register from the interpreter and replaces it will loads from the parent frame pointer. As part of this change the raw operand values for register values changes to enable the interpreter to keep using the operand value as the offset from the parent frame pointer. BUG= Review URL: https://codereview.chromium.org/1903093002 Cr-Commit-Position: refs/heads/master@{#35640} --- src/x87/builtins-x87.cc | 27 +++++++-------------------- src/x87/interface-descriptors-x87.cc | 5 ++--- src/x87/macro-assembler-x87.h | 1 - 3 files changed, 9 insertions(+), 24 deletions(-) diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc index 731e0b543e..c561ac1458 100644 --- a/src/x87/builtins-x87.cc +++ b/src/x87/builtins-x87.cc @@ -614,9 +614,8 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { // Load accumulator, register file, bytecode offset, dispatch table into // registers. __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); - __ mov(kInterpreterRegisterFileRegister, ebp); - __ add(kInterpreterRegisterFileRegister, - Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); + __ mov(edx, ebp); + __ add(edx, Immediate(InterpreterFrameConstants::kRegisterFileFromFp)); __ mov(kInterpreterBytecodeOffsetRegister, Immediate(BytecodeArray::kHeaderSize - kHeapObjectTag)); __ mov(kInterpreterDispatchTableRegister, @@ -644,13 +643,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { - // TODO(rmcilroy): List of things not currently dealt with here but done in - // fullcodegen's EmitReturnSequence. - // - Supporting FLAG_trace for Runtime::TraceExit. - // - Support profiler (specifically decrementing profiling_counter - // appropriately and calling out to HandleInterrupts if necessary). - - // The return value is in accumulator, which is already in rax. + // The return value is in accumulator, which is already in eax. // Leave the frame (also dropping the register file). __ leave(); @@ -753,18 +746,14 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { - // Initialize register file register and dispatch table register. - __ mov(kInterpreterRegisterFileRegister, ebp); - __ add(kInterpreterRegisterFileRegister, - Immediate(InterpreterFrameConstants::kRegisterFilePointerFromFp)); + // Initialize the dispatch table register. __ mov(kInterpreterDispatchTableRegister, Immediate(ExternalReference::interpreter_dispatch_table_address( masm->isolate()))); // Get the bytecode array pointer from the frame. __ mov(kInterpreterBytecodeArrayRegister, - Operand(kInterpreterRegisterFileRegister, - InterpreterFrameConstants::kBytecodeArrayFromRegisterPointer)); + Operand(ebp, InterpreterFrameConstants::kBytecodeArrayFromFp)); if (FLAG_debug_code) { // Check function data field is actually a BytecodeArray object. @@ -775,10 +764,8 @@ static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { } // Get the target bytecode offset from the frame. - __ mov( - kInterpreterBytecodeOffsetRegister, - Operand(kInterpreterRegisterFileRegister, - InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); + __ mov(kInterpreterBytecodeOffsetRegister, + Operand(ebp, InterpreterFrameConstants::kBytecodeOffsetFromFp)); __ SmiUntag(kInterpreterBytecodeOffsetRegister); // Dispatch to the target bytecode. diff --git a/src/x87/interface-descriptors-x87.cc b/src/x87/interface-descriptors-x87.cc index 363408a19d..e03b65814c 100644 --- a/src/x87/interface-descriptors-x87.cc +++ b/src/x87/interface-descriptors-x87.cc @@ -379,9 +379,8 @@ void ApiCallbackDescriptorBase::InitializePlatformSpecific( void InterpreterDispatchDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { Register registers[] = { - kInterpreterAccumulatorRegister, kInterpreterRegisterFileRegister, - kInterpreterBytecodeOffsetRegister, kInterpreterBytecodeArrayRegister, - kInterpreterDispatchTableRegister}; + kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister, + kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister}; data->InitializePlatformSpecific(arraysize(registers), registers); } diff --git a/src/x87/macro-assembler-x87.h b/src/x87/macro-assembler-x87.h index ef11da0683..b130df1beb 100644 --- a/src/x87/macro-assembler-x87.h +++ b/src/x87/macro-assembler-x87.h @@ -20,7 +20,6 @@ const Register kReturnRegister2 = {Register::kCode_edi}; const Register kJSFunctionRegister = {Register::kCode_edi}; const Register kContextRegister = {Register::kCode_esi}; const Register kInterpreterAccumulatorRegister = {Register::kCode_eax}; -const Register kInterpreterRegisterFileRegister = {Register::kCode_edx}; const Register kInterpreterBytecodeOffsetRegister = {Register::kCode_ecx}; const Register kInterpreterBytecodeArrayRegister = {Register::kCode_edi}; const Register kInterpreterDispatchTableRegister = {Register::kCode_esi};