public class StackMapTable extends AttributeInfo
stack_map
attribute.
This is an entry in the attributes table of a Code attribute. It was introduced by J2SE 6 for the verification by typechecking.
StackMap
Modifier and Type | Class and Description |
---|---|
(package private) static class |
StackMapTable.Copier |
(package private) static class |
StackMapTable.InsertLocal |
(package private) static class |
StackMapTable.NewRemover |
(package private) static class |
StackMapTable.OffsetShifter |
(package private) static class |
StackMapTable.Printer |
static class |
StackMapTable.RuntimeCopyException
An exception that may be thrown by
copy()
in StackMapTable . |
(package private) static class |
StackMapTable.Shifter |
(package private) static class |
StackMapTable.SimpleCopy |
(package private) static class |
StackMapTable.SwitchShifter |
static class |
StackMapTable.Walker
A code walker for a StackMapTable attribute.
|
static class |
StackMapTable.Writer
A writer of stack map tables.
|
Modifier and Type | Field and Description |
---|---|
static int |
DOUBLE
Double_variable_info.tag . |
static int |
FLOAT
Float_variable_info.tag . |
static int |
INTEGER
Integer_variable_info.tag . |
static int |
LONG
Long_variable_info.tag . |
static int |
NULL
Null_variable_info.tag . |
static int |
OBJECT
Object_variable_info.tag . |
static java.lang.String |
tag
The name of this attribute
"StackMapTable" . |
static int |
THIS
UninitializedThis_variable_info.tag . |
static int |
TOP
Top_variable_info.tag . |
static int |
UNINIT
Uninitialized_variable_info.tag . |
constPool, info, name
Constructor and Description |
---|
StackMapTable(ConstPool cp,
byte[] newInfo)
Constructs a
stack_map attribute. |
StackMapTable(ConstPool cp,
int name_id,
java.io.DataInputStream in) |
Modifier and Type | Method and Description |
---|---|
AttributeInfo |
copy(ConstPool newCp,
java.util.Map classnames)
Makes a copy.
|
void |
insertLocal(int index,
int tag,
int classInfo)
Updates this stack map table when a new local variable is inserted
for a new parameter.
|
void |
println(java.io.PrintStream ps)
Prints the stack table map.
|
void |
println(java.io.PrintWriter w)
Prints the stack table map.
|
void |
removeNew(int where)
Undocumented method.
|
(package private) void |
shiftForSwitch(int where,
int gapSize) |
(package private) void |
shiftPc(int where,
int gapSize,
boolean exclusive) |
static int |
typeTagOf(char descriptor)
Returns the tag of the type specified by the
descriptor.
|
(package private) void |
write(java.io.DataOutputStream out) |
copyAll, get, getConstPool, getLength, getName, getRefClasses, getRefClasses, length, lookup, read, remove, renameClass, renameClass, renameClass, renameClass, set, writeAll
public static final java.lang.String tag
"StackMapTable"
.public static final int TOP
Top_variable_info.tag
.public static final int INTEGER
Integer_variable_info.tag
.public static final int FLOAT
Float_variable_info.tag
.public static final int DOUBLE
Double_variable_info.tag
.public static final int LONG
Long_variable_info.tag
.public static final int NULL
Null_variable_info.tag
.public static final int THIS
UninitializedThis_variable_info.tag
.public static final int OBJECT
Object_variable_info.tag
.public static final int UNINIT
Uninitialized_variable_info.tag
.StackMapTable(ConstPool cp, byte[] newInfo)
stack_map
attribute.StackMapTable(ConstPool cp, int name_id, java.io.DataInputStream in) throws java.io.IOException
java.io.IOException
public AttributeInfo copy(ConstPool newCp, java.util.Map classnames) throws StackMapTable.RuntimeCopyException
copy
in class AttributeInfo
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted
class names.StackMapTable.RuntimeCopyException
- if a BadBytecode
exception is thrown while copying,
it is converted into
RuntimeCopyException
.void write(java.io.DataOutputStream out) throws java.io.IOException
write
in class AttributeInfo
java.io.IOException
public void insertLocal(int index, int tag, int classInfo) throws BadBytecode
index
- the index of the added local variable.tag
- the type tag of that local variable.classInfo
- the index of the CONSTANT_Class_info
structure
in a constant pool table. This should be zero unless the tag
is ITEM_Object
.BadBytecode
CtBehavior.addParameter(javassist.CtClass)
,
typeTagOf(char)
,
ConstPool
public static int typeTagOf(char descriptor)
INTEGER
unless the descriptor is either D (double), F (float),
J (long), L (class type), or [ (array).descriptor
- the type descriptor.Descriptor
public void println(java.io.PrintWriter w)
public void println(java.io.PrintStream ps)
ps
- a print stream such as System.out
.void shiftPc(int where, int gapSize, boolean exclusive) throws BadBytecode
BadBytecode
void shiftForSwitch(int where, int gapSize) throws BadBytecode
BadBytecode
CodeIterator.Switcher.adjustOffsets(int, int)
public void removeNew(int where) throws CannotCompileException
This method is for javassist.convert.TransformNew. It is called to update the stack map table when the NEW opcode (and the following DUP) is removed.
where
- the position of the removed NEW opcode.CannotCompileException