mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Expect files are input/ouput code only (no HIR/scopes)
This commit is contained in:
@@ -14,13 +14,13 @@ import {
|
||||
inferTypes,
|
||||
lower,
|
||||
} from "./HIR";
|
||||
import { ReactiveFunction } from "./HIR/HIR";
|
||||
import {
|
||||
buildReactiveFunction,
|
||||
codegenReactiveFunction,
|
||||
flattenReactiveLoops,
|
||||
inferReactiveScopes,
|
||||
inferReactiveScopeVariables,
|
||||
printReactiveFunction,
|
||||
propagateScopeDependencies,
|
||||
pruneUnusedLabels,
|
||||
pruneUnusedScopes,
|
||||
@@ -30,9 +30,9 @@ import { eliminateRedundantPhi, enterSSA, leaveSSA } from "./SSA";
|
||||
import { logHIRFunction } from "./Utils/logger";
|
||||
|
||||
export type CompilerResult = {
|
||||
ir: HIRFunction;
|
||||
ast: t.Function;
|
||||
scopes: string;
|
||||
ir: HIRFunction;
|
||||
reactiveFunction: ReactiveFunction;
|
||||
};
|
||||
|
||||
export default function (
|
||||
@@ -73,12 +73,11 @@ export default function (
|
||||
propagateScopeDependencies(reactiveFunction);
|
||||
pruneUnusedScopes(reactiveFunction);
|
||||
renameVariables(reactiveFunction);
|
||||
const scopes = printReactiveFunction(reactiveFunction);
|
||||
const ast = codegenReactiveFunction(reactiveFunction);
|
||||
|
||||
return {
|
||||
ast,
|
||||
ir,
|
||||
scopes,
|
||||
reactiveFunction,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,40 +20,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
[3] If (read props$3.b) then:bb1 else:bb2 fallthrough=bb2
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
[5] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb2
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
[7] Return freeze a$4_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
if (read props$3.b) {
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
return freeze a$4_@0
|
||||
}
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,31 +11,6 @@ function f() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate x$0$5:TPrimitive = 2
|
||||
[3] Const mutate $6:TPrimitive = Binary read x$0$5:TPrimitive + read x$0$5:TPrimitive
|
||||
[4] Const mutate $7:TPrimitive = Binary read $6:TPrimitive + read x$0$5:TPrimitive
|
||||
[5] Return read $7:TPrimitive
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function f(
|
||||
) {
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate x$0$5:TPrimitive = 2
|
||||
[3] Const mutate $6:TPrimitive = Binary read x$0$5:TPrimitive + read x$0$5:TPrimitive
|
||||
[4] Const mutate $7:TPrimitive = Binary read $6:TPrimitive + read x$0$5:TPrimitive
|
||||
return read $7:TPrimitive
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,35 +13,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate z$5_@0[1:7] = Array []
|
||||
[2] Const mutate y$6_@0:TObject[1:7] = Object { }
|
||||
[3] Reassign store y$6_@0.z[1:7] = read z$5_@0
|
||||
[4] Const mutate x$7_@0:TObject[1:7] = Object { }
|
||||
[5] Reassign store x$7_@0.y[1:7] = read y$6_@0:TObject
|
||||
[6] Call mutate mutate$4:TFunction(mutate x$7_@0.y.z)
|
||||
[7] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
[1] Const mutate z$5_@0[1:7] = Array []
|
||||
[2] Const mutate y$6_@0:TObject[1:7] = Object { }
|
||||
[3] Reassign store y$6_@0.z[1:7] = read z$5_@0
|
||||
[4] Const mutate x$7_@0:TObject[1:7] = Object { }
|
||||
[5] Reassign store x$7_@0.y[1:7] = read y$6_@0:TObject
|
||||
[6] Call mutate mutate$4:TFunction(mutate x$7_@0.y.z)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,39 +13,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate z$4_@0 = Array []
|
||||
[2] Const mutate y$5_@1:TObject[2:4] = Object { }
|
||||
[3] Reassign store y$5_@1.z[2:4] = read z$4_@0
|
||||
[4] Const mutate x$6_@2:TObject[4:6] = Object { }
|
||||
[5] Reassign store x$6_@2.y[4:6] = read y$5_@1:TObject
|
||||
[6] Return freeze x$6_@2:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[z$4_@0] {
|
||||
[1] Const mutate z$4_@0 = Array []
|
||||
}
|
||||
scope @1 [2:4] deps=[read z$4_@0] out=[y$5_@1] {
|
||||
[2] Const mutate y$5_@1:TObject[2:4] = Object { }
|
||||
[3] Reassign store y$5_@1.z[2:4] = read z$4_@0
|
||||
}
|
||||
scope @2 [4:6] deps=[read y$5_@1:TObject] out=[x$6_@2] {
|
||||
[4] Const mutate x$6_@2:TObject[4:6] = Object { }
|
||||
[5] Reassign store x$6_@2.y[4:6] = read y$5_@1:TObject
|
||||
}
|
||||
return freeze x$6_@2:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -23,61 +23,6 @@ function mutate(x, y) {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Let mutate a$8_@0:TObject[1:12] = Object { }
|
||||
[2] Let mutate b$9_@0:TObject[1:12] = Object { }
|
||||
[3] Let mutate c$10_@0:TObject[1:12] = Object { }
|
||||
[4] While test=bb1 loop=bb3 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb3
|
||||
[5] If (read cond$7) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[6] Const mutate z$13_@0[1:12] = read a$8_@0:TObject
|
||||
[7] Reassign mutate a$8_@0:TObject[1:12] = read b$9_@0:TObject
|
||||
[8] Reassign mutate b$9_@0:TObject[1:12] = read c$10_@0:TObject
|
||||
[9] Reassign mutate c$10_@0:TObject[1:12] = read z$13_@0
|
||||
[10] Call mutate mutate$6:TFunction(mutate a$8_@0:TObject, mutate b$9_@0:TObject)
|
||||
[11] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[12] read a$8_@0:TObject
|
||||
[13] read b$9_@0:TObject
|
||||
[14] read c$10_@0:TObject
|
||||
[15] Return freeze a$8_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
cond,
|
||||
) {
|
||||
scope @0 [1:12] deps=[read cond$7] out=[a$8_@0, b$9_@0, c$10_@0] {
|
||||
[1] Let mutate a$8_@0:TObject[1:12] = Object { }
|
||||
[2] Let mutate b$9_@0:TObject[1:12] = Object { }
|
||||
[3] Let mutate c$10_@0:TObject[1:12] = Object { }
|
||||
while (
|
||||
read cond$7
|
||||
) {
|
||||
[6] Const mutate z$13_@0[1:12] = read a$8_@0:TObject
|
||||
[7] Reassign mutate a$8_@0:TObject[1:12] = read b$9_@0:TObject
|
||||
[8] Reassign mutate b$9_@0:TObject[1:12] = read c$10_@0:TObject
|
||||
[9] Reassign mutate c$10_@0:TObject[1:12] = read z$13_@0
|
||||
[10] Call mutate mutate$6:TFunction(mutate a$8_@0:TObject, mutate b$9_@0:TObject)
|
||||
}
|
||||
}
|
||||
[12] read a$8_@0:TObject
|
||||
[13] read b$9_@0:TObject
|
||||
[14] read c$10_@0:TObject
|
||||
return freeze a$8_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -117,25 +62,6 @@ function foo(cond) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function mutate(
|
||||
x,
|
||||
y,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -16,37 +16,6 @@ function g(a) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
[2] Const mutate $6:TPrimitive = 1
|
||||
[3] Const mutate x$0$7:TPrimitive = Binary read x$5:TPrimitive + read $6:TPrimitive
|
||||
[4] Const mutate $8:TPrimitive = 1
|
||||
[5] Const mutate x$1$9:TPrimitive = Binary read x$0$7:TPrimitive + read $8:TPrimitive
|
||||
[6] Const mutate $10:TPrimitive = 1
|
||||
[7] Const mutate x$2$11:TPrimitive = Binary read x$1$9:TPrimitive >>> read $10:TPrimitive
|
||||
[8] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function f(
|
||||
) {
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
[2] Const mutate $6:TPrimitive = 1
|
||||
[3] Const mutate x$0$7:TPrimitive = Binary read x$5:TPrimitive + read $6:TPrimitive
|
||||
[4] Const mutate $8:TPrimitive = 1
|
||||
[5] Const mutate x$1$9:TPrimitive = Binary read x$0$7:TPrimitive + read $8:TPrimitive
|
||||
[6] Const mutate $10:TPrimitive = 1
|
||||
[7] Const mutate x$2$11:TPrimitive = Binary read x$1$9:TPrimitive >>> read $10:TPrimitive
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -58,34 +27,6 @@ function f() {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate $6:TPrimitive = 1
|
||||
[2] Const mutate $7:TPrimitive = Binary read a$5_@0.b.c + read $6:TPrimitive
|
||||
[3] Reassign read a$5_@0.b.c[0:6] = read $7:TPrimitive
|
||||
[4] Const mutate $8:TPrimitive = 2
|
||||
[5] Reassign mutate a$5_@0.b.c[0:6] = Binary read a$5_@0.b.c * read $8:TPrimitive
|
||||
[6] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function g(
|
||||
a,
|
||||
) {
|
||||
[1] Const mutate $6:TPrimitive = 1
|
||||
[2] Const mutate $7:TPrimitive = Binary read a$5_@0.b.c + read $6:TPrimitive
|
||||
[3] Reassign read a$5_@0.b.c[0:6] = read $7:TPrimitive
|
||||
[4] Const mutate $8:TPrimitive = 2
|
||||
[5] Reassign mutate a$5_@0.b.c[0:6] = Binary read a$5_@0.b.c * read $8:TPrimitive
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,67 +15,12 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$10_@0[1:7] = Array []
|
||||
[2] Const mutate b$11_@0:TObject[1:7] = Object { }
|
||||
[3] Call mutate foo$4:TFunction(mutate a$10_@0, mutate b$11_@0:TObject)
|
||||
[4] Const mutate $12:TPrimitive = "div"
|
||||
[5] Const mutate _$13_@1 = JSX <read $12:TPrimitive a={freeze a$10_@0} ></read $12:TPrimitive>
|
||||
[6] Call mutate foo$4:TFunction(mutate b$11_@0:TObject)
|
||||
[7] Const mutate $14:TPrimitive = "div"
|
||||
[8] Const mutate t4$15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
|
||||
[9] Return read t4$15_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:7] deps=[] out=[a$10_@0, b$11_@0] {
|
||||
[1] Const mutate a$10_@0[1:7] = Array []
|
||||
[2] Const mutate b$11_@0:TObject[1:7] = Object { }
|
||||
[3] Call mutate foo$4:TFunction(mutate a$10_@0, mutate b$11_@0:TObject)
|
||||
[4] Const mutate $12:TPrimitive = "div"
|
||||
[5] Const mutate _$13_@1 = JSX <read $12:TPrimitive a={freeze a$10_@0} ></read $12:TPrimitive>
|
||||
[6] Call mutate foo$4:TFunction(mutate b$11_@0:TObject)
|
||||
}
|
||||
[7] Const mutate $14:TPrimitive = "div"
|
||||
scope @2 [8:9] deps=[read a$10_@0, freeze b$11_@0:TObject] out=[$15_@2] {
|
||||
[8] Const mutate $15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
|
||||
}
|
||||
return read $15_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -14,50 +14,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] If (read a$4) then:bb3 else:bb1 fallthrough=bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[2] While test=bb4 loop=bb6 fallthrough=bb1
|
||||
bb4:
|
||||
predecessor blocks: bb3 bb7
|
||||
[3] If (read b$5) then:bb6 else:bb1 fallthrough=bb1
|
||||
bb6:
|
||||
predecessor blocks: bb4
|
||||
[4] If (read c$6) then:bb1 else:bb7 fallthrough=bb7
|
||||
bb7:
|
||||
predecessor blocks: bb6
|
||||
[5] Goto(Continue) bb4
|
||||
bb1:
|
||||
predecessor blocks: bb6 bb4 bb0
|
||||
[6] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
if (read a$4) {
|
||||
while (
|
||||
read b$5
|
||||
) {
|
||||
if (read c$6) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -31,146 +31,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate items$30 = read props$29.items
|
||||
[2] Const mutate maxItems$31 = read props$29.maxItems
|
||||
[3] Const mutate renderedItems$32_@0[3:33] = Array []
|
||||
[4] Const mutate seen$33_@0[3:33] = New mutate Set$5()
|
||||
[5] Const mutate $34:TPrimitive = 0
|
||||
[6] Const mutate max$35_@2:TPrimitive = Call mutate Math$7.max(read $34:TPrimitive, read maxItems$31)
|
||||
[7] For init=bb3 test=bb1 loop=bb5 update=bb4 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[8] Let mutate i$36_@0:TPrimitive[3:33] = 0
|
||||
[9] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb4
|
||||
[10] Const mutate $39:TPrimitive = Binary read i$36_@0:TPrimitive < read items$30.length
|
||||
[11] If (read $39:TPrimitive) then:bb5 else:bb2 fallthrough=bb2
|
||||
bb5:
|
||||
predecessor blocks: bb1
|
||||
[12] Const mutate item$40_@0:TPrimitive[3:33] = Call read items$30.at(read i$36_@0:TPrimitive)
|
||||
[13] Const mutate $41:TPrimitive = null
|
||||
[14] Const mutate $42:TPrimitive = Binary read item$40_@0:TPrimitive == read $41:TPrimitive
|
||||
[15] Let mutate $46_@0[3:33] = undefined
|
||||
[15] If (read $42:TPrimitive) then:bb10 else:bb11 fallthrough=bb9
|
||||
bb10:
|
||||
predecessor blocks: bb5
|
||||
[16] Const mutate $43:TPrimitive = read $42:TPrimitive
|
||||
[17] Reassign mutate $46_@0[3:33] = read $43:TPrimitive
|
||||
[17] Goto bb9
|
||||
bb11:
|
||||
predecessor blocks: bb5
|
||||
[18] Const mutate $45_@0[3:33] = Call mutate seen$33_@0.has(mutate item$40_@0:TPrimitive)
|
||||
[19] Reassign mutate $46_@0[3:33] = read $45_@0
|
||||
[19] Goto bb9
|
||||
bb9:
|
||||
predecessor blocks: bb10 bb11
|
||||
[20] If (read $46_@0) then:bb7 else:bb6 fallthrough=bb6
|
||||
bb7:
|
||||
predecessor blocks: bb9
|
||||
[21] Goto(Continue) bb4
|
||||
bb6:
|
||||
predecessor blocks: bb9
|
||||
[22] Call mutate seen$33_@0.add(mutate item$40_@0:TPrimitive)
|
||||
[23] Const mutate $49:TPrimitive = "div"
|
||||
[24] Const mutate $50_@4 = JSX <read $49:TPrimitive>{freeze item$40_@0:TPrimitive}</read $49:TPrimitive>
|
||||
[25] Call mutate renderedItems$32_@0.push(read $50_@4)
|
||||
[26] Const mutate $55:TPrimitive = Binary read renderedItems$32_@0.length >= read max$35_@2:TPrimitive
|
||||
[27] If (read $55:TPrimitive) then:bb2 else:bb12 fallthrough=bb12
|
||||
bb12:
|
||||
predecessor blocks: bb6
|
||||
[28] Goto(Continue) bb4
|
||||
bb4:
|
||||
predecessor blocks: bb7 bb12
|
||||
[29] Const mutate $56:TPrimitive = 1
|
||||
[30] Reassign mutate i$36_@0:TPrimitive[3:33] = Binary read i$36_@0:TPrimitive + read $56:TPrimitive
|
||||
[31] read i$36_@0:TPrimitive
|
||||
[32] Goto bb1
|
||||
bb2:
|
||||
predecessor blocks: bb6 bb1
|
||||
[33] Const mutate count$66 = read renderedItems$32_@0.length
|
||||
[34] Const mutate $67:TPrimitive = "div"
|
||||
[35] Const mutate $68:TPrimitive = "\n "
|
||||
[36] Const mutate $69:TPrimitive = "h1"
|
||||
[37] Const mutate $70:TPrimitive = " Items"
|
||||
[38] Const mutate t7$71_@5 = JSX <read $69:TPrimitive>{freeze count$66}{read $70:TPrimitive}</read $69:TPrimitive>
|
||||
[39] Const mutate $72:TPrimitive = "\n "
|
||||
[40] Const mutate $73:TPrimitive = "\n "
|
||||
[41] Const mutate t10$74_@6 = JSX <read $67:TPrimitive>{read $68:TPrimitive}{read t7$71_@5}{read $72:TPrimitive}{freeze renderedItems$32_@0}{read $73:TPrimitive}</read $67:TPrimitive>
|
||||
[42] Return read t10$74_@6
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate items$30 = read props$29.items
|
||||
[2] Const mutate maxItems$31 = read props$29.maxItems
|
||||
scope @0 [3:33] deps=[read maxItems$31, read items$30.length, read items$30] out=[renderedItems$32_@0] {
|
||||
[3] Const mutate renderedItems$32_@0[3:33] = Array []
|
||||
[4] Const mutate seen$33_@0[3:33] = New mutate Set$5()
|
||||
[5] Const mutate $34:TPrimitive = 0
|
||||
scope @2 [6:7] deps=[read maxItems$31] out=[max$35_@2] {
|
||||
[6] Const mutate max$35_@2:TPrimitive = Call mutate Math$7.max(read $34:TPrimitive, read maxItems$31)
|
||||
}
|
||||
for (
|
||||
[8] Let mutate i$36_@0:TPrimitive[3:33] = 0
|
||||
;
|
||||
[10] Const mutate $39:TPrimitive = Binary read i$36_@0:TPrimitive < read items$30.length
|
||||
read $39:TPrimitive
|
||||
;
|
||||
[29] Const mutate $56:TPrimitive = 1
|
||||
[30] Reassign mutate i$36_@0:TPrimitive[3:33] = Binary read i$36_@0:TPrimitive + read $56:TPrimitive
|
||||
read i$36_@0:TPrimitive
|
||||
) {
|
||||
[12] Const mutate item$40_@0:TPrimitive[3:33] = Call read items$30.at(read i$36_@0:TPrimitive)
|
||||
[13] Const mutate $41:TPrimitive = null
|
||||
[14] Const mutate $42:TPrimitive = Binary read item$40_@0:TPrimitive == read $41:TPrimitive
|
||||
[15] Let mutate $46_@0[3:33] = undefined
|
||||
if (read $42:TPrimitive) {
|
||||
[16] Const mutate $43:TPrimitive = read $42:TPrimitive
|
||||
[17] Reassign mutate $46_@0[3:33] = read $43:TPrimitive
|
||||
} else {
|
||||
[18] Const mutate $45_@0[3:33] = Call mutate seen$33_@0.has(mutate item$40_@0:TPrimitive)
|
||||
[19] Reassign mutate $46_@0[3:33] = read $45_@0
|
||||
}
|
||||
if (read $46_@0) {
|
||||
continue
|
||||
}
|
||||
[22] Call mutate seen$33_@0.add(mutate item$40_@0:TPrimitive)
|
||||
[23] Const mutate $49:TPrimitive = "div"
|
||||
[24] Const mutate $50_@4 = JSX <read $49:TPrimitive>{freeze item$40_@0:TPrimitive}</read $49:TPrimitive>
|
||||
[25] Call mutate renderedItems$32_@0.push(read $50_@4)
|
||||
[26] Const mutate $55:TPrimitive = Binary read renderedItems$32_@0.length >= read max$35_@2:TPrimitive
|
||||
if (read $55:TPrimitive) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
[33] Const mutate count$66 = read renderedItems$32_@0.length
|
||||
[34] Const mutate $67:TPrimitive = "div"
|
||||
[35] Const mutate $68:TPrimitive = "\n "
|
||||
[36] Const mutate $69:TPrimitive = "h1"
|
||||
[37] Const mutate $70:TPrimitive = " Items"
|
||||
scope @5 [38:39] deps=[freeze count$66] out=[$71_@5] {
|
||||
[38] Const mutate $71_@5 = JSX <read $69:TPrimitive>{freeze count$66}{read $70:TPrimitive}</read $69:TPrimitive>
|
||||
}
|
||||
[39] Const mutate $72:TPrimitive = "\n "
|
||||
[40] Const mutate $73:TPrimitive = "\n "
|
||||
scope @6 [41:42] deps=[read $71_@5, freeze renderedItems$32_@0] out=[$74_@6] {
|
||||
[41] Const mutate $74_@6 = JSX <read $67:TPrimitive>{read $68:TPrimitive}{read $71_@5}{read $72:TPrimitive}{freeze renderedItems$32_@0}{read $73:TPrimitive}</read $67:TPrimitive>
|
||||
}
|
||||
return read $74_@6
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -74,43 +74,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a_DEBUG$5_@0[1:7] = Array []
|
||||
[2] Call mutate a_DEBUG$5_@0.push(read props$4.a)
|
||||
[3] If (read props$4.b) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Const mutate $6:TPrimitive = null
|
||||
[5] Return read $6:TPrimitive
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[6] Call mutate a_DEBUG$5_@0.push(read props$4.d)
|
||||
[7] Return freeze a_DEBUG$5_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:7] deps=[read props$4.a, read props$4.b, read props$4.d] out=[a_DEBUG$5_@0] {
|
||||
[1] Const mutate a_DEBUG$5_@0[1:7] = Array []
|
||||
[2] Call mutate a_DEBUG$5_@0.push(read props$4.a)
|
||||
if (read props$4.b) {
|
||||
[4] Const mutate $6:TPrimitive = null
|
||||
return read $6:TPrimitive
|
||||
}
|
||||
[6] Call mutate a_DEBUG$5_@0.push(read props$4.d)
|
||||
}
|
||||
return freeze a_DEBUG$5_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -141,42 +104,6 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
[3] If (read props$3.b) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
[5] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
[7] Return freeze a$4_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:7] deps=[read props$3.a, read props$3.b, read props$3.c, read props$3.d] out=[a$4_@0] {
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
if (read props$3.b) {
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
}
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
}
|
||||
return freeze a$4_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -209,45 +136,6 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$5_@0[1:8] = Array []
|
||||
[2] Call mutate a$5_@0.push(read props$4.a)
|
||||
[3] If (read props$4.b) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate a$5_@0.push(read props$4.c)
|
||||
[5] Const mutate $6:TPrimitive = null
|
||||
[6] Return read $6:TPrimitive
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[7] Call mutate a$5_@0.push(read props$4.d)
|
||||
[8] Return freeze a$5_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:8] deps=[read props$4.a, read props$4.b, read props$4.c, read props$4.d] out=[a$5_@0] {
|
||||
[1] Const mutate a$5_@0[1:8] = Array []
|
||||
[2] Call mutate a$5_@0.push(read props$4.a)
|
||||
if (read props$4.b) {
|
||||
[4] Call mutate a$5_@0.push(read props$4.c)
|
||||
[5] Const mutate $6:TPrimitive = null
|
||||
return read $6:TPrimitive
|
||||
}
|
||||
[7] Call mutate a$5_@0.push(read props$4.d)
|
||||
}
|
||||
return freeze a$5_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -281,43 +169,6 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
[3] If (read props$3.b) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
[5] Return freeze a$4_@0
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
[7] Return freeze a$4_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:7] deps=[read props$3.a, read props$3.b, read props$3.c, read props$3.d] out=[a$4_@0] {
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
if (read props$3.b) {
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
return freeze a$4_@0
|
||||
}
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
}
|
||||
return freeze a$4_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -351,40 +202,6 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
[3] If (read props$3.b) then:bb1 else:bb2 fallthrough=bb2
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
[5] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb2
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
[7] Return freeze a$4_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate a$4_@0[1:7] = Array []
|
||||
[2] Call mutate a$4_@0.push(read props$3.a)
|
||||
if (read props$3.b) {
|
||||
[6] Call mutate a$4_@0.push(read props$3.d)
|
||||
return freeze a$4_@0
|
||||
}
|
||||
[4] Call mutate a$4_@0.push(read props$3.c)
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -31,54 +31,6 @@ function mayMutate() {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$7_@0[1:9] = Array []
|
||||
[2] Const mutate b$8_@0[1:9] = Array []
|
||||
[3] If (read b$8_@0) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate a$7_@0.push(read props$6.p0)
|
||||
[5] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[6] If (read props$6.p1) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb1
|
||||
[7] Call mutate b$8_@0.push(read props$6.p2)
|
||||
[8] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb1
|
||||
[9] Const mutate t6$16_@2 = JSX <read Foo$4 a={freeze a$7_@0} b={freeze b$8_@0} ></read Foo$4>
|
||||
[10] Return read t6$16_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:9] deps=[read props$6.p0, read props$6.p1, read props$6.p2] out=[a$7_@0] {
|
||||
[1] Const mutate a$7_@0[1:9] = Array []
|
||||
[2] Const mutate b$8_@0[1:9] = Array []
|
||||
if (read b$8_@0) {
|
||||
[4] Call mutate a$7_@0.push(read props$6.p0)
|
||||
}
|
||||
if (read props$6.p1) {
|
||||
[7] Call mutate b$8_@0.push(read props$6.p2)
|
||||
}
|
||||
}
|
||||
scope @2 [9:10] deps=[freeze a$7_@0, freeze b$8_@0] out=[$16_@2] {
|
||||
[9] Const mutate $16_@2 = JSX <read Foo$4 a={freeze a$7_@0} b={freeze b$8_@0} ></read Foo$4>
|
||||
}
|
||||
return read $16_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -125,56 +77,6 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$9_@0[1:10] = Array []
|
||||
[2] Const mutate b$10_@0[1:10] = Array []
|
||||
[3] Const mutate $11_@0[1:10] = Call mutate mayMutate$4:TFunction(mutate b$10_@0)
|
||||
[4] If (read $11_@0) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Call mutate a$9_@0.push(read props$8.p0)
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] If (read props$8.p1) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb1
|
||||
[8] Call mutate b$10_@0.push(read props$8.p2)
|
||||
[9] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb1
|
||||
[10] Const mutate t6$19_@2 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
|
||||
[11] Return read t6$19_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:10] deps=[read props$8.p0, read props$8.p1, read props$8.p2] out=[a$9_@0] {
|
||||
[1] Const mutate a$9_@0[1:10] = Array []
|
||||
[2] Const mutate b$10_@0[1:10] = Array []
|
||||
[3] Const mutate $11_@0[1:10] = Call mutate mayMutate$4:TFunction(mutate b$10_@0)
|
||||
if (read $11_@0) {
|
||||
[5] Call mutate a$9_@0.push(read props$8.p0)
|
||||
}
|
||||
if (read props$8.p1) {
|
||||
[8] Call mutate b$10_@0.push(read props$8.p2)
|
||||
}
|
||||
}
|
||||
scope @2 [10:11] deps=[freeze a$9_@0, freeze b$10_@0] out=[$19_@2] {
|
||||
[10] Const mutate $19_@2 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
|
||||
}
|
||||
return read $19_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -221,46 +123,12 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function Foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function mayMutate(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,67 +15,12 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function Foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$10_@0[1:7] = Array []
|
||||
[2] Const mutate b$11_@0:TObject[1:7] = Object { }
|
||||
[3] New mutate Foo$4(mutate a$10_@0, mutate b$11_@0:TObject)
|
||||
[4] Const mutate $12:TPrimitive = "div"
|
||||
[5] Const mutate _$13_@1 = JSX <read $12:TPrimitive a={freeze a$10_@0} ></read $12:TPrimitive>
|
||||
[6] New mutate Foo$4(mutate b$11_@0:TObject)
|
||||
[7] Const mutate $14:TPrimitive = "div"
|
||||
[8] Const mutate t4$15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
|
||||
[9] Return read t4$15_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:7] deps=[] out=[a$10_@0, b$11_@0] {
|
||||
[1] Const mutate a$10_@0[1:7] = Array []
|
||||
[2] Const mutate b$11_@0:TObject[1:7] = Object { }
|
||||
[3] New mutate Foo$4(mutate a$10_@0, mutate b$11_@0:TObject)
|
||||
[4] Const mutate $12:TPrimitive = "div"
|
||||
[5] Const mutate _$13_@1 = JSX <read $12:TPrimitive a={freeze a$10_@0} ></read $12:TPrimitive>
|
||||
[6] New mutate Foo$4(mutate b$11_@0:TObject)
|
||||
}
|
||||
[7] Const mutate $14:TPrimitive = "div"
|
||||
scope @2 [8:9] deps=[read a$10_@0, freeze b$11_@0:TObject] out=[$15_@2] {
|
||||
[8] Const mutate $15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
|
||||
}
|
||||
return read $15_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -18,57 +18,6 @@ function foo(a, b) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$8_@0[1:3] = Array []
|
||||
[2] Call mutate x$8_@0.push(read a$6)
|
||||
[3] Const mutate $9:TPrimitive = "div"
|
||||
[4] JSX <read $9:TPrimitive>{freeze x$8_@0}</read $9:TPrimitive>
|
||||
[5] Const mutate y$10_@1[5:12] = Array []
|
||||
[6] If (read x$8_@0.length) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[7] Call mutate y$10_@1.push(read x$8_@0)
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[9] If (read b$7) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb1
|
||||
[10] Call mutate y$10_@1.push(read b$7)
|
||||
[11] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb1
|
||||
[12] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
) {
|
||||
scope @0 [1:3] deps=[read a$6] out=[x$8_@0] {
|
||||
[1] Const mutate x$8_@0[1:3] = Array []
|
||||
[2] Call mutate x$8_@0.push(read a$6)
|
||||
}
|
||||
[3] Const mutate $9:TPrimitive = "div"
|
||||
[4] JSX <read $9:TPrimitive>{freeze x$8_@0}</read $9:TPrimitive>
|
||||
[5] Const mutate y$10_@1[5:12] = Array []
|
||||
if (read x$8_@0.length) {
|
||||
[7] Call mutate y$10_@1.push(read x$8_@0)
|
||||
}
|
||||
if (read b$7) {
|
||||
[10] Call mutate y$10_@1.push(read b$7)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -20,54 +20,6 @@ function foo(x, y, z) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate items$9_@0[1:10] = Array [read z$8]
|
||||
[2] Call mutate items$9_@0.push(read x$6)
|
||||
[3] Const mutate items2$10_@1[3:7] = Array []
|
||||
[4] If (read x$6) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Call mutate items2$10_@1.push(read y$7)
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] If (read y$7) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb1
|
||||
[8] Call mutate items$9_@0.push(read x$6)
|
||||
[9] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb1
|
||||
[10] Return freeze items2$10_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
) {
|
||||
[1] Const mutate items$9_@0[1:10] = Array [read z$8]
|
||||
[2] Call mutate items$9_@0.push(read x$6)
|
||||
scope @1 [3:7] deps=[read x$6, read y$7] out=[items2$10_@1] {
|
||||
[3] Const mutate items2$10_@1[3:7] = Array []
|
||||
if (read x$6) {
|
||||
[5] Call mutate items2$10_@1.push(read y$7)
|
||||
}
|
||||
}
|
||||
if (read y$7) {
|
||||
[8] Call mutate items$9_@0.push(read x$6)
|
||||
}
|
||||
return freeze items2$10_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -19,61 +19,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$10_@0[1:8] = Array []
|
||||
[2] If (read a$7) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] If (read b$8) then:bb4 else:bb1 fallthrough=bb1
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[4] If (read c$9) then:bb6 else:bb1 fallthrough=bb1
|
||||
bb6:
|
||||
predecessor blocks: bb4
|
||||
[5] Const mutate $11:TPrimitive = 0
|
||||
[6] Call mutate x$10_@0.push(read $11:TPrimitive)
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb6 bb4 bb2 bb0
|
||||
[8] If (read a$7.length) then:bb8 else:bb7 fallthrough=bb7
|
||||
bb8:
|
||||
predecessor blocks: bb1
|
||||
[9] Return read a$7
|
||||
bb7:
|
||||
predecessor blocks: bb1
|
||||
[10] Const mutate $13:TPrimitive = null
|
||||
[11] Return read $13:TPrimitive
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
[1] Const mutate x$10_@0[1:8] = Array []
|
||||
if (read a$7) {
|
||||
if (read b$8) {
|
||||
if (read c$9) {
|
||||
[5] Const mutate $11:TPrimitive = 0
|
||||
[6] Call mutate x$10_@0.push(read $11:TPrimitive)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (read a$7.length) {
|
||||
return read a$7
|
||||
}
|
||||
[10] Const mutate $13:TPrimitive = null
|
||||
return read $13:TPrimitive
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -14,33 +14,6 @@ function foo(x) {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$5_@0 = Array []
|
||||
[2] Const mutate b$6 = read a$5_@0
|
||||
[3] Call read useFreeze$3:TFunction(freeze a$5_@0)
|
||||
[4] Call mutate foo$4:TFunction(read b$6)
|
||||
[5] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[a$5_@0] {
|
||||
[1] Const mutate a$5_@0 = Array []
|
||||
}
|
||||
[2] Const mutate b$6 = read a$5_@0
|
||||
[3] Call read useFreeze$3:TFunction(freeze a$5_@0)
|
||||
[4] Call mutate foo$4:TFunction(read b$6)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -60,47 +33,12 @@ function Component() {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function useFreeze(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function useFreeze() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
x,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -19,90 +19,18 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function useFreeze(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function useFreeze() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$11_@0 = Array []
|
||||
[2] Const mutate y$12_@1 = Call read useFreeze$3:TFunction(freeze x$11_@0)
|
||||
[3] Call mutate foo$5:TFunction(read y$12_@1, read x$11_@0)
|
||||
[4] Const mutate $13:TPrimitive = "\n "
|
||||
[5] Const mutate $14:TPrimitive = "\n "
|
||||
[6] Const mutate $15:TPrimitive = "\n "
|
||||
[7] Const mutate t5$16_@2 = JSX <read Component$0>{read $13:TPrimitive}{read x$11_@0}{read $14:TPrimitive}{read y$12_@1}{read $15:TPrimitive}</read Component$0>
|
||||
[8] Return read t5$16_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[x$11_@0] {
|
||||
[1] Const mutate x$11_@0 = Array []
|
||||
}
|
||||
scope @1 [2:3] deps=[freeze x$11_@0] out=[y$12_@1] {
|
||||
[2] Const mutate y$12_@1 = Call read useFreeze$3:TFunction(freeze x$11_@0)
|
||||
}
|
||||
[3] Call mutate foo$5:TFunction(read y$12_@1, read x$11_@0)
|
||||
[4] Const mutate $13:TPrimitive = "\n "
|
||||
[5] Const mutate $14:TPrimitive = "\n "
|
||||
[6] Const mutate $15:TPrimitive = "\n "
|
||||
scope @2 [7:8] deps=[read x$11_@0, read y$12_@1] out=[$16_@2] {
|
||||
[7] Const mutate $16_@2 = JSX <read Component$0>{read $13:TPrimitive}{read x$11_@0}{read $14:TPrimitive}{read y$12_@1}{read $15:TPrimitive}</read Component$0>
|
||||
}
|
||||
return read $16_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,33 +15,6 @@ function call(x) {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$4_@0 = Array []
|
||||
[2] Call read useFreeze$2:TFunction(freeze a$4_@0)
|
||||
[3] Call read useFreeze$2:TFunction(read a$4_@0)
|
||||
[4] Call mutate call$3:TFunction(read a$4_@0)
|
||||
[5] Return read a$4_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[a$4_@0] {
|
||||
[1] Const mutate a$4_@0 = Array []
|
||||
}
|
||||
[2] Call read useFreeze$2:TFunction(freeze a$4_@0)
|
||||
[3] Call read useFreeze$2:TFunction(read a$4_@0)
|
||||
[4] Call mutate call$3:TFunction(read a$4_@0)
|
||||
return read a$4_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -62,48 +35,12 @@ function Component() {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function useFreeze(
|
||||
x,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function useFreeze(x) {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function call(
|
||||
x,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
-92
@@ -22,62 +22,6 @@ function call(x) {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate cond$8 = read props$7.cond
|
||||
[2] Const mutate x$9 = read props$7.x
|
||||
[3] Const mutate a$10:TPrimitive = undefined
|
||||
[4] Let mutate a$0$14_@0[4:9] = undefined
|
||||
[4] If (read cond$8) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate a$1$11 = read x$9
|
||||
[6] Reassign mutate a$0$14_@0[4:9] = read a$1$11
|
||||
[6] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[7] Const mutate a$2$12_@1 = Array []
|
||||
[8] Reassign mutate a$0$14_@0[4:9] = read a$2$12_@1
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[9] Call read useFreeze$5:TFunction(freeze a$0$14_@0)
|
||||
[10] Call read useFreeze$5:TFunction(read a$0$14_@0)
|
||||
[11] Call mutate call$6:TFunction(read a$0$14_@0)
|
||||
[12] Return read a$0$14_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate cond$8 = read props$7.cond
|
||||
[2] Const mutate x$9 = read props$7.x
|
||||
[3] Const mutate a$10:TPrimitive = undefined
|
||||
scope @0 [4:9] deps=[read cond$8, read x$9] out=[a$0$14_@0] {
|
||||
[4] Let mutate a$0$14_@0[4:9] = undefined
|
||||
if (read cond$8) {
|
||||
[5] Const mutate a$1$11 = read x$9
|
||||
[6] Reassign mutate a$0$14_@0[4:9] = read a$1$11
|
||||
} else {
|
||||
scope @1 [7:8] deps=[] out=[a$2$12_@1] {
|
||||
[7] Const mutate a$2$12_@1 = Array []
|
||||
}
|
||||
[8] Reassign mutate a$0$14_@0[4:9] = read a$2$12_@1
|
||||
}
|
||||
}
|
||||
[9] Call read useFreeze$5:TFunction(freeze a$0$14_@0)
|
||||
[10] Call read useFreeze$5:TFunction(read a$0$14_@0)
|
||||
[11] Call mutate call$6:TFunction(read a$0$14_@0)
|
||||
return read a$0$14_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -122,48 +66,12 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function useFreeze(
|
||||
x,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function useFreeze(x) {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function call(
|
||||
x,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -33,138 +33,30 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function compute(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function compute() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function mutate(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function mutate() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function Foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$9_@1[1:7] = Call mutate compute$2:TFunction(read props$8.a)
|
||||
[2] Const mutate b$10_@1[1:7] = Call mutate compute$2:TFunction(read props$8.b)
|
||||
[3] If (read props$8.c) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate mutate$5:TFunction(mutate a$9_@1)
|
||||
[5] Call mutate mutate$5:TFunction(mutate b$10_@1)
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] Const mutate t6$14_@2 = JSX <read Foo$6 a={freeze a$9_@1} b={freeze b$10_@1} ></read Foo$6>
|
||||
[8] Return read t6$14_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @1 [1:7] deps=[read props$8.a, read props$8.b, read props$8.c] out=[a$9_@1] {
|
||||
[1] Const mutate a$9_@1[1:7] = Call mutate compute$2:TFunction(read props$8.a)
|
||||
[2] Const mutate b$10_@1[1:7] = Call mutate compute$2:TFunction(read props$8.b)
|
||||
if (read props$8.c) {
|
||||
[4] Call mutate mutate$5:TFunction(mutate a$9_@1)
|
||||
[5] Call mutate mutate$5:TFunction(mutate b$10_@1)
|
||||
}
|
||||
}
|
||||
scope @2 [7:8] deps=[freeze a$9_@1, freeze b$10_@1] out=[$14_@2] {
|
||||
[7] Const mutate $14_@2 = JSX <read Foo$6 a={freeze a$9_@1} b={freeze b$10_@1} ></read Foo$6>
|
||||
}
|
||||
return read $14_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -24,36 +24,6 @@ function Foo() {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$8_@0 = Call mutate compute$2:TFunction(read props$7.a)
|
||||
[2] Const mutate b$9_@1 = Call mutate compute$2:TFunction(read props$7.b)
|
||||
[3] Const mutate t6$10_@2 = JSX <read Foo$5 a={freeze a$8_@0} b={freeze b$9_@1} ></read Foo$5>
|
||||
[4] Return read t6$10_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:2] deps=[read props$7.a] out=[a$8_@0] {
|
||||
[1] Const mutate a$8_@0 = Call mutate compute$2:TFunction(read props$7.a)
|
||||
}
|
||||
scope @1 [2:3] deps=[read props$7.b] out=[b$9_@1] {
|
||||
[2] Const mutate b$9_@1 = Call mutate compute$2:TFunction(read props$7.b)
|
||||
}
|
||||
scope @2 [3:4] deps=[freeze a$8_@0, freeze b$9_@1] out=[$10_@2] {
|
||||
[3] Const mutate $10_@2 = JSX <read Foo$5 a={freeze a$8_@0} b={freeze b$9_@1} ></read Foo$5>
|
||||
}
|
||||
return read $10_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -97,69 +67,18 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function compute(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function compute() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
-30
@@ -12,36 +12,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$9_@0:TObject[1:4] = Object { a: read a$6 }
|
||||
[2] Const mutate t6$10_@1 = Array [read b$7, read c$8]
|
||||
[3] Reassign store x$9_@0.y[1:4] = read t6$10_@1
|
||||
[4] Return freeze x$9_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
scope @0 [1:4] deps=[read a$6, read b$7, read c$8] out=[x$9_@0] {
|
||||
[1] Const mutate x$9_@0:TObject[1:4] = Object { a: read a$6 }
|
||||
scope @1 [2:3] deps=[read b$7, read c$8] out=[$10_@1] {
|
||||
[2] Const mutate $10_@1 = Array [read b$7, read c$8]
|
||||
}
|
||||
[3] Reassign store x$9_@0.y[1:4] = read $10_@1
|
||||
}
|
||||
return freeze x$9_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -27,113 +27,24 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function compute(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function compute() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function Foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$9_@0[1:6] = Call mutate compute$2:TFunction(read props$8.a)
|
||||
[2] Const mutate b$10_@0[1:6] = Call mutate compute$2:TFunction(read props$8.b)
|
||||
[3] If (read props$8.c) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate foo$5:TFunction(mutate a$9_@0, mutate b$10_@0)
|
||||
[5] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[6] Const mutate t7$14_@1 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
|
||||
[7] Return read t7$14_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:6] deps=[read props$8.a, read props$8.b, read props$8.c] out=[a$9_@0, b$10_@0] {
|
||||
[1] Const mutate a$9_@0[1:6] = Call mutate compute$2:TFunction(read props$8.a)
|
||||
[2] Const mutate b$10_@0[1:6] = Call mutate compute$2:TFunction(read props$8.b)
|
||||
if (read props$8.c) {
|
||||
[4] Call mutate foo$5:TFunction(mutate a$9_@0, mutate b$10_@0)
|
||||
}
|
||||
}
|
||||
scope @1 [6:7] deps=[freeze a$9_@0, freeze b$10_@0] out=[$14_@1] {
|
||||
[6] Const mutate $14_@1 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
|
||||
}
|
||||
return read $14_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -24,36 +24,6 @@ function Foo() {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$9_@0[1:4] = Call mutate compute$2:TFunction(read props$8.a)
|
||||
[2] Const mutate b$10_@0[1:4] = Call mutate compute$2:TFunction(read props$8.b)
|
||||
[3] Call mutate foo$5:TFunction(mutate a$9_@0, mutate b$10_@0)
|
||||
[4] Const mutate t6$11_@1 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
|
||||
[5] Return read t6$11_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:4] deps=[read props$8.a, read props$8.b] out=[a$9_@0, b$10_@0] {
|
||||
[1] Const mutate a$9_@0[1:4] = Call mutate compute$2:TFunction(read props$8.a)
|
||||
[2] Const mutate b$10_@0[1:4] = Call mutate compute$2:TFunction(read props$8.b)
|
||||
[3] Call mutate foo$5:TFunction(mutate a$9_@0, mutate b$10_@0)
|
||||
}
|
||||
scope @1 [4:5] deps=[freeze a$9_@0, freeze b$10_@0] out=[$11_@1] {
|
||||
[4] Const mutate $11_@1 = JSX <read Foo$6 a={freeze a$9_@0} b={freeze b$10_@0} ></read Foo$6>
|
||||
}
|
||||
return read $11_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -93,69 +63,18 @@ function Component(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function compute(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function compute() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -14,43 +14,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate y$8_@0[1:6] = Array []
|
||||
[2] If (read a$5) then:bb3 else:bb1 fallthrough=bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[3] If (read b$6) then:bb5 else:bb1 fallthrough=bb1
|
||||
bb5:
|
||||
predecessor blocks: bb3
|
||||
[4] Call mutate y$8_@0.push(read c$7)
|
||||
[5] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb5 bb3 bb0
|
||||
[6] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
[1] Const mutate y$8_@0[1:6] = Array []
|
||||
if (read a$5) {
|
||||
if (read b$6) {
|
||||
[4] Call mutate y$8_@0.push(read c$7)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,34 +11,6 @@ function Component(c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0:TObject[1:3] = Object { c: read c$6 }
|
||||
[2] Call mutate mutate$3:TFunction(mutate x$7_@0:TObject)
|
||||
[3] Const mutate a$8:TObject = read x$7_@0:TObject
|
||||
[4] Const mutate b$9:TObject = read a$8:TObject
|
||||
[5] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
c,
|
||||
) {
|
||||
scope @0 [1:3] deps=[read c$6] out=[x$7_@0] {
|
||||
[1] Const mutate x$7_@0:TObject[1:3] = Object { c: read c$6 }
|
||||
[2] Call mutate mutate$3:TFunction(mutate x$7_@0:TObject)
|
||||
}
|
||||
[3] Const mutate a$8:TObject = read x$7_@0:TObject
|
||||
[4] Const mutate b$9:TObject = read a$8:TObject
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,52 +15,6 @@ function Foo(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate $14:TPrimitive = "\n Hello "
|
||||
[2] Const mutate $15:TPrimitive = " "
|
||||
[3] Const mutate $16:TPrimitive = "\n "
|
||||
[4] Const mutate $17:TPrimitive = "div"
|
||||
[5] Const mutate $18:TPrimitive = "\n "
|
||||
[6] Const mutate $19:TPrimitive = "Text"
|
||||
[7] Const mutate t0$20_@0 = JsxFragment [read $19:TPrimitive]
|
||||
[8] Const mutate $21:TPrimitive = "\n "
|
||||
[9] Const mutate t2$22_@1 = JSX <read $17:TPrimitive>{read $18:TPrimitive}{read t0$20_@0}{read $21:TPrimitive}</read $17:TPrimitive>
|
||||
[10] Const mutate $23:TPrimitive = "\n "
|
||||
[11] Const mutate t5$24_@2 = JsxFragment [read $14:TPrimitive, read props$13.greeting, read $15:TPrimitive, read $16:TPrimitive, read t2$22_@1, read $23:TPrimitive]
|
||||
[12] Return read t5$24_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate $14:TPrimitive = "\n Hello "
|
||||
[2] Const mutate $15:TPrimitive = " "
|
||||
[3] Const mutate $16:TPrimitive = "\n "
|
||||
[4] Const mutate $17:TPrimitive = "div"
|
||||
[5] Const mutate $18:TPrimitive = "\n "
|
||||
[6] Const mutate $19:TPrimitive = "Text"
|
||||
scope @0 [7:8] deps=[] out=[$20_@0] {
|
||||
[7] Const mutate $20_@0 = JsxFragment [read $19:TPrimitive]
|
||||
}
|
||||
[8] Const mutate $21:TPrimitive = "\n "
|
||||
scope @1 [9:10] deps=[read $20_@0] out=[$22_@1] {
|
||||
[9] Const mutate $22_@1 = JSX <read $17:TPrimitive>{read $18:TPrimitive}{read $20_@0}{read $21:TPrimitive}</read $17:TPrimitive>
|
||||
}
|
||||
[10] Const mutate $23:TPrimitive = "\n "
|
||||
scope @2 [11:12] deps=[read props$13.greeting, read $22_@1] out=[$24_@2] {
|
||||
[11] Const mutate $24_@2 = JsxFragment [read $14:TPrimitive, read props$13.greeting, read $15:TPrimitive, read $16:TPrimitive, read $22_@1, read $23:TPrimitive]
|
||||
}
|
||||
return read $24_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -19,53 +19,6 @@ function g() {}
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate t0$5_@0 = Call mutate f$1:TFunction()
|
||||
[2] Let mutate t2$8_@1[2:7] = undefined
|
||||
[2] If (read t0$5_@0) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate t3$6_@2 = Call mutate g$4:TFunction()
|
||||
[4] Reassign mutate t2$8_@1[2:7] = read t3$6_@2
|
||||
[4] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate $7 = read t0$5_@0
|
||||
[6] Reassign mutate t2$8_@1[2:7] = read $7
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[7] Return freeze t2$8_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function And(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[$5_@0] {
|
||||
[1] Const mutate $5_@0 = Call mutate f$1:TFunction()
|
||||
}
|
||||
scope @1 [2:7] deps=[read $5_@0] out=[$8_@1] {
|
||||
[2] Let mutate $8_@1[2:7] = undefined
|
||||
if (read $5_@0) {
|
||||
scope @2 [3:4] deps=[] out=[$6_@2] {
|
||||
[3] Const mutate $6_@2 = Call mutate g$4:TFunction()
|
||||
}
|
||||
[4] Reassign mutate $8_@1[2:7] = read $6_@2
|
||||
} else {
|
||||
[5] Const mutate $7 = read $5_@0
|
||||
[6] Reassign mutate $8_@1[2:7] = read $7
|
||||
}
|
||||
}
|
||||
return freeze $8_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -110,53 +63,6 @@ function And() {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate t0$5_@0 = Call mutate f$1:TFunction()
|
||||
[2] Let mutate t2$8_@1[2:7] = undefined
|
||||
[2] If (read t0$5_@0) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate $6 = read t0$5_@0
|
||||
[4] Reassign mutate t2$8_@1[2:7] = read $6
|
||||
[4] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate t3$7_@2 = Call mutate g$4:TFunction()
|
||||
[6] Reassign mutate t2$8_@1[2:7] = read t3$7_@2
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[7] Return freeze t2$8_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Or(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[$5_@0] {
|
||||
[1] Const mutate $5_@0 = Call mutate f$1:TFunction()
|
||||
}
|
||||
scope @1 [2:7] deps=[read $5_@0] out=[$8_@1] {
|
||||
[2] Let mutate $8_@1[2:7] = undefined
|
||||
if (read $5_@0) {
|
||||
[3] Const mutate $6 = read $5_@0
|
||||
[4] Reassign mutate $8_@1[2:7] = read $6
|
||||
} else {
|
||||
scope @2 [5:6] deps=[] out=[$7_@2] {
|
||||
[5] Const mutate $7_@2 = Call mutate g$4:TFunction()
|
||||
}
|
||||
[6] Reassign mutate $8_@1[2:7] = read $7_@2
|
||||
}
|
||||
}
|
||||
return freeze $8_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -201,58 +107,6 @@ function Or() {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate t0$9_@0:TPrimitive = Call mutate f$2:TFunction()
|
||||
[2] Const mutate $10:TPrimitive = null
|
||||
[3] Const mutate $11:TPrimitive = Binary read t0$9_@0:TPrimitive != read $10:TPrimitive
|
||||
[4] Let mutate t2$14_@1[4:9] = undefined
|
||||
[4] If (read $11:TPrimitive) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate $12:TPrimitive = read t0$9_@0:TPrimitive
|
||||
[6] Reassign mutate t2$14_@1[4:9] = read $12:TPrimitive
|
||||
[6] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[7] Const mutate t3$13_@2 = Call mutate g$7:TFunction()
|
||||
[8] Reassign mutate t2$14_@1[4:9] = read t3$13_@2
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[9] Return freeze t2$14_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function QuestionQuestion(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[$9_@0] {
|
||||
[1] Const mutate $9_@0:TPrimitive = Call mutate f$2:TFunction()
|
||||
}
|
||||
[2] Const mutate $10:TPrimitive = null
|
||||
[3] Const mutate $11:TPrimitive = Binary read $9_@0:TPrimitive != read $10:TPrimitive
|
||||
scope @1 [4:9] deps=[read $9_@0:TPrimitive] out=[$14_@1] {
|
||||
[4] Let mutate $14_@1[4:9] = undefined
|
||||
if (read $11:TPrimitive) {
|
||||
[5] Const mutate $12:TPrimitive = read $9_@0:TPrimitive
|
||||
[6] Reassign mutate $14_@1[4:9] = read $12:TPrimitive
|
||||
} else {
|
||||
scope @2 [7:8] deps=[] out=[$13_@2] {
|
||||
[7] Const mutate $13_@2 = Call mutate g$7:TFunction()
|
||||
}
|
||||
[8] Reassign mutate $14_@1[4:9] = read $13_@2
|
||||
}
|
||||
}
|
||||
return freeze $14_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
@@ -297,46 +151,12 @@ function QuestionQuestion(props) {
|
||||
}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function f(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function f() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function g(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -39,156 +39,18 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function mutate(
|
||||
x,
|
||||
y,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function mutate(x, y) {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function cond(
|
||||
x,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function cond(x) {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Let mutate a$13_@0:TObject[1:23] = Object { }
|
||||
[2] Let mutate b$14_@0:TObject[1:23] = Object { }
|
||||
[3] Let mutate c$15_@0:TObject[1:23] = Object { }
|
||||
[4] Let mutate d$16_@0:TObject[1:23] = Object { }
|
||||
[5] Let mutate a$0$30_@0[1:23] = read a$13_@0:TObject
|
||||
[5] Let mutate b$1$31_@0[1:23] = read b$14_@0:TObject
|
||||
[5] Let mutate c$2$32_@0[1:23] = read c$15_@0:TObject
|
||||
[5] Let mutate d$3$33_@0[1:23] = read d$16_@0:TObject
|
||||
[5] While test=bb1 loop=bb3 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb4
|
||||
[6] Const mutate $17:TPrimitive = true
|
||||
[7] If (read $17:TPrimitive) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[8] Const mutate z$19_@0[1:23] = read a$13_@0:TObject
|
||||
[9] Reassign mutate a$13_@0:TObject[1:23] = read b$14_@0:TObject
|
||||
[10] Reassign mutate b$14_@0:TObject[1:23] = read c$15_@0:TObject
|
||||
[11] Reassign mutate c$15_@0:TObject[1:23] = read d$16_@0:TObject
|
||||
[12] Reassign mutate d$16_@0:TObject[1:23] = read z$19_@0
|
||||
[13] Call mutate mutate$7:TFunction(mutate a$13_@0:TObject, mutate b$14_@0:TObject)
|
||||
[14] Const mutate $29_@0[1:23] = Call mutate cond$8:TFunction(mutate a$13_@0:TObject)
|
||||
[15] Reassign mutate a$0$30_@0[1:23] = read a$13_@0:TObject
|
||||
[15] Reassign mutate b$1$31_@0[1:23] = read b$14_@0:TObject
|
||||
[15] Reassign mutate c$2$32_@0[1:23] = read c$15_@0:TObject
|
||||
[15] Reassign mutate d$3$33_@0[1:23] = read d$16_@0:TObject
|
||||
[15] If (read $29_@0) then:bb2 else:bb4 fallthrough=bb4
|
||||
bb4:
|
||||
predecessor blocks: bb3
|
||||
[16] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb3 bb1
|
||||
[17] If (read a$0$30_@0) then:bb7 else:bb7 fallthrough=bb7
|
||||
bb7:
|
||||
predecessor blocks: bb2
|
||||
[18] If (read b$1$31_@0) then:bb9 else:bb9 fallthrough=bb9
|
||||
bb9:
|
||||
predecessor blocks: bb7
|
||||
[19] If (read c$2$32_@0) then:bb11 else:bb11 fallthrough=bb11
|
||||
bb11:
|
||||
predecessor blocks: bb9
|
||||
[20] If (read d$3$33_@0) then:bb13 else:bb13 fallthrough=bb13
|
||||
bb13:
|
||||
predecessor blocks: bb11
|
||||
[21] Const mutate $34:TPrimitive = null
|
||||
[22] Call mutate mutate$7:TFunction(mutate d$3$33_@0, read $34:TPrimitive)
|
||||
[23] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Let mutate a$13_@0:TObject[1:23] = Object { }
|
||||
[2] Let mutate b$14_@0:TObject[1:23] = Object { }
|
||||
[3] Let mutate c$15_@0:TObject[1:23] = Object { }
|
||||
[4] Let mutate d$16_@0:TObject[1:23] = Object { }
|
||||
[5] Let mutate a$0$30_@0[1:23] = read a$13_@0:TObject
|
||||
[5] Let mutate b$1$31_@0[1:23] = read b$14_@0:TObject
|
||||
[5] Let mutate c$2$32_@0[1:23] = read c$15_@0:TObject
|
||||
[5] Let mutate d$3$33_@0[1:23] = read d$16_@0:TObject
|
||||
while (
|
||||
[6] Const mutate $17:TPrimitive = true
|
||||
read $17:TPrimitive
|
||||
) {
|
||||
[8] Const mutate z$19_@0[1:23] = read a$13_@0:TObject
|
||||
[9] Reassign mutate a$13_@0:TObject[1:23] = read b$14_@0:TObject
|
||||
[10] Reassign mutate b$14_@0:TObject[1:23] = read c$15_@0:TObject
|
||||
[11] Reassign mutate c$15_@0:TObject[1:23] = read d$16_@0:TObject
|
||||
[12] Reassign mutate d$16_@0:TObject[1:23] = read z$19_@0
|
||||
[13] Call mutate mutate$7:TFunction(mutate a$13_@0:TObject, mutate b$14_@0:TObject)
|
||||
[14] Const mutate $29_@0[1:23] = Call mutate cond$8:TFunction(mutate a$13_@0:TObject)
|
||||
[15] Reassign mutate a$0$30_@0[1:23] = read a$13_@0:TObject
|
||||
[15] Reassign mutate b$1$31_@0[1:23] = read b$14_@0:TObject
|
||||
[15] Reassign mutate c$2$32_@0[1:23] = read c$15_@0:TObject
|
||||
[15] Reassign mutate d$3$33_@0[1:23] = read d$16_@0:TObject
|
||||
if (read $29_@0) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (read a$0$30_@0) {
|
||||
}
|
||||
if (read b$1$31_@0) {
|
||||
}
|
||||
if (read c$2$32_@0) {
|
||||
}
|
||||
if (read d$3$33_@0) {
|
||||
}
|
||||
[21] Const mutate $34:TPrimitive = null
|
||||
[22] Call mutate mutate$7:TFunction(mutate d$3$33_@0, read $34:TPrimitive)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -35,96 +35,12 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function mutate(
|
||||
x,
|
||||
y,
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function mutate(x, y) {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$11_@0:TObject = Object { }
|
||||
[2] Const mutate b$12_@1[2:15] = Array [read a$11_@0:TObject]
|
||||
[3] Const mutate c$13_@2:TObject = Object { }
|
||||
[4] Const mutate d$14_@1:TObject[2:15] = Object { c: read c$13_@2:TObject }
|
||||
[5] Const mutate x$15_@1:TObject[2:15] = Object { }
|
||||
[6] Reassign store x$15_@1.b[2:15] = read b$12_@1
|
||||
[7] Const mutate y$16_@1[2:15] = Call mutate mutate$7:TFunction(mutate x$15_@1:TObject, mutate d$14_@1:TObject)
|
||||
[8] If (read a$11_@0:TObject) then:bb1 else:bb1 fallthrough=bb1
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[9] If (read b$12_@1) then:bb3 else:bb3 fallthrough=bb3
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[10] If (read c$13_@2:TObject) then:bb5 else:bb5 fallthrough=bb5
|
||||
bb5:
|
||||
predecessor blocks: bb3
|
||||
[11] If (read d$14_@1:TObject) then:bb7 else:bb7 fallthrough=bb7
|
||||
bb7:
|
||||
predecessor blocks: bb5
|
||||
[12] If (read y$16_@1) then:bb9 else:bb9 fallthrough=bb9
|
||||
bb9:
|
||||
predecessor blocks: bb7
|
||||
[13] Const mutate $17:TPrimitive = null
|
||||
[14] Call mutate mutate$7:TFunction(mutate x$15_@1:TObject, read $17:TPrimitive)
|
||||
[15] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[a$11_@0] {
|
||||
[1] Const mutate a$11_@0:TObject = Object { }
|
||||
}
|
||||
[2] Const mutate b$12_@1[2:15] = Array [read a$11_@0:TObject]
|
||||
scope @2 [3:4] deps=[] out=[c$13_@2] {
|
||||
[3] Const mutate c$13_@2:TObject = Object { }
|
||||
}
|
||||
[4] Const mutate d$14_@1:TObject[2:15] = Object { c: read c$13_@2:TObject }
|
||||
[5] Const mutate x$15_@1:TObject[2:15] = Object { }
|
||||
[6] Reassign store x$15_@1.b[2:15] = read b$12_@1
|
||||
[7] Const mutate y$16_@1[2:15] = Call mutate mutate$7:TFunction(mutate x$15_@1:TObject, mutate d$14_@1:TObject)
|
||||
if (read a$11_@0:TObject) {
|
||||
}
|
||||
if (read b$12_@1) {
|
||||
}
|
||||
if (read c$13_@2:TObject) {
|
||||
}
|
||||
if (read d$14_@1:TObject) {
|
||||
}
|
||||
if (read y$16_@1) {
|
||||
}
|
||||
[13] Const mutate $17:TPrimitive = null
|
||||
[14] Call mutate mutate$7:TFunction(mutate x$15_@1:TObject, read $17:TPrimitive)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -34,129 +34,18 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function mutate(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function mutate() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function cond(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function cond() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$12_@0:TObject[1:18] = Object { }
|
||||
[2] Const mutate b$13_@0:TObject[1:18] = Object { }
|
||||
[3] Const mutate c$14_@1:TObject = Object { }
|
||||
[4] Const mutate d$15_@0:TObject[1:18] = Object { }
|
||||
[5] While test=bb1 loop=bb3 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb4
|
||||
[6] Const mutate $16:TPrimitive = true
|
||||
[7] If (read $16:TPrimitive) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[8] Call mutate mutate$6:TFunction(mutate a$12_@0:TObject, mutate b$13_@0:TObject)
|
||||
[9] Const mutate $21_@0[1:18] = Call mutate cond$7:TFunction(mutate a$12_@0:TObject)
|
||||
[10] If (read $21_@0) then:bb2 else:bb4 fallthrough=bb4
|
||||
bb4:
|
||||
predecessor blocks: bb3
|
||||
[11] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb3 bb1
|
||||
[12] If (read a$12_@0:TObject) then:bb7 else:bb7 fallthrough=bb7
|
||||
bb7:
|
||||
predecessor blocks: bb2
|
||||
[13] If (read b$13_@0:TObject) then:bb9 else:bb9 fallthrough=bb9
|
||||
bb9:
|
||||
predecessor blocks: bb7
|
||||
[14] If (read c$14_@1:TObject) then:bb11 else:bb11 fallthrough=bb11
|
||||
bb11:
|
||||
predecessor blocks: bb9
|
||||
[15] If (read d$15_@0:TObject) then:bb13 else:bb13 fallthrough=bb13
|
||||
bb13:
|
||||
predecessor blocks: bb11
|
||||
[16] Const mutate $28:TPrimitive = null
|
||||
[17] Call mutate mutate$6:TFunction(mutate d$15_@0:TObject, read $28:TPrimitive)
|
||||
[18] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate a$12_@0:TObject[1:18] = Object { }
|
||||
[2] Const mutate b$13_@0:TObject[1:18] = Object { }
|
||||
scope @1 [3:4] deps=[] out=[c$14_@1] {
|
||||
[3] Const mutate c$14_@1:TObject = Object { }
|
||||
}
|
||||
[4] Const mutate d$15_@0:TObject[1:18] = Object { }
|
||||
while (
|
||||
[6] Const mutate $16:TPrimitive = true
|
||||
read $16:TPrimitive
|
||||
) {
|
||||
[8] Call mutate mutate$6:TFunction(mutate a$12_@0:TObject, mutate b$13_@0:TObject)
|
||||
[9] Const mutate $21_@0[1:18] = Call mutate cond$7:TFunction(mutate a$12_@0:TObject)
|
||||
if (read $21_@0) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (read a$12_@0:TObject) {
|
||||
}
|
||||
if (read b$13_@0:TObject) {
|
||||
}
|
||||
if (read c$14_@1:TObject) {
|
||||
}
|
||||
if (read d$15_@0:TObject) {
|
||||
}
|
||||
[16] Const mutate $28:TPrimitive = null
|
||||
[17] Call mutate mutate$6:TFunction(mutate d$15_@0:TObject, read $28:TPrimitive)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
## Input
|
||||
|
||||
```javascript
|
||||
function foo(a, b, c) {
|
||||
const x = a.x;
|
||||
const y = b.c.d;
|
||||
y.z = c.d.e;
|
||||
foo(a.b.c);
|
||||
[a.b.c];
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo(a, b, c) {
|
||||
const x = a.x;
|
||||
const y = b.c.d;
|
||||
y.z = c.d.e;
|
||||
foo(a.b.c);
|
||||
[a.b.c];
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
function foo(a, b, c) {
|
||||
const x = a.x;
|
||||
const y = b.c.d;
|
||||
y.z = c.d.e;
|
||||
foo(a.b.c);
|
||||
[a.b.c];
|
||||
}
|
||||
-33
@@ -15,39 +15,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$9_@0[1:6] = Array []
|
||||
[2] Const mutate y$10_@0[1:6] = Array []
|
||||
[3] If (read x$9_@0) then:bb1 else:bb1 fallthrough=bb1
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[4] Call mutate y$10_@0.push(read a$6)
|
||||
[5] Call mutate x$9_@0.push(read b$7)
|
||||
[6] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
[1] Const mutate x$9_@0[1:6] = Array []
|
||||
[2] Const mutate y$10_@0[1:6] = Array []
|
||||
if (read x$9_@0) {
|
||||
}
|
||||
[4] Call mutate y$10_@0.push(read a$6)
|
||||
[5] Call mutate x$9_@0.push(read b$7)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,33 +11,6 @@ function foo(a, b) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0[1:5] = Array []
|
||||
[2] Const mutate y$8_@0[1:5] = Array []
|
||||
[3] Call mutate x$7_@0.push(read a$5)
|
||||
[4] Call mutate y$8_@0.push(read b$6)
|
||||
[5] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
) {
|
||||
[1] Const mutate x$7_@0[1:5] = Array []
|
||||
[2] Const mutate y$8_@0[1:5] = Array []
|
||||
[3] Call mutate x$7_@0.push(read a$5)
|
||||
[4] Call mutate y$8_@0.push(read b$6)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,33 +11,6 @@ function foo(a, b) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0[1:5] = Array []
|
||||
[2] Const mutate y$8_@1[2:4] = Array []
|
||||
[3] Call mutate y$8_@1.push(read b$6)
|
||||
[4] Call mutate x$7_@0.push(read a$5)
|
||||
[5] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
) {
|
||||
[1] Const mutate x$7_@0[1:5] = Array []
|
||||
[2] Const mutate y$8_@1[2:4] = Array []
|
||||
[3] Call mutate y$8_@1.push(read b$6)
|
||||
[4] Call mutate x$7_@0.push(read a$5)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
-54
@@ -17,60 +17,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$11_@0[1:11] = Array []
|
||||
[2] If (read a$8) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate y$12_@1[3:7] = Array []
|
||||
[4] If (read b$9) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[5] Call mutate y$12_@1.push(read c$10)
|
||||
[6] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb2
|
||||
[7] Const mutate $13:TPrimitive = "div"
|
||||
[8] Const mutate t8$15_@2 = JSX <read $13:TPrimitive>{freeze y$12_@1}</read $13:TPrimitive>
|
||||
[9] Call mutate x$11_@0.push(read t8$15_@2)
|
||||
[10] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb0
|
||||
[11] Return freeze x$11_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
scope @0 [1:11] deps=[read a$8, read b$9, read c$10] out=[x$11_@0] {
|
||||
[1] Const mutate x$11_@0[1:11] = Array []
|
||||
if (read a$8) {
|
||||
scope @1 [3:7] deps=[read b$9, read c$10] out=[y$12_@1] {
|
||||
[3] Const mutate y$12_@1[3:7] = Array []
|
||||
if (read b$9) {
|
||||
[5] Call mutate y$12_@1.push(read c$10)
|
||||
}
|
||||
}
|
||||
[7] Const mutate $13:TPrimitive = "div"
|
||||
scope @2 [8:9] deps=[freeze y$12_@1] out=[$15_@2] {
|
||||
[8] Const mutate $15_@2 = JSX <read $13:TPrimitive>{freeze y$12_@1}</read $13:TPrimitive>
|
||||
}
|
||||
[9] Call mutate x$11_@0.push(read $15_@2)
|
||||
}
|
||||
}
|
||||
return freeze x$11_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,47 +13,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$9_@0[1:8] = Array []
|
||||
[2] Const mutate y$10_@0[1:8] = Array []
|
||||
[3] While test=bb1 loop=bb3 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb3
|
||||
[4] If (read c$8) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[5] Call mutate y$10_@0.push(read b$7)
|
||||
[6] Call mutate x$9_@0.push(read a$6)
|
||||
[7] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[8] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
[1] Const mutate x$9_@0[1:8] = Array []
|
||||
[2] Const mutate y$10_@0[1:8] = Array []
|
||||
while (
|
||||
read c$8
|
||||
) {
|
||||
[5] Call mutate y$10_@0.push(read b$7)
|
||||
[6] Call mutate x$9_@0.push(read a$6)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -17,52 +17,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$9_@0[1:9] = Array []
|
||||
[2] If (read a$6) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate y$10_@0[1:9] = Array []
|
||||
[4] If (read b$7) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[5] Call mutate y$10_@0.push(read c$8)
|
||||
[6] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb2
|
||||
[7] Call mutate x$9_@0.push(mutate y$10_@0)
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb0
|
||||
[9] Return freeze x$9_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
scope @0 [1:9] deps=[read a$6, read b$7, read c$8] out=[x$9_@0] {
|
||||
[1] Const mutate x$9_@0[1:9] = Array []
|
||||
if (read a$6) {
|
||||
[3] Const mutate y$10_@0[1:9] = Array []
|
||||
if (read b$7) {
|
||||
[5] Call mutate y$10_@0.push(read c$8)
|
||||
}
|
||||
[7] Call mutate x$9_@0.push(mutate y$10_@0)
|
||||
}
|
||||
}
|
||||
return freeze x$9_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,40 +13,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0:TObject[1:6] = Object { }
|
||||
[2] Const mutate y$8_@0[1:6] = Array []
|
||||
[3] Reassign store x$7_@0.y[1:6] = read y$8_@0
|
||||
[4] Const mutate child$9_@0[1:6] = JSX <read Component$0 data={freeze y$8_@0} ></read Component$0>
|
||||
[5] Call mutate x$7_@0.y.push(read props$6.p0)
|
||||
[6] Const mutate t5$10_@1 = JSX <read Component$0 data={freeze x$7_@0:TObject} >{read child$9_@0}</read Component$0>
|
||||
[7] Return read t5$10_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:6] deps=[read props$6.p0] out=[x$7_@0, child$9_@0] {
|
||||
[1] Const mutate x$7_@0:TObject[1:6] = Object { }
|
||||
[2] Const mutate y$8_@0[1:6] = Array []
|
||||
[3] Reassign store x$7_@0.y[1:6] = read y$8_@0
|
||||
[4] Const mutate child$9_@0[1:6] = JSX <read Component$0 data={freeze y$8_@0} ></read Component$0>
|
||||
[5] Call mutate x$7_@0.y.push(read props$6.p0)
|
||||
}
|
||||
scope @1 [6:7] deps=[freeze x$7_@0:TObject, read child$9_@0] out=[$10_@1] {
|
||||
[6] Const mutate $10_@1 = JSX <read Component$0 data={freeze x$7_@0:TObject} >{read child$9_@0}</read Component$0>
|
||||
}
|
||||
return read $10_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -14,37 +14,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4_@0:TObject[1:6] = Object { }
|
||||
[2] Const mutate y$5_@1[2:5] = Array []
|
||||
[3] Const mutate z$6_@1:TObject[2:5] = Object { }
|
||||
[4] Call mutate y$5_@1.push(mutate z$6_@1:TObject)
|
||||
[5] Reassign store x$4_@0.y[1:6] = read y$5_@1
|
||||
[6] Return freeze x$4_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:6] deps=[] out=[x$4_@0] {
|
||||
[1] Const mutate x$4_@0:TObject[1:6] = Object { }
|
||||
scope @1 [2:5] deps=[] out=[y$5_@1] {
|
||||
[2] Const mutate y$5_@1[2:5] = Array []
|
||||
[3] Const mutate z$6_@1:TObject[2:5] = Object { }
|
||||
[4] Call mutate y$5_@1.push(mutate z$6_@1:TObject)
|
||||
}
|
||||
[5] Reassign store x$4_@0.y[1:6] = read y$5_@1
|
||||
}
|
||||
return freeze x$4_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -16,58 +16,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$11_@0[1:11] = Array []
|
||||
[2] If (read a$8) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate y$12_@1[3:5] = Array []
|
||||
[4] Call mutate y$12_@1.push(read b$9)
|
||||
[5] Const mutate $13:TPrimitive = "div"
|
||||
[6] Const mutate t7$14_@2 = JSX <read $13:TPrimitive>{freeze y$12_@1}</read $13:TPrimitive>
|
||||
[7] Call mutate x$11_@0.push(read t7$14_@2)
|
||||
[8] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[9] Call mutate x$11_@0.push(read c$10)
|
||||
[10] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[11] Return freeze x$11_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
scope @0 [1:11] deps=[read a$8, read b$9, read c$10] out=[x$11_@0] {
|
||||
[1] Const mutate x$11_@0[1:11] = Array []
|
||||
if (read a$8) {
|
||||
scope @1 [3:5] deps=[read b$9] out=[y$12_@1] {
|
||||
[3] Const mutate y$12_@1[3:5] = Array []
|
||||
[4] Call mutate y$12_@1.push(read b$9)
|
||||
}
|
||||
[5] Const mutate $13:TPrimitive = "div"
|
||||
scope @2 [6:7] deps=[freeze y$12_@1] out=[$14_@2] {
|
||||
[6] Const mutate $14_@2 = JSX <read $13:TPrimitive>{freeze y$12_@1}</read $13:TPrimitive>
|
||||
}
|
||||
[7] Call mutate x$11_@0.push(read $14_@2)
|
||||
} else {
|
||||
[9] Call mutate x$11_@0.push(read c$10)
|
||||
}
|
||||
}
|
||||
return freeze x$11_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,54 +15,6 @@ function f(a, b) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$10_@0[1:8] = Array []
|
||||
[2] Const mutate $11:TPrimitive = 1
|
||||
[3] Const mutate $12:TPrimitive = Binary read a$8.length === read $11:TPrimitive
|
||||
[4] If (read $12:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] If (read b$9) then:bb4 else:bb1 fallthrough=bb1
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[6] Call mutate x$10_@0.push(read b$9)
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb4 bb2 bb0
|
||||
[8] Const mutate $13:TPrimitive = "div"
|
||||
[9] Const mutate t4$15_@1 = JSX <read $13:TPrimitive>{freeze x$10_@0}</read $13:TPrimitive>
|
||||
[10] Return read t4$15_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function f(
|
||||
a,
|
||||
b,
|
||||
) {
|
||||
scope @0 [1:8] deps=[read a$8.length, read b$9] out=[x$10_@0] {
|
||||
[1] Const mutate x$10_@0[1:8] = Array []
|
||||
[2] Const mutate $11:TPrimitive = 1
|
||||
[3] Const mutate $12:TPrimitive = Binary read a$8.length === read $11:TPrimitive
|
||||
if (read $12:TPrimitive) {
|
||||
if (read b$9) {
|
||||
[6] Call mutate x$10_@0.push(read b$9)
|
||||
}
|
||||
}
|
||||
}
|
||||
[8] Const mutate $13:TPrimitive = "div"
|
||||
scope @1 [9:10] deps=[freeze x$10_@0] out=[$15_@1] {
|
||||
[9] Const mutate $15_@1 = JSX <read $13:TPrimitive>{freeze x$10_@0}</read $13:TPrimitive>
|
||||
}
|
||||
return read $15_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -19,58 +19,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0[1:3] = Array []
|
||||
[2] Call mutate x$7_@0.push(read props$6.p0)
|
||||
[3] Const mutate y$8 = read x$7_@0
|
||||
[4] Let mutate x$0$11_@1[1:7] = read x$7_@0
|
||||
[4] If (read props$6.p1) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate x$1$9_@2 = Array []
|
||||
[6] Reassign mutate x$0$11_@1[1:7] = read x$1$9_@2
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] Const mutate _$12_@3 = JSX <read Component$0 x={freeze x$0$11_@1} ></read Component$0>
|
||||
[8] Call read y$8.push(read props$6.p2)
|
||||
[9] Const mutate t7$15_@4 = JSX <read Component$0 x={read x$0$11_@1} y={read y$8} ></read Component$0>
|
||||
[10] Return read t7$15_@4
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:3] deps=[read props$6.p0] out=[x$7_@0] {
|
||||
[1] Const mutate x$7_@0[1:3] = Array []
|
||||
[2] Call mutate x$7_@0.push(read props$6.p0)
|
||||
}
|
||||
[3] Const mutate y$8 = read x$7_@0
|
||||
scope @1 [1:7] deps=[read props$6.p1] out=[x$0$11_@1] {
|
||||
[4] Let mutate x$0$11_@1[1:7] = read x$7_@0
|
||||
if (read props$6.p1) {
|
||||
scope @2 [5:6] deps=[] out=[x$1$9_@2] {
|
||||
[5] Const mutate x$1$9_@2 = Array []
|
||||
}
|
||||
[6] Reassign mutate x$0$11_@1[1:7] = read x$1$9_@2
|
||||
}
|
||||
}
|
||||
[7] Const mutate _$12_@3 = JSX <read Component$0 x={freeze x$0$11_@1} ></read Component$0>
|
||||
[8] Call read y$8.push(read props$6.p2)
|
||||
scope @4 [9:10] deps=[read x$0$11_@1, read y$8] out=[$15_@4] {
|
||||
[9] Const mutate $15_@4 = JSX <read Component$0 x={read x$0$11_@1} y={read y$8} ></read Component$0>
|
||||
}
|
||||
return read $15_@4
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -30,99 +30,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$16_@0[1:5] = Array []
|
||||
[2] If (read a$13) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Call mutate x$16_@0.push(read a$13)
|
||||
[4] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[5] Const mutate $17:TPrimitive = "div"
|
||||
[6] Const mutate y$19_@1 = JSX <read $17:TPrimitive>{freeze x$16_@0}</read $17:TPrimitive>
|
||||
[7] Const mutate $20:TPrimitive = 0
|
||||
[8] Let mutate x$0$30_@2[8:15] = undefined
|
||||
[8] Switch (read b$14)
|
||||
Case read $20:TPrimitive: bb5
|
||||
Default: bb4
|
||||
Fallthrough: bb3
|
||||
bb5:
|
||||
predecessor blocks: bb1
|
||||
[9] Const mutate x$1$22_@3[9:11] = Array []
|
||||
[10] Call mutate x$1$22_@3.push(read b$14)
|
||||
[11] Reassign mutate x$0$30_@2[8:15] = read x$1$22_@3
|
||||
[11] Goto bb3
|
||||
bb4:
|
||||
predecessor blocks: bb1
|
||||
[12] Const mutate x$2$23_@4[12:14] = Array []
|
||||
[13] Call mutate x$2$23_@4.push(read c$15)
|
||||
[14] Reassign mutate x$0$30_@2[8:15] = read x$2$23_@4
|
||||
[14] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb5 bb4
|
||||
[15] Const mutate $25:TPrimitive = "div"
|
||||
[16] Const mutate $26:TPrimitive = "\n "
|
||||
[17] Const mutate $27:TPrimitive = "\n "
|
||||
[18] Const mutate $28:TPrimitive = "\n "
|
||||
[19] Const mutate t13$31_@5 = JSX <read $25:TPrimitive>{read $26:TPrimitive}{read y$19_@1}{read $27:TPrimitive}{freeze x$0$30_@2}{read $28:TPrimitive}</read $25:TPrimitive>
|
||||
[20] Return read t13$31_@5
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
scope @0 [1:5] deps=[read a$13] out=[x$16_@0] {
|
||||
[1] Const mutate x$16_@0[1:5] = Array []
|
||||
if (read a$13) {
|
||||
[3] Call mutate x$16_@0.push(read a$13)
|
||||
}
|
||||
}
|
||||
[5] Const mutate $17:TPrimitive = "div"
|
||||
scope @1 [6:7] deps=[freeze x$16_@0] out=[y$19_@1] {
|
||||
[6] Const mutate y$19_@1 = JSX <read $17:TPrimitive>{freeze x$16_@0}</read $17:TPrimitive>
|
||||
}
|
||||
[7] Const mutate $20:TPrimitive = 0
|
||||
scope @2 [8:15] deps=[read b$14, read c$15] out=[x$0$30_@2] {
|
||||
[8] Let mutate x$0$30_@2[8:15] = undefined
|
||||
switch (read b$14) {
|
||||
case read $20:TPrimitive: {
|
||||
scope @3 [9:11] deps=[read b$14] out=[x$1$22_@3] {
|
||||
[9] Const mutate x$1$22_@3[9:11] = Array []
|
||||
[10] Call mutate x$1$22_@3.push(read b$14)
|
||||
}
|
||||
[11] Reassign mutate x$0$30_@2[8:15] = read x$1$22_@3
|
||||
break bb3
|
||||
}
|
||||
default: {
|
||||
scope @4 [12:14] deps=[read c$15] out=[x$2$23_@4] {
|
||||
[12] Const mutate x$2$23_@4[12:14] = Array []
|
||||
[13] Call mutate x$2$23_@4.push(read c$15)
|
||||
}
|
||||
[14] Reassign mutate x$0$30_@2[8:15] = read x$2$23_@4
|
||||
}
|
||||
}
|
||||
}
|
||||
[15] Const mutate $25:TPrimitive = "div"
|
||||
[16] Const mutate $26:TPrimitive = "\n "
|
||||
[17] Const mutate $27:TPrimitive = "\n "
|
||||
[18] Const mutate $28:TPrimitive = "\n "
|
||||
scope @5 [19:20] deps=[read y$19_@1, freeze x$0$30_@2] out=[$31_@5] {
|
||||
[19] Const mutate $31_@5 = JSX <read $25:TPrimitive>{read $26:TPrimitive}{read y$19_@1}{read $27:TPrimitive}{freeze x$0$30_@2}{read $28:TPrimitive}</read $25:TPrimitive>
|
||||
}
|
||||
return read $31_@5
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -17,44 +17,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0[1:7] = Array []
|
||||
[2] Call mutate x$7_@0.push(read props$6.p0)
|
||||
[3] Const mutate y$8_@0[1:7] = read x$7_@0
|
||||
[4] Const mutate x$0$9_@1 = Array []
|
||||
[5] Const mutate _$10_@2 = JSX <read Component$0 x={freeze x$0$9_@1} ></read Component$0>
|
||||
[6] Call mutate y$8_@0.push(read props$6.p1)
|
||||
[7] Const mutate t6$11_@3 = JSX <read Component$0 x={read x$0$9_@1} y={freeze y$8_@0} ></read Component$0>
|
||||
[8] Return read t6$11_@3
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:7] deps=[read props$6.p0, read props$6.p1] out=[y$8_@0] {
|
||||
[1] Const mutate x$7_@0[1:7] = Array []
|
||||
[2] Call mutate x$7_@0.push(read props$6.p0)
|
||||
[3] Const mutate y$8_@0[1:7] = read x$7_@0
|
||||
scope @1 [4:5] deps=[] out=[x$0$9_@1] {
|
||||
[4] Const mutate x$0$9_@1 = Array []
|
||||
}
|
||||
[5] Const mutate _$10_@2 = JSX <read Component$0 x={freeze x$0$9_@1} ></read Component$0>
|
||||
[6] Call mutate y$8_@0.push(read props$6.p1)
|
||||
}
|
||||
scope @3 [7:8] deps=[read x$0$9_@1, freeze y$8_@0] out=[$11_@3] {
|
||||
[7] Const mutate $11_@3 = JSX <read Component$0 x={read x$0$9_@1} y={freeze y$8_@0} ></read Component$0>
|
||||
}
|
||||
return read $11_@3
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -32,105 +32,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7:TPrimitive = undefined
|
||||
[2] Let mutate x$0$16_@0[2:18] = undefined
|
||||
[2] If (read props$6.cond) then:bb2 else:bb10 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate $8:TPrimitive = 2
|
||||
[4] Const mutate $9:TPrimitive = 1
|
||||
[5] Const mutate $10:TPrimitive = 0
|
||||
[6] Switch (read props$6.test)
|
||||
Case read $10:TPrimitive: bb8
|
||||
Case read $9:TPrimitive: bb6
|
||||
Case read $8:TPrimitive: bb4
|
||||
Default: bb4
|
||||
Fallthrough: bb1
|
||||
bb8:
|
||||
predecessor blocks: bb2
|
||||
[7] Const mutate x$1$11 = read props$6.v0
|
||||
[8] Reassign mutate x$0$16_@0[2:18] = read x$1$11
|
||||
[8] Goto bb1
|
||||
bb6:
|
||||
predecessor blocks: bb2
|
||||
[9] Const mutate x$2$12 = read props$6.v1
|
||||
[10] Reassign mutate x$0$16_@0[2:18] = read x$2$12
|
||||
[10] Goto bb1
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[11] Const mutate x$3$13 = read props$6.v2
|
||||
[12] Reassign mutate x$0$16_@0[2:18] = read x$3$13
|
||||
[12] Goto bb1
|
||||
bb10:
|
||||
predecessor blocks: bb0
|
||||
[13] If (read props$6.cond2) then:bb12 else:bb13 fallthrough=bb1
|
||||
bb12:
|
||||
predecessor blocks: bb10
|
||||
[14] Const mutate x$4$14 = read props$6.b
|
||||
[15] Reassign mutate x$0$16_@0[2:18] = read x$4$14
|
||||
[15] Goto bb1
|
||||
bb13:
|
||||
predecessor blocks: bb10
|
||||
[16] Const mutate x$5$15 = read props$6.c
|
||||
[17] Reassign mutate x$0$16_@0[2:18] = read x$5$15
|
||||
[17] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb8 bb6 bb4 bb12 bb13
|
||||
[18] read x$0$16_@0
|
||||
[19] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate x$7:TPrimitive = undefined
|
||||
scope @0 [2:18] deps=[read props$6.cond, read props$6.test, read props$6.v0, read props$6.v1, read props$6.v2, read props$6.cond2, read props$6.b, read props$6.c] out=[x$0$16_@0] {
|
||||
[2] Let mutate x$0$16_@0[2:18] = undefined
|
||||
if (read props$6.cond) {
|
||||
[3] Const mutate $8:TPrimitive = 2
|
||||
[4] Const mutate $9:TPrimitive = 1
|
||||
[5] Const mutate $10:TPrimitive = 0
|
||||
switch (read props$6.test) {
|
||||
case read $10:TPrimitive: {
|
||||
[7] Const mutate x$1$11 = read props$6.v0
|
||||
[8] Reassign mutate x$0$16_@0[2:18] = read x$1$11
|
||||
break bb1
|
||||
}
|
||||
case read $9:TPrimitive: {
|
||||
[9] Const mutate x$2$12 = read props$6.v1
|
||||
[10] Reassign mutate x$0$16_@0[2:18] = read x$2$12
|
||||
break bb1
|
||||
}
|
||||
case read $8:TPrimitive: {
|
||||
}
|
||||
default: {
|
||||
[11] Const mutate x$3$13 = read props$6.v2
|
||||
[12] Reassign mutate x$0$16_@0[2:18] = read x$3$13
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (read props$6.cond2) {
|
||||
[14] Const mutate x$4$14 = read props$6.b
|
||||
[15] Reassign mutate x$0$16_@0[2:18] = read x$4$14
|
||||
} else {
|
||||
[16] Const mutate x$5$15 = read props$6.c
|
||||
[17] Reassign mutate x$0$16_@0[2:18] = read x$5$15
|
||||
}
|
||||
}
|
||||
}
|
||||
[18] read x$0$16_@0
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -16,62 +16,12 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function mutate(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function mutate() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$5_@0:TObject = Object { }
|
||||
[2] Const mutate b$6_@1:TObject[2:8] = Object { }
|
||||
[3] Const mutate c$7_@1:TObject[2:8] = Object { }
|
||||
[4] Const mutate a$0$8_@1:TObject[2:8] = read b$6_@1:TObject
|
||||
[5] Const mutate b$1$9_@1:TObject[2:8] = read c$7_@1:TObject
|
||||
[6] Const mutate c$2$10_@1:TObject[2:8] = read a$0$8_@1:TObject
|
||||
[7] Call mutate mutate$4:TFunction(mutate a$0$8_@1:TObject, mutate b$1$9_@1:TObject)
|
||||
[8] Return freeze c$2$10_@1:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate a$5_@0:TObject = Object { }
|
||||
scope @1 [2:8] deps=[] out=[c$2$10_@1] {
|
||||
[2] Const mutate b$6_@1:TObject[2:8] = Object { }
|
||||
[3] Const mutate c$7_@1:TObject[2:8] = Object { }
|
||||
[4] Const mutate a$0$8_@1:TObject[2:8] = read b$6_@1:TObject
|
||||
[5] Const mutate b$1$9_@1:TObject[2:8] = read c$7_@1:TObject
|
||||
[6] Const mutate c$2$10_@1:TObject[2:8] = read a$0$8_@1:TObject
|
||||
[7] Call mutate mutate$4:TFunction(mutate a$0$8_@1:TObject, mutate b$1$9_@1:TObject)
|
||||
}
|
||||
return freeze c$2$10_@1:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,48 +11,6 @@ function foo(x, y) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] If (read x$8) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[2] Const mutate $10:TPrimitive = false
|
||||
[3] Const mutate t1$11_@0 = Call read foo$0:TFunction(read $10:TPrimitive, read y$9:TPrimitive)
|
||||
[4] Return freeze t1$11_@0
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate $12:TPrimitive = 10
|
||||
[6] Const mutate $13:TPrimitive = Binary read y$9:TPrimitive * read $12:TPrimitive
|
||||
[7] Const mutate t2$14_@1 = Array [read $13:TPrimitive]
|
||||
[8] Return freeze t2$14_@1
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
x,
|
||||
y,
|
||||
) {
|
||||
if (read x$8) {
|
||||
[2] Const mutate $10:TPrimitive = false
|
||||
scope @0 [3:4] deps=[read y$9:TPrimitive] out=[$11_@0] {
|
||||
[3] Const mutate $11_@0 = Call read foo$0:TFunction(read $10:TPrimitive, read y$9:TPrimitive)
|
||||
}
|
||||
return freeze $11_@0
|
||||
}
|
||||
[5] Const mutate $12:TPrimitive = 10
|
||||
[6] Const mutate $13:TPrimitive = Binary read y$9:TPrimitive * read $12:TPrimitive
|
||||
scope @1 [7:8] deps=[] out=[$14_@1] {
|
||||
[7] Const mutate $14_@1 = Array [read $13:TPrimitive]
|
||||
}
|
||||
return freeze $14_@1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,32 +11,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$6:TPrimitive = 1
|
||||
[2] Const mutate b$7:TPrimitive = 2
|
||||
[3] Const mutate x$8_@0 = Array [read a$6:TPrimitive, read b$7:TPrimitive]
|
||||
[4] Return freeze x$8_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate a$6:TPrimitive = 1
|
||||
[2] Const mutate b$7:TPrimitive = 2
|
||||
scope @0 [3:4] deps=[] out=[x$8_@0] {
|
||||
[3] Const mutate x$8_@0 = Array [read a$6:TPrimitive, read b$7:TPrimitive]
|
||||
}
|
||||
return freeze x$8_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -18,79 +18,12 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$11_@0[1:10] = Array []
|
||||
[2] Const mutate b$12_@0:TObject[1:10] = Object { }
|
||||
[3] Call mutate foo$4:TFunction(mutate a$11_@0, mutate b$12_@0:TObject)
|
||||
[4] Const mutate t2$13_@1 = Call mutate foo$4:TFunction()
|
||||
[5] If (read t2$13_@1) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate $14:TPrimitive = "div"
|
||||
[7] Const mutate _$15_@2 = JSX <read $14:TPrimitive a={freeze a$11_@0} ></read $14:TPrimitive>
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[9] Call mutate foo$4:TFunction(read a$11_@0, mutate b$12_@0:TObject)
|
||||
[10] Const mutate $19:TPrimitive = "div"
|
||||
[11] Const mutate t5$20_@3 = JSX <read $19:TPrimitive a={freeze a$11_@0} b={freeze b$12_@0:TObject} ></read $19:TPrimitive>
|
||||
[12] Return read t5$20_@3
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:10] deps=[] out=[a$11_@0, b$12_@0] {
|
||||
[1] Const mutate a$11_@0[1:10] = Array []
|
||||
[2] Const mutate b$12_@0:TObject[1:10] = Object { }
|
||||
[3] Call mutate foo$4:TFunction(mutate a$11_@0, mutate b$12_@0:TObject)
|
||||
scope @1 [4:5] deps=[] out=[$13_@1] {
|
||||
[4] Const mutate $13_@1 = Call mutate foo$4:TFunction()
|
||||
}
|
||||
if (read $13_@1) {
|
||||
[6] Const mutate $14:TPrimitive = "div"
|
||||
[7] Const mutate _$15_@2 = JSX <read $14:TPrimitive a={freeze a$11_@0} ></read $14:TPrimitive>
|
||||
}
|
||||
[9] Call mutate foo$4:TFunction(read a$11_@0, mutate b$12_@0:TObject)
|
||||
}
|
||||
[10] Const mutate $19:TPrimitive = "div"
|
||||
scope @3 [11:12] deps=[freeze a$11_@0, freeze b$12_@0:TObject] out=[$20_@3] {
|
||||
[11] Const mutate $20_@3 = JSX <read $19:TPrimitive a={freeze a$11_@0} b={freeze b$12_@0:TObject} ></read $19:TPrimitive>
|
||||
}
|
||||
return read $20_@3
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,67 +15,12 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$10_@0[1:7] = Array []
|
||||
[2] Const mutate b$11_@0:TObject[1:7] = Object { }
|
||||
[3] Call mutate foo$4:TFunction(mutate a$10_@0, mutate b$11_@0:TObject)
|
||||
[4] Const mutate $12:TPrimitive = "div"
|
||||
[5] Const mutate _$13_@1 = JSX <read $12:TPrimitive a={freeze a$10_@0} ></read $12:TPrimitive>
|
||||
[6] Call mutate foo$4:TFunction(read a$10_@0, mutate b$11_@0:TObject)
|
||||
[7] Const mutate $14:TPrimitive = "div"
|
||||
[8] Const mutate t4$15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
|
||||
[9] Return read t4$15_@2
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:7] deps=[] out=[a$10_@0, b$11_@0] {
|
||||
[1] Const mutate a$10_@0[1:7] = Array []
|
||||
[2] Const mutate b$11_@0:TObject[1:7] = Object { }
|
||||
[3] Call mutate foo$4:TFunction(mutate a$10_@0, mutate b$11_@0:TObject)
|
||||
[4] Const mutate $12:TPrimitive = "div"
|
||||
[5] Const mutate _$13_@1 = JSX <read $12:TPrimitive a={freeze a$10_@0} ></read $12:TPrimitive>
|
||||
[6] Call mutate foo$4:TFunction(read a$10_@0, mutate b$11_@0:TObject)
|
||||
}
|
||||
[7] Const mutate $14:TPrimitive = "div"
|
||||
scope @2 [8:9] deps=[read a$10_@0, freeze b$11_@0:TObject] out=[$15_@2] {
|
||||
[8] Const mutate $15_@2 = JSX <read $14:TPrimitive a={read a$10_@0} b={freeze b$11_@0:TObject} ></read $14:TPrimitive>
|
||||
}
|
||||
return read $15_@2
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -17,69 +17,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7:TPrimitive = 1
|
||||
[2] Const mutate y$8:TPrimitive = 2
|
||||
[3] Const mutate $9:TPrimitive = 2
|
||||
[4] Const mutate $10:TPrimitive = Binary read y$8:TPrimitive === read $9:TPrimitive
|
||||
[5] Let mutate x$0$17_@0[1:8] = read x$7:TPrimitive
|
||||
[5] If (read $10:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate x$1$11:TPrimitive = 3
|
||||
[7] Reassign mutate x$0$17_@0[1:8] = read x$1$11:TPrimitive
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[8] Const mutate $12:TPrimitive = 3
|
||||
[9] Const mutate $14:TPrimitive = Binary read y$8:TPrimitive === read $12:TPrimitive
|
||||
[10] Let mutate x$2$16_@1[1:13] = read x$0$17_@0
|
||||
[10] If (read $14:TPrimitive) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb1
|
||||
[11] Const mutate x$3$15:TPrimitive = 5
|
||||
[12] Reassign mutate x$2$16_@1[1:13] = read x$3$15:TPrimitive
|
||||
[12] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb1
|
||||
[13] Const mutate y$4$18 = read x$2$16_@1
|
||||
[14] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$7:TPrimitive = 1
|
||||
[2] Const mutate y$8:TPrimitive = 2
|
||||
[3] Const mutate $9:TPrimitive = 2
|
||||
[4] Const mutate $10:TPrimitive = Binary read y$8:TPrimitive === read $9:TPrimitive
|
||||
scope @0 [1:8] deps=[] out=[x$0$17_@0] {
|
||||
[5] Let mutate x$0$17_@0[1:8] = read x$7:TPrimitive
|
||||
if (read $10:TPrimitive) {
|
||||
[6] Const mutate x$1$11:TPrimitive = 3
|
||||
[7] Reassign mutate x$0$17_@0[1:8] = read x$1$11:TPrimitive
|
||||
}
|
||||
}
|
||||
[8] Const mutate $12:TPrimitive = 3
|
||||
[9] Const mutate $14:TPrimitive = Binary read y$8:TPrimitive === read $12:TPrimitive
|
||||
scope @1 [1:13] deps=[] out=[x$2$16_@1] {
|
||||
[10] Let mutate x$2$16_@1[1:13] = read x$0$17_@0
|
||||
if (read $14:TPrimitive) {
|
||||
[11] Const mutate x$3$15:TPrimitive = 5
|
||||
[12] Reassign mutate x$2$16_@1[1:13] = read x$3$15:TPrimitive
|
||||
}
|
||||
}
|
||||
[13] Const mutate y$4$18 = read x$2$16_@1
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -14,49 +14,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
[2] Const mutate y$6:TPrimitive = 2
|
||||
[3] Const mutate $7:TPrimitive = 2
|
||||
[4] Const mutate $8:TPrimitive = Binary read y$6:TPrimitive === read $7:TPrimitive
|
||||
[5] Let mutate x$0$10_@0[1:8] = read x$5:TPrimitive
|
||||
[5] If (read $8:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate x$1$9:TPrimitive = 3
|
||||
[7] Reassign mutate x$0$10_@0[1:8] = read x$1$9:TPrimitive
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[8] Const mutate y$2$11 = read x$0$10_@0
|
||||
[9] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
[2] Const mutate y$6:TPrimitive = 2
|
||||
[3] Const mutate $7:TPrimitive = 2
|
||||
[4] Const mutate $8:TPrimitive = Binary read y$6:TPrimitive === read $7:TPrimitive
|
||||
scope @0 [1:8] deps=[] out=[x$0$10_@0] {
|
||||
[5] Let mutate x$0$10_@0[1:8] = read x$5:TPrimitive
|
||||
if (read $8:TPrimitive) {
|
||||
[6] Const mutate x$1$9:TPrimitive = 3
|
||||
[7] Reassign mutate x$0$10_@0[1:8] = read x$1$9:TPrimitive
|
||||
}
|
||||
}
|
||||
[8] Const mutate y$2$11 = read x$0$10_@0
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,42 +15,6 @@ function foo(cond) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate items$5_@0 = Array []
|
||||
[2] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb4
|
||||
[3] If (read items$5_@0) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[4] Const mutate y$7:TPrimitive = 0
|
||||
[5] If (read cond$4) then:bb5 else:bb4 fallthrough=bb4
|
||||
bb5:
|
||||
predecessor blocks: bb3
|
||||
[6] Const mutate y$9:TPrimitive = 1
|
||||
[7] Goto bb4
|
||||
bb4:
|
||||
predecessor blocks: bb5 bb3
|
||||
[8] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[9] Return freeze items$5_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
cond,
|
||||
) {
|
||||
[1] Const mutate items$5_@0 = Array []
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -12,60 +12,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Let mutate x$6_@0:TPrimitive[1:13] = 1
|
||||
[2] For init=bb3 test=bb1 loop=bb5 update=bb4 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate i$7:TPrimitive = 0
|
||||
[4] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb4
|
||||
[5] Const mutate $8:TPrimitive = 10
|
||||
[6] Const mutate $10:TPrimitive = Binary read i$7:TPrimitive < read $8:TPrimitive
|
||||
[7] If (read $10:TPrimitive) then:bb5 else:bb2 fallthrough=bb2
|
||||
bb5:
|
||||
predecessor blocks: bb1
|
||||
[8] Const mutate $11:TPrimitive = 1
|
||||
[9] Reassign mutate x$6_@0:TPrimitive[1:13] = Binary read x$6_@0:TPrimitive + read $11:TPrimitive
|
||||
[10] Goto(Continue) bb4
|
||||
bb4:
|
||||
predecessor blocks: bb5
|
||||
[11] read i$7:TPrimitive
|
||||
[12] Goto bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[13] Return read x$6_@0:TPrimitive
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:13] deps=[] out=[x$6_@0] {
|
||||
[1] Let mutate x$6_@0:TPrimitive[1:13] = 1
|
||||
for (
|
||||
[3] Const mutate i$7:TPrimitive = 0
|
||||
;
|
||||
[5] Const mutate $8:TPrimitive = 10
|
||||
[6] Const mutate $10:TPrimitive = Binary read i$7:TPrimitive < read $8:TPrimitive
|
||||
read $10:TPrimitive
|
||||
;
|
||||
read i$7:TPrimitive
|
||||
) {
|
||||
[8] Const mutate $11:TPrimitive = 1
|
||||
[9] Reassign mutate x$6_@0:TPrimitive[1:13] = Binary read x$6_@0:TPrimitive + read $11:TPrimitive
|
||||
}
|
||||
}
|
||||
return read x$6_@0:TPrimitive
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -12,64 +12,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Let mutate x$7_@1:TPrimitive[1:15] = 1
|
||||
[2] For init=bb3 test=bb1 loop=bb5 update=bb4 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[3] Let mutate i$8_@1:TPrimitive[1:15] = 0
|
||||
[4] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb4
|
||||
[5] Const mutate $9:TPrimitive = 10
|
||||
[6] Const mutate $11:TPrimitive = Binary read i$8_@1:TPrimitive < read $9:TPrimitive
|
||||
[7] If (read $11:TPrimitive) then:bb5 else:bb2 fallthrough=bb2
|
||||
bb5:
|
||||
predecessor blocks: bb1
|
||||
[8] Const mutate $12:TPrimitive = 1
|
||||
[9] Reassign mutate x$7_@1:TPrimitive[1:15] = Binary read x$7_@1:TPrimitive + read $12:TPrimitive
|
||||
[10] Goto(Continue) bb4
|
||||
bb4:
|
||||
predecessor blocks: bb5
|
||||
[11] Const mutate $15:TPrimitive = 1
|
||||
[12] Reassign mutate i$8_@1:TPrimitive[1:15] = Binary read i$8_@1:TPrimitive + read $15:TPrimitive
|
||||
[13] read i$8_@1:TPrimitive
|
||||
[14] Goto bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[15] Return read x$7_@1:TPrimitive
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @1 [1:15] deps=[] out=[x$7_@1] {
|
||||
[1] Let mutate x$7_@1:TPrimitive[1:15] = 1
|
||||
for (
|
||||
[3] Let mutate i$8_@1:TPrimitive[1:15] = 0
|
||||
;
|
||||
[5] Const mutate $9:TPrimitive = 10
|
||||
[6] Const mutate $11:TPrimitive = Binary read i$8_@1:TPrimitive < read $9:TPrimitive
|
||||
read $11:TPrimitive
|
||||
;
|
||||
[11] Const mutate $15:TPrimitive = 1
|
||||
[12] Reassign mutate i$8_@1:TPrimitive[1:15] = Binary read i$8_@1:TPrimitive + read $15:TPrimitive
|
||||
read i$8_@1:TPrimitive
|
||||
) {
|
||||
[8] Const mutate $12:TPrimitive = 1
|
||||
[9] Reassign mutate x$7_@1:TPrimitive[1:15] = Binary read x$7_@1:TPrimitive + read $12:TPrimitive
|
||||
}
|
||||
}
|
||||
return read x$7_@1:TPrimitive
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,43 +15,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
[2] Const mutate y$6:TPrimitive = 2
|
||||
[3] If (read y$6:TPrimitive) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Const mutate z$7:TPrimitive = Binary read x$5:TPrimitive + read y$6:TPrimitive
|
||||
[5] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate z$8:TPrimitive = read x$5:TPrimitive
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[8] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
[2] Const mutate y$6:TPrimitive = 2
|
||||
if (read y$6:TPrimitive) {
|
||||
[4] Const mutate z$7:TPrimitive = Binary read x$5:TPrimitive + read y$6:TPrimitive
|
||||
} else {
|
||||
[6] Const mutate z$8:TPrimitive = read x$5:TPrimitive
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -24,99 +24,6 @@ function foo(a, b, c, d) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$13:TPrimitive = 0
|
||||
[2] Const mutate $14:TPrimitive = true
|
||||
[3] Let mutate x$0$23_@0[3:20] = undefined
|
||||
[3] If (read $14:TPrimitive) then:bb2 else:bb6 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Const mutate $15:TPrimitive = true
|
||||
[5] If (read $15:TPrimitive) then:bb4 else:bb5 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[6] Const mutate x$1$16 = read a$9
|
||||
[7] Reassign mutate x$0$23_@0[3:20] = read x$1$16
|
||||
[7] Goto bb3
|
||||
bb5:
|
||||
predecessor blocks: bb2
|
||||
[8] Const mutate x$2$17 = read b$10
|
||||
[9] Reassign mutate x$0$23_@0[3:20] = read x$2$17
|
||||
[9] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb5
|
||||
[10] read x$3$18
|
||||
[11] Reassign mutate x$0$23_@0[3:20] = read x$3$18
|
||||
[11] Goto bb1
|
||||
bb6:
|
||||
predecessor blocks: bb0
|
||||
[12] Const mutate $19:TPrimitive = true
|
||||
[13] If (read $19:TPrimitive) then:bb8 else:bb9 fallthrough=bb7
|
||||
bb8:
|
||||
predecessor blocks: bb6
|
||||
[14] Const mutate x$4$20 = read c$11
|
||||
[15] Reassign mutate x$0$23_@0[3:20] = read x$4$20
|
||||
[15] Goto bb7
|
||||
bb9:
|
||||
predecessor blocks: bb6
|
||||
[16] Const mutate x$5$21 = read d$12
|
||||
[17] Reassign mutate x$0$23_@0[3:20] = read x$5$21
|
||||
[17] Goto bb7
|
||||
bb7:
|
||||
predecessor blocks: bb8 bb9
|
||||
[18] read x$6$22
|
||||
[19] Reassign mutate x$0$23_@0[3:20] = read x$6$22
|
||||
[19] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb7
|
||||
[20] Return read x$0$23_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d,
|
||||
) {
|
||||
[1] Const mutate x$13:TPrimitive = 0
|
||||
[2] Const mutate $14:TPrimitive = true
|
||||
scope @0 [3:20] deps=[read a$9, read b$10, read c$11, read d$12] out=[x$0$23_@0] {
|
||||
[3] Let mutate x$0$23_@0[3:20] = undefined
|
||||
if (read $14:TPrimitive) {
|
||||
[4] Const mutate $15:TPrimitive = true
|
||||
if (read $15:TPrimitive) {
|
||||
[6] Const mutate x$1$16 = read a$9
|
||||
[7] Reassign mutate x$0$23_@0[3:20] = read x$1$16
|
||||
} else {
|
||||
[8] Const mutate x$2$17 = read b$10
|
||||
[9] Reassign mutate x$0$23_@0[3:20] = read x$2$17
|
||||
}
|
||||
[10] read x$3$18
|
||||
[11] Reassign mutate x$0$23_@0[3:20] = read x$3$18
|
||||
} else {
|
||||
[12] Const mutate $19:TPrimitive = true
|
||||
if (read $19:TPrimitive) {
|
||||
[14] Const mutate x$4$20 = read c$11
|
||||
[15] Reassign mutate x$0$23_@0[3:20] = read x$4$20
|
||||
} else {
|
||||
[16] Const mutate x$5$21 = read d$12
|
||||
[17] Reassign mutate x$0$23_@0[3:20] = read x$5$21
|
||||
}
|
||||
[18] read x$6$22
|
||||
[19] Reassign mutate x$0$23_@0[3:20] = read x$6$22
|
||||
}
|
||||
}
|
||||
return read x$0$23_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -17,71 +17,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$9:TPrimitive = 0
|
||||
[2] While test=bb1 loop=bb3 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb5
|
||||
[3] If (read a$6) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[4] While test=bb4 loop=bb6 fallthrough=bb5
|
||||
bb4:
|
||||
predecessor blocks: bb3 bb8
|
||||
[5] If (read b$7) then:bb6 else:bb5 fallthrough=bb5
|
||||
bb6:
|
||||
predecessor blocks: bb4
|
||||
[6] While test=bb7 loop=bb9 fallthrough=bb8
|
||||
bb7:
|
||||
predecessor blocks: bb6 bb9
|
||||
[7] If (read c$8) then:bb9 else:bb8 fallthrough=bb8
|
||||
bb9:
|
||||
predecessor blocks: bb7
|
||||
[8] Const mutate $13:TPrimitive = 1
|
||||
[9] Binary read x$9:TPrimitive + read $13:TPrimitive
|
||||
[10] Goto(Continue) bb7
|
||||
bb8:
|
||||
predecessor blocks: bb7
|
||||
[11] Goto(Continue) bb4
|
||||
bb5:
|
||||
predecessor blocks: bb4
|
||||
[12] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[13] Return read x$9:TPrimitive
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
[1] Const mutate x$9:TPrimitive = 0
|
||||
while (
|
||||
read a$6
|
||||
) {
|
||||
while (
|
||||
read b$7
|
||||
) {
|
||||
while (
|
||||
read c$8
|
||||
) {
|
||||
[8] Const mutate $13:TPrimitive = 1
|
||||
[9] Binary read x$9:TPrimitive + read $13:TPrimitive
|
||||
}
|
||||
}
|
||||
}
|
||||
return read x$9:TPrimitive
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -14,54 +14,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$8 = read a$5
|
||||
[2] If (read b$6) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Let mutate x$0$10_@0[1:6] = read x$8
|
||||
[3] If (read c$7) then:bb4 else:bb3 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[4] Const mutate x$1$9 = read c$7
|
||||
[5] Reassign mutate x$0$10_@0[1:6] = read x$1$9
|
||||
[5] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb2
|
||||
[6] read x$0$10_@0
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb0
|
||||
[8] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
[1] Const mutate x$8 = read a$5
|
||||
if (read b$6) {
|
||||
scope @0 [1:6] deps=[read c$7] out=[x$0$10_@0] {
|
||||
[3] Let mutate x$0$10_@0[1:6] = read x$8
|
||||
if (read c$7) {
|
||||
[4] Const mutate x$1$9 = read c$7
|
||||
[5] Reassign mutate x$0$10_@0[1:6] = read x$1$9
|
||||
}
|
||||
}
|
||||
[6] read x$0$10_@0
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -16,59 +16,6 @@ function foo(a, b, c, d, e) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$12:TPrimitive = null
|
||||
[2] Let mutate x$0$15_@0[1:8] = read x$12:TPrimitive
|
||||
[2] If (read a$7) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate x$1$13 = read b$8
|
||||
[4] Reassign mutate x$0$15_@0[1:8] = read x$1$13
|
||||
[4] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[5] If (read c$9) then:bb5 else:bb1 fallthrough=bb1
|
||||
bb5:
|
||||
predecessor blocks: bb3
|
||||
[6] Const mutate x$2$14 = read d$10
|
||||
[7] Reassign mutate x$0$15_@0[1:8] = read x$2$14
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb5 bb3
|
||||
[8] Return read x$0$15_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d,
|
||||
e,
|
||||
) {
|
||||
[1] Const mutate x$12:TPrimitive = null
|
||||
scope @0 [1:8] deps=[read a$7, read b$8, read c$9, read d$10] out=[x$0$15_@0] {
|
||||
[2] Let mutate x$0$15_@0[1:8] = read x$12:TPrimitive
|
||||
if (read a$7) {
|
||||
[3] Const mutate x$1$13 = read b$8
|
||||
[4] Reassign mutate x$0$15_@0[1:8] = read x$1$13
|
||||
} else {
|
||||
if (read c$9) {
|
||||
[6] Const mutate x$2$14 = read d$10
|
||||
[7] Reassign mutate x$0$15_@0[1:8] = read x$2$14
|
||||
}
|
||||
}
|
||||
}
|
||||
return read x$0$15_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,55 +13,12 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function Foo() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$7_@0[1:4] = Array []
|
||||
[2] Const mutate b$8_@0:TObject[1:4] = Object { }
|
||||
[3] Const mutate c$9_@0[1:4] = New mutate Foo$4(mutate a$7_@0, mutate b$8_@0:TObject)
|
||||
[4] Return freeze c$9_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @0 [1:4] deps=[] out=[c$9_@0] {
|
||||
[1] Const mutate a$7_@0[1:4] = Array []
|
||||
[2] Const mutate b$8_@0:TObject[1:4] = Object { }
|
||||
[3] Const mutate c$9_@0[1:4] = New mutate Foo$4(mutate a$7_@0, mutate b$8_@0:TObject)
|
||||
}
|
||||
return freeze c$9_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -18,61 +18,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$6:TPrimitive = 1
|
||||
[2] Const mutate y$7:TPrimitive = 2
|
||||
[3] Const mutate $8:TPrimitive = 1
|
||||
[4] Const mutate $9:TPrimitive = Binary read x$6:TPrimitive > read $8:TPrimitive
|
||||
[5] Let mutate x$0$12_@0[1:10] = read x$6:TPrimitive
|
||||
[5] Let mutate y$1$13_@0[1:10] = read y$7:TPrimitive
|
||||
[5] If (read $9:TPrimitive) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate x$2$10:TPrimitive = 2
|
||||
[7] Reassign mutate x$0$12_@0[1:10] = read x$2$10:TPrimitive
|
||||
[7] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[8] Const mutate y$3$11:TPrimitive = 3
|
||||
[9] Reassign mutate y$1$13_@0[1:10] = read y$3$11:TPrimitive
|
||||
[9] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[10] Const mutate t$14_@2:TObject = Object { x: read x$0$12_@0, y: read y$1$13_@0 }
|
||||
[11] Return freeze t$14_@2:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$6:TPrimitive = 1
|
||||
[2] Const mutate y$7:TPrimitive = 2
|
||||
[3] Const mutate $8:TPrimitive = 1
|
||||
[4] Const mutate $9:TPrimitive = Binary read x$6:TPrimitive > read $8:TPrimitive
|
||||
scope @0 [1:10] deps=[] out=[x$0$12_@0] {
|
||||
[5] Let mutate x$0$12_@0[1:10] = read x$6:TPrimitive
|
||||
[5] Let mutate y$1$13_@0[1:10] = read y$7:TPrimitive
|
||||
if (read $9:TPrimitive) {
|
||||
[6] Const mutate x$2$10:TPrimitive = 2
|
||||
[7] Reassign mutate x$0$12_@0[1:10] = read x$2$10:TPrimitive
|
||||
} else {
|
||||
[8] Const mutate y$3$11:TPrimitive = 3
|
||||
[9] Reassign mutate y$1$13_@0[1:10] = read y$3$11:TPrimitive
|
||||
}
|
||||
}
|
||||
scope @2 [10:11] deps=[read x$0$12_@0, read y$1$13_@0] out=[t$14_@2] {
|
||||
[10] Const mutate t$14_@2:TObject = Object { x: read x$0$12_@0, y: read y$1$13_@0 }
|
||||
}
|
||||
return freeze t$14_@2:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,32 +11,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$6:TPrimitive = 1
|
||||
[2] Const mutate b$7:TPrimitive = 2
|
||||
[3] Const mutate x$8_@0:TObject = Object { a: read a$6:TPrimitive, b: read b$7:TPrimitive }
|
||||
[4] Return freeze x$8_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
[1] Const mutate a$6:TPrimitive = 1
|
||||
[2] Const mutate b$7:TPrimitive = 2
|
||||
scope @0 [3:4] deps=[] out=[x$8_@0] {
|
||||
[3] Const mutate x$8_@0:TObject = Object { a: read a$6:TPrimitive, b: read b$7:TPrimitive }
|
||||
}
|
||||
return freeze x$8_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
-46
@@ -18,52 +18,6 @@ function foo(a) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate b$8_@0:TObject[1:11] = Object { }
|
||||
[2] Const mutate x$9_@0:TObject[1:11] = read b$8_@0:TObject
|
||||
[3] If (read a$7) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Const mutate y$10_@0:TObject[1:11] = Object { }
|
||||
[5] Reassign store x$9_@0.y[1:11] = read y$10_@0:TObject
|
||||
[6] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[7] Const mutate z$11_@0:TObject[1:11] = Object { }
|
||||
[8] Reassign store x$9_@0.z[1:11] = read z$11_@0:TObject
|
||||
[9] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[10] Call mutate mutate$6:TFunction(mutate b$8_@0:TObject)
|
||||
[11] Return freeze x$9_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
) {
|
||||
scope @0 [1:11] deps=[read a$7] out=[x$9_@0] {
|
||||
[1] Const mutate b$8_@0:TObject[1:11] = Object { }
|
||||
[2] Const mutate x$9_@0:TObject[1:11] = read b$8_@0:TObject
|
||||
if (read a$7) {
|
||||
[4] Const mutate y$10_@0:TObject[1:11] = Object { }
|
||||
[5] Reassign store x$9_@0.y[1:11] = read y$10_@0:TObject
|
||||
} else {
|
||||
[7] Const mutate z$11_@0:TObject[1:11] = Object { }
|
||||
[8] Reassign store x$9_@0.z[1:11] = read z$11_@0:TObject
|
||||
}
|
||||
[10] Call mutate mutate$6:TFunction(mutate b$8_@0:TObject)
|
||||
}
|
||||
return freeze x$9_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -16,52 +16,6 @@ function foo(a) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$6_@0:TObject[1:9] = Object { }
|
||||
[2] If (read a$5) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate y$7_@1:TObject = Object { }
|
||||
[4] Reassign store x$6_@0.y[1:9] = read y$7_@1:TObject
|
||||
[5] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate z$8_@2:TObject = Object { }
|
||||
[7] Reassign store x$6_@0.z[1:9] = read z$8_@2:TObject
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[9] Return freeze x$6_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
) {
|
||||
scope @0 [1:9] deps=[read a$5] out=[x$6_@0] {
|
||||
[1] Const mutate x$6_@0:TObject[1:9] = Object { }
|
||||
if (read a$5) {
|
||||
scope @1 [3:4] deps=[] out=[y$7_@1] {
|
||||
[3] Const mutate y$7_@1:TObject = Object { }
|
||||
}
|
||||
[4] Reassign store x$6_@0.y[1:9] = read y$7_@1:TObject
|
||||
} else {
|
||||
scope @2 [6:7] deps=[] out=[z$8_@2] {
|
||||
[6] Const mutate z$8_@2:TObject = Object { }
|
||||
}
|
||||
[7] Reassign store x$6_@0.z[1:9] = read z$8_@2:TObject
|
||||
}
|
||||
}
|
||||
return freeze x$6_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -17,50 +17,6 @@ function foo(a) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0:TObject[1:10] = Object { }
|
||||
[2] If (read a$6) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate y$8_@0:TObject[1:10] = Object { }
|
||||
[4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
|
||||
[5] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate z$9_@0:TObject[1:10] = Object { }
|
||||
[7] Reassign store x$7_@0.z[1:10] = read z$9_@0:TObject
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[9] Call mutate mutate$5:TFunction(mutate x$7_@0:TObject)
|
||||
[10] Return freeze x$7_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
) {
|
||||
scope @0 [1:10] deps=[read a$6] out=[x$7_@0] {
|
||||
[1] Const mutate x$7_@0:TObject[1:10] = Object { }
|
||||
if (read a$6) {
|
||||
[3] Const mutate y$8_@0:TObject[1:10] = Object { }
|
||||
[4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
|
||||
} else {
|
||||
[6] Const mutate z$9_@0:TObject[1:10] = Object { }
|
||||
[7] Reassign store x$7_@0.z[1:10] = read z$9_@0:TObject
|
||||
}
|
||||
[9] Call mutate mutate$5:TFunction(mutate x$7_@0:TObject)
|
||||
}
|
||||
return freeze x$7_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
-46
@@ -17,52 +17,6 @@ function foo(a) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0:TObject[1:10] = Object { }
|
||||
[2] If (read a$6) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate y$8_@0:TObject[1:10] = Object { }
|
||||
[4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
|
||||
[5] Call mutate mutate$4:TFunction(mutate y$8_@0:TObject)
|
||||
[6] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[7] Const mutate z$9_@1:TObject = Object { }
|
||||
[8] Reassign store x$7_@0.z[1:10] = read z$9_@1:TObject
|
||||
[9] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[10] Return freeze x$7_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
) {
|
||||
scope @0 [1:10] deps=[read a$6] out=[x$7_@0] {
|
||||
[1] Const mutate x$7_@0:TObject[1:10] = Object { }
|
||||
if (read a$6) {
|
||||
[3] Const mutate y$8_@0:TObject[1:10] = Object { }
|
||||
[4] Reassign store x$7_@0.y[1:10] = read y$8_@0:TObject
|
||||
[5] Call mutate mutate$4:TFunction(mutate y$8_@0:TObject)
|
||||
} else {
|
||||
scope @1 [7:8] deps=[] out=[z$9_@1] {
|
||||
[7] Const mutate z$9_@1:TObject = Object { }
|
||||
}
|
||||
[8] Reassign store x$7_@0.z[1:10] = read z$9_@1:TObject
|
||||
}
|
||||
}
|
||||
return freeze x$7_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,35 +15,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$5_@0:TObject[1:6] = Object { }
|
||||
[2] Const mutate x$6_@0:TObject[1:6] = read a$5_@0:TObject
|
||||
[3] Const mutate y$7_@0:TObject[1:6] = Object { }
|
||||
[4] Reassign store y$7_@0.x[1:6] = read x$6_@0:TObject
|
||||
[5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
|
||||
[6] Return freeze y$7_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:6] deps=[] out=[y$7_@0] {
|
||||
[1] Const mutate a$5_@0:TObject[1:6] = Object { }
|
||||
[2] Const mutate x$6_@0:TObject[1:6] = read a$5_@0:TObject
|
||||
[3] Const mutate y$7_@0:TObject[1:6] = Object { }
|
||||
[4] Reassign store y$7_@0.x[1:6] = read x$6_@0:TObject
|
||||
[5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
|
||||
}
|
||||
return freeze y$7_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,35 +11,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4_@0 = Array []
|
||||
[2] Const mutate y$5_@1:TObject[2:5] = Object { x: read x$4_@0 }
|
||||
[3] Const mutate $6_@1[2:5] = Array []
|
||||
[4] Call mutate y$5_@1.x.push(mutate $6_@1)
|
||||
[5] Return freeze y$5_@1:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[x$4_@0] {
|
||||
[1] Const mutate x$4_@0 = Array []
|
||||
}
|
||||
scope @1 [2:5] deps=[read x$4_@0] out=[y$5_@1] {
|
||||
[2] Const mutate y$5_@1:TObject[2:5] = Object { x: read x$4_@0 }
|
||||
[3] Const mutate $6_@1[2:5] = Array []
|
||||
[4] Call mutate y$5_@1.x.push(mutate $6_@1)
|
||||
}
|
||||
return freeze y$5_@1:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -12,33 +12,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4_@0[1:5] = Array []
|
||||
[2] Const mutate y$5_@0:TObject[1:5] = Object { }
|
||||
[3] Reassign store y$5_@0.x[1:5] = read x$4_@0
|
||||
[4] Call mutate mutate$3:TFunction(mutate x$4_@0)
|
||||
[5] Return freeze y$5_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:5] deps=[] out=[y$5_@0] {
|
||||
[1] Const mutate x$4_@0[1:5] = Array []
|
||||
[2] Const mutate y$5_@0:TObject[1:5] = Object { }
|
||||
[3] Reassign store y$5_@0.x[1:5] = read x$4_@0
|
||||
[4] Call mutate mutate$3:TFunction(mutate x$4_@0)
|
||||
}
|
||||
return freeze y$5_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,35 +15,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$5_@0:TObject[1:6] = Object { }
|
||||
[2] Const mutate y$6_@0:TObject[1:6] = read a$5_@0:TObject
|
||||
[3] Const mutate x$7_@0[1:6] = Array []
|
||||
[4] Reassign store y$6_@0.x[1:6] = read x$7_@0
|
||||
[5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
|
||||
[6] Return freeze y$6_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:6] deps=[] out=[y$6_@0] {
|
||||
[1] Const mutate a$5_@0:TObject[1:6] = Object { }
|
||||
[2] Const mutate y$6_@0:TObject[1:6] = read a$5_@0:TObject
|
||||
[3] Const mutate x$7_@0[1:6] = Array []
|
||||
[4] Reassign store y$6_@0.x[1:6] = read x$7_@0
|
||||
[5] Call mutate mutate$4:TFunction(mutate a$5_@0:TObject)
|
||||
}
|
||||
return freeze y$6_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -12,33 +12,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4_@0[1:5] = Array []
|
||||
[2] Const mutate y$5_@0:TObject[1:5] = Object { }
|
||||
[3] Reassign store y$5_@0.x[1:5] = read x$4_@0
|
||||
[4] Call mutate mutate$3:TFunction(mutate y$5_@0:TObject)
|
||||
[5] Return freeze y$5_@0:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:5] deps=[] out=[y$5_@0] {
|
||||
[1] Const mutate x$4_@0[1:5] = Array []
|
||||
[2] Const mutate y$5_@0:TObject[1:5] = Object { }
|
||||
[3] Reassign store y$5_@0.x[1:5] = read x$4_@0
|
||||
[4] Call mutate mutate$3:TFunction(mutate y$5_@0:TObject)
|
||||
}
|
||||
return freeze y$5_@0:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,33 +11,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$3_@0 = Array []
|
||||
[2] Const mutate y$4_@1:TObject[2:4] = Object { }
|
||||
[3] Reassign store y$4_@1.x[2:4] = read x$3_@0
|
||||
[4] Return freeze y$4_@1:TObject
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[x$3_@0] {
|
||||
[1] Const mutate x$3_@0 = Array []
|
||||
}
|
||||
scope @1 [2:4] deps=[read x$3_@0] out=[y$4_@1] {
|
||||
[2] Const mutate y$4_@1:TObject[2:4] = Object { }
|
||||
[3] Reassign store y$4_@1.x[2:4] = read x$3_@0
|
||||
}
|
||||
return freeze y$4_@1:TObject
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -12,34 +12,6 @@ function foo(a, b, c) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$8:TPrimitive = 0
|
||||
[2] Const mutate x$0$9 = read a$5
|
||||
[3] Const mutate x$1$10 = read b$6
|
||||
[4] Const mutate x$2$11 = read c$7
|
||||
[5] Return read x$2$11
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
) {
|
||||
[1] Const mutate x$8:TPrimitive = 0
|
||||
[2] Const mutate x$0$9 = read a$5
|
||||
[3] Const mutate x$1$10 = read b$6
|
||||
[4] Const mutate x$2$11 = read c$7
|
||||
return read x$2$11
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,45 +13,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate $5:TPrimitive = 1
|
||||
[3] Const mutate $6:TPrimitive = Binary read x$4:TPrimitive === read $5:TPrimitive
|
||||
[4] Let mutate x$0$8_@0[1:7] = read x$4:TPrimitive
|
||||
[4] If (read $6:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate x$1$7:TPrimitive = 2
|
||||
[6] Reassign mutate x$0$8_@0[1:7] = read x$1$7:TPrimitive
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] Return read x$0$8_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate $5:TPrimitive = 1
|
||||
[3] Const mutate $6:TPrimitive = Binary read x$4:TPrimitive === read $5:TPrimitive
|
||||
scope @0 [1:7] deps=[] out=[x$0$8_@0] {
|
||||
[4] Let mutate x$0$8_@0[1:7] = read x$4:TPrimitive
|
||||
if (read $6:TPrimitive) {
|
||||
[5] Const mutate x$1$7:TPrimitive = 2
|
||||
[6] Reassign mutate x$0$8_@0[1:7] = read x$1$7:TPrimitive
|
||||
}
|
||||
}
|
||||
return read x$0$8_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -17,75 +17,12 @@ function Foo(cond) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function log(
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
function log() {}
|
||||
|
||||
```
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate str$6:TPrimitive = ""
|
||||
[2] Let mutate str$0$10_@0[1:8] = read str$6:TPrimitive
|
||||
[2] If (read cond$5) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate str$1$7:TPrimitive = "other test"
|
||||
[4] Call mutate log$4:TFunction(read str$1$7:TPrimitive)
|
||||
[5] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[6] Const mutate str$2$8:TPrimitive = "fallthrough test"
|
||||
[7] Reassign mutate str$0$10_@0[1:8] = read str$2$8:TPrimitive
|
||||
[7] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[8] Call mutate log$4:TFunction(read str$0$10_@0)
|
||||
[9] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Foo(
|
||||
cond,
|
||||
) {
|
||||
[1] Const mutate str$6:TPrimitive = ""
|
||||
scope @0 [1:8] deps=[read cond$5] out=[str$0$10_@0] {
|
||||
[2] Let mutate str$0$10_@0[1:8] = read str$6:TPrimitive
|
||||
if (read cond$5) {
|
||||
[3] Const mutate str$1$7:TPrimitive = "other test"
|
||||
[4] Call mutate log$4:TFunction(read str$1$7:TPrimitive)
|
||||
} else {
|
||||
[6] Const mutate str$2$8:TPrimitive = "fallthrough test"
|
||||
[7] Reassign mutate str$0$10_@0[1:8] = read str$2$8:TPrimitive
|
||||
}
|
||||
}
|
||||
[8] Call mutate log$4:TFunction(read str$0$10_@0)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -24,99 +24,6 @@ function foo(a, b, c, d) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$13:TPrimitive = 0
|
||||
[2] Const mutate $14:TPrimitive = true
|
||||
[3] If (read $14:TPrimitive) then:bb2 else:bb6 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Const mutate $15:TPrimitive = true
|
||||
[5] Let mutate x$0$18_@0[5:10] = undefined
|
||||
[5] If (read $15:TPrimitive) then:bb4 else:bb5 fallthrough=bb3
|
||||
bb4:
|
||||
predecessor blocks: bb2
|
||||
[6] Const mutate x$1$16 = read a$9
|
||||
[7] Reassign mutate x$0$18_@0[5:10] = read x$1$16
|
||||
[7] Goto bb3
|
||||
bb5:
|
||||
predecessor blocks: bb2
|
||||
[8] Const mutate x$2$17 = read b$10
|
||||
[9] Reassign mutate x$0$18_@0[5:10] = read x$2$17
|
||||
[9] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb5
|
||||
[10] read x$0$18_@0
|
||||
[11] Goto bb1
|
||||
bb6:
|
||||
predecessor blocks: bb0
|
||||
[12] Const mutate $19:TPrimitive = true
|
||||
[13] Let mutate x$3$22_@1[13:18] = undefined
|
||||
[13] If (read $19:TPrimitive) then:bb8 else:bb9 fallthrough=bb7
|
||||
bb8:
|
||||
predecessor blocks: bb6
|
||||
[14] Const mutate x$4$20 = read c$11
|
||||
[15] Reassign mutate x$3$22_@1[13:18] = read x$4$20
|
||||
[15] Goto bb7
|
||||
bb9:
|
||||
predecessor blocks: bb6
|
||||
[16] Const mutate x$5$21 = read d$12
|
||||
[17] Reassign mutate x$3$22_@1[13:18] = read x$5$21
|
||||
[17] Goto bb7
|
||||
bb7:
|
||||
predecessor blocks: bb8 bb9
|
||||
[18] read x$3$22_@1
|
||||
[19] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb3 bb7
|
||||
[20] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
d,
|
||||
) {
|
||||
[1] Const mutate x$13:TPrimitive = 0
|
||||
[2] Const mutate $14:TPrimitive = true
|
||||
if (read $14:TPrimitive) {
|
||||
[4] Const mutate $15:TPrimitive = true
|
||||
scope @0 [5:10] deps=[read a$9, read b$10] out=[x$0$18_@0] {
|
||||
[5] Let mutate x$0$18_@0[5:10] = undefined
|
||||
if (read $15:TPrimitive) {
|
||||
[6] Const mutate x$1$16 = read a$9
|
||||
[7] Reassign mutate x$0$18_@0[5:10] = read x$1$16
|
||||
} else {
|
||||
[8] Const mutate x$2$17 = read b$10
|
||||
[9] Reassign mutate x$0$18_@0[5:10] = read x$2$17
|
||||
}
|
||||
}
|
||||
[10] read x$0$18_@0
|
||||
} else {
|
||||
[12] Const mutate $19:TPrimitive = true
|
||||
scope @1 [13:18] deps=[read c$11, read d$12] out=[x$3$22_@1] {
|
||||
[13] Let mutate x$3$22_@1[13:18] = undefined
|
||||
if (read $19:TPrimitive) {
|
||||
[14] Const mutate x$4$20 = read c$11
|
||||
[15] Reassign mutate x$3$22_@1[13:18] = read x$4$20
|
||||
} else {
|
||||
[16] Const mutate x$5$21 = read d$12
|
||||
[17] Reassign mutate x$3$22_@1[13:18] = read x$5$21
|
||||
}
|
||||
}
|
||||
[18] read x$3$22_@1
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -16,55 +16,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate y$5:TPrimitive = 2
|
||||
[2] Const mutate $6:TPrimitive = 1
|
||||
[3] Const mutate $7:TPrimitive = Binary read y$5:TPrimitive > read $6:TPrimitive
|
||||
[4] Let mutate y$0$10_@0[4:9] = undefined
|
||||
[4] If (read $7:TPrimitive) then:bb2 else:bb3 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate y$1$8:TPrimitive = 1
|
||||
[6] Reassign mutate y$0$10_@0[4:9] = read y$1$8:TPrimitive
|
||||
[6] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[7] Const mutate y$2$9:TPrimitive = 2
|
||||
[8] Reassign mutate y$0$10_@0[4:9] = read y$2$9:TPrimitive
|
||||
[8] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb3
|
||||
[9] Const mutate x$11 = read y$0$10_@0
|
||||
[10] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate y$5:TPrimitive = 2
|
||||
[2] Const mutate $6:TPrimitive = 1
|
||||
[3] Const mutate $7:TPrimitive = Binary read y$5:TPrimitive > read $6:TPrimitive
|
||||
scope @0 [4:9] deps=[] out=[y$0$10_@0] {
|
||||
[4] Let mutate y$0$10_@0[4:9] = undefined
|
||||
if (read $7:TPrimitive) {
|
||||
[5] Const mutate y$1$8:TPrimitive = 1
|
||||
[6] Reassign mutate y$0$10_@0[4:9] = read y$1$8:TPrimitive
|
||||
} else {
|
||||
[7] Const mutate y$2$9:TPrimitive = 2
|
||||
[8] Reassign mutate y$0$10_@0[4:9] = read y$2$9:TPrimitive
|
||||
}
|
||||
}
|
||||
[9] Const mutate x$11 = read y$0$10_@0
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -9,27 +9,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$3:TPrimitive = 1
|
||||
[2] Const mutate y$4:TPrimitive = 2
|
||||
[3] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$3:TPrimitive = 1
|
||||
[2] Const mutate y$4:TPrimitive = 2
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,37 +13,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate y$5:TPrimitive = 2
|
||||
[3] If (read y$5:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[4] Const mutate z$6:TPrimitive = Binary read x$4:TPrimitive + read y$5:TPrimitive
|
||||
[5] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[6] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate y$5:TPrimitive = 2
|
||||
if (read y$5:TPrimitive) {
|
||||
[4] Const mutate z$6:TPrimitive = Binary read x$4:TPrimitive + read y$5:TPrimitive
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -24,83 +24,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$10:TPrimitive = 1
|
||||
[2] Const mutate $11:TPrimitive = 2
|
||||
[3] Const mutate $12:TPrimitive = Binary read x$10:TPrimitive === read $11:TPrimitive
|
||||
[4] Const mutate $13:TPrimitive = 1
|
||||
[5] Const mutate $14:TPrimitive = Binary read x$10:TPrimitive === read $13:TPrimitive
|
||||
[6] Let mutate x$0$21_@0[6:16] = undefined
|
||||
[6] Switch (read x$10:TPrimitive)
|
||||
Case read $14:TPrimitive: bb5
|
||||
Case read $12:TPrimitive: bb3
|
||||
Default: bb2
|
||||
Fallthrough: bb1
|
||||
bb5:
|
||||
predecessor blocks: bb0
|
||||
[7] Const mutate $15:TPrimitive = 1
|
||||
[8] Const mutate x$1$16:TPrimitive = Binary read x$10:TPrimitive + read $15:TPrimitive
|
||||
[9] Reassign mutate x$0$21_@0[6:16] = read x$1$16:TPrimitive
|
||||
[9] Goto bb1
|
||||
bb3:
|
||||
predecessor blocks: bb0
|
||||
[10] Const mutate $17:TPrimitive = 2
|
||||
[11] Const mutate x$2$18:TPrimitive = Binary read x$10:TPrimitive + read $17:TPrimitive
|
||||
[12] Reassign mutate x$0$21_@0[6:16] = read x$2$18:TPrimitive
|
||||
[12] Goto bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[13] Const mutate $19:TPrimitive = 3
|
||||
[14] Const mutate x$3$20:TPrimitive = Binary read x$10:TPrimitive + read $19:TPrimitive
|
||||
[15] Reassign mutate x$0$21_@0[6:16] = read x$3$20:TPrimitive
|
||||
[15] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb5 bb3 bb2
|
||||
[16] Const mutate y$22 = read x$0$21_@0
|
||||
[17] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$10:TPrimitive = 1
|
||||
[2] Const mutate $11:TPrimitive = 2
|
||||
[3] Const mutate $12:TPrimitive = Binary read x$10:TPrimitive === read $11:TPrimitive
|
||||
[4] Const mutate $13:TPrimitive = 1
|
||||
[5] Const mutate $14:TPrimitive = Binary read x$10:TPrimitive === read $13:TPrimitive
|
||||
scope @0 [6:16] deps=[] out=[x$0$21_@0] {
|
||||
[6] Let mutate x$0$21_@0[6:16] = undefined
|
||||
switch (read x$10:TPrimitive) {
|
||||
case read $14:TPrimitive: {
|
||||
[7] Const mutate $15:TPrimitive = 1
|
||||
[8] Const mutate x$1$16:TPrimitive = Binary read x$10:TPrimitive + read $15:TPrimitive
|
||||
[9] Reassign mutate x$0$21_@0[6:16] = read x$1$16:TPrimitive
|
||||
break bb1
|
||||
}
|
||||
case read $12:TPrimitive: {
|
||||
[10] Const mutate $17:TPrimitive = 2
|
||||
[11] Const mutate x$2$18:TPrimitive = Binary read x$10:TPrimitive + read $17:TPrimitive
|
||||
[12] Reassign mutate x$0$21_@0[6:16] = read x$2$18:TPrimitive
|
||||
break bb1
|
||||
}
|
||||
default: {
|
||||
[13] Const mutate $19:TPrimitive = 3
|
||||
[14] Const mutate x$3$20:TPrimitive = Binary read x$10:TPrimitive + read $19:TPrimitive
|
||||
[15] Reassign mutate x$0$21_@0[6:16] = read x$3$20:TPrimitive
|
||||
}
|
||||
}
|
||||
}
|
||||
[16] Const mutate y$22 = read x$0$21_@0
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -12,45 +12,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate $5:TPrimitive = 1
|
||||
[3] Const mutate $6:TPrimitive = Binary read x$4:TPrimitive === read $5:TPrimitive
|
||||
[4] Let mutate x$0$8_@0[1:7] = read x$4:TPrimitive
|
||||
[4] If (read $6:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate x$1$7:TPrimitive = 2
|
||||
[6] Reassign mutate x$0$8_@0[1:7] = read x$1$7:TPrimitive
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] Throw read x$0$8_@0
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$4:TPrimitive = 1
|
||||
[2] Const mutate $5:TPrimitive = 1
|
||||
[3] Const mutate $6:TPrimitive = Binary read x$4:TPrimitive === read $5:TPrimitive
|
||||
scope @0 [1:7] deps=[] out=[x$0$8_@0] {
|
||||
[4] Let mutate x$0$8_@0[1:7] = read x$4:TPrimitive
|
||||
if (read $6:TPrimitive) {
|
||||
[5] Const mutate x$1$7:TPrimitive = 2
|
||||
[6] Reassign mutate x$0$8_@0[1:7] = read x$1$7:TPrimitive
|
||||
}
|
||||
}
|
||||
throw read x$0$8_@0
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,46 +13,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
[2] While test=bb1 loop=bb3 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb3
|
||||
[3] Const mutate $6:TPrimitive = 10
|
||||
[4] Const mutate $8:TPrimitive = Binary read x$5:TPrimitive < read $6:TPrimitive
|
||||
[5] If (read $8:TPrimitive) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[6] Const mutate $9:TPrimitive = 1
|
||||
[7] Binary read x$5:TPrimitive + read $9:TPrimitive
|
||||
[8] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[9] Return read x$5:TPrimitive
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
[1] Const mutate x$5:TPrimitive = 1
|
||||
while (
|
||||
[3] Const mutate $6:TPrimitive = 10
|
||||
[4] Const mutate $8:TPrimitive = Binary read x$5:TPrimitive < read $6:TPrimitive
|
||||
read $8:TPrimitive
|
||||
) {
|
||||
[6] Const mutate $9:TPrimitive = 1
|
||||
[7] Binary read x$5:TPrimitive + read $9:TPrimitive
|
||||
}
|
||||
return read x$5:TPrimitive
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -13,48 +13,6 @@ function foo() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Let mutate x$5_@0:TPrimitive[1:9] = 1
|
||||
[2] While test=bb1 loop=bb3 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb3
|
||||
[3] Const mutate $6:TPrimitive = 10
|
||||
[4] Const mutate $8:TPrimitive = Binary read x$5_@0:TPrimitive < read $6:TPrimitive
|
||||
[5] If (read $8:TPrimitive) then:bb3 else:bb2 fallthrough=bb2
|
||||
bb3:
|
||||
predecessor blocks: bb1
|
||||
[6] Const mutate $9:TPrimitive = 1
|
||||
[7] Reassign mutate x$5_@0:TPrimitive[1:9] = Binary read x$5_@0:TPrimitive + read $9:TPrimitive
|
||||
[8] Goto(Continue) bb1
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[9] Return read x$5_@0:TPrimitive
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
) {
|
||||
scope @0 [1:9] deps=[] out=[x$5_@0] {
|
||||
[1] Let mutate x$5_@0:TPrimitive[1:9] = 1
|
||||
while (
|
||||
[3] Const mutate $6:TPrimitive = 10
|
||||
[4] Const mutate $8:TPrimitive = Binary read x$5_@0:TPrimitive < read $6:TPrimitive
|
||||
read $8:TPrimitive
|
||||
) {
|
||||
[6] Const mutate $9:TPrimitive = 1
|
||||
[7] Reassign mutate x$5_@0:TPrimitive[1:9] = Binary read x$5_@0:TPrimitive + read $9:TPrimitive
|
||||
}
|
||||
}
|
||||
return read x$5_@0:TPrimitive
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -28,87 +28,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$10_@1[1:12] = Array []
|
||||
[2] Const mutate y$11:TPrimitive = undefined
|
||||
[3] Const mutate $12:TPrimitive = false
|
||||
[4] Const mutate $13:TPrimitive = true
|
||||
[5] Const mutate $14:TPrimitive = 1
|
||||
[6] Let mutate y$0$20_@1[1:12] = read y$11:TPrimitive
|
||||
[6] Switch (read props$9.p0)
|
||||
Case read $14:TPrimitive: bb1
|
||||
Case read $13:TPrimitive: bb6
|
||||
Default: bb1
|
||||
Case read $12:TPrimitive: bb2
|
||||
Fallthrough: bb1
|
||||
bb6:
|
||||
predecessor blocks: bb0
|
||||
[7] Call mutate x$10_@1.push(read props$9.p2)
|
||||
[8] Const mutate y$1$15_@2 = Array []
|
||||
[9] Reassign mutate y$0$20_@1[1:12] = read y$1$15_@2
|
||||
[9] Goto bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[10] Const mutate y$2$16 = read x$10_@1
|
||||
[11] Reassign mutate y$0$20_@1[1:12] = read y$2$16
|
||||
[11] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb0 bb6 bb2
|
||||
[12] Const mutate child$19_@3 = JSX <read Component$0 data={freeze x$10_@1} ></read Component$0>
|
||||
[13] Call read y$0$20_@1.push(read props$9.p4)
|
||||
[14] Const mutate t8$22_@4 = JSX <read Component$0 data={freeze y$0$20_@1} >{read child$19_@3}</read Component$0>
|
||||
[15] Return read t8$22_@4
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @1 [1:12] deps=[read props$9.p0, read props$9.p2] out=[x$10_@1] {
|
||||
[1] Const mutate x$10_@1[1:12] = Array []
|
||||
[2] Const mutate y$11:TPrimitive = undefined
|
||||
[3] Const mutate $12:TPrimitive = false
|
||||
[4] Const mutate $13:TPrimitive = true
|
||||
[5] Const mutate $14:TPrimitive = 1
|
||||
[6] Let mutate y$0$20_@1[1:12] = read y$11:TPrimitive
|
||||
switch (read props$9.p0) {
|
||||
case read $14:TPrimitive: {
|
||||
break bb1
|
||||
}
|
||||
case read $13:TPrimitive: {
|
||||
[7] Call mutate x$10_@1.push(read props$9.p2)
|
||||
scope @2 [8:9] deps=[] out=[y$1$15_@2] {
|
||||
[8] Const mutate y$1$15_@2 = Array []
|
||||
}
|
||||
[9] Reassign mutate y$0$20_@1[1:12] = read y$1$15_@2
|
||||
break bb1
|
||||
}
|
||||
default: {
|
||||
break bb1
|
||||
}
|
||||
case read $12:TPrimitive: {
|
||||
[10] Const mutate y$2$16 = read x$10_@1
|
||||
[11] Reassign mutate y$0$20_@1[1:12] = read y$2$16
|
||||
}
|
||||
}
|
||||
}
|
||||
scope @3 [12:13] deps=[freeze x$10_@1] out=[child$19_@3] {
|
||||
[12] Const mutate child$19_@3 = JSX <read Component$0 data={freeze x$10_@1} ></read Component$0>
|
||||
}
|
||||
[13] Call read y$0$20_@1.push(read props$9.p4)
|
||||
scope @4 [14:15] deps=[freeze y$0$20_@1, read child$19_@3] out=[$22_@4] {
|
||||
[14] Const mutate $22_@4 = JSX <read Component$0 data={freeze y$0$20_@1} >{read child$19_@3}</read Component$0>
|
||||
}
|
||||
return read $22_@4
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -32,98 +32,6 @@ function foo(x) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate y$10:TPrimitive = undefined
|
||||
[2] Const mutate $11:TPrimitive = 5
|
||||
[3] Const mutate $12:TPrimitive = 4
|
||||
[4] Const mutate $13:TPrimitive = 3
|
||||
[5] Const mutate $14:TPrimitive = 2
|
||||
[6] Const mutate $15:TPrimitive = 1
|
||||
[7] Const mutate $16:TPrimitive = 0
|
||||
[8] Switch (read x$9)
|
||||
Case read $16:TPrimitive: bb10
|
||||
Case read $15:TPrimitive: bb9
|
||||
Case read $14:TPrimitive: bb1
|
||||
Case read $13:TPrimitive: bb5
|
||||
Case read $12:TPrimitive: bb4
|
||||
Case read $11:TPrimitive: bb3
|
||||
Default: bb2
|
||||
Fallthrough: bb1
|
||||
bb10:
|
||||
predecessor blocks: bb0
|
||||
[9] Const mutate y$0$17:TPrimitive = 0
|
||||
[10] Goto bb9
|
||||
bb9:
|
||||
predecessor blocks: bb10 bb0
|
||||
[11] Const mutate y$1$18:TPrimitive = 1
|
||||
[12] Goto bb1
|
||||
bb5:
|
||||
predecessor blocks: bb0
|
||||
[13] Const mutate y$2$19:TPrimitive = 3
|
||||
[14] Goto bb1
|
||||
bb4:
|
||||
predecessor blocks: bb0
|
||||
[15] Const mutate y$3$20:TPrimitive = 4
|
||||
[16] Goto bb3
|
||||
bb3:
|
||||
predecessor blocks: bb4 bb0
|
||||
[17] Const mutate y$4$21:TPrimitive = 5
|
||||
[18] Goto bb2
|
||||
bb2:
|
||||
predecessor blocks: bb3 bb0
|
||||
[19] Const mutate y$5$22:TPrimitive = 0
|
||||
[20] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb9 bb0 bb5 bb2
|
||||
[21] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
x,
|
||||
) {
|
||||
[1] Const mutate y$10:TPrimitive = undefined
|
||||
[2] Const mutate $11:TPrimitive = 5
|
||||
[3] Const mutate $12:TPrimitive = 4
|
||||
[4] Const mutate $13:TPrimitive = 3
|
||||
[5] Const mutate $14:TPrimitive = 2
|
||||
[6] Const mutate $15:TPrimitive = 1
|
||||
[7] Const mutate $16:TPrimitive = 0
|
||||
switch (read x$9) {
|
||||
case read $16:TPrimitive: {
|
||||
[9] Const mutate y$0$17:TPrimitive = 0
|
||||
}
|
||||
case read $15:TPrimitive: {
|
||||
[11] Const mutate y$1$18:TPrimitive = 1
|
||||
break bb1
|
||||
}
|
||||
case read $14:TPrimitive: {
|
||||
break bb1
|
||||
}
|
||||
case read $13:TPrimitive: {
|
||||
[13] Const mutate y$2$19:TPrimitive = 3
|
||||
break bb1
|
||||
}
|
||||
case read $12:TPrimitive: {
|
||||
[15] Const mutate y$3$20:TPrimitive = 4
|
||||
}
|
||||
case read $11:TPrimitive: {
|
||||
[17] Const mutate y$4$21:TPrimitive = 5
|
||||
}
|
||||
default: {
|
||||
[19] Const mutate y$5$22:TPrimitive = 0
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -23,75 +23,6 @@ function Component(props) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$9_@1[1:12] = Array []
|
||||
[2] Const mutate y$10:TPrimitive = undefined
|
||||
[3] Const mutate $11:TPrimitive = false
|
||||
[4] Const mutate $12:TPrimitive = true
|
||||
[5] Let mutate y$0$20_@1[1:12] = read y$10:TPrimitive
|
||||
[5] Switch (read props$8.p0)
|
||||
Case read $12:TPrimitive: bb4
|
||||
Case read $11:TPrimitive: bb2
|
||||
Default: bb1
|
||||
Fallthrough: bb1
|
||||
bb4:
|
||||
predecessor blocks: bb0
|
||||
[6] Call mutate x$9_@1.push(read props$8.p2)
|
||||
[7] Call mutate x$9_@1.push(read props$8.p3)
|
||||
[8] Const mutate y$1$13_@2 = Array []
|
||||
[9] Goto bb2
|
||||
bb2:
|
||||
predecessor blocks: bb4 bb0
|
||||
[10] Const mutate y$2$15 = read x$9_@1
|
||||
[11] Reassign mutate y$0$20_@1[1:12] = read y$2$15
|
||||
[11] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[12] Const mutate child$19_@3 = JSX <read Component$0 data={freeze x$9_@1} ></read Component$0>
|
||||
[13] Call read y$0$20_@1.push(read props$8.p4)
|
||||
[14] Const mutate t8$23_@4 = JSX <read Component$0 data={read y$0$20_@1} >{read child$19_@3}</read Component$0>
|
||||
[15] Return read t8$23_@4
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function Component(
|
||||
props,
|
||||
) {
|
||||
scope @1 [1:12] deps=[read props$8.p0, read props$8.p2, read props$8.p3] out=[x$9_@1] {
|
||||
[1] Const mutate x$9_@1[1:12] = Array []
|
||||
[2] Const mutate y$10:TPrimitive = undefined
|
||||
[3] Const mutate $11:TPrimitive = false
|
||||
[4] Const mutate $12:TPrimitive = true
|
||||
[5] Let mutate y$0$20_@1[1:12] = read y$10:TPrimitive
|
||||
switch (read props$8.p0) {
|
||||
case read $12:TPrimitive: {
|
||||
[6] Call mutate x$9_@1.push(read props$8.p2)
|
||||
[7] Call mutate x$9_@1.push(read props$8.p3)
|
||||
[8] Const mutate y$1$13_@2 = Array []
|
||||
}
|
||||
case read $11:TPrimitive: {
|
||||
[10] Const mutate y$2$15 = read x$9_@1
|
||||
[11] Reassign mutate y$0$20_@1[1:12] = read y$2$15
|
||||
}
|
||||
}
|
||||
}
|
||||
scope @3 [12:13] deps=[freeze x$9_@1] out=[child$19_@3] {
|
||||
[12] Const mutate child$19_@3 = JSX <read Component$0 data={freeze x$9_@1} ></read Component$0>
|
||||
}
|
||||
[13] Call read y$0$20_@1.push(read props$8.p4)
|
||||
scope @4 [14:15] deps=[read y$0$20_@1, read child$19_@3] out=[$23_@4] {
|
||||
[14] Const mutate $23_@4 = JSX <read Component$0 data={read y$0$20_@1} >{read child$19_@3}</read Component$0>
|
||||
}
|
||||
return read $23_@4
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -17,39 +17,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$6_@0:TObject[1:9] = Object { }
|
||||
[2] Const mutate p$7_@0:TObject[1:9] = Object { }
|
||||
[3] Const mutate q$8_@0:TObject[1:9] = Object { }
|
||||
[4] Const mutate y$9_@0:TObject[1:9] = Object { }
|
||||
[5] Reassign store x$6_@0.y[1:9] = read y$9_@0:TObject
|
||||
[6] Reassign store p$7_@0.y[1:9] = read x$6_@0.y
|
||||
[7] Reassign store q$8_@0.y[1:9] = read p$7_@0.y
|
||||
[8] Call mutate mutate$5:TFunction(mutate q$8_@0:TObject)
|
||||
[9] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
[1] Const mutate x$6_@0:TObject[1:9] = Object { }
|
||||
[2] Const mutate p$7_@0:TObject[1:9] = Object { }
|
||||
[3] Const mutate q$8_@0:TObject[1:9] = Object { }
|
||||
[4] Const mutate y$9_@0:TObject[1:9] = Object { }
|
||||
[5] Reassign store x$6_@0.y[1:9] = read y$9_@0:TObject
|
||||
[6] Reassign store p$7_@0.y[1:9] = read x$6_@0.y
|
||||
[7] Reassign store q$8_@0.y[1:9] = read p$7_@0.y
|
||||
[8] Call mutate mutate$5:TFunction(mutate q$8_@0:TObject)
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -10,37 +10,6 @@ function component(a, b) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate $7:TPrimitive = Binary read a$5:TPrimitive > read b$6:TPrimitive
|
||||
[2] If (read $7:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[3] Const mutate m$8_@0:TObject = Object { }
|
||||
[4] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[5] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
a,
|
||||
b,
|
||||
) {
|
||||
[1] Const mutate $7:TPrimitive = Binary read a$5:TPrimitive > read b$6:TPrimitive
|
||||
if (read $7:TPrimitive) {
|
||||
[3] Const mutate m$8_@0:TObject = Object { }
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -12,43 +12,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate a$7_@0:TPrimitive = Call mutate some$1:TFunction()
|
||||
[2] Const mutate b$8_@1:TPrimitive = Call mutate someOther$3:TFunction()
|
||||
[3] Const mutate $9:TPrimitive = Binary read a$7_@0:TPrimitive > read b$8_@1:TPrimitive
|
||||
[4] If (read $9:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate m$10_@2:TObject = Object { }
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[a$7_@0] {
|
||||
[1] Const mutate a$7_@0:TPrimitive = Call mutate some$1:TFunction()
|
||||
}
|
||||
scope @1 [2:3] deps=[] out=[b$8_@1] {
|
||||
[2] Const mutate b$8_@1:TPrimitive = Call mutate someOther$3:TFunction()
|
||||
}
|
||||
[3] Const mutate $9:TPrimitive = Binary read a$7_@0:TPrimitive > read b$8_@1:TPrimitive
|
||||
if (read $9:TPrimitive) {
|
||||
[5] Const mutate m$10_@2:TObject = Object { }
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -9,31 +9,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate $4:TPrimitive = 1
|
||||
[2] Const mutate x$5_@0:TObject = Object { t: read $4:TPrimitive }
|
||||
[3] Const mutate p$6 = read x$5_@0.t
|
||||
[4] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
[1] Const mutate $4:TPrimitive = 1
|
||||
scope @0 [2:3] deps=[] out=[x$5_@0] {
|
||||
[2] Const mutate x$5_@0:TObject = Object { t: read $4:TPrimitive }
|
||||
}
|
||||
[3] Const mutate p$6 = read x$5_@0.t
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -15,50 +15,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate t0$10_@0 = Call mutate makeSomePrimitive$1:TFunction()
|
||||
[2] Const mutate t1$11_@1 = Call mutate makeSomePrimitive$1:TFunction()
|
||||
[3] Const mutate x$12_@2:TObject = Object { u: read t0$10_@0, v: read t1$11_@1 }
|
||||
[4] Const mutate u$13:TPrimitive = read x$12_@2.u
|
||||
[5] Const mutate v$14:TPrimitive = read x$12_@2.v
|
||||
[6] Const mutate $15:TPrimitive = Binary read u$13:TPrimitive > read v$14:TPrimitive
|
||||
[7] If (read $15:TPrimitive) then:bb1 else:bb1 fallthrough=bb1
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[8] Const mutate y$16 = read x$12_@2.u
|
||||
[9] Const mutate z$17 = read x$12_@2.v
|
||||
[10] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[$10_@0] {
|
||||
[1] Const mutate $10_@0 = Call mutate makeSomePrimitive$1:TFunction()
|
||||
}
|
||||
scope @1 [2:3] deps=[] out=[$11_@1] {
|
||||
[2] Const mutate $11_@1 = Call mutate makeSomePrimitive$1:TFunction()
|
||||
}
|
||||
scope @2 [3:4] deps=[read $10_@0, read $11_@1] out=[x$12_@2] {
|
||||
[3] Const mutate x$12_@2:TObject = Object { u: read $10_@0, v: read $11_@1 }
|
||||
}
|
||||
[4] Const mutate u$13:TPrimitive = read x$12_@2.u
|
||||
[5] Const mutate v$14:TPrimitive = read x$12_@2.v
|
||||
[6] Const mutate $15:TPrimitive = Binary read u$13:TPrimitive > read v$14:TPrimitive
|
||||
if (read $15:TPrimitive) {
|
||||
}
|
||||
[8] Const mutate y$16 = read x$12_@2.u
|
||||
[9] Const mutate z$17 = read x$12_@2.v
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,35 +11,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$4_@0:TObject[1:4] = Object { }
|
||||
[2] Const mutate q$5_@1:TObject = Object { }
|
||||
[3] Reassign store x$4_@0.t[1:4] = read q$5_@1:TObject
|
||||
[4] Const mutate z$6 = read x$4_@0.t
|
||||
[5] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
scope @0 [1:4] deps=[] out=[x$4_@0] {
|
||||
[1] Const mutate x$4_@0:TObject[1:4] = Object { }
|
||||
scope @1 [2:3] deps=[] out=[q$5_@1] {
|
||||
[2] Const mutate q$5_@1:TObject = Object { }
|
||||
}
|
||||
[3] Reassign store x$4_@0.t[1:4] = read q$5_@1:TObject
|
||||
}
|
||||
[4] Const mutate z$6 = read x$4_@0.t
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -18,45 +18,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate p$7_@0:TPrimitive = Call mutate makePrimitive$1:TFunction()
|
||||
[2] Binary read p$7_@0:TPrimitive + read p$7_@0:TPrimitive
|
||||
[3] Const mutate o$8_@1:TObject = Object { }
|
||||
[4] Const mutate x$9_@2:TObject[4:8] = Object { }
|
||||
[5] Reassign store x$9_@2.t[4:8] = read p$7_@0:TPrimitive
|
||||
[6] Const mutate z$10_@2[4:8] = read x$9_@2.t
|
||||
[7] Reassign store x$9_@2.t[4:8] = read o$8_@1:TObject
|
||||
[8] Const mutate y$11 = read x$9_@2.t
|
||||
[9] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[p$7_@0] {
|
||||
[1] Const mutate p$7_@0:TPrimitive = Call mutate makePrimitive$1:TFunction()
|
||||
}
|
||||
[2] Binary read p$7_@0:TPrimitive + read p$7_@0:TPrimitive
|
||||
scope @1 [3:4] deps=[] out=[o$8_@1] {
|
||||
[3] Const mutate o$8_@1:TObject = Object { }
|
||||
}
|
||||
scope @2 [4:8] deps=[read p$7_@0:TPrimitive, read o$8_@1:TObject] out=[x$9_@2] {
|
||||
[4] Const mutate x$9_@2:TObject[4:8] = Object { }
|
||||
[5] Reassign store x$9_@2.t[4:8] = read p$7_@0:TPrimitive
|
||||
[6] Const mutate z$10_@2[4:8] = read x$9_@2.t
|
||||
[7] Reassign store x$9_@2.t[4:8] = read o$8_@1:TObject
|
||||
}
|
||||
[8] Const mutate y$11 = read x$9_@2.t
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -9,27 +9,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$3:TPrimitive = 1
|
||||
[2] Const mutate y$4:TPrimitive = 2
|
||||
[3] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
[1] Const mutate x$3:TPrimitive = 1
|
||||
[2] Const mutate y$4:TPrimitive = 2
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -14,45 +14,6 @@ function component() {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] Const mutate x$7_@0:TPrimitive = Call mutate foo$1:TFunction()
|
||||
[2] Const mutate y$8_@1:TPrimitive = Call mutate foo$1:TFunction()
|
||||
[3] Const mutate $9:TPrimitive = Binary read x$7_@0:TPrimitive > read y$8_@1:TPrimitive
|
||||
[4] If (read $9:TPrimitive) then:bb2 else:bb1 fallthrough=bb1
|
||||
bb2:
|
||||
predecessor blocks: bb0
|
||||
[5] Const mutate z$10_@2:TObject = Object { }
|
||||
[6] Goto bb1
|
||||
bb1:
|
||||
predecessor blocks: bb2 bb0
|
||||
[7] Const mutate z$12_@3 = Call mutate foo$1:TFunction()
|
||||
[8] Return
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function component(
|
||||
) {
|
||||
scope @0 [1:2] deps=[] out=[x$7_@0] {
|
||||
[1] Const mutate x$7_@0:TPrimitive = Call mutate foo$1:TFunction()
|
||||
}
|
||||
scope @1 [2:3] deps=[] out=[y$8_@1] {
|
||||
[2] Const mutate y$8_@1:TPrimitive = Call mutate foo$1:TFunction()
|
||||
}
|
||||
[3] Const mutate $9:TPrimitive = Binary read x$7_@0:TPrimitive > read y$8_@1:TPrimitive
|
||||
if (read $9:TPrimitive) {
|
||||
[5] Const mutate z$10_@2:TObject = Object { }
|
||||
}
|
||||
[7] Const mutate z$12_@3 = Call mutate foo$1:TFunction()
|
||||
return
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
@@ -11,36 +11,6 @@ function foo(a, b) {
|
||||
|
||||
```
|
||||
|
||||
## HIR
|
||||
|
||||
```
|
||||
bb0:
|
||||
[1] While test=bb1 loop=bb2 fallthrough=bb2
|
||||
bb1:
|
||||
predecessor blocks: bb0
|
||||
[2] If (read a$3) then:bb2 else:bb2 fallthrough=bb2
|
||||
bb2:
|
||||
predecessor blocks: bb1
|
||||
[3] Return read b$4
|
||||
```
|
||||
|
||||
## Reactive Scopes
|
||||
|
||||
```
|
||||
function foo(
|
||||
a,
|
||||
b,
|
||||
) {
|
||||
while (
|
||||
read a$3
|
||||
) {
|
||||
break
|
||||
}
|
||||
return read b$4
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Code
|
||||
|
||||
```javascript
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user