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

Method processMap

deps/v8/tools/system-analyzer/processor.mjs:540–576  ·  view source on GitHub ↗
(type, time, from, to, pc, line, column, reason, name)

Source from the content-addressed store, hash-verified

538 }
539
540 processMap(type, time, from, to, pc, line, column, reason, name) {
541 this._lastTimestamp = time;
542 const time_ = parseInt(time);
543 if (type === 'Deprecate') return this.deprecateMap(type, time_, from);
544 // Skip normalized maps that were cached so we don't introduce multiple
545 // edges with the same source and target map.
546 if (type === 'NormalizeCached') return;
547 const from_ = this.getOrCreateMapEntry(from, time_);
548 const to_ = this.getOrCreateMapEntry(to, time_);
549 if (type === 'Normalize') {
550 // Fix a bug where we log "Normalize" transitions for maps created from
551 // the NormalizedMapCache.
552 if (to_.parent?.id === from || to_.time < from_.time || to_.depth > 0) {
553 console.log(`Skipping transition to cached normalized map`);
554 return;
555 }
556 }
557 if (pc) {
558 const profCodeEntry = this._profile.findEntry(pc);
559 if (profCodeEntry) {
560 to_.entry = profCodeEntry;
561 profCodeEntry.logEntry.add(to_);
562 let script = this.getProfileEntryScript(profCodeEntry);
563 if (script) {
564 to_.sourcePosition = script.addSourcePosition(line, column, to_);
565 }
566 }
567 }
568 let edge = new Edge(type, name, reason, time, from_, to_);
569 if (to_.parent !== undefined && to_.parent === from_) {
570 // Fix bug where we double log transitions.
571 console.warn('Fixing up double transition');
572 to_.edge.updateFrom(edge);
573 } else {
574 edge.finishSetup();
575 }
576 }
577
578 deprecateMap(type, time, id) {
579 this._lastTimestamp = time;

Callers

nothing calls this directly

Calls 10

deprecateMapMethod · 0.95
getOrCreateMapEntryMethod · 0.95
getProfileEntryScriptMethod · 0.95
finishSetupMethod · 0.95
warnMethod · 0.80
updateFromMethod · 0.80
addMethod · 0.65
logMethod · 0.45
findEntryMethod · 0.45
addSourcePositionMethod · 0.45

Tested by

no test coverage detected