Skip to content

Commit ffc5793

Browse files
committed
Remove symbol chain cache
1 parent 03da79d commit ffc5793

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,6 @@ namespace ts {
375375
// extra cost of calling `getParseTreeNode` when calling these functions from inside the
376376
// checker.
377377
const checker: TypeChecker = {
378-
setSymbolChainCache: (cache: SymbolChainCache | undefined): void => {
379-
nodeBuilder.setSymbolChainCache(cache);
380-
},
381378
getNodeCount: () => sum(host.getSourceFiles(), "nodeCount"),
382379
getIdentifierCount: () => sum(host.getSourceFiles(), "identifierCount"),
383380
getSymbolCount: () => sum(host.getSourceFiles(), "symbolCount") + symbolCount,
@@ -4497,9 +4494,7 @@ namespace ts {
44974494
}
44984495

44994496
function createNodeBuilder() {
4500-
let symbolChainCache: SymbolChainCache | undefined;
45014497
return {
4502-
setSymbolChainCache: (cache: SymbolChainCache | undefined): void => { symbolChainCache = cache },
45034498
typeToTypeNode: (type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags, tracker?: SymbolTracker) =>
45044499
withContext(enclosingDeclaration, flags, tracker, context => typeToTypeNodeHelper(type, context)),
45054500
indexInfoToIndexSignatureDeclaration: (indexInfo: IndexInfo, enclosingDeclaration?: Node, flags?: NodeBuilderFlags, tracker?: SymbolTracker) =>
@@ -4537,7 +4532,6 @@ namespace ts {
45374532
fileExists: fileName => host.fileExists(fileName),
45384533
getFileIncludeReasons: () => host.getFileIncludeReasons(),
45394534
} : undefined },
4540-
cache: symbolChainCache,
45414535
encounteredError: false,
45424536
reportedDiagnostic: false,
45434537
visitedTypes: undefined,
@@ -5626,30 +5620,6 @@ namespace ts {
56265620

56275621
/** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */
56285622
function getSymbolChain(symbol: Symbol, meaning: SymbolFlags, endOfChain: boolean): Symbol[] | undefined {
5629-
let key: SymbolChainCacheKey | undefined;
5630-
let result: Symbol[] | undefined;
5631-
if (context.cache) {
5632-
key = {
5633-
symbol,
5634-
enclosingDeclaration: context.enclosingDeclaration,
5635-
flags: context.flags,
5636-
meaning: meaning,
5637-
yieldModuleSymbol: yieldModuleSymbol,
5638-
endOfChain: endOfChain
5639-
}
5640-
result = context.cache.lookup(key);
5641-
if (result) {
5642-
return result;
5643-
}
5644-
}
5645-
result = doGetSymbolChain(symbol, meaning, endOfChain);
5646-
if (result && key && context.cache) {
5647-
context.cache.cache(key, result);
5648-
}
5649-
return result;
5650-
}
5651-
5652-
function doGetSymbolChain(symbol: Symbol, meaning: SymbolFlags, endOfChain: boolean): Symbol[] | undefined {
56535623
let accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & NodeBuilderFlags.UseOnlyExternalAliasing));
56545624
let parentSpecifiers: (string | undefined)[];
56555625
if (!accessibleSymbolChain ||
@@ -7863,7 +7833,6 @@ namespace ts {
78637833
enclosingDeclaration: Node | undefined;
78647834
flags: NodeBuilderFlags;
78657835
tracker: SymbolTracker;
7866-
cache: SymbolChainCache | undefined;
78677836

78687837
// State
78697838
encounteredError: boolean;

src/compiler/types.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4096,22 +4096,7 @@ namespace ts {
40964096
readonly redirectTargetsMap: RedirectTargetsMap;
40974097
}
40984098

4099-
export interface SymbolChainCacheKey {
4100-
symbol: Symbol;
4101-
enclosingDeclaration?: Node;
4102-
flags: NodeBuilderFlags;
4103-
meaning: SymbolFlags;
4104-
yieldModuleSymbol?: boolean;
4105-
endOfChain: boolean;
4106-
}
4107-
4108-
export interface SymbolChainCache {
4109-
lookup(key: SymbolChainCacheKey): Symbol[] | undefined;
4110-
cache(key: SymbolChainCacheKey, value: Symbol[]): void;
4111-
}
4112-
41134099
export interface TypeChecker {
4114-
setSymbolChainCache(cache: SymbolChainCache | undefined): void;
41154100
getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type;
41164101
getDeclaredTypeOfSymbol(symbol: Symbol): Type;
41174102
getPropertiesOfType(type: Type): Symbol[];

0 commit comments

Comments
 (0)