Added 'sink' instruction to pseudocode

This commit is contained in:
svtk
2011-11-03 18:29:34 +04:00
parent bfb70330eb
commit 92a3fef06b
21 changed files with 255 additions and 84 deletions
@@ -16,26 +16,30 @@ class AnonymousInitializers() {
}
---------------------
l0:
<START> NEXT:[r(34)] PREV:[]
r(34) NEXT:[w(k)] PREV:[<START>]
w(k) NEXT:[r(12)] PREV:[r(34)]
r(12) NEXT:[w($i)] PREV:[w(k)]
w($i) NEXT:[r(13)] PREV:[r(12)]
r(13) NEXT:[w($i)] PREV:[w($i)]
w($i) NEXT:[<END>] PREV:[r(13)]
<START> NEXT:[r(34)] PREV:[]
r(34) NEXT:[w(k)] PREV:[<START>]
w(k) NEXT:[r(12)] PREV:[r(34)]
r(12) NEXT:[w($i)] PREV:[w(k)]
w($i) NEXT:[r(13)] PREV:[r(12)]
r(13) NEXT:[w($i)] PREV:[w($i)]
w($i) NEXT:[<END>] PREV:[r(13)]
l1:
<END> NEXT:[] PREV:[w($i)]
<END> NEXT:[<SINK>] PREV:[w($i)]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== k ==
val k = 34
---------------------
l0:
<START> NEXT:[r(34)] PREV:[]
r(34) NEXT:[<END>] PREV:[<START>]
<START> NEXT:[r(34)] PREV:[]
r(34) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[r(34)]
<END> NEXT:[<SINK>] PREV:[r(34)]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -32,7 +32,9 @@ l0:
r(+=) NEXT:[w(a[10])] PREV:[r(1)]
w(a[10]) NEXT:[<END>] PREV:[r(+=)]
l1:
<END> NEXT:[] PREV:[w(a[10])]
<END> NEXT:[<SINK>] PREV:[w(a[10])]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -4,11 +4,13 @@ class Test {
}
---------------------
l0:
<START> NEXT:[<END>] PREV:[]
<START> NEXT:[<END>] PREV:[]
l1:
<END> NEXT:[] PREV:[<START>]
<END> NEXT:[<SINK>] PREV:[<START>]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== assignments ==
fun assignments() : Unit {
@@ -63,7 +65,9 @@ l5:
r(=) NEXT:[w(t.x)] PREV:[r(t)]
w(t.x) NEXT:[<END>] PREV:[r(=)]
l1:
<END> NEXT:[] PREV:[w(t.x)]
<END> NEXT:[<SINK>] PREV:[w(t.x)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
+25 -13
View File
@@ -2,12 +2,14 @@
{1}
---------------------
l2:
<START> NEXT:[r(1)] PREV:[]
r(1) NEXT:[<END>] PREV:[<START>]
<START> NEXT:[r(1)] PREV:[]
r(1) NEXT:[<END>] PREV:[<START>]
l3:
<END> NEXT:[] PREV:[r(1)]
<END> NEXT:[<SINK>] PREV:[r(1)]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== f ==
fun f(a : Boolean) : Unit {
@@ -41,7 +43,7 @@ l0:
r(foo(a, 3)) NEXT:[r(genfun)] PREV:[r(foo)]
r(genfun) NEXT:[r(genfun<Any>())] PREV:[r(foo(a, 3))]
r(genfun<Any>()) NEXT:[df({1})] PREV:[r(genfun)]
df({1}) NEXT:[r({1})] PREV:[r(genfun<Any>())]
df({1}) NEXT:[<SINK>, r({1})] PREV:[r(genfun<Any>())]
r({1}) NEXT:[r(flfun)] PREV:[df({1})]
r(flfun) NEXT:[r(flfun {1})] PREV:[r({1})]
r(flfun {1}) NEXT:[r(3)] PREV:[r(flfun)]
@@ -69,16 +71,20 @@ l4:
l5:
r(a || false) NEXT:[<END>] PREV:[jt(l5), r(false)]
l1:
<END> NEXT:[] PREV:[r(a || false)]
<END> NEXT:[<SINK>] PREV:[r(a || false)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[df({1}), <END>]
l2:
<START> NEXT:[r(1)] PREV:[]
r(1) NEXT:[<END>] PREV:[<START>]
<START> NEXT:[r(1)] PREV:[]
r(1) NEXT:[<END>] PREV:[<START>]
l3:
<END> NEXT:[] PREV:[r(1)]
<END> NEXT:[<SINK>] PREV:[r(1)]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== foo ==
fun foo(a : Boolean, b : Int) : Unit {}
@@ -87,9 +93,11 @@ l0:
<START> NEXT:[read (Unit)] PREV:[]
read (Unit) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== genfun ==
fun genfun<T>() : Unit {}
@@ -98,9 +106,11 @@ l0:
<START> NEXT:[read (Unit)] PREV:[]
read (Unit) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== flfun ==
fun flfun(f : fun () : Any) : Unit {}
@@ -109,7 +119,9 @@ l0:
<START> NEXT:[read (Unit)] PREV:[]
read (Unit) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -5,7 +5,9 @@ l0:
<START> NEXT:[read (Unit)] PREV:[]
read (Unit) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -13,7 +13,9 @@ l0:
r(java.lang.RuntimeException()) NEXT:[jmp(error)] PREV:[r(RuntimeException())]
jmp(error) NEXT:[<ERROR>] PREV:[r(java.lang.RuntimeException())]
l1:
<END> NEXT:[] PREV:[]
<END> NEXT:[<SINK>] PREV:[]
error:
<ERROR> NEXT:[] PREV:[jmp(error)]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
+56 -26
View File
@@ -14,9 +14,11 @@ l0:
l2:
r(2) NEXT:[<END>] PREV:[jmp?(l2), r(1)]
l1:
<END> NEXT:[] PREV:[r(2)]
<END> NEXT:[<SINK>] PREV:[r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3() {
@@ -48,9 +50,11 @@ l2:
l4:
r(2) NEXT:[<END>] PREV:[jmp?(l2), read (Unit)]
l1:
<END> NEXT:[] PREV:[ret l1, r(2)]
<END> NEXT:[<SINK>] PREV:[ret l1, r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== anonymous_0 ==
{ () =>
@@ -72,9 +76,11 @@ l5:
read (Unit) NEXT:[<END>] PREV:[jf(l5)]
l4:
l6:
<END> NEXT:[] PREV:[ret l4, read (Unit)]
<END> NEXT:[<SINK>] PREV:[ret l4, read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3() {
@@ -91,25 +97,27 @@ fun t3() {
}
---------------------
l0:
<START> NEXT:[jmp?(l2)] PREV:[]
jmp?(l2) NEXT:[r(2), r(1)] PREV:[<START>]
r(1) NEXT:[df({ () => if (2 > 3) { retu..)] PREV:[jmp?(l2)]
<START> NEXT:[jmp?(l2)] PREV:[]
jmp?(l2) NEXT:[r(2), r(1)] PREV:[<START>]
r(1) NEXT:[df({ () => if (2 > 3) { retu..)] PREV:[jmp?(l2)]
df({ () =>
if (2 > 3) {
return@
}
}) NEXT:[r({ () => if (2 > 3) { retur..)] PREV:[r(1)]
}) NEXT:[<SINK>, r({ () => if (2 > 3) { retur..)] PREV:[r(1)]
r({ () =>
if (2 > 3) {
return@
}
}) NEXT:[r(2)] PREV:[df({ () => if (2 > 3) { retu..)]
}) NEXT:[r(2)] PREV:[df({ () => if (2 > 3) { retu..)]
l2:
r(2) NEXT:[<END>] PREV:[jmp?(l2), r({ () => if (2 > 3) { retur..)]
r(2) NEXT:[<END>] PREV:[jmp?(l2), r({ () => if (2 > 3) { retur..)]
l1:
<END> NEXT:[] PREV:[r(2)]
<END> NEXT:[<SINK>] PREV:[r(2)]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[df({ () => if (2 > 3) { retu..), <END>]
l3:
<START> NEXT:[r(2)] PREV:[]
r(2) NEXT:[r(3)] PREV:[<START>]
@@ -123,9 +131,11 @@ l5:
read (Unit) NEXT:[<END>] PREV:[jf(l5)]
l4:
l6:
<END> NEXT:[] PREV:[ret l4, read (Unit)]
<END> NEXT:[<SINK>] PREV:[ret l4, read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== anonymous_1 ==
{ () =>
@@ -157,9 +167,11 @@ l4:
l6:
r(2) NEXT:[<END>] PREV:[jmp?(l4), read (Unit)]
l3:
<END> NEXT:[] PREV:[ret l3, r(2)]
<END> NEXT:[<SINK>] PREV:[ret l3, r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3() {
@@ -176,7 +188,7 @@ fun t3() {
}
---------------------
l0:
<START> NEXT:[df({ () => try { 1 if (2 > 3..)] PREV:[]
<START> NEXT:[df({ () => try { 1 if (2 > 3..)] PREV:[]
df({ () =>
try {
1
@@ -186,7 +198,7 @@ l0:
} finally {
2
}
}) NEXT:[r({ () => try { 1 if (2 > 3)..)] PREV:[<START>]
}) NEXT:[<SINK>, r({ () => try { 1 if (2 > 3)..)] PREV:[<START>]
r({ () =>
try {
1
@@ -196,11 +208,13 @@ l0:
} finally {
2
}
}) NEXT:[<END>] PREV:[df({ () => try { 1 if (2 > 3..)]
}) NEXT:[<END>] PREV:[df({ () => try { 1 if (2 > 3..)]
l1:
<END> NEXT:[] PREV:[r({ () => try { 1 if (2 > 3)..)]
<END> NEXT:[<SINK>] PREV:[r({ () => try { 1 if (2 > 3)..)]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[df({ () => try { 1 if (2 > 3..), <END>]
l2:
<START> NEXT:[jmp?(l4)] PREV:[]
jmp?(l4) NEXT:[r(2), r(1)] PREV:[<START>]
@@ -219,9 +233,11 @@ l4:
l6:
r(2) NEXT:[<END>] PREV:[jmp?(l4), read (Unit)]
l3:
<END> NEXT:[] PREV:[ret l3, r(2)]
<END> NEXT:[<SINK>] PREV:[ret l3, r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3() {
@@ -263,9 +279,11 @@ l8:
l3:
read (Unit) NEXT:[<END>] PREV:[jf(l3), jmp(l3)]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3() {
@@ -308,9 +326,11 @@ l4:
l2:
r(2) NEXT:[<END>] PREV:[jmp?(l2), r(5)]
l1:
<END> NEXT:[] PREV:[r(2)]
<END> NEXT:[<SINK>] PREV:[r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3() {
@@ -351,9 +371,11 @@ l4:
l2:
r(2) NEXT:[<END>] PREV:[jmp?(l2), read (Unit)]
l1:
<END> NEXT:[] PREV:[r(2)]
<END> NEXT:[<SINK>] PREV:[r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3(a : Int) {
@@ -399,9 +421,11 @@ l8:
l2:
read (Unit) NEXT:[<END>] PREV:[jmp?(l2), jmp?(l4)]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3(a : Int) {
@@ -448,9 +472,11 @@ l3:
l2:
r(2) NEXT:[<END>] PREV:[jmp?(l2), r(5)]
l1:
<END> NEXT:[] PREV:[r(2)]
<END> NEXT:[<SINK>] PREV:[r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t3 ==
fun t3(a : Int) {
@@ -495,9 +521,11 @@ l3:
l2:
r(2) NEXT:[<END>] PREV:[jmp?(l2), read (Unit)]
l1:
<END> NEXT:[] PREV:[r(2)]
<END> NEXT:[<SINK>] PREV:[r(2)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== tf ==
fun tf() {
@@ -520,7 +548,9 @@ l2:
r(2) NEXT:[ret(*) l1] PREV:[jmp?(l2)]
ret(*) l1 NEXT:[<END>] PREV:[r(2)]
l1:
<END> NEXT:[] PREV:[ret(*) l1, ret(*) l1]
<END> NEXT:[<SINK>] PREV:[ret(*) l1, ret(*) l1]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
+6 -2
View File
@@ -23,9 +23,11 @@ l5:
l2:
read (Unit) NEXT:[<END>] PREV:[jmp?(l2), jmp?(l4)]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== doSmth ==
fun doSmth(i: Int) {}
@@ -34,7 +36,9 @@ l0:
<START> NEXT:[read (Unit)] PREV:[]
read (Unit) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
+9 -3
View File
@@ -42,9 +42,11 @@ l5:
r(doSmth) NEXT:[r(doSmth(r))] PREV:[r(r)]
r(doSmth(r)) NEXT:[<END>] PREV:[r(doSmth)]
l1:
<END> NEXT:[] PREV:[r(doSmth(r))]
<END> NEXT:[<SINK>] PREV:[r(doSmth(r))]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== t2 ==
fun t2(b: Boolean) {
@@ -81,9 +83,11 @@ l4:
read (Unit) NEXT:[<END>] PREV:[jf(l4)]
l1:
l5:
<END> NEXT:[] PREV:[ret l1, ret l1, read (Unit)]
<END> NEXT:[<SINK>] PREV:[ret l1, ret l1, read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== doSmth ==
fun doSmth(s: String) {}
@@ -92,7 +96,9 @@ l0:
<START> NEXT:[read (Unit)] PREV:[]
read (Unit) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -66,7 +66,9 @@ l12:
l13:
r(14) NEXT:[<END>] PREV:[jmp(l13), r(13)]
l1:
<END> NEXT:[] PREV:[r(14)]
<END> NEXT:[<SINK>] PREV:[r(14)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -20,9 +20,11 @@ l4:
l3:
read (Unit) NEXT:[<END>] PREV:[jf(l3)]
l1:
<END> NEXT:[] PREV:[read (Unit)]
<END> NEXT:[<SINK>] PREV:[read (Unit)]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
== dowhile ==
fun dowhile() {
@@ -44,7 +46,9 @@ l5:
l3:
* read (Unit) NEXT:[<END>] PREV:[]
l1:
<END> NEXT:[] PREV:[ret l1]
<END> NEXT:[<SINK>] PREV:[ret l1]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -12,7 +12,9 @@ l0:
l2:
r(false || (return false)) NEXT:[<END>] PREV:[jt(l2)]
l1:
<END> NEXT:[] PREV:[ret(*) l1, r(false || (return false))]
<END> NEXT:[<SINK>] PREV:[ret(*) l1, r(false || (return false))]
error:
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================
@@ -2,10 +2,12 @@
fun short() = 1
---------------------
l0:
<START> NEXT:[r(1)] PREV:[]
r(1) NEXT:[<END>] PREV:[<START>]
<START> NEXT:[r(1)] PREV:[]
r(1) NEXT:[<END>] PREV:[<START>]
l1:
<END> NEXT:[] PREV:[r(1)]
<END> NEXT:[<SINK>] PREV:[r(1)]
error:
<ERROR> NEXT:[] PREV:[]
<ERROR> NEXT:[] PREV:[]
sink:
<SINK> NEXT:[] PREV:[<END>]
=====================