[lworld] RFR: [DRAFT] [lworld] Test scalarization and call conventions for different value class shapes

Galder Zamarreño galder at openjdk.org
Wed Aug 20 04:13:52 UTC 2025


On Mon, 18 Aug 2025 13:48:16 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/valhalla/inlinetypes/templating/TestOne.java line 172:
>> 
>>> 170:         final List<FieldConstant> fields = fieldTypes.stream()
>>> 171:             .map(fieldType -> FieldConstant.of(fieldId.getAndIncrement(), fieldType))
>>> 172:             .toList();
>> 
>> Why do you need the constants associated with the fields here?
>
> And what is the id good for?

`FieldConstant` is just quick way that I used to model what I couldn't model with `dataNames` in order to construct a `Box` type with 2 boolean fields.

The constants are leftover from a previous approach where I was trying to use them to both initialise a field with it, and then use it as the expected result verify that the test result was the constant that I had assigned in the field. Later on I found there are other ways to compute the expected result in ways that I don't have to track the value around, e.g. setting it to a static gold value or similar.

The id was just a way to number the fields that I added before I recognised I could use the `$` sign. I'm not sure if I still need it even though I'm not using dataNames for multi-field box types but I'll double check.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1522#discussion_r2286931753


More information about the valhalla-dev mailing list