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 protected
MapMaker(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 void
copyTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes)
private static int
diffSize(TypeData[] types, int offset, int len)
private int[]
fillStackMap(int num, int offset, int[] data, TypeData[] types)
private void
findDeadCatchers(byte[] code, TypedBlock[] blocks)
private void
fixDeadcode(byte[] code, TypedBlock block)
private void
fixTypes(byte[] code, TypedBlock[] blocks)
private boolean
isTarget(TypedBlock cur, TypedBlock prev)
Returns true if cur is a branch target.private void
make(byte[] code, TypedBlock tb)
(package private) void
make(TypedBlock[] blocks, byte[] code)
Runs an analyzer (Phase 1 and 2).static StackMapTable
make(ClassPool classes, MethodInfo minfo)
Computes the stack map table of the given method and returns it.static StackMap
make2(ClassPool classes, MethodInfo minfo)
Computes the stack map table for J2ME.private TypeData
merge(TypeData src, TypeData target)
private void
mergeMap(TypedBlock dest, boolean mergeStack)
private void
recordStackMap(TypedBlock target)
private void
recordStackMap(TypedBlock target, int exceptionType)
private void
recordStackMap0(TypedBlock target, int st, TypeData[] tStackTypes)
protected static int
recordTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes)
private static int
stackMapDiff(int oldTdLen, TypeData[] oldTd, int newTdLen, TypeData[] newTd)
private static boolean
stackMapEq(TypeData[] oldTd, TypeData[] newTd, int len)
private TypeData.ClassName
toExceptionType(int exceptionType)
StackMapTable
toStackMap(TypedBlock[] blocks)
StackMap
toStackMap2(ConstPool cp, TypedBlock[] blocks)
private void
toStackMapBody(StackMapTable.Writer writer, TypedBlock bb, int diffL, int offsetDelta, TypedBlock prev)
private void
traceException(byte[] code, BasicBlock.Catch handler)
private static TypeData
validateTypeData(TypeData[] data, int length, int index)
private void
writeStackFrame(StackMap.Writer writer, ConstPool cp, int offset, TypedBlock tb)
private void
writeVerifyTypeInfo(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:
NotFoundException
BadBytecode
-
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)
-
-