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 {
view.selectMenu.innerHTML = '';
view.sourceResolver.forEachPhase((phase) => {
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);
});
this.selectMenu.onchange = function (this: HTMLSelectElement) {
......
......@@ -302,6 +302,7 @@ export class SourceResolver {
recordOrigins(phase) {
if (phase.type != "graph") return;
for (const node of phase.data.nodes) {
phase.highestNodeId = Math.max(phase.highestNodeId, node.id)
if (node.origin != undefined &&
node.origin.bytecodePosition != undefined) {
const position = { bytecodePosition: node.origin.bytecodePosition };
......@@ -384,6 +385,7 @@ export class SourceResolver {
parsePhases(phases) {
for (const [phaseId, phase] of Object.entries<Phase>(phases)) {
phase.highestNodeId = 0;
if (phase.type == 'disassembly') {
this.disassemblyPhase = phase;
} 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