ConstantDynamic in unvisited catch causes 74X slowdown

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Jan 25 21:26:06 UTC 2022


Initial JIT-compiler support of ConstantDynamic CP entries doesn't cover 
unresolved ConstantDynamic case. It leads to compilation bailouts both 
in C1 and C2 when an unresolved ConstantDynamic entry is encountered.

There's a bug filed for it:
   https://bugs.openjdk.java.net/browse/JDK-8280473

Surprisingly, I spotted it shortly before your report and working on a fix.

Best regards,
Vladimir Ivanov

On 25.01.2022 23:04, Eirik Bjørsnøs wrote:
>>
>> What is going on here?
>>
> 
> -XX:+PrintCompilation revealed the following:
> 
>      867  563 % !   4
> com.eirbjo.cpc.ConstantDynamicCliff$TheCliff::climb @ 31 (66 bytes)
>      868  563 % !   4
> com.eirbjo.cpc.ConstantDynamicCliff$TheCliff::climb @ 31 (66 bytes)
> COMPILE SKIPPED: cannot parse method (retry at different tier)
>      869  564 % !   1
> com.eirbjo.cpc.ConstantDynamicCliff$TheCliff::climb @ 31 (66 bytes)
> compilation bailout: could not resolve a constant
>      870  564 % !   1
> com.eirbjo.cpc.ConstantDynamicCliff$TheCliff::climb @ 31 (66 bytes)
> COMPILE SKIPPED: could not resolve a constant (retry at different tier)
> 
> Which leads me to
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/c1/c1_GraphBuilder.cpp#L919
> 
>    if (con.basic_type() == T_ILLEGAL) {
>      // FIXME: an unresolved Dynamic constant can get here,
>      // and that should not terminate the whole compilation.
>      BAILOUT("could not resolve a constant");
>    }
> 
> Eirik.
> 


More information about the hotspot-compiler-dev mailing list