Store only data for variables declared in current lexical scope.

Remove data for other variables (when leaving a scope).
This commit is contained in:
Svetlana Isakova
2014-03-05 19:35:39 +04:00
parent 9dd23d9289
commit 35c6a656c9
17 changed files with 219 additions and 131 deletions
@@ -10,7 +10,7 @@ fun foo() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val b: Boolean if (1 < 2) { use(b) } else { b = true } })
v(val b: Boolean) INIT: in: {} out: {b=D}
mark(if (1 < 2) { use(b) } else { b = true }) INIT: in: {b=D} out: {b=D}
@@ -30,11 +30,11 @@ L2:
w(b) INIT: in: {b=D} out: {b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
L1:
L3:
1 <END> INIT: in: {b=D} out: {b=D}
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {b=D} out: {b=D} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== use ==
fun use(vararg a: Any?) = a
@@ -8,7 +8,7 @@ fun foo() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val a = 1 val f = { (x: Int) -> val y = x + a use(a) } })
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
@@ -16,16 +16,16 @@ L0:
v(val f = { (x: Int) -> val y = x + a use(a) }) INIT: in: {a=ID} out: {a=ID, f=D}
mark({ (x: Int) -> val y = x + a use(a) }) INIT: in: {a=ID, f=D} out: {a=ID, f=D}
jmp?(L2)
d({ (x: Int) -> val y = x + a use(a) }) INIT: in: {a=ID, f=D, x=ID, y=ID} out: {a=ID, f=D, x=ID, y=ID} USE: in: {a=READ, x=READ} out: {a=READ, x=READ}
d({ (x: Int) -> val y = x + a use(a) }) USE: in: {a=READ} out: {a=READ}
L2:
r({ (x: Int) -> val y = x + a use(a) }) INIT: in: {a=ID, f=D} out: {a=ID, f=D}
r({ (x: Int) -> val y = x + a use(a) })
w(f) INIT: in: {a=ID, f=D} out: {a=ID, f=ID}
L1:
1 <END> INIT: in: {a=ID, f=ID} out: {a=ID, f=ID}
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, f=D, x=ID, y=ID} out: {a=ID, f=D, x=ID, y=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== anonymous_0 ==
{ (x: Int) ->
@@ -48,11 +48,11 @@ L3:
r(a) USE: in: {} out: {a=READ}
call(use, use)
L4:
3 <END>
3 <END> INIT: in: {a=ID, f=D, x=ID} out: {a=ID, f=D, x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, f=D, x=ID, y=ID} out: {a=ID, f=D, x=ID, y=ID} USE: in: {} out: {}
<SINK> INIT: in: {a=ID, f=D, x=ID} out: {a=ID, f=D, x=ID} USE: in: {} out: {}
=====================
== use ==
fun use(vararg a: Any?) = a
@@ -7,7 +7,7 @@ fun foo() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val a = 1 val b: Int b = 2 42 })
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
@@ -17,11 +17,11 @@ L0:
w(b) INIT: in: {a=ID, b=D} out: {a=ID, b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
r(42) INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
L1:
1 <END>
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== bar ==
fun bar(foo: Foo) {
@@ -7,7 +7,7 @@ fun foo() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ var a = 1 use(a) a = 2 use(a) })
v(var a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
@@ -21,11 +21,11 @@ L0:
r(a) USE: in: {} out: {a=READ}
call(use, use)
L1:
1 <END>
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== bar ==
fun bar() {
@@ -34,17 +34,17 @@ fun bar() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val b: Int b = 3 })
v(val b: Int) INIT: in: {} out: {b=D}
r(3) INIT: in: {b=D} out: {b=D} USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b) INIT: in: {b=D} out: {b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
r(3) INIT: in: {b=D} out: {b=D} USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b) INIT: in: {b=D} out: {b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
L1:
1 <END> INIT: in: {b=ID} out: {b=ID}
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {b=ID} out: {b=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== use ==
fun use(a: Int) = a
@@ -11,7 +11,7 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" do { var a = 2 } while (a > 0) "after" })
mark("before")
r("before")
r("before") USE: in: {} out: {}
3 mark(do { var a = 2 } while (a > 0))
L2 [loop entry point]:
L4 [body entry point]:
@@ -27,12 +27,12 @@ L5 [condition entry point]:
jt(L2 [loop entry point]) USE: in: {a=READ} out: {a=READ}
L3 [loop exit point]:
read (Unit)
2 mark("after")
2 mark("after") INIT: in: {} out: {}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
@@ -11,7 +11,7 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" for (i in 1..10) { val a = i } "after" })
mark("before")
r("before")
r("before") USE: in: {} out: {}
3 mark(for (i in 1..10) { val a = i })
mark(1..10)
r(1)
@@ -23,19 +23,19 @@ L3:
jmp?(L2) INIT: in: {i=ID} out: {i=ID}
L4 [loop entry point]:
L5 [body entry point]:
4 mark({ val a = i }) INIT: in: {a=ID, i=ID} out: {a=ID, i=ID}
v(val a = i)
r(i)
w(a)
3 jmp?(L4 [loop entry point]) USE: in: {i=READ} out: {i=READ}
4 mark({ val a = i })
v(val a = i) INIT: in: {i=ID} out: {a=D, i=ID}
r(i) INIT: in: {a=D, i=ID} out: {a=D, i=ID}
w(a) INIT: in: {a=D, i=ID} out: {a=ID, i=ID}
3 jmp?(L4 [loop entry point]) INIT: in: {i=ID} out: {i=ID} USE: in: {i=READ} out: {i=READ}
L2:
read (Unit)
2 mark("after")
2 mark("after") INIT: in: {} out: {}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, i=ID} out: {a=ID, i=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
@@ -9,7 +9,7 @@ fun foo() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ "before" val b = 1 val f = { (x: Int) -> val a = x + b } "after" })
mark("before")
r("before")
@@ -19,18 +19,18 @@ L0:
v(val f = { (x: Int) -> val a = x + b }) INIT: in: {b=ID} out: {b=ID, f=D}
mark({ (x: Int) -> val a = x + b }) INIT: in: {b=ID, f=D} out: {b=ID, f=D}
jmp?(L2)
d({ (x: Int) -> val a = x + b }) INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
d({ (x: Int) -> val a = x + b }) USE: in: {b=READ} out: {b=READ}
L2:
r({ (x: Int) -> val a = x + b }) INIT: in: {b=ID, f=D} out: {b=ID, f=D}
r({ (x: Int) -> val a = x + b })
w(f) INIT: in: {b=ID, f=D} out: {b=ID, f=ID}
mark("after") INIT: in: {b=ID, f=ID} out: {b=ID, f=ID}
r("after")
L1:
1 <END>
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== anonymous_0 ==
{ (x: Int) ->
@@ -43,15 +43,15 @@ L3:
w(x) INIT: in: {b=ID, f=D, x=D} out: {b=ID, f=D, x=ID}
4 mark(val a = x + b) INIT: in: {b=ID, f=D, x=ID} out: {b=ID, f=D, x=ID}
v(val a = x + b) INIT: in: {b=ID, f=D, x=ID} out: {a=D, b=ID, f=D, x=ID}
mark(x + b) INIT: in: {a=D, b=ID, f=D, x=ID} out: {a=D, b=ID, f=D, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) USE: in: {b=READ} out: {b=READ, x=READ}
r(b) USE: in: {} out: {b=READ}
mark(x + b) INIT: in: {a=D, b=ID, f=D, x=ID} out: {a=D, b=ID, f=D, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) USE: in: {b=READ} out: {b=READ, x=READ}
r(b) USE: in: {} out: {b=READ}
call(+, plus)
w(a) INIT: in: {a=D, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID}
3 <END> INIT: in: {b=ID, f=D, x=ID} out: {b=ID, f=D, x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, f=D, x=ID} out: {a=ID, b=ID, f=D, x=ID} USE: in: {} out: {}
<SINK> INIT: in: {b=ID, f=D, x=ID} out: {b=ID, f=D, x=ID} USE: in: {} out: {}
=====================
@@ -22,19 +22,19 @@ L0:
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
2 jmp(L3) INIT: in: {a=ID} out: {a=ID}
2 jmp(L3) INIT: in: {} out: {}
L2:
3 mark({ val b = 2 }) INIT: in: {} out: {}
3 mark({ val b = 2 })
v(val b = 2) INIT: in: {} out: {b=D}
r(2) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
L3:
2 mark("after") INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
2 mark("after") INIT: in: {} out: {}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
@@ -23,17 +23,17 @@ L0:
v(val a = x) INIT: in: {x=ID} out: {a=D, x=ID}
r(x) INIT: in: {a=D, x=ID} out: {a=D, x=ID}
w(a) INIT: in: {a=D, x=ID} out: {a=ID, x=ID}
2 jmp?(L2) INIT: in: {a=ID, x=ID} out: {a=ID, x=ID}
d(fun foo() { val b = x }) INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {x=READ} out: {x=READ}
2 jmp?(L2) INIT: in: {x=ID} out: {x=ID}
d(fun foo() { val b = x }) USE: in: {x=READ} out: {x=READ}
L2:
mark("after") INIT: in: {a=ID, x=ID} out: {a=ID, x=ID}
mark("after")
r("after")
L1:
1 <END>
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== foo ==
fun foo() {
@@ -41,15 +41,15 @@ fun foo() {
}
---------------------
L3:
3 <START> INIT: in: {a=ID, x=ID} out: {a=ID, x=ID}
3 <START> INIT: in: {x=ID} out: {x=ID}
4 mark({ val b = x })
v(val b = x) INIT: in: {a=ID, x=ID} out: {a=ID, b=D, x=ID} USE: in: {x=READ} out: {x=READ}
r(x) INIT: in: {a=ID, b=D, x=ID} out: {a=ID, b=D, x=ID} USE: in: {} out: {x=READ}
w(b) INIT: in: {a=ID, b=D, x=ID} out: {a=ID, b=ID, x=ID}
v(val b = x) INIT: in: {x=ID} out: {b=D, x=ID} USE: in: {x=READ} out: {x=READ}
r(x) INIT: in: {b=D, x=ID} out: {b=D, x=ID} USE: in: {} out: {x=READ}
w(b) INIT: in: {b=D, x=ID} out: {b=ID, x=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID}
3 <END> INIT: in: {x=ID} out: {x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
@@ -9,7 +9,7 @@ fun foo() {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ "before" val b = 1 fun local(x: Int) { val a = x + b } "after" })
mark("before")
r("before")
@@ -17,16 +17,16 @@ L0:
r(1) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
jmp?(L2) INIT: in: {b=ID} out: {b=ID}
d(fun local(x: Int) { val a = x + b }) INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
d(fun local(x: Int) { val a = x + b }) USE: in: {b=READ} out: {b=READ}
L2:
mark("after") INIT: in: {b=ID} out: {b=ID}
mark("after")
r("after")
L1:
1 <END>
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== local ==
fun local(x: Int) {
@@ -39,15 +39,15 @@ L3:
w(x) INIT: in: {b=ID, x=D} out: {b=ID, x=ID}
4 mark({ val a = x + b }) INIT: in: {b=ID, x=ID} out: {b=ID, x=ID}
v(val a = x + b) INIT: in: {b=ID, x=ID} out: {a=D, b=ID, x=ID}
mark(x + b) INIT: in: {a=D, b=ID, x=ID} out: {a=D, b=ID, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) USE: in: {b=READ} out: {b=READ, x=READ}
r(b) USE: in: {} out: {b=READ}
mark(x + b) INIT: in: {a=D, b=ID, x=ID} out: {a=D, b=ID, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) USE: in: {b=READ} out: {b=READ, x=READ}
r(b) USE: in: {} out: {b=READ}
call(+, plus)
w(a) INIT: in: {a=D, b=ID, x=ID} out: {a=ID, b=ID, x=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID}
3 <END> INIT: in: {b=ID, x=ID} out: {b=ID, x=ID}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, b=ID, x=ID} out: {a=ID, b=ID, x=ID} USE: in: {} out: {}
<SINK> INIT: in: {b=ID, x=ID} out: {b=ID, x=ID} USE: in: {} out: {}
=====================
@@ -21,17 +21,17 @@ L0:
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
2 jmp?(L2) INIT: in: {a=ID} out: {a=ID}
d(fun foo() { val b = 2 }) INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
2 jmp?(L2) INIT: in: {} out: {}
d(fun foo() { val b = 2 })
L2:
mark("after") INIT: in: {a=ID} out: {a=ID}
mark("after")
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== foo ==
fun foo() {
@@ -39,15 +39,15 @@ fun foo() {
}
---------------------
L3:
3 <START> INIT: in: {a=ID} out: {a=ID}
3 <START> INIT: in: {} out: {}
4 mark({ val b = 2 })
v(val b = 2) INIT: in: {a=ID} out: {a=ID, b=D}
r(2) INIT: in: {a=ID, b=D} out: {a=ID, b=D}
w(b) INIT: in: {a=ID, b=D} out: {a=ID, b=ID}
v(val b = 2) INIT: in: {} out: {b=D}
r(2) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
L4:
3 <END> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
3 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
@@ -23,19 +23,19 @@ L0:
v(val x = 1) INIT: in: {bar=D} out: {bar=D, x=D}
r(1) INIT: in: {bar=D, x=D} out: {bar=D, x=D}
w(x) INIT: in: {bar=D, x=D} out: {bar=D, x=ID}
2 jmp?(L2) INIT: in: {bar=D, x=ID} out: {bar=D, x=ID}
d(fun foo() { val a = 2 }) INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID}
2 jmp?(L2) INIT: in: {bar=D} out: {bar=D}
d(fun foo() { val a = 2 })
L2:
r(object { { val x = 1 } fun foo() { val a = 2 } }) INIT: in: {bar=D, x=ID} out: {bar=D, x=ID}
w(bar) INIT: in: {bar=D, x=ID} out: {bar=ID, x=ID}
mark("after") INIT: in: {bar=ID, x=ID} out: {bar=ID, x=ID}
r(object { { val x = 1 } fun foo() { val a = 2 } })
w(bar) INIT: in: {bar=D} out: {bar=ID}
mark("after") INIT: in: {bar=ID} out: {bar=ID}
r("after")
L1:
1 <END>
1 <END> INIT: in: {} out: {}
error:
<ERROR> INIT: in: {} out: {}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== foo ==
fun foo() {
@@ -43,15 +43,15 @@ fun foo() {
}
---------------------
L3:
3 <START> INIT: in: {bar=D, x=ID} out: {bar=D, x=ID}
3 <START> INIT: in: {bar=D} out: {bar=D}
4 mark({ val a = 2 })
v(val a = 2) INIT: in: {bar=D, x=ID} out: {a=D, bar=D, x=ID}
r(2) INIT: in: {a=D, bar=D, x=ID} out: {a=D, bar=D, x=ID}
w(a) INIT: in: {a=D, bar=D, x=ID} out: {a=ID, bar=D, x=ID}
v(val a = 2) INIT: in: {bar=D} out: {a=D, bar=D}
r(2) INIT: in: {a=D, bar=D} out: {a=D, bar=D}
w(a) INIT: in: {a=D, bar=D} out: {a=ID, bar=D}
L4:
3 <END> INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID}
3 <END> INIT: in: {bar=D} out: {bar=D}
error:
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID, bar=D, x=ID} out: {a=ID, bar=D, x=ID} USE: in: {} out: {}
<SINK> INIT: in: {bar=D} out: {bar=D} USE: in: {} out: {}
=====================
@@ -19,41 +19,41 @@ L0:
mark("before")
r("before")
mark(try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 })
jmp?(L2 [onException]) USE: in: {e=READ} out: {e=READ}
jmp?(L2 [onException])
jmp?(L3 [onExceptionToFinallyBlock])
3 mark({ foo() })
mark(foo())
call(foo, foo)
2 jmp(L4 [afterCatches]) USE: in: {} out: {}
2 jmp(L4 [afterCatches]) USE: in: {} out: {}
L2 [onException]:
3 v(e: Exception) INIT: in: {} out: {e=D}
w(e) INIT: in: {e=D} out: {e=ID}
4 mark({ val a = e }) INIT: in: {e=ID} out: {e=ID}
v(val a = e) INIT: in: {e=ID} out: {a=D, e=ID} USE: in: {e=READ} out: {e=READ}
r(e) INIT: in: {a=D, e=ID} out: {a=D, e=ID} USE: in: {} out: {e=READ}
v(val a = e) INIT: in: {e=ID} out: {a=D, e=ID} USE: in: {e=READ} out: {e=READ}
r(e) INIT: in: {a=D, e=ID} out: {a=D, e=ID} USE: in: {} out: {e=READ}
w(a) INIT: in: {a=D, e=ID} out: {a=ID, e=ID}
3 jmp(L4 [afterCatches]) INIT: in: {a=ID, e=ID} out: {a=ID, e=ID}
3 jmp(L4 [afterCatches]) INIT: in: {e=ID} out: {e=ID}
L4 [afterCatches]:
2 jmp(L5 [skipFinallyToErrorBlock])
2 jmp(L5 [skipFinallyToErrorBlock]) INIT: in: {} out: {}
L3 [onExceptionToFinallyBlock]:
L6 [start finally]:
3 mark({ val a = 1 }) INIT: in: {} out: {}
3 mark({ val a = 1 })
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
L7 [finish finally]:
2 jmp(error) INIT: in: {a=ID} out: {a=ID}
2 jmp(error) INIT: in: {} out: {}
L5 [skipFinallyToErrorBlock]:
3 mark({ val a = 1 }) INIT: in: {a=ID, e=ID} out: {a=ID, e=ID}
v(val a = 1) INIT: in: {a=ID, e=ID} out: {a=D, a=ID, e=ID}
r(1) INIT: in: {a=D, a=ID, e=ID} out: {a=D, a=ID, e=ID}
w(a) INIT: in: {a=D, a=ID, e=ID} out: {a=ID, a=ID, e=ID}
2 mark("after") INIT: in: {a=ID, a=ID, e=ID} out: {a=ID, a=ID, e=ID}
3 mark({ val a = 1 })
v(val a = 1) INIT: in: {} out: {a=D}
r(1) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
2 mark("after") INIT: in: {} out: {}
r("after")
L1:
1 <END>
error:
<ERROR> INIT: in: {a=ID} out: {a=ID}
<ERROR>
sink:
<SINK> INIT: in: {a=ID, a=ID, e=ID} out: {a=ID, a=ID, e=ID} USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
@@ -15,11 +15,11 @@ L0:
mark(while (true) { val a: Int })
L2 [loop entry point]:
L5 [condition entry point]:
r(true) INIT: in: {a=D} out: {a=D}
r(true)
L4 [body entry point]:
3 mark({ val a: Int })
v(val a: Int)
2 jmp(L2 [loop entry point]) USE: in: {} out: {}
v(val a: Int) INIT: in: {} out: {a=D}
2 jmp(L2 [loop entry point]) INIT: in: {} out: {} USE: in: {} out: {}
L3 [loop exit point]:
- read (Unit)
- mark("after")
@@ -29,5 +29,5 @@ L1:
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================