stack_map attribute 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.
MethodInfo#doPreverify, StackMapTable
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | |
| public static class | StackMap.
A code walker for a StackMap attribute. |
| public static class | StackMap.
Internal use only. |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DOUBLE
|
| public static final int | FLOAT
|
| public static final int | INTEGER
|
| public static final int | LONG
|
| public static final int | NULL
|
| public static final int | OBJECT
|
| public static final String | tag
The name of this attribute |
| public static final int | THIS
|
| public static final int | TOP
|
| public static final int | UNINIT
|
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public AttributeInfo | |
| public void | insertLocal(int
the index of the added local variable. index, int the type tag of that local variable.
It is available by tag, int StackMapTable.typeTagOf(char).the index of the classInfo)CONSTANT_Class_info structure
in a constant pool table. This should be zero unless the tag
is ITEM_Object.Updates this stack map table when a new local variable is inserted for a new parameter. |
| public int | |
| public void | |
| public void | |
| pack-priv void | |
| pack-priv void |
| DOUBLE | back to summary |
|---|---|
| public static final int DOUBLE
| |
| FLOAT | back to summary |
|---|---|
| public static final int FLOAT
| |
| INTEGER | back to summary |
|---|---|
| public static final int INTEGER
| |
| LONG | back to summary |
|---|---|
| public static final int LONG
| |
| NULL | back to summary |
|---|---|
| public static final int NULL
| |
| OBJECT | back to summary |
|---|---|
| public static final int OBJECT
| |
| tag | back to summary |
|---|---|
| public static final String tag The name of this attribute | |
| THIS | back to summary |
|---|---|
| public static final int THIS
| |
| TOP | back to summary |
|---|---|
| public static final int TOP
| |
| UNINIT | back to summary |
|---|---|
| public static final int UNINIT
| |
| StackMap | back to summary |
|---|---|
| pack-priv StackMap(ConstPool cp, byte[] newInfo) Constructs a | |
| StackMap | back to summary |
|---|---|
| pack-priv StackMap(ConstPool cp, int name_id, DataInputStream in) throws IOException | |
| copy | back to summary |
|---|---|
| public AttributeInfo copy(ConstPool newCp, Map<String, String> classnames) Overrides javassist. Makes a copy.
| |
| insertLocal | back to summary |
|---|---|
| public void insertLocal(int index, int tag, int classInfo) throws BadBytecode Updates this stack map table when a new local variable is inserted for a new parameter.
| |
| numOfEntries | back to summary |
|---|---|
| public int numOfEntries() Returns | |
| back to summary | |
|---|---|
| public void print(PrintWriter out) Prints this stack map. | |
| removeNew | back to summary |
|---|---|
| public void removeNew(int where) throws CannotCompileException Undocumented 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.
| |
| shiftForSwitch | back to summary |
|---|---|
| pack-priv void shiftForSwitch(int where, int gapSize) throws BadBytecode | |
| shiftPc | back to summary |
|---|---|
| pack-priv void shiftPc(int where, int gapSize, boolean exclusive) throws BadBytecode | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Map | |
| pack-priv byte[] | |
| pack-priv ConstPool | |
| pack-priv ConstPool |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public StackMap | |
| public int | locals(int pos, int offset, int num)
Overrides javassist. Invoked when |
| public void | objectVariable(int pos, int clazz)
Overrides javassist. Invoked when an element of type |
| public void | typeInfo(int pos, byte tag)
Overrides javassist. Invoked when an element of |
| public int | typeInfoArray(int pos, int offset, int
the number of elements. num, boolean true if this array is for isLocals)locals.
false if it is for stack.Overrides javassist. Invoked when an array of |
| public void | uninitialized(int pos, int offset)
Overrides javassist. Invoked when an element of type |
| public void | visit()
Overrides javassist. Visits each entry of the stack map frames. |
| classnames | back to summary |
|---|---|
| pack-priv Map<String, String> classnames | |
| dest | back to summary |
|---|---|
| pack-priv byte[] dest | |
| destCp | back to summary |
|---|---|
| pack-priv ConstPool destCp | |
| srcCp | back to summary |
|---|---|
| pack-priv ConstPool srcCp | |
| Copier | back to summary |
|---|---|
| pack-priv Copier(StackMap map, ConstPool newCp, Map<String, String> classnames) | |
| getStackMap | back to summary |
|---|---|
| public StackMap getStackMap() | |
| locals | back to summary |
|---|---|
| public int locals(int pos, int offset, int num) Overrides javassist. Doc from javassist. Invoked when
| |
| objectVariable | back to summary |
|---|---|
| public void objectVariable(int pos, int clazz) Overrides javassist. Doc from javassist. Invoked when an element of type
| |
| typeInfo | back to summary |
|---|---|
| public void typeInfo(int pos, byte tag) Overrides javassist. Doc from javassist. Invoked when an element of
| |
| typeInfoArray | back to summary |
|---|---|
| public int typeInfoArray(int pos, int offset, int num, boolean isLocals) Overrides javassist. Doc from javassist. Invoked when an array of
| |
| uninitialized | back to summary |
|---|---|
| public void uninitialized(int pos, int offset) Overrides javassist. Doc from javassist. Invoked when an element of type
| |
| visit | back to summary |
|---|---|
| public void visit() Overrides javassist. Doc from javassist. Visits each entry of the stack map frames.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | typeInfoArray(int pos, int offset, int
the number of elements. num, boolean true if this array is for isLocals)locals.
false if it is for stack.Overrides javassist. Invoked when an array of |
| private void |
| varData | back to summary |
|---|---|
| private int varData | |
| varIndex | back to summary |
|---|---|
| private int varIndex | |
| varTag | back to summary |
|---|---|
| private int varTag | |
| InsertLocal | back to summary |
|---|---|
| pack-priv InsertLocal(StackMap map, int varIndex, int varTag, int varData) | |
| typeInfoArray | back to summary |
|---|---|
| public int typeInfoArray(int pos, int offset, int num, boolean isLocals) Overrides javassist. Doc from javassist. Invoked when an array of
| |
| writeVarTypeInfo | back to summary |
|---|---|
| private void writeVarTypeInfo() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | stack(int pos, int offset, int num)
Overrides javassist. Invoked when |
| private int |
| posOfNew | back to summary |
|---|---|
| pack-priv int posOfNew | |
| NewRemover | back to summary |
|---|---|
| pack-priv NewRemover(StackMap map, int where) | |
| stack | back to summary |
|---|---|
| public int stack(int pos, int offset, int num) Overrides javassist. Doc from javassist. Invoked when
| |
| stackTypeInfoArray | back to summary |
|---|---|
| private int stackTypeInfoArray(int pos, int offset, int num) | |
| Modifier and Type | Field and Description |
|---|---|
| private PrintWriter |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | locals(int pos, int offset, int num)
Overrides javassist. Invoked when |
| public void |
| writer | back to summary |
|---|---|
| private PrintWriter writer | |
| Printer | back to summary |
|---|---|
| public Printer(StackMap map, PrintWriter out) | |
| locals | back to summary |
|---|---|
| public int locals(int pos, int offset, int num) Overrides javassist. Doc from javassist. Invoked when
| |
| back to summary | |
|---|---|
| public void print() | |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | locals(int pos, int offset, int num)
Overrides javassist. Invoked when |
| public void | uninitialized(int pos, int offset)
Overrides javassist. Invoked when an element of type |
| exclusive | back to summary |
|---|---|
| private boolean exclusive | |
| gap | back to summary |
|---|---|
| private int gap | |
| where | back to summary |
|---|---|
| private int where | |
| Shifter | back to summary |
|---|---|
| public Shifter(StackMap smt, int where, int gap, boolean exclusive) | |
| locals | back to summary |
|---|---|
| public int locals(int pos, int offset, int num) Overrides javassist. Doc from javassist. Invoked when
| |
| uninitialized | back to summary |
|---|---|
| public void uninitialized(int pos, int offset) Overrides javassist. Doc from javassist. Invoked when an element of type
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv StackMap. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv byte[] | |
| public int | locals(int pos, int offset, int num)
Overrides javassist. Invoked when |
| public void | objectVariable(int pos, int clazz)
Overrides javassist. Invoked when an element of type |
| public void | typeInfo(int pos, byte tag)
Overrides javassist. Invoked when an element of |
| public int | typeInfoArray(int pos, int offset, int
the number of elements. num, boolean true if this array is for isLocals)locals.
false if it is for stack.Overrides javassist. Invoked when an array of |
| public void | uninitialized(int pos, int offset)
Overrides javassist. Invoked when an element of type |
| public void | visit()
Overrides javassist. Visits each entry of the stack map frames. |
| writer | back to summary |
|---|---|
| pack-priv StackMap. | |
| SimpleCopy | back to summary |
|---|---|
| pack-priv SimpleCopy(StackMap map) | |
| doit | back to summary |
|---|---|
| pack-priv byte[] doit() | |
| locals | back to summary |
|---|---|
| public int locals(int pos, int offset, int num) Overrides javassist. Doc from javassist. Invoked when
| |
| objectVariable | back to summary |
|---|---|
| public void objectVariable(int pos, int clazz) Overrides javassist. Doc from javassist. Invoked when an element of type
| |
| typeInfo | back to summary |
|---|---|
| public void typeInfo(int pos, byte tag) Overrides javassist. Doc from javassist. Invoked when an element of
| |
| typeInfoArray | back to summary |
|---|---|
| public int typeInfoArray(int pos, int offset, int num, boolean isLocals) Overrides javassist. Doc from javassist. Invoked when an array of
| |
| uninitialized | back to summary |
|---|---|
| public void uninitialized(int pos, int offset) Overrides javassist. Doc from javassist. Invoked when an element of type
| |
| visit | back to summary |
|---|---|
| public void visit() Overrides javassist. Doc from javassist. Visits each entry of the stack map frames.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | locals(int pos, int offset, int num)
Overrides javassist. Invoked when |
| SwitchShifter | back to summary |
|---|---|
| public SwitchShifter(StackMap smt, int where, int gap) | |
| locals | back to summary |
|---|---|
| public int locals(int pos, int offset, int num) Overrides javassist. Doc from javassist. Invoked when
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv byte[] |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public void | |
| public int | |
| public void | typeInfo(int pos, byte tag)
Invoked when an element of |
| public int | typeInfoArray(int pos, int offset, int
the number of elements. num, boolean true if this array is for isLocals)locals.
false if it is for stack.Invoked when an array of |
| pack-priv int | |
| public void | uninitialized(int pos, int offset)
Invoked when an element of type |
| public void |
| info | back to summary |
|---|---|
| pack-priv byte[] info | |
| Walker | back to summary |
|---|---|
| public Walker(StackMap sm) Constructs a walker. | |
| locals | back to summary |
|---|---|
| public int locals(int pos, int offset, int num) Invoked when | |
| objectVariable | back to summary |
|---|---|
| public void objectVariable(int pos, int clazz) Invoked when an element of type | |
| stack | back to summary |
|---|---|
| public int stack(int pos, int offset, int num) Invoked when | |
| typeInfo | back to summary |
|---|---|
| public void typeInfo(int pos, byte tag) Invoked when an element of | |
| typeInfoArray | back to summary |
|---|---|
| public int typeInfoArray(int pos, int offset, int num, boolean isLocals) Invoked when an array of
| |
| typeInfoArray2 | back to summary |
|---|---|
| pack-priv int typeInfoArray2(int k, int pos) | |
| uninitialized | back to summary |
|---|---|
| public void uninitialized(int pos, int offset) Invoked when an element of type | |
| visit | back to summary |
|---|---|
| public void visit() Visits each entry of the stack map frames. | |
| Modifier and Type | Field and Description |
|---|---|
| private ByteArrayOutputStream |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public byte[] | |
| public StackMap | |
| public void | |
| public void | writeVerifyTypeInfo(int tag, int
cpool_index or offset.Writes a |
| output | back to summary |
|---|---|
| private ByteArrayOutputStream output | |
| Writer | back to summary |
|---|---|
| public Writer() Constructs a writer. | |
| toByteArray | back to summary |
|---|---|
| public byte[] toByteArray() Converts the written data into a byte array. | |
| toStackMap | back to summary |
|---|---|
| public StackMap toStackMap(ConstPool cp) Converts to a | |
| write16bit | back to summary |
|---|---|
| public void write16bit(int value) Writes a 16bit value. | |
| writeVerifyTypeInfo | back to summary |
|---|---|
| public void writeVerifyTypeInfo(int tag, int data) Writes a
| |