blob: ef7e4089594151e20f961b6c007aa505793eeb6d [file] [log] [blame]
Matthew Dempskyd68f52a2015-02-27 17:40:34 +09001// 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"
Brad Fitzpatrick5fea2cc2016-03-01 23:21:55 +00006// to update builtin.go. This is not done automatically
Matthew Dempskyd68f52a2015-02-27 17:40:34 +09007// to avoid depending on having a working compiler binary.
8
9// +build ignore
10
Matthew Dempsky7555f7f2015-12-01 11:52:32 -080011package runtime
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090012
13// emitted by compiler, not referred to by go programs
14
15func newobject(typ *byte) *any
16func panicindex()
17func panicslice()
18func panicdivide()
19func throwreturn()
20func throwinit()
21func panicwrap(string, string, string)
22
23func gopanic(interface{})
24func gorecover(*int32) interface{}
25
26func printbool(bool)
27func printfloat(float64)
28func printint(int64)
29func printhex(uint64)
30func printuint(uint64)
31func printcomplex(complex128)
32func printstring(string)
33func printpointer(any)
34func printiface(any)
35func printeface(any)
36func printslice(any)
37func printnl()
38func printsp()
39func printlock()
40func printunlock()
41
42func concatstring2(*[32]byte, string, string) string
43func concatstring3(*[32]byte, string, string, string) string
44func concatstring4(*[32]byte, string, string, string, string) string
45func concatstring5(*[32]byte, string, string, string, string, string) string
46func concatstrings(*[32]byte, []string) string
47
48func cmpstring(string, string) int
49func eqstring(string, string) bool
50func intstring(*[4]byte, int64) string
51func slicebytetostring(*[32]byte, []byte) string
52func slicebytetostringtmp([]byte) string
53func slicerunetostring(*[32]byte, []rune) string
54func stringtoslicebyte(*[32]byte, string) []byte
55func stringtoslicebytetmp(string) []byte
56func stringtoslicerune(*[32]rune, string) []rune
57func stringiter(string, int) int
58func stringiter2(string, int) (retk int, retv rune)
59func slicecopy(to any, fr any, wid uintptr) int
60func slicestringcopy(to any, fr any) int
61
62// interface conversions
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090063func convI2E(elem any) (ret any)
64func convI2I(typ *byte, elem any) (ret any)
David Chase22701332015-03-27 11:21:14 -040065func convT2E(typ *byte, elem, buf *any) (ret any)
Michel Lespinasse859b63c2016-03-18 17:21:33 -070066func convT2I(tab *byte, elem, buf *any) (ret any)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090067
68// interface type assertions x.(T)
69func assertE2E(typ *byte, iface any, ret *any)
70func assertE2E2(typ *byte, iface any, ret *any) bool
71func assertE2I(typ *byte, iface any, ret *any)
72func assertE2I2(typ *byte, iface any, ret *any) bool
73func assertE2T(typ *byte, iface any, ret *any)
74func assertE2T2(typ *byte, iface any, ret *any) bool
75func assertI2E(typ *byte, iface any, ret *any)
76func assertI2E2(typ *byte, iface any, ret *any) bool
77func assertI2I(typ *byte, iface any, ret *any)
78func assertI2I2(typ *byte, iface any, ret *any) bool
79func assertI2T(typ *byte, iface any, ret *any)
80func assertI2T2(typ *byte, iface any, ret *any) bool
Russ Cox4224d812015-03-20 00:06:10 -040081func panicdottype(have, want, iface *byte)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090082
83func ifaceeq(i1 any, i2 any) (ret bool)
84func efaceeq(i1 any, i2 any) (ret bool)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090085
86// *byte is really *runtime.Type
Matthew Dempsky98779002016-02-23 07:46:01 +000087func makemap(mapType *byte, hint int64, mapbuf *any, bucketbuf *any) (hmap map[any]any)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090088func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any)
89func mapaccess1_fast32(mapType *byte, hmap map[any]any, key any) (val *any)
90func mapaccess1_fast64(mapType *byte, hmap map[any]any, key any) (val *any)
91func mapaccess1_faststr(mapType *byte, hmap map[any]any, key any) (val *any)
Keith Randall60fd32a2016-04-19 08:31:04 -070092func mapaccess1_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090093func mapaccess2(mapType *byte, hmap map[any]any, key *any) (val *any, pres bool)
94func mapaccess2_fast32(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
95func mapaccess2_fast64(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
96func mapaccess2_faststr(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
Keith Randall60fd32a2016-04-19 08:31:04 -070097func mapaccess2_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any, pres bool)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +090098func mapassign1(mapType *byte, hmap map[any]any, key *any, val *any)
Matthew Dempsky98779002016-02-23 07:46:01 +000099func mapiterinit(mapType *byte, hmap map[any]any, hiter *any)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900100func mapdelete(mapType *byte, hmap map[any]any, key *any)
Matthew Dempsky98779002016-02-23 07:46:01 +0000101func mapiternext(hiter *any)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900102
103// *byte is really *runtime.Type
104func makechan(chanType *byte, hint int64) (hchan chan any)
105func chanrecv1(chanType *byte, hchan <-chan any, elem *any)
106func chanrecv2(chanType *byte, hchan <-chan any, elem *any) bool
107func chansend1(chanType *byte, hchan chan<- any, elem *any)
108func closechan(hchan any)
109
Ian Lance Taylorbe1ef462015-11-13 17:45:22 -0800110var writeBarrier struct {
111 enabled bool
112 needed bool
113 cgo bool
114}
Russ Cox653d5602015-04-24 14:13:06 -0400115
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900116func writebarrierptr(dst *any, src any)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900117
Russ Cox653d5602015-04-24 14:13:06 -0400118// *byte is really *runtime.Type
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900119func typedmemmove(typ *byte, dst *any, src *any)
120func typedslicecopy(typ *byte, dst any, src any) int
121
122func selectnbsend(chanType *byte, hchan chan<- any, elem *any) bool
123func selectnbrecv(chanType *byte, elem *any, hchan <-chan any) bool
124func selectnbrecv2(chanType *byte, elem *any, received *bool, hchan <-chan any) bool
125
126func newselect(sel *byte, selsize int64, size int32)
127func selectsend(sel *byte, hchan chan<- any, elem *any) (selected bool)
128func selectrecv(sel *byte, hchan <-chan any, elem *any) (selected bool)
129func selectrecv2(sel *byte, hchan <-chan any, elem *any, received *bool) (selected bool)
130func selectdefault(sel *byte) (selected bool)
131func selectgo(sel *byte)
132func block()
133
134func makeslice(typ *byte, nel int64, cap int64) (ary []any)
Russ Cox32fddad2015-06-25 19:27:20 -0400135func growslice(typ *byte, old []any, cap int) (ary []any)
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900136func memmove(to *any, frm *any, length uintptr)
137func memclr(ptr *byte, length uintptr)
138
139func memequal(x, y *any, size uintptr) bool
140func memequal8(x, y *any) bool
141func memequal16(x, y *any) bool
142func memequal32(x, y *any) bool
143func memequal64(x, y *any) bool
144func memequal128(x, y *any) bool
145
146// only used on 32-bit
147func int64div(int64, int64) int64
148func uint64div(uint64, uint64) uint64
149func int64mod(int64, int64) int64
150func uint64mod(uint64, uint64) uint64
151func float64toint64(float64) int64
152func float64touint64(float64) uint64
Keith Randalldf2f8132016-07-21 10:37:59 -0700153func float64touint32(float64) uint32
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900154func int64tofloat64(int64) float64
155func uint64tofloat64(uint64) float64
Keith Randalldf2f8132016-07-21 10:37:59 -0700156func uint32tofloat64(uint32) float64
Matthew Dempskyd68f52a2015-02-27 17:40:34 +0900157
158func complex128div(num complex128, den complex128) (quo complex128)
159
160// race detection
161func racefuncenter(uintptr)
162func racefuncexit()
163func raceread(uintptr)
164func racewrite(uintptr)
165func racereadrange(addr, size uintptr)
166func racewriterange(addr, size uintptr)
Ian Lance Taylor0c69f132015-10-21 07:04:10 -0700167
168// memory sanitizer
169func msanread(addr, size uintptr)
170func msanwrite(addr, size uintptr)