public static class StackMapTable.Walker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) byte[] |
info |
(package private) int |
numOfEntries |
Constructor and Description |
---|
Walker(byte[] data)
Constructs a walker.
|
Walker(StackMapTable smt)
Constructs a walker.
|
Modifier and Type | Method and Description |
---|---|
private int |
appendFrame(int pos,
int type) |
void |
appendFrame(int pos,
int offsetDelta,
int[] tags,
int[] data)
Invoked if the visited frame is a
append_frame . |
void |
chopFrame(int pos,
int offsetDelta,
int k)
Invoked if the visited frame is a
chop_frame . |
private int |
fullFrame(int pos) |
void |
fullFrame(int pos,
int offsetDelta,
int[] localTags,
int[] localData,
int[] stackTags,
int[] stackData)
Invoked if the visited frame is
full_frame . |
void |
objectOrUninitialized(int tag,
int data,
int pos)
Invoked if
Object_variable_info
or Uninitialized_variable_info is visited. |
void |
parse()
Visits each entry of the stack map frames.
|
void |
sameFrame(int pos,
int offsetDelta)
Invoked if the visited frame is a
same_frame or
a same_frame_extended . |
private int |
sameLocals(int pos,
int type) |
void |
sameLocals(int pos,
int offsetDelta,
int stackTag,
int stackData)
Invoked if the visited frame is a
same_locals_1_stack_item_frame
or a same_locals_1_stack_item_frame_extended . |
int |
size()
Returns the number of the entries.
|
(package private) int |
stackMapFrames(int pos,
int nth)
Invoked when the next entry of the stack map frames is visited.
|
private int |
verifyTypeInfo(int pos,
int n,
int[] tags,
int[] data) |
public Walker(StackMapTable smt)
smt
- the StackMapTable that this walker
walks around.public Walker(byte[] data)
data
- the info
field of the
attribute_info
structure.
It can be obtained by get()
in the AttributeInfo
class.public final int size()
public void parse() throws BadBytecode
BadBytecode
int stackMapFrames(int pos, int nth) throws BadBytecode
pos
- the position of the frame in the info
field of attribute_info
structure.nth
- the frame is the N-th
(0, 1st, 2nd, 3rd, 4th, ...) entry.BadBytecode
public void sameFrame(int pos, int offsetDelta) throws BadBytecode
same_frame
or
a same_frame_extended
.pos
- the position of this frame in the info
field of attribute_info
structure.offsetDelta
- BadBytecode
private int sameLocals(int pos, int type) throws BadBytecode
BadBytecode
public void sameLocals(int pos, int offsetDelta, int stackTag, int stackData) throws BadBytecode
same_locals_1_stack_item_frame
or a same_locals_1_stack_item_frame_extended
.pos
- the position.offsetDelta
- stackTag
- stack[0].tag
.stackData
- stack[0].cpool_index
if the tag is OBJECT
,
or stack[0].offset
if the tag is UNINIT
.BadBytecode
public void chopFrame(int pos, int offsetDelta, int k) throws BadBytecode
chop_frame
.pos
- the position.offsetDelta
- k
- the BadBytecode
private int appendFrame(int pos, int type) throws BadBytecode
BadBytecode
public void appendFrame(int pos, int offsetDelta, int[] tags, int[] data) throws BadBytecode
append_frame
.pos
- the position.offsetDelta
- tags
- locals[i].tag
.data
- locals[i].cpool_index
or BadBytecode
private int fullFrame(int pos) throws BadBytecode
BadBytecode
public void fullFrame(int pos, int offsetDelta, int[] localTags, int[] localData, int[] stackTags, int[] stackData) throws BadBytecode
full_frame
.pos
- the position.offsetDelta
- localTags
- locals[i].tag
localData
- locals[i].cpool_index
or locals[i].offset
stackTags
- stack[i].tag
stackData
- stack[i].cpool_index
or stack[i].offset
BadBytecode
private int verifyTypeInfo(int pos, int n, int[] tags, int[] data)
public void objectOrUninitialized(int tag, int data, int pos)
Object_variable_info
or Uninitialized_variable_info
is visited.tag
- OBJECT
or UNINIT
.data
- the value of cpool_index
or offset
.pos
- the position of cpool_index
or offset
.