Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index c455564b41a736d268db2e81a9259fec07b261bd..a2d713666897e9cbac7052b2ac1ecf4fe46bf143 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -1867,26 +1867,37 @@ 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(contents->length() >= 2); |
- ASSERT(Marking::IsWhite(Marking::MarkBitFrom(contents))); |
- base_marker()->MarkObjectWithoutPush(contents); |
- |
- // Contents contains (value, details) pairs. 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 < contents->length(); i += 2) { |
- PropertyDetails details(Smi::cast(contents->get(i + 1))); |
- |
- Object** slot = contents->data_start() + i; |
- if (!(*slot)->IsHeapObject()) continue; |
- HeapObject* value = HeapObject::cast(*slot); |
- |
- mark_compact_collector()->RecordSlot(slot, slot, *slot); |
+ if (!base_marker()->MarkObjectWithoutPush(descriptors)) return; |
+ Object** descriptor_start = descriptors->data_start(); |
+ |
+ if (descriptors->HasEnumCache()) { |
+ 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) { |
+ 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); |
+ |
+ mark_compact_collector()->RecordSlot(descriptor_start, value_slot, *value_slot); |
Florian Schneider
2012/05/22 16:53:09
Long line.
|
+ |
+ PropertyDetails details(descriptors->GetDetails(i)); |
switch (details.type()) { |
case NORMAL: |