executors

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package executor contains the executors that perform a specific action on the Wasm code tree (Module) that they operate on. The executors keep track of their execution state in corresponding context objects.

Index

Constants

View Source
const DEBUG_MODULE = "xxx.wasm"
View Source
const MAX_LOCALS = 1060

test-guard-page-skip tests with 1056 i64 = 8448 bytes of locals

Variables

View Source
var Modules = make(map[string]*sections.Module)
View Source
var TotalNrFailed int
View Source
var TotalNrOfTests int

Functions

func DefineModule added in v0.2.0

func DefineModule(module string) *sections.Module

Types

type WasmAnalyzer

type WasmAnalyzer struct {
	// contains filtered or unexported fields
}

WasmAnalyzer is an executor that analyzes the Module for validity and prepares it for running by other executors.

func NewWasmAnalyzer

func NewWasmAnalyzer(m *sections.Module) *WasmAnalyzer

func (*WasmAnalyzer) Analyze

func (ctx *WasmAnalyzer) Analyze() error

type WasmLinker

type WasmLinker struct {
	// contains filtered or unexported fields
}

func NewWasmLinker

func NewWasmLinker(m *sections.Module) *WasmLinker

func (*WasmLinker) DefineFunction added in v0.2.1

func (lnk *WasmLinker) DefineFunction(name string, params []value.DataType, results []value.DataType, f sections.HostCall) *sections.Function

func (*WasmLinker) DefineGlobal added in v0.2.1

func (lnk *WasmLinker) DefineGlobal(name string, dataType value.DataType, init *sections.Variable) *sections.Global

func (*WasmLinker) DefineMemory added in v0.2.1

func (lnk *WasmLinker) DefineMemory(name string, min uint32, max uint32) *sections.Memory

func (*WasmLinker) DefineTable added in v0.2.1

func (lnk *WasmLinker) DefineTable(name string, min uint32, max uint32) *sections.Table
func (lnk *WasmLinker) Link() error

type WasmReader

type WasmReader struct {
	// contains filtered or unexported fields
}

WasmReader is an executor that reads a binary Wasm file and converts it to a Module.

func NewWasmReader

func NewWasmReader(m *sections.Module, data []byte) *WasmReader

func (*WasmReader) Read

func (ctx *WasmReader) Read() error

type WasmRunner added in v0.0.5

type WasmRunner struct {
	// contains filtered or unexported fields
}

func NewWasmRunner added in v0.0.5

func NewWasmRunner() *WasmRunner

func (*WasmRunner) Load added in v0.0.5

func (r *WasmRunner) Load(wasmData []byte) error

func (*WasmRunner) Memory added in v0.2.0

func (r *WasmRunner) Memory() []byte

func (*WasmRunner) Module added in v0.0.5

func (r *WasmRunner) Module() *sections.Module

func (*WasmRunner) RunExport added in v0.0.9

func (r *WasmRunner) RunExport(exportName string, params []sections.Variable) error

func (*WasmRunner) RunFunction added in v0.0.9

func (r *WasmRunner) RunFunction(function *sections.Function, params []sections.Variable) error

type WasmTester

type WasmTester struct {
	Error error
	// contains filtered or unexported fields
}

WasmReader is an executor that reads a tests.json file and uses its data to run a series of unit tests on Wasm modules in the same folder.

func NewWasmTester

func NewWasmTester(path string, isSpecTest bool) *WasmTester

func (*WasmTester) Test

func (tst *WasmTester) Test()

type WasmWriter

type WasmWriter struct {
	// contains filtered or unexported fields
}

WasmWriter is an executor that creates binary Wasm data from a Module.

func NewWasmWriter

func NewWasmWriter(m *sections.Module) *WasmWriter

func (*WasmWriter) Data

func (ctx *WasmWriter) Data() []byte

func (*WasmWriter) Write

func (ctx *WasmWriter) Write()

type WatWriter

type WatWriter struct {
	// contains filtered or unexported fields
}

WatWriter is an executor that creates a Wasm disassembly text file from a Module.

func NewWatWriter

func NewWatWriter(m *sections.Module, w io.Writer) *WatWriter

func (*WatWriter) Write

func (ctx *WatWriter) Write()

Directories

Path Synopsis
Package context contains the context objects for the executors that perform a specific action on the Wasm code tree (Module) that they operate on.
Package context contains the context objects for the executors that perform a specific action on the Wasm code tree (Module) that they operate on.
test
Package test contains all the extra POGO that are needed to read the tests.json file that is processed by the WasmTester executor.
Package test contains all the extra POGO that are needed to read the tests.json file that is processed by the WasmTester executor.

Jump to

Keyboard shortcuts

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