]> Cypherpunks repositories - gostls13.git/commit
cmd/compile,internal/runtime/maps: stack allocated maps and small alloc
authorMichael Pratt <mpratt@google.com>
Fri, 25 Oct 2024 19:08:54 +0000 (15:08 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 30 Oct 2024 15:43:54 +0000 (15:43 +0000)
commit63ba2b9d84dede1df107db30b4ff8139711402eb
treeab604c55740391f9205499bd0745685191a91020
parentaefb173b0a1c1edfdd631b8b4ac752b947ab80a8
cmd/compile,internal/runtime/maps: stack allocated maps and small alloc

The compiler will stack allocate the Map struct and initial group if
possible.

Stack maps are initialized inline without calling into the runtime.
Small heap allocated maps use makemap_small.

These are the same heuristics as existing maps.

For #54766.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest-swissmap
Change-Id: I6c371d1309716fd1c38a3212d417b3c76db5c9b9
Reviewed-on: https://go-review.googlesource.com/c/go/+/622042
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
13 files changed:
src/cmd/compile/internal/typecheck/_builtin/runtime.go
src/cmd/compile/internal/typecheck/builtin.go
src/cmd/compile/internal/walk/builtin.go
src/internal/abi/map_swiss.go
src/internal/runtime/maps/export_test.go
src/internal/runtime/maps/map.go
src/runtime/map_swiss.go
test/live.go
test/live_noswiss.go [deleted file]
test/live_regabi.go
test/live_regabi_noswiss.go [deleted file]
test/live_regabi_swiss.go [deleted file]
test/live_swiss.go [deleted file]