-
Notifications
You must be signed in to change notification settings - Fork 733
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
Null-restricted checks for jitCheckCastForArrayStore #20331
base: master
Are you sure you want to change the base?
Conversation
@@ -1490,17 +1490,19 @@ old_fast_jitCheckCastForArrayStore(J9VMThread *currentThread) | |||
{ | |||
void *slowPath = NULL; | |||
OLD_JIT_HELPER_PROLOGUE(2); | |||
DECLARE_JIT_CLASS_PARM(castClass, 1); | |||
DECLARE_JIT_CLASS_PARM(castClassArray, 1); // <-- castClassArray should be the array class, not its base class |
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.
I'm wondering when VT is not enabled, it should still be checking the component class but if VT is enabled, it will check the array class. I don't have a strong preference either way. @hzongaro What do you think?
jitCheckCastForArrayStore
is currently only used at one place in EA fixupFieldAccessForNonContiguousAllocation. If checking array class here regardless of if VT is enabled or not, it will require a coordinated merge with the JIT change so that it doesn't break the functionality for non-VT build. But the change here is cleaner without having to consider if VT is enabled or not.
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.
@a7ehuo - Good catch! Escape Analysis is using the class that was specified on an anewarray
operation, so it will need to get the corresponding array class instead. And in order for EA to stack allocate non-nullable arrays, it will need to recognize calls to ValueClass.newArrayInstance(NullRestrictedCheckedType.of(myself),...)
.
I'll take a look at implementing those changes. . . .
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.
Just spotted a few things you almost certainly would have uncovered once you were able to run testing on these changes. . . .
@theresa-m, I have prototyped the changes to Escape Analysis that would be required for your changes to |
Signed-off-by: Theresa Mammarella <[email protected]>
Related to #20184 and #18157
fyi @a7ehuo this is what I was thinking for jitCheckCastForArrayStore if the jit can pass in the array class rather than the base class.