From 6e5606efda433fba503483496e340c19bd76b8b9 Mon Sep 17 00:00:00 2001 From: Ulan Degenbaev Date: Thu, 17 Aug 2017 21:04:19 +0200 Subject: [PATCH] [heap] Sync write barrier stub with runtime for concurrent marking. This also starts black allocation earlier if concurrent marking compile time flag is on. Bug: chromium:694255 Change-Id: I73c02676e5149fae10e5f9301ad585926e223a1d Reviewed-on: https://chromium-review.googlesource.com/618893 Reviewed-by: Michael Lippautz Commit-Queue: Ulan Degenbaev Cr-Commit-Position: refs/heads/master@{#47412} --- src/heap/incremental-marking.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc index badbec8d19..d338fcf15c 100644 --- a/src/heap/incremental-marking.cc +++ b/src/heap/incremental-marking.cc @@ -55,8 +55,13 @@ bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object* value) { HeapObject* value_heap_obj = HeapObject::cast(value); DCHECK(!marking_state()->IsImpossible(value_heap_obj)); DCHECK(!marking_state()->IsImpossible(obj)); - const bool need_recording = - FLAG_concurrent_marking || marking_state()->IsBlack(obj); +#ifdef V8_CONCURRENT_MARKING + // The write barrier stub generated with V8_CONCURRENT_MARKING does not + // check the color of the source object. + const bool need_recording = true; +#else + const bool need_recording = marking_state()->IsBlack(obj); +#endif if (need_recording && WhiteToGreyAndPush(value_heap_obj)) { RestartIfNotMarking(); @@ -556,9 +561,13 @@ void IncrementalMarking::StartMarking() { heap_->isolate()->compilation_cache()->MarkCompactPrologue(); - if (FLAG_concurrent_marking && !black_allocation_) { +#ifdef V8_CONCURRENT_MARKING + // The write-barrier does not check the color of the source object. + // Start black allocation earlier to ensure faster marking progress. + if (!black_allocation_) { StartBlackAllocation(); } +#endif // Mark strong roots grey. IncrementalMarkingRootMarkingVisitor visitor(this);