diff options
Diffstat (limited to 'deps/v8/tools/system-analyzer/log')
-rw-r--r-- | deps/v8/tools/system-analyzer/log/api.mjs | 24 | ||||
-rw-r--r-- | deps/v8/tools/system-analyzer/log/code.mjs | 62 | ||||
-rw-r--r-- | deps/v8/tools/system-analyzer/log/timer.mjs | 4 |
3 files changed, 47 insertions, 43 deletions
diff --git a/deps/v8/tools/system-analyzer/log/api.mjs b/deps/v8/tools/system-analyzer/log/api.mjs deleted file mode 100644 index 8e29cb39d5..0000000000 --- a/deps/v8/tools/system-analyzer/log/api.mjs +++ /dev/null @@ -1,24 +0,0 @@ -// 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 {LogEntry} from './log.mjs'; - -export class ApiLogEntry extends LogEntry { - constructor(type, time, name, argument) { - super(type, time); - this._name = name; - this._argument = argument; - } - - get name() { - return this._name; - } - - get argument() { - return this._argument; - } - - static get propertyNames() { - return ['type', 'name', 'argument']; - } -} diff --git a/deps/v8/tools/system-analyzer/log/code.mjs b/deps/v8/tools/system-analyzer/log/code.mjs index 4e8ca40f5e..06051a2e52 100644 --- a/deps/v8/tools/system-analyzer/log/code.mjs +++ b/deps/v8/tools/system-analyzer/log/code.mjs @@ -2,9 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import {formatBytes} from '../helper.mjs'; - import {LogEntry} from './log.mjs'; +class CodeString { + constructor(string) { + if (typeof string !== 'string') { + throw new Error('Expected string'); + } + this.string = string; + } + + get isCode() { + return true; + } + + toString() { + return this.string; + } +} + export class DeoptLogEntry extends LogEntry { constructor( type, time, entry, deoptReason, deoptLocation, scriptOffset, @@ -48,14 +64,33 @@ export class DeoptLogEntry extends LogEntry { } } -export class CodeLogEntry extends LogEntry { - constructor(type, time, kindName, kind, entry) { +class CodeLikeLogEntry extends LogEntry { + constructor(type, time, profilerEntry) { super(type, time); + this._entry = profilerEntry; + profilerEntry.logEntry = this; + this._relatedEntries = []; + } + + get entry() { + return this._entry; + } + + add(entry) { + this._relatedEntries.push(entry); + } + + relatedEntries() { + return this._relatedEntries; + } +} + +export class CodeLogEntry extends CodeLikeLogEntry { + constructor(type, time, kindName, kind, profilerEntry) { + super(type, time, profilerEntry); this._kind = kind; this._kindName = kindName; - this._entry = entry; this._feedbackVector = undefined; - entry.logEntry = this; } get kind() { @@ -74,10 +109,6 @@ export class CodeLogEntry extends LogEntry { return this._kindName; } - get entry() { - return this._entry; - } - get functionName() { return this._entry.functionName ?? this._entry.getRawName(); } @@ -117,6 +148,8 @@ export class CodeLogEntry extends LogEntry { get toolTipDict() { const dict = super.toolTipDict; dict.size = formatBytes(dict.size); + dict.source = new CodeString(dict.source); + dict.code = new CodeString(dict.code); return dict; } @@ -182,20 +215,15 @@ export class FeedbackVectorEntry extends LogEntry { } } -export class SharedLibLogEntry extends LogEntry { - constructor(entry) { - super('SHARED_LIB', 0); - this._entry = entry; +export class SharedLibLogEntry extends CodeLikeLogEntry { + constructor(profilerEntry) { + super('SHARED_LIB', 0, profilerEntry); } get name() { return this._entry.name; } - get entry() { - return this._entry; - } - toString() { return `SharedLib`; } diff --git a/deps/v8/tools/system-analyzer/log/timer.mjs b/deps/v8/tools/system-analyzer/log/timer.mjs index d2ca02a46c..01bfbd0421 100644 --- a/deps/v8/tools/system-analyzer/log/timer.mjs +++ b/deps/v8/tools/system-analyzer/log/timer.mjs @@ -30,7 +30,7 @@ export class TimerLogEntry extends LogEntry { } get duration() { - return this._endTime - this._time; + return Math.max(0, this._endTime - this._time); } covers(time) { @@ -53,4 +53,4 @@ export class TimerLogEntry extends LogEntry { 'duration', ]; } -}
\ No newline at end of file +} |