RFR: 8336042: Caller/callee param size mismatch in deoptimization causes crash [v2]
Vladimir Ivanov
vlivanov at openjdk.org
Fri Feb 14 19:30:18 UTC 2025
On Thu, 13 Feb 2025 21:23:55 GMT, Dean Long <dlong at openjdk.org> wrote:
>> As far as I can tell, it was never needed. If an invokedynamic or invokehandle adds an appendix, then it will show up in the callee, and will be reflected in the caller args size, so there is no mismatch. As far as the JVM is concerned, an invokedynamic/invokehandle looks like a call to a JVM-generated adapter. The only way for invokedynamic/invokehandle to cause an argument mismatch is if the JVM resolved the call-site to an adapter that was actually a MethodHandle linker. That is the exception I describe in the comment below. If we ever allowed the JVM to do that, then several other checks would also need to be fixed.
>> For the record, this code used to call cur.is_method_handle_invoke(), which was also wrong, but at least it had a name closer to what we would want. Ideally, something like is_method_handle_linker_invoke() that checks for linkToVirtual, linkToStatic, linkToSpecial, and linkToInterface would have been better.
>> The old comment about "arbitrary chains of calls" seems to be left over from an early JSR292 feature known as Ricochet Frames.
>
> For the curious, it is still possible create an arbitrarily long chain of linkTo calls, but only trusted code would be able to do that, so I'm not addressing this issue in this PR.
Thanks for the clarifications!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23557#discussion_r1956626058
More information about the hotspot-dev
mailing list