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 SignatureForListener ¶ added in v1.6.0
SignatureForListener returns the signatures for the listener functions.
func SignatureForWasmFunctionType ¶ added in v1.6.0
func SignatureForWasmFunctionType(typ *wasm.FunctionType) ssa.Signature
SignatureForWasmFunctionType returns the ssa.Signature for the given wasm.FunctionType.
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, ensureTermination bool, listenerOn bool, sourceInfo bool) *Compiler
NewFrontendCompiler returns a frontend Compiler.
func (*Compiler) Init ¶
func (c *Compiler) Init(idx, typIndex wasm.Index, typ *wasm.FunctionType, localTypes []wasm.ValueType, body []byte, needListener bool, bodyOffsetInCodeSection uint64)
Init initializes the state of frontendCompiler and make it ready for a next function.
func (*Compiler) LowerToSSA ¶
func (c *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.