-
Notifications
You must be signed in to change notification settings - Fork 734
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
Add NULL restricted check #18331
Add NULL restricted check #18331
Conversation
runtime/vm/ValueTypeHelpers.hpp
Outdated
goto done; | ||
} | ||
} else { | ||
/* Nullable class type or interface type */ |
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.
is the else block needed? we seem to handle the non-flattened case in the if (J9ROMFIELD_IS_NULL_RESTRICTED(result->field)) {
as well. Perhaps L
can look like what Q
used to look like since "null restricted" doesn't add any semantic differences.
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.
is the else block needed?
Yes, the else block is needed for nullable L types. The code in the else block is the same as previous L
case.
Perhaps L can look like what Q used to look like since "null restricted" doesn't add any semantic differences.
The code of L
in the null restricted case is the same as what Q
used to be.
For the nullable case, the L
code is doing VM_ValueTypeHelpers::acmp()
that contains an additional J9_IS_J9CLASS_VALUETYPE(lhsClass) && (rhsClass == lhsClass)
comparison before isSubstitutable()
, while the previous Q
case is directly callingisSubstitutable()
. I guess they are different.
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.
Yes, a NULL check would be needed to collapse those statements.
runtime/vm/ValueTypeHelpers.hpp
Outdated
rc = true; | ||
} else { | ||
/* When unflattened, we get our object from the specified offset, then increment past the header to the first field. */ | ||
rc = isSubstitutable(currentThread, objectAccessBarrier, lhsFieldObject, rhsFieldObject, J9VMTHREAD_OBJECT_HEADER_SIZE(currentThread), fieldClass); |
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.
After looking at it some more, I think this needs to be VM_ValueTypeHelpers::acmp
since value classes can have super classes that aren't j.l.Object.
|
||
if (!VM_ValueTypeHelpers::acmp(currentThread, objectAccessBarrier, lhsObject, rhsObject)) { | ||
case 'L': { | ||
if (J9ROMFIELD_IS_NULL_RESTRICTED(result->field)) { |
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.
(J9_IS_FIELD_FLATTENED(fieldClass, result->field)
implies null restricted and if you replace isSubstitutable
with acmp
then you can handle both null restricted and nullabe, so the if (J9ROMFIELD_IS_NULL_RESTRICTED(result->field)) {
is not needed.
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.
Change is updated to remove the J9ROMFIELD_IS_NULL_RESTRICTED
check and handle the unflattened cases (nullable and null free) together.
Jenkins test sanity win jdk8 |
Jenkins test sanity,extended xlinuxval jdknext |
Jenkins test sanity plinuxvalst jdknext |
For the compilation error: We need to move:
Do you want to remove the assertion in |
Ah okay, the original null restricted check is better. |
Q type is going to be removed. Instead we should do null restricted modifier check. In order for existing test to work, this change does not remove q type checks from the existing code. NULL restricted check is appended to places where Q type check is done. issue eclipse-openj9#18157 Signed-off-by: Hang Shao <[email protected]>
The null restricted check is added back. |
Jenkins test sanity,extended xlinuxval jdknext |
Jenkins test sanity plinuxvalst jdknext |
Jenkins test sanity win jdk8 |
The failures in the PR build:
is not related to this change. They are caused by |
Valhalla extension doesn't have the latest API changes either.
|
Temporarily disable JEP 454 tests |
@TobiAjila Do you have more review comments ? |
No Ill merge |
Q type is going to be removed. Instead we should do null restricted modifier check.
In order for existing test to work, this change does not remove q type checks from the existing code. NULL restricted check is appended to places where Q type check is done.
issue #18157