By moving the bit field, we can reduce the miniExpr size by
8 bytes, reducing the sizes of Exprs embedding this type.
Hopefully we get a few types to a lower memory size class.
Change-Id: I4b1d4471cf905f998b26d235980e40ca91446f45
GitHub-Last-Rev:
6dea0bd27c38d9118d13d55052efcb4070b26751
GitHub-Pull-Request: golang/go#71823
Reviewed-on: https://go-review.googlesource.com/c/go/+/650435
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
// A miniExpr is a miniNode with extra fields common to expressions.
// TODO(rsc): Once we are sure about the contents, compact the bools
// into a bit field and leave extra bits available for implementations
-// embedding miniExpr. Right now there are ~60 unused bits sitting here.
+// embedding miniExpr. Right now there are ~24 unused bits sitting here.
type miniExpr struct {
miniNode
+ flags bitset8
typ *types.Type
init Nodes // TODO(rsc): Don't require every Node to have an init
- flags bitset8
}
const (
_64bit uintptr // size on 64bit platforms
}{
{Func{}, 184, 312},
- {Name{}, 96, 168},
+ {Name{}, 96, 160},
+ {miniExpr{}, 32, 48},
}
for _, tt := range tests {