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

Function childIdFromCode

deps/v8/tools/profview/profile-utils.js:115–127  ·  view source on GitHub ↗
(codeId, code)

Source from the content-addressed store, hash-verified

113}
114
115function childIdFromCode(codeId, code) {
116 // For JavaScript function, pretend there is one instance of optimized
117 // function and one instance of unoptimized function per SFI.
118 // Otherwise, just compute the id from code id.
119 let type = resolveCodeKind(code);
120 if (type === "JSOPT") {
121 return code.func * 4 + 1;
122 } else if (type === "JSUNOPT") {
123 return code.func * 4 + 2;
124 } else {
125 return codeId * 4;
126 }
127}
128
129// We store list of ticks and positions within the ticks stack by
130// storing flattened triplets of { tickIndex, depth, count }.

Callers 2

addOrUpdateChildNodeFunction · 0.85
addStackMethod · 0.85

Calls 1

resolveCodeKindFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…