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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 548633003: ARM: for StrictCompare cache constant values in register instead of materializing it each time. Nex… (Closed) Base URL: http://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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 39918)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -293,11 +293,13 @@
LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate,
bool opt) const {
const intptr_t kNumInputs = 0;
- const intptr_t kNumTemps = 1;
+ const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1;
LocationSummary* locs = new(isolate) LocationSummary(
isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_out(0, Location::RequiresFpuRegister());
- locs->set_temp(0, Location::RequiresRegister());
+ if (representation_ != kUnboxedInt32) {
+ locs->set_temp(0, Location::RequiresRegister());
+ }
return locs;
}
@@ -7115,12 +7117,26 @@
}
LocationSummary* locs = new(isolate) LocationSummary(
isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
- locs->set_in(0, Location::RegisterOrConstant(left()));
- // Only one of the inputs can be a constant. Choose register if the first one
- // is a constant.
- locs->set_in(1, locs->in(0).IsConstant()
- ? Location::RequiresRegister()
- : Location::RegisterOrConstant(right()));
+
+ // If a constant has more than one use, make sure it is loaded in register
+ // so that multiple immediate loads can be avoided.
+ ConstantInstr* constant = left()->definition()->AsConstant();
+ if ((constant != NULL) && !left()->IsSingleUse()) {
+ locs->set_in(0, Location::RequiresRegister());
+ } else {
+ locs->set_in(0, Location::RegisterOrConstant(left()));
+ }
+
+ constant = right()->definition()->AsConstant();
+ if ((constant != NULL) && !right()->IsSingleUse()) {
+ locs->set_in(1, Location::RequiresRegister());
+ } else {
+ // Only one of the inputs can be a constant. Choose register if the first
+ // one is a constant.
+ locs->set_in(1, locs->in(0).IsConstant()
+ ? Location::RequiresRegister()
+ : Location::RegisterOrConstant(right()));
+ }
locs->set_out(0, Location::RequiresRegister());
return locs;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698