> Hi, > > The reason for the failure is that, we separately compute the instance type > `type`, which is used in the assert, and the klass type `klass_type`, which > is used for the check cast, so there is a chance during the computation of > `type`, the class has only 1 single concrete subclass, and before the > computation of `klass_type`, another subtype is loaded, leading to > `klass_type` being the supertype of `type`, which triggers the assert. > Computing these 2 in the opposite order likely does not work, either, because > we can have concurrent class unloading. > > As a result, in this PR, I reworked `check_interpreter_type` to receive a > `ciType`, this also helps simplify the implementation, as previously, we > needed to obtain the null restriction and larval-ness of the value > indirectly, while they are readily available in the `ciType` obtained from > `ciTypeFlow`. Trying to keep the assert for every case is cumbersome, and > verifying the type right after the check cast seems unnecessary, so I relaxed > the assert to only verify the correct kind of value. > > Testing: > > - [ ] tier1-4,valhalla-comp-stress > > Please take a look and leave your review, thanks a lot. > > --------- > > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: missing try_improve ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/2333/files - new: https://git.openjdk.org/valhalla/pull/2333/files/2a6f233c..ba193acc Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2333&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2333&range=00-01 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/valhalla/pull/2333.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2333/head:pull/2333 PR: https://git.openjdk.org/valhalla/pull/2333
