|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JavaElement | +--Klass
Field Summary | |
(package private) int |
access_flags
|
(package private) AttributeTable |
attributes
|
(package private) static boolean[] |
BytecodeUsed
array giving the bytecodes used in our program. |
private static java.util.Hashtable |
Classes
hashtable: classname string -> Klass object. |
(package private) int |
classIndex
the index of this class in structures like the ClassTable. |
(package private) static int |
CLASSINFO_ARRAY
code for a scalar-array class. |
(package private) static int |
CLASSINFO_ARRAYOFOBJECTS
code for an object-array class. |
(package private) static int |
CLASSINFO_OBJECT
code for a normal class. |
(package private) static java.util.Vector |
ClassList
vector of all Klass objects. |
(package private) java.lang.String |
className
name of the class. classname in slash-syntax for ordinary classes, signature with '[' for array classes, signature enclosed in dashes for primitive types. |
(package private) ConstantPool |
constant_pool
|
(package private) int |
dataSize
data size of the instance fields, not including management overhead. |
(package private) FieldInfo[] |
fields
|
(package private) int |
fullVtableSize
number of entries in the virtual-or-interface function table for this class. |
(package private) int |
instanceofClassIndex
the index of this class for 'instanceof' checks. |
(package private) static java.util.Vector |
instanceofTargetClassList
vector of all target classes for 'instanceof' checks. |
(package private) Klass[] |
interfaces
|
(package private) boolean[] |
itable
the 'instanceof' compatibility array for this class. |
(package private) int |
magic
|
(package private) int |
major_version
|
(package private) MethodInfo[] |
methods
|
(package private) int |
minor_version
|
(package private) static java.util.Vector |
neededObjectFields
vector of all needed static fields of object type. |
(package private) static java.util.Vector |
neededScalarFields
vector of all needed static fields of scalar type. |
(package private) java.util.Vector |
subclasses
(for a class) list of direct subclasses -or- (for an interface) list of subinterfaces and directly implementing classes. |
(package private) Klass |
superclass
|
(package private) static java.util.Vector |
targetClassList
vector of all classes having an explicit representation in our resulting target code. |
(package private) java.util.Vector |
vtable
the virtual-or-interface function table of this class. |
Fields inherited from class JavaElement |
EXACT_INSTANCE_NEEDED,
INSTANCE_NEEDED,
NEEDED,
NEEDED_INSTANCEOF,
NEEDED_VIRTUALLY,
neededModeAddOn,
neededModeBasic,
neededReasons,
UNNEEDED |
Constructor Summary | |
(package private) |
Klass(java.lang.String classname)
construct a non-loaded class (like an array class) that's completely defined by its name/Signature. |
(package private) |
Klass(java.lang.String classname,
java.io.InputStream instream)
construct a class from a class file |
Method Summary | |
private void |
addAllSubclasses(java.util.Vector coll)
|
private void |
addAllSuperclasses(java.util.Vector coll)
|
(package private) void |
addSubclass(Klass cl)
helper method for the contruction's phase: register a subclass. |
(package private) static void |
assignAllClassIndices()
assign class indices to all needed classes. |
(package private) static java.util.Vector |
clinitOrdering()
compute an appropriate ordering of the needed <clinit> methods. |
(package private) void |
fillItable()
compute the 'instanceof' class compatibility table 'itable' for this class. |
(package private) FieldInfo |
findField(java.lang.String name)
finds a field with a given name. |
(package private) MethodInfo |
findMethod(java.lang.String name)
finds a method with given name in this class and its superclasses. |
(package private) MethodInfo |
findMethod(java.lang.String name,
java.lang.String signature)
finds a method with given name and signature (exact!) |
(package private) static Klass |
forName(java.lang.String name)
returns a class descriptor for a class with a given name. |
(package private) static Klass |
forSignature(java.lang.String signature)
returns a class descriptor for a given type signature. |
(package private) static boolean[] |
getAllBytecodesUsed()
returns an array showing all bytecodes used in all classes. |
(package private) java.util.Vector |
getAllSubclasses()
return a Vector of all (currently known) subclasses. |
(package private) java.util.Vector |
getAllSuperclasses()
return a Vector of all superclasses and implemented interfaces. |
(package private) java.lang.String |
getSignature()
returns the classname in signature syntax. |
(package private) boolean |
hasSuperclass(Klass sup)
check whether this class has a given class as direct or indirect superclass. |
(package private) boolean |
isCastableTo(Klass target)
check whether a direct instance of this class can be cast to the 'target' class. |
(package private) void |
layoutFields()
lay out the fields of this class. |
(package private) static void |
layoutFieldsAll()
lay out the fields for all classes |
(package private) static void |
layoutItableAll()
compute the 'instanceof' class compatibility table 'itable' for all classes. |
(package private) static void |
layoutVtableAll()
lay out the vtables for all classes and interfaces. |
(package private) void |
markBytecodesUsed(boolean[] bytecodesUsed)
marks the bytecodes used in the needed methods of this class. |
(package private) void |
markNeeded(java.lang.Object reason,
int mode)
mark this class needed in a specific mode, adding logically to the current mode. |
(package private) void |
report()
|
(package private) static void |
reportAll()
print to System.out a report on all classes and their elements. |
java.lang.String |
toString()
the full name of this class. |
(package private) static void |
updateAll()
do one iteration to update the 'needed' state of all elements. |
(package private) void |
updateNeeded()
update the 'needed' state of this class and the elements this class depends upon. |
void |
writeNeeded(java.lang.String baseDir)
write a new classfile containing only the needed parts of this class. |
(package private) static void |
writeNeededAll(java.lang.String baseDir)
write all needed classes (only the needed elements) to new classfiles. |
Methods inherited from class JavaElement |
isNeeded,
isNeeded |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int CLASSINFO_OBJECT
static final int CLASSINFO_ARRAY
static final int CLASSINFO_ARRAYOFOBJECTS
private static java.util.Hashtable Classes
static java.util.Vector ClassList
static java.util.Vector targetClassList
static java.util.Vector instanceofTargetClassList
static java.util.Vector neededScalarFields
static java.util.Vector neededObjectFields
static boolean[] BytecodeUsed
int magic
int minor_version
int major_version
ConstantPool constant_pool
int access_flags
Klass superclass
Klass[] interfaces
java.util.Vector subclasses
FieldInfo[] fields
MethodInfo[] methods
AttributeTable attributes
java.lang.String className
int classIndex
int instanceofClassIndex
int dataSize
int fullVtableSize
java.util.Vector vtable
boolean[] itable
Let
Constructor Detail |
Klass(java.lang.String classname)
Klass(java.lang.String classname, java.io.InputStream instream) throws java.io.IOException
Method Detail |
static Klass forName(java.lang.String name)
static Klass forSignature(java.lang.String signature)
void addSubclass(Klass cl)
void markNeeded(java.lang.Object reason, int mode)
reason
- the reason why this element is needed
(normally another JavaElement referencing this one).mode
- a mode constant describing how this element is needed.void updateNeeded()
static void updateAll()
void markBytecodesUsed(boolean[] bytecodesUsed)
static boolean[] getAllBytecodesUsed()
void layoutFields()
static void layoutFieldsAll()
static void layoutVtableAll()
static void assignAllClassIndices()
static java.util.Vector clinitOrdering()
void fillItable()
static void layoutItableAll()
java.lang.String getSignature()
FieldInfo findField(java.lang.String name)
MethodInfo findMethod(java.lang.String name, java.lang.String signature)
MethodInfo findMethod(java.lang.String name)
boolean isCastableTo(Klass target)
boolean hasSuperclass(Klass sup)
java.util.Vector getAllSuperclasses()
private void addAllSuperclasses(java.util.Vector coll)
java.util.Vector getAllSubclasses()
private void addAllSubclasses(java.util.Vector coll)
public void writeNeeded(java.lang.String baseDir) throws java.io.IOException
The method does its work by creating a new classfile from the internal representations of the class members.
static void writeNeededAll(java.lang.String baseDir)
public java.lang.String toString()
void report()
static void reportAll()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |