]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/objabi: add regabi GOEXPERIMENT
authorAustin Clements <austin@google.com>
Tue, 1 Sep 2020 15:16:33 +0000 (11:16 -0400)
committerAustin Clements <austin@google.com>
Thu, 3 Sep 2020 12:55:46 +0000 (12:55 +0000)
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 <cherryyz@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/internal/objabi/util.go

index 6c5a9ba4410fd7afa04993149d25a614d977127e..d2d6fdbda8d75ce038832c56fb44cd454bbd020d 100644 (file)
@@ -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()