RFR: 8359412: Template-Framework Library: Operations and Expressions [v6]
Emanuel Peter
epeter at openjdk.org
Mon Oct 13 08:43:08 UTC 2025
On Mon, 13 Oct 2025 07:54:28 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - more comments
>> - add othervm to test
>
> test/hotspot/jtreg/compiler/lib/template_framework/library/Operations.java line 67:
>
>> 65: ops.add(Expression.make(BYTES, "(byte)(", LONGS, ")"));
>> 66: ops.add(Expression.make(BYTES, "(byte)(", FLOATS, ")"));
>> 67: ops.add(Expression.make(BYTES, "(byte)(", DOUBLES, ")"));
>
> There is a lot of repetition of this block for the various types. Could you share the code? Maybe something like this:
>
>
> ops.add(Expression.make(returnType, "(castType)(", BYTES, ")"));
> ops.add(Expression.make(returnType, "(castType)(", SHORTS, ")"));
> ops.add(Expression.make(returnType, "(castType)(", CHARS, ")"));
> ops.add(Expression.make(returnType, "(castType)(", INTS, ")"));
> ops.add(Expression.make(returnType, "(castType)(", LONGS, ")"));
> ops.add(Expression.make(returnType, "(castType)(", FLOATS, ")"));
> ops.add(Expression.make(returnType, "(castType)(", DOUBLES, ")"));
I'll look into simplifications, good idea :)
> test/hotspot/jtreg/compiler/lib/template_framework/library/Operations.java line 154:
>
>> 152: ops.add(Expression.make(BOOLEANS, "(", INTS, " < ", INTS, ")"));
>> 153: ops.add(Expression.make(BOOLEANS, "(", INTS, " >= ", INTS, ")"));
>> 154: ops.add(Expression.make(BOOLEANS, "(", INTS, " <= ", INTS, ")"));
>
> This also seems to be repeated for `LONGS` and could be shared.
I'll look into simplifications, good idea :)
> test/hotspot/jtreg/compiler/lib/template_framework/library/Operations.java line 263:
>
>> 261: ops.add(Expression.make(BOOLEANS, "(", FLOATS, " < ", FLOATS, ")"));
>> 262: ops.add(Expression.make(BOOLEANS, "(", FLOATS, " >= ", FLOATS, ")"));
>> 263: ops.add(Expression.make(BOOLEANS, "(", FLOATS, " <= ", FLOATS, ")"));
>
> Could also be shared with the double version.
I'll look into simplifications, good idea :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26885#discussion_r2425577971
PR Review Comment: https://git.openjdk.org/jdk/pull/26885#discussion_r2425578143
PR Review Comment: https://git.openjdk.org/jdk/pull/26885#discussion_r2425578255
More information about the hotspot-compiler-dev
mailing list