Documentation ¶
Index ¶
- func RunBenchmarkAllocation(b *testing.B, runtime func() Runtime)
- func RunBenchmarkFactorial(b *testing.B, runtime func() Runtime)
- func RunBenchmarkHostCall(b *testing.B, runtime func() Runtime)
- func RunBenchmarkMemory(b *testing.B, runtime func() Runtime)
- func RunTestAllocation(t *testing.T, runtime func() Runtime)
- func RunTestBenchmarkAllocation_Call_CompilerFastest(t *testing.T, vsRuntime Runtime)
- func RunTestBenchmarkFactorial_Call_CompilerFastest(t *testing.T, vsRuntime Runtime)
- func RunTestBenchmarkHostCall_CompilerFastest(t *testing.T, vsRuntime Runtime)
- func RunTestBenchmarkMemory_CompilerFastest(t *testing.T, vsRuntime Runtime)
- func RunTestFactorial(t *testing.T, runtime func() Runtime)
- func RunTestHostCall(t *testing.T, runtime func() Runtime)
- func RunTestMemory(t *testing.T, runtime func() Runtime)
- type Module
- type Runtime
- type RuntimeConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunBenchmarkAllocation ¶
func RunBenchmarkFactorial ¶
func RunBenchmarkHostCall ¶
func RunBenchmarkMemory ¶
func RunTestAllocation ¶
func RunTestFactorial ¶
func RunTestHostCall ¶
func RunTestMemory ¶
Types ¶
type Module ¶
type Module interface { CallI32_I32(ctx context.Context, funcName string, param uint32) (uint32, error) CallI32I32_V(ctx context.Context, funcName string, x, y uint32) error CallI32_V(ctx context.Context, funcName string, param uint32) error CallV_V(ctx context.Context, funcName string) error CallI64_I64(ctx context.Context, funcName string, param uint64) (uint64, error) WriteMemory(ctx context.Context, offset uint32, bytes []byte) error Memory() []byte Close(context.Context) error }
type Runtime ¶
type Runtime interface { Name() string Compile(context.Context, *RuntimeConfig) error Instantiate(context.Context, *RuntimeConfig) (Module, error) Close(context.Context) error }
func NewWazeroCompilerRuntime ¶
func NewWazeroCompilerRuntime() Runtime
func NewWazeroInterpreterRuntime ¶
func NewWazeroInterpreterRuntime() Runtime
type RuntimeConfig ¶
type RuntimeConfig struct { Name string ModuleName string ModuleWasm []byte FuncNames []string NeedsWASI bool NeedsMemoryExport bool // LogFn requires the implementation to export a function "env.log" which accepts i32i32_v. // The implementation invoke this with a byte slice allocated from the offset, length pair. // This function simulates a host function that logs a message. LogFn func([]byte) error // EnvFReturnValue is set to non-zero if we want the runtime to instantiate "env" module with the function "f" // which accepts one i64 value and returns the EnvFReturnValue as i64. This is mutually exclusive to LogFn. EnvFReturnValue uint64 }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.