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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_ia32.cc
===================================================================
--- runtime/vm/flow_graph_compiler_ia32.cc (revision 35656)
+++ runtime/vm/flow_graph_compiler_ia32.cc (working copy)
@@ -12,6 +12,7 @@
#include "vm/cpu.h"
#include "vm/dart_entry.h"
#include "vm/deopt_instructions.h"
+#include "vm/flow_graph_builder.h"
#include "vm/il_printer.h"
#include "vm/locations.h"
#include "vm/object_store.h"
@@ -1649,6 +1650,18 @@
} else {
__ LoadObjectSafely(destination.reg(), constant);
}
+ } else if (destination.IsFpuRegister()) {
+ const Double& constant = Double::Cast(source.constant());
+ uword addr = FlowGraphBuilder::FindDoubleConstant(constant.value());
+ if (addr == 0) {
+ __ pushl(EAX);
+ __ LoadObject(EAX, constant);
+ __ movsd(destination.fpu_reg(),
+ FieldAddress(EAX, Double::value_offset()));
+ __ popl(EAX);
+ } else {
+ __ movsd(destination.fpu_reg(), Address::Absolute(addr));
+ }
} else {
ASSERT(destination.IsStackSlot());
StoreObject(destination.ToStackSlotAddress(), source.constant());
« 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