|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjbet.Instruction
public final class Instruction
An instance of this class represents a single JVM instruction, along with any in-line data. This class knows how to build itself out of the JVM bytecode format, and how to write itself out in that format. The data members of this class hold the "content" of the instruction, for code analysis and editing purposes. Instruction has quite a few fields and usualy only a few are in use at any one time. We use accessor methods so we can switch to a more economical storage later if we want to. Branch targets are considered to be owned by their instructions. They may not be shared.
Field Summary | |
---|---|
static int |
AOP_COMMENT
|
static int |
AOP_DPUSH
|
static int |
AOP_EXCMARKER
|
static int |
AOP_FPUSH
|
static int |
AOP_FREE
|
static int |
AOP_GOTOBLK
|
static int |
AOP_GOTOTEMP
|
static int |
AOP_INVOKEINIT
|
static int |
AOP_IPUSH
|
static int |
AOP_LABEL
|
static int |
AOP_LPUSH
|
static int |
AOP_NONE
|
static int |
AOP_SPUSH
|
static int |
NAT_BOOLEAN
|
static int |
NAT_BYTE
|
static int |
NAT_CHAR
|
static int |
NAT_DOUBLE
|
static int |
NAT_FLOAT
|
static int |
NAT_INT
|
static int |
NAT_LONG
|
static int |
NAT_SHORT
|
Instruction |
next
|
static int |
OP_AALOAD
|
static int |
OP_AASTORE
|
static int |
OP_ACONST_NULL
|
static int |
OP_ALOAD
|
static int |
OP_ALOAD_0
|
static int |
OP_ALOAD_1
|
static int |
OP_ALOAD_2
|
static int |
OP_ALOAD_3
|
static int |
OP_ANEWARRAY
|
static int |
OP_ARETURN
|
static int |
OP_ARRAYLENGTH
|
static int |
OP_ASTORE
|
static int |
OP_ASTORE_0
|
static int |
OP_ASTORE_1
|
static int |
OP_ASTORE_2
|
static int |
OP_ASTORE_3
|
static int |
OP_ATHROW
|
static int |
OP_BALOAD
|
static int |
OP_BASTORE
|
static int |
OP_BIPUSH
|
static int |
OP_CALOAD
|
static int |
OP_CASTORE
|
static int |
OP_CHECKCAST
|
static int |
OP_D2F
|
static int |
OP_D2I
|
static int |
OP_D2L
|
static int |
OP_DADD
|
static int |
OP_DALOAD
|
static int |
OP_DASTORE
|
static int |
OP_DCMPG
|
static int |
OP_DCMPL
|
static int |
OP_DCONST_0
|
static int |
OP_DCONST_1
|
static int |
OP_DDIV
|
static int |
OP_DLOAD
|
static int |
OP_DLOAD_0
|
static int |
OP_DLOAD_1
|
static int |
OP_DLOAD_2
|
static int |
OP_DLOAD_3
|
static int |
OP_DMUL
|
static int |
OP_DNEG
|
static int |
OP_DREM
|
static int |
OP_DRETURN
|
static int |
OP_DSTORE
|
static int |
OP_DSTORE_0
|
static int |
OP_DSTORE_1
|
static int |
OP_DSTORE_2
|
static int |
OP_DSTORE_3
|
static int |
OP_DSUB
|
static int |
OP_DUP
|
static int |
OP_DUP_X1
|
static int |
OP_DUP_X2
|
static int |
OP_DUP2
|
static int |
OP_DUP2_X1
|
static int |
OP_DUP2_X2
|
static int |
OP_F2D
|
static int |
OP_F2I
|
static int |
OP_F2L
|
static int |
OP_FADD
|
static int |
OP_FALOAD
|
static int |
OP_FASTORE
|
static int |
OP_FCMPG
|
static int |
OP_FCMPL
|
static int |
OP_FCONST_0
|
static int |
OP_FCONST_1
|
static int |
OP_FCONST_2
|
static int |
OP_FDIV
|
static int |
OP_FLOAD
|
static int |
OP_FLOAD_0
|
static int |
OP_FLOAD_1
|
static int |
OP_FLOAD_2
|
static int |
OP_FLOAD_3
|
static int |
OP_FMUL
|
static int |
OP_FNEG
|
static int |
OP_FREM
|
static int |
OP_FRETURN
|
static int |
OP_FSTORE
|
static int |
OP_FSTORE_0
|
static int |
OP_FSTORE_1
|
static int |
OP_FSTORE_2
|
static int |
OP_FSTORE_3
|
static int |
OP_FSUB
|
static int |
OP_GETFIELD
|
static int |
OP_GETSTATIC
|
static int |
OP_GOTO
|
static int |
OP_GOTO_W
|
static int |
OP_I2B
|
static int |
OP_I2C
|
static int |
OP_I2D
|
static int |
OP_I2F
|
static int |
OP_I2L
|
static int |
OP_I2S
|
static int |
OP_IADD
|
static int |
OP_IALOAD
|
static int |
OP_IAND
|
static int |
OP_IASTORE
|
static int |
OP_ICONST_0
|
static int |
OP_ICONST_1
|
static int |
OP_ICONST_2
|
static int |
OP_ICONST_3
|
static int |
OP_ICONST_4
|
static int |
OP_ICONST_5
|
static int |
OP_ICONST_M1
|
static int |
OP_IDIV
|
static int |
OP_IF_ACMPEQ
|
static int |
OP_IF_ACMPNE
|
static int |
OP_IF_ICMPEQ
|
static int |
OP_IF_ICMPGE
|
static int |
OP_IF_ICMPGT
|
static int |
OP_IF_ICMPLE
|
static int |
OP_IF_ICMPLT
|
static int |
OP_IF_ICMPNE
|
static int |
OP_IFEQ
|
static int |
OP_IFGE
|
static int |
OP_IFGT
|
static int |
OP_IFLE
|
static int |
OP_IFLT
|
static int |
OP_IFNE
|
static int |
OP_IFNONNULL
|
static int |
OP_IFNULL
|
static int |
OP_IINC
|
static int |
OP_ILOAD
|
static int |
OP_ILOAD_0
|
static int |
OP_ILOAD_1
|
static int |
OP_ILOAD_2
|
static int |
OP_ILOAD_3
|
static int |
OP_IMUL
|
static int |
OP_INEG
|
static int |
OP_INSTANCEOF
|
static int |
OP_INVOKEINTERFACE
|
static int |
OP_INVOKESPECIAL
|
static int |
OP_INVOKESTATIC
|
static int |
OP_INVOKEVIRTUAL
|
static int |
OP_IOR
|
static int |
OP_IREM
|
static int |
OP_IRETURN
|
static int |
OP_ISHL
|
static int |
OP_ISHR
|
static int |
OP_ISTORE
|
static int |
OP_ISTORE_0
|
static int |
OP_ISTORE_1
|
static int |
OP_ISTORE_2
|
static int |
OP_ISTORE_3
|
static int |
OP_ISUB
|
static int |
OP_IUSHR
|
static int |
OP_IXOR
|
static int |
OP_JSR
|
static int |
OP_JSR_W
|
static int |
OP_L2D
|
static int |
OP_L2F
|
static int |
OP_L2I
|
static int |
OP_LADD
|
static int |
OP_LALOAD
|
static int |
OP_LAND
|
static int |
OP_LASTORE
|
static int |
OP_LCMP
|
static int |
OP_LCONST_0
|
static int |
OP_LCONST_1
|
static int |
OP_LDC
|
static int |
OP_LDC_W
|
static int |
OP_LDC2_W
|
static int |
OP_LDIV
|
static int |
OP_LLOAD
|
static int |
OP_LLOAD_0
|
static int |
OP_LLOAD_1
|
static int |
OP_LLOAD_2
|
static int |
OP_LLOAD_3
|
static int |
OP_LMUL
|
static int |
OP_LNEG
|
static int |
OP_LOOKUPSWITCH
|
static int |
OP_LOR
|
static int |
OP_LREM
|
static int |
OP_LRETURN
|
static int |
OP_LSHL
|
static int |
OP_LSHR
|
static int |
OP_LSTORE
|
static int |
OP_LSTORE_0
|
static int |
OP_LSTORE_1
|
static int |
OP_LSTORE_2
|
static int |
OP_LSTORE_3
|
static int |
OP_LSUB
|
static int |
OP_LUSHR
|
static int |
OP_LXOR
|
static int |
OP_MONITORENTER
|
static int |
OP_MONITOREXIT
|
static int |
OP_MULTIANEWARRAY
|
static int |
OP_NEW
|
static int |
OP_NEWARRAY
|
static int |
OP_NOP
|
static int |
OP_POP
|
static int |
OP_POP2
|
static int |
OP_PUTFIELD
|
static int |
OP_PUTSTATIC
|
static int |
OP_RET
|
static int |
OP_RETURN
|
static int |
OP_SALOAD
|
static int |
OP_SASTORE
|
static int |
OP_SIPUSH
|
static int |
OP_SWAP
|
static int |
OP_TABLESWITCH
|
static int |
OP_WIDE
|
Instruction |
prev
|
Constructor Summary | |
---|---|
Instruction()
Constructor. |
Method Summary | |
---|---|
BranchTarget |
branchTarget()
|
java.lang.String |
classRef()
|
void |
copy(Instruction i)
make this a verbatim copy of i |
int |
countArgs()
|
int |
countRets()
|
Descriptor |
descriptor()
|
Instruction |
dup()
|
java.lang.String |
elemName()
|
boolean |
equals(java.lang.Object o)
support Cloneable |
static int |
extend16(int i)
|
static int |
extend8(int i)
|
int |
hashCode()
support Cloneable |
double |
immediate_f()
|
long |
immediate_l()
|
java.lang.String |
immediate_s()
|
int |
immediate()
|
static int |
invCondition(int op)
|
boolean |
isGet()
|
boolean |
isLoad()
|
boolean |
isPut()
|
boolean |
isReturn()
|
boolean |
isStore()
|
boolean |
isSwitch()
|
Type |
localType()
|
java.lang.String |
lvname()
|
int |
lvtIndex()
|
int |
maxsize()
How big can this instruction possibly be when written to disk? Immediates or local numbers are considered when determining the size (ie, aload 0 is size 1) . |
int |
opCode()
Field getter and setter functions. |
int |
pc()
|
DataFlow.ProcState |
procState()
|
int |
readFile(java.io.DataInputStream dataIn,
int index,
jbet.ConstantPool constantPool)
Constructor parses a JVM bytecode and any in-line data and creates a single Instruction object. |
int |
realOpCode()
|
java.lang.String |
recString()
|
Instruction |
setAaload()
Set this to an AALOAD |
Instruction |
setAastore()
Set this to an AASTORE |
Instruction |
setAconst_Null()
Set this to an ACONST_NULL |
Instruction |
setAload(int lvt)
Set this to an ALOAD |
Instruction |
setANewArray(java.lang.String s)
Set this to an ANEWARRAY |
Instruction |
setAreturn()
Set this to an ARETURN |
Instruction |
setArrayLength()
Set this to an ARRAYLENGTH |
Instruction |
setArrayLoad(Type t)
Set this to the correct ALOAD opcode depending on type |
Instruction |
setArrayStore(Type t)
Set this to the correct ASTORE opcode depending on type |
Instruction |
setAstore(int lvt)
Set this to an ASTORE |
Instruction |
setAthrow()
Set this to an ATHROW |
void |
setBranchTarget(Block b)
|
BranchTarget |
setBranchTarget(BranchTarget t)
|
void |
setBranchTarget(Instruction instr)
|
Instruction |
setCheckcast(java.lang.String s)
Set this to a CHECKCAST |
Instruction |
setCheckcast(Type t)
Set this to a CHECKCAST |
java.lang.String |
setClassRef(java.lang.String s)
|
Instruction |
setComment(java.lang.String s)
Set this to an comment string |
Descriptor |
setDescriptor(Descriptor t)
|
Instruction |
setDload(int lvt)
Set this to a DLOAD |
Instruction |
setDpush(double i)
Set this to a DPUSH |
Instruction |
setDreturn()
Set this to a DRETURN |
Instruction |
setDstore(int lvt)
Set this to a DSTORE |
Instruction |
setDup_x(Type t,
Type over)
|
Instruction |
setDup_x1()
Set this to a DUP_X1 |
Instruction |
setDup_x2()
Set this to a DUP_X2 |
Instruction |
setDup()
Set this to a DUP |
Instruction |
setDup(Type t)
Set this to a DUP or DUP2 depending on type |
Instruction |
setDup2_x1()
Set this to a DUP2_X1 |
Instruction |
setDup2_x2()
Set this to a DUP2_X2 |
Instruction |
setDup2()
Set this to a DUP2 |
java.lang.String |
setElemName(java.lang.String s)
|
Instruction |
setFload(int lvt)
Set this to an FLOAD |
Instruction |
setFpush(double i)
Set this to an FPUSH |
Instruction |
setFreturn()
Set this to an FRETURN |
Instruction |
setFstore(int lvt)
Set this to an FSTORE |
Instruction |
setGetfield(java.lang.String cname,
java.lang.String field,
Type t)
Set this to a GETFIELD |
Instruction |
setGetstatic(java.lang.String cname,
java.lang.String field,
Type t)
Set this to a GETSTATIC |
Instruction |
setGoto(Block target)
Make this instruction a GOTO to the given switch block. |
Instruction |
setGoto(Instruction target)
Make this instruction a GOTO to the given instruction. |
Instruction |
setIaload()
Set this to an IALOAD |
Instruction |
setIastore()
Set this to an IASTORE |
Instruction |
setIfeq()
Make this instruction an IFEQ. |
Instruction |
setIfeq(Instruction target)
Initialize an Instruction object as an "ifeq" instruction. |
Instruction |
setIfIcmpeq()
Make this instruction an IF_ICMPEQ. |
Instruction |
setIfIcmpeq(Instruction target)
Make this instruction an IF_ICMPEQ. |
Instruction |
setIfIcmpge(Instruction ins)
Make this instruction an IF_ICMPGE. |
Instruction |
setIfIcmpgt()
Make this instruction an IF_ICMPGT. |
Instruction |
setIfIcmpgt(Instruction target)
Make this instruction an IF_ICMPGT. |
Instruction |
setIfIcmple()
Make this instruction an IF_ICMPLE. |
Instruction |
setIfIcmple(Instruction target)
Make this instruction an IF_ICMPLE. |
Instruction |
setIfIcmpne()
Make this instruction an IF_ICMPNE. |
Instruction |
setIfIcmpne(Instruction target)
Make this instruction an IF_ICMPNE. |
Instruction |
setIflt(Instruction ins)
Make this instruction an IFLT. |
Instruction |
setIfne()
Make this instruction an IFNE. |
Instruction |
setIfne(Instruction target)
Make this instruction an IFNE. |
Instruction |
setIfNoNull()
Set this to an IFNONNULL |
Instruction |
setIfNoNull(Instruction ins)
|
Instruction |
setIfNull()
Set this to an IFNULL |
Instruction |
setIfNull(Instruction ins)
|
Instruction |
setIinc(int lvt,
int inc)
Set this to an IINC |
Instruction |
setIload(int lvt)
Set this to an ILOAD |
double |
setImmediate_f(double d)
|
long |
setImmediate_l(long l)
|
java.lang.String |
setImmediate_s(java.lang.String d)
|
int |
setImmediate(int i)
|
Instruction |
setInstanceof(java.lang.String s)
Set this to an INSTANCEOF |
Instruction |
setInstanceof(Type t)
Set this to a CHECKCAST |
Instruction |
setInvoke(java.lang.String cname,
java.lang.String ename,
Descriptor d,
boolean isStatic)
Set this to an INVOKESTATIC or INVOKEVIRTUAL |
Instruction |
setInvoke(java.lang.String cname,
java.lang.String ename,
Descriptor d,
int op)
Set this to an invoke |
Instruction |
setInvokeSpecial(java.lang.String cname,
java.lang.String ename,
Descriptor d)
Set this to an INVOKESPECIAL |
Instruction |
setInvokeStatic(java.lang.String cname,
java.lang.String ename,
Descriptor d)
Set this to an INVOKESTATIC |
Instruction |
setInvokeVirtual(java.lang.String cname,
java.lang.String ename,
Descriptor d)
Set this to an INVOKEVIRTUAL |
Instruction |
setIpush(int i)
Set this to an IPUSH |
Instruction |
setIreturn()
Set this to an IRETURN |
Instruction |
setIstore(int lvt)
Set this to an ISTORE |
Instruction |
setIsub()
Set this to an ISUB |
Instruction |
setLload(int lvt)
Set this to an LLOAD |
Instruction |
setLoad(Type t,
int lvt)
Set this to the correct LOAD opcode depending on type |
Instruction |
setLookupSwitch()
Make this instruction a LOOKUPSWITCH. |
Instruction |
setLpush(long i)
Set this to an LPUSH |
Instruction |
setLreturn()
Set this to an LRETURN |
Instruction |
setLstore(int lvt)
Set this to an LSTORE |
java.lang.String |
setLvname(java.lang.String d)
|
int |
setLvtIndex(int i)
|
Instruction |
setMultiaNewArray(java.lang.String s,
int n)
Set this to an MULTIANEWARRAY |
Instruction |
setNew(java.lang.String s)
Set this to a NEW |
Instruction |
setNewArray(int atype)
Set this to a NEWARRAY |
Instruction |
setNewArray(Type array)
Set this to a NEWARRAY |
Instruction |
setNop()
Set this to a NOP |
int |
setOpCode(int o)
|
int |
setPc(int i)
|
Instruction |
setPop()
Set this to a POP |
Instruction |
setPop(Type t)
Set this to a POP or POP2 depending on type |
Instruction |
setPop2()
Set this to a POP2 |
Instruction |
setPutfield(java.lang.String cname,
java.lang.String field,
Type t)
Set this to a PUTFIELD |
Instruction |
setPutstatic(java.lang.String cname,
java.lang.String field,
Type t)
Set this to a PUTSTATIC |
int |
setRealOpCode(int o)
|
Instruction |
setRet(int lvt)
Set this to a ret |
Instruction |
setReturn()
Set this to a RETURN |
Instruction |
setReturn(Type t)
Set this to the correct RETURN opcode depending on type |
Instruction |
setSpush(java.lang.String s)
Set this to an SPUSH |
Instruction |
setStore(Type t,
int lvt)
Set this to the correct STORE opcode depending on type |
Instruction |
setSwap()
Set this to a SWAP |
BranchTarget[] |
setSwitchArray(BranchTarget[] a)
|
Instruction |
setTableSwitch()
Make this instruction a TABLESWITCH. |
Type |
setType(Type t)
|
int |
stackUse()
|
BranchTarget[] |
switchArray()
|
Type |
type()
|
static int |
unextend16(int i)
|
static long |
unextend32(long i)
|
static int |
unextend8(int i)
|
boolean |
usesBranch()
|
boolean |
usesClass()
|
boolean |
usesField()
|
boolean |
usesLocals()
|
boolean |
usesMethod()
|
int |
writeFile(java.io.DataOutputStream dataOut,
int index)
write the instruction to a file. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Instruction next
public Instruction prev
public static final int NAT_BOOLEAN
public static final int NAT_CHAR
public static final int NAT_FLOAT
public static final int NAT_DOUBLE
public static final int NAT_BYTE
public static final int NAT_SHORT
public static final int NAT_INT
public static final int NAT_LONG
public static final int OP_NOP
public static final int OP_MONITORENTER
public static final int OP_MONITOREXIT
public static final int OP_WIDE
public static final int OP_NEW
public static final int OP_NEWARRAY
public static final int OP_ANEWARRAY
public static final int OP_MULTIANEWARRAY
public static final int OP_RET
public static final int OP_IRETURN
public static final int OP_LRETURN
public static final int OP_FRETURN
public static final int OP_DRETURN
public static final int OP_ARETURN
public static final int OP_RETURN
public static final int OP_CHECKCAST
public static final int OP_INSTANCEOF
public static final int OP_INVOKEVIRTUAL
public static final int OP_INVOKESPECIAL
public static final int OP_INVOKESTATIC
public static final int OP_INVOKEINTERFACE
public static final int OP_IFEQ
public static final int OP_IFNE
public static final int OP_IFLT
public static final int OP_IFGE
public static final int OP_IFGT
public static final int OP_IFLE
public static final int OP_IF_ICMPEQ
public static final int OP_IF_ICMPNE
public static final int OP_IF_ICMPLT
public static final int OP_IF_ICMPGE
public static final int OP_IF_ICMPGT
public static final int OP_IF_ICMPLE
public static final int OP_IF_ACMPEQ
public static final int OP_IF_ACMPNE
public static final int OP_GOTO
public static final int OP_GOTO_W
public static final int OP_JSR
public static final int OP_TABLESWITCH
public static final int OP_LOOKUPSWITCH
public static final int OP_IFNULL
public static final int OP_IFNONNULL
public static final int OP_JSR_W
public static final int OP_ATHROW
public static final int OP_ACONST_NULL
public static final int OP_ICONST_M1
public static final int OP_ICONST_0
public static final int OP_ICONST_1
public static final int OP_ICONST_2
public static final int OP_ICONST_3
public static final int OP_ICONST_4
public static final int OP_ICONST_5
public static final int OP_LCONST_0
public static final int OP_LCONST_1
public static final int OP_FCONST_0
public static final int OP_FCONST_1
public static final int OP_FCONST_2
public static final int OP_DCONST_0
public static final int OP_DCONST_1
public static final int OP_LDC
public static final int OP_LDC_W
public static final int OP_LDC2_W
public static final int OP_BIPUSH
public static final int OP_SIPUSH
public static final int OP_POP
public static final int OP_POP2
public static final int OP_ILOAD
public static final int OP_ILOAD_0
public static final int OP_ILOAD_1
public static final int OP_ILOAD_2
public static final int OP_ILOAD_3
public static final int OP_FLOAD
public static final int OP_FLOAD_0
public static final int OP_FLOAD_1
public static final int OP_FLOAD_2
public static final int OP_FLOAD_3
public static final int OP_LLOAD
public static final int OP_LLOAD_0
public static final int OP_LLOAD_1
public static final int OP_LLOAD_2
public static final int OP_LLOAD_3
public static final int OP_DLOAD
public static final int OP_DLOAD_0
public static final int OP_DLOAD_1
public static final int OP_DLOAD_2
public static final int OP_DLOAD_3
public static final int OP_ALOAD
public static final int OP_ALOAD_0
public static final int OP_ALOAD_1
public static final int OP_ALOAD_2
public static final int OP_ALOAD_3
public static final int OP_ISTORE
public static final int OP_ISTORE_0
public static final int OP_ISTORE_1
public static final int OP_ISTORE_2
public static final int OP_ISTORE_3
public static final int OP_FSTORE
public static final int OP_FSTORE_0
public static final int OP_FSTORE_1
public static final int OP_FSTORE_2
public static final int OP_FSTORE_3
public static final int OP_LSTORE
public static final int OP_LSTORE_0
public static final int OP_LSTORE_1
public static final int OP_LSTORE_2
public static final int OP_LSTORE_3
public static final int OP_DSTORE
public static final int OP_DSTORE_0
public static final int OP_DSTORE_1
public static final int OP_DSTORE_2
public static final int OP_DSTORE_3
public static final int OP_ASTORE
public static final int OP_ASTORE_0
public static final int OP_ASTORE_1
public static final int OP_ASTORE_2
public static final int OP_ASTORE_3
public static final int OP_GETSTATIC
public static final int OP_PUTSTATIC
public static final int OP_GETFIELD
public static final int OP_PUTFIELD
public static final int OP_DUP
public static final int OP_DUP_X1
public static final int OP_DUP_X2
public static final int OP_DUP2
public static final int OP_DUP2_X1
public static final int OP_DUP2_X2
public static final int OP_SWAP
public static final int OP_IADD
public static final int OP_LADD
public static final int OP_FADD
public static final int OP_DADD
public static final int OP_ISUB
public static final int OP_LSUB
public static final int OP_FSUB
public static final int OP_DSUB
public static final int OP_IMUL
public static final int OP_LMUL
public static final int OP_FMUL
public static final int OP_DMUL
public static final int OP_IDIV
public static final int OP_LDIV
public static final int OP_FDIV
public static final int OP_DDIV
public static final int OP_IREM
public static final int OP_LREM
public static final int OP_FREM
public static final int OP_DREM
public static final int OP_INEG
public static final int OP_LNEG
public static final int OP_FNEG
public static final int OP_DNEG
public static final int OP_ISHL
public static final int OP_LSHL
public static final int OP_ISHR
public static final int OP_LSHR
public static final int OP_IUSHR
public static final int OP_LUSHR
public static final int OP_IAND
public static final int OP_LAND
public static final int OP_IOR
public static final int OP_LOR
public static final int OP_IXOR
public static final int OP_LXOR
public static final int OP_IINC
public static final int OP_LCMP
public static final int OP_FCMPG
public static final int OP_FCMPL
public static final int OP_DCMPG
public static final int OP_DCMPL
public static final int OP_I2B
public static final int OP_I2C
public static final int OP_I2S
public static final int OP_I2L
public static final int OP_I2F
public static final int OP_I2D
public static final int OP_L2I
public static final int OP_L2F
public static final int OP_L2D
public static final int OP_F2I
public static final int OP_F2L
public static final int OP_F2D
public static final int OP_D2I
public static final int OP_D2L
public static final int OP_D2F
public static final int OP_IALOAD
public static final int OP_LALOAD
public static final int OP_FALOAD
public static final int OP_DALOAD
public static final int OP_AALOAD
public static final int OP_BALOAD
public static final int OP_CALOAD
public static final int OP_SALOAD
public static final int OP_IASTORE
public static final int OP_LASTORE
public static final int OP_FASTORE
public static final int OP_DASTORE
public static final int OP_AASTORE
public static final int OP_BASTORE
public static final int OP_CASTORE
public static final int OP_SASTORE
public static final int OP_ARRAYLENGTH
public static final int AOP_IPUSH
public static final int AOP_FPUSH
public static final int AOP_LPUSH
public static final int AOP_DPUSH
public static final int AOP_SPUSH
public static final int AOP_NONE
public static final int AOP_EXCMARKER
public static final int AOP_COMMENT
public static final int AOP_GOTOBLK
public static final int AOP_LABEL
public static final int AOP_INVOKEINIT
public static final int AOP_GOTOTEMP
public static final int AOP_FREE
Constructor Detail |
---|
public Instruction()
Method Detail |
---|
public void copy(Instruction i)
i
- public int opCode()
public int setOpCode(int o)
public int realOpCode()
public int setRealOpCode(int o)
public int lvtIndex()
public int setLvtIndex(int i)
public int immediate()
public int setImmediate(int i)
public long immediate_l()
public long setImmediate_l(long l)
public double immediate_f()
public double setImmediate_f(double d)
public java.lang.String immediate_s()
public java.lang.String setImmediate_s(java.lang.String d)
public java.lang.String lvname()
public java.lang.String setLvname(java.lang.String d)
public BranchTarget branchTarget()
public BranchTarget setBranchTarget(BranchTarget t)
public BranchTarget[] switchArray()
public BranchTarget[] setSwitchArray(BranchTarget[] a)
public java.lang.String classRef()
public java.lang.String setClassRef(java.lang.String s)
public java.lang.String elemName()
public java.lang.String setElemName(java.lang.String s)
public Type type()
public Type setType(Type t)
public Descriptor descriptor()
public Descriptor setDescriptor(Descriptor t)
public int pc()
public int setPc(int i)
public DataFlow.ProcState procState()
public void setBranchTarget(Instruction instr)
public void setBranchTarget(Block b)
public Instruction dup()
public Instruction setNop()
public Instruction setComment(java.lang.String s)
s
- comment string
public Instruction setIfNull()
public Instruction setIfNull(Instruction ins)
public Instruction setIfNoNull()
public Instruction setIfNoNull(Instruction ins)
public Instruction setNew(java.lang.String s)
s
- class reference
public Instruction setNewArray(int atype)
atype
- one of the NAT_* values
public Instruction setANewArray(java.lang.String s)
s
- class reference
public Instruction setMultiaNewArray(java.lang.String s, int n)
s
- class reference
public Instruction setInstanceof(java.lang.String s)
s
- class reference
public Instruction setInstanceof(Type t)
t
- a type to check
public Instruction setCheckcast(java.lang.String s)
s
- class reference
public Instruction setCheckcast(Type t)
t
- a type to check
public Instruction setInvokeStatic(java.lang.String cname, java.lang.String ename, Descriptor d)
cname
- class nameename
- element named
- type descriptor
public Instruction setInvokeVirtual(java.lang.String cname, java.lang.String ename, Descriptor d)
cname
- class nameename
- element named
- type descriptor
public Instruction setInvokeSpecial(java.lang.String cname, java.lang.String ename, Descriptor d)
cname
- class nameename
- element named
- type descriptor
public Instruction setInvoke(java.lang.String cname, java.lang.String ename, Descriptor d, int op)
cname
- class nameename
- element named
- type descriptor
public Instruction setInvoke(java.lang.String cname, java.lang.String ename, Descriptor d, boolean isStatic)
cname
- class nameename
- element named
- type descriptorisStatic
- TRUE if static
public Instruction setGetfield(java.lang.String cname, java.lang.String field, Type t)
cname
- class namefield
- field namet
- type
public boolean isGet()
public boolean isPut()
public Instruction setGetstatic(java.lang.String cname, java.lang.String field, Type t)
cname
- class namefield
- field namet
- type
public Instruction setPutfield(java.lang.String cname, java.lang.String field, Type t)
cname
- class namefield
- field namet
- type
public Instruction setPutstatic(java.lang.String cname, java.lang.String field, Type t)
cname
- class namefield
- field namet
- type
public Instruction setDup()
public Instruction setDup2()
public Instruction setDup(Type t)
public Instruction setDup_x(Type t, Type over)
public Instruction setAconst_Null()
public Instruction setAthrow()
public Instruction setAreturn()
public Instruction setIreturn()
public Instruction setDreturn()
public Instruction setFreturn()
public Instruction setLreturn()
public Instruction setReturn()
public Instruction setPop()
public Instruction setPop2()
public Instruction setPop(Type t)
public Instruction setDup_x1()
public Instruction setDup_x2()
public Instruction setDup2_x1()
public Instruction setDup2_x2()
public Instruction setIpush(int i)
i
- int value to push
public Instruction setDpush(double i)
i
- double to push
public Instruction setFpush(double i)
i
- double value to push
public Instruction setLpush(long i)
i
- long value to push
public Instruction setSpush(java.lang.String s)
s
- string value to push
public Instruction setLoad(Type t, int lvt)
t
- type of valuelvt
- index
public Instruction setNewArray(Type array)
array
- type of array to create. array can be the array or value type
public Instruction setArrayLoad(Type t)
t
- type of value (not array)
public Instruction setArrayStore(Type t)
t
- type of value or array
public Instruction setReturn(Type t)
t
- type of return
public Instruction setAload(int lvt)
lvt
- index
public Instruction setRet(int lvt)
lvt
- index
public Instruction setIload(int lvt)
lvt
- index
public Instruction setDload(int lvt)
lvt
- index
public Instruction setFload(int lvt)
lvt
- index
public Instruction setLload(int lvt)
lvt
- index
public Instruction setIstore(int lvt)
lvt
- index
public Instruction setIastore()
public Instruction setIaload()
public Instruction setAastore()
public Instruction setAaload()
public Instruction setArrayLength()
public Instruction setIsub()
public Instruction setIinc(int lvt, int inc)
lvt
- indexinc
- increment immediate
public Instruction setLstore(int lvt)
lvt
- index
public Instruction setFstore(int lvt)
lvt
- index
public Instruction setDstore(int lvt)
lvt
- index
public Instruction setAstore(int lvt)
lvt
- index
public Instruction setStore(Type t, int lvt)
t
- typelvt
- index
public Instruction setSwap()
public Instruction setIfeq(Instruction target)
target
- The instruction to branch to.
public Instruction setIfne(Instruction target)
target
- the instruction that this one goes to.
public Instruction setIfeq()
public Instruction setIfne()
public Instruction setIflt(Instruction ins)
target
- the instruction that this one goes to.
public Instruction setIfIcmple(Instruction target)
target
- the instruction that this one goes to.
public Instruction setIfIcmple()
public Instruction setIfIcmpne(Instruction target)
target
- the instruction that this one goes to.
public Instruction setIfIcmpne()
public Instruction setIfIcmpeq(Instruction target)
target
- the instruction that this one goes to.
public Instruction setIfIcmpeq()
public Instruction setIfIcmpge(Instruction ins)
ins
- the instruction that this one goes to.
public Instruction setIfIcmpgt(Instruction target)
target
- the instruction that this one goes to.
public Instruction setIfIcmpgt()
public Instruction setGoto(Instruction target)
target
- the instruction that this one goes to.
public Instruction setGoto(Block target)
target
- the switch block that this one goes to.
public Instruction setTableSwitch()
public Instruction setLookupSwitch()
public int readFile(java.io.DataInputStream dataIn, int index, jbet.ConstantPool constantPool) throws ClassFileException, java.io.IOException
code
- An array of JVM bytecodes.index
- Where in the array to recognize the instruction.
ClassFileException
java.io.IOException
public int writeFile(java.io.DataOutputStream dataOut, int index) throws java.lang.RuntimeException, java.io.IOException
dataOut
- output streamindex
- size of padding for alignment in tableswitch
java.lang.RuntimeException
java.io.IOException
public static long unextend32(long i)
public static int unextend16(int i)
public static int unextend8(int i)
public static int extend8(int i)
public static int extend16(int i)
public boolean usesLocals()
public Type localType()
public boolean isStore()
public boolean isLoad()
public boolean usesMethod()
public boolean usesField()
public boolean usesClass()
public int countArgs()
public int countRets()
public int stackUse()
public boolean usesBranch()
public boolean isReturn()
public boolean isSwitch()
public static int invCondition(int op)
public java.lang.String recString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int maxsize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |