OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 return result; | 1394 return result; |
1395 } | 1395 } |
1396 | 1396 |
1397 | 1397 |
1398 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { | 1398 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { |
1399 DCHECK(instr->representation().IsSmiOrInteger32()); | 1399 DCHECK(instr->representation().IsSmiOrInteger32()); |
1400 DCHECK(instr->left()->representation().Equals(instr->representation())); | 1400 DCHECK(instr->left()->representation().Equals(instr->representation())); |
1401 DCHECK(instr->right()->representation().Equals(instr->representation())); | 1401 DCHECK(instr->right()->representation().Equals(instr->representation())); |
1402 LOperand* dividend = UseRegister(instr->left()); | 1402 LOperand* dividend = UseRegister(instr->left()); |
1403 LOperand* divisor = UseRegister(instr->right()); | 1403 LOperand* divisor = UseRegister(instr->right()); |
1404 LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor); | 1404 LInstruction* result = |
1405 return AssignEnvironment(DefineAsRegister(div)); | 1405 DefineAsRegister(new (zone()) LFlooringDivI(dividend, divisor)); |
| 1406 if (instr->CheckFlag(HValue::kCanBeDivByZero) || |
| 1407 instr->CheckFlag(HValue::kBailoutOnMinusZero) || |
| 1408 (instr->CheckFlag(HValue::kCanOverflow))) { |
| 1409 result = AssignEnvironment(result); |
| 1410 } |
| 1411 return result; |
1406 } | 1412 } |
1407 | 1413 |
1408 | 1414 |
1409 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { | 1415 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { |
1410 if (instr->RightIsPowerOf2()) { | 1416 if (instr->RightIsPowerOf2()) { |
1411 return DoFlooringDivByPowerOf2I(instr); | 1417 return DoFlooringDivByPowerOf2I(instr); |
1412 } else if (instr->right()->IsConstant()) { | 1418 } else if (instr->right()->IsConstant()) { |
1413 return DoFlooringDivByConstI(instr); | 1419 return DoFlooringDivByConstI(instr); |
1414 } else { | 1420 } else { |
1415 return DoFlooringDivI(instr); | 1421 return DoFlooringDivI(instr); |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2583 LOperand* context = UseFixed(instr->context(), cp); | 2589 LOperand* context = UseFixed(instr->context(), cp); |
2584 LOperand* function = UseRegisterAtStart(instr->function()); | 2590 LOperand* function = UseRegisterAtStart(instr->function()); |
2585 LAllocateBlockContext* result = | 2591 LAllocateBlockContext* result = |
2586 new(zone()) LAllocateBlockContext(context, function); | 2592 new(zone()) LAllocateBlockContext(context, function); |
2587 return MarkAsCall(DefineFixed(result, cp), instr); | 2593 return MarkAsCall(DefineFixed(result, cp), instr); |
2588 } | 2594 } |
2589 | 2595 |
2590 } } // namespace v8::internal | 2596 } } // namespace v8::internal |
2591 | 2597 |
2592 #endif // V8_TARGET_ARCH_MIPS | 2598 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |