From 5eb98b3c3016c7dd10d71ee15bb6fc5d3128bec9 Mon Sep 17 00:00:00 2001 From: Yury Smolsky Date: Fri, 8 Jun 2018 00:25:12 +0300 Subject: [PATCH] cmd/compile: use expandable columns in ssa.html Display just a few columns in ssa.html, other columns can be expanded by clicking on collapsed column. Use sans serif font for the text, slightly smaller font size for non program text. Fixes #25286 Change-Id: I1094695135401602d90b97b69e42f6dda05871a2 Reviewed-on: https://go-review.googlesource.com/117275 Run-TryBot: Yury Smolsky TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/ssa.go | 2 +- src/cmd/compile/internal/ssa/compile.go | 4 +- src/cmd/compile/internal/ssa/html.go | 95 +++++++++++++++++++++++-- 3 files changed, 93 insertions(+), 8 deletions(-) diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index a64d2122330..3c15c8e555a 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -4985,7 +4985,7 @@ func genssa(f *ssa.Func, pp *Progs) { } buf.WriteString("") buf.WriteString("") - f.HTMLWriter.WriteColumn("genssa", "ssa-prog", buf.String()) + f.HTMLWriter.WriteColumn("genssa", "genssa", "ssa-prog", buf.String()) // pp.Text.Ctxt.LineHist.PrintFilenameOnly = saved } } diff --git a/src/cmd/compile/internal/ssa/compile.go b/src/cmd/compile/internal/ssa/compile.go index 4bd9ade4799..c7797d79e92 100644 --- a/src/cmd/compile/internal/ssa/compile.go +++ b/src/cmd/compile/internal/ssa/compile.go @@ -43,7 +43,7 @@ func Compile(f *Func) { // Run all the passes printFunc(f) - f.HTMLWriter.WriteFunc("start", f) + f.HTMLWriter.WriteFunc("start", "start", f) if BuildDump != "" && BuildDump == f.Name { f.dumpFile("build") } @@ -86,7 +86,7 @@ func Compile(f *Func) { f.Logf(" pass %s end %s\n", p.name, stats) printFunc(f) - f.HTMLWriter.WriteFunc(fmt.Sprintf("after %s %s", phaseName, stats), f) + f.HTMLWriter.WriteFunc(phaseName, fmt.Sprintf("%s %s", phaseName, stats), f) } if p.time || p.mem { // Surround timing information w/ enough context to allow comparisons. diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go index 85d97ba4970..d37e69977e7 100644 --- a/src/cmd/compile/internal/ssa/html.go +++ b/src/cmd/compile/internal/ssa/html.go @@ -38,6 +38,11 @@ func (w *HTMLWriter) start(name string) {