Commit fff889be authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

bindings: Update docs and DCHECK for resetting references on Scavenge

5956f2fe already stealth-fixed a problem
with rehashed backing stores containing references to dead objects
during Scavenge. Emitting a write barrier for such dead objects can
corrupt V8's worklists.

Not doing the optimization during an already running GC is the safest
option. Avoiding write barriers or allocation would be other brittle
options that may break in future.

Bug: 1021171
Change-Id: Ib3e8b59759e13911a754830c1d20041d60b35cc7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899457Reviewed-by: default avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712580}
parent 5653486e
......@@ -181,6 +181,12 @@ void UnifiedHeapController::ResetHandleInNonTracingGC(
class_id != WrapperTypeInfo::kObjectClassId)
return;
// We should not reset any handles during an already running tracing
// collection. Resetting a handle could re-allocate a backing or trigger
// potential in place rehashing. Both operations may trigger write barriers by
// moving references. Such references may already be dead but not yet cleared
// which would result in reporting dead objects to V8.
DCHECK(IsTracingDone());
// 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.
......
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