APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvm.hotspot

public Class HotSpotTypeDataBase

extends BasicTypeDataBase
Class Inheritance
Imports
java.io.*, java.util.*, sun.jvm.hotspot.debugger.*, sun.jvm.hotspot.types.*, sun.jvm.hotspot.types.basic.*, sun.jvm.hotspot.utilities.*

This is the cross-platform TypeDataBase used by the Oop hierarchy. The decision was made to make this cross-platform by having the VM export the necessary symbols via a built-in table; see src/share/vm/runtime/vmStructs.[ch]pp for more details.

Warning

clients should refer to this class through the TypeDataBase interface and not directly to the HotSpotTypeDataBase type.

Note

since we are fetching the sizes of the Java primitive types

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final boolean
private int
private String[]
private static final int
private static int
private Debugger
private static final int

Constructor Summary

AccessConstructor and Description
public
HotSpotTypeDataBase(MachineDescription machDesc, VtblAccess vtblAccess, Debugger symbolLookup, String[] jvmLibNames)

This requires a SymbolLookup mechanism as well as the MachineDescription.

Method Summary

Modifier and TypeMethod and Description
private BasicType
createBasicType(String typeName, boolean isOopType, boolean isIntegerType, boolean isUnsigned)

Creates a new BasicType, initializes its size to -1 so we can test to ensure that all types' sizes are initialized by VMTypes, and adds it to the database.

public void
createField(BasicType containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)

"Virtual constructor" for fields based on type

public void
createType(String typeName, String superclassName, boolean isOopType, boolean isIntegerType, boolean isUnsigned, long size)

private void
dumpMemory(Address addr, int len)

private long
private void
pack-priv Field
internalCreateField(BasicType containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)

private Address
private BasicType
lookupOrCreateClass(String typeName, boolean isOopType, boolean isIntegerType, boolean isUnsigned)

private BasicType
lookupOrFail(String typeName)

private Type
public Type
lookupType(String cTypeName, boolean throwException)

Overrides sun.jvm.hotspot.types.basic.BasicTypeDataBase.lookupType.

Implements sun.jvm.hotspot.types.TypeDataBase.lookupType.

For simplicity of the initial implementation, this is not guaranteed to work for primitive types.

private void
private void
private void
private void
private void
private BasicPointerType
recursiveCreateBasicPointerType(String typeName)

Recursively creates a PointerType from the string representation of the type's name.

private boolean
Inherited from sun.jvm.hotspot.types.basic.BasicTypeDataBase:
addIntConstantaddLongConstantaddressTypeIsEqualToTypeaddTypecIntegerTypeMaxValuecIntegerTypeMinValuefindDynamicTypeForAddressgetAddressSizegetIntConstantsgetJBooleanTypegetJByteTypegetJCharTypegetJDoubleTypegetJFloatTypegetJIntTypegetJLongTypegetJShortTypegetLongConstantsgetOopSizegetTypesguessTypeForAddresslookupIntConstantlookupIntConstantlookupLongConstantlookupLongConstantlookupTyperemoveIntConstantremoveLongConstantremoveTypesetJBooleanTypesetJByteTypesetJCharTypesetJDoubleTypesetJFloatTypesetJIntTypesetJLongTypesetJShortTypevtblForType

Field Detail

C_INT32_SIZEback to summary
private static final int C_INT32_SIZE
C_INT64_SIZEback to summary
private static final int C_INT64_SIZE
C_INT8_SIZEback to summary
private static final int C_INT8_SIZE
DEBUGback to summary
private static final boolean DEBUG

Hides sun.jvm.hotspot.types.basic.BasicTypeDataBase.DEBUG.

duplicateDefCountback to summary
private int duplicateDefCount
jvmLibNamesback to summary
private String[] jvmLibNames
MAX_DUPLICATE_DEFINITIONSback to summary
private static final int MAX_DUPLICATE_DEFINITIONS
pointerSizeback to summary
private static int pointerSize
symbolLookupback to summary
private Debugger symbolLookup
UNINITIALIZED_SIZEback to summary
private static final int UNINITIALIZED_SIZE

Constructor Detail

HotSpotTypeDataBaseback to summary
public HotSpotTypeDataBase(MachineDescription machDesc, VtblAccess vtblAccess, Debugger symbolLookup, String[] jvmLibNames) throws NoSuchSymbolException

This requires a SymbolLookup mechanism as well as the MachineDescription. Note that we do not need a NameMangler since we use the vmStructs mechanism to avoid looking up C++ symbols.

NOTE that it is guaranteed that this constructor will not attempt to fetch any Java values from the remote process, only C integers and addresses. This is required because we are fetching the sizes of the Java primitive types from the remote process, implying that attempting to fetch them before their sizes are known is illegal.

Throws NoSuchSymbolException if a problem occurred while looking up one of the bootstrapping symbols related to the VMStructs table in the remote VM; this may indicate that the remote process is not actually a HotSpot VM.

Method Detail

createBasicTypeback to summary
private BasicType createBasicType(String typeName, boolean isOopType, boolean isIntegerType, boolean isUnsigned)

Creates a new BasicType, initializes its size to -1 so we can test to ensure that all types' sizes are initialized by VMTypes, and adds it to the database. Takes care of initializing integer and oop types properly.

createFieldback to summary
public void createField(BasicType containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)

"Virtual constructor" for fields based on type

createTypeback to summary
public void createType(String typeName, String superclassName, boolean isOopType, boolean isIntegerType, boolean isUnsigned, long size)
dumpMemoryback to summary
private void dumpMemory(Address addr, int len)
getLongValueFromProcessback to summary
private long getLongValueFromProcess(String symbol)
initializePrimitiveTypesback to summary
private void initializePrimitiveTypes()
internalCreateFieldback to summary
pack-priv Field internalCreateField(BasicType containingType, String name, Type type, boolean isStatic, long offset, Address staticFieldAddress)
lookupInProcessback to summary
private Address lookupInProcess(String symbol) throws NoSuchSymbolException
lookupOrCreateClassback to summary
private BasicType lookupOrCreateClass(String typeName, boolean isOopType, boolean isIntegerType, boolean isUnsigned)
lookupOrFailback to summary
private BasicType lookupOrFail(String typeName)
lookupPrimitiveTypeback to summary
private Type lookupPrimitiveType(String typeName)
lookupTypeback to summary
public Type lookupType(String cTypeName, boolean throwException)

Overrides sun.jvm.hotspot.types.basic.BasicTypeDataBase.lookupType.

Implements sun.jvm.hotspot.types.TypeDataBase.lookupType.

Doc from sun.jvm.hotspot.types.TypeDataBase.lookupType.

For simplicity of the initial implementation, this is not guaranteed to work for primitive types. If throwException is true, throws an (unspecified) run-time exception if the type is not found.

readExternalDefinitionsback to summary
private void readExternalDefinitions()
readVMIntConstantsback to summary
private void readVMIntConstants()
readVMLongConstantsback to summary
private void readVMLongConstants()
readVMStructsback to summary
private void readVMStructs()
readVMTypesback to summary
private void readVMTypes()
recursiveCreateBasicPointerTypeback to summary
private BasicPointerType recursiveCreateBasicPointerType(String typeName)

Recursively creates a PointerType from the string representation of the type's name. Note that this currently needs some workarounds due to incomplete information in the VMStructs database.

typeNameIsPointerTypeback to summary
private boolean typeNameIsPointerType(String typeName)