Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 6d8a1be02a83e228eca6134f24d41a99e25ab54d..83859176e410fcca451a8abe127220806b61fc99 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3568,9 +3568,16 @@ 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::kZero); |
+ 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::kZero); |
+ } |
} |
isolate->counters()->props_to_dictionary()->Increment(); |