Enum coffer::code::Instruction[][src]

pub enum Instruction {
Show variants NoOp, PushNull, Push(OrDynamic<Constant>), Dup, DupX1, DupX2, Dup2, Dup2X1, Dup2X2, Pop1, Pop2, Jump(JumpConditionLabel), CompareLongs, CompareFloats(FloatTypeNaNBehavior), LocalVariable(LoadOrStoreLocalTypeu16), Array(LoadOrStoreArrayType), ArrayLength, IntOperation(IntTypeIntOperation), FloatOperation(FloatTypeFloatOperation), Throw, CheckCast(OrDynamic<ClassType>), InstanceOf(OrDynamic<ClassType>), NewArray(OrDynamic<Type>, u8), Monitor(MonitorOperation), New(OrDynamic<Cow<'static, str>>), Conversion(NumberTypeNumberType), ConvertInt(BitType), Return(Option<LocalType>), Field(GetOrPutMemberTypeOrDynamic<MemberRef>), InvokeExact(MemberTypeOrDynamic<MemberRef>), InvokeSpecial(OrDynamic<MemberRef>), InvokeDynamic(Dynamic), InvokeInterface(OrDynamic<MemberRef>, u8), Jsr(Label), Ret(u16), Swap, IntIncrement(u16i16), LineNumber(u16), TableSwitch { default: Label, low: i32, offsets: Vec<Label>, }, LookupSwitch { default: Label, table: IndexMap<i32, Label>, }, Label(Label),
}

Abstract tagged union to represent the instruction set. Note that while each valid instruction corresponds to one and only one enum variant, a value may correspond to multiple possibilities of actual operation used in bytecode. Normally, it should choose the option that takes the lowest space.

Some variants don’t actually appear in the code, but instead they represent attributes of the Code attribute. This gives benefits such that when modifying the class it doesn’t need to modify the indices of the attributes to remain valid.

However, StackMap frames will not be a variant because they become quite invalid after modifications made to code, thus, frames should be regenerated every time.

Variants

NoOp
PushNull

Push a null object reference.

Push a constant value to the current stack.

Dup
DupX1
DupX2
Dup2
Dup2X1
Dup2X2
Pop1
Pop2
CompareLongs
CompareFloats(FloatTypeNaNBehavior)
LocalVariable(LoadOrStoreLocalTypeu16)
ArrayLength
IntOperation(IntTypeIntOperation)
FloatOperation(FloatTypeFloatOperation)
Throw
CheckCast(OrDynamic<ClassType>)
InstanceOf(OrDynamic<ClassType>)
NewArray(OrDynamic<Type>, u8)
New(OrDynamic<Cow<'static, str>>)
Conversion(NumberTypeNumberType)

Conversion of the same types have no effect, it will not result in an instruction.

ConvertInt(BitType)
Return(Option<LocalType>)
InvokeSpecial(OrDynamic<MemberRef>)
InvokeDynamic(Dynamic)
InvokeInterface(OrDynamic<MemberRef>, u8)
Jsr(Label)
Ret(u16)
Swap
IntIncrement(u16i16)
LineNumber(u16)
TableSwitch
Show fields

Fields of TableSwitch

default: Labellow: i32offsets: Vec<Label>
LookupSwitch
Show fields

Fields of LookupSwitch

default: Labeltable: IndexMap<i32, Label>
Label(Label)

Not real in bytecode, used as a marker of location.

Trait Implementations

impl Clone for Instruction[src]

impl Debug for Instruction[src]

impl PartialEq<Instruction> for Instruction[src]

impl StructuralPartialEq for Instruction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.