[jdk17] RFR: 8269285: Crash/miscompile in CallGenerator::for_method_handle_inline after JDK-8191998 [v2]

Aleksey Shipilev shade at openjdk.java.net
Wed Jun 30 13:33:01 UTC 2021


On Wed, 30 Jun 2021 12:24:20 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> I am not convinced it is safe. At least it does not look safe for JDK 17. The "must" in the comment block above makes me wary about skipping the casting for interfaces...
>> 
>> 
>>         // In lambda forms we erase signature types to avoid resolving issues
>>         // involving class loaders.  When we optimize a method handle invoke
>>         // to a direct call we must cast the receiver and arguments to its
>>         // actual types.
>
> Not sure what safety concerns you have in mind w.r.t interfaces. On bytecode level interface treatment is lax (e.g., verifier ignores interface type info; see JVMS-4.10.1.2 for details).

I am mostly concerned about pushing a "less than obvious and wider than definitely required" fix to JDK 17. Filtering out by "empty join type" is quite probably too wide. Filtering out the interface arguments is much less obvious. Yes, I get that interface arguments in signatures might be filtered wholesale, but I would rather wait for more testing to see if that actually works.

-------------

PR: https://git.openjdk.java.net/jdk17/pull/169


More information about the hotspot-compiler-dev mailing list