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 ¶
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.
Click to show internal directories.
Click to hide internal directories.