Skip to main content

NyarInstruction

Enum NyarInstruction 

Source
pub enum NyarInstruction {
Show 207 variants Nop, Push(u16), PushNone, Pop, Dup(u8), Swap(u8), LoadLocal(u8), StoreLocal(u8), LoadGlobal(u16), StoreGlobal(u16), LoadUpvalue(u8), StoreUpvalue(u8), CloseUpvalues, Jump(i16), JumpIfFalse(i16), JumpIfTrue(i16), JumpIfNull(i16), Return, MakeClosure(u16, Vec<NyarUpvalueRef>), TailCall(u16, u8), TailCallClosure(u8), Call(u16, u8), CallVirtual(u16, u8), CallDynamic(u16, u8), CallClosure(u8), InvokeMethod(u16, u8), CallSymbol(u16, u8), GetField(u16), SetField(u16), NewObject(u16), NewArray(u16), GetElement, SetElement, NewDynObject, RemoveKey, Initiate(u8), Finalize, NewList(u16), PushElementLeft, PopElementLeft, PushElementRight, PopElementRight, MakeTuple(u8), HasKey, MatchVariant(u16), SizeOf, TypeOf, InstanceOf(u16), CheckCast(u16), Cast(u16), Perform(u16, u8), WithHandler(u16), ResumeWith, CaptureCont, Await, BlockOn, MatchEffect(u16), GetWitnessTable(u16, u16), WitnessMethod(u16), OpenExistential, CloseExistential, Quote(u32), Splice, Eval(u8), ExpandMacro(u16, u8), FFICall(u16, u8), Halt, I32Const(i32), I32Add, I32Sub, I32Mul, I32DivS, I32DivU, I32RemS, I32RemU, I32And, I32Or, I32Xor, I32Shl, I32ShrS, I32ShrU, I32Not, I32Neg, I32Eq, I32Ne, I32LtS, I32LtU, I32LeS, I32LeU, I32GtS, I32GtU, I32GeS, I32GeU, I32ToF32S, I32ToF32U, I32ToF64S, I32ToF64U, I32AddSatS, I32AddSatU, I32SubSatS, I32SubSatU, I32Extend64S, I32Extend64U, I32Trunc64SLow, I32Trunc64S, I32Trunc64U, I64Const(i64), I64Add, I64Sub, I64Mul, I64DivS, I64DivU, I64RemS, I64RemU, I64And, I64Or, I64Xor, I64Shl, I64ShrS, I64ShrU, I64Not, I64Neg, I64Eq, I64Ne, I64LtS, I64LtU, I64LeS, I64LeU, I64GtS, I64GtU, I64GeS, I64GeU, I64ToF32S, I64ToF32U, I64ToF64S, I64ToF64U, I64AddSatS, I64AddSatU, F32Const(f32), F32Add, F32Sub, F32Mul, F32Div, F32Neg, F32Eq, F32Ne, F32Lt, F32Le, F32Gt, F32Ge, F32ToI32S, F32ToI32U, F32ToI64S, F32ToI64U, F32ToF64, F64Const(f64), F64Add, F64Sub, F64Mul, F64Div, F64Neg, F64Eq, F64Ne, F64Lt, F64Le, F64Gt, F64Ge, F64ToI32S, F64ToI32U, F64ToI64S, F64ToI64U, F64ToF32, BigIntConst { sign: u8, bytes: Vec<u8>, }, BigIntAdd, BigIntSub, BigIntMul, BigIntDiv, BigIntMod, BigIntNeg, BigIntEq, BigIntNe, BigIntLt, BigIntLe, BigIntGt, BigIntGe, BigIntToI64, BigIntFromI64, BigIntToString, StringConst(String), StringConcat, StringLenBytes, StringLenChars, StringEq, StringNe, StringLt, StringLe, StringGt, StringGe, StringSubstr, NewChannel(u16), SendChannel, RecvChannel, SelectChannel(u8), NewQuery(u16), QueryExec, NewClock, ClockWait,
}
Expand description

Nyar 指令枚举

Variants§

§

Nop

无操作

§

Push(u16)

入栈常量,参数为常量池索引

§

PushNone

入栈空值

§

Pop

栈顶出栈

§

Dup(u8)

复制栈顶元素,参数为相对于栈顶的深度

§

Swap(u8)

交换栈顶两个元素,参数为相对于栈顶的深度

§

LoadLocal(u8)

加载局部变量,参数为局部变量索引

§

StoreLocal(u8)

存储局部变量,参数为局部变量索引

§

LoadGlobal(u16)

加载全局变量,参数为全局变量名索引

§

StoreGlobal(u16)

存储全局变量,参数为全局变量名索引

§

LoadUpvalue(u8)

加载上值,参数为上值索引

§

StoreUpvalue(u8)

存储上值,参数为上值索引

§

CloseUpvalues

关闭所有开启的上值

§

Jump(i16)

无条件跳转,参数为相对偏移量

§

JumpIfFalse(i16)

如果栈顶为假则跳转

§

JumpIfTrue(i16)

如果栈顶为真则跳转

§

JumpIfNull(i16)

如果栈顶为空则跳转

§

Return

函数返回

§

MakeClosure(u16, Vec<NyarUpvalueRef>)

创建闭包,参数为函数体索引和上值引用列表

§

TailCall(u16, u8)

尾递归调用,参数为函数名索引和参数数量

§

TailCallClosure(u8)

闭包尾递归调用,参数为参数数量

§

Call(u16, u8)

函数调用,参数为函数名索引和参数数量

§

CallVirtual(u16, u8)

虚函数调用,参数为函数名索引和参数数量

§

CallDynamic(u16, u8)

动态调用,参数为函数名索引和参数数量

§

CallClosure(u8)

闭包调用,参数为参数数量

§

InvokeMethod(u16, u8)

方法调用,参数为函数名索引和参数数量

§

CallSymbol(u16, u8)

符号调用,参数为符号名索引和参数数量

§

GetField(u16)

获取对象字段,参数为字段名索引

§

SetField(u16)

设置对象字段,参数为字段名索引

§

NewObject(u16)

创建新对象,参数为类型名索引

§

NewArray(u16)

创建新数组,参数为长度

§

GetElement

获取容器元素

§

SetElement

设置容器元素

§

NewDynObject

创建动态对象

§

RemoveKey

移除容器中的键

§

Initiate(u8)

初始化对象

§

Finalize

终止对象生命周期

§

NewList(u16)

创建新列表

§

PushElementLeft

元素入队左侧

§

PopElementLeft

元素出队左侧

§

PushElementRight

元素入队右侧

§

PopElementRight

元素出队右侧

§

MakeTuple(u8)

创建元组,参数为元素数量

§

HasKey

Check if key exists

§

MatchVariant(u16)

Match enum variant

§

SizeOf

Get container size

§

TypeOf

Get element type

§

InstanceOf(u16)

Check if value is instance of type

§

CheckCast(u16)

Check type cast validity

§

Cast(u16)

Perform type cast

§

Perform(u16, u8)

Perform side effect

§

WithHandler(u16)

Register side effect handler

§

ResumeWith

Resume continuation

§

CaptureCont

Capture continuation

§

Await

Await async operation

§

BlockOn

Blocking await async operation

§

MatchEffect(u16)

Match side effect result

§

GetWitnessTable(u16, u16)

Get vtable index

§

WitnessMethod(u16)

Call vtable method

§

OpenExistential

Open existential type

§

CloseExistential

Close existential type

§

Quote(u32)

Reference LIR code block

§

Splice

Splice LIR expression

§

Eval(u8)

Evaluate LIR expression

§

ExpandMacro(u16, u8)

Expand macro

§

FFICall(u16, u8)

FFI call

§

Halt

Halt execution

§

I32Const(i32)

I32 constant

§

I32Add

I32 addition

§

I32Sub

I32 subtraction

§

I32Mul

I32 multiplication

§

I32DivS

I32 signed division

§

I32DivU

I32 unsigned division

§

I32RemS

I32 signed remainder

§

I32RemU

I32 unsigned remainder

§

I32And

I32 bitwise AND

§

I32Or

I32 bitwise OR

§

I32Xor

I32 bitwise XOR

§

I32Shl

I32 left shift

§

I32ShrS

I32 signed right shift

§

I32ShrU

I32 unsigned right shift

§

I32Not

I32 bitwise NOT

§

I32Neg

I32 negate

§

I32Eq

I32 equal

§

I32Ne

I32 not equal

§

I32LtS

I32 signed less than

§

I32LtU

I32 unsigned less than

§

I32LeS

I32 signed less than or equal

§

I32LeU

I32 unsigned less than or equal

§

I32GtS

I32 signed greater than

§

I32GtU

I32 unsigned greater than

§

I32GeS

I32 signed greater than or equal

§

I32GeU

I32 unsigned greater than or equal

§

I32ToF32S

I32 to F32 (signed)

§

I32ToF32U

I32 to F32 (unsigned)

§

I32ToF64S

I32 to F64 (signed)

§

I32ToF64U

I32 to F64 (unsigned)

§

I32AddSatS

I32 addition (saturated signed)

§

I32AddSatU

I32 addition (saturated unsigned)

§

I32SubSatS

I32 subtraction (saturated signed)

§

I32SubSatU

I32 subtraction (saturated unsigned)

§

I32Extend64S

I32 sign extend to I64

§

I32Extend64U

I32 zero extend to I64

§

I32Trunc64SLow

I32 truncate I64 (low)

§

I32Trunc64S

I32 truncate I64 (signed)

§

I32Trunc64U

I32 truncate I64 (unsigned)

§

I64Const(i64)

I64 常量

§

I64Add

I64 加法

§

I64Sub

I64 减法

§

I64Mul

I64 乘法

§

I64DivS

I64 有符号除法

§

I64DivU

I64 无符号除法

§

I64RemS

I64 有符号取模

§

I64RemU

I64 无符号取模

§

I64And

I64 按位与

§

I64Or

I64 按位或

§

I64Xor

I64 按位异或

§

I64Shl

I64 左移

§

I64ShrS

I64 有符号右移

§

I64ShrU

I64 无符号右移

§

I64Not

I64 按位取反

§

I64Neg

I64 取负

§

I64Eq

I64 等于

§

I64Ne

I64 不等于

§

I64LtS

I64 有符号小于

§

I64LtU

I64 无符号小于

§

I64LeS

I64 有符号小于等于

§

I64LeU

I64 无符号小于等于

§

I64GtS

I64 有符号大于

§

I64GtU

I64 无符号大于

§

I64GeS

I64 有符号大于等于

§

I64GeU

I64 无符号大于等于

§

I64ToF32S

I64 转 F32 (有符号)

§

I64ToF32U

I64 转 F32 (无符号)

§

I64ToF64S

I64 转 F64 (有符号)

§

I64ToF64U

I64 转 F64 (无符号)

§

I64AddSatS

I64 加法 (饱和有符号)

§

I64AddSatU

I64 加法 (饱和无符号)

§

F32Const(f32)

F32 常量

§

F32Add

F32 加法

§

F32Sub

F32 减法

§

F32Mul

F32 乘法

§

F32Div

F32 除法

§

F32Neg

F32 取负

§

F32Eq

F32 等于

§

F32Ne

F32 不等于

§

F32Lt

F32 小于

§

F32Le

F32 小于等于

§

F32Gt

F32 大于

§

F32Ge

F32 大于等于

§

F32ToI32S

F32 转 I32 (有符号)

§

F32ToI32U

F32 转 I32 (无符号)

§

F32ToI64S

F32 转 I64 (有符号)

§

F32ToI64U

F32 转 I64 (无符号)

§

F32ToF64

F32 转 F64

§

F64Const(f64)

F64 常量

§

F64Add

F64 加法

§

F64Sub

F64 减法

§

F64Mul

F64 乘法

§

F64Div

F64 除法

§

F64Neg

F64 取负

§

F64Eq

F64 等于

§

F64Ne

F64 不等于

§

F64Lt

F64 小于

§

F64Le

F64 小于等于

§

F64Gt

F64 大于

§

F64Ge

F64 大于等于

§

F64ToI32S

F64 转 I32 (有符号)

§

F64ToI32U

F64 转 I32 (无符号)

§

F64ToI64S

F64 转 I64 (有符号)

§

F64ToI64U

F64 转 I64 (无符号)

§

F64ToF32

F64 转 F32

§

BigIntConst

大整数常量

Fields

§sign: u8

符号 (0: 正, 1: 负)

§bytes: Vec<u8>

原始字节数据

§

BigIntAdd

大整数加法

§

BigIntSub

大整数减法

§

BigIntMul

大整数乘法

§

BigIntDiv

大整数除法

§

BigIntMod

大整数取模

§

BigIntNeg

大整数取负

§

BigIntEq

大整数等于

§

BigIntNe

大整数不等于

§

BigIntLt

大整数小于

§

BigIntLe

大整数小于等于

§

BigIntGt

大整数大于

§

BigIntGe

大整数大于等于

§

BigIntToI64

大整数转 I64

§

BigIntFromI64

I64 转 大整数

§

BigIntToString

大整数转字符串

§

StringConst(String)

字符串常量

§

StringConcat

字符串拼接

§

StringLenBytes

字符串长度 (字节)

§

StringLenChars

字符串长度 (字符)

§

StringEq

字符串等于

§

StringNe

字符串不等于

§

StringLt

字符串小于

§

StringLe

字符串小于等于

§

StringGt

字符串大于

§

StringGe

字符串大于等于

§

StringSubstr

字符串截取

§

NewChannel(u16)

新建通道

§

SendChannel

发送通道消息

§

RecvChannel

接收通道消息

§

SelectChannel(u8)

选择通道

§

NewQuery(u16)

新建查询

§

QueryExec

执行查询

§

NewClock

新建时钟

§

ClockWait

时钟等待

Trait Implementations§

Source§

impl Clone for NyarInstruction

Source§

fn clone(&self) -> NyarInstruction

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 NyarInstruction

Source§

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

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

impl<'de> Deserialize<'de> for NyarInstruction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl NyarCodec for NyarInstruction

Source§

fn encode( &self, writer: &mut BinaryWriter<Vec<u8>, Leb128>, ) -> Result<(), GaiaError>

Encode to binary stream
Source§

fn decode( reader: &mut BinaryReader<Cursor<&[u8]>, Leb128>, ) -> Result<Self, GaiaError>

Decode from binary stream
Source§

impl PartialEq for NyarInstruction

Source§

fn eq(&self, other: &NyarInstruction) -> 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 Serialize for NyarInstruction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for NyarInstruction

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,