Integrated: 8293291: Simplify relocation of native pointers in archive heap
Ioi Lam
iklam at openjdk.org
Wed Oct 19 05:01:45 UTC 2022
On Thu, 15 Sep 2022 20:49:24 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> 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).
This pull request has now been integrated.
Changeset: 3f4964f8
Author: Ioi Lam <iklam at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/3f4964f83d6f03efbee2fb34aa8258d4fc923efb
Stats: 428 lines in 17 files changed: 193 ins; 153 del; 82 mod
8293291: Simplify relocation of native pointers in archive heap
Reviewed-by: ccheung, coleenp
-------------
PR: https://git.openjdk.org/jdk/pull/10296
More information about the hotspot-runtime-dev
mailing list