RFC: Diagnostic flag to crash VM on JIT compilation failure?
Vladimir Kozlov
vladimir.kozlov at oracle.com
Thu Oct 11 17:39:32 UTC 2018
Why to crush? Do you want to attach debugger?
There is CICrashAt flag you can use.
+LogCompilation should record all failure. I think +PrintCompilation should report it too.
Then you can use DumpReplayDataOnError + ReplayCompilation to debug the method you are interesting in.
Or use -XX:CompileCommand=option,method,DumpReplay to dump replay date for any compiled method and replay it later.
Thanks,
Vladimir
On 10/11/18 9:02 AM, Aleksey Shipilev wrote:
> 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
>
More information about the hotspot-compiler-dev
mailing list