diff options
| author | Michael Pratt <mpratt@google.com> | 2024-04-19 13:52:31 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-08-02 16:41:53 +0000 |
| commit | 4f7dc282c4bdfba4e63b39bbe9846c1469dc7ee5 (patch) | |
| tree | b4fa4f7de70120c25c408b85056ac30245cfaef9 /src/cmd/link/internal/ld/deadcode.go | |
| parent | 057b703407fa833193cbdc1f37179561c6c9da90 (diff) | |
| download | go-4f7dc282c4bdfba4e63b39bbe9846c1469dc7ee5.tar.xz | |
all: split old and swiss map abi and compiler integration
The two map implementations are still identical, but now the compiler
targets the appropriate ABI depending on GOEXPERIMENT.
For #54766.
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-amd64-longtest-swissmap
Change-Id: I8438f64f044ba9de30ddbf2b8ceb9b4edd2d5614
Reviewed-on: https://go-review.googlesource.com/c/go/+/580779
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/deadcode.go')
| -rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index 20609ed7bf..3d547259a1 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -552,8 +552,12 @@ func (d *deadcodePass) decodetypeMethods(ldr *loader.Loader, arch *sys.Arch, sym off += 3 * arch.PtrSize case abi.Chan: // reflect.chanType off += 2 * arch.PtrSize - case abi.Map: // reflect.mapType - off += 4*arch.PtrSize + 8 + case abi.Map: + if buildcfg.Experiment.SwissMap { + off += 4*arch.PtrSize + 8 // internal/abi.SwissMapType + } else { + off += 4*arch.PtrSize + 8 // internal/abi.OldMapType + } case abi.Interface: // reflect.interfaceType off += 3 * arch.PtrSize default: |
