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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 10909169: Add support for WritableRegister policy in the register allocator. (Closed) Base URL: https://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
Index: runtime/vm/intermediate_language_ia32.cc
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index d27b20aea1921945bcd55f1d302755eaf05ed376..c06c98dce1dd51d4836c88bbb5048675e8ff9e00 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -920,7 +920,8 @@ LocationSummary* StoreIndexedInstr::MakeLocationSummary() const {
new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
locs->set_in(0, Location::RequiresRegister());
locs->set_in(1, Location::RequiresRegister());
- locs->set_in(2, Location::RequiresRegister());
+ locs->set_in(2, value()->NeedsStoreBuffer() ? Location::WritableRegister()
+ : Location::RequiresRegister());
if (receiver_type() == kGrowableObjectArrayCid) {
locs->set_temp(0, Location::RequiresRegister());
}
@@ -939,7 +940,8 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Note that index is Smi, i.e, times 2.
ASSERT(kSmiTagShift == 1);
if (this->value()->NeedsStoreBuffer()) {
- __ StoreIntoObject(receiver,
+ __ StoreIntoObject(
Ivan Posva 2012/09/11 11:57:30 ?
Vyacheslav Egorov (Google) 2012/09/11 12:18:05 Done.
+ receiver,
FieldAddress(receiver, index, TIMES_2, sizeof(RawArray)),
value);
} else {
@@ -955,7 +957,8 @@ void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Note that index is Smi, i.e, times 2.
ASSERT(kSmiTagShift == 1);
if (this->value()->NeedsStoreBuffer()) {
- __ StoreIntoObject(temp,
+ __ StoreIntoObject(
Ivan Posva 2012/09/11 11:57:30 ?
Vyacheslav Egorov (Google) 2012/09/11 12:18:05 Done.
+ temp,
FieldAddress(temp, index, TIMES_2, sizeof(RawArray)),
value);
} else {
@@ -997,7 +1000,9 @@ LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const {
LocationSummary* summary =
new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
- summary->set_in(1, Location::RequiresRegister());
+ summary->set_in(1,
+ value()->NeedsStoreBuffer() ? Location::WritableRegister()
+ : Location::RequiresRegister());
return summary;
}
@@ -1006,8 +1011,10 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Register instance_reg = locs()->in(0).reg();
Register value_reg = locs()->in(1).reg();
if (this->value()->NeedsStoreBuffer()) {
- __ StoreIntoObject(instance_reg,
- FieldAddress(instance_reg, field().Offset()), value_reg);
+ __ StoreIntoObject(
+ instance_reg,
+ FieldAddress(instance_reg, field().Offset()),
+ value_reg);
} else {
__ StoreIntoObjectNoBarrier(instance_reg,
FieldAddress(instance_reg, field().Offset()), value_reg);
@@ -1031,10 +1038,9 @@ void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall);
- locs->set_in(0, Location::RequiresRegister());
+ locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
+ : Location::RequiresRegister());
locs->set_temp(0, Location::RequiresRegister());
- locs->set_out(is_used() ? Location::SameAsFirstInput()
- : Location::NoLocation());
return locs;
}
@@ -1042,11 +1048,12 @@ LocationSummary* StoreStaticFieldInstr::MakeLocationSummary() const {
void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
Register temp = locs()->temp(0).reg();
- ASSERT(!is_used() || (locs()->out().reg() == value));
__ LoadObject(temp, field());
if (this->value()->NeedsStoreBuffer()) {
- __ StoreIntoObject(temp, FieldAddress(temp, Field::value_offset()), value);
+ __ StoreIntoObject(temp,
Ivan Posva 2012/09/11 11:57:30 ditto
Vyacheslav Egorov (Google) 2012/09/11 12:18:05 Done.
+ FieldAddress(temp, Field::value_offset()),
+ value);
} else {
__ StoreIntoObjectNoBarrier(
temp, FieldAddress(temp, Field::value_offset()), value);

Powered by Google App Engine
This is Rietveld 408576698