...

Package reflectdata

import "cmd/compile/internal/reflectdata"
Overview
Index

Overview ▾

Index ▾

Constants
Variables
func AlgType(t *types.Type) types.AlgKind
func AppendElemRType(pos src.XPos, n *ir.CallExpr) ir.Node
func CompareRType(pos src.XPos, n *ir.BinaryExpr) ir.Node
func ConvIfaceSrcRType(pos src.XPos, n *ir.ConvExpr) ir.Node
func ConvIfaceTypeWord(pos src.XPos, n *ir.ConvExpr) ir.Node
func CopyElemRType(pos src.XPos, n *ir.BinaryExpr) ir.Node
func DeleteMapRType(pos src.XPos, n *ir.CallExpr) ir.Node
func EqFor(t *types.Type) (ir.Node, bool)
func GCSym(t *types.Type) (lsym *obj.LSym, useGCProg bool, ptrdata int64)
func ITabAddrAt(pos src.XPos, typ, iface *types.Type) *ir.AddrExpr
func ITabLsym(typ, iface *types.Type) *obj.LSym
func IndexMapRType(pos src.XPos, n *ir.IndexExpr) ir.Node
func InterfaceMethodOffset(ityp *types.Type, i int64) int64
func MakeChanRType(pos src.XPos, n *ir.MakeExpr) ir.Node
func MakeMapRType(pos src.XPos, n *ir.MakeExpr) ir.Node
func MakeSliceElemRType(pos src.XPos, n *ir.MakeExpr) ir.Node
func MapBucketType(t *types.Type) *types.Type
func MapIterType() *types.Type
func MapType() *types.Type
func MarkTypeSymUsedInInterface(tsym *obj.LSym, from *obj.LSym)
func MarkTypeUsedInInterface(t *types.Type, from *obj.LSym)
func MarkUsedIfaceMethod(n *ir.CallExpr)
func NeedEmit(typ *types.Type) bool
func NeedRuntimeType(t *types.Type)
func RangeMapRType(pos src.XPos, n *ir.RangeStmt) ir.Node
func TrackSym(t *types.Type, f *types.Field) *obj.LSym
func TypeLinksym(t *types.Type) *obj.LSym
func TypeLinksymLookup(name string) *obj.LSym
func TypeLinksymPrefix(prefix string, t *types.Type) *obj.LSym
func TypePtrAt(pos src.XPos, t *types.Type) *ir.AddrExpr
func TypeSym(t *types.Type) *types.Sym
func TypeSymPrefix(prefix string, t *types.Type) *types.Sym
func UnsafeSliceElemRType(pos src.XPos, n *ir.BinaryExpr) ir.Node
func WriteBasicTypes()
func WriteGCSymbols()
func WritePluginTable()
func WriteRuntimeTypes()
func ZeroAddr(size int64) ir.Node

Package files

alg.go helpers.go reflect.go

Constants

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.

A "bucket" is a "struct" {
      tophash [BUCKETSIZE]uint8
      keys [BUCKETSIZE]keyType
      elems [BUCKETSIZE]elemType
      overflow *bucket
    }
const (
    BUCKETSIZE  = abi.MapBucketCount
    MAXKEYSIZE  = abi.MapMaxKeyBytes
    MAXELEMSIZE = abi.MapMaxElemBytes
)

Variables

var ZeroSize int64

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 AppendElemRType

func AppendElemRType(pos src.XPos, n *ir.CallExpr) ir.Node

AppendElemRType asserts that n is an "append" operation, and returns an expression that yields the *runtime._type value representing the result slice type's element type.

func CompareRType

func CompareRType(pos src.XPos, n *ir.BinaryExpr) ir.Node

CompareRType asserts that n is a comparison (== or !=) operation between expressions of interface and non-interface type, and returns an expression that yields the *runtime._type value representing the non-interface type.

func ConvIfaceSrcRType

func ConvIfaceSrcRType(pos src.XPos, n *ir.ConvExpr) ir.Node

ConvIfaceSrcRType asserts that n is a conversion from non-interface type to interface type, and returns an expression that yields the *runtime._type for copying the convertee value to the heap.

func ConvIfaceTypeWord

func ConvIfaceTypeWord(pos src.XPos, n *ir.ConvExpr) ir.Node

ConvIfaceTypeWord asserts that n is conversion to interface type, and returns an expression that yields the *runtime._type or *runtime.itab value necessary for implementing the conversion.

func CopyElemRType

func CopyElemRType(pos src.XPos, n *ir.BinaryExpr) ir.Node

CopyElemRType asserts that n is a "copy" operation, and returns an expression that yields the *runtime._type value representing the destination slice type's element type.

func DeleteMapRType

func DeleteMapRType(pos src.XPos, n *ir.CallExpr) ir.Node

DeleteMapRType asserts that n is a "delete" operation, and returns an expression that yields the *runtime._type value representing the map type.

func EqFor

func EqFor(t *types.Type) (ir.Node, bool)

EqFor returns ONAME node represents type t's equal function, and a boolean to indicates whether a length needs to be passed when calling the function.

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 ITabAddrAt

func ITabAddrAt(pos src.XPos, typ, iface *types.Type) *ir.AddrExpr

ITabAddrAt returns an expression that evaluates to the *runtime.itab value for concrete type typ implementing interface iface.

func ITabLsym

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 IndexMapRType

func IndexMapRType(pos src.XPos, n *ir.IndexExpr) ir.Node

IndexMapRType asserts that n is a map index operation, and returns an expression that yields the *runtime._type value representing the map type.

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 MakeChanRType

func MakeChanRType(pos src.XPos, n *ir.MakeExpr) ir.Node

MakeChanRType asserts that n is a "make" operation for a channel type, and returns an expression that yields the *runtime._type value representing that channel type.

func MakeMapRType

func MakeMapRType(pos src.XPos, n *ir.MakeExpr) ir.Node

MakeMapRType asserts that n is a "make" operation for a map type, and returns an expression that yields the *runtime._type value representing that map type.

func MakeSliceElemRType

func MakeSliceElemRType(pos src.XPos, n *ir.MakeExpr) ir.Node

MakeSliceElemRType asserts that n is a "make" operation for a slice type, and returns an expression that yields the *runtime._type value representing that slice type's element type.

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() *types.Type

MapIterType returns a type interchangeable with runtime.hiter. Make sure this stays in sync with runtime/map.go.

func MapType

func MapType() *types.Type

MapType returns a type interchangeable with runtime.hmap. Make sure this stays in sync with runtime/map.go.

func MarkTypeSymUsedInInterface

func MarkTypeSymUsedInInterface(tsym *obj.LSym, from *obj.LSym)

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

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 RangeMapRType

func RangeMapRType(pos src.XPos, n *ir.RangeStmt) ir.Node

RangeMapRType asserts that n is a "range" loop over a map value, and returns an expression that yields the *runtime._type value representing that map type.

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 TypePtrAt

func TypePtrAt(pos src.XPos, t *types.Type) *ir.AddrExpr

TypePtrAt returns an expression that evaluates to the *runtime._type value for t.

func TypeSym

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

func TypeSymPrefix

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

func UnsafeSliceElemRType

func UnsafeSliceElemRType(pos src.XPos, n *ir.BinaryExpr) ir.Node

UnsafeSliceElemRType asserts that n is an "unsafe.Slice" operation, and returns an expression that yields the *runtime._type value representing the result slice type's element type.

func WriteBasicTypes

func WriteBasicTypes()

func WriteGCSymbols

func WriteGCSymbols()

func WritePluginTable

func WritePluginTable()

func WriteRuntimeTypes

func WriteRuntimeTypes()

func ZeroAddr

func ZeroAddr(size int64) ir.Node

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