-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8329998: Remove double initialization for parts of small TypeArrays in ZObjArrayAllocator #18721
Conversation
…n ZObjArrayAllocator
👋 Welcome back aboldtch! A progress list of the required criteria for merging this PR into |
@xmas92 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
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.
Looks good. One suggestion.
// initialize_memory can only fill word aligned memory, | ||
// fill the first 4 bytes here. | ||
assert(process_start_offset_in_bytes - base_offset_in_bytes == 4, "Must be 4-byte aligned"); | ||
assert(!is_reference_type(element_type), "Only TypeArrays can be 4-byte aligned"); |
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.
Actually, only the type arrays whose element type is not double word can be 4-byte aligned. So this assertion could be !is_reference_type(element_type) && !is_double_word_type(element_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.
I think the point is that when it is not a reference type, it is OK to initialize with a plain 0
.
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.
May be better to treat the assertion as a more detailed guard or check. But I'm also OK with the current code.
Thanks for the reviews. Reran testing after merge. |
Going to push as commit 96c5c3f.
Your commit was automatically rebased without conflicts. |
JDK-8139457 introduced non-word aligned payloads for TypeArrays. This required adaptation in
ZObjArrayAllocator
segmented array allocator. But the implementation does this adaptation even when the size is small enough and dispatches the allocation toObjArrayAllocator
, which already handles clearing this memory.Instead move the initialization of any unaligned payload start to after the segmented allocation decision.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18721/head:pull/18721
$ git checkout pull/18721
Update a local copy of the PR:
$ git checkout pull/18721
$ git pull https://git.openjdk.org/jdk.git pull/18721/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18721
View PR using the GUI difftool:
$ git pr show -t 18721
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18721.diff
Webrev
Link to Webrev Comment