mirror of
https://github.com/golang/go
synced 2024-11-23 08:30:05 -07:00
reflect,runtime: assume register ABI with GOEXPERIMENT=regabiargs
This change causes finalizers, reflect calls, and Windows syscall callbacks to assume the register ABI when GOEXPERIMENT=regabiargs is set. That is, when all Go functions are using the new ABI by default, these features should assume the new ABI too. For #40724. Change-Id: Ie4ee66b8085b692e1ff675f01134c9a4703ae1b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/306571 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
51cd074c59
commit
27d306281c
@ -28,9 +28,9 @@ import (
|
|||||||
// commented out there should be the actual values once
|
// commented out there should be the actual values once
|
||||||
// we're ready to use the register ABI everywhere.
|
// we're ready to use the register ABI everywhere.
|
||||||
var (
|
var (
|
||||||
intArgRegs = 0 // abi.IntArgRegs
|
intArgRegs = abi.IntArgRegs * experimentRegabiArgs
|
||||||
floatArgRegs = 0 // abi.FloatArgRegs
|
floatArgRegs = abi.FloatArgRegs * experimentRegabiArgs
|
||||||
floatRegSize = uintptr(0) // uintptr(abi.EffectiveFloatRegSize)
|
floatRegSize = uintptr(abi.EffectiveFloatRegSize * experimentRegabiArgs)
|
||||||
)
|
)
|
||||||
|
|
||||||
// abiStep represents an ABI "instruction." Each instruction
|
// abiStep represents an ABI "instruction." Each instruction
|
||||||
|
10
src/reflect/regabiargs_off.go
Normal file
10
src/reflect/regabiargs_off.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright 2021 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build !goexperiment.regabiargs
|
||||||
|
// +build !goexperiment.regabiargs
|
||||||
|
|
||||||
|
package reflect
|
||||||
|
|
||||||
|
const experimentRegabiArgs = 0
|
10
src/reflect/regabiargs_on.go
Normal file
10
src/reflect/regabiargs_on.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright 2021 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build goexperiment.regabiargs
|
||||||
|
// +build goexperiment.regabiargs
|
||||||
|
|
||||||
|
package reflect
|
||||||
|
|
||||||
|
const experimentRegabiArgs = 1
|
10
src/runtime/regabiargs_off.go
Normal file
10
src/runtime/regabiargs_off.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright 2021 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build !goexperiment.regabiargs
|
||||||
|
// +build !goexperiment.regabiargs
|
||||||
|
|
||||||
|
package runtime
|
||||||
|
|
||||||
|
const experimentRegabiArgs = 0
|
10
src/runtime/regabiargs_on.go
Normal file
10
src/runtime/regabiargs_on.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// Copyright 2021 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build goexperiment.regabiargs
|
||||||
|
// +build goexperiment.regabiargs
|
||||||
|
|
||||||
|
package runtime
|
||||||
|
|
||||||
|
const experimentRegabiArgs = 1
|
@ -423,4 +423,4 @@ func sigpanic0()
|
|||||||
// everywhere.
|
// everywhere.
|
||||||
//
|
//
|
||||||
// Protected by finlock.
|
// Protected by finlock.
|
||||||
var intArgRegs = 0 // abi.IntArgRegs
|
var intArgRegs = abi.IntArgRegs * experimentRegabiArgs
|
||||||
|
Loading…
Reference in New Issue
Block a user