[compiler] Handle empty optional in ReadFeedbackForGlobalAccess

Alternatively, the CHECK and load could be removed.

Bug: v8:7790,chromium:1237309
Change-Id: I45b1495002a47f2f4ff2915c7997e34c79c1aed2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3080561
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76154}
This commit is contained in:
Jakob Gruber 2021-08-09 09:21:50 +02:00 committed by V8 LUCI CQ
parent 5e90616319
commit 71986fef2f

View File

@ -643,9 +643,8 @@ ProcessedFeedback const& JSHeapBroker::ReadFeedbackForGlobalAccess(
target_native_context().script_context_table().object()->get_context(
script_context_index));
ObjectRef contents = context.get(context_slot_index).value();
CHECK(!contents.equals(
MakeRef<Object>(this, isolate()->factory()->the_hole_value())));
base::Optional<ObjectRef> contents = context.get(context_slot_index);
if (contents.has_value()) CHECK(!contents->IsTheHole());
return *zone()->New<GlobalAccessFeedback>(
context, context_slot_index,