diff options
| author | Keith Randall <khr@golang.org> | 2024-11-14 16:58:07 -0800 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2024-11-17 20:17:05 +0000 |
| commit | 63f762bcdea96889d8ffa406804665b84bda63ab (patch) | |
| tree | 6ec8508a506b512742af1d3415116f90d67ad7be /src/cmd/link/internal/ld | |
| parent | 04807d3acf160b270fbec42b7b672d531dec06b7 (diff) | |
| download | go-63f762bcdea96889d8ffa406804665b84bda63ab.tar.xz | |
internal/runtime/maps: eliminate a load from the hot path
typ.Group.Size involves two loads.
Instead cache GroupSize as a separate fields of the map type
so we can get to it in just one load.
Change-Id: I10ffdce1c7f75dcf448da14040fda78f0d75fd1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/627716
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/link/internal/ld')
| -rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index b9a15767e7..cdf7deb31b 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -561,7 +561,7 @@ func (d *deadcodePass) decodetypeMethods(ldr *loader.Loader, arch *sys.Arch, sym off += 2 * arch.PtrSize case abi.Map: if buildcfg.Experiment.SwissMap { - off += 6*arch.PtrSize + 4 // internal/abi.SwissMapType + off += 7*arch.PtrSize + 4 // internal/abi.SwissMapType if arch.PtrSize == 8 { off += 4 // padding for final uint32 field (Flags). } |
