Pseudocode: Introduce pseudo-value analysis

This commit is contained in:
Alexey Sedunov
2014-05-12 17:42:44 +04:00
parent 3ce96671d9
commit d2c055e9da
103 changed files with 2417 additions and 1432 deletions
@@ -15,19 +15,19 @@ L0:
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}
mark(1 < 2)
r(1)
r(2)
call(<, compareTo)
jf(L2)
r(1) -> <v0>
r(2) -> <v1>
call(<, compareTo|<v0>, <v1>) -> <v2>
jf(L2|<v2>)
3 mark({ use(b) })
mark(use(b)) USE: in: {b=READ} out: {b=READ}
r(b) USE: in: {} out: {b=READ}
call(use, use)
r(b) -> <v3> USE: in: {} out: {b=READ}
call(use, use|<v3>) -> <v4>
2 jmp(L3) USE: in: {} out: {}
L2:
3 mark({ b = true })
r(true) 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(true) -> <v5> USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b|<v5>) INIT: in: {b=D} out: {b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
L1:
L3:
1 <END> INIT: in: {} out: {}
@@ -40,14 +40,15 @@ sink:
fun use(vararg a: Any?) = a
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
magic(vararg a: Any?) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) -> <v1> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
L1:
<END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
=====================
@@ -9,8 +9,8 @@ class A {
L0:
1 <START> INIT: in: {} out: {}
2 mark({ x = 1 })
r(1) USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ}
w(x) INIT: in: {} out: {x=I} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ}
r(1) -> <v0> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ}
w(x|<v0>) INIT: in: {} out: {x=I} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ}
1 v(val x: Int) INIT: in: {x=I} out: {x=ID}
L1:
<END> INIT: in: {x=ID} out: {x=ID}
@@ -11,15 +11,15 @@ L0:
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}
w(a) INIT: in: {a=D} out: {a=ID}
r(1) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
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) }) USE: in: {a=READ} out: {a=READ}
L2:
r({ (x: Int) -> val y = x + a use(a) })
w(f) INIT: in: {a=ID, f=D} out: {a=ID, f=ID}
r({ (x: Int) -> val y = x + a use(a) }) -> <v1>
w(f|<v1>) INIT: in: {a=ID, f=D} out: {a=ID, f=ID}
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -34,38 +34,40 @@ sink:
}
---------------------
L3:
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
4 mark(val y = x + a use(a)) INIT: in: {x=ID} out: {x=ID}
v(val y = x + a) INIT: in: {x=ID} out: {x=ID, y=D}
mark(x + a) INIT: in: {x=ID, y=D} out: {x=ID, y=D} USE: in: {a=READ, x=READ} out: {a=READ, x=READ}
r(x) USE: in: {a=READ} out: {a=READ, x=READ}
r(a)
call(+, plus)
w(y) INIT: in: {x=ID, y=D} out: {x=ID, y=ID}
mark(use(a)) INIT: in: {x=ID, y=ID} out: {x=ID, y=ID} USE: in: {a=READ} out: {a=READ}
r(a) USE: in: {} out: {a=READ}
call(use, use)
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
magic(x: Int) -> <v0> INIT: in: {x=D} out: {x=D}
w(x|<v0>) INIT: in: {x=D} out: {x=ID}
4 mark(val y = x + a use(a)) INIT: in: {x=ID} out: {x=ID}
v(val y = x + a) INIT: in: {x=ID} out: {x=ID, y=D}
mark(x + a) INIT: in: {x=ID, y=D} out: {x=ID, y=D} USE: in: {a=READ, x=READ} out: {a=READ, x=READ}
r(x) -> <v1> USE: in: {a=READ} out: {a=READ, x=READ}
r(a) -> <v2>
call(+, plus|<v1>, <v2>) -> <v3>
w(y|<v3>) INIT: in: {x=ID, y=D} out: {x=ID, y=ID}
mark(use(a)) INIT: in: {x=ID, y=ID} out: {x=ID, y=ID} USE: in: {a=READ} out: {a=READ}
r(a) -> <v4> USE: in: {} out: {a=READ}
call(use, use|<v4>) -> <v5>
L4:
3 <END> INIT: in: {x=ID} out: {x=ID}
3 <END> INIT: in: {x=ID} out: {x=ID}
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
== use ==
fun use(vararg a: Any?) = a
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
magic(vararg a: Any?) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) -> <v1> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
L1:
<END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
=====================
@@ -10,12 +10,12 @@ L0:
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}
w(a) INIT: in: {a=D} out: {a=ID}
r(1) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
v(val b: Int) INIT: in: {a=ID} out: {a=ID, b=D}
r(2) INIT: in: {a=ID, b=D} out: {a=ID, b=D} USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
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}
r(2) -> <v1> INIT: in: {a=ID, b=D} out: {a=ID, b=D} USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b|<v1>) INIT: in: {a=ID, b=D} out: {a=ID, b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
r(42) -> <v2> INIT: in: {a=ID, b=ID} out: {a=ID, b=ID}
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -33,15 +33,16 @@ fun bar(foo: Foo) {
L0:
1 <START> INIT: in: {} out: {}
v(foo: Foo) INIT: in: {} out: {foo=D}
w(foo) INIT: in: {foo=D} out: {foo=ID}
magic(foo: Foo) -> <v0> INIT: in: {foo=D} out: {foo=D}
w(foo|<v0>) INIT: in: {foo=D} out: {foo=ID}
2 mark({ foo.c foo.c = 2 42 }) INIT: in: {foo=ID} out: {foo=ID}
mark(foo.c)
r(foo) USE: in: {c=READ, foo=READ} out: {c=READ, foo=READ}
r(c) USE: in: {c=ONLY_WRITTEN_NEVER_READ, foo=READ} out: {c=READ, foo=READ}
r(2) USE: in: {c=ONLY_WRITTEN_NEVER_READ, foo=READ} out: {c=ONLY_WRITTEN_NEVER_READ, foo=READ}
r(foo) USE: in: {c=ONLY_WRITTEN_NEVER_READ} out: {c=ONLY_WRITTEN_NEVER_READ, foo=READ}
w(foo.c) INIT: in: {foo=ID} out: {c=I, foo=ID} USE: in: {} out: {c=ONLY_WRITTEN_NEVER_READ}
r(42) INIT: in: {c=I, foo=ID} out: {c=I, foo=ID}
r(foo) -> <v1> USE: in: {c=READ, foo=READ} out: {c=READ, foo=READ}
r(c|<v1>) -> <v2> USE: in: {c=ONLY_WRITTEN_NEVER_READ, foo=READ} out: {c=READ, foo=READ}
r(2) -> <v3> USE: in: {c=ONLY_WRITTEN_NEVER_READ, foo=READ} out: {c=ONLY_WRITTEN_NEVER_READ, foo=READ}
r(foo) -> <v4> USE: in: {c=ONLY_WRITTEN_NEVER_READ} out: {c=ONLY_WRITTEN_NEVER_READ, foo=READ}
w(foo.c|<v4>, <v3>) INIT: in: {foo=ID} out: {c=I, foo=ID} USE: in: {} out: {c=ONLY_WRITTEN_NEVER_READ}
r(42) -> <v5> INIT: in: {c=I, foo=ID} out: {c=I, foo=ID}
L1:
1 <END>
error:
@@ -10,16 +10,16 @@ L0:
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}
w(a) INIT: in: {a=D} out: {a=ID}
r(1) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
mark(use(a)) INIT: in: {a=ID} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) USE: in: {a=WRITTEN_AFTER_READ} out: {a=READ}
call(use, use)
r(2) USE: in: {a=WRITTEN_AFTER_READ} out: {a=WRITTEN_AFTER_READ}
w(a) USE: in: {a=READ} out: {a=WRITTEN_AFTER_READ}
r(a) -> <v1> USE: in: {a=WRITTEN_AFTER_READ} out: {a=READ}
call(use, use|<v1>) -> <v2>
r(2) -> <v3> USE: in: {a=WRITTEN_AFTER_READ} out: {a=WRITTEN_AFTER_READ}
w(a|<v3>) USE: in: {a=READ} out: {a=WRITTEN_AFTER_READ}
mark(use(a)) USE: in: {a=READ} out: {a=READ}
r(a) USE: in: {} out: {a=READ}
call(use, use)
r(a) -> <v4> USE: in: {} out: {a=READ}
call(use, use|<v4>) -> <v5>
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -37,8 +37,8 @@ L0:
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) -> <v0> INIT: in: {b=D} out: {b=D} USE: in: {b=ONLY_WRITTEN_NEVER_READ} out: {b=ONLY_WRITTEN_NEVER_READ}
w(b|<v0>) INIT: in: {b=D} out: {b=ID} USE: in: {} out: {b=ONLY_WRITTEN_NEVER_READ}
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -50,14 +50,15 @@ sink:
fun use(a: Int) = a
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(a: Int) INIT: in: {} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
1 <START> INIT: in: {} out: {}
v(a: Int) INIT: in: {} out: {a=D}
magic(a: Int) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) -> <v1> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
L1:
<END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
=====================
@@ -12,8 +12,8 @@ L0:
jmp?(L2)
d({ (x: Int) -> sum(x - 1) + x }) USE: in: {sum=READ} out: {sum=READ}
L2:
r({ (x: Int) -> sum(x - 1) + x })
w(sum) INIT: in: {sum=D} out: {sum=ID}
r({ (x: Int) -> sum(x - 1) + x }) -> <v0>
w(sum|<v0>) INIT: in: {sum=D} out: {sum=ID}
L1:
<END> INIT: in: {sum=ID} out: {sum=ID}
error:
@@ -27,40 +27,42 @@ sink:
}
---------------------
L3:
2 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
3 mark(sum(x - 1) + x) INIT: in: {x=ID} out: {x=ID}
2 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
magic(x: Int) -> <v0> INIT: in: {x=D} out: {x=D}
w(x|<v0>) INIT: in: {x=D} out: {x=ID}
3 mark(sum(x - 1) + x) INIT: in: {x=ID} out: {x=ID}
mark(sum(x - 1) + x)
mark(sum(x - 1)) USE: in: {sum=READ, x=READ} out: {sum=READ, x=READ}
r(sum) USE: in: {x=READ} out: {sum=READ, x=READ}
mark(sum(x - 1)) USE: in: {sum=READ, x=READ} out: {sum=READ, x=READ}
r(sum) -> <v1> USE: in: {x=READ} out: {sum=READ, x=READ}
mark(x - 1)
r(x)
r(1)
call(-, minus)
call(sum, invoke) USE: in: {x=READ} out: {x=READ}
r(x) USE: in: {} out: {x=READ}
call(+, plus)
r(x) -> <v2>
r(1) -> <v3>
call(-, minus|<v2>, <v3>) -> <v4>
call(sum, invoke|<v1>, <v4>) -> <v5> USE: in: {x=READ} out: {x=READ}
r(x) -> <v6> USE: in: {} out: {x=READ}
call(+, plus|<v5>, <v6>) -> <v7>
L4:
2 <END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
== A ==
open class A(val a: A)
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(val a: A) INIT: in: {} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
1 <START> INIT: in: {} out: {}
v(val a: A) INIT: in: {} out: {a=D}
magic(val a: A) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
L1:
<END> INIT: in: {a=ID} out: {a=ID}
<END> INIT: in: {a=ID} out: {a=ID}
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
=====================
== TestObjectLiteral ==
class TestObjectLiteral {
@@ -78,16 +80,16 @@ L0:
1 <START> INIT: in: {} out: {}
v(val obj: A = object: A(obj) { { val x = obj } fun foo() { val y = obj } }) INIT: in: {} out: {obj=D}
mark(object: A(obj) { { val x = obj } fun foo() { val y = obj } }) INIT: in: {obj=D} out: {obj=D}
r(obj)
r(obj) -> <v0>
2 mark({ val x = obj })
v(val x = obj) INIT: in: {obj=D} out: {obj=D, x=D}
r(obj) INIT: in: {obj=D, x=D} out: {obj=D, x=D}
w(x) INIT: in: {obj=D, x=D} out: {obj=D, x=ID}
r(obj) -> <v1> INIT: in: {obj=D, x=D} out: {obj=D, x=D}
w(x|<v1>) INIT: in: {obj=D, x=D} out: {obj=D, x=ID}
1 jmp?(L2) INIT: in: {obj=D} out: {obj=D}
d(fun foo() { val y = obj }) USE: in: {obj=READ} out: {obj=READ}
L2:
r(object: A(obj) { { val x = obj } fun foo() { val y = obj } })
w(obj) INIT: in: {obj=D} out: {obj=ID}
r(object: A(obj) { { val x = obj } fun foo() { val y = obj } }) -> <v2>
w(obj|<v2>) INIT: in: {obj=D} out: {obj=ID}
L1:
<END> INIT: in: {obj=ID} out: {obj=ID}
error:
@@ -104,8 +106,8 @@ L3:
2 <START> INIT: in: {} out: {}
3 mark({ val y = obj })
v(val y = obj) INIT: in: {} out: {y=D} USE: in: {obj=READ} out: {obj=READ}
r(obj) INIT: in: {y=D} out: {y=D} USE: in: {} out: {obj=READ}
w(y) INIT: in: {y=D} out: {y=ID}
r(obj) -> <v0> INIT: in: {y=D} out: {y=D} USE: in: {} out: {obj=READ}
w(y|<v0>) INIT: in: {y=D} out: {y=ID}
L4:
2 <END> INIT: in: {} out: {}
error:
@@ -119,17 +121,17 @@ class TestOther {
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(val x: Int = x + 1) INIT: in: {} out: {x=D}
mark(x + 1) INIT: in: {x=D} out: {x=D} USE: in: {x=READ} out: {x=READ}
r(x) USE: in: {} out: {x=READ}
r(1)
call(+, plus)
w(x) INIT: in: {x=D} out: {x=ID}
1 <START> INIT: in: {} out: {}
v(val x: Int = x + 1) INIT: in: {} out: {x=D}
mark(x + 1) INIT: in: {x=D} out: {x=D} USE: in: {x=READ} out: {x=READ}
r(x) -> <v0> USE: in: {} out: {x=READ}
r(1) -> <v1>
call(+, plus|<v0>, <v1>) -> <v2>
w(x|<v2>) INIT: in: {x=D} out: {x=ID}
L1:
<END> INIT: in: {x=ID} out: {x=ID}
<END> INIT: in: {x=ID} out: {x=ID}
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
@@ -16,23 +16,24 @@ L0:
v(val b: Boolean) INIT: in: {} out: {b=D}
mark(if (1 < 2) { b = false } else { b = true }) INIT: in: {b=D} out: {b=D}
mark(1 < 2)
r(1)
r(2)
call(<, compareTo)
jf(L2)
r(1) -> <v0>
r(2) -> <v1>
call(<, compareTo|<v0>, <v1>) -> <v2>
jf(L2|<v2>)
3 mark({ b = false })
r(false) USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b) INIT: in: {b=D} out: {b=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
r(false) -> <v3> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b|<v3>) INIT: in: {b=D} out: {b=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
2 jmp(L3) INIT: in: {b=ID} out: {b=ID} USE: in: {b=READ} out: {b=READ}
L2:
3 mark({ b = true }) INIT: in: {b=D} out: {b=D}
r(true) USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b) INIT: in: {b=D} out: {b=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
r(true) -> <v4> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b|<v4>) INIT: in: {b=D} out: {b=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
L3:
2 mark(use(b)) INIT: in: {b=ID} out: {b=ID}
error(use, No resolved call) USE: in: {b=READ} out: {b=READ}
r(b) USE: in: {} out: {b=READ}
r(b) -> <v5> USE: in: {} out: {b=READ}
error(use, No resolved call)
magic(use|<v5>) -> <v6>
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -16,36 +16,38 @@ fun foo(numbers: Collection<Int>) {
L0:
1 <START> INIT: in: {} out: {}
v(numbers: Collection<Int>) INIT: in: {} out: {numbers=D}
w(numbers) INIT: in: {numbers=D} out: {numbers=ID}
magic(numbers: Collection<Int>) -> <v0> INIT: in: {numbers=D} out: {numbers=D}
w(numbers|<v0>) INIT: in: {numbers=D} out: {numbers=ID}
2 mark({ for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } }) INIT: in: {numbers=ID} out: {numbers=ID}
3 mark(for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue }) USE: in: {numbers=READ} out: {numbers=READ}
r(numbers) USE: in: {} out: {numbers=READ}
r(numbers) -> <v1> USE: in: {} out: {numbers=READ}
v(i) INIT: in: {numbers=ID} out: {i=D, numbers=ID}
L3:
jmp?(L2) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
L4 [loop entry point]:
L5 [body entry point]:
w(i) INIT: in: {i=D, numbers=ID} out: {i=ID, numbers=ID} USE: in: {} out: {}
magic(numbers|<v1>) -> <v2>
w(i|<v2>) INIT: in: {i=D, numbers=ID} out: {i=ID, numbers=ID} USE: in: {} out: {}
4 mark({ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue }) INIT: in: {i=ID, numbers=ID} out: {i=ID, numbers=ID}
v(val b: Boolean) INIT: in: {i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
mark(if (1 < 2) { b = false } else { b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
mark(1 < 2)
r(1)
r(2)
call(<, compareTo)
jf(L6)
r(1) -> <v3>
r(2) -> <v4>
call(<, compareTo|<v3>, <v4>) -> <v5>
jf(L6|<v5>)
5 mark({ b = false })
r(false) USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
r(false) -> <v6> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b|<v6>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
4 jmp(L7) INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=READ}
L6:
5 mark({ b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
r(true) USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
r(true) -> <v7> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b|<v7>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
L7:
4 mark(use(b)) INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ} out: {b=READ}
r(b) USE: in: {} out: {b=READ}
call(use, use)
r(b) -> <v8> USE: in: {} out: {b=READ}
call(use, use|<v8>) -> <v9>
jmp(L4 [loop entry point]) USE: in: {} out: {}
- 3 jmp?(L4 [loop entry point])
L2:
@@ -61,14 +63,15 @@ sink:
fun use(vararg a: Any?) = a
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
magic(vararg a: Any?) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID} USE: in: {a=READ} out: {a=READ}
r(a) -> <v1> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {a=READ}
L1:
<END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
<SINK> INIT: in: {a=ID} out: {a=ID} USE: in: {} out: {}
=====================
@@ -11,24 +11,24 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" do { var a = 2 } while (a > 0) "after" })
mark("before")
r("before") USE: in: {} out: {}
r("before") -> <v0> USE: in: {} out: {}
3 mark(do { var a = 2 } while (a > 0))
L2 [loop entry point]:
L4 [body entry point]:
mark({ var a = 2 }) INIT: in: {a=ID} out: {a=ID}
v(var a = 2)
r(2)
w(a)
r(2) -> <v1>
w(a|<v1>)
L5 [condition entry point]:
mark(a > 0)
r(a)
r(0)
call(>, compareTo)
jt(L2 [loop entry point]) USE: in: {a=READ} out: {a=READ}
r(a) -> <v2>
r(0) -> <v3>
call(>, compareTo|<v2>, <v3>) -> <v4>
jt(L2 [loop entry point]|<v4>) USE: in: {a=READ} out: {a=READ}
L3 [loop exit point]:
read (Unit)
2 mark("after") INIT: in: {} out: {}
r("after")
r("after") -> <v5>
L1:
1 <END>
error:
@@ -11,27 +11,28 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" for (i in 1..10) { val a = i } "after" })
mark("before")
r("before") USE: in: {} out: {}
r("before") -> <v0> USE: in: {} out: {}
3 mark(for (i in 1..10) { val a = i })
mark(1..10)
r(1)
r(10)
call(.., rangeTo)
r(1) -> <v1>
r(10) -> <v2>
call(.., rangeTo|<v1>, <v2>) -> <v3>
v(i) INIT: in: {} out: {i=D}
L3:
jmp?(L2) INIT: in: {i=D} out: {i=D}
L4 [loop entry point]:
L5 [body entry point]:
w(i) INIT: in: {i=D} out: {i=ID}
magic(1..10|<v3>) -> <v4>
w(i|<v4>) INIT: in: {i=D} out: {i=ID}
4 mark({ val a = i }) INIT: in: {i=ID} out: {i=ID}
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}
r(i) -> <v5> INIT: in: {a=D, i=ID} out: {a=D, i=ID}
w(a|<v5>) 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) INIT: in: {i=D} out: {i=D}
2 mark("after") INIT: in: {} out: {}
r("after")
r("after") -> <v6>
L1:
1 <END>
error:
@@ -12,19 +12,19 @@ L0:
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")
r("before") -> <v0>
v(val b = 1) INIT: in: {} out: {b=D}
r(1) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
r(1) -> <v1> INIT: in: {b=D} out: {b=D}
w(b|<v1>) INIT: in: {b=D} out: {b=ID}
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 }) USE: in: {b=READ} out: {b=READ}
L2:
r({ (x: Int) -> val a = x + b })
w(f) INIT: in: {b=ID, f=D} out: {b=ID, f=ID}
r({ (x: Int) -> val a = x + b }) -> <v2>
w(f|<v2>) 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")
r("after") -> <v3>
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -38,20 +38,21 @@ sink:
}
---------------------
L3:
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
4 mark(val a = x + b) INIT: in: {x=ID} out: {x=ID}
v(val a = x + b) INIT: in: {x=ID} out: {a=D, x=ID}
mark(x + b) INIT: in: {a=D, x=ID} out: {a=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, x=ID} out: {a=ID, x=ID}
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
magic(x: Int) -> <v0> INIT: in: {x=D} out: {x=D}
w(x|<v0>) INIT: in: {x=D} out: {x=ID}
4 mark(val a = x + b) INIT: in: {x=ID} out: {x=ID}
v(val a = x + b) INIT: in: {x=ID} out: {a=D, x=ID}
mark(x + b) INIT: in: {a=D, x=ID} out: {a=D, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) -> <v1> USE: in: {b=READ} out: {b=READ, x=READ}
r(b) -> <v2> USE: in: {} out: {b=READ}
call(+, plus|<v1>, <v2>) -> <v3>
w(a|<v3>) INIT: in: {a=D, x=ID} out: {a=ID, x=ID}
L4:
3 <END> INIT: in: {x=ID} out: {x=ID}
3 <END> INIT: in: {x=ID} out: {x=ID}
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
@@ -14,23 +14,23 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" if (true) { val a = 1 } else { val b = 2 } "after" })
mark("before")
r("before")
r("before") -> <v0>
mark(if (true) { val a = 1 } else { val b = 2 })
r(true)
jf(L2)
r(true) -> <v1>
jf(L2|<v1>)
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}
r(1) -> <v2> INIT: in: {a=D} out: {a=D}
w(a|<v2>) INIT: in: {a=D} out: {a=ID}
2 jmp(L3) INIT: in: {} out: {}
L2:
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}
r(2) -> <v3> INIT: in: {b=D} out: {b=D}
w(b|<v3>) INIT: in: {b=D} out: {b=ID}
L3:
2 mark("after") INIT: in: {} out: {}
r("after")
r("after") -> <v4>
L1:
1 <END>
error:
@@ -16,18 +16,19 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" class A(val x: Int) { { val a = x } fun foo() { val b = x } } "after" })
mark("before")
r("before")
r("before") -> <v0>
v(val x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
magic(val x: Int) -> <v1> INIT: in: {x=D} out: {x=D}
w(x|<v1>) INIT: in: {x=D} out: {x=ID}
3 mark({ val a = x }) INIT: in: {x=ID} out: {x=ID}
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}
r(x) -> <v2> INIT: in: {a=D, x=ID} out: {a=D, x=ID}
w(a|<v2>) INIT: in: {a=D, x=ID} out: {a=ID, x=ID}
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")
r("after")
r("after") -> <v3>
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -44,8 +45,8 @@ L3:
3 <START> INIT: in: {} out: {}
4 mark({ val b = x })
v(val b = x) INIT: in: {} out: {b=D} USE: in: {x=READ} out: {x=READ}
r(x) INIT: in: {b=D} out: {b=D} USE: in: {} out: {x=READ}
w(b) INIT: in: {b=D} out: {b=ID}
r(x) -> <v0> INIT: in: {b=D} out: {b=D} USE: in: {} out: {x=READ}
w(b|<v0>) INIT: in: {b=D} out: {b=ID}
L4:
3 <END> INIT: in: {} out: {}
error:
@@ -12,15 +12,15 @@ L0:
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")
r("before") -> <v0>
v(val b = 1) INIT: in: {} out: {b=D}
r(1) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
r(1) -> <v1> INIT: in: {b=D} out: {b=D}
w(b|<v1>) 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 }) USE: in: {b=READ} out: {b=READ}
L2:
mark("after")
r("after")
r("after") -> <v2>
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -34,20 +34,21 @@ fun local(x: Int) {
}
---------------------
L3:
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
4 mark({ val a = x + b }) INIT: in: {x=ID} out: {x=ID}
v(val a = x + b) INIT: in: {x=ID} out: {a=D, x=ID}
mark(x + b) INIT: in: {a=D, x=ID} out: {a=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, x=ID} out: {a=ID, x=ID}
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
magic(x: Int) -> <v0> INIT: in: {x=D} out: {x=D}
w(x|<v0>) INIT: in: {x=D} out: {x=ID}
4 mark({ val a = x + b }) INIT: in: {x=ID} out: {x=ID}
v(val a = x + b) INIT: in: {x=ID} out: {a=D, x=ID}
mark(x + b) INIT: in: {a=D, x=ID} out: {a=D, x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) -> <v1> USE: in: {b=READ} out: {b=READ, x=READ}
r(b) -> <v2> USE: in: {} out: {b=READ}
call(+, plus|<v1>, <v2>) -> <v3>
w(a|<v3>) INIT: in: {a=D, x=ID} out: {a=ID, x=ID}
L4:
3 <END> INIT: in: {x=ID} out: {x=ID}
3 <END> INIT: in: {x=ID} out: {x=ID}
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
@@ -10,15 +10,15 @@ L0:
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ "before" val b = 1 fun local(x: Int) = x + b "after" })
mark("before")
r("before")
r("before") -> <v0>
v(val b = 1) INIT: in: {} out: {b=D}
r(1) INIT: in: {b=D} out: {b=D}
w(b) INIT: in: {b=D} out: {b=ID}
r(1) -> <v1> INIT: in: {b=D} out: {b=D}
w(b|<v1>) INIT: in: {b=D} out: {b=ID}
jmp?(L2) INIT: in: {b=ID} out: {b=ID}
d(fun local(x: Int) = x + b) USE: in: {b=READ} out: {b=READ}
L2:
mark("after")
r("after")
r("after") -> <v2>
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -30,17 +30,18 @@ sink:
fun local(x: Int) = x + b
---------------------
L3:
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
w(x) INIT: in: {x=D} out: {x=ID}
mark(x + b) INIT: in: {x=ID} out: {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)
3 <START> INIT: in: {} out: {}
v(x: Int) INIT: in: {} out: {x=D}
magic(x: Int) -> <v0> INIT: in: {x=D} out: {x=D}
w(x|<v0>) INIT: in: {x=D} out: {x=ID}
mark(x + b) INIT: in: {x=ID} out: {x=ID} USE: in: {b=READ, x=READ} out: {b=READ, x=READ}
r(x) -> <v1> USE: in: {b=READ} out: {b=READ, x=READ}
r(b) -> <v2> USE: in: {} out: {b=READ}
call(+, plus|<v1>, <v2>) -> <v3>
L4:
<END>
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {}
=====================
@@ -16,16 +16,16 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" object A { { val a = 1 } fun foo() { val b = 2 } } "after" })
mark("before")
r("before")
r("before") -> <v0>
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}
r(1) -> <v1> INIT: in: {a=D} out: {a=D}
w(a|<v1>) INIT: in: {a=D} out: {a=ID}
2 jmp?(L2) INIT: in: {} out: {}
d(fun foo() { val b = 2 })
L2:
mark("after")
r("after")
r("after") -> <v2>
L1:
1 <END>
error:
@@ -42,8 +42,8 @@ L3:
3 <START> INIT: in: {} out: {}
4 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}
r(2) -> <v0> INIT: in: {b=D} out: {b=D}
w(b|<v0>) INIT: in: {b=D} out: {b=ID}
L4:
3 <END> INIT: in: {} out: {}
error:
@@ -16,20 +16,20 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" val bar = object { { val x = 1 } fun foo() { val a = 2 } } "after" })
mark("before")
r("before")
r("before") -> <v0>
v(val bar = object { { val x = 1 } fun foo() { val a = 2 } }) INIT: in: {} out: {bar=D}
mark(object { { val x = 1 } fun foo() { val a = 2 } }) INIT: in: {bar=D} out: {bar=D}
3 mark({ val x = 1 })
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}
r(1) -> <v1> INIT: in: {bar=D, x=D} out: {bar=D, x=D}
w(x|<v1>) INIT: in: {bar=D, x=D} out: {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 } })
w(bar) INIT: in: {bar=D} out: {bar=ID}
r(object { { val x = 1 } fun foo() { val a = 2 } }) -> <v2>
w(bar|<v2>) INIT: in: {bar=D} out: {bar=ID}
mark("after") INIT: in: {bar=ID} out: {bar=ID}
r("after")
r("after") -> <v3>
L1:
1 <END> INIT: in: {} out: {}
error:
@@ -46,8 +46,8 @@ L3:
3 <START> INIT: in: {} out: {}
4 mark({ val a = 2 })
v(val a = 2) INIT: in: {} out: {a=D}
r(2) INIT: in: {a=D} out: {a=D}
w(a) INIT: in: {a=D} out: {a=ID}
r(2) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
L4:
3 <END> INIT: in: {} out: {}
error:
@@ -36,8 +36,8 @@ get() {
L3:
3 <START> INIT: in: {} out: {}
4 mark({ return $a }) USE: in: {a=READ} out: {a=READ}
r($a) USE: in: {} out: {a=READ}
ret(*) L4
r($a) -> <v0> USE: in: {} out: {a=READ}
ret(*|<v0>) L4
L4:
3 <END>
error:
@@ -51,16 +51,17 @@ set(v: Int) {
}
---------------------
L6:
3 <START> INIT: in: {} out: {}
v(v: Int) INIT: in: {} out: {v=D}
w(v) INIT: in: {v=D} out: {v=ID}
4 mark({ $a = v }) INIT: in: {v=ID} out: {v=ID} USE: in: {a=ONLY_WRITTEN_NEVER_READ, v=READ} out: {a=ONLY_WRITTEN_NEVER_READ, v=READ}
r(v) USE: in: {a=ONLY_WRITTEN_NEVER_READ} out: {a=ONLY_WRITTEN_NEVER_READ, v=READ}
w($a) INIT: in: {v=ID} out: {a=I, v=ID} USE: in: {} out: {a=ONLY_WRITTEN_NEVER_READ}
3 <START> INIT: in: {} out: {}
v(v: Int) INIT: in: {} out: {v=D}
magic(v: Int) -> <v0> INIT: in: {v=D} out: {v=D}
w(v|<v0>) INIT: in: {v=D} out: {v=ID}
4 mark({ $a = v }) INIT: in: {v=ID} out: {v=ID} USE: in: {a=ONLY_WRITTEN_NEVER_READ, v=READ} out: {a=ONLY_WRITTEN_NEVER_READ, v=READ}
r(v) -> <v1> USE: in: {a=ONLY_WRITTEN_NEVER_READ} out: {a=ONLY_WRITTEN_NEVER_READ, v=READ}
w($a|<v1>) INIT: in: {v=ID} out: {a=I, v=ID} USE: in: {} out: {a=ONLY_WRITTEN_NEVER_READ}
L7:
3 <END> INIT: in: {a=I, v=ID} out: {a=I, v=ID}
3 <END> INIT: in: {a=I, v=ID} out: {a=I, v=ID}
error:
<ERROR> INIT: in: {} out: {}
<ERROR> INIT: in: {} out: {}
sink:
<SINK> INIT: in: {a=I, v=ID} out: {a=I, v=ID} USE: in: {} out: {}
<SINK> INIT: in: {a=I, v=ID} out: {a=I, v=ID} USE: in: {} out: {}
=====================
@@ -17,21 +17,22 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 } "after" })
mark("before")
r("before")
r("before") -> <v0>
mark(try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 })
jmp?(L2 [onException])
jmp?(L3 [onExceptionToFinallyBlock])
3 mark({ foo() })
mark(foo())
call(foo, foo)
call(foo, foo) -> <v1>
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}
magic(e: Exception) -> <v2> INIT: in: {e=D} out: {e=D}
w(e|<v2>) 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}
w(a) INIT: in: {a=D, e=ID} out: {a=ID, e=ID}
r(e) -> <v3> INIT: in: {a=D, e=ID} out: {a=D, e=ID} USE: in: {} out: {e=READ}
w(a|<v3>) INIT: in: {a=D, e=ID} out: {a=ID, e=ID}
3 jmp(L4 [afterCatches]) INIT: in: {e=ID} out: {e=ID}
L4 [afterCatches]:
2 jmp(L5 [skipFinallyToErrorBlock]) INIT: in: {} out: {}
@@ -39,17 +40,17 @@ L3 [onExceptionToFinallyBlock]:
L6 [start finally]:
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}
r(1) -> <v4> INIT: in: {a=D} out: {a=D}
w(a|<v4>) INIT: in: {a=D} out: {a=ID}
L7 [finish finally]:
2 jmp(error) INIT: in: {} out: {}
L5 [skipFinallyToErrorBlock]:
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}
r(1) -> <v4> INIT: in: {a=D} out: {a=D}
w(a|<v4>) INIT: in: {a=D} out: {a=ID}
2 mark("after") INIT: in: {} out: {}
r("after")
r("after") -> <v5>
L1:
1 <END>
error:
@@ -11,11 +11,11 @@ L0:
1 <START> INIT: in: {} out: {}
2 mark({ "before" while (true) { val a: Int } "after" })
mark("before")
r("before")
r("before") -> <v0>
mark(while (true) { val a: Int })
L2 [loop entry point]:
L5 [condition entry point]:
r(true)
r(true) -> <v1>
L4 [body entry point]:
3 mark({ val a: Int })
v(val a: Int) INIT: in: {} out: {a=D}
@@ -23,7 +23,7 @@ L4 [body entry point]:
L3 [loop exit point]:
- read (Unit)
- mark("after")
- r("after")
- r("after") -> <v2>
L1:
1 <END> INIT: in: {} out: {}
error: