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_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
10 | 10 |
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 return result; | 1395 return result; |
1396 } | 1396 } |
1397 | 1397 |
1398 | 1398 |
1399 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { | 1399 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { |
1400 DCHECK(instr->representation().IsSmiOrInteger32()); | 1400 DCHECK(instr->representation().IsSmiOrInteger32()); |
1401 DCHECK(instr->left()->representation().Equals(instr->representation())); | 1401 DCHECK(instr->left()->representation().Equals(instr->representation())); |
1402 DCHECK(instr->right()->representation().Equals(instr->representation())); | 1402 DCHECK(instr->right()->representation().Equals(instr->representation())); |
1403 LOperand* dividend = UseRegister(instr->left()); | 1403 LOperand* dividend = UseRegister(instr->left()); |
1404 LOperand* divisor = UseRegister(instr->right()); | 1404 LOperand* divisor = UseRegister(instr->right()); |
1405 LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor); | 1405 LInstruction* result = |
1406 return AssignEnvironment(DefineAsRegister(div)); | 1406 DefineAsRegister(new (zone()) LFlooringDivI(dividend, divisor)); |
| 1407 if (instr->CheckFlag(HValue::kCanBeDivByZero) || |
| 1408 instr->CheckFlag(HValue::kBailoutOnMinusZero) || |
| 1409 (instr->CheckFlag(HValue::kCanOverflow))) { |
| 1410 result = AssignEnvironment(result); |
| 1411 } |
| 1412 return result; |
1407 } | 1413 } |
1408 | 1414 |
1409 | 1415 |
1410 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { | 1416 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { |
1411 if (instr->RightIsPowerOf2()) { | 1417 if (instr->RightIsPowerOf2()) { |
1412 return DoFlooringDivByPowerOf2I(instr); | 1418 return DoFlooringDivByPowerOf2I(instr); |
1413 } else if (instr->right()->IsConstant()) { | 1419 } else if (instr->right()->IsConstant()) { |
1414 return DoFlooringDivByConstI(instr); | 1420 return DoFlooringDivByConstI(instr); |
1415 } else { | 1421 } else { |
1416 return DoFlooringDivI(instr); | 1422 return DoFlooringDivI(instr); |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2583 LOperand* function = UseRegisterAtStart(instr->function()); | 2589 LOperand* function = UseRegisterAtStart(instr->function()); |
2584 LAllocateBlockContext* result = | 2590 LAllocateBlockContext* result = |
2585 new(zone()) LAllocateBlockContext(context, function); | 2591 new(zone()) LAllocateBlockContext(context, function); |
2586 return MarkAsCall(DefineFixed(result, cp), instr); | 2592 return MarkAsCall(DefineFixed(result, cp), instr); |
2587 } | 2593 } |
2588 | 2594 |
2589 | 2595 |
2590 } } // namespace v8::internal | 2596 } } // namespace v8::internal |
2591 | 2597 |
2592 #endif // V8_TARGET_ARCH_MIPS64 | 2598 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |