Documentation ¶
Overview ¶
Package goexperiment implements support for toolchain experiments.
Toolchain experiments are controlled by the GOEXPERIMENT environment variable. GOEXPERIMENT is a comma-separated list of experiment names. GOEXPERIMENT can be set at make.bash time, which sets the default experiments for binaries built with the tool chain; or it can be set at build time. GOEXPERIMENT can also be set to "none", which disables any experiments that were enabled at make.bash time.
Experiments are exposed to the build in the following ways:
- Build tag goexperiment.x is set if experiment x (lower case) is enabled.
- For each experiment x (in camel case), this package contains a boolean constant x and an integer constant xInt.
- In runtime assembly, the macro GOEXPERIMENT_x is defined if experiment x (lower case) is enabled.
In the toolchain, the set of experiments enabled for the current build should be accessed via objabi.Experiment.
The set of experiments is included in the output of runtime.Version() and "go version <binary>" if it differs from the default experiments.
For the set of experiments supported by the current toolchain, see "go doc goexperiment.Flags".
Note that this package defines the set of experiments (in Flags) and records the experiments that were enabled when the package was compiled (as boolean and integer constants).
Note especially that this package does not itself change behavior at run time based on the GOEXPERIMENT variable. The code used in builds to interpret the GOEXPERIMENT variable is in the separate package internal/buildcfg.
Index ¶
Constants ¶
const AllocHeaders = false
const AllocHeadersInt = 0
const Arenas = false
const ArenasInt = 0
const BoringCrypto = false
const BoringCryptoInt = 0
const CacheProg = false
const CacheProgInt = 0
const CgoCheck2 = false
const CgoCheck2Int = 0
const CoverageRedesign = false
const CoverageRedesignInt = 0
const ExecTracer2 = false
const ExecTracer2Int = 0
const FieldTrack = false
const FieldTrackInt = 0
const HeapMinimum512KiB = false
const HeapMinimum512KiBInt = 0
const LoopVar = false
const LoopVarInt = 0
const NewInliner = false
const NewInlinerInt = 0
const PageTrace = false
const PageTraceInt = 0
const PreemptibleLoops = false
const PreemptibleLoopsInt = 0
const RangeFunc = false
const RangeFuncInt = 0
const RegabiArgs = false
const RegabiArgsInt = 0
const RegabiWrappers = false
const RegabiWrappersInt = 0
const StaticLockRanking = false
const StaticLockRankingInt = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flags ¶
type Flags struct { FieldTrack bool PreemptibleLoops bool StaticLockRanking bool BoringCrypto bool // RegabiWrappers enables ABI wrappers for calling between // ABI0 and ABIInternal functions. Without this, the ABIs are // assumed to be identical so cross-ABI calls are direct. RegabiWrappers bool // RegabiArgs enables register arguments/results in all // compiled Go functions. // // Requires wrappers (to do ABI translation), and reflect (so // reflection calls use registers). RegabiArgs bool // HeapMinimum512KiB reduces the minimum heap size to 512 KiB. // // This was originally reduced as part of PacerRedesign, but // has been broken out to its own experiment that is disabled // by default. HeapMinimum512KiB bool // CoverageRedesign enables the new compiler-based code coverage // tooling. CoverageRedesign bool // Arenas causes the "arena" standard library package to be visible // to the outside world. Arenas bool // PageTrace enables GODEBUG=pagetrace=/path/to/result. This feature // is a GOEXPERIMENT due to a security risk with setuid binaries: // this compels the Go runtime to write to some arbitrary file, which // may be exploited. PageTrace bool // CgoCheck2 enables an expensive cgo rule checker. // When this experiment is enabled, cgo rule checks occur regardless // of the GODEBUG=cgocheck setting provided at runtime. CgoCheck2 bool // LoopVar changes loop semantics so that each iteration gets its own // copy of the iteration variable. LoopVar bool // CacheProg adds support to cmd/go to use a child process to implement // the build cache; see https://github.com/golang/go/issues/59719. CacheProg bool // NewInliner enables a new+improved version of the function // inlining phase within the Go compiler. NewInliner bool // RangeFunc enables range over func. RangeFunc bool // Range enables range over int and func. Range bool // AllocHeaders enables a different, more efficient way for the GC to // manage heap metadata. AllocHeaders bool // ExecTracer2 controls whether to use the new execution trace // implementation. ExecTracer2 bool }
Flags is the set of experiments that can be enabled or disabled in the current toolchain.
When specified in the GOEXPERIMENT environment variable or as build tags, experiments use the strings.ToLower of their field name.
For the baseline experimental configuration, see objabi.experimentBaseline.
If you change this struct definition, run "go generate".
Source Files ¶
- exp_allocheaders_off.go
- exp_arenas_off.go
- exp_boringcrypto_off.go
- exp_cacheprog_off.go
- exp_cgocheck2_off.go
- exp_coverageredesign_off.go
- exp_exectracer2_off.go
- exp_fieldtrack_off.go
- exp_heapminimum512kib_off.go
- exp_loopvar_off.go
- exp_newinliner_off.go
- exp_pagetrace_off.go
- exp_preemptibleloops_off.go
- exp_rangefunc_off.go
- exp_regabiargs_off.go
- exp_regabiwrappers_off.go
- exp_staticlockranking_off.go
- flags.go