Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateWasmCode ¶
func SerializeSSA ¶
SerializeSSA emits a standalone WAT module from a typed SSA graph. Supports primitive numeric/boolean values, canonical if/phi control flow, and structured while loops (back edges produced by lowerWhile in ssa.go). Unsupported graph shapes return an error instead of falling back silently.
func SerializeSSAProgram ¶
SerializeSSAProgram emits a standalone WAT module containing one function per entry in functions plus an exported "main" entrypoint for entry. Calls between functions (including recursion) are resolved by name via ir.OpCall. With no functions, this produces byte-identical output to SerializeSSA(entry).
func ValidateWAT ¶
ValidateWAT parses and type-checks the folded instruction subset emitted by this backend. External tools remain the authority for the complete WAT grammar, but malformed instructions cannot pass merely because parentheses happen to balance.
Types ¶
type Function ¶
Function is one named, typed function ready for multi-function Wasm program serialization via SerializeSSAProgram. Graph is produced by ir.LowerSSAFunction from the same Params.
type NativeLayout ¶
type NativeLayout struct {
ValueType string
Size uint64
Align uint64
Indirect bool
FieldOffsets map[string]uint64
}
NativeLayout is the representation selected by the Wasm backend for a typed HowlFrame value. Aggregate values are represented by a linear-memory pointer until Wasm memory access/code generation is added for them.