]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: remove gc programs from stack frame objects
authorKeith Randall <khr@golang.org>
Wed, 15 Nov 2023 21:38:06 +0000 (13:38 -0800)
committerKeith Randall <khr@golang.org>
Mon, 18 Nov 2024 18:43:25 +0000 (18:43 +0000)
commit5a0f2a7a7c5658f4f3065c265cee61ec1bde9691
tree7252ff8068e5573b0205d38f83cc0e126d92bf1c
parentd4b0bd28eef0a212930fb196230171a9f11e5ec4
cmd/compile: remove gc programs from stack frame objects

This is a two-pronged approach. First, try to keep large objects
off the stack frame. Second, if they do manage to appear anyway,
use straight bitmasks instead of gc programs.

Generally probably a good idea to keep large objects out of stack frames.
But particularly keeping gc programs off the stack simplifies
runtime code a bit.

This CL sets the limit of most stack objects to 131072 bytes (on 64-bit archs).
There can still be large objects if allocated by a late pass, like order, or
they are required to be on the stack, like function arguments.
But the size for the bitmasks for these objects isn't a huge deal,
as we have already have (probably several) bitmasks for the frame
liveness map itself.

Change-Id: I6d2bed0e9aa9ac7499955562c6154f9264061359
Reviewed-on: https://go-review.googlesource.com/c/go/+/542815
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/ir/cfg.go
src/cmd/compile/internal/liveness/plive.go
src/cmd/compile/internal/reflectdata/reflect.go
src/runtime/mgcmark.go
src/runtime/stack.go
src/runtime/stkframe.go
test/fixedbugs/bug385_64.go
test/fixedbugs/issue39292.go