| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1670 } else if (source.IsQuadStackSlot()) { | 1670 } else if (source.IsQuadStackSlot()) { |
| 1671 if (destination.IsFpuRegister()) { | 1671 if (destination.IsFpuRegister()) { |
| 1672 __ movups(destination.fpu_reg(), source.ToStackSlotAddress()); | 1672 __ movups(destination.fpu_reg(), source.ToStackSlotAddress()); |
| 1673 } else { | 1673 } else { |
| 1674 ASSERT(destination.IsQuadStackSlot()); | 1674 ASSERT(destination.IsQuadStackSlot()); |
| 1675 __ movups(XMM0, source.ToStackSlotAddress()); | 1675 __ movups(XMM0, source.ToStackSlotAddress()); |
| 1676 __ movups(destination.ToStackSlotAddress(), XMM0); | 1676 __ movups(destination.ToStackSlotAddress(), XMM0); |
| 1677 } | 1677 } |
| 1678 } else { | 1678 } else { |
| 1679 ASSERT(source.IsConstant()); | 1679 ASSERT(source.IsConstant()); |
| 1680 const Object& constant = source.constant(); |
| 1680 if (destination.IsRegister()) { | 1681 if (destination.IsRegister()) { |
| 1681 const Object& constant = source.constant(); | |
| 1682 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) { | 1682 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) { |
| 1683 __ xorq(destination.reg(), destination.reg()); | 1683 __ xorq(destination.reg(), destination.reg()); |
| 1684 } else { | 1684 } else { |
| 1685 __ LoadObject(destination.reg(), constant, PP); | 1685 __ LoadObject(destination.reg(), constant, PP); |
| 1686 } | 1686 } |
| 1687 } else if (destination.IsFpuRegister()) { |
| 1688 __ LoadObject(TMP, constant, PP); |
| 1689 __ movsd(destination.fpu_reg(), |
| 1690 FieldAddress(TMP, Double::value_offset())); |
| 1687 } else { | 1691 } else { |
| 1688 ASSERT(destination.IsStackSlot()); | 1692 ASSERT(destination.IsStackSlot()); |
| 1689 StoreObject(destination.ToStackSlotAddress(), source.constant()); | 1693 StoreObject(destination.ToStackSlotAddress(), constant); |
| 1690 } | 1694 } |
| 1691 } | 1695 } |
| 1692 | 1696 |
| 1693 move->Eliminate(); | 1697 move->Eliminate(); |
| 1694 } | 1698 } |
| 1695 | 1699 |
| 1696 | 1700 |
| 1697 void ParallelMoveResolver::EmitSwap(int index) { | 1701 void ParallelMoveResolver::EmitSwap(int index) { |
| 1698 MoveOperands* move = moves_[index]; | 1702 MoveOperands* move = moves_[index]; |
| 1699 const Location source = move->src(); | 1703 const Location source = move->src(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 __ movups(reg, Address(RSP, 0)); | 1828 __ movups(reg, Address(RSP, 0)); |
| 1825 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1829 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
| 1826 } | 1830 } |
| 1827 | 1831 |
| 1828 | 1832 |
| 1829 #undef __ | 1833 #undef __ |
| 1830 | 1834 |
| 1831 } // namespace dart | 1835 } // namespace dart |
| 1832 | 1836 |
| 1833 #endif // defined TARGET_ARCH_X64 | 1837 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |