Commit 9f4c5454 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

heap: Avoid reporting back memory changes during Scavenge

Blink must not report back memory changes during Scavenge (==
non-tracing GC) as those could trigger (or finalize) full garbage
collections. GC while GC is not supported and we have to delay the
reporting in those scenarios.

Bug: 1014078
Change-Id: I24ecbfa93639b67f54bbfd103c7b7753ef9e52aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859973
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: default avatarAnton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705611}
parent e4dc12db
...@@ -177,6 +177,10 @@ void UnifiedHeapController::ResetHandleInNonTracingGC( ...@@ -177,6 +177,10 @@ void UnifiedHeapController::ResetHandleInNonTracingGC(
class_id != WrapperTypeInfo::kObjectClassId) class_id != WrapperTypeInfo::kObjectClassId)
return; return;
// Clearing the wrapper below adjusts the DOM wrapper store which may
// re-allocate its backing. We have to avoid report memory to V8 as that may
// trigger GC during GC.
ThreadState::GCForbiddenScope gc_forbidden(thread_state());
const v8::TracedReference<v8::Object>& traced = handle.As<v8::Object>(); const v8::TracedReference<v8::Object>& traced = handle.As<v8::Object>();
bool success = DOMWrapperWorld::UnsetSpecificWrapperIfSet( bool success = DOMWrapperWorld::UnsetSpecificWrapperIfSet(
ToScriptWrappable(traced), traced); ToScriptWrappable(traced), traced);
......
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