Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index 5e47665c0c3c4298e33d898341f41f50642d00bc..b1919ba54e431b07abed8bfdb3986422cc343816 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -260,6 +260,9 @@ void LCodeGen::GenerateOsrPrologue() { |
void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { |
+ if (instr->IsCall()) { |
+ EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); |
+ } |
if (!instr->IsLazyBailout() && !instr->IsGap()) { |
safepoints_.BumpLastLazySafepointIndex(); |
} |
@@ -5614,7 +5617,7 @@ void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
- EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); |
+ last_lazy_deopt_pc_ = masm()->pc_offset(); |
ASSERT(instr->HasEnvironment()); |
LEnvironment* env = instr->environment(); |
RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
@@ -5686,10 +5689,7 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) { |
CallCode(isolate()->builtins()->StackCheck(), |
RelocInfo::CODE_TARGET, |
instr); |
- EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); |
__ bind(&done); |
- RegisterEnvironmentForDeoptimization(env, Safepoint::kLazyDeopt); |
- safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); |
} else { |
ASSERT(instr->hydrogen()->is_backwards_branch()); |
// Perform stack overflow check if this goto needs it before jumping. |