[code-reflection] RFR: Build extern type element tree [v2]

Paul Sandoz psandoz at openjdk.org
Fri May 2 21:16:56 UTC 2025


On Fri, 2 May 2025 21:12:45 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> The model that builds the model now explicitly builds the externalized type element tree rather than parsing it from the string form. Externalized type element instances are reused.
>
> Paul Sandoz has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove unused import

src/jdk.incubator.code/share/classes/jdk/incubator/code/TypeElement.java line 113:

> 111:                                                  ExternalizedTypeElement a3, ExternalizedTypeElement a4) {
> 112:             return new ExternalizedTypeElement(s, List.of(a1, a2, a3, a4));
> 113:         }

It's possible we don't need these methods. They were included so that it was more efficient to encode ex type elem construction in the class file. Since instances used more than once are shared the small incremental cost of using the list accepting method is likely a good tradeoff.

(General idea - we should annotate methods that are referenced by the compiler and runtime and used for generating and producing code models, such that we know it will cause issues if we remove or refactor them.)

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

PR Review Comment: https://git.openjdk.org/babylon/pull/419#discussion_r2072155374


More information about the babylon-dev mailing list