hotspot/src/share/vm/oops/klass.cpp
changeset 15437 eabd4555d072
parent 14588 8ec26d2d9339
child 15484 7395ace8a11a
equal deleted inserted replaced
15431:570c5062ab8a 15437:eabd4555d072
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    27 #include "classfile/dictionary.hpp"
    27 #include "classfile/dictionary.hpp"
    28 #include "classfile/systemDictionary.hpp"
    28 #include "classfile/systemDictionary.hpp"
    29 #include "classfile/vmSymbols.hpp"
    29 #include "classfile/vmSymbols.hpp"
    30 #include "gc_implementation/shared/markSweep.inline.hpp"
    30 #include "gc_implementation/shared/markSweep.inline.hpp"
    31 #include "gc_interface/collectedHeap.inline.hpp"
    31 #include "gc_interface/collectedHeap.inline.hpp"
       
    32 #include "memory/heapInspection.hpp"
    32 #include "memory/metadataFactory.hpp"
    33 #include "memory/metadataFactory.hpp"
    33 #include "memory/oopFactory.hpp"
    34 #include "memory/oopFactory.hpp"
    34 #include "memory/resourceArea.hpp"
    35 #include "memory/resourceArea.hpp"
    35 #include "oops/instanceKlass.hpp"
    36 #include "oops/instanceKlass.hpp"
    36 #include "oops/klass.inline.hpp"
    37 #include "oops/klass.inline.hpp"
   622   ResourceMark rm;              // Cannot print in debug mode without this
   623   ResourceMark rm;              // Cannot print in debug mode without this
   623   st->print("%s", internal_name());
   624   st->print("%s", internal_name());
   624   obj->print_address_on(st);
   625   obj->print_address_on(st);
   625 }
   626 }
   626 
   627 
       
   628 #if INCLUDE_SERVICES
       
   629 // Size Statistics
       
   630 void Klass::collect_statistics(KlassSizeStats *sz) const {
       
   631   sz->_klass_bytes = sz->count(this);
       
   632   sz->_mirror_bytes = sz->count(java_mirror());
       
   633   sz->_secondary_supers_bytes = sz->count_array(secondary_supers());
       
   634 
       
   635   sz->_ro_bytes += sz->_secondary_supers_bytes;
       
   636   sz->_rw_bytes += sz->_klass_bytes + sz->_mirror_bytes;
       
   637 }
       
   638 #endif // INCLUDE_SERVICES
   627 
   639 
   628 // Verification
   640 // Verification
   629 
   641 
   630 void Klass::verify_on(outputStream* st) {
   642 void Klass::verify_on(outputStream* st) {
   631   guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be");
   643   guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be");