wat

package
v0.8.0-test2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

WAT 文本格式的模块。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBlank

func NewBlank() *blank

func NewComment

func NewComment(name string) *comment

func NewInstAdd

func NewInstAdd(t ValueType) *instAdd

func NewInstAnd added in v0.8.0

func NewInstAnd(t ValueType) *instAnd

func NewInstBlock

func NewInstBlock(name string) *instBlock

func NewInstBr

func NewInstBr(name string) *instBr

func NewInstBrTable

func NewInstBrTable(t []int) *instBrTable

func NewInstCall

func NewInstCall(name string) *instCall

func NewInstCallIndirect

func NewInstCallIndirect(func_type string) *instCallIndirect

func NewInstConst

func NewInstConst(typ ValueType, literal string) *instConst

func NewInstConvert_f32_convert_i32_s added in v0.8.0

func NewInstConvert_f32_convert_i32_s() *instConvert_f32_convert_i32_s

func NewInstConvert_f32_convert_i32_u added in v0.8.0

func NewInstConvert_f32_convert_i32_u() *instConvert_f32_convert_i32_u

func NewInstConvert_f32_convert_i64_s added in v0.8.0

func NewInstConvert_f32_convert_i64_s() *instConvert_f32_convert_i64_s

func NewInstConvert_f32_convert_i64_u added in v0.8.0

func NewInstConvert_f32_convert_i64_u() *instConvert_f32_convert_i64_u

func NewInstConvert_f32_demote_f64 added in v0.8.0

func NewInstConvert_f32_demote_f64() *instConvert_f32_demote_f64

func NewInstConvert_f64_convert_i32_s added in v0.8.0

func NewInstConvert_f64_convert_i32_s() *instConvert_f64_convert_i32_s

func NewInstConvert_f64_convert_i32_u added in v0.8.0

func NewInstConvert_f64_convert_i32_u() *instConvert_f64_convert_i32_u

func NewInstConvert_f64_convert_i64_s added in v0.8.0

func NewInstConvert_f64_convert_i64_s() *instConvert_f64_convert_i64_s

func NewInstConvert_f64_convert_i64_u added in v0.8.0

func NewInstConvert_f64_convert_i64_u() *instConvert_f64_convert_i64_u

func NewInstConvert_f64_promote_f32 added in v0.8.0

func NewInstConvert_f64_promote_f32() *instConvert_f64_promote_f32

func NewInstConvert_i32_trunc_f32_s added in v0.8.0

func NewInstConvert_i32_trunc_f32_s() *instConvert_i32_trunc_f32_s

func NewInstConvert_i32_trunc_f64_s added in v0.8.0

func NewInstConvert_i32_trunc_f64_s() *instConvert_i32_trunc_f64_s

func NewInstConvert_i32_wrap_i64 added in v0.8.0

func NewInstConvert_i32_wrap_i64() *instConvert_i32_wrap_i64

func NewInstConvert_i64_extend_i32_s added in v0.8.0

func NewInstConvert_i64_extend_i32_s() *instConvert_i64_extend_i32_s

func NewInstConvert_i64_extend_i32_u added in v0.8.0

func NewInstConvert_i64_extend_i32_u() *instConvert_i64_extend_i32_u

func NewInstConvert_i64_trunc_f32_s added in v0.8.0

func NewInstConvert_i64_trunc_f32_s() *instConvert_i64_trunc_f32_s

func NewInstConvert_i64_trunc_f64_s added in v0.8.0

func NewInstConvert_i64_trunc_f64_s() *instConvert_i64_trunc_f64_s

func NewInstDiv

func NewInstDiv(t ValueType) *instDiv

func NewInstDrop

func NewInstDrop() *instDrop

func NewInstEq

func NewInstEq(t ValueType) *instEq

func NewInstEqz

func NewInstEqz(t ValueType) *instEqz

func NewInstGe

func NewInstGe(t ValueType) *instGe

func NewInstGetGlobal

func NewInstGetGlobal(name string) *instGetGlobal

func NewInstGetLocal

func NewInstGetLocal(name string) *instGetLocal

func NewInstGt

func NewInstGt(t ValueType) *instGt

func NewInstIf

func NewInstIf(instsTrue, instsFalse []Inst, ret []ValueType) *instIf

func NewInstLe

func NewInstLe(t ValueType) *instLe

func NewInstLoad

func NewInstLoad(typ ValueType, offset int, align int) *instLoad

func NewInstLoad16s

func NewInstLoad16s(offset int, align int) *instLoad16s

func NewInstLoad16u

func NewInstLoad16u(offset int, align int) *instLoad16u

func NewInstLoad8s

func NewInstLoad8s(offset int, align int) *instLoad8s

func NewInstLoad8u

func NewInstLoad8u(offset int, align int) *instLoad8u

func NewInstLoop

func NewInstLoop(name string) *instLoop

func NewInstLt

func NewInstLt(t ValueType) *instLt

func NewInstMul

func NewInstMul(t ValueType) *instMul

func NewInstNe

func NewInstNe(t ValueType) *instNe

func NewInstOr added in v0.8.0

func NewInstOr(t ValueType) *instOr

func NewInstRem

func NewInstRem(t ValueType) *instRem

func NewInstReturn

func NewInstReturn() *instReturn

func NewInstSetGlobal

func NewInstSetGlobal(name string) *instSetGlobal

func NewInstSetLocal

func NewInstSetLocal(name string) *instSetLocal

func NewInstShl added in v0.8.0

func NewInstShl(t ValueType) *instShl

func NewInstShr added in v0.8.0

func NewInstShr(t ValueType) *instShr

func NewInstStore

func NewInstStore(typ ValueType, offset int, align int) *instStore

func NewInstStore16

func NewInstStore16(offset int, align int) *instStore16

func NewInstStore8

func NewInstStore8(offset int, align int) *instStore8

func NewInstSub

func NewInstSub(t ValueType) *instSub

func NewInstUnreachable added in v0.7.0

func NewInstUnreachable() *instUnreachable

func NewInstXor added in v0.5.0

func NewInstXor(t ValueType) *instXor

Types

type F32

type F32 struct {
	// contains filtered or unexported fields
}

************************************* F32: *************************************

func (F32) Equal

func (t F32) Equal(u ValueType) bool

func (F32) Name

func (t F32) Name() string

type F64

type F64 struct {
	// contains filtered or unexported fields
}

************************************* F64: *************************************

func (F64) Equal

func (t F64) Equal(u ValueType) bool

func (F64) Name

func (t F64) Name() string

type FuncSig

type FuncSig struct {
	Params  []ValueType
	Results []ValueType
}

************************************* FuncSig: *************************************

func (*FuncSig) String

func (sig *FuncSig) String() string

type FuncType

type FuncType struct {
	Name string
	FuncSig
}

************************************* FuncType: *************************************

func (FuncType) String

func (t FuncType) String() string

type Function

type Function struct {
	InternalName string
	ExternalName string
	Results      []ValueType
	Params       []Value
	Locals       []Value

	Insts []Inst
}

************************************* Function: *************************************

func (*Function) Format

func (f *Function) Format(indent string) string

type Global

type Global struct {
	V         Value
	IsMut     bool
	InitValue string
}

************************************* Global: *************************************

type I32

type I32 struct {
	// contains filtered or unexported fields
}

************************************* I32: *************************************

func (I32) Equal

func (t I32) Equal(u ValueType) bool

func (I32) Name

func (t I32) Name() string

type I64

type I64 struct {
	// contains filtered or unexported fields
}

************************************* I64: *************************************

func (I64) Equal

func (t I64) Equal(u ValueType) bool

func (I64) Name

func (t I64) Name() string

type ImpFunc

type ImpFunc struct {
	ImpObj
	// contains filtered or unexported fields
}

************************************* ImpFunc: *************************************

func NewImpFunc

func NewImpFunc(moduleName string, objName string, funcName string, sig FuncSig) *ImpFunc

func (*ImpFunc) Format

func (o *ImpFunc) Format(indent string) string

func (*ImpFunc) Type

func (o *ImpFunc) Type() ObjType

type ImpObj

type ImpObj struct {
	// contains filtered or unexported fields
}

************************************* ImpObj: *************************************

func (*ImpObj) ModuleName

func (o *ImpObj) ModuleName() string

func (*ImpObj) ObjName

func (o *ImpObj) ObjName() string

type Import

type Import interface {
	Format(indent string) string
	ModuleName() string
	ObjName() string
	Type() ObjType
}

************************************* Import: *************************************

type Inst

type Inst interface {
	Format(indent string) string
	// contains filtered or unexported methods
}

************************************* Inst: *************************************

type Module

type Module struct {
	Name    string
	Imports []Import

	Tables    Table
	FuncTypes []FuncType
	Globals   []Global
	Funcs     []*Function
	DataSeg   []byte

	BaseWat string
}

模块对象

func (*Module) String

func (m *Module) String() string

type ObjType

type ObjType int32

************************************* ObjType: *************************************

const (
	ObjTypeFunc ObjType = iota
	ObjTypeMem
	ObjTypeTable
	ObjTypeGlobal
)

type OpCode

type OpCode int32

************************************* OpCode: *************************************

const (
	OpCodeAdd OpCode = iota
	OpCodeSub
	OpCodeMul
	OpCodeQuo
	OpCodeRem
	OpCodeEql
	OpCodeNe
	OpCodeLt
	OpCodeGt
	OpCodeLe
	OpCodeGe
	OpCodeAnd
	OpCodeOr
	OpCodeXor
	OpCodeNot
	OpCodeShl
	OpCodeShr
	OpCodeAndNot
)

type Table

type Table struct {
	Elems []string
}

************************************* Table: *************************************

func (Table) String

func (t Table) String() string

type U32

type U32 struct {
	// contains filtered or unexported fields
}

************************************* U32: *************************************

func (U32) Equal

func (t U32) Equal(u ValueType) bool

func (U32) Name

func (t U32) Name() string

type U64

type U64 struct {
	// contains filtered or unexported fields
}

************************************* U64: *************************************

func (U64) Equal

func (t U64) Equal(u ValueType) bool

func (U64) Name

func (t U64) Name() string

type Value

type Value interface {
	Name() string
	Type() ValueType
}

************************************* Value: *************************************

func NewVar

func NewVar(name string, typ ValueType) Value

func NewVarF32

func NewVarF32(name string) Value

func NewVarF64

func NewVarF64(name string) Value

func NewVarI32

func NewVarI32(name string) Value

func NewVarI64

func NewVarI64(name string) Value

func NewVarU32

func NewVarU32(name string) Value

func NewVarU64

func NewVarU64(name string) Value

type ValueType

type ValueType interface {
	Name() string
	// contains filtered or unexported methods
}

************************************* ValueType: *************************************

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL