Top Fields Constructors Methods
javassist.bytecode.stackmap

public abstract Class Tracer

extends Object
implements TypeTag
Class Inheritance
All Implemented Interfaces
javassist.bytecode.stackmap.TypeTag
Known Direct Subclasses
javassist.bytecode.stackmap.MapMaker
Imports
javassist.ClassPool, javassist.bytecode.BadBytecode, .ByteArray, .ConstPool, .Descriptor, .Opcode

Field Summary

Modifier and TypeField and Description
protected ClassPool
protected ConstPool
protected TypeData[]
protected String
protected int
protected TypeData[]

Constructor Summary

AccessConstructor and Description
public
Tracer(ClassPool classes, ConstPool cp, int maxStack, int maxLocals, String retType)

public

Method Summary

Modifier and TypeMethod and Description
private void
checkParamTypes(String desc, int i)

private void
constructorCalled(TypeData target, int offset)

private int
doALOAD(int localVar)

private int
doASTORE(int index)

private void
doDUP_XX(int delta, int len)

private int
doGetField(int pos, byte[] code, boolean notStatic)

private int
doInvokeDynamic(int pos, byte[] code)

private int
doInvokeIntfMethod(int pos, byte[] code)

private int
doInvokeMethod(int pos, byte[] code, boolean notStatic)

private void
doLDC(int index)

private int
doMultiANewArray(int pos, byte[] code)

private int
doNEWARRAY(int pos, byte[] code)

protected int

Returns:

the size of the instruction at POS.
doOpcode
(int
the position of the instruction.
pos
,
byte[] code)

Does abstract interpretation on the given bytecode instruction.

private int
doOpcode0_53(int pos, byte[] code, int op)

private int
doOpcode148_201(int pos, byte[] code, int op)

private int
doOpcode54_95(int pos, byte[] code, int op)

private int
doOpcode96_147(int pos, byte[] code, int op)

private int
doPutField(int pos, byte[] code, boolean notStatic)

private int
doWIDE(int pos, byte[] code)

private void
doWIDE_STORE(int pos, byte[] code, TypeData type)

private void
doWIDE_XLOAD(int pos, byte[] code, TypeData type)

private int
doXLOAD(TypeData type, byte[] code, int pos)

private int
doXLOAD(int localVar, TypeData type)

private int
doXSTORE(int pos, byte[] code, TypeData type)

private int
doXSTORE(int index, TypeData type)

private static String
getFieldClassName(String desc, int index)

private void
pushMemberType(String descriptor)

private void
setFieldTarget(boolean notStatic, int index)

protected void
visitBranch(int pos, byte[] code, int offset)

protected void
visitGoto(int pos, byte[] code, int offset)

protected void
visitJSR(int pos, byte[] code)

Invoked when the visited instruction is jsr.

protected void
visitLookupSwitch(int
the position of LOOKUPSWITCH
pos
,
byte[]
bytecode
code
,
int
the number of case labels
n
,
int
the position of the table of pairs of a value and a branch target.
pairsPos
,
int
the offset to the default branch target.
defaultOffset
)

protected void
visitRET(int pos, byte[] code)

Invoked when the visited instruction is ret or wide ret.

protected void
visitReturn(int pos, byte[] code)

protected void
visitTableSwitch(int
the position of TABLESWITCH
pos
,
byte[]
bytecode
code
,
int
the number of case labels
n
,
int
the position of the branch-target table.
offsetPos
,
int
the offset to the default branch target.
defaultOffset
)

protected void
visitThrow(int pos, byte[] code)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classPoolback to summary
protected ClassPool classPool
cpoolback to summary
protected ConstPool cpool
localsTypesback to summary
protected TypeData[] localsTypes
returnTypeback to summary
protected String returnType
stackTopback to summary
protected int stackTop
stackTypesback to summary
protected TypeData[] stackTypes

Constructor Detail

Tracerback to summary
public Tracer(ClassPool classes, ConstPool cp, int maxStack, int maxLocals, String retType)
Tracerback to summary
public Tracer(Tracer t)

Method Detail

checkParamTypesback to summary
private void checkParamTypes(String desc, int i) throws BadBytecode
constructorCalledback to summary
private void constructorCalled(TypeData target, int offset)
doALOADback to summary
private int doALOAD(int localVar)
doASTOREback to summary
private int doASTORE(int index)
doDUP_XXback to summary
private void doDUP_XX(int delta, int len)
doGetFieldback to summary
private int doGetField(int pos, byte[] code, boolean notStatic) throws BadBytecode
doInvokeDynamicback to summary
private int doInvokeDynamic(int pos, byte[] code) throws BadBytecode
doInvokeIntfMethodback to summary
private int doInvokeIntfMethod(int pos, byte[] code) throws BadBytecode
doInvokeMethodback to summary
private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode
doLDCback to summary
private void doLDC(int index)
doMultiANewArrayback to summary
private int doMultiANewArray(int pos, byte[] code)
doNEWARRAYback to summary
private int doNEWARRAY(int pos, byte[] code)
doOpcodeback to summary
protected int doOpcode(int pos, byte[] code) throws BadBytecode

Does abstract interpretation on the given bytecode instruction. It records whether or not a local variable (i.e. register) is accessed. If the instruction requires that a local variable or a stack element has a more specific type, this method updates the type of it.

Parameters
pos:int

the position of the instruction.

Returns:int

the size of the instruction at POS.

doOpcode0_53back to summary
private int doOpcode0_53(int pos, byte[] code, int op) throws BadBytecode
doOpcode148_201back to summary
private int doOpcode148_201(int pos, byte[] code, int op) throws BadBytecode
doOpcode54_95back to summary
private int doOpcode54_95(int pos, byte[] code, int op) throws BadBytecode
doOpcode96_147back to summary
private int doOpcode96_147(int pos, byte[] code, int op)
doPutFieldback to summary
private int doPutField(int pos, byte[] code, boolean notStatic) throws BadBytecode
doWIDEback to summary
private int doWIDE(int pos, byte[] code) throws BadBytecode
doWIDE_STOREback to summary
private void doWIDE_STORE(int pos, byte[] code, TypeData type)
doWIDE_XLOADback to summary
private void doWIDE_XLOAD(int pos, byte[] code, TypeData type)
doXLOADback to summary
private int doXLOAD(TypeData type, byte[] code, int pos)
doXLOADback to summary
private int doXLOAD(int localVar, TypeData type)
doXSTOREback to summary
private int doXSTORE(int pos, byte[] code, TypeData type)
doXSTOREback to summary
private int doXSTORE(int index, TypeData type)
getFieldClassNameback to summary
private static String getFieldClassName(String desc, int index)
pushMemberTypeback to summary
private void pushMemberType(String descriptor)
setFieldTargetback to summary
private void setFieldTarget(boolean notStatic, int index) throws BadBytecode
visitBranchback to summary
protected void visitBranch(int pos, byte[] code, int offset) throws BadBytecode
visitGotoback to summary
protected void visitGoto(int pos, byte[] code, int offset) throws BadBytecode
visitJSRback to summary
protected void visitJSR(int pos, byte[] code) throws BadBytecode

Invoked when the visited instruction is jsr. Java6 or later does not allow using RET.

visitLookupSwitchback to summary
protected void visitLookupSwitch(int pos, byte[] code, int n, int pairsPos, int defaultOffset) throws BadBytecode
Parameters
pos:int

the position of LOOKUPSWITCH

code:byte[]

bytecode

n:int

the number of case labels

pairsPos:int

the position of the table of pairs of a value and a branch target.

defaultOffset:int

the offset to the default branch target.

visitRETback to summary
protected void visitRET(int pos, byte[] code) throws BadBytecode

Invoked when the visited instruction is ret or wide ret. Java6 or later does not allow using RET.

visitReturnback to summary
protected void visitReturn(int pos, byte[] code) throws BadBytecode
visitTableSwitchback to summary
protected void visitTableSwitch(int pos, byte[] code, int n, int offsetPos, int defaultOffset) throws BadBytecode
Parameters
pos:int

the position of TABLESWITCH

code:byte[]

bytecode

n:int

the number of case labels

offsetPos:int

the position of the branch-target table.

defaultOffset:int

the offset to the default branch target.

visitThrowback to summary
protected void visitThrow(int pos, byte[] code) throws BadBytecode