Documentation ¶
Overview ¶
Package goarch isolates code from runtime.GOARCH=wasm in a way that avoids cyclic dependencies when re-used from other packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSP ¶
GetSP gets the stack pointer, which is needed prior to storing a value when in an operation that can trigger a Go event handler.
See https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L210-L213
func StubFunction ¶
StubFunction stubs functions not used in Go's main source tree. This traps (unreachable opcode) to ensure the function is never called.
Types ¶
type Stack ¶
type Stack interface { // Name is the function name being invoked. Name() string Param(i int) uint64 // ParamBytes reads a byte slice, given its memory offset and length (stack // positions i, i+1) ParamBytes(mem api.Memory, i int) []byte // ParamString reads a string, given its memory offset and length (stack // positions i, i+1) ParamString(mem api.Memory, i int) string ParamInt32(i int) int32 ParamUint32(i int) uint32 // Refresh the stack from the current stack pointer (SP). // // Note: This is needed prior to storing a value when in an operation that // can trigger a Go event handler. Refresh(api.Module) SetResult(i int, v uint64) SetResultBool(i int, v bool) SetResultI32(i int, v int32) SetResultI64(i int, v int64) SetResultUint32(i int, v uint32) }
Click to show internal directories.
Click to hide internal directories.