refactor(v8): derive printable run length from scan offsets (#17327)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-06 08:40:35 +08:00
1 parent eed11027e9
commit 108443db1d
1 file changed
+1 -4
+1 -4
View File
@@ -203,7 +203,6 @@ class V8CodeCachePayloadScanner {
readonly #maxStrings: number;
#cursor = 0;
#runStart = -1;
#runLength = 0;
// not-an-allowance: fixed scratch buffer write length capped at MAX_INSPECT_V8_CODE_CACHE_STRING_BYTES
#retainedLength = 0;
@@ -215,7 +214,7 @@ class V8CodeCachePayloadScanner {
#flush(): void {
if (this.#runStart < 0) return;
const runBytes = this.#runLength;
const runBytes = this.#cursor - this.#runStart;
if (runBytes >= this.#minStringBytes) {
if (this.#observations.length >= this.#maxStrings)
// The message states the fact. Recovery advice belongs to the provider, which
@@ -235,7 +234,6 @@ class V8CodeCachePayloadScanner {
});
}
this.#runStart = -1;
this.#runLength = 0;
this.#retainedLength = 0;
}
@@ -251,7 +249,6 @@ class V8CodeCachePayloadScanner {
this.#runBuffer[this.#retainedLength] = byte;
this.#retainedLength += 1;
}
this.#runLength += 1;
} else {
this.#flush();
}