]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: avoid duplicate GC bitmap symbols
authorAustin Clements <austin@google.com>
Mon, 29 Oct 2018 22:21:00 +0000 (18:21 -0400)
committerAustin Clements <austin@google.com>
Sat, 3 Nov 2018 15:12:34 +0000 (15:12 +0000)
commit15265ec4217f8d9497d8d5079ac8996302dfd007
tree3b39f3c1ba44f756c7c4c466821feb69f23d52b5
parent441cb988b4c63f4232edd7930758eb0e8cc8599b
cmd/compile: avoid duplicate GC bitmap symbols

Currently, liveness produces a distinct obj.LSym for each GC bitmap
for each function. These are then named by content hash and only
ultimately deduplicated by WriteObjFile.

For various reasons (see next commit), we want to remove this
deduplication behavior from WriteObjFile. Furthermore, it's
inefficient to produce these duplicate symbols in the first place.

GC bitmaps are the only source of duplicate symbols in the compiler.
This commit eliminates these duplicate symbols by declaring them in
the Ctxt symbol hash just like every other obj.LSym. As a result, all
GC bitmaps with the same content now refer to the same obj.LSym.

The next commit will remove deduplication from WriteObjFile.

For #27539.

Change-Id: I4f15e3d99530122cdf473b7a838c69ef5f79db59
Reviewed-on: https://go-review.googlesource.com/c/146557
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/obj.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/plist.go