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