1.1 --- a/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp Fri Mar 29 20:52:01 2013 -0700 1.2 +++ b/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp Sat Mar 30 08:01:05 2013 -0700 1.3 @@ -72,36 +72,6 @@ 1.4 // 0x20000000 | 536870912 - unused 1.5 // 0x40000000 | 1073741824 - unused 1.6 // 0x80000000 | 2147483648 - unused 1.7 -// 1.8 -// Note: The ResourceMark is to cleanup resource allocated args. 1.9 -// The "while (0)" is so we can use semi-colon at end of RC_TRACE(). 1.10 -#define RC_TRACE(level, args) \ 1.11 - if ((TraceRedefineClasses & level) != 0) { \ 1.12 - ResourceMark rm; \ 1.13 - tty->print("RedefineClasses-0x%x: ", level); \ 1.14 - tty->print_cr args; \ 1.15 - } while (0) 1.16 - 1.17 -#define RC_TRACE_NO_CR(level, args) \ 1.18 - if ((TraceRedefineClasses & level) != 0) { \ 1.19 - ResourceMark rm; \ 1.20 - tty->print("RedefineClasses-0x%x: ", level); \ 1.21 - tty->print args; \ 1.22 - } while (0) 1.23 - 1.24 -#define RC_TRACE_WITH_THREAD(level, thread, args) \ 1.25 - if ((TraceRedefineClasses & level) != 0) { \ 1.26 - ResourceMark rm(thread); \ 1.27 - tty->print("RedefineClasses-0x%x: ", level); \ 1.28 - tty->print_cr args; \ 1.29 - } while (0) 1.30 - 1.31 -#define RC_TRACE_MESG(args) \ 1.32 - { \ 1.33 - ResourceMark rm; \ 1.34 - tty->print("RedefineClasses: "); \ 1.35 - tty->print_cr args; \ 1.36 - } while (0) 1.37 1.38 // Macro for checking if TraceRedefineClasses has a specific bit 1.39 // enabled. Returns true if the bit specified by level is set. 1.40 @@ -120,16 +90,49 @@ 1.41 #define RC_TRACE_IN_RANGE(low, high) \ 1.42 (((TraceRedefineClasses & ((high << 1) - 1)) & ~(low - 1)) != 0) 1.43 1.44 -// Timer support macros. Only do timer operations if timer tracing 1.45 -// is enabled. The "while (0)" is so we can use semi-colon at end of 1.46 -// the macro. 1.47 -#define RC_TIMER_START(t) \ 1.48 +// Note: The ResourceMark is to cleanup resource allocated args. 1.49 +// The "do {...} while (0)" is so we can use semi-colon at end of RC_TRACE(). 1.50 +#define RC_TRACE(level, args) do { \ 1.51 + if (RC_TRACE_ENABLED(level)) { \ 1.52 + ResourceMark rm; \ 1.53 + tty->print("RedefineClasses-0x%x: ", level); \ 1.54 + tty->print_cr args; \ 1.55 + } \ 1.56 +} while (0) 1.57 + 1.58 +#define RC_TRACE_NO_CR(level, args) do { \ 1.59 + if (RC_TRACE_ENABLED(level)) { \ 1.60 + ResourceMark rm; \ 1.61 + tty->print("RedefineClasses-0x%x: ", level); \ 1.62 + tty->print args; \ 1.63 + } \ 1.64 +} while (0) 1.65 + 1.66 +#define RC_TRACE_WITH_THREAD(level, thread, args) do { \ 1.67 + if (RC_TRACE_ENABLED(level)) { \ 1.68 + ResourceMark rm(thread); \ 1.69 + tty->print("RedefineClasses-0x%x: ", level); \ 1.70 + tty->print_cr args; \ 1.71 + } \ 1.72 +} while (0) 1.73 + 1.74 +#define RC_TRACE_MESG(args) do { \ 1.75 + ResourceMark rm; \ 1.76 + tty->print("RedefineClasses: "); \ 1.77 + tty->print_cr args; \ 1.78 +} while (0) 1.79 + 1.80 +// Timer support macros. Only do timer operations if timer tracing is enabled. 1.81 +// The "do {...} while (0)" is so we can use semi-colon at end of the macro. 1.82 +#define RC_TIMER_START(t) do { \ 1.83 if (RC_TRACE_ENABLED(0x00000004)) { \ 1.84 t.start(); \ 1.85 - } while (0) 1.86 -#define RC_TIMER_STOP(t) \ 1.87 + } \ 1.88 +} while (0) 1.89 +#define RC_TIMER_STOP(t) do { \ 1.90 if (RC_TRACE_ENABLED(0x00000004)) { \ 1.91 t.stop(); \ 1.92 - } while (0) 1.93 + } \ 1.94 +} while (0) 1.95 1.96 #endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP