</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",
}
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;
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);
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);
};
}
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;
+ }
}
}
}