2015-02-27 17:40:34 +09:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
// NOTE: If you change this file you must run "go generate"
|
2016-03-01 23:21:55 +00:00
|
|
|
// to update builtin.go. This is not done automatically
|
2015-02-27 17:40:34 +09:00
|
|
|
// to avoid depending on having a working compiler binary.
|
|
|
|
|
|
|
|
|
|
// +build ignore
|
|
|
|
|
|
2015-12-01 11:52:32 -08:00
|
|
|
package runtime
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
// emitted by compiler, not referred to by go programs
|
|
|
|
|
|
|
|
|
|
func newobject(typ *byte) *any
|
|
|
|
|
func panicindex()
|
|
|
|
|
func panicslice()
|
|
|
|
|
func panicdivide()
|
|
|
|
|
func throwinit()
|
|
|
|
|
func panicwrap(string, string, string)
|
|
|
|
|
|
|
|
|
|
func gopanic(interface{})
|
|
|
|
|
func gorecover(*int32) interface{}
|
|
|
|
|
|
|
|
|
|
func printbool(bool)
|
|
|
|
|
func printfloat(float64)
|
|
|
|
|
func printint(int64)
|
|
|
|
|
func printhex(uint64)
|
|
|
|
|
func printuint(uint64)
|
|
|
|
|
func printcomplex(complex128)
|
|
|
|
|
func printstring(string)
|
|
|
|
|
func printpointer(any)
|
|
|
|
|
func printiface(any)
|
|
|
|
|
func printeface(any)
|
|
|
|
|
func printslice(any)
|
|
|
|
|
func printnl()
|
|
|
|
|
func printsp()
|
|
|
|
|
func printlock()
|
|
|
|
|
func printunlock()
|
|
|
|
|
|
|
|
|
|
func concatstring2(*[32]byte, string, string) string
|
|
|
|
|
func concatstring3(*[32]byte, string, string, string) string
|
|
|
|
|
func concatstring4(*[32]byte, string, string, string, string) string
|
|
|
|
|
func concatstring5(*[32]byte, string, string, string, string, string) string
|
|
|
|
|
func concatstrings(*[32]byte, []string) string
|
|
|
|
|
|
|
|
|
|
func cmpstring(string, string) int
|
|
|
|
|
func eqstring(string, string) bool
|
|
|
|
|
func intstring(*[4]byte, int64) string
|
|
|
|
|
func slicebytetostring(*[32]byte, []byte) string
|
|
|
|
|
func slicebytetostringtmp([]byte) string
|
|
|
|
|
func slicerunetostring(*[32]byte, []rune) string
|
|
|
|
|
func stringtoslicebyte(*[32]byte, string) []byte
|
|
|
|
|
func stringtoslicerune(*[32]rune, string) []rune
|
2016-09-02 17:04:41 +02:00
|
|
|
func decoderune(string, int) (retv rune, retk int)
|
2015-02-27 17:40:34 +09:00
|
|
|
func slicecopy(to any, fr any, wid uintptr) int
|
|
|
|
|
func slicestringcopy(to any, fr any) int
|
|
|
|
|
|
|
|
|
|
// interface conversions
|
|
|
|
|
func convI2I(typ *byte, elem any) (ret any)
|
2016-09-17 15:04:36 -07:00
|
|
|
func convT2E(typ *byte, elem *any) (ret any)
|
|
|
|
|
func convT2I(tab *byte, elem *any) (ret any)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
// interface type assertions x.(T)
|
2016-10-28 11:37:45 -07:00
|
|
|
func assertE2I(typ *byte, iface any) (ret any)
|
|
|
|
|
func assertE2I2(typ *byte, iface any) (ret any, b bool)
|
|
|
|
|
func assertI2I(typ *byte, iface any) (ret any)
|
|
|
|
|
func assertI2I2(typ *byte, iface any) (ret any, b bool)
|
2015-03-20 00:06:10 -04:00
|
|
|
func panicdottype(have, want, iface *byte)
|
2016-10-28 11:37:45 -07:00
|
|
|
func panicnildottype(want *byte)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
func ifaceeq(i1 any, i2 any) (ret bool)
|
|
|
|
|
func efaceeq(i1 any, i2 any) (ret bool)
|
|
|
|
|
|
|
|
|
|
// *byte is really *runtime.Type
|
2016-02-23 07:46:01 +00:00
|
|
|
func makemap(mapType *byte, hint int64, mapbuf *any, bucketbuf *any) (hmap map[any]any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any)
|
|
|
|
|
func mapaccess1_fast32(mapType *byte, hmap map[any]any, key any) (val *any)
|
|
|
|
|
func mapaccess1_fast64(mapType *byte, hmap map[any]any, key any) (val *any)
|
|
|
|
|
func mapaccess1_faststr(mapType *byte, hmap map[any]any, key any) (val *any)
|
2016-04-19 08:31:04 -07:00
|
|
|
func mapaccess1_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func mapaccess2(mapType *byte, hmap map[any]any, key *any) (val *any, pres bool)
|
|
|
|
|
func mapaccess2_fast32(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
|
|
|
|
|
func mapaccess2_fast64(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
|
|
|
|
|
func mapaccess2_faststr(mapType *byte, hmap map[any]any, key any) (val *any, pres bool)
|
2016-04-19 08:31:04 -07:00
|
|
|
func mapaccess2_fat(mapType *byte, hmap map[any]any, key *any, zero *byte) (val *any, pres bool)
|
2016-10-11 08:36:38 -07:00
|
|
|
func mapassign(mapType *byte, hmap map[any]any, key *any) (val *any)
|
2016-02-23 07:46:01 +00:00
|
|
|
func mapiterinit(mapType *byte, hmap map[any]any, hiter *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func mapdelete(mapType *byte, hmap map[any]any, key *any)
|
2016-02-23 07:46:01 +00:00
|
|
|
func mapiternext(hiter *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
// *byte is really *runtime.Type
|
|
|
|
|
func makechan(chanType *byte, hint int64) (hchan chan any)
|
|
|
|
|
func chanrecv1(chanType *byte, hchan <-chan any, elem *any)
|
|
|
|
|
func chanrecv2(chanType *byte, hchan <-chan any, elem *any) bool
|
|
|
|
|
func chansend1(chanType *byte, hchan chan<- any, elem *any)
|
|
|
|
|
func closechan(hchan any)
|
|
|
|
|
|
2015-11-13 17:45:22 -08:00
|
|
|
var writeBarrier struct {
|
|
|
|
|
enabled bool
|
|
|
|
|
needed bool
|
|
|
|
|
cgo bool
|
|
|
|
|
}
|
cmd/internal/gc: inline writeBarrierEnabled check before calling writebarrierptr
I believe the benchmarks that get slower are under register pressure,
and not making the call unconditionally makes the pressure worse,
and the register allocator doesn't do a great job. But part of the point
of this sequence is to get the write barriers out of the way so I can work
on the register allocator, so that's okay.
name old new delta
BenchmarkBinaryTree17 17.9s × (1.00,1.01) 18.0s × (0.99,1.01) ~
BenchmarkFannkuch11 4.43s × (1.00,1.00) 4.43s × (1.00,1.00) ~
BenchmarkFmtFprintfEmpty 110ns × (1.00,1.06) 114ns × (0.95,1.05) ~
BenchmarkFmtFprintfString 487ns × (0.99,1.00) 468ns × (0.99,1.01) -4.00%
BenchmarkFmtFprintfInt 450ns × (0.99,1.00) 433ns × (1.00,1.01) -3.88%
BenchmarkFmtFprintfIntInt 762ns × (1.00,1.00) 748ns × (0.99,1.01) -1.84%
BenchmarkFmtFprintfPrefixedInt 584ns × (0.99,1.01) 547ns × (0.99,1.01) -6.26%
BenchmarkFmtFprintfFloat 738ns × (1.00,1.00) 756ns × (1.00,1.01) +2.37%
BenchmarkFmtManyArgs 2.80µs × (1.00,1.01) 2.79µs × (1.00,1.01) ~
BenchmarkGobDecode 39.0ms × (0.99,1.00) 39.6ms × (0.99,1.00) +1.54%
BenchmarkGobEncode 37.8ms × (0.98,1.01) 37.6ms × (1.00,1.01) ~
BenchmarkGzip 661ms × (0.99,1.01) 663ms × (0.99,1.02) ~
BenchmarkGunzip 142ms × (1.00,1.00) 142ms × (1.00,1.00) ~
BenchmarkHTTPClientServer 132µs × (0.99,1.01) 132µs × (0.99,1.01) ~
BenchmarkJSONEncode 56.3ms × (0.99,1.01) 56.2ms × (0.99,1.01) ~
BenchmarkJSONDecode 138ms × (0.99,1.01) 138ms × (1.00,1.00) ~
BenchmarkMandelbrot200 6.01ms × (1.00,1.00) 6.03ms × (1.00,1.01) +0.23%
BenchmarkGoParse 10.2ms × (0.87,1.05) 9.8ms × (0.93,1.10) ~
BenchmarkRegexpMatchEasy0_32 208ns × (1.00,1.00) 207ns × (1.00,1.00) ~
BenchmarkRegexpMatchEasy0_1K 588ns × (1.00,1.00) 581ns × (1.00,1.01) -1.27%
BenchmarkRegexpMatchEasy1_32 182ns × (0.99,1.01) 185ns × (0.99,1.01) +1.65%
BenchmarkRegexpMatchEasy1_1K 986ns × (1.00,1.01) 975ns × (1.00,1.01) -1.17%
BenchmarkRegexpMatchMedium_32 323ns × (1.00,1.01) 328ns × (0.99,1.00) +1.55%
BenchmarkRegexpMatchMedium_1K 89.9µs × (1.00,1.00) 88.6µs × (1.00,1.01) -1.38%
BenchmarkRegexpMatchHard_32 4.72µs × (0.95,1.01) 4.69µs × (0.95,1.03) ~
BenchmarkRegexpMatchHard_1K 133µs × (1.00,1.01) 133µs × (1.00,1.01) ~
BenchmarkRevcomp 900ms × (1.00,1.05) 902ms × (0.99,1.05) ~
BenchmarkTemplate 168ms × (0.99,1.01) 174ms × (0.99,1.01) +3.30%
BenchmarkTimeParse 637ns × (1.00,1.00) 639ns × (1.00,1.00) +0.31%
BenchmarkTimeFormat 738ns × (1.00,1.00) 736ns × (1.00,1.01) ~
Change-Id: I03ce152852edec404538f6c20eb650fac82e2aa2
Reviewed-on: https://go-review.googlesource.com/9224
Reviewed-by: Austin Clements <austin@google.com>
2015-04-24 14:13:06 -04:00
|
|
|
|
2015-02-27 17:40:34 +09:00
|
|
|
func writebarrierptr(dst *any, src any)
|
|
|
|
|
|
cmd/internal/gc: inline writeBarrierEnabled check before calling writebarrierptr
I believe the benchmarks that get slower are under register pressure,
and not making the call unconditionally makes the pressure worse,
and the register allocator doesn't do a great job. But part of the point
of this sequence is to get the write barriers out of the way so I can work
on the register allocator, so that's okay.
name old new delta
BenchmarkBinaryTree17 17.9s × (1.00,1.01) 18.0s × (0.99,1.01) ~
BenchmarkFannkuch11 4.43s × (1.00,1.00) 4.43s × (1.00,1.00) ~
BenchmarkFmtFprintfEmpty 110ns × (1.00,1.06) 114ns × (0.95,1.05) ~
BenchmarkFmtFprintfString 487ns × (0.99,1.00) 468ns × (0.99,1.01) -4.00%
BenchmarkFmtFprintfInt 450ns × (0.99,1.00) 433ns × (1.00,1.01) -3.88%
BenchmarkFmtFprintfIntInt 762ns × (1.00,1.00) 748ns × (0.99,1.01) -1.84%
BenchmarkFmtFprintfPrefixedInt 584ns × (0.99,1.01) 547ns × (0.99,1.01) -6.26%
BenchmarkFmtFprintfFloat 738ns × (1.00,1.00) 756ns × (1.00,1.01) +2.37%
BenchmarkFmtManyArgs 2.80µs × (1.00,1.01) 2.79µs × (1.00,1.01) ~
BenchmarkGobDecode 39.0ms × (0.99,1.00) 39.6ms × (0.99,1.00) +1.54%
BenchmarkGobEncode 37.8ms × (0.98,1.01) 37.6ms × (1.00,1.01) ~
BenchmarkGzip 661ms × (0.99,1.01) 663ms × (0.99,1.02) ~
BenchmarkGunzip 142ms × (1.00,1.00) 142ms × (1.00,1.00) ~
BenchmarkHTTPClientServer 132µs × (0.99,1.01) 132µs × (0.99,1.01) ~
BenchmarkJSONEncode 56.3ms × (0.99,1.01) 56.2ms × (0.99,1.01) ~
BenchmarkJSONDecode 138ms × (0.99,1.01) 138ms × (1.00,1.00) ~
BenchmarkMandelbrot200 6.01ms × (1.00,1.00) 6.03ms × (1.00,1.01) +0.23%
BenchmarkGoParse 10.2ms × (0.87,1.05) 9.8ms × (0.93,1.10) ~
BenchmarkRegexpMatchEasy0_32 208ns × (1.00,1.00) 207ns × (1.00,1.00) ~
BenchmarkRegexpMatchEasy0_1K 588ns × (1.00,1.00) 581ns × (1.00,1.01) -1.27%
BenchmarkRegexpMatchEasy1_32 182ns × (0.99,1.01) 185ns × (0.99,1.01) +1.65%
BenchmarkRegexpMatchEasy1_1K 986ns × (1.00,1.01) 975ns × (1.00,1.01) -1.17%
BenchmarkRegexpMatchMedium_32 323ns × (1.00,1.01) 328ns × (0.99,1.00) +1.55%
BenchmarkRegexpMatchMedium_1K 89.9µs × (1.00,1.00) 88.6µs × (1.00,1.01) -1.38%
BenchmarkRegexpMatchHard_32 4.72µs × (0.95,1.01) 4.69µs × (0.95,1.03) ~
BenchmarkRegexpMatchHard_1K 133µs × (1.00,1.01) 133µs × (1.00,1.01) ~
BenchmarkRevcomp 900ms × (1.00,1.05) 902ms × (0.99,1.05) ~
BenchmarkTemplate 168ms × (0.99,1.01) 174ms × (0.99,1.01) +3.30%
BenchmarkTimeParse 637ns × (1.00,1.00) 639ns × (1.00,1.00) +0.31%
BenchmarkTimeFormat 738ns × (1.00,1.00) 736ns × (1.00,1.01) ~
Change-Id: I03ce152852edec404538f6c20eb650fac82e2aa2
Reviewed-on: https://go-review.googlesource.com/9224
Reviewed-by: Austin Clements <austin@google.com>
2015-04-24 14:13:06 -04:00
|
|
|
// *byte is really *runtime.Type
|
2015-02-27 17:40:34 +09:00
|
|
|
func typedmemmove(typ *byte, dst *any, src *any)
|
2016-10-17 18:41:56 -04:00
|
|
|
func typedmemclr(typ *byte, dst *any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func typedslicecopy(typ *byte, dst any, src any) int
|
|
|
|
|
|
|
|
|
|
func selectnbsend(chanType *byte, hchan chan<- any, elem *any) bool
|
|
|
|
|
func selectnbrecv(chanType *byte, elem *any, hchan <-chan any) bool
|
|
|
|
|
func selectnbrecv2(chanType *byte, elem *any, received *bool, hchan <-chan any) bool
|
|
|
|
|
|
|
|
|
|
func newselect(sel *byte, selsize int64, size int32)
|
|
|
|
|
func selectsend(sel *byte, hchan chan<- any, elem *any) (selected bool)
|
|
|
|
|
func selectrecv(sel *byte, hchan <-chan any, elem *any) (selected bool)
|
|
|
|
|
func selectrecv2(sel *byte, hchan <-chan any, elem *any, received *bool) (selected bool)
|
|
|
|
|
func selectdefault(sel *byte) (selected bool)
|
|
|
|
|
func selectgo(sel *byte)
|
|
|
|
|
func block()
|
|
|
|
|
|
2016-08-25 14:17:52 +02:00
|
|
|
func makeslice(typ *byte, len int, cap int) (ary []any)
|
|
|
|
|
func makeslice64(typ *byte, len int64, cap int64) (ary []any)
|
2015-06-25 19:27:20 -04:00
|
|
|
func growslice(typ *byte, old []any, cap int) (ary []any)
|
2015-02-27 17:40:34 +09:00
|
|
|
func memmove(to *any, frm *any, length uintptr)
|
2016-10-17 18:41:56 -04:00
|
|
|
func memclrNoHeapPointers(ptr *byte, length uintptr)
|
|
|
|
|
func memclrHasPointers(ptr *byte, length uintptr)
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
func memequal(x, y *any, size uintptr) bool
|
|
|
|
|
func memequal8(x, y *any) bool
|
|
|
|
|
func memequal16(x, y *any) bool
|
|
|
|
|
func memequal32(x, y *any) bool
|
|
|
|
|
func memequal64(x, y *any) bool
|
|
|
|
|
func memequal128(x, y *any) bool
|
|
|
|
|
|
|
|
|
|
// only used on 32-bit
|
|
|
|
|
func int64div(int64, int64) int64
|
|
|
|
|
func uint64div(uint64, uint64) uint64
|
|
|
|
|
func int64mod(int64, int64) int64
|
|
|
|
|
func uint64mod(uint64, uint64) uint64
|
|
|
|
|
func float64toint64(float64) int64
|
|
|
|
|
func float64touint64(float64) uint64
|
2016-07-21 10:37:59 -07:00
|
|
|
func float64touint32(float64) uint32
|
2015-02-27 17:40:34 +09:00
|
|
|
func int64tofloat64(int64) float64
|
|
|
|
|
func uint64tofloat64(uint64) float64
|
2016-07-21 10:37:59 -07:00
|
|
|
func uint32tofloat64(uint32) float64
|
2015-02-27 17:40:34 +09:00
|
|
|
|
|
|
|
|
func complex128div(num complex128, den complex128) (quo complex128)
|
|
|
|
|
|
|
|
|
|
// race detection
|
|
|
|
|
func racefuncenter(uintptr)
|
|
|
|
|
func racefuncexit()
|
|
|
|
|
func raceread(uintptr)
|
|
|
|
|
func racewrite(uintptr)
|
|
|
|
|
func racereadrange(addr, size uintptr)
|
|
|
|
|
func racewriterange(addr, size uintptr)
|
2015-10-21 07:04:10 -07:00
|
|
|
|
|
|
|
|
// memory sanitizer
|
|
|
|
|
func msanread(addr, size uintptr)
|
|
|
|
|
func msanwrite(addr, size uintptr)
|