Chromium Code Reviews| Index: src/a64/lithium-a64.cc |
| diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc |
| index a6a22905e9593ec665958ad0cfb41bc4104f0b02..74fddabccfcf229f93997060b73a3cb858f359ca 100644 |
| --- a/src/a64/lithium-a64.cc |
| +++ b/src/a64/lithium-a64.cc |
| @@ -506,15 +506,6 @@ LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, |
| instr->MarkAsCall(); |
| instr = AssignPointerMap(instr); |
| - if (hinstr->HasObservableSideEffects()) { |
| - ASSERT(hinstr->next()->IsSimulate()); |
| - HSimulate* sim = HSimulate::cast(hinstr->next()); |
| - ASSERT(instruction_pending_deoptimization_environment_ == NULL); |
| - ASSERT(pending_deoptimization_ast_id_.IsNone()); |
| - instruction_pending_deoptimization_environment_ = instr; |
| - pending_deoptimization_ast_id_ = sim->ast_id(); |
| - } |
| - |
| // If instruction does not have side-effects lazy deoptimization |
| // after the call will try to deoptimize to the point before the call. |
| // Thus we still need to attach environment to this call even if |
| @@ -736,6 +727,27 @@ void LChunkBuilder::VisitInstruction(HInstruction* current) { |
| instr = AssignEnvironment(instr); |
| } |
| chunk_->AddInstruction(instr, current_block_); |
| + |
| + if (instr->IsCall()) { |
| + HValue* hydrogen_value_for_lazy_bailout = current; |
| + if (current->HasObservableSideEffects()) { |
| + HSimulate* sim = HSimulate::cast(current->next()); |
| + ASSERT(instruction_pending_deoptimization_environment_ == NULL); |
| + instruction_pending_deoptimization_environment_ = instr; |
| + sim->ReplayEnvironment(current_block_->last_environment()); |
| + hydrogen_value_for_lazy_bailout = sim; |
| + } |
| + LInstruction* bailout = AssignEnvironment(new(zone()) LLazyBailout()); |
| + bailout->set_hydrogen_value(hydrogen_value_for_lazy_bailout); |
| + chunk_->AddInstruction(bailout, current_block_); |
| + if (instruction_pending_deoptimization_environment_ != NULL) { |
| + // Store the lazy deopt environment with the instruction if needed. |
| + // Right now it is only used for LInstanceOfKnownGlobal. |
| + instruction_pending_deoptimization_environment_-> |
|
Jarin
2014/03/12 00:33:58
Cannot instruction_pending_deoptimization_environm
Jakob Kummerow
2014/03/12 09:39:49
A very good point indeed. Done.
|
| + SetDeferredLazyDeoptimizationEnvironment(bailout->environment()); |
| + instruction_pending_deoptimization_environment_ = NULL; |
| + } |
| + } |
| } |
| current_instruction_ = old_current; |
| } |
| @@ -2107,21 +2119,6 @@ LInstruction* LChunkBuilder::DoShr(HShr* instr) { |
| LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { |
| instr->ReplayEnvironment(current_block_->last_environment()); |
| - |
| - // If there is an instruction pending deoptimization environment create a |
| - // lazy bailout instruction to capture the environment. |
| - if (pending_deoptimization_ast_id_ == instr->ast_id()) { |
| - LInstruction* result = new(zone()) LLazyBailout; |
| - result = AssignEnvironment(result); |
| - // Store the lazy deopt environment with the instruction if needed. Right |
| - // now it is only used for LInstanceOfKnownGlobal. |
| - instruction_pending_deoptimization_environment_-> |
| - SetDeferredLazyDeoptimizationEnvironment(result->environment()); |
| - instruction_pending_deoptimization_environment_ = NULL; |
| - pending_deoptimization_ast_id_ = BailoutId::None(); |
| - return result; |
| - } |
| - |
| return NULL; |
| } |