Package javassist.bytecode.stackmap
Class MapMaker
- java.lang.Object
-
- javassist.bytecode.stackmap.Tracer
-
- javassist.bytecode.stackmap.MapMaker
-
-
Field Summary
-
Fields inherited from class javassist.bytecode.stackmap.Tracer
classPool, cpool, localsTypes, returnType, stackTop, stackTypes
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMapMaker(MapMaker old)MapMaker(ClassPool classes, MethodInfo minfo, CodeAttribute ca)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidcopyTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes)private static intdiffSize(TypeData[] types, int offset, int len)private int[]fillStackMap(int num, int offset, int[] data, TypeData[] types)private voidfindDeadCatchers(byte[] code, TypedBlock[] blocks)private voidfixDeadcode(byte[] code, TypedBlock block)private voidfixTypes(byte[] code, TypedBlock[] blocks)private booleanisTarget(TypedBlock cur, TypedBlock prev)Returns true if cur is a branch target.private voidmake(byte[] code, TypedBlock tb)(package private) voidmake(TypedBlock[] blocks, byte[] code)Runs an analyzer (Phase 1 and 2).static StackMapTablemake(ClassPool classes, MethodInfo minfo)Computes the stack map table of the given method and returns it.static StackMapmake2(ClassPool classes, MethodInfo minfo)Computes the stack map table for J2ME.private TypeDatamerge(TypeData src, TypeData target)private voidmergeMap(TypedBlock dest, boolean mergeStack)private voidrecordStackMap(TypedBlock target)private voidrecordStackMap(TypedBlock target, int exceptionType)private voidrecordStackMap0(TypedBlock target, int st, TypeData[] tStackTypes)protected static intrecordTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes)private static intstackMapDiff(int oldTdLen, TypeData[] oldTd, int newTdLen, TypeData[] newTd)private static booleanstackMapEq(TypeData[] oldTd, TypeData[] newTd, int len)private TypeData.ClassNametoExceptionType(int exceptionType)StackMapTabletoStackMap(TypedBlock[] blocks)StackMaptoStackMap2(ConstPool cp, TypedBlock[] blocks)private voidtoStackMapBody(StackMapTable.Writer writer, TypedBlock bb, int diffL, int offsetDelta, TypedBlock prev)private voidtraceException(byte[] code, BasicBlock.Catch handler)private static TypeDatavalidateTypeData(TypeData[] data, int length, int index)private voidwriteStackFrame(StackMap.Writer writer, ConstPool cp, int offset, TypedBlock tb)private voidwriteVerifyTypeInfo(StackMap.Writer writer, ConstPool cp, TypeData[] types, int num)-
Methods inherited from class javassist.bytecode.stackmap.Tracer
doOpcode, visitBranch, visitGoto, visitJSR, visitLookupSwitch, visitRET, visitReturn, visitTableSwitch, visitThrow
-
-
-
-
Constructor Detail
-
MapMaker
public MapMaker(ClassPool classes, MethodInfo minfo, CodeAttribute ca)
-
MapMaker
protected MapMaker(MapMaker old)
-
-
Method Detail
-
make
public static StackMapTable make(ClassPool classes, MethodInfo minfo) throws BadBytecode
Computes the stack map table of the given method and returns it. It returns null if the given method does not have to have a stack map table or it includes JSR.- Throws:
BadBytecode
-
make2
public static StackMap make2(ClassPool classes, MethodInfo minfo) throws BadBytecode
Computes the stack map table for J2ME. It returns null if the given method does not have to have a stack map table or it includes JSR.- Throws:
BadBytecode
-
make
void make(TypedBlock[] blocks, byte[] code) throws BadBytecode
Runs an analyzer (Phase 1 and 2).- Throws:
BadBytecode
-
make
private void make(byte[] code, TypedBlock tb) throws BadBytecode- Throws:
BadBytecode
-
traceException
private void traceException(byte[] code, BasicBlock.Catch handler) throws BadBytecode- Throws:
BadBytecode
-
mergeMap
private void mergeMap(TypedBlock dest, boolean mergeStack) throws BadBytecode
- Throws:
BadBytecode
-
merge
private TypeData merge(TypeData src, TypeData target) throws BadBytecode
- Throws:
BadBytecode
-
recordStackMap
private void recordStackMap(TypedBlock target) throws BadBytecode
- Throws:
BadBytecode
-
recordStackMap
private void recordStackMap(TypedBlock target, int exceptionType) throws BadBytecode
- Throws:
BadBytecode
-
toExceptionType
private TypeData.ClassName toExceptionType(int exceptionType)
-
recordStackMap0
private void recordStackMap0(TypedBlock target, int st, TypeData[] tStackTypes) throws BadBytecode
- Throws:
BadBytecode
-
recordTypeData
protected static int recordTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes)
-
findDeadCatchers
private void findDeadCatchers(byte[] code, TypedBlock[] blocks) throws BadBytecode- Throws:
BadBytecode
-
fixDeadcode
private void fixDeadcode(byte[] code, TypedBlock block) throws BadBytecode- Throws:
BadBytecode
-
fixTypes
private void fixTypes(byte[] code, TypedBlock[] blocks) throws NotFoundException, BadBytecode- Throws:
NotFoundExceptionBadBytecode
-
toStackMap
public StackMapTable toStackMap(TypedBlock[] blocks)
-
isTarget
private boolean isTarget(TypedBlock cur, TypedBlock prev)
Returns true if cur is a branch target.
-
toStackMapBody
private void toStackMapBody(StackMapTable.Writer writer, TypedBlock bb, int diffL, int offsetDelta, TypedBlock prev)
-
fillStackMap
private int[] fillStackMap(int num, int offset, int[] data, TypeData[] types)
-
stackMapDiff
private static int stackMapDiff(int oldTdLen, TypeData[] oldTd, int newTdLen, TypeData[] newTd)
-
diffSize
private static int diffSize(TypeData[] types, int offset, int len)
-
toStackMap2
public StackMap toStackMap2(ConstPool cp, TypedBlock[] blocks)
-
writeStackFrame
private void writeStackFrame(StackMap.Writer writer, ConstPool cp, int offset, TypedBlock tb)
-
writeVerifyTypeInfo
private void writeVerifyTypeInfo(StackMap.Writer writer, ConstPool cp, TypeData[] types, int num)
-
-