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

Function addOrUpdateChildNode

deps/v8/tools/profview/profile-utils.js:160–185  ·  view source on GitHub ↗
(parent, file, stackIndex, stackPos, ascending)

Source from the content-addressed store, hash-verified

158}
159
160function addOrUpdateChildNode(parent, file, stackIndex, stackPos, ascending) {
161 if (stackPos === -1) {
162 // We reached the end without finding the next step.
163 // If we are doing top-down call tree, update own ticks.
164 if (!ascending) {
165 parent.ownTicks++;
166 }
167 return;
168 }
169
170 let stack = file.ticks[stackIndex].s;
171 console.assert(stackPos >= 0 && stackPos < stack.length);
172 let codeId = stack[stackPos];
173 let code = codeId >= 0 ? file.code[codeId] : undefined;
174 // We found a child node.
175 let childId = childIdFromCode(codeId, code);
176 let child = parent.children[childId];
177 if (!child) {
178 let vmState = file.ticks[stackIndex].vm;
179 child = createNodeFromStackEntry(code, codeId, vmState);
180 child.delayedExpansion = { frameList : [], ascending };
181 parent.children[childId] = child;
182 }
183 child.ticks++;
184 addFrameToFrameList(child.delayedExpansion.frameList, stackIndex, stackPos);
185}
186
187// This expands a tree node (direct children only).
188function expandTreeNode(file, node, filter) {

Callers 4

expandTreeNodeFunction · 0.85
addStackMethod · 0.85
addStackMethod · 0.85
addStackMethod · 0.85

Calls 4

childIdFromCodeFunction · 0.85
createNodeFromStackEntryFunction · 0.85
addFrameToFrameListFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…