]> Cypherpunks.ru repositories - gostls13.git/blob - src/cmd/compile/internal/typecheck/_builtin/runtime.go
cmd/compile: implement range over func
[gostls13.git] / src / cmd / compile / internal / typecheck / _builtin / runtime.go
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.
4
5 // NOTE: If you change this file you must run "go generate"
6 // to update builtin.go. This is not done automatically
7 // to avoid depending on having a working compiler binary.
8
9 //go:build ignore
10
11 package runtime
12
13 // emitted by compiler, not referred to by go programs
14
15 import "unsafe"
16
17 func newobject(typ *byte) *any
18 func mallocgc(size uintptr, typ *byte, needszero bool) unsafe.Pointer
19 func panicdivide()
20 func panicshift()
21 func panicmakeslicelen()
22 func panicmakeslicecap()
23 func throwinit()
24 func panicwrap()
25
26 func gopanic(interface{})
27 func gorecover(*int32) interface{}
28 func goschedguarded()
29
30 // Note: these declarations are just for wasm port.
31 // Other ports call assembly stubs instead.
32 func goPanicIndex(x int, y int)
33 func goPanicIndexU(x uint, y int)
34 func goPanicSliceAlen(x int, y int)
35 func goPanicSliceAlenU(x uint, y int)
36 func goPanicSliceAcap(x int, y int)
37 func goPanicSliceAcapU(x uint, y int)
38 func goPanicSliceB(x int, y int)
39 func goPanicSliceBU(x uint, y int)
40 func goPanicSlice3Alen(x int, y int)
41 func goPanicSlice3AlenU(x uint, y int)
42 func goPanicSlice3Acap(x int, y int)
43 func goPanicSlice3AcapU(x uint, y int)
44 func goPanicSlice3B(x int, y int)
45 func goPanicSlice3BU(x uint, y int)
46 func goPanicSlice3C(x int, y int)
47 func goPanicSlice3CU(x uint, y int)
48 func goPanicSliceConvert(x int, y int)
49
50 func printbool(bool)
51 func printfloat(float64)
52 func printint(int64)
53 func printhex(uint64)
54 func printuint(uint64)
55 func printcomplex(complex128)
56 func printstring(string)
57 func printpointer(any)
58 func printuintptr(uintptr)
59 func printiface(any)
60 func printeface(any)
61 func printslice(any)
62 func printnl()
63 func printsp()
64 func printlock()
65 func printunlock()
66
67 func concatstring2(*[32]byte, string, string) string
68 func concatstring3(*[32]byte, string, string, string) string
69 func concatstring4(*[32]byte, string, string, string, string) string
70 func concatstring5(*[32]byte, string, string, string, string, string) string
71 func concatstrings(*[32]byte, []string) string
72
73 func cmpstring(string, string) int
74 func intstring(*[4]byte, int64) string
75 func slicebytetostring(buf *[32]byte, ptr *byte, n int) string
76 func slicebytetostringtmp(ptr *byte, n int) string
77 func slicerunetostring(*[32]byte, []rune) string
78 func stringtoslicebyte(*[32]byte, string) []byte
79 func stringtoslicerune(*[32]rune, string) []rune
80 func slicecopy(toPtr *any, toLen int, fromPtr *any, fromLen int, wid uintptr) int
81
82 func decoderune(string, int) (retv rune, retk int)
83 func countrunes(string) int
84
85 // Non-empty-interface to non-empty-interface conversion.
86 func convI2I(typ *byte, itab *uintptr) (ret *uintptr)
87
88 // Convert non-interface type to the data word of a (empty or nonempty) interface.
89 func convT(typ *byte, elem *any) unsafe.Pointer
90
91 // Same as convT, for types with no pointers in them.
92 func convTnoptr(typ *byte, elem *any) unsafe.Pointer
93
94 // Specialized versions of convT for specific types.
95 // These functions take concrete types in the runtime. But they may
96 // be used for a wider range of types, which have the same memory
97 // layout as the parameter type. The compiler converts the
98 // to-be-converted type to the parameter type before calling the
99 // runtime function. This way, the call is ABI-insensitive.
100 func convT16(val uint16) unsafe.Pointer
101 func convT32(val uint32) unsafe.Pointer
102 func convT64(val uint64) unsafe.Pointer
103 func convTstring(val string) unsafe.Pointer
104 func convTslice(val []uint8) unsafe.Pointer
105
106 // interface type assertions x.(T)
107 func assertE2I(inter *byte, typ *byte) *byte
108 func assertE2I2(inter *byte, eface any) (ret any)
109 func assertI2I(inter *byte, tab *byte) *byte
110 func assertI2I2(inter *byte, iface any) (ret any)
111 func panicdottypeE(have, want, iface *byte)
112 func panicdottypeI(have, want, iface *byte)
113 func panicnildottype(want *byte)
114
115 // interface equality. Type/itab pointers are already known to be equal, so
116 // we only need to pass one.
117 func ifaceeq(tab *uintptr, x, y unsafe.Pointer) (ret bool)
118 func efaceeq(typ *uintptr, x, y unsafe.Pointer) (ret bool)
119
120 // defer in range over func
121 func deferrangefunc() interface{}
122
123 func fastrand() uint32
124
125 // *byte is really *runtime.Type
126 func makemap64(mapType *byte, hint int64, mapbuf *any) (hmap map[any]any)
127 func makemap(mapType *byte, hint int, mapbuf *any) (hmap map[any]any)
128 func makemap_small() (hmap map[any]any)
129 func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any)
130 func mapaccess1_fast32(mapType *byte, hmap map[any]any, key uint32) (val *any)
131 func mapaccess1_fast64(mapType *byte, hmap map[any]any, key uint64) (val *any)
132 func mapaccess1_faststr(mapType *byte, hmap map[any]any, key string) (val *any)
133 func mapaccess1_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any)
134 func mapaccess2(mapType *byte, hmap map[any]any, key *any) (val *any, pres bool)
135 func mapaccess2_fast32(mapType *byte, hmap map[any]any, key uint32) (val *any, pres bool)
136 func mapaccess2_fast64(mapType *byte, hmap map[any]any, key uint64) (val *any, pres bool)
137 func mapaccess2_faststr(mapType *byte, hmap map[any]any, key string) (val *any, pres bool)
138 func mapaccess2_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any, pres bool)
139 func mapassign(mapType *byte, hmap map[any]any, key *any) (val *any)
140 func mapassign_fast32(mapType *byte, hmap map[any]any, key uint32) (val *any)
141 func mapassign_fast32ptr(mapType *byte, hmap map[any]any, key unsafe.Pointer) (val *any)
142 func mapassign_fast64(mapType *byte, hmap map[any]any, key uint64) (val *any)
143 func mapassign_fast64ptr(mapType *byte, hmap map[any]any, key unsafe.Pointer) (val *any)
144 func mapassign_faststr(mapType *byte, hmap map[any]any, key string) (val *any)
145 func mapiterinit(mapType *byte, hmap map[any]any, hiter *any)
146 func mapdelete(mapType *byte, hmap map[any]any, key *any)
147 func mapdelete_fast32(mapType *byte, hmap map[any]any, key uint32)
148 func mapdelete_fast64(mapType *byte, hmap map[any]any, key uint64)
149 func mapdelete_faststr(mapType *byte, hmap map[any]any, key string)
150 func mapiternext(hiter *any)
151 func mapclear(mapType *byte, hmap map[any]any)
152
153 // *byte is really *runtime.Type
154 func makechan64(chanType *byte, size int64) (hchan chan any)
155 func makechan(chanType *byte, size int) (hchan chan any)
156 func chanrecv1(hchan <-chan any, elem *any)
157 func chanrecv2(hchan <-chan any, elem *any) bool
158 func chansend1(hchan chan<- any, elem *any)
159 func closechan(hchan any)
160
161 var writeBarrier struct {
162         enabled bool
163         pad     [3]byte
164         needed  bool
165         cgo     bool
166         alignme uint64
167 }
168
169 // *byte is really *runtime.Type
170 func typedmemmove(typ *byte, dst *any, src *any)
171 func typedmemclr(typ *byte, dst *any)
172 func typedslicecopy(typ *byte, dstPtr *any, dstLen int, srcPtr *any, srcLen int) int
173
174 func selectnbsend(hchan chan<- any, elem *any) bool
175 func selectnbrecv(elem *any, hchan <-chan any) (bool, bool)
176
177 func selectsetpc(pc *uintptr)
178 func selectgo(cas0 *byte, order0 *byte, pc0 *uintptr, nsends int, nrecvs int, block bool) (int, bool)
179 func block()
180
181 func makeslice(typ *byte, len int, cap int) unsafe.Pointer
182 func makeslice64(typ *byte, len int64, cap int64) unsafe.Pointer
183 func makeslicecopy(typ *byte, tolen int, fromlen int, from unsafe.Pointer) unsafe.Pointer
184 func growslice(oldPtr *any, newLen, oldCap, num int, et *byte) (ary []any)
185 func unsafeslicecheckptr(typ *byte, ptr unsafe.Pointer, len int64)
186 func panicunsafeslicelen()
187 func panicunsafeslicenilptr()
188 func unsafestringcheckptr(ptr unsafe.Pointer, len int64)
189 func panicunsafestringlen()
190 func panicunsafestringnilptr()
191
192 func mulUintptr(x, y uintptr) (uintptr, bool)
193
194 func memmove(to *any, frm *any, length uintptr)
195 func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
196 func memclrHasPointers(ptr unsafe.Pointer, n uintptr)
197
198 func memequal(x, y *any, size uintptr) bool
199 func memequal0(x, y *any) bool
200 func memequal8(x, y *any) bool
201 func memequal16(x, y *any) bool
202 func memequal32(x, y *any) bool
203 func memequal64(x, y *any) bool
204 func memequal128(x, y *any) bool
205 func f32equal(p, q unsafe.Pointer) bool
206 func f64equal(p, q unsafe.Pointer) bool
207 func c64equal(p, q unsafe.Pointer) bool
208 func c128equal(p, q unsafe.Pointer) bool
209 func strequal(p, q unsafe.Pointer) bool
210 func interequal(p, q unsafe.Pointer) bool
211 func nilinterequal(p, q unsafe.Pointer) bool
212
213 func memhash(x *any, h uintptr, size uintptr) uintptr
214 func memhash0(p unsafe.Pointer, h uintptr) uintptr
215 func memhash8(p unsafe.Pointer, h uintptr) uintptr
216 func memhash16(p unsafe.Pointer, h uintptr) uintptr
217 func memhash32(p unsafe.Pointer, h uintptr) uintptr
218 func memhash64(p unsafe.Pointer, h uintptr) uintptr
219 func memhash128(p unsafe.Pointer, h uintptr) uintptr
220 func f32hash(p *any, h uintptr) uintptr
221 func f64hash(p *any, h uintptr) uintptr
222 func c64hash(p *any, h uintptr) uintptr
223 func c128hash(p *any, h uintptr) uintptr
224 func strhash(a *any, h uintptr) uintptr
225 func interhash(p *any, h uintptr) uintptr
226 func nilinterhash(p *any, h uintptr) uintptr
227
228 // only used on 32-bit
229 func int64div(int64, int64) int64
230 func uint64div(uint64, uint64) uint64
231 func int64mod(int64, int64) int64
232 func uint64mod(uint64, uint64) uint64
233 func float64toint64(float64) int64
234 func float64touint64(float64) uint64
235 func float64touint32(float64) uint32
236 func int64tofloat64(int64) float64
237 func int64tofloat32(int64) float32
238 func uint64tofloat64(uint64) float64
239 func uint64tofloat32(uint64) float32
240 func uint32tofloat64(uint32) float64
241
242 func complex128div(num complex128, den complex128) (quo complex128)
243
244 func getcallerpc() uintptr
245 func getcallersp() uintptr
246
247 // race detection
248 func racefuncenter(uintptr)
249 func racefuncexit()
250 func raceread(uintptr)
251 func racewrite(uintptr)
252 func racereadrange(addr, size uintptr)
253 func racewriterange(addr, size uintptr)
254
255 // memory sanitizer
256 func msanread(addr, size uintptr)
257 func msanwrite(addr, size uintptr)
258 func msanmove(dst, src, size uintptr)
259
260 // address sanitizer
261 func asanread(addr, size uintptr)
262 func asanwrite(addr, size uintptr)
263
264 func checkptrAlignment(unsafe.Pointer, *byte, uintptr)
265 func checkptrArithmetic(unsafe.Pointer, []unsafe.Pointer)
266
267 func libfuzzerTraceCmp1(uint8, uint8, uint)
268 func libfuzzerTraceCmp2(uint16, uint16, uint)
269 func libfuzzerTraceCmp4(uint32, uint32, uint)
270 func libfuzzerTraceCmp8(uint64, uint64, uint)
271 func libfuzzerTraceConstCmp1(uint8, uint8, uint)
272 func libfuzzerTraceConstCmp2(uint16, uint16, uint)
273 func libfuzzerTraceConstCmp4(uint32, uint32, uint)
274 func libfuzzerTraceConstCmp8(uint64, uint64, uint)
275 func libfuzzerHookStrCmp(string, string, uint)
276 func libfuzzerHookEqualFold(string, string, uint)
277
278 func addCovMeta(p unsafe.Pointer, len uint32, hash [16]byte, pkpath string, pkgId int, cmode uint8, cgran uint8) uint32
279
280 // architecture variants
281 var x86HasPOPCNT bool
282 var x86HasSSE41 bool
283 var x86HasFMA bool
284 var armHasVFPv4 bool
285 var arm64HasATOMICS bool
286
287 func asanregisterglobals(unsafe.Pointer, uintptr)