Package javassist.bytecode.stackmap
Class TypedBlock
- java.lang.Object
-
- javassist.bytecode.stackmap.BasicBlock
-
- javassist.bytecode.stackmap.TypedBlock
-
public class TypedBlock extends BasicBlock
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TypedBlock.Maker
-
Nested classes/interfaces inherited from class javassist.bytecode.stackmap.BasicBlock
BasicBlock.Catch, BasicBlock.JsrBytecode, BasicBlock.Mark
-
-
Field Summary
Fields Modifier and Type Field Description TypeData[]
localsTypes
int
numLocals
int
stackTop
TypeData[]
stackTypes
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypedBlock(int pos)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
alreadySet()
private static int
descToTag(java.lang.String desc, int i, int n, TypeData[] types)
static java.lang.String
getRetType(java.lang.String desc)
(package private) void
initFirstBlock(int maxStack, int maxLocals, java.lang.String className, java.lang.String methodDesc, boolean isStatic, boolean isConstructor)
Initializes the first block by the given method descriptor.static TypedBlock[]
makeBlocks(MethodInfo minfo, CodeAttribute ca, boolean optimize)
Divides the method body into basic blocks.private void
printTypes(java.lang.StringBuilder sbuf, int size, TypeData[] types)
void
resetNumLocals()
void
setStackMap(int st, TypeData[] stack, int nl, TypeData[] locals)
private static TypeData
toPrimitiveTag(char c)
protected void
toString2(java.lang.StringBuilder sbuf)
-
Methods inherited from class javassist.bytecode.stackmap.BasicBlock
find, toString
-
-
-
-
Method Detail
-
makeBlocks
public static TypedBlock[] makeBlocks(MethodInfo minfo, CodeAttribute ca, boolean optimize) throws BadBytecode
Divides the method body into basic blocks. The type information of the first block is initialized.- Parameters:
optimize
- if it is true and the method does not include branches, this method returns null.- Throws:
BadBytecode
-
toString2
protected void toString2(java.lang.StringBuilder sbuf)
- Overrides:
toString2
in classBasicBlock
-
printTypes
private void printTypes(java.lang.StringBuilder sbuf, int size, TypeData[] types)
-
alreadySet
public boolean alreadySet()
-
setStackMap
public void setStackMap(int st, TypeData[] stack, int nl, TypeData[] locals) throws BadBytecode
- Throws:
BadBytecode
-
resetNumLocals
public void resetNumLocals()
-
initFirstBlock
void initFirstBlock(int maxStack, int maxLocals, java.lang.String className, java.lang.String methodDesc, boolean isStatic, boolean isConstructor) throws BadBytecode
Initializes the first block by the given method descriptor.- Parameters:
block
- the first basic block that this method initializes.className
- a dot-separated fully qualified class name. For example,javassist.bytecode.stackmap.BasicBlock
.methodDesc
- method descriptor.isStatic
- true if the method is a static method.isConstructor
- true if the method is a constructor.- Throws:
BadBytecode
-
descToTag
private static int descToTag(java.lang.String desc, int i, int n, TypeData[] types) throws BadBytecode
- Throws:
BadBytecode
-
toPrimitiveTag
private static TypeData toPrimitiveTag(char c)
-
getRetType
public static java.lang.String getRetType(java.lang.String desc)
-
-