mirror of
https://github.com/golang/go
synced 2024-11-26 07:17:59 -07:00
runtime: drop haveexperiment, sys.GOEXPERIMENT
We have ways to statically access experiments now, so we don't need a relatively clunky string-parsing dynamic way to do it. Change-Id: I5d75480916eef4bde2c30d5fe30593180da77ff2 Reviewed-on: https://go-review.googlesource.com/c/go/+/307815 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
f60aa7a18c
commit
aeaa4519b5
@ -171,7 +171,6 @@ func init() {
|
||||
}
|
||||
|
||||
// Set GOEXPERIMENT to the parsed and canonicalized set of experiments.
|
||||
// This format must be parseable by runtime.haveexperiment.
|
||||
GOEXPERIMENT = expList()
|
||||
}
|
||||
|
||||
|
@ -118,8 +118,6 @@ func Main(arch *sys.Arch, theArch Arch) {
|
||||
addstrdata1(ctxt, "runtime.defaultGOROOT="+final)
|
||||
addstrdata1(ctxt, "cmd/internal/objabi.defaultGOROOT="+final)
|
||||
|
||||
addstrdata1(ctxt, "runtime/internal/sys.GOEXPERIMENT="+objabi.GOEXPERIMENT)
|
||||
|
||||
// TODO(matloob): define these above and then check flag values here
|
||||
if ctxt.Arch.Family == sys.AMD64 && objabi.GOOS == "plan9" {
|
||||
flag.BoolVar(&flag8, "8", false, "use 64-bit addresses in symbol table")
|
||||
|
@ -532,7 +532,7 @@ func dumpparams() {
|
||||
dumpint(uint64(arenaStart))
|
||||
dumpint(uint64(arenaEnd))
|
||||
dumpstr(sys.GOARCH)
|
||||
dumpstr(sys.GOEXPERIMENT)
|
||||
dumpstr(buildVersion)
|
||||
dumpint(uint64(ncpu))
|
||||
}
|
||||
|
||||
|
@ -52,5 +52,3 @@ const MinFrameSize = _MinFrameSize
|
||||
// StackAlign is the required alignment of the SP register.
|
||||
// The stack must be at least word aligned, but some architectures require more.
|
||||
const StackAlign = _StackAlign
|
||||
|
||||
var GOEXPERIMENT string // set by cmd/link
|
||||
|
@ -5,7 +5,6 @@
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"internal/bytealg"
|
||||
"internal/cpu"
|
||||
"runtime/internal/atomic"
|
||||
"runtime/internal/sys"
|
||||
@ -6039,26 +6038,6 @@ func setMaxThreads(in int) (out int) {
|
||||
return
|
||||
}
|
||||
|
||||
func haveexperiment(name string) bool {
|
||||
// GOEXPERIMENT is a comma-separated list of enabled
|
||||
// experiments. It's not the raw environment variable, but a
|
||||
// pre-processed list from cmd/internal/objabi.
|
||||
x := sys.GOEXPERIMENT
|
||||
for x != "" {
|
||||
xname := ""
|
||||
i := bytealg.IndexByteString(x, ',')
|
||||
if i < 0 {
|
||||
xname, x = x, ""
|
||||
} else {
|
||||
xname, x = x[:i], x[i+1:]
|
||||
}
|
||||
if xname == name {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func procPin() int {
|
||||
_g_ := getg()
|
||||
|
Loading…
Reference in New Issue
Block a user