Package javassist.bytecode.stackmap
Class Tracer
java.lang.Object
javassist.bytecode.stackmap.Tracer
- All Implemented Interfaces:
TypeTag
- Direct Known Subclasses:
MapMaker
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckParamTypes(String desc, int i) private voidconstructorCalled(TypeData target, int offset) private intdoALOAD(int localVar) private intdoASTORE(int index) private voiddoDUP_XX(int delta, int len) private intdoGetField(int pos, byte[] code, boolean notStatic) private intdoInvokeDynamic(int pos, byte[] code) private intdoInvokeIntfMethod(int pos, byte[] code) private intdoInvokeMethod(int pos, byte[] code, boolean notStatic) private voiddoLDC(int index) private intdoMultiANewArray(int pos, byte[] code) private intdoNEWARRAY(int pos, byte[] code) protected intdoOpcode(int pos, byte[] code) Does abstract interpretation on the given bytecode instruction.private intdoOpcode0_53(int pos, byte[] code, int op) private intdoOpcode148_201(int pos, byte[] code, int op) private intdoOpcode54_95(int pos, byte[] code, int op) private intdoOpcode96_147(int pos, byte[] code, int op) private intdoPutField(int pos, byte[] code, boolean notStatic) private intdoWIDE(int pos, byte[] code) private voiddoWIDE_STORE(int pos, byte[] code, TypeData type) private voiddoWIDE_XLOAD(int pos, byte[] code, TypeData type) private intprivate intprivate intprivate intprivate static StringgetFieldClassName(String desc, int index) private voidpushMemberType(String descriptor) private voidsetFieldTarget(boolean notStatic, int index) protected voidvisitBranch(int pos, byte[] code, int offset) protected voidvisitGoto(int pos, byte[] code, int offset) protected voidvisitJSR(int pos, byte[] code) Invoked when the visited instruction is jsr.protected voidvisitLookupSwitch(int pos, byte[] code, int n, int pairsPos, int defaultOffset) protected voidvisitRET(int pos, byte[] code) Invoked when the visited instruction is ret or wide ret.protected voidvisitReturn(int pos, byte[] code) protected voidvisitTableSwitch(int pos, byte[] code, int n, int offsetPos, int defaultOffset) protected voidvisitThrow(int pos, byte[] code)
-
Field Details
-
classPool
-
cpool
-
returnType
-
stackTop
protected int stackTop -
stackTypes
-
localsTypes
-
-
Constructor Details
-
Tracer
-
Tracer
-
-
Method Details
-
doOpcode
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- the position of the instruction.- Returns:
- the size of the instruction at POS.
- Throws:
BadBytecode
-
visitBranch
- Throws:
BadBytecode
-
visitGoto
- Throws:
BadBytecode
-
visitReturn
- Throws:
BadBytecode
-
visitThrow
- Throws:
BadBytecode
-
visitTableSwitch
protected void visitTableSwitch(int pos, byte[] code, int n, int offsetPos, int defaultOffset) throws BadBytecode - Parameters:
pos- the position of TABLESWITCHcode- bytecoden- the number of case labelsoffsetPos- the position of the branch-target table.defaultOffset- the offset to the default branch target.- Throws:
BadBytecode
-
visitLookupSwitch
protected void visitLookupSwitch(int pos, byte[] code, int n, int pairsPos, int defaultOffset) throws BadBytecode - Parameters:
pos- the position of LOOKUPSWITCHcode- bytecoden- the number of case labelspairsPos- the position of the table of pairs of a value and a branch target.defaultOffset- the offset to the default branch target.- Throws:
BadBytecode
-
visitJSR
Invoked when the visited instruction is jsr. Java6 or later does not allow using RET.- Throws:
BadBytecode
-
visitRET
Invoked when the visited instruction is ret or wide ret. Java6 or later does not allow using RET.- Throws:
BadBytecode
-
doOpcode0_53
- Throws:
BadBytecode
-
doLDC
private void doLDC(int index) -
doXLOAD
-
doXLOAD
-
doALOAD
private int doALOAD(int localVar) -
doOpcode54_95
- Throws:
BadBytecode
-
doXSTORE
-
doXSTORE
-
doASTORE
private int doASTORE(int index) -
doDUP_XX
private void doDUP_XX(int delta, int len) -
doOpcode96_147
private int doOpcode96_147(int pos, byte[] code, int op) -
doOpcode148_201
- Throws:
BadBytecode
-
doWIDE
- Throws:
BadBytecode
-
doWIDE_XLOAD
-
doWIDE_STORE
-
doPutField
- Throws:
BadBytecode
-
doGetField
- Throws:
BadBytecode
-
setFieldTarget
- Throws:
BadBytecode
-
doNEWARRAY
private int doNEWARRAY(int pos, byte[] code) -
doMultiANewArray
private int doMultiANewArray(int pos, byte[] code) -
doInvokeMethod
- Throws:
BadBytecode
-
constructorCalled
-
doInvokeIntfMethod
- Throws:
BadBytecode
-
doInvokeDynamic
- Throws:
BadBytecode
-
pushMemberType
-
getFieldClassName
-
checkParamTypes
- Throws:
BadBytecode
-