From: Austin Clements Date: Tue, 1 Sep 2020 15:16:33 +0000 (-0400) Subject: cmd/internal/objabi: add regabi GOEXPERIMENT X-Git-Tag: go1.16beta1~1132 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2b8b06ebbf0198d3c7a9b4d839bc05d9b13ecbe7;p=gostls13.git cmd/internal/objabi: add regabi GOEXPERIMENT This is the "feature flag" for the register calling convention work (though since this work is expected to extend over a few releases, it's not version-prefixed). This will let us develop the register calling convention on the main branch while maintaining an easy toggle between the old and new ABIs. Updates #40724. Change-Id: I129c8d87d34e6fa0910b6fa43efb35b706021637 Reviewed-on: https://go-review.googlesource.com/c/go/+/252257 Reviewed-by: Cherry Zhang Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/internal/objabi/util.go b/src/cmd/internal/objabi/util.go index 6c5a9ba441..d2d6fdbda8 100644 --- a/src/cmd/internal/objabi/util.go +++ b/src/cmd/internal/objabi/util.go @@ -131,6 +131,11 @@ func init() { addexp(f) } } + + // regabi is only supported on amd64. + if GOARCH != "amd64" { + Regabi_enabled = 0 + } } // Note: must agree with runtime.framepointer_enabled. @@ -161,6 +166,7 @@ var ( Fieldtrack_enabled int Preemptibleloops_enabled int Staticlockranking_enabled int + Regabi_enabled int ) // Toolchain experiments. @@ -174,6 +180,7 @@ var exper = []struct { {"fieldtrack", &Fieldtrack_enabled}, {"preemptibleloops", &Preemptibleloops_enabled}, {"staticlockranking", &Staticlockranking_enabled}, + {"regabi", &Regabi_enabled}, } var defaultExpstring = Expstring()