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

Unified Diff: src/objects.cc

Issue 2549803002: Merged: [heap] Clear recorded slots for inobject properties when migrating fast object to slow mode. (Closed)
Patch Set: Created 4 years 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 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();
« 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