Index: src/mips64/lithium-mips64.cc |
diff --git a/src/mips64/lithium-mips64.cc b/src/mips64/lithium-mips64.cc |
index 664fdd0846f017e12ecf010d5d792713fc481730..c2192944346ef3240d5a26282bbf9bca87624ed0 100644 |
--- a/src/mips64/lithium-mips64.cc |
+++ b/src/mips64/lithium-mips64.cc |
@@ -1402,8 +1402,14 @@ LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { |
DCHECK(instr->right()->representation().Equals(instr->representation())); |
LOperand* dividend = UseRegister(instr->left()); |
LOperand* divisor = UseRegister(instr->right()); |
- LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor); |
- return AssignEnvironment(DefineAsRegister(div)); |
+ LInstruction* result = |
+ DefineAsRegister(new (zone()) LFlooringDivI(dividend, divisor)); |
+ if (instr->CheckFlag(HValue::kCanBeDivByZero) || |
+ instr->CheckFlag(HValue::kBailoutOnMinusZero) || |
+ (instr->CheckFlag(HValue::kCanOverflow))) { |
+ result = AssignEnvironment(result); |
+ } |
+ return result; |
} |