OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); | 1650 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); |
1651 LInstruction* result = use_lea | 1651 LInstruction* result = use_lea |
1652 ? DefineAsRegister(add) | 1652 ? DefineAsRegister(add) |
1653 : DefineSameAsFirst(add); | 1653 : DefineSameAsFirst(add); |
1654 if (can_overflow) { | 1654 if (can_overflow) { |
1655 result = AssignEnvironment(result); | 1655 result = AssignEnvironment(result); |
1656 } | 1656 } |
1657 return result; | 1657 return result; |
1658 } else if (instr->representation().IsDouble()) { | 1658 } else if (instr->representation().IsDouble()) { |
1659 return DoArithmeticD(Token::ADD, instr); | 1659 return DoArithmeticD(Token::ADD, instr); |
| 1660 } else if (instr->representation().IsExternal()) { |
| 1661 ASSERT(instr->left()->representation().IsExternal()); |
| 1662 ASSERT(instr->right()->representation().IsInteger32()); |
| 1663 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); |
| 1664 bool use_lea = LAddI::UseLea(instr); |
| 1665 LOperand* left = UseRegisterAtStart(instr->left()); |
| 1666 HValue* right_candidate = instr->right(); |
| 1667 LOperand* right = use_lea |
| 1668 ? UseRegisterOrConstantAtStart(right_candidate) |
| 1669 : UseOrConstantAtStart(right_candidate); |
| 1670 LAddI* add = new(zone()) LAddI(left, right); |
| 1671 LInstruction* result = use_lea |
| 1672 ? DefineAsRegister(add) |
| 1673 : DefineSameAsFirst(add); |
| 1674 return result; |
1660 } else { | 1675 } else { |
1661 return DoArithmeticT(Token::ADD, instr); | 1676 return DoArithmeticT(Token::ADD, instr); |
1662 } | 1677 } |
1663 } | 1678 } |
1664 | 1679 |
1665 | 1680 |
1666 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { | 1681 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { |
1667 LOperand* left = NULL; | 1682 LOperand* left = NULL; |
1668 LOperand* right = NULL; | 1683 LOperand* right = NULL; |
1669 if (instr->representation().IsSmiOrInteger32()) { | 1684 if (instr->representation().IsSmiOrInteger32()) { |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2767 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2782 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2768 LOperand* object = UseRegister(instr->object()); | 2783 LOperand* object = UseRegister(instr->object()); |
2769 LOperand* index = UseTempRegister(instr->index()); | 2784 LOperand* index = UseTempRegister(instr->index()); |
2770 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2785 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2771 } | 2786 } |
2772 | 2787 |
2773 | 2788 |
2774 } } // namespace v8::internal | 2789 } } // namespace v8::internal |
2775 | 2790 |
2776 #endif // V8_TARGET_ARCH_IA32 | 2791 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |