Revert of [heap] Give marking functions for incremental marking more precise names. (patchset #3 id:40001 of https://codereview.chromium.org/2173773002/ )

Reason for revert:
Breaks Roll https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/271267/steps/browser_tests%20%28with%20patch%29%20on%20Ubuntu-12.04/logs/MaterialHistoryBrowserTest.DrawerTest

Original issue's description:
> [heap] Give marking functions for incremental marking more precise names.
>
> BUG=
>
> Committed: https://crrev.com/4ac08c97f0c26cca3c0687b7349c929a4db2df43
> Cr-Commit-Position: refs/heads/master@{#38141}

TBR=ulan@chromium.org,hpayer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2197583002
Cr-Commit-Position: refs/heads/master@{#38175}
This commit is contained in:
hablich 2016-07-29 04:02:20 -07:00 committed by Commit bot
parent cbcc231991
commit 91612668fa
3 changed files with 22 additions and 21 deletions

View File

@ -4685,7 +4685,7 @@ class IteratePromotedObjectsVisitor final : public ObjectVisitor {
// promoted objects.
if (heap_->incremental_marking()->black_allocation()) {
Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot));
IncrementalMarking::MarkGrey(heap_, code);
IncrementalMarking::MarkObject(heap_, code);
}
}
@ -4721,7 +4721,7 @@ void Heap::IteratePromotedObject(HeapObject* target, int size,
// regular visiting and IteratePromotedObjectPointers.
if (!was_marked_black) {
if (incremental_marking()->black_allocation()) {
IncrementalMarking::MarkGrey(this, target->map());
IncrementalMarking::MarkObject(this, target->map());
incremental_marking()->IterateBlackObject(target);
}
}

View File

@ -197,6 +197,14 @@ 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:
@ -288,7 +296,7 @@ class IncrementalMarkingMarkingVisitor
// Marks the object grey and pushes it on the marking stack.
INLINE(static void MarkObject(Heap* heap, Object* obj)) {
IncrementalMarking::MarkGrey(heap, HeapObject::cast(obj));
IncrementalMarking::MarkObject(heap, HeapObject::cast(obj));
}
// Marks the object black without pushing it on the marking stack.
@ -333,7 +341,7 @@ class IncrementalMarkingRootMarkingVisitor : public ObjectVisitor {
Object* obj = *p;
if (!obj->IsHeapObject()) return;
IncrementalMarking::MarkGrey(heap_, HeapObject::cast(obj));
IncrementalMarking::MarkObject(heap_, HeapObject::cast(obj));
}
Heap* heap_;
@ -627,7 +635,7 @@ void IncrementalMarking::MarkObjectGroups() {
DCHECK(IsMarking());
IncrementalMarkingRootMarkingVisitor visitor(this);
heap_->mark_compact_collector()->MarkImplicitRefGroups(&MarkGrey);
heap_->mark_compact_collector()->MarkImplicitRefGroups(&MarkObject);
heap_->isolate()->global_handles()->IterateObjectGroups(
&visitor, &MarkCompactCollector::IsUnmarkedHeapObjectWithHeap);
heap_->isolate()->global_handles()->RemoveImplicitRefGroups();
@ -714,7 +722,7 @@ void IncrementalMarking::RetainMaps() {
if (i >= number_of_disposed_maps && !map_retaining_is_disabled &&
Marking::IsWhite(map_mark)) {
if (ShouldRetainMap(map, age)) {
MarkGrey(heap(), map);
MarkObject(heap(), map);
}
Object* prototype = map->prototype();
if (age > 0 && prototype->IsHeapObject() &&
@ -857,34 +865,29 @@ void IncrementalMarking::UpdateMarkingDequeAfterScavenge() {
void IncrementalMarking::VisitObject(Map* map, HeapObject* obj, int size) {
MarkGrey(heap_, map);
MarkObject(heap_, map);
IncrementalMarkingMarkingVisitor::IterateBody(map, obj);
#if ENABLE_SLOW_DCHECKS
MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
#if ENABLE_SLOW_DCHECKS
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
MarkBlack(obj, size);
MarkBlackOrKeepBlack(obj, mark_bit, size);
}
void IncrementalMarking::MarkGrey(Heap* heap, HeapObject* object) {
MarkBit mark_bit = ObjectMarking::MarkBitFrom(object);
void IncrementalMarking::MarkObject(Heap* heap, HeapObject* obj) {
MarkBit mark_bit = ObjectMarking::MarkBitFrom(obj);
if (Marking::IsWhite(mark_bit)) {
heap->incremental_marking()->WhiteToGreyAndPush(object, mark_bit);
heap->incremental_marking()->WhiteToGreyAndPush(obj, 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) {
intptr_t bytes_processed = 0;

View File

@ -204,9 +204,7 @@ class IncrementalMarking {
bool IsIdleMarkingDelayCounterLimitReached();
static void MarkGrey(Heap* heap, HeapObject* object);
static void MarkBlack(HeapObject* object, int size);
static void MarkObject(Heap* heap, HeapObject* object);
static void TransferMark(Heap* heap, Address old_start, Address new_start);