Package javassist.bytecode
Class StackMapTable.Walker
java.lang.Object
javassist.bytecode.StackMapTable.Walker
- Direct Known Subclasses:
StackMapTable.OffsetShifter,StackMapTable.Printer,StackMapTable.Shifter,StackMapTable.SimpleCopy
- Enclosing class:
- StackMapTable
A code walker for a StackMapTable attribute.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[](package private) int -
Constructor Summary
ConstructorsConstructorDescriptionWalker(byte[] data) Constructs a walker.Walker(StackMapTable smt) Constructs a walker. -
Method Summary
Modifier and TypeMethodDescriptionprivate intappendFrame(int pos, int type) voidappendFrame(int pos, int offsetDelta, int[] tags, int[] data) Invoked if the visited frame is aappend_frame.voidchopFrame(int pos, int offsetDelta, int k) Invoked if the visited frame is achop_frame.private intfullFrame(int pos) voidfullFrame(int pos, int offsetDelta, int[] localTags, int[] localData, int[] stackTags, int[] stackData) Invoked if the visited frame isfull_frame.voidobjectOrUninitialized(int tag, int data, int pos) Invoked ifObject_variable_infoorUninitialized_variable_infois visited.voidparse()Visits each entry of the stack map frames.voidsameFrame(int pos, int offsetDelta) Invoked if the visited frame is asame_frameor asame_frame_extended.private intsameLocals(int pos, int type) voidsameLocals(int pos, int offsetDelta, int stackTag, int stackData) Invoked if the visited frame is asame_locals_1_stack_item_frameor asame_locals_1_stack_item_frame_extended.final intsize()Returns the number of the entries.(package private) intstackMapFrames(int pos, int nth) Invoked when the next entry of the stack map frames is visited.private intverifyTypeInfo(int pos, int n, int[] tags, int[] data)
-
Field Details
-
info
byte[] info -
numOfEntries
int numOfEntries
-
-
Constructor Details
-
Walker
Constructs a walker.- Parameters:
smt- the StackMapTable that this walker walks around.
-
Walker
public Walker(byte[] data) Constructs a walker.- Parameters:
data- theinfofield of theattribute_infostructure. It can be obtained byget()in theAttributeInfoclass.
-
-
Method Details
-
size
public final int size()Returns the number of the entries. -
parse
Visits each entry of the stack map frames.- Throws:
BadBytecode
-
stackMapFrames
Invoked when the next entry of the stack map frames is visited.- Parameters:
pos- the position of the frame in theinfofield ofattribute_infostructure.nth- the frame is the N-th (0, 1st, 2nd, 3rd, 4th, ...) entry.- Returns:
- the position of the next frame.
- Throws:
BadBytecode
-
sameFrame
Invoked if the visited frame is asame_frameor asame_frame_extended.- Parameters:
pos- the position of this frame in theinfofield ofattribute_infostructure.offsetDelta-- Throws:
BadBytecode
-
sameLocals
- Throws:
BadBytecode
-
sameLocals
Invoked if the visited frame is asame_locals_1_stack_item_frameor asame_locals_1_stack_item_frame_extended.- Parameters:
pos- the position.offsetDelta-stackTag-stack[0].tag.stackData-stack[0].cpool_indexif the tag isOBJECT, orstack[0].offsetif the tag isUNINIT.- Throws:
BadBytecode
-
chopFrame
Invoked if the visited frame is achop_frame.- Parameters:
pos- the position.offsetDelta-k- theklast locals are absent.- Throws:
BadBytecode
-
appendFrame
- Throws:
BadBytecode
-
appendFrame
Invoked if the visited frame is aappend_frame.- Parameters:
pos- the position.offsetDelta-tags-locals[i].tag.data-locals[i].cpool_indexorlocals[i].offset.- Throws:
BadBytecode
-
fullFrame
- Throws:
BadBytecode
-
fullFrame
public void fullFrame(int pos, int offsetDelta, int[] localTags, int[] localData, int[] stackTags, int[] stackData) throws BadBytecode Invoked if the visited frame isfull_frame.- Parameters:
pos- the position.offsetDelta-localTags-locals[i].taglocalData-locals[i].cpool_indexorlocals[i].offsetstackTags-stack[i].tagstackData-stack[i].cpool_indexorstack[i].offset- Throws:
BadBytecode
-
verifyTypeInfo
private int verifyTypeInfo(int pos, int n, int[] tags, int[] data) -
objectOrUninitialized
public void objectOrUninitialized(int tag, int data, int pos) Invoked ifObject_variable_infoorUninitialized_variable_infois visited.- Parameters:
tag-OBJECTorUNINIT.data- the value ofcpool_indexoroffset.pos- the position ofcpool_indexoroffset.
-