Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index e817e777f11669b4bdf7935708c4d216a6bbafad..8703835f4687ae9edbba6bd44ff984a671b58fc5 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3512,10 +3512,17 @@ void MigrateFastToSlow(Handle<JSObject> object, Handle<Map> new_map, |
// Ensure that in-object space of slow-mode object does not contain random |
// garbage. |
int inobject_properties = new_map->GetInObjectProperties(); |
- for (int i = 0; i < inobject_properties; i++) { |
- FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i); |
- object->RawFastPropertyAtPut(index, Smi::FromInt(0)); |
- } |
+ if (inobject_properties) { |
+ Heap* heap = isolate->heap(); |
+ heap->ClearRecordedSlotRange( |
+ object->address() + map->GetInObjectPropertyOffset(0), |
+ object->address() + new_instance_size); |
+ |
+ for (int i = 0; i < inobject_properties; i++) { |
+ FieldIndex index = FieldIndex::ForPropertyIndex(*new_map, i); |
+ object->RawFastPropertyAtPut(index, Smi::FromInt(0)); |
+ } |
+ } |
isolate->counters()->props_to_dictionary()->Increment(); |