Commit 949dffc9 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[turbolizer] Display highest node id in phase selection drop-down

Notry: true
Change-Id: Ia3cb4872703a6d1e5f6d0007a5e59afcd743907d
Bug: v8:7327
Reviewed-on: https://chromium-review.googlesource.com/c/1309754Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57164}
parent b14a2a50
...@@ -47,7 +47,8 @@ export class GraphMultiView extends View { ...@@ -47,7 +47,8 @@ export class GraphMultiView extends View {
view.selectMenu.innerHTML = ''; view.selectMenu.innerHTML = '';
view.sourceResolver.forEachPhase((phase) => { view.sourceResolver.forEachPhase((phase) => {
const optionElement = document.createElement("option"); const optionElement = document.createElement("option");
optionElement.text = phase.name; const maxNodeId = phase.highestNodeId == 0 ? "" : ` ${phase.highestNodeId}`;
optionElement.text = `${phase.name}${maxNodeId}`;
view.selectMenu.add(optionElement); view.selectMenu.add(optionElement);
}); });
this.selectMenu.onchange = function (this: HTMLSelectElement) { this.selectMenu.onchange = function (this: HTMLSelectElement) {
......
...@@ -302,6 +302,7 @@ export class SourceResolver { ...@@ -302,6 +302,7 @@ export class SourceResolver {
recordOrigins(phase) { recordOrigins(phase) {
if (phase.type != "graph") return; if (phase.type != "graph") return;
for (const node of phase.data.nodes) { for (const node of phase.data.nodes) {
phase.highestNodeId = Math.max(phase.highestNodeId, node.id)
if (node.origin != undefined && if (node.origin != undefined &&
node.origin.bytecodePosition != undefined) { node.origin.bytecodePosition != undefined) {
const position = { bytecodePosition: node.origin.bytecodePosition }; const position = { bytecodePosition: node.origin.bytecodePosition };
...@@ -384,6 +385,7 @@ export class SourceResolver { ...@@ -384,6 +385,7 @@ export class SourceResolver {
parsePhases(phases) { parsePhases(phases) {
for (const [phaseId, phase] of Object.entries<Phase>(phases)) { for (const [phaseId, phase] of Object.entries<Phase>(phases)) {
phase.highestNodeId = 0;
if (phase.type == 'disassembly') { if (phase.type == 'disassembly') {
this.disassemblyPhase = phase; this.disassemblyPhase = phase;
} else if (phase.type == 'schedule') { } else if (phase.type == 'schedule') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment