hotspot/src/share/vm/classfile/classLoaderStats.cpp
author roland
Thu, 10 Jul 2014 15:12:48 +0200
changeset 25635 d2f8ae0c908b
parent 25051 8110ec6e7340
child 29081 c61eb4914428
permissions -rw-r--r--
8040237: nsk/jvmti/RetransformClasses/retransform001 crashed the VM on all platforms when run with with -server -Xcomp Summary: class redefinition may cause speculative trap clean up code to dereference dead method Reviewed-by: kvn, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25051
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     1
/*
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     4
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     8
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    13
 * accompanied this code).
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    14
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    18
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    21
 * questions.
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    22
 *
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    23
 */
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    24
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    25
#include "precompiled.hpp"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    26
#include "classfile/classLoaderStats.hpp"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    27
#include "utilities/globalDefinitions.hpp"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    28
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    29
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    30
class ClassStatsClosure : public KlassClosure {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    31
public:
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    32
  int _num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    33
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    34
  ClassStatsClosure() :
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    35
    _num_classes(0) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    36
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    37
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    38
  virtual void do_klass(Klass* k) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    39
    _num_classes++;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    40
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    41
};
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    42
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    43
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    44
void ClassLoaderStatsClosure::do_cld(ClassLoaderData* cld) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    45
  oop cl = cld->class_loader();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    46
  ClassLoaderStats* cls;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    47
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    48
  // The hashtable key is the ClassLoader oop since we want to account
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    49
  // for "real" classes and anonymous classes together
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    50
  ClassLoaderStats** cls_ptr = _stats->get(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    51
  if (cls_ptr == NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    52
    cls = new ClassLoaderStats();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    53
    _stats->put(cl, cls);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    54
    _total_loaders++;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    55
  } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    56
    cls = *cls_ptr;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    57
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    58
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    59
  if (!cld->is_anonymous()) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    60
    cls->_cld = cld;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    61
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    62
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    63
  cls->_class_loader = cl;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    64
  if (cl != NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    65
    cls->_parent = java_lang_ClassLoader::parent(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    66
    addEmptyParents(cls->_parent);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    67
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    68
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    69
  ClassStatsClosure csc;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    70
  cld->classes_do(&csc);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    71
  if(cld->is_anonymous()) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    72
    cls->_anon_classes_count += csc._num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    73
  } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    74
    cls->_classes_count = csc._num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    75
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    76
  _total_classes += csc._num_classes;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    77
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    78
  Metaspace* ms = cld->metaspace_or_null();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    79
  if (ms != NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    80
    if(cld->is_anonymous()) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    81
      cls->_anon_chunk_sz += ms->allocated_chunks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    82
      cls->_anon_block_sz += ms->allocated_blocks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    83
    } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    84
      cls->_chunk_sz = ms->allocated_chunks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    85
      cls->_block_sz = ms->allocated_blocks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    86
    }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    87
    _total_chunk_sz += ms->allocated_chunks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    88
    _total_block_sz += ms->allocated_blocks_bytes();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    89
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    90
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    91
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    92
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    93
// Handles the difference in pointer width on 32 and 64 bit platforms
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    94
#ifdef _LP64
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    95
  #define SPACE "%8s"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    96
#else
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    97
  #define SPACE "%s"
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    98
#endif
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
    99
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   100
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   101
bool ClassLoaderStatsClosure::do_entry(oop const& key, ClassLoaderStats* const& cls) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   102
  Klass* class_loader_klass = (cls->_class_loader == NULL ? NULL : cls->_class_loader->klass());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   103
  Klass* parent_klass = (cls->_parent == NULL ? NULL : cls->_parent->klass());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   104
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   105
  _out->print(INTPTR_FORMAT "  " INTPTR_FORMAT "  " INTPTR_FORMAT "  " UINTX_FORMAT_W(6) "  " SIZE_FORMAT_W(8) "  " SIZE_FORMAT_W(8) "  ",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   106
      p2i(class_loader_klass), p2i(parent_klass), p2i(cls->_cld),
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   107
      cls->_classes_count,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   108
      cls->_chunk_sz, cls->_block_sz);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   109
  if (class_loader_klass != NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   110
    _out->print("%s", class_loader_klass->external_name());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   111
  } else {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   112
    _out->print("<boot class loader>");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   113
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   114
  _out->cr();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   115
  if (cls->_anon_classes_count > 0) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   116
    _out->print_cr(SPACE SPACE SPACE "                                    " UINTX_FORMAT_W(6) "  " SIZE_FORMAT_W(8) "  " SIZE_FORMAT_W(8) "   + unsafe anonymous classes",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   117
        "", "", "",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   118
        cls->_anon_classes_count,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   119
        cls->_anon_chunk_sz, cls->_anon_block_sz);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   120
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   121
  return true;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   122
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   123
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   124
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   125
void ClassLoaderStatsClosure::print() {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   126
  _out->print_cr("ClassLoader" SPACE " Parent" SPACE "      CLD*" SPACE "       Classes   ChunkSz   BlockSz  Type", "", "", "");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   127
  _stats->iterate(this);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   128
  _out->print("Total = " UINTX_FORMAT_W(-6), _total_loaders);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   129
  _out->print(SPACE SPACE SPACE "                      ", "", "", "");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   130
  _out->print_cr(UINTX_FORMAT_W(6) "  " SIZE_FORMAT_W(8) "  " SIZE_FORMAT_W(8) "  ",
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   131
      _total_classes,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   132
      _total_chunk_sz,
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   133
      _total_block_sz);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   134
  _out->print_cr("ChunkSz: Total size of all allocated metaspace chunks");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   135
  _out->print_cr("BlockSz: Total size of all allocated metaspace blocks (each chunk has several blocks)");
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   136
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   137
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   138
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   139
void ClassLoaderStatsClosure::addEmptyParents(oop cl) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   140
  while (cl != NULL && java_lang_ClassLoader::loader_data(cl) == NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   141
    // This classloader has not loaded any classes
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   142
    ClassLoaderStats** cls_ptr = _stats->get(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   143
    if (cls_ptr == NULL) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   144
      // It does not exist in our table - add it
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   145
      ClassLoaderStats* cls = new ClassLoaderStats();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   146
      cls->_class_loader = cl;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   147
      cls->_parent = java_lang_ClassLoader::parent(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   148
      _stats->put(cl, cls);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   149
      _total_loaders++;
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   150
    }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   151
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   152
    cl = java_lang_ClassLoader::parent(cl);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   153
  }
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   154
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   155
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   156
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   157
void ClassLoaderStatsVMOperation::doit() {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   158
  ClassLoaderStatsClosure clsc (_out);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   159
  ClassLoaderDataGraph::cld_do(&clsc);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   160
  clsc.print();
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   161
}
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   162
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   163
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   164
void ClassLoaderStatsDCmd::execute(DCmdSource source, TRAPS) {
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   165
  ClassLoaderStatsVMOperation op(output());
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   166
  VMThread::execute(&op);
8110ec6e7340 8044107: Add Diagnostic Command to list all ClassLoaders
sla
parents:
diff changeset
   167
}