RFC: Diagnostic flag to crash VM on JIT compilation failure?

Aleksey Shipilev shade at redhat.com
Thu Oct 11 16:02:59 UTC 2018


In Shenandoah, we have a simple diagnostic flag that checks we are compiling the code fine with GC
barriers enabled. Is there interesting in having this flag generically? Or, maybe there is already
one, but I failed to find it?

Non-generic Shenandoah patch looks like this:

--- old/src/hotspot/share/compiler/compileBroker.cpp	2018-10-11 16:41:53.031100956 +0200
+++ new/src/hotspot/share/compiler/compileBroker.cpp	2018-10-11 16:41:52.827101162 +0200
@@ -2088,6 +2088,10 @@

     ciMethod* target = ci_env.get_method_from_handle(target_handle);

+#if INCLUDE_SHENANDOAHGC
+    bool target_compilable = target->can_be_parsed() && target->can_be_compiled();
+#endif
+
     TraceTime t1("compilation", &time);
     EventCompilation event;

@@ -2119,6 +2123,13 @@
       ci_env.report_failure(failure_reason);
     }

+#if INCLUDE_SHENANDOAHGC
+    guarantee(!UseShenandoahGC || !ShenandoahCompileCheck || !target_compilable || (compilable !=
ciEnv::MethodCompilable_not_at_tier),
+              "Not compilable on level %d due to: %s", task_level, failure_reason);
+    guarantee(!UseShenandoahGC || !ShenandoahCompileCheck || !target_compilable ||(compilable !=
ciEnv::MethodCompilable_never || !target_compilable),
+              "Never compilable due to: %s", failure_reason);
+#endif
+
     post_compile(thread, task, !ci_env.failing(), &ci_env);
     if (event.should_commit()) {
       post_compilation_event(&event, task);


Thanks,
-Aleksey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20181011/8e93df5d/signature.asc>


More information about the hotspot-compiler-dev mailing list