reflectdata

package standard library
go1.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 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 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 CompileITabs

func CompileITabs()

for each itabEntry, gather the methods on the concrete type that implement the interface

func CountTabs

func CountTabs() (numPTabs, numITabs 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(t, itype *types.Type) *ir.AddrExpr

func ITabSym

func ITabSym(it *obj.LSym, offset int64) *obj.LSym

ITabSym uses the information gathered in CompileITabs to de-virtualize interface methods. Since this is called by the SSA backend, it shouldn't generate additional Nodes, Syms, etc.

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 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