wag: github.com/tsavola/wag/internal/gen Index | Files | Directories

package gen

import "github.com/tsavola/wag/internal/gen"

Index

Package Files

debugger.go func.go prog.go

Constants

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

type Block Uses

type Block struct {
    Suspension bool
    WeakDead   bool // Like deadend state, but must not affect portable ABI.
}

type BranchTable Uses

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

type BranchTarget Uses

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

    Block Block
}

type Breakpoint Uses

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

Breakpoint information, for debugger support.

type Debugger Uses

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

    Source     Teller
    CodeOffset int64
}

type Func Uses

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

    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 Uses

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

func (*Func) MapCallAddr Uses

func (f *Func) MapCallAddr(retAddr int32)

func (*Func) MapTrapAddr Uses

func (f *Func) MapTrapAddr(retAddr int32)

func (*Func) StackValueConsumed Uses

func (f *Func) StackValueConsumed()

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

func (*Func) ValueBecameUnreachable Uses

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 Uses

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 arm backend.

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

    DebugMap obj.DebugObjectMapper
    Debugger Debugger
}

type Teller Uses

type Teller interface {
    Tell() int64
}

Directories

PathSynopsis
atomic
codegen
condition
debug
link
operand
reg
regalloc
rodata
storage

Package gen imports 13 packages (graph) and is imported by 5 packages. Updated 2020-10-29. Refresh now. Tools for package owners.