Documentation
¶
Index ¶
- type DataSection
- type ElemSection
- type ExportSpec
- type Field
- type Func
- type FuncBody
- type FuncType
- type Global
- type ImportSpec
- type Ins_Block
- type Ins_Br
- type Ins_BrIf
- type Ins_BrTable
- type Ins_Call
- type Ins_CallIndirect
- type Ins_Drop
- type Ins_Else
- type Ins_End
- type Ins_F32Abs
- type Ins_F32Add
- type Ins_F32Ceil
- type Ins_F32Const
- type Ins_F32ConvertI32S
- type Ins_F32ConvertI32U
- type Ins_F32ConvertI64S
- type Ins_F32ConvertI64U
- type Ins_F32Copysign
- type Ins_F32DemoteF64
- type Ins_F32Div
- type Ins_F32Eq
- type Ins_F32Floor
- type Ins_F32Ge
- type Ins_F32Gt
- type Ins_F32Le
- type Ins_F32Load
- type Ins_F32Lt
- type Ins_F32Max
- type Ins_F32Min
- type Ins_F32Mul
- type Ins_F32Ne
- type Ins_F32Nearest
- type Ins_F32Neg
- type Ins_F32ReintepretI32
- type Ins_F32Sqrt
- type Ins_F32Store
- type Ins_F32Sub
- type Ins_F32Trunc
- type Ins_F64Abs
- type Ins_F64Add
- type Ins_F64Ceil
- type Ins_F64Const
- type Ins_F64ConvertI32S
- type Ins_F64ConvertI32U
- type Ins_F64ConvertI64S
- type Ins_F64ConvertI64U
- type Ins_F64Copysign
- type Ins_F64Div
- type Ins_F64Eq
- type Ins_F64Floor
- type Ins_F64Ge
- type Ins_F64Gt
- type Ins_F64Le
- type Ins_F64Load
- type Ins_F64Lt
- type Ins_F64Max
- type Ins_F64Min
- type Ins_F64Mul
- type Ins_F64Ne
- type Ins_F64Nearest
- type Ins_F64Neg
- type Ins_F64PromoteF32
- type Ins_F64ReintepretI64
- type Ins_F64Sqrt
- type Ins_F64Store
- type Ins_F64Sub
- type Ins_F64Trunc
- type Ins_GlobalGet
- type Ins_GlobalSet
- type Ins_I32Add
- type Ins_I32And
- type Ins_I32Clz
- type Ins_I32Const
- type Ins_I32Ctz
- type Ins_I32DivS
- type Ins_I32DivU
- type Ins_I32Eq
- type Ins_I32Eqz
- type Ins_I32GeS
- type Ins_I32GeU
- type Ins_I32GtS
- type Ins_I32GtU
- type Ins_I32LeS
- type Ins_I32LeU
- type Ins_I32Load
- type Ins_I32Load16S
- type Ins_I32Load16U
- type Ins_I32Load8S
- type Ins_I32Load8U
- type Ins_I32LtS
- type Ins_I32LtU
- type Ins_I32Mul
- type Ins_I32Ne
- type Ins_I32Or
- type Ins_I32Popcnt
- type Ins_I32ReintepretF32
- type Ins_I32RemS
- type Ins_I32RemU
- type Ins_I32Rotl
- type Ins_I32Rotr
- type Ins_I32Shl
- type Ins_I32ShrS
- type Ins_I32ShrU
- type Ins_I32Store
- type Ins_I32Store16
- type Ins_I32Store8
- type Ins_I32Sub
- type Ins_I32TruncF32S
- type Ins_I32TruncF32U
- type Ins_I32TruncF64S
- type Ins_I32TruncF64U
- type Ins_I32WrapI64
- type Ins_I32Xor
- type Ins_I64Add
- type Ins_I64And
- type Ins_I64Clz
- type Ins_I64Const
- type Ins_I64Ctz
- type Ins_I64DivS
- type Ins_I64DivU
- type Ins_I64Eq
- type Ins_I64Eqz
- type Ins_I64ExtendI32S
- type Ins_I64ExtendI32U
- type Ins_I64GeS
- type Ins_I64GeU
- type Ins_I64GtS
- type Ins_I64GtU
- type Ins_I64LeS
- type Ins_I64LeU
- type Ins_I64Load
- type Ins_I64Load16S
- type Ins_I64Load16U
- type Ins_I64Load32S
- type Ins_I64Load32U
- type Ins_I64Load8S
- type Ins_I64Load8U
- type Ins_I64LtS
- type Ins_I64LtU
- type Ins_I64Mul
- type Ins_I64Ne
- type Ins_I64Or
- type Ins_I64Popcnt
- type Ins_I64ReintepretF64
- type Ins_I64RemS
- type Ins_I64RemU
- type Ins_I64Rotl
- type Ins_I64Rotr
- type Ins_I64Shl
- type Ins_I64ShrS
- type Ins_I64ShrU
- type Ins_I64Store
- type Ins_I64Store16
- type Ins_I64Store32
- type Ins_I64Store8
- type Ins_I64Sub
- type Ins_I64TruncF32S
- type Ins_I64TruncF32U
- type Ins_I64TruncF64S
- type Ins_I64TruncF64U
- type Ins_I64Xor
- type Ins_If
- type Ins_LocalGet
- type Ins_LocalSet
- type Ins_LocalTee
- type Ins_Loop
- type Ins_MemoryCopy
- type Ins_MemoryFill
- type Ins_MemoryGrow
- type Ins_MemoryInit
- type Ins_MemorySize
- type Ins_Nop
- type Ins_Return
- type Ins_Select
- type Ins_TableGet
- type Ins_TableSet
- type Ins_Unreachable
- type Instruction
- type Memory
- type Module
- type OpToken
- type Table
- type TypeSection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSection ¶
初始化数据
type ElemSection ¶
type ElemSection struct { Name string // 名字 Offset uint32 // 偏移量(从 0 开始) Values []string // 初始化值, 引用的是其他 func 的名字 }
表格元素数据
type ExportSpec ¶
type ExportSpec struct { Name string // 导出名字 Kind token.Token // 导出类型 FuncIdx string // 导出函数ID TableIdx string // 导出表格ID MemoryIdx string // 导出内存ID GlobalIdx string // 导出全局变量ID }
导出对象
type Func ¶
type Func struct { Name string // 函数名 ExportName string // 导出名字 Type *FuncType // 函数类型 Body *FuncBody // 函数体 }
函数定义
type Global ¶
type Global struct { Name string // 全局变量名 ExportName string // 导出名字 Mutable bool // 是否可写 Type token.Token // 类型信息 I32Value int32 // 初始值(导入变量忽略) I64Value int64 // 初始值(导入变量忽略) F32Value float32 // 初始值(导入变量忽略) F64Value float64 // 初始值(导入变量忽略) }
全局变量
type ImportSpec ¶
type ImportSpec struct { ObjModule string // 模块路径 ObjName string // 实体名字 ObjKind token.Token // 导入类别: MEMORY, TABLE, FUNC, GLOBAL Memory *Memory // 导入内存 TableName string // 导入Table编号 GlobalName string // 导入全局变量名字 GlobalType token.Token // 导入全局变量类型: I32, I64, F32, F64 FuncName string // 导入后函数名字 FuncType *FuncType // 导入函数类型 }
导入对象(仅支持函数)
type Ins_Block ¶
type Ins_Block struct { OpToken Label string Results []token.Token // 返回值类型: I32, I64, F32, F64 List []Instruction }
type Ins_BrTable ¶
type Ins_CallIndirect ¶
type Ins_F32Abs ¶
type Ins_F32Abs struct{ OpToken }
type Ins_F32Add ¶
type Ins_F32Add struct{ OpToken }
type Ins_F32Ceil ¶
type Ins_F32Ceil struct{ OpToken }
type Ins_F32Const ¶
type Ins_F32ConvertI32S ¶
type Ins_F32ConvertI32S struct{ OpToken }
type Ins_F32ConvertI32U ¶
type Ins_F32ConvertI32U struct{ OpToken }
type Ins_F32ConvertI64S ¶
type Ins_F32ConvertI64S struct{ OpToken }
type Ins_F32ConvertI64U ¶
type Ins_F32ConvertI64U struct{ OpToken }
type Ins_F32Copysign ¶
type Ins_F32Copysign struct{ OpToken }
type Ins_F32DemoteF64 ¶
type Ins_F32DemoteF64 struct{ OpToken }
type Ins_F32Div ¶
type Ins_F32Div struct{ OpToken }
type Ins_F32Floor ¶
type Ins_F32Floor struct{ OpToken }
type Ins_F32Load ¶
type Ins_F32Max ¶
type Ins_F32Max struct{ OpToken }
type Ins_F32Min ¶
type Ins_F32Min struct{ OpToken }
type Ins_F32Mul ¶
type Ins_F32Mul struct{ OpToken }
type Ins_F32Nearest ¶
type Ins_F32Nearest struct{ OpToken }
type Ins_F32Neg ¶
type Ins_F32Neg struct{ OpToken }
type Ins_F32ReintepretI32 ¶
type Ins_F32ReintepretI32 struct{ OpToken }
type Ins_F32Sqrt ¶
type Ins_F32Sqrt struct{ OpToken }
type Ins_F32Store ¶
type Ins_F32Sub ¶
type Ins_F32Sub struct{ OpToken }
type Ins_F32Trunc ¶
type Ins_F32Trunc struct{ OpToken }
type Ins_F64Abs ¶
type Ins_F64Abs struct{ OpToken }
type Ins_F64Add ¶
type Ins_F64Add struct{ OpToken }
type Ins_F64Ceil ¶
type Ins_F64Ceil struct{ OpToken }
type Ins_F64Const ¶
type Ins_F64ConvertI32S ¶
type Ins_F64ConvertI32S struct{ OpToken }
type Ins_F64ConvertI32U ¶
type Ins_F64ConvertI32U struct{ OpToken }
type Ins_F64ConvertI64S ¶
type Ins_F64ConvertI64S struct{ OpToken }
type Ins_F64ConvertI64U ¶
type Ins_F64ConvertI64U struct{ OpToken }
type Ins_F64Copysign ¶
type Ins_F64Copysign struct{ OpToken }
type Ins_F64Div ¶
type Ins_F64Div struct{ OpToken }
type Ins_F64Floor ¶
type Ins_F64Floor struct{ OpToken }
type Ins_F64Load ¶
type Ins_F64Max ¶
type Ins_F64Max struct{ OpToken }
type Ins_F64Min ¶
type Ins_F64Min struct{ OpToken }
type Ins_F64Mul ¶
type Ins_F64Mul struct{ OpToken }
type Ins_F64Nearest ¶
type Ins_F64Nearest struct{ OpToken }
type Ins_F64Neg ¶
type Ins_F64Neg struct{ OpToken }
type Ins_F64PromoteF32 ¶
type Ins_F64PromoteF32 struct{ OpToken }
type Ins_F64ReintepretI64 ¶
type Ins_F64ReintepretI64 struct{ OpToken }
type Ins_F64Sqrt ¶
type Ins_F64Sqrt struct{ OpToken }
type Ins_F64Store ¶
type Ins_F64Sub ¶
type Ins_F64Sub struct{ OpToken }
type Ins_F64Trunc ¶
type Ins_F64Trunc struct{ OpToken }
type Ins_GlobalGet ¶
type Ins_GlobalSet ¶
type Ins_I32Add ¶
type Ins_I32Add struct{ OpToken }
type Ins_I32And ¶
type Ins_I32And struct{ OpToken }
type Ins_I32Clz ¶
type Ins_I32Clz struct{ OpToken }
type Ins_I32Const ¶
type Ins_I32Ctz ¶
type Ins_I32Ctz struct{ OpToken }
type Ins_I32DivS ¶
type Ins_I32DivS struct{ OpToken }
type Ins_I32DivU ¶
type Ins_I32DivU struct{ OpToken }
type Ins_I32Eqz ¶
type Ins_I32Eqz struct{ OpToken }
type Ins_I32GeS ¶
type Ins_I32GeS struct{ OpToken }
type Ins_I32GeU ¶
type Ins_I32GeU struct{ OpToken }
type Ins_I32GtS ¶
type Ins_I32GtS struct{ OpToken }
type Ins_I32GtU ¶
type Ins_I32GtU struct{ OpToken }
type Ins_I32LeS ¶
type Ins_I32LeS struct{ OpToken }
type Ins_I32LeU ¶
type Ins_I32LeU struct{ OpToken }
type Ins_I32Load ¶
type Ins_I32Load16S ¶
type Ins_I32Load16U ¶
type Ins_I32Load8S ¶
type Ins_I32Load8U ¶
type Ins_I32LtS ¶
type Ins_I32LtS struct{ OpToken }
type Ins_I32LtU ¶
type Ins_I32LtU struct{ OpToken }
type Ins_I32Mul ¶
type Ins_I32Mul struct{ OpToken }
type Ins_I32Popcnt ¶
type Ins_I32Popcnt struct{ OpToken }
type Ins_I32ReintepretF32 ¶
type Ins_I32ReintepretF32 struct{ OpToken }
type Ins_I32RemS ¶
type Ins_I32RemS struct{ OpToken }
type Ins_I32RemU ¶
type Ins_I32RemU struct{ OpToken }
type Ins_I32Rotl ¶
type Ins_I32Rotl struct{ OpToken }
type Ins_I32Rotr ¶
type Ins_I32Rotr struct{ OpToken }
type Ins_I32Shl ¶
type Ins_I32Shl struct{ OpToken }
type Ins_I32ShrS ¶
type Ins_I32ShrS struct{ OpToken }
type Ins_I32ShrU ¶
type Ins_I32ShrU struct{ OpToken }
type Ins_I32Store ¶
type Ins_I32Store16 ¶
type Ins_I32Store8 ¶
type Ins_I32Sub ¶
type Ins_I32Sub struct{ OpToken }
type Ins_I32TruncF32S ¶
type Ins_I32TruncF32S struct{ OpToken }
type Ins_I32TruncF32U ¶
type Ins_I32TruncF32U struct{ OpToken }
type Ins_I32TruncF64S ¶
type Ins_I32TruncF64S struct{ OpToken }
type Ins_I32TruncF64U ¶
type Ins_I32TruncF64U struct{ OpToken }
type Ins_I32WrapI64 ¶
type Ins_I32WrapI64 struct{ OpToken }
type Ins_I32Xor ¶
type Ins_I32Xor struct{ OpToken }
type Ins_I64Add ¶
type Ins_I64Add struct{ OpToken }
type Ins_I64And ¶
type Ins_I64And struct{ OpToken }
type Ins_I64Clz ¶
type Ins_I64Clz struct{ OpToken }
type Ins_I64Const ¶
type Ins_I64Ctz ¶
type Ins_I64Ctz struct{ OpToken }
type Ins_I64DivS ¶
type Ins_I64DivS struct{ OpToken }
type Ins_I64DivU ¶
type Ins_I64DivU struct{ OpToken }
type Ins_I64Eqz ¶
type Ins_I64Eqz struct{ OpToken }
type Ins_I64ExtendI32S ¶
type Ins_I64ExtendI32S struct{ OpToken }
type Ins_I64ExtendI32U ¶
type Ins_I64ExtendI32U struct{ OpToken }
type Ins_I64GeS ¶
type Ins_I64GeS struct{ OpToken }
type Ins_I64GeU ¶
type Ins_I64GeU struct{ OpToken }
type Ins_I64GtS ¶
type Ins_I64GtS struct{ OpToken }
type Ins_I64GtU ¶
type Ins_I64GtU struct{ OpToken }
type Ins_I64LeS ¶
type Ins_I64LeS struct{ OpToken }
type Ins_I64LeU ¶
type Ins_I64LeU struct{ OpToken }
type Ins_I64Load ¶
type Ins_I64Load16S ¶
type Ins_I64Load16U ¶
type Ins_I64Load32S ¶
type Ins_I64Load32U ¶
type Ins_I64Load8S ¶
type Ins_I64Load8U ¶
type Ins_I64LtS ¶
type Ins_I64LtS struct{ OpToken }
type Ins_I64LtU ¶
type Ins_I64LtU struct{ OpToken }
type Ins_I64Mul ¶
type Ins_I64Mul struct{ OpToken }
type Ins_I64Popcnt ¶
type Ins_I64Popcnt struct{ OpToken }
type Ins_I64ReintepretF64 ¶
type Ins_I64ReintepretF64 struct{ OpToken }
type Ins_I64RemS ¶
type Ins_I64RemS struct{ OpToken }
type Ins_I64RemU ¶
type Ins_I64RemU struct{ OpToken }
type Ins_I64Rotl ¶
type Ins_I64Rotl struct{ OpToken }
type Ins_I64Rotr ¶
type Ins_I64Rotr struct{ OpToken }
type Ins_I64Shl ¶
type Ins_I64Shl struct{ OpToken }
type Ins_I64ShrS ¶
type Ins_I64ShrS struct{ OpToken }
type Ins_I64ShrU ¶
type Ins_I64ShrU struct{ OpToken }
type Ins_I64Store ¶
type Ins_I64Store16 ¶
type Ins_I64Store32 ¶
type Ins_I64Store8 ¶
type Ins_I64Sub ¶
type Ins_I64Sub struct{ OpToken }
type Ins_I64TruncF32S ¶
type Ins_I64TruncF32S struct{ OpToken }
type Ins_I64TruncF32U ¶
type Ins_I64TruncF32U struct{ OpToken }
type Ins_I64TruncF64S ¶
type Ins_I64TruncF64S struct{ OpToken }
type Ins_I64TruncF64U ¶
type Ins_I64TruncF64U struct{ OpToken }
type Ins_I64Xor ¶
type Ins_I64Xor struct{ OpToken }
type Ins_If ¶
type Ins_If struct { OpToken Label string Results []token.Token // 返回值类型: I32, I64, F32, F64 Body []Instruction Else []Instruction }
type Ins_LocalGet ¶
type Ins_LocalSet ¶
type Ins_LocalTee ¶
type Ins_Loop ¶
type Ins_Loop struct { OpToken Label string Results []token.Token // 返回值类型: I32, I64, F32, F64 List []Instruction }
type Ins_MemoryCopy ¶ added in v0.21.0
type Ins_MemoryCopy struct{ OpToken }
type Ins_MemoryFill ¶ added in v0.21.0
type Ins_MemoryFill struct{ OpToken }
type Ins_MemoryGrow ¶
type Ins_MemoryGrow struct{ OpToken }
type Ins_MemoryInit ¶ added in v0.21.0
type Ins_MemorySize ¶
type Ins_MemorySize struct{ OpToken }
type Ins_Return ¶
type Ins_Return struct{ OpToken }
type Ins_Select ¶
type Ins_TableGet ¶
type Ins_TableSet ¶
type Ins_Unreachable ¶
type Ins_Unreachable struct{ OpToken }
type Instruction ¶
指令对应接口
type Module ¶
type Module struct { Name string // 模块的名字(可空) Types []*TypeSection // 类型定义 Imports []*ImportSpec // 导入对象 Exports []*ExportSpec // 导出对象 Memory *Memory // 内存对象, 包含 Data 信息(可空) Data []*DataSection // 初始化数据, 可能重叠 Table *Table // 表格对象, 包含 Elem 信息(可空) Elem []*ElemSection // 初始化数据 Globals []*Global // 全局对象 Funcs []*Func // 函数对象 Start string // start 函数 }
Module 表示一个 WASM 模块。
Click to show internal directories.
Click to hide internal directories.