Package javassist.bytecode
Class StackMap
- java.lang.Object
-
- javassist.bytecode.AttributeInfo
-
- javassist.bytecode.StackMap
-
public class StackMap extends AttributeInfo
Anotherstack_mapattribute defined in CLDC 1.1 for J2ME.This is an entry in the attributes table of a Code attribute. It was introduced by J2ME CLDC 1.1 (JSR 139) for pre-verification.
According to the CLDC specification, the sizes of some fields are not 16bit but 32bit if the code size is more than 64K or the number of the local variables is more than 64K. However, for the J2ME CLDC technology, they are always 16bit. The implementation of the StackMap class assumes they are 16bit.
- Since:
- 3.12
- See Also:
MethodInfo.doPreverify,StackMapTable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStackMap.WalkerA code walker for a StackMap attribute.static classStackMap.WriterInternal use only.
-
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 StringtagThe name of this attribute"StackMap".static intTHISUninitializedThis_variable_info.tag.static intTOPTop_variable_info.tag.static intUNINITUninitialized_variable_info.tag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeInfocopy(ConstPool newCp, Map<String,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.intnumOfEntries()Returnsnumber_of_entries.voidprint(PrintWriter out)Prints this stack map.voidremoveNew(int where)Undocumented method.-
Methods inherited from class javassist.bytecode.AttributeInfo
get, getConstPool, getName, length, set
-
-
-
-
Field Detail
-
tag
public static final String tag
The name of this attribute"StackMap".- 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
-
numOfEntries
public int numOfEntries()
Returnsnumber_of_entries.
-
copy
public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames)
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.
-
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. It is available byStackMapTable.typeTagOf(char).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),StackMapTable.typeTagOf(char),ConstPool
-
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 when the NEW opcode (and the following DUP) is removed.
- Parameters:
where- the position of the removed NEW opcode.- Throws:
CannotCompileException
-
print
public void print(PrintWriter out)
Prints this stack map.
-
-