package frontend
import "github.com/tetratelabs/wazero/internal/engine/wazevo/frontend"
Package frontend implements the translation of WebAssembly to SSA IR using the ssa package.
Index ¶
- func FunctionIndexToFuncRef(idx wasm.Index) ssa.FuncRef
- func WasmTypeToSSAType(vt wasm.ValueType) ssa.Type
- type Compiler
Functions ¶
func FunctionIndexToFuncRef ¶
func WasmTypeToSSAType ¶
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 ¶
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.
Source Files ¶
- Version
- v1.5.0
- Published
- Aug 24, 2023
- Platform
- js/wasm
- Imports
- 10 packages
- Last checked
- 9 hours ago –
Tools for package owners.