--- old/src/hotspot/share/services/diagnosticCommand.hpp 2019-07-19 10:38:40.000000000 -0400 +++ new/src/hotspot/share/services/diagnosticCommand.hpp 2019-07-19 10:38:40.000000000 -0400 @@ -425,6 +425,32 @@ virtual void execute(DCmdSource source, TRAPS); }; +class PrintClassLayoutDCmd : public DCmdWithParser { +protected: + DCmdArgument _classname; // lass name whose layout should be printed. +public: + PrintClassLayoutDCmd(outputStream* output, bool heap); + static const char* name() { + return "VM.class_print_layout"; + } + static const char* description() { + return "Print the layout of an instance of a class, including flattened fields. " + "The name of each class is followed by the ClassLoaderData* of its ClassLoader, " + "or \"null\" if loaded by the bootstrap class loader."; + } + static const char* impact() { + return "Medium: Depends on number of loaded classes."; + } + static const JavaPermission permission() { + JavaPermission p = {"java.lang.management.ManagementPermission", + "monitor", NULL}; + return p; + } + static int num_arguments(); + virtual void execute(DCmdSource source, TRAPS); +}; + + class TouchedMethodsDCmd : public DCmdWithParser { public: TouchedMethodsDCmd(outputStream* output, bool heap);