diff options
| author | Austin Clements <austin@google.com> | 2018-10-29 18:21:00 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2018-11-03 15:12:34 +0000 |
| commit | 15265ec4217f8d9497d8d5079ac8996302dfd007 (patch) | |
| tree | 3b39f3c1ba44f756c7c4c466821feb69f23d52b5 /src/cmd/internal/obj/link.go | |
| parent | 441cb988b4c63f4232edd7930758eb0e8cc8599b (diff) | |
| download | go-15265ec4217f8d9497d8d5079ac8996302dfd007.tar.xz | |
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>
Diffstat (limited to 'src/cmd/internal/obj/link.go')
| -rw-r--r-- | src/cmd/internal/obj/link.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index f983d5277e..d924cbc214 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -403,9 +403,9 @@ type FuncInfo struct { dwarfAbsFnSym *LSym dwarfIsStmtSym *LSym - GCArgs LSym - GCLocals LSym - GCRegs LSym + GCArgs *LSym + GCLocals *LSym + GCRegs *LSym StackObjects *LSym } |
