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

Unified Diff: src/objects.cc

Issue 10658033: Fix missing slot recording in transition compaction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing SMI check. Created 8 years, 6 months 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 | no next file » | 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 5ec05aa4ebc230ddaf5aa24847b7ae2b1b26c240..57483177854d3928d838967bf9c8a98adc7f6a54 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -7444,6 +7444,9 @@ static bool ClearNonLiveTransitionsFromDescriptor(Heap* heap,
}
+// TODO(mstarzinger): This method should be moved into MarkCompactCollector,
+// because it cannot be called from outside the GC and we already have methods
+// depending on the transitions layout in the GC anyways.
void Map::ClearNonLiveTransitions(Heap* heap) {
Object* array = *RawField(this, Map::kInstanceDescriptorsOrBitField3Offset);
// If there are no descriptors to be cleared, return.
@@ -7457,9 +7460,18 @@ void Map::ClearNonLiveTransitions(Heap* heap) {
for (int i = 0; i < d->number_of_descriptors(); ++i) {
if (!ClearNonLiveTransitionsFromDescriptor(heap, d, i)) {
if (i != descriptor_index) {
- d->SetKeyUnchecked(heap, descriptor_index, d->GetKey(i));
+ String* key = d->GetKey(i);
+ Object* value = d->GetValue(i);
+ d->SetKeyUnchecked(heap, descriptor_index, key);
d->SetDetailsUnchecked(descriptor_index, d->GetDetails(i).AsSmi());
- d->SetValueUnchecked(heap, descriptor_index, d->GetValue(i));
+ d->SetValueUnchecked(heap, descriptor_index, value);
+ MarkCompactCollector* collector = heap->mark_compact_collector();
+ Object** key_slot = d->GetKeySlot(descriptor_index);
+ collector->RecordSlot(key_slot, key_slot, key);
+ if (value->IsHeapObject()) {
+ Object** value_slot = d->GetValueSlot(descriptor_index);
+ collector->RecordSlot(value_slot, value_slot, value);
+ }
}
descriptor_index++;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698