abi

package standard library
go1.17.6 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// IntArgRegs is the number of registers dedicated
	// to passing integer argument values. Result registers are identical
	// to argument registers, so this number is used for those too.
	IntArgRegs = 0

	// FloatArgRegs is the number of registers dedicated
	// to passing floating-point argument values. Result registers are
	// identical to argument registers, so this number is used for
	// those too.
	FloatArgRegs = 0

	// EffectiveFloatRegSize describes the width of floating point
	// registers on the current platform from the ABI's perspective.
	//
	// Since Go only supports 32-bit and 64-bit floating point primitives,
	// this number should be either 0, 4, or 8. 0 indicates no floating
	// point registers for the ABI or that floating point values will be
	// passed via the softfloat ABI.
	//
	// For platforms that support larger floating point register widths,
	// such as x87's 80-bit "registers" (not that we support x87 currently),
	// use 8.
	EffectiveFloatRegSize = 0
)

Variables

This section is empty.

Functions

func FuncPCABI0

func FuncPCABI0(f interface{}) uintptr

FuncPCABI0 returns the entry PC of the function f, which must be a direct reference of a function defined as ABI0. Otherwise it is a compile-time error.

Implemented as a compile intrinsic.

func FuncPCABIInternal

func FuncPCABIInternal(f interface{}) uintptr

FuncPCABIInternal returns the entry PC of the function f. If f is a direct reference of a function, it must be defined as ABIInternal. Otherwise it is a compile-time error. If f is not a direct reference of a defined function, it assumes that f is a func value. Otherwise the behavior is undefined.

Implemented as a compile intrinsic.

Types

type IntArgRegBitmap

type IntArgRegBitmap [(IntArgRegs + 7) / 8]uint8

IntArgRegBitmap is a bitmap large enough to hold one bit per integer argument/return register.

func (*IntArgRegBitmap) Get

func (b *IntArgRegBitmap) Get(i int) bool

Get returns whether the i'th bit of the bitmap is set.

nosplit because it's called in extremely sensitive contexts, like on the reflectcall return path.

func (*IntArgRegBitmap) Set

func (b *IntArgRegBitmap) Set(i int)

Set sets the i'th bit of the bitmap to 1.

type RegArgs

type RegArgs struct {
	Ints   [IntArgRegs]uintptr  // untyped integer registers
	Floats [FloatArgRegs]uint64 // untyped float registers

	// Ptrs is a space that duplicates Ints but with pointer type,
	// used to make pointers passed or returned  in registers
	// visible to the GC by making the type unsafe.Pointer.
	Ptrs [IntArgRegs]unsafe.Pointer

	// ReturnIsPtr is a bitmap that indicates which registers
	// contain or will contain pointers on the return path from
	// a reflectcall. The i'th bit indicates whether the i'th
	// register contains or will contain a valid Go pointer.
	ReturnIsPtr IntArgRegBitmap
}

RegArgs is a struct that has space for each argument and return value register on the current architecture.

Assembly code knows the layout of the first two fields of RegArgs.

RegArgs also contains additional space to hold pointers when it may not be safe to keep them only in the integer register space otherwise.

func (*RegArgs) Dump added in go1.17.6

func (r *RegArgs) Dump()

Jump to

Keyboard shortcuts

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