author | coleenp |
Mon, 13 Nov 2017 17:29:00 -0500 | |
changeset 47887 | e20d8f168bb6 |
parent 47551 | 4d034d861e13 |
child 48614 | c39ae979ca35 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41669
diff
changeset
|
2 |
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4571
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4571
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4571
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "ci/ciField.hpp" |
|
27 |
#include "ci/ciInstance.hpp" |
|
28 |
#include "ci/ciInstanceKlass.hpp" |
|
29 |
#include "ci/ciUtilities.hpp" |
|
30 |
#include "classfile/systemDictionary.hpp" |
|
31 |
#include "memory/allocation.hpp" |
|
32 |
#include "memory/allocation.inline.hpp" |
|
37248 | 33 |
#include "memory/resourceArea.hpp" |
7397 | 34 |
#include "oops/oop.inline.hpp" |
10546 | 35 |
#include "oops/fieldStreams.hpp" |
7397 | 36 |
#include "runtime/fieldDescriptor.hpp" |
47887
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
37 |
#if INCLUDE_ALL_GCS |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
38 |
# include "gc/g1/g1SATBCardTableModRefBS.hpp" |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
39 |
#endif |
1 | 40 |
|
41 |
// ciInstanceKlass |
|
42 |
// |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
43 |
// This class represents a Klass* in the HotSpot virtual machine |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
44 |
// whose Klass part in an InstanceKlass. |
1 | 45 |
|
46 |
// ------------------------------------------------------------------ |
|
47887
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
47 |
// ensure_metadata_alive |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
48 |
// |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
49 |
// Ensure that the metadata wrapped by the ciMetadata is kept alive by GC. |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
50 |
// This is primarily useful for metadata which is considered as weak roots |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
51 |
// by the GC but need to be strong roots if reachable from a current compilation. |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
52 |
// InstanceKlass are created for both weak and strong metadata. Ensuring this metadata |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
53 |
// alive covers the cases where there are weak roots without performance cost. |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
54 |
// |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
55 |
static void ensure_metadata_alive(oop metadata_holder) { |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
56 |
#if INCLUDE_ALL_GCS |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
57 |
if (!UseG1GC) { |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
58 |
return; |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
59 |
} |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
60 |
if (metadata_holder != NULL) { |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
61 |
G1SATBCardTableModRefBS::enqueue(metadata_holder); |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
62 |
} |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
63 |
#endif |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
64 |
} |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
65 |
|
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
66 |
|
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
67 |
// ------------------------------------------------------------------ |
1 | 68 |
// ciInstanceKlass::ciInstanceKlass |
69 |
// |
|
70 |
// Loaded instance klass. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41669
diff
changeset
|
71 |
ciInstanceKlass::ciInstanceKlass(Klass* k) : |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41669
diff
changeset
|
72 |
ciKlass(k) |
217
c646ef2f5d58
6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents:
1
diff
changeset
|
73 |
{ |
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
31519
diff
changeset
|
74 |
assert(get_Klass()->is_instance_klass(), "wrong type"); |
8314
057b1c20fd7e
6354181: nsk.logging.stress.threads.scmhml001 fails assertion in "src/share/vm/oops/instanceKlass.cpp, 111"
never
parents:
8076
diff
changeset
|
75 |
assert(get_instanceKlass()->is_loaded(), "must be at least loaded"); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
76 |
InstanceKlass* ik = get_instanceKlass(); |
1 | 77 |
|
78 |
AccessFlags access_flags = ik->access_flags(); |
|
79 |
_flags = ciFlags(access_flags); |
|
80 |
_has_finalizer = access_flags.has_finalizer(); |
|
81 |
_has_subklass = ik->subklass() != NULL; |
|
11407
5399831730cd
7117052: instanceKlass::_init_state can be u1 type
coleenp
parents:
10546
diff
changeset
|
82 |
_init_state = ik->init_state(); |
1 | 83 |
_nonstatic_field_size = ik->nonstatic_field_size(); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
84 |
_has_nonstatic_fields = ik->has_nonstatic_fields(); |
41669
2091069b6851
8081800: AbstractMethodError when evaluating a private method in an interface via debugger
dholmes
parents:
37248
diff
changeset
|
85 |
_has_nonstatic_concrete_methods = ik->has_nonstatic_concrete_methods(); |
31519
bb26c50aadd0
8087218: Constant fold loads from final instance fields in VM anonymous classes
vlivanov
parents:
31037
diff
changeset
|
86 |
_is_anonymous = ik->is_anonymous(); |
1 | 87 |
_nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields: |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
88 |
_has_injected_fields = -1; |
12369
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
89 |
_implementor = NULL; // we will fill these lazily |
1 | 90 |
|
47887
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
91 |
oop holder = ik->klass_holder(); |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
92 |
ensure_metadata_alive(holder); |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
93 |
if (ik->is_anonymous()) { |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
94 |
// Though ciInstanceKlass records class loader oop, it's not enough to keep |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
95 |
// VM anonymous classes alive (loader == NULL). Klass holder should be used instead. |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
96 |
// It is enough to record a ciObject, since cached elements are never removed |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
97 |
// during ciObjectFactory lifetime. ciObjectFactory itself is created for |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
98 |
// every compilation and lives for the whole duration of the compilation. |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
99 |
assert(holder != NULL, "holder of anonymous class is the mirror which is never null"); |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
100 |
(void)CURRENT_ENV->get_object(holder); |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
101 |
} |
e20d8f168bb6
8190891: Clean up G1 barrier code in compiler interface (ci)
coleenp
parents:
47551
diff
changeset
|
102 |
|
1 | 103 |
Thread *thread = Thread::current(); |
104 |
if (ciObjectFactory::is_initialized()) { |
|
105 |
_loader = JNIHandles::make_local(thread, ik->class_loader()); |
|
106 |
_protection_domain = JNIHandles::make_local(thread, |
|
107 |
ik->protection_domain()); |
|
108 |
_is_shared = false; |
|
109 |
} else { |
|
110 |
Handle h_loader(thread, ik->class_loader()); |
|
111 |
Handle h_protection_domain(thread, ik->protection_domain()); |
|
112 |
_loader = JNIHandles::make_global(h_loader); |
|
113 |
_protection_domain = JNIHandles::make_global(h_protection_domain); |
|
114 |
_is_shared = true; |
|
115 |
} |
|
116 |
||
117 |
// Lazy fields get filled in only upon request. |
|
118 |
_super = NULL; |
|
119 |
_java_mirror = NULL; |
|
120 |
||
121 |
if (is_shared()) { |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
41669
diff
changeset
|
122 |
if (k != SystemDictionary::Object_klass()) { |
1 | 123 |
super(); |
124 |
} |
|
125 |
//compute_nonstatic_fields(); // done outside of constructor |
|
126 |
} |
|
127 |
||
128 |
_field_cache = NULL; |
|
129 |
} |
|
130 |
||
131 |
// Version for unloaded classes: |
|
132 |
ciInstanceKlass::ciInstanceKlass(ciSymbol* name, |
|
133 |
jobject loader, jobject protection_domain) |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
134 |
: ciKlass(name, T_OBJECT) |
1 | 135 |
{ |
136 |
assert(name->byte_at(0) != '[', "not an instance klass"); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
137 |
_init_state = (InstanceKlass::ClassState)0; |
1 | 138 |
_nonstatic_field_size = -1; |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
139 |
_has_nonstatic_fields = false; |
1 | 140 |
_nonstatic_fields = NULL; |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
141 |
_has_injected_fields = -1; |
31519
bb26c50aadd0
8087218: Constant fold loads from final instance fields in VM anonymous classes
vlivanov
parents:
31037
diff
changeset
|
142 |
_is_anonymous = false; |
1 | 143 |
_loader = loader; |
144 |
_protection_domain = protection_domain; |
|
145 |
_is_shared = false; |
|
146 |
_super = NULL; |
|
147 |
_java_mirror = NULL; |
|
148 |
_field_cache = NULL; |
|
149 |
} |
|
150 |
||
151 |
||
152 |
||
153 |
// ------------------------------------------------------------------ |
|
154 |
// ciInstanceKlass::compute_shared_is_initialized |
|
5925
a30fef61d0b7
6958668: repeated uncommon trapping for new of klass which is being initialized
never
parents:
5884
diff
changeset
|
155 |
void ciInstanceKlass::compute_shared_init_state() { |
1 | 156 |
GUARDED_VM_ENTRY( |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
157 |
InstanceKlass* ik = get_instanceKlass(); |
11407
5399831730cd
7117052: instanceKlass::_init_state can be u1 type
coleenp
parents:
10546
diff
changeset
|
158 |
_init_state = ik->init_state(); |
1 | 159 |
) |
160 |
} |
|
161 |
||
162 |
// ------------------------------------------------------------------ |
|
163 |
// ciInstanceKlass::compute_shared_has_subklass |
|
164 |
bool ciInstanceKlass::compute_shared_has_subklass() { |
|
165 |
GUARDED_VM_ENTRY( |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
166 |
InstanceKlass* ik = get_instanceKlass(); |
1 | 167 |
_has_subklass = ik->subklass() != NULL; |
168 |
return _has_subklass; |
|
169 |
) |
|
170 |
} |
|
171 |
||
172 |
// ------------------------------------------------------------------ |
|
173 |
// ciInstanceKlass::loader |
|
174 |
oop ciInstanceKlass::loader() { |
|
175 |
ASSERT_IN_VM; |
|
176 |
return JNIHandles::resolve(_loader); |
|
177 |
} |
|
178 |
||
179 |
// ------------------------------------------------------------------ |
|
180 |
// ciInstanceKlass::loader_handle |
|
181 |
jobject ciInstanceKlass::loader_handle() { |
|
182 |
return _loader; |
|
183 |
} |
|
184 |
||
185 |
// ------------------------------------------------------------------ |
|
186 |
// ciInstanceKlass::protection_domain |
|
187 |
oop ciInstanceKlass::protection_domain() { |
|
188 |
ASSERT_IN_VM; |
|
189 |
return JNIHandles::resolve(_protection_domain); |
|
190 |
} |
|
191 |
||
192 |
// ------------------------------------------------------------------ |
|
193 |
// ciInstanceKlass::protection_domain_handle |
|
194 |
jobject ciInstanceKlass::protection_domain_handle() { |
|
195 |
return _protection_domain; |
|
196 |
} |
|
197 |
||
198 |
// ------------------------------------------------------------------ |
|
199 |
// ciInstanceKlass::field_cache |
|
200 |
// |
|
201 |
// Get the field cache associated with this klass. |
|
202 |
ciConstantPoolCache* ciInstanceKlass::field_cache() { |
|
203 |
if (is_shared()) { |
|
204 |
return NULL; |
|
205 |
} |
|
206 |
if (_field_cache == NULL) { |
|
207 |
assert(!is_java_lang_Object(), "Object has no fields"); |
|
208 |
Arena* arena = CURRENT_ENV->arena(); |
|
209 |
_field_cache = new (arena) ciConstantPoolCache(arena, 5); |
|
210 |
} |
|
211 |
return _field_cache; |
|
212 |
} |
|
213 |
||
214 |
// ------------------------------------------------------------------ |
|
215 |
// ciInstanceKlass::get_canonical_holder |
|
216 |
// |
|
217 |
ciInstanceKlass* ciInstanceKlass::get_canonical_holder(int offset) { |
|
218 |
#ifdef ASSERT |
|
219 |
if (!(offset >= 0 && offset < layout_helper())) { |
|
220 |
tty->print("*** get_canonical_holder(%d) on ", offset); |
|
221 |
this->print(); |
|
222 |
tty->print_cr(" ***"); |
|
223 |
}; |
|
224 |
assert(offset >= 0 && offset < layout_helper(), "offset must be tame"); |
|
225 |
#endif |
|
226 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
227 |
if (offset < instanceOopDesc::base_offset_in_bytes()) { |
1 | 228 |
// All header offsets belong properly to java/lang/Object. |
229 |
return CURRENT_ENV->Object_klass(); |
|
230 |
} |
|
231 |
||
232 |
ciInstanceKlass* self = this; |
|
233 |
for (;;) { |
|
234 |
assert(self->is_loaded(), "must be loaded to have size"); |
|
235 |
ciInstanceKlass* super = self->super(); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
236 |
if (super == NULL || super->nof_nonstatic_fields() == 0 || |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
237 |
!super->contains_field_offset(offset)) { |
1 | 238 |
return self; |
239 |
} else { |
|
240 |
self = super; // return super->get_canonical_holder(offset) |
|
241 |
} |
|
242 |
} |
|
243 |
} |
|
244 |
||
245 |
// ------------------------------------------------------------------ |
|
246 |
// ciInstanceKlass::is_java_lang_Object |
|
247 |
// |
|
248 |
// Is this klass java.lang.Object? |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
249 |
bool ciInstanceKlass::is_java_lang_Object() const { |
1 | 250 |
return equals(CURRENT_ENV->Object_klass()); |
251 |
} |
|
252 |
||
253 |
// ------------------------------------------------------------------ |
|
254 |
// ciInstanceKlass::uses_default_loader |
|
17383 | 255 |
bool ciInstanceKlass::uses_default_loader() const { |
4567
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
256 |
// Note: We do not need to resolve the handle or enter the VM |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
257 |
// in order to test null-ness. |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
258 |
return _loader == NULL; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
259 |
} |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
260 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
261 |
// ------------------------------------------------------------------ |
17383 | 262 |
|
263 |
/** |
|
264 |
* Return basic type of boxed value for box klass or T_OBJECT if not. |
|
265 |
*/ |
|
266 |
BasicType ciInstanceKlass::box_klass_type() const { |
|
267 |
if (uses_default_loader() && is_loaded()) { |
|
268 |
return SystemDictionary::box_klass_type(get_Klass()); |
|
269 |
} else { |
|
270 |
return T_OBJECT; |
|
271 |
} |
|
272 |
} |
|
273 |
||
274 |
/** |
|
275 |
* Is this boxing klass? |
|
276 |
*/ |
|
277 |
bool ciInstanceKlass::is_box_klass() const { |
|
278 |
return is_java_primitive(box_klass_type()); |
|
279 |
} |
|
280 |
||
281 |
/** |
|
282 |
* Is this boxed value offset? |
|
283 |
*/ |
|
284 |
bool ciInstanceKlass::is_boxed_value_offset(int offset) const { |
|
285 |
BasicType bt = box_klass_type(); |
|
286 |
return is_java_primitive(bt) && |
|
287 |
(offset == java_lang_boxing_object::value_offset_in_bytes(bt)); |
|
288 |
} |
|
289 |
||
290 |
// ------------------------------------------------------------------ |
|
4567
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
291 |
// ciInstanceKlass::is_in_package |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
292 |
// |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
293 |
// Is this klass in the given package? |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
294 |
bool ciInstanceKlass::is_in_package(const char* packagename, int len) { |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
295 |
// To avoid class loader mischief, this test always rejects application classes. |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
296 |
if (!uses_default_loader()) |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
297 |
return false; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
298 |
GUARDED_VM_ENTRY( |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
299 |
return is_in_package_impl(packagename, len); |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
300 |
) |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
301 |
} |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
302 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
303 |
bool ciInstanceKlass::is_in_package_impl(const char* packagename, int len) { |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
304 |
ASSERT_IN_VM; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
305 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
306 |
// If packagename contains trailing '/' exclude it from the |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
307 |
// prefix-test since we test for it explicitly. |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
308 |
if (packagename[len - 1] == '/') |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
309 |
len--; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
310 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
311 |
if (!name()->starts_with(packagename, len)) |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
312 |
return false; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
313 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
314 |
// Test if the class name is something like "java/lang". |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
315 |
if ((len + 1) > name()->utf8_length()) |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
316 |
return false; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
317 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
318 |
// Test for trailing '/' |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
319 |
if ((char) name()->byte_at(len) != '/') |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
320 |
return false; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
321 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
322 |
// Make sure it's not actually in a subpackage: |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
323 |
if (name()->index_of_at(len+1, "/", 1) >= 0) |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
324 |
return false; |
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
325 |
|
7fc02fbe5c7a
6893268: additional dynamic language related optimizations in C2
twisti
parents:
4450
diff
changeset
|
326 |
return true; |
1 | 327 |
} |
328 |
||
329 |
// ------------------------------------------------------------------ |
|
330 |
// ciInstanceKlass::print_impl |
|
331 |
// |
|
332 |
// Implementation of the print method. |
|
333 |
void ciInstanceKlass::print_impl(outputStream* st) { |
|
334 |
ciKlass::print_impl(st); |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21209
diff
changeset
|
335 |
GUARDED_VM_ENTRY(st->print(" loader=" INTPTR_FORMAT, p2i((address)loader()));) |
1 | 336 |
if (is_loaded()) { |
337 |
st->print(" loaded=true initialized=%s finalized=%s subklass=%s size=%d flags=", |
|
338 |
bool_to_str(is_initialized()), |
|
339 |
bool_to_str(has_finalizer()), |
|
340 |
bool_to_str(has_subklass()), |
|
341 |
layout_helper()); |
|
342 |
||
343 |
_flags.print_klass_flags(); |
|
344 |
||
345 |
if (_super) { |
|
346 |
st->print(" super="); |
|
347 |
_super->print_name(); |
|
348 |
} |
|
349 |
if (_java_mirror) { |
|
350 |
st->print(" mirror=PRESENT"); |
|
351 |
} |
|
352 |
} else { |
|
353 |
st->print(" loaded=false"); |
|
354 |
} |
|
355 |
} |
|
356 |
||
357 |
// ------------------------------------------------------------------ |
|
358 |
// ciInstanceKlass::super |
|
359 |
// |
|
360 |
// Get the superklass of this klass. |
|
361 |
ciInstanceKlass* ciInstanceKlass::super() { |
|
362 |
assert(is_loaded(), "must be loaded"); |
|
363 |
if (_super == NULL && !is_java_lang_Object()) { |
|
364 |
GUARDED_VM_ENTRY( |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
365 |
Klass* super_klass = get_instanceKlass()->super(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
366 |
_super = CURRENT_ENV->get_instance_klass(super_klass); |
1 | 367 |
) |
368 |
} |
|
369 |
return _super; |
|
370 |
} |
|
371 |
||
372 |
// ------------------------------------------------------------------ |
|
373 |
// ciInstanceKlass::java_mirror |
|
374 |
// |
|
375 |
// Get the instance of java.lang.Class corresponding to this klass. |
|
5884
3963019e3782
6960865: ldc of unloaded class throws an assert in ciTypeFlow
jrose
parents:
5882
diff
changeset
|
376 |
// Cache it on this->_java_mirror. |
1 | 377 |
ciInstance* ciInstanceKlass::java_mirror() { |
8725
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8314
diff
changeset
|
378 |
if (is_shared()) { |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8314
diff
changeset
|
379 |
return ciKlass::java_mirror(); |
8c1e3dd5fe1b
7017732: move static fields into Class to prepare for perm gen removal
never
parents:
8314
diff
changeset
|
380 |
} |
1 | 381 |
if (_java_mirror == NULL) { |
5884
3963019e3782
6960865: ldc of unloaded class throws an assert in ciTypeFlow
jrose
parents:
5882
diff
changeset
|
382 |
_java_mirror = ciKlass::java_mirror(); |
1 | 383 |
} |
384 |
return _java_mirror; |
|
385 |
} |
|
386 |
||
387 |
// ------------------------------------------------------------------ |
|
388 |
// ciInstanceKlass::unique_concrete_subklass |
|
389 |
ciInstanceKlass* ciInstanceKlass::unique_concrete_subklass() { |
|
390 |
if (!is_loaded()) return NULL; // No change if class is not loaded |
|
391 |
if (!is_abstract()) return NULL; // Only applies to abstract classes. |
|
392 |
if (!has_subklass()) return NULL; // Must have at least one subklass. |
|
393 |
VM_ENTRY_MARK; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
394 |
InstanceKlass* ik = get_instanceKlass(); |
1 | 395 |
Klass* up = ik->up_cast_abstract(); |
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
31519
diff
changeset
|
396 |
assert(up->is_instance_klass(), "must be InstanceKlass"); |
1 | 397 |
if (ik == up) { |
398 |
return NULL; |
|
399 |
} |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
400 |
return CURRENT_THREAD_ENV->get_instance_klass(up); |
1 | 401 |
} |
402 |
||
403 |
// ------------------------------------------------------------------ |
|
404 |
// ciInstanceKlass::has_finalizable_subclass |
|
405 |
bool ciInstanceKlass::has_finalizable_subclass() { |
|
406 |
if (!is_loaded()) return true; |
|
407 |
VM_ENTRY_MARK; |
|
408 |
return Dependencies::find_finalizable_subclass(get_instanceKlass()) != NULL; |
|
409 |
} |
|
410 |
||
411 |
// ------------------------------------------------------------------ |
|
412 |
// ciInstanceKlass::get_field_by_offset |
|
413 |
ciField* ciInstanceKlass::get_field_by_offset(int field_offset, bool is_static) { |
|
414 |
if (!is_static) { |
|
415 |
for (int i = 0, len = nof_nonstatic_fields(); i < len; i++) { |
|
416 |
ciField* field = _nonstatic_fields->at(i); |
|
417 |
int field_off = field->offset_in_bytes(); |
|
418 |
if (field_off == field_offset) |
|
419 |
return field; |
|
420 |
if (field_off > field_offset) |
|
421 |
break; |
|
422 |
// could do binary search or check bins, but probably not worth it |
|
423 |
} |
|
424 |
return NULL; |
|
425 |
} |
|
426 |
VM_ENTRY_MARK; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
427 |
InstanceKlass* k = get_instanceKlass(); |
1 | 428 |
fieldDescriptor fd; |
429 |
if (!k->find_field_from_offset(field_offset, is_static, &fd)) { |
|
430 |
return NULL; |
|
431 |
} |
|
432 |
ciField* field = new (CURRENT_THREAD_ENV->arena()) ciField(&fd); |
|
433 |
return field; |
|
434 |
} |
|
435 |
||
217
c646ef2f5d58
6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents:
1
diff
changeset
|
436 |
// ------------------------------------------------------------------ |
4450
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
437 |
// ciInstanceKlass::get_field_by_name |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
438 |
ciField* ciInstanceKlass::get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static) { |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
439 |
VM_ENTRY_MARK; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
440 |
InstanceKlass* k = get_instanceKlass(); |
4450
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
441 |
fieldDescriptor fd; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
442 |
Klass* def = k->find_field(name->get_symbol(), signature->get_symbol(), is_static, &fd); |
4450
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
443 |
if (def == NULL) { |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
444 |
return NULL; |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
445 |
} |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
446 |
ciField* field = new (CURRENT_THREAD_ENV->arena()) ciField(&fd); |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
447 |
return field; |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
448 |
} |
6d700b859b3e
6892658: C2 should optimize some stringbuilder patterns
never
parents:
670
diff
changeset
|
449 |
|
217
c646ef2f5d58
6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents:
1
diff
changeset
|
450 |
|
1 | 451 |
static int sort_field_by_offset(ciField** a, ciField** b) { |
452 |
return (*a)->offset_in_bytes() - (*b)->offset_in_bytes(); |
|
453 |
// (no worries about 32-bit overflow...) |
|
454 |
} |
|
455 |
||
456 |
// ------------------------------------------------------------------ |
|
457 |
// ciInstanceKlass::compute_nonstatic_fields |
|
458 |
int ciInstanceKlass::compute_nonstatic_fields() { |
|
459 |
assert(is_loaded(), "must be loaded"); |
|
460 |
||
461 |
if (_nonstatic_fields != NULL) |
|
462 |
return _nonstatic_fields->length(); |
|
463 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
464 |
if (!has_nonstatic_fields()) { |
1 | 465 |
Arena* arena = CURRENT_ENV->arena(); |
466 |
_nonstatic_fields = new (arena) GrowableArray<ciField*>(arena, 0, 0, NULL); |
|
467 |
return 0; |
|
468 |
} |
|
469 |
assert(!is_java_lang_Object(), "bootstrap OK"); |
|
470 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
471 |
// Size in bytes of my fields, including inherited fields. |
591
04d2e26e6d69
6703888: Compressed Oops: use the 32-bits gap after klass in a object
kvn
parents:
360
diff
changeset
|
472 |
int fsize = nonstatic_field_size() * heapOopSize; |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
473 |
|
1 | 474 |
ciInstanceKlass* super = this->super(); |
475 |
GrowableArray<ciField*>* super_fields = NULL; |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
476 |
if (super != NULL && super->has_nonstatic_fields()) { |
591
04d2e26e6d69
6703888: Compressed Oops: use the 32-bits gap after klass in a object
kvn
parents:
360
diff
changeset
|
477 |
int super_fsize = super->nonstatic_field_size() * heapOopSize; |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
478 |
int super_flen = super->nof_nonstatic_fields(); |
1 | 479 |
super_fields = super->_nonstatic_fields; |
480 |
assert(super_flen == 0 || super_fields != NULL, "first get nof_fields"); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
481 |
// See if I am no larger than my super; if so, I can use his fields. |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
482 |
if (fsize == super_fsize) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
483 |
_nonstatic_fields = super_fields; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
484 |
return super_fields->length(); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
217
diff
changeset
|
485 |
} |
1 | 486 |
} |
487 |
||
488 |
GrowableArray<ciField*>* fields = NULL; |
|
489 |
GUARDED_VM_ENTRY({ |
|
490 |
fields = compute_nonstatic_fields_impl(super_fields); |
|
491 |
}); |
|
492 |
||
493 |
if (fields == NULL) { |
|
494 |
// This can happen if this class (java.lang.Class) has invisible fields. |
|
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
28933
diff
changeset
|
495 |
if (super_fields != NULL) { |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
28933
diff
changeset
|
496 |
_nonstatic_fields = super_fields; |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
28933
diff
changeset
|
497 |
return super_fields->length(); |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
28933
diff
changeset
|
498 |
} else { |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
28933
diff
changeset
|
499 |
return 0; |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
28933
diff
changeset
|
500 |
} |
1 | 501 |
} |
502 |
||
503 |
int flen = fields->length(); |
|
504 |
||
505 |
// Now sort them by offset, ascending. |
|
506 |
// (In principle, they could mix with superclass fields.) |
|
507 |
fields->sort(sort_field_by_offset); |
|
508 |
_nonstatic_fields = fields; |
|
509 |
return flen; |
|
510 |
} |
|
511 |
||
512 |
GrowableArray<ciField*>* |
|
513 |
ciInstanceKlass::compute_nonstatic_fields_impl(GrowableArray<ciField*>* |
|
514 |
super_fields) { |
|
515 |
ASSERT_IN_VM; |
|
516 |
Arena* arena = CURRENT_ENV->arena(); |
|
517 |
int flen = 0; |
|
518 |
GrowableArray<ciField*>* fields = NULL; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
519 |
InstanceKlass* k = get_instanceKlass(); |
10546 | 520 |
for (JavaFieldStream fs(k); !fs.done(); fs.next()) { |
521 |
if (fs.access_flags().is_static()) continue; |
|
522 |
flen += 1; |
|
523 |
} |
|
1 | 524 |
|
10546 | 525 |
// allocate the array: |
526 |
if (flen == 0) { |
|
527 |
return NULL; // return nothing if none are locally declared |
|
528 |
} |
|
529 |
if (super_fields != NULL) { |
|
530 |
flen += super_fields->length(); |
|
531 |
} |
|
532 |
fields = new (arena) GrowableArray<ciField*>(arena, flen, 0, NULL); |
|
533 |
if (super_fields != NULL) { |
|
534 |
fields->appendAll(super_fields); |
|
535 |
} |
|
536 |
||
537 |
for (JavaFieldStream fs(k); !fs.done(); fs.next()) { |
|
538 |
if (fs.access_flags().is_static()) continue; |
|
20017
81eba62e9048
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
17383
diff
changeset
|
539 |
fieldDescriptor& fd = fs.field_descriptor(); |
10546 | 540 |
ciField* field = new (arena) ciField(&fd); |
541 |
fields->append(field); |
|
1 | 542 |
} |
543 |
assert(fields->length() == flen, "sanity"); |
|
544 |
return fields; |
|
545 |
} |
|
546 |
||
28933
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
547 |
bool ciInstanceKlass::compute_injected_fields_helper() { |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
548 |
ASSERT_IN_VM; |
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
549 |
InstanceKlass* k = get_instanceKlass(); |
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
550 |
|
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
551 |
for (InternalFieldStream fs(k); !fs.done(); fs.next()) { |
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
552 |
if (fs.access_flags().is_static()) continue; |
28933
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
553 |
return true; |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
554 |
} |
28933
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
555 |
return false; |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
556 |
} |
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
557 |
|
28933
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
558 |
void ciInstanceKlass::compute_injected_fields() { |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
559 |
assert(is_loaded(), "must be loaded"); |
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
560 |
|
28933
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
561 |
int has_injected_fields = 0; |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
562 |
if (super() != NULL && super()->has_injected_fields()) { |
28933
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
563 |
has_injected_fields = 1; |
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
564 |
} else { |
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
565 |
GUARDED_VM_ENTRY({ |
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
566 |
has_injected_fields = compute_injected_fields_helper() ? 1 : 0; |
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
567 |
}); |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
568 |
} |
28933
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
569 |
// may be concurrently initialized for shared ciInstanceKlass objects |
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
570 |
assert(_has_injected_fields == -1 || _has_injected_fields == has_injected_fields, "broken concurrent initialization"); |
a11a29cf06d5
8071821: Assert failed in UnexpectedDeoptimizationTest.java
roland
parents:
28396
diff
changeset
|
571 |
_has_injected_fields = has_injected_fields; |
28396
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
572 |
} |
7fe4347e6792
6700100: optimize inline_native_clone() for small objects with exact klass
roland
parents:
26706
diff
changeset
|
573 |
|
1 | 574 |
// ------------------------------------------------------------------ |
575 |
// ciInstanceKlass::find_method |
|
576 |
// |
|
577 |
// Find a method in this klass. |
|
578 |
ciMethod* ciInstanceKlass::find_method(ciSymbol* name, ciSymbol* signature) { |
|
579 |
VM_ENTRY_MARK; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
580 |
InstanceKlass* k = get_instanceKlass(); |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
581 |
Symbol* name_sym = name->get_symbol(); |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
582 |
Symbol* sig_sym= signature->get_symbol(); |
1 | 583 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
584 |
Method* m = k->find_method(name_sym, sig_sym); |
1 | 585 |
if (m == NULL) return NULL; |
586 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
587 |
return CURRENT_THREAD_ENV->get_method(m); |
1 | 588 |
} |
589 |
||
590 |
// ------------------------------------------------------------------ |
|
591 |
// ciInstanceKlass::is_leaf_type |
|
592 |
bool ciInstanceKlass::is_leaf_type() { |
|
593 |
assert(is_loaded(), "must be loaded"); |
|
594 |
if (is_shared()) { |
|
595 |
return is_final(); // approximately correct |
|
596 |
} else { |
|
12369
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
597 |
return !_has_subklass && (nof_implementors() == 0); |
1 | 598 |
} |
599 |
} |
|
600 |
||
601 |
// ------------------------------------------------------------------ |
|
602 |
// ciInstanceKlass::implementor |
|
603 |
// |
|
604 |
// Report an implementor of this interface. |
|
605 |
// Note that there are various races here, since my copy |
|
606 |
// of _nof_implementors might be out of date with respect |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
607 |
// to results returned by InstanceKlass::implementor. |
1 | 608 |
// This is OK, since any dependencies we decide to assert |
609 |
// will be checked later under the Compile_lock. |
|
12369
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
610 |
ciInstanceKlass* ciInstanceKlass::implementor() { |
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
611 |
ciInstanceKlass* impl = _implementor; |
1 | 612 |
if (impl == NULL) { |
613 |
// Go into the VM to fetch the implementor. |
|
614 |
{ |
|
615 |
VM_ENTRY_MARK; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
616 |
Klass* k = get_instanceKlass()->implementor(); |
1 | 617 |
if (k != NULL) { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
618 |
if (k == get_instanceKlass()) { |
12369
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
619 |
// More than one implementors. Use 'this' in this case. |
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
620 |
impl = this; |
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
621 |
} else { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
12369
diff
changeset
|
622 |
impl = CURRENT_THREAD_ENV->get_instance_klass(k); |
12369
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
623 |
} |
1 | 624 |
} |
625 |
} |
|
626 |
// Memoize this result. |
|
627 |
if (!is_shared()) { |
|
12369
48fd3da4025c
7154670: The instanceKlass _implementors[] and _nof_implementors are not needed for non-interface klass.
jiangli
parents:
11407
diff
changeset
|
628 |
_implementor = impl; |
1 | 629 |
} |
630 |
} |
|
631 |
return impl; |
|
632 |
} |
|
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
633 |
|
44738 | 634 |
ciInstanceKlass* ciInstanceKlass::host_klass() { |
635 |
assert(is_loaded(), "must be loaded"); |
|
636 |
if (is_anonymous()) { |
|
637 |
VM_ENTRY_MARK |
|
638 |
Klass* host_klass = get_instanceKlass()->host_klass(); |
|
639 |
return CURRENT_ENV->get_instance_klass(host_klass); |
|
640 |
} |
|
641 |
return NULL; |
|
642 |
} |
|
643 |
||
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
644 |
// Utility class for printing of the contents of the static fields for |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
645 |
// use by compilation replay. It only prints out the information that |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
646 |
// could be consumed by the compiler, so for primitive types it prints |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
647 |
// out the actual value. For Strings it's the actual string value. |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
648 |
// For array types it it's first level array size since that's the |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
649 |
// only value which statically unchangeable. For all other reference |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
650 |
// types it simply prints out the dynamic type. |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
651 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
652 |
class StaticFinalFieldPrinter : public FieldClosure { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
653 |
outputStream* _out; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
654 |
const char* _holder; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
655 |
public: |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
656 |
StaticFinalFieldPrinter(outputStream* out, const char* holder) : |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
657 |
_out(out), |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
658 |
_holder(holder) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
659 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
660 |
void do_field(fieldDescriptor* fd) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
661 |
if (fd->is_final() && !fd->has_initial_value()) { |
15471
41f75023e6a6
8006410: allocating without ResourceMark when CompileCommand was specified
vlivanov
parents:
14477
diff
changeset
|
662 |
ResourceMark rm; |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
663 |
oop mirror = fd->field_holder()->java_mirror(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
664 |
_out->print("staticfield %s %s %s ", _holder, fd->name()->as_quoted_ascii(), fd->signature()->as_quoted_ascii()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
665 |
switch (fd->field_type()) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
666 |
case T_BYTE: _out->print_cr("%d", mirror->byte_field(fd->offset())); break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
667 |
case T_BOOLEAN: _out->print_cr("%d", mirror->bool_field(fd->offset())); break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
668 |
case T_SHORT: _out->print_cr("%d", mirror->short_field(fd->offset())); break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
669 |
case T_CHAR: _out->print_cr("%d", mirror->char_field(fd->offset())); break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
670 |
case T_INT: _out->print_cr("%d", mirror->int_field(fd->offset())); break; |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21209
diff
changeset
|
671 |
case T_LONG: _out->print_cr(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break; |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
672 |
case T_FLOAT: { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
673 |
float f = mirror->float_field(fd->offset()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
674 |
_out->print_cr("%d", *(int*)&f); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
675 |
break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
676 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
677 |
case T_DOUBLE: { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
678 |
double d = mirror->double_field(fd->offset()); |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21209
diff
changeset
|
679 |
_out->print_cr(INT64_FORMAT, *(int64_t*)&d); |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
680 |
break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
681 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
682 |
case T_ARRAY: { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
683 |
oop value = mirror->obj_field_acquire(fd->offset()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
684 |
if (value == NULL) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
685 |
_out->print_cr("null"); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
686 |
} else { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
687 |
typeArrayOop ta = (typeArrayOop)value; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
688 |
_out->print("%d", ta->length()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
689 |
if (value->is_objArray()) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
690 |
objArrayOop oa = (objArrayOop)value; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
691 |
const char* klass_name = value->klass()->name()->as_quoted_ascii(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
692 |
_out->print(" %s", klass_name); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
693 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
694 |
_out->cr(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
695 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
696 |
break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
697 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
698 |
case T_OBJECT: { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
699 |
oop value = mirror->obj_field_acquire(fd->offset()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
700 |
if (value == NULL) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
701 |
_out->print_cr("null"); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
702 |
} else if (value->is_instance()) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
703 |
if (value->is_a(SystemDictionary::String_klass())) { |
47551
4d034d861e13
8187780: VM crashes while generating replay compilation file
thartmann
parents:
47216
diff
changeset
|
704 |
const char* ascii_value = java_lang_String::as_quoted_ascii(value); |
4d034d861e13
8187780: VM crashes while generating replay compilation file
thartmann
parents:
47216
diff
changeset
|
705 |
_out->print("\"%s\"", (ascii_value != NULL) ? ascii_value : ""); |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
706 |
} else { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
707 |
const char* klass_name = value->klass()->name()->as_quoted_ascii(); |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21209
diff
changeset
|
708 |
_out->print_cr("%s", klass_name); |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
709 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
710 |
} else { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
711 |
ShouldNotReachHere(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
712 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
713 |
break; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
714 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
715 |
default: |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
716 |
ShouldNotReachHere(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
717 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
718 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
719 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
720 |
}; |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
721 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
722 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
723 |
void ciInstanceKlass::dump_replay_data(outputStream* out) { |
15471
41f75023e6a6
8006410: allocating without ResourceMark when CompileCommand was specified
vlivanov
parents:
14477
diff
changeset
|
724 |
ResourceMark rm; |
41f75023e6a6
8006410: allocating without ResourceMark when CompileCommand was specified
vlivanov
parents:
14477
diff
changeset
|
725 |
|
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
726 |
InstanceKlass* ik = get_instanceKlass(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
727 |
ConstantPool* cp = ik->constants(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
728 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
729 |
// Try to record related loaded classes |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
730 |
Klass* sub = ik->subklass(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
731 |
while (sub != NULL) { |
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
31519
diff
changeset
|
732 |
if (sub->is_instance_klass()) { |
14477
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
733 |
out->print_cr("instanceKlass %s", sub->name()->as_quoted_ascii()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
734 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
735 |
sub = sub->next_sibling(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
736 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
737 |
|
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
738 |
// Dump out the state of the constant pool tags. During replay the |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
739 |
// tags will be validated for things which shouldn't change and |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
740 |
// classes will be resolved if the tags indicate that they were |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
741 |
// resolved at compile time. |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
742 |
out->print("ciInstanceKlass %s %d %d %d", ik->name()->as_quoted_ascii(), |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
743 |
is_linked(), is_initialized(), cp->length()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
744 |
for (int index = 1; index < cp->length(); index++) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
745 |
out->print(" %d", cp->tags()->at(index)); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
746 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
747 |
out->cr(); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
748 |
if (is_initialized()) { |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
749 |
// Dump out the static final fields in case the compilation relies |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
750 |
// on their value for correct replay. |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
751 |
StaticFinalFieldPrinter sffp(out, ik->name()->as_quoted_ascii()); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
752 |
ik->do_local_static_fields(&sffp); |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
753 |
} |
95e66ea71f71
6830717: replay of compilations would help with debugging
minqi
parents:
13728
diff
changeset
|
754 |
} |