8293291: Simplify relocation of native pointers in archive heap
Some objects in the archive heap contain native pointers. E.g., archived java.lang.Class objects contain a pointer to its Klass*.
At runtime, if the archived metadata are mapped at an alternative address, all of the Klass* pointers must be relocated. Instead of doing this in an ad-hoc way, this PR uses a bitmap, FileMapRegion::ptrmap_view(), to track the position of all the native pointers.
This PR is done in preparation for supporting new types of archived heap objects that have native pointers. E.g., java.lang.invoke.ResolvedMethodName has a pointer to a Method*.
Notes for reviewers:
- At dump time, the native pointers are remembered in
HeapShared::mark_native_pointers(). - At runtime, the native pointers are patched in
ArchiveHeapLoader::patch_native_pointers(). - The ad-hoc relocation code has been removed from javaClasses.cpp and systemDictionaryShared.cpp
- Many of the changes are for renaming from "oopmaps" to "bitmaps": the old code handled only a single type of pointers (oop references). The new code handles two types of bitmaps ("oopmap" is for oop references, "ptrmap" is for native pointers).
Progress
- [x] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
Issue
- JDK-8293291: Simplify relocation of native pointers in archive heap
Reviewers
- Calvin Cheung (@calvinccheung - Reviewer) ⚠️ Review applies to 24b905b3
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10296/head:pull/10296
$ git checkout pull/10296
Update a local copy of the PR:
$ git checkout pull/10296
$ git pull https://git.openjdk.org/jdk pull/10296/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10296
View PR using the GUI difftool:
$ git pr show -t 10296
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10296.diff
:wave: Welcome back iklam! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.
@iklam The following label will be automatically applied to this pull request:
-
hotspot-runtime
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.
Webrevs
- 05: Full - Incremental (a39ca652)
- 04: Full - Incremental (810289f7)
- 03: Full - Incremental (54f78f56)
- 02: Full - Incremental (d2e969bb)
- 01: Full - Incremental (24b905b3)
- 00: Full (4eee5962)
@iklam 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:
8293291: Simplify relocation of native pointers in archive heap
Reviewed-by: ccheung, coleenp
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 master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.
➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.
Thanks @calvinccheung and @coleenp for the review. I have merged with latest repo (after CPU sync) and retested with tiers 1-4. All passed. /integrate
Going to push as commit 3f4964f83d6f03efbee2fb34aa8258d4fc923efb.
@iklam Pushed as commit 3f4964f83d6f03efbee2fb34aa8258d4fc923efb.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.