[code-reflection] RFR: Dialect factory
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue Jun 17 11:14:42 UTC 2025
On Fri, 13 Jun 2025 23:51:15 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
> Group op factory and type element factory into dialect factory record.
>
> The synthetic method added by javac to build a code model now has no parameters. The dialect factory, namely that for Java ops and type elements, is accessed from within the generated method body. This simplifies the connections between compiler/runtime and code reflection (see the reduction in `CodeReflectionSymbols.java` and `InnerClassLambdaMetafactory.java`).
>
> The synthetic method's accessibility is now private, as is the synthetic method to access the quoted instance from a quotable lambda's functional interface implementation.
>
> Further alignment of the factories and their use will occur in one or more subsequent PRs.
src/jdk.incubator.code/share/classes/jdk/incubator/code/internal/ReflectMethods.java line 408:
> 406: private JCMethodDecl opMethodDecl(Name methodName, CoreOp.FuncOp op, CodeModelStorageOption codeModelStorageOption) {
> 407: // Create the method that constructs the code model stored in the class file
> 408: var mt = new MethodType(com.sun.tools.javac.util.List.nil(), crSyms.opType,
I like that the logic for entering the method symbol in the class members table is now centralized, regardless of translation strategy.
-------------
PR Review Comment: https://git.openjdk.org/babylon/pull/441#discussion_r2151993462
More information about the babylon-dev
mailing list