src/hotspot/share/compiler/compileBroker.cpp
changeset 52605 b8c88c64abf0
parent 52369 52f892f43a05
child 52934 8deeb7bba516
--- a/src/hotspot/share/compiler/compileBroker.cpp	Tue Nov 13 09:59:50 2018 +0100
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Mon Nov 19 11:51:27 2018 +0100
@@ -1946,7 +1946,8 @@
   }
 }
 
-void CompileBroker::post_compile(CompilerThread* thread, CompileTask* task, bool success, ciEnv* ci_env) {
+void CompileBroker::post_compile(CompilerThread* thread, CompileTask* task, bool success, ciEnv* ci_env,
+                                 int compilable, const char* failure_reason) {
   if (success) {
     task->mark_success();
     if (ci_env != NULL) {
@@ -1958,6 +1959,13 @@
         _compilation_log->log_nmethod(thread, code);
       }
     }
+  } else if (AbortVMOnCompilationFailure) {
+    if (compilable == ciEnv::MethodCompilable_not_at_tier) {
+      fatal("Not compilable at tier %d: %s", task->comp_level(), failure_reason);
+    }
+    if (compilable == ciEnv::MethodCompilable_never) {
+      fatal("Never compilable: %s", failure_reason);
+    }
   }
   // simulate crash during compilation
   assert(task->compile_id() != CICrashAt, "just as planned");
@@ -2068,7 +2076,7 @@
           compilable = ciEnv::MethodCompilable_not_at_tier;
         }
     }
-    post_compile(thread, task, task->code() != NULL, NULL);
+    post_compile(thread, task, task->code() != NULL, NULL, compilable, failure_reason);
     if (event.should_commit()) {
       post_compilation_event(&event, task);
     }
@@ -2128,7 +2136,7 @@
       ci_env.report_failure(failure_reason);
     }
 
-    post_compile(thread, task, !ci_env.failing(), &ci_env);
+    post_compile(thread, task, !ci_env.failing(), &ci_env, compilable, failure_reason);
     if (event.should_commit()) {
       post_compilation_event(&event, task);
     }