Documentation ¶
Index ¶
- Constants
- Variables
- func AlgType(t *types.Type) types.AlgKind
- func CollectPTabs()
- func CountPTabs() int
- func EqInterface(s, t ir.Node) (eqtab *ir.BinaryExpr, eqdata *ir.CallExpr)
- func EqString(s, t ir.Node) (eqlen *ir.BinaryExpr, eqmem *ir.CallExpr)
- func GCSym(t *types.Type) (lsym *obj.LSym, useGCProg bool, ptrdata int64)
- func ITabAddr(typ, iface *types.Type) *ir.AddrExpr
- func ITabLsym(typ, iface *types.Type) *obj.LSym
- func InterfaceMethodOffset(ityp *types.Type, i int64) int64
- func MapBucketType(t *types.Type) *types.Type
- func MapIterType(t *types.Type) *types.Type
- func MapType(t *types.Type) *types.Type
- 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 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 TypePtr(t *types.Type) *ir.AddrExpr
- func TypeSym(t *types.Type) *types.Sym
- func TypeSymPrefix(prefix string, t *types.Type) *types.Sym
- func WriteBasicTypes()
- func WriteImportStrings()
- func WriteRuntimeTypes()
- func WriteTabs()
- func ZeroAddr(size int64) ir.Node
Constants ¶
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 ¶
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.
var ZeroSize int64
Functions ¶
func AlgType ¶
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 ¶
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 ¶
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 ¶
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 ¶
ITabAddr returns an expression representing a pointer to the itab for concrete type typ implementing interface iface.
func ITabLsym ¶ added in go1.18
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 ¶
InterfaceMethodOffset returns the offset of the i-th method in the interface type descriptor, ityp.
func MapBucketType ¶
MapBucketType makes the map bucket type given the type of the map.
func MapIterType ¶
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 ¶
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 ¶
MarkTypeUsedInInterface marks that type t is converted to an interface. This information is used in the linker in dead method elimination.
func MarkUsedIfaceMethod ¶
MarkUsedIfaceMethod marks that an interface method is used in the current function. n is OCALLINTER node.
func NeedEmit ¶ added in go1.18
NeedEmit reports whether typ is a type that we need to emit code for (e.g., runtime type descriptors, method wrappers).
func NeedRuntimeType ¶
NeedRuntimeType ensures that a runtime type descriptor is emitted for t.
func TrackSym ¶
TrackSym returns the symbol for tracking use of field/method f, assumed to be a member of struct/interface type t.
func TypeLinksymLookup ¶
func WriteBasicTypes ¶
func WriteBasicTypes()
func WriteImportStrings ¶
func WriteImportStrings()
func WriteRuntimeTypes ¶
func WriteRuntimeTypes()
Types ¶
This section is empty.