< prev index next >

src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp

Print this page
rev 50565 : [mq]: 8203343-VM.metaspace-show-reflection-invocation-targets

@@ -28,10 +28,11 @@
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/classLoaderHierarchyDCmd.hpp"
 #include "memory/allocation.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/safepoint.hpp"
+#include "oops/reflectionAccessorImplKlassHelper.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/ostream.hpp"
 
 
 ClassLoaderHierarchyDCmd::ClassLoaderHierarchyDCmd(outputStream* output, bool heap)

@@ -200,23 +201,31 @@
         branchtracker.print(st);
         st->cr();
       }
 
       if (print_classes) {
-
         if (_classes != NULL) {
           for (LoadedClassInfo* lci = _classes; lci; lci = lci->_next) {
+            // Non-anonymous classes should live in the primary CLD of its loader
+            assert(lci->_cld == _cld, "must be");
+
             branchtracker.print(st);
             if (lci == _classes) { // first iteration
               st->print("%*s ", indentation, "Classes:");
             } else {
               st->print("%*s ", indentation, "");
             }
             st->print("%s", lci->_klass->external_name());
+
+            // Special treatment for generated core reflection accessor classes: print invocation target.
+            if (ReflectionAccessorImplKlassHelper::is_generated_accessor(lci->_klass)) {
+              st->print(" (invokes: ");
+              ReflectionAccessorImplKlassHelper::print_invocation_target(st, lci->_klass);
+              st->print(")");
+            }
+
             st->cr();
-            // Non-anonymous classes should live in the primary CLD of its loader
-            assert(lci->_cld == _cld, "must be");
           }
           branchtracker.print(st);
           st->print("%*s ", indentation, "");
           st->print_cr("(%u class%s)", _num_classes, (_num_classes == 1) ? "" : "es");
 
< prev index next >