RFR: 8359335: Template-Framework Library: Primitive Types subtyping
Manuel Hässig
mhaessig at openjdk.org
Fri Jan 23 12:37:24 UTC 2026
On Wed, 21 Jan 2026 15:56:36 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:
> This PR implements the subtype relation for primitive types in the Template Framework Library according to JLS §4.10.1. Further, this PR extends the primitive type example to test the addition.
>
> Testing:
> - [x] Github Actions
> - [x] tier1, tier2
Thank you for writing this up.
> it would be nice to restrict Expression nesting to exact type matches, rather than isSubtypeOf
This breaks the assumptions of current template framework tests, but that should be easy enough to fix.
Generally, I think that we will not get around annotating float division operators with the possibility for an `ArithmeticException`. Saying that we want to nest on exact types would only push that out into the future. Also, I do not really see the problem with the extra try-catch since C2 should be able to prove it is not necessary when all involved types are floats.
Thus, my proposal is slightly different:
- Add the possibility for `Expression` to nest with exact or subtypes.
- Make the `ExpressionFuzzer` nest on exact types to preserve the current behavior and mitigate the sampling problem you laid out above.
- Keep the exception annotation on the float division operations.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29349#issuecomment-3790039695
More information about the hotspot-compiler-dev
mailing list