#[derive(Debug, Clone, PartialEq)]
pub enum Instruction {
Aaload,
Aastore,
AConstNull,
Aload(u8),
Aload0,
Aload1,
Aload2,
Aload3,
Anewarray(u16),
Areturn,
Arraylength,
Astore(u8),
Astore0,
Astore1,
Astore2,
Astore3,
Athrow,
Baload,
Bastore,
Bipush(u8),
Caload,
Castore,
Checkcast(u16),
D2f,
D2i,
D2l,
Dadd,
Daload,
Dastore,
Dcmpg,
Dcmpl,
Dconst0,
Dconst1,
Ddiv,
Dload(u8),
Dload0,
Dload1,
Dload2,
Dload3,
Dmul,
Dneg,
Drem,
Dreturn,
Dstore(u8),
Dstore0,
Dstore1,
Dstore2,
Dstore3,
Dsub,
Dup,
DupX1,
DupX2,
Dup2,
Dup2X1,
Dup2X2,
F2d,
F2i,
F2l,
Fadd,
Faload,
Fastore,
Fcmpg,
Fcmpl,
Fconst0,
Fconst1,
Fconst2,
Fdiv,
Fload(u8),
Fload0,
Fload1,
Fload2,
Fload3,
Fmul,
Fneg,
Frem,
Freturn,
Fstore(u8),
Fstore0,
Fstore1,
Fstore2,
Fstore3,
Fsub,
Getfield(u16),
Getstatic(u16),
Goto(u16),
GotoW,
I2b,
I2c,
I2d,
I2f,
I2l,
I2s,
Iadd,
Iaload,
Iand,
Iastore,
IconstM1,
Iconst0,
Iconst1,
Iconst2,
Iconst3,
Iconst4,
Iconst5,
Idiv,
IfAcmpeq(u16),
IfAcmpne(u16),
IfIcmpeq(u16),
IfIcmpne(u16),
IfIcmplt(u16),
IfIcmpge(u16),
IfIcmpgt(u16),
IfIcmple(u16),
Ifeq(u16),
Ifne(u16),
Iflt(u16),
Ifge(u16),
Ifgt(u16),
Ifle(u16),
Ifnonnull(u16),
Ifnull(u16),
Iinc(u8, i8),
Iload(u8),
Iload0,
Iload1,
Iload2,
Iload3,
Imul,
Ineg,
Instanceof(u16),
Invokedynamic(u16),
Invokeinterface(u16, u8),
Invokespecial(u16),
Invokestatic(u16),
Invokevirtual(u16),
Ior,
Irem,
Ireturn,
Ishl,
Ishr,
Istore(u8),
Istore0,
Istore1,
Istore2,
Istore3,
Isub,
Iushr,
Ixor,
Jsr(u16),
JsrW,
L2d,
L2f,
L2i,
Ladd,
Laload,
Land,
Lastore,
Lcmp,
Lconst0,
Lconst1,
Ldc(u8),
LdcW(u16),
Ldc2W(u16),
Ldiv,
Lload(u8),
Lload0,
Lload1,
Lload2,
Lload3,
Lmul,
Lneg,
Lookupswitch,
Lor,
Lrem,
Lreturn,
Lshl,
Lshr,
Lstore(u8),
Lstore0,
Lstore1,
Lstore2,
Lstore3,
Lsub,
Lushr,
Lxor,
Monitorenter,
Monitorexit,
Multianewarray(u16, u8),
New(u16),
Newarray(u8), Nop,
Pop,
Pop2,
Putfield(u16),
Putstatic(u16),
Ret(u8),
Return,
Saload,
Sastore,
Sipush(i16),
Swap,
Tableswitch,
Wide,
}
impl std::fmt::Display for Instruction {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Instruction::Aaload => write!(f, "aaload"),
Instruction::Aastore => write!(f, "aastore"),
Instruction::AConstNull => write!(f, "aconst_null"),
Instruction::Aload(index) => write!(f, "aload {}", index),
Instruction::Aload0 => write!(f, "aload_0"),
Instruction::Aload1 => write!(f, "aload_1"),
Instruction::Aload2 => write!(f, "aload_2"),
Instruction::Aload3 => write!(f, "aload_3"),
Instruction::Anewarray(index) => write!(f, "anewarray {}", index),
Instruction::Areturn => write!(f, "areturn"),
Instruction::Arraylength => write!(f, "arraylength"),
Instruction::Astore(index) => write!(f, "astore {}", index),
Instruction::Astore0 => write!(f, "astore_0"),
Instruction::Astore1 => write!(f, "astore_1"),
Instruction::Astore2 => write!(f, "astore_2"),
Instruction::Astore3 => write!(f, "astore_3"),
Instruction::Athrow => write!(f, "athrow"),
Instruction::Baload => write!(f, "baload"),
Instruction::Bastore => write!(f, "bastore"),
Instruction::Bipush(value) => write!(f, "bipush {}", value),
Instruction::Caload => write!(f, "caload"),
Instruction::Castore => write!(f, "castore"),
Instruction::Checkcast(index) => write!(f, "checkcast {}", index),
Instruction::D2f => write!(f, "d2f"),
Instruction::D2i => write!(f, "d2i"),
Instruction::D2l => write!(f, "d2l"),
Instruction::Dadd => write!(f, "dadd"),
Instruction::Daload => write!(f, "daload"),
Instruction::Dastore => write!(f, "dastore"),
Instruction::Dcmpg => write!(f, "dcmpg"),
Instruction::Dcmpl => write!(f, "dcmpl"),
Instruction::Dconst0 => write!(f, "dconst_0"),
Instruction::Dconst1 => write!(f, "dconst_1"),
Instruction::Ddiv => write!(f, "ddiv"),
Instruction::Dload(index) => write!(f, "dload {}", index),
Instruction::Dload0 => write!(f, "dload_0"),
Instruction::Dload1 => write!(f, "dload_1"),
Instruction::Dload2 => write!(f, "dload_2"),
Instruction::Dload3 => write!(f, "dload_3"),
Instruction::Dmul => write!(f, "dmul"),
Instruction::Dneg => write!(f, "dneg"),
Instruction::Drem => write!(f, "drem"),
Instruction::Dreturn => write!(f, "dreturn"),
Instruction::Dstore(index) => write!(f, "dstore {}", index),
Instruction::Dstore0 => write!(f, "dstore_0"),
Instruction::Dstore1 => write!(f, "dstore_1"),
Instruction::Dstore2 => write!(f, "dstore_2"),
Instruction::Dstore3 => write!(f, "dstore_3"),
Instruction::Dsub => write!(f, "dsub"),
Instruction::Dup => write!(f, "dup"),
Instruction::DupX1 => write!(f, "dup_x1"),
Instruction::DupX2 => write!(f, "dup_x2"),
Instruction::Dup2 => write!(f, "dup2"),
Instruction::Dup2X1 => write!(f, "dup2_x1"),
Instruction::Dup2X2 => write!(f, "dup2_x2"),
Instruction::F2d => write!(f, "f2d"),
Instruction::F2i => write!(f, "f2i"),
Instruction::F2l => write!(f, "f2l"),
Instruction::Fadd => write!(f, "fadd"),
Instruction::Faload => write!(f, "faload"),
Instruction::Fastore => write!(f, "fastore"),
Instruction::Fcmpg => write!(f, "fcmpg"),
Instruction::Fcmpl => write!(f, "fcmpl"),
Instruction::Fconst0 => write!(f, "fconst_0"),
Instruction::Fconst1 => write!(f, "fconst_1"),
Instruction::Fconst2 => write!(f, "fconst_2"),
Instruction::Fdiv => write!(f, "fdiv"),
Instruction::Fload(index) => write!(f, "fload {}", index),
Instruction::Fload0 => write!(f, "fload_0"),
Instruction::Fload1 => write!(f, "fload_1"),
Instruction::Fload2 => write!(f, "fload_2"),
Instruction::Fload3 => write!(f, "fload_3"),
Instruction::Fmul => write!(f, "fmul"),
Instruction::Fneg => write!(f, "fneg"),
Instruction::Frem => write!(f, "frem"),
Instruction::Freturn => write!(f, "freturn"),
Instruction::Fstore(index) => write!(f, "fstore {}", index),
Instruction::Fstore0 => write!(f, "fstore_0"),
Instruction::Fstore1 => write!(f, "fstore_1"),
Instruction::Fstore2 => write!(f, "fstore_2"),
Instruction::Fstore3 => write!(f, "fstore_3"),
Instruction::Fsub => write!(f, "fsub"),
Instruction::Getfield(index) => write!(f, "getfield {}", index),
Instruction::Getstatic(index) => write!(f, "getstatic {}", index),
Instruction::Goto(offset) => write!(f, "goto {}", offset),
Instruction::GotoW => write!(f, "goto_w"),
Instruction::I2b => write!(f, "i2b"),
Instruction::I2c => write!(f, "i2c"),
Instruction::I2d => write!(f, "i2d"),
Instruction::I2f => write!(f, "i2f"),
Instruction::I2l => write!(f, "i2l"),
Instruction::I2s => write!(f, "i2s"),
Instruction::Iadd => write!(f, "iadd"),
Instruction::Iaload => write!(f, "iaload"),
Instruction::Iand => write!(f, "iand"),
Instruction::Iastore => write!(f, "iastore"),
Instruction::IconstM1 => write!(f, "iconst_m1"),
Instruction::Iconst0 => write!(f, "iconst_0"),
Instruction::Iconst1 => write!(f, "iconst_1"),
Instruction::Iconst2 => write!(f, "iconst_2"),
Instruction::Iconst3 => write!(f, "iconst_3"),
Instruction::Iconst4 => write!(f, "iconst_4"),
Instruction::Iconst5 => write!(f, "iconst_5"),
Instruction::Idiv => write!(f, "idiv"),
Instruction::IfAcmpeq(offset) => write!(f, "if_acmpeq {}", offset),
Instruction::IfAcmpne(offset) => write!(f, "if_acmpne {}", offset),
Instruction::IfIcmpeq(offset) => write!(f, "if_icmpeq {}", offset),
Instruction::IfIcmpne(offset) => write!(f, "if_icmpne {}", offset),
Instruction::IfIcmplt(offset) => write!(f, "if_icmplt {}", offset),
Instruction::IfIcmpge(offset) => write!(f, "if_icmpge {}", offset),
Instruction::IfIcmpgt(offset) => write!(f, "if_icmpgt {}", offset),
Instruction::IfIcmple(offset) => write!(f, "if_icmple {}", offset),
Instruction::Ifeq(offset) => write!(f, "ifeq {}", offset),
Instruction::Ifne(offset) => write!(f, "ifne {}", offset),
Instruction::Iflt(offset) => write!(f, "iflt {}", offset),
Instruction::Ifge(offset) => write!(f, "ifge {}", offset),
Instruction::Ifgt(offset) => write!(f, "ifgt {}", offset),
Instruction::Ifle(offset) => write!(f, "ifle {}", offset),
Instruction::Ifnonnull(offset) => write!(f, "ifnonnull {}", offset),
Instruction::Ifnull(offset) => write!(f, "ifnull {}", offset),
Instruction::Iinc(index, value) => write!(f, "iinc {} {}", index, value),
Instruction::Iload(index) => write!(f, "iload {}", index),
Instruction::Iload0 => write!(f, "iload_0"),
Instruction::Iload1 => write!(f, "iload_1"),
Instruction::Iload2 => write!(f, "iload_2"),
Instruction::Iload3 => write!(f, "iload_3"),
Instruction::Imul => write!(f, "imul"),
Instruction::Ineg => write!(f, "ineg"),
Instruction::Instanceof(index) => write!(f, "instanceof {}", index),
Instruction::Invokedynamic(index) => write!(f, "invokedynamic {}", index),
Instruction::Invokeinterface(index, offset) => {
write!(f, "invokeinterface {} {}", index, offset)
}
Instruction::Invokespecial(index) => write!(f, "invokespecial {}", index),
Instruction::Invokestatic(index) => write!(f, "invokestatic {}", index),
Instruction::Invokevirtual(index) => write!(f, "invokevirtual {}", index),
Instruction::Ior => write!(f, "ior"),
Instruction::Irem => write!(f, "irem"),
Instruction::Ireturn => write!(f, "ireturn"),
Instruction::Ishl => write!(f, "ishl"),
Instruction::Ishr => write!(f, "ishr"),
Instruction::Istore(index) => write!(f, "istore {}", index),
Instruction::Istore0 => write!(f, "istore_0"),
Instruction::Istore1 => write!(f, "istore_1"),
Instruction::Istore2 => write!(f, "istore_2"),
Instruction::Istore3 => write!(f, "istore_3"),
Instruction::Isub => write!(f, "isub"),
Instruction::Iushr => write!(f, "iushr"),
Instruction::Ixor => write!(f, "ixor"),
Instruction::Jsr(offset) => write!(f, "jsr {}", offset),
Instruction::JsrW => write!(f, "jsr_w"),
Instruction::L2d => write!(f, "l2d"),
Instruction::L2f => write!(f, "l2f"),
Instruction::L2i => write!(f, "l2i"),
Instruction::Ladd => write!(f, "ladd"),
Instruction::Laload => write!(f, "laload"),
Instruction::Land => write!(f, "land"),
Instruction::Lastore => write!(f, "lastore"),
Instruction::Lcmp => write!(f, "lcmp"),
Instruction::Lconst0 => write!(f, "lconst_0"),
Instruction::Lconst1 => write!(f, "lconst_1"),
Instruction::Ldc(index) => write!(f, "ldc {}", index),
Instruction::LdcW(index) => write!(f, "ldc_w {}", index),
Instruction::Ldc2W(index) => write!(f, "ldc2_w {}", index),
Instruction::Ldiv => write!(f, "ldiv"),
Instruction::Lload(index) => write!(f, "lload {}", index),
Instruction::Lload0 => write!(f, "lload_0"),
Instruction::Lload1 => write!(f, "lload_1"),
Instruction::Lload2 => write!(f, "lload_2"),
Instruction::Lload3 => write!(f, "lload_3"),
Instruction::Lmul => write!(f, "lmul"),
Instruction::Lneg => write!(f, "lneg"),
Instruction::Lookupswitch => write!(f, "lookupswitch"),
Instruction::Lor => write!(f, "lor"),
Instruction::Lrem => write!(f, "lrem"),
Instruction::Lreturn => write!(f, "lreturn"),
Instruction::Lshl => write!(f, "lshl"),
Instruction::Lshr => write!(f, "lshr"),
Instruction::Lstore(index) => write!(f, "lstore {}", index),
Instruction::Lstore0 => write!(f, "lstore_0"),
Instruction::Lstore1 => write!(f, "lstore_1"),
Instruction::Lstore2 => write!(f, "lstore_2"),
Instruction::Lstore3 => write!(f, "lstore_3"),
Instruction::Lsub => write!(f, "lsub"),
Instruction::Lushr => write!(f, "lushr"),
Instruction::Lxor => write!(f, "lxor"),
Instruction::Monitorenter => write!(f, "monitorenter"),
Instruction::Monitorexit => write!(f, "monitorexit"),
Instruction::Multianewarray(index, dimensions) => {
write!(f, "multianewarray {} {}", index, dimensions)
}
Instruction::New(index) => write!(f, "new {}", index),
Instruction::Newarray(index) => write!(f, "newarray {}", index),
Instruction::Nop => write!(f, "nop"),
Instruction::Pop => write!(f, "pop"),
Instruction::Pop2 => write!(f, "pop2"),
Instruction::Putfield(index) => write!(f, "putfield {}", index),
Instruction::Putstatic(index) => write!(f, "putstatic {}", index),
Instruction::Ret(index) => write!(f, "ret {}", index),
Instruction::Return => write!(f, "return"),
Instruction::Saload => write!(f, "saload"),
Instruction::Sastore => write!(f, "sastore"),
Instruction::Sipush(value) => write!(f, "sipush {}", value),
Instruction::Swap => write!(f, "swap"),
Instruction::Tableswitch => write!(f, "tableswitch"),
Instruction::Wide => write!(f, "wide"),
}
}
}