module

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicNumber = uint32(0x6d736100)
	Version     = uint32(1)
)
View Source
const (
	SectionUnknown = 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

This section is empty.

Types

type DataBuffer added in v0.3.0

type DataBuffer interface {
	Bytes() []byte
	ResizeBytes(n int) []byte
}

type ExternalKind

type ExternalKind byte

func (ExternalKind) String

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

type Global

type Global struct {
	Type    abi.Type
	Mutable bool
	Init    uint64
}
type Header struct {
	MagicNumber uint32
	Version     uint32
}

type ImportFunc added in v0.3.1

type ImportFunc struct {
	FuncIndex int
	Variadic  bool
	AbsAddr   uint64
}

type M added in v0.3.1

type M struct {
	Sigs              []abi.Sig
	FuncSigs          []uint32
	ImportFuncs       []ImportFunc
	TableLimitValues  ResizableLimits
	MemoryLimitValues ResizableLimits
	Globals           []Global
	NumImportGlobals  int
	EntryIndex        uint32
	EntryDefined      bool
	StartIndex        uint32
	StartDefined      bool
	TableFuncs        []uint32

	Text       TextBuffer
	RODataAddr int32
	ROData     DataBuffer
	TrapLinks  [trap.NumTraps]links.L
	FuncLinks  []links.FuncL
	Map        ObjectMap
	Regs       regalloc.Allocator

	Data         DataBuffer
	MemoryOffset int
}

type ObjectMap added in v0.3.2

type ObjectMap interface {
	InitObjectMap(numImportFuncs, numOtherFuncs int)
	PutImportFuncAddr(object.TextAddr)
	PutFuncAddr(object.TextAddr)
	PutCallSite(returnAddr object.TextAddr, stackOffset int32)
	PutInsnAddr(object.TextAddr)
}

ObjectMap gathers information about positions of (WebAssembly) functions, function calls and instructions within the text (machine code) section.

type Reader

type Reader interface {
	io.Reader
	io.ByteScanner
}

type ResizableLimits

type ResizableLimits struct {
	Initial int
	Maximum int
	Defined bool
}

type TextBuffer added in v0.3.0

type TextBuffer interface {
	gen.Buffer
}

Jump to

Keyboard shortcuts

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