annotate src/share/vm/oops/arrayKlass.cpp @ 20527:8cb56c8cb30d

Merge
author jiangli
date Mon, 15 Sep 2014 16:39:00 -0400
parents 6e0cb14ce59b 54bc75c144b0
children f0bedf980c65
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17674
85318d1fe8fe 8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on
coleenp
parents: 17467
diff changeset
2 * Copyright (c) 1997, 2014, 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: 1142
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1142
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: 1142
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: 1681
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
26 #include "classfile/javaClasses.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
27 #include "classfile/systemDictionary.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
28 #include "classfile/vmSymbols.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
29 #include "gc_interface/collectedHeap.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
30 #include "jvmtifiles/jvmti.h"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
31 #include "memory/gcLocker.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
32 #include "memory/universe.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
33 #include "oops/arrayKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
34 #include "oops/arrayOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
35 #include "oops/instanceKlass.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
36 #include "oops/objArrayOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1681
diff changeset
37 #include "oops/oop.inline.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
38
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
39 int ArrayKlass::static_size(int header_size) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // size of an array klass object
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
41 assert(header_size <= InstanceKlass::header_size(), "bad header size");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // If this assert fails, see comments in base_create_array_klass.
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
43 header_size = InstanceKlass::header_size();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
44 int vtable_len = Universe::base_vtable_size();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
45 #ifdef _LP64
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
46 int size = header_size + align_object_offset(vtable_len);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
47 #else
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
48 int size = header_size + vtable_len;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
49 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
50 return align_object_size(size);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 }
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
54 Klass* ArrayKlass::java_super() const {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
55 if (super() == NULL) return NULL; // bootstrap case
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Array klasses have primary supertypes which are not reported to Java.
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // Example super chain: String[][] -> Object[][] -> Object[] -> Object
1142
4ce7240d622c 6914300: ciEnv should export all well known classes
never
parents: 948
diff changeset
58 return SystemDictionary::Object_klass();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
62 oop ArrayKlass::multi_allocate(int rank, jint* sizes, TRAPS) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
63 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
64 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 }
a61af66fc99e Initial load
duke
parents:
diff changeset
66
18046
096a7e12d63f 8036805: Correct linker method lookup.
lfoltan
parents: 17467
diff changeset
67 // find field according to JVM spec 5.4.3.2, returns the klass in which the field is defined
096a7e12d63f 8036805: Correct linker method lookup.
lfoltan
parents: 17467
diff changeset
68 Klass* ArrayKlass::find_field(Symbol* name, Symbol* sig, fieldDescriptor* fd) const {
096a7e12d63f 8036805: Correct linker method lookup.
lfoltan
parents: 17467
diff changeset
69 // There are no fields in an array klass but look to the super class (Object)
096a7e12d63f 8036805: Correct linker method lookup.
lfoltan
parents: 17467
diff changeset
70 assert(super(), "super klass must be present");
096a7e12d63f 8036805: Correct linker method lookup.
lfoltan
parents: 17467
diff changeset
71 return super()->find_field(name, sig, fd);
096a7e12d63f 8036805: Correct linker method lookup.
lfoltan
parents: 17467
diff changeset
72 }
096a7e12d63f 8036805: Correct linker method lookup.
lfoltan
parents: 17467
diff changeset
73
17889
386dd1c71858 8033150: invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults.
lfoltan
parents: 17674
diff changeset
74 Method* ArrayKlass::uncached_lookup_method(Symbol* name, Symbol* signature, MethodLookupMode mode) const {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // There are no methods in an array klass but the super class (Object) has some
a61af66fc99e Initial load
duke
parents:
diff changeset
76 assert(super(), "super klass must be present");
17889
386dd1c71858 8033150: invokestatic: IncompatibleClassChangeError trying to invoke static method from a parent in presence of conflicting defaults.
lfoltan
parents: 17674
diff changeset
77 return super()->uncached_lookup_method(name, signature, mode);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
78 }
a61af66fc99e Initial load
duke
parents:
diff changeset
79
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
80 ArrayKlass::ArrayKlass(Symbol* name) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
81 set_name(name);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
82
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
83 set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
84 set_layout_helper(Klass::_lh_neutral_value);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
85 set_dimension(1);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
86 set_higher_dimension(NULL);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
87 set_lower_dimension(NULL);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
88 set_component_mirror(NULL);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // Arrays don't add any new methods, so their vtable is the same size as
a61af66fc99e Initial load
duke
parents:
diff changeset
90 // the vtable of klass Object.
a61af66fc99e Initial load
duke
parents:
diff changeset
91 int vtable_size = Universe::base_vtable_size();
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
92 set_vtable_length(vtable_size);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
93 set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
94 }
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // Initialization of vtables and mirror object is done separatly from base_create_array_klass,
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
98 // since a GC can happen. At this point all instance variables of the ArrayKlass must be setup.
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
99 void ArrayKlass::complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, TRAPS) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
100 ResourceMark rm(THREAD);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 k->initialize_supers(super_klass(), CHECK);
a61af66fc99e Initial load
duke
parents:
diff changeset
102 k->vtable()->initialize_vtable(false, CHECK);
10343
6bd680e9ea35 8003421: NPG: Move oops out of InstanceKlass into mirror
coleenp
parents: 6983
diff changeset
103 java_lang_Class::create_mirror(k, Handle(NULL), CHECK);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }
a61af66fc99e Initial load
duke
parents:
diff changeset
105
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
106 GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // interfaces = { cloneable_klass, serializable_klass };
a61af66fc99e Initial load
duke
parents:
diff changeset
108 assert(num_extra_slots == 0, "sanity of primitive array type");
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // Must share this for correct bootstrapping!
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
110 set_secondary_supers(Universe::the_array_interfaces_array());
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
111 return NULL;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
114 bool ArrayKlass::compute_is_subtype_of(Klass* k) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // An array is a subtype of Serializable, Clonable, and Object
1142
4ce7240d622c 6914300: ciEnv should export all well known classes
never
parents: 948
diff changeset
116 return k == SystemDictionary::Object_klass()
4ce7240d622c 6914300: ciEnv should export all well known classes
never
parents: 948
diff changeset
117 || k == SystemDictionary::Cloneable_klass()
4ce7240d622c 6914300: ciEnv should export all well known classes
never
parents: 948
diff changeset
118 || k == SystemDictionary::Serializable_klass();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
119 }
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
122 inline intptr_t* ArrayKlass::start_of_vtable() const {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
123 // all vtables start at the same place, that's why we use InstanceKlass::header_size here
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
124 return ((intptr_t*)this) + InstanceKlass::header_size();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
125 }
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
128 klassVtable* ArrayKlass::vtable() const {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
129 KlassHandle kh(Thread::current(), this);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
130 return new klassVtable(kh, start_of_vtable(), vtable_length() / vtableEntry::size());
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
134 objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
135 if (length < 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 if (length > arrayOopDesc::max_array_length(T_ARRAY)) {
876
1413494da700 6850957: Honor -XX:OnOutOfMemoryError when array size exceeds VM limit
martin
parents: 0
diff changeset
139 report_java_out_of_memory("Requested array size exceeds VM limit");
5935
a735aec54ea4 7123170: JCK vm/jvmti/ResourceExhausted/resexh001/resexh00101/ tests fails since 7u4 b02
sspitsyn
parents: 2426
diff changeset
140 JvmtiExport::post_array_size_exhausted();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
141 THROW_OOP_0(Universe::out_of_memory_error_array_size());
a61af66fc99e Initial load
duke
parents:
diff changeset
142 }
a61af66fc99e Initial load
duke
parents:
diff changeset
143 int size = objArrayOopDesc::object_size(length);
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
144 Klass* k = array_klass(n+dimension(), CHECK_0);
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
145 ArrayKlass* ak = ArrayKlass::cast(k);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
146 objArrayOop o =
a61af66fc99e Initial load
duke
parents:
diff changeset
147 (objArrayOop)CollectedHeap::array_allocate(ak, size, length, CHECK_0);
a61af66fc99e Initial load
duke
parents:
diff changeset
148 // initialization to NULL not necessary, area already cleared
a61af66fc99e Initial load
duke
parents:
diff changeset
149 return o;
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
152 void ArrayKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
153 Klass* k = this;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
154 // Iterate over this array klass and all higher dimensions
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
155 while (k != NULL) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
156 f(k, CHECK);
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
157 k = ArrayKlass::cast(k)->higher_dimension();
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
158 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
159 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
160
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
161 void ArrayKlass::array_klasses_do(void f(Klass* k)) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
162 Klass* k = this;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // Iterate over this array klass and all higher dimensions
a61af66fc99e Initial load
duke
parents:
diff changeset
164 while (k != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
165 f(k);
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
166 k = ArrayKlass::cast(k)->higher_dimension();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
167 }
a61af66fc99e Initial load
duke
parents:
diff changeset
168 }
a61af66fc99e Initial load
duke
parents:
diff changeset
169
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
170 // GC support
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
171
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
172 void ArrayKlass::oops_do(OopClosure* cl) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
173 Klass::oops_do(cl);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
174
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
175 cl->do_oop(adr_component_mirror());
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
176 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
177
0
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // JVM support
a61af66fc99e Initial load
duke
parents:
diff changeset
179
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
180 jint ArrayKlass::compute_modifier_flags(TRAPS) const {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
181 return JVM_ACC_ABSTRACT | JVM_ACC_FINAL | JVM_ACC_PUBLIC;
a61af66fc99e Initial load
duke
parents:
diff changeset
182 }
a61af66fc99e Initial load
duke
parents:
diff changeset
183
a61af66fc99e Initial load
duke
parents:
diff changeset
184 // JVMTI support
a61af66fc99e Initial load
duke
parents:
diff changeset
185
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
186 jint ArrayKlass::jvmti_class_status() const {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
187 return JVMTI_CLASS_STATUS_ARRAY;
a61af66fc99e Initial load
duke
parents:
diff changeset
188 }
a61af66fc99e Initial load
duke
parents:
diff changeset
189
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
190 void ArrayKlass::remove_unshareable_info() {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
191 Klass::remove_unshareable_info();
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
192 // Clear the java mirror
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
193 set_component_mirror(NULL);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
194 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
195
20375
6e0cb14ce59b 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 17889
diff changeset
196 void ArrayKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS) {
6e0cb14ce59b 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 17889
diff changeset
197 assert(loader_data == ClassLoaderData::the_null_class_loader_data(), "array classes belong to null loader");
6e0cb14ce59b 8046070: Class Data Sharing clean up and refactoring
iklam
parents: 17889
diff changeset
198 Klass::restore_unshareable_info(loader_data, protection_domain, CHECK);
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
199 // Klass recreates the component mirror also
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
200 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
201
0
a61af66fc99e Initial load
duke
parents:
diff changeset
202 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
203
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
204 void ArrayKlass::print_on(outputStream* st) const {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
205 assert(is_klass(), "must be klass");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
206 Klass::print_on(st);
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
207 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
208
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
209 void ArrayKlass::print_value_on(outputStream* st) const {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
210 assert(is_klass(), "must be klass");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
211 for(int index = 0; index < dimension(); index++) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
212 st->print("[]");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
213 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
214 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
215
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
216 void ArrayKlass::oop_print_on(oop obj, outputStream* st) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
217 assert(obj->is_array(), "must be array");
a61af66fc99e Initial load
duke
parents:
diff changeset
218 Klass::oop_print_on(obj, st);
a61af66fc99e Initial load
duke
parents:
diff changeset
219 st->print_cr(" - length: %d", arrayOop(obj)->length());
a61af66fc99e Initial load
duke
parents:
diff changeset
220 }
a61af66fc99e Initial load
duke
parents:
diff changeset
221
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
222
0
a61af66fc99e Initial load
duke
parents:
diff changeset
223 // Verification
a61af66fc99e Initial load
duke
parents:
diff changeset
224
17674
85318d1fe8fe 8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on
coleenp
parents: 17467
diff changeset
225 void ArrayKlass::verify_on(outputStream* st) {
85318d1fe8fe 8027146: Class loading verification failure if GC occurs in Universe::flush_dependents_on
coleenp
parents: 17467
diff changeset
226 Klass::verify_on(st);
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
227
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
228 if (component_mirror() != NULL) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
229 guarantee(component_mirror()->klass() != NULL, "should have a class");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
230 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
231 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 5935
diff changeset
232
6831
d8ce2825b193 8000213: NPG: Should have renamed arrayKlass and typeArrayKlass
coleenp
parents: 6725
diff changeset
233 void ArrayKlass::oop_verify_on(oop obj, outputStream* st) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
234 guarantee(obj->is_array(), "must be array");
a61af66fc99e Initial load
duke
parents:
diff changeset
235 arrayOop a = arrayOop(obj);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 guarantee(a->length() >= 0, "array with negative length?");
a61af66fc99e Initial load
duke
parents:
diff changeset
237 }