Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 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" |
Brad Fitzpatrick | 5fea2cc | 2016-03-01 23:21:55 +0000 | [diff] [blame] | 6 | // to update builtin.go. This is not done automatically |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 7 | // to avoid depending on having a working compiler binary. |
| 8 | |
| 9 | // +build ignore |
| 10 | |
Matthew Dempsky | 7555f7f | 2015-12-01 11:52:32 -0800 | [diff] [blame] | 11 | package runtime |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 12 | |
| 13 | // emitted by compiler, not referred to by go programs |
| 14 | |
| 15 | func newobject(typ *byte) *any |
| 16 | func panicindex() |
| 17 | func panicslice() |
| 18 | func panicdivide() |
| 19 | func throwreturn() |
| 20 | func throwinit() |
| 21 | func panicwrap(string, string, string) |
| 22 | |
| 23 | func gopanic(interface{}) |
| 24 | func gorecover(*int32) interface{} |
| 25 | |
| 26 | func printbool(bool) |
| 27 | func printfloat(float64) |
| 28 | func printint(int64) |
| 29 | func printhex(uint64) |
| 30 | func printuint(uint64) |
| 31 | func printcomplex(complex128) |
| 32 | func printstring(string) |
| 33 | func printpointer(any) |
| 34 | func printiface(any) |
| 35 | func printeface(any) |
| 36 | func printslice(any) |
| 37 | func printnl() |
| 38 | func printsp() |
| 39 | func printlock() |
| 40 | func printunlock() |
| 41 | |
| 42 | func concatstring2(*[32]byte, string, string) string |
| 43 | func concatstring3(*[32]byte, string, string, string) string |
| 44 | func concatstring4(*[32]byte, string, string, string, string) string |
| 45 | func concatstring5(*[32]byte, string, string, string, string, string) string |
| 46 | func concatstrings(*[32]byte, []string) string |
| 47 | |
| 48 | func cmpstring(string, string) int |
| 49 | func eqstring(string, string) bool |
| 50 | func intstring(*[4]byte, int64) string |
| 51 | func slicebytetostring(*[32]byte, []byte) string |
| 52 | func slicebytetostringtmp([]byte) string |
| 53 | func slicerunetostring(*[32]byte, []rune) string |
| 54 | func stringtoslicebyte(*[32]byte, string) []byte |
| 55 | func stringtoslicebytetmp(string) []byte |
| 56 | func stringtoslicerune(*[32]rune, string) []rune |
| 57 | func stringiter(string, int) int |
| 58 | func stringiter2(string, int) (retk int, retv rune) |
| 59 | func slicecopy(to any, fr any, wid uintptr) int |
| 60 | func slicestringcopy(to any, fr any) int |
| 61 | |
| 62 | // interface conversions |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 63 | func convI2E(elem any) (ret any) |
| 64 | func convI2I(typ *byte, elem any) (ret any) |
David Chase | 2270133 | 2015-03-27 11:21:14 -0400 | [diff] [blame] | 65 | func convT2E(typ *byte, elem, buf *any) (ret any) |
Michel Lespinasse | 859b63c | 2016-03-18 17:21:33 -0700 | [diff] [blame] | 66 | func convT2I(tab *byte, elem, buf *any) (ret any) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 67 | |
| 68 | // interface type assertions x.(T) |
| 69 | func assertE2E(typ *byte, iface any, ret *any) |
| 70 | func assertE2E2(typ *byte, iface any, ret *any) bool |
| 71 | func assertE2I(typ *byte, iface any, ret *any) |
| 72 | func assertE2I2(typ *byte, iface any, ret *any) bool |
| 73 | func assertE2T(typ *byte, iface any, ret *any) |
| 74 | func assertE2T2(typ *byte, iface any, ret *any) bool |
| 75 | func assertI2E(typ *byte, iface any, ret *any) |
| 76 | func assertI2E2(typ *byte, iface any, ret *any) bool |
| 77 | func assertI2I(typ *byte, iface any, ret *any) |
| 78 | func assertI2I2(typ *byte, iface any, ret *any) bool |
| 79 | func assertI2T(typ *byte, iface any, ret *any) |
| 80 | func assertI2T2(typ *byte, iface any, ret *any) bool |
Russ Cox | 4224d81 | 2015-03-20 00:06:10 -0400 | [diff] [blame] | 81 | func panicdottype(have, want, iface *byte) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 82 | |
| 83 | func ifaceeq(i1 any, i2 any) (ret bool) |
| 84 | func efaceeq(i1 any, i2 any) (ret bool) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 85 | |
| 86 | // *byte is really *runtime.Type |
Matthew Dempsky | 9877900 | 2016-02-23 07:46:01 +0000 | [diff] [blame] | 87 | func makemap(mapType *byte, hint int64, mapbuf *any, bucketbuf *any) (hmap map[any]any) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 88 | func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any) |
| 89 | func mapaccess1_fast32(mapType *byte, hmap map[any]any, key any) (val *any) |
| 90 | func mapaccess1_fast64(mapType *byte, hmap map[any]any, key any) (val *any) |
| 91 | func mapaccess1_faststr(mapType *byte, hmap map[any]any, key any) (val *any) |
Keith Randall | 60fd32a | 2016-04-19 08:31:04 -0700 | [diff] [blame] | 92 | func mapaccess1_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 93 | func mapaccess2(mapType *byte, hmap map[any]any, key *any) (val *any, pres bool) |
| 94 | func mapaccess2_fast32(mapType *byte, hmap map[any]any, key any) (val *any, pres bool) |
| 95 | func mapaccess2_fast64(mapType *byte, hmap map[any]any, key any) (val *any, pres bool) |
| 96 | func mapaccess2_faststr(mapType *byte, hmap map[any]any, key any) (val *any, pres bool) |
Keith Randall | 60fd32a | 2016-04-19 08:31:04 -0700 | [diff] [blame] | 97 | func mapaccess2_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any, pres bool) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 98 | func mapassign1(mapType *byte, hmap map[any]any, key *any, val *any) |
Matthew Dempsky | 9877900 | 2016-02-23 07:46:01 +0000 | [diff] [blame] | 99 | func mapiterinit(mapType *byte, hmap map[any]any, hiter *any) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 100 | func mapdelete(mapType *byte, hmap map[any]any, key *any) |
Matthew Dempsky | 9877900 | 2016-02-23 07:46:01 +0000 | [diff] [blame] | 101 | func mapiternext(hiter *any) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 102 | |
| 103 | // *byte is really *runtime.Type |
| 104 | func makechan(chanType *byte, hint int64) (hchan chan any) |
| 105 | func chanrecv1(chanType *byte, hchan <-chan any, elem *any) |
| 106 | func chanrecv2(chanType *byte, hchan <-chan any, elem *any) bool |
| 107 | func chansend1(chanType *byte, hchan chan<- any, elem *any) |
| 108 | func closechan(hchan any) |
| 109 | |
Ian Lance Taylor | be1ef46 | 2015-11-13 17:45:22 -0800 | [diff] [blame] | 110 | var writeBarrier struct { |
| 111 | enabled bool |
| 112 | needed bool |
| 113 | cgo bool |
| 114 | } |
Russ Cox | 653d560 | 2015-04-24 14:13:06 -0400 | [diff] [blame] | 115 | |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 116 | func writebarrierptr(dst *any, src any) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 117 | |
Russ Cox | 653d560 | 2015-04-24 14:13:06 -0400 | [diff] [blame] | 118 | // *byte is really *runtime.Type |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 119 | func typedmemmove(typ *byte, dst *any, src *any) |
| 120 | func typedslicecopy(typ *byte, dst any, src any) int |
| 121 | |
| 122 | func selectnbsend(chanType *byte, hchan chan<- any, elem *any) bool |
| 123 | func selectnbrecv(chanType *byte, elem *any, hchan <-chan any) bool |
| 124 | func selectnbrecv2(chanType *byte, elem *any, received *bool, hchan <-chan any) bool |
| 125 | |
| 126 | func newselect(sel *byte, selsize int64, size int32) |
| 127 | func selectsend(sel *byte, hchan chan<- any, elem *any) (selected bool) |
| 128 | func selectrecv(sel *byte, hchan <-chan any, elem *any) (selected bool) |
| 129 | func selectrecv2(sel *byte, hchan <-chan any, elem *any, received *bool) (selected bool) |
| 130 | func selectdefault(sel *byte) (selected bool) |
| 131 | func selectgo(sel *byte) |
| 132 | func block() |
| 133 | |
| 134 | func makeslice(typ *byte, nel int64, cap int64) (ary []any) |
Russ Cox | 32fddad | 2015-06-25 19:27:20 -0400 | [diff] [blame] | 135 | func growslice(typ *byte, old []any, cap int) (ary []any) |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 136 | func memmove(to *any, frm *any, length uintptr) |
| 137 | func memclr(ptr *byte, length uintptr) |
| 138 | |
| 139 | func memequal(x, y *any, size uintptr) bool |
| 140 | func memequal8(x, y *any) bool |
| 141 | func memequal16(x, y *any) bool |
| 142 | func memequal32(x, y *any) bool |
| 143 | func memequal64(x, y *any) bool |
| 144 | func memequal128(x, y *any) bool |
| 145 | |
| 146 | // only used on 32-bit |
| 147 | func int64div(int64, int64) int64 |
| 148 | func uint64div(uint64, uint64) uint64 |
| 149 | func int64mod(int64, int64) int64 |
| 150 | func uint64mod(uint64, uint64) uint64 |
| 151 | func float64toint64(float64) int64 |
| 152 | func float64touint64(float64) uint64 |
Keith Randall | df2f813 | 2016-07-21 10:37:59 -0700 | [diff] [blame] | 153 | func float64touint32(float64) uint32 |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 154 | func int64tofloat64(int64) float64 |
| 155 | func uint64tofloat64(uint64) float64 |
Keith Randall | df2f813 | 2016-07-21 10:37:59 -0700 | [diff] [blame] | 156 | func uint32tofloat64(uint32) float64 |
Matthew Dempsky | d68f52a | 2015-02-27 17:40:34 +0900 | [diff] [blame] | 157 | |
| 158 | func complex128div(num complex128, den complex128) (quo complex128) |
| 159 | |
| 160 | // race detection |
| 161 | func racefuncenter(uintptr) |
| 162 | func racefuncexit() |
| 163 | func raceread(uintptr) |
| 164 | func racewrite(uintptr) |
| 165 | func racereadrange(addr, size uintptr) |
| 166 | func racewriterange(addr, size uintptr) |
Ian Lance Taylor | 0c69f13 | 2015-10-21 07:04:10 -0700 | [diff] [blame] | 167 | |
| 168 | // memory sanitizer |
| 169 | func msanread(addr, size uintptr) |
| 170 | func msanwrite(addr, size uintptr) |