RFR: 8344942: Template-Based Testing Framework [v61]

Christian Hagedorn chagedorn at openjdk.org
Fri May 30 10:43:16 UTC 2025


On Fri, 30 May 2025 08:33:27 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge branch 'JDK-8344942-TemplateFramework-v3' of https://github.com/eme64/jdk into JDK-8344942-TemplateFramework-v3
>>  - move verification
>
> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 358:
> 
>> 356: 
>> 357:     // We saw the use of custom hooks above, but now we look at the use of CLASS_HOOK and METHOD_HOOK
>> 358:     // from the Template Library.
> 
> Can you expand here on why it's better to use them instead of creating your own? Is it just readability/convenience?

Another question which is not evidently clear by following the examples: Can and should (not) you use the same hook inside the hook itself, i.e.:

Hooks.CLASS_HOOK.anchor(
   Hooks.CLASS_HOOK.anchor(
      // ...

This is probably not done on purpose but such a situation could arise when nesting more templates and suddenly one anchors the same hook again?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24217#discussion_r2115414990


More information about the hotspot-compiler-dev mailing list