[heap] Fix broken DCHECK in FlushBytecodeFromSFI

The String might be in the shared heap which is not collected during
client GCs.

Bug: v8:11708
Change-Id: I0958c46996a2aeba3a046263350617e8d177deca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3805883
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82179}
This commit is contained in:
Dominik Inführ 2022-08-03 16:25:44 +02:00 committed by V8 LUCI CQ
parent 79e3fc0df8
commit 45059dc2b7

View File

@ -3014,7 +3014,8 @@ void MarkCompactCollector::FlushBytecodeFromSFI(
// Mark the uncompiled data as black, and ensure all fields have already been
// marked.
DCHECK(marking_state()->IsBlackOrGrey(inferred_name));
DCHECK(marking_state()->IsBlackOrGrey(inferred_name) ||
(!is_shared_heap() && inferred_name.InSharedWritableHeap()));
marking_state()->WhiteToBlack(uncompiled_data);
// Use the raw function data setter to avoid validity checks, since we're