Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: src/objects.cc

Issue 2539493002: [heap] Clear recorded slots for inobject properties when migrating fast object to slow mode. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-666046.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-666046.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698