Index: src/x87/deoptimizer-x87.cc |
diff --git a/src/x87/deoptimizer-x87.cc b/src/x87/deoptimizer-x87.cc |
index f31f915efdeb8f2a4b75575e604fa3575e88a96e..99c31f26e28df5092a9cafe44a954aecddb58a46 100644 |
--- a/src/x87/deoptimizer-x87.cc |
+++ b/src/x87/deoptimizer-x87.cc |
@@ -246,7 +246,12 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
__ push(edi); |
// Allocate a new deoptimizer object. |
__ PrepareCallCFunction(6, eax); |
+ __ mov(eax, Immediate(0)); |
+ Label context_check; |
+ __ mov(edi, Operand(ebp, CommonFrameConstants::kContextOrFrameTypeOffset)); |
+ __ JumpIfSmi(edi, &context_check); |
__ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
+ __ bind(&context_check); |
__ mov(Operand(esp, 0 * kPointerSize), eax); // Function. |
__ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. |
__ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. |