Commit e24deb89 authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[tools] Various system-analyzer fixes

- Handle empty script sources
- Fix list-panel groups, order by count

Bug: v8:10644
Change-Id: I03d3915f709d47429040b591c0271e951eca58e9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289642
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78165}
parent d76dceb8
......@@ -70,7 +70,7 @@ export class SourcePosition {
export class Script {
url;
source;
source = "";
name;
sourcePosition = undefined;
// Map<line, Map<column, SourcePosition>>
......@@ -106,7 +106,7 @@ export class Script {
}
findFunctionSourcePosition(sourcePosition) {
// TODO(cbruni) implmenent
// TODO(cbruni): implement
return undefined;
}
......
......@@ -102,6 +102,6 @@ export function groupBy(array, keyFunction, collect = false) {
groups.push(group);
keyToGroup.set(key, group);
}
// Sort by count
return groups.sort((a, b) => b.count - a.count);
}
\ No newline at end of file
// Sort by length
return groups.sort((a, b) => b.length - a.length);
}
......@@ -112,6 +112,7 @@ DOM.defineCustomElement('view/list-panel',
createSubgroups(group) {
const map = new Map();
const tempGroups = [];
for (let propertyName of this._propertyNames) {
map.set(
propertyName,
......@@ -176,9 +177,6 @@ DOM.defineCustomElement('view/list-panel',
_render(groups, table) {
let last;
new LazyTable(table, groups, group => {
if (last && last.count < group.length) {
console.log(last, group);
}
last = group;
const tr = DOM.tr();
tr.group = group;
......
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