[code-reflection] RFR: Support storing the code that builds the code model [v4]

Mourad Abbay mabbay at openjdk.org
Mon Feb 10 20:36:20 UTC 2025


On Mon, 10 Feb 2025 20:14:41 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> In this PR we allow the user to decide how to store the code model. The first option is `TEXT`, if this is selected, we store the textual representation of the code model. The second option is `CODE_BUILDR`, if this is selected, we store the code that builds the code model. All work done here is around the second option, because the first option is already supported.
>
> Mourad Abbay has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Add a program to test storing code that builds code model
>  - Add JavaType -> Type mapping for Block.Parameter

To test this you can compile the program `TestStoringCodeModelBuilder.java` with the following configuration:

- Program: `com.sun.tools.javac.Main`

- Arguments: `-XDdumpIR -XDcodeModelStorageOption=CODE_BUILDER src/jdk.incubator.code/share/classes/jdk/incubator/code/internal/TestStoringCodeModelBuilder.java`

The compilation will fail with the error: `no enclosing instance of type TypeElementFactory is in scope`

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

PR Comment: https://git.openjdk.org/babylon/pull/305#issuecomment-2649173489


More information about the babylon-dev mailing list