Skip to main content

CilInstr

Enum CilInstr 

Source
pub enum CilInstr {
Show 92 variants Nop, LdlocS(u16), StlocS(u16), LdlocaS(u16), LdargS(u16), StargS(u16), LdargaS(u16), LdcI4(i32), LdcI4S(i8), LdcI4Small(i32), LdcI8(i64), LdcR4(f32), LdcR8(f64), Ldnull, Ldstr(String), Ldsflda(CilFieldRef), Ldsfld(CilFieldRef), Stsfld(CilFieldRef), Add, AddOvf, Sub, SubOvf, Mul, MulOvf, Div, DivUn, Rem, RemUn, Neg, And, Or, Xor, Not, Shl, Shr, ShrUn, Ceq, Cgt, CgtUn, Clt, CltUn, Br(String), Brfalse(String), Brtrue(String), Beq(String), BneUn(String), Blt(String), Bgt(String), Ble(String), Bge(String), Switch(Vec<String>), Ret, Throw, Rethrow, Label(String), Call(CilMethodRef), Callvirt(CilMethodRef), TailCall(CilMethodRef), Calli(CilCallSig), Ldftn(CilMethodRef), Ldvirtftn(CilMethodRef), Newobj(CilMethodRef), Ldobj(CilType), Stobj(CilType), Ldfld(CilFieldRef), Stfld(CilFieldRef), Ldflda(CilFieldRef), Box_(CilType), Unbox(CilType), UnboxAny(CilType), Isinst(CilType), Castclass(CilType), Initobj(CilType), Sizeof(CilType), Ldtoken(CilType), Newarr(CilType), Ldlen, Ldelem(CilType), Stelem(CilType), Ldelema(CilType), Dup, Pop, ConvI4, ConvI8, ConvR4, ConvR8, ConvU4, ConvU8, LdindI4, StindI4, Localloc, Comment(String),
}
Expand description

CIL instruction set.

Covers the major opcodes from ECMA-335 Partition III.

Variants§

§

Nop

nop — no operation

§

LdlocS(u16)

ldloc.s <idx> — load local variable

§

StlocS(u16)

stloc.s <idx> — store local variable

§

LdlocaS(u16)

ldloca.s <idx> — load address of local

§

LdargS(u16)

ldarg.s <idx> — load argument

§

StargS(u16)

starg.s <idx> — store argument

§

LdargaS(u16)

ldarga.s <idx> — load argument address

§

LdcI4(i32)

ldc.i4 <val> — load int32 constant

§

LdcI4S(i8)

ldc.i4.s <val> — load int32 constant (short form, -128..127)

§

LdcI4Small(i32)

ldc.i4.N — load small int32 (N = 0..8)

§

LdcI8(i64)

ldc.i8 <val> — load int64 constant

§

LdcR4(f32)

ldc.r4 <val> — load float32 constant

§

LdcR8(f64)

ldc.r8 <val> — load float64 constant

§

Ldnull

ldnull — load null reference

§

Ldstr(String)

ldstr <s> — load string literal

§

Ldsflda(CilFieldRef)

ldsflda <field> — load address of static field

§

Ldsfld(CilFieldRef)

ldsfld <field> — load static field value

§

Stsfld(CilFieldRef)

stsfld <field> — store static field value

§

Add

add

§

AddOvf

add.ovf — checked addition

§

Sub

sub

§

SubOvf

sub.ovf — checked subtraction

§

Mul

mul

§

MulOvf

mul.ovf — checked multiplication

§

Div

div

§

DivUn

div.un — unsigned division

§

Rem

rem

§

RemUn

rem.un — unsigned remainder

§

Neg

neg — negate

§

And

and

§

Or

or

§

Xor

xor

§

Not

not

§

Shl

shl — shift left

§

Shr

shr — shift right (signed)

§

ShrUn

shr.un — shift right (unsigned)

§

Ceq

ceq — compare equal (push 1 or 0)

§

Cgt

cgt

§

CgtUn

cgt.un

§

Clt

clt

§

CltUn

clt.un

§

Br(String)

br <label>

§

Brfalse(String)

brfalse <label>

§

Brtrue(String)

brtrue <label>

§

Beq(String)

beq <label>

§

BneUn(String)

bne.un <label>

§

Blt(String)

blt <label>

§

Bgt(String)

bgt <label>

§

Ble(String)

ble <label>

§

Bge(String)

bge <label>

§

Switch(Vec<String>)

switch <labels...>

§

Ret

ret

§

Throw

throw

§

Rethrow

rethrow

§

Label(String)

A label definition point

§

Call(CilMethodRef)

call <method>

§

Callvirt(CilMethodRef)

callvirt <method>

§

TailCall(CilMethodRef)

tail. call <method>

§

Calli(CilCallSig)

calli <signature>

§

Ldftn(CilMethodRef)

ldftn <method>

§

Ldvirtftn(CilMethodRef)

ldvirtftn <method>

§

Newobj(CilMethodRef)

newobj <ctor>

§

Ldobj(CilType)

ldobj <type>

§

Stobj(CilType)

stobj <type>

§

Ldfld(CilFieldRef)

ldfld <field>

§

Stfld(CilFieldRef)

stfld <field>

§

Ldflda(CilFieldRef)

ldflda <field>

§

Box_(CilType)

box <type>

§

Unbox(CilType)

unbox <type>

§

UnboxAny(CilType)

unbox.any <type>

§

Isinst(CilType)

isinst <type>

§

Castclass(CilType)

castclass <type>

§

Initobj(CilType)

initobj <type>

§

Sizeof(CilType)

sizeof <type>

§

Ldtoken(CilType)

ldtoken <type>

§

Newarr(CilType)

newarr <type>

§

Ldlen

ldlen

§

Ldelem(CilType)

ldelem <type>

§

Stelem(CilType)

stelem <type>

§

Ldelema(CilType)

ldelema <type>

§

Dup

dup

§

Pop

pop

§

ConvI4

conv.i4

§

ConvI8

conv.i8

§

ConvR4

conv.r4

§

ConvR8

conv.r8

§

ConvU4

conv.u4

§

ConvU8

conv.u8

§

LdindI4

ldind.i4

§

StindI4

stind.i4

§

Localloc

localloc

§

Comment(String)

Comment (for IL dump readability)

Trait Implementations§

Source§

impl Clone for CilInstr

Source§

fn clone(&self) -> CilInstr

Returns a duplicate 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 CilInstr

Source§

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

Formats the value using the given formatter. Read more

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