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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 562203005: Inline toDouble calls on mints (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index cf9dec16dfd0524e7821c9d13375b46b3b2bdf5c..d931ba692a8fbbaeef9b2a7e5362058f99da9937 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -4855,6 +4855,41 @@ void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
}
+LocationSummary* MintToDoubleInstr::MakeLocationSummary(Isolate* isolate,
+ bool opt) const {
+ const intptr_t kNumInputs = 1;
+ const intptr_t kNumTemps = 0;
+ LocationSummary* result = new(isolate) LocationSummary(
+ isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ result->set_in(0, Location::Pair(Location::RequiresRegister(),
+ Location::RequiresRegister()));
+ result->set_out(0, Location::RequiresFpuRegister());
+ return result;
+}
+
+
+void MintToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ PairLocation* pair = locs()->in(0).AsPairLocation();
+ Register in_lo = pair->At(0).reg();
+ Register in_hi = pair->At(1).reg();
+
+ FpuRegister result = locs()->out(0).fpu_reg();
+
+ // Push hi.
+ __ pushl(in_hi);
+ // Push lo.
+ __ pushl(in_lo);
+ // Perform conversion from Mint to double.
+ __ fildl(Address(ESP, 0));
+ // Pop FPU stack onto regular stack.
+ __ fstpl(Address(ESP, 0));
+ // Copy into result.
+ __ movsd(result, Address(ESP, 0));
+ // Pop args.
+ __ addl(ESP, Immediate(2 * kWordSize));
+}
+
+
LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Isolate* isolate,
bool opt) const {
const intptr_t kNumInputs = 1;
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698