jbet
Class Instruction

java.lang.Object
  extended by jbet.Instruction
All Implemented Interfaces:
java.lang.Cloneable

public final class Instruction
extends java.lang.Object
implements java.lang.Cloneable

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.

Since:
JDK 1.1.8

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

next

public Instruction next

prev

public Instruction prev

NAT_BOOLEAN

public static final int NAT_BOOLEAN
See Also:
Constant Field Values

NAT_CHAR

public static final int NAT_CHAR
See Also:
Constant Field Values

NAT_FLOAT

public static final int NAT_FLOAT
See Also:
Constant Field Values

NAT_DOUBLE

public static final int NAT_DOUBLE
See Also:
Constant Field Values

NAT_BYTE

public static final int NAT_BYTE
See Also:
Constant Field Values

NAT_SHORT

public static final int NAT_SHORT
See Also:
Constant Field Values

NAT_INT

public static final int NAT_INT
See Also:
Constant Field Values

NAT_LONG

public static final int NAT_LONG
See Also:
Constant Field Values

OP_NOP

public static final int OP_NOP
See Also:
Constant Field Values

OP_MONITORENTER

public static final int OP_MONITORENTER
See Also:
Constant Field Values

OP_MONITOREXIT

public static final int OP_MONITOREXIT
See Also:
Constant Field Values

OP_WIDE

public static final int OP_WIDE
See Also:
Constant Field Values

OP_NEW

public static final int OP_NEW
See Also:
Constant Field Values

OP_NEWARRAY

public static final int OP_NEWARRAY
See Also:
Constant Field Values

OP_ANEWARRAY

public static final int OP_ANEWARRAY
See Also:
Constant Field Values

OP_MULTIANEWARRAY

public static final int OP_MULTIANEWARRAY
See Also:
Constant Field Values

OP_RET

public static final int OP_RET
See Also:
Constant Field Values

OP_IRETURN

public static final int OP_IRETURN
See Also:
Constant Field Values

OP_LRETURN

public static final int OP_LRETURN
See Also:
Constant Field Values

OP_FRETURN

public static final int OP_FRETURN
See Also:
Constant Field Values

OP_DRETURN

public static final int OP_DRETURN
See Also:
Constant Field Values

OP_ARETURN

public static final int OP_ARETURN
See Also:
Constant Field Values

OP_RETURN

public static final int OP_RETURN
See Also:
Constant Field Values

OP_CHECKCAST

public static final int OP_CHECKCAST
See Also:
Constant Field Values

OP_INSTANCEOF

public static final int OP_INSTANCEOF
See Also:
Constant Field Values

OP_INVOKEVIRTUAL

public static final int OP_INVOKEVIRTUAL
See Also:
Constant Field Values

OP_INVOKESPECIAL

public static final int OP_INVOKESPECIAL
See Also:
Constant Field Values

OP_INVOKESTATIC

public static final int OP_INVOKESTATIC
See Also:
Constant Field Values

OP_INVOKEINTERFACE

public static final int OP_INVOKEINTERFACE
See Also:
Constant Field Values

OP_IFEQ

public static final int OP_IFEQ
See Also:
Constant Field Values

OP_IFNE

public static final int OP_IFNE
See Also:
Constant Field Values

OP_IFLT

public static final int OP_IFLT
See Also:
Constant Field Values

OP_IFGE

public static final int OP_IFGE
See Also:
Constant Field Values

OP_IFGT

public static final int OP_IFGT
See Also:
Constant Field Values

OP_IFLE

public static final int OP_IFLE
See Also:
Constant Field Values

OP_IF_ICMPEQ

public static final int OP_IF_ICMPEQ
See Also:
Constant Field Values

OP_IF_ICMPNE

public static final int OP_IF_ICMPNE
See Also:
Constant Field Values

OP_IF_ICMPLT

public static final int OP_IF_ICMPLT
See Also:
Constant Field Values

OP_IF_ICMPGE

public static final int OP_IF_ICMPGE
See Also:
Constant Field Values

OP_IF_ICMPGT

public static final int OP_IF_ICMPGT
See Also:
Constant Field Values

OP_IF_ICMPLE

public static final int OP_IF_ICMPLE
See Also:
Constant Field Values

OP_IF_ACMPEQ

public static final int OP_IF_ACMPEQ
See Also:
Constant Field Values

OP_IF_ACMPNE

public static final int OP_IF_ACMPNE
See Also:
Constant Field Values

OP_GOTO

public static final int OP_GOTO
See Also:
Constant Field Values

OP_GOTO_W

public static final int OP_GOTO_W
See Also:
Constant Field Values

OP_JSR

public static final int OP_JSR
See Also:
Constant Field Values

OP_TABLESWITCH

public static final int OP_TABLESWITCH
See Also:
Constant Field Values

OP_LOOKUPSWITCH

public static final int OP_LOOKUPSWITCH
See Also:
Constant Field Values

OP_IFNULL

public static final int OP_IFNULL
See Also:
Constant Field Values

OP_IFNONNULL

public static final int OP_IFNONNULL
See Also:
Constant Field Values

OP_JSR_W

public static final int OP_JSR_W
See Also:
Constant Field Values

OP_ATHROW

public static final int OP_ATHROW
See Also:
Constant Field Values

OP_ACONST_NULL

public static final int OP_ACONST_NULL
See Also:
Constant Field Values

OP_ICONST_M1

public static final int OP_ICONST_M1
See Also:
Constant Field Values

OP_ICONST_0

public static final int OP_ICONST_0
See Also:
Constant Field Values

OP_ICONST_1

public static final int OP_ICONST_1
See Also:
Constant Field Values

OP_ICONST_2

public static final int OP_ICONST_2
See Also:
Constant Field Values

OP_ICONST_3

public static final int OP_ICONST_3
See Also:
Constant Field Values

OP_ICONST_4

public static final int OP_ICONST_4
See Also:
Constant Field Values

OP_ICONST_5

public static final int OP_ICONST_5
See Also:
Constant Field Values

OP_LCONST_0

public static final int OP_LCONST_0
See Also:
Constant Field Values

OP_LCONST_1

public static final int OP_LCONST_1
See Also:
Constant Field Values

OP_FCONST_0

public static final int OP_FCONST_0
See Also:
Constant Field Values

OP_FCONST_1

public static final int OP_FCONST_1
See Also:
Constant Field Values

OP_FCONST_2

public static final int OP_FCONST_2
See Also:
Constant Field Values

OP_DCONST_0

public static final int OP_DCONST_0
See Also:
Constant Field Values

OP_DCONST_1

public static final int OP_DCONST_1
See Also:
Constant Field Values

OP_LDC

public static final int OP_LDC
See Also:
Constant Field Values

OP_LDC_W

public static final int OP_LDC_W
See Also:
Constant Field Values

OP_LDC2_W

public static final int OP_LDC2_W
See Also:
Constant Field Values

OP_BIPUSH

public static final int OP_BIPUSH
See Also:
Constant Field Values

OP_SIPUSH

public static final int OP_SIPUSH
See Also:
Constant Field Values

OP_POP

public static final int OP_POP
See Also:
Constant Field Values

OP_POP2

public static final int OP_POP2
See Also:
Constant Field Values

OP_ILOAD

public static final int OP_ILOAD
See Also:
Constant Field Values

OP_ILOAD_0

public static final int OP_ILOAD_0
See Also:
Constant Field Values

OP_ILOAD_1

public static final int OP_ILOAD_1
See Also:
Constant Field Values

OP_ILOAD_2

public static final int OP_ILOAD_2
See Also:
Constant Field Values

OP_ILOAD_3

public static final int OP_ILOAD_3
See Also:
Constant Field Values

OP_FLOAD

public static final int OP_FLOAD
See Also:
Constant Field Values

OP_FLOAD_0

public static final int OP_FLOAD_0
See Also:
Constant Field Values

OP_FLOAD_1

public static final int OP_FLOAD_1
See Also:
Constant Field Values

OP_FLOAD_2

public static final int OP_FLOAD_2
See Also:
Constant Field Values

OP_FLOAD_3

public static final int OP_FLOAD_3
See Also:
Constant Field Values

OP_LLOAD

public static final int OP_LLOAD
See Also:
Constant Field Values

OP_LLOAD_0

public static final int OP_LLOAD_0
See Also:
Constant Field Values

OP_LLOAD_1

public static final int OP_LLOAD_1
See Also:
Constant Field Values

OP_LLOAD_2

public static final int OP_LLOAD_2
See Also:
Constant Field Values

OP_LLOAD_3

public static final int OP_LLOAD_3
See Also:
Constant Field Values

OP_DLOAD

public static final int OP_DLOAD
See Also:
Constant Field Values

OP_DLOAD_0

public static final int OP_DLOAD_0
See Also:
Constant Field Values

OP_DLOAD_1

public static final int OP_DLOAD_1
See Also:
Constant Field Values

OP_DLOAD_2

public static final int OP_DLOAD_2
See Also:
Constant Field Values

OP_DLOAD_3

public static final int OP_DLOAD_3
See Also:
Constant Field Values

OP_ALOAD

public static final int OP_ALOAD
See Also:
Constant Field Values

OP_ALOAD_0

public static final int OP_ALOAD_0
See Also:
Constant Field Values

OP_ALOAD_1

public static final int OP_ALOAD_1
See Also:
Constant Field Values

OP_ALOAD_2

public static final int OP_ALOAD_2
See Also:
Constant Field Values

OP_ALOAD_3

public static final int OP_ALOAD_3
See Also:
Constant Field Values

OP_ISTORE

public static final int OP_ISTORE
See Also:
Constant Field Values

OP_ISTORE_0

public static final int OP_ISTORE_0
See Also:
Constant Field Values

OP_ISTORE_1

public static final int OP_ISTORE_1
See Also:
Constant Field Values

OP_ISTORE_2

public static final int OP_ISTORE_2
See Also:
Constant Field Values

OP_ISTORE_3

public static final int OP_ISTORE_3
See Also:
Constant Field Values

OP_FSTORE

public static final int OP_FSTORE
See Also:
Constant Field Values

OP_FSTORE_0

public static final int OP_FSTORE_0
See Also:
Constant Field Values

OP_FSTORE_1

public static final int OP_FSTORE_1
See Also:
Constant Field Values

OP_FSTORE_2

public static final int OP_FSTORE_2
See Also:
Constant Field Values

OP_FSTORE_3

public static final int OP_FSTORE_3
See Also:
Constant Field Values

OP_LSTORE

public static final int OP_LSTORE
See Also:
Constant Field Values

OP_LSTORE_0

public static final int OP_LSTORE_0
See Also:
Constant Field Values

OP_LSTORE_1

public static final int OP_LSTORE_1
See Also:
Constant Field Values

OP_LSTORE_2

public static final int OP_LSTORE_2
See Also:
Constant Field Values

OP_LSTORE_3

public static final int OP_LSTORE_3
See Also:
Constant Field Values

OP_DSTORE

public static final int OP_DSTORE
See Also:
Constant Field Values

OP_DSTORE_0

public static final int OP_DSTORE_0
See Also:
Constant Field Values

OP_DSTORE_1

public static final int OP_DSTORE_1
See Also:
Constant Field Values

OP_DSTORE_2

public static final int OP_DSTORE_2
See Also:
Constant Field Values

OP_DSTORE_3

public static final int OP_DSTORE_3
See Also:
Constant Field Values

OP_ASTORE

public static final int OP_ASTORE
See Also:
Constant Field Values

OP_ASTORE_0

public static final int OP_ASTORE_0
See Also:
Constant Field Values

OP_ASTORE_1

public static final int OP_ASTORE_1
See Also:
Constant Field Values

OP_ASTORE_2

public static final int OP_ASTORE_2
See Also:
Constant Field Values

OP_ASTORE_3

public static final int OP_ASTORE_3
See Also:
Constant Field Values

OP_GETSTATIC

public static final int OP_GETSTATIC
See Also:
Constant Field Values

OP_PUTSTATIC

public static final int OP_PUTSTATIC
See Also:
Constant Field Values

OP_GETFIELD

public static final int OP_GETFIELD
See Also:
Constant Field Values

OP_PUTFIELD

public static final int OP_PUTFIELD
See Also:
Constant Field Values

OP_DUP

public static final int OP_DUP
See Also:
Constant Field Values

OP_DUP_X1

public static final int OP_DUP_X1
See Also:
Constant Field Values

OP_DUP_X2

public static final int OP_DUP_X2
See Also:
Constant Field Values

OP_DUP2

public static final int OP_DUP2
See Also:
Constant Field Values

OP_DUP2_X1

public static final int OP_DUP2_X1
See Also:
Constant Field Values

OP_DUP2_X2

public static final int OP_DUP2_X2
See Also:
Constant Field Values

OP_SWAP

public static final int OP_SWAP
See Also:
Constant Field Values

OP_IADD

public static final int OP_IADD
See Also:
Constant Field Values

OP_LADD

public static final int OP_LADD
See Also:
Constant Field Values

OP_FADD

public static final int OP_FADD
See Also:
Constant Field Values

OP_DADD

public static final int OP_DADD
See Also:
Constant Field Values

OP_ISUB

public static final int OP_ISUB
See Also:
Constant Field Values

OP_LSUB

public static final int OP_LSUB
See Also:
Constant Field Values

OP_FSUB

public static final int OP_FSUB
See Also:
Constant Field Values

OP_DSUB

public static final int OP_DSUB
See Also:
Constant Field Values

OP_IMUL

public static final int OP_IMUL
See Also:
Constant Field Values

OP_LMUL

public static final int OP_LMUL
See Also:
Constant Field Values

OP_FMUL

public static final int OP_FMUL
See Also:
Constant Field Values

OP_DMUL

public static final int OP_DMUL
See Also:
Constant Field Values

OP_IDIV

public static final int OP_IDIV
See Also:
Constant Field Values

OP_LDIV

public static final int OP_LDIV
See Also:
Constant Field Values

OP_FDIV

public static final int OP_FDIV
See Also:
Constant Field Values

OP_DDIV

public static final int OP_DDIV
See Also:
Constant Field Values

OP_IREM

public static final int OP_IREM
See Also:
Constant Field Values

OP_LREM

public static final int OP_LREM
See Also:
Constant Field Values

OP_FREM

public static final int OP_FREM
See Also:
Constant Field Values

OP_DREM

public static final int OP_DREM
See Also:
Constant Field Values

OP_INEG

public static final int OP_INEG
See Also:
Constant Field Values

OP_LNEG

public static final int OP_LNEG
See Also:
Constant Field Values

OP_FNEG

public static final int OP_FNEG
See Also:
Constant Field Values

OP_DNEG

public static final int OP_DNEG
See Also:
Constant Field Values

OP_ISHL

public static final int OP_ISHL
See Also:
Constant Field Values

OP_LSHL

public static final int OP_LSHL
See Also:
Constant Field Values

OP_ISHR

public static final int OP_ISHR
See Also:
Constant Field Values

OP_LSHR

public static final int OP_LSHR
See Also:
Constant Field Values

OP_IUSHR

public static final int OP_IUSHR
See Also:
Constant Field Values

OP_LUSHR

public static final int OP_LUSHR
See Also:
Constant Field Values

OP_IAND

public static final int OP_IAND
See Also:
Constant Field Values

OP_LAND

public static final int OP_LAND
See Also:
Constant Field Values

OP_IOR

public static final int OP_IOR
See Also:
Constant Field Values

OP_LOR

public static final int OP_LOR
See Also:
Constant Field Values

OP_IXOR

public static final int OP_IXOR
See Also:
Constant Field Values

OP_LXOR

public static final int OP_LXOR
See Also:
Constant Field Values

OP_IINC

public static final int OP_IINC
See Also:
Constant Field Values

OP_LCMP

public static final int OP_LCMP
See Also:
Constant Field Values

OP_FCMPG

public static final int OP_FCMPG
See Also:
Constant Field Values

OP_FCMPL

public static final int OP_FCMPL
See Also:
Constant Field Values

OP_DCMPG

public static final int OP_DCMPG
See Also:
Constant Field Values

OP_DCMPL

public static final int OP_DCMPL
See Also:
Constant Field Values

OP_I2B

public static final int OP_I2B
See Also:
Constant Field Values

OP_I2C

public static final int OP_I2C
See Also:
Constant Field Values

OP_I2S

public static final int OP_I2S
See Also:
Constant Field Values

OP_I2L

public static final int OP_I2L
See Also:
Constant Field Values

OP_I2F

public static final int OP_I2F
See Also:
Constant Field Values

OP_I2D

public static final int OP_I2D
See Also:
Constant Field Values

OP_L2I

public static final int OP_L2I
See Also:
Constant Field Values

OP_L2F

public static final int OP_L2F
See Also:
Constant Field Values

OP_L2D

public static final int OP_L2D
See Also:
Constant Field Values

OP_F2I

public static final int OP_F2I
See Also:
Constant Field Values

OP_F2L

public static final int OP_F2L
See Also:
Constant Field Values

OP_F2D

public static final int OP_F2D
See Also:
Constant Field Values

OP_D2I

public static final int OP_D2I
See Also:
Constant Field Values

OP_D2L

public static final int OP_D2L
See Also:
Constant Field Values

OP_D2F

public static final int OP_D2F
See Also:
Constant Field Values

OP_IALOAD

public static final int OP_IALOAD
See Also:
Constant Field Values

OP_LALOAD

public static final int OP_LALOAD
See Also:
Constant Field Values

OP_FALOAD

public static final int OP_FALOAD
See Also:
Constant Field Values

OP_DALOAD

public static final int OP_DALOAD
See Also:
Constant Field Values

OP_AALOAD

public static final int OP_AALOAD
See Also:
Constant Field Values

OP_BALOAD

public static final int OP_BALOAD
See Also:
Constant Field Values

OP_CALOAD

public static final int OP_CALOAD
See Also:
Constant Field Values

OP_SALOAD

public static final int OP_SALOAD
See Also:
Constant Field Values

OP_IASTORE

public static final int OP_IASTORE
See Also:
Constant Field Values

OP_LASTORE

public static final int OP_LASTORE
See Also:
Constant Field Values

OP_FASTORE

public static final int OP_FASTORE
See Also:
Constant Field Values

OP_DASTORE

public static final int OP_DASTORE
See Also:
Constant Field Values

OP_AASTORE

public static final int OP_AASTORE
See Also:
Constant Field Values

OP_BASTORE

public static final int OP_BASTORE
See Also:
Constant Field Values

OP_CASTORE

public static final int OP_CASTORE
See Also:
Constant Field Values

OP_SASTORE

public static final int OP_SASTORE
See Also:
Constant Field Values

OP_ARRAYLENGTH

public static final int OP_ARRAYLENGTH
See Also:
Constant Field Values

AOP_IPUSH

public static final int AOP_IPUSH
See Also:
Constant Field Values

AOP_FPUSH

public static final int AOP_FPUSH
See Also:
Constant Field Values

AOP_LPUSH

public static final int AOP_LPUSH
See Also:
Constant Field Values

AOP_DPUSH

public static final int AOP_DPUSH
See Also:
Constant Field Values

AOP_SPUSH

public static final int AOP_SPUSH
See Also:
Constant Field Values

AOP_NONE

public static final int AOP_NONE
See Also:
Constant Field Values

AOP_EXCMARKER

public static final int AOP_EXCMARKER
See Also:
Constant Field Values

AOP_COMMENT

public static final int AOP_COMMENT
See Also:
Constant Field Values

AOP_GOTOBLK

public static final int AOP_GOTOBLK
See Also:
Constant Field Values

AOP_LABEL

public static final int AOP_LABEL
See Also:
Constant Field Values

AOP_INVOKEINIT

public static final int AOP_INVOKEINIT
See Also:
Constant Field Values

AOP_GOTOTEMP

public static final int AOP_GOTOTEMP
See Also:
Constant Field Values

AOP_FREE

public static final int AOP_FREE
See Also:
Constant Field Values
Constructor Detail

Instruction

public Instruction()
Constructor.

Method Detail

copy

public void copy(Instruction i)
make this a verbatim copy of i

Parameters:
i -

opCode

public int opCode()
Field getter and setter functions.


setOpCode

public int setOpCode(int o)

realOpCode

public int realOpCode()

setRealOpCode

public int setRealOpCode(int o)

lvtIndex

public int lvtIndex()

setLvtIndex

public int setLvtIndex(int i)

immediate

public int immediate()

setImmediate

public int setImmediate(int i)

immediate_l

public long immediate_l()

setImmediate_l

public long setImmediate_l(long l)

immediate_f

public double immediate_f()

setImmediate_f

public double setImmediate_f(double d)

immediate_s

public java.lang.String immediate_s()

setImmediate_s

public java.lang.String setImmediate_s(java.lang.String d)

lvname

public java.lang.String lvname()

setLvname

public java.lang.String setLvname(java.lang.String d)

branchTarget

public BranchTarget branchTarget()

setBranchTarget

public BranchTarget setBranchTarget(BranchTarget t)

switchArray

public BranchTarget[] switchArray()

setSwitchArray

public BranchTarget[] setSwitchArray(BranchTarget[] a)

classRef

public java.lang.String classRef()

setClassRef

public java.lang.String setClassRef(java.lang.String s)

elemName

public java.lang.String elemName()

setElemName

public java.lang.String setElemName(java.lang.String s)

type

public Type type()

setType

public Type setType(Type t)

descriptor

public Descriptor descriptor()

setDescriptor

public Descriptor setDescriptor(Descriptor t)

pc

public int pc()

setPc

public int setPc(int i)

procState

public DataFlow.ProcState procState()

setBranchTarget

public void setBranchTarget(Instruction instr)

setBranchTarget

public void setBranchTarget(Block b)

dup

public Instruction dup()

setNop

public Instruction setNop()
Set this to a NOP

Returns:
a reference to this

setComment

public Instruction setComment(java.lang.String s)
Set this to an comment string

Parameters:
s - comment string
Returns:
a reference to this

setIfNull

public Instruction setIfNull()
Set this to an IFNULL

Returns:
a reference to this

setIfNull

public Instruction setIfNull(Instruction ins)

setIfNoNull

public Instruction setIfNoNull()
Set this to an IFNONNULL

Returns:
a reference to this

setIfNoNull

public Instruction setIfNoNull(Instruction ins)

setNew

public Instruction setNew(java.lang.String s)
Set this to a NEW

Parameters:
s - class reference
Returns:
a reference to this

setNewArray

public Instruction setNewArray(int atype)
Set this to a NEWARRAY

Parameters:
atype - one of the NAT_* values
Returns:
a reference to this

setANewArray

public Instruction setANewArray(java.lang.String s)
Set this to an ANEWARRAY

Parameters:
s - class reference
Returns:
a reference to this

setMultiaNewArray

public Instruction setMultiaNewArray(java.lang.String s,
                                     int n)
Set this to an MULTIANEWARRAY

Parameters:
s - class reference
Returns:
a reference to this

setInstanceof

public Instruction setInstanceof(java.lang.String s)
Set this to an INSTANCEOF

Parameters:
s - class reference
Returns:
a reference to this

setInstanceof

public Instruction setInstanceof(Type t)
Set this to a CHECKCAST

Parameters:
t - a type to check
Returns:
a reference to this

setCheckcast

public Instruction setCheckcast(java.lang.String s)
Set this to a CHECKCAST

Parameters:
s - class reference
Returns:
a reference to this

setCheckcast

public Instruction setCheckcast(Type t)
Set this to a CHECKCAST

Parameters:
t - a type to check
Returns:
a reference to this

setInvokeStatic

public Instruction setInvokeStatic(java.lang.String cname,
                                   java.lang.String ename,
                                   Descriptor d)
Set this to an INVOKESTATIC

Parameters:
cname - class name
ename - element name
d - type descriptor
Returns:
a reference to this

setInvokeVirtual

public Instruction setInvokeVirtual(java.lang.String cname,
                                    java.lang.String ename,
                                    Descriptor d)
Set this to an INVOKEVIRTUAL

Parameters:
cname - class name
ename - element name
d - type descriptor
Returns:
a reference to this

setInvokeSpecial

public Instruction setInvokeSpecial(java.lang.String cname,
                                    java.lang.String ename,
                                    Descriptor d)
Set this to an INVOKESPECIAL

Parameters:
cname - class name
ename - element name
d - type descriptor
Returns:
a reference to this

setInvoke

public Instruction setInvoke(java.lang.String cname,
                             java.lang.String ename,
                             Descriptor d,
                             int op)
Set this to an invoke

Parameters:
cname - class name
ename - element name
d - type descriptor
Returns:
a reference to this

setInvoke

public Instruction setInvoke(java.lang.String cname,
                             java.lang.String ename,
                             Descriptor d,
                             boolean isStatic)
Set this to an INVOKESTATIC or INVOKEVIRTUAL

Parameters:
cname - class name
ename - element name
d - type descriptor
isStatic - TRUE if static
Returns:
a reference to this

setGetfield

public Instruction setGetfield(java.lang.String cname,
                               java.lang.String field,
                               Type t)
Set this to a GETFIELD

Parameters:
cname - class name
field - field name
t - type
Returns:
a reference to this

isGet

public boolean isGet()

isPut

public boolean isPut()

setGetstatic

public Instruction setGetstatic(java.lang.String cname,
                                java.lang.String field,
                                Type t)
Set this to a GETSTATIC

Parameters:
cname - class name
field - field name
t - type
Returns:
a reference to this

setPutfield

public Instruction setPutfield(java.lang.String cname,
                               java.lang.String field,
                               Type t)
Set this to a PUTFIELD

Parameters:
cname - class name
field - field name
t - type
Returns:
a reference to this

setPutstatic

public Instruction setPutstatic(java.lang.String cname,
                                java.lang.String field,
                                Type t)
Set this to a PUTSTATIC

Parameters:
cname - class name
field - field name
t - type
Returns:
a reference to this

setDup

public Instruction setDup()
Set this to a DUP

Returns:
a reference to this

setDup2

public Instruction setDup2()
Set this to a DUP2

Returns:
a reference to this

setDup

public Instruction setDup(Type t)
Set this to a DUP or DUP2 depending on type

Returns:
a reference to this

setDup_x

public Instruction setDup_x(Type t,
                            Type over)

setAconst_Null

public Instruction setAconst_Null()
Set this to an ACONST_NULL

Returns:
a reference to this

setAthrow

public Instruction setAthrow()
Set this to an ATHROW

Returns:
a reference to this

setAreturn

public Instruction setAreturn()
Set this to an ARETURN

Returns:
a reference to this

setIreturn

public Instruction setIreturn()
Set this to an IRETURN

Returns:
a reference to this

setDreturn

public Instruction setDreturn()
Set this to a DRETURN

Returns:
a reference to this

setFreturn

public Instruction setFreturn()
Set this to an FRETURN

Returns:
a reference to this

setLreturn

public Instruction setLreturn()
Set this to an LRETURN

Returns:
a reference to this

setReturn

public Instruction setReturn()
Set this to a RETURN

Returns:
a reference to this

setPop

public Instruction setPop()
Set this to a POP

Returns:
a reference to this

setPop2

public Instruction setPop2()
Set this to a POP2

Returns:
a reference to this

setPop

public Instruction setPop(Type t)
Set this to a POP or POP2 depending on type

Returns:
a reference to this

setDup_x1

public Instruction setDup_x1()
Set this to a DUP_X1

Returns:
a reference to this

setDup_x2

public Instruction setDup_x2()
Set this to a DUP_X2

Returns:
a reference to this

setDup2_x1

public Instruction setDup2_x1()
Set this to a DUP2_X1

Returns:
a reference to this

setDup2_x2

public Instruction setDup2_x2()
Set this to a DUP2_X2

Returns:
a reference to this

setIpush

public Instruction setIpush(int i)
Set this to an IPUSH

Parameters:
i - int value to push
Returns:
a reference to this

setDpush

public Instruction setDpush(double i)
Set this to a DPUSH

Parameters:
i - double to push
Returns:
a reference to this

setFpush

public Instruction setFpush(double i)
Set this to an FPUSH

Parameters:
i - double value to push
Returns:
a reference to this

setLpush

public Instruction setLpush(long i)
Set this to an LPUSH

Parameters:
i - long value to push
Returns:
a reference to this

setSpush

public Instruction setSpush(java.lang.String s)
Set this to an SPUSH

Parameters:
s - string value to push
Returns:
a reference to this

setLoad

public Instruction setLoad(Type t,
                           int lvt)
Set this to the correct LOAD opcode depending on type

Parameters:
t - type of value
lvt - index
Returns:
a reference to this

setNewArray

public Instruction setNewArray(Type array)
Set this to a NEWARRAY

Parameters:
array - type of array to create. array can be the array or value type
Returns:
a reference to this

setArrayLoad

public Instruction setArrayLoad(Type t)
Set this to the correct ALOAD opcode depending on type

Parameters:
t - type of value (not array)
Returns:
a reference to this

setArrayStore

public Instruction setArrayStore(Type t)
Set this to the correct ASTORE opcode depending on type

Parameters:
t - type of value or array
Returns:
a reference to this

setReturn

public Instruction setReturn(Type t)
Set this to the correct RETURN opcode depending on type

Parameters:
t - type of return
Returns:
a reference to this

setAload

public Instruction setAload(int lvt)
Set this to an ALOAD

Parameters:
lvt - index
Returns:
a reference to this

setRet

public Instruction setRet(int lvt)
Set this to a ret

Parameters:
lvt - index
Returns:
a reference to this

setIload

public Instruction setIload(int lvt)
Set this to an ILOAD

Parameters:
lvt - index
Returns:
a reference to this

setDload

public Instruction setDload(int lvt)
Set this to a DLOAD

Parameters:
lvt - index
Returns:
a reference to this

setFload

public Instruction setFload(int lvt)
Set this to an FLOAD

Parameters:
lvt - index
Returns:
a reference to this

setLload

public Instruction setLload(int lvt)
Set this to an LLOAD

Parameters:
lvt - index
Returns:
a reference to this

setIstore

public Instruction setIstore(int lvt)
Set this to an ISTORE

Parameters:
lvt - index
Returns:
a reference to this

setIastore

public Instruction setIastore()
Set this to an IASTORE

Returns:
a reference to this

setIaload

public Instruction setIaload()
Set this to an IALOAD

Returns:
a reference to this

setAastore

public Instruction setAastore()
Set this to an AASTORE

Returns:
a reference to this

setAaload

public Instruction setAaload()
Set this to an AALOAD

Returns:
a reference to this

setArrayLength

public Instruction setArrayLength()
Set this to an ARRAYLENGTH

Returns:
a reference to this

setIsub

public Instruction setIsub()
Set this to an ISUB

Returns:
a reference to this

setIinc

public Instruction setIinc(int lvt,
                           int inc)
Set this to an IINC

Parameters:
lvt - index
inc - increment immediate
Returns:
a reference to this

setLstore

public Instruction setLstore(int lvt)
Set this to an LSTORE

Parameters:
lvt - index
Returns:
a reference to this

setFstore

public Instruction setFstore(int lvt)
Set this to an FSTORE

Parameters:
lvt - index
Returns:
a reference to this

setDstore

public Instruction setDstore(int lvt)
Set this to a DSTORE

Parameters:
lvt - index
Returns:
a reference to this

setAstore

public Instruction setAstore(int lvt)
Set this to an ASTORE

Parameters:
lvt - index
Returns:
a reference to this

setStore

public Instruction setStore(Type t,
                            int lvt)
Set this to the correct STORE opcode depending on type

Parameters:
t - type
lvt - index
Returns:
a reference to this

setSwap

public Instruction setSwap()
Set this to a SWAP

Returns:
a reference to this

setIfeq

public Instruction setIfeq(Instruction target)
Initialize an Instruction object as an "ifeq" instruction.

Parameters:
target - The instruction to branch to.
Returns:
a reference to this instance.

setIfne

public Instruction setIfne(Instruction target)
Make this instruction an IFNE.

Parameters:
target - the instruction that this one goes to.
Returns:
a reference to this instance.

setIfeq

public Instruction setIfeq()
Make this instruction an IFEQ.

Returns:
a reference to this instance.

setIfne

public Instruction setIfne()
Make this instruction an IFNE.

Returns:
a reference to this instance.

setIflt

public Instruction setIflt(Instruction ins)
Make this instruction an IFLT.

Parameters:
target - the instruction that this one goes to.
Returns:
a reference to this instance.

setIfIcmple

public Instruction setIfIcmple(Instruction target)
Make this instruction an IF_ICMPLE.

Parameters:
target - the instruction that this one goes to.
Returns:
a reference to this instance.

setIfIcmple

public Instruction setIfIcmple()
Make this instruction an IF_ICMPLE.

Returns:
a reference to this instance.

setIfIcmpne

public Instruction setIfIcmpne(Instruction target)
Make this instruction an IF_ICMPNE.

Parameters:
target - the instruction that this one goes to.
Returns:
a reference to this instance.

setIfIcmpne

public Instruction setIfIcmpne()
Make this instruction an IF_ICMPNE.

Returns:
a reference to this instance.

setIfIcmpeq

public Instruction setIfIcmpeq(Instruction target)
Make this instruction an IF_ICMPEQ.

Parameters:
target - the instruction that this one goes to.
Returns:
a reference to this instance.

setIfIcmpeq

public Instruction setIfIcmpeq()
Make this instruction an IF_ICMPEQ.

Returns:
a reference to this instance.

setIfIcmpge

public Instruction setIfIcmpge(Instruction ins)
Make this instruction an IF_ICMPGE.

Parameters:
ins - the instruction that this one goes to.
Returns:
a reference to this instance.

setIfIcmpgt

public Instruction setIfIcmpgt(Instruction target)
Make this instruction an IF_ICMPGT.

Parameters:
target - the instruction that this one goes to.
Returns:
a reference to this instance.

setIfIcmpgt

public Instruction setIfIcmpgt()
Make this instruction an IF_ICMPGT.

Returns:
a reference to this instance.

setGoto

public Instruction setGoto(Instruction target)
Make this instruction a GOTO to the given instruction.

Parameters:
target - the instruction that this one goes to.
Returns:
a reference to this instance.

setGoto

public Instruction setGoto(Block target)
Make this instruction a GOTO to the given switch block.

Parameters:
target - the switch block that this one goes to.
Returns:
a reference to this instance.

setTableSwitch

public Instruction setTableSwitch()
Make this instruction a TABLESWITCH.

Returns:
a reference to this instance.

setLookupSwitch

public Instruction setLookupSwitch()
Make this instruction a LOOKUPSWITCH.

Returns:
a reference to this instance.

readFile

public int readFile(java.io.DataInputStream dataIn,
                    int index,
                    jbet.ConstantPool constantPool)
             throws ClassFileException,
                    java.io.IOException
Constructor parses a JVM bytecode and any in-line data and creates a single Instruction object.

Parameters:
code - An array of JVM bytecodes.
index - Where in the array to recognize the instruction.
Returns:
size in bytes of the instruction we just read.
Throws:
ClassFileException
java.io.IOException

writeFile

public int writeFile(java.io.DataOutputStream dataOut,
                     int index)
              throws java.lang.RuntimeException,
                     java.io.IOException
write the instruction to a file.

Parameters:
dataOut - output stream
index - size of padding for alignment in tableswitch
Returns:
size written
Throws:
java.lang.RuntimeException
java.io.IOException

unextend32

public static long unextend32(long i)

unextend16

public static int unextend16(int i)

unextend8

public static int unextend8(int i)

extend8

public static int extend8(int i)

extend16

public static int extend16(int i)

usesLocals

public boolean usesLocals()

localType

public Type localType()

isStore

public boolean isStore()

isLoad

public boolean isLoad()

usesMethod

public boolean usesMethod()

usesField

public boolean usesField()

usesClass

public boolean usesClass()

countArgs

public int countArgs()

countRets

public int countRets()

stackUse

public int stackUse()

usesBranch

public boolean usesBranch()

isReturn

public boolean isReturn()

isSwitch

public boolean isSwitch()

invCondition

public static int invCondition(int op)

recString

public java.lang.String recString()

hashCode

public int hashCode()
support Cloneable

Overrides:
hashCode in class java.lang.Object
Returns:
hash code for this object

equals

public boolean equals(java.lang.Object o)
support Cloneable

Overrides:
equals in class java.lang.Object
Returns:
true if objects are EQ.

maxsize

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

Returns:
size in bytes