| |
|
| java.lang.Object gov.nasa.jpf.jvm.ClassInfo
ClassInfo | public class ClassInfo (Code) | | Describes the JVM's view of a java class. Contains descriptions of the
static and dynamic fields, methods, and information relevant to the
class.
|
Constructor Summary | |
protected | ClassInfo(String builtinClassName) ClassInfo ctor used for builtin types (arrays and primitive types)
i.e. | protected | ClassInfo(JavaClass jc) Creates a new class from the JavaClass information. |
Method Summary | |
public boolean | areAssertionsEnabled() | int | computeInstanceDataOffset() | int | computeInstanceDataSize() | int | computeStaticDataSize() | int | createClassObject(ThreadInfo th, int cref) | public Fields | createInstanceFields() Creates the fields for an object. | protected static SyntheticRepository | createRepository(Config config) | Fields | createStaticFields(StaticArea staticArea) Creates the fields for a class. | public Instruction | executeNativeMethod(ThreadInfo th, MethodInfo mi) | public static boolean | exists(String cname) | Set | getAllInterfaces() | boolean | getAssertionStatus() | ClassInfo | getClassBase(String clsBase) | public static synchronized ClassInfo | getClassInfo(String cname) Loads the class specified.
Parameters: cname - The fully qualified name of the class to load. | public int | getClassObjectRef() | ClassInfo | getComponentClassInfo() | public static ConstantPoolGen | getConstantPoolGen(ConstantPool cp) | int | getDataSize(FieldInfo[] fields) | public FieldInfo | getDeclaredInstanceField(String fName) | FieldInfo | getDeclaredInstanceField(int i) | Map | getDeclaredMethods() | public FieldInfo | getDeclaredStaticField(String fName) | static String | getDefaultBootClassPath() | static String | getDefaultClassPath() | public int | getElementInfoAttrs() | public int | getFieldAttrs(int fieldIndex) | MethodInfo | getFinalizer() | int | getInstanceDataOffset() | int | getInstanceDataSize() | public FieldInfo | getInstanceField(String clsBase, String fName) | public FieldInfo | getInstanceField(String fName) | FieldInfo | getInstanceField(int i) | public MethodInfo | getMethod(String uniqueName, boolean isRecursiveLookup) Note that 'uniqueName' is the name plus the argument type part of the
signature, i.e. | public String | getName() Returns the name of the class. | public int | getNumberOfDeclaredInstanceFields() | public int | getNumberOfInstanceFields() | public int | getNumberOfStaticFields() | public String | getPackageName() | public Source | getSource() | public String | getSourceFileName() | int | getStaticDataSize() | public FieldInfo | getStaticField(String clsBase, String fName) | public FieldInfo | getStaticField(String fname) | public FieldInfo | getStaticField(int index) Returns the information about a static field. | public String | getStaticFieldName(int index) Returns the name of a static field. | public ClassInfo | getSuperClass() Return the super class. | public ClassInfo | getSuperClass(String clsName) return the ClassInfo for the provided superclass name. | public String | getType() Returns the type of a class. | boolean | hasImmutableInstances() | boolean | hasRefField(int ref, Fields fv) | static boolean | init(Config config) | public void | initializeClass(ThreadInfo th) | void | initializeInstanceData(Fields f) | void | initializeStaticData(Fields f) | public boolean | instanceOf(String cname) Returns true if the given class is an instance of the class
or interface specified. | public boolean | isArray() | static boolean | isBuiltinClass(String cname) | public boolean | isInstanceOf(ClassInfo ci) | public boolean | isMethodCondDeterministic(ThreadInfo th, MethodInfo mi) | public boolean | isMethodCondExecutable(ThreadInfo th, MethodInfo mi) | public boolean | isRefClass() | public boolean | isReferenceArray() | public boolean | isStaticMethodAbstractionDeterministic(ThreadInfo th, MethodInfo mi) | public boolean | isSystemClass() Returns true if the class is a system class. | public boolean | isWeakReference() | protected static Set | loadArrayInterfaces() | Map | loadArrayMethods() | protected static Set | loadBuiltinInterfaces(String type) | Map | loadBuiltinMethods(String type) | int | loadElementInfoAttrs(JavaClass jc) | FieldInfo[] | loadInstanceFields(JavaClass jc) | void | loadInterfaceRec(Set set, ClassInfo ci) | protected static Set | loadInterfaces(JavaClass jc) Loads the interfaces of a class. | Map | loadMethods(JavaClass jc) | protected Source | loadSource() | FieldInfo[] | loadStaticFields(JavaClass jc) | ClassInfo | loadSuperClass(JavaClass jc) | public static void | reset() | static void | resetCPCache() | static void | setSourceRoots(Config config) |
allInterfaces | protected Set allInterfaces(Code) | | all interfaces (parent interfaces and interface parents) - lazy eval
|
attributor | protected static Attributor attributor(Code) | | optionally used to determine atomic methods of a class (during class loading)
|
classClassInfo | static ClassInfo classClassInfo(Code) | | here we get infinitly recursive, so keep it around for
identity checks
|
cpCache | static ConstantPool cpCache(Code) | | this is a optimization to work around the BCEL strangeness that some
insn info (types etc.) are only accessible with modifiable ConstPools
(the ConstantPoolGen, which is costly to create), and some others
(toString) are only provided via ConstPools. It's way to expensive
to create this always on the fly, for each relevant insn, so we cache it
here
|
cpgCache | static ConstantPoolGen cpgCache(Code) | | |
elementInfoAttrs | protected int elementInfoAttrs(Code) | | type based object attributes (for GC, partial order reduction and
property checks)
|
enableAssertions | boolean enableAssertions(Code) | | |
iFields | protected FieldInfo[] iFields(Code) | | our instance fields.
Note these are NOT flattened, i.e. only contain the declared ones
|
instanceDataOffset | protected int instanceDataOffset(Code) | | where in the instance data array (int[]) do our declared fields start
|
instanceDataSize | protected int instanceDataSize(Code) | | the storage size of instances of this class (stored as an int[])
|
interfaces | final protected Set interfaces(Code) | | Interfaces implemented by the class.
|
isArray | protected boolean isArray(Code) | | |
isClass | protected boolean isClass(Code) | | |
isReferenceArray | protected boolean isReferenceArray(Code) | | |
isWeakReference | protected boolean isWeakReference(Code) | | |
level | static int level(Code) | | Initializes a class. A class is initialized atomically without being
interleaved with any other thread.
<2do> pcm - wrong. static init of a class is only synced on the class
object itself
|
loadedClasses | protected static Hashtable loadedClasses(Code) | | Map of the loaded classes.
|
methods | final protected Map methods(Code) | | all our declared methods (we don't flatten, this is not
a high-performance VM)
|
nInstanceFields | protected int nInstanceFields(Code) | | total number of instance fields (flattened, not only declared ones)
|
nativePeer | NativePeer nativePeer(Code) | | this is the object we use to execute methods in the underlying JVM
(it replaces Reflection)
<2do> pcm - set this private once MethodInfo is cleaned up
|
packageName | final protected String packageName(Code) | | Name of the package.
|
repository | protected static SyntheticRepository repository(Code) | | this is our BCEL class repository. Note that this actually might be
turned into a call or ClassInfo instance field if we ever support
ClassLoaders (for now we keep it simple)
|
sFields | protected FieldInfo[] sFields(Code) | | our static fields. Again, not flattened
|
source | protected Source source(Code) | | Source file associated with the class.
|
sourceFileName | protected String sourceFileName(Code) | | Name of the file which contains the source of this class.
|
staticDataSize | protected int staticDataSize(Code) | | the storage size of static fields of this class (stored as an int[])
|
ClassInfo | protected ClassInfo(String builtinClassName)(Code) | | ClassInfo ctor used for builtin types (arrays and primitive types)
i.e. classes we don't have class files for
|
ClassInfo | protected ClassInfo(JavaClass jc)(Code) | | Creates a new class from the JavaClass information.
|
areAssertionsEnabled | public boolean areAssertionsEnabled()(Code) | | |
computeInstanceDataOffset | int computeInstanceDataOffset()(Code) | | |
computeInstanceDataSize | int computeInstanceDataSize()(Code) | | |
computeStaticDataSize | int computeStaticDataSize()(Code) | | |
createInstanceFields | public Fields createInstanceFields()(Code) | | Creates the fields for an object.
|
createRepository | protected static SyntheticRepository createRepository(Config config)(Code) | | |
createStaticFields | Fields createStaticFields(StaticArea staticArea)(Code) | | Creates the fields for a class. This gets called by the StaticArea
when a class is loaded.
|
getAllInterfaces | Set getAllInterfaces()(Code) | | |
getAssertionStatus | boolean getAssertionStatus()(Code) | | |
getClassInfo | public static synchronized ClassInfo getClassInfo(String cname)(Code) | | Loads the class specified.
Parameters: cname - The fully qualified name of the class to load. Returns the ClassInfo for the classname passed in,or null. |
getClassObjectRef | public int getClassObjectRef()(Code) | | |
getConstantPoolGen | public static ConstantPoolGen getConstantPoolGen(ConstantPool cp)(Code) | | |
getDeclaredInstanceField | public FieldInfo getDeclaredInstanceField(String fName)(Code) | | FieldInfo lookup in the fields that are declared in this class
|
getDeclaredMethods | Map getDeclaredMethods()(Code) | | most definitely not a public method, but handy for the NativePeer
|
getDeclaredStaticField | public FieldInfo getDeclaredStaticField(String fName)(Code) | | FieldInfo lookup in the static fields that are declared in this class
<2do> pcm - should employ a map at some point, but it's usually not that
important since we can cash the returned FieldInfo in the PUT/GET_STATIC insns
|
getDefaultBootClassPath | static String getDefaultBootClassPath()(Code) | | provide a default path from where to load essential model classes
(associated with native peers that JPF needs)
|
getDefaultClassPath | static String getDefaultClassPath()(Code) | | this is for application specific classes that should not be seen by the host VM
|
getElementInfoAttrs | public int getElementInfoAttrs()(Code) | | |
getFieldAttrs | public int getFieldAttrs(int fieldIndex)(Code) | | |
getInstanceDataOffset | int getInstanceDataOffset()(Code) | | |
getInstanceDataSize | int getInstanceDataSize()(Code) | | |
getInstanceField | public FieldInfo getInstanceField(String clsBase, String fName)(Code) | | base relative FieldInfo lookup - the workhorse
<2do> again, should eventually use Maps
Parameters: clsBase - - the class where we start the lookup (self or some super) Parameters: fName - - the field name |
getInstanceField | public FieldInfo getInstanceField(String fName)(Code) | | complete bottom-up FieldInfo lookup
|
getMethod | public MethodInfo getMethod(String uniqueName, boolean isRecursiveLookup)(Code) | | Note that 'uniqueName' is the name plus the argument type part of the
signature, i.e. everything that's relevant for overloading
(besides saving some const space, we also ease reverse lookup
of natives that way).
Note also that we don't have to make any difference between
class and instance methods, because that just matters in the
INVOKExx instruction, when looking up the relevant ClassInfo to start
searching in (either by means of the object type, or by means of the
constpool classname entry).
|
getName | public String getName()(Code) | | Returns the name of the class.
|
getNumberOfDeclaredInstanceFields | public int getNumberOfDeclaredInstanceFields()(Code) | | |
getNumberOfInstanceFields | public int getNumberOfInstanceFields()(Code) | | |
getNumberOfStaticFields | public int getNumberOfStaticFields()(Code) | | |
getStaticDataSize | int getStaticDataSize()(Code) | | |
getStaticField | public FieldInfo getStaticField(int index)(Code) | | Returns the information about a static field.
|
getStaticFieldName | public String getStaticFieldName(int index)(Code) | | Returns the name of a static field.
|
getSuperClass | public ClassInfo getSuperClass()(Code) | | Return the super class.
|
getSuperClass | public ClassInfo getSuperClass(String clsName)(Code) | | return the ClassInfo for the provided superclass name. If this is equal
to ourself, return this (a little bit strange if we hit it in the first place)
|
getType | public String getType()(Code) | | Returns the type of a class.
|
hasImmutableInstances | boolean hasImmutableInstances()(Code) | | |
initializeInstanceData | void initializeInstanceData(Fields f)(Code) | | |
initializeStaticData | void initializeStaticData(Fields f)(Code) | | |
instanceOf | public boolean instanceOf(String cname)(Code) | | Returns true if the given class is an instance of the class
or interface specified.
|
isArray | public boolean isArray()(Code) | | |
isBuiltinClass | static boolean isBuiltinClass(String cname)(Code) | | |
isMethodCondDeterministic | public boolean isMethodCondDeterministic(ThreadInfo th, MethodInfo mi)(Code) | | consult nativePeer to check if method is deterministic
|
isMethodCondExecutable | public boolean isMethodCondExecutable(ThreadInfo th, MethodInfo mi)(Code) | | consult nativePeer to check if method is executable
|
isRefClass | public boolean isRefClass()(Code) | | note this only returns true is this is really the java.lang.ref.Reference classInfo
|
isReferenceArray | public boolean isReferenceArray()(Code) | | |
isStaticMethodAbstractionDeterministic | public boolean isStaticMethodAbstractionDeterministic(ThreadInfo th, MethodInfo mi)(Code) | | Checks if a static method call is deterministic, but only for
abtraction based determinism, due to Bandera.choose() calls
|
isSystemClass | public boolean isSystemClass()(Code) | | Returns true if the class is a system class.
|
isWeakReference | public boolean isWeakReference()(Code) | | is this a (subclass of) WeakReference? this must be efficient, since it's
called in the mark phase on all live objects
|
loadArrayInterfaces | protected static Set loadArrayInterfaces()(Code) | | |
loadArrayMethods | Map loadArrayMethods()(Code) | | |
loadBuiltinInterfaces | protected static Set loadBuiltinInterfaces(String type)(Code) | | |
loadElementInfoAttrs | int loadElementInfoAttrs(JavaClass jc)(Code) | | |
loadInterfaces | protected static Set loadInterfaces(JavaClass jc)(Code) | | Loads the interfaces of a class.
|
loadMethods | Map loadMethods(JavaClass jc)(Code) | | |
reset | public static void reset()(Code) | | clean up statics for another 'main' run
|
resetCPCache | static void resetCPCache()(Code) | | avoid memory leaks
|
setSourceRoots | static void setSourceRoots(Config config)(Code) | | set the locations where we look up sources
|
|
|
|