Index: src/a64/lithium-codegen-a64.cc |
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc |
index 060c1da52c6826f4212148b53b9c6817c103bf9c..eee981872693bc283e959e62b53a8968fff8b91d 100644 |
--- a/src/a64/lithium-codegen-a64.cc |
+++ b/src/a64/lithium-codegen-a64.cc |
@@ -770,6 +770,9 @@ void LCodeGen::GenerateOsrPrologue() { |
void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { |
+ if (instr->IsCall()) { |
+ EnsureSpaceForLazyDeopt(Deoptimizer::patch_size()); |
+ } |
if (!instr->IsLazyBailout() && !instr->IsGap()) { |
safepoints_.BumpLastLazySafepointIndex(); |
} |
@@ -2549,7 +2552,7 @@ void LCodeGen::DoCheckValue(LCheckValue* instr) { |
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); |
@@ -4942,11 +4945,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. |