diff src/share/vm/graal/graalEnv.cpp @ 7089:af30115c9d0e

added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
author Doug Simon <doug.simon@oracle.com>
date Wed, 28 Nov 2012 20:39:43 +0100
parents e5ec98288b91
children eec7173947a1
line wrap: on
line diff
--- a/src/share/vm/graal/graalEnv.cpp	Wed Nov 28 19:18:39 2012 +0100
+++ b/src/share/vm/graal/graalEnv.cpp	Wed Nov 28 20:39:43 2012 +0100
@@ -428,7 +428,9 @@
 
 // ------------------------------------------------------------------
 // ciEnv::register_method
-nmethod* GraalEnv::register_method(methodHandle& method,
+GraalEnv::CodeInstallResult GraalEnv::register_method(
+                                methodHandle& method,
+                                nmethod*& nm,
                                 int entry_bci,
                                 CodeOffsets* offsets,
                                 int orig_pc_offset,
@@ -447,7 +449,7 @@
                                 Handle installed_code) {
   EXCEPTION_CONTEXT;
   NMethodSweeper::possibly_sweep();
-  nmethod* nm = NULL;
+  nm = NULL;
   int comp_level = CompLevel_simple;
   {
     // To prevent compile queue updates.
@@ -472,7 +474,7 @@
       // If the code buffer is created on each compile attempt
       // as in C2, then it must be freed.
       //code_buffer->free_blob();
-      return NULL;
+      return GraalEnv::dependencies_failed;
     }
 
     nm =  nmethod::new_nmethod(method,
@@ -555,8 +557,9 @@
   // JVMTI -- compiled method notification (must be done outside lock)
   if (nm != NULL) {
     nm->post_compiled_method_load_event();
+    return GraalEnv::ok;
   }
 
-  return nm;
+  return GraalEnv::cache_full;
 }