Revision: 11930
Author:   [email protected]
Date:     Tue Jun 26 04:25:28 2012
Log:      Fix missing slot recording in transition compaction.

[email protected]
TEST=cctest/test-api/Threading2

Review URL: https://chromiumcodereview.appspot.com/10658033
http://code.google.com/p/v8/source/detail?r=11930

Modified:
 /branches/bleeding_edge/src/objects.cc

=======================================
--- /branches/bleeding_edge/src/objects.cc      Mon Jun 25 06:33:48 2012
+++ /branches/bleeding_edge/src/objects.cc      Tue Jun 26 04:25:28 2012
@@ -7444,6 +7444,9 @@
 }


+// 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 @@
   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++;
     }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to