Chromium Code Reviews| Index: runtime/vm/assembler_ia32.cc |
| diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc |
| index 2acf8ce65f0caefe8152567b374bda5c7b033994..9d0160bb09deca67e74592fec5cb74eacc5ad012 100644 |
| --- a/runtime/vm/assembler_ia32.cc |
| +++ b/runtime/vm/assembler_ia32.cc |
| @@ -1850,6 +1850,26 @@ void Assembler::CompareObject(Register reg, const Object& object) { |
| // Destroys the value register. |
| +void Assembler::StoreIntoObjectFilterNoSmi(Register object, |
| + Register value, |
| + Label* no_update) { |
| + COMPILE_ASSERT((kNewObjectAlignmentOffset == kWordSize) && |
| + (kOldObjectAlignmentOffset == 0), young_alignment); |
| + |
| + // Write-barrier triggers if the value is in the new space (has bit set) and |
| + // the object is in the old space (has bit cleared). |
| + // To check that we could compute value & ~object and skip the write barrier |
| + // if the bit is not set. However we can't destroy the object. |
| + // However to preserve the object we compute negated expression |
| + // ~value | object instead and skip the write barrier if the bit is set. |
|
Ivan Posva
2013/03/22 04:11:35
Neat!
|
| + notl(value); |
| + orl(value, object); |
| + testl(value, Immediate(kNewObjectAlignmentOffset)); |
| + j(NOT_ZERO, no_update, Assembler::kNearJump); |
| +} |
| + |
| + |
| +// Destroys the value register. |
| void Assembler::StoreIntoObjectFilter(Register object, |
| Register value, |
| Label* no_update) { |
| @@ -1872,12 +1892,17 @@ void Assembler::StoreIntoObjectFilter(Register object, |
| void Assembler::StoreIntoObject(Register object, |
| const Address& dest, |
| - Register value) { |
| + Register value, |
| + ValueSminess value_sminess) { |
| ASSERT(object != value); |
| TraceStoreIntoObject(object, dest, value); |
| movl(dest, value); |
| Label done; |
| - StoreIntoObjectFilter(object, value, &done); |
| + if (value_sminess == kValueIsNotSmi) { |
| + StoreIntoObjectFilterNoSmi(object, value, &done); |
| + } else { |
| + StoreIntoObjectFilter(object, value, &done); |
|
Ivan Posva
2013/03/22 04:11:35
Please assert for kValueCanBeSmi in case we add mo
Vyacheslav Egorov (Google)
2013/03/22 11:22:50
Done.
|
| + } |
| // A store buffer update is required. |
| if (value != EAX) pushl(EAX); // Preserve EAX. |
| leal(EAX, dest); |