-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not trust nullable arrayclass type in VP #20420
Do not trust nullable arrayclass type in VP #20420
Conversation
@hzongaro May I ask you to review this change? Thank you! The detailed analysis related to this change is in #19914 (comment) |
79e5a3e
to
49082ab
Compare
Update isUnreliableSignatureType to check if the class is an array class, and if its component class is value type, and if the array class is not null-restricted array. If so, the type is not reliable because it can either be a nullable array class type or a null-restricted array type. Fixes: eclipse-openj9#19914 Signed-off-by: Annabelle Huo <[email protected]>
49082ab
to
04ce59f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
Jenkins test sanity.functional,extended.functional xlinuxval,alinuxval,zlinuxval,plinuxval jdknext |
Jenkins test sanity.functional,sanity.openjdk xlinux jdk8,jdk21 |
Test_openjdk21_j9_sanity.openjdk_x86-64_linux_Personal failed with the following 4 vector tests (#55). They also fail in other PR tests: #52 #54 #53 The nightly build hasn't completed yet but I can see it shows jdk_vector_long128_j9_0 fails in nightly build, which seems similar to these failures.
|
Value types testing was successful. Failures in non-value types testing were due to known problems. Merging. |
I don't think arrays of value types really need to be treated as unreliable like interfaces are
This should be fine because the null-restricted array type is a subtype of the regular/unrestricted array type (#20305), so in particular null-restricted arrays are also instances of the unrestricted array type (just not exactly that type), which is the one named in the signature AFAICT the real problem in #19914 (comment) is the "fixed class" here:
VP sees that the component type is final, and so it creates a fixed-type constraint for the array. This is correct when the component type is not a value type (so until recently it was always correct). But now with value types having these two different array types, when the component type is a value type and the innermost array type is unrestricted, that array type now has a (strict) subtype even though its component type is final. So I'm pretty sure that VP can still use the type bound, but it just needs to detect that situation and avoid concluding that the type is fixed |
@jdmpapin Thank you very much for finding this issue! I'll take a look at an appropriate fix |
Update isUnreliableSignatureType to check if the class is an array class. If the class is an array class and its component class is value type and the array class is not null-restricted array, the type is not reliable because it can either be a nullable array class type or a null-restricted array type.
Fixes: #19914