Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 1b8ed3848c2ff1aeb13e5f2c5286b367e2c47ac7..2cfe17b5bedd60de819d6b2b3305b1b57b2f1ced 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -768,9 +768,19 @@ void StubCompiler::GenerateStoreField(MacroAssembler* masm, |
} |
if (!transition.is_null()) { |
- // Update the map of the object; no write barrier updating is |
- // needed because the map is never in new space. |
- __ Move(FieldOperand(receiver_reg, HeapObject::kMapOffset), transition); |
+ // Update the map of the object. |
+ __ Move(scratch, transition); |
+ __ movq(FieldOperand(receiver_reg, HeapObject::kMapOffset), scratch); |
+ |
+ // Update the write barrier for the map field and pass the now unused |
+ // name_reg as scratch register. |
+ __ RecordWriteField(receiver_reg, |
+ HeapObject::kMapOffset, |
+ scratch, |
+ name_reg, |
+ kDontSaveFPRegs, |
+ OMIT_REMEMBERED_SET, |
+ OMIT_SMI_CHECK); |
} |
// Adjust for the number of properties stored in the object. Even in the |