]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: prevent duplicated works in WriteRuntimeTypes
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 8 Jun 2021 12:28:45 +0000 (19:28 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 19 Aug 2021 16:10:32 +0000 (16:10 +0000)
commit91e2e3b9030440713b59dcc7dd9deae71b18d9fc
tree4f96a7b3d7d9a2cc4c4a39619dbf3786c44696f7
parent9871726c72af7009aa73be33edfa06a8d9e5965e
cmd/compile: prevent duplicated works in WriteRuntimeTypes

While processing signatset, the entry is deleted immediately after being
pushed to signatslice. Then calling writeType may add the same type
to signatset again. That would add more works, though not a big impact
to the performace, since when writeType is guarded by s.Siggen() check.

Instead, we should keep the entry in signatset, so written type will
never be added again.

This change does not affect compiler performace, but help debugging
issue like one in #46386 easier.

Change-Id: Iddafe773885fa21cb7003ba27ddf9554fc3f297d
Reviewed-on: https://go-review.googlesource.com/c/go/+/326029
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/reflectdata/reflect.go