dillon1000/react

Commit

Lowering for PropertyStore

Converts assignment expressions where the lvalue is a MemberExpression to use 
PropertyStore, rather than creating an lvalue with a member path. The net effect 
is that lvalue will always have a null member path. 

There are two main cases: 

* `x.y = <value>`. We lower <value> to a Place, lower the object of the member 
expression to a place (`object)` create a temporary Place for the result of the 
assignment, and then create a `PropertyStore <object>, "<property>", <value>`. 

* `x.y += <value>` (and similar update-in-place operands). We extract the object 
of the member expression, read the current value via a PropertyLoad, compute the 
updated value, and store it back with a PropertyStore (each of these goes into 
its own temporary).
Browse files
Changed paths15 files
First-parent comparison
M compiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/HIR/Codegen.ts ModifiedM compiler/forget/src/HIR/InferReferenceEffects.ts ModifiedA compiler/forget/src/__tests__/fixtures/hir/_bug_chained-assignment-expressions.expect.md AddedA compiler/forget/src/__tests__/fixtures/hir/_bug_chained-assignment-expressions.js AddedM compiler/forget/src/__tests__/fixtures/hir/_bug_invalid-scope.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/alias-nested-member-path-mutate.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/assignment-variations-complex-lvalue.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/mutable-lifetime-with-aliasing.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/property-assignment.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-alias-mutate-if.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/ssa-property-alias-mutate-if.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate-alias.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/ssa-property-mutate.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/transitive-alias-fields.expect.md Modified
Patch

Files changed

Rendering syntax-highlighted changes…