From 4f7dc282c4bdfba4e63b39bbe9846c1469dc7ee5 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 19 Apr 2024 13:52:31 -0400 Subject: 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 Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI Auto-Submit: Michael Pratt --- src/cmd/link/internal/ld/deadcode.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/cmd/link/internal/ld/deadcode.go') 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: -- cgit v1.3