Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,19 @@
<!-- Copyright 2020 the V8 project authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<head>
<link href="./index.css" rel="stylesheet">
</head>
<style>
#mapDetails,
#filePositionNode {
overflow: scroll;
}
#mapDetails {
font-family: monospace;
white-space: pre;
}
</style>
<section id="mapProperties"></section>
<section id="mapDetails"></section>

View File

@ -0,0 +1,59 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {FocusEvent} from '../events.mjs';
import {DOM, ExpandableText, V8CustomElement} from '../helper.mjs';
DOM.defineCustomElement(
'./view/map-panel/map-details',
(templateText) => class MapDetails extends V8CustomElement {
_map;
constructor() {
super(templateText);
}
get _mapDetails() {
return this.$('#mapDetails');
}
get _mapProperties() {
return this.$('#mapProperties');
}
set map(map) {
if (this._map === map) return;
this._map = map;
this.requestUpdate();
}
_update() {
this._mapProperties.innerText = '';
if (this._map) {
let clickableDetailsTable = DOM.table('properties');
{
const row = clickableDetailsTable.insertRow();
row.insertCell().innerText = 'ID';
row.insertCell().innerText = `${this._map.id}`;
}
{
const row = clickableDetailsTable.insertRow();
row.insertCell().innerText = 'Source location';
const sourceLocation = row.insertCell();
new ExpandableText(sourceLocation, `${this._map.sourcePosition}`);
sourceLocation.className = 'clickable';
sourceLocation.onclick = e => this._handleSourcePositionClick(e);
}
this._mapProperties.appendChild(clickableDetailsTable);
this._mapDetails.innerText = this._map.description;
} else {
this._mapDetails.innerText = '';
}
}
_handleSourcePositionClick(event) {
this.dispatchEvent(new FocusEvent(this._map.sourcePosition));
}
});

View File

@ -0,0 +1,140 @@
<!-- Copyright 2020 the V8 project authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<head>
<link href="./index.css" rel="stylesheet">
</head>
<style>
#transitionView {
overflow-x: scroll;
white-space: nowrap;
min-height: 50px;
max-height: 200px;
padding: 50px 0 0 0;
margin-top: -25px;
width: 100%;
}
#transitionView::-webkit-scrollbar {
width: 0;
background-color: transparent;
}
.map {
width: 20px;
height: 20px;
display: inline-block;
border-radius: 50%;
background-color: var(--map-background-color);
border: 4px solid var(--surface-color);
font-size: 10px;
text-align: center;
line-height: 18px;
color: var(--on-surface-color);
vertical-align: top;
margin-top: -13px;
/* raise z-index */
position: relative;
z-index: 2;
cursor: pointer;
}
.map.selected {
border-color: var(--on-surface-color);
}
.transitions {
display: inline-block;
margin-left: -15px;
}
.transition {
min-height: 55px;
margin: 0 0 -2px 2px;
}
/* gray out deprecated transitions */
.deprecated>.transitionEdge,
.deprecated>.map {
opacity: 0.5;
}
.deprecated>.transition {
border-color: rgba(0, 0, 0, 0.5);
}
/* Show a border for all but the first transition */
.transition:nth-of-type(2),
.transition:nth-last-of-type(n+2) {
border-left: 2px solid;
margin-left: 0px;
}
/* special case for 2 transitions */
.transition:nth-last-of-type(1) {
border-left: none;
}
/* topmost transitions are not related */
#transitionView>.transition {
border-left: none;
}
/* topmost transition edge needs initial offset to be aligned */
#transitionView>.transition>.transitionEdge {
margin-left: 13px;
}
.transitionEdge {
height: 2px;
width: 80px;
display: inline-block;
margin: 0 0 2px 0;
background-color: var(--map-background-color);
vertical-align: top;
padding-left: 15px;
}
.transitionLabel {
color: var(--on-surface-color);
transform: rotate(-15deg);
transform-origin: top left;
margin-top: -10px;
font-size: 10px;
white-space: normal;
word-break: break-all;
background-color: var(--surface-color);
}
.showSubtransitions {
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 10px solid var(--map-background-color);
cursor: zoom-in;
margin: 4px 0 0 4px;
}
.showSubtransitions.opened {
border-top: none;
border-bottom: 10px solid var(--map-background-color);
cursor: zoom-out;
}
#tooltip {
position: absolute;
width: 10px;
height: 10px;
background-color: var(--red);
pointer-events: none;
z-index: 100;
display: none;
}
#title {
padding-bottom: 10px;
}
</style>
<section id="transitionView"></section>

View File

@ -0,0 +1,181 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import {FocusEvent, SelectRelatedEvent, ToolTipEvent} from '../events.mjs';
import {CSSColor, DOM, V8CustomElement} from '../helper.mjs';
DOM.defineCustomElement(
'./view/map-panel/map-transitions',
(templateText) => class MapTransitions extends V8CustomElement {
_timeline;
_map;
_edgeToColor = new Map();
_selectedLogEntries;
_displayedMapsInTree;
_toggleSubtreeHandler = this._handleToggleSubtree.bind(this);
_mapClickHandler = this._handleMapClick.bind(this);
_mapDoubleClickHandler = this._handleMapDoubleClick.bind(this);
_mouseoverMapHandler = this._handleMouseoverMap.bind(this);
constructor() {
super(templateText);
this.currentNode = this.transitionView;
}
get transitionView() {
return this.$('#transitionView');
}
set timeline(timeline) {
this._timeline = timeline;
this._edgeToColor.clear();
timeline.getBreakdown().forEach(breakdown => {
this._edgeToColor.set(breakdown.key, CSSColor.at(breakdown.id));
});
}
set selectedLogEntries(list) {
this._selectedLogEntries = list;
this.requestUpdate();
}
_update() {
this.transitionView.style.display = 'none';
DOM.removeAllChildren(this.transitionView);
if (this._selectedLogEntries.length == 0) return;
this._displayedMapsInTree = new Set();
// Limit view to 200 maps for performance reasons.
this._selectedLogEntries.slice(0, 200).forEach(
(map) => this._addMapAndParentTransitions(map));
this._displayedMapsInTree = undefined;
this.transitionView.style.display = '';
}
_addMapAndParentTransitions(map) {
if (map === undefined) return;
if (this._displayedMapsInTree.has(map)) return;
this._displayedMapsInTree.add(map);
this.currentNode = this.transitionView;
let parents = map.getParents();
if (parents.length > 0) {
this._addTransitionTo(parents.pop());
parents.reverse().forEach((each) => this._addTransitionTo(each));
}
let mapNode = this._addSubtransitions(map);
// Mark and show the selected map.
mapNode.classList.add('selected');
if (this.selectedMap == map) {
setTimeout(
() => mapNode.scrollIntoView({
behavior: 'smooth',
block: 'nearest',
inline: 'nearest',
}),
1);
}
}
_addSubtransitions(map) {
let mapNode = this._addTransitionTo(map);
// Draw outgoing linear transition line.
let current = map;
while (current.children.length == 1) {
current = current.children[0].to;
this._addTransitionTo(current);
}
return mapNode;
}
_addTransitionEdge(map) {
let classes = ['transitionEdge'];
let edge = DOM.div(classes);
edge.style.backgroundColor = this._edgeToColor.get(map.edge.type);
let labelNode = DOM.div('transitionLabel');
labelNode.innerText = map.edge.toString();
edge.appendChild(labelNode);
return edge;
}
_addTransitionTo(map) {
// transition[ transitions[ transition[...], transition[...], ...]];
this._displayedMapsInTree?.add(map);
let transition = DOM.div('transition');
if (map.isDeprecated()) transition.classList.add('deprecated');
if (map.edge) {
transition.appendChild(this._addTransitionEdge(map));
}
let mapNode = this._addMapNode(map);
transition.appendChild(mapNode);
let subtree = DOM.div('transitions');
transition.appendChild(subtree);
this.currentNode.appendChild(transition);
this.currentNode = subtree;
return mapNode;
}
_addMapNode(map) {
let node = DOM.div('map');
if (map.edge)
node.style.backgroundColor = this._edgeToColor.get(map.edge.type);
node.map = map;
node.onclick = this._mapClickHandler
node.ondblclick = this._mapDoubleClickHandler
node.onmouseover = this._mouseoverMapHandler
if (map.children.length > 1) {
node.innerText = map.children.length;
const showSubtree = DOM.div('showSubtransitions');
showSubtree.onclick = this._toggleSubtreeHandler
node.appendChild(showSubtree);
}
else if (map.children.length == 0) {
node.innerHTML = '&#x25CF;';
}
this.currentNode.appendChild(node);
return node;
}
_handleMapClick(event) {
const map = event.currentTarget.map;
this.dispatchEvent(new FocusEvent(map));
}
_handleMapDoubleClick(event) {
this.dispatchEvent(new SelectRelatedEvent(event.currentTarget.map));
}
_handleMouseoverMap(event) {
this.dispatchEvent(new ToolTipEvent(
event.currentTarget.map, event.currentTarget, event.ctrlKey));
}
_handleToggleSubtree(event) {
event.stopImmediatePropagation();
const node = event.currentTarget.parentElement;
const map = node.map;
event.target.classList.toggle('opened');
const transitionsNode =
node.parentElement.querySelector('.transitions');
const subtransitionNodes = transitionsNode.children;
if (subtransitionNodes.length <= 1) {
// Add subtransitions except the one that's already shown.
let visibleTransitionMap = subtransitionNodes.length == 1 ?
transitionsNode.querySelector('.map').map :
undefined;
map.children.forEach((edge) => {
if (edge.to != visibleTransitionMap) {
this.currentNode = transitionsNode;
this._addSubtransitions(edge.to);
}
});
} else {
// remove all but the first (currently selected) subtransition
for (let i = subtransitionNodes.length - 1; i > 0; i--) {
transitionsNode.removeChild(subtransitionNodes[i]);
}
}
return false;
}
});