Index: src/x87/builtins-x87.cc |
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc |
index 3e1e2569693ac4d838cec24e6ed28058ad41ddd8..b18f573d667109028f89a57ccb3798daefce7680 100644 |
--- a/src/x87/builtins-x87.cc |
+++ b/src/x87/builtins-x87.cc |
@@ -759,22 +759,7 @@ void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
} |
-static void Generate_InterpreterNotifyDeoptimizedHelper( |
- MacroAssembler* masm, Deoptimizer::BailoutType type) { |
- // Enter an internal frame. |
- { |
- FrameScope scope(masm, StackFrame::INTERNAL); |
- __ Push(kInterpreterAccumulatorRegister); // Save accumulator register. |
- |
- // Pass the deoptimization type to the runtime system. |
- __ Push(Smi::FromInt(static_cast<int>(type))); |
- |
- __ CallRuntime(Runtime::kNotifyDeoptimized); |
- |
- __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register. |
- // Tear down internal frame. |
- } |
- |
+static void Generate_EnterBytecodeDispatch(MacroAssembler* masm) { |
// Initialize register file register. |
__ mov(kInterpreterRegisterFileRegister, ebp); |
__ add(kInterpreterRegisterFileRegister, |
@@ -802,12 +787,13 @@ static void Generate_InterpreterNotifyDeoptimizedHelper( |
InterpreterFrameConstants::kBytecodeOffsetFromRegisterPointer)); |
__ SmiUntag(kInterpreterBytecodeOffsetRegister); |
- // Push dispatch table as a stack located parameter to the bytecode handler - |
- // overwrite the state slot (we don't use these for interpreter deopts). |
+ // Push dispatch table as a stack located parameter to the bytecode handler. |
__ LoadRoot(ebx, Heap::kInterpreterTableRootIndex); |
__ add(ebx, Immediate(FixedArray::kHeaderSize - kHeapObjectTag)); |
DCHECK_EQ(-1, kInterpreterDispatchTableSpillSlot); |
- __ mov(Operand(esp, kPointerSize), ebx); |
+ __ Pop(esi); |
+ __ Push(ebx); |
+ __ Push(esi); |
// Dispatch to the target bytecode. |
__ movzx_b(esi, Operand(kInterpreterBytecodeArrayRegister, |
@@ -828,6 +814,34 @@ static void Generate_InterpreterNotifyDeoptimizedHelper( |
} |
+static void Generate_InterpreterNotifyDeoptimizedHelper( |
+ MacroAssembler* masm, Deoptimizer::BailoutType type) { |
+ // Enter an internal frame. |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ Push(kInterpreterAccumulatorRegister); // Save accumulator register. |
+ |
+ // Pass the deoptimization type to the runtime system. |
+ __ Push(Smi::FromInt(static_cast<int>(type))); |
+ |
+ __ CallRuntime(Runtime::kNotifyDeoptimized); |
+ |
+ __ Pop(kInterpreterAccumulatorRegister); // Restore accumulator register. |
+ // Tear down internal frame. |
+ } |
+ |
+ // Drop state (we don't use these for interpreter deopts) and push PC at top |
+ // of stack (to simulate initial call to bytecode handler in interpreter entry |
+ // trampoline). |
+ __ Pop(ebx); |
+ __ Drop(1); |
+ __ Push(ebx); |
+ |
+ // Enter the bytecode dispatch. |
+ Generate_EnterBytecodeDispatch(masm); |
+} |
+ |
+ |
void Builtins::Generate_InterpreterNotifyDeoptimized(MacroAssembler* masm) { |
Generate_InterpreterNotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
} |
@@ -843,6 +857,11 @@ void Builtins::Generate_InterpreterNotifyLazyDeoptimized(MacroAssembler* masm) { |
} |
+void Builtins::Generate_InterpreterEnterExceptionHandler(MacroAssembler* masm) { |
+ Generate_EnterBytecodeDispatch(masm); |
+} |
+ |
+ |
void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
GenerateTailCallToReturnedCode(masm); |