v8/tools/turbolizer/turbo-visualizer-ranges.css

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

238 lines
4.1 KiB
CSS
Raw Normal View History

[turbolizer] Display live ranges with sequences Display register allocation live ranges alongside sequences in turbolizer. The existing --trace-turbo flag now also outputs the register allocation data as part of the json file alongside the instruction sequence data that is already produced before and after register allocation is performed. This data includes live range intervals for each virtual and fixed register and the state of their assignments. This json data can now be displayed in turbolizer alongside the instruction sequences. The information is presented as a grid, with each grid cell representing a LifeTimePosition of a certain virtual register, determined by the column and row indices respectively. Each LifeTimePosition is shown to be part of an instruction id which itself is shown to be part of a block id. Each interval is shown as a coloured rectangle positioned over the relevant cells, and displaying text to indicate the state of their assignment. The Resizer object has been extended to allow the grid's html panel to be varied in size in the same manner that the left and right panels can be. The size of the grid itself must also be adjusted whenever the div container changes size. The RangeView class is introduced and is created and held by the single SequenceView object used to display the InstructionSequence data before and after register allocation. A checkbox allows the user to show/hide the range view, this is disabled when register allocation data is not provided or more than 249 instructions are in the sequence. The latter being required due to the css grid-row-col limit of 1000 alond with helping alleviate performance issues. The SequenceView object tracks the phase index currently selected as well as whether or not it is currently being shown. This ensures that the RangeView is not hidden and shown when switching between before and after register allocation, allowing for a smoother transition between the two. The scroll position is also saved and restored for convenience. The data about the instruction sequence required for the display is held by the RangeView object and reset whenever a new instruction sequence is shown. The grid div must sync its scroll with the headers and row labels so as to ensure a consistent view. The register allocation data is extracted from the json, with each register row showing all intervals within the relevant ranges. When the view is switched between before and after register allocation, the relevant intervals are swapped in. Bug: v8:7327 Notry: true Change-Id: I183535a2410a7d663382f387199885250fb98691 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2184232 Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Cr-Commit-Position: refs/heads/master@{#68019}
2020-05-27 11:18:28 +00:00
/* CSS specific to the live ranges div associated with
the RangeView typescript class in src/range-view.ts. */
:root {
--range-y-axis-width: 18ch;
--range-position-width: 3.5ch;
--range-block-border: 6px;
--range-instr-border: 3px;
--range-position-border: 1px;
}
.range-bold {
font-weight: bold;
color: black;
}
#ranges {
font-family: monospace;
min-height: auto;
overflow: hidden;
}
#resizer-ranges {
height: 10px;
}
.range-title-div {
padding: 2ch 2ch 2ch 2ch;
white-space: nowrap;
overflow: auto;
}
.range-title {
text-decoration: underline;
font-weight: bold;
font-size: large;
display: inline-block;
}
.range-title-help {
margin-left: 2ch;
width: 1ch;
padding: 0 0.25ch;
border: 1px dotted black;
color: slategray;
display: inline-block;
}
input.range-toggle-show {
vertical-align: middle;
}
.range-header-label-x {
text-align: center;
margin-left: 13ch;
}
.range-header-label-y {
width: 11ch;
float: left;
white-space: pre-wrap;
word-wrap: break-word;
margin-left: 6ch;
margin-top: 4ch;
}
.range-y-axis {
display: inline-block;
width: var(--range-y-axis-width);
overflow: hidden;
white-space: nowrap;
vertical-align: top;
}
.range-header {
display: flex;
overflow: hidden;
height: 8ch;
margin-left: var(--range-y-axis-width);
}
.range-position-labels,
.range-register-labels {
background-color: lightgray;
}
.range-register-labels {
float: right;
}
.range-position-labels {
margin-top: auto;
}
.range-registers {
float: right;
overflow: hidden;
text-align: right;
}
.range-positions-header,
.range-instruction-ids,
.range-block-ids {
overflow: hidden;
white-space: nowrap;
display: grid;
grid-gap: 0;
}
.range-reg {
width: 13ch;
text-align: right;
}
.range-reg::after {
content: ":";
}
.range-grid {
overflow: auto;
display: inline-block;
white-space: nowrap;
}
.range-block-id {
display: inline-block;
text-align: center;
}
.range-instruction-id {
display: inline-block;
text-align: center;
}
.range-position {
display: inline-block;
text-align: center;
z-index: 1;
}
.range-transparent,
.range-position.range-empty {
color: transparent;
}
.range-block-id:hover,
.range-instruction-id:hover,
.range-reg:hover,
.range-position:hover {
background-color: rgba(0, 0, 255, 0.10);
}
.range-position.range-header-element {
border-bottom: 2px solid rgb(109, 107, 107);
}
.range-block-id,
.range-instruction-id,
.range-reg,
.range-interval,
.range-position {
position: relative;
border: var(--range-position-border) solid rgb(109, 107, 107);
}
.range-block-id,
.range-instruction-id,
.range-interval,
.range-position {
border-left: 0;
}
.range-block-ids > .range-block-id:first-child,
.range-instruction-ids > .range-instruction-id:first-child,
.range-positions > .range-position:first-child {
border-left: var(--range-position-border) solid rgb(109, 107, 107);
}
.range-position.range-interval-position {
border: none;
}
.range-interval-text {
position: absolute;
padding-left: 0.5ch;
z-index: 2;
pointer-events: none
}
.range-position.range-use {
border-left: var(--range-instr-border) solid red;
}
[turbolizer] Display live ranges with sequences Display register allocation live ranges alongside sequences in turbolizer. The existing --trace-turbo flag now also outputs the register allocation data as part of the json file alongside the instruction sequence data that is already produced before and after register allocation is performed. This data includes live range intervals for each virtual and fixed register and the state of their assignments. This json data can now be displayed in turbolizer alongside the instruction sequences. The information is presented as a grid, with each grid cell representing a LifeTimePosition of a certain virtual register, determined by the column and row indices respectively. Each LifeTimePosition is shown to be part of an instruction id which itself is shown to be part of a block id. Each interval is shown as a coloured rectangle positioned over the relevant cells, and displaying text to indicate the state of their assignment. The Resizer object has been extended to allow the grid's html panel to be varied in size in the same manner that the left and right panels can be. The size of the grid itself must also be adjusted whenever the div container changes size. The RangeView class is introduced and is created and held by the single SequenceView object used to display the InstructionSequence data before and after register allocation. A checkbox allows the user to show/hide the range view, this is disabled when register allocation data is not provided or more than 249 instructions are in the sequence. The latter being required due to the css grid-row-col limit of 1000 alond with helping alleviate performance issues. The SequenceView object tracks the phase index currently selected as well as whether or not it is currently being shown. This ensures that the RangeView is not hidden and shown when switching between before and after register allocation, allowing for a smoother transition between the two. The scroll position is also saved and restored for convenience. The data about the instruction sequence required for the display is held by the RangeView object and reset whenever a new instruction sequence is shown. The grid div must sync its scroll with the headers and row labels so as to ensure a consistent view. The register allocation data is extracted from the json, with each register row showing all intervals within the relevant ranges. When the view is switched between before and after register allocation, the relevant intervals are swapped in. Bug: v8:7327 Notry: true Change-Id: I183535a2410a7d663382f387199885250fb98691 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2184232 Reviewed-by: Georg Neis <neis@chromium.org> Reviewed-by: Santiago Aboy Solanes <solanes@chromium.org> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Cr-Commit-Position: refs/heads/master@{#68019}
2020-05-27 11:18:28 +00:00
.range-block-border,
.range-block-border.range-position.range-interval-position:last-child {
border-right: var(--range-block-border) solid rgb(109, 107, 107);
}
.range-block-border.range-position.range-interval-position {
border-right: var(--range-block-border) solid transparent;
}
.range-instr-border,
.range-instr-border.range-position.range-interval-position:last-child {
border-right: var(--range-instr-border) solid rgb(109, 107, 107);
}
.range-instr-border.range-position.range-interval-position {
border-right: var(--range-instr-border) solid transparent;
}
.range,
.range-interval,
.range-interval-wrapper,
.range-positions {
white-space: nowrap;
display: inline-block;
}
.range-interval-wrapper,
.range-positions {
display: grid;
grid-gap: 0;
}
.range-interval {
background-color: rgb(153, 158, 168);
}
.range-hidden {
display: none !important;
}
.range-positions-placeholder {
width: 100%;
border: var(--range-position-border) solid transparent;
color: transparent;
}