[code-reflection] RFR: Super expressions [v2]

Paul Sandoz psandoz at openjdk.org
Fri Sep 6 17:13:15 UTC 2024


On Fri, 6 Sep 2024 07:52:29 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Paul Sandoz has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove comment.
>
> src/java.base/share/classes/java/lang/reflect/code/op/CoreOp.java line 3721:
> 
>> 3719:      * @return the invoke operation
>> 3720:      */
>> 3721:     public static InvokeOp.InvokeSuperOp invokeSuper(TypeElement returnType, MethodRef invokeDescriptor, List<Value> args) {
> 
> The split here hits hard - as you need M * K overloads (in the general case) where M is the number of overloads per kind, and K is the number of kinds we end up supporting.

Indeed. Varargs support will also increase the complexity and might motivate a change in the splitting/lumping.

For the majority of the cases so far it just so happens we don't need the kind of invocation and it all works out and one does not need to think too much about it, similar to how `Class::getMethod/getDeclaredMethod` works out. I think it is because of the language rules regarding methods declarations, and all declared methods in a class file are required to have unique name + descriptor regardless of their access flags and attributes ([jvms-4.6](https://docs.oracle.com/javase/specs/jvms/se22/html/jvms-4.html#jvms-4.6))

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

PR Review Comment: https://git.openjdk.org/babylon/pull/221#discussion_r1747461051


More information about the babylon-dev mailing list