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
public static class StackMapTable.Walker extends java.lang.Object
A code walker for a StackMapTable attribute.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]
info
(package private) int
numOfEntries
-
Constructor Summary
Constructors Constructor Description Walker(byte[] data)
Constructs a walker.Walker(StackMapTable smt)
Constructs a walker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
appendFrame(int pos, int type)
void
appendFrame(int pos, int offsetDelta, int[] tags, int[] data)
Invoked if the visited frame is aappend_frame
.void
chopFrame(int pos, int offsetDelta, int k)
Invoked if the visited frame is achop_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 isfull_frame
.void
objectOrUninitialized(int tag, int data, int pos)
Invoked ifObject_variable_info
orUninitialized_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 asame_frame
or asame_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 asame_locals_1_stack_item_frame
or asame_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)
-
-
-
Constructor Detail
-
Walker
public Walker(StackMapTable smt)
Constructs a walker.- Parameters:
smt
- the StackMapTable that this walker walks around.
-
Walker
public Walker(byte[] data)
Constructs a walker.- Parameters:
data
- theinfo
field of theattribute_info
structure. It can be obtained byget()
in theAttributeInfo
class.
-
-
Method Detail
-
size
public final int size()
Returns the number of the entries.
-
parse
public void parse() throws BadBytecode
Visits each entry of the stack map frames.- Throws:
BadBytecode
-
stackMapFrames
int stackMapFrames(int pos, int nth) throws BadBytecode
Invoked when the next entry of the stack map frames is visited.- Parameters:
pos
- the position of the frame in theinfo
field ofattribute_info
structure.nth
- the frame is the N-th (0, 1st, 2nd, 3rd, 4th, ...) entry.- Returns:
- the position of the next frame.
- Throws:
BadBytecode
-
sameFrame
public void sameFrame(int pos, int offsetDelta) throws BadBytecode
Invoked if the visited frame is asame_frame
or asame_frame_extended
.- Parameters:
pos
- the position of this frame in theinfo
field ofattribute_info
structure.offsetDelta
-- Throws:
BadBytecode
-
sameLocals
private int sameLocals(int pos, int type) throws BadBytecode
- Throws:
BadBytecode
-
sameLocals
public void sameLocals(int pos, int offsetDelta, int stackTag, int stackData) throws BadBytecode
Invoked if the visited frame is asame_locals_1_stack_item_frame
or asame_locals_1_stack_item_frame_extended
.- Parameters:
pos
- the position.offsetDelta
-stackTag
-stack[0].tag
.stackData
-stack[0].cpool_index
if the tag isOBJECT
, orstack[0].offset
if the tag isUNINIT
.- Throws:
BadBytecode
-
chopFrame
public void chopFrame(int pos, int offsetDelta, int k) throws BadBytecode
Invoked if the visited frame is achop_frame
.- Parameters:
pos
- the position.offsetDelta
-k
- thek
last locals are absent.- Throws:
BadBytecode
-
appendFrame
private int appendFrame(int pos, int type) throws BadBytecode
- Throws:
BadBytecode
-
appendFrame
public void appendFrame(int pos, int offsetDelta, int[] tags, int[] data) throws BadBytecode
Invoked if the visited frame is aappend_frame
.- Parameters:
pos
- the position.offsetDelta
-tags
-locals[i].tag
.data
-locals[i].cpool_index
orlocals[i].offset
.- Throws:
BadBytecode
-
fullFrame
private int fullFrame(int pos) throws BadBytecode
- 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].tag
localData
-locals[i].cpool_index
orlocals[i].offset
stackTags
-stack[i].tag
stackData
-stack[i].cpool_index
orstack[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_info
orUninitialized_variable_info
is visited.- Parameters:
tag
-OBJECT
orUNINIT
.data
- the value ofcpool_index
oroffset
.pos
- the position ofcpool_index
oroffset
.
-
-