abi

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package abi contains target-independent lowering for LLGo's internal ABI.

Index

Constants

View Source
const (
	// MaxStackVarSize matches cmd/compile's default limit for explicitly
	// declared variables. Values larger than this must not live on LLGo's
	// fixed native stack.
	MaxStackVarSize uint64 = 128 * 1024
	// MaxImplicitStackVarSize matches cmd/compile's default limit for
	// compiler-generated temporaries.
	MaxImplicitStackVarSize uint64 = 64 * 1024
	// MinWasmAggregateCopySize is the point at which Wasm aggregate loads and
	// stores are lowered to memory intrinsics to avoid LLVM scalarization.
	MinWasmAggregateCopySize uint64 = 4 * 1024
)

Variables

This section is empty.

Functions

func LowerLargeAggregates

func LowerLargeAggregates(td llvm.TargetData, m llvm.Module, config AggregateLoweringConfig)

LowerLargeAggregates converts oversized direct aggregate returns and copies to indirect memory operations before target-specific C ABI lowering runs.

func LowerWasmAggregateCopies added in v1.0.4

func LowerWasmAggregateCopies(td llvm.TargetData, m llvm.Module, config AggregateLoweringConfig) int

LowerWasmAggregateCopies applies the same snapshot lowering to copies of at least 4 KiB. LLVM scalarizes these too, notably in reflection's by-value wrappers. Return types and the native stack/return ABI limits are unchanged.

func PopGCRootFrame added in v1.0.4

func PopGCRootFrame(m llvm.Module, fn llvm.Value, frame GCRootFrame)

PopGCRootFrame restores the chain only when this frame is its actual head. Discarded entries replayed by SJLJ may return without having linked a frame.

Types

type AggregateLoweringConfig added in v1.0.4

type AggregateLoweringConfig struct {
	GoWordSize int
	GCRoots    bool
	Wasm       bool
}

AggregateLoweringConfig describes the Go runtime ABI used by lowering-created allocations and roots. GoWordSize can exceed the physical Wasm address size.

type GCRootFrame added in v1.0.4

type GCRootFrame struct {
	Frame, Prev llvm.Value
	Slots       []llvm.Value
	// contains filtered or unexported fields
}

GCRootFrame is the shadow-frame layout used by temporaries introduced after frontend root planning.

func NewGCRootFrame added in v1.0.4

func NewGCRootFrame(m llvm.Module, fn llvm.Value, count, pointerSize, goWordSize int, wasm bool) GCRootFrame

NewGCRootFrame adds an outer frame before the existing entry. When frames are nested by successive lowering passes, pop them in the reverse order.

func (GCRootFrame) StorePointer added in v1.0.4

func (frame GCRootFrame) StorePointer(b llvm.Builder, slot, ptr llvm.Value)

StorePointer publishes a physical address in the Go pointer storage format.

Jump to

Keyboard shortcuts

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