RFR: 8347997: assert(false) failed: EA: missing memory path
Vladimir Kozlov
kvn at openjdk.org
Fri Jan 24 18:02:15 UTC 2025
On Fri, 24 Jan 2025 07:39:48 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> C2's Escape Analysis does not recognize pattern where one input of memory `Phi` node is `MergeMem` node and an other is RAW store. This pattern is created by Continuation pinning intrinsic. As result EA complains about strange memory graph.
>>
>> I suggest to add second `MergeMem` between Store and Phi nodes by calling `reset_memory()`. EA recognize such patter and removes allocations.
>>
>> I checked generated assembler pinning code and it is the same as before. The only difference in the test is eliminated allocations.
>>
>> I moved Uncommon code up to avoid resetting memory - it is already done at the beginning of this intrinsic code.
>>
>> We should not use `uncommon_trap_exact()` for `Deoptimization::Action_none` - It is used for other actions to prevent changing them to `Action_none`.
>>
>> Tested tier1-5, hs-xcomp, hs-comp-stress
>> Added new regression test based on reproducer from bug report.
>
> If you want, the reproducer can be simplified to just invoke pin/unpin, avoids needing the method handle code to invoke them reflectively, e.g.
>
>
> import jdk.internal.vm.Continuation;
>
> static class FailsEA {
> final Object o;
>
> public FailsEA() throws Throwable {
> o = new Object();
> Continuation.pin();
> Continuation.unpin();
> }
> }
>
> static class Crashes {
> final Object o;
>
> public Crashes() throws Throwable {
> Continuation.pin();
> Continuation.unpin();
> o = new Object();
> }
> }
>
>
> If you add `@modules java.base/jdk.internal.vm` to the test description then jtreg will compile and run the test with this package exported, no need be open the package with the `@run` tag.
Thank you @AlanBateman for suggestions about the test. I implemented them and verified that the test still catches the failure without fix.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23284#issuecomment-2613094931
More information about the hotspot-compiler-dev
mailing list