runtime: scan register backing store on ia64
[official-gcc.git] / libgo / go / runtime / type.go
blob6788f2425e1323066746b0c496c50fb579f499f4
1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Runtime type representation.
7 package runtime
9 import "unsafe"
11 type _type struct {
12 size uintptr
13 ptrdata uintptr
14 hash uint32
15 kind uint8
16 align int8
17 fieldAlign uint8
18 _ uint8
20 hashfn func(unsafe.Pointer, uintptr) uintptr
21 equalfn func(unsafe.Pointer, unsafe.Pointer) bool
23 gcdata *byte
24 string *string
25 *uncommontype
26 ptrToThis *_type
29 // Return whether two type descriptors are equal.
30 // This is gccgo-specific, as gccgo, unlike gc, permits multiple
31 // independent descriptors for a single type.
32 func eqtype(t1, t2 *_type) bool {
33 switch {
34 case t1 == t2:
35 return true
36 case t1 == nil || t2 == nil:
37 return false
38 case t1.kind != t2.kind || t1.hash != t2.hash:
39 return false
40 default:
41 return *t1.string == *t2.string
45 type method struct {
46 name *string
47 pkgPath *string
48 mtyp *_type
49 typ *_type
50 tfn unsafe.Pointer
53 type uncommontype struct {
54 name *string
55 pkgPath *string
56 methods []method
59 type imethod struct {
60 name *string
61 pkgPath *string
62 typ *_type
65 type interfacetype struct {
66 typ _type
67 methods []imethod
70 type maptype struct {
71 typ _type
72 key *_type
73 elem *_type
74 bucket *_type // internal type representing a hash bucket
75 hmap *_type // internal type representing a hmap
76 keysize uint8 // size of key slot
77 indirectkey bool // store ptr to key instead of key itself
78 valuesize uint8 // size of value slot
79 indirectvalue bool // store ptr to value instead of value itself
80 bucketsize uint16 // size of bucket
81 reflexivekey bool // true if k==k for all keys
82 needkeyupdate bool // true if we need to update key on an overwrite
85 type arraytype struct {
86 typ _type
87 elem *_type
88 slice *_type
89 len uintptr
92 type chantype struct {
93 typ _type
94 elem *_type
95 dir uintptr
98 type slicetype struct {
99 typ _type
100 elem *_type
103 type functype struct {
104 typ _type
105 dotdotdot bool
106 in []*_type
107 out []*_type
110 type ptrtype struct {
111 typ _type
112 elem *_type
115 type structfield struct {
116 name *string // nil for embedded fields
117 pkgPath *string // nil for exported Names; otherwise import path
118 typ *_type // type of field
119 tag *string // nil if no tag
120 offset uintptr // byte offset of field within struct
123 type structtype struct {
124 typ _type
125 fields []structfield