diff options
author | Jeremy Faller <jeremy@golang.org> | 2020-09-30 17:57:14 -0400 |
---|---|---|
committer | Jeremy Faller <jeremy@golang.org> | 2020-09-30 18:00:58 -0400 |
commit | 91e4d2d57bc341dd82c98247117114c851380aef (patch) | |
tree | 15a2d023cdc63543cf8a6e99f8a561c0a0459000 /src/cmd/compile/internal/ssa/html.go | |
parent | c863e14a6c15e174ac0979ddd7f9530d6a4ec9cc (diff) | |
parent | 846dce9d05f19a1f53465e62a304dea21b99f910 (diff) | |
download | go-91e4d2d57bc341dd82c98247117114c851380aef.tar.gz go-91e4d2d57bc341dd82c98247117114c851380aef.zip |
[dev.link] Merge branch 'master' into dev.link
2 conflicts, that make sense.
src/cmd/internal/obj/objfile.go
src/cmd/link/internal/loader/loader.go
Change-Id: Ib224e2d248cb568fa1e888af79dd908b2f5e05ff
Diffstat (limited to 'src/cmd/compile/internal/ssa/html.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/html.go | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go index ba37a80412..c781ca92cc 100644 --- a/src/cmd/compile/internal/ssa/html.go +++ b/src/cmd/compile/internal/ssa/html.go @@ -119,7 +119,8 @@ td.collapsed { } td.collapsed div { - /* TODO: Flip the direction of the phase's title 90 degrees on a collapsed column. */ + text-align: right; + transform: rotate(180deg); writing-mode: vertical-lr; white-space: pre; } @@ -357,6 +358,21 @@ body.darkmode ellipse.outline-black { outline: gray solid 2px; } </style> <script type="text/javascript"> + +// Contains phase names which are expanded by default. Other columns are collapsed. +let expandedDefault = [ + "start", + "deadcode", + "opt", + "lower", + "late-deadcode", + "regalloc", + "genssa", +]; +if (history.state === null) { + history.pushState({expandedDefault}, "", location.href); +} + // ordered list of all available highlight colors var highlights = [ "highlight-aquamarine", @@ -401,6 +417,9 @@ for (var i = 0; i < outlines.length; i++) { } window.onload = function() { + if (history.state !== null) { + expandedDefault = history.state.expandedDefault; + } if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) { toggleDarkMode(); document.getElementById("dark-mode-button").checked = true; @@ -409,9 +428,6 @@ window.onload = function() { var ssaElemClicked = function(elem, event, selections, selected) { event.stopPropagation(); - // TODO: pushState with updated state and read it on page load, - // so that state can survive across reloads - // find all values with the same name var c = elem.classList.item(0); var x = document.getElementsByClassName(c); @@ -489,21 +505,18 @@ window.onload = function() { lines[i].addEventListener('click', ssaValueClicked); } - // Contains phase names which are expanded by default. Other columns are collapsed. - var expandedDefault = [ - "start", - "deadcode", - "opt", - "lower", - "late-deadcode", - "regalloc", - "genssa", - ]; function toggler(phase) { return function() { toggle_cell(phase+'-col'); toggle_cell(phase+'-exp'); + const i = expandedDefault.indexOf(phase); + if (i !== -1) { + expandedDefault.splice(i, 1); + } else { + expandedDefault.push(phase); + } + history.pushState({expandedDefault}, "", location.href); }; } @@ -531,9 +544,13 @@ window.onload = function() { const len = combined.length; if (len > 1) { for (let i = 0; i < len; i++) { - if (expandedDefault.indexOf(combined[i]) !== -1) { - show = true; - break; + const num = expandedDefault.indexOf(combined[i]); + if (num !== -1) { + expandedDefault.splice(num, 1); + if (expandedDefault.indexOf(phase) === -1) { + expandedDefault.push(phase); + show = true; + } } } } |