| Index: src/ia32/builtins-ia32.cc
|
| diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
|
| index bf4ee949ed29be5be0cf4b661922a30873f5ebec..9f5aabef2b24bd8096a10da70a5815a8d3c8de86 100644
|
| --- a/src/ia32/builtins-ia32.cc
|
| +++ b/src/ia32/builtins-ia32.cc
|
| @@ -627,32 +627,35 @@ static void Generate_NotifyDeoptimizedHelper(MacroAssembler* masm,
|
| Deoptimizer::BailoutType type) {
|
| {
|
| FrameScope scope(masm, StackFrame::INTERNAL);
|
| -
|
| + // Registers set in the output frame that need to be preserved.
|
| + if (type == Deoptimizer::LAZY) {
|
| + __ push(eax); // Exception when throwing to optimized code.
|
| + }
|
| // Pass deoptimization type to the runtime system.
|
| __ push(Immediate(Smi::FromInt(static_cast<int>(type))));
|
| __ CallRuntime(Runtime::kNotifyDeoptimized, 1);
|
|
|
| + if (type == Deoptimizer::LAZY) {
|
| + __ pop(eax);
|
| + }
|
| // Tear down internal frame.
|
| }
|
|
|
| - // Get the full codegen state from the stack and untag it.
|
| - __ mov(ecx, Operand(esp, 1 * kPointerSize));
|
| - __ SmiUntag(ecx);
|
| -
|
| // Switch on the state.
|
| - Label not_no_registers, not_tos_eax;
|
| - __ cmp(ecx, FullCodeGenerator::NO_REGISTERS);
|
| + Label not_no_registers;
|
| + __ cmp(Operand(esp, 1 * kPointerSize),
|
| + Immediate(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)));
|
| __ j(not_equal, ¬_no_registers, Label::kNear);
|
| __ ret(1 * kPointerSize); // Remove state.
|
|
|
| __ bind(¬_no_registers);
|
| __ mov(eax, Operand(esp, 2 * kPointerSize));
|
| - __ cmp(ecx, FullCodeGenerator::TOS_REG);
|
| - __ j(not_equal, ¬_tos_eax, Label::kNear);
|
| + if (masm->emit_debug_code()) {
|
| + __ cmp(Operand(esp, 1 * kPointerSize),
|
| + Immediate(Smi::FromInt(FullCodeGenerator::TOS_REG)));
|
| + __ Assert(equal, "Invalid deoptimization state.");
|
| + }
|
| __ ret(2 * kPointerSize); // Remove state, eax.
|
| -
|
| - __ bind(¬_tos_eax);
|
| - __ Abort("no cases left");
|
| }
|
|
|
|
|
|
|