Index: src/crankshaft/mips64/lithium-mips64.cc |
diff --git a/src/crankshaft/mips64/lithium-mips64.cc b/src/crankshaft/mips64/lithium-mips64.cc |
index 52736f70d0823c91dedb61b1ac10b295c7c1fd60..6e3ef9651b732da11d7f4cccabb341832e323a9b 100644 |
--- a/src/crankshaft/mips64/lithium-mips64.cc |
+++ b/src/crankshaft/mips64/lithium-mips64.cc |
@@ -897,6 +897,11 @@ void LChunkBuilder::AddInstruction(LInstruction* instr, |
// Push return value on top of outer environment. |
hydrogen_env = hydrogen_env->Copy(); |
hydrogen_env->Push(hydrogen_val); |
+ } else { |
+ // Although we don't need this lazy bailout for normal execution |
+ // (because when we tail call from the outermost function we should pop |
+ // its frame) we still need it when debugger is on. |
+ hydrogen_env = current_block_->last_environment(); |
} |
} else { |
if (hydrogen_val->HasObservableSideEffects()) { |
@@ -905,16 +910,10 @@ void LChunkBuilder::AddInstruction(LInstruction* instr, |
hydrogen_value_for_lazy_bailout = sim; |
} |
} |
- if (hydrogen_env != nullptr) { |
- // The |hydrogen_env| can be null at this point only if we are generating |
- // a syntactic tail call from the outermost function but in this case |
- // it would be a real tail call which will pop function's frame and |
- // therefore this lazy bailout can be skipped. |
- LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( |
- new (zone()) LLazyBailout(), hydrogen_env); |
- bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
- chunk_->AddInstruction(bailout, current_block_); |
- } |
+ LInstruction* bailout = LChunkBuilderBase::AssignEnvironment( |
+ new (zone()) LLazyBailout(), hydrogen_env); |
+ bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
+ chunk_->AddInstruction(bailout, current_block_); |
} |
} |