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 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, | 1586 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, |
1587 multiplicand_op)); | 1587 multiplicand_op)); |
1588 } | 1588 } |
1589 | 1589 |
1590 | 1590 |
1591 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { | 1591 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { |
1592 if (instr->representation().IsSmiOrInteger32()) { | 1592 if (instr->representation().IsSmiOrInteger32()) { |
1593 DCHECK(instr->left()->representation().Equals(instr->representation())); | 1593 DCHECK(instr->left()->representation().Equals(instr->representation())); |
1594 DCHECK(instr->right()->representation().Equals(instr->representation())); | 1594 DCHECK(instr->right()->representation().Equals(instr->representation())); |
1595 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); | 1595 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); |
1596 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); | 1596 LOperand* right = UseRegisterOrConstantAtStart(instr->BetterRightOperand()); |
1597 LAddI* add = new(zone()) LAddI(left, right); | 1597 LAddI* add = new(zone()) LAddI(left, right); |
1598 LInstruction* result = DefineAsRegister(add); | 1598 LInstruction* result = DefineAsRegister(add); |
1599 if (instr->CheckFlag(HValue::kCanOverflow)) { | 1599 if (instr->CheckFlag(HValue::kCanOverflow)) { |
1600 result = AssignEnvironment(result); | 1600 result = AssignEnvironment(result); |
1601 } | 1601 } |
1602 return result; | 1602 return result; |
1603 } else if (instr->representation().IsExternal()) { | 1603 } else if (instr->representation().IsExternal()) { |
1604 DCHECK(instr->left()->representation().IsExternal()); | 1604 DCHECK(instr->left()->representation().IsExternal()); |
1605 DCHECK(instr->right()->representation().IsInteger32()); | 1605 DCHECK(instr->right()->representation().IsInteger32()); |
1606 DCHECK(!instr->CheckFlag(HValue::kCanOverflow)); | 1606 DCHECK(!instr->CheckFlag(HValue::kCanOverflow)); |
1607 LOperand* left = UseRegisterAtStart(instr->left()); | 1607 LOperand* left = UseRegisterAtStart(instr->left()); |
1608 LOperand* right = UseOrConstantAtStart(instr->right()); | 1608 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); |
1609 LAddI* add = new(zone()) LAddI(left, right); | 1609 return DefineAsRegister(new (zone()) LAddE(left, right)); |
1610 LInstruction* result = DefineAsRegister(add); | |
1611 return result; | |
1612 } else if (instr->representation().IsDouble()) { | 1610 } else if (instr->representation().IsDouble()) { |
1613 if (kArchVariant == kMips64r2) { | 1611 if (kArchVariant == kMips64r2) { |
1614 if (instr->left()->IsMul()) | 1612 if (instr->left()->IsMul()) |
1615 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); | 1613 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); |
1616 | 1614 |
1617 if (instr->right()->IsMul()) { | 1615 if (instr->right()->IsMul()) { |
1618 DCHECK(!instr->left()->IsMul()); | 1616 DCHECK(!instr->left()->IsMul()); |
1619 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); | 1617 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); |
1620 } | 1618 } |
1621 } | 1619 } |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2617 LAllocateBlockContext* result = | 2615 LAllocateBlockContext* result = |
2618 new(zone()) LAllocateBlockContext(context, function); | 2616 new(zone()) LAllocateBlockContext(context, function); |
2619 return MarkAsCall(DefineFixed(result, cp), instr); | 2617 return MarkAsCall(DefineFixed(result, cp), instr); |
2620 } | 2618 } |
2621 | 2619 |
2622 | 2620 |
2623 } // namespace internal | 2621 } // namespace internal |
2624 } // namespace v8 | 2622 } // namespace v8 |
2625 | 2623 |
2626 #endif // V8_TARGET_ARCH_MIPS64 | 2624 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |