In JDK mainline, linked old classes are excluded from the CDS archive (see JDK-8309074 for the reason)
In leyden-premain, -XX:+ArchiveInvokeDynamic can create archived heap objects (MethodType) that reference linked old classes.
As a result, we get an error like this when running 'java -Xshare:dump -XX:ArchiveInvokeDynamic"
# Internal Error (/jdk3/le3/open/src/hotspot/share/cds/archiveBuilder.hpp:300), pid=3992961, tid=3993274
# assert(is_in_buffer_space(obj)) failed: must be
Stack: [0x00007fffd89d3000,0x00007fffd8ad3000], sp=0x00007fffd8ad1110, free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x5e7ec8] unsigned char* ArchiveBuilder::to_requested<unsigned char*>(unsigned char*) const+0x50 (archiveBuilder.hpp:300)
V [libjvm.so+0x5f8447] ArchiveHeapWriter::compute_ptrmap(ArchiveHeapInfo*)+0x279 (archiveHeapWriter.cpp:692)
V [libjvm.so+0x5f7ed2] ArchiveHeapWriter::relocate_embedded_oops(GrowableArrayCHeap<oopDesc*, (MEMFLAGS)13>*, ArchiveHeapInfo*, GrowableArray<unsigned long>*, int)+0x25e (archiveHeapWriter.cpp:592)
V [libjvm.so+0x5f6476] ArchiveHeapWriter::write(GrowableArrayCHeap<oopDesc*, (MEMFLAGS)13>*, ArchiveHeapInfo*)+0xda (archiveHeapWriter.cpp:112)
V [libjvm.so+0xd03eaa] HeapShared::archive_objects(ArchiveHeapInfo*)+0x168 (heapShared.cpp:680)