This class encapsulates the global state of the VM; the universe, object heap, interpreter, etc. It is a Singleton and must be initialized with a call to initialize() before calling getVM().
Many auxiliary classes (i.e., most of the VMObjects) keep needed field offsets in the form of static Field objects. In a debugging system, the VM might be shutdown and re-initialized (on a differently-configured build, i.e., 32- vs. 64-bit), and all old cached state (including fields and field offsets) must be flushed.
An Observer pattern is used to implement the initialization of such classes. Each such class, in its static initializer, registers an Observer with the VM class via VM.registerVMInitializedObserver(). This Observer is guaranteed to be notified whenever the VM is initialized (or re-initialized). To implement the first-time initialization, the observer is also notified when it registers itself with the VM. (For bootstrapping reasons, this implies that the constructor of VM can not instantiate any such objects, since VM.soleInstance will not have been set yet. This is a bootstrapping issue which may have to be revisited later.)
Modifier and Type | Class and Description |
---|---|
public static class |
Modifier and Type | Field and Description |
---|---|
private static CIntegerType | |
private Bytes | |
private int | |
private int | |
private ClassLoaderDataGraph | |
private static final String[] | |
private CodeCache | codeCache
This is only present in a non-core build |
private VM. | |
private Boolean | |
private Boolean | |
private TypeDataBase | |
private JVMDebugger | debugger
This is only present if in a debugging system |
private SystemDictionary | |
private static final boolean | |
private FileMapInfo | |
public static int | |
public static int | |
public static int | |
public static int | Flags_DEFAULT
-XX flags (value origin) |
public static int | |
public static int | |
public static int | |
public static int | |
public static int | |
private static int | |
private static int | |
private Map | |
private JNIHandles | |
private ObjectHeap | |
private int | |
private int | |
private Interpreter | |
private static Type | |
private static Type | |
private int | invocationEntryBCI
These constants come from globalDefinitions.hpp |
private boolean | |
private boolean | isJvmtiSupported
Flag indicating if JVMTI support is included in the build |
private boolean | isLP64
alignment constants |
private int | |
private long | |
private int | |
private int | |
private int | |
private int | |
private int | |
private int | |
private ReversePtrs | |
private Runtime1 | runtime1
This is only present in a C1 build |
private static final Properties | |
private Boolean | |
private static Type | |
private static VM | |
private StubRoutines | |
private ObjectSynchronizer | |
private Properties | |
private Threads | |
private static Type | |
private static Type | |
private static Type | |
private Universe | |
private boolean | usingClientCompiler
Flags indicating whether we are attached to a core, C1, or C2 build |
private boolean | |
private static List | |
private String | |
private VMRegImpl | |
private String | |
private List | |
private List |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public long | |
public long | |
public int | buildIntFromShorts(short low, short high)
Utility routine for building an int from two "unsigned" 16-bit shorts |
private static void | |
public void | |
public void | |
public long | |
public static long | |
public Bytes | |
public int | |
public int | |
public ClassLoaderDataGraph | |
public CodeCache | |
public boolean | |
public VM. | |
public VM. | |
public String | |
public JVMDebugger | |
public FileMapInfo | |
private String | |
public int | |
public int | |
public Interpreter | |
public long | |
public int | |
public JNIHandles | |
public int | |
public long | |
public int | |
public int | |
public int | |
public int | |
public ObjectHeap | |
public ObjectSynchronizer | |
public long | |
public String | |
public int | |
public ReversePtrs | |
public Runtime1 | |
public StubRoutines | |
public SystemDictionary | |
public Properties | |
public String | |
public Threads | |
public TypeDataBase | |
public Universe | |
public boolean | |
public static VM | |
public String | |
public VMRegImpl | |
public String | |
public static void | |
public static void | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | isDebugging()
Test to see whether we're in debugging mode (NOTE: this really should not be tested by this code; currently only used in StackFrameStream) |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public Integer | |
public Type | |
private void | |
private void | |
public static void | |
public void | |
public void | |
public void | |
public static void | |
public boolean | |
public boolean |
boolType | back to summary |
---|---|
private static CIntegerType boolType |
bytes | back to summary |
---|---|
private Bytes bytes |
bytesPerLong | back to summary |
---|---|
private int bytesPerLong |
bytesPerWord | back to summary |
---|---|
private int bytesPerWord |
cldGraph | back to summary |
---|---|
private ClassLoaderDataGraph cldGraph |
cmdFlagTypes | back to summary |
---|---|
private static final String[] cmdFlagTypes |
codeCache | back to summary |
---|---|
private CodeCache codeCache This is only present in a non-core build |
commandLineFlags | back to summary |
---|---|
private VM. |
compressedKlassPointersEnabled | back to summary |
---|---|
private Boolean compressedKlassPointersEnabled |
compressedOopsEnabled | back to summary |
---|---|
private Boolean compressedOopsEnabled |
db | back to summary |
---|---|
private TypeDataBase db |
debugger | back to summary |
---|---|
private JVMDebugger debugger This is only present if in a debugging system |
dict | back to summary |
---|---|
private SystemDictionary dict |
disableDerivedPointerTableCheck | back to summary |
---|---|
private static final boolean disableDerivedPointerTableCheck |
fileMapInfo | back to summary |
---|---|
private FileMapInfo fileMapInfo |
Flags_ATTACH_ON_DEMAND | back to summary |
---|---|
public static int Flags_ATTACH_ON_DEMAND |
Flags_COMMAND_LINE | back to summary |
---|---|
public static int Flags_COMMAND_LINE |
Flags_CONFIG_FILE | back to summary |
---|---|
public static int Flags_CONFIG_FILE |
Flags_DEFAULT | back to summary |
---|---|
public static int Flags_DEFAULT -XX flags (value origin) |
Flags_ENVIRON_VAR | back to summary |
---|---|
public static int Flags_ENVIRON_VAR |
Flags_ERGONOMIC | back to summary |
---|---|
public static int Flags_ERGONOMIC |
Flags_INTERNAL | back to summary |
---|---|
public static int Flags_INTERNAL |
Flags_JIMAGE_RESOURCE | back to summary |
---|---|
public static int Flags_JIMAGE_RESOURCE |
Flags_MANAGEMENT | back to summary |
---|---|
public static int Flags_MANAGEMENT |
Flags_VALUE_ORIGIN_MASK | back to summary |
---|---|
private static int Flags_VALUE_ORIGIN_MASK |
Flags_WAS_SET_ON_COMMAND_LINE | back to summary |
---|---|
private static int Flags_WAS_SET_ON_COMMAND_LINE |
flagsMap | back to summary |
---|---|
private Map<String, VM. |
handles | back to summary |
---|---|
private JNIHandles handles |
heap | back to summary |
---|---|
private ObjectHeap heap |
heapOopSize | back to summary |
---|---|
private int heapOopSize |
heapWordSize | back to summary |
---|---|
private int heapWordSize |
interpreter | back to summary |
---|---|
private Interpreter interpreter |
intType | back to summary |
---|---|
private static Type intType |
intxType | back to summary |
---|---|
private static Type intxType |
invocationEntryBCI | back to summary |
---|---|
private int invocationEntryBCI These constants come from globalDefinitions.hpp |
isBigEndian | back to summary |
---|---|
private boolean isBigEndian |
isJvmtiSupported | back to summary |
---|---|
private boolean isJvmtiSupported Flag indicating if JVMTI support is included in the build |
isLP64 | back to summary |
---|---|
private boolean isLP64 alignment constants |
klassPtrSize | back to summary |
---|---|
private int klassPtrSize |
logAddressSize | back to summary |
---|---|
private long logAddressSize |
logBytesPerWord | back to summary |
---|---|
private int logBytesPerWord |
logMinObjAlignmentInBytes | back to summary |
---|---|
private int logMinObjAlignmentInBytes |
minObjAlignmentInBytes | back to summary |
---|---|
private int minObjAlignmentInBytes |
objectAlignmentInBytes | back to summary |
---|---|
private int objectAlignmentInBytes |
oopSize | back to summary |
---|---|
private int oopSize |
reserveForAllocationPrefetch | back to summary |
---|---|
private int reserveForAllocationPrefetch |
revPtrs | back to summary |
---|---|
private ReversePtrs revPtrs |
runtime1 | back to summary |
---|---|
private Runtime1 runtime1 This is only present in a C1 build |
saProps | back to summary |
---|---|
private static final Properties saProps |
sharingEnabled | back to summary |
---|---|
private Boolean sharingEnabled |
sizetType | back to summary |
---|---|
private static Type sizetType |
soleInstance | back to summary |
---|---|
private static VM soleInstance |
stubRoutines | back to summary |
---|---|
private StubRoutines stubRoutines |
synchronizer | back to summary |
---|---|
private ObjectSynchronizer synchronizer |
sysProps | back to summary |
---|---|
private Properties sysProps |
threads | back to summary |
---|---|
private Threads threads |
uint64tType | back to summary |
---|---|
private static Type uint64tType |
uintType | back to summary |
---|---|
private static Type uintType |
uintxType | back to summary |
---|---|
private static Type uintxType |
universe | back to summary |
---|---|
private Universe universe |
usingClientCompiler | back to summary |
---|---|
private boolean usingClientCompiler Flags indicating whether we are attached to a core, C1, or C2 build |
usingServerCompiler | back to summary |
---|---|
private boolean usingServerCompiler |
vmInitializedObservers | back to summary |
---|---|
private static List<Observer> vmInitializedObservers |
vmInternalInfo | back to summary |
---|---|
private String vmInternalInfo |
vmregImpl | back to summary |
---|---|
private VMRegImpl vmregImpl |
vmRelease | back to summary |
---|---|
private String vmRelease |
vmResumedObservers | back to summary |
---|---|
private List<Observer> vmResumedObservers |
vmSuspendedObservers | back to summary |
---|---|
private List<Observer> vmSuspendedObservers |
VM | back to summary |
---|---|
private VM(TypeDataBase db, JVMDebugger debugger, boolean isBigEndian) |
alignDown | back to summary |
---|---|
public long alignDown(long size, long alignment) Utility routine for getting data structure alignment correct |
alignUp | back to summary |
---|---|
public long alignUp(long size, long alignment) Utility routine for getting data structure alignment correct |
buildIntFromShorts | back to summary |
---|---|
public int buildIntFromShorts(short low, short high) Utility routine for building an int from two "unsigned" 16-bit shorts |
checkVMVersion | back to summary |
---|---|
private static void checkVMVersion(String vmRelease) |
fireVMResumed | back to summary |
---|---|
public void fireVMResumed() This is only used by the debugging system. Informs all registered resumption observers that the VM has been resumed. The application is responsible for actually having performed the resumption. No OopHandles must be used after this point, as they may move in the target address space due to garbage collection. |
fireVMSuspended | back to summary |
---|---|
public void fireVMSuspended() This is only used by the debugging system. Informs all registered suspension observers that the VM has been suspended. The application is responsible for actually having performed the suspension. Garbage collection must be forbidden at this point; for example, a JPDA-level suspension is not adequate since the VM thread may still be running. |
getAddressSize | back to summary |
---|---|
public long getAddressSize() |
getAddressValue | back to summary |
---|---|
public static long getAddressValue(Address addr) |
getBytes | back to summary |
---|---|
public Bytes getBytes() |
getBytesPerLong | back to summary |
---|---|
public int getBytesPerLong() Get bytes-per-long == long/double natural alignment. |
getBytesPerWord | back to summary |
---|---|
public int getBytesPerWord() |
getClassLoaderDataGraph | back to summary |
---|---|
public ClassLoaderDataGraph getClassLoaderDataGraph() |
getCodeCache | back to summary |
---|---|
public CodeCache getCodeCache() Returns the code cache; should not be used if is core build |
getCommandLineBooleanFlag | back to summary |
---|---|
public boolean getCommandLineBooleanFlag(String name) |
getCommandLineFlag | back to summary |
---|---|
public VM. |
getCommandLineFlags | back to summary |
---|---|
public VM. |
getCPU | back to summary |
---|---|
public String getCPU() Returns the CPU this VM is running on. Notice that by delegating to the debugger we can transparently support remote debugging. |
getDebugger | back to summary |
---|---|
public JVMDebugger getDebugger() This is only used by the debugging (i.e., non-runtime) system |
getFileMapInfo | back to summary |
---|---|
public FileMapInfo getFileMapInfo() |
getFlagTypeAsString | back to summary |
---|---|
private String getFlagTypeAsString(int typeIndex) |
getHeapOopSize | back to summary |
---|---|
public int getHeapOopSize() |
getHeapWordSize | back to summary |
---|---|
public int getHeapWordSize() |
getInterpreter | back to summary |
---|---|
public Interpreter getInterpreter() |
getIntSize | back to summary |
---|---|
public long getIntSize() |
getInvocationEntryBCI | back to summary |
---|---|
public int getInvocationEntryBCI() FIXME: figure out where to stick this |
getJNIHandles | back to summary |
---|---|
public JNIHandles getJNIHandles() |
getKlassPtrSize | back to summary |
---|---|
public int getKlassPtrSize() |
getLogAddressSize | back to summary |
---|---|
public long getLogAddressSize() |
getLogBytesPerWord | back to summary |
---|---|
public int getLogBytesPerWord() |
getLogMinObjAlignmentInBytes | back to summary |
---|---|
public int getLogMinObjAlignmentInBytes() |
getMinObjAlignmentInBytes | back to summary |
---|---|
public int getMinObjAlignmentInBytes() Get minimum object alignment in bytes. |
getObjectAlignmentInBytes | back to summary |
---|---|
public int getObjectAlignmentInBytes() |
getObjectHeap | back to summary |
---|---|
public ObjectHeap getObjectHeap() |
getObjectSynchronizer | back to summary |
---|---|
public ObjectSynchronizer getObjectSynchronizer() |
getOopSize | back to summary |
---|---|
public long getOopSize() |
getOS | back to summary |
---|---|
public String getOS() Returns the OS this VM is running on. Notice that by delegating to the debugger we can transparently support remote debugging. |
getReserveForAllocationPrefetch | back to summary |
---|---|
public int getReserveForAllocationPrefetch() |
getRevPtrs | back to summary |
---|---|
public ReversePtrs getRevPtrs() |
getRuntime1 | back to summary |
---|---|
public Runtime1 getRuntime1() Should only be called for C1 builds |
getStubRoutines | back to summary |
---|---|
public StubRoutines getStubRoutines() |
getSystemDictionary | back to summary |
---|---|
public SystemDictionary getSystemDictionary() |
getSystemProperties | back to summary |
---|---|
public Properties getSystemProperties() |
getSystemProperty | back to summary |
---|---|
public String getSystemProperty(String key) |
getThreads | back to summary |
---|---|
public Threads getThreads() |
getTypeDataBase | back to summary |
---|---|
public TypeDataBase getTypeDataBase() |
getUniverse | back to summary |
---|---|
public Universe getUniverse() |
getUseTLAB | back to summary |
---|---|
public boolean getUseTLAB() Indicates whether Thread-Local Allocation Buffers are used |
getVM | back to summary |
---|---|
public static VM getVM() This is the primary accessor used by both the debugger and any potential runtime system |
getVMInternalInfo | back to summary |
---|---|
public String getVMInternalInfo() |
getVMRegImplInfo | back to summary |
---|---|
public VMRegImpl getVMRegImplInfo() |
getVMRelease | back to summary |
---|---|
public String getVMRelease() |
initialize | back to summary |
---|---|
public static void initialize(TypeDataBase db, boolean isBigEndian) This could be used by a reflective runtime system |
initialize | back to summary |
---|---|
public static void initialize(TypeDataBase db, JVMDebugger debugger) This is used by the debugging system |
isBigEndian | back to summary |
---|---|
public boolean isBigEndian() Returns true if this is a isBigEndian, false otherwise |
isClientCompiler | back to summary |
---|---|
public boolean isClientCompiler() Returns true if this is a C1 build, false otherwise |
isCompressedKlassPointersEnabled | back to summary |
---|---|
public boolean isCompressedKlassPointersEnabled() |
isCompressedOopsEnabled | back to summary |
---|---|
public boolean isCompressedOopsEnabled() |
isCore | back to summary |
---|---|
public boolean isCore() Returns true if this is a "core" build, false if either C1 or C2 is present |
isDebugging | back to summary |
---|---|
public boolean isDebugging() Test to see whether we're in debugging mode (NOTE: this really should not be tested by this code; currently only used in StackFrameStream) |
isJavaPCDbg | back to summary |
---|---|
public boolean isJavaPCDbg(Address addr) Indicates whether a given program counter is in Java code. This includes but is not spanned by the interpreter and code cache. Only used in the debugging system, for implementing JavaThread.currentFrameGuess() on x86. |
isJvmtiSupported | back to summary |
---|---|
public boolean isJvmtiSupported() Returns true if JVMTI is supported, false otherwise |
isLP64 | back to summary |
---|---|
public boolean isLP64() Indicates whether the underlying machine supports the LP64 data model. This is needed for conditionalizing code in a few places |
isServerCompiler | back to summary |
---|---|
public boolean isServerCompiler() Returns true if this is a C2 build, false otherwise |
isSharingEnabled | back to summary |
---|---|
public boolean isSharingEnabled() |
lookupIntConstant | back to summary |
---|---|
public Integer lookupIntConstant(String name) |
lookupType | back to summary |
---|---|
public Type lookupType(String cTypeName) |
readCommandLineFlags | back to summary |
---|---|
private void readCommandLineFlags() |
readSystemProperties | back to summary |
---|---|
private void readSystemProperties() |
registerVMInitializedObserver | back to summary |
---|---|
public static void registerVMInitializedObserver(Observer o) This is used by both the debugger and any runtime system. It is the basic mechanism by which classes which mimic underlying VM functionality cause themselves to be initialized. The given observer will be notified (with arguments (null, null)) when the VM is re-initialized, as well as when it registers itself with the VM. |
registerVMResumedObserver | back to summary |
---|---|
public void registerVMResumedObserver(Observer o) This is only used by the debugging system. The given observer
will be notified if the underlying VM resumes execution. NOTE
that the given observer is not triggered if the VM is currently
running and therefore differs in behavior from |
registerVMSuspendedObserver | back to summary |
---|---|
public void registerVMSuspendedObserver(Observer o) This is only used by the debugging system. The given observer
will be notified if the underlying VM suspends execution. NOTE
that the given observer is not triggered if the VM is currently
suspended and therefore differs in behavior from |
setRevPtrs | back to summary |
---|---|
public void setRevPtrs(ReversePtrs rp) |
shutdown | back to summary |
---|---|
public static void shutdown() This is used by the debugging system |
useDerivedPointerTable | back to summary |
---|---|
public boolean useDerivedPointerTable() Returns true if C2 derived pointer table should be used, false otherwise |
wizardMode | back to summary |
---|---|
public boolean wizardMode() |
Modifier and Type | Field and Description |
---|---|
private Address | |
private int | |
private String | |
private String |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public Address | |
public boolean | |
public String | |
public String | |
public double | |
public long | |
public long | |
public String | |
public int | |
public String | |
public long | |
public String | |
public long | |
public long | |
public long | |
public String | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean | |
public boolean |
addr | back to summary |
---|---|
private Address addr |
flags | back to summary |
---|---|
private int flags |
name | back to summary |
---|---|
private String name |
type | back to summary |
---|---|
private String type |
Flag | back to summary |
---|---|
private Flag(String type, String name, Address addr, int flags) |
getAddress | back to summary |
---|---|
public Address getAddress() |
getBool | back to summary |
---|---|
public boolean getBool() |
getCcstr | back to summary |
---|---|
public String getCcstr() |
getCcstrlist | back to summary |
---|---|
public String getCcstrlist() |
getDouble | back to summary |
---|---|
public double getDouble() |
getInt | back to summary |
---|---|
public long getInt() |
getIntx | back to summary |
---|---|
public long getIntx() |
getName | back to summary |
---|---|
public String getName() |
getOrigin | back to summary |
---|---|
public int getOrigin() |
getOriginString | back to summary |
---|---|
public String getOriginString() |
getSizet | back to summary |
---|---|
public long getSizet() |
getType | back to summary |
---|---|
public String getType() |
getUInt | back to summary |
---|---|
public long getUInt() |
getUint64t | back to summary |
---|---|
public long getUint64t() |
getUIntx | back to summary |
---|---|
public long getUIntx() |
getValue | back to summary |
---|---|
public String getValue() |
isBool | back to summary |
---|---|
public boolean isBool() |
isCcstr | back to summary |
---|---|
public boolean isCcstr() |
isCcstrlist | back to summary |
---|---|
public boolean isCcstrlist() |
isDouble | back to summary |
---|---|
public boolean isDouble() |
isInt | back to summary |
---|---|
public boolean isInt() |
isIntx | back to summary |
---|---|
public boolean isIntx() |
isSizet | back to summary |
---|---|
public boolean isSizet() |
isUInt | back to summary |
---|---|
public boolean isUInt() |
isUint64t | back to summary |
---|---|
public boolean isUint64t() |
isUIntx | back to summary |
---|---|
public boolean isUIntx() |