Index: src/crankshaft/hydrogen-gvn.cc |
diff --git a/src/crankshaft/hydrogen-gvn.cc b/src/crankshaft/hydrogen-gvn.cc |
index 07bfabc79ac83e0f075f3fb01fb2ab0aa6cf7d42..e6ddd7526bc4488c923bccda288898036df8ab5c 100644 |
--- a/src/crankshaft/hydrogen-gvn.cc |
+++ b/src/crankshaft/hydrogen-gvn.cc |
@@ -637,17 +637,12 @@ void HGlobalValueNumberingPhase::ProcessLoopBlock( |
} |
-bool HGlobalValueNumberingPhase::AllowCodeMotion() { |
- return info()->IsStub() || info()->opt_count() + 1 < FLAG_max_opt_count; |
-} |
- |
- |
bool HGlobalValueNumberingPhase::ShouldMove(HInstruction* instr, |
HBasicBlock* loop_header) { |
// If we've disabled code motion or we're in a block that unconditionally |
// deoptimizes, don't move any instructions. |
- return AllowCodeMotion() && !instr->block()->IsDeoptimizing() && |
- instr->block()->IsReachable(); |
+ return graph()->allow_code_motion() && !instr->block()->IsDeoptimizing() && |
+ instr->block()->IsReachable(); |
} |