Mercurial > hg > truffle
comparison src/share/vm/oops/klass.cpp @ 8124:5fc51c1ecdeb
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 05 Mar 2013 23:44:54 +0100 |
parents | 291ffc492eb6 3c9bc17b9403 |
children | b9a918201d47 |
comparison
equal
deleted
inserted
replaced
7943:a413bcd552a4 | 8124:5fc51c1ecdeb |
---|---|
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" |
37 #include "oops/oop.inline2.hpp" | 38 #include "oops/oop.inline2.hpp" |
38 #include "runtime/atomic.hpp" | 39 #include "runtime/atomic.hpp" |
39 #include "utilities/stack.hpp" | 40 #include "utilities/stack.hpp" |
40 #ifndef SERIALGC | 41 #include "utilities/macros.hpp" |
42 #if INCLUDE_ALL_GCS | |
41 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp" | 43 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp" |
42 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" | 44 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp" |
43 #include "gc_implementation/parallelScavenge/psScavenge.hpp" | 45 #include "gc_implementation/parallelScavenge/psScavenge.hpp" |
44 #endif | 46 #endif // INCLUDE_ALL_GCS |
45 | 47 |
46 void Klass::set_name(Symbol* n) { | 48 void Klass::set_name(Symbol* n) { |
47 _name = n; | 49 _name = n; |
48 if (_name != NULL) _name->increment_refcount(); | 50 if (_name != NULL) _name->increment_refcount(); |
49 } | 51 } |
622 ResourceMark rm; // Cannot print in debug mode without this | 624 ResourceMark rm; // Cannot print in debug mode without this |
623 st->print("%s", internal_name()); | 625 st->print("%s", internal_name()); |
624 obj->print_address_on(st); | 626 obj->print_address_on(st); |
625 } | 627 } |
626 | 628 |
629 #if INCLUDE_SERVICES | |
630 // Size Statistics | |
631 void Klass::collect_statistics(KlassSizeStats *sz) const { | |
632 sz->_klass_bytes = sz->count(this); | |
633 sz->_mirror_bytes = sz->count(java_mirror()); | |
634 sz->_secondary_supers_bytes = sz->count_array(secondary_supers()); | |
635 | |
636 sz->_ro_bytes += sz->_secondary_supers_bytes; | |
637 sz->_rw_bytes += sz->_klass_bytes + sz->_mirror_bytes; | |
638 } | |
639 #endif // INCLUDE_SERVICES | |
627 | 640 |
628 // Verification | 641 // Verification |
629 | 642 |
630 void Klass::verify_on(outputStream* st) { | 643 void Klass::verify_on(outputStream* st) { |
631 guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be"); | 644 guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be"); |