OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1667 if (FLAG_debug_code) { | 1667 if (FLAG_debug_code) { |
1668 Comment("Unreachable code."); | 1668 Comment("Unreachable code."); |
1669 __ int3(); | 1669 __ int3(); |
1670 } | 1670 } |
1671 } | 1671 } |
1672 | 1672 |
1673 | 1673 |
1674 void LCodeGen::DoAddI(LAddI* instr) { | 1674 void LCodeGen::DoAddI(LAddI* instr) { |
1675 LOperand* left = instr->left(); | 1675 LOperand* left = instr->left(); |
1676 LOperand* right = instr->right(); | 1676 LOperand* right = instr->right(); |
| 1677 ASSERT(left->Equals(instr->result())); |
1677 | 1678 |
1678 if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) { | 1679 if (right->IsConstantOperand()) { |
1679 if (right->IsConstantOperand()) { | 1680 __ addl(ToRegister(left), |
1680 int32_t offset = ToInteger32(LConstantOperand::cast(right)); | 1681 Immediate(ToInteger32(LConstantOperand::cast(right)))); |
1681 __ lea(ToRegister(instr->result()), MemOperand(ToRegister(left), offset)); | 1682 } else if (right->IsRegister()) { |
1682 } else { | 1683 __ addl(ToRegister(left), ToRegister(right)); |
1683 Operand address(ToRegister(left), ToRegister(right), times_1, 0); | |
1684 __ lea(ToRegister(instr->result()), address); | |
1685 } | |
1686 } else { | 1684 } else { |
1687 if (right->IsConstantOperand()) { | 1685 __ addl(ToRegister(left), ToOperand(right)); |
1688 __ addl(ToRegister(left), | 1686 } |
1689 Immediate(ToInteger32(LConstantOperand::cast(right)))); | 1687 |
1690 } else if (right->IsRegister()) { | 1688 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
1691 __ addl(ToRegister(left), ToRegister(right)); | 1689 DeoptimizeIf(overflow, instr->environment()); |
1692 } else { | |
1693 __ addl(ToRegister(left), ToOperand(right)); | |
1694 } | |
1695 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | |
1696 DeoptimizeIf(overflow, instr->environment()); | |
1697 } | |
1698 } | 1690 } |
1699 } | 1691 } |
1700 | 1692 |
1701 | 1693 |
1702 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { | 1694 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
1703 LOperand* left = instr->left(); | 1695 LOperand* left = instr->left(); |
1704 LOperand* right = instr->right(); | 1696 LOperand* right = instr->right(); |
1705 ASSERT(left->Equals(instr->result())); | 1697 ASSERT(left->Equals(instr->result())); |
1706 HMathMinMax::Operation operation = instr->hydrogen()->operation(); | 1698 HMathMinMax::Operation operation = instr->hydrogen()->operation(); |
1707 if (instr->hydrogen()->representation().IsInteger32()) { | 1699 if (instr->hydrogen()->representation().IsInteger32()) { |
(...skipping 3989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5697 FixedArray::kHeaderSize - kPointerSize)); | 5689 FixedArray::kHeaderSize - kPointerSize)); |
5698 __ bind(&done); | 5690 __ bind(&done); |
5699 } | 5691 } |
5700 | 5692 |
5701 | 5693 |
5702 #undef __ | 5694 #undef __ |
5703 | 5695 |
5704 } } // namespace v8::internal | 5696 } } // namespace v8::internal |
5705 | 5697 |
5706 #endif // V8_TARGET_ARCH_X64 | 5698 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |