gen

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VectorOffsetMemoryAddr    = -4 * obj.Word
	VectorOffsetCurrentMemory = -3 * obj.Word
	VectorOffsetGrowMemory    = -2 * obj.Word
	VectorOffsetTrapHandler   = -1 * obj.Word
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block added in v0.32.0

type Block struct {
	Suspension bool
	Deadend    bool
}

type BranchTable added in v0.4.0

type BranchTable struct {
	Addr       int32
	Targets    []*BranchTarget
	StackDepth int // -1 indicates common depth among all targets
}

type BranchTarget added in v0.4.0

type BranchTarget struct {
	Label      link.L
	StackDepth int
	ValueType  wa.Type
	FuncEnd    bool

	Block Block
}

type Breakpoint added in v0.32.0

type Breakpoint struct {
	Set bool // Set by the compiler if it implemented the breakpoint.
}

Breakpoint information, for debugger support.

type Debugger added in v0.32.0

type Debugger struct {
	// Breakpoints are WebAssembly code offsets.  They can be obtained from
	// DWARF debug info.
	Breakpoints map[uint32]Breakpoint

	CodeOffset int64
}

func (*Debugger) SourceAddr added in v0.34.0

func (d *Debugger) SourceAddr(load *loader.L) uint32

type Func added in v0.4.0

type Func struct {
	Prog // Initialized by GenProgram, preserved by GenFunction

	Regs regalloc.Allocator

	ResultType wa.Type
	LocalTypes []wa.Type
	NumParams  int
	NumLocals  int // The non-param ones
	NumExtra   int // Library function's duplicated arguments etc.

	Operands          []operand.O
	FrameBase         int // Number of (stack) operands belonging to parent blocks
	NumStableOperands int
	StackDepth        int // The dynamic entries after locals
	MaxStackDepth     int

	BranchTargets []*BranchTarget
	BranchTables  []BranchTable

	AtomicCallStubs bool
}

func (*Func) LocalOffset added in v0.32.0

func (f *Func) LocalOffset(index int) int32

func (*Func) MapCallAddr added in v0.4.0

func (f *Func) MapCallAddr(retAddr int32)

func (*Func) StackValueConsumed added in v0.32.0

func (f *Func) StackValueConsumed()

StackValueConsumed updates the virtual stack pointer on behalf of MacroAssembler when it changes the physical stack pointer.

func (*Func) ValueBecameUnreachable added in v0.32.0

func (f *Func) ValueBecameUnreachable(x operand.O)

ValueBecameUnreachable keeps the state consistent when an operand will not be operated on (because it was popped on an unreachable code path).

type Prog added in v0.4.0

type Prog struct {
	Module                  *module.M
	Text                    code.Buf
	Map                     obj.ObjectMapper
	FuncLinks               []link.FuncL
	TrapLinks               [trap.NumTraps]link.L
	TrapLinkRewindSuspended [program.NumTrapLinkRewindSuspended]link.L
	TrapLinkTruncOverflow   [program.NumTrapLinkTruncOverflow]link.L
	LastCallAddr            int32 // Needed only by arm64 backend.

	ImportContext *module.Library // Set during import function generation.

	DebugMap obj.DebugObjectMapper
	Debugger Debugger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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