RFR: 8374639: Static archive with AOTClassLinking breaks dynamic archive
Ioi Lam
iklam at openjdk.org
Wed Jan 7 21:46:10 UTC 2026
On Wed, 7 Jan 2026 20:29:17 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> So for the static archive, there will still be InstanceKlass::_array_klasses saved, just not for dynamic archive? This looks really good. It is easy to recreate array classes on demand as they're needed.
After this PR, we can still store **some** `ArrayKlasses` in both the static archive and the dynamic archive, and all the pointers `InstanceKlass::_array_klasses`, `ArrayKlass::_higher_dimension`, `ArrayKlass::_lower_dimension`, `ObjArrayKlass::_element_klass`, and `ObjArrayKlass::_bottom_klass` and set properly inside the archives.
However, we will no longer have an `ArrayKlass` in the dynamic archive whose element type is in the static archive. Therefore, none of the above pointers will be pointing from one archive to the other.
(All the code removed from this PR had to do with setting up such cross-archive pointers).
E.g., if you run this app with `-XX:ArchiveClassesAtExit`
class Hello {
public static void main(String[] args) {
System[] x = new System[0];
System.out.println(x);
Hello[] y = new Hello[0];
System.out.println(y);
}
}
- `System[]` will not be stored in the dynamic archive (because its element type `System` is in the static archive).
- `Hello[]` will be stored in the dynamic archive (because its element type `Hello` is in the dynamic archive).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29078#issuecomment-3720931422
More information about the hotspot-runtime-dev
mailing list