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

Method addAnyCode

deps/v8/tools/codemap.mjs:81–94  ·  view source on GitHub ↗

* Adds a code entry that might overlap with static code (e.g. for builtins). * * @param {number} start The starting address. * @param {CodeEntry} codeEntry Code entry object.

(start, codeEntry)

Source from the content-addressed store, hash-verified

79 * @param {CodeEntry} codeEntry Code entry object.
80 */
81 addAnyCode(start, codeEntry) {
82 const pageAddr = (start / this.kPageSize) | this.kZero;
83 if (!this.pages_.has(pageAddr)) return this.addCode(start, codeEntry);
84 // We might have loaded static code (builtins, bytecode handlers)
85 // and we get more information later in v8.log with code-creation events.
86 // Overwrite the existing entries in this case.
87 let result = this.findInTree_(this.statics_, start);
88 if (result === null) return this.addCode(start, codeEntry);
89
90 const removedNode = this.statics_.remove(start);
91 this.deleteAllCoveredNodes_(
92 this.statics_, start, start + removedNode.value.size);
93 this.statics_.insert(start, codeEntry);
94 }
95
96
97 /**

Callers

nothing calls this directly

Calls 6

addCodeMethod · 0.95
findInTree_Method · 0.95
hasMethod · 0.65
removeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected