OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/incremental-marking.h" | 5 #include "src/heap/incremental-marking.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
10 #include "src/heap/gc-idle-time-handler.h" | 10 #include "src/heap/gc-idle-time-handler.h" |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 Object* weak_cell_obj = heap()->encountered_weak_cells(); | 616 Object* weak_cell_obj = heap()->encountered_weak_cells(); |
617 Object* weak_cell_head = Smi::kZero; | 617 Object* weak_cell_head = Smi::kZero; |
618 WeakCell* prev_weak_cell_obj = NULL; | 618 WeakCell* prev_weak_cell_obj = NULL; |
619 while (weak_cell_obj != Smi::kZero) { | 619 while (weak_cell_obj != Smi::kZero) { |
620 WeakCell* weak_cell = reinterpret_cast<WeakCell*>(weak_cell_obj); | 620 WeakCell* weak_cell = reinterpret_cast<WeakCell*>(weak_cell_obj); |
621 // We do not insert cleared weak cells into the list, so the value | 621 // We do not insert cleared weak cells into the list, so the value |
622 // cannot be a Smi here. | 622 // cannot be a Smi here. |
623 HeapObject* value = HeapObject::cast(weak_cell->value()); | 623 HeapObject* value = HeapObject::cast(weak_cell->value()); |
624 // Remove weak cells with live objects from the list, they do not need | 624 // Remove weak cells with live objects from the list, they do not need |
625 // clearing. | 625 // clearing. |
626 if (MarkCompactCollector::IsMarked(value)) { | 626 if (ObjectMarking::IsBlackOrGrey(value)) { |
627 // Record slot, if value is pointing to an evacuation candidate. | 627 // Record slot, if value is pointing to an evacuation candidate. |
628 Object** slot = HeapObject::RawField(weak_cell, WeakCell::kValueOffset); | 628 Object** slot = HeapObject::RawField(weak_cell, WeakCell::kValueOffset); |
629 heap_->mark_compact_collector()->RecordSlot(weak_cell, slot, *slot); | 629 heap_->mark_compact_collector()->RecordSlot(weak_cell, slot, *slot); |
630 // Remove entry somewhere after top. | 630 // Remove entry somewhere after top. |
631 if (prev_weak_cell_obj != NULL) { | 631 if (prev_weak_cell_obj != NULL) { |
632 prev_weak_cell_obj->set_next(weak_cell->next()); | 632 prev_weak_cell_obj->set_next(weak_cell->next()); |
633 } | 633 } |
634 weak_cell_obj = weak_cell->next(); | 634 weak_cell_obj = weak_cell->next(); |
635 weak_cell->clear_next(the_hole_value); | 635 weak_cell->clear_next(the_hole_value); |
636 } else { | 636 } else { |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 idle_marking_delay_counter_++; | 1189 idle_marking_delay_counter_++; |
1190 } | 1190 } |
1191 | 1191 |
1192 | 1192 |
1193 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1193 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1194 idle_marking_delay_counter_ = 0; | 1194 idle_marking_delay_counter_ = 0; |
1195 } | 1195 } |
1196 | 1196 |
1197 } // namespace internal | 1197 } // namespace internal |
1198 } // namespace v8 | 1198 } // namespace v8 |
OLD | NEW |