RFR: 8358772: Template-Framework Library: Primitive Types [v3]
Christian Hagedorn
chagedorn at openjdk.org
Thu Jun 12 11:33:29 UTC 2025
On Thu, 12 Jun 2025 11:23:54 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> I would like to add primitive type support to the template framework library.
>>
>> In follow-up work, we will use these types in random expression generation - but they can also already be useful on their own now.
>>
>> I encountered an issue with some methods that return `Token` from the `TemplateFramework`, such as `Hook.insert` and `addDataName`. Since `Token` was package private, this class could not be used in some places where automatic type inference is required. I now refactored the code, so that the `Token` is just an empty interface, and all the methods are moved to a separate class `TokenParser`.
>>
>> Original experiments from here: https://github.com/openjdk/jdk/pull/23418
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>
> review suggestions applied
Marked as reviewed by chagedorn (Reviewer).
test/hotspot/jtreg/compiler/lib/template_framework/library/CodeGenerationDataNameType.java line 106:
> 104: * List of all {@link PrimitiveType}s.
> 105: */
> 106: static final List<PrimitiveType> PRIMITIVE_TYPES = List.of(
`static final` can also be removed for constants :-) Otherwise, looks good, thanks for the update!
-------------
PR Review: https://git.openjdk.org/jdk/pull/25672#pullrequestreview-2920689284
PR Review Comment: https://git.openjdk.org/jdk/pull/25672#discussion_r2142444561
More information about the hotspot-compiler-dev
mailing list