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:18:06 UTC 2025
    
    
  
On Tue, 14 Oct 2025 15:02:10 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
>
> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 423:
> 
>> 421:             """
>> 422:             static int v3d_#{x} = #a + #b;
>> 423:             """
> 
> I do not understand how `a` escapes the let without a `transparentScope()` like for `b`. Also the paragraph above does not really explain what the trick is that lets us simulate a lambda-less `let`.
I added this to the comment:
+  419             //
+  420             // Below we see the standard use of "let", where we add a hashtag replacement for "a"
+  421             // for the rest of the enclosing scope. We then also use a lambda version of "let"
+  422             // with a transparent scope, which means that "b" escapes that scope and is also
+  423             // available in the enclosing scope. In the implementation of the framework, we
+  424             // actually use a "transparentScope", so the standard "let" is really just syntactic
+  425             // sugar for the lambda "let" with "transparentScope". 
Does that help?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27255#discussion_r2429743530
    
    
More information about the hotspot-compiler-dev
mailing list