| Index: src/mips/lithium-mips.cc
|
| diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
|
| index ccdbcdb5db37017d1bab9f593e62fa1182e8d940..36f1b9583a606671f78abc2532ee942b54a299e9 100644
|
| --- a/src/mips/lithium-mips.cc
|
| +++ b/src/mips/lithium-mips.cc
|
| @@ -1290,7 +1290,7 @@ LInstruction* LChunkBuilder::DoDivByConstI(HDiv* instr) {
|
| }
|
|
|
|
|
| -LInstruction* LChunkBuilder::DoDivI(HBinaryOperation* instr) {
|
| +LInstruction* LChunkBuilder::DoDivI(HDiv* instr) {
|
| ASSERT(instr->representation().IsSmiOrInteger32());
|
| ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| ASSERT(instr->right()->representation().Equals(instr->representation()));
|
| @@ -1351,13 +1351,24 @@ LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) {
|
| }
|
|
|
|
|
| +LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) {
|
| + ASSERT(instr->representation().IsSmiOrInteger32());
|
| + ASSERT(instr->left()->representation().Equals(instr->representation()));
|
| + ASSERT(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* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
|
| if (instr->RightIsPowerOf2()) {
|
| return DoFlooringDivByPowerOf2I(instr);
|
| } else if (instr->right()->IsConstant()) {
|
| return DoFlooringDivByConstI(instr);
|
| } else {
|
| - return DoDivI(instr);
|
| + return DoFlooringDivI(instr);
|
| }
|
| }
|
|
|
|
|