reflectdata

package standard library
go1.18.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BUCKETSIZE  = 8
	MAXKEYSIZE  = 128
	MAXELEMSIZE = 128
)

Builds a type representing a Bucket structure for the given map type. This type is not visible to users - we include only enough information to generate a correct GC program for it. Make sure this stays in sync with runtime/map.go.

Variables

View Source
var AfterGlobalEscapeAnalysis bool

AfterGlobalEscapeAnalysis tracks whether package gc has already performed the main, global escape analysis pass. If so, methodWrapper takes responsibility for escape analyzing any generated wrappers.

View Source
var ZeroSize int64

Functions

func AlgType

func AlgType(t *types.Type) types.AlgKind

AlgType returns the fixed-width AMEMxx variants instead of the general AMEM kind when possible.

func CollectPTabs

func CollectPTabs()

func CountPTabs added in go1.18

func CountPTabs() int

func EqInterface

func EqInterface(s, t ir.Node) (eqtab *ir.BinaryExpr, eqdata *ir.CallExpr)

EqInterface returns the nodes

s.tab == t.tab (or s.typ == t.typ, as appropriate)

and

ifaceeq(s.tab, s.data, t.data) (or efaceeq(s.typ, s.data, t.data), as appropriate)

which can be used to construct interface equality comparison. eqtab must be evaluated before eqdata, and shortcircuiting is required.

func EqString

func EqString(s, t ir.Node) (eqlen *ir.BinaryExpr, eqmem *ir.CallExpr)

EqString returns the nodes

len(s) == len(t)

and

memequal(s.ptr, t.ptr, len(s))

which can be used to construct string equality comparison. eqlen must be evaluated before eqmem, and shortcircuiting is required.

func GCSym

func GCSym(t *types.Type) (lsym *obj.LSym, useGCProg bool, ptrdata int64)

GCSym returns a data symbol containing GC information for type t, along with a boolean reporting whether the UseGCProg bit should be set in the type kind, and the ptrdata field to record in the reflect type information. GCSym may be called in concurrent backend, so it does not emit the symbol content.

func ITabAddr

func ITabAddr(typ, iface *types.Type) *ir.AddrExpr

ITabAddr returns an expression representing a pointer to the itab for concrete type typ implementing interface iface.

func ITabLsym added in go1.18

func ITabLsym(typ, iface *types.Type) *obj.LSym

ITabLsym returns the LSym representing the itab for concrete type typ implementing interface iface. A dummy tab will be created in the unusual case where typ doesn't implement iface. Normally, this wouldn't happen, because the typechecker would have reported a compile-time error. This situation can only happen when the destination type of a type assert or a type in a type switch is parameterized, so it may sometimes, but not always, be a type that can't implement the specified interface.

func InterfaceMethodOffset

func InterfaceMethodOffset(ityp *types.Type, i int64) int64

InterfaceMethodOffset returns the offset of the i-th method in the interface type descriptor, ityp.

func MapBucketType

func MapBucketType(t *types.Type) *types.Type

MapBucketType makes the map bucket type given the type of the map.

func MapIterType

func MapIterType(t *types.Type) *types.Type

MapIterType builds a type representing an Hiter structure for the given map type. Make sure this stays in sync with runtime/map.go.

func MapType

func MapType(t *types.Type) *types.Type

MapType builds a type representing a Hmap structure for the given map type. Make sure this stays in sync with runtime/map.go.

func MarkTypeUsedInInterface

func MarkTypeUsedInInterface(t *types.Type, from *obj.LSym)

MarkTypeUsedInInterface marks that type t is converted to an interface. This information is used in the linker in dead method elimination.

func MarkUsedIfaceMethod

func MarkUsedIfaceMethod(n *ir.CallExpr)

MarkUsedIfaceMethod marks that an interface method is used in the current function. n is OCALLINTER node.

func NeedEmit added in go1.18

func NeedEmit(typ *types.Type) bool

NeedEmit reports whether typ is a type that we need to emit code for (e.g., runtime type descriptors, method wrappers).

func NeedRuntimeType

func NeedRuntimeType(t *types.Type)

NeedRuntimeType ensures that a runtime type descriptor is emitted for t.

func TrackSym

func TrackSym(t *types.Type, f *types.Field) *obj.LSym

TrackSym returns the symbol for tracking use of field/method f, assumed to be a member of struct/interface type t.

func TypeLinksym

func TypeLinksym(t *types.Type) *obj.LSym

func TypeLinksymLookup

func TypeLinksymLookup(name string) *obj.LSym

func TypeLinksymPrefix

func TypeLinksymPrefix(prefix string, t *types.Type) *obj.LSym

func TypePtr

func TypePtr(t *types.Type) *ir.AddrExpr

func TypeSym

func TypeSym(t *types.Type) *types.Sym

func TypeSymPrefix

func TypeSymPrefix(prefix string, t *types.Type) *types.Sym

func WriteBasicTypes

func WriteBasicTypes()

func WriteImportStrings

func WriteImportStrings()

func WriteRuntimeTypes

func WriteRuntimeTypes()

func WriteTabs

func WriteTabs()

func ZeroAddr

func ZeroAddr(size int64) ir.Node

ZeroAddr returns the address of a symbol with at least size bytes of zeros.

Types

This section is empty.

Jump to

Keyboard shortcuts

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