Package javassist.bytecode
Class StackMapTable
- java.lang.Object
-
- javassist.bytecode.AttributeInfo
-
- javassist.bytecode.StackMapTable
-
public class StackMapTable extends AttributeInfo
stack_mapattribute.This is an entry in the attributes table of a Code attribute. It was introduced by J2SE 6 for the verification by typechecking.
- Since:
- 3.4
- See Also:
StackMap
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classStackMapTable.Copier(package private) static classStackMapTable.InsertLocal(package private) static classStackMapTable.NewRemover(package private) static classStackMapTable.OffsetShifter(package private) static classStackMapTable.Printerstatic classStackMapTable.RuntimeCopyExceptionAn exception that may be thrown bycopy()inStackMapTable.(package private) static classStackMapTable.Shifter(package private) static classStackMapTable.SimpleCopy(package private) static classStackMapTable.SwitchShifterstatic classStackMapTable.WalkerA code walker for a StackMapTable attribute.static classStackMapTable.WriterA writer of stack map tables.
-
Field Summary
Fields Modifier and Type Field Description static intDOUBLEDouble_variable_info.tag.static intFLOATFloat_variable_info.tag.static intINTEGERInteger_variable_info.tag.static intLONGLong_variable_info.tag.static intNULLNull_variable_info.tag.static intOBJECTObject_variable_info.tag.static java.lang.StringtagThe name of this attribute"StackMapTable".static intTHISUninitializedThis_variable_info.tag.static intTOPTop_variable_info.tag.static intUNINITUninitialized_variable_info.tag.-
Fields inherited from class javassist.bytecode.AttributeInfo
constPool, info, name
-
-
Constructor Summary
Constructors Constructor Description StackMapTable(ConstPool cp, byte[] newInfo)Constructs astack_mapattribute.StackMapTable(ConstPool cp, int name_id, java.io.DataInputStream in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeInfocopy(ConstPool newCp, java.util.Map<java.lang.String,java.lang.String> classnames)Makes a copy.voidinsertLocal(int index, int tag, int classInfo)Updates this stack map table when a new local variable is inserted for a new parameter.voidprintln(java.io.PrintStream ps)Prints the stack table map.voidprintln(java.io.PrintWriter w)Prints the stack table map.voidremoveNew(int where)Undocumented method.(package private) voidshiftForSwitch(int where, int gapSize)(package private) voidshiftPc(int where, int gapSize, boolean exclusive)static inttypeTagOf(char descriptor)Returns the tag of the type specified by the descriptor.(package private) voidwrite(java.io.DataOutputStream out)-
Methods inherited from class javassist.bytecode.AttributeInfo
copyAll, get, getConstPool, getLength, getName, getRefClasses, getRefClasses, length, lookup, read, remove, renameClass, renameClass, renameClass, renameClass, set, writeAll
-
-
-
-
Field Detail
-
tag
public static final java.lang.String tag
The name of this attribute"StackMapTable".- See Also:
- Constant Field Values
-
TOP
public static final int TOP
Top_variable_info.tag.- See Also:
- Constant Field Values
-
INTEGER
public static final int INTEGER
Integer_variable_info.tag.- See Also:
- Constant Field Values
-
FLOAT
public static final int FLOAT
Float_variable_info.tag.- See Also:
- Constant Field Values
-
DOUBLE
public static final int DOUBLE
Double_variable_info.tag.- See Also:
- Constant Field Values
-
LONG
public static final int LONG
Long_variable_info.tag.- See Also:
- Constant Field Values
-
NULL
public static final int NULL
Null_variable_info.tag.- See Also:
- Constant Field Values
-
THIS
public static final int THIS
UninitializedThis_variable_info.tag.- See Also:
- Constant Field Values
-
OBJECT
public static final int OBJECT
Object_variable_info.tag.- See Also:
- Constant Field Values
-
UNINIT
public static final int UNINIT
Uninitialized_variable_info.tag.- See Also:
- Constant Field Values
-
-
Method Detail
-
copy
public AttributeInfo copy(ConstPool newCp, java.util.Map<java.lang.String,java.lang.String> classnames) throws StackMapTable.RuntimeCopyException
Makes a copy.- Overrides:
copyin classAttributeInfo- Parameters:
newCp- the constant pool table used by the new copy.classnames- pairs of replaced and substituted class names.- Throws:
StackMapTable.RuntimeCopyException- if aBadBytecodeexception is thrown while copying, it is converted intoRuntimeCopyException.
-
write
void write(java.io.DataOutputStream out) throws java.io.IOException- Overrides:
writein classAttributeInfo- Throws:
java.io.IOException
-
insertLocal
public void insertLocal(int index, int tag, int classInfo) throws BadBytecodeUpdates this stack map table when a new local variable is inserted for a new parameter.- Parameters:
index- the index of the added local variable.tag- the type tag of that local variable.classInfo- the index of theCONSTANT_Class_infostructure in a constant pool table. This should be zero unless the tag isITEM_Object.- Throws:
BadBytecode- See Also:
CtBehavior.addParameter(javassist.CtClass),typeTagOf(char),ConstPool
-
typeTagOf
public static int typeTagOf(char descriptor)
Returns the tag of the type specified by the descriptor. This method returnsINTEGERunless the descriptor is either D (double), F (float), J (long), L (class type), or [ (array).- Parameters:
descriptor- the type descriptor.- See Also:
Descriptor
-
println
public void println(java.io.PrintWriter w)
Prints the stack table map.
-
println
public void println(java.io.PrintStream ps)
Prints the stack table map.- Parameters:
ps- a print stream such asSystem.out.
-
shiftPc
void shiftPc(int where, int gapSize, boolean exclusive) throws BadBytecode- Throws:
BadBytecode
-
shiftForSwitch
void shiftForSwitch(int where, int gapSize) throws BadBytecode- Throws:
BadBytecode- See Also:
CodeIterator.Switcher.adjustOffsets(int, int)
-
removeNew
public void removeNew(int where) throws CannotCompileExceptionUndocumented method. Do not use; internal-use only.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.
- Parameters:
where- the position of the removed NEW opcode.- Throws:
CannotCompileException
-
-