final class SymbolTable
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
className
The internal name of the class to which this symbol table belongs.
|
(package private) ClassWriter |
classWriter |
(package private) ByteVector |
constantPool
The content of the ClassFile's constant_pool JVMS structure corresponding to this SymbolTable.
|
(package private) int |
constantPoolCount
The number of constant pool items in
constantPool, plus 1. |
private Symbol[] |
entries |
private int |
entryCount |
private int |
typeCount
The actual number of elements in
typeTable. |
(package private) Symbol[] |
typeTable |
| Constructor and Description |
|---|
SymbolTable(ClassWriter classWriter)
Constructs a new, empty SymbolTable for the given ClassWriter.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) Symbol |
addConstantIntegerOrFloat(int value) |
(package private) Symbol |
addConstantLongOrDouble(long value) |
(package private) Symbol |
addConstantMemberReference(int tag,
java.lang.String owner,
java.lang.String name,
java.lang.String descriptor) |
(package private) int |
addConstantNameAndType(java.lang.String name,
java.lang.String descriptor)
Adds a CONSTANT_NameAndType_info to the constant pool of this symbol table.
|
(package private) int |
addConstantUtf8(java.lang.String value)
Adds a CONSTANT_Utf8_info to the constant pool of this symbol table.
|
(package private) Symbol |
addConstantUtf8Reference(int tag,
java.lang.String value) |
(package private) int |
addMergedType(int typeTableIndex1,
int typeTableIndex2) |
(package private) int |
addType(java.lang.String value)
Adds a type in the type table of this symbol table.
|
private int |
addTypeInternal(Symbol entry) |
(package private) int |
addUninitializedType(java.lang.String value,
int bytecodeOffset)
Adds an
Frame.ITEM_UNINITIALIZED type in the type table of this symbol table. |
private Symbol |
put(Symbol entry)
Puts the given entry in the
entries hash set. |
(package private) int |
setMajorVersionAndClassName(int majorVersion,
java.lang.String className)
Sets the major version and the name of the class to which this symbol table belongs.
|
final ClassWriter classWriter
java.lang.String className
private int entryCount
private Symbol[] entries
int constantPoolCount
constantPool, plus 1. The first constant pool
item has index 1, and long and double items count for two items.final ByteVector constantPool
private int typeCount
typeTable. These elements are stored from index 0 to
typeCount (excluded). The other array entries are empty.Symbol[] typeTable
SymbolTable(ClassWriter classWriter)
classWriter - a ClassWriter.int setMajorVersionAndClassName(int majorVersion,
java.lang.String className)
majorVersion - a major ClassFile version number.className - an internal class name.private Symbol put(Symbol entry)
entries hash set. This method does not check
whether entries already contains a similar entry or not. entries is resized
if necessary to avoid hash collisions (multiple entries needing to be stored at the same entries array index) as much as possible, with reasonable memory usage.entry - an Entry (which must not already be contained in entries).Symbol addConstantMemberReference(int tag, java.lang.String owner, java.lang.String name, java.lang.String descriptor)
Symbol addConstantIntegerOrFloat(int value)
Symbol addConstantLongOrDouble(long value)
int addConstantNameAndType(java.lang.String name,
java.lang.String descriptor)
name - a field or method name.descriptor - a field or method descriptor.int addConstantUtf8(java.lang.String value)
value - a string.Symbol addConstantUtf8Reference(int tag, java.lang.String value)
int addType(java.lang.String value)
value - an internal class name.int addUninitializedType(java.lang.String value,
int bytecodeOffset)
Frame.ITEM_UNINITIALIZED type in the type table of this symbol table. Does
nothing if the type table already contains a similar type.value - an internal class name.bytecodeOffset - the bytecode offset of the NEW instruction that created this Frame.ITEM_UNINITIALIZED type value.int addMergedType(int typeTableIndex1,
int typeTableIndex2)
private int addTypeInternal(Symbol entry)