[code-reflection] RFR: Remove MethodTypeDesc [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Mar 1 12:38:11 UTC 2024


On Thu, 29 Feb 2024 23:13:21 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Remove `MethodTypeDesc` and replace with usages of `FunctionType`, with functionality to convert between nominal description `java.lang.constant.MethodTypeDesc` (from which it can be resolved to `java.lang.invoke.MethodType`).
>> 
>> The `new` operation now accepts a `FunctionType` as an attribute value, which is serialized as a type in the textual form rather than the prior more bespoke form.
>> 
>> The serialization of `MethodDesc` does not currently change, we will likely revisit when the `invoke` operation to include information related to the kind of invocation (beyond static and virtual).
>
> Paul Sandoz has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename

src/java.base/share/classes/java/lang/reflect/code/descriptor/MethodDesc.java line 108:

> 106:     // @@@ Where else to place them?
> 107: 
> 108:     static FunctionType ofNominalDescriptor(MethodTypeDesc d) {

These seems straightforward mapping from MTD -> FT (and back). So it feels like they should go in FunctionType.

Simiilarly, classDesc -> TE mapping (and maybe back) should be in either TypeElement or JavaType.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/31#discussion_r1508924025


More information about the babylon-dev mailing list