1.1 --- a/src/share/vm/oops/constantPool.cpp Wed Apr 03 16:43:09 2013 -0700 1.2 +++ b/src/share/vm/oops/constantPool.cpp Thu Apr 04 10:01:26 2013 -0700 1.3 @@ -1378,12 +1378,13 @@ 1.4 1.5 // JVMTI GetConstantPool support 1.6 1.7 -// For temporary use until code is stable. 1.8 -#define DBG(code) 1.9 +// For debugging of constant pool 1.10 +const bool debug_cpool = false; 1.11 1.12 -static const char* WARN_MSG = "Must not be such entry!"; 1.13 +#define DBG(code) do { if (debug_cpool) { (code); } } while(0) 1.14 1.15 static void print_cpool_bytes(jint cnt, u1 *bytes) { 1.16 + const char* WARN_MSG = "Must not be such entry!"; 1.17 jint size = 0; 1.18 u2 idx1, idx2; 1.19 1.20 @@ -1669,8 +1670,7 @@ 1.21 idx1 = tbl->symbol_to_value(sym); 1.22 assert(idx1 != 0, "Have not found a hashtable entry"); 1.23 Bytes::put_Java_u2((address) (bytes+1), idx1); 1.24 - DBG(char *str = sym->as_utf8()); 1.25 - DBG(printf("JVM_CONSTANT_String: idx=#%03hd, %s", idx1, str)); 1.26 + DBG(printf("JVM_CONSTANT_String: idx=#%03hd, %s", idx1, sym->as_utf8())); 1.27 break; 1.28 } 1.29 case JVM_CONSTANT_Fieldref: 1.30 @@ -1745,6 +1745,8 @@ 1.31 return (int)(bytes - start_bytes); 1.32 } /* end copy_cpool_bytes */ 1.33 1.34 +#undef DBG 1.35 + 1.36 1.37 void ConstantPool::set_on_stack(const bool value) { 1.38 if (value) {