Documentation
¶
Index ¶
- Constants
- func LoadCodeSection(config *CodeConfig, r Reader, mod *Module) (err error)
- func LoadDataSection(config *DataConfig, r Reader, mod *Module) (err error)
- func LoadUnknownSections(config *Config, r Reader) (err error)
- type CodeBuffer
- type CodeConfig
- type Config
- type DataBuffer
- type DataConfig
- type ImportResolver
- type Module
- func (m *Module) FuncTypes() []wa.FuncType
- func (m *Module) GlobalsSize() int
- func (m *Module) ImportFunc(i int) (module, field string, sig wa.FuncType)
- func (m *Module) ImportGlobal(i int) (module, field string, t wa.Type)
- func (m *Module) InitialMemorySize() int
- func (m *Module) MemorySizeLimit() int
- func (m *Module) NumImportFuncs() int
- func (m *Module) NumImportGlobals() int
- func (m *Module) SetImportFunc(i int, addr uint64)
- func (m *Module) SetImportGlobal(i int, init uint64)
- func (m *Module) SetImportsUsing(reso ImportResolver) (err error)
- func (m *Module) Types() []wa.FuncType
- type ModuleConfig
- type ObjectMap
- type Reader
Constants ¶
const ObjectVersion = 0
ABI version of generated machine code.
Variables ¶
This section is empty.
Functions ¶
func LoadCodeSection ¶ added in v0.5.0
func LoadCodeSection(config *CodeConfig, r Reader, mod *Module) (err error)
LoadCodeSection reads a WebAssembly module's code section and generates machine code and read-only data.
func LoadDataSection ¶ added in v0.5.0
func LoadDataSection(config *DataConfig, r Reader, mod *Module) (err error)
LoadDataSection reads a WebAssembly module's data section and generates initial contents of mutable program state (globals and linear memory).
func LoadUnknownSections ¶ added in v0.5.0
LoadUnknownSections reads a WebAssembly module's extension sections which follow known sections.
Types ¶
type CodeBuffer ¶ added in v0.5.0
type CodeConfig ¶ added in v0.5.0
type CodeConfig struct {
EntrySymbol string
EntryArgs []uint64
Text CodeBuffer // Initialized with default implementation if nil.
ROData DataBuffer // Initialized with default implementation if nil.
RODataAddr uintptr
ObjectMapper ObjectMap
EventHandler func(event.Event)
Config
}
CodeConfig for a single compiler invocation.
type DataBuffer ¶
type DataConfig ¶ added in v0.5.0
type DataConfig struct {
GlobalsMemory DataBuffer // Initialized with default implementation if nil.
MemoryAlignment int // Initialized with minimal value if zero.
Config
}
DataConfig for a single compiler invocation.
type ImportResolver ¶ added in v0.5.0
type ImportResolver interface {
ResolveFunc(module, field string, sig wa.FuncType) (addr uint64, err error)
ResolveGlobal(module, field string, t wa.Type) (init uint64, err error)
}
ImportResolver maps symbols to function addresses and constant values.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module contains a WebAssembly module specification without code or data.
func LoadInitialSections ¶ added in v0.6.0
func LoadInitialSections(config *ModuleConfig, r Reader) (m *Module, err error)
LoadInitialSections reads module header and all sections preceding code and data.
func (*Module) GlobalsSize ¶
func (*Module) ImportFunc ¶ added in v0.5.0
func (*Module) ImportGlobal ¶ added in v0.5.0
func (*Module) InitialMemorySize ¶ added in v0.7.0
func (*Module) MemorySizeLimit ¶ added in v0.7.0
func (*Module) NumImportFuncs ¶ added in v0.7.0
func (*Module) NumImportGlobals ¶ added in v0.7.0
func (*Module) SetImportFunc ¶ added in v0.7.0
func (*Module) SetImportGlobal ¶ added in v0.7.0
func (*Module) SetImportsUsing ¶ added in v0.7.0
func (m *Module) SetImportsUsing(reso ImportResolver) (err error)
type ModuleConfig ¶ added in v0.6.0
type ModuleConfig struct {
Config
}
ModuleConfig for a single compiler invocation.