| Index: runtime/vm/assembler_ia32.cc
|
| diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
|
| index 2acf8ce65f0caefe8152567b374bda5c7b033994..8d0221cbb200d1529e20964fe24d51a7bece958a 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.
|
| + 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,
|
| + bool can_value_be_smi) {
|
| ASSERT(object != value);
|
| TraceStoreIntoObject(object, dest, value);
|
| movl(dest, value);
|
| Label done;
|
| - StoreIntoObjectFilter(object, value, &done);
|
| + if (can_value_be_smi) {
|
| + StoreIntoObjectFilter(object, value, &done);
|
| + } else {
|
| + StoreIntoObjectFilterNoSmi(object, value, &done);
|
| + }
|
| // A store buffer update is required.
|
| if (value != EAX) pushl(EAX); // Preserve EAX.
|
| leal(EAX, dest);
|
|
|