context

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: 7 Imported by: 0

Documentation

Overview

Package context contains the context objects for 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 these context objects.

Index

Constants

View Source
const PAGE_SIZE = 0x10000

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	BlockMark int
	Code      []helper.Instruction
	Error     error
	Frame     []value.DataType
	FuncNr    uint32
	IP        int
	Labels    []*Label
	Locals    int
	MaxSP     int
	MinSP     int
	Module    *sections.Module
	SP        int
}

func NewAnalyzer

func NewAnalyzer(m *sections.Module, params []value.DataType, locals []*sections.Local) *Analyzer

func (*Analyzer) Fail

func (a *Analyzer) Fail(format string, args ...interface{})

func (*Analyzer) Pop

func (a *Analyzer) Pop() value.DataType

func (*Analyzer) PopExpected

func (a *Analyzer) PopExpected(expected value.DataType) value.DataType

func (*Analyzer) PopMulti

func (a *Analyzer) PopMulti(values []value.DataType)

func (*Analyzer) Push

func (a *Analyzer) Push(dataType value.DataType)

func (*Analyzer) PushMulti

func (a *Analyzer) PushMulti(dataTypes []value.DataType)

type Label

type Label struct {
	BlockInst   helper.Instruction
	BlockType   *sections.FuncType
	HasElse     bool
	Target      helper.Instruction
	Unreachable bool
	UnwindSP    int
}

func NewLabel

func NewLabel(blockType *sections.FuncType, target helper.Instruction) *Label

type Reader

type Reader struct {
	Flag   byte
	Error  error
	Max    uint32
	Min    uint32
	Module *sections.Module
	Opcode byte

	IP int
	// contains filtered or unexported fields
}

func NewReader

func NewReader(m *sections.Module, data []byte) *Reader

func (*Reader) GetByte

func (r *Reader) GetByte() byte

func (*Reader) GetBytes

func (r *Reader) GetBytes(count uint32) []byte

func (*Reader) GetDataType

func (r *Reader) GetDataType() value.DataType

func (*Reader) GetDataTypes

func (r *Reader) GetDataTypes() []value.DataType

func (*Reader) GetF32

func (r *Reader) GetF32() float32

func (*Reader) GetF64

func (r *Reader) GetF64() float64

func (*Reader) GetI32

func (r *Reader) GetI32() int32

func (*Reader) GetI64

func (r *Reader) GetI64() int64

func (*Reader) GetLimits

func (r *Reader) GetLimits()

func (*Reader) GetString

func (r *Reader) GetString() string

func (*Reader) GetU32

func (r *Reader) GetU32() uint32

func (*Reader) GetU64

func (r *Reader) GetU64() uint64

func (*Reader) Size

func (r *Reader) Size() uint32

returns size of unread part

type Runner

type Runner struct {
	Addr      uint32
	Buffer    []byte
	CallDepth int
	Error     error
	Frame     []sections.Variable
	Module    *sections.Module
	Next      helper.Instruction
	SP        int
}

func NewRunner

func NewRunner(m *sections.Module) *Runner

type Writer

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

func NewWriter

func NewWriter() *Writer

func (*Writer) Data

func (w *Writer) Data() []byte

func (*Writer) PutByte

func (w *Writer) PutByte(val byte)

func (*Writer) PutBytes

func (w *Writer) PutBytes(data []byte)

func (*Writer) PutDataType

func (w *Writer) PutDataType(dataType value.DataType)

func (*Writer) PutDataTypes

func (w *Writer) PutDataTypes(dataTypes []value.DataType)

func (*Writer) PutF32

func (w *Writer) PutF32(val float32)

func (*Writer) PutF64

func (w *Writer) PutF64(val float64)

func (*Writer) PutI32

func (w *Writer) PutI32(val int32)

func (*Writer) PutI64

func (w *Writer) PutI64(val int64)

func (*Writer) PutLimits

func (w *Writer) PutLimits(min uint32, max uint32)

func (*Writer) PutString

func (w *Writer) PutString(val string)

func (*Writer) PutU32

func (w *Writer) PutU32(val uint32)

func (*Writer) PutU64

func (w *Writer) PutU64(val uint64)

func (*Writer) Size

func (w *Writer) Size() uint32

returns size of written part

Directories

Path Synopsis
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