Lines 323–333 at 127 (were 323–331 at 126)
323323 this.#together = storedMap(storage, "together"); 324324 this.#fileAtomPages = storedLists<AtomId>(storage, "file-atoms"); 325325 this.#runStarts = storedMap(storage, "run-starts"); 326− this.#relocations = storedMap(storage, "relocations");
327− this.#relocatedTo = storedMap(storage, "relocated-to");
328− this.#relocatedToCode = storedMap(storage, "relocated-to-code");
326+ this.#relocationPages = storedLists<RelocationInfo>(storage, "relocations"); 327+ this.#relocatedToPages = storedLists<RelocationInfo>(storage, "relocated-to"); 328+ this.#relocatedToCodePages = storedLists<RelocationInfo>(storage, "relocated-to-code", (key) => 329+ JSON.stringify(["number", Number(key)]), 329331 this.#labels = storedMap(storage, "labels"); Lines 440–451 at 127 (were 438–446 at 126)
438440 /** 1 for the first line of a run whose atom deleted the line it hangs off: the run replaces it. */ 439441 #replacing: NumberIndex = new Ints(true); 440442 #relocations: StateMap<LineId, RelocationInfo[]> = new Map(); 443+ #relocationPages: ReturnType<typeof storedLists<RelocationInfo>> | undefined; 441444 #relocatedTo: StateMap<NodeId, RelocationInfo[]> = new Map(); 445+ #relocatedToPages: ReturnType<typeof storedLists<RelocationInfo>> | undefined; 442446 /** The same relocations by node code (a line's n, or -1 - a path's index), for views laid out by number. */ 443447 #relocatedToCode: StateMap<number, RelocationInfo[]> = new Map(); 448+ #relocatedToCodePages: ReturnType<typeof storedLists<RelocationInfo>> | undefined; 444449 #movers: AtomId[] = []; 445450 #atomFiles: (readonly string[])[] = []; 446451 /** Each atom's deleted lines by n, packed (#46), or undefined when it deletes none. */ Lines 636–648 at 127 (were 631–638 at 126)
632637 /** Every relocation that puts a line right after the node with this code. */ 633638 relocatedToCode(code: number): readonly RelocationInfo[] { 639+ if (this.#relocatedToCodePages) return [...this.eachRelocatedToCode(code)]; 634640 return this.#relocatedToCode.get(code) ?? EMPTY; 642+ *eachRelocatedToCode(code: number): IterableIterator<RelocationInfo> { 643+ if (this.#relocatedToCodePages) yield* this.#relocatedToCodePages.values(String(code)); 644+ else yield* this.#relocatedToCode.get(code) ?? EMPTY; 637647 /** How many lines every atom together has written. */ 638648 get lineCount(): number { Lines 792–808 at 127 (were 782–792 at 126)
783793 /** Every relocation of a line, in seq order. */ 784794 relocationsOf(line: LineId): readonly RelocationInfo[] { 795+ if (this.#relocationPages) return [...this.eachRelocationOf(line)]; 785796 return this.#relocations.get(line) ?? EMPTY; 798+ *eachRelocationOf(line: LineId): IterableIterator<RelocationInfo> { 799+ if (this.#relocationPages) yield* this.#relocationPages.values(line); 800+ else yield* this.#relocations.get(line) ?? EMPTY; 788803 /** Every relocation that puts a line right after this node, in seq order. */ 789804 relocatedTo(node: NodeId): readonly RelocationInfo[] { 805+ if (this.#relocatedToPages) return [...this.#relocatedToPages.values(node)]; 790806 return this.#relocatedTo.get(node) ?? EMPTY; Lines 1014–1026 at 127 (were 998–1010 at 126)
9991015 (frozen.moves ?? []).forEach((m, i) => { 10001016 const info: RelocationInfo = Object.freeze({ atom: frozen.id, line: m.line, parent: m.parent, k: i }); 1001− pushIndex(this.#relocations, m.line, info);
1002− pushIndex(this.#relocatedTo, m.parent, info);
1003− pushIndex(
1004− this.#relocatedToCode,
1005− isStartNode(m.parent) ? -1 - this.#pathOf(m.parent.slice(1)) : this.#lineN(m.parent),
1006− info,
1007− );
1017+ if (this.#relocationPages) this.#relocationPages.append(m.line, info); 1018+ else pushIndex(this.#relocations, m.line, info); 1019+ if (this.#relocatedToPages) this.#relocatedToPages.append(m.parent, info); 1020+ else pushIndex(this.#relocatedTo, m.parent, info); 1021+ const parentCode = isStartNode(m.parent) ? -1 - this.#pathOf(m.parent.slice(1)) : this.#lineN(m.parent); 1022+ if (this.#relocatedToCodePages) this.#relocatedToCodePages.append(String(parentCode), info); 1023+ else pushIndex(this.#relocatedToCode, parentCode, info); 10091025 if (frozen.moves) this.#movers.push(frozen.id); 10101026 for (const n of deletedN) {