frontend

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package frontend implements the translation of WebAssembly to SSA IR using the ssa package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FunctionIndexToFuncRef

func FunctionIndexToFuncRef(idx wasm.Index) ssa.FuncRef

func WasmTypeToSSAType

func WasmTypeToSSAType(vt wasm.ValueType) ssa.Type

WasmTypeToSSAType converts wasm.ValueType to ssa.Type.

Types

type Compiler

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

Compiler is in charge of lowering Wasm to SSA IR, and does the optimization on top of it in architecture-independent way.

func NewFrontendCompiler

func NewFrontendCompiler(m *wasm.Module, ssaBuilder ssa.Builder, offset *wazevoapi.ModuleContextOffsetData) *Compiler

NewFrontendCompiler returns a frontend Compiler.

func (*Compiler) Init

func (c *Compiler) Init(idx wasm.Index, typ *wasm.FunctionType, localTypes []wasm.ValueType, body []byte)

Init initializes the state of frontendCompiler and make it ready for a next function.

func (*Compiler) LowerToSSA

func (c *Compiler) LowerToSSA() error

LowerToSSA lowers the current function to SSA function which will be held by ssaBuilder. After calling this, the caller will be able to access the SSA info in *Compiler.ssaBuilder.

Note that this only does the naive lowering, and do not do any optimization, instead the caller is expected to do so.

Jump to

Keyboard shortcuts

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