RFR: 8316994: Avoid modifying ClassLoader and Module objects during -Xshare:dump

Ioi Lam iklam at openjdk.org
Wed Sep 27 05:11:51 UTC 2023


When dumping the module graph, we set some native pointers in `ClassLoader` and `Module` objects to null.

We used to modify the copies of these objects in the actual heap. This makes `InstanceKlass::class_loader_data()` return the wrong value inside `VM_PopulateDumpSharedSpace`.

Instead, this PR modifies the copies of the objects in the `ArchiveHeapWriter` buffer. This also means that the `HeapShared::restore_loader_data()` function is no longer needed.

-------------

Commit messages:
 - 8316994: Avoid modifying ClassLoader and Module objects during -Xshare:dump

Changes: https://git.openjdk.org/jdk/pull/15937/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15937&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316994
  Stats: 66 lines in 7 files changed: 26 ins; 33 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/15937.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15937/head:pull/15937

PR: https://git.openjdk.org/jdk/pull/15937


More information about the hotspot-runtime-dev mailing list