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

Emanuel Peter epeter at openjdk.org
Tue Oct 14 16:38:35 UTC 2025


On Tue, 14 Oct 2025 15:51:07 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix TestMethodArguments.java after merge with master
>
> Thank you for your continued effort on this, @eme64! Better to do this now than later.
> 
> I have so far only looked at the tutorial, but came up with some questions. I will continue looking at the rest, later.

@mhaessig Thanks for having a first look! I addressed all your comments / questions. I hope it is a bit better now.

> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 831:
> 
>> 829:         // Define a static field.
>> 830:         // Note: it is very important that we use a "transparentScope" for the template here,
>> 831:         //       so that the DataName can escape to outer scopes.
> 
> We could also use `hashtagScope` and achieve the same thing, could we not?

Yes, we could. But that's not great style, because hashtags would be implicitly non-transparent at template boundary. But I can add such a comment.

   842         // Define a static field.
   843         // Note: it is very important that we use a "transparentScope" for the template here,
   844         //       so that the DataName can escape to outer scopes.
+  845         //       (We could also use "hashtagScope", since those are also transparent for
+  846         //        names. But it is not great style, because template boundaries are
+  847         //        non-transparent for hashtags and setFuelCost anyway. So we might as
+  848         //        well just use "transparentScope".)                                                                                                                                                          
   849         var templateStaticField = Template.make("type", (DataName.Type type) -> transparentScope(

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

PR Comment: https://git.openjdk.org/jdk/pull/27255#issuecomment-3402730165
PR Review Comment: https://git.openjdk.org/jdk/pull/27255#discussion_r2429785331


More information about the hotspot-compiler-dev mailing list