From 48c5d677a8821818ff9bb2aaf9d3ef4b38c54a53 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Tue, 29 Jun 2021 17:13:55 +0100 Subject: [PATCH] [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 Commit-Queue: Santiago Aboy Solanes Cr-Commit-Position: refs/heads/master@{#75460} --- src/compiler/heap-refs.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/heap-refs.cc b/src/compiler/heap-refs.cc index 0fe5eae25e..b6ddfdb18a 100644 --- a/src/compiler/heap-refs.cc +++ b/src/compiler/heap-refs.cc @@ -2914,14 +2914,14 @@ ObjectData* JSHeapBroker::TryGetOrCreateData(Handle object, kUnserializedReadOnlyHeapObject); } -#define CREATE_DATA(Name, Kind) \ - if (object->Is##Name()) { \ - CreateDataFunctor 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 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