mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
all: explode GOEXPERIMENT=regabi into 5 sub-experiments
This separates GOEXPERIMENT=regabi into five sub-experiments: regabiwrappers, regabig, regabireflect, regabidefer, and regabiargs. Setting GOEXPERIMENT=regabi now implies the working subset of these (currently, regabiwrappers, regabig, and regabireflect). This simplifies testing, helps derisk the register ABI project, and will also help with performance comparisons. This replaces the -abiwrap flag to the compiler and linker with the regabiwrappers experiment. As part of this, regabiargs now enables registers for all calls in the compiler. Previously, this was statically disabled in regabiEnabledForAllCompilation, but now that we can control it independently, this isn't necessary. For #40724. Change-Id: I5171e60cda6789031f2ef034cc2e7c5d62459122 Reviewed-on: https://go-review.googlesource.com/c/go/+/302070 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: David Chase <drchase@google.com>
This commit is contained in:
parent
c71acbfe83
commit
eaa1ddee84
20 changed files with 131 additions and 60 deletions
|
|
@ -46,12 +46,30 @@ func NewInput(name string) *Input {
|
|||
func predefine(defines flags.MultiFlag) map[string]*Macro {
|
||||
macros := make(map[string]*Macro)
|
||||
|
||||
if *flags.CompilingRuntime && objabi.Regabi_enabled != 0 {
|
||||
const name = "GOEXPERIMENT_REGABI"
|
||||
macros[name] = &Macro{
|
||||
name: name,
|
||||
args: nil,
|
||||
tokens: Tokenize("1"),
|
||||
// Set macros for various GOEXPERIMENTs so we can easily
|
||||
// switch runtime assembly code based on them.
|
||||
if *flags.CompilingRuntime {
|
||||
set := func(name string) {
|
||||
macros[name] = &Macro{
|
||||
name: name,
|
||||
args: nil,
|
||||
tokens: Tokenize("1"),
|
||||
}
|
||||
}
|
||||
if objabi.Experiment.RegabiWrappers {
|
||||
set("GOEXPERIMENT_REGABI_WRAPPERS")
|
||||
}
|
||||
if objabi.Experiment.RegabiG {
|
||||
set("GOEXPERIMENT_REGABI_G")
|
||||
}
|
||||
if objabi.Experiment.RegabiReflect {
|
||||
set("GOEXPERIMENT_REGABI_REFLECT")
|
||||
}
|
||||
if objabi.Experiment.RegabiDefer {
|
||||
set("GOEXPERIMENT_REGABI_DEFER")
|
||||
}
|
||||
if objabi.Experiment.RegabiArgs {
|
||||
set("GOEXPERIMENT_REGABI_ARGS")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue