| Index: runtime/vm/intermediate_language_x64.cc
|
| ===================================================================
|
| --- runtime/vm/intermediate_language_x64.cc (revision 12307)
|
| +++ runtime/vm/intermediate_language_x64.cc (working copy)
|
| @@ -931,7 +931,7 @@
|
| locs->set_in(1, CanBeImmediateIndex(index())
|
| ? Location::RegisterOrConstant(index())
|
| : Location::RequiresRegister());
|
| - locs->set_in(2, value()->NeedsStoreBuffer()
|
| + locs->set_in(2, ShouldEmitStoreBarrier()
|
| ? Location::WritableRegister()
|
| : Location::RegisterOrConstant(value()));
|
| return locs;
|
| @@ -951,7 +951,7 @@
|
| Smi::Cast(index.constant()).Value() * kWordSize + sizeof(RawArray)))
|
| : FieldAddress(array, index.reg(), TIMES_4, sizeof(RawArray));
|
|
|
| - if (this->value()->NeedsStoreBuffer() && emit_store_barrier()) {
|
| + if (ShouldEmitStoreBarrier()) {
|
| Register value = locs()->in(2).reg();
|
| __ StoreIntoObject(array, field_address, value);
|
| } else {
|
| @@ -972,22 +972,28 @@
|
| LocationSummary* summary =
|
| new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall);
|
| summary->set_in(0, Location::RequiresRegister());
|
| - summary->set_in(1,
|
| - value()->NeedsStoreBuffer() ? Location::WritableRegister()
|
| - : Location::RequiresRegister());
|
| + summary->set_in(1, ShouldEmitStoreBarrier()
|
| + ? Location::WritableRegister()
|
| + : Location::RegisterOrConstant(value()));
|
| return summary;
|
| }
|
|
|
|
|
| void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| Register instance_reg = locs()->in(0).reg();
|
| - Register value_reg = locs()->in(1).reg();
|
| - if (this->value()->NeedsStoreBuffer() && emit_store_barrier()) {
|
| + if (ShouldEmitStoreBarrier()) {
|
| + Register value_reg = locs()->in(1).reg();
|
| __ StoreIntoObject(instance_reg,
|
| FieldAddress(instance_reg, field().Offset()), value_reg);
|
| } else {
|
| - __ StoreIntoObjectNoBarrier(instance_reg,
|
| - FieldAddress(instance_reg, field().Offset()), value_reg);
|
| + if (locs()->in(1).IsConstant()) {
|
| + __ StoreObject(FieldAddress(instance_reg, field().Offset()),
|
| + locs()->in(1).constant());
|
| + } else {
|
| + Register value_reg = locs()->in(1).reg();
|
| + __ StoreIntoObjectNoBarrier(instance_reg,
|
| + FieldAddress(instance_reg, field().Offset()), value_reg);
|
| + }
|
| }
|
| }
|
|
|
|
|