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

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: 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/flow_graph_compiler.cc ('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)
@@ -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, (value()->NeedsStoreBuffer() && emit_store_barrier())
Vyacheslav Egorov (Google) 2012/09/13 10:35:43 nice catch. maybe move this a && b to some helper
Florian Schneider 2012/09/13 10:46:07 Done.
+ ? 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()) {
+ 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/flow_graph_compiler.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698