]> Cypherpunks repositories - gostls13.git/commitdiff
reflect, runtime: drop RegabiArgs conditions
authorCherry Mui <cherryyz@google.com>
Wed, 16 Mar 2022 16:12:50 +0000 (12:12 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 18 Mar 2022 15:17:37 +0000 (15:17 +0000)
With the previous CL, internal/abi.IntArgRegs and FloatArgRegs
is controlled by RegabiArgs (or always enabled), so there is no
need to check for that goexperiment.

There are a few places we guard register-ABI specific code and
tests with the RegabiArgs flag. Switch to checking for the number
of argument registers instead.

Change-Id: I79fff9fd1e919684ffaf73aba9e7e85d5a9e1629
Reviewed-on: https://go-review.googlesource.com/c/go/+/393363
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/reflect/abi.go
src/runtime/debug_test.go
src/runtime/stubs.go
src/runtime/traceback_test.go

index 28204b81937fc3abbd464fd16657002cc1cd70c1..9957d237689043c04bffadca718be687ac9d9403 100644 (file)
@@ -7,7 +7,6 @@ package reflect
 import (
        "internal/abi"
        "internal/goarch"
-       "internal/goexperiment"
        "unsafe"
 )
 
@@ -30,9 +29,9 @@ import (
 // commented out there should be the actual values once
 // we're ready to use the register ABI everywhere.
 var (
-       intArgRegs   = abi.IntArgRegs * goexperiment.RegabiArgsInt
-       floatArgRegs = abi.FloatArgRegs * goexperiment.RegabiArgsInt
-       floatRegSize = uintptr(abi.EffectiveFloatRegSize * goexperiment.RegabiArgsInt)
+       intArgRegs   = abi.IntArgRegs
+       floatArgRegs = abi.FloatArgRegs
+       floatRegSize = uintptr(abi.EffectiveFloatRegSize)
 )
 
 // abiStep represents an ABI "instruction." Each instruction
index 5bb0c5cee3be8b122d2dad43ac88a2516324a425..7698eacb5957dcc2c84e205adb47e07b6b6d1490 100644 (file)
@@ -16,7 +16,6 @@ package runtime_test
 import (
        "fmt"
        "internal/abi"
-       "internal/goexperiment"
        "math"
        "os"
        "regexp"
@@ -144,7 +143,7 @@ func TestDebugCall(t *testing.T) {
        intRegs := regs.Ints[:]
        floatRegs := regs.Floats[:]
        fval := float64(42.0)
-       if goexperiment.RegabiArgs {
+       if len(intRegs) > 0 {
                intRegs[0] = 42
                floatRegs[0] = math.Float64bits(fval)
        } else {
@@ -159,7 +158,7 @@ func TestDebugCall(t *testing.T) {
        }
        var result0 int
        var result1 float64
-       if goexperiment.RegabiArgs {
+       if len(intRegs) > 0 {
                result0 = int(intRegs[0])
                result1 = math.Float64frombits(floatRegs[0])
        } else {
index ad78363bb67b1184a51eb75be1efff5f489c979a..cd7c91029b0f4cb60a3d3c95ee40a0479e6435b7 100644 (file)
@@ -7,7 +7,6 @@ package runtime
 import (
        "internal/abi"
        "internal/goarch"
-       "internal/goexperiment"
        "runtime/internal/math"
        "unsafe"
 )
@@ -434,4 +433,4 @@ func sigpanic0()
 // registers the system supports.
 //
 // Protected by finlock.
-var intArgRegs = abi.IntArgRegs * (goexperiment.RegabiArgsInt | goarch.IsAmd64)
+var intArgRegs = abi.IntArgRegs
index 7d8b04e14b732e2b1615f115cf563d92d9f1c4dd..e50bd95eadea4d1f09a53d8fd75982899f22e2ed 100644 (file)
@@ -6,7 +6,7 @@ package runtime_test
 
 import (
        "bytes"
-       "internal/goexperiment"
+       "internal/abi"
        "internal/testenv"
        "runtime"
        "strings"
@@ -23,7 +23,7 @@ func TestTracebackArgs(t *testing.T) {
        abiSel := func(x, y string) string {
                // select expected output based on ABI
                // In noopt build we always spill arguments so the output is the same as stack ABI.
-               if optimized && goexperiment.RegabiArgs {
+               if optimized && abi.IntArgRegs > 0 {
                        return x
                }
                return y