# HG changeset patch # User Gilles Duboscq # Date 1364390407 -3600 # Node ID 3a105dec912fbaf63b4827a3d08ad6b881b7598d # Parent 54f0a88e45236060951c95cb6a330d822196a3c8 Respect the PrintCodeCacheOnCompilation flag in the graal compiler diff -r 54f0a88e4523 -r 3a105dec912f src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Wed Mar 27 11:53:31 2013 +0100 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Wed Mar 27 14:20:07 2013 +0100 @@ -814,6 +814,17 @@ GraalEnv::CodeInstallResult result; CodeInstaller installer(compResultHandle, method, result, nm, installed_code_handle, triggered_deoptimizations_handle); + if (PrintCodeCacheOnCompilation) { + stringStream s; + // Dump code cache into a buffer before locking the tty, + { + MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + CodeCache::print_summary(&s, false); + } + ttyLocker ttyl; + tty->print_cr(s.as_string()); + } + if (result != GraalEnv::ok) { assert(nm == NULL, "should be"); } else {