| 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())); | |
| 1678 | 1677 |
| 1679 if (right->IsConstantOperand()) { | 1678 if (LAddI::UseLea(instr->hydrogen()) && !left->Equals(instr->result())) { |
| 1680 __ addl(ToRegister(left), | 1679 if (right->IsConstantOperand()) { |
| 1681 Immediate(ToInteger32(LConstantOperand::cast(right)))); | 1680 int32_t offset = ToInteger32(LConstantOperand::cast(right)); |
| 1682 } else if (right->IsRegister()) { | 1681 __ lea(ToRegister(instr->result()), MemOperand(ToRegister(left), offset)); |
| 1683 __ addl(ToRegister(left), ToRegister(right)); | 1682 } else { |
| 1683 Operand address(ToRegister(left), ToRegister(right), times_1, 0); |
| 1684 __ lea(ToRegister(instr->result()), address); |
| 1685 } |
| 1684 } else { | 1686 } else { |
| 1685 __ addl(ToRegister(left), ToOperand(right)); | 1687 if (right->IsConstantOperand()) { |
| 1686 } | 1688 __ addl(ToRegister(left), |
| 1687 | 1689 Immediate(ToInteger32(LConstantOperand::cast(right)))); |
| 1688 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | 1690 } else if (right->IsRegister()) { |
| 1689 DeoptimizeIf(overflow, instr->environment()); | 1691 __ addl(ToRegister(left), ToRegister(right)); |
| 1692 } else { |
| 1693 __ addl(ToRegister(left), ToOperand(right)); |
| 1694 } |
| 1695 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { |
| 1696 DeoptimizeIf(overflow, instr->environment()); |
| 1697 } |
| 1690 } | 1698 } |
| 1691 } | 1699 } |
| 1692 | 1700 |
| 1693 | 1701 |
| 1694 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { | 1702 void LCodeGen::DoMathMinMax(LMathMinMax* instr) { |
| 1695 LOperand* left = instr->left(); | 1703 LOperand* left = instr->left(); |
| 1696 LOperand* right = instr->right(); | 1704 LOperand* right = instr->right(); |
| 1697 ASSERT(left->Equals(instr->result())); | 1705 ASSERT(left->Equals(instr->result())); |
| 1698 HMathMinMax::Operation operation = instr->hydrogen()->operation(); | 1706 HMathMinMax::Operation operation = instr->hydrogen()->operation(); |
| 1699 if (instr->hydrogen()->representation().IsInteger32()) { | 1707 if (instr->hydrogen()->representation().IsInteger32()) { |
| (...skipping 3997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5697 FixedArray::kHeaderSize - kPointerSize)); | 5705 FixedArray::kHeaderSize - kPointerSize)); |
| 5698 __ bind(&done); | 5706 __ bind(&done); |
| 5699 } | 5707 } |
| 5700 | 5708 |
| 5701 | 5709 |
| 5702 #undef __ | 5710 #undef __ |
| 5703 | 5711 |
| 5704 } } // namespace v8::internal | 5712 } } // namespace v8::internal |
| 5705 | 5713 |
| 5706 #endif // V8_TARGET_ARCH_X64 | 5714 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |