Skip to content

Commit d8bee94

Browse files
committed
reflect, runtime: drop RegabiArgs conditions
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 <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Run-TryBot: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 3684abb commit d8bee94

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

src/reflect/abi.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package reflect
77
import (
88
"internal/abi"
99
"internal/goarch"
10-
"internal/goexperiment"
1110
"unsafe"
1211
)
1312

@@ -30,9 +29,9 @@ import (
3029
// commented out there should be the actual values once
3130
// we're ready to use the register ABI everywhere.
3231
var (
33-
intArgRegs = abi.IntArgRegs * goexperiment.RegabiArgsInt
34-
floatArgRegs = abi.FloatArgRegs * goexperiment.RegabiArgsInt
35-
floatRegSize = uintptr(abi.EffectiveFloatRegSize * goexperiment.RegabiArgsInt)
32+
intArgRegs = abi.IntArgRegs
33+
floatArgRegs = abi.FloatArgRegs
34+
floatRegSize = uintptr(abi.EffectiveFloatRegSize)
3635
)
3736

3837
// abiStep represents an ABI "instruction." Each instruction

src/runtime/debug_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package runtime_test
1616
import (
1717
"fmt"
1818
"internal/abi"
19-
"internal/goexperiment"
2019
"math"
2120
"os"
2221
"regexp"
@@ -144,7 +143,7 @@ func TestDebugCall(t *testing.T) {
144143
intRegs := regs.Ints[:]
145144
floatRegs := regs.Floats[:]
146145
fval := float64(42.0)
147-
if goexperiment.RegabiArgs {
146+
if len(intRegs) > 0 {
148147
intRegs[0] = 42
149148
floatRegs[0] = math.Float64bits(fval)
150149
} else {
@@ -159,7 +158,7 @@ func TestDebugCall(t *testing.T) {
159158
}
160159
var result0 int
161160
var result1 float64
162-
if goexperiment.RegabiArgs {
161+
if len(intRegs) > 0 {
163162
result0 = int(intRegs[0])
164163
result1 = math.Float64frombits(floatRegs[0])
165164
} else {

src/runtime/stubs.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package runtime
77
import (
88
"internal/abi"
99
"internal/goarch"
10-
"internal/goexperiment"
1110
"runtime/internal/math"
1211
"unsafe"
1312
)
@@ -434,4 +433,4 @@ func sigpanic0()
434433
// registers the system supports.
435434
//
436435
// Protected by finlock.
437-
var intArgRegs = abi.IntArgRegs * (goexperiment.RegabiArgsInt | goarch.IsAmd64)
436+
var intArgRegs = abi.IntArgRegs

src/runtime/traceback_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package runtime_test
66

77
import (
88
"bytes"
9-
"internal/goexperiment"
9+
"internal/abi"
1010
"internal/testenv"
1111
"runtime"
1212
"strings"
@@ -23,7 +23,7 @@ func TestTracebackArgs(t *testing.T) {
2323
abiSel := func(x, y string) string {
2424
// select expected output based on ABI
2525
// In noopt build we always spill arguments so the output is the same as stack ABI.
26-
if optimized && goexperiment.RegabiArgs {
26+
if optimized && abi.IntArgRegs > 0 {
2727
return x
2828
}
2929
return y

0 commit comments

Comments
 (0)