Index: src/mips/lithium-mips.cc |
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc |
index 7d5ffadd49aaa12e621d75569cdfef82bc575a9f..47aac304929e84c7250b066f147517dd6666efcb 100644 |
--- a/src/mips/lithium-mips.cc |
+++ b/src/mips/lithium-mips.cc |
@@ -1401,8 +1401,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; |
} |