MCPcopy Index your code
hub / github.com/nodejs/node / addStack

Method addStack

deps/v8/tools/profview/profile-utils.js:418–433  ·  view source on GitHub ↗
(file, tickIndex)

Source from the content-addressed store, hash-verified

416 }
417
418 addStack(file, tickIndex) {
419 let { tm : timestamp, vm : vmState, s : stack } = file.ticks[tickIndex];
420
421 let i = Math.floor((timestamp - this.firstTime) / this.step);
422 if (i === this.buckets.length) i--;
423 console.assert(i >= 0 && i < this.buckets.length);
424
425 let bucket = this.buckets[i];
426 bucket.total++;
427
428 let stackPos = findNextFrame(file, stack, 0, 2, this.filter);
429 let codeId = stackPos >= 0 ? stack[stackPos] : -1;
430 let code = codeId >= 0 ? file.code[codeId] : undefined;
431 let kind = resolveCodeKindAndVmState(code, vmState);
432 bucket[kind]++;
433 }
434}
435
436class FunctionTimelineProcessor {

Callers 1

generateTreeFunction · 0.45

Calls 3

findNextFrameFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected