Documentation
¶
Overview ¶
Package abi contains target-independent lowering for LLGo's internal ABI.
Index ¶
- Constants
- func LowerLargeAggregates(td llvm.TargetData, m llvm.Module, config AggregateLoweringConfig)
- func LowerWasmAggregateCopies(td llvm.TargetData, m llvm.Module, config AggregateLoweringConfig) int
- func PopGCRootFrame(m llvm.Module, fn llvm.Value, frame GCRootFrame)
- type AggregateLoweringConfig
- type GCRootFrame
Constants ¶
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
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.