Fix reference array element alignment test for stable arrays - #15512
Conversation
There was a problem hiding this comment.
Code changes LGTM with one mild suggestion.
Another suggestion about the message:
take compressed references in account when checking if array element is null
For most types, the alignment check is there just to make sure that we're looking at exactly one array element when we try to determine whether the value is zero, but as I mentioned in my other comment, a misaligned reference load isn't even safe to perform at all. So I think it would make more sense to characterize this in the description/commit message as a fix for the reference array element alignment test. It does also ensure that we're looking at exactly one array element for the purpose of checking for a null though, so I'll leave it to you how best to describe it
edited to add: IMO it would be good at least to spell out the problem that this fixes (which I assume is the following): we would spuriously fail to fold loads of reference array elements at odd positions when compressed references were enabled because the alignment test looked for 8-byte alignment even though only 4-byte alignment is really required
- we would spuriously fail to fold loads of reference array elements at odd positions when compressed references were enabled because the alignment test looked for 8-byte alignment even though only 4-byte alignment is really required
995be92 to
75dbc84
Compare
|
Jenkins test sanity all jdk17 |
|
@vijaysun-omr, has your question been adequately addressed? And if so, do you have anything further, or does the change look OK to you? (subject to the PR testing, of course) |
|
Yes, thanks, I have approved the change now. |
elements at odd positions when compressed references were enabled
because the alignment test looked for 8-byte alignment even though
only 4-byte alignment is really required