# HG changeset patch # User Christian Haeubl # Date 1369128973 -7200 # Node ID 7bd4a69b4ce152a56f22359ebde6c75e12beaee4 # Parent 26785bb7006d3cff8055014296ff2a9ea214167c Added #ifdefs to nmethod statistics. diff -r 26785bb7006d -r 7bd4a69b4ce1 src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Tue May 21 10:34:18 2013 +0200 +++ b/src/share/vm/code/nmethod.cpp Tue May 21 11:36:13 2013 +0200 @@ -124,6 +124,9 @@ // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. // (In the latter two cases, they like other stats are printed to the log only.) +#if !defined(PRODUCT) || defined(GRAAL) +#define NOT_PRODUCT_OR_GRAAL(code) code + // These variables are put into one block to reduce relocations // and make it simpler to print from the debugger. static @@ -213,7 +216,9 @@ pc_desc_tests, pc_desc_searches, pc_desc_adds); } } nmethod_stats; - +#else // !PRODUCT || GRAAL +#define NOT_PRODUCT_OR_GRAAL(code) +#endif // !PRODUCT || GRAAL //--------------------------------------------------------------------------------- @@ -519,7 +524,7 @@ code_buffer, frame_size, basic_lock_owner_sp_offset, basic_lock_sp_offset, oop_maps); - if (nm != NULL) nmethod_stats.note_native_nmethod(nm); + NOT_PRODUCT_OR_GRAAL(if (nm != NULL) nmethod_stats.note_native_nmethod(nm)); if (PrintAssembly && nm != NULL) Disassembler::decode(nm); } @@ -556,7 +561,7 @@ nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); - if (nm != NULL) nmethod_stats.note_nmethod(nm); + NOT_PRODUCT_OR_GRAAL(if (nm != NULL) nmethod_stats.note_nmethod(nm)); if (PrintAssembly && nm != NULL) Disassembler::decode(nm); } @@ -640,7 +645,7 @@ InstanceKlass::cast(klass)->add_dependent_nmethod(nm); } } - if (nm != NULL) nmethod_stats.note_nmethod(nm); + NOT_PRODUCT_OR_GRAAL(if (nm != NULL) nmethod_stats.note_nmethod(nm)); if (PrintAssembly && nm != NULL) Disassembler::decode(nm); } @@ -3019,6 +3024,7 @@ #endif // PRODUCT void nmethod::print_statistics() { +#if !defined(PRODUCT) || defined(GRAAL) ttyLocker ttyl; if (xtty != NULL) xtty->head("statistics type='nmethod'"); nmethod_stats.print_native_nmethod_stats(); @@ -3027,4 +3033,7 @@ nmethod_stats.print_pc_stats(); Dependencies::print_statistics(); if (xtty != NULL) xtty->tail("statistics"); +#endif } + +#undef NOT_PRODUCT_OR_GRAAL