diff a/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp b/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp --- a/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp +++ b/src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp @@ -23,22 +23,22 @@ */ #ifndef SHARE_JFR_LEAKPROFILER_UTILITIES_ROOTTYPE_HPP #define SHARE_JFR_LEAKPROFILER_UTILITIES_ROOTTYPE_HPP +#include "gc/shared/oopStorageSet.hpp" #include "memory/allocation.hpp" -#include "utilities/debug.hpp" class OldObjectRoot : public AllStatic { public: enum System { _system_undetermined, _universe, - _global_jni_handles, _threads, + _strong_oop_storage_set_first, + _strong_oop_storage_set_last = _strong_oop_storage_set_first + OopStorageSet::strong_count - 1, _object_synchronizer, - _vm_global, _class_loader_data, _management, _jvmti, _code_cache, _aot, @@ -49,63 +49,16 @@ enum Type { _type_undetermined, _stack_variable, _local_jni_handle, _global_jni_handle, + _global_oop_handle, _handle_area, _number_of_types }; - static const char* system_description(System system) { - switch (system) { - case _system_undetermined: - return ""; - case _universe: - return "Universe"; - case _global_jni_handles: - return "Global JNI Handles"; - case _threads: - return "Threads"; - case _object_synchronizer: - return "Object Monitor"; - case _vm_global: - return "VM Global"; - case _class_loader_data: - return "Class Loader Data"; - case _management: - return "Management"; - case _jvmti: - return "JVMTI"; - case _code_cache: - return "Code Cache"; - case _aot: - return "AOT"; -#if INCLUDE_JVMCI - case _jvmci: - return "JVMCI"; -#endif - default: - ShouldNotReachHere(); - } - return NULL; - } - - static const char* type_description(Type type) { - switch (type) { - case _type_undetermined: - return ""; - case _stack_variable: - return "Stack Variable"; - case _local_jni_handle: - return "Local JNI Handle"; - case _global_jni_handle: - return "Global JNI Handle"; - case _handle_area: - return "Handle Area"; - default: - ShouldNotReachHere(); - } - return NULL; - } + static OopStorage* system_oop_storage(System system); + static const char* system_description(System system); + static const char* type_description(Type type); }; #endif // SHARE_JFR_LEAKPROFILER_UTILITIES_ROOTTYPE_HPP