| Index: src/ia32/builtins-ia32.cc
|
| diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
|
| index d979525701080897975606e8a12154fc92b0051d..8c1ca799bb5d2cecf45492d548b13b79d725b986 100644
|
| --- a/src/ia32/builtins-ia32.cc
|
| +++ b/src/ia32/builtins-ia32.cc
|
| @@ -758,22 +758,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,
|
| @@ -801,12 +786,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,
|
| @@ -827,6 +813,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);
|
| }
|
| @@ -842,6 +856,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);
|
|
|