Chromium Code Reviews| Index: src/objects-visiting-inl.h |
| diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h |
| index 7332a0c8d6ad591df61a2e7c3195e103de1cfdf5..45cb4504bf0057626a914bc54d0d2b454159a1f3 100644 |
| --- a/src/objects-visiting-inl.h |
| +++ b/src/objects-visiting-inl.h |
| @@ -396,6 +396,33 @@ void StaticMarkingVisitor<StaticVisitor>::MarkMapContents( |
| ASSERT(transitions->IsMap() || transitions->IsUndefined()); |
| } |
| + // Since descriptor arrays are potentially shared, ensure that only the |
| + // descriptors that appeared for this map are marked. The first time a |
| + // non-empty descriptor array is marked, its header is also marked. The slot |
|
Michael Starzinger
2013/01/31 10:44:09
s/its header is also marked/its header is also vis
Toon Verwaest
2013/01/31 10:50:02
Done.
|
| + // holding the descriptor array will be implicitly recorded when the pointer |
| + // fields of this map are visited. |
| + DescriptorArray* descriptors = map->instance_descriptors(); |
| + if (StaticVisitor::MarkObjectWithoutPush(heap, descriptors) && |
| + descriptors->length() > 0) { |
| + StaticVisitor::VisitPointers(heap, |
| + descriptors->GetFirstElementAddress(), |
|
Michael Starzinger
2013/01/31 10:44:09
Indent by 4 instead of 2 characters.
Toon Verwaest
2013/01/31 10:50:02
Done.
|
| + descriptors->GetDescriptorEndSlot(0)); |
| + } |
| + int start = 0; |
| + int end = map->NumberOfOwnDescriptors(); |
| + Object* back_pointer = map->GetBackPointer(); |
| + if (!back_pointer->IsUndefined()) { |
| + Map* parent_map = Map::cast(back_pointer); |
| + if (descriptors == parent_map->instance_descriptors()) { |
| + start = parent_map->NumberOfOwnDescriptors(); |
| + } |
| + } |
| + if (start < end) { |
| + StaticVisitor::VisitPointers(heap, |
| + descriptors->GetDescriptorStartSlot(start), |
| + descriptors->GetDescriptorEndSlot(end)); |
| + } |
| + |
| // Mark prototype dependent codes array but do not push it onto marking |
| // stack, this will make references from it weak. We will clean dead |
| // codes when we iterate over maps in ClearNonLiveTransitions. |