| 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();
|
|
|