annotate src/share/vm/oops/klassKlass.cpp @ 2376:c7f3d0b4570f

7017732: move static fields into Class to prepare for perm gen removal Reviewed-by: kvn, coleenp, twisti, stefank
author never
date Fri, 18 Mar 2011 16:00:34 -0700
parents e5383553fd4e
children 0654ee04b214
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2227
e5383553fd4e 7014851: Remove unused parallel compaction code
stefank
parents: 2177
diff changeset
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1155
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
26 #include "gc_implementation/shared/markSweep.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
27 #include "gc_interface/collectedHeap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
28 #include "gc_interface/collectedHeap.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
29 #include "memory/oopFactory.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
30 #include "memory/permGen.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
31 #include "oops/constantPoolKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
32 #include "oops/instanceKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
33 #include "oops/instanceOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
34 #include "oops/klassKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
35 #include "oops/klassOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
36 #include "oops/methodKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
37 #include "oops/objArrayKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
38 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
39 #include "oops/oop.inline2.hpp"
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
40 #include "oops/symbol.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
41 #include "oops/typeArrayKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
42 #include "runtime/handles.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
43 #ifndef SERIALGC
2376
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
44 #include "gc_implementation/parNew/parOopClosures.inline.hpp"
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
45 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
46 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
47 #include "memory/cardTableRS.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
48 #include "oops/oop.pcgc.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1713
diff changeset
49 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 int klassKlass::oop_size(oop obj) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
52 assert (obj->is_klass(), "must be a klassOop");
a61af66fc99e Initial load
duke
parents:
diff changeset
53 return klassOop(obj)->klass_part()->klass_oop_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
54 }
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 klassOop klassKlass::create_klass(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 KlassHandle h_this_klass;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 klassKlass o;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 // for bootstrapping, handles may not be available yet.
a61af66fc99e Initial load
duke
parents:
diff changeset
60 klassOop k = base_create_klass_oop(h_this_klass, header_size(), o.vtbl_value(), CHECK_NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
61 k->set_klass(k); // point to thyself
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // Do not try to allocate mirror, java.lang.Class not loaded at this point.
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // See Universe::fixup_mirrors()
a61af66fc99e Initial load
duke
parents:
diff changeset
64 return k;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 void klassKlass::oop_follow_contents(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 Klass* k = Klass::cast(klassOop(obj));
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // If we are alive it is valid to keep our superclass and subtype caches alive
a61af66fc99e Initial load
duke
parents:
diff changeset
70 MarkSweep::mark_and_push(k->adr_super());
a61af66fc99e Initial load
duke
parents:
diff changeset
71 for (juint i = 0; i < Klass::primary_super_limit(); i++)
a61af66fc99e Initial load
duke
parents:
diff changeset
72 MarkSweep::mark_and_push(k->adr_primary_supers()+i);
a61af66fc99e Initial load
duke
parents:
diff changeset
73 MarkSweep::mark_and_push(k->adr_secondary_super_cache());
a61af66fc99e Initial load
duke
parents:
diff changeset
74 MarkSweep::mark_and_push(k->adr_secondary_supers());
a61af66fc99e Initial load
duke
parents:
diff changeset
75 MarkSweep::mark_and_push(k->adr_java_mirror());
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // We follow the subklass and sibling links at the end of the
a61af66fc99e Initial load
duke
parents:
diff changeset
77 // marking phase, since otherwise following them will prevent
a61af66fc99e Initial load
duke
parents:
diff changeset
78 // class unloading (all classes are transitively linked from
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // java.lang.Object).
a61af66fc99e Initial load
duke
parents:
diff changeset
80 MarkSweep::revisit_weak_klass_link(k);
a61af66fc99e Initial load
duke
parents:
diff changeset
81 obj->follow_header();
a61af66fc99e Initial load
duke
parents:
diff changeset
82 }
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
85 void klassKlass::oop_follow_contents(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
86 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 Klass* k = Klass::cast(klassOop(obj));
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // If we are alive it is valid to keep our superclass and subtype caches alive
a61af66fc99e Initial load
duke
parents:
diff changeset
89 PSParallelCompact::mark_and_push(cm, k->adr_super());
a61af66fc99e Initial load
duke
parents:
diff changeset
90 for (juint i = 0; i < Klass::primary_super_limit(); i++)
a61af66fc99e Initial load
duke
parents:
diff changeset
91 PSParallelCompact::mark_and_push(cm, k->adr_primary_supers()+i);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 PSParallelCompact::mark_and_push(cm, k->adr_secondary_super_cache());
a61af66fc99e Initial load
duke
parents:
diff changeset
93 PSParallelCompact::mark_and_push(cm, k->adr_secondary_supers());
a61af66fc99e Initial load
duke
parents:
diff changeset
94 PSParallelCompact::mark_and_push(cm, k->adr_java_mirror());
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // We follow the subklass and sibling links at the end of the
a61af66fc99e Initial load
duke
parents:
diff changeset
96 // marking phase, since otherwise following them will prevent
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // class unloading (all classes are transitively linked from
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // java.lang.Object).
a61af66fc99e Initial load
duke
parents:
diff changeset
99 PSParallelCompact::revisit_weak_klass_link(cm, k);
a61af66fc99e Initial load
duke
parents:
diff changeset
100 obj->follow_header(cm);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 }
a61af66fc99e Initial load
duke
parents:
diff changeset
102 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 int klassKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // Get size before changing pointers
a61af66fc99e Initial load
duke
parents:
diff changeset
106 int size = oop_size(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
107 Klass* k = Klass::cast(klassOop(obj));
a61af66fc99e Initial load
duke
parents:
diff changeset
108 blk->do_oop(k->adr_super());
a61af66fc99e Initial load
duke
parents:
diff changeset
109 for (juint i = 0; i < Klass::primary_super_limit(); i++)
a61af66fc99e Initial load
duke
parents:
diff changeset
110 blk->do_oop(k->adr_primary_supers()+i);
a61af66fc99e Initial load
duke
parents:
diff changeset
111 blk->do_oop(k->adr_secondary_super_cache());
a61af66fc99e Initial load
duke
parents:
diff changeset
112 blk->do_oop(k->adr_secondary_supers());
a61af66fc99e Initial load
duke
parents:
diff changeset
113 blk->do_oop(k->adr_java_mirror());
a61af66fc99e Initial load
duke
parents:
diff changeset
114 // The following are in the perm gen and are treated
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // specially in a later phase of a perm gen collection; ...
a61af66fc99e Initial load
duke
parents:
diff changeset
116 assert(oop(k)->is_perm(), "should be in perm");
a61af66fc99e Initial load
duke
parents:
diff changeset
117 assert(oop(k->subklass())->is_perm_or_null(), "should be in perm");
a61af66fc99e Initial load
duke
parents:
diff changeset
118 assert(oop(k->next_sibling())->is_perm_or_null(), "should be in perm");
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // ... don't scan them normally, but remember this klassKlass
a61af66fc99e Initial load
duke
parents:
diff changeset
120 // for later (see, for instance, oop_follow_contents above
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // for what MarkSweep does with it.
a61af66fc99e Initial load
duke
parents:
diff changeset
122 if (blk->should_remember_klasses()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
123 blk->remember_klass(k);
a61af66fc99e Initial load
duke
parents:
diff changeset
124 }
a61af66fc99e Initial load
duke
parents:
diff changeset
125 obj->oop_iterate_header(blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
126 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 int klassKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // Get size before changing pointers
a61af66fc99e Initial load
duke
parents:
diff changeset
132 int size = oop_size(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
133 Klass* k = Klass::cast(klassOop(obj));
a61af66fc99e Initial load
duke
parents:
diff changeset
134 oop* adr;
a61af66fc99e Initial load
duke
parents:
diff changeset
135 adr = k->adr_super();
a61af66fc99e Initial load
duke
parents:
diff changeset
136 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
137 for (juint i = 0; i < Klass::primary_super_limit(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 adr = k->adr_primary_supers()+i;
a61af66fc99e Initial load
duke
parents:
diff changeset
139 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141 adr = k->adr_secondary_super_cache();
a61af66fc99e Initial load
duke
parents:
diff changeset
142 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
143 adr = k->adr_secondary_supers();
a61af66fc99e Initial load
duke
parents:
diff changeset
144 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
145 adr = k->adr_java_mirror();
a61af66fc99e Initial load
duke
parents:
diff changeset
146 if (mr.contains(adr)) blk->do_oop(adr);
a61af66fc99e Initial load
duke
parents:
diff changeset
147 // The following are "weak links" in the perm gen and are
a61af66fc99e Initial load
duke
parents:
diff changeset
148 // treated specially in a later phase of a perm gen collection.
a61af66fc99e Initial load
duke
parents:
diff changeset
149 assert(oop(k)->is_perm(), "should be in perm");
a61af66fc99e Initial load
duke
parents:
diff changeset
150 assert(oop(k->adr_subklass())->is_perm(), "should be in perm");
a61af66fc99e Initial load
duke
parents:
diff changeset
151 assert(oop(k->adr_next_sibling())->is_perm(), "should be in perm");
a61af66fc99e Initial load
duke
parents:
diff changeset
152 if (blk->should_remember_klasses()
a61af66fc99e Initial load
duke
parents:
diff changeset
153 && (mr.contains(k->adr_subklass())
a61af66fc99e Initial load
duke
parents:
diff changeset
154 || mr.contains(k->adr_next_sibling()))) {
a61af66fc99e Initial load
duke
parents:
diff changeset
155 blk->remember_klass(k);
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157 obj->oop_iterate_header(blk, mr);
a61af66fc99e Initial load
duke
parents:
diff changeset
158 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 }
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 int klassKlass::oop_adjust_pointers(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // Get size before changing pointers
a61af66fc99e Initial load
duke
parents:
diff changeset
164 int size = oop_size(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
165 obj->adjust_header();
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 Klass* k = Klass::cast(klassOop(obj));
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 MarkSweep::adjust_pointer(k->adr_super());
a61af66fc99e Initial load
duke
parents:
diff changeset
170 for (juint i = 0; i < Klass::primary_super_limit(); i++)
a61af66fc99e Initial load
duke
parents:
diff changeset
171 MarkSweep::adjust_pointer(k->adr_primary_supers()+i);
a61af66fc99e Initial load
duke
parents:
diff changeset
172 MarkSweep::adjust_pointer(k->adr_secondary_super_cache());
a61af66fc99e Initial load
duke
parents:
diff changeset
173 MarkSweep::adjust_pointer(k->adr_secondary_supers());
a61af66fc99e Initial load
duke
parents:
diff changeset
174 MarkSweep::adjust_pointer(k->adr_java_mirror());
a61af66fc99e Initial load
duke
parents:
diff changeset
175 MarkSweep::adjust_pointer(k->adr_subklass());
a61af66fc99e Initial load
duke
parents:
diff changeset
176 MarkSweep::adjust_pointer(k->adr_next_sibling());
a61af66fc99e Initial load
duke
parents:
diff changeset
177 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
178 }
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
181 void klassKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
2376
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
182 Klass* k = Klass::cast(klassOop(obj));
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
183
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
184 oop* p = k->adr_java_mirror();
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
185 if (PSScavenge::should_scavenge(p)) {
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
186 pm->claim_or_forward_depth(p);
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
187 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
188 }
a61af66fc99e Initial load
duke
parents:
diff changeset
189
a61af66fc99e Initial load
duke
parents:
diff changeset
190 int klassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
191 Klass* k = Klass::cast(klassOop(obj));
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 oop* const beg_oop = k->oop_block_beg();
a61af66fc99e Initial load
duke
parents:
diff changeset
194 oop* const end_oop = k->oop_block_end();
a61af66fc99e Initial load
duke
parents:
diff changeset
195 for (oop* cur_oop = beg_oop; cur_oop < end_oop; ++cur_oop) {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 PSParallelCompact::adjust_pointer(cur_oop);
a61af66fc99e Initial load
duke
parents:
diff changeset
197 }
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 return oop_size(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203
a61af66fc99e Initial load
duke
parents:
diff changeset
204 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 void klassKlass::oop_print_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
207 Klass::oop_print_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
208 }
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 void klassKlass::oop_print_value_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
211 Klass::oop_print_value_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 }
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 const char* klassKlass::internal_name() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
215 return "{other class}";
a61af66fc99e Initial load
duke
parents:
diff changeset
216 }
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 // Verification
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 void klassKlass::oop_verify_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 Klass::oop_verify_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
223 guarantee(obj->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
224 guarantee(obj->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 Klass* k = Klass::cast(klassOop(obj));
a61af66fc99e Initial load
duke
parents:
diff changeset
227 if (k->super() != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 guarantee(k->super()->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
229 guarantee(k->super()->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
230 }
a61af66fc99e Initial load
duke
parents:
diff changeset
231 klassOop ko = k->secondary_super_cache();
a61af66fc99e Initial load
duke
parents:
diff changeset
232 if( ko != NULL ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
233 guarantee(ko->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
234 guarantee(ko->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
235 }
a61af66fc99e Initial load
duke
parents:
diff changeset
236 for( uint i = 0; i < primary_super_limit(); i++ ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
237 oop ko = k->adr_primary_supers()[i]; // Cannot use normal accessor because it asserts
a61af66fc99e Initial load
duke
parents:
diff changeset
238 if( ko != NULL ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
239 guarantee(ko->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
240 guarantee(ko->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 }
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 if (k->java_mirror() != NULL || (k->oop_is_instance() && instanceKlass::cast(klassOop(obj))->is_loaded())) {
a61af66fc99e Initial load
duke
parents:
diff changeset
245 guarantee(k->java_mirror() != NULL, "should be allocated");
2376
c7f3d0b4570f 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 2227
diff changeset
246 guarantee(k->java_mirror()->is_perm() || !JavaObjectsInPerm, "should be in permspace");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
247 guarantee(k->java_mirror()->is_instance(), "should be instance");
a61af66fc99e Initial load
duke
parents:
diff changeset
248 }
a61af66fc99e Initial load
duke
parents:
diff changeset
249 }