Commit 2069e5ca authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

heap: Avoid reporting memory to V8 when in GCForbidden scope

Within such a scope we should not finalize garbage collection which may happen
when reporting memory to V8.

Bug: 1005723
Change-Id: Icdd568143081d954d019265dc4bfc6640f8bf500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841336
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703134}
parent 35431c51
......@@ -184,9 +184,13 @@ bool UnifiedHeapController::IsRootForNonTracingGC(
}
void UnifiedHeapController::ReportBufferedAllocatedSizeIfPossible() {
// Reported from a recursive sweeping call.
if (thread_state()->IsSweepingInProgress() &&
thread_state()->SweepForbidden()) {
// Avoid reporting to V8 in the following conditions as that may trigger GC
// finalizations where not allowed.
// - Recursive sweeping.
// - GC forbidden scope.
if ((thread_state()->IsSweepingInProgress() &&
thread_state()->SweepForbidden()) ||
thread_state()->IsGCForbidden()) {
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment