-
Notifications
You must be signed in to change notification settings - Fork 722
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
Z: Zero multi array size when batch clear is disabled. #19557
Z: Zero multi array size when batch clear is disabled. #19557
Conversation
ec864bb
to
601701b
Compare
@r30shah this PR is ready for review. I confirm this fixes the issue with MultiANewArray tree. |
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.
Can you share the sequence generated now (Instruction selection log). Also I would like to understand the purpose behind setting the discontiguous size field to 0 (but not mustBeZero field), is it a bug / some clever seq?
601701b
to
ec6cc9e
Compare
We inline multi array allocation when dim 1 or 2 are zero. When allocate from zeroed memory, size field is already zero. When batch clear is disabled, we must explicitly zero the size filed. This commit add instructions to zero the size filed. Signed-off-by: Ehsan Kiani Far <ehsan.kianifar@gmail.com>
401d765
to
87aa69f
Compare
Discontiguous layout is used for all zero size arrays. In discontiguous array layout, there should always be zero on the offset that the |
87aa69f
to
06ec759
Compare
@r30shah this PR is ready for review. |
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.
LGTM
jenkins test sanity zlinux jdk11,jdk21 |
@r30shah is it okay if we merge this PR? |
jenkins test sanity zlinux jdk17 |
I will merge this once JDK17 test finishes |
We inline the multi array allocation when the size of first or second dimension is zero but the instruction don't set the zero size filed of the new object. This is not a problem when we allocate from zeroed memory but if the memory is not zeroed, it causes problems.
In this PR I add instructions to explicitly set size filed to zero.