summaryrefslogtreecommitdiff
path: root/deps/v8/tools/system-analyzer/processor.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/tools/system-analyzer/processor.mjs')
-rw-r--r--deps/v8/tools/system-analyzer/processor.mjs70
1 files changed, 39 insertions, 31 deletions
diff --git a/deps/v8/tools/system-analyzer/processor.mjs b/deps/v8/tools/system-analyzer/processor.mjs
index 15eccd70c9..c4cd1f9915 100644
--- a/deps/v8/tools/system-analyzer/processor.mjs
+++ b/deps/v8/tools/system-analyzer/processor.mjs
@@ -47,7 +47,6 @@ class AsyncConsumer {
}
export class Processor extends LogReader {
- _profile = new Profile();
_codeTimeline = new Timeline();
_deoptTimeline = new Timeline();
_icTimeline = new Timeline();
@@ -70,12 +69,16 @@ export class Processor extends LogReader {
MAJOR_VERSION = 7;
MINOR_VERSION = 6;
- constructor() {
- super();
+ constructor(useBigInt = false) {
+ super(false, false, useBigInt);
+ this.useBigInt = useBigInt;
+ this.kZero = useBigInt ? 0n : 0;
+ this.parseAddress = useBigInt ? BigInt : parseInt;
this._chunkConsumer =
new AsyncConsumer((chunk) => this._processChunk(chunk));
+ this._profile = new Profile(useBigInt);
const propertyICParser = [
- parseInt, parseInt, parseInt, parseInt, parseString, parseString,
+ this.parseAddress, parseInt, parseInt, parseInt, parseString, parseString,
parseString, parseString, parseString, parseString
];
this.setDispatchTable({
@@ -88,46 +91,47 @@ export class Processor extends LogReader {
processor: this.processV8Version,
},
'shared-library': {
- parsers: [parseString, parseInt, parseInt, parseInt],
+ parsers: [
+ parseString, this.parseAddress, this.parseAddress, this.parseAddress
+ ],
processor: this.processSharedLibrary.bind(this),
isAsync: true,
},
'code-creation': {
parsers: [
- parseString, parseInt, parseInt, parseInt, parseInt, parseString,
- parseVarArgs
+ parseString, parseInt, parseInt, this.parseAddress, this.parseAddress,
+ parseString, parseVarArgs
],
processor: this.processCodeCreation
},
'code-deopt': {
parsers: [
- parseInt, parseInt, parseInt, parseInt, parseInt, parseString,
- parseString, parseString
+ parseInt, parseInt, this.parseAddress, parseInt, parseInt,
+ parseString, parseString, parseString
],
processor: this.processCodeDeopt
},
- 'code-move':
- {parsers: [parseInt, parseInt], processor: this.processCodeMove},
- 'code-delete': {parsers: [parseInt], processor: this.processCodeDelete},
+ 'code-move': {
+ parsers: [this.parseAddress, this.parseAddress],
+ processor: this.processCodeMove
+ },
+ 'code-delete':
+ {parsers: [this.parseAddress], processor: this.processCodeDelete},
'code-source-info': {
parsers: [
- parseInt, parseInt, parseInt, parseInt, parseString, parseString,
- parseString
+ this.parseAddress, parseInt, parseInt, parseInt, parseString,
+ parseString, parseString
],
processor: this.processCodeSourceInfo
},
'code-disassemble': {
- parsers: [
- parseInt,
- parseString,
- parseString,
- ],
+ parsers: [this.parseAddress, parseString, parseString],
processor: this.processCodeDisassemble
},
'feedback-vector': {
parsers: [
- parseInt, parseString, parseInt, parseInt, parseString, parseString,
- parseInt, parseInt, parseString
+ parseInt, parseString, parseInt, this.parseAddress, parseString,
+ parseString, parseInt, parseInt, parseString
],
processor: this.processFeedbackVector
},
@@ -135,11 +139,15 @@ export class Processor extends LogReader {
parsers: [parseInt, parseString, parseString],
processor: this.processScriptSource
},
- 'sfi-move':
- {parsers: [parseInt, parseInt], processor: this.processFunctionMove},
+ 'sfi-move': {
+ parsers: [this.parseAddress, this.parseAddress],
+ processor: this.processFunctionMove
+ },
'tick': {
- parsers:
- [parseInt, parseInt, parseInt, parseInt, parseInt, parseVarArgs],
+ parsers: [
+ this.parseAddress, parseInt, parseInt, this.parseAddress, parseInt,
+ parseVarArgs
+ ],
processor: this.processTick
},
'active-runtime-timer': undefined,
@@ -157,8 +165,8 @@ export class Processor extends LogReader {
{parsers: [parseInt, parseString], processor: this.processMapCreate},
'map': {
parsers: [
- parseString, parseInt, parseString, parseString, parseInt, parseInt,
- parseInt, parseString, parseString
+ parseString, parseInt, parseString, parseString, this.parseAddress,
+ parseInt, parseInt, parseString, parseString
],
processor: this.processMap
},
@@ -352,7 +360,7 @@ export class Processor extends LogReader {
let profilerEntry;
let stateName = '';
if (maybe_func.length) {
- const funcAddr = parseInt(maybe_func[0]);
+ const funcAddr = this.parseAddress(maybe_func[0]);
stateName = maybe_func[1] ?? '';
const state = Profile.parseState(maybe_func[1]);
profilerEntry = this._profile.addFuncCode(
@@ -404,7 +412,7 @@ export class Processor extends LogReader {
optimization_tier, invocation_count, profiler_ticks, fbv_string) {
const profCodeEntry = this._profile.findEntry(instructionStart);
if (!profCodeEntry) {
- console.warn('Didn\'t find code for FBV', {fbv, instructionStart});
+ console.warn('Didn\'t find code for FBV', {fbv_string, instructionStart});
return;
}
const fbv = new FeedbackVectorEntry(
@@ -439,13 +447,13 @@ export class Processor extends LogReader {
// that a callback calls itself. Instead we use tos_or_external_callback,
// as simply resetting PC will produce unaccounted ticks.
pc = tos_or_external_callback;
- tos_or_external_callback = 0;
+ tos_or_external_callback = this.kZero;
} else if (tos_or_external_callback) {
// Find out, if top of stack was pointing inside a JS function
// meaning that we have encountered a frameless invocation.
const funcEntry = this._profile.findEntry(tos_or_external_callback);
if (!funcEntry?.isJSFunction?.()) {
- tos_or_external_callback = 0;
+ tos_or_external_callback = this.kZero;
}
}
const entryStack = this._profile.recordTick(