-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw ArrayStoreException if null is stored in non-nullable array
Attempting to store a null reference to a non-nullable array is expected to throw an ArrayStoreException. Previously that was expected to result in a NullPointerException. This modifies Tree Lowering optimization's transformation of calls to <nonNullableArrayNullStoreCheckhelper> to use ZEROCHK to call jitArrayStoreException if the value to be stored is null and the array is non-nullable. Further, if Value Propagation determines at compile-time that an array is non-nullable, it used to generate a NULLCHK for the value. With this change, it will generate a ZEROCHK that tests whether the value is a null reference. Finally, this change renames the utility method TR_J9VMBase::checkArrayCompClassPrimitiveValueType to TR_J9VMBase::testIsArrayClassNullRestrictedType, to reflect more recent terminology. It also removes the argument that expected an "if" OpCode and will instead generate IL that yields a zero or non-zero result to indicate whether the array is null-restricted, leaving it to the caller to decide whether to generate IL that will branch or perform some other action based on the result. Signed-off-by: Henry Zongaro <[email protected]>
- Loading branch information
Showing
4 changed files
with
65 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters