7a90c32032
Add basic profiler support - Moved profiling-related helpers to profiling.mjs - Added bottom-up profiler table - Added mini-timeline overview wit opt/deopt events and usage graph - Added flame-graph, pivoted on the currently selected function Drive-by-fixes: - Added/updated jsdoc type information - Fixed static symbols (builtins, bytecodehandlers) that were both added by the CppEntriesProvider and from code-events in the v8.log - Support platform-specific (linux/macos) dynamic symbol loader by adding a query path ('/v8/info/platform') to lws-middleware.js - added css var --selection-color Bug: v8:10644 Change-Id: I6412bec63eac13140d6d425e7d9cc33316824c73 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3585453 Reviewed-by: Patrick Thier <pthier@chromium.org> Commit-Queue: Camillo Bruni <cbruni@chromium.org> Cr-Commit-Position: refs/heads/main@{#80192}
60 lines
1.3 KiB
JavaScript
60 lines
1.3 KiB
JavaScript
// 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.
|
|
|
|
export class LogEntry {
|
|
constructor(type, time) {
|
|
/** @type {number} */
|
|
this._time = time;
|
|
this._type = type;
|
|
/** @type {?SourcePosition} */
|
|
this.sourcePosition = undefined;
|
|
}
|
|
|
|
get time() {
|
|
return this._time;
|
|
}
|
|
|
|
get type() {
|
|
return this._type;
|
|
}
|
|
|
|
get script() {
|
|
return this.sourcePosition?.script;
|
|
}
|
|
|
|
toString() {
|
|
let name = this.constructor.name;
|
|
const index = name.lastIndexOf('LogEntry');
|
|
if (index > 0) {
|
|
name = name.substr(0, index);
|
|
}
|
|
return `${name}(${this._type})`;
|
|
}
|
|
|
|
get toolTipDict() {
|
|
const toolTipDescription = {
|
|
__proto__: null,
|
|
__this__: this,
|
|
title: this.toString()
|
|
};
|
|
for (let key of this.constructor.propertyNames) {
|
|
toolTipDescription[key] = this[key];
|
|
}
|
|
|
|
return toolTipDescription;
|
|
}
|
|
|
|
// Returns an Array of all possible #type values.
|
|
/** @return {string[]} */
|
|
static get allTypes() {
|
|
throw new Error('Not implemented.');
|
|
}
|
|
|
|
// Returns an array of public property names.
|
|
/** @return {string[]} */
|
|
static get propertyNames() {
|
|
throw new Error('Not implemented.');
|
|
}
|
|
}
|