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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 10910252: Improve register usage for StoreInstanceField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Addressed comment and improved StoreIndexed as well. Created 8 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 | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('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 12307)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -913,7 +913,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;
@@ -932,7 +932,7 @@
Smi::Cast(index.constant()).Value() * kWordSize + sizeof(RawArray))
: FieldAddress(array, index.reg(), TIMES_2, sizeof(RawArray));
- if (this->value()->NeedsStoreBuffer() && emit_store_barrier()) {
+ if (ShouldEmitStoreBarrier()) {
Register value = locs()->in(2).reg();
__ StoreIntoObject(array, field_address, value);
} else {
@@ -953,22 +953,30 @@
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()) {
+ __ StoreIntoObjectNoBarrier(
+ instance_reg,
+ 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);
+ }
}
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698