diff options
author | Ian Lance Taylor <iant@golang.org> | 2017-01-14 00:05:42 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-01-14 00:05:42 +0000 |
commit | c2047754c300b68c05d65faa8dc2925fe67b71b4 (patch) | |
tree | e183ae81a1f48a02945cb6de463a70c5be1b06f6 /libgo/go/runtime/runtime2.go | |
parent | 829afb8f05602bb31c9c597b24df7377fed4f059 (diff) | |
download | gcc-c2047754c300b68c05d65faa8dc2925fe67b71b4.zip gcc-c2047754c300b68c05d65faa8dc2925fe67b71b4.tar.gz gcc-c2047754c300b68c05d65faa8dc2925fe67b71b4.tar.bz2 |
libgo: update to Go 1.8 release candidate 1
Compiler changes:
* Change map assignment to use mapassign and assign value directly.
* Change string iteration to use decoderune, faster for ASCII strings.
* Change makeslice to take int, and use makeslice64 for larger values.
* Add new noverflow field to hmap struct used for maps.
Unresolved problems, to be fixed later:
* Commented out test in go/types/sizes_test.go that doesn't compile.
* Commented out reflect.TestStructOf test for padding after zero-sized field.
Reviewed-on: https://go-review.googlesource.com/35231
gotools/:
Updates for Go 1.8rc1.
* Makefile.am (go_cmd_go_files): Add bug.go.
(s-zdefaultcc): Write defaultPkgConfig.
* Makefile.in: Rebuild.
From-SVN: r244456
Diffstat (limited to 'libgo/go/runtime/runtime2.go')
-rw-r--r-- | libgo/go/runtime/runtime2.go | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/libgo/go/runtime/runtime2.go b/libgo/go/runtime/runtime2.go index 7dc2743..195d65b 100644 --- a/libgo/go/runtime/runtime2.go +++ b/libgo/go/runtime/runtime2.go @@ -209,6 +209,14 @@ func (gp *guintptr) cas(old, new guintptr) bool { return atomic.Casuintptr((*uintptr)(unsafe.Pointer(gp)), uintptr(old), uintptr(new)) } +// setGNoWB performs *gp = new without a write barrier. +// For times when it's impractical to use a guintptr. +//go:nosplit +//go:nowritebarrier +func setGNoWB(gp **g, new *g) { + (*guintptr)(unsafe.Pointer(gp)).set(new) +} + type puintptr uintptr //go:nosplit @@ -225,6 +233,14 @@ func (mp muintptr) ptr() *m { return (*m)(unsafe.Pointer(mp)) } //go:nosplit func (mp *muintptr) set(m *m) { *mp = muintptr(unsafe.Pointer(m)) } +// setMNoWB performs *mp = new without a write barrier. +// For times when it's impractical to use an muintptr. +//go:nosplit +//go:nowritebarrier +func setMNoWB(mp **m, new *m) { + (*muintptr)(unsafe.Pointer(mp)).set(new) +} + // sudog represents a g in a wait list, such as for sending/receiving // on a channel. // @@ -249,6 +265,7 @@ type sudog struct { // The following fields are never accessed concurrently. // waitlink is only accessed by g. + acquiretime int64 releasetime int64 ticket uint32 waitlink *sudog // g.waiting list @@ -538,7 +555,7 @@ type p struct { runSafePointFn uint32 // if 1, run sched.safePointFn at next safe point - pad [64]byte + pad [sys.CacheLineSize]byte } const ( @@ -626,29 +643,6 @@ const ( _SigUnblock // unblocked in minit ) -/* -gccgo does not use this. - -// Layout of in-memory per-function information prepared by linker -// See https://golang.org/s/go12symtab. -// Keep in sync with linker -// and with package debug/gosym and with symtab.go in package runtime. -type _func struct { - entry uintptr // start pc - nameoff int32 // function name - - args int32 // in/out args size - _ int32 // previously legacy frame size; kept for layout compatibility - - pcsp int32 - pcfile int32 - pcln int32 - npcdata int32 - nfuncdata int32 -} - -*/ - // Lock-free stack node. // // Also known to export_test.go. type lfnode struct { @@ -766,15 +760,17 @@ var ( newprocs int32 // Information about what cpu features are available. - // Set on startup. + // Set on startup in asm_{x86,amd64}.s. cpuid_ecx uint32 support_aes bool -// cpuid_edx uint32 -// cpuid_ebx7 uint32 -// lfenceBeforeRdtsc bool -// support_avx bool -// support_avx2 bool + // cpuid_edx uint32 + // cpuid_ebx7 uint32 + // lfenceBeforeRdtsc bool + // support_avx bool + // support_avx2 bool + // support_bmi1 bool + // support_bmi2 bool // goarm uint8 // set by cmd/link on arm systems // framepointer_enabled bool // set by cmd/link |