Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 266633007: Merge ConstantInstr -> UnboxDouble to UnboxedConstant. Reduces register usage and allows for variou… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "vm/compiler.h" 11 #include "vm/compiler.h"
12 #include "vm/cpu.h" 12 #include "vm/cpu.h"
13 #include "vm/dart_entry.h" 13 #include "vm/dart_entry.h"
14 #include "vm/deopt_instructions.h" 14 #include "vm/deopt_instructions.h"
15 #include "vm/flow_graph_builder.h"
15 #include "vm/il_printer.h" 16 #include "vm/il_printer.h"
16 #include "vm/locations.h" 17 #include "vm/locations.h"
17 #include "vm/object_store.h" 18 #include "vm/object_store.h"
18 #include "vm/parser.h" 19 #include "vm/parser.h"
19 #include "vm/stack_frame.h" 20 #include "vm/stack_frame.h"
20 #include "vm/stub_code.h" 21 #include "vm/stub_code.h"
21 #include "vm/symbols.h" 22 #include "vm/symbols.h"
22 23
23 namespace dart { 24 namespace dart {
24 25
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 } 1643 }
1643 } else { 1644 } else {
1644 ASSERT(source.IsConstant()); 1645 ASSERT(source.IsConstant());
1645 if (destination.IsRegister()) { 1646 if (destination.IsRegister()) {
1646 const Object& constant = source.constant(); 1647 const Object& constant = source.constant();
1647 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) { 1648 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
1648 __ xorl(destination.reg(), destination.reg()); 1649 __ xorl(destination.reg(), destination.reg());
1649 } else { 1650 } else {
1650 __ LoadObjectSafely(destination.reg(), constant); 1651 __ LoadObjectSafely(destination.reg(), constant);
1651 } 1652 }
1653 } else if (destination.IsFpuRegister()) {
1654 const Double& constant = Double::Cast(source.constant());
1655 uword addr = FlowGraphBuilder::FindDoubleConstant(constant.value());
1656 if (addr == 0) {
1657 __ pushl(EAX);
1658 __ LoadObject(EAX, constant);
1659 __ movsd(destination.fpu_reg(),
1660 FieldAddress(EAX, Double::value_offset()));
1661 __ popl(EAX);
1662 } else {
1663 __ movsd(destination.fpu_reg(), Address::Absolute(addr));
1664 }
1652 } else { 1665 } else {
1653 ASSERT(destination.IsStackSlot()); 1666 ASSERT(destination.IsStackSlot());
1654 StoreObject(destination.ToStackSlotAddress(), source.constant()); 1667 StoreObject(destination.ToStackSlotAddress(), source.constant());
1655 } 1668 }
1656 } 1669 }
1657 1670
1658 move->Eliminate(); 1671 move->Eliminate();
1659 } 1672 }
1660 1673
1661 1674
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 __ movups(reg, Address(ESP, 0)); 1818 __ movups(reg, Address(ESP, 0));
1806 __ addl(ESP, Immediate(kFpuRegisterSize)); 1819 __ addl(ESP, Immediate(kFpuRegisterSize));
1807 } 1820 }
1808 1821
1809 1822
1810 #undef __ 1823 #undef __
1811 1824
1812 } // namespace dart 1825 } // namespace dart
1813 1826
1814 #endif // defined TARGET_ARCH_IA32 1827 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698