Chromium Code Reviews| Index: src/heap/mark-compact.cc |
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
| index ffda9f159d263d2c40e22c3c013881ef1be7f106..2f56b0c6ad5a8cd0b8025ddaf1efc9c786f6c0fa 100644 |
| --- a/src/heap/mark-compact.cc |
| +++ b/src/heap/mark-compact.cc |
| @@ -2198,14 +2198,13 @@ void MarkCompactCollector::ClearNonLiveReferences() { |
| for (HeapObject* obj = map_iterator.Next(); obj != NULL; |
| obj = map_iterator.Next()) { |
| Map* map = Map::cast(obj); |
| - |
| if (!map->CanTransition()) continue; |
| - |
| MarkBit map_mark = Marking::MarkBitFrom(map); |
| - ClearNonLivePrototypeTransitions(map); |
| - ClearNonLiveMapTransitions(map, map_mark); |
| - |
| - if (Marking::IsWhite(map_mark)) { |
| + bool alive = !Marking::IsWhite(map_mark); |
|
Hannes Payer (out of office)
2015/11/12 19:35:59
Let's ask Marking::IsBlackOrGrey here for liveness
ulan
2015/11/17 11:29:46
Done.
|
| + if (alive) { |
| + ClearNonLivePrototypeTransitions(map); |
|
ulan
2015/11/12 12:00:37
We don't need to compact prototype transitions for
Hannes Payer (out of office)
2015/11/12 19:35:59
Awesome!
|
| + } else { |
| + ClearNonLiveMapTransitions(map); |
|
ulan
2015/11/12 12:00:37
We don't need to call this function for live maps
Hannes Payer (out of office)
2015/11/12 19:35:59
Awesome^2!
|
| have_code_to_deoptimize_ |= |
| map->dependent_code()->MarkCodeForDeoptimization( |
| isolate(), DependentCode::kWeakCodeGroup); |
| @@ -2267,17 +2266,16 @@ void MarkCompactCollector::ClearNonLivePrototypeTransitions(Map* map) { |
| } |
| -void MarkCompactCollector::ClearNonLiveMapTransitions(Map* map, |
| - MarkBit map_mark) { |
| +void MarkCompactCollector::ClearNonLiveMapTransitions(Map* map) { |
| Object* potential_parent = map->GetBackPointer(); |
| if (!potential_parent->IsMap()) return; |
| Map* parent = Map::cast(potential_parent); |
| // Follow back pointer, check whether we are dealing with a map transition |
| // from a live map to a dead path and in case clear transitions of parent. |
| - bool current_is_alive = Marking::IsBlackOrGrey(map_mark); |
| + DCHECK(Marking::IsBlackOrGrey(Marking::MarkBitFrom(map))); |
| bool parent_is_alive = Marking::IsBlackOrGrey(Marking::MarkBitFrom(parent)); |
| - if (!current_is_alive && parent_is_alive) { |
| + if (parent_is_alive) { |
| ClearMapTransitions(parent, map); |
| } |
| } |