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// +build ignore
10
11package runtime
12
13// emitted by compiler, not referred to by go programs
14
15import "unsafe"
16
17func newobject(typ *byte) *any
18func panicindex()
19func panicslice()
20func panicdivide()
21func throwinit()
22func panicwrap()
23
24func gopanic(interface{})
25func gorecover(*int32) interface{}
26func goschedguarded()
27
28func printbool(bool)
29func printfloat(float64)
30func printint(int64)
31func printhex(uint64)
32func printuint(uint64)
33func printcomplex(complex128)
34func printstring(string)
35func printpointer(any)
36func printiface(any)
37func printeface(any)
38func printslice(any)
39func printnl()
40func printsp()
41func printlock()
42func printunlock()
43
44func concatstring2(*[32]byte, string, string) string
45func concatstring3(*[32]byte, string, string, string) string
46func concatstring4(*[32]byte, string, string, string, string) string
47func concatstring5(*[32]byte, string, string, string, string, string) string
48func concatstrings(*[32]byte, []string) string
49
50func cmpstring(string, string) int
51func eqstring(string, string) bool
52func intstring(*[4]byte, int64) string
53func slicebytetostring(*[32]byte, []byte) string
54func slicebytetostringtmp([]byte) string
55func slicerunetostring(*[32]byte, []rune) string
56func stringtoslicebyte(*[32]byte, string) []byte
57func stringtoslicerune(*[32]rune, string) []rune
58func decoderune(string, int) (retv rune, retk int)
59func slicecopy(to any, fr any, wid uintptr) int
60func slicestringcopy(to any, fr any) int
61
62// interface conversions
63func convI2I(typ *byte, elem any) (ret any)
64
65func convT2E(typ *byte, elem *any) (ret any)
66func convT2E16(typ *byte, elem *any) (ret any)
67func convT2E32(typ *byte, elem *any) (ret any)
68func convT2E64(typ *byte, elem *any) (ret any)
69func convT2Estring(typ *byte, elem *any) (ret any)
70func convT2Eslice(typ *byte, elem *any) (ret any)
71func convT2Enoptr(typ *byte, elem *any) (ret any)
72
73func convT2I(tab *byte, elem *any) (ret any)
74func convT2I16(tab *byte, elem *any) (ret any)
75func convT2I32(tab *byte, elem *any) (ret any)
76func convT2I64(tab *byte, elem *any) (ret any)
77func convT2Istring(tab *byte, elem *any) (ret any)
78func convT2Islice(tab *byte, elem *any) (ret any)
79func convT2Inoptr(tab *byte, elem *any) (ret any)
80
81// interface type assertions  x.(T)
82func assertE2I(typ *byte, iface any) (ret any)
83func assertE2I2(typ *byte, iface any) (ret any, b bool)
84func assertI2I(typ *byte, iface any) (ret any)
85func assertI2I2(typ *byte, iface any) (ret any, b bool)
86func panicdottypeE(have, want, iface *byte)
87func panicdottypeI(have, want, iface *byte)
88func panicnildottype(want *byte)
89
90// interface equality. Type/itab pointers are already known to be equal, so
91// we only need to pass one.
92func ifaceeq(tab *uintptr, x, y unsafe.Pointer) (ret bool)
93func efaceeq(typ *uintptr, x, y unsafe.Pointer) (ret bool)
94
95// *byte is really *runtime.Type
96func makemap(mapType *byte, hint int64, mapbuf *any, bucketbuf *any) (hmap map[any]any)
97func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any)
98func mapaccess1_fast32(mapType *byte, hmap map[any]any, key any) (val *any)
99func mapaccess1_fast64(mapType *byte, hmap map[any]any, key any) (val *any)
100func mapaccess1_faststr(mapType *byte, hmap map[any]any, key any) (val *any)
101func mapaccess1_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any)
102func mapaccess2(mapType *byte, hmap map[any]any, key *any) (val *any, pres bool)
103func mapaccess2_fast32(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
104func mapaccess2_fast64(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
105func mapaccess2_faststr(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
106func mapaccess2_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any, pres bool)
107func mapassign(mapType *byte, hmap map[any]any, key *any) (val *any)
108func mapassign_fast32(mapType *byte, hmap map[any]any, key any) (val *any)
109func mapassign_fast32ptr(mapType *byte, hmap map[any]any, key any) (val *any)
110func mapassign_fast64(mapType *byte, hmap map[any]any, key any) (val *any)
111func mapassign_fast64ptr(mapType *byte, hmap map[any]any, key any) (val *any)
112func mapassign_faststr(mapType *byte, hmap map[any]any, key any) (val *any)
113func mapiterinit(mapType *byte, hmap map[any]any, hiter *any)
114func mapdelete(mapType *byte, hmap map[any]any, key *any)
115func mapdelete_fast32(mapType *byte, hmap map[any]any, key any)
116func mapdelete_fast64(mapType *byte, hmap map[any]any, key any)
117func mapdelete_faststr(mapType *byte, hmap map[any]any, key any)
118func mapiternext(hiter *any)
119
120// *byte is really *runtime.Type
121func makechan(chanType *byte, hint int64) (hchan chan any)
122func chanrecv1(hchan <-chan any, elem *any)
123func chanrecv2(hchan <-chan any, elem *any) bool
124func chansend1(hchan chan<- any, elem *any)
125func closechan(hchan any)
126
127var writeBarrier struct {
128	enabled bool
129	pad     [3]byte
130	needed  bool
131	cgo     bool
132	alignme uint64
133}
134
135func writebarrierptr(dst *any, src any)
136
137// *byte is really *runtime.Type
138func typedmemmove(typ *byte, dst *any, src *any)
139func typedmemclr(typ *byte, dst *any)
140func typedslicecopy(typ *byte, dst any, src any) int
141
142func selectnbsend(hchan chan<- any, elem *any) bool
143func selectnbrecv(elem *any, hchan <-chan any) bool
144func selectnbrecv2(elem *any, received *bool, hchan <-chan any) bool
145
146func newselect(sel *byte, selsize int64, size int32)
147func selectsend(sel *byte, hchan chan<- any, elem *any)
148func selectrecv(sel *byte, hchan <-chan any, elem *any, received *bool)
149func selectdefault(sel *byte)
150func selectgo(sel *byte) int
151func block()
152
153func makeslice(typ *byte, len int, cap int) (ary []any)
154func makeslice64(typ *byte, len int64, cap int64) (ary []any)
155func growslice(typ *byte, old []any, cap int) (ary []any)
156func memmove(to *any, frm *any, length uintptr)
157func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)
158func memclrHasPointers(ptr unsafe.Pointer, n uintptr)
159
160func memequal(x, y *any, size uintptr) bool
161func memequal8(x, y *any) bool
162func memequal16(x, y *any) bool
163func memequal32(x, y *any) bool
164func memequal64(x, y *any) bool
165func memequal128(x, y *any) bool
166
167// only used on 32-bit
168func int64div(int64, int64) int64
169func uint64div(uint64, uint64) uint64
170func int64mod(int64, int64) int64
171func uint64mod(uint64, uint64) uint64
172func float64toint64(float64) int64
173func float64touint64(float64) uint64
174func float64touint32(float64) uint32
175func int64tofloat64(int64) float64
176func uint64tofloat64(uint64) float64
177func uint32tofloat64(uint32) float64
178
179func complex128div(num complex128, den complex128) (quo complex128)
180
181// race detection
182func racefuncenter(uintptr)
183func racefuncexit()
184func raceread(uintptr)
185func racewrite(uintptr)
186func racereadrange(addr, size uintptr)
187func racewriterange(addr, size uintptr)
188
189// memory sanitizer
190func msanread(addr, size uintptr)
191func msanwrite(addr, size uintptr)
192
193// architecture variants
194var support_popcnt bool
195