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

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Mar 1 12:43:58 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

Overall, this is a very nice cleanup and reuse of existing abstractions in j.l.Constant

test/langtools/tools/javac/reflect/BoxingConversionTest.java line 132:

> 130:     @IR("""
> 131:             func @"test7" (%0 : BoxingConversionTest)void -> {
> 132:                 %1 : BoxingConversionTest$Box = new @"func<BoxingConversionTest$Box>";

Question: how fundamental it is that function types should be spelled with `<>` ? After all, function type is a "core type", so perhaps we can afford some special syntactic support. For dialects and user-defined types, I understand that it might be harder to support ad-hoc syntax.

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

Marked as reviewed by mcimadamore (Reviewer).

PR Review: https://git.openjdk.org/babylon/pull/31#pullrequestreview-1911036857
PR Review Comment: https://git.openjdk.org/babylon/pull/31#discussion_r1508929426


More information about the babylon-dev mailing list