Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index d1c893dc88c39920ba1f7ba60e0d0aa619bfc6ef..1e1ccc529775c729cc6dd96e76edb9e33d53493f 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -274,6 +274,9 @@ void LCodeGen::GenerateOsrPrologue() { |
void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { |
+ if (instr->IsCall()) { |
+ EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); |
+ } |
if (!instr->IsLazyBailout() && !instr->IsGap()) { |
safepoints_.BumpLastLazySafepointIndex(); |
} |
@@ -5462,7 +5465,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); |
@@ -5534,10 +5537,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. |