aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/objfile.go
diff options
context:
space:
mode:
authorshaharko <skohanim@gmail.com>2016-10-19 07:33:16 +0300
committerShahar Kohanim <skohanim@gmail.com>2016-10-25 19:44:06 +0000
commitd8d445280a6a7e5f3535e8b49e9ae248f2627759 (patch)
tree9924c85ccf22d27fd1d3d654435199b77c7571ce /src/cmd/internal/obj/objfile.go
parent5a9549260df1f5ffcbdd5938861fea9f74478661 (diff)
downloadgo-d8d445280a6a7e5f3535e8b49e9ae248f2627759.tar.xz
cmd/compile, cmd/link: more efficient typelink generation
Instead of generating typelink symbols in the compiler mark types that should have typelinks with a flag. The linker detects this flag and adds the marked types to the typelink table. name old s/op new s/op delta LinkCmdCompile 0.27 ± 6% 0.25 ± 6% -6.93% (p=0.000 n=97+98) LinkCmdGo 0.30 ± 5% 0.29 ±10% -4.22% (p=0.000 n=97+99) name old MaxRSS new MaxRSS delta LinkCmdCompile 112k ± 3% 106k ± 2% -4.85% (p=0.000 n=100+100) LinkCmdGo 107k ± 3% 103k ± 3% -3.00% (p=0.000 n=100+100) Change-Id: Ic95dd4b0101e90c1fa262c9c6c03a2028d6b3623 Reviewed-on: https://go-review.googlesource.com/31772 Run-TryBot: Shahar Kohanim <skohanim@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/objfile.go')
-rw-r--r--src/cmd/internal/obj/objfile.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go
index f8d61cd1c2..0a269afdca 100644
--- a/src/cmd/internal/obj/objfile.go
+++ b/src/cmd/internal/obj/objfile.go
@@ -52,7 +52,9 @@
// - type [int]
// - name & version [symref index]
// - flags [int]
-// 1 dupok
+// 1<<0 dupok
+// 1<<1 local
+// 1<<2 add to typelink table
// - size [int]
// - gotype [symref index]
// - p [data block]
@@ -395,6 +397,9 @@ func (w *objWriter) writeSym(s *LSym) {
if s.Local {
flags |= 1 << 1
}
+ if s.MakeTypelink {
+ flags |= 1 << 2
+ }
w.writeInt(flags)
w.writeInt(s.Size)
w.writeRefIndex(s.Gotype)