@samitouri / QOS-React-2 / commits / afdd2cb910

[hir] Add Effect.Store

Effect.Store is exactly like Effect.Mutate, the only difference is that Store aliases one into a another value. There is no practical difference between Effect.Mutate and Effect.Store currently.

Sathya Gunasekaran committed Dec 21, 2022 at 12:04 UTC afdd2cb9104254ded6b507bfbbe5ada541e8be9d
22 files changed +73 -58
compiler/forget/src/HIR/HIR.ts
+2
@@ -376,6 +376,8 @@ export enum Effect {
376 Read = "read",
377 // This reference may write to (mutate) the value
378 Mutate = "mutate",
379 + // This reference may alias to (mutate) the value
380 + Store = "store",
381 }
382
383 export type ReactiveScope = {
compiler/forget/src/HIR/InferMutableLifetimes.ts
+1
@@ -72,6 +72,7 @@ function inferPlace(place: Place, instr: Instruction) {
72 case Effect.Read:
73 case Effect.Freeze:
74 return;
75 + case Effect.Store:
76 case Effect.Mutate: {
77 place.identifier.mutableRange.end = makeInstructionId(instr.id + 1);
78 return;
compiler/forget/src/HIR/InferReferenceEffects.ts
+14 -2
@@ -270,6 +270,18 @@ class Environment {
270 }
271 break;
272 }
273 + case Effect.Store: {
274 + // TODO(gsn): Uncomment the invariant once
275 + // https://github.com/facebook/react-forget/pull/908#discussion_r1054294337
276 + // is fixed.
277 + //
278 + // invariant(
279 + // valueKind === ValueKind.Mutable,
280 + // `expected valueKind to be 'Mutable' but found to be '${valueKind}'`
281 + // );
282 + effect = Effect.Store;
283 + break;
284 + }
285 case Effect.Read: {
286 effect = Effect.Read;
287 break;
@@ -575,10 +587,10 @@ function inferBlock(env: Environment, block: BasicBlock) {
587 env.define(lvalue.place, instrValue);
588 } else if (instrValue.memberPath === null) {
589 // no-op: `a.b.c = d`
578 - env.reference(lvalue.place, Effect.Mutate);
590 + env.reference(lvalue.place, Effect.Store);
591 } else {
592 // no-op: `a.b.c = d.e.f`
581 - env.reference(lvalue.place, Effect.Mutate);
593 + env.reference(lvalue.place, Effect.Store);
594 }
595 }
596 continue;
compiler/forget/src/__tests__/fixtures/hir/alias-nested-member-path-mutate.expect.md
+4 -4
@@ -19,9 +19,9 @@ function component() {
19 bb0:
20 [1] Const mutate z$5_@0[1:7] = Array []
21 [2] Const mutate y$6_@0:TObject[1:7] = Object { }
22 - [3] Reassign mutate y$6_@0.z[1:7] = read z$5_@0
22 + [3] Reassign store y$6_@0.z[1:7] = read z$5_@0
23 [4] Const mutate x$7_@0:TObject[1:7] = Object { }
24 - [5] Reassign mutate x$7_@0.y[1:7] = read y$6_@0:TObject
24 + [5] Reassign store 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 ```
@@ -33,9 +33,9 @@ function component(
33 ) {
34 [1] Const mutate z$5_@0[1:7] = Array []
35 [2] Const mutate y$6_@0:TObject[1:7] = Object { }
36 - [3] Reassign mutate y$6_@0.z[1:7] = read z$5_@0
36 + [3] Reassign store y$6_@0.z[1:7] = read z$5_@0
37 [4] Const mutate x$7_@0:TObject[1:7] = Object { }
38 - [5] Reassign mutate x$7_@0.y[1:7] = read y$6_@0:TObject
38 + [5] Reassign store x$7_@0.y[1:7] = read y$6_@0:TObject
39 [6] Call mutate mutate$4:TFunction(mutate x$7_@0.y.z)
40 return
41 }
compiler/forget/src/__tests__/fixtures/hir/alias-nested-member-path.expect.md
+4 -4
@@ -19,9 +19,9 @@ function component() {
19 bb0:
20 [1] Const mutate z$4_@0 = Array []
21 [2] Const mutate y$5_@1:TObject[2:4] = Object { }
22 - [3] Reassign mutate y$5_@1.z[2:4] = read z$4_@0
22 + [3] Reassign store y$5_@1.z[2:4] = read z$4_@0
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
24 + [5] Reassign store x$6_@2.y[4:6] = read y$5_@1:TObject
25 [6] Return freeze x$6_@2:TObject
26 ```
27
@@ -35,11 +35,11 @@ function component(
35 }
36 scope @1 [2:4] deps=[read z$4_@0] out=[y$5_@1] {
37 [2] Const mutate y$5_@1:TObject[2:4] = Object { }
38 - [3] Reassign mutate y$5_@1.z[2:4] = read z$4_@0
38 + [3] Reassign store y$5_@1.z[2:4] = read z$4_@0
39 }
40 scope @2 [4:6] deps=[read y$5_@1:TObject] out=[x$6_@2] {
41 [4] Const mutate x$6_@2:TObject[4:6] = Object { }
42 - [5] Reassign mutate x$6_@2.y[4:6] = read y$5_@1:TObject
42 + [5] Reassign store x$6_@2.y[4:6] = read y$5_@1:TObject
43 }
44 return freeze x$6_@2:TObject
45 }
compiler/forget/src/__tests__/fixtures/hir/assignment-variations.expect.md
+2 -2
@@ -64,7 +64,7 @@ function f$0() {
64 bb0:
65 [1] Const mutate $6:TPrimitive = 1
66 [2] Const mutate $7:TPrimitive = Binary read a$5_@0.b.c + read $6:TPrimitive
67 - [3] Reassign read a$5_@0.b.c[0:6] = read $7:TPrimitive
67 + [3] Reassign store a$5_@0.b.c[0:6] = read $7:TPrimitive
68 [4] Const mutate $8:TPrimitive = 2
69 [5] Reassign mutate a$5_@0.b.c[0:6] = Binary read a$5_@0.b.c * read $8:TPrimitive
70 [6] Return
@@ -78,7 +78,7 @@ function g(
78 ) {
79 [1] Const mutate $6:TPrimitive = 1
80 [2] Const mutate $7:TPrimitive = Binary read a$5_@0.b.c + read $6:TPrimitive
81 - [3] Reassign read a$5_@0.b.c[0:6] = read $7:TPrimitive
81 + [3] Reassign store a$5_@0.b.c[0:6] = read $7:TPrimitive
82 [4] Const mutate $8:TPrimitive = 2
83 [5] Reassign mutate a$5_@0.b.c[0:6] = Binary read a$5_@0.b.c * read $8:TPrimitive
84 return
compiler/forget/src/__tests__/fixtures/hir/independently-memoize-object-property.expect.md
+2 -2
@@ -18,7 +18,7 @@ function foo(a, b, c) {
18 bb0:
19 [1] Const mutate x$9_@0:TObject[1:4] = Object { a: read a$6 }
20 [2] Const mutate t6$10_@1 = Array [read b$7, read c$8]
21 - [3] Reassign mutate x$9_@0.y[1:4] = read t6$10_@1
21 + [3] Reassign store x$9_@0.y[1:4] = read t6$10_@1
22 [4] Return freeze x$9_@0:TObject
23 ```
24
@@ -35,7 +35,7 @@ function foo(
35 scope @1 [2:3] deps=[read b$7, read c$8] out=[$10_@1] {
36 [2] Const mutate $10_@1 = Array [read b$7, read c$8]
37 }
38 - [3] Reassign mutate x$9_@0.y[1:4] = read $10_@1
38 + [3] Reassign store x$9_@0.y[1:4] = read $10_@1
39 }
40 return freeze x$9_@0:TObject
41 }
compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-with-aliasing.expect.md
+2 -2
@@ -69,7 +69,7 @@ bb0:
69 [3] Const mutate c$13_@2:TObject = Object { }
70 [4] Const mutate d$14_@1:TObject[2:15] = Object { c: read c$13_@2:TObject }
71 [5] Const mutate x$15_@1:TObject[2:15] = Object { }
72 - [6] Reassign mutate x$15_@1.b[2:15] = read b$12_@1
72 + [6] Reassign store x$15_@1.b[2:15] = read b$12_@1
73 [7] Const mutate y$16_@1[2:15] = Call mutate mutate$8:TFunction(mutate x$15_@1:TObject, mutate d$14_@1:TObject)
74 [8] If (read a$11_@0:TObject) then:bb1 else:bb1 fallthrough=bb1
75 bb1:
@@ -106,7 +106,7 @@ function Component(
106 }
107 [4] Const mutate d$14_@1:TObject[2:15] = Object { c: read c$13_@2:TObject }
108 [5] Const mutate x$15_@1:TObject[2:15] = Object { }
109 - [6] Reassign mutate x$15_@1.b[2:15] = read b$12_@1
109 + [6] Reassign store x$15_@1.b[2:15] = read b$12_@1
110 [7] Const mutate y$16_@1[2:15] = Call mutate mutate$8:TFunction(mutate x$15_@1:TObject, mutate d$14_@1:TObject)
111 if (read a$11_@0:TObject) {
112 }
compiler/forget/src/__tests__/fixtures/hir/property-assignment.expect.md
+2 -2
@@ -19,7 +19,7 @@ function Component(props) {
19 bb0:
20 [1] Const mutate x$7_@0:TObject[1:6] = Object { }
21 [2] Const mutate y$8_@0[1:6] = Array []
22 - [3] Reassign mutate x$7_@0.y[1:6] = read y$8_@0
22 + [3] Reassign store x$7_@0.y[1:6] = read y$8_@0
23 [4] Const mutate child$9_@0[1:6] = JSX <read Component$0 data={freeze y$8_@0} ></read Component$0>
24 [5] Call mutate x$7_@0.y.push(read props$6.p0)
25 [6] Const mutate t5$10_@1 = JSX <read Component$0 data={freeze x$7_@0:TObject} >{read child$9_@0}</read Component$0>
@@ -35,7 +35,7 @@ function Component(
35 scope @0 [1:6] deps=[read props$6.p0] out=[x$7_@0, child$9_@0] {
36 [1] Const mutate x$7_@0:TObject[1:6] = Object { }
37 [2] Const mutate y$8_@0[1:6] = Array []
38 - [3] Reassign mutate x$7_@0.y[1:6] = read y$8_@0
38 + [3] Reassign store x$7_@0.y[1:6] = read y$8_@0
39 [4] Const mutate child$9_@0[1:6] = JSX <read Component$0 data={freeze y$8_@0} ></read Component$0>
40 [5] Call mutate x$7_@0.y.push(read props$6.p0)
41 }
compiler/forget/src/__tests__/fixtures/hir/reactive-scope-grouping.expect.md
+2 -2
@@ -22,7 +22,7 @@ bb0:
22 [2] Const mutate y$5_@1[2:5] = Array []
23 [3] Const mutate z$6_@1:TObject[2:5] = Object { }
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
25 + [5] Reassign store x$4_@0.y[1:6] = read y$5_@1
26 [6] Return freeze x$4_@0:TObject
27 ```
28
@@ -38,7 +38,7 @@ function foo(
38 [3] Const mutate z$6_@1:TObject[2:5] = Object { }
39 [4] Call mutate y$5_@1.push(mutate z$6_@1:TObject)
40 }
41 - [5] Reassign mutate x$4_@0.y[1:6] = read y$5_@1
41 + [5] Reassign store x$4_@0.y[1:6] = read y$5_@1
42 }
43 return freeze x$4_@0:TObject
44 }
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-alias-mutate-if.expect.md
+4 -4
@@ -28,12 +28,12 @@ bb0:
28 bb2:
29 predecessor blocks: bb0
30 [4] Const mutate y$10_@0:TObject[1:11] = Object { }
31 - [5] Reassign mutate x$9_@0.y[1:11] = read y$10_@0:TObject
31 + [5] Reassign store x$9_@0.y[1:11] = read y$10_@0:TObject
32 [6] Goto bb1
33 bb3:
34 predecessor blocks: bb0
35 [7] Const mutate z$11_@0:TObject[1:11] = Object { }
36 - [8] Reassign mutate x$9_@0.z[1:11] = read z$11_@0:TObject
36 + [8] Reassign store x$9_@0.z[1:11] = read z$11_@0:TObject
37 [9] Goto bb1
38 bb1:
39 predecessor blocks: bb2 bb3
@@ -52,10 +52,10 @@ function foo(
52 [2] Const mutate x$9_@0:TObject[1:11] = read b$8_@0:TObject
53 if (read a$7) {
54 [4] Const mutate y$10_@0:TObject[1:11] = Object { }
55 - [5] Reassign mutate x$9_@0.y[1:11] = read y$10_@0:TObject
55 + [5] Reassign store x$9_@0.y[1:11] = read y$10_@0:TObject
56 } else {
57 [7] Const mutate z$11_@0:TObject[1:11] = Object { }
58 - [8] Reassign mutate x$9_@0.z[1:11] = read z$11_@0:TObject
58 + [8] Reassign store x$9_@0.z[1:11] = read z$11_@0:TObject
59 }
60 [10] Call mutate mutate$6:TFunction(mutate b$8_@0:TObject)
61 }
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-if.expect.md
+4 -4
@@ -25,12 +25,12 @@ bb0:
25 bb2:
26 predecessor blocks: bb0
27 [3] Const mutate y$7_@1:TObject = Object { }
28 - [4] Reassign mutate x$6_@0.y[1:9] = read y$7_@1:TObject
28 + [4] Reassign store x$6_@0.y[1:9] = read y$7_@1:TObject
29 [5] Goto bb1
30 bb3:
31 predecessor blocks: bb0
32 [6] Const mutate z$8_@2:TObject = Object { }
33 - [7] Reassign mutate x$6_@0.z[1:9] = read z$8_@2:TObject
33 + [7] Reassign store x$6_@0.z[1:9] = read z$8_@2:TObject
34 [8] Goto bb1
35 bb1:
36 predecessor blocks: bb2 bb3
@@ -49,12 +49,12 @@ function foo(
49 scope @1 [3:4] deps=[] out=[y$7_@1] {
50 [3] Const mutate y$7_@1:TObject = Object { }
51 }
52 - [4] Reassign mutate x$6_@0.y[1:9] = read y$7_@1:TObject
52 + [4] Reassign store x$6_@0.y[1:9] = read y$7_@1:TObject
53 } else {
54 scope @2 [6:7] deps=[] out=[z$8_@2] {
55 [6] Const mutate z$8_@2:TObject = Object { }
56 }
57 - [7] Reassign mutate x$6_@0.z[1:9] = read z$8_@2:TObject
57 + [7] Reassign store x$6_@0.z[1:9] = read z$8_@2:TObject
58 }
59 }
60 return freeze x$6_@0:TObject
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-if.expect.md
+4 -4
@@ -26,12 +26,12 @@ bb0:
26 bb2:
27 predecessor blocks: bb0
28 [3] Const mutate y$8_@0:TObject[1:10] = Object { }
29 - [4] Reassign mutate x$7_@0.y[1:10] = read y$8_@0:TObject
29 + [4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
30 [5] Goto bb1
31 bb3:
32 predecessor blocks: bb0
33 [6] Const mutate z$9_@0:TObject[1:10] = Object { }
34 - [7] Reassign mutate x$7_@0.z[1:10] = read z$9_@0:TObject
34 + [7] Reassign store x$7_@0.z[1:10] = read z$9_@0:TObject
35 [8] Goto bb1
36 bb1:
37 predecessor blocks: bb2 bb3
@@ -49,10 +49,10 @@ function foo(
49 [1] Const mutate x$7_@0:TObject[1:10] = Object { }
50 if (read a$6) {
51 [3] Const mutate y$8_@0:TObject[1:10] = Object { }
52 - [4] Reassign mutate x$7_@0.y[1:10] = read y$8_@0:TObject
52 + [4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
53 } else {
54 [6] Const mutate z$9_@0:TObject[1:10] = Object { }
55 - [7] Reassign mutate x$7_@0.z[1:10] = read z$9_@0:TObject
55 + [7] Reassign store x$7_@0.z[1:10] = read z$9_@0:TObject
56 }
57 [9] Call mutate mutate$5:TFunction(mutate x$7_@0:TObject)
58 }
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-inside-if.expect.md
+4 -4
@@ -26,13 +26,13 @@ bb0:
26 bb2:
27 predecessor blocks: bb0
28 [3] Const mutate y$8_@0:TObject[1:10] = Object { }
29 - [4] Reassign mutate x$7_@0.y[1:10] = read y$8_@0:TObject
29 + [4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
30 [5] Call mutate mutate$4:TFunction(mutate y$8_@0:TObject)
31 [6] Goto bb1
32 bb3:
33 predecessor blocks: bb0
34 [7] Const mutate z$9_@1:TObject = Object { }
35 - [8] Reassign mutate x$7_@0.z[1:10] = read z$9_@1:TObject
35 + [8] Reassign store x$7_@0.z[1:10] = read z$9_@1:TObject
36 [9] Goto bb1
37 bb1:
38 predecessor blocks: bb2 bb3
@@ -49,13 +49,13 @@ function foo(
49 [1] Const mutate x$7_@0:TObject[1:10] = Object { }
50 if (read a$6) {
51 [3] Const mutate y$8_@0:TObject[1:10] = Object { }
52 - [4] Reassign mutate x$7_@0.y[1:10] = read y$8_@0:TObject
52 + [4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
53 [5] Call mutate mutate$4:TFunction(mutate y$8_@0:TObject)
54 } else {
55 scope @1 [7:8] deps=[] out=[z$9_@1] {
56 [7] Const mutate z$9_@1:TObject = Object { }
57 }
58 - [8] Reassign mutate x$7_@0.z[1:10] = read z$9_@1:TObject
58 + [8] Reassign store x$7_@0.z[1:10] = read z$9_@1:TObject
59 }
60 }
61 return freeze x$7_@0:TObject
compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate.expect.md
+2 -2
@@ -22,7 +22,7 @@ bb0:
22 [1] Const mutate a$5_@0:TObject[1:6] = Object { }
23 [2] Const mutate x$6_@0:TObject[1:6] = read a$5_@0:TObject
24 [3] Const mutate y$7_@0:TObject[1:6] = Object { }
25 - [4] Reassign mutate y$7_@0.x[1:6] = read x$6_@0:TObject
25 + [4] Reassign store 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 ```
@@ -36,7 +36,7 @@ function foo(
36 [1] Const mutate a$5_@0:TObject[1:6] = Object { }
37 [2] Const mutate x$6_@0:TObject[1:6] = read a$5_@0:TObject
38 [3] Const mutate y$7_@0:TObject[1:6] = Object { }
39 - [4] Reassign mutate y$7_@0.x[1:6] = read x$6_@0:TObject
39 + [4] Reassign store y$7_@0.x[1:6] = read x$6_@0:TObject
40 [5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
41 }
42 return freeze y$7_@0:TObject
compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate-2.expect.md
+2 -2
@@ -18,7 +18,7 @@ function foo() {
18 bb0:
19 [1] Const mutate x$4_@0[1:5] = Array []
20 [2] Const mutate y$5_@0:TObject[1:5] = Object { }
21 - [3] Reassign mutate y$5_@0.x[1:5] = read x$4_@0
21 + [3] Reassign store 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 ```
@@ -31,7 +31,7 @@ function foo(
31 scope @0 [1:5] deps=[] out=[y$5_@0] {
32 [1] Const mutate x$4_@0[1:5] = Array []
33 [2] Const mutate y$5_@0:TObject[1:5] = Object { }
34 - [3] Reassign mutate y$5_@0.x[1:5] = read x$4_@0
34 + [3] Reassign store y$5_@0.x[1:5] = read x$4_@0
35 [4] Call mutate mutate$3:TFunction(mutate x$4_@0)
36 }
37 return freeze y$5_@0:TObject
compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate-alias.expect.md
+2 -2
@@ -22,7 +22,7 @@ bb0:
22 [1] Const mutate a$5_@0:TObject[1:6] = Object { }
23 [2] Const mutate y$6_@0:TObject[1:6] = read a$5_@0:TObject
24 [3] Const mutate x$7_@0[1:6] = Array []
25 - [4] Reassign mutate y$6_@0.x[1:6] = read x$7_@0
25 + [4] Reassign store 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 ```
@@ -36,7 +36,7 @@ function foo(
36 [1] Const mutate a$5_@0:TObject[1:6] = Object { }
37 [2] Const mutate y$6_@0:TObject[1:6] = read a$5_@0:TObject
38 [3] Const mutate x$7_@0[1:6] = Array []
39 - [4] Reassign mutate y$6_@0.x[1:6] = read x$7_@0
39 + [4] Reassign store y$6_@0.x[1:6] = read x$7_@0
40 [5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
41 }
42 return freeze y$6_@0:TObject
compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate.expect.md
+2 -2
@@ -18,7 +18,7 @@ function foo() {
18 bb0:
19 [1] Const mutate x$4_@0[1:5] = Array []
20 [2] Const mutate y$5_@0:TObject[1:5] = Object { }
21 - [3] Reassign mutate y$5_@0.x[1:5] = read x$4_@0
21 + [3] Reassign store 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 ```
@@ -31,7 +31,7 @@ function foo(
31 scope @0 [1:5] deps=[] out=[y$5_@0] {
32 [1] Const mutate x$4_@0[1:5] = Array []
33 [2] Const mutate y$5_@0:TObject[1:5] = Object { }
34 - [3] Reassign mutate y$5_@0.x[1:5] = read x$4_@0
34 + [3] Reassign store y$5_@0.x[1:5] = read x$4_@0
35 [4] Call mutate mutate$3:TFunction(mutate y$5_@0:TObject)
36 }
37 return freeze y$5_@0:TObject
compiler/forget/src/__tests__/fixtures/hir/ssa-property.expect.md
+2 -2
@@ -17,7 +17,7 @@ function foo() {
17 bb0:
18 [1] Const mutate x$3_@0 = Array []
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
20 + [3] Reassign store y$4_@1.x[2:4] = read x$3_@0
21 [4] Return freeze y$4_@1:TObject
22 ```
23
@@ -31,7 +31,7 @@ function foo(
31 }
32 scope @1 [2:4] deps=[read x$3_@0] out=[y$4_@1] {
33 [2] Const mutate y$4_@1:TObject[2:4] = Object { }
34 - [3] Reassign mutate y$4_@1.x[2:4] = read x$3_@0
34 + [3] Reassign store y$4_@1.x[2:4] = read x$3_@0
35 }
36 return freeze y$4_@1:TObject
37 }
compiler/forget/src/__tests__/fixtures/hir/transitive-alias-fields.expect.md
+6 -6
@@ -25,9 +25,9 @@ bb0:
25 [2] Const mutate p$7_@0:TObject[1:9] = Object { }
26 [3] Const mutate q$8_@0:TObject[1:9] = Object { }
27 [4] Const mutate y$9_@0:TObject[1:9] = Object { }
28 - [5] Reassign mutate x$6_@0.y[1:9] = read y$9_@0:TObject
29 - [6] Reassign mutate p$7_@0.y[1:9] = read x$6_@0.y
30 - [7] Reassign mutate q$8_@0.y[1:9] = read p$7_@0.y
28 + [5] Reassign store x$6_@0.y[1:9] = read y$9_@0:TObject
29 + [6] Reassign store p$7_@0.y[1:9] = read x$6_@0.y
30 + [7] Reassign store 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 ```
@@ -41,9 +41,9 @@ function component(
41 [2] Const mutate p$7_@0:TObject[1:9] = Object { }
42 [3] Const mutate q$8_@0:TObject[1:9] = Object { }
43 [4] Const mutate y$9_@0:TObject[1:9] = Object { }
44 - [5] Reassign mutate x$6_@0.y[1:9] = read y$9_@0:TObject
45 - [6] Reassign mutate p$7_@0.y[1:9] = read x$6_@0.y
46 - [7] Reassign mutate q$8_@0.y[1:9] = read p$7_@0.y
44 + [5] Reassign store x$6_@0.y[1:9] = read y$9_@0:TObject
45 + [6] Reassign store p$7_@0.y[1:9] = read x$6_@0.y
46 + [7] Reassign store q$8_@0.y[1:9] = read p$7_@0.y
47 [8] Call mutate mutate$5:TFunction(mutate q$8_@0:TObject)
48 return
49 }
compiler/forget/src/__tests__/fixtures/hir/type-test-field-store.expect.md
+2 -2
@@ -17,7 +17,7 @@ function component() {
17 bb0:
18 [1] Const mutate x$4_@0:TObject[1:4] = Object { }
19 [2] Const mutate q$5_@1:TObject = Object { }
20 - [3] Reassign mutate x$4_@0.t[1:4] = read q$5_@1:TObject
20 + [3] Reassign store 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 ```
@@ -32,7 +32,7 @@ function component(
32 scope @1 [2:3] deps=[] out=[q$5_@1] {
33 [2] Const mutate q$5_@1:TObject = Object { }
34 }
35 - [3] Reassign mutate x$4_@0.t[1:4] = read q$5_@1:TObject
35 + [3] Reassign store x$4_@0.t[1:4] = read q$5_@1:TObject
36 }
37 [4] Const mutate z$6:TObject = read x$4_@0.t
38 return
compiler/forget/src/__tests__/fixtures/hir/type-test-polymorphic.expect.md
+4 -4
@@ -26,9 +26,9 @@ bb0:
26 [2] Binary read p$7_@0:TPrimitive + read p$7_@0:TPrimitive
27 [3] Const mutate o$8_@1:TObject = Object { }
28 [4] Const mutate x$9_@2:TObject[4:8] = Object { }
29 - [5] Reassign mutate x$9_@2.t[4:8] = read p$7_@0:TPrimitive
29 + [5] Reassign store x$9_@2.t[4:8] = read p$7_@0:TPrimitive
30 [6] Const mutate z$10_@2:TPrimitive[4:8] = read x$9_@2.t
31 - [7] Reassign mutate x$9_@2.t[4:8] = read o$8_@1:TObject
31 + [7] Reassign store 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 ```
@@ -47,9 +47,9 @@ function component(
47 }
48 scope @2 [4:8] deps=[read p$7_@0:TPrimitive, read o$8_@1:TObject] out=[x$9_@2] {
49 [4] Const mutate x$9_@2:TObject[4:8] = Object { }
50 - [5] Reassign mutate x$9_@2.t[4:8] = read p$7_@0:TPrimitive
50 + [5] Reassign store x$9_@2.t[4:8] = read p$7_@0:TPrimitive
51 [6] Const mutate z$10_@2:TPrimitive[4:8] = read x$9_@2.t
52 - [7] Reassign mutate x$9_@2.t[4:8] = read o$8_@1:TObject
52 + [7] Reassign store x$9_@2.t[4:8] = read o$8_@1:TObject
53 }
54 [8] Const mutate y$11:TPoly = read x$9_@2.t
55 return