byucc.jhdl.synth.classparse
Class OpCode
java.lang.Object
byucc.jhdl.synth.classparse.ClassFileParser
byucc.jhdl.synth.classparse.OpCode
- Direct Known Subclasses:
- OpCodeBranch, OpCodeByte, OpCodeByteCP, OpCodeIinc, OpCodeMultianewarray, OpCodeShort, OpCodeWide, SynthOpCode
- public class OpCode
- extends ClassFileParser
Fields inherited from class byucc.jhdl.synth.classparse.ClassFileParser |
CONSTANT_Class, CONSTANT_Double, CONSTANT_Fieldref, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodref, CONSTANT_Long, CONSTANT_Methodref, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8 |
Constructor Summary |
OpCode(int pc,
java.lang.String mnemonic,
int op_code)
|
OpCode(java.lang.String mnemonic,
int op_code)
|
Methods inherited from class byucc.jhdl.synth.classparse.ClassFileParser |
getClassFile, getConstantPool, length, parseAttributeInfo, parseAttributes, parseConstantPool, parseCPInfo, parseDouble, parseFieldInfo, parseFields, parseFloat, parseLong, parseMethodInfo, parseMethods, parseOpCode, parseSuccess, parseUTF, s2, toJasmin, u1, u2, u4 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
mnemonic
protected java.lang.String mnemonic
pc
protected int pc
op_code
protected int op_code
OP_NOP
public static final int OP_NOP
- 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_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_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_ILOAD
public static final int OP_ILOAD
- See Also:
- Constant Field Values
OP_LLOAD
public static final int OP_LLOAD
- See Also:
- Constant Field Values
OP_FLOAD
public static final int OP_FLOAD
- See Also:
- Constant Field Values
OP_DLOAD
public static final int OP_DLOAD
- See Also:
- Constant Field Values
OP_ALOAD
public static final int OP_ALOAD
- 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_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_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_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_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_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_ISTORE
public static final int OP_ISTORE
- See Also:
- Constant Field Values
OP_LSTORE
public static final int OP_LSTORE
- See Also:
- Constant Field Values
OP_FSTORE
public static final int OP_FSTORE
- See Also:
- Constant Field Values
OP_DSTORE
public static final int OP_DSTORE
- See Also:
- Constant Field Values
OP_ASTORE
public static final int OP_ASTORE
- 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_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_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_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_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_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_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_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_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_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_LCMP
public static final int OP_LCMP
- See Also:
- Constant Field Values
OP_FCMPL
public static final int OP_FCMPL
- See Also:
- Constant Field Values
OP_FCMPG
public static final int OP_FCMPG
- See Also:
- Constant Field Values
OP_DCMPL
public static final int OP_DCMPL
- See Also:
- Constant Field Values
OP_DCMPG
public static final int OP_DCMPG
- 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_JSR
public static final int OP_JSR
- See Also:
- Constant Field Values
OP_RET
public static final int OP_RET
- 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_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_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_INVOKEVIRTUAL
public static final int OP_INVOKEVIRTUAL
- See Also:
- Constant Field Values
OP_INVOKENONVIRTUAL
public static final int OP_INVOKENONVIRTUAL
- 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_UNUSED
public static final int OP_UNUSED
- 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_ARRAYLENGTH
public static final int OP_ARRAYLENGTH
- See Also:
- Constant Field Values
OP_ATHROW
public static final int OP_ATHROW
- 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_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_MULTIANEWARRAY
public static final int OP_MULTIANEWARRAY
- 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_GOTO_W
public static final int OP_GOTO_W
- See Also:
- Constant Field Values
OP_JSR_W
public static final int OP_JSR_W
- See Also:
- Constant Field Values
codes
protected static OpCode[] codes
OpCode
public OpCode(java.lang.String mnemonic,
int op_code)
OpCode
public OpCode(int pc,
java.lang.String mnemonic,
int op_code)
toClass
public void toClass(ClassFileWriter output)
- Spit out the contents of this OpCode to the given ClassFileWriter.
This method is basically the opposite of the constructor. The constructor
reads in a OpCode from a DataInputStream and this method spits the
OpCode out to a DataOutputStream, (which is in the ClassFileWriter).
- Parameters:
output
- a ClassFileWriter constructed with a DataOutputStram to
contain the output class file.
isControl
public boolean isControl()
- Is the current OpCode an instruction which affects control flow?
isSwitch
public boolean isSwitch()
isConditionalBranch
public boolean isConditionalBranch()
isUnconditionalBranch
public boolean isUnconditionalBranch()
isTarget
public boolean isTarget()
setTarget
public void setTarget()
registerOpCodeArray
public static void registerOpCodeArray(OpCode[] codes)
getLineNumber
public int getLineNumber()
getPC
public int getPC()
getOpCode
public int getOpCode()
getName
public java.lang.String getName()
toString
public java.lang.String toString()
toJasmin
public java.lang.StringBuffer toJasmin(java.lang.StringBuffer result)
- Overrides:
toJasmin
in class ClassFileParser
jasminHeader
public java.lang.String jasminHeader()
parse
public OpCode parse(int pc,
java.lang.String mnemonic,
int op_code)
hasImmediate
protected boolean hasImmediate(java.lang.String mnemonic)
getImmediate
protected int getImmediate(java.lang.String mnemonic)
execute
public void execute(VirtualMachine vm)
getPossibleTargets
public WeightedOpCode[] getPossibleTargets(AttributeCode code)
Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.