Commit f89ecbb1 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by V8 LUCI CQ

[turbolizer] Connect the register allocation phase with the other panels

Now we can click any panel and connect to the others via highlight. Note
that we do not have a bijection between panels and (e.g. one node can be
several instructions in the generated code.

Bug: v8:7327, v8:11192
Notry: true
Change-Id: Idfabce98bfdfc1b6cd26d540e6f0bbac47754de1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3001175
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75576}
parent 40695807
......@@ -54,6 +54,18 @@ export class SelectionBroker {
for (const b of this.instructionHandlers) {
if (b != from) b.brokeredInstructionSelect(instructionOffsets, selected);
}
// Select the lines from the source panel (left panel)
const pcOffsets = this.sourceResolver.instructionsToKeyPcOffsets(instructionOffsets);
for (const offset of pcOffsets) {
const nodes = this.sourceResolver.nodesForPCOffset(offset)[0];
const sourcePositions = this.sourceResolver.nodeIdsToSourcePositions(nodes);
for (const b of this.sourcePositionHandlers) {
if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected);
}
}
// The middle panel lines have already been selected so there's no need to reselect them.
}
broadcastSourcePositionSelect(from, sourcePositions, selected) {
......@@ -76,14 +88,20 @@ export class SelectionBroker {
if (b != from) b.brokeredNodeSelect(nodes, selected);
}
// Select the lines from the disassembly (right panel)
for (const node of nodes) {
const instructionOffsets = this.sourceResolver.nodeIdToInstructionRange[node];
// Skip nodes which do not have an associated instruction range.
if (instructionOffsets == undefined) continue;
// Select the lines from the disassembly (right panel)
for (const b of this.instructionHandlers) {
if (b != from) b.brokeredInstructionSelect(instructionOffsets, selected);
}
// Select the lines from the middle panel for the register allocation phase.
for (const b of this.registerAllocationHandlers) {
if (b != from) b.brokeredRegisterAllocationSelect(instructionOffsets, selected);
}
}
}
......@@ -99,14 +117,19 @@ export class SelectionBroker {
if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected);
}
// Select the lines from the disassembly (right panel)
for (const node of nodes) {
const instructionOffsets = this.sourceResolver.nodeIdToInstructionRange[node];
// Skip nodes which do not have an associated instruction range.
if (instructionOffsets == undefined) continue;
// Select the lines from the disassembly (right panel)
for (const b of this.instructionHandlers) {
if (b != from) b.brokeredInstructionSelect(instructionOffsets, selected);
}
// Select the lines from the middle panel for the register allocation phase.
for (const b of this.registerAllocationHandlers) {
if (b != from) b.brokeredRegisterAllocationSelect(instructionOffsets, selected);
}
}
}
......
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