Documentation ¶
Index ¶
- Constants
- Variables
- func AlgType(t *types.Type) types.AlgKind
- func CollectPTabs()
- func CompileITabs()
- func CountTabs() (numPTabs, numITabs 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(t, itype *types.Type) *ir.AddrExpr
- func ITabSym(it *obj.LSym, offset int64) *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 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 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 CompileITabs ¶
func CompileITabs()
for each itabEntry, gather the methods on the concrete type that implement the interface
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 ITabSym ¶
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 ¶
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 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.