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