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

Manuel Hässig mhaessig at openjdk.org
Fri May 23 10:46:07 UTC 2025


On Fri, 23 May 2025 09:41:00 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/lib/template_framework/Template.java line 770:
>> 
>>> 768:         }
>>> 769:         boolean mutable = mutability == DataName.Mutability.MUTABLE;
>>> 770:         return new AddNameToken(new DataName(name, type, mutable, weight));
>> 
>> "Input vaildation" for mutablity happens here for mutability, but inside the constructor for weight. Should both happen in the same place?
>
> `mutability` only applies to `DataName`. `weight` applies also to `StructuralName`, so I put it in the shared code. I'd rather avoid duplicating that code.

It is duplicated in the constructors of `DataName` and `StructuralName` respectively. If those checks are moved to `Name`, I do understand the separation.

>> test/hotspot/jtreg/testlibrary_tests/template_framework/examples/TestTutorial.java line 332:
>> 
>>> 330:             // The Hook is set for the Tokens inside the set braces.
>>> 331:             // As long as the hook is anchored, we can insert code into the hook,
>>> 332:             // here we can define static fields for example.
>> 
>> Perhaps this comment should mention that the code is inserted at the point where `myHook.anchor` is located.
>
> I though that's what I said 😅 
> I reformulated it, and hope it is clearer now.
> 
> ![image](https://github.com/user-attachments/assets/fb51a98d-d0c6-44ae-a414-557c38ff9639)

That is as clear as can be. Thank you

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

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


More information about the hotspot-compiler-dev mailing list