author | dnsimon |
Tue, 22 Jan 2019 10:12:05 +0100 | |
changeset 53417 | 126c5e7b97b1 |
parent 52067 | 2e72562697bf |
child 53430 | ccfd4e614bb8 |
permissions | -rw-r--r-- |
33160 | 1 |
/* |
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
48299
diff
changeset
|
2 |
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. |
33160 | 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 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
26 |
#include "jvmci/jvmciEnv.hpp" |
|
27 |
#include "classfile/javaAssertions.hpp" |
|
28 |
#include "classfile/systemDictionary.hpp" |
|
29 |
#include "classfile/vmSymbols.hpp" |
|
30 |
#include "code/codeCache.hpp" |
|
31 |
#include "code/scopeDesc.hpp" |
|
32 |
#include "compiler/compileBroker.hpp" |
|
33 |
#include "compiler/compileLog.hpp" |
|
34 |
#include "compiler/compilerOracle.hpp" |
|
35 |
#include "interpreter/linkResolver.hpp" |
|
36 |
#include "memory/allocation.inline.hpp" |
|
37 |
#include "memory/oopFactory.hpp" |
|
37248 | 38 |
#include "memory/resourceArea.hpp" |
49359
59f6547e151f
8199264: Remove universe.inline.hpp to simplify include dependencies
stefank
parents:
49340
diff
changeset
|
39 |
#include "memory/universe.hpp" |
49340
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
48299
diff
changeset
|
40 |
#include "oops/constantPool.inline.hpp" |
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
48299
diff
changeset
|
41 |
#include "oops/cpCache.inline.hpp" |
4e82736053ae
8191102: Incorrect include file use in classLoader.hpp
hseigel
parents:
48299
diff
changeset
|
42 |
#include "oops/method.inline.hpp" |
33160 | 43 |
#include "oops/methodData.hpp" |
44 |
#include "oops/objArrayKlass.hpp" |
|
45 |
#include "oops/oop.inline.hpp" |
|
46 |
#include "prims/jvmtiExport.hpp" |
|
51467
12997ebbc0d8
8209647: constantPoolHandle::constantPoolHandle(ConstantPool*) when precompiled header is disabled
iklam
parents:
49480
diff
changeset
|
47 |
#include "runtime/fieldDescriptor.inline.hpp" |
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
49467
diff
changeset
|
48 |
#include "runtime/handles.inline.hpp" |
33160 | 49 |
#include "runtime/init.hpp" |
50 |
#include "runtime/reflection.hpp" |
|
51 |
#include "runtime/sharedRuntime.hpp" |
|
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
49467
diff
changeset
|
52 |
#include "runtime/sweeper.hpp" |
33160 | 53 |
#include "utilities/dtrace.hpp" |
54 |
#include "jvmci/jvmciRuntime.hpp" |
|
55 |
#include "jvmci/jvmciJavaClasses.hpp" |
|
56 |
||
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
57 |
JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter): |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
58 |
_task(task), |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
59 |
_system_dictionary_modification_counter(system_dictionary_modification_counter), |
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
52067
diff
changeset
|
60 |
_retryable(true), |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
61 |
_failure_reason(NULL), |
53417
126c5e7b97b1
8217445: [JVMCI] incorrect management of JVMCI compilation failure reason string
dnsimon
parents:
52067
diff
changeset
|
62 |
_failure_reason_on_C_heap(false) |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
63 |
{ |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
64 |
// Get Jvmti capabilities under lock to get consistent values. |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
65 |
MutexLocker mu(JvmtiThreadState_lock); |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
66 |
_jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint(); |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
67 |
_jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables(); |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
68 |
_jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions(); |
33160 | 69 |
} |
70 |
||
71 |
// ------------------------------------------------------------------ |
|
72 |
// Note: the logic of this method should mirror the logic of |
|
73 |
// constantPoolOopDesc::verify_constant_pool_resolve. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
74 |
bool JVMCIEnv::check_klass_accessibility(Klass* accessing_klass, Klass* resolved_klass) { |
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
33593
diff
changeset
|
75 |
if (accessing_klass->is_objArray_klass()) { |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
76 |
accessing_klass = ObjArrayKlass::cast(accessing_klass)->bottom_klass(); |
33160 | 77 |
} |
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
33593
diff
changeset
|
78 |
if (!accessing_klass->is_instance_klass()) { |
33160 | 79 |
return true; |
80 |
} |
|
81 |
||
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
33593
diff
changeset
|
82 |
if (resolved_klass->is_objArray_klass()) { |
33160 | 83 |
// Find the element klass, if this is an array. |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
84 |
resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass(); |
33160 | 85 |
} |
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
33593
diff
changeset
|
86 |
if (resolved_klass->is_instance_klass()) { |
36508 | 87 |
Reflection::VerifyClassAccessResults result = |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
88 |
Reflection::verify_class_access(accessing_klass, InstanceKlass::cast(resolved_klass), true); |
36508 | 89 |
return result == Reflection::ACCESS_OK; |
33160 | 90 |
} |
91 |
return true; |
|
92 |
} |
|
93 |
||
94 |
// ------------------------------------------------------------------ |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
95 |
Klass* JVMCIEnv::get_klass_by_name_impl(Klass* accessing_klass, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
96 |
const constantPoolHandle& cpool, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
97 |
Symbol* sym, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
98 |
bool require_local) { |
33160 | 99 |
JVMCI_EXCEPTION_CONTEXT; |
100 |
||
101 |
// Now we need to check the SystemDictionary |
|
51997
9ce37fa2e179
8209138: Symbol constructor uses u1 as the element type of its name argument
hseigel
parents:
51467
diff
changeset
|
102 |
if (sym->char_at(0) == 'L' && |
9ce37fa2e179
8209138: Symbol constructor uses u1 as the element type of its name argument
hseigel
parents:
51467
diff
changeset
|
103 |
sym->char_at(sym->utf8_length()-1) == ';') { |
33160 | 104 |
// This is a name from a signature. Strip off the trimmings. |
105 |
// Call recursive to keep scope of strippedsym. |
|
106 |
TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1, |
|
107 |
sym->utf8_length()-2, |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
108 |
CHECK_NULL); |
33160 | 109 |
return get_klass_by_name_impl(accessing_klass, cpool, strippedsym, require_local); |
110 |
} |
|
111 |
||
112 |
Handle loader(THREAD, (oop)NULL); |
|
113 |
Handle domain(THREAD, (oop)NULL); |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
114 |
if (accessing_klass != NULL) { |
33160 | 115 |
loader = Handle(THREAD, accessing_klass->class_loader()); |
116 |
domain = Handle(THREAD, accessing_klass->protection_domain()); |
|
117 |
} |
|
118 |
||
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
119 |
Klass* found_klass = NULL; |
33160 | 120 |
{ |
121 |
ttyUnlocker ttyul; // release tty lock to avoid ordering problems |
|
122 |
MutexLocker ml(Compile_lock); |
|
123 |
if (!require_local) { |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
124 |
found_klass = SystemDictionary::find_constrained_instance_or_array_klass(sym, loader, CHECK_NULL); |
33160 | 125 |
} else { |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
126 |
found_klass = SystemDictionary::find_instance_or_array_klass(sym, loader, domain, CHECK_NULL); |
33160 | 127 |
} |
128 |
} |
|
129 |
||
130 |
// If we fail to find an array klass, look again for its element type. |
|
131 |
// The element type may be available either locally or via constraints. |
|
132 |
// In either case, if we can find the element type in the system dictionary, |
|
133 |
// we must build an array type around it. The CI requires array klasses |
|
134 |
// to be loaded if their element klasses are loaded, except when memory |
|
135 |
// is exhausted. |
|
51997
9ce37fa2e179
8209138: Symbol constructor uses u1 as the element type of its name argument
hseigel
parents:
51467
diff
changeset
|
136 |
if (sym->char_at(0) == '[' && |
9ce37fa2e179
8209138: Symbol constructor uses u1 as the element type of its name argument
hseigel
parents:
51467
diff
changeset
|
137 |
(sym->char_at(1) == '[' || sym->char_at(1) == 'L')) { |
33160 | 138 |
// We have an unloaded array. |
139 |
// Build it on the fly if the element class exists. |
|
140 |
TempNewSymbol elem_sym = SymbolTable::new_symbol(sym->as_utf8()+1, |
|
141 |
sym->utf8_length()-1, |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
142 |
CHECK_NULL); |
33160 | 143 |
|
144 |
// Get element Klass recursively. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
145 |
Klass* elem_klass = |
33160 | 146 |
get_klass_by_name_impl(accessing_klass, |
147 |
cpool, |
|
148 |
elem_sym, |
|
149 |
require_local); |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
150 |
if (elem_klass != NULL) { |
33160 | 151 |
// Now make an array for it |
52067
2e72562697bf
8211394: CHECK_ must be used in the rhs of an assignment statement within a block
dholmes
parents:
51997
diff
changeset
|
152 |
return elem_klass->array_klass(THREAD); |
33160 | 153 |
} |
154 |
} |
|
155 |
||
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
156 |
if (found_klass == NULL && !cpool.is_null() && cpool->has_preresolution()) { |
33160 | 157 |
// Look inside the constant pool for pre-resolved class entries. |
158 |
for (int i = cpool->length() - 1; i >= 1; i--) { |
|
159 |
if (cpool->tag_at(i).is_klass()) { |
|
160 |
Klass* kls = cpool->resolved_klass_at(i); |
|
161 |
if (kls->name() == sym) { |
|
162 |
return kls; |
|
163 |
} |
|
164 |
} |
|
165 |
} |
|
166 |
} |
|
167 |
||
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
168 |
return found_klass; |
33160 | 169 |
} |
170 |
||
171 |
// ------------------------------------------------------------------ |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
172 |
Klass* JVMCIEnv::get_klass_by_name(Klass* accessing_klass, |
33160 | 173 |
Symbol* klass_name, |
174 |
bool require_local) { |
|
175 |
ResourceMark rm; |
|
176 |
constantPoolHandle cpool; |
|
177 |
return get_klass_by_name_impl(accessing_klass, |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
178 |
cpool, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
179 |
klass_name, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
180 |
require_local); |
33160 | 181 |
} |
182 |
||
183 |
// ------------------------------------------------------------------ |
|
184 |
// Implementation of get_klass_by_index. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
185 |
Klass* JVMCIEnv::get_klass_by_index_impl(const constantPoolHandle& cpool, |
33160 | 186 |
int index, |
187 |
bool& is_accessible, |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
188 |
Klass* accessor) { |
33160 | 189 |
JVMCI_EXCEPTION_CONTEXT; |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
190 |
Klass* klass = ConstantPool::klass_at_if_loaded(cpool, index); |
33160 | 191 |
Symbol* klass_name = NULL; |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
192 |
if (klass == NULL) { |
33160 | 193 |
klass_name = cpool->klass_name_at(index); |
194 |
} |
|
195 |
||
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
196 |
if (klass == NULL) { |
33160 | 197 |
// Not found in constant pool. Use the name to do the lookup. |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
198 |
Klass* k = get_klass_by_name_impl(accessor, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
199 |
cpool, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
200 |
klass_name, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
201 |
false); |
33160 | 202 |
// Calculate accessibility the hard way. |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
203 |
if (k == NULL) { |
33160 | 204 |
is_accessible = false; |
205 |
} else if (k->class_loader() != accessor->class_loader() && |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
206 |
get_klass_by_name_impl(accessor, cpool, k->name(), true) == NULL) { |
33160 | 207 |
// Loaded only remotely. Not linked yet. |
208 |
is_accessible = false; |
|
209 |
} else { |
|
210 |
// Linked locally, and we must also check public/private, etc. |
|
211 |
is_accessible = check_klass_accessibility(accessor, k); |
|
212 |
} |
|
213 |
if (!is_accessible) { |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
214 |
return NULL; |
33160 | 215 |
} |
216 |
return k; |
|
217 |
} |
|
218 |
||
219 |
// It is known to be accessible, since it was found in the constant pool. |
|
220 |
is_accessible = true; |
|
221 |
return klass; |
|
222 |
} |
|
223 |
||
224 |
// ------------------------------------------------------------------ |
|
225 |
// Get a klass from the constant pool. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
226 |
Klass* JVMCIEnv::get_klass_by_index(const constantPoolHandle& cpool, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
227 |
int index, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
228 |
bool& is_accessible, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
229 |
Klass* accessor) { |
33160 | 230 |
ResourceMark rm; |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
231 |
return get_klass_by_index_impl(cpool, index, is_accessible, accessor); |
33160 | 232 |
} |
233 |
||
234 |
// ------------------------------------------------------------------ |
|
235 |
// Implementation of get_field_by_index. |
|
236 |
// |
|
237 |
// Implementation note: the results of field lookups are cached |
|
238 |
// in the accessor klass. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
239 |
void JVMCIEnv::get_field_by_index_impl(InstanceKlass* klass, fieldDescriptor& field_desc, |
33160 | 240 |
int index) { |
241 |
JVMCI_EXCEPTION_CONTEXT; |
|
242 |
||
243 |
assert(klass->is_linked(), "must be linked before using its constant-pool"); |
|
244 |
||
245 |
constantPoolHandle cpool(thread, klass->constants()); |
|
246 |
||
247 |
// Get the field's name, signature, and type. |
|
248 |
Symbol* name = cpool->name_ref_at(index); |
|
249 |
||
250 |
int nt_index = cpool->name_and_type_ref_index_at(index); |
|
251 |
int sig_index = cpool->signature_ref_index_at(nt_index); |
|
252 |
Symbol* signature = cpool->symbol_at(sig_index); |
|
253 |
||
254 |
// Get the field's declared holder. |
|
255 |
int holder_index = cpool->klass_ref_index_at(index); |
|
256 |
bool holder_is_accessible; |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
257 |
Klass* declared_holder = get_klass_by_index(cpool, holder_index, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
258 |
holder_is_accessible, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
259 |
klass); |
33160 | 260 |
|
261 |
// The declared holder of this field may not have been loaded. |
|
262 |
// Bail out with partial field information. |
|
263 |
if (!holder_is_accessible) { |
|
264 |
return; |
|
265 |
} |
|
266 |
||
267 |
||
268 |
// Perform the field lookup. |
|
269 |
Klass* canonical_holder = |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
270 |
InstanceKlass::cast(declared_holder)->find_field(name, signature, &field_desc); |
33160 | 271 |
if (canonical_holder == NULL) { |
272 |
return; |
|
273 |
} |
|
274 |
||
275 |
assert(canonical_holder == field_desc.field_holder(), "just checking"); |
|
276 |
} |
|
277 |
||
278 |
// ------------------------------------------------------------------ |
|
279 |
// Get a field by index from a klass's constant pool. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
280 |
void JVMCIEnv::get_field_by_index(InstanceKlass* accessor, fieldDescriptor& fd, int index) { |
33160 | 281 |
ResourceMark rm; |
282 |
return get_field_by_index_impl(accessor, fd, index); |
|
283 |
} |
|
284 |
||
285 |
// ------------------------------------------------------------------ |
|
286 |
// Perform an appropriate method lookup based on accessor, holder, |
|
287 |
// name, signature, and bytecode. |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
288 |
methodHandle JVMCIEnv::lookup_method(InstanceKlass* accessor, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
289 |
Klass* holder, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
290 |
Symbol* name, |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
291 |
Symbol* sig, |
38719
133bf85c3f36
8145148: InterfaceMethod CP entry pointing to a class should cause ICCE
coleenp
parents:
38133
diff
changeset
|
292 |
Bytecodes::Code bc, |
133bf85c3f36
8145148: InterfaceMethod CP entry pointing to a class should cause ICCE
coleenp
parents:
38133
diff
changeset
|
293 |
constantTag tag) { |
43938
f0e4bcc4d9f3
8170455: C2: Access to [].clone from interfaces fails
jcm
parents:
40642
diff
changeset
|
294 |
// Accessibility checks are performed in JVMCIEnv::get_method_by_index_impl(). |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
295 |
assert(check_klass_accessibility(accessor, holder), "holder not accessible"); |
43938
f0e4bcc4d9f3
8170455: C2: Access to [].clone from interfaces fails
jcm
parents:
40642
diff
changeset
|
296 |
|
33160 | 297 |
methodHandle dest_method; |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
298 |
LinkInfo link_info(holder, name, sig, accessor, LinkInfo::needs_access_check, tag); |
33160 | 299 |
switch (bc) { |
300 |
case Bytecodes::_invokestatic: |
|
301 |
dest_method = |
|
302 |
LinkResolver::resolve_static_call_or_null(link_info); |
|
303 |
break; |
|
304 |
case Bytecodes::_invokespecial: |
|
305 |
dest_method = |
|
306 |
LinkResolver::resolve_special_call_or_null(link_info); |
|
307 |
break; |
|
308 |
case Bytecodes::_invokeinterface: |
|
309 |
dest_method = |
|
310 |
LinkResolver::linktime_resolve_interface_method_or_null(link_info); |
|
311 |
break; |
|
312 |
case Bytecodes::_invokevirtual: |
|
313 |
dest_method = |
|
314 |
LinkResolver::linktime_resolve_virtual_method_or_null(link_info); |
|
315 |
break; |
|
316 |
default: ShouldNotReachHere(); |
|
317 |
} |
|
318 |
||
319 |
return dest_method; |
|
320 |
} |
|
321 |
||
322 |
||
323 |
// ------------------------------------------------------------------ |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
324 |
methodHandle JVMCIEnv::get_method_by_index_impl(const constantPoolHandle& cpool, |
33160 | 325 |
int index, Bytecodes::Code bc, |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
326 |
InstanceKlass* accessor) { |
33160 | 327 |
if (bc == Bytecodes::_invokedynamic) { |
328 |
ConstantPoolCacheEntry* cpce = cpool->invokedynamic_cp_cache_entry_at(index); |
|
329 |
bool is_resolved = !cpce->is_f1_null(); |
|
330 |
if (is_resolved) { |
|
331 |
// Get the invoker Method* from the constant pool. |
|
332 |
// (The appendix argument, if any, will be noted in the method's signature.) |
|
333 |
Method* adapter = cpce->f1_as_method(); |
|
334 |
return methodHandle(adapter); |
|
335 |
} |
|
336 |
||
337 |
return NULL; |
|
338 |
} |
|
339 |
||
340 |
int holder_index = cpool->klass_ref_index_at(index); |
|
341 |
bool holder_is_accessible; |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
342 |
Klass* holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, accessor); |
33160 | 343 |
|
344 |
// Get the method's name and signature. |
|
345 |
Symbol* name_sym = cpool->name_ref_at(index); |
|
346 |
Symbol* sig_sym = cpool->signature_ref_at(index); |
|
347 |
||
348 |
if (cpool->has_preresolution() |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
349 |
|| ((holder == SystemDictionary::MethodHandle_klass() || holder == SystemDictionary::VarHandle_klass()) && |
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
350 |
MethodHandles::is_signature_polymorphic_name(holder, name_sym))) { |
33160 | 351 |
// Short-circuit lookups for JSR 292-related call sites. |
352 |
// That is, do not rely only on name-based lookups, because they may fail |
|
353 |
// if the names are not resolvable in the boot class loader (7056328). |
|
354 |
switch (bc) { |
|
355 |
case Bytecodes::_invokevirtual: |
|
356 |
case Bytecodes::_invokeinterface: |
|
357 |
case Bytecodes::_invokespecial: |
|
358 |
case Bytecodes::_invokestatic: |
|
359 |
{ |
|
360 |
Method* m = ConstantPool::method_at_if_loaded(cpool, index); |
|
361 |
if (m != NULL) { |
|
362 |
return m; |
|
363 |
} |
|
364 |
} |
|
365 |
break; |
|
46630
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46329
diff
changeset
|
366 |
default: |
75aa3e39d02c
8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents:
46329
diff
changeset
|
367 |
break; |
33160 | 368 |
} |
369 |
} |
|
370 |
||
371 |
if (holder_is_accessible) { // Our declared holder is loaded. |
|
38719
133bf85c3f36
8145148: InterfaceMethod CP entry pointing to a class should cause ICCE
coleenp
parents:
38133
diff
changeset
|
372 |
constantTag tag = cpool->tag_ref_at(index); |
43938
f0e4bcc4d9f3
8170455: C2: Access to [].clone from interfaces fails
jcm
parents:
40642
diff
changeset
|
373 |
methodHandle m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag); |
33160 | 374 |
if (!m.is_null()) { |
375 |
// We found the method. |
|
376 |
return m; |
|
377 |
} |
|
378 |
} |
|
379 |
||
380 |
// Either the declared holder was not loaded, or the method could |
|
381 |
// not be found. |
|
382 |
||
383 |
return NULL; |
|
384 |
} |
|
385 |
||
386 |
// ------------------------------------------------------------------ |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
387 |
InstanceKlass* JVMCIEnv::get_instance_klass_for_declared_method_holder(Klass* method_holder) { |
33160 | 388 |
// For the case of <array>.clone(), the method holder can be an ArrayKlass* |
389 |
// instead of an InstanceKlass*. For that case simply pretend that the |
|
390 |
// declared holder is Object.clone since that's where the call will bottom out. |
|
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
33593
diff
changeset
|
391 |
if (method_holder->is_instance_klass()) { |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
392 |
return InstanceKlass::cast(method_holder); |
33611
9abd65805e19
8139203: Consistent naming for klass type predicates
coleenp
parents:
33593
diff
changeset
|
393 |
} else if (method_holder->is_array_klass()) { |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
394 |
return SystemDictionary::Object_klass(); |
33160 | 395 |
} else { |
396 |
ShouldNotReachHere(); |
|
397 |
} |
|
398 |
return NULL; |
|
399 |
} |
|
400 |
||
401 |
||
402 |
// ------------------------------------------------------------------ |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
33160
diff
changeset
|
403 |
methodHandle JVMCIEnv::get_method_by_index(const constantPoolHandle& cpool, |
33160 | 404 |
int index, Bytecodes::Code bc, |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46327
diff
changeset
|
405 |
InstanceKlass* accessor) { |
33160 | 406 |
ResourceMark rm; |
407 |
return get_method_by_index_impl(cpool, index, bc, accessor); |
|
408 |
} |
|
409 |
||
410 |
// ------------------------------------------------------------------ |
|
411 |
// Check for changes to the system dictionary during compilation |
|
412 |
// class loads, evolution, breakpoints |
|
48299
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
413 |
JVMCIEnv::CodeInstallResult JVMCIEnv::validate_compile_task_dependencies(Dependencies* dependencies, Handle compiled_code, |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
414 |
JVMCIEnv* env, char** failure_detail) { |
33160 | 415 |
// If JVMTI capabilities were enabled during compile, the compilation is invalidated. |
416 |
if (env != NULL) { |
|
417 |
if (!env->_jvmti_can_hotswap_or_post_breakpoint && JvmtiExport::can_hotswap_or_post_breakpoint()) { |
|
418 |
*failure_detail = (char*) "Hotswapping or breakpointing was enabled during compilation"; |
|
419 |
return JVMCIEnv::dependencies_failed; |
|
420 |
} |
|
421 |
} |
|
422 |
||
423 |
// Dependencies must be checked when the system dictionary changes |
|
424 |
// or if we don't know whether it has changed (i.e., env == NULL). |
|
48299
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
425 |
bool counter_changed = env == NULL || env->_system_dictionary_modification_counter != SystemDictionary::number_of_modifications(); |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
426 |
CompileTask* task = env == NULL ? NULL : env->task(); |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
427 |
Dependencies::DepType result = dependencies->validate_dependencies(task, counter_changed, failure_detail); |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
428 |
if (result == Dependencies::end_marker) { |
33160 | 429 |
return JVMCIEnv::ok; |
430 |
} |
|
431 |
||
48299
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
432 |
if (!Dependencies::is_klass_type(result) || counter_changed) { |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
433 |
return JVMCIEnv::dependencies_failed; |
33160 | 434 |
} |
48299
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
435 |
// The dependencies were invalid at the time of installation |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
436 |
// without any intervening modification of the system |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
437 |
// dictionary. That means they were invalidly constructed. |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
438 |
return JVMCIEnv::dependencies_invalid; |
33160 | 439 |
} |
440 |
||
441 |
// ------------------------------------------------------------------ |
|
442 |
JVMCIEnv::CodeInstallResult JVMCIEnv::register_method( |
|
34165 | 443 |
const methodHandle& method, |
33160 | 444 |
nmethod*& nm, |
445 |
int entry_bci, |
|
446 |
CodeOffsets* offsets, |
|
447 |
int orig_pc_offset, |
|
448 |
CodeBuffer* code_buffer, |
|
449 |
int frame_words, |
|
450 |
OopMapSet* oop_map_set, |
|
451 |
ExceptionHandlerTable* handler_table, |
|
452 |
AbstractCompiler* compiler, |
|
453 |
DebugInformationRecorder* debug_info, |
|
454 |
Dependencies* dependencies, |
|
455 |
JVMCIEnv* env, |
|
456 |
int compile_id, |
|
457 |
bool has_unsafe_access, |
|
458 |
bool has_wide_vector, |
|
459 |
Handle installed_code, |
|
460 |
Handle compiled_code, |
|
461 |
Handle speculation_log) { |
|
462 |
JVMCI_EXCEPTION_CONTEXT; |
|
463 |
nm = NULL; |
|
464 |
int comp_level = CompLevel_full_optimization; |
|
465 |
char* failure_detail = NULL; |
|
466 |
JVMCIEnv::CodeInstallResult result; |
|
467 |
{ |
|
468 |
// To prevent compile queue updates. |
|
469 |
MutexLocker locker(MethodCompileQueue_lock, THREAD); |
|
470 |
||
471 |
// Prevent SystemDictionary::add_to_hierarchy from running |
|
472 |
// and invalidating our dependencies until we install this method. |
|
473 |
MutexLocker ml(Compile_lock); |
|
474 |
||
475 |
// Encode the dependencies now, so we can check them right away. |
|
476 |
dependencies->encode_content_bytes(); |
|
477 |
||
48299
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
478 |
// Record the dependencies for the current compile in the log |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
479 |
if (LogCompilation) { |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
480 |
for (Dependencies::DepStream deps(dependencies); deps.next(); ) { |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
481 |
deps.log_dependency(); |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
482 |
} |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
483 |
} |
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
484 |
|
33160 | 485 |
// Check for {class loads, evolution, breakpoints} during compilation |
48299
e8f5fc8f5f67
8191052: [Graal] java/lang/invoke/CallSiteTest.java intermittently fails with "Failed dependency of type call_site_target_value" when running with Graal as JIT
never
parents:
48007
diff
changeset
|
486 |
result = validate_compile_task_dependencies(dependencies, compiled_code, env, &failure_detail); |
33160 | 487 |
if (result != JVMCIEnv::ok) { |
488 |
// While not a true deoptimization, it is a preemptive decompile. |
|
489 |
MethodData* mdp = method()->method_data(); |
|
490 |
if (mdp != NULL) { |
|
491 |
mdp->inc_decompile_count(); |
|
33632 | 492 |
#ifdef ASSERT |
33160 | 493 |
if (mdp->decompile_count() > (uint)PerMethodRecompilationCutoff) { |
494 |
ResourceMark m; |
|
495 |
tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string()); |
|
496 |
} |
|
33632 | 497 |
#endif |
33160 | 498 |
} |
499 |
||
500 |
// All buffers in the CodeBuffer are allocated in the CodeCache. |
|
501 |
// If the code buffer is created on each compile attempt |
|
502 |
// as in C2, then it must be freed. |
|
503 |
//code_buffer->free_blob(); |
|
504 |
} else { |
|
505 |
ImplicitExceptionTable implicit_tbl; |
|
506 |
nm = nmethod::new_nmethod(method, |
|
507 |
compile_id, |
|
508 |
entry_bci, |
|
509 |
offsets, |
|
510 |
orig_pc_offset, |
|
511 |
debug_info, dependencies, code_buffer, |
|
512 |
frame_words, oop_map_set, |
|
513 |
handler_table, &implicit_tbl, |
|
47794
e84aa2c71241
8188102: [JVMCI] Convert special JVMCI oops in nmethod to jweak values
dnsimon
parents:
47216
diff
changeset
|
514 |
compiler, comp_level, |
e84aa2c71241
8188102: [JVMCI] Convert special JVMCI oops in nmethod to jweak values
dnsimon
parents:
47216
diff
changeset
|
515 |
JNIHandles::make_weak_global(installed_code), |
e84aa2c71241
8188102: [JVMCI] Convert special JVMCI oops in nmethod to jweak values
dnsimon
parents:
47216
diff
changeset
|
516 |
JNIHandles::make_weak_global(speculation_log)); |
33160 | 517 |
|
518 |
// Free codeBlobs |
|
519 |
//code_buffer->free_blob(); |
|
520 |
if (nm == NULL) { |
|
521 |
// The CodeCache is full. Print out warning and disable compilation. |
|
522 |
{ |
|
523 |
MutexUnlocker ml(Compile_lock); |
|
524 |
MutexUnlocker locker(MethodCompileQueue_lock); |
|
525 |
CompileBroker::handle_full_code_cache(CodeCache::get_code_blob_type(comp_level)); |
|
526 |
} |
|
527 |
} else { |
|
528 |
nm->set_has_unsafe_access(has_unsafe_access); |
|
529 |
nm->set_has_wide_vectors(has_wide_vector); |
|
530 |
||
531 |
// Record successful registration. |
|
532 |
// (Put nm into the task handle *before* publishing to the Java heap.) |
|
533 |
CompileTask* task = env == NULL ? NULL : env->task(); |
|
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
534 |
if (task != NULL) { |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
535 |
task->set_code(nm); |
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
34317
diff
changeset
|
536 |
} |
33160 | 537 |
|
538 |
if (installed_code->is_a(HotSpotNmethod::klass()) && HotSpotNmethod::isDefault(installed_code())) { |
|
539 |
if (entry_bci == InvocationEntryBci) { |
|
540 |
if (TieredCompilation) { |
|
541 |
// If there is an old version we're done with it |
|
38133
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37296
diff
changeset
|
542 |
CompiledMethod* old = method->code(); |
33160 | 543 |
if (TraceMethodReplacement && old != NULL) { |
544 |
ResourceMark rm; |
|
545 |
char *method_name = method->name_and_sig_as_C_string(); |
|
546 |
tty->print_cr("Replacing method %s", method_name); |
|
547 |
} |
|
548 |
if (old != NULL ) { |
|
549 |
old->make_not_entrant(); |
|
550 |
} |
|
551 |
} |
|
552 |
if (TraceNMethodInstalls) { |
|
553 |
ResourceMark rm; |
|
554 |
char *method_name = method->name_and_sig_as_C_string(); |
|
555 |
ttyLocker ttyl; |
|
556 |
tty->print_cr("Installing method (%d) %s [entry point: %p]", |
|
557 |
comp_level, |
|
558 |
method_name, nm->entry_point()); |
|
559 |
} |
|
560 |
// Allow the code to be executed |
|
561 |
method->set_code(method, nm); |
|
562 |
} else { |
|
563 |
if (TraceNMethodInstalls ) { |
|
564 |
ResourceMark rm; |
|
565 |
char *method_name = method->name_and_sig_as_C_string(); |
|
566 |
ttyLocker ttyl; |
|
567 |
tty->print_cr("Installing osr method (%d) %s @ %d", |
|
568 |
comp_level, |
|
569 |
method_name, |
|
570 |
entry_bci); |
|
571 |
} |
|
572 |
InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm); |
|
573 |
} |
|
574 |
} |
|
48007
ab3959df2115
8043070: nmethod::verify_interrupt_point() shouldn't enter safepoint
iveresov
parents:
47794
diff
changeset
|
575 |
nm->make_in_use(); |
33160 | 576 |
} |
577 |
result = nm != NULL ? JVMCIEnv::ok :JVMCIEnv::cache_full; |
|
578 |
} |
|
579 |
} |
|
580 |
||
581 |
// String creation must be done outside lock |
|
582 |
if (failure_detail != NULL) { |
|
583 |
// A failure to allocate the string is silently ignored. |
|
584 |
Handle message = java_lang_String::create_from_str(failure_detail, THREAD); |
|
585 |
HotSpotCompiledNmethod::set_installationFailureMessage(compiled_code, message()); |
|
586 |
} |
|
587 |
||
588 |
// JVMTI -- compiled method notification (must be done outside lock) |
|
589 |
if (nm != NULL) { |
|
590 |
nm->post_compiled_method_load_event(); |
|
36078
954c49c0ba57
8149969: [JVMCI] PrintNMethods is ignored for CompilerToVM.installCode when not called from the broker
never
parents:
35592
diff
changeset
|
591 |
|
954c49c0ba57
8149969: [JVMCI] PrintNMethods is ignored for CompilerToVM.installCode when not called from the broker
never
parents:
35592
diff
changeset
|
592 |
if (env == NULL) { |
954c49c0ba57
8149969: [JVMCI] PrintNMethods is ignored for CompilerToVM.installCode when not called from the broker
never
parents:
35592
diff
changeset
|
593 |
// This compile didn't come through the CompileBroker so perform the printing here |
954c49c0ba57
8149969: [JVMCI] PrintNMethods is ignored for CompilerToVM.installCode when not called from the broker
never
parents:
35592
diff
changeset
|
594 |
DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, compiler); |
954c49c0ba57
8149969: [JVMCI] PrintNMethods is ignored for CompilerToVM.installCode when not called from the broker
never
parents:
35592
diff
changeset
|
595 |
nm->maybe_print_nmethod(directive); |
954c49c0ba57
8149969: [JVMCI] PrintNMethods is ignored for CompilerToVM.installCode when not called from the broker
never
parents:
35592
diff
changeset
|
596 |
DirectivesStack::release(directive); |
954c49c0ba57
8149969: [JVMCI] PrintNMethods is ignored for CompilerToVM.installCode when not called from the broker
never
parents:
35592
diff
changeset
|
597 |
} |
33160 | 598 |
} |
599 |
||
600 |
return result; |
|
601 |
} |