From 6daf6911544046e437459b36655f7bc4f5f949fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Inf=C3=BChr?= Date: Thu, 9 Jul 2020 16:54:56 +0000 Subject: [PATCH] Revert "[heap] Move start of incremental marking in allocation" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d6a14abe05e1b98d3e4368bcd85c12521fe8864e. Reason for revert: Caused TSAN failures. Original change's description: > [heap] Move start of incremental marking in allocation > > Move start of incremental marking out of > RefillLinearAllocationAreaFromFreeList. This avoids a potential > safepoint while holding allocation_mutex_. > > Bug: v8:10315 > Change-Id: Ieb60ac68f26199eea7b6b7ad6d874851382f3d69 > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287496 > Commit-Queue: Dominik Inführ > Reviewed-by: Ulan Degenbaev > Cr-Commit-Position: refs/heads/master@{#68751} TBR=ulan@chromium.org,dinfuehr@chromium.org Change-Id: Ic928413884115ac01917a8db591af83cbbc9cc5a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: v8:10315 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2289977 Reviewed-by: Dominik Inführ Commit-Queue: Dominik Inführ Cr-Commit-Position: refs/heads/master@{#68762} --- src/heap/paged-spaces.cc | 15 ++++++--------- test/cctest/heap/test-external-string-tracker.cc | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/heap/paged-spaces.cc b/src/heap/paged-spaces.cc index de0ca5e750..cc29c83abd 100644 --- a/src/heap/paged-spaces.cc +++ b/src/heap/paged-spaces.cc @@ -529,6 +529,12 @@ bool PagedSpace::RefillLinearAllocationAreaFromFreeList( // if it is big enough. FreeLinearAllocationArea(); + if (!is_local_space()) { + heap()->StartIncrementalMarkingIfAllocationLimitIsReached( + heap()->GCFlagsForIncrementalMarking(), + kGCCallbackScheduleIdleGarbageCollection); + } + size_t new_node_size = 0; FreeSpace new_node = free_list_->Allocate(size_in_bytes, &new_node_size, origin); @@ -1013,15 +1019,6 @@ AllocationResult PagedSpace::AllocateRawSlow(int size_in_bytes, top_on_previous_step_ ? top() - top_on_previous_step_ : 0; DCHECK_IMPLIES(!SupportsInlineAllocation(), bytes_since_last == 0); - if (!is_local_space()) { - // Start incremental marking before the actual allocation, this allows the - // allocation function to mark the object black when incremental marking is - // running. - heap()->StartIncrementalMarkingIfAllocationLimitIsReached( - heap()->GCFlagsForIncrementalMarking(), - kGCCallbackScheduleIdleGarbageCollection); - } - #ifdef V8_HOST_ARCH_32_BIT AllocationResult result = alignment != kWordAligned diff --git a/test/cctest/heap/test-external-string-tracker.cc b/test/cctest/heap/test-external-string-tracker.cc index 001ae25c20..28ddc7b69c 100644 --- a/test/cctest/heap/test-external-string-tracker.cc +++ b/test/cctest/heap/test-external-string-tracker.cc @@ -130,7 +130,6 @@ TEST(ExternalString_ExternalBackingStoreSizeIncreasesMarkCompact) { } TEST(ExternalString_ExternalBackingStoreSizeIncreasesAfterExternalization) { - ManualGCScope manual_gc_scope; CcTest::InitializeVM(); LocalContext env; v8::Isolate* isolate = env->GetIsolate();