RFR: 8297290: Use int indices to reference CDS archived primitive mirrors [v2]
Ioi Lam
iklam at openjdk.org
Tue Nov 22 18:45:33 UTC 2022
> In CDS, when archived class metadata reference an object in the archive heap, it's usually done using an integer index, which can be passed to `HeapShared::get_root(int)` to retrieve the object. This way, we don't need to worry if the archive heap has been relocated. E.g.,
>
>
> oop Klass::archived_java_mirror() {
> assert(has_archived_mirror_index(), "must have archived mirror");
> return HeapShared::get_root(_archived_mirror_index);
> }
>
> However, for the primitive mirror objects (in `Universe::_mirrors[]`, which point to the `java.lang.Class` instances of the Java primitive types such as `int`, `float`, etc), we are still using a direct oop reference.
>
> For consistency, we should change this code to use the same int indices as the rest of the system. This will also make it simpler to optimize the layout of the CDS archive heap (e.g., in [JDK-8234679](https://bugs.openjdk.org/browse/JDK-8234679)).
>
> Testing: passed tiers 1-4
Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
@calvinccheung comments
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/11256/files
- new: https://git.openjdk.org/jdk/pull/11256/files/cce9ec6c..eb0d663c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=11256&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=11256&range=00-01
Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/11256.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/11256/head:pull/11256
PR: https://git.openjdk.org/jdk/pull/11256
More information about the hotspot-runtime-dev
mailing list