From: Mateusz Poliwczak Date: Wed, 19 Feb 2025 07:15:19 +0000 (+0000) Subject: cmd/compile/internal/ir: correct doc comment, miniNode in now 12 bytes X-Git-Tag: go1.25rc1~979 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7a33f793e83ad2ee8a271769df66346865bae9fe;p=gostls13.git cmd/compile/internal/ir: correct doc comment, miniNode in now 12 bytes Change-Id: I5887565077f598bc7e3edc4b78188956fb13cdaa GitHub-Last-Rev: 479a04b42e9dc2ffc72cb599ebb12b8fc669fe20 GitHub-Pull-Request: golang/go#71822 Reviewed-on: https://go-review.googlesource.com/c/go/+/650415 Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Auto-Submit: Keith Randall Reviewed-by: Michael Knyszek --- diff --git a/src/cmd/compile/internal/ir/mini.go b/src/cmd/compile/internal/ir/mini.go index 52c622df23..70897fc3f9 100644 --- a/src/cmd/compile/internal/ir/mini.go +++ b/src/cmd/compile/internal/ir/mini.go @@ -15,7 +15,7 @@ import ( // A miniNode is a minimal node implementation, // meant to be embedded as the first field in a larger node implementation, -// at a cost of 8 bytes. +// at a cost of 12 bytes. // // A miniNode is NOT a valid Node by itself: the embedding struct // must at the least provide: @@ -28,8 +28,8 @@ import ( // for more useful panic messages when invalid methods are called, // instead of implementing Op itself. type miniNode struct { - pos src.XPos // uint32 - op Op // uint8 + pos src.XPos + op Op bits bitset8 esc uint16 } diff --git a/src/cmd/compile/internal/ir/sizeof_test.go b/src/cmd/compile/internal/ir/sizeof_test.go index 1715bad0c1..14b6b4f3cd 100644 --- a/src/cmd/compile/internal/ir/sizeof_test.go +++ b/src/cmd/compile/internal/ir/sizeof_test.go @@ -23,6 +23,7 @@ func TestSizeof(t *testing.T) { {Func{}, 184, 312}, {Name{}, 96, 160}, {miniExpr{}, 32, 48}, + {miniNode{}, 12, 12}, } for _, tt := range tests {