Index: src/compiler/instruction-scheduler.cc |
diff --git a/src/compiler/instruction-scheduler.cc b/src/compiler/instruction-scheduler.cc |
index a49e3a557d09ef80b0adb692660b47cd17b320e6..c7fd1ccd667b145bac22d4275665ebb051026e35 100644 |
--- a/src/compiler/instruction-scheduler.cc |
+++ b/src/compiler/instruction-scheduler.cc |
@@ -136,9 +136,9 @@ void InstructionScheduler::AddInstruction(Instruction* instr) { |
last_live_in_reg_marker_->AddSuccessor(new_node); |
} |
- // Make sure that new instructions are not scheduled before the last |
- // deoptimization point. |
- if (last_deopt_ != nullptr) { |
+ // Make sure that instructions are not scheduled before the last |
+ // deoptimization point when they depend on it. |
+ if ((last_deopt_ != nullptr) && DependsOnDeoptimization(instr)) { |
last_deopt_->AddSuccessor(new_node); |
} |