Top Fields Constructors Methods
jdk.internal.misc

public Class CDS

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .File, .InputStreamReader, .InputStream, .IOException, .PrintStream, java.util.Arrays, .ArrayList, .List, .Map, .Objects, java.util.stream.Stream, jdk.internal.access.SharedSecrets

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv static final String
pack-priv static final String
private static String[]
pack-priv static final String
private static final boolean
private static final boolean
private static final boolean
private static final boolean

Constructor Summary

AccessConstructor and Description
public
CDS()

Method Summary

Modifier and TypeMethod and Description
private static boolean
public static native void
defineArchivedModules(ClassLoader platformLoader, ClassLoader systemLoader)

Ensure that the native representation of all archived java.lang.Module objects are properly restored.

private static String
drainOutput(InputStream stream, long pid, String tail, List<String> cmds)

private static native void
dumpClassList(String listFileName)

private static native void
dumpDynamicArchive(String archiveFileName)

private static String

Returns:

The archive name if successfully dumped.
dumpSharedArchive
(boolean
true for dump static archive or false for dynnamic archive.
isStatic
,
String
user input archive name, can be null.
fileName
)

called from jcmd VM.cds to dump static or dynamic shared archive

private static Object[]

Returns:

Object[] if holder classes can be generated.
generateLambdaFormHolderClasses
(String[]
in format of LF_RESOLVE or SPECIES_RESOLVE output
lines
)

called from vm to generate MethodHandle holder classes

public static native long
getRandomSeedForDumping()

Returns a predictable "random" seed derived from the VM's build ID and version, to be used by java.util.ImmutableCollections to ensure that archived ImmutableCollections are always sorted the same order for the same VM build.

public static native void
initializeFromArchive(Class<?> c)

Initialize archived static fields in the given Class using archived values from CDS dump time.

private static boolean
public static boolean
isDumpingArchive()

Is the VM writing to a (static or dynamic) CDS archive.

private static native boolean
public static boolean
isDumpingClassList()

indicator for dumping class list.

private static native boolean
public static boolean
isDumpingStaticArchive()

Is dumping static archive.

public static boolean
isSharingEnabled()

Is sharing enabled.

private static native boolean
private static boolean
private static boolean
private static native void
public static void
traceLambdaFormInvoker(String prefix, String holder, String name, String type)

log lambda form invoker holder, name and method type

public static void
traceSpeciesType(String prefix, String cn)

log species

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BASIC_FORMS_HOLDER_CLASS_NAMEback to summary
pack-priv static final String BASIC_FORMS_HOLDER_CLASS_NAME
DELEGATING_HOLDER_CLASS_NAMEback to summary
pack-priv static final String DELEGATING_HOLDER_CLASS_NAME
DIRECT_HOLDER_CLASS_NAMEback to summary
pack-priv static final String DIRECT_HOLDER_CLASS_NAME
excludeFlagsback to summary
private static String[] excludeFlags
INVOKERS_HOLDER_CLASS_NAMEback to summary
pack-priv static final String INVOKERS_HOLDER_CLASS_NAME
isDumpingArchiveback to summary
private static final boolean isDumpingArchive
isDumpingClassListback to summary
private static final boolean isDumpingClassList
isDumpingStaticArchiveback to summary
private static final boolean isDumpingStaticArchive
isSharingEnabledback to summary
private static final boolean isSharingEnabled

Constructor Detail

CDSback to summary
public CDS()

Method Detail

containsExcludedFlagsback to summary
private static boolean containsExcludedFlags(String testStr)
defineArchivedModulesback to summary
public static native void defineArchivedModules(ClassLoader platformLoader, ClassLoader systemLoader)

Ensure that the native representation of all archived java.lang.Module objects are properly restored.

drainOutputback to summary
private static String drainOutput(InputStream stream, long pid, String tail, List<String> cmds)
dumpClassListback to summary
private static native void dumpClassList(String listFileName)
dumpDynamicArchiveback to summary
private static native void dumpDynamicArchive(String archiveFileName)
dumpSharedArchiveback to summary
private static String dumpSharedArchive(boolean isStatic, String fileName) throws Exception

called from jcmd VM.cds to dump static or dynamic shared archive

Parameters
isStatic:boolean

true for dump static archive or false for dynnamic archive.

fileName:String

user input archive name, can be null.

Returns:String

The archive name if successfully dumped.

generateLambdaFormHolderClassesback to summary
private static Object[] generateLambdaFormHolderClasses(String[] lines)

called from vm to generate MethodHandle holder classes

Parameters
lines:String[]

in format of LF_RESOLVE or SPECIES_RESOLVE output

Returns:Object[]

Object[] if holder classes can be generated.

getRandomSeedForDumpingback to summary
public static native long getRandomSeedForDumping()

Returns a predictable "random" seed derived from the VM's build ID and version, to be used by java.util.ImmutableCollections to ensure that archived ImmutableCollections are always sorted the same order for the same VM build.

initializeFromArchiveback to summary
public static native void initializeFromArchive(Class<?> c)

Initialize archived static fields in the given Class using archived values from CDS dump time. Also initialize the classes of objects in the archived graph referenced by those fields. Those static fields remain as uninitialized if there is no mapped CDS java heap data or there is any error during initialization of the object class in the archived graph.

isBasicTypeCharback to summary
private static boolean isBasicTypeChar(char c)
isDumpingArchiveback to summary
public static boolean isDumpingArchive()

Is the VM writing to a (static or dynamic) CDS archive.

isDumpingArchive0back to summary
private static native boolean isDumpingArchive0()
isDumpingClassListback to summary
public static boolean isDumpingClassList()

indicator for dumping class list.

isDumpingClassList0back to summary
private static native boolean isDumpingClassList0()
isDumpingStaticArchiveback to summary
public static boolean isDumpingStaticArchive()

Is dumping static archive.

isSharingEnabledback to summary
public static boolean isSharingEnabled()

Is sharing enabled.

isSharingEnabled0back to summary
private static native boolean isSharingEnabled0()
isValidHolderNameback to summary
private static boolean isValidHolderName(String name)
isValidMethodTypeback to summary
private static boolean isValidMethodType(String type)
logLambdaFormInvokerback to summary
private static native void logLambdaFormInvoker(String line)
traceLambdaFormInvokerback to summary
public static void traceLambdaFormInvoker(String prefix, String holder, String name, String type)

log lambda form invoker holder, name and method type

traceSpeciesTypeback to summary
public static void traceSpeciesType(String prefix, String cn)

log species

validateInputLinesback to summary
private static void validateInputLines(String[] lines)