[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 <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#47412}
This commit is contained in:
parent
2da66836b3
commit
6e5606efda
@ -55,8 +55,13 @@ bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, Object* value) {
|
|||||||
HeapObject* value_heap_obj = HeapObject::cast(value);
|
HeapObject* value_heap_obj = HeapObject::cast(value);
|
||||||
DCHECK(!marking_state()->IsImpossible(value_heap_obj));
|
DCHECK(!marking_state()->IsImpossible(value_heap_obj));
|
||||||
DCHECK(!marking_state()->IsImpossible(obj));
|
DCHECK(!marking_state()->IsImpossible(obj));
|
||||||
const bool need_recording =
|
#ifdef V8_CONCURRENT_MARKING
|
||||||
FLAG_concurrent_marking || marking_state()->IsBlack(obj);
|
// 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)) {
|
if (need_recording && WhiteToGreyAndPush(value_heap_obj)) {
|
||||||
RestartIfNotMarking();
|
RestartIfNotMarking();
|
||||||
@ -556,9 +561,13 @@ void IncrementalMarking::StartMarking() {
|
|||||||
|
|
||||||
heap_->isolate()->compilation_cache()->MarkCompactPrologue();
|
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();
|
StartBlackAllocation();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Mark strong roots grey.
|
// Mark strong roots grey.
|
||||||
IncrementalMarkingRootMarkingVisitor visitor(this);
|
IncrementalMarkingRootMarkingVisitor visitor(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user