Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: src/heap/incremental-marking.cc

Issue 2173773002: [heap] Give marking functions for incremental marking more precise names. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix compile Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
index b9f198ea6294224e4a9c96dfe9e3b558f918fc7c..ec7594159ba63476e2cb69db8fb4876991eb4506 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -195,14 +195,6 @@ void IncrementalMarking::TransferMark(Heap* heap, Address old_start,
#endif
}
-static inline void MarkBlackOrKeepBlack(HeapObject* heap_object,
- MarkBit mark_bit, int size) {
- DCHECK(!Marking::IsImpossible(mark_bit));
- if (Marking::IsBlack(mark_bit)) return;
- Marking::MarkBlack(mark_bit);
- MemoryChunk::IncrementLiveBytesFromGC(heap_object, size);
-}
-
class IncrementalMarkingMarkingVisitor
: public StaticMarkingVisitor<IncrementalMarkingMarkingVisitor> {
public:
@@ -294,7 +286,7 @@ class IncrementalMarkingMarkingVisitor
// Marks the object grey and pushes it on the marking stack.
INLINE(static void MarkObject(Heap* heap, Object* obj)) {
- IncrementalMarking::MarkObject(heap, HeapObject::cast(obj));
+ IncrementalMarking::MarkGrey(heap, HeapObject::cast(obj));
}
// Marks the object black without pushing it on the marking stack.
@@ -339,7 +331,7 @@ class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor {
Object* obj = *p;
if (!obj->IsHeapObject()) return;
- IncrementalMarking::MarkObject(heap_, HeapObject::cast(obj));
+ IncrementalMarking::MarkGrey(heap_, HeapObject::cast(obj));
}
Heap* heap_;
@@ -633,7 +625,7 @@ void IncrementalMarking::MarkObjectGroups() {
DCHECK(IsMarking());
IncrementalMarkingRootMarkingVisitor visitor(this);
- heap_->mark_compact_collector()->MarkImplicitRefGroups(&MarkObject);
+ heap_->mark_compact_collector()->MarkImplicitRefGroups(&MarkGrey);
heap_->isolate()->global_handles()->IterateObjectGroups(
&visitor, &MarkCompactCollector::IsUnmarkedHeapObjectWithHeap);
heap_->isolate()->global_handles()->RemoveImplicitRefGroups();
@@ -720,7 +712,7 @@ void IncrementalMarking::RetainMaps() {
if (i >= number_of_disposed_maps && !map_retaining_is_disabled &&
Marking::IsWhite(map_mark)) {
if (ShouldRetainMap(map, age)) {
- MarkObject(heap(), map);
+ MarkGrey(heap(), map);
}
Object* prototype = map->prototype();
if (age > 0 && prototype->IsHeapObject() &&
@@ -863,29 +855,35 @@ void IncrementalMarking::UpdateMarkingDequeAfterScavenge() {
void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) {
- MarkObject(heap_, map);
+ MarkGrey(heap_, map);
IncrementalMarkingMarkingVisitor::IterateBody(map, obj);
- MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
#if ENABLE_SLOW_DCHECKS
+ MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address());
SLOW_DCHECK(Marking::IsGrey(mark_bit) ||
(obj->IsFiller() && Marking::IsWhite(mark_bit)) ||
(chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR) &&
Marking::IsBlack(mark_bit)));
#endif
- MarkBlackOrKeepBlack(obj, mark_bit, size);
+ MarkBlack(obj, size);
}
-
-void IncrementalMarking::MarkObject(Heap* heap, HeapObject* obj) {
- MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
+void IncrementalMarking::MarkGrey(Heap* heap, HeapObject* object) {
+ MarkBit mark_bit = ObjectMarking::MarkBitFrom(object);
if (Marking::IsWhite(mark_bit)) {
- heap->incremental_marking()->WhiteToGreyAndPush(obj, mark_bit);
+ heap->incremental_marking()->WhiteToGreyAndPush(object, mark_bit);
}
}
+void IncrementalMarking::MarkBlack(HeapObject* obj, int size) {
+ MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
+ if (Marking::IsBlack(mark_bit)) return;
+ Marking::GreyToBlack(mark_bit);
+ MemoryChunk::IncrementLiveBytesFromGC(obj, size);
+}
+
intptr_t IncrementalMarking::ProcessMarkingDeque(
intptr_t bytes_to_process, ForceCompletionAction completion) {
intptr_t bytes_processed = 0;
« no previous file with comments | « src/heap/incremental-marking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698