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

Function resolveCodeKind

deps/v8/tools/profview/profile-utils.js:29–71  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

27];
28
29function resolveCodeKind(code) {
30 if (!code || !code.type) {
31 return "UNKNOWN";
32 }
33 const type = code.type;
34 if (type === "CPP") {
35 return "CPP";
36 } else if (type === "SHARED_LIB") {
37 return "LIB";
38 }
39 const kind = code.kind;
40 if (type === "CODE") {
41 if (kind === "LoadIC" ||
42 kind === "StoreIC" ||
43 kind === "KeyedStoreIC" ||
44 kind === "KeyedLoadIC" ||
45 kind === "LoadGlobalIC" ||
46 kind === "Handler") {
47 return "IC";
48 } else if (kind === "BytecodeHandler") {
49 return "BC";
50 } else if (kind === "Stub") {
51 return "STUB";
52 } else if (kind === "Builtin") {
53 return "BUILTIN";
54 } else if (kind === "RegExp") {
55 return "REGEXP";
56 }
57 console.warn("Unknown CODE: '" + kind + "'.");
58 return "CODE";
59 } else if (type === "JS") {
60 if (kind === "Builtin" || kind == "Ignition" || kind === "Unopt") {
61 return "JS_IGNITION";
62 } else if (kind === "Baseline" || kind === "Sparkplug") {
63 return "JS_SPARKPLUG";
64 } else if (kind === "Maglev") {
65 return "JS_MAGLEV";
66 } else if (kind === "Opt" || kind === "Turbofan") {
67 return "JS_TURBOFAN";
68 }
69 }
70 console.warn("Unknown code type '" + kind + "'.");
71}
72
73function resolveCodeKindAndVmState(code, vmState) {
74 let kind = resolveCodeKind(code);

Callers 2

childIdFromCodeFunction · 0.85

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…