MCPcopy
hub / github.com/rollup/rollup / deoptimizeCache

Method deoptimizeCache

src/ast/nodes/LogicalExpression.ts:77–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 }
76
77 deoptimizeCache(): void {
78 if (this.hasDeoptimizedCache) return;
79 this.hasDeoptimizedCache = true;
80 if (this.usedBranch) {
81 const unusedBranch = this.usedBranch === this.left ? this.right : this.left;
82 this.usedBranch = null;
83 unusedBranch.deoptimizePath(UNKNOWN_PATH);
84 if (this.included) {
85 // As we are not tracking inclusions, we just include everything
86 unusedBranch.includePath(UNKNOWN_PATH, createInclusionContext());
87 }
88 }
89 const {
90 scope: { context },
91 expressionsToBeDeoptimized
92 } = this;
93 this.expressionsToBeDeoptimized = EMPTY_ARRAY as unknown as DeoptimizableEntity[];
94 for (const expression of expressionsToBeDeoptimized) {
95 expression.deoptimizeCache();
96 }
97 // Request another pass because we need to ensure "include" runs again if
98 // it is rendered
99 context.requestTreeshakingPass();
100 }
101
102 deoptimizePath(path: ObjectPath): void {
103 const usedBranch = this.getUsedBranch();

Callers

nothing calls this directly

Calls 4

createInclusionContextFunction · 0.90
deoptimizePathMethod · 0.65
includePathMethod · 0.65
deoptimizeCacheMethod · 0.65

Tested by

no test coverage detected