@samitouri / QOS-React-2 / commits / 552fe1878b

Cleanup previous dep collection

Joe Savona committed Dec 14, 2022 at 08:42 UTC 552fe1878be8e73118bd18c1a217ca934aebdbb5
103 files changed -705
compiler/forget/packages/playground/components/Editor/Output.tsx
-11
@@ -28,7 +28,6 @@ const {
28 eliminateRedundantPhi,
29 inferReferenceEffects,
30 inferMutableRanges,
31 - inferReactiveScopeDependencies,
31 inferReactiveScopeVariables,
32 inferReactiveScopes,
33 leaveSSA,
@@ -55,7 +54,6 @@ type CompilerOutput = {
54 inferMutableRangesOutput: string;
55 inferReactiveScopeVariablesOutput: string;
56 inferReactiveScopesOutput: string;
58 - inferReactiveScopeDependenciesOutput: string;
57 reactiveFunctionOutput: string;
58 leaveSSAOutput: string;
59 codegenOutput: string;
@@ -99,9 +97,6 @@ function compile(source: string): CompilerOutput | CompilerError {
97 inferReactiveScopes(ir);
98 const inferReactiveScopesOutput = printHIR(ir.body);
99
102 - inferReactiveScopeDependencies(ir);
103 - const inferReactiveScopeDependenciesOutput = printHIR(ir.body);
104 -
100 const reactiveFunction = buildReactiveFunction(ir);
101 const reactiveFunctionOutput = printReactiveFunction(reactiveFunction);
102
@@ -131,7 +126,6 @@ function compile(source: string): CompilerOutput | CompilerError {
126 eliminateRedundantPhiOutput,
127 inferReferenceEffectsOutput,
128 inferMutableRangesOutput,
134 - inferReactiveScopeDependenciesOutput,
129 inferReactiveScopeVariablesOutput,
130 inferReactiveScopesOutput,
131 reactiveFunctionOutput,
@@ -205,11 +199,6 @@ function Output({ store, setTabsOpen, tabsOpen }: Props) {
199 output={compilerOutput.inferReactiveScopesOutput}
200 ></TextTabContent>
201 ),
208 - InferReactiveScopeDependencies: (
209 - <TextTabContent
210 - output={compilerOutput.inferReactiveScopeDependenciesOutput}
211 - ></TextTabContent>
212 - ),
202 ReactiveFunctions: (
203 <TextTabContent
204 output={compilerOutput.reactiveFunctionOutput}
compiler/forget/packages/playground/components/TabbedWindow.tsx
-1
@@ -15,7 +15,6 @@ export type TabTypes =
15 | "InferMutableRanges"
16 | "InferReactiveScopeVariables"
17 | "InferReactiveScopes"
18 - | "InferReactiveScopeDependencies"
18 | "ReactiveFunctions"
19 | "LeaveSSA"
20 | "JS"
compiler/forget/src/HIR/InferReactiveScopeDependencies.ts deleted
-248
@@ -1,248 +0,0 @@
1 -/**
2 - * Copyright (c) Facebook, Inc. and its affiliates.
3 - *
4 - * This source code is licensed under the MIT license found in the
5 - * LICENSE file in the root directory of this source tree.
6 - */
7 -
8 -import { assertExhaustive, retainWhere } from "../Common/utils";
9 -import {
10 - BlockId,
11 - HIRFunction,
12 - Identifier,
13 - Instruction,
14 - InstructionId,
15 - InstructionValue,
16 - makeInstructionId,
17 - Place,
18 - ReactiveScope,
19 -} from "./HIR";
20 -import { BlockTerminal, Visitor, visitTree } from "./HIRTreeVisitor";
21 -import { eachInstructionValueOperand } from "./visitors";
22 -
23 -export function inferReactiveScopeDependencies(fn: HIRFunction) {
24 - // TODO: visitTree is more of a transformer visitor, consider adding a new tree visitor
25 - // that only visits and replacing this usage
26 - const visitor = new ScopeDependenciesVisitor(fn);
27 - visitTree(fn, visitor);
28 -}
29 -
30 -export function instructionInScope(
31 - instrId: InstructionId,
32 - scope: ReactiveScope
33 -) {
34 - return instrId >= scope.range.start && instrId < scope.range.end;
35 -}
36 -
37 -class ScopeDependenciesVisitor
38 - implements Visitor<void, void, void, void, InstructionValue, void, void>
39 -{
40 - #kinds: Map<Identifier, DeclKind> = new Map();
41 - #identifiers: Map<Identifier, InstructionId> = new Map();
42 - // Scopes that are currently active at this point in the traversal
43 - #activeScopes: Set<ReactiveScope> = new Set();
44 -
45 - get #lastActiveScope(): ReactiveScope | null {
46 - const scopes = [...this.#activeScopes];
47 - return scopes[scopes.length - 1];
48 - }
49 -
50 - constructor(fn: HIRFunction) {
51 - if (fn.id !== null) {
52 - this.#identifiers.set(fn.id, makeInstructionId(0));
53 - this.#kinds.set(fn.id, DeclKind.Const);
54 - }
55 - for (const param of fn.params) {
56 - this.#identifiers.set(param.identifier, makeInstructionId(0));
57 - this.#kinds.set(param.identifier, DeclKind.Dynamic);
58 - }
59 - }
60 -
61 - #recordActiveScope(scope: ReactiveScope) {
62 - this.#activeScopes.add(scope);
63 - }
64 -
65 - /**
66 - * Prune any scopes that are out of range
67 - */
68 - #visitId(id: InstructionId): void {
69 - const scopes = [...this.#activeScopes];
70 - retainWhere(scopes, (pending) => pending.range.end > id);
71 - this.#activeScopes = new Set(scopes);
72 - }
73 -
74 - /**
75 - * Adds a dependency on the terminal operand to the last active scope
76 - */
77 - #addTerminalDependency(operand: Place): void {
78 - const activeScope = this.#lastActiveScope;
79 - if (activeScope != null) {
80 - const identId = this.#identifiers.get(operand.identifier);
81 - if (identId !== undefined && identId < activeScope.range.start) {
82 - activeScope.dependencies.add(operand);
83 - }
84 - }
85 - }
86 -
87 - visitTerminal(
88 - terminal: BlockTerminal<void, InstructionValue, void, void>
89 - ): void {
90 - switch (terminal.kind) {
91 - case "if":
92 - case "switch":
93 - case "for":
94 - case "while": {
95 - if (typeof terminal?.test?.kind !== "string") {
96 - console.log(terminal);
97 - }
98 - for (const operand of eachInstructionValueOperand(terminal.test)) {
99 - this.#addTerminalDependency(operand);
100 - }
101 - break;
102 - }
103 - case "return":
104 - case "throw": {
105 - if (terminal.value != null) {
106 - for (const operand of eachInstructionValueOperand(terminal.value)) {
107 - this.#addTerminalDependency(operand);
108 - }
109 - }
110 - break;
111 - }
112 - case "continue":
113 - case "break": {
114 - break;
115 - }
116 - default:
117 - assertExhaustive(terminal, `unhandled terminal ${terminal}`);
118 - }
119 - }
120 -
121 - visitTerminalId(id: InstructionId): void {
122 - this.#visitId(id);
123 - }
124 -
125 - /**
126 - * We don't need to map to a different representation, so just return the value directly
127 - */
128 - visitValue(value: InstructionValue, id: InstructionId): InstructionValue {
129 - return value;
130 - }
131 -
132 - visitInstruction(instr: Instruction, _value: InstructionValue): void {
133 - this.#visitId(instr.id);
134 - const { lvalue, value } = instr;
135 - if (lvalue !== null && lvalue.place.memberPath === null) {
136 - if (!this.#identifiers.has(lvalue.place.identifier)) {
137 - this.#identifiers.set(lvalue.place.identifier, instr.id);
138 - }
139 - }
140 -
141 - const activeScopes: Set<ReactiveScope> = new Set();
142 - const dependencies: Array<Place> = [];
143 - if (lvalue != null) {
144 - if (
145 - lvalue.place.identifier.scope !== null &&
146 - lvalue.place.memberPath === null &&
147 - instructionInScope(instr.id, lvalue.place.identifier.scope)
148 - ) {
149 - activeScopes.add(lvalue.place.identifier.scope);
150 - } else {
151 - dependencies.push(lvalue.place);
152 - }
153 - }
154 - for (const operand of eachInstructionValueOperand(value)) {
155 - if (
156 - operand.identifier.scope !== null &&
157 - instructionInScope(instr.id, operand.identifier.scope)
158 - ) {
159 - activeScopes.add(operand.identifier.scope);
160 - } else {
161 - dependencies.push(operand);
162 - }
163 - }
164 -
165 - for (const scope of activeScopes) {
166 - this.#recordActiveScope(scope);
167 - }
168 -
169 - if (dependencies.length > 0) {
170 - const scope = this.#lastActiveScope;
171 - if (scope != null) {
172 - for (const dep of dependencies) {
173 - const identId = this.#identifiers.get(dep.identifier);
174 - if (identId !== undefined && identId < scope.range.start) {
175 - scope.dependencies.add(dep);
176 - }
177 - }
178 - }
179 - }
180 - }
181 -
182 - enterBlock(): void {}
183 - enterValueBlock(): void {}
184 - enterInitBlock(block: void): void {}
185 - visitImplicitTerminal(): void | null {}
186 - visitCase(test: InstructionValue, block: void): void {}
187 - appendBlock(block: void, item: void, label?: BlockId | undefined): void {}
188 - appendValueBlock(block: void, item: void): void {}
189 - appendInitBlock(block: void, item: void): void {}
190 - leaveBlock(block: void): void {}
191 - leaveValueBlock(block: void, value: InstructionValue): InstructionValue {
192 - return value;
193 - }
194 - leaveInitBlock(block: void): void {}
195 -}
196 -
197 -enum DeclKind {
198 - Const = "Const",
199 - Dynamic = "Dynamic",
200 -}
201 -
202 -function visitOperand(
203 - operand: Place,
204 - dependencies: Set<Place>,
205 - declarations: Map<Identifier, DeclKind>
206 -): void {
207 - const kind = declarations.get(operand.identifier);
208 - if (kind === undefined) {
209 - // TODO: global, ignore
210 - return;
211 - } else if (kind === DeclKind.Const) {
212 - // constant, dont need to add a dep
213 - return;
214 - } else {
215 - for (const dep of dependencies) {
216 - // not the same identifier
217 - if (dep.identifier !== operand.identifier) {
218 - continue;
219 - }
220 - const depPath = dep.memberPath;
221 - // existing dep covers all paths
222 - if (depPath === null) {
223 - return;
224 - }
225 - const operandPath = operand.memberPath;
226 - // existing dep is for a path, this operand covers all paths so swap them
227 - if (operandPath === null) {
228 - dependencies.delete(dep);
229 - dependencies.add(operand);
230 - return;
231 - }
232 - // both the operand and dep have paths, determine if the existing path
233 - // is a subset of the new path
234 - let commonPathIndex = 0;
235 - while (
236 - commonPathIndex < operandPath.length &&
237 - commonPathIndex < depPath.length &&
238 - operandPath[commonPathIndex] === depPath[commonPathIndex]
239 - ) {
240 - commonPathIndex++;
241 - }
242 - if (commonPathIndex === depPath.length) {
243 - return;
244 - }
245 - }
246 - dependencies.add(operand);
247 - }
248 -}
compiler/forget/src/HIR/Pipeline.ts
-6
@@ -15,7 +15,6 @@ import { leaveSSA } from "../HIR/LeaveSSA";
15 import codegen from "./Codegen";
16 import { HIRFunction } from "./HIR";
17 import { inferMutableRanges } from "./InferMutableRanges";
18 -import { inferReactiveScopeDependencies } from "./InferReactiveScopeDependencies";
18 import { inferReactiveScopes } from "./InferReactiveScopes";
19 import { inferReactiveScopeVariables } from "./InferReactiveScopeVariables";
20 import { inferTypes } from "./InferTypes";
@@ -83,11 +82,6 @@ export default function (
82 logHIRFunction("inferReactiveScopes", ir);
83 }
84
86 - if (flags.inferReactiveScopeDependencies) {
87 - inferReactiveScopeDependencies(ir);
88 - logHIRFunction("inferReactiveScopeDependencies", ir);
89 - }
90 -
85 if (flags.codegen) {
86 return {
87 ast: codegen(ir),
compiler/forget/src/HIR/PrintHIR.ts
-24
@@ -25,7 +25,6 @@ import {
25 Terminal,
26 Type,
27 } from "./HIR";
28 -import { eachReactiveScope } from "./visitors";
28
29 export type Options = {
30 indent: number;
@@ -34,7 +33,6 @@ export type Options = {
33 export function printFunction(fn: HIRFunction): string {
34 const output = [];
35 output.push(printHIR(fn.body));
37 - output.push(printReactiveScopes(fn.body));
36 return output.join("\n");
37 }
38
@@ -358,25 +356,3 @@ export function printAliases(aliases: DisjointSet<Identifier>): string {
356
357 return items.join("\n");
358 }
361 -
362 -export function printReactiveScopes(ir: HIR) {
363 - const output = [];
364 - for (const scope of eachReactiveScope(ir)) {
365 - let shouldOutput = false;
366 - const line = [
367 - `scope${scope.id} [${scope.range.start}:${scope.range.end}]:`,
368 - ];
369 - if (scope.dependencies.size > 0) {
370 - shouldOutput = true;
371 - line.push(
372 - `${Array.from(scope.dependencies)
373 - .map((p) => " - dependency: " + printPlace(p))
374 - .join("\n")}`
375 - );
376 - }
377 - if (shouldOutput) {
378 - output.push(line.join("\n"));
379 - }
380 - }
381 - return output.join("\n");
382 -}
compiler/forget/src/__tests__/fixtures/hir/_bug_conditional-break-labeled.expect.md
-4
@@ -35,10 +35,6 @@ bb1:
35 predecessor blocks: bb0 bb2
36 [6] Call mutate a$4_@0.push(read props$3.d)
37 [7] Return freeze a$4_@0:TFunction
38 -scope0 [1:7]:
39 - - dependency: read props$3.a
40 - - dependency: read props$3.d
41 - - dependency: read props$3.c
38 ```
39
40 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/_bug_expression-with-assignment.expect.md
-1
@@ -20,7 +20,6 @@ bb0:
20 [3] Const mutate $6:TPrimitive = Binary read x$5:TPrimitive + read x$5:TPrimitive
21 [4] Const mutate $7:TPrimitive = Binary read $6:TPrimitive + read x$5:TPrimitive
22 [5] Return read $7:TPrimitive
23 -
23 ```
24
25 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/alias-nested-member-path-mutate.expect.md
-1
@@ -24,7 +24,6 @@ bb0:
24 [5] Reassign mutate x$7_@0.y[1:7] = read y$6_@0:TObject
25 [6] Call mutate mutate$4:TFunction(mutate x$7_@0.y.z)
26 [7] Return
27 -
27 ```
28
29 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/alias-nested-member-path.expect.md
-4
@@ -23,10 +23,6 @@ bb0:
23 [4] Const mutate x$6_@2:TObject[4:6] = Object { }
24 [5] Reassign mutate x$6_@2.y[4:6] = read y$5_@1:TObject
25 [6] Return freeze x$6_@2:TObject
26 -scope1 [2:4]:
27 - - dependency: read z$4_@0
28 -scope2 [4:6]:
29 - - dependency: read y$5_@1:TObject
26 ```
27
28 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/alias-while.expect.md
-3
@@ -48,8 +48,6 @@ bb2:
48 [13] read b$9_@0:TObject
49 [14] read c$10_@0:TObject
50 [15] Return freeze a$8_@0:TObject
51 -scope0 [1:12]:
52 - - dependency: read cond$7
51 ```
52
53 ## Reactive Scopes
@@ -107,7 +105,6 @@ function foo$0(cond$7) {
105 ```
106 bb0:
107 [1] Return
110 -
108 ```
109
110 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/assignment-variations.expect.md
-2
@@ -28,7 +28,6 @@ bb0:
28 [6] Const mutate $10:TPrimitive = 1
29 [7] Const mutate x$11:TPrimitive = Binary read x$9:TPrimitive >>> read $10:TPrimitive
30 [8] Return
31 -
31 ```
32
33 ## Reactive Scopes
@@ -68,7 +67,6 @@ bb0:
67 [3] Const mutate $6:TPrimitive = 2
68 [4] Reassign mutate a$4_@0.b.c[0:5] = Binary read a$4_@0.b.c * read $6:TPrimitive
69 [5] Return
71 -
70 ```
71
72 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/call.expect.md
-7
@@ -20,7 +20,6 @@ function Component(props) {
20 ```
21 bb0:
22 [1] Return
23 -
23 ```
24
25 ## Reactive Scopes
@@ -52,12 +51,6 @@ bb0:
51 [7] Const mutate $14:TPrimitive = "div"
52 [8] Const mutate $15_@2 = JSX <read $14:TPrimitive a={read a$10_@0:TObject} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
53 [9] Return read $15_@2
55 -scope1 [5:6]:
56 - - dependency: read $12:TPrimitive
57 -scope2 [8:9]:
58 - - dependency: read $14:TPrimitive
59 - - dependency: read a$10_@0:TObject
60 - - dependency: freeze b$11_@0:TObject
54 ```
55
56 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/complex-while.expect.md
-1
@@ -34,7 +34,6 @@ bb7:
34 bb1:
35 predecessor blocks: bb6 bb4 bb0
36 [6] Return
37 -
37 ```
38
39 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/component.expect.md
-16
@@ -100,22 +100,6 @@ bb2:
100 [40] Const mutate $73 = "\n "
101 [41] Const mutate $74_@5 = JSX <read $67:TPrimitive>{read $68}{read $71_@4}{read $72}{freeze renderedItems$32_@0:TFunction}{read $73}</read $67:TPrimitive>
102 [42] Return read $74_@5
103 -scope2 [6:7]:
104 - - dependency: read $34:TPrimitive
105 - - dependency: read maxItems$31:TProp
106 -scope3 [24:25]:
107 - - dependency: read $49:TPrimitive
108 -scope4 [38:39]:
109 - - dependency: read $69:TPrimitive
110 - - dependency: freeze count$66:TProp
111 - - dependency: read $70
112 -scope5 [41:42]:
113 - - dependency: read $67:TPrimitive
114 - - dependency: read $68
115 - - dependency: read $71_@4
116 - - dependency: read $72
117 - - dependency: freeze renderedItems$32_@0:TFunction
118 - - dependency: read $73
103 ```
104
105 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/conditional-break.expect.md
-23
@@ -89,10 +89,6 @@ bb1:
89 predecessor blocks: bb0
90 [6] Call mutate a_DEBUG$5_@0.push(read props$4.d)
91 [7] Return freeze a_DEBUG$5_@0:TFunction
92 -scope0 [1:7]:
93 - - dependency: read props$4.a
94 - - dependency: read props$4.b
95 - - dependency: read props$4.d
92 ```
93
94 ## Reactive Scopes
@@ -145,11 +141,6 @@ bb1:
141 predecessor blocks: bb2 bb0
142 [6] Call mutate a$4_@0.push(read props$3.d)
143 [7] Return freeze a$4_@0:TFunction
148 -scope0 [1:7]:
149 - - dependency: read props$3.a
150 - - dependency: read props$3.c
151 - - dependency: read props$3.b
152 - - dependency: read props$3.d
144 ```
145
146 ## Reactive Scopes
@@ -202,11 +193,6 @@ bb1:
193 predecessor blocks: bb0
194 [7] Call mutate a$5_@0.push(read props$4.d)
195 [8] Return freeze a$5_@0:TFunction
205 -scope0 [1:8]:
206 - - dependency: read props$4.a
207 - - dependency: read props$4.c
208 - - dependency: read props$4.b
209 - - dependency: read props$4.d
196 ```
197
198 ## Reactive Scopes
@@ -261,11 +247,6 @@ bb1:
247 predecessor blocks: bb0
248 [6] Call mutate a$4_@0.push(read props$3.d)
249 [7] Return freeze a$4_@0:TFunction
264 -scope0 [1:7]:
265 - - dependency: read props$3.a
266 - - dependency: read props$3.c
267 - - dependency: read props$3.b
268 - - dependency: read props$3.d
250 ```
251
252 ## Reactive Scopes
@@ -319,10 +300,6 @@ bb1:
300 predecessor blocks: bb0 bb2
301 [6] Call mutate a$4_@0.push(read props$3.d)
302 [7] Return freeze a$4_@0:TFunction
322 -scope0 [1:7]:
323 - - dependency: read props$3.a
324 - - dependency: read props$3.d
325 - - dependency: read props$3.c
303 ```
304
305 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/conditional-on-mutable.expect.md
-8
@@ -53,9 +53,6 @@ bb3:
53 predecessor blocks: bb4 bb1
54 [9] Const mutate $16_@2 = JSX <read Foo$4 a={freeze a$7_@0:TFunction} b={freeze b$8_@0:TFunction} ></read Foo$4>
55 [10] Return read $16_@2
56 -scope2 [9:10]:
57 - - dependency: freeze a$7_@0:TFunction
58 - - dependency: freeze b$8_@0:TFunction
56 ```
57
58 ## Reactive Scopes
@@ -123,9 +120,6 @@ bb3:
120 predecessor blocks: bb4 bb1
121 [10] Const mutate $19_@2 = JSX <read Foo$6 a={freeze a$9_@0:TFunction} b={freeze b$10_@0:TFunction} ></read Foo$6>
122 [11] Return read $19_@2
126 -scope2 [10:11]:
127 - - dependency: freeze a$9_@0:TFunction
128 - - dependency: freeze b$10_@0:TFunction
123 ```
124
125 ## Reactive Scopes
@@ -176,7 +170,6 @@ function Component$0(props$8) {
170 ```
171 bb0:
172 [1] Return
179 -
173 ```
174
175 ## Reactive Scopes
@@ -200,7 +193,6 @@ function Foo$0() {}
193 ```
194 bb0:
195 [1] Return
203 -
196 ```
197
198 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/constructor.expect.md
-7
@@ -20,7 +20,6 @@ function Component(props) {
20 ```
21 bb0:
22 [1] Return
23 -
23 ```
24
25 ## Reactive Scopes
@@ -52,12 +51,6 @@ bb0:
51 [7] Const mutate $14:TPrimitive = "div"
52 [8] Const mutate $15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
53 [9] Return read $15_@2
55 -scope1 [5:6]:
56 - - dependency: read $12:TPrimitive
57 -scope2 [8:9]:
58 - - dependency: read $14:TPrimitive
59 - - dependency: read a$10_@0
60 - - dependency: freeze b$11_@0:TObject
54 ```
55
56 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/dependencies-outputs.expect.md
-7
@@ -42,13 +42,6 @@ bb4:
42 bb3:
43 predecessor blocks: bb4 bb1
44 [12] Return
45 -scope0 [1:3]:
46 - - dependency: read a$6
47 -scope1 [5:12]:
48 - - dependency: read x$8_@0:TFunction
49 - - dependency: read x$8_@0.length
50 - - dependency: read b$7:TFunction
51 - - dependency: read b$7:TFunction
45 ```
46
47 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/dependencies.expect.md
-8
@@ -42,14 +42,6 @@ bb4:
42 bb3:
43 predecessor blocks: bb4 bb1
44 [10] Return freeze items2$10_@1:TFunction
45 -scope0 [1:10]:
46 - - dependency: read z$8
47 - - dependency: read x$6
48 - - dependency: read x$6
49 - - dependency: read y$7
50 -scope1 [3:7]:
51 - - dependency: read y$7
52 - - dependency: read x$6
45 ```
46
47 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/extend-scopes-if.expect.md
-4
@@ -46,10 +46,6 @@ bb7:
46 predecessor blocks: bb1
47 [10] Const mutate $13:TPrimitive = null
48 [11] Return read $13:TPrimitive
49 -scope0 [1:8]:
50 - - dependency: read c$9
51 - - dependency: read b$8
52 - - dependency: read a$7
49 ```
50
51 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/frozen-after-alias.expect.md
-3
@@ -23,7 +23,6 @@ bb0:
23 [3] Call read useFreeze$3:TFunction(freeze a$5_@0)
24 [4] Call mutate foo$4:TFunction(read b$6)
25 [5] Return
26 -
26 ```
27
28 ## Reactive Scopes
@@ -58,7 +57,6 @@ function Component$0() {
57 ```
58 bb0:
59 [1] Return
61 -
60 ```
61
62 ## Reactive Scopes
@@ -82,7 +80,6 @@ function useFreeze$0() {}
80 ```
81 bb0:
82 [1] Return
85 -
83 ```
84
85 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/hook-call.expect.md
-11
@@ -24,7 +24,6 @@ function Component(props) {
24 ```
25 bb0:
26 [1] Return
27 -
27 ```
28
29 ## Reactive Scopes
@@ -48,7 +47,6 @@ function useFreeze$0() {}
47 ```
48 bb0:
49 [1] Return
51 -
50 ```
51
52 ## Reactive Scopes
@@ -79,15 +77,6 @@ bb0:
77 [6] Const mutate $15 = "\n "
78 [7] Const mutate $16_@2 = JSX <read Component$0>{read $13}{read x$11_@0}{read $14}{read y$12_@1}{read $15}</read Component$0>
79 [8] Return read $16_@2
82 -scope1 [2:3]:
83 - - dependency: freeze x$11_@0
84 -scope2 [7:8]:
85 - - dependency: read Component$0
86 - - dependency: read $13
87 - - dependency: read x$11_@0
88 - - dependency: read $14
89 - - dependency: read y$12_@1
90 - - dependency: read $15
80 ```
81
82 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/hooks-freeze-arguments.expect.md
-3
@@ -24,7 +24,6 @@ bb0:
24 [3] Call read useFreeze$2:TFunction(read a$4_@0)
25 [4] Call mutate call$3:TFunction(read a$4_@0)
26 [5] Return read a$4_@0
27 -
27 ```
28
29 ## Reactive Scopes
@@ -60,7 +59,6 @@ function Component$0() {
59 ```
60 bb0:
61 [1] Return
63 -
62 ```
63
64 ## Reactive Scopes
@@ -85,7 +83,6 @@ function useFreeze$0(x$2) {}
83 ```
84 bb0:
85 [1] Return
88 -
86 ```
87
88 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/hooks-freeze-possibly-mutable-arguments.expect.md
-5
@@ -45,9 +45,6 @@ bb1:
45 [10] Call read useFreeze$5:TFunction(read a$11_@0:TProp)
46 [11] Call mutate call$6:TFunction(read a$11_@0:TProp)
47 [12] Return read a$11_@0:TProp
48 -scope0 [4:9]:
49 - - dependency: read x$9:TProp
50 - - dependency: read cond$8:TProp
48 ```
49
50 ## Reactive Scopes
@@ -101,7 +98,6 @@ function Component$0(props$7) {
98 ```
99 bb0:
100 [1] Return
104 -
101 ```
102
103 ## Reactive Scopes
@@ -126,7 +122,6 @@ function useFreeze$0(x$2) {}
122 ```
123 bb0:
124 [1] Return
129 -
125 ```
126
127 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/independent-across-if.expect.md
-9
@@ -38,7 +38,6 @@ function Component(props) {
38 ```
39 bb0:
40 [1] Return
41 -
41 ```
42
43 ## Reactive Scopes
@@ -62,7 +61,6 @@ function compute$0() {}
61 ```
62 bb0:
63 [1] Return
65 -
64 ```
65
66 ## Reactive Scopes
@@ -86,7 +84,6 @@ function mutate$0() {}
84 ```
85 bb0:
86 [1] Return
89 -
87 ```
88
89 ## Reactive Scopes
@@ -110,7 +107,6 @@ function foo$0() {}
107 ```
108 bb0:
109 [1] Return
113 -
110 ```
111
112 ## Reactive Scopes
@@ -145,11 +141,6 @@ bb1:
141 predecessor blocks: bb2 bb0
142 [7] Const mutate $14_@2 = JSX <read Foo$6 a={freeze a$9_@1} b={freeze b$10_@1} ></read Foo$6>
143 [8] Return read $14_@2
148 -scope1 [1:7]:
149 - - dependency: read props$8.a
150 -scope2 [7:8]:
151 - - dependency: freeze a$9_@1
152 - - dependency: freeze b$10_@1
144 ```
145
146 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/independent.expect.md
-10
@@ -32,13 +32,6 @@ bb0:
32 [2] Const mutate b$9_@1 = Call mutate compute$3:TFunction(read props$7.b)
33 [3] Const mutate $10_@2 = JSX <read Foo$5 a={freeze a$8_@0} b={freeze b$9_@1} ></read Foo$5>
34 [4] Return read $10_@2
35 -scope0 [1:2]:
36 - - dependency: read props$7.a
37 -scope1 [2:3]:
38 - - dependency: read props$7.b
39 -scope2 [3:4]:
40 - - dependency: freeze a$8_@0
41 - - dependency: freeze b$9_@1
35 ```
36
37 ## Reactive Scopes
@@ -76,7 +69,6 @@ function Component$0(props$7) {
69 ```
70 bb0:
71 [1] Return
79 -
72 ```
73
74 ## Reactive Scopes
@@ -100,7 +92,6 @@ function compute$0() {}
92 ```
93 bb0:
94 [1] Return
103 -
95 ```
96
97 ## Reactive Scopes
@@ -124,7 +115,6 @@ function foo$0() {}
115 ```
116 bb0:
117 [1] Return
127 -
118 ```
119
120 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/interdependent-across-if.expect.md
-10
@@ -32,7 +32,6 @@ function Component(props) {
32 ```
33 bb0:
34 [1] Return
35 -
35 ```
36
37 ## Reactive Scopes
@@ -56,7 +55,6 @@ function compute$0() {}
55 ```
56 bb0:
57 [1] Return
59 -
58 ```
59
60 ## Reactive Scopes
@@ -80,7 +78,6 @@ function foo$0() {}
78 ```
79 bb0:
80 [1] Return
83 -
81 ```
82
83 ## Reactive Scopes
@@ -114,13 +111,6 @@ bb1:
111 predecessor blocks: bb2 bb0
112 [6] Const mutate $14_@1 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
113 [7] Return read $14_@1
117 -scope0 [1:6]:
118 - - dependency: read props$8.a
119 - - dependency: read props$8.b
120 - - dependency: read props$8.c
121 -scope1 [6:7]:
122 - - dependency: freeze a$9_@0
123 - - dependency: freeze b$10_@0
114 ```
115
116 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/interdependent.expect.md
-9
@@ -33,12 +33,6 @@ bb0:
33 [3] Call mutate foo$5:TFunction(mutate a$9_@0, mutate b$10_@0)
34 [4] Const mutate $11_@1 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
35 [5] Return read $11_@1
36 -scope0 [1:4]:
37 - - dependency: read props$8.a
38 - - dependency: read props$8.b
39 -scope1 [4:5]:
40 - - dependency: freeze a$9_@0
41 - - dependency: freeze b$10_@0
36 ```
37
38 ## Reactive Scopes
@@ -76,7 +70,6 @@ function Component$0(props$8) {
70 ```
71 bb0:
72 [1] Return
79 -
73 ```
74
75 ## Reactive Scopes
@@ -100,7 +93,6 @@ function compute$0() {}
93 ```
94 bb0:
95 [1] Return
103 -
96 ```
97
98 ## Reactive Scopes
@@ -124,7 +116,6 @@ function foo$0() {}
116 ```
117 bb0:
118 [1] Return
127 -
119 ```
120
121 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/inverted-if.expect.md
-4
@@ -30,10 +30,6 @@ bb5:
30 bb1:
31 predecessor blocks: bb5 bb3 bb0
32 [6] Return
33 -scope0 [1:6]:
34 - - dependency: read c$7
35 - - dependency: read b$6
36 - - dependency: read a$5
33 ```
34
35 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/issue852.expect.md
-2
@@ -20,8 +20,6 @@ bb0:
20 [3] Const mutate a$8:TObject = read x$7_@0:TObject
21 [4] Const mutate b$9:TObject = read a$8:TObject
22 [5] Return
23 -scope0 [1:3]:
24 - - dependency: read c$6
23 ```
24
25 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/jsx-fragment.expect.md
-14
@@ -31,20 +31,6 @@ bb0:
31 [10] Const mutate $23 = "\n "
32 [11] Const mutate $24_@2 = JsxFragment [read $14, read props$13.greeting, read $15:TPrimitive, read $16, read $22_@1, read $23]
33 [12] Return read $24_@2
34 -scope0 [7:8]:
35 - - dependency: read $19
36 -scope1 [9:10]:
37 - - dependency: read $17:TPrimitive
38 - - dependency: read $18
39 - - dependency: read $20_@0
40 - - dependency: read $21
41 -scope2 [11:12]:
42 - - dependency: read $14
43 - - dependency: read props$13.greeting
44 - - dependency: read $15:TPrimitive
45 - - dependency: read $16
46 - - dependency: read $22_@1
47 - - dependency: read $23
34 ```
35
36 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/logical-expression.expect.md
-11
@@ -37,9 +37,6 @@ bb3:
37 bb1:
38 predecessor blocks: bb2 bb3
39 [7] Return freeze $6_@1
40 -scope1 [2:7]:
41 - - dependency: read $5_@0
42 - - dependency: read $5_@0
40 ```
41
42 ## Reactive Scopes
@@ -92,9 +89,6 @@ bb3:
89 bb1:
90 predecessor blocks: bb2 bb3
91 [7] Return freeze $6_@1
95 -scope1 [2:7]:
96 - - dependency: read $5_@0
97 - - dependency: read $5_@0
92 ```
93
94 ## Reactive Scopes
@@ -149,9 +143,6 @@ bb3:
143 bb1:
144 predecessor blocks: bb2 bb3
145 [9] Return freeze $12_@1:TPrimitive
152 -scope1 [4:9]:
153 - - dependency: read $9_@0:TPrimitive
154 - - dependency: read $11:TPrimitive
146 ```
147
148 ## Reactive Scopes
@@ -194,7 +185,6 @@ function QuestionQuestion$0(props$8) {
185 ```
186 bb0:
187 [1] Return
197 -
188 ```
189
190 ## Reactive Scopes
@@ -218,7 +208,6 @@ function f$0() {}
208 ```
209 bb0:
210 [1] Return
221 -
211 ```
212
213 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-loops.expect.md
-3
@@ -44,7 +44,6 @@ function Component(props) {
44 ```
45 bb0:
46 [1] Return
47 -
47 ```
48
49 ## Reactive Scopes
@@ -70,7 +69,6 @@ function mutate$0(x$3, y$4) {}
69 ```
70 bb0:
71 [1] Return
73 -
72 ```
73
74 ## Reactive Scopes
@@ -133,7 +131,6 @@ bb13:
131 [21] Const mutate $34:TPrimitive = null
132 [22] Call mutate mutate$7:TFunction(mutate d$24_@0, read $34:TPrimitive)
133 [23] Return
136 -
134 ```
135
136 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-with-aliasing.expect.md
-4
@@ -40,7 +40,6 @@ function Component(props) {
40 ```
41 bb0:
42 [1] Return
43 -
43 ```
44
45 ## Reactive Scopes
@@ -90,9 +89,6 @@ bb9:
89 [13] Const mutate $17:TPrimitive = null
90 [14] Call mutate mutate$8:TFunction(mutate x$15_@1:TObject, read $17:TPrimitive)
91 [15] Return
93 -scope1 [2:15]:
94 - - dependency: read a$11_@0:TObject
95 - - dependency: read a$11_@0:TObject
92 ```
93
94 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/mutable-liverange-loop.expect.md
-3
@@ -39,7 +39,6 @@ function Component(props) {
39 ```
40 bb0:
41 [1] Return
42 -
42 ```
43
44 ## Reactive Scopes
@@ -63,7 +62,6 @@ function mutate$0() {}
62 ```
63 bb0:
64 [1] Return
66 -
65 ```
66
67 ## Reactive Scopes
@@ -120,7 +118,6 @@ bb13:
118 [16] Const mutate $28:TPrimitive = null
119 [17] Call mutate mutate$6:TFunction(mutate d$15_@0:TObject, read $28:TPrimitive)
120 [18] Return
123 -
121 ```
122
123 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-interleaved-by-terminal.expect.md
-1
@@ -27,7 +27,6 @@ bb1:
27 [4] Call mutate y$10_@0.push(read a$6)
28 [5] Call mutate x$9_@0.push(read b$7)
29 [6] Return
30 -
30 ```
31
32 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-interleaved.expect.md
-1
@@ -20,7 +20,6 @@ bb0:
20 [3] Call mutate x$7_@0.push(read a$5)
21 [4] Call mutate y$8_@0.push(read b$6)
22 [5] Return
23 -
23 ```
24
25 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-shadowed.expect.md
-4
@@ -20,10 +20,6 @@ bb0:
20 [3] Call mutate y$8_@1.push(read b$6)
21 [4] Call mutate x$7_@0.push(read a$5)
22 [5] Return
23 -scope0 [1:5]:
24 - - dependency: read a$5
25 -scope1 [2:4]:
26 - - dependency: read b$6
23 ```
24
25 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-shadowing-within-block.expect.md
-8
@@ -40,14 +40,6 @@ bb3:
40 bb1:
41 predecessor blocks: bb3 bb0
42 [11] Return freeze x$11_@0:TFunction
43 -scope0 [1:11]:
44 - - dependency: read a$8
45 -scope1 [3:7]:
46 - - dependency: read c$10
47 - - dependency: read b$9
48 -scope2 [8:9]:
49 - - dependency: read $13:TPrimitive
50 - - dependency: freeze y$12_@1:TFunction
43 ```
44
45 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-while.expect.md
-1
@@ -31,7 +31,6 @@ bb3:
31 bb2:
32 predecessor blocks: bb1
33 [8] Return
34 -
34 ```
35
36 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/overlapping-scopes-within-block.expect.md
-4
@@ -38,10 +38,6 @@ bb3:
38 bb1:
39 predecessor blocks: bb3 bb0
40 [9] Return freeze x$9_@0:TFunction
41 -scope0 [1:9]:
42 - - dependency: read c$8
43 - - dependency: read b$7
44 - - dependency: read a$6
41 ```
42
43 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/property-assignment.expect.md
-7
@@ -24,13 +24,6 @@ bb0:
24 [5] Call mutate x$7_@0.y.push(read props$6.p0)
25 [6] Const mutate $10_@1 = JSX <read Component$0 data={freeze x$7_@0:TObject} >{read child$9_@0}</read Component$0>
26 [7] Return read $10_@1
27 -scope0 [1:6]:
28 - - dependency: read Component$0
29 - - dependency: read props$6.p0
30 -scope1 [6:7]:
31 - - dependency: read Component$0
32 - - dependency: freeze x$7_@0:TObject
33 - - dependency: read child$9_@0
27 ```
28
29 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/reactive-scope-grouping.expect.md
-1
@@ -24,7 +24,6 @@ bb0:
24 [4] Call mutate y$5_@1.push(mutate z$6_@1:TObject)
25 [5] Reassign mutate x$4_@0.y[1:6] = read y$5_@1:TFunction
26 [6] Return freeze x$4_@0:TObject
27 -
27 ```
28
29 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/reactive-scopes-if.expect.md
-8
@@ -37,14 +37,6 @@ bb3:
37 bb1:
38 predecessor blocks: bb2 bb3
39 [11] Return freeze x$11_@0:TFunction
40 -scope0 [1:11]:
41 - - dependency: read c$10
42 - - dependency: read a$8
43 -scope1 [3:5]:
44 - - dependency: read b$9
45 -scope2 [6:7]:
46 - - dependency: read $13:TPrimitive
47 - - dependency: freeze y$12_@1:TFunction
40 ```
41
42 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/reactive-scopes.expect.md
-7
@@ -35,13 +35,6 @@ bb1:
35 [8] Const mutate $13:TPrimitive = "div"
36 [9] Const mutate $15_@1 = JSX <read $13:TPrimitive>{freeze x$10_@0:TFunction}</read $13:TPrimitive>
37 [10] Return read $15_@1
38 -scope0 [1:8]:
39 - - dependency: read a$8.length
40 - - dependency: read b$9
41 - - dependency: read b$9
42 -scope1 [9:10]:
43 - - dependency: read $13:TPrimitive
44 - - dependency: freeze x$10_@0:TFunction
38 ```
39
40 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/reassignment-conditional.expect.md
-10
@@ -37,16 +37,6 @@ bb1:
37 [8] Call read y$8.push(read props$6.p2)
38 [9] Const mutate $15_@2 = JSX <read Component$0 x={read x$7_@0:TFunction} y={read y$8:TFunction} ></read Component$0>
39 [10] Return read $15_@2
40 -scope0 [1:7]:
41 - - dependency: read props$6.p0
42 - - dependency: read props$6.p1
43 -scope1 [7:8]:
44 - - dependency: read Component$0
45 - - dependency: freeze x$7_@0:TFunction
46 -scope2 [9:10]:
47 - - dependency: read Component$0
48 - - dependency: read x$7_@0:TFunction
49 - - dependency: read y$8:TFunction
40 ```
41
42 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/reassignment-separate-scopes.expect.md
-17
@@ -68,23 +68,6 @@ bb3:
68 [18] Const mutate $28 = "\n "
69 [19] Const mutate $31_@3 = JSX <read $25:TPrimitive>{read $26}{read y$19_@1}{read $27}{freeze x$22_@2:TFunction}{read $28}</read $25:TPrimitive>
70 [20] Return read $31_@3
71 -scope0 [1:5]:
72 - - dependency: read a$13
73 - - dependency: read a$13
74 -scope1 [6:7]:
75 - - dependency: read $17:TPrimitive
76 - - dependency: freeze x$16_@0:TFunction
77 -scope2 [8:15]:
78 - - dependency: read c$15
79 - - dependency: read b$14
80 - - dependency: read b$14
81 -scope3 [19:20]:
82 - - dependency: read $25:TPrimitive
83 - - dependency: read $26
84 - - dependency: read y$19_@1
85 - - dependency: read $27
86 - - dependency: freeze x$22_@2:TFunction
87 - - dependency: read $28
71 ```
72
73 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/reassignment.expect.md
-10
@@ -29,16 +29,6 @@ bb0:
29 [6] Call mutate y$8_@0.push(read props$6.p1)
30 [7] Const mutate $11_@3 = JSX <read Component$0 x={read x$9_@1} y={freeze y$8_@0:TFunction} ></read Component$0>
31 [8] Return read $11_@3
32 -scope0 [1:7]:
33 - - dependency: read props$6.p0
34 - - dependency: read props$6.p1
35 -scope2 [5:6]:
36 - - dependency: read Component$0
37 - - dependency: freeze x$9_@1
38 -scope3 [7:8]:
39 - - dependency: read Component$0
40 - - dependency: read x$9_@1
41 - - dependency: freeze y$8_@0:TFunction
32 ```
33
34 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/reverse-postorder.expect.md
-9
@@ -77,15 +77,6 @@ bb1:
77 predecessor blocks: bb8 bb6 bb4 bb12 bb13
78 [18] read x$11_@0:TProp
79 [19] Return
80 -scope0 [2:18]:
81 - - dependency: read props$6.v2
82 - - dependency: read props$6.v1
83 - - dependency: read props$6.v0
84 - - dependency: read props$6.test
85 - - dependency: read props$6.b
86 - - dependency: read props$6.c
87 - - dependency: read props$6.cond2
88 - - dependency: read props$6.cond
80 ```
81
82 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/simple-alias.expect.md
-2
@@ -21,7 +21,6 @@ function foo() {
21 ```
22 bb0:
23 [1] Return
24 -
24 ```
25
26 ## Reactive Scopes
@@ -52,7 +51,6 @@ bb0:
51 [6] Const mutate c$10_@1:TObject[2:8] = read a$8_@1:TObject
52 [7] Call mutate mutate$4:TFunction(mutate a$8_@1:TObject, mutate b$9_@1:TObject)
53 [8] Return freeze c$10_@1:TObject
55 -
54 ```
55
56 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/simple.expect.md
-6
@@ -27,12 +27,6 @@ bb1:
27 [6] Const mutate $13:TPrimitive = Binary read y$9:TPrimitive * read $12:TPrimitive
28 [7] Const mutate $14_@1 = Array [read $13:TPrimitive]
29 [8] Return freeze $14_@1
30 -scope0 [3:4]:
31 - - dependency: read foo$0:TFunction
32 - - dependency: read $10:TPrimitive
33 - - dependency: read y$9:TPrimitive
34 -scope1 [7:8]:
35 - - dependency: read $13:TPrimitive
30 ```
31
32 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-arrayexpression.expect.md
-3
@@ -19,9 +19,6 @@ bb0:
19 [2] Const mutate b$7:TPrimitive = 2
20 [3] Const mutate x$8_@0 = Array [read a$6:TPrimitive, read b$7:TPrimitive]
21 [4] Return freeze x$8_@0
22 -scope0 [3:4]:
23 - - dependency: read a$6:TPrimitive
24 - - dependency: read b$7:TPrimitive
22 ```
23
24 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-call-jsx-2.expect.md
-7
@@ -23,7 +23,6 @@ function Component(props) {
23 ```
24 bb0:
25 [1] Return
26 -
26 ```
27
28 ## Reactive Scopes
@@ -62,12 +61,6 @@ bb1:
61 [10] Const mutate $19:TPrimitive = "div"
62 [11] Const mutate $20_@3 = JSX <read $19:TPrimitive a={freeze a$11_@0} b={freeze b$12_@0:TObject} ></read $19:TPrimitive>
63 [12] Return read $20_@3
65 -scope2 [7:8]:
66 - - dependency: read $14:TPrimitive
67 -scope3 [11:12]:
68 - - dependency: read $19:TPrimitive
69 - - dependency: freeze a$11_@0
70 - - dependency: freeze b$12_@0:TObject
64 ```
65
66 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-call-jsx.expect.md
-7
@@ -20,7 +20,6 @@ function Component(props) {
20 ```
21 bb0:
22 [1] Return
23 -
23 ```
24
25 ## Reactive Scopes
@@ -52,12 +51,6 @@ bb0:
51 [7] Const mutate $14:TPrimitive = "div"
52 [8] Const mutate $15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
53 [9] Return read $15_@2
55 -scope1 [5:6]:
56 - - dependency: read $12:TPrimitive
57 -scope2 [8:9]:
58 - - dependency: read $14:TPrimitive
59 - - dependency: read a$10_@0
60 - - dependency: freeze b$11_@0:TObject
54 ```
55
56 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-complex-multiple-if.expect.md
-1
@@ -43,7 +43,6 @@ bb3:
43 predecessor blocks: bb4 bb1
44 [13] Const mutate y$18 = read x$7_@0:TPrimitive
45 [14] Return
46 -
46 ```
47
48 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-complex-single-if.expect.md
-1
@@ -31,7 +31,6 @@ bb1:
31 predecessor blocks: bb2 bb0
32 [8] Const mutate y$11 = read x$5_@0:TPrimitive
33 [9] Return
34 -
34 ```
35
36 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-for-of.expect.md
-1
@@ -38,7 +38,6 @@ bb4:
38 bb2:
39 predecessor blocks: bb1
40 [9] Return freeze items$5_@0
41 -
41 ```
42
43 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-for-trivial-update.expect.md
-1
@@ -39,7 +39,6 @@ bb4:
39 bb2:
40 predecessor blocks: bb1
41 [13] Return read x$6_@0:TPrimitive
42 -
42 ```
43
44 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-for.expect.md
-1
@@ -41,7 +41,6 @@ bb4:
41 bb2:
42 predecessor blocks: bb1
43 [15] Return read x$7_@1:TPrimitive
44 -
44 ```
45
46 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-if-else.expect.md
-1
@@ -33,7 +33,6 @@ bb3:
33 bb1:
34 predecessor blocks: bb2 bb3
35 [8] Return
36 -
36 ```
37
38 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-multiple-phis.expect.md
-6
@@ -68,12 +68,6 @@ bb1:
68 predecessor blocks: bb3 bb7
69 [20] read x$18_@0
70 [21] Return
71 -scope0 [3:20]:
72 - - dependency: read a$9
73 - - dependency: read b$10
74 - - dependency: read c$11
75 - - dependency: read d$12
76 - - dependency: read $14:TPrimitive
71 ```
72
73 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-nested-loops-no-reassign.expect.md
-1
@@ -52,7 +52,6 @@ bb5:
52 bb2:
53 predecessor blocks: bb1
54 [13] Return read x$9:TPrimitive
55 -
55 ```
56
57 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-phi.expect.md
-5
@@ -34,11 +34,6 @@ bb3:
34 bb1:
35 predecessor blocks: bb3 bb0
36 [8] Return
37 -scope0 [1:8]:
38 - - dependency: read a$5
39 - - dependency: read c$7
40 - - dependency: read c$7
41 - - dependency: read b$6
37 ```
38
39 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-nested-partial-reassignment.expect.md
-5
@@ -36,11 +36,6 @@ bb5:
36 bb1:
37 predecessor blocks: bb2 bb5 bb3
38 [8] Return read x$12_@0:TPrimitive
39 -scope0 [1:8]:
40 - - dependency: read b$8
41 - - dependency: read d$10
42 - - dependency: read c$9
43 - - dependency: read a$7
39 ```
40
41 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-newexpression.expect.md
-2
@@ -18,7 +18,6 @@ function Component(props) {
18 ```
19 bb0:
20 [1] Return
21 -
21 ```
22
23 ## Reactive Scopes
@@ -45,7 +44,6 @@ bb0:
44 [2] Const mutate b$8_@0:TObject[1:4] = Object { }
45 [3] Const mutate c$9_@0[1:4] = New mutate Foo$5(mutate a$7_@0, mutate b$8_@0:TObject)
46 [4] Return freeze c$9_@0
48 -
47 ```
48
49 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-objectexpression-phi.expect.md
-3
@@ -39,9 +39,6 @@ bb1:
39 predecessor blocks: bb2 bb3
40 [10] Const mutate t$14_@2:TObject = Object { x: read x$6_@0:TPrimitive, y: read y$7_@0:TPrimitive }
41 [11] Return freeze t$14_@2:TObject
42 -scope2 [10:11]:
43 - - dependency: read x$6_@0:TPrimitive
44 - - dependency: read y$7_@0:TPrimitive
42 ```
43
44 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-objectexpression.expect.md
-3
@@ -19,9 +19,6 @@ bb0:
19 [2] Const mutate b$7:TPrimitive = 2
20 [3] Const mutate x$8_@0:TObject = Object { a: read a$6:TPrimitive, b: read b$7:TPrimitive }
21 [4] Return freeze x$8_@0:TObject
22 -scope0 [3:4]:
23 - - dependency: read a$6:TPrimitive
24 - - dependency: read b$7:TPrimitive
22 ```
23
24 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-alias-mutate-if.expect.md
-2
@@ -39,8 +39,6 @@ bb1:
39 predecessor blocks: bb2 bb3
40 [10] Call mutate mutate$6:TFunction(mutate b$8_@0:TObject)
41 [11] Return freeze x$9_@0:TObject
42 -scope0 [1:11]:
43 - - dependency: read a$7
42 ```
43
44 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-if.expect.md
-2
@@ -35,8 +35,6 @@ bb3:
35 bb1:
36 predecessor blocks: bb2 bb3
37 [9] Return freeze x$6_@0:TObject
38 -scope0 [1:9]:
39 - - dependency: read a$5
38 ```
39
40 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-if.expect.md
-2
@@ -37,8 +37,6 @@ bb1:
37 predecessor blocks: bb2 bb3
38 [9] Call mutate mutate$5:TFunction(mutate x$7_@0:TObject)
39 [10] Return freeze x$7_@0:TObject
40 -scope0 [1:10]:
41 - - dependency: read a$6
40 ```
41
42 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-inside-if.expect.md
-2
@@ -37,8 +37,6 @@ bb3:
37 bb1:
38 predecessor blocks: bb2 bb3
39 [10] Return freeze x$7_@0:TObject
40 -scope0 [1:10]:
41 - - dependency: read a$6
40 ```
41
42 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate.expect.md
-1
@@ -25,7 +25,6 @@ bb0:
25 [4] Reassign mutate y$7_@0.x[1:6] = read x$6_@0:TObject
26 [5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
27 [6] Return freeze y$7_@0:TObject
28 -
28 ```
29
30 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-call.expect.md
-2
@@ -20,8 +20,6 @@ bb0:
20 [3] Const mutate $6_@1[2:5] = Array []
21 [4] Call mutate y$5_@1.x.push(mutate $6_@1)
22 [5] Return freeze y$5_@1:TObject
23 -scope1 [2:5]:
24 - - dependency: read x$4_@0
23 ```
24
25 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate-2.expect.md
-1
@@ -21,7 +21,6 @@ bb0:
21 [3] Reassign mutate y$5_@0.x[1:5] = read x$4_@0
22 [4] Call mutate mutate$3:TFunction(mutate x$4_@0)
23 [5] Return freeze y$5_@0:TObject
24 -
24 ```
25
26 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate-alias.expect.md
-1
@@ -25,7 +25,6 @@ bb0:
25 [4] Reassign mutate y$6_@0.x[1:6] = read x$7_@0
26 [5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
27 [6] Return freeze y$6_@0:TObject
28 -
28 ```
29
30 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate.expect.md
-1
@@ -21,7 +21,6 @@ bb0:
21 [3] Reassign mutate y$5_@0.x[1:5] = read x$4_@0
22 [4] Call mutate mutate$3:TFunction(mutate y$5_@0:TObject)
23 [5] Return freeze y$5_@0:TObject
24 -
24 ```
25
26 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-property.expect.md
-2
@@ -19,8 +19,6 @@ bb0:
19 [2] Const mutate y$4_@1:TObject[2:4] = Object { }
20 [3] Reassign mutate y$4_@1.x[2:4] = read x$3_@0
21 [4] Return freeze y$4_@1:TObject
22 -scope1 [2:4]:
23 - - dependency: read x$3_@0
22 ```
23
24 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-reassign.expect.md
-1
@@ -21,7 +21,6 @@ bb0:
21 [3] Const mutate x$10 = read b$6
22 [4] Const mutate x$11 = read c$7
23 [5] Return read x$11
24 -
24 ```
25
26 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-return.expect.md
-1
@@ -28,7 +28,6 @@ bb2:
28 bb1:
29 predecessor blocks: bb2 bb0
30 [7] Return read x$4_@0:TPrimitive
31 -
31 ```
32
33 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-shadowing.expect.md
-3
@@ -22,7 +22,6 @@ function Foo(cond) {
22 ```
23 bb0:
24 [1] Return
25 -
25 ```
26
27 ## Reactive Scopes
@@ -60,8 +59,6 @@ bb1:
59 predecessor blocks: bb2 bb3
60 [8] Call mutate log$4:TFunction(read str$6_@0:TPrimitive)
61 [9] Return
63 -scope0 [1:8]:
64 - - dependency: read cond$5
62 ```
63
64 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-sibling-phis.expect.md
-8
@@ -68,14 +68,6 @@ bb7:
68 bb1:
69 predecessor blocks: bb3 bb7
70 [20] Return
71 -scope0 [5:10]:
72 - - dependency: read a$9
73 - - dependency: read b$10
74 - - dependency: read $15:TPrimitive
75 -scope1 [13:18]:
76 - - dependency: read c$11
77 - - dependency: read d$12
78 - - dependency: read $19:TPrimitive
71 ```
72
73 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-simple-phi.expect.md
-2
@@ -37,8 +37,6 @@ bb1:
37 predecessor blocks: bb2 bb3
38 [9] Const mutate x$11 = read y$8_@0:TPrimitive
39 [10] Return
40 -scope0 [4:9]:
41 - - dependency: read $7:TPrimitive
40 ```
41
42 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-simple.expect.md
-1
@@ -16,7 +16,6 @@ bb0:
16 [1] Const mutate x$3:TPrimitive = 1
17 [2] Const mutate y$4:TPrimitive = 2
18 [3] Return
19 -
19 ```
20
21 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-single-if.expect.md
-1
@@ -27,7 +27,6 @@ bb2:
27 bb1:
28 predecessor blocks: bb2 bb0
29 [6] Return
30 -
30 ```
31
32 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-switch.expect.md
-5
@@ -58,11 +58,6 @@ bb1:
58 predecessor blocks: bb5 bb3 bb2
59 [16] Const mutate y$22 = read x$16_@0:TPrimitive
60 [17] Return
61 -scope0 [6:16]:
62 - - dependency: read x$10:TPrimitive
63 - - dependency: read x$10:TPrimitive
64 - - dependency: read x$10:TPrimitive
65 - - dependency: read x$10:TPrimitive
61 ```
62
63 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-throw.expect.md
-1
@@ -27,7 +27,6 @@ bb2:
27 bb1:
28 predecessor blocks: bb2 bb0
29 [7] Throw read x$4_@0:TPrimitive
30 -
30 ```
31
32 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-while-no-reassign.expect.md
-1
@@ -32,7 +32,6 @@ bb3:
32 bb2:
33 predecessor blocks: bb1
34 [9] Return read x$5:TPrimitive
35 -
35 ```
36
37 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/ssa-while.expect.md
-1
@@ -32,7 +32,6 @@ bb3:
32 bb2:
33 predecessor blocks: bb1
34 [9] Return read x$5_@0:TPrimitive
35 -
35 ```
36
37 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/switch-non-final-default.expect.md
-7
@@ -58,13 +58,6 @@ bb1:
58 [13] Call read y$11_@1.push(read props$9.p4)
59 [14] Const mutate $22_@3 = JSX <read Component$0 data={freeze y$11_@1:TPrimitive} >{read child$19_@2}</read Component$0>
60 [15] Return read $22_@3
61 -scope2 [12:13]:
62 - - dependency: read Component$0
63 - - dependency: freeze x$10_@1:TFunction
64 -scope3 [14:15]:
65 - - dependency: read Component$0
66 - - dependency: freeze y$11_@1:TPrimitive
67 - - dependency: read child$19_@2
61 ```
62
63 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/switch-with-fallthrough.expect.md
-1
@@ -79,7 +79,6 @@ bb2:
79 bb1:
80 predecessor blocks: bb9 bb0 bb5 bb2
81 [21] Return
82 -
82 ```
83
84 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/switch.expect.md
-7
@@ -52,13 +52,6 @@ bb1:
52 [13] Call read y$10_@1.push(read props$8.p4)
53 [14] Const mutate $23_@4 = JSX <read Component$0 data={read y$10_@1:TPrimitive} >{read child$19_@3}</read Component$0>
54 [15] Return read $23_@4
55 -scope3 [12:13]:
56 - - dependency: read Component$0
57 - - dependency: freeze x$9_@1:TFunction
58 -scope4 [14:15]:
59 - - dependency: read Component$0
60 - - dependency: read y$10_@1:TPrimitive
61 - - dependency: read child$19_@3
55 ```
56
57 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/transitive-alias-fields.expect.md
-1
@@ -30,7 +30,6 @@ bb0:
30 [7] Reassign mutate q$8_@0.y[1:9] = read p$7_@0.y
31 [8] Call mutate mutate$5:TFunction(mutate q$8_@0:TObject)
32 [9] Return
33 -
33 ```
34
35 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-args-test-binary-operator.expect.md
-1
@@ -23,7 +23,6 @@ bb2:
23 bb1:
24 predecessor blocks: bb2 bb0
25 [5] Return
26 -
26 ```
27
28 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-binary-operator.expect.md
-1
@@ -27,7 +27,6 @@ bb2:
27 bb1:
28 predecessor blocks: bb2 bb0
29 [7] Return
30 -
30 ```
31
32 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-field-load.expect.md
-2
@@ -17,8 +17,6 @@ bb0:
17 [2] Const mutate x$5_@0:TObject = Object { t: read $4:TPrimitive }
18 [3] Const mutate p$6:TPrimitive = read x$5_@0.t
19 [4] Return
20 -scope0 [2:3]:
21 - - dependency: read $4:TPrimitive
20 ```
21
22 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-test-field-load-binary-op.expect.md
-3
@@ -31,9 +31,6 @@ bb1:
31 [8] Const mutate y$16:TPrimitive = read x$12_@2.u
32 [9] Const mutate z$17:TPrimitive = read x$12_@2.v
33 [10] Return
34 -scope2 [3:4]:
35 - - dependency: read $10_@0:TPrimitive
36 - - dependency: read $11_@1:TPrimitive
34 ```
35
36 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-test-field-store.expect.md
-1
@@ -20,7 +20,6 @@ bb0:
20 [3] Reassign mutate x$4_@0.t[1:4] = read q$5_@1:TObject
21 [4] Const mutate z$6:TObject = read x$4_@0.t
22 [5] Return
23 -
23 ```
24
25 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-test-polymorphic.expect.md
-3
@@ -31,9 +31,6 @@ bb0:
31 [7] Reassign mutate x$9_@2.t[4:8] = read o$8_@1:TObject
32 [8] Const mutate y$11:TPoly = read x$9_@2.t
33 [9] Return
34 -scope2 [4:8]:
35 - - dependency: read p$7_@0:TPrimitive
36 - - dependency: read o$8_@1:TObject
34 ```
35
36 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-test-primitive.expect.md
-1
@@ -16,7 +16,6 @@ bb0:
16 [1] Const mutate x$3:TPrimitive = 1
17 [2] Const mutate y$4:TPrimitive = 2
18 [3] Return
19 -
19 ```
20
21 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/type-test-return-type-inference.expect.md
-1
@@ -30,7 +30,6 @@ bb1:
30 predecessor blocks: bb2 bb0
31 [7] Const mutate z$12_@3:TPrimitive = Call mutate foo$2:TFunction()
32 [8] Return
33 -
33 ```
34
35 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/while-break.expect.md
-1
@@ -22,7 +22,6 @@ bb1:
22 bb2:
23 predecessor blocks: bb1
24 [3] Return read b$4
25 -
25 ```
26
27 ## Reactive Scopes
compiler/forget/src/__tests__/fixtures/hir/while-conditional-continue.expect.md
-1
@@ -37,7 +37,6 @@ bb2:
37 predecessor blocks: bb1
38 [7] Call read d$8:TFunction()
39 [8] Return
40 -
40 ```
41
42 ## Reactive Scopes
compiler/forget/src/index.ts
-2
@@ -31,7 +31,6 @@ import { eliminateRedundantPhi } from "./HIR/EliminateRedundantPhi";
31 import enterSSA from "./HIR/EnterSSA";
32 import { Environment } from "./HIR/HIRBuilder";
33 import { inferMutableRanges } from "./HIR/InferMutableRanges";
34 -import { inferReactiveScopeDependencies } from "./HIR/InferReactiveScopeDependencies";
34 import { inferReactiveScopes } from "./HIR/InferReactiveScopes";
35 import { inferReactiveScopeVariables } from "./HIR/InferReactiveScopeVariables";
36 import inferReferenceEffects from "./HIR/InferReferenceEffects";
@@ -67,7 +66,6 @@ export const HIR = {
66 enterSSA,
67 inferMutableRanges,
68 inferReferenceEffects,
70 - inferReactiveScopeDependencies,
69 inferReactiveScopeVariables,
70 inferReactiveScopes,
71 buildReactiveFunction,