Mercurial > hg > graal-compiler
comparison src/share/vm/classfile/classLoaderData.cpp @ 17937:78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas
8043164: Format warning in traceStream.hpp
Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings
Reviewed-by: kvn, coleenp, iveresov, twisti
author | drchase |
---|---|
date | Thu, 22 May 2014 15:52:41 -0400 |
parents | 7384f6a12fc1 |
children | e4a6e7f1b90b |
comparison
equal
deleted
inserted
replaced
17935:7384f6a12fc1 | 17937:78bbf4d43a14 |
---|---|
267 | 267 |
268 if (TraceClassLoaderData && Verbose && k->class_loader_data() != NULL) { | 268 if (TraceClassLoaderData && Verbose && k->class_loader_data() != NULL) { |
269 ResourceMark rm; | 269 ResourceMark rm; |
270 tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: " | 270 tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: " |
271 PTR_FORMAT " loader: " PTR_FORMAT " %s", | 271 PTR_FORMAT " loader: " PTR_FORMAT " %s", |
272 k, | 272 p2i(k), |
273 k->external_name(), | 273 k->external_name(), |
274 k->class_loader_data(), | 274 p2i(k->class_loader_data()), |
275 (void *)k->class_loader(), | 275 p2i((void *)k->class_loader()), |
276 loader_name()); | 276 loader_name()); |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 // This is called by InstanceKlass::deallocate_contents() to remove the | 280 // This is called by InstanceKlass::deallocate_contents() to remove the |
305 // Tell serviceability tools these classes are unloading | 305 // Tell serviceability tools these classes are unloading |
306 classes_do(InstanceKlass::notify_unload_class); | 306 classes_do(InstanceKlass::notify_unload_class); |
307 | 307 |
308 if (TraceClassLoaderData) { | 308 if (TraceClassLoaderData) { |
309 ResourceMark rm; | 309 ResourceMark rm; |
310 tty->print("[ClassLoaderData: unload loader data "PTR_FORMAT, this); | 310 tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this)); |
311 tty->print(" for instance "PTR_FORMAT" of %s", (void *)class_loader(), | 311 tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()), |
312 loader_name()); | 312 loader_name()); |
313 if (is_anonymous()) { | 313 if (is_anonymous()) { |
314 tty->print(" for anonymous class "PTR_FORMAT " ", _klasses); | 314 tty->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses)); |
315 } | 315 } |
316 tty->print_cr("]"); | 316 tty->print_cr("]"); |
317 } | 317 } |
318 } | 318 } |
319 | 319 |
467 #undef CLD_DUMP_KLASSES | 467 #undef CLD_DUMP_KLASSES |
468 | 468 |
469 void ClassLoaderData::dump(outputStream * const out) { | 469 void ClassLoaderData::dump(outputStream * const out) { |
470 ResourceMark rm; | 470 ResourceMark rm; |
471 out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {", | 471 out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {", |
472 this, (void *)class_loader(), | 472 p2i(this), p2i((void *)class_loader()), |
473 class_loader() != NULL ? class_loader()->klass() : NULL, loader_name()); | 473 p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name()); |
474 if (claimed()) out->print(" claimed "); | 474 if (claimed()) out->print(" claimed "); |
475 if (is_unloading()) out->print(" unloading "); | 475 if (is_unloading()) out->print(" unloading "); |
476 out->print(" handles " INTPTR_FORMAT, handles()); | 476 out->print(" handles " INTPTR_FORMAT, p2i(handles())); |
477 out->cr(); | 477 out->cr(); |
478 if (metaspace_or_null() != NULL) { | 478 if (metaspace_or_null() != NULL) { |
479 out->print_cr("metaspace: " PTR_FORMAT, metaspace_or_null()); | 479 out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null())); |
480 metaspace_or_null()->dump(out); | 480 metaspace_or_null()->dump(out); |
481 } else { | 481 } else { |
482 out->print_cr("metaspace: NULL"); | 482 out->print_cr("metaspace: NULL"); |
483 } | 483 } |
484 | 484 |
570 ClassLoaderData* exchanged = (ClassLoaderData*)Atomic::cmpxchg_ptr(cld, list_head, next); | 570 ClassLoaderData* exchanged = (ClassLoaderData*)Atomic::cmpxchg_ptr(cld, list_head, next); |
571 if (exchanged == next) { | 571 if (exchanged == next) { |
572 if (TraceClassLoaderData) { | 572 if (TraceClassLoaderData) { |
573 ResourceMark rm; | 573 ResourceMark rm; |
574 tty->print("[ClassLoaderData: "); | 574 tty->print("[ClassLoaderData: "); |
575 tty->print("create class loader data "PTR_FORMAT, cld); | 575 tty->print("create class loader data " INTPTR_FORMAT, p2i(cld)); |
576 tty->print(" for instance "PTR_FORMAT" of %s", (void *)cld->class_loader(), | 576 tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()), |
577 cld->loader_name()); | 577 cld->loader_name()); |
578 tty->print_cr("]"); | 578 tty->print_cr("]"); |
579 } | 579 } |
580 return cld; | 580 return cld; |
581 } | 581 } |
802 | 802 |
803 void ClassLoaderData::print_value_on(outputStream* out) const { | 803 void ClassLoaderData::print_value_on(outputStream* out) const { |
804 if (class_loader() == NULL) { | 804 if (class_loader() == NULL) { |
805 out->print("NULL class_loader"); | 805 out->print("NULL class_loader"); |
806 } else { | 806 } else { |
807 out->print("class loader "PTR_FORMAT, this); | 807 out->print("class loader " INTPTR_FORMAT, p2i(this)); |
808 class_loader()->print_value_on(out); | 808 class_loader()->print_value_on(out); |
809 } | 809 } |
810 } | 810 } |
811 | 811 |
812 #if INCLUDE_TRACE | 812 #if INCLUDE_TRACE |