| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index bfd1fb50958ee8288422606051700c4324438775..2d361f763068c424624bddbb366535a527a0310f 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -6501,5 +6501,34 @@ void Heap::UnregisterStrongRoots(Object** start) {
|
| list = next;
|
| }
|
| }
|
| +
|
| +
|
| +const char* Heap::GetObjectTypeName(size_t index) {
|
| + if (index >= OBJECT_STATS_COUNT) return nullptr;
|
| +
|
| + switch (static_cast<int>(index)) {
|
| +#define COMPARE_AND_RETURN_NAME(name) \
|
| + case name: \
|
| + return #name;
|
| + INSTANCE_TYPE_LIST(COMPARE_AND_RETURN_NAME)
|
| +#undef COMPARE_AND_RETURN_NAME
|
| +#define COMPARE_AND_RETURN_NAME(name) \
|
| + case FIRST_CODE_KIND_SUB_TYPE + Code::name: \
|
| + return "CODE_TYPE/CODE_KIND/" #name;
|
| + CODE_KIND_LIST(COMPARE_AND_RETURN_NAME)
|
| +#undef COMPARE_AND_RETURN_NAME
|
| +#define COMPARE_AND_RETURN_NAME(name) \
|
| + case FIRST_FIXED_ARRAY_SUB_TYPE + name: \
|
| + return "FIXED_ARRAY_TYPE/" #name;
|
| + FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COMPARE_AND_RETURN_NAME)
|
| +#undef COMPARE_AND_RETURN_NAME
|
| +#define COMPARE_AND_RETURN_NAME(name) \
|
| + case FIRST_CODE_AGE_SUB_TYPE + Code::k##name##CodeAge - Code::kFirstCodeAge: \
|
| + return "CODE_TYPE/CODE_AGE/" #name;
|
| + CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
|
| +#undef COMPARE_AND_RETURN_NAME
|
| + }
|
| + return nullptr;
|
| +}
|
| }
|
| } // namespace v8::internal
|
|
|