Chromium Code Reviews| 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,24 @@ |
| } |
| 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())); |
| + |
| + ConstantInstr* constant = left()->definition()->AsConstant(); |
| + if ((constant != NULL) && !left()->IsSingleUse()) { |
|
zra
2014/09/05 20:52:15
Maybe add comment like: "Make sure we use a regist
srdjan
2014/09/05 20:58:29
Done.
|
| + 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; |
| } |