Enum Instruction

Source
#[repr(u8)]
pub enum Instruction {
Show 205 variants Nop = 0, AConstNull = 1, IConstM1 = 2, IConst0 = 3, IConst1 = 4, IConst2 = 5, IConst3 = 6, IConst4 = 7, IConst5 = 8, LConst0 = 9, LConst1 = 10, FConst0 = 11, FConst1 = 12, FConst2 = 13, DConst0 = 14, DConst1 = 15, BiPush(u8), SiPush(u16), Ldc(ConstantValue), LdcW(ConstantValue), Ldc2W(ConstantValue), ILoad(u8), LLoad(u8), FLoad(u8), DLoad(u8), ALoad(u8), ILoad0 = 26, ILoad1 = 27, ILoad2 = 28, ILoad3 = 29, LLoad0 = 30, LLoad1 = 31, LLoad2 = 32, LLoad3 = 33, FLoad0 = 34, FLoad1 = 35, FLoad2 = 36, FLoad3 = 37, DLoad0 = 38, DLoad1 = 39, DLoad2 = 40, DLoad3 = 41, ALoad0 = 42, ALoad1 = 43, ALoad2 = 44, ALoad3 = 45, IALoad = 46, LALoad = 47, FALoad = 48, DALoad = 49, AALoad = 50, BALoad = 51, CALoad = 52, SALoad = 53, IStore(u8), LStore(u8), FStore(u8), DStore(u8), AStore(u8), IStore0 = 59, IStore1 = 60, IStore2 = 61, IStore3 = 62, LStore0 = 63, LStore1 = 64, LStore2 = 65, LStore3 = 66, FStore0 = 67, FStore1 = 68, FStore2 = 69, FStore3 = 70, DStore0 = 71, DStore1 = 72, DStore2 = 73, DStore3 = 74, AStore0 = 75, AStore1 = 76, AStore2 = 77, AStore3 = 78, IAStore = 79, LAStore = 80, FAStore = 81, DAStore = 82, AAStore = 83, BAStore = 84, CAStore = 85, SAStore = 86, Pop = 87, Pop2 = 88, Dup = 89, DupX1 = 90, DupX2 = 91, Dup2 = 92, Dup2X1 = 93, Dup2X2 = 94, Swap = 95, IAdd = 96, LAdd = 97, FAdd = 98, DAdd = 99, ISub = 100, LSub = 101, FSub = 102, DSub = 103, IMul = 104, LMul = 105, FMul = 106, DMul = 107, IDiv = 108, LDiv = 109, FDiv = 110, DDiv = 111, IRem = 112, LRem = 113, FRem = 114, DRem = 115, INeg = 116, LNeg = 117, FNeg = 118, DNeg = 119, IShl = 120, LShl = 121, IShr = 122, LShr = 123, IUShr = 124, LUShr = 125, IAnd = 126, LAnd = 127, IOr = 128, LOr = 129, IXor = 130, LXor = 131, IInc(u8, i32), I2L = 133, I2F = 134, I2D = 135, L2I = 136, L2F = 137, L2D = 138, F2I = 139, F2L = 140, F2D = 141, D2I = 142, D2L = 143, D2F = 144, I2B = 145, I2C = 146, I2S = 147, LCmp = 148, FCmpL = 149, FCmpG = 150, DCmpL = 151, DCmpG = 152, IfEq(ProgramCounter), IfNe(ProgramCounter), IfLt(ProgramCounter), IfGe(ProgramCounter), IfGt(ProgramCounter), IfLe(ProgramCounter), IfICmpEq(ProgramCounter), IfICmpNe(ProgramCounter), IfICmpLt(ProgramCounter), IfICmpGe(ProgramCounter), IfICmpGt(ProgramCounter), IfICmpLe(ProgramCounter), IfACmpEq(ProgramCounter), IfACmpNe(ProgramCounter), Goto(ProgramCounter), Jsr(ProgramCounter), Ret(u8), TableSwitch { range: RangeInclusive<i32>, jump_targets: Vec<ProgramCounter>, default: ProgramCounter, }, LookupSwitch { default: ProgramCounter, match_targets: BTreeMap<i32, ProgramCounter>, }, IReturn = 172, LReturn = 173, FReturn = 174, DReturn = 175, AReturn = 176, Return = 177, GetStatic(FieldRef), PutStatic(FieldRef), GetField(FieldRef), PutField(FieldRef), InvokeVirtual(MethodRef), InvokeSpecial(MethodRef), InvokeStatic(MethodRef), InvokeInterface(MethodRef, u8), InvokeDynamic { bootstrap_method_index: u16, name: String, descriptor: MethodDescriptor, }, New(ClassRef), NewArray(PrimitiveType), ANewArray(ClassRef), ArrayLength = 190, AThrow = 191, CheckCast(FieldType), InstanceOf(FieldType), MonitorEnter = 194, MonitorExit = 195, Wide(WideInstruction), MultiANewArray(FieldType, u8), IfNull(ProgramCounter), IfNonNull(ProgramCounter), GotoW(ProgramCounter), JsrW(ProgramCounter), Breakpoint = 202, ImpDep1 = 254, ImpDep2 = 255,
}
Expand description

A JVM instruction. See the JVM Specification §6.5 for more information.

Variants§

§

Nop = 0

§

AConstNull = 1

§

IConstM1 = 2

§

IConst0 = 3

§

IConst1 = 4

§

IConst2 = 5

§

IConst3 = 6

§

IConst4 = 7

§

IConst5 = 8

§

LConst0 = 9

§

LConst1 = 10

§

FConst0 = 11

§

FConst1 = 12

§

FConst2 = 13

§

DConst0 = 14

§

DConst1 = 15

§

BiPush(u8)

§

SiPush(u16)

§

Ldc(ConstantValue)

§

LdcW(ConstantValue)

§

Ldc2W(ConstantValue)

§

ILoad(u8)

§

LLoad(u8)

§

FLoad(u8)

§

DLoad(u8)

§

ALoad(u8)

§

ILoad0 = 26

§

ILoad1 = 27

§

ILoad2 = 28

§

ILoad3 = 29

§

LLoad0 = 30

§

LLoad1 = 31

§

LLoad2 = 32

§

LLoad3 = 33

§

FLoad0 = 34

§

FLoad1 = 35

§

FLoad2 = 36

§

FLoad3 = 37

§

DLoad0 = 38

§

DLoad1 = 39

§

DLoad2 = 40

§

DLoad3 = 41

§

ALoad0 = 42

§

ALoad1 = 43

§

ALoad2 = 44

§

ALoad3 = 45

§

IALoad = 46

§

LALoad = 47

§

FALoad = 48

§

DALoad = 49

§

AALoad = 50

§

BALoad = 51

§

CALoad = 52

§

SALoad = 53

§

IStore(u8)

§

LStore(u8)

§

FStore(u8)

§

DStore(u8)

§

AStore(u8)

§

IStore0 = 59

§

IStore1 = 60

§

IStore2 = 61

§

IStore3 = 62

§

LStore0 = 63

§

LStore1 = 64

§

LStore2 = 65

§

LStore3 = 66

§

FStore0 = 67

§

FStore1 = 68

§

FStore2 = 69

§

FStore3 = 70

§

DStore0 = 71

§

DStore1 = 72

§

DStore2 = 73

§

DStore3 = 74

§

AStore0 = 75

§

AStore1 = 76

§

AStore2 = 77

§

AStore3 = 78

§

IAStore = 79

§

LAStore = 80

§

FAStore = 81

§

DAStore = 82

§

AAStore = 83

§

BAStore = 84

§

CAStore = 85

§

SAStore = 86

§

Pop = 87

§

Pop2 = 88

§

Dup = 89

§

DupX1 = 90

§

DupX2 = 91

§

Dup2 = 92

§

Dup2X1 = 93

§

Dup2X2 = 94

§

Swap = 95

§

IAdd = 96

§

LAdd = 97

§

FAdd = 98

§

DAdd = 99

§

ISub = 100

§

LSub = 101

§

FSub = 102

§

DSub = 103

§

IMul = 104

§

LMul = 105

§

FMul = 106

§

DMul = 107

§

IDiv = 108

§

LDiv = 109

§

FDiv = 110

§

DDiv = 111

§

IRem = 112

§

LRem = 113

§

FRem = 114

§

DRem = 115

§

INeg = 116

§

LNeg = 117

§

FNeg = 118

§

DNeg = 119

§

IShl = 120

§

LShl = 121

§

IShr = 122

§

LShr = 123

§

IUShr = 124

§

LUShr = 125

§

IAnd = 126

§

LAnd = 127

§

IOr = 128

§

LOr = 129

§

IXor = 130

§

LXor = 131

§

IInc(u8, i32)

§

I2L = 133

§

I2F = 134

§

I2D = 135

§

L2I = 136

§

L2F = 137

§

L2D = 138

§

F2I = 139

§

F2L = 140

§

F2D = 141

§

D2I = 142

§

D2L = 143

§

D2F = 144

§

I2B = 145

§

I2C = 146

§

I2S = 147

§

LCmp = 148

§

FCmpL = 149

§

FCmpG = 150

§

DCmpL = 151

§

DCmpG = 152

§

IfEq(ProgramCounter)

§

IfNe(ProgramCounter)

§

IfLt(ProgramCounter)

§

IfGe(ProgramCounter)

§

IfGt(ProgramCounter)

§

IfLe(ProgramCounter)

§

IfICmpEq(ProgramCounter)

§

IfICmpNe(ProgramCounter)

§

IfICmpLt(ProgramCounter)

§

IfICmpGe(ProgramCounter)

§

IfICmpGt(ProgramCounter)

§

IfICmpLe(ProgramCounter)

§

IfACmpEq(ProgramCounter)

§

IfACmpNe(ProgramCounter)

§

Goto(ProgramCounter)

§

Jsr(ProgramCounter)

§

Ret(u8)

§

TableSwitch

Fields

§jump_targets: Vec<ProgramCounter>
§

LookupSwitch

Fields

§match_targets: BTreeMap<i32, ProgramCounter>
§

IReturn = 172

§

LReturn = 173

§

FReturn = 174

§

DReturn = 175

§

AReturn = 176

§

Return = 177

§

GetStatic(FieldRef)

§

PutStatic(FieldRef)

§

GetField(FieldRef)

§

PutField(FieldRef)

§

InvokeVirtual(MethodRef)

§

InvokeSpecial(MethodRef)

§

InvokeStatic(MethodRef)

§

InvokeInterface(MethodRef, u8)

§

InvokeDynamic

Fields

§bootstrap_method_index: u16
§name: String
§descriptor: MethodDescriptor
§

New(ClassRef)

§

NewArray(PrimitiveType)

§

ANewArray(ClassRef)

§

ArrayLength = 190

§

AThrow = 191

§

CheckCast(FieldType)

§

InstanceOf(FieldType)

§

MonitorEnter = 194

§

MonitorExit = 195

§

Wide(WideInstruction)

§

MultiANewArray(FieldType, u8)

§

IfNull(ProgramCounter)

§

IfNonNull(ProgramCounter)

§

GotoW(ProgramCounter)

§

JsrW(ProgramCounter)

§

Breakpoint = 202

§

ImpDep1 = 254

§

ImpDep2 = 255

Implementations§

Source§

impl Instruction

Source

pub const fn opcode(&self) -> u8

Gets the opcode.

Source

pub const fn name<'a>(&self) -> &'a str

Gets the name of the Instruction.

Source§

impl Instruction

Source

pub fn into_raw_instruction( self, pc: ProgramCounter, cp: &mut ConstantPool, ) -> Result<RawInstruction, ToWriterError>

Lower the instruction into a raw instruction.

§Errors

See ToWriterError for details.

Trait Implementations§

Source§

impl Clone for Instruction

Source§

fn clone(&self) -> Instruction

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Instruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Instruction

Source§

fn eq(&self, other: &Instruction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Instruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.