[compiler] Add Ref name to the "Ref creation failure" error message

When failing to construct a Ref, it helps debugging knowing which class
is the one we failed to create.

Bug: v8:7790
Change-Id: I22388920633fe2155c7b4fa712c5dead25a2f2d6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2992726
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75460}
This commit is contained in:
Santiago Aboy Solanes 2021-06-29 17:13:55 +01:00 committed by V8 LUCI CQ
parent 9ca10d840c
commit 48c5d677a8

View File

@ -2914,14 +2914,14 @@ ObjectData* JSHeapBroker::TryGetOrCreateData(Handle<Object> object,
kUnserializedReadOnlyHeapObject);
}
#define CREATE_DATA(Name, Kind) \
if (object->Is##Name()) { \
CreateDataFunctor<Kind, Name##Data, Name> f; \
if (!f(this, refs_, object, &entry, &object_data)) { \
CHECK_WITH_MSG(!crash_on_error, "Ref construction failed"); \
return nullptr; \
} \
/* NOLINTNEXTLINE(readability/braces) */ \
#define CREATE_DATA(Name, Kind) \
if (object->Is##Name()) { \
CreateDataFunctor<Kind, Name##Data, Name> f; \
if (!f(this, refs_, object, &entry, &object_data)) { \
CHECK_WITH_MSG(!crash_on_error, #Name "Ref construction failed"); \
return nullptr; \
} \
/* NOLINTNEXTLINE(readability/braces) */ \
} else
HEAP_BROKER_OBJECT_LIST(CREATE_DATA)
#undef CREATE_DATA