RFR: 8367531: Template Framework: use scopes and tokens instead of misbehaving immediate-return-queries [v11]

Emanuel Peter epeter at openjdk.org
Wed Nov 5 12:38:18 UTC 2025


On Wed, 5 Nov 2025 09:43:40 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   small adjustments after call with Roberto and Christian
>
> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 764:
> 
>> 762:             addDataName($("f1"), mySimpleInt, MUTABLE, 1),
>> 763:             addDataName($("f2"), mySimpleInt, MUTABLE, 1),
>> 764:             addDataName($("f3"), mySimpleInt, MUTABLE), // omit weight, default is 1.
> 
> It seems implicitly obvious but maybe we can add here that data names will only be available after adding them:
> 
> Suggestion:
> 
> // Also note that DataNames are only available once they are defined:
> 
> // Nothing defined, yet: dataNames() = {}
> addDataName($("f1"), mySimpleInt, MUTABLE, 1),
> // Only now dataNames() contains f1: dataNames() = {f1}
> addDataName($("f2"), mySimpleInt, MUTABLE, 1),
> // dataNames() = {f1, f2}
> addDataName($("f3"), mySimpleInt, MUTABLE), // omit weight, default is 1.
> // dataNames() = {f1, f2, f3}

Good idea. I have lots of those examples in `TestTemplates.java`, but we should also mention it here :)

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

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


More information about the hotspot-compiler-dev mailing list