diff src/share/vm/oops/methodDataOop.cpp @ 5036:8e6db1a5c537

exit the VM when an endless recompilation is detected
author Christian Haeubl <christian.haeubl@oracle.com>
date Mon, 05 Mar 2012 12:01:38 -0800
parents 18a5539bf19b
children f3d2447db2d9
line wrap: on
line diff
--- a/src/share/vm/oops/methodDataOop.cpp	Sun Mar 04 18:56:25 2012 -0800
+++ b/src/share/vm/oops/methodDataOop.cpp	Mon Mar 05 12:01:38 2012 -0800
@@ -861,6 +861,19 @@
   return CompilationPolicy::policy()->is_mature(_method);
 }
 
+void methodDataOopDesc::inc_decompile_count() {
+  _nof_decompiles += 1;
+  if (decompile_count() > (uint)PerMethodRecompilationCutoff) {
+#ifdef GRAAL
+    // TODO (ch) enable this in the fastdebug build only once we are more stable
+    ResourceMark m;
+    tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string());
+    vm_exit(1);
+#endif
+    method()->set_not_compilable(CompLevel_full_optimization);
+  }
+}
+
 // Translate a bci to its corresponding data index (di).
 address methodDataOopDesc::bci_to_dp(int bci) {
   ResourceMark rm;