RFR[S] Refactor HeapShared::archive_reachable_objects_from_static_field
Ioi Lam
ioi.lam at oracle.com
Sun Sep 2 19:35:18 UTC 2018
https://bugs.openjdk.java.net/browse/JDK-8210295
http://cr.openjdk.java.net/~iklam/jdk12/8210295-refactor-heapshared-archive-static-field.v01/
Background
----------
Currently, the only way to archive an object subgraph is to call
HeapShared::archive_reachable_objects_from_static_field, which
requires the root to be in a static field of a Java class.
To support JDK-8198698 (Archive Lambda classes in CDS), we need to
archive subgraphs from other sources, such as objects stored in
ConstantPool::resolved_references().
Fix
---
This is intended to be a clean-up only, with no change in functionality.
I moved the common code into a new method
HeapShared::archive_reachable_objects_from()
In doing so, I was able to consolidate some code that was duplicated between
archive_reachable_objects_from_static_field and WalkOopAndArchiveClosure.
Also:
+ removed some obsolete comments (e.g., "only ArchivedModuleGraph is
supported")
+ moved excessive tracing code from Debug to Trace
+ improve the alignment of some logs to make them more readable
Thanks
- Ioi
More information about the hotspot-runtime-dev
mailing list