New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime, cmd/compile: share more constants #59670
Comments
Change https://go.dev/cl/485195 mentions this issue: |
For anyone curious, here are the duplicated constants my little tool found. Some of these are only coincidental, but most are real duplicates.
|
Change https://go.dev/cl/485495 mentions this issue: |
Change https://go.dev/cl/485496 mentions this issue: |
Change https://go.dev/cl/485497 mentions this issue: |
Change https://go.dev/cl/486381 mentions this issue: |
Change https://go.dev/cl/486379 mentions this issue: |
Change https://go.dev/cl/486380 mentions this issue: |
…ternal/abi For #59670. Change-Id: I04a17079b351b9b4999ca252825373c17afb8a88 Reviewed-on: https://go-review.googlesource.com/c/go/+/486379 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
The current definitions of StackLimit and StackGuard only indirectly specify the NOSPLIT stack limit and duplicate a literal constant (928). Currently, they define the stack guard delta, and from there compute the NOSPLIT limit. Rationalize these by defining a new constant, abi.StackNosplitBase, which consolidates and directly specifies the NOSPLIT stack limit (in the default case). From this we then compute the stack guard delta, inverting the relationship between these two constants. While we're here, we rename StackLimit to StackNosplit to make it clearer what's being limited. This change does not affect the values of these constants in the default configuration. It does slightly change how StackGuardMultiplier values other than 1 affect the constants, but this multiplier is a pretty rough heuristic anyway. before after stackNosplit 800 800 _StackGuard 928 928 stackNosplit -race 1728 1600 _StackGuard -race 1856 1728 For #59670. Change-Id: Ibe20825ebe0076bbd7b0b7501177b16c9dbcb79e Reviewed-on: https://go-review.googlesource.com/c/go/+/486380 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
For #59670. Change-Id: I4476d6f92663e8a825d063d6e6a7fc9a2ac99d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/486381 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Change https://go.dev/cl/486975 mentions this issue: |
Change https://go.dev/cl/486977 mentions this issue: |
Change https://go.dev/cl/486976 mentions this issue: |
For #59670. Change-Id: I517e97ea74cf232e5cfbb77b127fa8804f74d84b Reviewed-on: https://go-review.googlesource.com/c/go/+/485495 Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com>
For #59670. Change-Id: Ie784ba4dd2701e4f455e1abde4a6bfebee4b1387 Reviewed-on: https://go-review.googlesource.com/c/go/+/485496 Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Austin Clements <austin@google.com> Auto-Submit: Austin Clements <austin@google.com>
… internal/abi We also rename the constants related to unsafe-points: currently, they follow the same naming scheme as the PCDATA table indexes, but are not PCDATA table indexes. For #59670. Change-Id: I06529fecfae535be5fe7d9ac56c886b9106c74fd Reviewed-on: https://go-review.googlesource.com/c/go/+/485497 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
…ternal/abi For #59670. Change-Id: I91448363be2fc678964ce119d85cd5fae34a14da Reviewed-on: https://go-review.googlesource.com/c/go/+/486975 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Austin Clements <austin@google.com> Auto-Submit: Austin Clements <austin@google.com>
The current definitions of StackLimit and StackGuard only indirectly specify the NOSPLIT stack limit and duplicate a literal constant (928). Currently, they define the stack guard delta, and from there compute the NOSPLIT limit. Rationalize these by defining a new constant, abi.StackNosplitBase, which consolidates and directly specifies the NOSPLIT stack limit (in the default case). From this we then compute the stack guard delta, inverting the relationship between these two constants. While we're here, we rename StackLimit to StackNosplit to make it clearer what's being limited. This change does not affect the values of these constants in the default configuration. It does slightly change how StackGuardMultiplier values other than 1 affect the constants, but this multiplier is a pretty rough heuristic anyway. before after stackNosplit 800 800 _StackGuard 928 928 stackNosplit -race 1728 1600 _StackGuard -race 1856 1728 For #59670. Change-Id: Ia94094c5e47897e7c088d24b4a5e33f5c2768db5 Reviewed-on: https://go-review.googlesource.com/c/go/+/486976 Auto-Submit: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
For #59670. Change-Id: I0efa743edc08e48dc8d906803ba45e9f641369db Reviewed-on: https://go-review.googlesource.com/c/go/+/486977 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com>
Change https://go.dev/cl/494795 mentions this issue: |
method -> Method For #59670 Change-Id: I78e0410f3d5094aa12b2f3ccd6735fec0d696190 Reviewed-on: https://go-review.googlesource.com/c/go/+/494795 Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com>
This is much better than it was! Taking another pass through the common constants, I think these could still be merged: _dotdotdot src/runtime/traceback.go:657:3 _endAgg src/runtime/traceback.go:656:3 _endSeq src/runtime/traceback.go:654:3 _offsetTooLarge src/runtime/traceback.go:658:3 _startAgg src/runtime/traceback.go:655:3 boundsIndex src/runtime/error.go:127:2 boundsSlice3Acap src/runtime/error.go:134:2 boundsSlice3Alen src/runtime/error.go:133:2 boundsSlice3B src/runtime/error.go:135:2 boundsSlice3C src/runtime/error.go:136:2 boundsSliceAcap src/runtime/error.go:130:2 bucketCnt src/runtime/map.go:67:2 flagAddr src/internal/reflectlite/value.go:73:2 flagEmbedRO src/internal/reflectlite/value.go:71:2 flagIndir src/internal/reflectlite/value.go:72:2 flagKindWidth src/internal/reflectlite/value.go:68:2 flagMethod src/internal/reflectlite/value.go:74:2 flagMethodShift src/internal/reflectlite/value.go:75:2 flagRO src/internal/reflectlite/value.go:76:2 flagStickyRO src/internal/reflectlite/value.go:70:2 kindArray src/runtime/typekind.go:24:2 kindBool src/runtime/typekind.go:8:2 kindChan src/runtime/typekind.go:25:2 kindComplex128 src/runtime/typekind.go:23:2 kindComplex64 src/runtime/typekind.go:22:2 kindDirectIface src/runtime/typekind.go:35:2 kindFloat32 src/runtime/typekind.go:20:2 kindFloat64 src/runtime/typekind.go:21:2 kindFunc src/runtime/typekind.go:26:2 kindGCProg src/runtime/typekind.go:36:2 kindInt src/runtime/typekind.go:9:2 kindInt16 src/runtime/typekind.go:11:2 kindInt32 src/runtime/typekind.go:12:2 kindInt64 src/runtime/typekind.go:13:2 kindInt8 src/runtime/typekind.go:10:2 kindInterface src/runtime/typekind.go:27:2 kindMap src/runtime/typekind.go:28:2 kindMask src/runtime/typekind.go:37:2 kindPtr src/runtime/typekind.go:29:2 kindSlice src/runtime/typekind.go:30:2 kindString src/runtime/typekind.go:31:2 kindStruct src/runtime/typekind.go:32:2 kindUint src/runtime/typekind.go:14:2 kindUint16 src/runtime/typekind.go:16:2 kindUint32 src/runtime/typekind.go:17:2 kindUint64 src/runtime/typekind.go:18:2 kindUint8 src/runtime/typekind.go:15:2 kindUintptr src/runtime/typekind.go:19:2 kindUnsafePointer src/runtime/typekind.go:33:2 limit src/runtime/traceback.go:662:3 maxDepth src/runtime/traceback.go:663:3 maxElemSize src/runtime/map.go:80:2 maxInt64 src/runtime/string.go:354:2 maxKeySize src/runtime/map.go:79:2 maxLen src/runtime/traceback.go:664:3 maxPtrmaskBytes src/reflect/type.go:2617:7 maxValSize src/reflect/type.go:1955:2 maxZero src/runtime/map.go:1439:7 minfunc src/runtime/symtab.go:501:7 pcbucketsize src/runtime/symtab.go:502:7 selectDefault src/runtime/select.go:538:2 selectRecv src/runtime/select.go:537:2 selectSend src/runtime/select.go:536:2 |
CL 462115 merged a few constants that were duplicated between several runtime-related and toolchain-related packages into a single
internal/abi
package. This is an internal cleanup tracking issue for merging more of these constants.The text was updated successfully, but these errors were encountered: