Class SuperBlock
java.lang.Object
org.mozilla.classfile.SuperBlock
A super block is defined as a contiguous chunk of code with a single entry
point and multiple exit points (therefore ending in an unconditional jump
or the end of the method). This is used to emulate OpenJDK's compiler, which
outputs stack map frames at the start of every super block except the method
start.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) int
getEnd()
(package private) int
getIndex()
(package private) int[]
(package private) int[]
getStack()
(package private) int
getStart()
(package private) int[]
Get a copy of the super block's locals without any trailing TOP types.(package private) boolean
(package private) boolean
(package private) boolean
merge
(int[] locals, int localsTop, int[] stack, int stackTop, ConstantPool pool) private static boolean
mergeState
(int[] current, int[] incoming, int size, ConstantPool pool) Merge an operand stack or local variable array with incoming state.(package private) void
setInitialized
(boolean b) (package private) void
setInQueue
(boolean b) toString()
-
Field Details
-
index
private int index -
start
private int start -
end
private int end -
locals
private int[] locals -
stack
private int[] stack -
isInitialized
private boolean isInitialized -
isInQueue
private boolean isInQueue
-
-
Constructor Details
-
SuperBlock
SuperBlock(int index, int start, int end, int[] initialLocals)
-
-
Method Details
-
getIndex
int getIndex() -
getLocals
int[] getLocals() -
getTrimmedLocals
int[] getTrimmedLocals()Get a copy of the super block's locals without any trailing TOP types. This is useful for actual writing stack maps; during the computation of stack map types, all local arrays have the same size; the max locals for the method. In addition, DOUBLE and LONG types have trailing TOP types because they occupy two words. For writing purposes, these are not useful. -
getStack
int[] getStack() -
merge
-
mergeState
Merge an operand stack or local variable array with incoming state. They are treated the same way; by this point, it should already be ensured that the array sizes are the same, which is the only additional constraint that is imposed on merging operand stacks (the local variable array is always the same size). -
getStart
int getStart() -
getEnd
int getEnd() -
toString
-
isInitialized
boolean isInitialized() -
setInitialized
void setInitialized(boolean b) -
isInQueue
boolean isInQueue() -
setInQueue
void setInQueue(boolean b)
-