reflect: sort exported methods first

By moving exported methods to the front of method lists, filtering
down to only the exported methods just needs a count of how many
exported methods exist, which the compiler can statically
provide. This allows getting rid of the exported method cache.

For #22075.

Change-Id: I8eeb274563a2940e1347c34d673f843ae2569064
Reviewed-on: https://go-review.googlesource.com/100846
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Matthew Dempsky 2018-03-15 13:40:57 -07:00
parent 91bbe5388d
commit 86a338960d
5 changed files with 60 additions and 75 deletions

View file

@ -329,7 +329,7 @@ type method struct {
type uncommontype struct {
pkgpath nameOff
mcount uint16 // number of methods
_ uint16 // unused
xcount uint16 // number of exported methods
moff uint32 // offset from this uncommontype to [mcount]method
_ uint32 // unused
}