ComputedCall modeled as ComputedLoad + Call for order-of-evaluation semantics

This is the version of @mofeiZ's change for PropertyLoad, but made to work on 
ComputedCall. We force the method to be evaluated in the same scope as the call 
in InferReactiveScopeVariables.
This commit is contained in:
Joe Savona
2023-03-22 14:36:48 -07:00
parent 8ef22a2a90
commit 5f1bebbeae
16 changed files with 149 additions and 123 deletions
+8 -8
View File
@@ -927,15 +927,15 @@ function lowerExpression(
}
if (calleePath.isMemberExpression()) {
const memberExpr = lowerMemberExpression(builder, calleePath);
const propertyPlace = buildTemporaryPlace(builder, GeneratedSource);
builder.push({
id: makeInstructionId(0),
lvalue: { ...propertyPlace },
value: memberExpr.value,
loc: GeneratedSource,
});
const args = lowerArguments(builder, expr.get("arguments"));
if (typeof memberExpr.property === "string") {
const propertyPlace = buildTemporaryPlace(builder, GeneratedSource);
builder.push({
id: makeInstructionId(0),
lvalue: { ...propertyPlace },
value: memberExpr.value,
loc: GeneratedSource,
});
return {
kind: "PropertyCall",
receiver: memberExpr.object,
@@ -947,7 +947,7 @@ function lowerExpression(
return {
kind: "ComputedCall",
receiver: memberExpr.object,
property: memberExpr.property,
property: { ...propertyPlace },
args,
loc: exprLoc,
};
@@ -613,11 +613,23 @@ function codegenInstructionValue(
break;
}
case "ComputedCall": {
const receiver = codegenPlace(cx, instrValue.receiver);
const property = codegenPlace(cx, instrValue.property);
const callee = t.memberExpression(receiver, property, true);
const memberExpr = codegenPlace(cx, instrValue.property);
invariant(
t.isMemberExpression(memberExpr) ||
t.isOptionalMemberExpression(memberExpr),
"[Codegen] Internal error: ComputedCall::property must be an unpromoted + unmemoized MemberExpression, was %s.",
memberExpr.type
);
invariant(
t.isNodesEquivalent(
memberExpr.object,
codegenPlace(cx, instrValue.receiver)
),
"[Codegen] Internal error: Forget should always generate ComputedCall::property " +
"as a MemberExpression of ComputedCall::receiver"
);
const args = instrValue.args.map((arg) => codegenArgument(cx, arg));
value = createCallExpression(instrValue.loc, callee, args);
value = createCallExpression(instrValue.loc, memberExpr, args);
break;
}
case "NewExpression": {
@@ -134,6 +134,20 @@ export function inferReactiveScopeVariables(fn: HIRFunction): void {
) {
operands.push(instr.value.value.identifier);
}
} else if (instr.value.kind === "ComputedCall") {
for (const operand of eachInstructionOperand(instr)) {
if (
isMutable(instr, operand) &&
// exclude global variables from being added to scopes, we can't recreate them!
// TODO: improve handling of module-scoped variables and globals
operand.identifier.mutableRange.start > 0
) {
operands.push(operand.identifier);
}
}
// Ensure that the ComputedLoad to resolve the method is in the same scope as the
// call itself
operands.push(instr.value.property.identifier);
} else {
for (const operand of eachInstructionOperand(instr)) {
if (
@@ -38,7 +38,7 @@ function Component() {
console.log("B");
changeF(x);
console.log("arg");
x["f"](1);
x.f(1);
$[0] = x;
} else {
x = $[0];
@@ -22,7 +22,7 @@ function Component(props) {
if (c_0) {
x = {};
x.foo = x.foo + x.bar;
x["foo"](props.foo);
x.foo(props.foo);
$[0] = props.foo;
$[1] = x;
} else {
@@ -33,9 +33,9 @@ bb0 (block):
[4] store $52:TObject<Array> = Array [...capture $51]
[5] store $54:TObject<Array> = StoreLocal Const store arr$53:TObject<Array> = capture $52:TObject<Array>
[6] mutate $55:TObject<Array> = LoadLocal capture arr$53:TObject<Array>
[7] mutate $56 = LoadLocal capture x$48
[8] mutate $57:TFunction<<generated_0>> = PropertyLoad read $55:TObject<Array>.at
[9] mutate $58 = PropertyCall read $55:TObject<Array>.read $57:TFunction<<generated_0>>(read $56)
[7] mutate $56:TFunction<<generated_0>> = PropertyLoad read $55:TObject<Array>.at
[8] mutate $57 = LoadLocal capture x$48
[9] mutate $58 = PropertyCall read $55:TObject<Array>.read $56:TFunction<<generated_0>>(read $57)
[10] Return freeze $58
[9] store $41[9:12]:TFunction = StoreLocal Const mutate fn$40[9:12]:TFunction = capture $39[8:12]:TFunction
[10] mutate $42[10:12]:TFunction = LoadLocal capture fn$40[9:12]:TFunction
@@ -25,12 +25,12 @@ bb0 (block):
[5] store $24:TObject<Array> = Array [capture $23]
[6] store $26:TObject<Array> = StoreLocal Const store arr$25:TObject<Array> = capture $24:TObject<Array>
[7] mutate $27:TObject<Array> = LoadLocal capture arr$25:TObject<Array>
[8] mutate $28:TFunction = Global bar
[9] mutate $29 = LoadLocal read props$19
[10] mutate $30 = PropertyLoad read $29.y
[11] mutate $31 = Call read $28:TFunction(read $30)
[12] mutate $32:TFunction<<generated_0>> = PropertyLoad read $27:TObject<Array>.at
[13] mutate $33 = PropertyCall read $27:TObject<Array>.read $32:TFunction<<generated_0>>(read $31)
[8] mutate $28:TFunction<<generated_0>> = PropertyLoad read $27:TObject<Array>.at
[9] mutate $29:TFunction = Global bar
[10] mutate $30 = LoadLocal read props$19
[11] mutate $31 = PropertyLoad read $30.y
[12] mutate $32 = Call read $29:TFunction(read $31)
[13] mutate $33 = PropertyCall read $27:TObject<Array>.read $28:TFunction<<generated_0>>(read $32)
[14] store $35 = StoreLocal Const mutate result$34 = capture $33
[15] mutate $36 = LoadLocal capture result$34
[16] Return freeze $36
@@ -24,15 +24,15 @@ bb0 (block):
[6] store $33[6:12]:TObject<Array> = Array [read $29, read $31, read $32:TPrimitive]
[7] store $35[7:12]:TObject<Array> = StoreLocal Const store a$34[7:12]:TObject<Array> = capture $33[6:12]:TObject<Array>
[8] mutate $36[8:12]:TObject<Array> = LoadLocal capture a$34[7:12]:TObject<Array>
[9] mutate $37:TPrimitive = 42
[10] mutate $38[10:12]:TFunction<<generated_2>> = PropertyLoad read $36[8:12]:TObject<Array>.push
[11] mutate $39:TPrimitive = PropertyCall mutate $36[8:12]:TObject<Array>.read $38[10:12]:TFunction<<generated_2>>(read $37:TPrimitive)
[9] mutate $37[9:12]:TFunction<<generated_2>> = PropertyLoad read $36[8:12]:TObject<Array>.push
[10] mutate $38:TPrimitive = 42
[11] mutate $39:TPrimitive = PropertyCall mutate $36[8:12]:TObject<Array>.read $37[9:12]:TFunction<<generated_2>>(read $38:TPrimitive)
[12] store $41:TPrimitive = StoreLocal Const mutate x$40:TPrimitive = capture $39:TPrimitive
[13] mutate $42:TObject<Array> = LoadLocal capture a$34[7:12]:TObject<Array>
[14] mutate $43 = LoadLocal read props$27
[15] mutate $44 = PropertyLoad read $43.c
[16] mutate $45:TFunction<<generated_0>> = PropertyLoad read $42:TObject<Array>.at
[17] mutate $46 = PropertyCall read $42:TObject<Array>.read $45:TFunction<<generated_0>>(read $44)
[14] mutate $43:TFunction<<generated_0>> = PropertyLoad read $42:TObject<Array>.at
[15] mutate $44 = LoadLocal read props$27
[16] mutate $45 = PropertyLoad read $44.c
[17] mutate $46 = PropertyCall read $42:TObject<Array>.read $43:TFunction<<generated_0>>(read $45)
[18] store $48 = StoreLocal Const mutate y$47 = capture $46
[19] mutate $49:TObject<Array> = LoadLocal capture a$34[7:12]:TObject<Array>
[20] mutate $50:TPrimitive = LoadLocal capture x$40:TPrimitive
@@ -32,14 +32,14 @@ bb0 (block):
[10] store $38[10:21]:TObject<Array> = Array []
[11] store $40[11:21]:TObject<Array> = StoreLocal Const store arr$39[11:21]:TObject<Array> = capture $38[10:21]:TObject<Array>
[12] mutate $41[12:21]:TObject<Array> = LoadLocal capture arr$39[11:21]:TObject<Array>
[13] store $42:TObject<Object> = Object { }
[14] mutate $43[14:21]:TFunction<<generated_2>> = PropertyLoad read $41[12:21]:TObject<Array>.push
[15] mutate $44:TPrimitive = PropertyCall mutate $41[12:21]:TObject<Array>.read $43[14:21]:TFunction<<generated_2>>(capture $42:TObject<Object>)
[13] mutate $42[13:21]:TFunction<<generated_2>> = PropertyLoad read $41[12:21]:TObject<Array>.push
[14] store $43:TObject<Object> = Object { }
[15] mutate $44:TPrimitive = PropertyCall mutate $41[12:21]:TObject<Array>.read $42[13:21]:TFunction<<generated_2>>(capture $43:TObject<Object>)
[16] mutate $45[16:21]:TObject<Array> = LoadLocal capture arr$39[11:21]:TObject<Array>
[17] mutate $46 = LoadLocal capture x$31
[18] mutate $47:TObject<Object> = LoadLocal capture y$36:TObject<Object>
[19] mutate $48[19:21]:TFunction<<generated_2>> = PropertyLoad read $45[16:21]:TObject<Array>.push
[20] mutate $49:TPrimitive = PropertyCall mutate $45[16:21]:TObject<Array>.read $48[19:21]:TFunction<<generated_2>>(capture $46, capture $47:TObject<Object>)
[17] mutate $46[17:21]:TFunction<<generated_2>> = PropertyLoad read $45[16:21]:TObject<Array>.push
[18] mutate $47 = LoadLocal capture x$31
[19] mutate $48:TObject<Object> = LoadLocal capture y$36:TObject<Object>
[20] mutate $49:TPrimitive = PropertyCall mutate $45[16:21]:TObject<Array>.read $46[17:21]:TFunction<<generated_2>>(capture $47, capture $48:TObject<Object>)
[21] mutate $50:TObject<Array> = LoadLocal capture arr$39[11:21]:TObject<Array>
[22] Return freeze $50:TObject<Array>
```
@@ -22,10 +22,10 @@ bb0 (block):
[1] store $38[1:36]:TObject<Array> = Array []
[2] store $40[2:36]:TObject<Array> = StoreLocal Let store x$39[2:36]:TObject<Array> = capture $38[1:36]:TObject<Array>
[3] mutate $41[3:36]:TObject<Array> = LoadLocal capture x$39[2:36]:TObject<Array>
[4] mutate $42 = LoadLocal read props$37
[5] mutate $43 = PropertyLoad read $42.bar
[6] mutate $44[6:36]:TFunction<<generated_2>> = PropertyLoad read $41[3:36]:TObject<Array>.push
[7] mutate $45:TPrimitive = PropertyCall mutate $41[3:36]:TObject<Array>.read $44[6:36]:TFunction<<generated_2>>(read $43)
[4] mutate $42[4:36]:TFunction<<generated_2>> = PropertyLoad read $41[3:36]:TObject<Array>.push
[5] mutate $43 = LoadLocal read props$37
[6] mutate $44 = PropertyLoad read $43.bar
[7] mutate $45:TPrimitive = PropertyCall mutate $41[3:36]:TObject<Array>.read $42[4:36]:TFunction<<generated_2>>(read $44)
[8] Ternary test:bb2 fallthrough=bb1
bb2 (value):
predecessor blocks: bb0
@@ -38,10 +38,10 @@ bb3 (value):
[16] store $53[16:36]:TObject<Array> = Array [capture $52[15:36]:TObject<Array>]
[17] store $55[17:36] = Destructure Reassign [ mutate x$39[17:36] ] = capture $53[16:36]:TObject<Array>
[18] mutate $56[18:36] = LoadLocal capture x$39[17:36]
[19] mutate $57 = LoadLocal read props$37
[20] mutate $58 = PropertyLoad read $57.foo
[21] mutate $59[21:36] = PropertyLoad read $56[18:36].push
[22] mutate $60[22:33] = PropertyCall mutate $56[18:36].read $59[21:36](read $58)
[19] mutate $57[19:36] = PropertyLoad read $56[18:36].push
[20] mutate $58 = LoadLocal read props$37
[21] mutate $59 = PropertyLoad read $58.foo
[22] mutate $60[22:33] = PropertyCall mutate $56[18:36].read $57[19:36](read $59)
[23] store $62[23:33] = StoreLocal Const mutate $61[8:33] = capture $60[22:33]
[24] Goto bb1
bb4 (value):
@@ -55,9 +55,9 @@ bb1 (block):
x$39[2:36]:TPhi: phi(bb3: x$39, bb4: x$39)
[28] store $67[28:33] = StoreLocal Const mutate _$66[28:33] = capture $61[8:33]
[29] mutate $69 = Global console
[30] mutate $70[30:33] = LoadLocal capture _$66[28:33]
[31] mutate $71 = PropertyLoad read $69.log
[32] mutate $72 = PropertyCall read $69.read $71(mutate $70[30:33])
[30] mutate $70 = PropertyLoad read $69.log
[31] mutate $71[31:33] = LoadLocal capture _$66[28:33]
[32] mutate $72 = PropertyCall read $69.read $70(mutate $71[31:33])
[33] mutate $73:TFunction = Global mut
[34] mutate $74[34:36] = LoadLocal capture x$39[2:36]
[35] mutate $76 = Call read $73:TFunction(mutate $74[34:36])
@@ -21,10 +21,10 @@ bb0 (block):
[1] store $35[1:8]:TObject<Array> = Array []
[2] store $37[2:8]:TObject<Array> = StoreLocal Let store x$36[2:8]:TObject<Array> = capture $35[1:8]:TObject<Array>
[3] mutate $38[3:8]:TObject<Array> = LoadLocal capture x$36[2:8]:TObject<Array>
[4] mutate $39 = LoadLocal read props$34
[5] mutate $40 = PropertyLoad read $39.bar
[6] mutate $41[6:8]:TFunction<<generated_2>> = PropertyLoad read $38[3:8]:TObject<Array>.push
[7] mutate $42:TPrimitive = PropertyCall mutate $38[3:8]:TObject<Array>.read $41[6:8]:TFunction<<generated_2>>(read $40)
[4] mutate $39[4:8]:TFunction<<generated_2>> = PropertyLoad read $38[3:8]:TObject<Array>.push
[5] mutate $40 = LoadLocal read props$34
[6] mutate $41 = PropertyLoad read $40.bar
[7] mutate $42:TPrimitive = PropertyCall mutate $38[3:8]:TObject<Array>.read $39[4:8]:TFunction<<generated_2>>(read $41)
[8] Ternary test:bb2 fallthrough=bb1
bb2 (value):
predecessor blocks: bb0
@@ -37,10 +37,10 @@ bb3 (value):
[16] store $50[16:23]:TObject<Array> = Array [capture $49[15:23]:TObject<Array>]
[17] store $52[17:23] = Destructure Reassign [ mutate x$36[17:23] ] = capture $50[16:23]:TObject<Array>
[18] mutate $53[18:23] = LoadLocal capture x$36[17:23]
[19] mutate $54 = LoadLocal read props$34
[20] mutate $55 = PropertyLoad read $54.foo
[21] mutate $56[21:23] = PropertyLoad read $53[18:23].push
[22] mutate $57[22:33] = PropertyCall mutate $53[18:23].read $56[21:23](read $55)
[19] mutate $54[19:23] = PropertyLoad read $53[18:23].push
[20] mutate $55 = LoadLocal read props$34
[21] mutate $56 = PropertyLoad read $55.foo
[22] mutate $57[22:33] = PropertyCall mutate $53[18:23].read $54[19:23](read $56)
[23] store $59[23:33] = StoreLocal Const mutate $58[8:33] = capture $57[22:33]
[24] Goto bb1
bb4 (value):
@@ -54,9 +54,9 @@ bb1 (block):
x$36:TPhi: phi(bb3: x$36, bb4: x$36)
[28] store $64[28:33] = StoreLocal Const mutate _$63[28:33] = capture $58[8:33]
[29] mutate $66 = Global console
[30] mutate $67[30:33] = LoadLocal capture _$63[28:33]
[31] mutate $68 = PropertyLoad read $66.log
[32] mutate $69 = PropertyCall read $66.read $68(mutate $67[30:33])
[30] mutate $67 = PropertyLoad read $66.log
[31] mutate $68[31:33] = LoadLocal capture _$63[28:33]
[32] mutate $69 = PropertyCall read $66.read $67(mutate $68[31:33])
[33] mutate $70 = LoadLocal capture x$36
[34] Return freeze $70
```
@@ -20,10 +20,10 @@ bb0 (block):
[1] store $36[1:34]:TObject<Array> = Array []
[2] store $38[2:34]:TObject<Array> = StoreLocal Let store x$37[2:34]:TObject<Array> = capture $36[1:34]:TObject<Array>
[3] mutate $39[3:34]:TObject<Array> = LoadLocal capture x$37[2:34]:TObject<Array>
[4] mutate $40 = LoadLocal read props$35
[5] mutate $41 = PropertyLoad read $40.bar
[6] mutate $42[6:34]:TFunction<<generated_2>> = PropertyLoad read $39[3:34]:TObject<Array>.push
[7] mutate $43:TPrimitive = PropertyCall mutate $39[3:34]:TObject<Array>.read $42[6:34]:TFunction<<generated_2>>(read $41)
[4] mutate $40[4:34]:TFunction<<generated_2>> = PropertyLoad read $39[3:34]:TObject<Array>.push
[5] mutate $41 = LoadLocal read props$35
[6] mutate $42 = PropertyLoad read $41.bar
[7] mutate $43:TPrimitive = PropertyCall mutate $39[3:34]:TObject<Array>.read $40[4:34]:TFunction<<generated_2>>(read $42)
[8] Ternary test:bb2 fallthrough=bb1
bb2 (value):
predecessor blocks: bb0
@@ -35,10 +35,10 @@ bb3 (value):
[14] store $49[14:34]:TObject<Array> = Array []
[15] store $51[15:34]:TObject<Array> = StoreLocal Reassign store x$37[15:34]:TObject<Array> = capture $49[14:34]:TObject<Array>
[16] mutate $52[16:34]:TObject<Array> = LoadLocal capture x$37[15:34]:TObject<Array>
[17] mutate $53 = LoadLocal read props$35
[18] mutate $54 = PropertyLoad read $53.foo
[19] mutate $55[19:34]:TFunction<<generated_2>> = PropertyLoad read $52[16:34]:TObject<Array>.push
[20] mutate $56[20:31]:TPrimitive = PropertyCall mutate $52[16:34]:TObject<Array>.read $55[19:34]:TFunction<<generated_2>>(read $54)
[17] mutate $53[17:34]:TFunction<<generated_2>> = PropertyLoad read $52[16:34]:TObject<Array>.push
[18] mutate $54 = LoadLocal read props$35
[19] mutate $55 = PropertyLoad read $54.foo
[20] mutate $56[20:31]:TPrimitive = PropertyCall mutate $52[16:34]:TObject<Array>.read $53[17:34]:TFunction<<generated_2>>(read $55)
[21] store $58[21:31]:TPrimitive = StoreLocal Const mutate $57[8:31]:TPrimitive = capture $56[20:31]:TPrimitive
[22] Goto bb1
bb4 (value):
@@ -52,9 +52,9 @@ bb1 (block):
x$37[2:34]:TObject<Array>: phi(bb3: x$37, bb4: x$37)
[26] store $63[26:31] = StoreLocal Const mutate _$62[26:31] = capture $57[8:31]:TPrimitive
[27] mutate $65 = Global console
[28] mutate $66[28:31] = LoadLocal capture _$62[26:31]
[29] mutate $67 = PropertyLoad read $65.log
[30] mutate $68 = PropertyCall read $65.read $67(mutate $66[28:31])
[28] mutate $66 = PropertyLoad read $65.log
[29] mutate $67[29:31] = LoadLocal capture _$62[26:31]
[30] mutate $68 = PropertyCall read $65.read $66(mutate $67[29:31])
[31] mutate $69:TFunction = Global mut
[32] mutate $70[32:34] = LoadLocal capture x$37[2:34]
[33] mutate $72 = Call read $69:TFunction(mutate $70[32:34])
@@ -19,10 +19,10 @@ bb0 (block):
[1] store $33[1:8]:TObject<Array> = Array []
[2] store $35[2:8]:TObject<Array> = StoreLocal Let store x$34[2:8]:TObject<Array> = capture $33[1:8]:TObject<Array>
[3] mutate $36[3:8]:TObject<Array> = LoadLocal capture x$34[2:8]:TObject<Array>
[4] mutate $37 = LoadLocal read props$32
[5] mutate $38 = PropertyLoad read $37.bar
[6] mutate $39[6:8]:TFunction<<generated_2>> = PropertyLoad read $36[3:8]:TObject<Array>.push
[7] mutate $40:TPrimitive = PropertyCall mutate $36[3:8]:TObject<Array>.read $39[6:8]:TFunction<<generated_2>>(read $38)
[4] mutate $37[4:8]:TFunction<<generated_2>> = PropertyLoad read $36[3:8]:TObject<Array>.push
[5] mutate $38 = LoadLocal read props$32
[6] mutate $39 = PropertyLoad read $38.bar
[7] mutate $40:TPrimitive = PropertyCall mutate $36[3:8]:TObject<Array>.read $37[4:8]:TFunction<<generated_2>>(read $39)
[8] Ternary test:bb2 fallthrough=bb1
bb2 (value):
predecessor blocks: bb0
@@ -34,10 +34,10 @@ bb3 (value):
[14] store $46[14:21]:TObject<Array> = Array []
[15] store $48[15:21]:TObject<Array> = StoreLocal Reassign store x$34[15:21]:TObject<Array> = capture $46[14:21]:TObject<Array>
[16] mutate $49[16:21]:TObject<Array> = LoadLocal capture x$34[15:21]:TObject<Array>
[17] mutate $50 = LoadLocal read props$32
[18] mutate $51 = PropertyLoad read $50.foo
[19] mutate $52[19:21]:TFunction<<generated_2>> = PropertyLoad read $49[16:21]:TObject<Array>.push
[20] mutate $53[20:31]:TPrimitive = PropertyCall mutate $49[16:21]:TObject<Array>.read $52[19:21]:TFunction<<generated_2>>(read $51)
[17] mutate $50[17:21]:TFunction<<generated_2>> = PropertyLoad read $49[16:21]:TObject<Array>.push
[18] mutate $51 = LoadLocal read props$32
[19] mutate $52 = PropertyLoad read $51.foo
[20] mutate $53[20:31]:TPrimitive = PropertyCall mutate $49[16:21]:TObject<Array>.read $50[17:21]:TFunction<<generated_2>>(read $52)
[21] store $55[21:31]:TPrimitive = StoreLocal Const mutate $54[8:31]:TPrimitive = capture $53[20:31]:TPrimitive
[22] Goto bb1
bb4 (value):
@@ -51,9 +51,9 @@ bb1 (block):
x$34:TObject<Array>: phi(bb3: x$34, bb4: x$34)
[26] store $60[26:31] = StoreLocal Const mutate _$59[26:31] = capture $54[8:31]:TPrimitive
[27] mutate $62 = Global console
[28] mutate $63[28:31] = LoadLocal capture _$59[26:31]
[29] mutate $64 = PropertyLoad read $62.log
[30] mutate $65 = PropertyCall read $62.read $64(mutate $63[28:31])
[28] mutate $63 = PropertyLoad read $62.log
[29] mutate $64[29:31] = LoadLocal capture _$59[26:31]
[30] mutate $65 = PropertyCall read $62.read $63(mutate $64[29:31])
[31] mutate $66 = LoadLocal capture x$34
[32] Return freeze $66
```
@@ -22,10 +22,10 @@ bb0 (block):
[1] store $44[1:8]:TObject<Array> = Array []
[2] store $46[2:8]:TObject<Array> = StoreLocal Let store x$45[2:42]:TObject<Array> = capture $44[1:8]:TObject<Array>
[3] mutate $47[3:8]:TObject<Array> = LoadLocal capture x$45[2:42]:TObject<Array>
[4] mutate $48 = LoadLocal read props$43
[5] mutate $49 = PropertyLoad read $48.bar
[6] mutate $50[6:8]:TFunction<<generated_2>> = PropertyLoad read $47[3:8]:TObject<Array>.push
[7] mutate $51:TPrimitive = PropertyCall mutate $47[3:8]:TObject<Array>.read $50[6:8]:TFunction<<generated_2>>(read $49)
[4] mutate $48[4:8]:TFunction<<generated_2>> = PropertyLoad read $47[3:8]:TObject<Array>.push
[5] mutate $49 = LoadLocal read props$43
[6] mutate $50 = PropertyLoad read $49.bar
[7] mutate $51:TPrimitive = PropertyCall mutate $47[3:8]:TObject<Array>.read $48[4:8]:TFunction<<generated_2>>(read $50)
[8] Ternary test:bb2 fallthrough=bb1
bb2 (value):
predecessor blocks: bb0
@@ -37,10 +37,10 @@ bb3 (value):
[14] store $57[14:42]:TObject<Array> = Array []
[15] store $59[15:42]:TObject<Array> = StoreLocal Reassign store x$45[15:42]:TObject<Array> = capture $57[14:42]:TObject<Array>
[16] mutate $60[16:42]:TObject<Array> = LoadLocal capture x$45[15:42]:TObject<Array>
[17] mutate $61 = LoadLocal read props$43
[18] mutate $62 = PropertyLoad read $61.foo
[19] mutate $63[19:42]:TFunction<<generated_2>> = PropertyLoad read $60[16:42]:TObject<Array>.push
[20] mutate $64[20:39]:TPrimitive = PropertyCall mutate $60[16:42]:TObject<Array>.read $63[19:42]:TFunction<<generated_2>>(read $62)
[17] mutate $61[17:42]:TFunction<<generated_2>> = PropertyLoad read $60[16:42]:TObject<Array>.push
[18] mutate $62 = LoadLocal read props$43
[19] mutate $63 = PropertyLoad read $62.foo
[20] mutate $64[20:39]:TPrimitive = PropertyCall mutate $60[16:42]:TObject<Array>.read $61[17:42]:TFunction<<generated_2>>(read $63)
[21] store $66[21:39]:TPrimitive = StoreLocal Const mutate $65[8:39]:TPrimitive = capture $64[20:39]:TPrimitive
[22] Goto bb1
bb4 (value):
@@ -48,10 +48,10 @@ bb4 (value):
[25] store $70[25:42]:TObject<Array> = Array []
[26] store $72[26:42]:TObject<Array> = StoreLocal Reassign store x$45[26:42]:TObject<Array> = capture $70[25:42]:TObject<Array>
[27] mutate $73[27:42]:TObject<Array> = LoadLocal capture x$45[26:42]:TObject<Array>
[28] mutate $74 = LoadLocal read props$43
[29] mutate $75 = PropertyLoad read $74.bar
[30] mutate $76[30:42]:TFunction<<generated_2>> = PropertyLoad read $73[27:42]:TObject<Array>.push
[31] mutate $77[31:39]:TPrimitive = PropertyCall mutate $73[27:42]:TObject<Array>.read $76[30:42]:TFunction<<generated_2>>(read $75)
[28] mutate $74[28:42]:TFunction<<generated_2>> = PropertyLoad read $73[27:42]:TObject<Array>.push
[29] mutate $75 = LoadLocal read props$43
[30] mutate $76 = PropertyLoad read $75.bar
[31] mutate $77[31:39]:TPrimitive = PropertyCall mutate $73[27:42]:TObject<Array>.read $74[28:42]:TFunction<<generated_2>>(read $76)
[32] store $79[32:39]:TPrimitive = StoreLocal Const mutate $65[8:39]:TPrimitive = capture $77[31:39]:TPrimitive
[33] Goto bb1
bb1 (block):
@@ -60,9 +60,9 @@ bb1 (block):
x$45[15:42]:TObject<Array>: phi(bb3: x$45, bb4: x$45)
[34] store $81[34:39] = StoreLocal Const mutate _$80[34:39] = capture $65[8:39]:TPrimitive
[35] mutate $83 = Global console
[36] mutate $84[36:39] = LoadLocal capture _$80[34:39]
[37] mutate $85 = PropertyLoad read $83.log
[38] mutate $86 = PropertyCall read $83.read $85(mutate $84[36:39])
[36] mutate $84 = PropertyLoad read $83.log
[37] mutate $85[37:39] = LoadLocal capture _$80[34:39]
[38] mutate $86 = PropertyCall read $83.read $84(mutate $85[37:39])
[39] mutate $87:TFunction = Global mut
[40] mutate $88[40:42] = LoadLocal capture x$45[15:42]
[41] mutate $90 = Call read $87:TFunction(mutate $88[40:42])
@@ -21,10 +21,10 @@ bb0 (block):
[1] store $41[1:8]:TObject<Array> = Array []
[2] store $43[2:8]:TObject<Array> = StoreLocal Let store x$42[2:8]:TObject<Array> = capture $41[1:8]:TObject<Array>
[3] mutate $44[3:8]:TObject<Array> = LoadLocal capture x$42[2:8]:TObject<Array>
[4] mutate $45 = LoadLocal read props$40
[5] mutate $46 = PropertyLoad read $45.bar
[6] mutate $47[6:8]:TFunction<<generated_2>> = PropertyLoad read $44[3:8]:TObject<Array>.push
[7] mutate $48:TPrimitive = PropertyCall mutate $44[3:8]:TObject<Array>.read $47[6:8]:TFunction<<generated_2>>(read $46)
[4] mutate $45[4:8]:TFunction<<generated_2>> = PropertyLoad read $44[3:8]:TObject<Array>.push
[5] mutate $46 = LoadLocal read props$40
[6] mutate $47 = PropertyLoad read $46.bar
[7] mutate $48:TPrimitive = PropertyCall mutate $44[3:8]:TObject<Array>.read $45[4:8]:TFunction<<generated_2>>(read $47)
[8] Ternary test:bb2 fallthrough=bb1
bb2 (value):
predecessor blocks: bb0
@@ -36,10 +36,10 @@ bb3 (value):
[14] store $54[14:21]:TObject<Array> = Array []
[15] store $56[15:21]:TObject<Array> = StoreLocal Reassign store x$42[15:21]:TObject<Array> = capture $54[14:21]:TObject<Array>
[16] mutate $57[16:21]:TObject<Array> = LoadLocal capture x$42[15:21]:TObject<Array>
[17] mutate $58 = LoadLocal read props$40
[18] mutate $59 = PropertyLoad read $58.foo
[19] mutate $60[19:21]:TFunction<<generated_2>> = PropertyLoad read $57[16:21]:TObject<Array>.push
[20] mutate $61[20:39]:TPrimitive = PropertyCall mutate $57[16:21]:TObject<Array>.read $60[19:21]:TFunction<<generated_2>>(read $59)
[17] mutate $58[17:21]:TFunction<<generated_2>> = PropertyLoad read $57[16:21]:TObject<Array>.push
[18] mutate $59 = LoadLocal read props$40
[19] mutate $60 = PropertyLoad read $59.foo
[20] mutate $61[20:39]:TPrimitive = PropertyCall mutate $57[16:21]:TObject<Array>.read $58[17:21]:TFunction<<generated_2>>(read $60)
[21] store $63[21:39]:TPrimitive = StoreLocal Const mutate $62[8:39]:TPrimitive = capture $61[20:39]:TPrimitive
[22] Goto bb1
bb4 (value):
@@ -47,10 +47,10 @@ bb4 (value):
[25] store $67[25:32]:TObject<Array> = Array []
[26] store $69[26:32]:TObject<Array> = StoreLocal Reassign store x$42[26:32]:TObject<Array> = capture $67[25:32]:TObject<Array>
[27] mutate $70[27:32]:TObject<Array> = LoadLocal capture x$42[26:32]:TObject<Array>
[28] mutate $71 = LoadLocal read props$40
[29] mutate $72 = PropertyLoad read $71.bar
[30] mutate $73[30:32]:TFunction<<generated_2>> = PropertyLoad read $70[27:32]:TObject<Array>.push
[31] mutate $74[31:39]:TPrimitive = PropertyCall mutate $70[27:32]:TObject<Array>.read $73[30:32]:TFunction<<generated_2>>(read $72)
[28] mutate $71[28:32]:TFunction<<generated_2>> = PropertyLoad read $70[27:32]:TObject<Array>.push
[29] mutate $72 = LoadLocal read props$40
[30] mutate $73 = PropertyLoad read $72.bar
[31] mutate $74[31:39]:TPrimitive = PropertyCall mutate $70[27:32]:TObject<Array>.read $71[28:32]:TFunction<<generated_2>>(read $73)
[32] store $76[32:39]:TPrimitive = StoreLocal Const mutate $62[8:39]:TPrimitive = capture $74[31:39]:TPrimitive
[33] Goto bb1
bb1 (block):
@@ -59,9 +59,9 @@ bb1 (block):
x$42:TObject<Array>: phi(bb3: x$42, bb4: x$42)
[34] store $78[34:39] = StoreLocal Const mutate _$77[34:39] = capture $62[8:39]:TPrimitive
[35] mutate $80 = Global console
[36] mutate $81[36:39] = LoadLocal capture _$77[34:39]
[37] mutate $82 = PropertyLoad read $80.log
[38] mutate $83 = PropertyCall read $80.read $82(mutate $81[36:39])
[36] mutate $81 = PropertyLoad read $80.log
[37] mutate $82[37:39] = LoadLocal capture _$77[34:39]
[38] mutate $83 = PropertyCall read $80.read $81(mutate $82[37:39])
[39] mutate $84 = LoadLocal capture x$42
[40] Return freeze $84
```
@@ -27,10 +27,10 @@ bb0 (block):
[1] store $35[1:8]:TObject<Array> = Array []
[2] store $37[2:8]:TObject<Array> = StoreLocal Let store x$36[2:34]:TObject<Array> = capture $35[1:8]:TObject<Array>
[3] mutate $38[3:8]:TObject<Array> = LoadLocal capture x$36[2:34]:TObject<Array>
[4] mutate $39 = LoadLocal read props$34
[5] mutate $40 = PropertyLoad read $39.bar
[6] mutate $41[6:8]:TFunction<<generated_2>> = PropertyLoad read $38[3:8]:TObject<Array>.push
[7] mutate $42:TPrimitive = PropertyCall mutate $38[3:8]:TObject<Array>.read $41[6:8]:TFunction<<generated_2>>(read $40)
[4] mutate $39[4:8]:TFunction<<generated_2>> = PropertyLoad read $38[3:8]:TObject<Array>.push
[5] mutate $40 = LoadLocal read props$34
[6] mutate $41 = PropertyLoad read $40.bar
[7] mutate $42:TPrimitive = PropertyCall mutate $38[3:8]:TObject<Array>.read $39[4:8]:TFunction<<generated_2>>(read $41)
[8] mutate $43 = LoadLocal read props$34
[9] mutate $44 = PropertyLoad read $43.cond
[10] If (read $44) then:bb2 else:bb3 fallthrough=bb1
@@ -39,20 +39,20 @@ bb2 (block):
[13] store $48[13:34]:TObject<Array> = Array []
[14] store $50[14:34]:TObject<Array> = StoreLocal Reassign store x$36[14:34]:TObject<Array> = capture $48[13:34]:TObject<Array>
[15] mutate $51[15:34]:TObject<Array> = LoadLocal capture x$36[14:34]:TObject<Array>
[16] mutate $52 = LoadLocal read props$34
[17] mutate $53 = PropertyLoad read $52.foo
[18] mutate $54[18:34]:TFunction<<generated_2>> = PropertyLoad read $51[15:34]:TObject<Array>.push
[19] mutate $55:TPrimitive = PropertyCall mutate $51[15:34]:TObject<Array>.read $54[18:34]:TFunction<<generated_2>>(read $53)
[16] mutate $52[16:34]:TFunction<<generated_2>> = PropertyLoad read $51[15:34]:TObject<Array>.push
[17] mutate $53 = LoadLocal read props$34
[18] mutate $54 = PropertyLoad read $53.foo
[19] mutate $55:TPrimitive = PropertyCall mutate $51[15:34]:TObject<Array>.read $52[16:34]:TFunction<<generated_2>>(read $54)
[20] Goto bb1
bb3 (block):
predecessor blocks: bb0
[23] store $59[23:34]:TObject<Array> = Array []
[24] store $61[24:34]:TObject<Array> = StoreLocal Reassign store x$36[24:34]:TObject<Array> = capture $59[23:34]:TObject<Array>
[25] mutate $62[25:34]:TObject<Array> = LoadLocal capture x$36[24:34]:TObject<Array>
[26] mutate $63 = LoadLocal read props$34
[27] mutate $64 = PropertyLoad read $63.bar
[28] mutate $65[28:34]:TFunction<<generated_2>> = PropertyLoad read $62[25:34]:TObject<Array>.push
[29] mutate $66:TPrimitive = PropertyCall mutate $62[25:34]:TObject<Array>.read $65[28:34]:TFunction<<generated_2>>(read $64)
[26] mutate $63[26:34]:TFunction<<generated_2>> = PropertyLoad read $62[25:34]:TObject<Array>.push
[27] mutate $64 = LoadLocal read props$34
[28] mutate $65 = PropertyLoad read $64.bar
[29] mutate $66:TPrimitive = PropertyCall mutate $62[25:34]:TObject<Array>.read $63[26:34]:TFunction<<generated_2>>(read $65)
[30] Goto bb1
bb1 (block):
predecessor blocks: bb2 bb3