Documentation
¶
Index ¶
- Constants
- Variables
- func ModuleValidate(binary []byte) bool
- func NewGlobal(compartment *Compartment, globalType *GlobalType, val *Val, debugName string) *C.wasm_global_t
- func ValGetF32(val *Val) float32
- func ValGetF64(val *Val) float64
- func ValGetI32(val *Val) int32
- func ValGetI64(val *Val) int64
- type Compartment
- func (c *Compartment) Clone() *Compartment
- func (c *Compartment) Close() error
- func (c *Compartment) Contains(ref *Ref) bool
- func (c *Compartment) Delete()
- func (c *Compartment) NewFunc(funcType *FuncType, callback FuncCallback, debugName string) *Func
- func (c *Compartment) NewStore(debugName string) *Store
- type Config
- func (c *Config) Close() error
- func (c *Config) Delete()
- func (c *Config) EnableAll() *Config
- func (c *Config) SetAtomics(enable bool) *Config
- func (c *Config) SetBulkMemoryOps(enable bool) *Config
- func (c *Config) SetExceptionHandling(enable bool) *Config
- func (c *Config) SetExtendedNameSection(enable bool) *Config
- func (c *Config) SetImportExportMutableGlobals(enable bool) *Config
- func (c *Config) SetMultiMemory(enable bool) *Config
- func (c *Config) SetMultiValue(enable bool) *Config
- func (c *Config) SetNonTrappingFloatToInt(enable bool) *Config
- func (c *Config) SetReferenceTypes(enable bool) *Config
- func (c *Config) SetSIMD(enable bool) *Config
- func (c *Config) SetSignExtension(enable bool) *Config
- type Engine
- func (e *Engine) Close() error
- func (e *Engine) Compile(wasm []byte, out []byte) []byte
- func (e *Engine) CompileObject(wasm []byte, out []byte) []byte
- func (e *Engine) Delete()
- func (e *Engine) NewCompartment(debugName string) *Compartment
- func (e *Engine) NewModule(binary []byte) *Module
- func (e *Engine) NewPrecompiledModule(binary []byte) *Module
- type Export
- type Extern
- type ExternKind
- type ExternType
- func FuncTypeAsExternType(t *FuncType) *ExternType
- func FuncTypeAsExternTypeConst(t *FuncType) *ExternType
- func GlobalTypeAsExternType(t *GlobalType) *ExternType
- func GlobalTypeAsExternTypeConst(t *GlobalType) *ExternType
- func MemoryTypeAsExternType(t *MemoryType) *ExternType
- func MemoryTypeAsExternTypeConst(t *MemoryType) *ExternType
- func TableTypeAsExternType(t *TableType) *ExternType
- func TableTypeAsExternTypeConst(t *TableType) *ExternType
- func WASMExternType(extern *Extern) *ExternType
- type Foreign
- type Frame
- type Func
- func (f *Func) AsExtern() *Extern
- func (f *Func) Call(store *Store, args *Val, results *Val) *Trap
- func (f *Func) CallNoCopy(store *Store, args *Val, results *Val) *Trap
- func (f *Func) CallNoTrap(store *Store, args *Val, results *Val) *Trap
- func (f *Func) CallUnsafe(store *Store, args *Val, results *Val) *Trap
- func (f *Func) Close() error
- func (f *Func) Delete()
- func (f *Func) ParamArity() int
- func (f *Func) ResultArity() int
- func (f *Func) Type() *FuncType
- type FuncCallback
- type FuncType
- func ExternTypeAsFuncType(t *ExternType) *FuncType
- func ExternTypeAsFuncTypeConst(t *ExternType) *FuncType
- func FuncType_0_0() *FuncType
- func FuncType_0_1(r1 *ValType) *FuncType
- func FuncType_0_2(r1 *ValType, r2 *ValType) *FuncType
- func FuncType_1_0(p1 *ValType) *FuncType
- func FuncType_1_1(p1 *ValType, r1 *ValType) *FuncType
- func FuncType_1_2(p1 *ValType, r1 *ValType, r2 *ValType) *FuncType
- func FuncType_2_0(p1 *ValType, p2 *ValType) *FuncType
- func FuncType_2_1(p1 *ValType, p2 *ValType, r1 *ValType) *FuncType
- func FuncType_2_2(p1 *ValType, p2 *ValType, r1 *ValType, r2 *ValType) *FuncType
- func FuncType_3_0(p1 *ValType, p2 *ValType, p3 *ValType) *FuncType
- func FuncType_3_1(p1 *ValType, p2 *ValType, p3 *ValType, r1 *ValType) *FuncType
- func FuncType_3_2(p1 *ValType, p2 *ValType, p3 *ValType, r1 *ValType, r2 *ValType) *FuncType
- func FuncType_4_1(p1 *ValType, p2 *ValType, p3 *ValType, p4 *ValType, r1 *ValType) *FuncType
- func NewFuncType(params []*ValType, results []*ValType) *FuncType
- type Global
- type GlobalType
- type Import
- type Index
- type Instance
- type Limits
- type Memory
- type MemoryType
- type Module
- func (m *Module) Close() error
- func (m *Module) Delete()
- func (m *Module) Export(index int) Export
- func (m *Module) Exports(exports []Export) []Export
- func (m *Module) Import(index int) Import
- func (m *Module) Imports(imports []Import) []Import
- func (m *Module) NumExports() int
- func (m *Module) NumImports() int
- func (m *Module) Print() string
- func (m *Module) PrintTo(b []byte) []byte
- type Mutability
- type Ref
- type Shared
- type Store
- type Table
- type TableType
- type Trap
- type V128T
- type Val
- func (v *Val) F32() float32
- func (v *Val) F64() float64
- func (v *Val) I32() int32
- func (v *Val) I64() int64
- func (v *Val) Ref32() uint32
- func (v *Val) Ref64() uint64
- func (v *Val) SetF32(value float32)
- func (v *Val) SetF64(value float64)
- func (v *Val) SetI32(value int32)
- func (v *Val) SetI64(value int64)
- func (v *Val) SetRef32(value uint32)
- func (v *Val) SetRef64(value uint64)
- func (v *Val) SetV128(value V128T)
- func (v *Val) V128() V128T
- type ValKind
- type ValType
Constants ¶
View Source
const ( ExternFunc = ExternKind(C.WASM_EXTERN_FUNC) ExternTable = ExternKind(C.WASM_EXTERN_TABLE) ExternMemory = ExternKind(C.WASM_EXTERN_MEMORY) ExternGlobal = ExternKind(C.WASM_EXTERN_GLOBAL) )
View Source
const ( CONST = Mutability(C.WASM_CONST) VAR = Mutability(C.WASM_VAR) )
View Source
const ( NOTSHARED = Shared(C.WASM_NOTSHARED) SHARED = Shared(C.WASM_SHARED) )
View Source
const ( INDEX_I32 = Index(C.WASM_INDEX_I32) INDEX_I64 = Index(C.WASM_INDEX_I64) )
Variables ¶
View Source
var ( WASMFuncCall = C.wasm_func_call WASMFuncCallNoCopy = C.wasm_func_call_no_copy WASMFuncCallNoTrap = C.wasm_func_call_no_trap WASMFuncCallNoCopyNoTrap = C.wasm_func_call_no_copy_no_trap )
View Source
var (
EMPTY = C.CString("")
)
Functions ¶
func ModuleValidate ¶
func NewGlobal ¶
func NewGlobal( compartment *Compartment, globalType *GlobalType, val *Val, debugName string, ) *C.wasm_global_t
Types ¶
type Compartment ¶
type Compartment C.wasm_compartment_t
func NewCompartment ¶
func NewCompartment(engine *Engine, debugName string) *Compartment
func (*Compartment) Clone ¶
func (c *Compartment) Clone() *Compartment
func (*Compartment) Close ¶
func (c *Compartment) Close() error
func (*Compartment) Contains ¶
func (c *Compartment) Contains(ref *Ref) bool
func (*Compartment) Delete ¶
func (c *Compartment) Delete()
func (*Compartment) NewFunc ¶
func (c *Compartment) NewFunc( funcType *FuncType, callback FuncCallback, debugName string, ) *Func
func (*Compartment) NewStore ¶
func (c *Compartment) NewStore(debugName string) *Store
type Config ¶
type Config C.wasm_config_t
func NewConfigAll ¶
func NewConfigAll() *Config
func (*Config) SetAtomics ¶
func (*Config) SetBulkMemoryOps ¶
func (*Config) SetExceptionHandling ¶
func (*Config) SetExtendedNameSection ¶
func (*Config) SetImportExportMutableGlobals ¶
func (*Config) SetMultiMemory ¶
func (*Config) SetMultiValue ¶
func (*Config) SetNonTrappingFloatToInt ¶
func (*Config) SetReferenceTypes ¶
func (*Config) SetSignExtension ¶
type Engine ¶
type Engine C.wasm_engine_t
func NewEngineWithConfig ¶
func (*Engine) NewCompartment ¶
func (e *Engine) NewCompartment(debugName string) *Compartment
func (*Engine) NewPrecompiledModule ¶
type Export ¶
type Export struct {
// contains filtered or unexported fields
}
typedef struct wasm_export_t
{
const char* name;
size_t num_name_bytes;
wasm_externtype_t* type;
} wasm_export_t;
func (*Export) NameUnsafe ¶
type Extern ¶
type Extern C.wasm_extern_t
func (*Extern) AsKind ¶
func (e *Extern) AsKind() ExternKind
type ExternKind ¶
type ExternKind uint8
func WASMExternKind ¶
func WASMExternKind(extern *Extern) ExternKind
type ExternType ¶
type ExternType C.wasm_externtype_t
func FuncTypeAsExternType ¶
func FuncTypeAsExternType(t *FuncType) *ExternType
func FuncTypeAsExternTypeConst ¶
func FuncTypeAsExternTypeConst(t *FuncType) *ExternType
func GlobalTypeAsExternType ¶
func GlobalTypeAsExternType(t *GlobalType) *ExternType
func GlobalTypeAsExternTypeConst ¶
func GlobalTypeAsExternTypeConst(t *GlobalType) *ExternType
func MemoryTypeAsExternType ¶
func MemoryTypeAsExternType(t *MemoryType) *ExternType
func MemoryTypeAsExternTypeConst ¶
func MemoryTypeAsExternTypeConst(t *MemoryType) *ExternType
func TableTypeAsExternType ¶
func TableTypeAsExternType(t *TableType) *ExternType
func TableTypeAsExternTypeConst ¶
func TableTypeAsExternTypeConst(t *TableType) *ExternType
func WASMExternType ¶
func WASMExternType(extern *Extern) *ExternType
type Foreign ¶
type Foreign C.wasm_foreign_t
func NewForeign ¶
func NewForeign(compartment *Compartment, debugName string) *Foreign
type Frame ¶
typedef struct wasm_frame_t
{
wasm_func_t* function;
size_t instr_index;
} wasm_frame_t;
type Func ¶
type Func C.wasm_func_t
func NewFunc ¶
func NewFunc( compartment *Compartment, funcType *FuncType, callback FuncCallback, debugName string) *Func
func (*Func) ParamArity ¶
func (*Func) ResultArity ¶
type FuncCallback ¶
type FuncCallback C.wasm_func_callback_t
type FuncType ¶
type FuncType C.wasm_functype_t
func ExternTypeAsFuncType ¶
func ExternTypeAsFuncType(t *ExternType) *FuncType
func ExternTypeAsFuncTypeConst ¶
func ExternTypeAsFuncTypeConst(t *ExternType) *FuncType
func FuncType_0_0 ¶
func FuncType_0_0() *FuncType
func FuncType_0_1 ¶
func FuncType_0_2 ¶
func FuncType_1_0 ¶
func FuncType_1_1 ¶
func FuncType_2_0 ¶
func FuncType_2_2 ¶
func FuncType_3_1 ¶
func FuncType_3_2 ¶
func FuncType_4_1 ¶
func NewFuncType ¶
func (*FuncType) NumResults ¶
type GlobalType ¶
type GlobalType C.wasm_globaltype_t
func ExternTypeAsGlobalType ¶
func ExternTypeAsGlobalType(t *ExternType) *GlobalType
func ExternTypeAsGlobalTypeConst ¶
func ExternTypeAsGlobalTypeConst(t *ExternType) *GlobalType
func NewGlobalType ¶
func NewGlobalType(valType *ValType, mutability Mutability) *GlobalType
func (*GlobalType) Close ¶
func (g *GlobalType) Close() error
func (*GlobalType) Content ¶
func (g *GlobalType) Content() *ValType
func (*GlobalType) Delete ¶
func (g *GlobalType) Delete()
func (*GlobalType) Mutability ¶
func (g *GlobalType) Mutability() Mutability
type Import ¶
type Import struct {
// contains filtered or unexported fields
}
typedef struct wasm_import_t
{
const char* module;
size_t num_module_bytes;
const char* name;
size_t num_name_bytes;
wasm_externtype_t* type;
} wasm_import_t;
func (*Import) ModuleUnsafe ¶
func (*Import) NameUnsafe ¶
type Memory ¶
type Memory C.wasm_memory_t
type MemoryType ¶
type MemoryType C.wasm_memorytype_t
func ExternTypeAsMemoryType ¶
func ExternTypeAsMemoryType(t *ExternType) *MemoryType
func ExternTypeAsMemoryTypeConst ¶
func ExternTypeAsMemoryTypeConst(t *ExternType) *MemoryType
func NewMemoryType ¶
func NewMemoryType(limits *Limits, shared Shared, index int) *MemoryType
func (*MemoryType) Close ¶
func (m *MemoryType) Close() error
func (*MemoryType) Delete ¶
func (m *MemoryType) Delete()
func (*MemoryType) Limits ¶
func (m *MemoryType) Limits() *Limits
func (*MemoryType) Shared ¶
func (m *MemoryType) Shared() Shared
type Module ¶
type Module C.wasm_module_t
func NewModulePrecompiled ¶
func NewModuleText ¶
func (*Module) NumExports ¶
func (*Module) NumImports ¶
type Mutability ¶
type Mutability uint8
type Ref ¶
type Ref C.wasm_ref_t
type Store ¶
type Store C.wasm_store_t
func NewStore ¶
func NewStore(compartment *Compartment, debugName string) *Store
type Table ¶
type Table C.wasm_table_t
type TableType ¶
type TableType C.wasm_tabletype_t
func ExternTypeAsTableType ¶
func ExternTypeAsTableType(t *ExternType) *TableType
func ExternTypeAsTableTypeConst ¶
func ExternTypeAsTableTypeConst(t *ExternType) *TableType
func NewTableType ¶
type Trap ¶
type Trap C.wasm_trap_t
func NewTrap ¶
func NewTrap(compartment *Compartment, message string) *Trap
func (*Trap) StackFrame ¶
func (*Trap) StackNumFrames ¶
type V128T ¶
type V128T struct {
// contains filtered or unexported fields
}
// NOTE: not 128-bit aligned typedef struct wasm_v128_t
{
uint64_t u64x2[2];
} wasm_v128_t;
type Val ¶
type Val C.wasm_val_t
typedef union wasm_val_t
{
int32_t i32;
int64_t i64;
wasm_float32_t f32;
wasm_float64_t f64;
wasm_v128_t v128;
wasm_ref_t* ref;
} wasm_val_t;
type ValType ¶
type ValType C.wasm_valtype_t
func NewValType ¶
func ValTypeAnyref ¶
func ValTypeAnyref() *ValType
func ValTypeF32 ¶
func ValTypeF32() *ValType
func ValTypeF64 ¶
func ValTypeF64() *ValType
func ValTypeFuncref ¶
func ValTypeFuncref() *ValType
func ValTypeI32 ¶
func ValTypeI32() *ValType
func ValTypeI64 ¶
func ValTypeI64() *ValType
func ValTypeV128 ¶
func ValTypeV128() *ValType
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
|
lib
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
|
lib/darwin_amd64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
|
lib/darwin_arm64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
|
lib/linux_amd64
See https://github.com/golang/go/issues/26366.
|
See https://github.com/golang/go/issues/26366. |
|
cmd
command
|
|
Click to show internal directories.
Click to hide internal directories.