annotate src/share/vm/oops/objArrayKlassKlass.cpp @ 2227:e5383553fd4e

7014851: Remove unused parallel compaction code Summary: Removed. Reviewed-by: jcoomes, brutisso
author stefank
date Tue, 08 Feb 2011 12:33:19 +0100
parents 3582bf76420e
children c7f3d0b4570f
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: 1706
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
26 #include "classfile/javaClasses.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
27 #include "classfile/systemDictionary.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
28 #include "gc_implementation/shared/markSweep.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
29 #include "gc_interface/collectedHeap.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
30 #include "oops/instanceKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
31 #include "oops/objArrayKlassKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
32 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1706
diff changeset
33 #include "oops/oop.inline2.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 klassOop objArrayKlassKlass::create_klass(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 objArrayKlassKlass o;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 KlassHandle h_this_klass(THREAD, Universe::klassKlassObj());
a61af66fc99e Initial load
duke
parents:
diff changeset
38 KlassHandle k = base_create_klass(h_this_klass, header_size(), o.vtbl_value(), CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
39 assert(k()->size() == align_object_size(header_size()), "wrong size for object");
a61af66fc99e Initial load
duke
parents:
diff changeset
40 java_lang_Class::create_mirror(k, CHECK_0); // Allocate mirror
a61af66fc99e Initial load
duke
parents:
diff changeset
41 return k();
a61af66fc99e Initial load
duke
parents:
diff changeset
42 }
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 klassOop objArrayKlassKlass::allocate_system_objArray_klass(TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
45 // system_objArrays have no instance klass, so allocate with fake class, then reset to NULL
a61af66fc99e Initial load
duke
parents:
diff changeset
46 KlassHandle kk(THREAD, Universe::intArrayKlassObj());
a61af66fc99e Initial load
duke
parents:
diff changeset
47 klassOop k = allocate_objArray_klass(1, kk, CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
48 objArrayKlass* tk = (objArrayKlass*) k->klass_part();
a61af66fc99e Initial load
duke
parents:
diff changeset
49 tk->set_element_klass(NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
50 tk->set_bottom_klass(NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 return k;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 }
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 klassOop objArrayKlassKlass::allocate_objArray_klass(int n, KlassHandle element_klass, TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
56 objArrayKlassKlassHandle this_oop(THREAD, as_klassOop());
a61af66fc99e Initial load
duke
parents:
diff changeset
57 return allocate_objArray_klass_impl(this_oop, n, element_klass, THREAD);
a61af66fc99e Initial load
duke
parents:
diff changeset
58 }
a61af66fc99e Initial load
duke
parents:
diff changeset
59
a61af66fc99e Initial load
duke
parents:
diff changeset
60 klassOop objArrayKlassKlass::allocate_objArray_klass_impl(objArrayKlassKlassHandle this_oop,
a61af66fc99e Initial load
duke
parents:
diff changeset
61 int n, KlassHandle element_klass, TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // Eagerly allocate the direct array supertype.
a61af66fc99e Initial load
duke
parents:
diff changeset
64 KlassHandle super_klass = KlassHandle();
a61af66fc99e Initial load
duke
parents:
diff changeset
65 if (!Universe::is_bootstrapping()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 KlassHandle element_super (THREAD, element_klass->super());
a61af66fc99e Initial load
duke
parents:
diff changeset
67 if (element_super.not_null()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // The element type has a direct super. E.g., String[] has direct super of Object[].
a61af66fc99e Initial load
duke
parents:
diff changeset
69 super_klass = KlassHandle(THREAD, element_super->array_klass_or_null());
a61af66fc99e Initial load
duke
parents:
diff changeset
70 bool supers_exist = super_klass.not_null();
a61af66fc99e Initial load
duke
parents:
diff changeset
71 // Also, see if the element has secondary supertypes.
a61af66fc99e Initial load
duke
parents:
diff changeset
72 // We need an array type for each.
a61af66fc99e Initial load
duke
parents:
diff changeset
73 objArrayHandle element_supers = objArrayHandle(THREAD,
a61af66fc99e Initial load
duke
parents:
diff changeset
74 element_klass->secondary_supers());
a61af66fc99e Initial load
duke
parents:
diff changeset
75 for( int i = element_supers->length()-1; i >= 0; i-- ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
76 klassOop elem_super = (klassOop) element_supers->obj_at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
77 if (Klass::cast(elem_super)->array_klass_or_null() == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 supers_exist = false;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 }
a61af66fc99e Initial load
duke
parents:
diff changeset
81 }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 if (!supers_exist) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // Oops. Not allocated yet. Back out, allocate it, and retry.
a61af66fc99e Initial load
duke
parents:
diff changeset
84 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
85 if (WizardMode) {
a61af66fc99e Initial load
duke
parents:
diff changeset
86 tty->print_cr("Must retry array klass creation for depth %d",n);
a61af66fc99e Initial load
duke
parents:
diff changeset
87 }
a61af66fc99e Initial load
duke
parents:
diff changeset
88 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
89 KlassHandle ek;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 {
a61af66fc99e Initial load
duke
parents:
diff changeset
91 MutexUnlocker mu(MultiArray_lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
92 MutexUnlocker mc(Compile_lock); // for vtables
a61af66fc99e Initial load
duke
parents:
diff changeset
93 klassOop sk = element_super->array_klass(CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 super_klass = KlassHandle(THREAD, sk);
a61af66fc99e Initial load
duke
parents:
diff changeset
95 for( int i = element_supers->length()-1; i >= 0; i-- ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
96 KlassHandle elem_super (THREAD, element_supers->obj_at(i));
a61af66fc99e Initial load
duke
parents:
diff changeset
97 elem_super->array_klass(CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
98 }
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // Now retry from the beginning
a61af66fc99e Initial load
duke
parents:
diff changeset
100 klassOop klass_oop = element_klass->array_klass(n, CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // Create a handle because the enclosing brace, when locking
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // can cause a gc. Better to have this function return a Handle.
a61af66fc99e Initial load
duke
parents:
diff changeset
103 ek = KlassHandle(THREAD, klass_oop);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 } // re-lock
a61af66fc99e Initial load
duke
parents:
diff changeset
105 return ek();
a61af66fc99e Initial load
duke
parents:
diff changeset
106 }
a61af66fc99e Initial load
duke
parents:
diff changeset
107 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
108 // The element type is already Object. Object[] has direct super of Object.
1142
4ce7240d622c 6914300: ciEnv should export all well known classes
never
parents: 0
diff changeset
109 super_klass = KlassHandle(THREAD, SystemDictionary::Object_klass());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111 }
a61af66fc99e Initial load
duke
parents:
diff changeset
112
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
113 // Create type name for klass.
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
114 Symbol* name = NULL;
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
115 if (!element_klass->oop_is_instance() ||
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
116 (name = instanceKlass::cast(element_klass())->array_name()) == NULL) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 ResourceMark rm(THREAD);
a61af66fc99e Initial load
duke
parents:
diff changeset
119 char *name_str = element_klass->name()->as_C_string();
a61af66fc99e Initial load
duke
parents:
diff changeset
120 int len = element_klass->name()->utf8_length();
a61af66fc99e Initial load
duke
parents:
diff changeset
121 char *new_str = NEW_RESOURCE_ARRAY(char, len + 4);
a61af66fc99e Initial load
duke
parents:
diff changeset
122 int idx = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 new_str[idx++] = '[';
a61af66fc99e Initial load
duke
parents:
diff changeset
124 if (element_klass->oop_is_instance()) { // it could be an array or simple type
a61af66fc99e Initial load
duke
parents:
diff changeset
125 new_str[idx++] = 'L';
a61af66fc99e Initial load
duke
parents:
diff changeset
126 }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 memcpy(&new_str[idx], name_str, len * sizeof(char));
a61af66fc99e Initial load
duke
parents:
diff changeset
128 idx += len;
a61af66fc99e Initial load
duke
parents:
diff changeset
129 if (element_klass->oop_is_instance()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
130 new_str[idx++] = ';';
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132 new_str[idx++] = '\0';
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
133 name = SymbolTable::new_symbol(new_str, CHECK_0);
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
134 if (element_klass->oop_is_instance()) {
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
135 instanceKlass* ik = instanceKlass::cast(element_klass());
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
136 ik->set_array_name(name);
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
137 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 objArrayKlass o;
a61af66fc99e Initial load
duke
parents:
diff changeset
141 arrayKlassHandle k = arrayKlass::base_create_array_klass(o.vtbl_value(),
a61af66fc99e Initial load
duke
parents:
diff changeset
142 objArrayKlass::header_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
143 this_oop,
a61af66fc99e Initial load
duke
parents:
diff changeset
144 CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // Initialize instance variables
a61af66fc99e Initial load
duke
parents:
diff changeset
147 objArrayKlass* oak = objArrayKlass::cast(k());
a61af66fc99e Initial load
duke
parents:
diff changeset
148 oak->set_dimension(n);
a61af66fc99e Initial load
duke
parents:
diff changeset
149 oak->set_element_klass(element_klass());
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
150 oak->set_name(name);
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
151 // decrement refcount because object arrays are not explicitly freed. The
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
152 // instanceKlass array_name() keeps the name counted while the klass is
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
153 // loaded.
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
154 name->decrement_refcount();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
155
a61af66fc99e Initial load
duke
parents:
diff changeset
156 klassOop bk;
a61af66fc99e Initial load
duke
parents:
diff changeset
157 if (element_klass->oop_is_objArray()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 bk = objArrayKlass::cast(element_klass())->bottom_klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
159 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 bk = element_klass();
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162 assert(bk != NULL && (Klass::cast(bk)->oop_is_instance() || Klass::cast(bk)->oop_is_typeArray()), "invalid bottom klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
163 oak->set_bottom_klass(bk);
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 oak->set_layout_helper(array_layout_helper(T_OBJECT));
a61af66fc99e Initial load
duke
parents:
diff changeset
166 assert(oak->oop_is_javaArray(), "sanity");
a61af66fc99e Initial load
duke
parents:
diff changeset
167 assert(oak->oop_is_objArray(), "sanity");
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 // Call complete_create_array_klass after all instance variables has been initialized.
a61af66fc99e Initial load
duke
parents:
diff changeset
170 arrayKlass::complete_create_array_klass(k, super_klass, CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 return k();
a61af66fc99e Initial load
duke
parents:
diff changeset
173 }
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 void objArrayKlassKlass::oop_follow_contents(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
177 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
178 assert(klassOop(obj)->klass_part()->oop_is_objArray_slow(), "must be obj array");
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 objArrayKlass* oak = objArrayKlass::cast((klassOop)obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
181 MarkSweep::mark_and_push(oak->element_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
182 MarkSweep::mark_and_push(oak->bottom_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 arrayKlassKlass::oop_follow_contents(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
185 }
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
188 void objArrayKlassKlass::oop_follow_contents(ParCompactionManager* cm,
a61af66fc99e Initial load
duke
parents:
diff changeset
189 oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
190 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
191 assert(klassOop(obj)->klass_part()->oop_is_objArray_slow(), "must be obj array");
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 objArrayKlass* oak = objArrayKlass::cast((klassOop)obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
194 PSParallelCompact::mark_and_push(cm, oak->element_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
195 PSParallelCompact::mark_and_push(cm, oak->bottom_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
196
a61af66fc99e Initial load
duke
parents:
diff changeset
197 arrayKlassKlass::oop_follow_contents(cm, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
198 }
a61af66fc99e Initial load
duke
parents:
diff changeset
199 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 int objArrayKlassKlass::oop_adjust_pointers(oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
203 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
204 assert(klassOop(obj)->klass_part()->oop_is_objArray_slow(), "must be obj array");
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 objArrayKlass* oak = objArrayKlass::cast((klassOop)obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
207 MarkSweep::adjust_pointer(oak->element_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
208 MarkSweep::adjust_pointer(oak->bottom_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 return arrayKlassKlass::oop_adjust_pointers(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
211 }
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 int objArrayKlassKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
217 assert(klassOop(obj)->klass_part()->oop_is_objArray_slow(), "must be obj array");
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 objArrayKlass* oak = objArrayKlass::cast((klassOop)obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
220 blk->do_oop(oak->element_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
221 blk->do_oop(oak->bottom_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
222
a61af66fc99e Initial load
duke
parents:
diff changeset
223 return arrayKlassKlass::oop_oop_iterate(obj, blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
224 }
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226
a61af66fc99e Initial load
duke
parents:
diff changeset
227 int
a61af66fc99e Initial load
duke
parents:
diff changeset
228 objArrayKlassKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
229 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
230 assert(klassOop(obj)->klass_part()->oop_is_objArray_slow(), "must be obj array");
a61af66fc99e Initial load
duke
parents:
diff changeset
231
a61af66fc99e Initial load
duke
parents:
diff changeset
232 objArrayKlass* oak = objArrayKlass::cast((klassOop)obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 oop* addr;
a61af66fc99e Initial load
duke
parents:
diff changeset
234 addr = oak->element_klass_addr();
a61af66fc99e Initial load
duke
parents:
diff changeset
235 if (mr.contains(addr)) blk->do_oop(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 addr = oak->bottom_klass_addr();
a61af66fc99e Initial load
duke
parents:
diff changeset
237 if (mr.contains(addr)) blk->do_oop(addr);
a61af66fc99e Initial load
duke
parents:
diff changeset
238
a61af66fc99e Initial load
duke
parents:
diff changeset
239 return arrayKlassKlass::oop_oop_iterate(obj, blk);
a61af66fc99e Initial load
duke
parents:
diff changeset
240 }
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 #ifndef SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
243 void objArrayKlassKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
244 assert(obj->blueprint()->oop_is_objArrayKlass(),"must be an obj array klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 int objArrayKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
a61af66fc99e Initial load
duke
parents:
diff changeset
248 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
249 assert(klassOop(obj)->klass_part()->oop_is_objArray_slow(), "must be obj array");
a61af66fc99e Initial load
duke
parents:
diff changeset
250
a61af66fc99e Initial load
duke
parents:
diff changeset
251 objArrayKlass* oak = objArrayKlass::cast((klassOop)obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
252 PSParallelCompact::adjust_pointer(oak->element_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
253 PSParallelCompact::adjust_pointer(oak->bottom_klass_addr());
a61af66fc99e Initial load
duke
parents:
diff changeset
254
a61af66fc99e Initial load
duke
parents:
diff changeset
255 return arrayKlassKlass::oop_update_pointers(cm, obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
256 }
a61af66fc99e Initial load
duke
parents:
diff changeset
257 #endif // SERIALGC
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 void objArrayKlassKlass::oop_print_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
264 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
265 objArrayKlass* oak = (objArrayKlass*) klassOop(obj)->klass_part();
a61af66fc99e Initial load
duke
parents:
diff changeset
266 klassKlass::oop_print_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
267 st->print(" - instance klass: ");
a61af66fc99e Initial load
duke
parents:
diff changeset
268 oak->element_klass()->print_value_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
269 st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
270 }
a61af66fc99e Initial load
duke
parents:
diff changeset
271
1155
4e6abf09f540 6912062: disassembler plugin needs to produce symbolic information in product mode
jrose
parents: 1142
diff changeset
272 #endif //PRODUCT
0
a61af66fc99e Initial load
duke
parents:
diff changeset
273
a61af66fc99e Initial load
duke
parents:
diff changeset
274 void objArrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
275 assert(obj->is_klass(), "must be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
276 objArrayKlass* oak = (objArrayKlass*) klassOop(obj)->klass_part();
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 oak->element_klass()->print_value_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
279 st->print("[]");
a61af66fc99e Initial load
duke
parents:
diff changeset
280 }
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282 const char* objArrayKlassKlass::internal_name() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
283 return "{object array class}";
a61af66fc99e Initial load
duke
parents:
diff changeset
284 }
a61af66fc99e Initial load
duke
parents:
diff changeset
285
a61af66fc99e Initial load
duke
parents:
diff changeset
286
a61af66fc99e Initial load
duke
parents:
diff changeset
287 // Verification
a61af66fc99e Initial load
duke
parents:
diff changeset
288
a61af66fc99e Initial load
duke
parents:
diff changeset
289 void objArrayKlassKlass::oop_verify_on(oop obj, outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
290 klassKlass::oop_verify_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
291 objArrayKlass* oak = objArrayKlass::cast((klassOop)obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
292 guarantee(oak->element_klass()->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
293 guarantee(oak->element_klass()->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
294 guarantee(oak->bottom_klass()->is_perm(), "should be in permspace");
a61af66fc99e Initial load
duke
parents:
diff changeset
295 guarantee(oak->bottom_klass()->is_klass(), "should be klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
296 Klass* bk = Klass::cast(oak->bottom_klass());
a61af66fc99e Initial load
duke
parents:
diff changeset
297 guarantee(bk->oop_is_instance() || bk->oop_is_typeArray(), "invalid bottom klass");
a61af66fc99e Initial load
duke
parents:
diff changeset
298 }