On Tue, 30 Jun 2026 08:08:45 GMT, Quan Anh Mai <[email protected]> wrote:
> Hi, > > It turns out this issue has been fixed by @marc-chevalier. However, after > thinking about this issue, I find that the pattern we use > `cast_to_exactness(false)->as_instance_type()` to obtain the `Type` of an oop > that subtypes a klass pointer is flawed. This is because in the `Type` > lattice, `cast_to_exactness` works in the `ciType` dimension, while we also > need to handle the `_refined_type` dimension when trying to perform that > action. > > To be specific, in this issue, we have a klass pointer of unrefined arrays > that subtype `Object[]`, `cast_to_exactness` finds that this `TypeKlassPtr` > is already inexact, and return it as is. This is problematic, because there > is no instance for an unrefined array klass, and `as_instance_type` is > confused. @marc-chevalier solves the issue by walking around this issue, and > assume when the klass pointer is unrefined, we really mean obtaining the > instance that subtypes the pointer, not just those with the same type. > > This PR does not actually solve the issue, I just refactored it, so the use > sites work in a more rigourous manner, we can fix the implementation after > Valhalla being merged. > > Testing: > > - [x] tier1-4,valhalla-comp-stress > > Please take a look and leave your reviews, thanks a lot. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: 71eb7034 Author: Quan Anh Mai <[email protected]> URL: https://git.openjdk.org/valhalla/commit/71eb703426da471d2f029da835f84dad4e76ab1e Stats: 45 lines in 10 files changed: 13 ins; 1 del; 31 mod 8386160: [lworld] Post jdk-27+25 compiler/valhalla/inlinetypes/TestIntrinsics.java#id4 assertion Reviewed-by: thartmann ------------- PR: https://git.openjdk.org/valhalla/pull/2598
