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

Method resolveAndFilterFuncs_

deps/v8/tools/profile.mjs:694–730  ·  view source on GitHub ↗

* Translates addresses into function names and filters unneeded * functions. * * @param {number[]} stack Stack sample.

(stack)

Source from the content-addressed store, hash-verified

692 * @param {number[]} stack Stack sample.
693 */
694 resolveAndFilterFuncs_(stack) {
695 const nameStack = [];
696 const entryStack = [];
697 let last_seen_c_function = '';
698 let look_for_first_c_function = false;
699 for (let i = 0; i < stack.length; ++i) {
700 const pc = stack[i];
701 const entry = this.codeMap_.findEntry(pc);
702 if (entry !== null) {
703 entryStack.push(entry);
704 const name = entry.getName();
705 if (i === 0 && (entry.type === 'CPP' || entry.type === 'SHARED_LIB')) {
706 look_for_first_c_function = true;
707 }
708 if (look_for_first_c_function && entry.type === 'CPP') {
709 last_seen_c_function = name;
710 }
711 if (!this.skipThisFunction(name)) {
712 nameStack.push(name);
713 }
714 } else {
715 this.handleUnknownCode(kProfileOperationTick, pc, i);
716 if (i === 0) nameStack.push("UNKNOWN");
717 entryStack.push(pc);
718 }
719 if (look_for_first_c_function && i > 0 &&
720 (entry === null || entry.type !== 'CPP')
721 && last_seen_c_function !== '') {
722 if (this.c_entries_[last_seen_c_function] === undefined) {
723 this.c_entries_[last_seen_c_function] = 0;
724 }
725 this.c_entries_[last_seen_c_function]++;
726 look_for_first_c_function = false; // Found it, we're done.
727 }
728 }
729 return {nameStack, entryStack};
730 }
731
732 /**
733 * Performs a BF traversal of the top down call graph.

Callers 1

recordTickMethod · 0.95

Calls 5

skipThisFunctionMethod · 0.95
handleUnknownCodeMethod · 0.95
findEntryMethod · 0.45
pushMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected