Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index d1be73561e7a00259446f2f0bceb7c68a667e672..16a3f4c7eab0514e99c959c482b33db744a15b07 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -1867,25 +1867,39 @@ void Marker<T>::MarkDescriptorArray(DescriptorArray* descriptors) { |
// Empty descriptor array is marked as a root before any maps are marked. |
ASSERT(descriptors != descriptors->GetHeap()->empty_descriptor_array()); |
- // The DescriptorArray contains a pointer to its contents array, but the |
- // contents array will be marked black and hence not be visited again. |
- if (!base_marker()->MarkObjectAndPush(descriptors)) return; |
- FixedArray* contents = FixedArray::cast( |
- descriptors->get(DescriptorArray::kContentArrayIndex)); |
- ASSERT(Marking::IsWhite(Marking::MarkBitFrom(contents))); |
- base_marker()->MarkObjectWithoutPush(contents); |
+ if (!base_marker()->MarkObjectWithoutPush(descriptors)) return; |
+ Object** descriptor_start = descriptors->data_start(); |
+ |
+ if (descriptors->HasEnumCache()) { |
Michael Starzinger
2012/06/01 14:03:15
It's important that we don't forget to mark every
Toon Verwaest
2012/06/04 07:30:45
Done.
|
+ Object** enum_cache_slot = descriptors->GetEnumCacheSlot(); |
+ Object* enum_cache = *enum_cache_slot; |
+ base_marker()->MarkObjectAndPush( |
+ reinterpret_cast<HeapObject*>(enum_cache)); |
+ mark_compact_collector()->RecordSlot(descriptor_start, |
+ enum_cache_slot, |
+ enum_cache); |
+ } |
// If the descriptor contains a transition (value is a Map), we don't mark the |
// value as live. It might be set to the NULL_DESCRIPTOR in |
// ClearNonLiveTransitions later. |
for (int i = 0; i < descriptors->number_of_descriptors(); ++i) { |
- PropertyDetails details(descriptors->GetDetails(i)); |
- Object** slot = descriptors->GetValueSlot(i); |
+ Object** key_slot = descriptors->GetKeySlot(i); |
+ Object* key = *key_slot; |
+ if (key->IsHeapObject()) { |
+ base_marker()->MarkObjectAndPush(reinterpret_cast<HeapObject*>(key)); |
+ mark_compact_collector()->RecordSlot(descriptor_start, key_slot, key); |
+ } |
+ |
+ Object** value_slot = descriptors->GetValueSlot(i); |
+ if (!(*value_slot)->IsHeapObject()) continue; |
+ HeapObject* value = HeapObject::cast(*value_slot); |
- if (!(*slot)->IsHeapObject()) continue; |
- HeapObject* value = HeapObject::cast(*slot); |
+ mark_compact_collector()->RecordSlot(descriptor_start, |
+ value_slot, |
+ *value_slot); |
Michael Starzinger
2012/06/01 14:03:15
Just pass "value" as the third parameter here.
Toon Verwaest
2012/06/04 07:30:45
Done.
|
- mark_compact_collector()->RecordSlot(slot, slot, *slot); |
+ PropertyDetails details(descriptors->GetDetails(i)); |
switch (details.type()) { |
case NORMAL: |