RFR: 8346836: C2: Verify CastII/CastLL bounds at runtime [v7]

Quan Anh Mai qamai at openjdk.org
Wed Apr 9 18:11:10 UTC 2025


On Tue, 8 Apr 2025 21:27:33 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> I believe C2 stacks are 16-byte aligned so we should not need to manually do the alignment?
>
> Indeed. Still puzzled why stack traces are omitted. Do you have a reproducer to try?

You can just run `compiler/arraycopy/TestArrayCopyConjoint.java` with `-XX:+StressGCM -XX:VerifyConstraintCasts=2`.

>> Thanks for the suggestions, I have changed this to `verify_int_in_range`. Expanding the `Type` before passing into the function would be really bad after #17508, though.
>
>> Expanding the Type before passing into the function would be really bad after https://github.com/openjdk/jdk/pull/17508, though.
> 
> Can you elaborate, please? Are you saying that after #17508 there'll be more invariants to verify, so better to pass all the data encapsulated in a `Type`?

Yes that's what I mean, expanding all of them to feed into this method seems inelegant.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22880#discussion_r2035872375
PR Review Comment: https://git.openjdk.org/jdk/pull/22880#discussion_r2035873092


More information about the hotspot-compiler-dev mailing list