8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderData.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "gc_interface/collectedHeap.hpp"
29 #include "memory/genCollectedHeap.hpp"
30 #include "memory/heapInspection.hpp"
31 #include "memory/resourceArea.hpp"
32 #include "oops/oop.inline.hpp"
33 #include "runtime/os.hpp"
34 #include "utilities/globalDefinitions.hpp"
35 #include "utilities/macros.hpp"
36 #include "utilities/stack.inline.hpp"
37 #if INCLUDE_ALL_GCS
38 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
39 #endif // INCLUDE_ALL_GCS
40
41 // HeapInspection
42
43 inline KlassInfoEntry::~KlassInfoEntry() {
44 if (_subclasses != NULL) {
45 delete _subclasses;
46 }
47 }
48
49 inline void KlassInfoEntry::add_subclass(KlassInfoEntry* cie) {
50 if (_subclasses == NULL) {
51 _subclasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<KlassInfoEntry*>(4, true);
52 }
53 _subclasses->append(cie);
54 }
55
56 int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) {
57 if(e1->_instance_words > e2->_instance_words) {
58 return -1;
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderData.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "gc/shared/collectedHeap.hpp"
29 #include "gc/shared/genCollectedHeap.hpp"
30 #include "memory/heapInspection.hpp"
31 #include "memory/resourceArea.hpp"
32 #include "oops/oop.inline.hpp"
33 #include "runtime/os.hpp"
34 #include "utilities/globalDefinitions.hpp"
35 #include "utilities/macros.hpp"
36 #include "utilities/stack.inline.hpp"
37 #if INCLUDE_ALL_GCS
38 #include "gc/parallel/parallelScavengeHeap.hpp"
39 #endif // INCLUDE_ALL_GCS
40
41 // HeapInspection
42
43 inline KlassInfoEntry::~KlassInfoEntry() {
44 if (_subclasses != NULL) {
45 delete _subclasses;
46 }
47 }
48
49 inline void KlassInfoEntry::add_subclass(KlassInfoEntry* cie) {
50 if (_subclasses == NULL) {
51 _subclasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<KlassInfoEntry*>(4, true);
52 }
53 _subclasses->append(cie);
54 }
55
56 int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) {
57 if(e1->_instance_words > e2->_instance_words) {
58 return -1;
|