* 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)
| 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 | /** |
nothing calls this directly
no test coverage detected