Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 18f2a39a83cd1a85ae13f0a63699aaef89cb237f..ca093ec6512e6d0b4337d91efc8725270cb06286 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -3368,7 +3368,22 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
int offset = instr->offset(); |
if (!instr->transition().is_null()) { |
- __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); |
+ if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { |
+ __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); |
+ } else { |
+ Register temp = ToRegister(instr->TempAt(0)); |
+ Register temp_map = ToRegister(instr->TempAt(1)); |
+ __ mov(temp_map, instr->transition()); |
+ __ mov(FieldOperand(object, HeapObject::kMapOffset), temp_map); |
+ // Update the write barrier for the map field. |
+ __ RecordWriteField(object, |
+ HeapObject::kMapOffset, |
+ temp_map, |
+ temp, |
+ kSaveFPRegs, |
+ OMIT_REMEMBERED_SET, |
+ OMIT_SMI_CHECK); |
+ } |
} |
// Do the store. |