module

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicNumber = uint32(0x6d736100)
	Version     = uint32(1)
)
View Source
const (
	MaxFunctions  = 32768
	MaxFuncParams = 255
	MaxTypes      = MaxFunctions
	MaxImports    = MaxFunctions
)
View Source
const (
	SectionCustom = SectionID(iota)
	SectionType
	SectionImport
	SectionFunction
	SectionTable
	SectionMemory
	SectionGlobal
	SectionExport
	SectionStart
	SectionElement
	SectionCode
	SectionData

	NumSections
)
View Source
const (
	ExternalKindFunction = ExternalKind(iota)
	ExternalKindTable
	ExternalKindMemory
	ExternalKindGlobal
)

Variables

This section is empty.

Functions

func Error added in v0.32.0

func Error(text string) error

func Errorf added in v0.32.0

func Errorf(format string, args ...any) error

func WrapError added in v0.32.0

func WrapError(cause error, text string) error

Types

type ExternalKind

type ExternalKind byte

func (ExternalKind) String

func (kind ExternalKind) String() (s string)

type Global

type Global struct {
	Type       wa.Type
	Mutable    bool
	InitImport int8 // -1 if InitConst is defined.
	InitConst  uint64
}
type Header struct {
	MagicNumber uint32
	Version     uint32
}

type Import added in v0.32.0

type Import struct {
	Module string
	Field  string
}

type ImportFunc added in v0.3.1

type ImportFunc struct {
	Import
	LibraryFunc uint32
}

type ImportIndex added in v0.32.0

type ImportIndex struct {
	Import
	VectorIndex int
}

type Library added in v0.32.0

type Library struct {
	Types       []wa.FuncType
	Funcs       []uint32
	ImportFuncs []ImportIndex
	Memory      bool
	ExportFuncs map[string]uint32
	CodeFuncs   [][]byte
}

type M added in v0.3.1

type M struct {
	Types         []wa.FuncType
	Funcs         []uint32
	ImportFuncs   []ImportFunc
	Table         bool
	TableLimit    ResizableLimits
	Memory        bool
	MemoryLimit   ResizableLimits
	Globals       []Global
	ImportGlobals []Import
	ExportFuncs   map[string]uint32
	StartIndex    uint32
	StartDefined  bool
	TableFuncs    []uint32
}

func (*M) EvaluateGlobalInitializer added in v0.34.0

func (m *M) EvaluateGlobalInitializer(index int, value uint64) uint64

func (*M) NumMemory added in v0.36.0

func (m *M) NumMemory() uint32

func (*M) NumTable added in v0.36.0

func (m *M) NumTable() uint32

type ResizableLimits

type ResizableLimits struct {
	Init int
	Max  int // -1 if unlimited (memory).
}

type SectionID added in v0.32.0

type SectionID byte

func (SectionID) String added in v0.32.0

func (id SectionID) String() string

Jump to

Keyboard shortcuts

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