]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.typeparams] internal/buildcfg: always enable regabi on AMD64
authorCherry Mui <cherryyz@google.com>
Mon, 2 Aug 2021 16:18:19 +0000 (12:18 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 11 Aug 2021 16:59:43 +0000 (16:59 +0000)
In Go 1.17 we added register ABI on AMD64 on Linux/macOS/Windows
as a GOEXPERIMENT, on by default. In Go 1.18, we commit to always
enabling register ABI on AMD64.

Now "go build" for AMD64 always have goexperiment.regabi* tags
set. However, at bootstrapping cmd/dist does not set the tags
when building go_bootstrap. For this to work, unfortunately, we
need to hard-code AMD64 to use register ABI in runtime code.

Change-Id: I0b31e678e186b9cdeeb8502cd9e38ed0d7e72d4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/341151
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/internal/abi/abi_amd64.go
src/internal/abi/abi_generic.go
src/internal/buildcfg/exp.go
src/runtime/stubs.go

index aff71f6a58a9553a7bc7175dfb287cf13e907d8b..d3c567822311b162b2ff2be048361bb5ac1819eb 100644 (file)
@@ -2,9 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build goexperiment.regabireflect
-// +build goexperiment.regabireflect
-
 package abi
 
 const (
index 69400f930fb12b50b1df1a24a89aaa0e577d17b5..e8f94f805f57e8198c295acf97a6272b3884f3af 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build !goexperiment.regabireflect
-// +build !goexperiment.regabireflect
+//go:build !goexperiment.regabireflect && !amd64
+// +build !goexperiment.regabireflect,!amd64
 
 package abi
 
index 0245574ec1c2c87d219487922556ac775d46b422..384f2f96af1a89b9e202bb04a0e980b17f401587 100644 (file)
@@ -105,9 +105,11 @@ func ParseGOEXPERIMENT(goos, goarch, goexp string) (flags, baseline goexperiment
                }
        }
 
-       // regabiwrappers is always enabled on amd64.
+       // regabi is always enabled on amd64.
        if goarch == "amd64" {
                flags.RegabiWrappers = true
+               flags.RegabiReflect = true
+               flags.RegabiArgs = true
        }
        // regabi is only supported on amd64 and arm64.
        if goarch != "amd64" && goarch != "arm64" {
index fc29a1bac3192377156b817438505ac2c61b47c3..8a520d7839e31e4fc7180f5e38b88be015c778e7 100644 (file)
@@ -6,6 +6,7 @@ package runtime
 
 import (
        "internal/abi"
+       "internal/goarch"
        "internal/goexperiment"
        "unsafe"
 )
@@ -419,12 +420,5 @@ func sigpanic0()
 // structure that is at least large enough to hold the
 // registers the system supports.
 //
-// Currently it's set to zero because using the actual
-// constant will break every part of the toolchain that
-// uses finalizers or Windows callbacks to call functions
-// The value that is currently commented out there should be
-// the actual value once we're ready to use the register ABI
-// everywhere.
-//
 // Protected by finlock.
-var intArgRegs = abi.IntArgRegs * goexperiment.RegabiArgsInt
+var intArgRegs = abi.IntArgRegs * (goexperiment.RegabiArgsInt | goarch.IsAmd64)