8207263: Store the Configuration for system modules into CDS archive

Archive boot layer Configuration.

Reviewed-by: redestad, iklam, ccheung
This commit is contained in:
Jiangli Zhou 2018-08-10 00:35:57 -04:00
parent 5858a507f4
commit a5d14313f5
13 changed files with 353 additions and 45 deletions

View file

@ -36,6 +36,7 @@ import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import jdk.internal.misc.SharedSecrets;
import jdk.internal.misc.VM;
import jdk.internal.vm.annotation.Stable;
/**
@ -409,7 +410,15 @@ class ImmutableCollections {
static final class ListN<E> extends AbstractImmutableList<E>
implements Serializable {
static final List<?> EMPTY_LIST = new ListN<>();
// EMPTY_LIST may be initialized from the CDS archive.
static @Stable List<?> EMPTY_LIST;
static {
VM.initializeFromArchive(ListN.class);
if (EMPTY_LIST == null) {
EMPTY_LIST = new ListN<>();
}
}
@Stable
private final E[] elements;
@ -567,7 +576,15 @@ class ImmutableCollections {
static final class SetN<E> extends AbstractImmutableSet<E>
implements Serializable {
static final Set<?> EMPTY_SET = new SetN<>();
// EMPTY_SET may be initialized from the CDS archive.
static @Stable Set<?> EMPTY_SET;
static {
VM.initializeFromArchive(SetN.class);
if (EMPTY_SET == null) {
EMPTY_SET = new SetN<>();
}
}
@Stable
final E[] elements;
@ -772,7 +789,15 @@ class ImmutableCollections {
*/
static final class MapN<K,V> extends AbstractImmutableMap<K,V> {
static final Map<?,?> EMPTY_MAP = new MapN<>();
// EMPTY_MAP may be initialized from the CDS archive.
static @Stable Map<?,?> EMPTY_MAP;
static {
VM.initializeFromArchive(MapN.class);
if (EMPTY_MAP == null) {
EMPTY_MAP = new MapN<>();
}
}
@Stable
final Object[] table; // pairs of key, value