vmhooksgenerate

package
v1.5.26 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEIGenWriter

func NewEIGenWriter(pathToApiPackage string, relativePath string) *eiGenWriter

func ReadAndParseEIMetadata

func ReadAndParseEIMetadata(fset *token.FileSet, pathToSources string, eiMetadata *EIMetadata) error

ReadAndParseEIMetadata will read and parse EI metadata

func WriteEIInterface

func WriteEIInterface(out *eiGenWriter, eiMetadata *EIMetadata)

func WriteExecutorOpcodeCost

func WriteExecutorOpcodeCost(out *eiGenWriter)

WriteExecutorOpcodeCost generates code for executor/gasCostWASM.go

func WriteNames

func WriteNames(
	out *eiGenWriter,
	packageName string,
	eiMetadata *EIMetadata,
)

func WriteOpcodeCostFuncHelpers

func WriteOpcodeCostFuncHelpers(out *eiGenWriter)

WriteOpcodeCostFuncHelpers generates code for extractOpcodeCost.txt (to be copied manually in wasmer2/wasmer2Executor.go)

func WriteRustCapiVMHooks

func WriteRustCapiVMHooks(out *eiGenWriter, eiMetadata *EIMetadata)

func WriteRustCapiVMHooksPointers

func WriteRustCapiVMHooksPointers(out *eiGenWriter, eiMetadata *EIMetadata)

func WriteRustHookNames added in v1.5.8

func WriteRustHookNames(
	out *eiGenWriter,
	eiMetadata *EIMetadata,
)

func WriteRustOpcodeCost

func WriteRustOpcodeCost(out *eiGenWriter)

WriteRustOpcodeCost generates code for opcode_cost.rs

func WriteRustVMHooksTrait

func WriteRustVMHooksTrait(out *eiGenWriter, eiMetadata *EIMetadata)

WriteRustVMHooksTrait autogenerate data in the provided file

func WriteRustWasmerImports

func WriteRustWasmerImports(out *eiGenWriter, eiMetadata *EIMetadata)

WriteRustWasmerImports autogenerate data in the provided file

func WriteRustWasmerMeteringHelpers

func WriteRustWasmerMeteringHelpers(out *eiGenWriter)

WriteRustWasmerMeteringHelpers generates code for wasmer_metering_helpers.rs

func WriteVMHooksWrapper

func WriteVMHooksWrapper(out *eiGenWriter, eiMetadata *EIMetadata)

func WriteWASMOpcodeCostConfigHelpers

func WriteWASMOpcodeCostConfigHelpers(out *eiGenWriter)

WriteWASMOpcodeCostConfigHelpers generates code for config.txt (to be copied manually in config/config.toml)

func WriteWASMOpcodeCostFuncHelpers

func WriteWASMOpcodeCostFuncHelpers(out *eiGenWriter)

WriteWASMOpcodeCostHelpers generates code for FillGasMap_WASMOpcodeCosts.txt (to be copied manually in config/gasSchedule.go)

func WriteWasmer1Cgo

func WriteWasmer1Cgo(out *eiGenWriter, eiMetadata *EIMetadata)

WriteWasmer1Cgo writes the metadata in the provided file

func WriteWasmer2Cgo

func WriteWasmer2Cgo(out *eiGenWriter, eiMetadata *EIMetadata)

WriteWasmer2Cgo writes the metadata in the provided file

func WriteWasmer2OpcodeCost

func WriteWasmer2OpcodeCost(out *eiGenWriter)

WriteWasmer2OpcodeCost generates code for wasmer2/opcodeCost.go

Types

type EIFunction

type EIFunction struct {
	Name      string
	Arguments []*EIFunctionArg
	Result    *EIFunctionResult
}

EIFunction holds data about one function in the VM EI.

type EIFunctionArg

type EIFunctionArg struct {
	Name string
	Type EIType
}

EIFunctionArg models an executor callback method arg.

type EIFunctionResult

type EIFunctionResult struct {
	Type EIType
}

EIFunctionResult models the executor callback method result.

type EIGroup

type EIGroup struct {
	SourcePath string
	Name       string
	Functions  []*EIFunction
}

EIGroup groups EI functions into bundles. They can end up in separate interfaces or files, if desired.

type EIMetadata

type EIMetadata struct {
	Groups       []*EIGroup
	AllFunctions []*EIFunction
}

EIMetadata holds all data about EI functions in the VM.

type EIType

type EIType int32
const (
	EITypeInt32 EIType = iota
	EITypeInt64
	EITypeMemPtr
	EITypeMemLength
	EITypeInvalid
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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