--- old/src/share/vm/compiler/compileBroker.cpp 2014-09-18 10:34:03.287747300 +0200 +++ new/src/share/vm/compiler/compileBroker.cpp 2014-09-18 10:34:03.175747295 +0200 @@ -783,18 +783,22 @@ void CompileBroker::print_compile_queues(outputStream* st) { - _c1_compile_queue->print(st); - _c2_compile_queue->print(st); + _c1_compile_queue->print_with_lock(st); + _c2_compile_queue->print_with_lock(st); } +void CompileQueue::print_with_lock(outputStream* st) { + MutexLocker locker(lock()); + print(st); +} void CompileQueue::print(outputStream* st) { - assert_locked_or_safepoint(lock()); + assert(lock()->owned_by_self(), "must own lock"); st->print_cr("Contents of %s", name()); st->print_cr("----------------------------"); CompileTask* task = _first; if (task == NULL) { - st->print_cr("Empty");; + st->print_cr("Empty"); } else { while (task != NULL) { task->print_compilation(st, NULL, true, true); --- old/src/share/vm/services/diagnosticCommand.hpp 2014-09-18 10:34:03.291747300 +0200 +++ new/src/share/vm/services/diagnosticCommand.hpp 2014-09-18 10:34:03.183747295 +0200 @@ -427,7 +427,7 @@ return "Compiler.codelist"; } static const char* description() { - return "Print all compiled methods in code cache."; + return "Print all compiled methods in code cache that are alive"; } static const char* impact() { return "Medium"; --- old/src/share/vm/compiler/compileBroker.hpp 2014-09-18 10:34:03.295747300 +0200 +++ new/src/share/vm/compiler/compileBroker.hpp 2014-09-18 10:34:03.179747295 +0200 @@ -235,6 +235,7 @@ void free_all(); void print_tty(); void print(outputStream* st = tty); + void print_with_lock(outputStream* st = tty); ~CompileQueue() { assert (is_empty(), " Compile Queue must be empty"); --- old/test/serviceability/dcmd/CodeCacheTest.java 2014-09-18 10:34:03.299747300 +0200 +++ new/test/serviceability/dcmd/CodeCacheTest.java 2014-09-18 10:34:03.183747295 +0200 @@ -80,22 +80,15 @@ line = r.readLine(); m = line2.matcher(line); if (m.matches()) { - long start = Long.parseLong(m.group(1), 16); - if (start < 0) { + String start = m.group(1); + String mark = m.group(2); + String top = m.group(3); + + // Lexical compare of hex numbers to check that they look sane. + if (start.compareTo(mark) > 1) { throw new Exception("Failed parsing dcmd codecache output"); } - long mark = Long.parseLong(m.group(2), 16); - if (mark < 0) { - throw new Exception("Failed parsing dcmd codecache output"); - } - long top = Long.parseLong(m.group(3), 16); - if (top < 0) { - throw new Exception("Failed parsing dcmd codecache output"); - } - if (start > mark) { - throw new Exception("Failed parsing dcmd codecache output"); - } - if (mark > top) { + if (mark.compareTo(top) > 1) { throw new Exception("Failed parsing dcmd codecache output"); } } else {