Top Description Fields Constructors Methods
javassist.bytecode.stackmap

public Class MapMaker

extends Tracer
Class Inheritance
Imports
java.util.ArrayList, .List, javassist.ClassPool, .NotFoundException, javassist.bytecode.BadBytecode, .ByteArray, .Bytecode, .CodeAttribute, .ConstPool, .MethodInfo, .StackMap, .StackMapTable

Stack map maker.

Field Summary

Inherited from javassist.bytecode.stackmap.Tracer:
classPoolcpoollocalsTypesreturnTypestackTopstackTypes

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and 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.

public static StackMapTable
make(ClassPool classes, MethodInfo minfo)

Computes the stack map table of the given method and returns it.

pack-priv void
make(TypedBlock[] blocks, byte[] code)

Runs an analyzer (Phase 1 and 2).

private void
make(byte[] code, TypedBlock tb)

public 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
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)

public StackMapTable
public StackMap
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)

Inherited from javassist.bytecode.stackmap.Tracer:
doOpcodevisitBranchvisitGotovisitJSRvisitLookupSwitchvisitRETvisitReturnvisitTableSwitchvisitThrow

Constructor Detail

MapMakerback to summary
public MapMaker(ClassPool classes, MethodInfo minfo, CodeAttribute ca)
MapMakerback to summary
protected MapMaker(MapMaker old)

Method Detail

copyTypeDataback to summary
protected static void copyTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes)
diffSizeback to summary
private static int diffSize(TypeData[] types, int offset, int len)
fillStackMapback to summary
private int[] fillStackMap(int num, int offset, int[] data, TypeData[] types)
findDeadCatchersback to summary
private void findDeadCatchers(byte[] code, TypedBlock[] blocks) throws BadBytecode
fixDeadcodeback to summary
private void fixDeadcode(byte[] code, TypedBlock block) throws BadBytecode
fixTypesback to summary
private void fixTypes(byte[] code, TypedBlock[] blocks) throws NotFoundException, BadBytecode
isTargetback to summary
private boolean isTarget(TypedBlock cur, TypedBlock prev)

Returns true if cur is a branch target.

makeback to summary
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.

makeback to summary
pack-priv void make(TypedBlock[] blocks, byte[] code) throws BadBytecode

Runs an analyzer (Phase 1 and 2).

makeback to summary
private void make(byte[] code, TypedBlock tb) throws BadBytecode
make2back to summary
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.

mergeback to summary
private TypeData merge(TypeData src, TypeData target) throws BadBytecode
mergeMapback to summary
private void mergeMap(TypedBlock dest, boolean mergeStack) throws BadBytecode
recordStackMapback to summary
private void recordStackMap(TypedBlock target) throws BadBytecode
recordStackMapback to summary
private void recordStackMap(TypedBlock target, int exceptionType) throws BadBytecode
recordStackMap0back to summary
private void recordStackMap0(TypedBlock target, int st, TypeData[] tStackTypes) throws BadBytecode
recordTypeDataback to summary
protected static int recordTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes)
stackMapDiffback to summary
private static int stackMapDiff(int oldTdLen, TypeData[] oldTd, int newTdLen, TypeData[] newTd)
stackMapEqback to summary
private static boolean stackMapEq(TypeData[] oldTd, TypeData[] newTd, int len)
toExceptionTypeback to summary
private TypeData.ClassName toExceptionType(int exceptionType)
toStackMapback to summary
public StackMapTable toStackMap(TypedBlock[] blocks)
toStackMap2back to summary
public StackMap toStackMap2(ConstPool cp, TypedBlock[] blocks)
toStackMapBodyback to summary
private void toStackMapBody(StackMapTable.Writer writer, TypedBlock bb, int diffL, int offsetDelta, TypedBlock prev)
traceExceptionback to summary
private void traceException(byte[] code, BasicBlock.Catch handler) throws BadBytecode
validateTypeDataback to summary
private static TypeData validateTypeData(TypeData[] data, int length, int index)
writeStackFrameback to summary
private void writeStackFrame(StackMap.Writer writer, ConstPool cp, int offset, TypedBlock tb)
writeVerifyTypeInfoback to summary
private void writeVerifyTypeInfo(StackMap.Writer writer, ConstPool cp, TypeData[] types, int num)