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

Vladimir Ivanov vlivanov at openjdk.java.net
Wed Jun 30 12:27:04 UTC 2021


On Wed, 30 Jun 2021 10:35:28 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/opto/callGenerator.cpp line 1165:
>> 
>>> 1163:         for (int i = 0, j = 0; i < signature->count(); i++) {
>>> 1164:           ciType* t = signature->type_at(i);
>>> 1165:           if (t->is_klass()) {
>> 
>> What I suggested is to extend the guard with `!t->as_klass()->is_interface()` check.
>
> 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).

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

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


More information about the hotspot-compiler-dev mailing list