changeset 8526:3a105dec912f

Respect the PrintCodeCacheOnCompilation flag in the graal compiler
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 27 Mar 2013 14:20:07 +0100
parents 54f0a88e4523
children 8a526d8b4604
files src/share/vm/graal/graalCompilerToVM.cpp
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 {