public class CodeVisitor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected CodeAttribute |
_codeAttr |
protected int |
_offset |
static int |
AALOAD |
static int |
AASTORE |
static int |
ACONST_NULL |
static int |
ALOAD |
static int |
ALOAD_0 |
static int |
ALOAD_1 |
static int |
ALOAD_2 |
static int |
ALOAD_3 |
static int |
ANEWARRAY |
static int |
ARETURN |
static int |
ARRAYLENGTH |
static int |
ASTORE |
static int |
ASTORE_0 |
static int |
ASTORE_1 |
static int |
ASTORE_2 |
static int |
ASTORE_3 |
static int |
ATHROW |
static int |
BALOAD |
static int |
BASTORE |
static int |
BIPUSH |
static int |
CALOAD |
static int |
CASTORE |
static int |
CHECKCAST |
static int |
D2F |
static int |
D2I |
static int |
D2L |
static int |
DADD |
static int |
DALOAD |
static int |
DASTORE |
static int |
DCMPG |
static int |
DCMPL |
static int |
DCONST_0 |
static int |
DCONST_1 |
static int |
DDIV |
static int |
DLOAD |
static int |
DLOAD_0 |
static int |
DLOAD_1 |
static int |
DLOAD_2 |
static int |
DLOAD_3 |
static int |
DMUL |
static int |
DNEG |
static int |
DREM |
static int |
DRETURN |
static int |
DSTORE |
static int |
DSTORE_0 |
static int |
DSTORE_1 |
static int |
DSTORE_2 |
static int |
DSTORE_3 |
static int |
DSUB |
static int |
DUP |
static int |
DUP_X1 |
static int |
DUP_X2 |
static int |
DUP2 |
static int |
DUP2_X1 |
static int |
DUP2_X2 |
static int |
F2D |
static int |
F2I |
static int |
F2L |
static int |
FADD |
static int |
FALOAD |
static int |
FASTORE |
static int |
FCMPG |
static int |
FCMPL |
static int |
FCONST_0 |
static int |
FCONST_1 |
static int |
FCONST_2 |
static int |
FDIV |
static int |
FLOAD |
static int |
FLOAD_0 |
static int |
FLOAD_1 |
static int |
FLOAD_2 |
static int |
FLOAD_3 |
static int |
FMUL |
static int |
FNEG |
static int |
FREM |
static int |
FRETURN |
static int |
FSTORE |
static int |
FSTORE_0 |
static int |
FSTORE_1 |
static int |
FSTORE_2 |
static int |
FSTORE_3 |
static int |
FSUB |
static int |
GETFIELD |
static int |
GETSTATIC |
static int |
GOTO |
static int |
GOTO_W |
static int |
I2B |
static int |
I2C |
static int |
I2D |
static int |
I2F |
static int |
I2L |
static int |
I2S |
static int |
IADD |
static int |
IALOAD |
static int |
IAND |
static int |
IASTORE |
static int |
ICONST_0 |
static int |
ICONST_1 |
static int |
ICONST_2 |
static int |
ICONST_3 |
static int |
ICONST_4 |
static int |
ICONST_5 |
static int |
ICONST_M1 |
static int |
IDIV |
static int |
IF_ACMPEQ |
static int |
IF_ACMPNE |
static int |
IF_ICMPEQ |
static int |
IF_ICMPGE |
static int |
IF_ICMPGT |
static int |
IF_ICMPLE |
static int |
IF_ICMPLT |
static int |
IF_ICMPNE |
static int |
IFEQ |
static int |
IFGE |
static int |
IFGT |
static int |
IFLE |
static int |
IFLT |
static int |
IFNE |
static int |
IFNONNULL |
static int |
IFNULL |
static int |
IINC |
static int |
ILOAD |
static int |
ILOAD_0 |
static int |
ILOAD_1 |
static int |
ILOAD_2 |
static int |
ILOAD_3 |
static int |
IMUL |
static int |
INEG |
static int |
INSTANCEOF |
static int |
INVOKEINTERFACE |
static int |
INVOKESPECIAL |
static int |
INVOKESTATIC |
static int |
INVOKEVIRTUAL |
static int |
IOR |
static int |
IREM |
static int |
IRETURN |
static int |
ISHL |
static int |
ISHR |
static int |
ISTORE |
static int |
ISTORE_0 |
static int |
ISTORE_1 |
static int |
ISTORE_2 |
static int |
ISTORE_3 |
static int |
ISUB |
static int |
IUSHR |
static int |
IXOR |
static int |
JSR |
static int |
JSR_W |
static int |
L2D |
static int |
L2F |
static int |
L2I |
static int |
LADD |
static int |
LALOAD |
static int |
LAND |
static int |
LASTORE |
static int |
LCMP |
static int |
LCONST_0 |
static int |
LCONST_1 |
static int |
LDC |
static int |
LDC_W |
static int |
LDC2_W |
static int |
LDIV |
static int |
LLOAD |
static int |
LLOAD_0 |
static int |
LLOAD_1 |
static int |
LLOAD_2 |
static int |
LLOAD_3 |
static int |
LMUL |
static int |
LNEG |
static int |
LOOKUPSWITCH |
static int |
LOR |
static int |
LREM |
static int |
LRETURN |
static int |
LSHL |
static int |
LSHR |
static int |
LSTORE |
static int |
LSTORE_0 |
static int |
LSTORE_1 |
static int |
LSTORE_2 |
static int |
LSTORE_3 |
static int |
LSUB |
static int |
LUSHR |
static int |
LXOR |
static int |
MONITORENTER |
static int |
MONITOREXIT |
static int |
MULTIANEWARRAY |
static int |
NEW |
static int |
NEWARRAY |
static int |
NOP |
static int |
POP |
static int |
POP2 |
static int |
PUTFIELD |
static int |
PUTSTATIC |
static int |
RESERVED_0 |
static int |
RET |
static int |
RETURN |
static int |
SALOAD |
static int |
SASTORE |
static int |
SIPUSH |
static int |
SWAP |
static int |
TABLESWITCH |
static int |
WIDE |
Constructor and Description |
---|
CodeVisitor() |
CodeVisitor(JavaClass javaClass,
CodeAttribute codeAttr) |
Modifier and Type | Method and Description |
---|---|
void |
analyze(Analyzer analyzer)
Analyzes the code for a method
|
void |
analyze(Analyzer analyzer,
boolean allowFlow)
Analyzes the code for a method
|
protected void |
analyzeImpl(Analyzer analyzer,
boolean allowFlow,
IntArray pendingTargets,
IntArray completedTargets)
Analyzes the code for a method
|
int |
getBranchTarget()
Returns the branch target.
|
int |
getByte(int offset)
Reads a byte value.
|
int |
getByteArg()
Reads a byte argument.
|
int |
getByteArg(int offset)
Gets a byte arg
|
byte[] |
getCode()
Returns the code buffer.
|
CodeAttribute |
getCodeAttribute()
Returns the code attribute.
|
ConstantPoolEntry |
getConstantArg()
Returns a constant pool item.
|
java.util.ArrayList<CodeAttribute.ExceptionItem> |
getExceptions()
Returns the exceptions.
|
int |
getInt(int offset)
Reads an int argument.
|
int |
getIntArg()
Reads an integer.
|
JavaClass |
getJavaClass()
Returns the java class.
|
int |
getOffset()
Returns the offset.
|
int |
getOpcode()
Returns the opcode at the cursor.
|
int |
getShort(int offset)
Reads a short value.
|
int |
getShortArg()
Reads a short argument.
|
int |
getShortArg(int offset)
Sets a short value.
|
int[] |
getSwitchTargets()
Returns the branch target.
|
void |
init(JavaClass javaClass,
CodeAttribute codeAttr) |
boolean |
isBranch()
Returns true for a simple branch, i.e.
|
boolean |
isSwitch()
Returns true for a switch.
|
boolean |
next()
Goes to the next opcode.
|
protected int |
nextOffset()
Goes to the next opcode.
|
void |
setByteArg(int offset,
int value)
Sets a byte value.
|
void |
setInt(int offset,
int value)
Sets a short value.
|
void |
setOffset(int offset)
Sets the offset.
|
void |
setShort(int offset,
int value)
Sets a short value.
|
void |
setShortArg(int offset,
int value)
Sets a short value.
|
protected CodeAttribute _codeAttr
protected int _offset
public static final int NOP
public static final int ACONST_NULL
public static final int ICONST_M1
public static final int ICONST_0
public static final int ICONST_1
public static final int ICONST_2
public static final int ICONST_3
public static final int ICONST_4
public static final int ICONST_5
public static final int LCONST_0
public static final int LCONST_1
public static final int FCONST_0
public static final int FCONST_1
public static final int FCONST_2
public static final int DCONST_0
public static final int DCONST_1
public static final int BIPUSH
public static final int SIPUSH
public static final int LDC
public static final int LDC_W
public static final int LDC2_W
public static final int ILOAD
public static final int LLOAD
public static final int FLOAD
public static final int DLOAD
public static final int ALOAD
public static final int ILOAD_0
public static final int ILOAD_1
public static final int ILOAD_2
public static final int ILOAD_3
public static final int LLOAD_0
public static final int LLOAD_1
public static final int LLOAD_2
public static final int LLOAD_3
public static final int FLOAD_0
public static final int FLOAD_1
public static final int FLOAD_2
public static final int FLOAD_3
public static final int DLOAD_0
public static final int DLOAD_1
public static final int DLOAD_2
public static final int DLOAD_3
public static final int ALOAD_0
public static final int ALOAD_1
public static final int ALOAD_2
public static final int ALOAD_3
public static final int IALOAD
public static final int LALOAD
public static final int FALOAD
public static final int DALOAD
public static final int AALOAD
public static final int BALOAD
public static final int CALOAD
public static final int SALOAD
public static final int ISTORE
public static final int LSTORE
public static final int FSTORE
public static final int DSTORE
public static final int ASTORE
public static final int ISTORE_0
public static final int ISTORE_1
public static final int ISTORE_2
public static final int ISTORE_3
public static final int LSTORE_0
public static final int LSTORE_1
public static final int LSTORE_2
public static final int LSTORE_3
public static final int FSTORE_0
public static final int FSTORE_1
public static final int FSTORE_2
public static final int FSTORE_3
public static final int DSTORE_0
public static final int DSTORE_1
public static final int DSTORE_2
public static final int DSTORE_3
public static final int ASTORE_0
public static final int ASTORE_1
public static final int ASTORE_2
public static final int ASTORE_3
public static final int IASTORE
public static final int LASTORE
public static final int FASTORE
public static final int DASTORE
public static final int AASTORE
public static final int BASTORE
public static final int CASTORE
public static final int SASTORE
public static final int POP
public static final int POP2
public static final int DUP
public static final int DUP_X1
public static final int DUP_X2
public static final int DUP2
public static final int DUP2_X1
public static final int DUP2_X2
public static final int SWAP
public static final int IADD
public static final int LADD
public static final int FADD
public static final int DADD
public static final int ISUB
public static final int LSUB
public static final int FSUB
public static final int DSUB
public static final int IMUL
public static final int LMUL
public static final int FMUL
public static final int DMUL
public static final int IDIV
public static final int LDIV
public static final int FDIV
public static final int DDIV
public static final int IREM
public static final int LREM
public static final int FREM
public static final int DREM
public static final int INEG
public static final int LNEG
public static final int FNEG
public static final int DNEG
public static final int ISHL
public static final int LSHL
public static final int ISHR
public static final int LSHR
public static final int IUSHR
public static final int LUSHR
public static final int IAND
public static final int LAND
public static final int IOR
public static final int LOR
public static final int IXOR
public static final int LXOR
public static final int IINC
public static final int I2L
public static final int I2F
public static final int I2D
public static final int L2I
public static final int L2F
public static final int L2D
public static final int F2I
public static final int F2L
public static final int F2D
public static final int D2I
public static final int D2L
public static final int D2F
public static final int I2B
public static final int I2C
public static final int I2S
public static final int LCMP
public static final int FCMPL
public static final int FCMPG
public static final int DCMPL
public static final int DCMPG
public static final int IFEQ
public static final int IFNE
public static final int IFLT
public static final int IFGE
public static final int IFGT
public static final int IFLE
public static final int IF_ICMPEQ
public static final int IF_ICMPNE
public static final int IF_ICMPLT
public static final int IF_ICMPGE
public static final int IF_ICMPGT
public static final int IF_ICMPLE
public static final int IF_ACMPEQ
public static final int IF_ACMPNE
public static final int GOTO
public static final int JSR
public static final int RET
public static final int TABLESWITCH
public static final int LOOKUPSWITCH
public static final int IRETURN
public static final int LRETURN
public static final int FRETURN
public static final int DRETURN
public static final int ARETURN
public static final int RETURN
public static final int GETSTATIC
public static final int PUTSTATIC
public static final int GETFIELD
public static final int PUTFIELD
public static final int INVOKEVIRTUAL
public static final int INVOKESPECIAL
public static final int INVOKESTATIC
public static final int INVOKEINTERFACE
public static final int RESERVED_0
public static final int NEW
public static final int NEWARRAY
public static final int ANEWARRAY
public static final int ARRAYLENGTH
public static final int ATHROW
public static final int CHECKCAST
public static final int INSTANCEOF
public static final int MONITORENTER
public static final int MONITOREXIT
public static final int WIDE
public static final int MULTIANEWARRAY
public static final int IFNULL
public static final int IFNONNULL
public static final int GOTO_W
public static final int JSR_W
public CodeVisitor()
public CodeVisitor(JavaClass javaClass, CodeAttribute codeAttr)
public void init(JavaClass javaClass, CodeAttribute codeAttr)
public JavaClass getJavaClass()
public CodeAttribute getCodeAttribute()
public int getOffset()
public void setOffset(int offset)
public byte[] getCode()
public java.util.ArrayList<CodeAttribute.ExceptionItem> getExceptions()
public int getOpcode()
public boolean next()
protected int nextOffset()
public boolean isBranch()
public int getBranchTarget()
public boolean isSwitch()
public int[] getSwitchTargets()
public ConstantPoolEntry getConstantArg()
public int getByteArg()
public int getByteArg(int offset)
public void setByteArg(int offset, int value)
public int getShortArg()
public int getShortArg(int offset)
public void setShortArg(int offset, int value)
public void setShort(int offset, int value)
public int getIntArg()
public void setInt(int offset, int value)
public int getByte(int offset)
public int getShort(int offset)
public int getInt(int offset)
public void analyze(Analyzer analyzer) throws java.lang.Exception
java.lang.Exception
public void analyze(Analyzer analyzer, boolean allowFlow) throws java.lang.Exception
java.lang.Exception