Mercurial > hg > truffle
comparison src/share/vm/code/compiledIC.cpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 9f7eac122d61 78bbf4d43a14 |
children | 7848fc12602b |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
86 } | 86 } |
87 | 87 |
88 if (TraceCompiledIC) { | 88 if (TraceCompiledIC) { |
89 tty->print(" "); | 89 tty->print(" "); |
90 print_compiled_ic(); | 90 print_compiled_ic(); |
91 tty->print(" changing destination to " INTPTR_FORMAT, entry_point); | 91 tty->print(" changing destination to " INTPTR_FORMAT, p2i(entry_point)); |
92 if (!is_optimized()) { | 92 if (!is_optimized()) { |
93 tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", (address)cache); | 93 tty->print(" changing cached %s to " INTPTR_FORMAT, is_icholder ? "icholder" : "metadata", p2i((address)cache)); |
94 } | 94 } |
95 if (is_icstub) { | 95 if (is_icstub) { |
96 tty->print(" (icstub)"); | 96 tty->print(" (icstub)"); |
97 } | 97 } |
98 tty->cr(); | 98 tty->cr(); |
193 } | 193 } |
194 | 194 |
195 if (TraceICs) { | 195 if (TraceICs) { |
196 ResourceMark rm; | 196 ResourceMark rm; |
197 tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT, | 197 tty->print_cr ("IC@" INTPTR_FORMAT ": to megamorphic %s entry: " INTPTR_FORMAT, |
198 instruction_address(), call_info->selected_method()->print_value_string(), entry); | 198 p2i(instruction_address()), call_info->selected_method()->print_value_string(), p2i(entry)); |
199 } | 199 } |
200 | 200 |
201 // We can't check this anymore. With lazy deopt we could have already | 201 // We can't check this anymore. With lazy deopt we could have already |
202 // cleaned this IC entry before we even return. This is possible if | 202 // cleaned this IC entry before we even return. This is possible if |
203 // we ran out of space in the inline cache buffer trying to do the | 203 // we ran out of space in the inline cache buffer trying to do the |
272 | 272 |
273 | 273 |
274 void CompiledIC::set_to_clean() { | 274 void CompiledIC::set_to_clean() { |
275 assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call"); | 275 assert(SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->is_locked() , "MT-unsafe call"); |
276 if (TraceInlineCacheClearing || TraceICs) { | 276 if (TraceInlineCacheClearing || TraceICs) { |
277 tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", instruction_address()); | 277 tty->print_cr("IC@" INTPTR_FORMAT ": set to clean", p2i(instruction_address())); |
278 print(); | 278 print(); |
279 } | 279 } |
280 | 280 |
281 address entry; | 281 address entry; |
282 if (is_optimized()) { | 282 if (is_optimized()) { |
354 methodHandle method (thread, (Method*)info.cached_metadata()); | 354 methodHandle method (thread, (Method*)info.cached_metadata()); |
355 csc->set_to_interpreted(method, info.entry()); | 355 csc->set_to_interpreted(method, info.entry()); |
356 if (TraceICs) { | 356 if (TraceICs) { |
357 ResourceMark rm(thread); | 357 ResourceMark rm(thread); |
358 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s", | 358 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter: %s", |
359 instruction_address(), | 359 p2i(instruction_address()), |
360 method->print_value_string()); | 360 method->print_value_string()); |
361 } | 361 } |
362 } else { | 362 } else { |
363 // Call via method-klass-holder | 363 // Call via method-klass-holder |
364 InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry()); | 364 InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry()); |
365 if (TraceICs) { | 365 if (TraceICs) { |
366 ResourceMark rm(thread); | 366 ResourceMark rm(thread); |
367 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", instruction_address()); | 367 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address())); |
368 } | 368 } |
369 } | 369 } |
370 } else { | 370 } else { |
371 // Call to compiled code | 371 // Call to compiled code |
372 bool static_bound = info.is_optimized() || (info.cached_metadata() == NULL); | 372 bool static_bound = info.is_optimized() || (info.cached_metadata() == NULL); |
392 | 392 |
393 if (TraceICs) { | 393 if (TraceICs) { |
394 ResourceMark rm(thread); | 394 ResourceMark rm(thread); |
395 assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be"); | 395 assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be"); |
396 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s", | 396 tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to compiled (rcvr klass) %s: %s", |
397 instruction_address(), | 397 p2i(instruction_address()), |
398 ((Klass*)info.cached_metadata())->print_value_string(), | 398 ((Klass*)info.cached_metadata())->print_value_string(), |
399 (safe) ? "" : "via stub"); | 399 (safe) ? "" : "via stub"); |
400 } | 400 } |
401 } | 401 } |
402 // We can't check this anymore. With lazy deopt we could have already | 402 // We can't check this anymore. With lazy deopt we could have already |
530 set_to_interpreted(info.callee(), info.entry()); | 530 set_to_interpreted(info.callee(), info.entry()); |
531 } else { | 531 } else { |
532 if (TraceICs) { | 532 if (TraceICs) { |
533 ResourceMark rm; | 533 ResourceMark rm; |
534 tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT, | 534 tty->print_cr("CompiledStaticCall@" INTPTR_FORMAT ": set_to_compiled " INTPTR_FORMAT, |
535 instruction_address(), | 535 p2i(instruction_address()), |
536 info.entry()); | 536 p2i(info.entry())); |
537 } | 537 } |
538 // Call to compiled code | 538 // Call to compiled code |
539 assert (CodeCache::contains(info.entry()), "wrong entry point"); | 539 assert (CodeCache::contains(info.entry()), "wrong entry point"); |
540 set_destination_mt_safe(info.entry()); | 540 set_destination_mt_safe(info.entry()); |
541 } | 541 } |
600 tty->cr(); | 600 tty->cr(); |
601 } | 601 } |
602 | 602 |
603 void CompiledIC::print_compiled_ic() { | 603 void CompiledIC::print_compiled_ic() { |
604 tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT, | 604 tty->print("Inline cache at " INTPTR_FORMAT ", calling %s " INTPTR_FORMAT " cached_value " INTPTR_FORMAT, |
605 instruction_address(), is_call_to_interpreted() ? "interpreted " : "", ic_destination(), is_optimized() ? NULL : cached_value()); | 605 p2i(instruction_address()), is_call_to_interpreted() ? "interpreted " : "", p2i(ic_destination()), p2i(is_optimized() ? NULL : cached_value())); |
606 } | 606 } |
607 | 607 |
608 void CompiledStaticCall::print() { | 608 void CompiledStaticCall::print() { |
609 tty->print("static call at " INTPTR_FORMAT " -> ", instruction_address()); | 609 tty->print("static call at " INTPTR_FORMAT " -> ", p2i(instruction_address())); |
610 if (is_clean()) { | 610 if (is_clean()) { |
611 tty->print("clean"); | 611 tty->print("clean"); |
612 } else if (is_call_to_compiled()) { | 612 } else if (is_call_to_compiled()) { |
613 tty->print("compiled"); | 613 tty->print("compiled"); |
614 } else if (is_call_to_interpreted()) { | 614 } else if (is_call_to_interpreted()) { |