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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 __ movups(XMM0, source.ToStackSlotAddress()); | 1570 __ movups(XMM0, source.ToStackSlotAddress()); |
1571 __ movups(destination.ToStackSlotAddress(), XMM0); | 1571 __ movups(destination.ToStackSlotAddress(), XMM0); |
1572 } | 1572 } |
1573 } else { | 1573 } else { |
1574 ASSERT(source.IsConstant()); | 1574 ASSERT(source.IsConstant()); |
1575 if (destination.IsRegister()) { | 1575 if (destination.IsRegister()) { |
1576 const Object& constant = source.constant(); | 1576 const Object& constant = source.constant(); |
1577 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) { | 1577 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) { |
1578 __ xorl(destination.reg(), destination.reg()); | 1578 __ xorl(destination.reg(), destination.reg()); |
1579 } else if (constant.IsSmi() && | 1579 } else if (constant.IsSmi() && |
1580 source.constant_instruction()->representation() == kUnboxedInt32) { | 1580 (source.constant_instruction()->representation() == kUnboxedInt32)) { |
1581 __ movl(destination.reg(), Immediate(Smi::Cast(constant).Value())); | 1581 __ movl(destination.reg(), Immediate(Smi::Cast(constant).Value())); |
1582 } else { | 1582 } else { |
1583 __ LoadObjectSafely(destination.reg(), constant); | 1583 __ LoadObjectSafely(destination.reg(), constant); |
1584 } | 1584 } |
1585 } else if (destination.IsFpuRegister()) { | 1585 } else if (destination.IsFpuRegister()) { |
1586 const Double& constant = Double::Cast(source.constant()); | 1586 const Double& constant = Double::Cast(source.constant()); |
1587 uword addr = FlowGraphBuilder::FindDoubleConstant(constant.value()); | 1587 uword addr = FlowGraphBuilder::FindDoubleConstant(constant.value()); |
1588 if (addr == 0) { | 1588 if (addr == 0) { |
1589 __ pushl(EAX); | 1589 __ pushl(EAX); |
1590 __ LoadObject(EAX, constant); | 1590 __ LoadObject(EAX, constant); |
(...skipping 16 matching lines...) Expand all Loading... |
1607 } else if (Utils::DoublesBitEqual(constant.value(), 0.0)) { | 1607 } else if (Utils::DoublesBitEqual(constant.value(), 0.0)) { |
1608 __ xorps(XMM0, XMM0); | 1608 __ xorps(XMM0, XMM0); |
1609 } else { | 1609 } else { |
1610 __ movsd(XMM0, Address::Absolute(addr)); | 1610 __ movsd(XMM0, Address::Absolute(addr)); |
1611 } | 1611 } |
1612 __ movsd(destination.ToStackSlotAddress(), XMM0); | 1612 __ movsd(destination.ToStackSlotAddress(), XMM0); |
1613 } else { | 1613 } else { |
1614 ASSERT(destination.IsStackSlot()); | 1614 ASSERT(destination.IsStackSlot()); |
1615 const Object& constant = source.constant(); | 1615 const Object& constant = source.constant(); |
1616 if (constant.IsSmi() && | 1616 if (constant.IsSmi() && |
1617 source.constant_instruction()->representation() == kUnboxedInt32) { | 1617 (source.constant_instruction()->representation() == kUnboxedInt32)) { |
1618 __ movl(destination.ToStackSlotAddress(), | 1618 __ movl(destination.ToStackSlotAddress(), |
1619 Immediate(Smi::Cast(constant).Value())); | 1619 Immediate(Smi::Cast(constant).Value())); |
1620 } else { | 1620 } else { |
1621 StoreObject(destination.ToStackSlotAddress(), source.constant()); | 1621 StoreObject(destination.ToStackSlotAddress(), source.constant()); |
1622 } | 1622 } |
1623 } | 1623 } |
1624 } | 1624 } |
1625 | 1625 |
1626 move->Eliminate(); | 1626 move->Eliminate(); |
1627 } | 1627 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 __ movups(reg, Address(ESP, 0)); | 1773 __ movups(reg, Address(ESP, 0)); |
1774 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1774 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1775 } | 1775 } |
1776 | 1776 |
1777 | 1777 |
1778 #undef __ | 1778 #undef __ |
1779 | 1779 |
1780 } // namespace dart | 1780 } // namespace dart |
1781 | 1781 |
1782 #endif // defined TARGET_ARCH_IA32 | 1782 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |