RFR: 8367531: Template Framework: use scopes and tokens instead of misbehaving immediate-return-queries [v14]
Emanuel Peter
epeter at openjdk.org
Thu Nov 6 12:59:29 UTC 2025
On Thu, 6 Nov 2025 09:14:30 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - for Christian
>> - Apply suggestions from code review
>>
>> Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>
> test/hotspot/jtreg/compiler/lib/template_framework/ScopeTokenImpl.java line 34:
>
>> 32: *
>> 33: * Note: we want the tokens to be package private, so we create this Impl
>> 34: * record.
>
> Can you extend this comment why it matters? Is it that users just don't need to know/worry about this or is it to actually avoid that someone is trying to write code that relies on this class and possibly prevent future internal changes?
sure, writing this instead:
~ 33 * Note: We want the {@link ScopeToken} to be public, but the internals of the
~ 34 * record should be private. One way too solve this is with a public interface
+ 35 * that exposes nothing but its name, and a private implementation via a
+ 36 * record that allows easy destructuring with pattern matching.
> test/hotspot/jtreg/compiler/lib/template_framework/ScopeTokenImpl.java line 39:
>
>> 37: boolean nestedNamesAreLocal,
>> 38: boolean nestedHashtagsAreLocal,
>> 39: boolean nestedSetFuelCostAreLocal) implements ScopeToken, Token {}
>
> Could be confusing what "local" means. Does it mean local to the scope or local to the nested scope? IIUC, it means to the nested scope. Maybe "nestedXAreTransparent" (or "nestedXAreNonTransparent" ) is clearer and adheres to the scope transparency definitions. What do you think?
What about `isTransparentForNames`, etc?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27255#discussion_r2498857830
PR Review Comment: https://git.openjdk.org/jdk/pull/27255#discussion_r2498866582
More information about the hotspot-compiler-dev
mailing list