-
Notifications
You must be signed in to change notification settings - Fork 738
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
New NullRestricted Attribute in Project Valhalla #17340
Comments
OpenJ9 is already doing this for Q types. |
FYI @theresa-m |
@hangshao0 can you point me to where this is happening in the code? |
The question is regarding #17340 (comment), i.e. where Q type is initialized to the default instance ? |
yes. |
The default instance of a value type is allocated here: openj9/runtime/vm/ClassInitialization.cpp Lines 521 to 535 in 5567b8c
The Q type instance fields are set here: openj9/runtime/gc_modron_startup/mgcalloc.cpp Line 518 in 5567b8c
openj9/runtime/vm/ValueTypeHelpers.cpp Lines 78 to 96 in 5567b8c
|
The remaining tasks for this issue are:
Remaining tasks:
|
@hangshao0 are there any other class verification checks you think should be added for NullRestricted? See the previous comment for all prs that are open against this issue. |
I haven't reviewed #18030 yet. But notice the following in the spec: Section 5.3.5. Section 5.4.2 Section 6.5 |
Thanks, #18030 should cover the first two but I didn't notice there was a specific error to be thrown. I'll update that. |
What about this one? Section 6.5.
|
We are already doing that. See We need to change But I guess making the above changes now will break some tests, as javac is not updated to generate null restricted attribute yet in the default branch of Valhalla repo. |
issue eclipse-openj9#17340 Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
This applies to `putfield`, `putstatic`, and `withfield`. Related: eclipse-openj9#17340 Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
This change is needed to support @ImplicitlyConstructible and @NullRestricted annotations for functional tests. See eclipse-openj9#19459 In this change: - J9ROMCLASS_IS_VALUE macro checks for ACC_IDENTITY flag instead of ACC_VALUE - Remove J9AccValueType from codebase There is more work to be done to fully remove ACC_VALUE (eclipse-openj9#18829) such as removing CFR_ACC_VALUE and adding runtime class file verification checks. Because functional value type tests are not able to run currently due to a recent update of the extensions repository I am making just a few changes toward getting those working. I am also removing the assert in JVM_IsNullRestrictedArray which is triggered when building OpenJ9. This method can't be implemented right now because OpenJ9 doesn't have support for null restricted arrays yet. See eclipse-openj9#17340
This change is needed to support @ImplicitlyConstructible and @NullRestricted annotations for functional tests. See eclipse-openj9#19459 In this change: - J9ROMCLASS_IS_VALUE macro checks for ACC_IDENTITY flag instead of ACC_VALUE - Remove J9AccValueType from codebase There is more work to be done to fully remove ACC_VALUE (eclipse-openj9#18829) such as removing CFR_ACC_VALUE and adding runtime class file verification checks. Because functional value type tests are not able to run currently due to a recent update of the extensions repository I am making just a few changes toward getting those working. I am also removing the assert in JVM_IsNullRestrictedArray which is triggered when building OpenJ9. This method can't be implemented right now because OpenJ9 doesn't have support for null restricted arrays yet. See eclipse-openj9#17340 eclipse-openj9#19460
This change is needed to support @ImplicitlyConstructible and @NullRestricted annotations for functional tests. See eclipse-openj9#19459 In this change: - J9ROMCLASS_IS_VALUE macro checks for ACC_IDENTITY flag instead of ACC_VALUE - Remove J9AccValueType from codebase There is more work to be done to fully remove ACC_VALUE (eclipse-openj9#18829) such as removing CFR_ACC_VALUE and adding runtime class file verification checks. Because functional value type tests are not able to run currently due to a recent update of the extensions repository I am making just a few changes toward getting those working. I am also removing the assert in JVM_IsNullRestrictedArray which is triggered when building OpenJ9. This method can't be implemented right now because OpenJ9 doesn't have support for null restricted arrays yet. See eclipse-openj9#17340 eclipse-openj9#19460
This change is needed to support @ImplicitlyConstructible and @NullRestricted annotations for functional tests. See eclipse-openj9#19459 In this change: - J9ROMCLASS_IS_VALUE macro checks for ACC_IDENTITY flag instead of ACC_VALUE - Remove J9AccValueType from codebase There is more work to be done to fully remove ACC_VALUE (eclipse-openj9#18829) such as removing CFR_ACC_VALUE and adding runtime class file verification checks. Because functional value type tests are not able to run currently due to a recent update of the extensions repository I am making just a few changes toward getting those working. I am also removing the assert in JVM_IsNullRestrictedArray which is triggered when building OpenJ9. This method can't be implemented right now because OpenJ9 doesn't have support for null restricted arrays yet. See eclipse-openj9#17340 eclipse-openj9#19460
This change is needed to support @ImplicitlyConstructible and @NullRestricted annotations for functional tests. See eclipse-openj9#19459 In this change: - J9ROMCLASS_IS_VALUE macro checks for ACC_IDENTITY flag instead of ACC_VALUE - Remove J9AccValueType from codebase There is more work to be done to fully remove ACC_VALUE (eclipse-openj9#18829) such as removing CFR_ACC_VALUE and adding runtime class file verification checks. Because functional value type tests are not able to run currently due to a recent update of the extensions repository I am making just a few changes toward getting those working. I am also removing the assert in JVM_IsNullRestrictedArray which is triggered when building OpenJ9. This method can't be implemented right now because OpenJ9 doesn't have support for null restricted arrays yet. See eclipse-openj9#17340 eclipse-openj9#19460
This change is needed to support @ImplicitlyConstructible and @NullRestricted annotations for functional tests. See eclipse-openj9#19459 In this change: - J9ROMCLASS_IS_VALUE macro checks for ACC_IDENTITY flag instead of ACC_VALUE - Remove J9AccValueType from codebase There is more work to be done to fully remove ACC_VALUE (eclipse-openj9#18829) such as removing CFR_ACC_VALUE and adding runtime class file verification checks. Because functional value type tests are not able to run currently due to a recent update of the extensions repository I am making just a few changes toward getting those working. I am also removing the assert in JVM_IsNullRestrictedArray which is triggered when building OpenJ9. This method can't be implemented right now because OpenJ9 doesn't have support for null restricted arrays yet. See eclipse-openj9#17340 eclipse-openj9#19460
In the last spec: https://cr.openjdk.org/~dlsmith/jep401/jep401-20230428/specs/flattened-heap-jvms.html, a NullRestricted attribute is introduced.
It indicates that the field cannot be null.
putfield
andputstatic
will throw NPE if there is an attempt to assigned null to such fields. The null restricted field needs to be initialized to the default instance.The text was updated successfully, but these errors were encountered: