Mercurial > hg > truffle
annotate src/share/vm/c1/c1_Runtime1.cpp @ 1480:2fe369533fed
Additional debug output.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Sat, 27 Nov 2010 16:43:53 +0100 |
parents | 7641338cfc92 |
children | 2d26b0046e0d |
rev | line source |
---|---|
0 | 1 /* |
1213
6deeaebad47a
6902182: 4/4 Starting with jdwp agent should not incur performance penalty
dcubed
parents:
1142
diff
changeset
|
2 * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. |
0 | 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | |
21 * have any questions. | |
22 * | |
23 */ | |
24 | |
25 #include "incls/_precompiled.incl" | |
26 #include "incls/_c1_Runtime1.cpp.incl" | |
27 | |
28 | |
29 // Implementation of StubAssembler | |
30 | |
31 StubAssembler::StubAssembler(CodeBuffer* code, const char * name, int stub_id) : C1_MacroAssembler(code) { | |
32 _name = name; | |
33 _must_gc_arguments = false; | |
34 _frame_size = no_frame_size; | |
35 _num_rt_args = 0; | |
36 _stub_id = stub_id; | |
37 } | |
38 | |
39 | |
40 void StubAssembler::set_info(const char* name, bool must_gc_arguments) { | |
41 _name = name; | |
42 _must_gc_arguments = must_gc_arguments; | |
43 } | |
44 | |
45 | |
46 void StubAssembler::set_frame_size(int size) { | |
47 if (_frame_size == no_frame_size) { | |
48 _frame_size = size; | |
49 } | |
50 assert(_frame_size == size, "can't change the frame size"); | |
51 } | |
52 | |
53 | |
54 void StubAssembler::set_num_rt_args(int args) { | |
55 if (_num_rt_args == 0) { | |
56 _num_rt_args = args; | |
57 } | |
58 assert(_num_rt_args == args, "can't change the number of args"); | |
59 } | |
60 | |
61 // Implementation of Runtime1 | |
62 | |
63 bool Runtime1::_is_initialized = false; | |
64 CodeBlob* Runtime1::_blobs[Runtime1::number_of_ids]; | |
65 const char *Runtime1::_blob_names[] = { | |
66 RUNTIME1_STUBS(STUB_NAME, LAST_STUB_NAME) | |
67 }; | |
68 | |
69 #ifndef PRODUCT | |
70 // statistics | |
71 int Runtime1::_generic_arraycopy_cnt = 0; | |
72 int Runtime1::_primitive_arraycopy_cnt = 0; | |
73 int Runtime1::_oop_arraycopy_cnt = 0; | |
74 int Runtime1::_arraycopy_slowcase_cnt = 0; | |
75 int Runtime1::_new_type_array_slowcase_cnt = 0; | |
76 int Runtime1::_new_object_array_slowcase_cnt = 0; | |
77 int Runtime1::_new_instance_slowcase_cnt = 0; | |
78 int Runtime1::_new_multi_array_slowcase_cnt = 0; | |
79 int Runtime1::_monitorenter_slowcase_cnt = 0; | |
80 int Runtime1::_monitorexit_slowcase_cnt = 0; | |
81 int Runtime1::_patch_code_slowcase_cnt = 0; | |
82 int Runtime1::_throw_range_check_exception_count = 0; | |
83 int Runtime1::_throw_index_exception_count = 0; | |
84 int Runtime1::_throw_div0_exception_count = 0; | |
85 int Runtime1::_throw_null_pointer_exception_count = 0; | |
86 int Runtime1::_throw_class_cast_exception_count = 0; | |
87 int Runtime1::_throw_incompatible_class_change_error_count = 0; | |
88 int Runtime1::_throw_array_store_exception_count = 0; | |
89 int Runtime1::_throw_count = 0; | |
90 #endif | |
91 | |
92 BufferBlob* Runtime1::_buffer_blob = NULL; | |
93 | |
94 // Simple helper to see if the caller of a runtime stub which | |
95 // entered the VM has been deoptimized | |
96 | |
97 static bool caller_is_deopted() { | |
98 JavaThread* thread = JavaThread::current(); | |
99 RegisterMap reg_map(thread, false); | |
100 frame runtime_frame = thread->last_frame(); | |
101 frame caller_frame = runtime_frame.sender(®_map); | |
102 assert(caller_frame.is_compiled_frame(), "must be compiled"); | |
103 return caller_frame.is_deoptimized_frame(); | |
104 } | |
105 | |
106 // Stress deoptimization | |
107 static void deopt_caller() { | |
108 if ( !caller_is_deopted()) { | |
109 JavaThread* thread = JavaThread::current(); | |
110 RegisterMap reg_map(thread, false); | |
111 frame runtime_frame = thread->last_frame(); | |
112 frame caller_frame = runtime_frame.sender(®_map); | |
1213
6deeaebad47a
6902182: 4/4 Starting with jdwp agent should not incur performance penalty
dcubed
parents:
1142
diff
changeset
|
113 // bypass VM_DeoptimizeFrame and deoptimize the frame directly |
6deeaebad47a
6902182: 4/4 Starting with jdwp agent should not incur performance penalty
dcubed
parents:
1142
diff
changeset
|
114 Deoptimization::deoptimize_frame(thread, caller_frame.id()); |
0 | 115 assert(caller_is_deopted(), "Must be deoptimized"); |
116 } | |
117 } | |
118 | |
119 | |
120 BufferBlob* Runtime1::get_buffer_blob() { | |
121 // Allocate code buffer space only once | |
122 BufferBlob* blob = _buffer_blob; | |
123 if (blob == NULL) { | |
124 // setup CodeBuffer. Preallocate a BufferBlob of size | |
125 // NMethodSizeLimit plus some extra space for constants. | |
126 int code_buffer_size = desired_max_code_buffer_size() + desired_max_constant_size(); | |
127 blob = BufferBlob::create("Compiler1 temporary CodeBuffer", | |
128 code_buffer_size); | |
129 guarantee(blob != NULL, "must create initial code buffer"); | |
130 _buffer_blob = blob; | |
131 } | |
132 return _buffer_blob; | |
133 } | |
134 | |
135 void Runtime1::setup_code_buffer(CodeBuffer* code, int call_stub_estimate) { | |
136 // Preinitialize the consts section to some large size: | |
137 int locs_buffer_size = 20 * (relocInfo::length_limit + sizeof(relocInfo)); | |
138 char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size); | |
139 code->insts()->initialize_shared_locs((relocInfo*)locs_buffer, | |
140 locs_buffer_size / sizeof(relocInfo)); | |
141 code->initialize_consts_size(desired_max_constant_size()); | |
142 // Call stubs + deopt/exception handler | |
143 code->initialize_stubs_size((call_stub_estimate * LIR_Assembler::call_stub_size) + | |
144 LIR_Assembler::exception_handler_size + | |
145 LIR_Assembler::deopt_handler_size); | |
146 } | |
147 | |
148 | |
149 void Runtime1::generate_blob_for(StubID id) { | |
150 assert(0 <= id && id < number_of_ids, "illegal stub id"); | |
151 ResourceMark rm; | |
152 // create code buffer for code storage | |
153 CodeBuffer code(get_buffer_blob()->instructions_begin(), | |
154 get_buffer_blob()->instructions_size()); | |
155 | |
156 setup_code_buffer(&code, 0); | |
157 | |
158 // create assembler for code generation | |
159 StubAssembler* sasm = new StubAssembler(&code, name_for(id), id); | |
160 // generate code for runtime stub | |
161 OopMapSet* oop_maps; | |
162 oop_maps = generate_code_for(id, sasm); | |
163 assert(oop_maps == NULL || sasm->frame_size() != no_frame_size, | |
164 "if stub has an oop map it must have a valid frame size"); | |
165 | |
166 #ifdef ASSERT | |
167 // Make sure that stubs that need oopmaps have them | |
168 switch (id) { | |
169 // These stubs don't need to have an oopmap | |
170 case dtrace_object_alloc_id: | |
342
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
171 case g1_pre_barrier_slow_id: |
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
113
diff
changeset
|
172 case g1_post_barrier_slow_id: |
0 | 173 case slow_subtype_check_id: |
174 case fpu2long_stub_id: | |
175 case unwind_exception_id: | |
1449
8cfe3537a0d3
Pointer verification stub. Two loose oop fixes in C1X C++ part. Logging which methods have been compiled.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1434
diff
changeset
|
176 case c1x_verify_pointer_id: |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1247
diff
changeset
|
177 case c1x_unwind_exception_call_id: |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1247
diff
changeset
|
178 case c1x_slow_subtype_check_id: |
1434
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
179 case c1x_arithmetic_frem_id: |
72cfb36c6bb2
* enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1429
diff
changeset
|
180 case c1x_arithmetic_drem_id: |
0 | 181 #ifndef TIERED |
182 case counter_overflow_id: // Not generated outside the tiered world | |
183 #endif | |
184 #ifdef SPARC | |
185 case handle_exception_nofpu_id: // Unused on sparc | |
186 #endif | |
187 break; | |
188 | |
189 // All other stubs should have oopmaps | |
190 default: | |
191 assert(oop_maps != NULL, "must have an oopmap"); | |
192 } | |
193 #endif | |
194 | |
195 // align so printing shows nop's instead of random code at the end (SimpleStubs are aligned) | |
196 sasm->align(BytesPerWord); | |
197 // make sure all code is in code buffer | |
198 sasm->flush(); | |
199 // create blob - distinguish a few special cases | |
200 CodeBlob* blob = RuntimeStub::new_runtime_stub(name_for(id), | |
201 &code, | |
202 CodeOffsets::frame_never_safe, | |
203 sasm->frame_size(), | |
204 oop_maps, | |
205 sasm->must_gc_arguments()); | |
206 // install blob | |
207 assert(blob != NULL, "blob must exist"); | |
208 _blobs[id] = blob; | |
209 } | |
210 | |
211 | |
212 void Runtime1::initialize() { | |
213 // Warning: If we have more than one compilation running in parallel, we | |
214 // need a lock here with the current setup (lazy initialization). | |
215 if (!is_initialized()) { | |
216 _is_initialized = true; | |
217 | |
218 // platform-dependent initialization | |
219 initialize_pd(); | |
220 // generate stubs | |
221 for (int id = 0; id < number_of_ids; id++) generate_blob_for((StubID)id); | |
222 // printing | |
223 #ifndef PRODUCT | |
224 if (PrintSimpleStubs) { | |
225 ResourceMark rm; | |
226 for (int id = 0; id < number_of_ids; id++) { | |
227 _blobs[id]->print(); | |
228 if (_blobs[id]->oop_maps() != NULL) { | |
229 _blobs[id]->oop_maps()->print(); | |
230 } | |
231 } | |
232 } | |
233 #endif | |
234 } | |
235 } | |
236 | |
237 | |
238 CodeBlob* Runtime1::blob_for(StubID id) { | |
239 assert(0 <= id && id < number_of_ids, "illegal stub id"); | |
240 if (!is_initialized()) initialize(); | |
241 return _blobs[id]; | |
242 } | |
243 | |
244 | |
245 const char* Runtime1::name_for(StubID id) { | |
246 assert(0 <= id && id < number_of_ids, "illegal stub id"); | |
247 return _blob_names[id]; | |
248 } | |
249 | |
250 const char* Runtime1::name_for_address(address entry) { | |
251 for (int id = 0; id < number_of_ids; id++) { | |
252 if (entry == entry_for((StubID)id)) return name_for((StubID)id); | |
253 } | |
254 | |
255 #define FUNCTION_CASE(a, f) \ | |
256 if ((intptr_t)a == CAST_FROM_FN_PTR(intptr_t, f)) return #f | |
257 | |
258 FUNCTION_CASE(entry, os::javaTimeMillis); | |
259 FUNCTION_CASE(entry, os::javaTimeNanos); | |
260 FUNCTION_CASE(entry, SharedRuntime::OSR_migration_end); | |
261 FUNCTION_CASE(entry, SharedRuntime::d2f); | |
262 FUNCTION_CASE(entry, SharedRuntime::d2i); | |
263 FUNCTION_CASE(entry, SharedRuntime::d2l); | |
264 FUNCTION_CASE(entry, SharedRuntime::dcos); | |
265 FUNCTION_CASE(entry, SharedRuntime::dexp); | |
266 FUNCTION_CASE(entry, SharedRuntime::dlog); | |
267 FUNCTION_CASE(entry, SharedRuntime::dlog10); | |
268 FUNCTION_CASE(entry, SharedRuntime::dpow); | |
269 FUNCTION_CASE(entry, SharedRuntime::drem); | |
270 FUNCTION_CASE(entry, SharedRuntime::dsin); | |
271 FUNCTION_CASE(entry, SharedRuntime::dtan); | |
272 FUNCTION_CASE(entry, SharedRuntime::f2i); | |
273 FUNCTION_CASE(entry, SharedRuntime::f2l); | |
274 FUNCTION_CASE(entry, SharedRuntime::frem); | |
275 FUNCTION_CASE(entry, SharedRuntime::l2d); | |
276 FUNCTION_CASE(entry, SharedRuntime::l2f); | |
277 FUNCTION_CASE(entry, SharedRuntime::ldiv); | |
278 FUNCTION_CASE(entry, SharedRuntime::lmul); | |
279 FUNCTION_CASE(entry, SharedRuntime::lrem); | |
280 FUNCTION_CASE(entry, SharedRuntime::lrem); | |
281 FUNCTION_CASE(entry, SharedRuntime::dtrace_method_entry); | |
282 FUNCTION_CASE(entry, SharedRuntime::dtrace_method_exit); | |
283 FUNCTION_CASE(entry, trace_block_entry); | |
284 | |
285 #undef FUNCTION_CASE | |
286 | |
287 return "<unknown function>"; | |
288 } | |
289 | |
290 | |
291 JRT_ENTRY(void, Runtime1::new_instance(JavaThread* thread, klassOopDesc* klass)) | |
292 NOT_PRODUCT(_new_instance_slowcase_cnt++;) | |
293 | |
294 assert(oop(klass)->is_klass(), "not a class"); | |
295 instanceKlassHandle h(thread, klass); | |
296 h->check_valid_for_instantiation(true, CHECK); | |
297 // make sure klass is initialized | |
298 h->initialize(CHECK); | |
299 // allocate instance and return via TLS | |
300 oop obj = h->allocate_instance(CHECK); | |
301 thread->set_vm_result(obj); | |
302 JRT_END | |
303 | |
304 | |
305 JRT_ENTRY(void, Runtime1::new_type_array(JavaThread* thread, klassOopDesc* klass, jint length)) | |
306 NOT_PRODUCT(_new_type_array_slowcase_cnt++;) | |
307 // Note: no handle for klass needed since they are not used | |
308 // anymore after new_typeArray() and no GC can happen before. | |
309 // (This may have to change if this code changes!) | |
310 assert(oop(klass)->is_klass(), "not a class"); | |
311 BasicType elt_type = typeArrayKlass::cast(klass)->element_type(); | |
312 oop obj = oopFactory::new_typeArray(elt_type, length, CHECK); | |
313 thread->set_vm_result(obj); | |
314 // This is pretty rare but this runtime patch is stressful to deoptimization | |
315 // if we deoptimize here so force a deopt to stress the path. | |
316 if (DeoptimizeALot) { | |
317 deopt_caller(); | |
318 } | |
319 | |
320 JRT_END | |
321 | |
322 | |
323 JRT_ENTRY(void, Runtime1::new_object_array(JavaThread* thread, klassOopDesc* array_klass, jint length)) | |
324 NOT_PRODUCT(_new_object_array_slowcase_cnt++;) | |
325 | |
326 // Note: no handle for klass needed since they are not used | |
327 // anymore after new_objArray() and no GC can happen before. | |
328 // (This may have to change if this code changes!) | |
329 assert(oop(array_klass)->is_klass(), "not a class"); | |
330 klassOop elem_klass = objArrayKlass::cast(array_klass)->element_klass(); | |
331 objArrayOop obj = oopFactory::new_objArray(elem_klass, length, CHECK); | |
332 thread->set_vm_result(obj); | |
333 // This is pretty rare but this runtime patch is stressful to deoptimization | |
334 // if we deoptimize here so force a deopt to stress the path. | |
335 if (DeoptimizeALot) { | |
336 deopt_caller(); | |
337 } | |
338 JRT_END | |
339 | |
340 | |
341 JRT_ENTRY(void, Runtime1::new_multi_array(JavaThread* thread, klassOopDesc* klass, int rank, jint* dims)) | |
342 NOT_PRODUCT(_new_multi_array_slowcase_cnt++;) | |
343 | |
344 assert(oop(klass)->is_klass(), "not a class"); | |
345 assert(rank >= 1, "rank must be nonzero"); | |
346 oop obj = arrayKlass::cast(klass)->multi_allocate(rank, dims, CHECK); | |
347 thread->set_vm_result(obj); | |
348 JRT_END | |
349 | |
350 | |
351 JRT_ENTRY(void, Runtime1::unimplemented_entry(JavaThread* thread, StubID id)) | |
352 tty->print_cr("Runtime1::entry_for(%d) returned unimplemented entry point", id); | |
353 JRT_END | |
354 | |
355 | |
356 JRT_ENTRY(void, Runtime1::throw_array_store_exception(JavaThread* thread)) | |
357 THROW(vmSymbolHandles::java_lang_ArrayStoreException()); | |
358 JRT_END | |
359 | |
360 | |
361 JRT_ENTRY(void, Runtime1::post_jvmti_exception_throw(JavaThread* thread)) | |
1213
6deeaebad47a
6902182: 4/4 Starting with jdwp agent should not incur performance penalty
dcubed
parents:
1142
diff
changeset
|
362 if (JvmtiExport::can_post_on_exceptions()) { |
0 | 363 vframeStream vfst(thread, true); |
364 address bcp = vfst.method()->bcp_from(vfst.bci()); | |
365 JvmtiExport::post_exception_throw(thread, vfst.method(), bcp, thread->exception_oop()); | |
366 } | |
367 JRT_END | |
368 | |
369 #ifdef TIERED | |
370 JRT_ENTRY(void, Runtime1::counter_overflow(JavaThread* thread, int bci)) | |
371 RegisterMap map(thread, false); | |
372 frame fr = thread->last_frame().sender(&map); | |
373 nmethod* nm = (nmethod*) fr.cb(); | |
374 assert(nm!= NULL && nm->is_nmethod(), "what?"); | |
375 methodHandle method(thread, nm->method()); | |
376 if (bci == 0) { | |
377 // invocation counter overflow | |
378 if (!Tier1CountOnly) { | |
379 CompilationPolicy::policy()->method_invocation_event(method, CHECK); | |
380 } else { | |
381 method()->invocation_counter()->reset(); | |
382 } | |
383 } else { | |
384 if (!Tier1CountOnly) { | |
385 // Twe have a bci but not the destination bci and besides a backedge | |
386 // event is more for OSR which we don't want here. | |
387 CompilationPolicy::policy()->method_invocation_event(method, CHECK); | |
388 } else { | |
389 method()->backedge_counter()->reset(); | |
390 } | |
391 } | |
392 JRT_END | |
393 #endif // TIERED | |
394 | |
395 extern void vm_exit(int code); | |
396 | |
397 // Enter this method from compiled code handler below. This is where we transition | |
398 // to VM mode. This is done as a helper routine so that the method called directly | |
399 // from compiled code does not have to transition to VM. This allows the entry | |
400 // method to see if the nmethod that we have just looked up a handler for has | |
401 // been deoptimized while we were in the vm. This simplifies the assembly code | |
402 // cpu directories. | |
403 // | |
404 // We are entering here from exception stub (via the entry method below) | |
405 // If there is a compiled exception handler in this method, we will continue there; | |
406 // otherwise we will unwind the stack and continue at the caller of top frame method | |
407 // Note: we enter in Java using a special JRT wrapper. This wrapper allows us to | |
408 // control the area where we can allow a safepoint. After we exit the safepoint area we can | |
409 // check to see if the handler we are going to return is now in a nmethod that has | |
410 // been deoptimized. If that is the case we return the deopt blob | |
411 // unpack_with_exception entry instead. This makes life for the exception blob easier | |
412 // because making that same check and diverting is painful from assembly language. | |
413 // | |
414 | |
415 | |
416 JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* thread, oopDesc* ex, address pc, nmethod*& nm)) | |
417 | |
418 Handle exception(thread, ex); | |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1247
diff
changeset
|
419 if (UseC1X && exception.is_null()) { |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1247
diff
changeset
|
420 exception = Exceptions::new_exception(thread, vmSymbols::java_lang_NullPointerException(), NULL); |
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1247
diff
changeset
|
421 } |
0 | 422 nm = CodeCache::find_nmethod(pc); |
423 assert(nm != NULL, "this is not an nmethod"); | |
424 // Adjust the pc as needed/ | |
425 if (nm->is_deopt_pc(pc)) { | |
426 RegisterMap map(thread, false); | |
427 frame exception_frame = thread->last_frame().sender(&map); | |
428 // if the frame isn't deopted then pc must not correspond to the caller of last_frame | |
429 assert(exception_frame.is_deoptimized_frame(), "must be deopted"); | |
430 pc = exception_frame.pc(); | |
431 } | |
432 #ifdef ASSERT | |
433 assert(exception.not_null(), "NULL exceptions should be handled by throw_exception"); | |
434 assert(exception->is_oop(), "just checking"); | |
435 // Check that exception is a subclass of Throwable, otherwise we have a VerifyError | |
1142 | 436 if (!(exception->is_a(SystemDictionary::Throwable_klass()))) { |
0 | 437 if (ExitVMOnVerifyError) vm_exit(-1); |
438 ShouldNotReachHere(); | |
439 } | |
440 #endif | |
441 | |
442 // Check the stack guard pages and reenable them if necessary and there is | |
443 // enough space on the stack to do so. Use fast exceptions only if the guard | |
444 // pages are enabled. | |
445 bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); | |
446 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); | |
447 | |
1213
6deeaebad47a
6902182: 4/4 Starting with jdwp agent should not incur performance penalty
dcubed
parents:
1142
diff
changeset
|
448 if (JvmtiExport::can_post_on_exceptions()) { |
0 | 449 // To ensure correct notification of exception catches and throws |
450 // we have to deoptimize here. If we attempted to notify the | |
451 // catches and throws during this exception lookup it's possible | |
452 // we could deoptimize on the way out of the VM and end back in | |
453 // the interpreter at the throw site. This would result in double | |
454 // notifications since the interpreter would also notify about | |
455 // these same catches and throws as it unwound the frame. | |
456 | |
457 RegisterMap reg_map(thread); | |
458 frame stub_frame = thread->last_frame(); | |
459 frame caller_frame = stub_frame.sender(®_map); | |
460 | |
461 // We don't really want to deoptimize the nmethod itself since we | |
462 // can actually continue in the exception handler ourselves but I | |
463 // don't see an easy way to have the desired effect. | |
464 VM_DeoptimizeFrame deopt(thread, caller_frame.id()); | |
465 VMThread::execute(&deopt); | |
466 | |
467 return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); | |
468 } | |
469 | |
470 // ExceptionCache is used only for exceptions at call and not for implicit exceptions | |
471 if (guard_pages_enabled) { | |
472 address fast_continuation = nm->handler_for_exception_and_pc(exception, pc); | |
473 if (fast_continuation != NULL) { | |
474 if (fast_continuation == ExceptionCache::unwind_handler()) fast_continuation = NULL; | |
475 return fast_continuation; | |
476 } | |
477 } | |
478 | |
479 // If the stack guard pages are enabled, check whether there is a handler in | |
480 // the current method. Otherwise (guard pages disabled), force an unwind and | |
481 // skip the exception cache update (i.e., just leave continuation==NULL). | |
482 address continuation = NULL; | |
483 if (guard_pages_enabled) { | |
484 | |
485 // New exception handling mechanism can support inlined methods | |
486 // with exception handlers since the mappings are from PC to PC | |
487 | |
488 // debugging support | |
489 // tracing | |
490 if (TraceExceptions) { | |
491 ttyLocker ttyl; | |
492 ResourceMark rm; | |
493 tty->print_cr("Exception <%s> (0x%x) thrown in compiled method <%s> at PC " PTR_FORMAT " for thread 0x%x", | |
494 exception->print_value_string(), (address)exception(), nm->method()->print_value_string(), pc, thread); | |
495 } | |
496 // for AbortVMOnException flag | |
497 NOT_PRODUCT(Exceptions::debug_check_abort(exception)); | |
498 | |
499 // Clear out the exception oop and pc since looking up an | |
500 // exception handler can cause class loading, which might throw an | |
501 // exception and those fields are expected to be clear during | |
502 // normal bytecode execution. | |
503 thread->set_exception_oop(NULL); | |
504 thread->set_exception_pc(NULL); | |
505 | |
506 continuation = SharedRuntime::compute_compiled_exc_handler(nm, pc, exception, false, false); | |
507 // If an exception was thrown during exception dispatch, the exception oop may have changed | |
508 thread->set_exception_oop(exception()); | |
509 thread->set_exception_pc(pc); | |
510 | |
511 // the exception cache is used only by non-implicit exceptions | |
512 if (continuation == NULL) { | |
513 nm->add_handler_for_exception_and_pc(exception, pc, ExceptionCache::unwind_handler()); | |
514 } else { | |
515 nm->add_handler_for_exception_and_pc(exception, pc, continuation); | |
516 } | |
517 } | |
518 | |
519 thread->set_vm_result(exception()); | |
520 | |
521 if (TraceExceptions) { | |
522 ttyLocker ttyl; | |
523 ResourceMark rm; | |
524 tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT, | |
525 thread, continuation, pc); | |
526 } | |
527 | |
528 return continuation; | |
529 JRT_END | |
530 | |
531 // Enter this method from compiled code only if there is a Java exception handler | |
532 // in the method handling the exception | |
533 // We are entering here from exception stub. We don't do a normal VM transition here. | |
534 // We do it in a helper. This is so we can check to see if the nmethod we have just | |
535 // searched for an exception handler has been deoptimized in the meantime. | |
536 address Runtime1::exception_handler_for_pc(JavaThread* thread) { | |
537 oop exception = thread->exception_oop(); | |
538 address pc = thread->exception_pc(); | |
539 // Still in Java mode | |
540 debug_only(ResetNoHandleMark rnhm); | |
541 nmethod* nm = NULL; | |
542 address continuation = NULL; | |
543 { | |
544 // Enter VM mode by calling the helper | |
545 | |
546 ResetNoHandleMark rnhm; | |
547 continuation = exception_handler_for_pc_helper(thread, exception, pc, nm); | |
548 } | |
549 // Back in JAVA, use no oops DON'T safepoint | |
550 | |
551 // Now check to see if the nmethod we were called from is now deoptimized. | |
552 // If so we must return to the deopt blob and deoptimize the nmethod | |
553 | |
554 if (nm != NULL && caller_is_deopted()) { | |
555 continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); | |
556 } | |
557 | |
558 return continuation; | |
559 } | |
560 | |
561 | |
562 JRT_ENTRY(void, Runtime1::throw_range_check_exception(JavaThread* thread, int index)) | |
563 NOT_PRODUCT(_throw_range_check_exception_count++;) | |
564 Events::log("throw_range_check"); | |
565 char message[jintAsStringSize]; | |
566 sprintf(message, "%d", index); | |
567 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message); | |
568 JRT_END | |
569 | |
570 | |
571 JRT_ENTRY(void, Runtime1::throw_index_exception(JavaThread* thread, int index)) | |
572 NOT_PRODUCT(_throw_index_exception_count++;) | |
573 Events::log("throw_index"); | |
574 char message[16]; | |
575 sprintf(message, "%d", index); | |
576 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IndexOutOfBoundsException(), message); | |
577 JRT_END | |
578 | |
579 | |
580 JRT_ENTRY(void, Runtime1::throw_div0_exception(JavaThread* thread)) | |
581 NOT_PRODUCT(_throw_div0_exception_count++;) | |
582 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArithmeticException(), "/ by zero"); | |
583 JRT_END | |
584 | |
585 | |
586 JRT_ENTRY(void, Runtime1::throw_null_pointer_exception(JavaThread* thread)) | |
587 NOT_PRODUCT(_throw_null_pointer_exception_count++;) | |
588 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_NullPointerException()); | |
589 JRT_END | |
590 | |
591 | |
592 JRT_ENTRY(void, Runtime1::throw_class_cast_exception(JavaThread* thread, oopDesc* object)) | |
593 NOT_PRODUCT(_throw_class_cast_exception_count++;) | |
594 ResourceMark rm(thread); | |
595 char* message = SharedRuntime::generate_class_cast_message( | |
596 thread, Klass::cast(object->klass())->external_name()); | |
597 SharedRuntime::throw_and_post_jvmti_exception( | |
598 thread, vmSymbols::java_lang_ClassCastException(), message); | |
599 JRT_END | |
600 | |
601 | |
602 JRT_ENTRY(void, Runtime1::throw_incompatible_class_change_error(JavaThread* thread)) | |
603 NOT_PRODUCT(_throw_incompatible_class_change_error_count++;) | |
604 ResourceMark rm(thread); | |
605 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IncompatibleClassChangeError()); | |
606 JRT_END | |
607 | |
608 | |
609 JRT_ENTRY_NO_ASYNC(void, Runtime1::monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock)) | |
610 NOT_PRODUCT(_monitorenter_slowcase_cnt++;) | |
611 if (PrintBiasedLockingStatistics) { | |
612 Atomic::inc(BiasedLocking::slow_path_entry_count_addr()); | |
613 } | |
614 Handle h_obj(thread, obj); | |
615 assert(h_obj()->is_oop(), "must be NULL or an object"); | |
616 if (UseBiasedLocking) { | |
617 // Retry fast entry if bias is revoked to avoid unnecessary inflation | |
618 ObjectSynchronizer::fast_enter(h_obj, lock->lock(), true, CHECK); | |
619 } else { | |
620 if (UseFastLocking) { | |
621 // When using fast locking, the compiled code has already tried the fast case | |
622 assert(obj == lock->obj(), "must match"); | |
623 ObjectSynchronizer::slow_enter(h_obj, lock->lock(), THREAD); | |
624 } else { | |
625 lock->set_obj(obj); | |
626 ObjectSynchronizer::fast_enter(h_obj, lock->lock(), false, THREAD); | |
627 } | |
628 } | |
629 JRT_END | |
630 | |
631 | |
632 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock)) | |
633 NOT_PRODUCT(_monitorexit_slowcase_cnt++;) | |
634 assert(thread == JavaThread::current(), "threads must correspond"); | |
635 assert(thread->last_Java_sp(), "last_Java_sp must be set"); | |
636 // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown | |
637 EXCEPTION_MARK; | |
638 | |
639 oop obj = lock->obj(); | |
1480
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
640 |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
641 #ifdef DEBUG |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
642 if (!obj->is_oop()) { |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
643 ResetNoHandleMark rhm; |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
644 nmethod* method = thread->last_frame().cb()->as_nmethod_or_null(); |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
645 if (method != NULL) { |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
646 tty->print_cr("ERROR in monitorexit in method %s", method->name()); |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
647 } |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
648 thread->print_stack_on(tty); |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
649 assert(false, "invalid lock object pointer dected"); |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
650 } |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
651 #endif |
2fe369533fed
Additional debug output.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1472
diff
changeset
|
652 |
0 | 653 if (UseFastLocking) { |
654 // When using fast locking, the compiled code has already tried the fast case | |
655 ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD); | |
656 } else { | |
657 ObjectSynchronizer::fast_exit(obj, lock->lock(), THREAD); | |
658 } | |
659 JRT_END | |
660 | |
661 | |
662 static klassOop resolve_field_return_klass(methodHandle caller, int bci, TRAPS) { | |
663 Bytecode_field* field_access = Bytecode_field_at(caller(), caller->bcp_from(bci)); | |
664 // This can be static or non-static field access | |
665 Bytecodes::Code code = field_access->code(); | |
666 | |
667 // We must load class, initialize class and resolvethe field | |
668 FieldAccessInfo result; // initialize class if needed | |
669 constantPoolHandle constants(THREAD, caller->constants()); | |
670 LinkResolver::resolve_field(result, constants, field_access->index(), Bytecodes::java_code(code), false, CHECK_NULL); | |
671 return result.klass()(); | |
672 } | |
673 | |
674 | |
675 // | |
676 // This routine patches sites where a class wasn't loaded or | |
677 // initialized at the time the code was generated. It handles | |
678 // references to classes, fields and forcing of initialization. Most | |
679 // of the cases are straightforward and involving simply forcing | |
680 // resolution of a class, rewriting the instruction stream with the | |
681 // needed constant and replacing the call in this function with the | |
682 // patched code. The case for static field is more complicated since | |
683 // the thread which is in the process of initializing a class can | |
684 // access it's static fields but other threads can't so the code | |
685 // either has to deoptimize when this case is detected or execute a | |
686 // check that the current thread is the initializing thread. The | |
687 // current | |
688 // | |
689 // Patches basically look like this: | |
690 // | |
691 // | |
692 // patch_site: jmp patch stub ;; will be patched | |
693 // continue: ... | |
694 // ... | |
695 // ... | |
696 // ... | |
697 // | |
698 // They have a stub which looks like this: | |
699 // | |
700 // ;; patch body | |
701 // movl <const>, reg (for class constants) | |
702 // <or> movl [reg1 + <const>], reg (for field offsets) | |
703 // <or> movl reg, [reg1 + <const>] (for field offsets) | |
704 // <being_init offset> <bytes to copy> <bytes to skip> | |
705 // patch_stub: call Runtime1::patch_code (through a runtime stub) | |
706 // jmp patch_site | |
707 // | |
708 // | |
709 // A normal patch is done by rewriting the patch body, usually a move, | |
710 // and then copying it into place over top of the jmp instruction | |
711 // being careful to flush caches and doing it in an MP-safe way. The | |
712 // constants following the patch body are used to find various pieces | |
713 // of the patch relative to the call site for Runtime1::patch_code. | |
714 // The case for getstatic and putstatic is more complicated because | |
715 // getstatic and putstatic have special semantics when executing while | |
716 // the class is being initialized. getstatic/putstatic on a class | |
717 // which is being_initialized may be executed by the initializing | |
718 // thread but other threads have to block when they execute it. This | |
719 // is accomplished in compiled code by executing a test of the current | |
720 // thread against the initializing thread of the class. It's emitted | |
721 // as boilerplate in their stub which allows the patched code to be | |
722 // executed before it's copied back into the main body of the nmethod. | |
723 // | |
724 // being_init: get_thread(<tmp reg> | |
725 // cmpl [reg1 + <init_thread_offset>], <tmp reg> | |
726 // jne patch_stub | |
727 // movl [reg1 + <const>], reg (for field offsets) <or> | |
728 // movl reg, [reg1 + <const>] (for field offsets) | |
729 // jmp continue | |
730 // <being_init offset> <bytes to copy> <bytes to skip> | |
731 // patch_stub: jmp Runtim1::patch_code (through a runtime stub) | |
732 // jmp patch_site | |
733 // | |
734 // If the class is being initialized the patch body is rewritten and | |
735 // the patch site is rewritten to jump to being_init, instead of | |
736 // patch_stub. Whenever this code is executed it checks the current | |
737 // thread against the intializing thread so other threads will enter | |
738 // the runtime and end up blocked waiting the class to finish | |
739 // initializing inside the calls to resolve_field below. The | |
740 // initializing class will continue on it's way. Once the class is | |
741 // fully_initialized, the intializing_thread of the class becomes | |
742 // NULL, so the next thread to execute this code will fail the test, | |
743 // call into patch_code and complete the patching process by copying | |
744 // the patch body back into the main part of the nmethod and resume | |
745 // executing. | |
746 // | |
747 // | |
748 | |
749 JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_id )) | |
750 NOT_PRODUCT(_patch_code_slowcase_cnt++;) | |
751 | |
752 ResourceMark rm(thread); | |
753 RegisterMap reg_map(thread, false); | |
754 frame runtime_frame = thread->last_frame(); | |
755 frame caller_frame = runtime_frame.sender(®_map); | |
756 | |
757 // last java frame on stack | |
758 vframeStream vfst(thread, true); | |
759 assert(!vfst.at_end(), "Java frame must exist"); | |
760 | |
761 methodHandle caller_method(THREAD, vfst.method()); | |
762 // Note that caller_method->code() may not be same as caller_code because of OSR's | |
763 // Note also that in the presence of inlining it is not guaranteed | |
764 // that caller_method() == caller_code->method() | |
765 | |
766 | |
767 int bci = vfst.bci(); | |
768 | |
769 Events::log("patch_code @ " INTPTR_FORMAT , caller_frame.pc()); | |
770 | |
771 Bytecodes::Code code = Bytecode_at(caller_method->bcp_from(bci))->java_code(); | |
772 | |
773 #ifndef PRODUCT | |
774 // this is used by assertions in the access_field_patching_id | |
775 BasicType patch_field_type = T_ILLEGAL; | |
776 #endif // PRODUCT | |
777 bool deoptimize_for_volatile = false; | |
778 int patch_field_offset = -1; | |
779 KlassHandle init_klass(THREAD, klassOop(NULL)); // klass needed by access_field_patching code | |
780 Handle load_klass(THREAD, NULL); // oop needed by load_klass_patching code | |
781 if (stub_id == Runtime1::access_field_patching_id) { | |
782 | |
783 Bytecode_field* field_access = Bytecode_field_at(caller_method(), caller_method->bcp_from(bci)); | |
784 FieldAccessInfo result; // initialize class if needed | |
785 Bytecodes::Code code = field_access->code(); | |
786 constantPoolHandle constants(THREAD, caller_method->constants()); | |
787 LinkResolver::resolve_field(result, constants, field_access->index(), Bytecodes::java_code(code), false, CHECK); | |
788 patch_field_offset = result.field_offset(); | |
789 | |
790 // If we're patching a field which is volatile then at compile it | |
791 // must not have been know to be volatile, so the generated code | |
792 // isn't correct for a volatile reference. The nmethod has to be | |
793 // deoptimized so that the code can be regenerated correctly. | |
794 // This check is only needed for access_field_patching since this | |
795 // is the path for patching field offsets. load_klass is only | |
796 // used for patching references to oops which don't need special | |
797 // handling in the volatile case. | |
798 deoptimize_for_volatile = result.access_flags().is_volatile(); | |
799 | |
800 #ifndef PRODUCT | |
801 patch_field_type = result.field_type(); | |
802 #endif | |
803 } else if (stub_id == Runtime1::load_klass_patching_id) { | |
804 oop k; | |
805 switch (code) { | |
806 case Bytecodes::_putstatic: | |
807 case Bytecodes::_getstatic: | |
808 { klassOop klass = resolve_field_return_klass(caller_method, bci, CHECK); | |
809 // Save a reference to the class that has to be checked for initialization | |
810 init_klass = KlassHandle(THREAD, klass); | |
811 k = klass; | |
812 } | |
813 break; | |
814 case Bytecodes::_new: | |
815 { Bytecode_new* bnew = Bytecode_new_at(caller_method->bcp_from(bci)); | |
816 k = caller_method->constants()->klass_at(bnew->index(), CHECK); | |
817 } | |
818 break; | |
819 case Bytecodes::_multianewarray: | |
820 { Bytecode_multianewarray* mna = Bytecode_multianewarray_at(caller_method->bcp_from(bci)); | |
821 k = caller_method->constants()->klass_at(mna->index(), CHECK); | |
822 } | |
823 break; | |
824 case Bytecodes::_instanceof: | |
825 { Bytecode_instanceof* io = Bytecode_instanceof_at(caller_method->bcp_from(bci)); | |
826 k = caller_method->constants()->klass_at(io->index(), CHECK); | |
827 } | |
828 break; | |
829 case Bytecodes::_checkcast: | |
830 { Bytecode_checkcast* cc = Bytecode_checkcast_at(caller_method->bcp_from(bci)); | |
831 k = caller_method->constants()->klass_at(cc->index(), CHECK); | |
832 } | |
833 break; | |
834 case Bytecodes::_anewarray: | |
835 { Bytecode_anewarray* anew = Bytecode_anewarray_at(caller_method->bcp_from(bci)); | |
836 klassOop ek = caller_method->constants()->klass_at(anew->index(), CHECK); | |
837 k = Klass::cast(ek)->array_klass(CHECK); | |
838 } | |
839 break; | |
840 case Bytecodes::_ldc: | |
841 case Bytecodes::_ldc_w: | |
842 { | |
843 Bytecode_loadconstant* cc = Bytecode_loadconstant_at(caller_method(), | |
844 caller_method->bcp_from(bci)); | |
845 klassOop resolved = caller_method->constants()->klass_at(cc->index(), CHECK); | |
846 // ldc wants the java mirror. | |
847 k = resolved->klass_part()->java_mirror(); | |
848 } | |
849 break; | |
1472
7641338cfc92
Small NPE fix. More detailed error in case of wrong bytecode in patching stub.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1449
diff
changeset
|
850 default: |
7641338cfc92
Small NPE fix. More detailed error in case of wrong bytecode in patching stub.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1449
diff
changeset
|
851 tty->print_cr("Unhandled bytecode: %d stub_id=%d caller=%s bci=%d pc=%d", code, stub_id, caller_method->name()->as_C_string(), bci, caller_frame.pc()); |
7641338cfc92
Small NPE fix. More detailed error in case of wrong bytecode in patching stub.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1449
diff
changeset
|
852 Unimplemented(); |
0 | 853 } |
854 // convert to handle | |
855 load_klass = Handle(THREAD, k); | |
856 } else { | |
857 ShouldNotReachHere(); | |
858 } | |
859 | |
860 if (deoptimize_for_volatile) { | |
861 // At compile time we assumed the field wasn't volatile but after | |
862 // loading it turns out it was volatile so we have to throw the | |
863 // compiled code out and let it be regenerated. | |
864 if (TracePatching) { | |
865 tty->print_cr("Deoptimizing for patching volatile field reference"); | |
866 } | |
485
ac8fe14c93e4
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
never
parents:
362
diff
changeset
|
867 // It's possible the nmethod was invalidated in the last |
ac8fe14c93e4
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
never
parents:
362
diff
changeset
|
868 // safepoint, but if it's still alive then make it not_entrant. |
ac8fe14c93e4
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
never
parents:
362
diff
changeset
|
869 nmethod* nm = CodeCache::find_nmethod(caller_frame.pc()); |
ac8fe14c93e4
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
never
parents:
362
diff
changeset
|
870 if (nm != NULL) { |
ac8fe14c93e4
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
never
parents:
362
diff
changeset
|
871 nm->make_not_entrant(); |
ac8fe14c93e4
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
never
parents:
362
diff
changeset
|
872 } |
ac8fe14c93e4
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
never
parents:
362
diff
changeset
|
873 |
0 | 874 VM_DeoptimizeFrame deopt(thread, caller_frame.id()); |
875 VMThread::execute(&deopt); | |
876 | |
877 // Return to the now deoptimized frame. | |
878 } | |
879 | |
880 | |
881 // Now copy code back | |
882 | |
883 { | |
884 MutexLockerEx ml_patch (Patching_lock, Mutex::_no_safepoint_check_flag); | |
885 // | |
886 // Deoptimization may have happened while we waited for the lock. | |
887 // In that case we don't bother to do any patching we just return | |
888 // and let the deopt happen | |
889 if (!caller_is_deopted()) { | |
890 NativeGeneralJump* jump = nativeGeneralJump_at(caller_frame.pc()); | |
891 address instr_pc = jump->jump_destination(); | |
892 NativeInstruction* ni = nativeInstruction_at(instr_pc); | |
893 if (ni->is_jump() ) { | |
894 // the jump has not been patched yet | |
895 // The jump destination is slow case and therefore not part of the stubs | |
896 // (stubs are only for StaticCalls) | |
897 | |
898 // format of buffer | |
899 // .... | |
900 // instr byte 0 <-- copy_buff | |
901 // instr byte 1 | |
902 // .. | |
903 // instr byte n-1 | |
904 // n | |
905 // .... <-- call destination | |
906 | |
907 address stub_location = caller_frame.pc() + PatchingStub::patch_info_offset(); | |
908 unsigned char* byte_count = (unsigned char*) (stub_location - 1); | |
909 unsigned char* byte_skip = (unsigned char*) (stub_location - 2); | |
910 unsigned char* being_initialized_entry_offset = (unsigned char*) (stub_location - 3); | |
911 address copy_buff = stub_location - *byte_skip - *byte_count; | |
912 address being_initialized_entry = stub_location - *being_initialized_entry_offset; | |
913 if (TracePatching) { | |
914 tty->print_cr(" Patching %s at bci %d at address 0x%x (%s)", Bytecodes::name(code), bci, | |
915 instr_pc, (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass"); | |
916 nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc()); | |
917 assert(caller_code != NULL, "nmethod not found"); | |
918 | |
919 // NOTE we use pc() not original_pc() because we already know they are | |
920 // identical otherwise we'd have never entered this block of code | |
921 | |
922 OopMap* map = caller_code->oop_map_for_return_address(caller_frame.pc()); | |
923 assert(map != NULL, "null check"); | |
924 map->print(); | |
925 tty->cr(); | |
926 | |
927 Disassembler::decode(copy_buff, copy_buff + *byte_count, tty); | |
928 } | |
929 // depending on the code below, do_patch says whether to copy the patch body back into the nmethod | |
930 bool do_patch = true; | |
931 if (stub_id == Runtime1::access_field_patching_id) { | |
932 // The offset may not be correct if the class was not loaded at code generation time. | |
933 // Set it now. | |
934 NativeMovRegMem* n_move = nativeMovRegMem_at(copy_buff); | |
935 assert(n_move->offset() == 0 || (n_move->offset() == 4 && (patch_field_type == T_DOUBLE || patch_field_type == T_LONG)), "illegal offset for type"); | |
936 assert(patch_field_offset >= 0, "illegal offset"); | |
937 n_move->add_offset_in_bytes(patch_field_offset); | |
938 } else if (stub_id == Runtime1::load_klass_patching_id) { | |
939 // If a getstatic or putstatic is referencing a klass which | |
940 // isn't fully initialized, the patch body isn't copied into | |
941 // place until initialization is complete. In this case the | |
942 // patch site is setup so that any threads besides the | |
943 // initializing thread are forced to come into the VM and | |
944 // block. | |
945 do_patch = (code != Bytecodes::_getstatic && code != Bytecodes::_putstatic) || | |
946 instanceKlass::cast(init_klass())->is_initialized(); | |
947 NativeGeneralJump* jump = nativeGeneralJump_at(instr_pc); | |
948 if (jump->jump_destination() == being_initialized_entry) { | |
949 assert(do_patch == true, "initialization must be complete at this point"); | |
950 } else { | |
951 // patch the instruction <move reg, klass> | |
952 NativeMovConstReg* n_copy = nativeMovConstReg_at(copy_buff); | |
953 assert(n_copy->data() == 0, "illegal init value"); | |
954 assert(load_klass() != NULL, "klass not set"); | |
955 n_copy->set_data((intx) (load_klass())); | |
956 | |
957 if (TracePatching) { | |
958 Disassembler::decode(copy_buff, copy_buff + *byte_count, tty); | |
959 } | |
960 | |
961 #ifdef SPARC | |
962 // Update the oop location in the nmethod with the proper | |
963 // oop. When the code was generated, a NULL was stuffed | |
964 // in the oop table and that table needs to be update to | |
965 // have the right value. On intel the value is kept | |
966 // directly in the instruction instead of in the oop | |
967 // table, so set_data above effectively updated the value. | |
968 nmethod* nm = CodeCache::find_nmethod(instr_pc); | |
969 assert(nm != NULL, "invalid nmethod_pc"); | |
970 RelocIterator oops(nm, copy_buff, copy_buff + 1); | |
971 bool found = false; | |
972 while (oops.next() && !found) { | |
973 if (oops.type() == relocInfo::oop_type) { | |
974 oop_Relocation* r = oops.oop_reloc(); | |
975 oop* oop_adr = r->oop_addr(); | |
976 *oop_adr = load_klass(); | |
977 r->fix_oop_relocation(); | |
978 found = true; | |
979 } | |
980 } | |
981 assert(found, "the oop must exist!"); | |
982 #endif | |
983 | |
984 } | |
985 } else { | |
986 ShouldNotReachHere(); | |
987 } | |
988 if (do_patch) { | |
989 // replace instructions | |
990 // first replace the tail, then the call | |
991 for (int i = NativeCall::instruction_size; i < *byte_count; i++) { | |
992 address ptr = copy_buff + i; | |
993 int a_byte = (*ptr) & 0xFF; | |
994 address dst = instr_pc + i; | |
995 *(unsigned char*)dst = (unsigned char) a_byte; | |
996 } | |
997 ICache::invalidate_range(instr_pc, *byte_count); | |
998 NativeGeneralJump::replace_mt_safe(instr_pc, copy_buff); | |
999 | |
1000 if (stub_id == Runtime1::load_klass_patching_id) { | |
1001 // update relocInfo to oop | |
1002 nmethod* nm = CodeCache::find_nmethod(instr_pc); | |
1003 assert(nm != NULL, "invalid nmethod_pc"); | |
1004 | |
1005 // The old patch site is now a move instruction so update | |
1006 // the reloc info so that it will get updated during | |
1007 // future GCs. | |
1008 RelocIterator iter(nm, (address)instr_pc, (address)(instr_pc + 1)); | |
1009 relocInfo::change_reloc_info_for_address(&iter, (address) instr_pc, | |
1010 relocInfo::none, relocInfo::oop_type); | |
1011 #ifdef SPARC | |
1012 // Sparc takes two relocations for an oop so update the second one. | |
1013 address instr_pc2 = instr_pc + NativeMovConstReg::add_offset; | |
1014 RelocIterator iter2(nm, instr_pc2, instr_pc2 + 1); | |
1015 relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2, | |
1016 relocInfo::none, relocInfo::oop_type); | |
1017 #endif | |
1018 } | |
1019 | |
1020 } else { | |
1021 ICache::invalidate_range(copy_buff, *byte_count); | |
1022 NativeGeneralJump::insert_unconditional(instr_pc, being_initialized_entry); | |
1023 } | |
1024 } | |
1025 } | |
1026 } | |
1027 JRT_END | |
1028 | |
1029 // | |
1030 // Entry point for compiled code. We want to patch a nmethod. | |
1031 // We don't do a normal VM transition here because we want to | |
1032 // know after the patching is complete and any safepoint(s) are taken | |
1033 // if the calling nmethod was deoptimized. We do this by calling a | |
1034 // helper method which does the normal VM transition and when it | |
1035 // completes we can check for deoptimization. This simplifies the | |
1036 // assembly code in the cpu directories. | |
1037 // | |
1038 int Runtime1::move_klass_patching(JavaThread* thread) { | |
1039 // | |
1040 // NOTE: we are still in Java | |
1041 // | |
1042 Thread* THREAD = thread; | |
1043 debug_only(NoHandleMark nhm;) | |
1044 { | |
1045 // Enter VM mode | |
1046 | |
1047 ResetNoHandleMark rnhm; | |
1048 patch_code(thread, load_klass_patching_id); | |
1049 } | |
1050 // Back in JAVA, use no oops DON'T safepoint | |
1051 | |
1052 // Return true if calling code is deoptimized | |
1053 | |
1054 return caller_is_deopted(); | |
1055 } | |
1056 | |
1057 // | |
1058 // Entry point for compiled code. We want to patch a nmethod. | |
1059 // We don't do a normal VM transition here because we want to | |
1060 // know after the patching is complete and any safepoint(s) are taken | |
1061 // if the calling nmethod was deoptimized. We do this by calling a | |
1062 // helper method which does the normal VM transition and when it | |
1063 // completes we can check for deoptimization. This simplifies the | |
1064 // assembly code in the cpu directories. | |
1065 // | |
1066 | |
1067 int Runtime1::access_field_patching(JavaThread* thread) { | |
1068 // | |
1069 // NOTE: we are still in Java | |
1070 // | |
1071 Thread* THREAD = thread; | |
1072 debug_only(NoHandleMark nhm;) | |
1073 { | |
1074 // Enter VM mode | |
1075 | |
1076 ResetNoHandleMark rnhm; | |
1077 patch_code(thread, access_field_patching_id); | |
1078 } | |
1079 // Back in JAVA, use no oops DON'T safepoint | |
1080 | |
1081 // Return true if calling code is deoptimized | |
1082 | |
1083 return caller_is_deopted(); | |
1084 JRT_END | |
1085 | |
1086 | |
1087 JRT_LEAF(void, Runtime1::trace_block_entry(jint block_id)) | |
1088 // for now we just print out the block id | |
1089 tty->print("%d ", block_id); | |
1090 JRT_END | |
1091 | |
1092 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1093 // Array copy return codes. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1094 enum { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1095 ac_failed = -1, // arraycopy failed |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1096 ac_ok = 0 // arraycopy succeeded |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1097 }; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1098 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1099 |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1100 // Below length is the # elements copied. |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1101 template <class T> int obj_arraycopy_work(oopDesc* src, T* src_addr, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1102 oopDesc* dst, T* dst_addr, |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1103 int length) { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1104 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1105 // For performance reasons, we assume we are using a card marking write |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1106 // barrier. The assert will fail if this is not the case. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1107 // Note that we use the non-virtual inlineable variant of write_ref_array. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1108 BarrierSet* bs = Universe::heap()->barrier_set(); |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1109 assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1110 assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1111 if (src == dst) { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1112 // same object, no check |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1113 bs->write_ref_array_pre(dst_addr, length); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1114 Copy::conjoint_oops_atomic(src_addr, dst_addr, length); |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1115 bs->write_ref_array((HeapWord*)dst_addr, length); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1116 return ac_ok; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1117 } else { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1118 klassOop bound = objArrayKlass::cast(dst->klass())->element_klass(); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1119 klassOop stype = objArrayKlass::cast(src->klass())->element_klass(); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1120 if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1121 // Elements are guaranteed to be subtypes, so no check necessary |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1122 bs->write_ref_array_pre(dst_addr, length); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1123 Copy::conjoint_oops_atomic(src_addr, dst_addr, length); |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1124 bs->write_ref_array((HeapWord*)dst_addr, length); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1125 return ac_ok; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1126 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1127 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1128 return ac_failed; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1129 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1130 |
0 | 1131 // fast and direct copy of arrays; returning -1, means that an exception may be thrown |
1132 // and we did not copy anything | |
1133 JRT_LEAF(int, Runtime1::arraycopy(oopDesc* src, int src_pos, oopDesc* dst, int dst_pos, int length)) | |
1134 #ifndef PRODUCT | |
1135 _generic_arraycopy_cnt++; // Slow-path oop array copy | |
1136 #endif | |
1137 | |
1138 if (src == NULL || dst == NULL || src_pos < 0 || dst_pos < 0 || length < 0) return ac_failed; | |
1139 if (!dst->is_array() || !src->is_array()) return ac_failed; | |
1140 if ((unsigned int) arrayOop(src)->length() < (unsigned int)src_pos + (unsigned int)length) return ac_failed; | |
1141 if ((unsigned int) arrayOop(dst)->length() < (unsigned int)dst_pos + (unsigned int)length) return ac_failed; | |
1142 | |
1143 if (length == 0) return ac_ok; | |
1144 if (src->is_typeArray()) { | |
1145 const klassOop klass_oop = src->klass(); | |
1146 if (klass_oop != dst->klass()) return ac_failed; | |
1147 typeArrayKlass* klass = typeArrayKlass::cast(klass_oop); | |
1148 const int l2es = klass->log2_element_size(); | |
1149 const int ihs = klass->array_header_in_bytes() / wordSize; | |
1150 char* src_addr = (char*) ((oopDesc**)src + ihs) + (src_pos << l2es); | |
1151 char* dst_addr = (char*) ((oopDesc**)dst + ihs) + (dst_pos << l2es); | |
1152 // Potential problem: memmove is not guaranteed to be word atomic | |
1153 // Revisit in Merlin | |
1154 memmove(dst_addr, src_addr, length << l2es); | |
1155 return ac_ok; | |
1156 } else if (src->is_objArray() && dst->is_objArray()) { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1157 if (UseCompressedOops) { // will need for tiered |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1158 narrowOop *src_addr = objArrayOop(src)->obj_at_addr<narrowOop>(src_pos); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1159 narrowOop *dst_addr = objArrayOop(dst)->obj_at_addr<narrowOop>(dst_pos); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1160 return obj_arraycopy_work(src, src_addr, dst, dst_addr, length); |
0 | 1161 } else { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1162 oop *src_addr = objArrayOop(src)->obj_at_addr<oop>(src_pos); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1163 oop *dst_addr = objArrayOop(dst)->obj_at_addr<oop>(dst_pos); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
1164 return obj_arraycopy_work(src, src_addr, dst, dst_addr, length); |
0 | 1165 } |
1166 } | |
1167 return ac_failed; | |
1168 JRT_END | |
1169 | |
1170 | |
1171 JRT_LEAF(void, Runtime1::primitive_arraycopy(HeapWord* src, HeapWord* dst, int length)) | |
1172 #ifndef PRODUCT | |
1173 _primitive_arraycopy_cnt++; | |
1174 #endif | |
1175 | |
1176 if (length == 0) return; | |
1177 // Not guaranteed to be word atomic, but that doesn't matter | |
1178 // for anything but an oop array, which is covered by oop_arraycopy. | |
1179 Copy::conjoint_bytes(src, dst, length); | |
1180 JRT_END | |
1181 | |
1182 JRT_LEAF(void, Runtime1::oop_arraycopy(HeapWord* src, HeapWord* dst, int num)) | |
1183 #ifndef PRODUCT | |
1184 _oop_arraycopy_cnt++; | |
1185 #endif | |
1186 | |
1187 if (num == 0) return; | |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1188 BarrierSet* bs = Universe::heap()->barrier_set(); |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1189 assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1190 assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1191 if (UseCompressedOops) { |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1192 bs->write_ref_array_pre((narrowOop*)dst, num); |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1193 } else { |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1194 bs->write_ref_array_pre((oop*)dst, num); |
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1195 } |
0 | 1196 Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num); |
1245
6484c4ee11cb
6904516: More object array barrier fixes, following up on 6906727
ysr
parents:
1142
diff
changeset
|
1197 bs->write_ref_array(dst, num); |
0 | 1198 JRT_END |
1199 | |
1200 | |
1201 #ifndef PRODUCT | |
1202 void Runtime1::print_statistics() { | |
1203 tty->print_cr("C1 Runtime statistics:"); | |
1204 tty->print_cr(" _resolve_invoke_virtual_cnt: %d", SharedRuntime::_resolve_virtual_ctr); | |
1205 tty->print_cr(" _resolve_invoke_opt_virtual_cnt: %d", SharedRuntime::_resolve_opt_virtual_ctr); | |
1206 tty->print_cr(" _resolve_invoke_static_cnt: %d", SharedRuntime::_resolve_static_ctr); | |
1207 tty->print_cr(" _handle_wrong_method_cnt: %d", SharedRuntime::_wrong_method_ctr); | |
1208 tty->print_cr(" _ic_miss_cnt: %d", SharedRuntime::_ic_miss_ctr); | |
1209 tty->print_cr(" _generic_arraycopy_cnt: %d", _generic_arraycopy_cnt); | |
1210 tty->print_cr(" _primitive_arraycopy_cnt: %d", _primitive_arraycopy_cnt); | |
1211 tty->print_cr(" _oop_arraycopy_cnt: %d", _oop_arraycopy_cnt); | |
1212 tty->print_cr(" _arraycopy_slowcase_cnt: %d", _arraycopy_slowcase_cnt); | |
1213 | |
1214 tty->print_cr(" _new_type_array_slowcase_cnt: %d", _new_type_array_slowcase_cnt); | |
1215 tty->print_cr(" _new_object_array_slowcase_cnt: %d", _new_object_array_slowcase_cnt); | |
1216 tty->print_cr(" _new_instance_slowcase_cnt: %d", _new_instance_slowcase_cnt); | |
1217 tty->print_cr(" _new_multi_array_slowcase_cnt: %d", _new_multi_array_slowcase_cnt); | |
1218 tty->print_cr(" _monitorenter_slowcase_cnt: %d", _monitorenter_slowcase_cnt); | |
1219 tty->print_cr(" _monitorexit_slowcase_cnt: %d", _monitorexit_slowcase_cnt); | |
1220 tty->print_cr(" _patch_code_slowcase_cnt: %d", _patch_code_slowcase_cnt); | |
1221 | |
1222 tty->print_cr(" _throw_range_check_exception_count: %d:", _throw_range_check_exception_count); | |
1223 tty->print_cr(" _throw_index_exception_count: %d:", _throw_index_exception_count); | |
1224 tty->print_cr(" _throw_div0_exception_count: %d:", _throw_div0_exception_count); | |
1225 tty->print_cr(" _throw_null_pointer_exception_count: %d:", _throw_null_pointer_exception_count); | |
1226 tty->print_cr(" _throw_class_cast_exception_count: %d:", _throw_class_cast_exception_count); | |
1227 tty->print_cr(" _throw_incompatible_class_change_error_count: %d:", _throw_incompatible_class_change_error_count); | |
1228 tty->print_cr(" _throw_array_store_exception_count: %d:", _throw_array_store_exception_count); | |
1229 tty->print_cr(" _throw_count: %d:", _throw_count); | |
1230 | |
1231 SharedRuntime::print_ic_miss_histogram(); | |
1232 tty->cr(); | |
1233 } | |
1234 #endif // PRODUCT |