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

Roman Kennke rkennke at redhat.com
Thu Oct 11 17:31:32 UTC 2018


A little background: every now and then we found that something that we
did to our C2 barriers would *silently* break compilation, sometimes
only of a few methods, which then led to the affected methods only being
compiled with C1 or not at all. The only way to find this was to watch
very closely at benchmarks or -XX:+PrintCompilation output. This change
makes regression testing this sort of bug much easier.

Roman

> 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/c6643e38/signature.asc>


More information about the hotspot-compiler-dev mailing list