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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 353513002: Use range information for optimizing integer boxing and fix bug in range analysis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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_arm.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 37654)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -5663,14 +5663,18 @@
LocationSummary* BoxIntegerInstr::MakeLocationSummary(Isolate* isolate,
bool opt) const {
const intptr_t kNumInputs = 1;
- const intptr_t kNumTemps = 1;
+ const intptr_t kNumTemps = is_smi() ? 0 : 1;
LocationSummary* summary = new(isolate) LocationSummary(
isolate, kNumInputs,
kNumTemps,
- LocationSummary::kCallOnSlowPath);
+ is_smi()
+ ? LocationSummary::kNoCall
+ : LocationSummary::kCallOnSlowPath);
summary->set_in(0, Location::Pair(Location::RequiresRegister(),
Location::RequiresRegister()));
- summary->set_temp(0, Location::RequiresRegister());
+ if (!is_smi()) {
+ summary->set_temp(0, Location::RequiresRegister());
+ }
summary->set_out(0, Location::RequiresRegister());
return summary;
}
@@ -5710,6 +5714,15 @@
void BoxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
+ if (is_smi()) {
+ PairLocation* value_pair = locs()->in(0).AsPairLocation();
+ Register value_lo = value_pair->At(0).reg();
+ Register out_reg = locs()->out(0).reg();
+ __ movl(out_reg, value_lo);
+ __ SmiTag(out_reg);
+ return;
+ }
+
BoxIntegerSlowPath* slow_path = new BoxIntegerSlowPath(this);
compiler->AddSlowPathCode(slow_path);
PairLocation* value_pair = locs()->in(0).AsPairLocation();
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698