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:54:43 UTC 2025


On Thu, 6 Nov 2025 08:49:32 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/Renderer.java line 246:
> 
>> 244: 
>> 245:     private void renderScopeToken(ScopeToken st, Runnable preamble) {
>> 246:         if (!(st instanceof ScopeTokenImpl sti)) {
> 
> Wasn't aware of that but seems quite convenient: The IDE suggests to use a record pattern:
> 
> 
> if (!(st instanceof ScopeTokenImpl(List<Token> tokens, boolean nestedNamesAreLocal,
>                                    boolean nestedHashtagsAreLocal, boolean nestedSetFuelCostAreLocal
> ))) {
> 
> Then you can directly access the fields below:
> 
> sti.nestedNamesAreLocal() -> nestedNamesAreLocal
> 
> etc.

Nice idea :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27255#discussion_r2498841860


More information about the hotspot-compiler-dev mailing list