diff --git a/compiler/testData/cfg/Basic.instructions b/compiler/testData/cfg/Basic.instructions index 54fb20d1cc2..b85b75bbe58 100644 --- a/compiler/testData/cfg/Basic.instructions +++ b/compiler/testData/cfg/Basic.instructions @@ -18,56 +18,47 @@ fun f(a : Boolean) : Unit { } --------------------- L0: - NEXT:[v(a : Boolean)] PREV:[] - v(a : Boolean) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(1)] PREV:[v(a : Boolean)] - r(1) NEXT:[r(a)] PREV:[w(a)] - r(a) NEXT:[r(2)] PREV:[r(1)] - r(2) NEXT:[r(toLong)] PREV:[r(a)] - r(toLong) NEXT:[r(toLong())] PREV:[r(2)] - r(toLong()) NEXT:[r(2.toLong())] PREV:[r(toLong)] - r(2.toLong()) NEXT:[r(a)] PREV:[r(toLong())] - r(a) NEXT:[r(3)] PREV:[r(2.toLong())] - r(3) NEXT:[r(foo)] PREV:[r(a)] - r(foo) NEXT:[r(foo(a, 3))] PREV:[r(3)] - r(foo(a, 3)) NEXT:[r(genfun)] PREV:[r(foo)] - r(genfun) NEXT:[r(genfun())] PREV:[r(foo(a, 3))] - r(genfun()) NEXT:[jmp?(L2)] PREV:[r(genfun)] - jmp?(L2) NEXT:[r({1}), d({1})] PREV:[r(genfun())] - d({1}) NEXT:[] PREV:[jmp?(L2)] + NEXT:[v(a : Boolean)] PREV:[] + v(a : Boolean) NEXT:[w(a)] PREV:[] + w(a) NEXT:[r(1)] PREV:[v(a : Boolean)] + r(1) NEXT:[r(a)] PREV:[w(a)] + r(a) NEXT:[r(2)] PREV:[r(1)] + r(2) NEXT:[call(toLong, toLong)] PREV:[r(a)] + call(toLong, toLong) NEXT:[r(a)] PREV:[r(2)] + r(a) NEXT:[r(3)] PREV:[call(toLong, toLong)] + r(3) NEXT:[call(foo, foo)] PREV:[r(a)] + call(foo, foo) NEXT:[call(genfun, genfun)] PREV:[r(3)] + call(genfun, genfun) NEXT:[jmp?(L2)] PREV:[call(foo, foo)] + jmp?(L2) NEXT:[r({1}), d({1})] PREV:[call(genfun, genfun)] + d({1}) NEXT:[] PREV:[jmp?(L2)] L2: - r({1}) NEXT:[r(flfun)] PREV:[jmp?(L2)] - r(flfun) NEXT:[r(flfun {1})] PREV:[r({1})] - r(flfun {1}) NEXT:[r(3)] PREV:[r(flfun)] - r(3) NEXT:[r(4)] PREV:[r(flfun {1})] - r(4) NEXT:[r(equals)] PREV:[r(3)] - r(equals) NEXT:[r(equals(4))] PREV:[r(4)] - r(equals(4)) NEXT:[r(3.equals(4))] PREV:[r(equals)] - r(3.equals(4)) NEXT:[r(3)] PREV:[r(equals(4))] - r(3) NEXT:[r(4)] PREV:[r(3.equals(4))] - r(4) NEXT:[r(equals)] PREV:[r(3)] - r(equals) NEXT:[r(3 equals 4)] PREV:[r(4)] - r(3 equals 4) NEXT:[r(1)] PREV:[r(equals)] - r(1) NEXT:[r(2)] PREV:[r(3 equals 4)] - r(2) NEXT:[r(+)] PREV:[r(1)] - r(+) NEXT:[r(1 + 2)] PREV:[r(2)] - r(1 + 2) NEXT:[r(a)] PREV:[r(+)] - r(a) NEXT:[jf(L5)] PREV:[r(1 + 2)] - jf(L5) NEXT:[r(a && true), r(true)] PREV:[r(a)] - r(true) NEXT:[r(a && true)] PREV:[jf(L5)] + r({1}) NEXT:[call(flfun, flfun)] PREV:[jmp?(L2)] + call(flfun, flfun) NEXT:[r(3)] PREV:[r({1})] + r(3) NEXT:[r(4)] PREV:[call(flfun, flfun)] + r(4) NEXT:[call(equals, equals)] PREV:[r(3)] + call(equals, equals) NEXT:[r(3)] PREV:[r(4)] + r(3) NEXT:[r(4)] PREV:[call(equals, equals)] + r(4) NEXT:[call(equals, equals)] PREV:[r(3)] + call(equals, equals) NEXT:[r(1)] PREV:[r(4)] + r(1) NEXT:[r(2)] PREV:[call(equals, equals)] + r(2) NEXT:[call(+, plus)] PREV:[r(1)] + call(+, plus) NEXT:[r(a)] PREV:[r(2)] + r(a) NEXT:[jf(L5)] PREV:[call(+, plus)] + jf(L5) NEXT:[r(a && true), r(true)] PREV:[r(a)] + r(true) NEXT:[r(a && true)] PREV:[jf(L5)] L5: - r(a && true) NEXT:[r(a)] PREV:[jf(L5), r(true)] - r(a) NEXT:[jt(L6)] PREV:[r(a && true)] - jt(L6) NEXT:[r(false), r(a || false)] PREV:[r(a)] - r(false) NEXT:[r(a || false)] PREV:[jt(L6)] + r(a && true) NEXT:[r(a)] PREV:[jf(L5), r(true)] + r(a) NEXT:[jt(L6)] PREV:[r(a && true)] + jt(L6) NEXT:[r(false), r(a || false)] PREV:[r(a)] + r(false) NEXT:[r(a || false)] PREV:[jt(L6)] L6: - r(a || false) NEXT:[] PREV:[jt(L6), r(false)] + r(a || false) NEXT:[] PREV:[jt(L6), r(false)] L1: - NEXT:[] PREV:[r(a || false)] + NEXT:[] PREV:[r(a || false)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, , d({1})] + NEXT:[] PREV:[, , d({1})] L3: NEXT:[r(1)] PREV:[] r(1) NEXT:[] PREV:[] diff --git a/compiler/testData/cfg/DeadCode.instructions b/compiler/testData/cfg/DeadCode.instructions index bd6401227c4..34fe6b7949a 100644 --- a/compiler/testData/cfg/DeadCode.instructions +++ b/compiler/testData/cfg/DeadCode.instructions @@ -5,12 +5,10 @@ fun test() { } --------------------- L0: - NEXT:[r(Exception)] PREV:[] - r(Exception) NEXT:[r(Exception())] PREV:[] - r(Exception()) NEXT:[throw (throw Exception())] PREV:[r(Exception)] - throw (throw Exception()) NEXT:[] PREV:[r(Exception())] -- r(test) NEXT:[r(test())] PREV:[] -- r(test()) NEXT:[] PREV:[] + NEXT:[call(Exception, )] PREV:[] + call(Exception, ) NEXT:[throw (throw Exception())] PREV:[] + throw (throw Exception()) NEXT:[] PREV:[call(Exception, )] +- call(test, test) NEXT:[] PREV:[] L1: NEXT:[] PREV:[] error: diff --git a/compiler/testData/cfg/DelegatedProperty.instructions b/compiler/testData/cfg/DelegatedProperty.instructions index a57d42d8854..2a84ad6b7e9 100644 --- a/compiler/testData/cfg/DelegatedProperty.instructions +++ b/compiler/testData/cfg/DelegatedProperty.instructions @@ -1,18 +1,31 @@ +== Delegate == +class Delegate { + fun get(_this: Any, p: PropertyMetadata): Int = 0 +} +--------------------- +L0: + NEXT:[] PREV:[] +L1: + NEXT:[] PREV:[] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== == a == val a = Delegate() --------------------- L0: - NEXT:[v(val a = Delegate())] PREV:[] - v(val a = Delegate()) NEXT:[r(Delegate)] PREV:[] - r(Delegate) NEXT:[r(Delegate())] PREV:[v(val a = Delegate())] - r(Delegate()) NEXT:[w(a)] PREV:[r(Delegate)] - w(a) NEXT:[] PREV:[r(Delegate())] + NEXT:[v(val a = Delegate())] PREV:[] + v(val a = Delegate()) NEXT:[call(Delegate, )] PREV:[] + call(Delegate, ) NEXT:[w(a)] PREV:[v(val a = Delegate())] + w(a) NEXT:[] PREV:[call(Delegate, )] L1: - NEXT:[] PREV:[w(a)] + NEXT:[] PREV:[w(a)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == b == val b by a diff --git a/compiler/testData/cfg/DelegatedProperty.kt b/compiler/testData/cfg/DelegatedProperty.kt index 478b174c6e4..69dd88733f3 100644 --- a/compiler/testData/cfg/DelegatedProperty.kt +++ b/compiler/testData/cfg/DelegatedProperty.kt @@ -1,3 +1,7 @@ +class Delegate { + fun get(_this: Any, p: PropertyMetadata): Int = 0 +} + val a = Delegate() val b by a \ No newline at end of file diff --git a/compiler/testData/cfg/FailFunction.instructions b/compiler/testData/cfg/FailFunction.instructions index fee3cb54eda..6833bcd0f15 100644 --- a/compiler/testData/cfg/FailFunction.instructions +++ b/compiler/testData/cfg/FailFunction.instructions @@ -4,14 +4,9 @@ fun fail() : Nothing { } --------------------- L0: - NEXT:[r(java)] PREV:[] - r(java) NEXT:[r(lang)] PREV:[] - r(lang) NEXT:[r(java.lang)] PREV:[r(java)] - r(java.lang) NEXT:[r(RuntimeException)] PREV:[r(lang)] - r(RuntimeException) NEXT:[r(RuntimeException())] PREV:[r(java.lang)] - r(RuntimeException()) NEXT:[r(java.lang.RuntimeException())] PREV:[r(RuntimeException)] - r(java.lang.RuntimeException()) NEXT:[throw (throw java.lang.RuntimeException())] PREV:[r(RuntimeException())] - throw (throw java.lang.RuntimeException()) NEXT:[] PREV:[r(java.lang.RuntimeException())] + NEXT:[call(RuntimeException, )] PREV:[] + call(RuntimeException, ) NEXT:[throw (throw java.lang.RuntimeException())] PREV:[] + throw (throw java.lang.RuntimeException()) NEXT:[] PREV:[call(RuntimeException, )] L1: NEXT:[] PREV:[] error: diff --git a/compiler/testData/cfg/Finally.instructions b/compiler/testData/cfg/Finally.instructions index 77f8d75a111..240ee1b8076 100644 --- a/compiler/testData/cfg/Finally.instructions +++ b/compiler/testData/cfg/Finally.instructions @@ -8,13 +8,8 @@ fun t1() { } --------------------- L0: - NEXT:[r(try { 1 } finally { 2 }) ] PREV:[] - r(try { - 1 - } finally { - 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { 1 } finally { 2 }) ] + NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] r(1) NEXT:[jmp(L3 [skipFinallyToErrorBlock])] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[r(1)] L2 [onExceptionToFinallyBlock]: @@ -44,22 +39,13 @@ fun t2() { } --------------------- L0: - NEXT:[r(try { 1 if (2 > 3) { retur..)] PREV:[] - r(try { - 1 - if (2 > 3) { - return - } - } finally { - 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { 1 if (2 > 3) { retur..)] + NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] r(1) NEXT:[r(2)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L3)] PREV:[r(>)] - jf(L3) NEXT:[read (Unit), r(2)] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L3)] PREV:[r(3)] + jf(L3) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] L4 [start finally]: r(2) NEXT:[ret L1] PREV:[jf(L3)] L5 [finish finally]: @@ -96,30 +82,20 @@ fun t3() { } --------------------- L0: - NEXT:[r(try { 1 @{ () => if (2 > 3..)] PREV:[] - r(try { - 1 - @{ () => - if (2 > 3) { - return@ - } - } - } finally { - 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { 1 @{ () => if (2 > 3..)] + NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] r(1) NEXT:[jmp?(L3)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] jmp?(L3) NEXT:[r({ () => if (2 > 3) { retur..), d({ () => if (2 > 3) { retur..)] PREV:[r(1)] - d({ () => - if (2 > 3) { - return@ - } + d({ () => + if (2 > 3) { + return@ + } }) NEXT:[] PREV:[jmp?(L3)] L3: - r({ () => - if (2 > 3) { - return@ - } + r({ () => + if (2 > 3) { + return@ + } }) NEXT:[jmp(L8 [skipFinallyToErrorBlock])] PREV:[jmp?(L3)] jmp(L8 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[r({ () => if (2 > 3) { retur..)] L2 [onExceptionToFinallyBlock]: @@ -136,24 +112,22 @@ error: sink: NEXT:[] PREV:[, , d({ () => if (2 > 3) { retur..)] L4: - NEXT:[r(())] PREV:[] - r(()) NEXT:[r(2)] PREV:[] - r(2) NEXT:[r(3)] PREV:[r(())] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L6)] PREV:[r(>)] - jf(L6) NEXT:[read (Unit), ret L5] PREV:[r(2 > 3)] - ret L5 NEXT:[] PREV:[jf(L6)] -- jmp(L7) NEXT:[] PREV:[] + NEXT:[r(2)] PREV:[] + r(2) NEXT:[r(3)] PREV:[] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] + jf(L6) NEXT:[read (Unit), ret L5] PREV:[call(>, compareTo)] + ret L5 NEXT:[] PREV:[jf(L6)] +- jmp(L7) NEXT:[] PREV:[] L6: - read (Unit) NEXT:[] PREV:[jf(L6)] + read (Unit) NEXT:[] PREV:[jf(L6)] L5: L7: - NEXT:[] PREV:[ret L5, read (Unit)] + NEXT:[] PREV:[ret L5, read (Unit)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == anonymous_0 == { () => @@ -163,24 +137,22 @@ sink: } --------------------- L4: - NEXT:[r(())] PREV:[] - r(()) NEXT:[r(2)] PREV:[] - r(2) NEXT:[r(3)] PREV:[r(())] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L6)] PREV:[r(>)] - jf(L6) NEXT:[read (Unit), ret L5] PREV:[r(2 > 3)] - ret L5 NEXT:[] PREV:[jf(L6)] -- jmp(L7) NEXT:[] PREV:[] + NEXT:[r(2)] PREV:[] + r(2) NEXT:[r(3)] PREV:[] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] + jf(L6) NEXT:[read (Unit), ret L5] PREV:[call(>, compareTo)] + ret L5 NEXT:[] PREV:[jf(L6)] +- jmp(L7) NEXT:[] PREV:[] L6: - read (Unit) NEXT:[] PREV:[jf(L6)] + read (Unit) NEXT:[] PREV:[jf(L6)] L5: L7: - NEXT:[] PREV:[ret L5, read (Unit)] + NEXT:[] PREV:[ret L5, read (Unit)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == t4 == fun t4() { @@ -199,26 +171,26 @@ fun t4() { L0: NEXT:[jmp?(L2)] PREV:[] jmp?(L2) NEXT:[r({ () => try { 1 if (2 > 3)..), d({ () => try { 1 if (2 > 3)..)] PREV:[] - d({ () => - try { - 1 + d({ () => + try { + 1 if (2 > 3) { - return@ - } - } finally { - 2 - } + return@ + } + } finally { + 2 + } }) NEXT:[] PREV:[jmp?(L2)] L2: - r({ () => - try { - 1 + r({ () => + try { + 1 if (2 > 3) { - return@ - } - } finally { - 2 - } + return@ + } + } finally { + 2 + } }) NEXT:[] PREV:[jmp?(L2)] L1: NEXT:[] PREV:[r({ () => try { 1 if (2 > 3)..)] @@ -227,23 +199,13 @@ error: sink: NEXT:[] PREV:[, , d({ () => try { 1 if (2 > 3)..)] L3: - NEXT:[r(())] PREV:[] - r(()) NEXT:[r(try { 1 if (2 > 3) { retur..)] PREV:[] - r(try { - 1 - if (2 > 3) { - return@ - } - } finally { - 2 - }) NEXT:[jmp?(L5 [onExceptionToFinallyBlock])] PREV:[r(())] - jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { 1 if (2 > 3) { retur..)] + NEXT:[jmp?(L5 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] r(1) NEXT:[r(2)] PREV:[jmp?(L5 [onExceptionToFinallyBlock])] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L6)] PREV:[r(>)] - jf(L6) NEXT:[read (Unit), r(2)] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] + jf(L6) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] L7 [start finally]: r(2) NEXT:[ret L4] PREV:[jf(L6)] L8 [finish finally]: @@ -278,23 +240,13 @@ sink: } --------------------- L3: - NEXT:[r(())] PREV:[] - r(()) NEXT:[r(try { 1 if (2 > 3) { retur..)] PREV:[] - r(try { - 1 - if (2 > 3) { - return@ - } - } finally { - 2 - }) NEXT:[jmp?(L5 [onExceptionToFinallyBlock])] PREV:[r(())] - jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { 1 if (2 > 3) { retur..)] + NEXT:[jmp?(L5 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L5 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] r(1) NEXT:[r(2)] PREV:[jmp?(L5 [onExceptionToFinallyBlock])] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L6)] PREV:[r(>)] - jf(L6) NEXT:[read (Unit), r(2)] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L6)] PREV:[r(3)] + jf(L6) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] L7 [start finally]: r(2) NEXT:[ret L4] PREV:[jf(L6)] L8 [finish finally]: @@ -331,36 +283,17 @@ fun t5() { } --------------------- L0: - NEXT:[r(while(true) { try { 1 if (..)] PREV:[] - r(while(true) { - try { - 1 - if (2 > 3) { - break @ - } - } finally { - 2 - } - }) NEXT:[r(true)] PREV:[] + NEXT:[r(true)] PREV:[] L2 [loop entry point]: L5 [condition entry point]: - r(true) NEXT:[r(try { 1 if (2 > 3) { break..)] PREV:[r(while(true) { try { 1 if (..), jmp(L2 [loop entry point])] + r(true) NEXT:[jmp?(L6 [onExceptionToFinallyBlock])] PREV:[, jmp(L2 [loop entry point])] L4 [body entry point]: - r(try { - 1 - if (2 > 3) { - break @ - } - } finally { - 2 - }) NEXT:[jmp?(L6 [onExceptionToFinallyBlock])] PREV:[r(true)] - jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { 1 if (2 > 3) { break..)] + jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(true)] r(1) NEXT:[r(2)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L7)] PREV:[r(>)] - jf(L7) NEXT:[read (Unit), r(2)] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] + jf(L7) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] L8 [start finally]: r(2) NEXT:[jmp(L3 [loop exit point])] PREV:[jf(L7)] L9 [finish finally]: @@ -401,35 +334,17 @@ fun t6() { } --------------------- L0: - NEXT:[r(try { @ while(true) { 1 if..)] PREV:[] - r(try { - @ while(true) { - 1 - if (2 > 3) { - break @ - } - } - 5 - } finally { - 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(while(true) { 1 if (2 > 3)..)] PREV:[r(try { @ while(true) { 1 if..)] - r(while(true) { - 1 - if (2 > 3) { - break @ - } - }) NEXT:[r(true)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(true)] PREV:[] L3 [loop entry point]: L6 [condition entry point]: - r(true) NEXT:[r(1)] PREV:[r(while(true) { 1 if (2 > 3)..), jmp(L3 [loop entry point])] + r(true) NEXT:[r(1)] PREV:[jmp?(L2 [onExceptionToFinallyBlock]), jmp(L3 [loop entry point])] L5 [body entry point]: r(1) NEXT:[r(2)] PREV:[r(true)] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L7)] PREV:[r(>)] - jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] + jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] PREV:[call(>, compareTo)] jmp(L4 [loop exit point]) NEXT:[read (Unit)] PREV:[jf(L7)] - jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[] L7: @@ -469,34 +384,17 @@ fun t7() { } --------------------- L0: - NEXT:[r(try { @ while(true) { 1 if..)] PREV:[] - r(try { - @ while(true) { - 1 - if (2 > 3) { - break @ - } - } - } finally { - 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(while(true) { 1 if (2 > 3)..)] PREV:[r(try { @ while(true) { 1 if..)] - r(while(true) { - 1 - if (2 > 3) { - break @ - } - }) NEXT:[r(true)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(true)] PREV:[] L3 [loop entry point]: L6 [condition entry point]: - r(true) NEXT:[r(1)] PREV:[r(while(true) { 1 if (2 > 3)..), jmp(L3 [loop entry point])] + r(true) NEXT:[r(1)] PREV:[jmp?(L2 [onExceptionToFinallyBlock]), jmp(L3 [loop entry point])] L5 [body entry point]: r(1) NEXT:[r(2)] PREV:[r(true)] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L7)] PREV:[r(>)] - jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] + jf(L7) NEXT:[read (Unit), jmp(L4 [loop exit point])] PREV:[call(>, compareTo)] jmp(L4 [loop exit point]) NEXT:[read (Unit)] PREV:[jf(L7)] - jmp(L8) NEXT:[jmp(L3 [loop entry point])] PREV:[] L7: @@ -535,67 +433,47 @@ fun t8(a : Int) { } --------------------- L0: - NEXT:[v(a : Int)] PREV:[] - v(a : Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(for (i in 1..a) { try { 1 ..)] PREV:[v(a : Int)] - r(for (i in 1..a) { - try { - 1 - if (2 > 3) { - continue @ - } - } finally { - 2 - } - }) NEXT:[r(1)] PREV:[w(a)] - r(1) NEXT:[r(a)] PREV:[r(for (i in 1..a) { try { 1 ..)] - r(a) NEXT:[r(..)] PREV:[r(1)] - r(..) NEXT:[r(1..a)] PREV:[r(a)] - r(1..a) NEXT:[v(i)] PREV:[r(..)] - v(i) NEXT:[w(i)] PREV:[r(1..a)] - w(i) NEXT:[jmp?(L2)] PREV:[v(i)] + NEXT:[v(a : Int)] PREV:[] + v(a : Int) NEXT:[w(a)] PREV:[] + w(a) NEXT:[r(1)] PREV:[v(a : Int)] + r(1) NEXT:[r(a)] PREV:[w(a)] + r(a) NEXT:[call(.., rangeTo)] PREV:[r(1)] + call(.., rangeTo) NEXT:[v(i)] PREV:[r(a)] + v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] + w(i) NEXT:[jmp?(L2)] PREV:[v(i)] L3: - jmp?(L2) NEXT:[read (Unit), r(try { 1 if (2 > 3) { conti..)] PREV:[w(i)] + jmp?(L2) NEXT:[read (Unit), jmp?(L6 [onExceptionToFinallyBlock])] PREV:[w(i)] L4 [loop entry point]: L5 [body entry point]: - r(try { - 1 - if (2 > 3) { - continue @ - } - } finally { - 2 - }) NEXT:[jmp?(L6 [onExceptionToFinallyBlock])] PREV:[jmp?(L2), jmp(L4 [loop entry point]), jmp?(L4 [loop entry point])] - jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { 1 if (2 > 3) { conti..)] - r(1) NEXT:[r(2)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L7)] PREV:[r(>)] - jf(L7) NEXT:[read (Unit), r(2)] PREV:[r(2 > 3)] + jmp?(L6 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[jmp?(L2), jmp(L4 [loop entry point]), jmp?(L4 [loop entry point])] + r(1) NEXT:[r(2)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] + r(2) NEXT:[r(3)] PREV:[r(1)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] + jf(L7) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] L8 [start finally]: - r(2) NEXT:[jmp(L4 [loop entry point])] PREV:[jf(L7)] + r(2) NEXT:[jmp(L4 [loop entry point])] PREV:[jf(L7)] L9 [finish finally]: - jmp(L4 [loop entry point]) NEXT:[r(try { 1 if (2 > 3) { conti..)] PREV:[r(2)] -- jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[] + jmp(L4 [loop entry point]) NEXT:[jmp?(L6 [onExceptionToFinallyBlock])] PREV:[r(2)] +- jmp(L10) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[] L7: - read (Unit) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[jf(L7)] + read (Unit) NEXT:[jmp(L11 [skipFinallyToErrorBlock])] PREV:[jf(L7)] L10: - jmp(L11 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] + jmp(L11 [skipFinallyToErrorBlock]) NEXT:[r(2)] PREV:[read (Unit)] L6 [onExceptionToFinallyBlock]: - r(2) NEXT:[jmp(error)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] - jmp(error) NEXT:[] PREV:[r(2)] + r(2) NEXT:[jmp(error)] PREV:[jmp?(L6 [onExceptionToFinallyBlock])] + jmp(error) NEXT:[] PREV:[r(2)] L11 [skipFinallyToErrorBlock]: - r(2) NEXT:[jmp?(L4 [loop entry point])] PREV:[jmp(L11 [skipFinallyToErrorBlock])] - jmp?(L4 [loop entry point]) NEXT:[r(try { 1 if (2 > 3) { conti..), read (Unit)] PREV:[r(2)] + r(2) NEXT:[jmp?(L4 [loop entry point])] PREV:[jmp(L11 [skipFinallyToErrorBlock])] + jmp?(L4 [loop entry point]) NEXT:[jmp?(L6 [onExceptionToFinallyBlock]), read (Unit)] PREV:[r(2)] L2: - read (Unit) NEXT:[] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] + read (Unit) NEXT:[] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] PREV:[read (Unit)] error: - NEXT:[] PREV:[jmp(error)] + NEXT:[] PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == t9 == fun t9(a : Int) { @@ -615,30 +493,12 @@ fun t9(a : Int) { L0: NEXT:[v(a : Int)] PREV:[] v(a : Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(try { @ for (i in 1..a) { ..)] PREV:[v(a : Int)] - r(try { - @ for (i in 1..a) { - 1 - if (2 > 3) { - continue @ - } - } - 5 - } finally { - 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[w(a)] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(for (i in 1..a) { 1 if (2 ..)] PREV:[r(try { @ for (i in 1..a) { ..)] - r(for (i in 1..a) { - 1 - if (2 > 3) { - continue @ - } - }) NEXT:[r(1)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(1) NEXT:[r(a)] PREV:[r(for (i in 1..a) { 1 if (2 ..)] - r(a) NEXT:[r(..)] PREV:[r(1)] - r(..) NEXT:[r(1..a)] PREV:[r(a)] - r(1..a) NEXT:[v(i)] PREV:[r(..)] - v(i) NEXT:[w(i)] PREV:[r(1..a)] + w(a) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[v(a : Int)] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[w(a)] + r(1) NEXT:[r(a)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(a) NEXT:[call(.., rangeTo)] PREV:[r(1)] + call(.., rangeTo) NEXT:[v(i)] PREV:[r(a)] + v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] w(i) NEXT:[jmp?(L3)] PREV:[v(i)] L4: jmp?(L3) NEXT:[read (Unit), r(1)] PREV:[w(i)] @@ -646,10 +506,9 @@ L5 [loop entry point]: L6 [body entry point]: r(1) NEXT:[r(2)] PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L7)] PREV:[r(>)] - jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] + jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] PREV:[call(>, compareTo)] jmp(L5 [loop entry point]) NEXT:[r(1)] PREV:[jf(L7)] - jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[] L7: @@ -691,29 +550,12 @@ fun t10(a : Int) { L0: NEXT:[v(a : Int)] PREV:[] v(a : Int) NEXT:[w(a)] PREV:[] - w(a) NEXT:[r(try { @ for (i in 1..a) { ..)] PREV:[v(a : Int)] - r(try { - @ for (i in 1..a) { - 1 - if (2 > 3) { - continue @ - } - } - } finally { - 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[w(a)] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(for (i in 1..a) { 1 if (2 ..)] PREV:[r(try { @ for (i in 1..a) { ..)] - r(for (i in 1..a) { - 1 - if (2 > 3) { - continue @ - } - }) NEXT:[r(1)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(1) NEXT:[r(a)] PREV:[r(for (i in 1..a) { 1 if (2 ..)] - r(a) NEXT:[r(..)] PREV:[r(1)] - r(..) NEXT:[r(1..a)] PREV:[r(a)] - r(1..a) NEXT:[v(i)] PREV:[r(..)] - v(i) NEXT:[w(i)] PREV:[r(1..a)] + w(a) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[v(a : Int)] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[w(a)] + r(1) NEXT:[r(a)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + r(a) NEXT:[call(.., rangeTo)] PREV:[r(1)] + call(.., rangeTo) NEXT:[v(i)] PREV:[r(a)] + v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] w(i) NEXT:[jmp?(L3)] PREV:[v(i)] L4: jmp?(L3) NEXT:[read (Unit), r(1)] PREV:[w(i)] @@ -721,10 +563,9 @@ L5 [loop entry point]: L6 [body entry point]: r(1) NEXT:[r(2)] PREV:[jmp?(L3), jmp(L5 [loop entry point]), jmp?(L5 [loop entry point])] r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(L7)] PREV:[r(>)] - jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] PREV:[r(2 > 3)] + r(3) NEXT:[call(>, compareTo)] PREV:[r(2)] + call(>, compareTo) NEXT:[jf(L7)] PREV:[r(3)] + jf(L7) NEXT:[read (Unit), jmp(L5 [loop entry point])] PREV:[call(>, compareTo)] jmp(L5 [loop entry point]) NEXT:[r(1)] PREV:[jf(L7)] - jmp(L8) NEXT:[jmp?(L5 [loop entry point])] PREV:[] L7: @@ -759,14 +600,8 @@ fun t11() { } --------------------- L0: - NEXT:[r(try { return 1 } finally {..)] PREV:[] - r(try { - return 1 - } - finally { - return 2 - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[r(try { return 1 } finally {..)] + NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(2), r(1)] PREV:[] r(1) NEXT:[r(2)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L3 [start finally]: r(2) NEXT:[ret(*) L1] PREV:[r(1)] @@ -799,31 +634,22 @@ fun t12() : Int { } --------------------- L0: - NEXT:[r(try { return 1 } finally {..)] PREV:[] - r(try { - return 1 - } - finally { - doSmth(3) - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[r(try { return 1 } finally {..)] + NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[] r(1) NEXT:[r(3)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] L3 [start finally]: - r(3) NEXT:[r(doSmth)] PREV:[r(1)] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[ret(*) L1] PREV:[r(doSmth)] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(1)] + call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] L4 [finish finally]: - ret(*) L1 NEXT:[] PREV:[r(doSmth(3))] + ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] - jmp(L5 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[] L2 [onExceptionToFinallyBlock]: - r(3) NEXT:[r(doSmth)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[jmp(error)] PREV:[r(doSmth)] - jmp(error) NEXT:[] PREV:[r(doSmth(3))] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] + jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] L5 [skipFinallyToErrorBlock]: -- r(3) NEXT:[r(doSmth)] PREV:[] -- r(doSmth) NEXT:[r(doSmth(3))] PREV:[] -- r(doSmth(3)) NEXT:[] PREV:[] +- r(3) NEXT:[call(doSmth, doSmth)] PREV:[] +- call(doSmth, doSmth) NEXT:[] PREV:[] L1: NEXT:[] PREV:[ret(*) L1] error: @@ -845,50 +671,37 @@ fun t13() : Int { } --------------------- L0: - NEXT:[r(try { return 1 } catch (e:..)] PREV:[] - r(try { - return 1 - } - catch (e: UnsupportedOperationException) { - doSmth(2) - } - finally { - doSmth(3) - }) NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[r(try { return 1 } catch (e:..)] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] - r(1) NEXT:[r(3)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + NEXT:[jmp?(L2 [onException])] PREV:[] + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] + r(1) NEXT:[r(3)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] L4 [start finally]: - r(3) NEXT:[r(doSmth)] PREV:[r(1)] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[ret(*) L1] PREV:[r(doSmth)] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(1)] + call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] L5 [finish finally]: - ret(*) L1 NEXT:[] PREV:[r(doSmth(3))] -- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] + ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] +- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[r(doSmth)] PREV:[w(e)] - r(doSmth) NEXT:[r(doSmth(2))] PREV:[r(2)] - r(doSmth(2)) NEXT:[jmp(L6 [afterCatches])] PREV:[r(doSmth)] - jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[r(doSmth(2))] + v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] + w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] + r(2) NEXT:[call(doSmth, doSmth)] PREV:[w(e)] + call(doSmth, doSmth) NEXT:[jmp(L6 [afterCatches])] PREV:[r(2)] + jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] L6 [afterCatches]: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[jmp(L6 [afterCatches])] + jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[jmp(L6 [afterCatches])] L3 [onExceptionToFinallyBlock]: - r(3) NEXT:[r(doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[jmp(error)] PREV:[r(doSmth)] - jmp(error) NEXT:[] PREV:[r(doSmth(3))] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] + jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] L7 [skipFinallyToErrorBlock]: - r(3) NEXT:[r(doSmth)] PREV:[jmp(L7 [skipFinallyToErrorBlock])] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[] PREV:[r(doSmth)] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L7 [skipFinallyToErrorBlock])] + call(doSmth, doSmth) NEXT:[] PREV:[r(3)] L1: - NEXT:[] PREV:[ret(*) L1, r(doSmth(3))] + NEXT:[] PREV:[ret(*) L1, call(doSmth, doSmth)] error: - NEXT:[] PREV:[jmp(error)] + NEXT:[] PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == t14 == fun t14() : Int { @@ -901,31 +714,24 @@ fun t14() : Int { } --------------------- L0: - NEXT:[r(try { return 1 } catch (e:..)] PREV:[] - r(try { - return 1 - } - catch (e: UnsupportedOperationException) { - doSmth(2) - }) NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), r(1)] PREV:[r(try { return 1 } catch (e:..)] - r(1) NEXT:[ret(*) L1] PREV:[jmp?(L2 [onException])] - ret(*) L1 NEXT:[] PREV:[r(1)] -- jmp(L3 [afterCatches]) NEXT:[] PREV:[] + NEXT:[jmp?(L2 [onException])] PREV:[] + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), r(1)] PREV:[] + r(1) NEXT:[ret(*) L1] PREV:[jmp?(L2 [onException])] + ret(*) L1 NEXT:[] PREV:[r(1)] +- jmp(L3 [afterCatches]) NEXT:[] PREV:[] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[r(doSmth)] PREV:[w(e)] - r(doSmth) NEXT:[r(doSmth(2))] PREV:[r(2)] - r(doSmth(2)) NEXT:[jmp(L3 [afterCatches])] PREV:[r(doSmth)] - jmp(L3 [afterCatches]) NEXT:[] PREV:[r(doSmth(2))] + v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] + w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] + r(2) NEXT:[call(doSmth, doSmth)] PREV:[w(e)] + call(doSmth, doSmth) NEXT:[jmp(L3 [afterCatches])] PREV:[r(2)] + jmp(L3 [afterCatches]) NEXT:[] PREV:[call(doSmth, doSmth)] L1: L3 [afterCatches]: - NEXT:[] PREV:[ret(*) L1, jmp(L3 [afterCatches])] + NEXT:[] PREV:[ret(*) L1, jmp(L3 [afterCatches])] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == t15 == fun t15() : Int { @@ -941,52 +747,39 @@ fun t15() : Int { } --------------------- L0: - NEXT:[r(try { return 1 } catch (e:..)] PREV:[] - r(try { - return 1 - } - catch (e: UnsupportedOperationException) { - return 2 - } - finally { - doSmth(3) - }) NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[r(try { return 1 } catch (e:..)] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] - r(1) NEXT:[r(3)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + NEXT:[jmp?(L2 [onException])] PREV:[] + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] + r(1) NEXT:[r(3)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] L4 [start finally]: - r(3) NEXT:[r(doSmth)] PREV:[r(1)] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[ret(*) L1] PREV:[r(doSmth)] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(1)] + call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] L5 [finish finally]: - ret(*) L1 NEXT:[] PREV:[r(doSmth(3))] -- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] + ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] +- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[r(3)] PREV:[w(e)] - r(3) NEXT:[r(doSmth)] PREV:[r(2)] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[ret(*) L1] PREV:[r(doSmth)] - ret(*) L1 NEXT:[] PREV:[r(doSmth(3))] -- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] + v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] + w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] + r(2) NEXT:[r(3)] PREV:[w(e)] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(2)] + call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] + ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] +- jmp(L6 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L6 [afterCatches]: -- jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[] +- jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[] L3 [onExceptionToFinallyBlock]: - r(3) NEXT:[r(doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[jmp(error)] PREV:[r(doSmth)] - jmp(error) NEXT:[] PREV:[r(doSmth(3))] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] + jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] L7 [skipFinallyToErrorBlock]: -- r(3) NEXT:[r(doSmth)] PREV:[] -- r(doSmth) NEXT:[r(doSmth(3))] PREV:[] -- r(doSmth(3)) NEXT:[] PREV:[] +- r(3) NEXT:[call(doSmth, doSmth)] PREV:[] +- call(doSmth, doSmth) NEXT:[] PREV:[] L1: - NEXT:[] PREV:[ret(*) L1, ret(*) L1] + NEXT:[] PREV:[ret(*) L1, ret(*) L1] error: - NEXT:[] PREV:[jmp(error)] + NEXT:[] PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == t16 == fun t16() : Int { @@ -1002,50 +795,37 @@ fun t16() : Int { } --------------------- L0: - NEXT:[r(try { doSmth(1) } catch (e..)] PREV:[] - r(try { - doSmth(1) - } - catch (e: UnsupportedOperationException) { - return 2 - } - finally { - doSmth(3) - }) NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[r(try { doSmth(1) } catch (e..)] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] - r(1) NEXT:[r(doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - r(doSmth) NEXT:[r(doSmth(1))] PREV:[r(1)] - r(doSmth(1)) NEXT:[jmp(L4 [afterCatches])] PREV:[r(doSmth)] - jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[r(doSmth(1))] + NEXT:[jmp?(L2 [onException])] PREV:[] + jmp?(L2 [onException]) NEXT:[v(e: UnsupportedOperationException), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(3), r(1)] PREV:[jmp?(L2 [onException])] + r(1) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) NEXT:[jmp(L4 [afterCatches])] PREV:[r(1)] + jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] L2 [onException]: - v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] - w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] - r(2) NEXT:[r(3)] PREV:[w(e)] + v(e: UnsupportedOperationException) NEXT:[w(e)] PREV:[jmp?(L2 [onException])] + w(e) NEXT:[r(2)] PREV:[v(e: UnsupportedOperationException)] + r(2) NEXT:[r(3)] PREV:[w(e)] L5 [start finally]: - r(3) NEXT:[r(doSmth)] PREV:[r(2)] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[ret(*) L1] PREV:[r(doSmth)] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[r(2)] + call(doSmth, doSmth) NEXT:[ret(*) L1] PREV:[r(3)] L6 [finish finally]: - ret(*) L1 NEXT:[] PREV:[r(doSmth(3))] -- jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] + ret(*) L1 NEXT:[] PREV:[call(doSmth, doSmth)] +- jmp(L4 [afterCatches]) NEXT:[jmp(L7 [skipFinallyToErrorBlock])] PREV:[] L4 [afterCatches]: - jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[jmp(L4 [afterCatches])] + jmp(L7 [skipFinallyToErrorBlock]) NEXT:[r(3)] PREV:[jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: - r(3) NEXT:[r(doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[jmp(error)] PREV:[r(doSmth)] - jmp(error) NEXT:[] PREV:[r(doSmth(3))] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + call(doSmth, doSmth) NEXT:[jmp(error)] PREV:[r(3)] + jmp(error) NEXT:[] PREV:[call(doSmth, doSmth)] L7 [skipFinallyToErrorBlock]: - r(3) NEXT:[r(doSmth)] PREV:[jmp(L7 [skipFinallyToErrorBlock])] - r(doSmth) NEXT:[r(doSmth(3))] PREV:[r(3)] - r(doSmth(3)) NEXT:[] PREV:[r(doSmth)] + r(3) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L7 [skipFinallyToErrorBlock])] + call(doSmth, doSmth) NEXT:[] PREV:[r(3)] L1: - NEXT:[] PREV:[ret(*) L1, r(doSmth(3))] + NEXT:[] PREV:[ret(*) L1, call(doSmth, doSmth)] error: - NEXT:[] PREV:[jmp(error)] + NEXT:[] PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == doSmth == fun doSmth(i: Int) { diff --git a/compiler/testData/cfg/FinallyTestCopy.instructions b/compiler/testData/cfg/FinallyTestCopy.instructions index faf0d39a190..d399696cce8 100644 --- a/compiler/testData/cfg/FinallyTestCopy.instructions +++ b/compiler/testData/cfg/FinallyTestCopy.instructions @@ -1,3 +1,55 @@ +== doSmth == +fun doSmth() {} +--------------------- +L0: + NEXT:[read (Unit)] PREV:[] + read (Unit) NEXT:[] PREV:[] +L1: + NEXT:[] PREV:[read (Unit)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== +== doSmth1 == +fun doSmth1() {} +--------------------- +L0: + NEXT:[read (Unit)] PREV:[] + read (Unit) NEXT:[] PREV:[] +L1: + NEXT:[] PREV:[read (Unit)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== +== doSmth2 == +fun doSmth2() {} +--------------------- +L0: + NEXT:[read (Unit)] PREV:[] + read (Unit) NEXT:[] PREV:[] +L1: + NEXT:[] PREV:[read (Unit)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== +== cond == +fun cond() {} +--------------------- +L0: + NEXT:[read (Unit)] PREV:[] + read (Unit) NEXT:[] PREV:[] +L1: + NEXT:[] PREV:[read (Unit)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== == testCopy1 == fun testCopy1() : Int { try { @@ -15,54 +67,39 @@ fun testCopy1() : Int { } --------------------- L0: - NEXT:[r(try { doSmth() } catch (e:..)] PREV:[] - r(try { - doSmth() - } - catch (e: NullPointerException) { - doSmth1() - } - catch (e: Exception) { - doSmth2() - } - finally { - return 1 - }) NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[r(try { doSmth() } catch (e:..)] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(1), r(doSmth)] PREV:[jmp?(L2 [onException])] - r(doSmth) NEXT:[r(doSmth())] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - r(doSmth()) NEXT:[jmp(L4 [afterCatches])] PREV:[r(doSmth)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[r(doSmth())] + NEXT:[jmp?(L2 [onException])] PREV:[] + jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(1), call(doSmth, doSmth)] PREV:[jmp?(L2 [onException])] + call(doSmth, doSmth) NEXT:[jmp(L4 [afterCatches])] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] L2 [onException]: - jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] - v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[r(doSmth1)] PREV:[v(e: NullPointerException)] - r(doSmth1) NEXT:[r(doSmth1())] PREV:[w(e)] - r(doSmth1()) NEXT:[jmp(L4 [afterCatches])] PREV:[r(doSmth1)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[r(doSmth1())] + jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] + v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] + w(e) NEXT:[call(doSmth1, doSmth1)] PREV:[v(e: NullPointerException)] + call(doSmth1, doSmth1) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth1, doSmth1)] L5 [catch 0]: - v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[r(doSmth2)] PREV:[v(e: Exception)] - r(doSmth2) NEXT:[r(doSmth2())] PREV:[w(e)] - r(doSmth2()) NEXT:[jmp(L4 [afterCatches])] PREV:[r(doSmth2)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[r(doSmth2())] + v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] + w(e) NEXT:[call(doSmth2, doSmth2)] PREV:[v(e: Exception)] + call(doSmth2, doSmth2) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth2, doSmth2)] L4 [afterCatches]: - jmp(L6 [skipFinallyToErrorBlock]) NEXT:[r(1)] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] + jmp(L6 [skipFinallyToErrorBlock]) NEXT:[r(1)] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: L7 [start finally]: - r(1) NEXT:[ret(*) L1] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - ret(*) L1 NEXT:[] PREV:[r(1)] + r(1) NEXT:[ret(*) L1] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + ret(*) L1 NEXT:[] PREV:[r(1)] L8 [finish finally]: -- jmp(error) NEXT:[] PREV:[] +- jmp(error) NEXT:[] PREV:[] L6 [skipFinallyToErrorBlock]: - r(1) NEXT:[ret(*) L1] PREV:[jmp(L6 [skipFinallyToErrorBlock])] - ret(*) L1 NEXT:[] PREV:[r(1)] + r(1) NEXT:[ret(*) L1] PREV:[jmp(L6 [skipFinallyToErrorBlock])] + ret(*) L1 NEXT:[] PREV:[r(1)] L1: - NEXT:[] PREV:[ret(*) L1, ret(*) L1] + NEXT:[] PREV:[ret(*) L1, ret(*) L1] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == testCopy2 == fun testCopy2() { @@ -84,89 +121,55 @@ fun testCopy2() { } --------------------- L0: - NEXT:[r(while (cond()) { try { doS..)] PREV:[] - r(while (cond()) { - try { - doSmth() - } - catch (e: NullPointerException) { - doSmth1() - } - catch (e: Exception) { - doSmth2() - } - finally { - if (cond()) return - else continue - } - }) NEXT:[r(cond)] PREV:[] + NEXT:[call(cond, cond)] PREV:[] L2 [loop entry point]: L5 [condition entry point]: - r(cond) NEXT:[r(cond())] PREV:[r(while (cond()) { try { doS..), jmp(L2 [loop entry point]), jmp(L2 [loop entry point])] - r(cond()) NEXT:[jf(L3 [loop exit point])] PREV:[r(cond)] - jf(L3 [loop exit point]) NEXT:[read (Unit), r(try { doSmth() } catch (e:..)] PREV:[r(cond())] + call(cond, cond) NEXT:[jf(L3 [loop exit point])] PREV:[, jmp(L2 [loop entry point]), jmp(L2 [loop entry point])] + jf(L3 [loop exit point]) NEXT:[read (Unit), jmp?(L6 [onException])] PREV:[call(cond, cond)] L4 [body entry point]: - r(try { - doSmth() - } - catch (e: NullPointerException) { - doSmth1() - } - catch (e: Exception) { - doSmth2() - } - finally { - if (cond()) return - else continue - }) NEXT:[jmp?(L6 [onException])] PREV:[jf(L3 [loop exit point])] - jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])] PREV:[r(try { doSmth() } catch (e:..)] - jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[r(cond), r(doSmth)] PREV:[jmp?(L6 [onException])] - r(doSmth) NEXT:[r(doSmth())] PREV:[jmp?(L7 [onExceptionToFinallyBlock])] - r(doSmth()) NEXT:[jmp(L8 [afterCatches])] PREV:[r(doSmth)] - jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[r(doSmth())] + jmp?(L6 [onException]) NEXT:[jmp?(L9 [catch 0]), jmp?(L7 [onExceptionToFinallyBlock])] PREV:[jf(L3 [loop exit point])] + jmp?(L7 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] PREV:[jmp?(L6 [onException])] + call(doSmth, doSmth) NEXT:[jmp(L8 [afterCatches])] PREV:[jmp?(L7 [onExceptionToFinallyBlock])] + jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] L6 [onException]: - jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])] - v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L9 [catch 0])] - w(e) NEXT:[r(doSmth1)] PREV:[v(e: NullPointerException)] - r(doSmth1) NEXT:[r(doSmth1())] PREV:[w(e)] - r(doSmth1()) NEXT:[jmp(L8 [afterCatches])] PREV:[r(doSmth1)] - jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[r(doSmth1())] + jmp?(L9 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L6 [onException])] + v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L9 [catch 0])] + w(e) NEXT:[call(doSmth1, doSmth1)] PREV:[v(e: NullPointerException)] + call(doSmth1, doSmth1) NEXT:[jmp(L8 [afterCatches])] PREV:[w(e)] + jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[call(doSmth1, doSmth1)] L9 [catch 0]: - v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L9 [catch 0])] - w(e) NEXT:[r(doSmth2)] PREV:[v(e: Exception)] - r(doSmth2) NEXT:[r(doSmth2())] PREV:[w(e)] - r(doSmth2()) NEXT:[jmp(L8 [afterCatches])] PREV:[r(doSmth2)] - jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[r(doSmth2())] + v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L9 [catch 0])] + w(e) NEXT:[call(doSmth2, doSmth2)] PREV:[v(e: Exception)] + call(doSmth2, doSmth2) NEXT:[jmp(L8 [afterCatches])] PREV:[w(e)] + jmp(L8 [afterCatches]) NEXT:[jmp(L10 [skipFinallyToErrorBlock])] PREV:[call(doSmth2, doSmth2)] L8 [afterCatches]: - jmp(L10 [skipFinallyToErrorBlock]) NEXT:[r(cond)] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])] + jmp(L10 [skipFinallyToErrorBlock]) NEXT:[call(cond, cond)] PREV:[jmp(L8 [afterCatches]), jmp(L8 [afterCatches]), jmp(L8 [afterCatches])] L7 [onExceptionToFinallyBlock]: L11 [start finally]: - r(cond) NEXT:[r(cond())] PREV:[jmp?(L7 [onExceptionToFinallyBlock])] - r(cond()) NEXT:[jf(L12)] PREV:[r(cond)] - jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1] PREV:[r(cond())] - ret L1 NEXT:[] PREV:[jf(L12)] -- jmp(L13) NEXT:[jmp(error)] PREV:[] + call(cond, cond) NEXT:[jf(L12)] PREV:[jmp?(L7 [onExceptionToFinallyBlock])] + jf(L12) NEXT:[jmp(L2 [loop entry point]), ret L1] PREV:[call(cond, cond)] + ret L1 NEXT:[] PREV:[jf(L12)] +- jmp(L13) NEXT:[jmp(error)] PREV:[] L12: - jmp(L2 [loop entry point]) NEXT:[r(cond)] PREV:[jf(L12)] + jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(L12)] L13: L14 [finish finally]: -- jmp(error) NEXT:[] PREV:[] +- jmp(error) NEXT:[] PREV:[] L10 [skipFinallyToErrorBlock]: - r(cond) NEXT:[r(cond())] PREV:[jmp(L10 [skipFinallyToErrorBlock])] - r(cond()) NEXT:[jf(copy L12)] PREV:[r(cond)] - jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1] PREV:[r(cond())] - ret L1 NEXT:[] PREV:[jf(copy L12)] -- jmp(copy L13) NEXT:[jmp(L2 [loop entry point])] PREV:[] - jmp(L2 [loop entry point]) NEXT:[r(cond)] PREV:[jf(copy L12)] -- jmp(L2 [loop entry point]) NEXT:[r(cond)] PREV:[] + call(cond, cond) NEXT:[jf(copy L12)] PREV:[jmp(L10 [skipFinallyToErrorBlock])] + jf(copy L12) NEXT:[jmp(L2 [loop entry point]), ret L1] PREV:[call(cond, cond)] + ret L1 NEXT:[] PREV:[jf(copy L12)] +- jmp(copy L13) NEXT:[jmp(L2 [loop entry point])] PREV:[] + jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(copy L12)] +- jmp(L2 [loop entry point]) NEXT:[call(cond, cond)] PREV:[] L3 [loop exit point]: - read (Unit) NEXT:[] PREV:[jf(L3 [loop exit point])] + read (Unit) NEXT:[] PREV:[jf(L3 [loop exit point])] L1: - NEXT:[] PREV:[ret L1, ret L1, read (Unit)] + NEXT:[] PREV:[ret L1, ret L1, read (Unit)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == testCopy3 == fun testCopy3() { @@ -185,69 +188,50 @@ fun testCopy3() { } --------------------- L0: - NEXT:[r(try { doSmth() } catch (e:..)] PREV:[] - r(try { - doSmth() - } - catch (e: NullPointerException) { - doSmth1() - } - catch (e: Exception) { - doSmth2() - } - finally { - while (cond()); - }) NEXT:[jmp?(L2 [onException])] PREV:[] - jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[r(try { doSmth() } catch (e:..)] - jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[r(while (cond())), r(doSmth)] PREV:[jmp?(L2 [onException])] - r(doSmth) NEXT:[r(doSmth())] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] - r(doSmth()) NEXT:[jmp(L4 [afterCatches])] PREV:[r(doSmth)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[r(doSmth())] + NEXT:[jmp?(L2 [onException])] PREV:[] + jmp?(L2 [onException]) NEXT:[jmp?(L5 [catch 0]), jmp?(L3 [onExceptionToFinallyBlock])] PREV:[] + jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[call(cond, cond), call(doSmth, doSmth)] PREV:[jmp?(L2 [onException])] + call(doSmth, doSmth) NEXT:[jmp(L4 [afterCatches])] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth, doSmth)] L2 [onException]: - jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] - v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[r(doSmth1)] PREV:[v(e: NullPointerException)] - r(doSmth1) NEXT:[r(doSmth1())] PREV:[w(e)] - r(doSmth1()) NEXT:[jmp(L4 [afterCatches])] PREV:[r(doSmth1)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[r(doSmth1())] + jmp?(L5 [catch 0]) NEXT:[v(e: Exception), v(e: NullPointerException)] PREV:[jmp?(L2 [onException])] + v(e: NullPointerException) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] + w(e) NEXT:[call(doSmth1, doSmth1)] PREV:[v(e: NullPointerException)] + call(doSmth1, doSmth1) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth1, doSmth1)] L5 [catch 0]: - v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] - w(e) NEXT:[r(doSmth2)] PREV:[v(e: Exception)] - r(doSmth2) NEXT:[r(doSmth2())] PREV:[w(e)] - r(doSmth2()) NEXT:[jmp(L4 [afterCatches])] PREV:[r(doSmth2)] - jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[r(doSmth2())] + v(e: Exception) NEXT:[w(e)] PREV:[jmp?(L5 [catch 0])] + w(e) NEXT:[call(doSmth2, doSmth2)] PREV:[v(e: Exception)] + call(doSmth2, doSmth2) NEXT:[jmp(L4 [afterCatches])] PREV:[w(e)] + jmp(L4 [afterCatches]) NEXT:[jmp(L6 [skipFinallyToErrorBlock])] PREV:[call(doSmth2, doSmth2)] L4 [afterCatches]: - jmp(L6 [skipFinallyToErrorBlock]) NEXT:[r(while (cond()))] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] + jmp(L6 [skipFinallyToErrorBlock]) NEXT:[call(cond, cond)] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches]), jmp(L4 [afterCatches])] L3 [onExceptionToFinallyBlock]: L7 [start finally]: - r(while (cond())) NEXT:[r(cond)] PREV:[jmp?(L3 [onExceptionToFinallyBlock])] L8 [loop entry point]: L11 [condition entry point]: - r(cond) NEXT:[r(cond())] PREV:[r(while (cond())), jmp(L8 [loop entry point])] - r(cond()) NEXT:[jf(L9 [loop exit point])] PREV:[r(cond)] - jf(L9 [loop exit point]) NEXT:[read (Unit), jmp(L8 [loop entry point])] PREV:[r(cond())] + call(cond, cond) NEXT:[jf(L9 [loop exit point])] PREV:[jmp?(L3 [onExceptionToFinallyBlock]), jmp(L8 [loop entry point])] + jf(L9 [loop exit point]) NEXT:[read (Unit), jmp(L8 [loop entry point])] PREV:[call(cond, cond)] L10 [body entry point]: - jmp(L8 [loop entry point]) NEXT:[r(cond)] PREV:[jf(L9 [loop exit point])] + jmp(L8 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(L9 [loop exit point])] L9 [loop exit point]: - read (Unit) NEXT:[jmp(error)] PREV:[jf(L9 [loop exit point])] + read (Unit) NEXT:[jmp(error)] PREV:[jf(L9 [loop exit point])] L12 [finish finally]: - jmp(error) NEXT:[] PREV:[read (Unit)] + jmp(error) NEXT:[] PREV:[read (Unit)] L6 [skipFinallyToErrorBlock]: - r(while (cond())) NEXT:[r(cond)] PREV:[jmp(L6 [skipFinallyToErrorBlock])] - r(cond) NEXT:[r(cond())] PREV:[r(while (cond())), jmp(copy L8 [loop entry point])] - r(cond()) NEXT:[jf(copy L9 [loop exit point])] PREV:[r(cond)] - jf(copy L9 [loop exit point]) NEXT:[read (Unit), jmp(copy L8 [loop entry point])] PREV:[r(cond())] - jmp(copy L8 [loop entry point]) NEXT:[r(cond)] PREV:[jf(copy L9 [loop exit point])] - read (Unit) NEXT:[] PREV:[jf(copy L9 [loop exit point])] + call(cond, cond) NEXT:[jf(copy L9 [loop exit point])] PREV:[jmp(L6 [skipFinallyToErrorBlock]), jmp(copy L8 [loop entry point])] + jf(copy L9 [loop exit point]) NEXT:[read (Unit), jmp(copy L8 [loop entry point])] PREV:[call(cond, cond)] + jmp(copy L8 [loop entry point]) NEXT:[call(cond, cond)] PREV:[jf(copy L9 [loop exit point])] + read (Unit) NEXT:[] PREV:[jf(copy L9 [loop exit point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] PREV:[read (Unit)] error: - NEXT:[] PREV:[jmp(error)] + NEXT:[] PREV:[jmp(error)] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == doTestCopy4 == -fun doTestCopy4() : Int { +fun doTestCopy4(list: List?) : Int { try { doSmth() } @@ -258,25 +242,18 @@ fun doTestCopy4() : Int { } --------------------- L0: - NEXT:[r(try { doSmth() } finally {..)] PREV:[] - r(try { - doSmth() - } - finally { - if(list != null) { - } - }) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[] - jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(list), r(doSmth)] PREV:[r(try { doSmth() } finally {..)] - r(doSmth) NEXT:[r(doSmth())] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(doSmth()) NEXT:[jmp(L3 [skipFinallyToErrorBlock])] PREV:[r(doSmth)] - jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(list)] PREV:[r(doSmth())] + NEXT:[v(list: List?)] PREV:[] + v(list: List?) NEXT:[w(list)] PREV:[] + w(list) NEXT:[jmp?(L2 [onExceptionToFinallyBlock])] PREV:[v(list: List?)] + jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[r(list), call(doSmth, doSmth)] PREV:[w(list)] + call(doSmth, doSmth) NEXT:[jmp(L3 [skipFinallyToErrorBlock])] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] + jmp(L3 [skipFinallyToErrorBlock]) NEXT:[r(list)] PREV:[call(doSmth, doSmth)] L2 [onExceptionToFinallyBlock]: L4 [start finally]: r(list) NEXT:[r(null)] PREV:[jmp?(L2 [onExceptionToFinallyBlock])] - r(null) NEXT:[r(!=)] PREV:[r(list)] - r(!=) NEXT:[r(list != null)] PREV:[r(null)] - r(list != null) NEXT:[jf(L5)] PREV:[r(!=)] - jf(L5) NEXT:[read (Unit), read (Unit)] PREV:[r(list != null)] + r(null) NEXT:[call(list != null, equals)] PREV:[r(list)] + call(list != null, equals) NEXT:[jf(L5)] PREV:[r(null)] + jf(L5) NEXT:[read (Unit), read (Unit)] PREV:[call(list != null, equals)] read (Unit) NEXT:[jmp(L6)] PREV:[jf(L5)] jmp(L6) NEXT:[jmp(error)] PREV:[read (Unit)] L5: @@ -286,10 +263,9 @@ L7 [finish finally]: jmp(error) NEXT:[] PREV:[jmp(L6), read (Unit)] L3 [skipFinallyToErrorBlock]: r(list) NEXT:[r(null)] PREV:[jmp(L3 [skipFinallyToErrorBlock])] - r(null) NEXT:[r(!=)] PREV:[r(list)] - r(!=) NEXT:[r(list != null)] PREV:[r(null)] - r(list != null) NEXT:[jf(copy L5)] PREV:[r(!=)] - jf(copy L5) NEXT:[read (Unit), read (Unit)] PREV:[r(list != null)] + r(null) NEXT:[call(list != null, equals)] PREV:[r(list)] + call(list != null, equals) NEXT:[jf(copy L5)] PREV:[r(null)] + jf(copy L5) NEXT:[read (Unit), read (Unit)] PREV:[call(list != null, equals)] read (Unit) NEXT:[jmp(copy L6)] PREV:[jf(copy L5)] jmp(copy L6) NEXT:[] PREV:[read (Unit)] read (Unit) NEXT:[] PREV:[jf(copy L5)] diff --git a/compiler/testData/cfg/FinallyTestCopy.kt b/compiler/testData/cfg/FinallyTestCopy.kt index c44079c9caf..2566b835557 100644 --- a/compiler/testData/cfg/FinallyTestCopy.kt +++ b/compiler/testData/cfg/FinallyTestCopy.kt @@ -1,3 +1,8 @@ +fun doSmth() {} +fun doSmth1() {} +fun doSmth2() {} +fun cond() {} + fun testCopy1() : Int { try { doSmth() @@ -46,7 +51,7 @@ fun testCopy3() { } } -fun doTestCopy4() : Int { +fun doTestCopy4(list: List?) : Int { try { doSmth() } diff --git a/compiler/testData/cfg/For.instructions b/compiler/testData/cfg/For.instructions index 3d28a4a8af1..b2eaabf7f4b 100644 --- a/compiler/testData/cfg/For.instructions +++ b/compiler/testData/cfg/For.instructions @@ -6,32 +6,27 @@ fun t1() { } --------------------- L0: - NEXT:[r(for (i in 1..2) { doSmth(i..)] PREV:[] - r(for (i in 1..2) { - doSmth(i) - }) NEXT:[r(1)] PREV:[] - r(1) NEXT:[r(2)] PREV:[r(for (i in 1..2) { doSmth(i..)] - r(2) NEXT:[r(..)] PREV:[r(1)] - r(..) NEXT:[r(1..2)] PREV:[r(2)] - r(1..2) NEXT:[v(i)] PREV:[r(..)] - v(i) NEXT:[w(i)] PREV:[r(1..2)] - w(i) NEXT:[jmp?(L2)] PREV:[v(i)] + NEXT:[r(1)] PREV:[] + r(1) NEXT:[r(2)] PREV:[] + r(2) NEXT:[call(.., rangeTo)] PREV:[r(1)] + call(.., rangeTo) NEXT:[v(i)] PREV:[r(2)] + v(i) NEXT:[w(i)] PREV:[call(.., rangeTo)] + w(i) NEXT:[jmp?(L2)] PREV:[v(i)] L3: - jmp?(L2) NEXT:[read (Unit), r(i)] PREV:[w(i)] + jmp?(L2) NEXT:[read (Unit), r(i)] PREV:[w(i)] L4 [loop entry point]: L5 [body entry point]: - r(i) NEXT:[r(doSmth)] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] - r(doSmth) NEXT:[r(doSmth(i))] PREV:[r(i)] - r(doSmth(i)) NEXT:[jmp?(L4 [loop entry point])] PREV:[r(doSmth)] - jmp?(L4 [loop entry point]) NEXT:[r(i), read (Unit)] PREV:[r(doSmth(i))] + r(i) NEXT:[call(doSmth, doSmth)] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] + call(doSmth, doSmth) NEXT:[jmp?(L4 [loop entry point])] PREV:[r(i)] + jmp?(L4 [loop entry point]) NEXT:[r(i), read (Unit)] PREV:[call(doSmth, doSmth)] L2: - read (Unit) NEXT:[] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] + read (Unit) NEXT:[] PREV:[jmp?(L2), jmp?(L4 [loop entry point])] L1: - NEXT:[] PREV:[read (Unit)] + NEXT:[] PREV:[read (Unit)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == doSmth == fun doSmth(i: Int) {} diff --git a/compiler/testData/cfg/If.instructions b/compiler/testData/cfg/If.instructions index c5e473cafc5..cfe905639bc 100644 --- a/compiler/testData/cfg/If.instructions +++ b/compiler/testData/cfg/If.instructions @@ -17,40 +17,38 @@ fun t1(b: Boolean) { } --------------------- L0: - NEXT:[v(b: Boolean)] PREV:[] - v(b: Boolean) NEXT:[w(b)] PREV:[] - w(b) NEXT:[v(var u: String)] PREV:[v(b: Boolean)] - v(var u: String) NEXT:[r(b)] PREV:[w(b)] - r(b) NEXT:[jf(L2)] PREV:[v(var u: String)] - jf(L2) NEXT:[read (Unit), r("s")] PREV:[r(b)] - r("s") NEXT:[w(u)] PREV:[jf(L2)] - w(u) NEXT:[jmp(L3)] PREV:[r("s")] - jmp(L3) NEXT:[r(u)] PREV:[w(u)] + NEXT:[v(b: Boolean)] PREV:[] + v(b: Boolean) NEXT:[w(b)] PREV:[] + w(b) NEXT:[v(var u: String)] PREV:[v(b: Boolean)] + v(var u: String) NEXT:[r(b)] PREV:[w(b)] + r(b) NEXT:[jf(L2)] PREV:[v(var u: String)] + jf(L2) NEXT:[read (Unit), r("s")] PREV:[r(b)] + r("s") NEXT:[w(u)] PREV:[jf(L2)] + w(u) NEXT:[jmp(L3)] PREV:[r("s")] + jmp(L3) NEXT:[r(u)] PREV:[w(u)] L2: - read (Unit) NEXT:[r(u)] PREV:[jf(L2)] + read (Unit) NEXT:[r(u)] PREV:[jf(L2)] L3: - r(u) NEXT:[r(doSmth)] PREV:[jmp(L3), read (Unit)] - r(doSmth) NEXT:[r(doSmth(u))] PREV:[r(u)] - r(doSmth(u)) NEXT:[v(var r: String)] PREV:[r(doSmth)] - v(var r: String) NEXT:[r(b)] PREV:[r(doSmth(u))] - r(b) NEXT:[jf(L4)] PREV:[v(var r: String)] - jf(L4) NEXT:[r("t"), r("s")] PREV:[r(b)] - r("s") NEXT:[w(r)] PREV:[jf(L4)] - w(r) NEXT:[jmp(L5)] PREV:[r("s")] - jmp(L5) NEXT:[r(r)] PREV:[w(r)] + r(u) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L3), read (Unit)] + call(doSmth, doSmth) NEXT:[v(var r: String)] PREV:[r(u)] + v(var r: String) NEXT:[r(b)] PREV:[call(doSmth, doSmth)] + r(b) NEXT:[jf(L4)] PREV:[v(var r: String)] + jf(L4) NEXT:[r("t"), r("s")] PREV:[r(b)] + r("s") NEXT:[w(r)] PREV:[jf(L4)] + w(r) NEXT:[jmp(L5)] PREV:[r("s")] + jmp(L5) NEXT:[r(r)] PREV:[w(r)] L4: - r("t") NEXT:[w(r)] PREV:[jf(L4)] - w(r) NEXT:[r(r)] PREV:[r("t")] + r("t") NEXT:[w(r)] PREV:[jf(L4)] + w(r) NEXT:[r(r)] PREV:[r("t")] L5: - r(r) NEXT:[r(doSmth)] PREV:[jmp(L5), w(r)] - r(doSmth) NEXT:[r(doSmth(r))] PREV:[r(r)] - r(doSmth(r)) NEXT:[] PREV:[r(doSmth)] + r(r) NEXT:[call(doSmth, doSmth)] PREV:[jmp(L5), w(r)] + call(doSmth, doSmth) NEXT:[] PREV:[r(r)] L1: - NEXT:[] PREV:[r(doSmth(r))] + NEXT:[] PREV:[call(doSmth, doSmth)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == t2 == fun t2(b: Boolean) { @@ -65,36 +63,34 @@ fun t2(b: Boolean) { } --------------------- L0: - NEXT:[v(b: Boolean)] PREV:[] - v(b: Boolean) NEXT:[w(b)] PREV:[] - w(b) NEXT:[v(val i = 3)] PREV:[v(b: Boolean)] - v(val i = 3) NEXT:[r(3)] PREV:[w(b)] - r(3) NEXT:[w(i)] PREV:[v(val i = 3)] - w(i) NEXT:[r(b)] PREV:[r(3)] - r(b) NEXT:[jf(L2)] PREV:[w(i)] - jf(L2) NEXT:[read (Unit), ret L1] PREV:[r(b)] - ret L1 NEXT:[] PREV:[jf(L2)] -- jmp(L3) NEXT:[r(i)] PREV:[] + NEXT:[v(b: Boolean)] PREV:[] + v(b: Boolean) NEXT:[w(b)] PREV:[] + w(b) NEXT:[v(val i = 3)] PREV:[v(b: Boolean)] + v(val i = 3) NEXT:[r(3)] PREV:[w(b)] + r(3) NEXT:[w(i)] PREV:[v(val i = 3)] + w(i) NEXT:[r(b)] PREV:[r(3)] + r(b) NEXT:[jf(L2)] PREV:[w(i)] + jf(L2) NEXT:[read (Unit), ret L1] PREV:[r(b)] + ret L1 NEXT:[] PREV:[jf(L2)] +- jmp(L3) NEXT:[r(i)] PREV:[] L2: - read (Unit) NEXT:[r(i)] PREV:[jf(L2)] + read (Unit) NEXT:[r(i)] PREV:[jf(L2)] L3: - r(i) NEXT:[r(doSmth)] PREV:[read (Unit)] - r(doSmth) NEXT:[r(doSmth(i))] PREV:[r(i)] - r(doSmth(i)) NEXT:[r(i)] PREV:[r(doSmth)] - r(i) NEXT:[r(i is Int)] PREV:[r(doSmth(i))] - r(i is Int) NEXT:[jf(L4)] PREV:[r(i)] - jf(L4) NEXT:[read (Unit), ret L1] PREV:[r(i is Int)] - ret L1 NEXT:[] PREV:[jf(L4)] -- jmp(L5) NEXT:[] PREV:[] + r(i) NEXT:[call(doSmth, doSmth)] PREV:[read (Unit)] + call(doSmth, doSmth) NEXT:[r(i)] PREV:[r(i)] + r(i) NEXT:[jf(L4)] PREV:[call(doSmth, doSmth)] + jf(L4) NEXT:[read (Unit), ret L1] PREV:[r(i)] + ret L1 NEXT:[] PREV:[jf(L4)] +- jmp(L5) NEXT:[] PREV:[] L4: - read (Unit) NEXT:[] PREV:[jf(L4)] + read (Unit) NEXT:[] PREV:[jf(L4)] L1: L5: - NEXT:[] PREV:[ret L1, ret L1, read (Unit)] + NEXT:[] PREV:[ret L1, ret L1, read (Unit)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == doSmth == fun doSmth(s: String) {} diff --git a/compiler/testData/cfg/MultiDecl.instructions b/compiler/testData/cfg/MultiDecl.instructions index 92c44184b99..8d935658a62 100644 --- a/compiler/testData/cfg/MultiDecl.instructions +++ b/compiler/testData/cfg/MultiDecl.instructions @@ -20,21 +20,23 @@ fun test(c: C) { } --------------------- L0: - NEXT:[v(c: C)] PREV:[] - v(c: C) NEXT:[w(c)] PREV:[] - w(c) NEXT:[r(c)] PREV:[v(c: C)] - r(c) NEXT:[v(a)] PREV:[w(c)] - v(a) NEXT:[w(a)] PREV:[r(c)] - w(a) NEXT:[v(b)] PREV:[v(a)] - v(b) NEXT:[w(b)] PREV:[w(a)] - w(b) NEXT:[v(val d = 1)] PREV:[v(b)] - v(val d = 1) NEXT:[r(1)] PREV:[w(b)] - r(1) NEXT:[w(d)] PREV:[v(val d = 1)] - w(d) NEXT:[] PREV:[r(1)] + NEXT:[v(c: C)] PREV:[] + v(c: C) NEXT:[w(c)] PREV:[] + w(c) NEXT:[r(c)] PREV:[v(c: C)] + r(c) NEXT:[v(a)] PREV:[w(c)] + v(a) NEXT:[call(a, component1)] PREV:[r(c)] + call(a, component1) NEXT:[w(a)] PREV:[v(a)] + w(a) NEXT:[v(b)] PREV:[call(a, component1)] + v(b) NEXT:[call(b, component2)] PREV:[w(a)] + call(b, component2) NEXT:[w(b)] PREV:[v(b)] + w(b) NEXT:[v(val d = 1)] PREV:[call(b, component2)] + v(val d = 1) NEXT:[r(1)] PREV:[w(b)] + r(1) NEXT:[w(d)] PREV:[v(val d = 1)] + w(d) NEXT:[] PREV:[r(1)] L1: - NEXT:[] PREV:[w(d)] + NEXT:[] PREV:[w(d)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== diff --git a/compiler/testData/cfg/ObjectExpression.instructions b/compiler/testData/cfg/ObjectExpression.instructions index 3d8736fdf83..ad16e3a80b3 100644 --- a/compiler/testData/cfg/ObjectExpression.instructions +++ b/compiler/testData/cfg/ObjectExpression.instructions @@ -41,11 +41,9 @@ L0: r(b) NEXT:[r(object : A by b {})] PREV:[v(val o = object : A by b {})] r(object : A by b {}) NEXT:[w(o)] PREV:[r(b)] w(o) NEXT:[r(o)] PREV:[r(object : A by b {})] - r(o) NEXT:[r(foo)] PREV:[w(o)] - r(foo) NEXT:[r(foo())] PREV:[r(o)] - r(foo()) NEXT:[r(o.foo())] PREV:[r(foo)] - r(o.foo()) NEXT:[ret(*) L1] PREV:[r(foo())] - ret(*) L1 NEXT:[] PREV:[r(o.foo())] + r(o) NEXT:[call(foo, foo)] PREV:[w(o)] + call(foo, foo) NEXT:[ret(*) L1] PREV:[r(o)] + ret(*) L1 NEXT:[] PREV:[call(foo, foo)] L1: NEXT:[] PREV:[ret(*) L1] error: diff --git a/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions b/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions index 000accbdbd3..c501c6b2e6c 100644 --- a/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions +++ b/compiler/testData/cfg/OnlyWhileInFunctionBody.instructions @@ -6,17 +6,13 @@ fun main() { } --------------------- L0: - NEXT:[r(while(1 > 0) { 2 }) ] PREV:[] - r(while(1 > 0) { - 2 - }) NEXT:[r(1)] PREV:[] + NEXT:[r(1)] PREV:[] L2 [loop entry point]: L5 [condition entry point]: - r(1) NEXT:[r(0)] PREV:[r(while(1 > 0) { 2 }) , jmp(L2 [loop entry point])] - r(0) NEXT:[r(>)] PREV:[r(1)] - r(>) NEXT:[r(1 > 0)] PREV:[r(0)] - r(1 > 0) NEXT:[jf(L3 [loop exit point])] PREV:[r(>)] - jf(L3 [loop exit point]) NEXT:[read (Unit), r(2)] PREV:[r(1 > 0)] + r(1) NEXT:[r(0)] PREV:[, jmp(L2 [loop entry point])] + r(0) NEXT:[call(>, compareTo)] PREV:[r(1)] + call(>, compareTo) NEXT:[jf(L3 [loop exit point])] PREV:[r(0)] + jf(L3 [loop exit point]) NEXT:[read (Unit), r(2)] PREV:[call(>, compareTo)] L4 [body entry point]: r(2) NEXT:[jmp(L2 [loop entry point])] PREV:[jf(L3 [loop exit point])] jmp(L2 [loop entry point]) NEXT:[r(1)] PREV:[r(2)] @@ -36,24 +32,21 @@ fun dowhile() { } --------------------- L0: - NEXT:[r(do {return} while(1 > 0)) ] PREV:[] - r(do {return} - while(1 > 0)) NEXT:[ret L1] PREV:[] + NEXT:[ret L1] PREV:[] L2 [loop entry point]: L4 [body entry point]: - ret L1 NEXT:[] PREV:[r(do {return} while(1 > 0)) ] + ret L1 NEXT:[] PREV:[] L5 [condition entry point]: -- r(1) NEXT:[r(0)] PREV:[] -- r(0) NEXT:[r(>)] PREV:[] -- r(>) NEXT:[r(1 > 0)] PREV:[] -- r(1 > 0) NEXT:[jt(L2 [loop entry point])] PREV:[] -- jt(L2 [loop entry point]) NEXT:[read (Unit), ret L1] PREV:[] +- r(1) NEXT:[r(0)] PREV:[] +- r(0) NEXT:[call(>, compareTo)] PREV:[] +- call(>, compareTo) NEXT:[jt(L2 [loop entry point])] PREV:[] +- jt(L2 [loop entry point]) NEXT:[read (Unit), ret L1] PREV:[] L3 [loop exit point]: -- read (Unit) NEXT:[] PREV:[] +- read (Unit) NEXT:[] PREV:[] L1: - NEXT:[] PREV:[ret L1] + NEXT:[] PREV:[ret L1] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== diff --git a/compiler/testData/cfg/ReturnFromExpression.instructions b/compiler/testData/cfg/ReturnFromExpression.instructions index 3de3387b5d0..7803e28dee0 100644 --- a/compiler/testData/cfg/ReturnFromExpression.instructions +++ b/compiler/testData/cfg/ReturnFromExpression.instructions @@ -4,18 +4,17 @@ fun blockAndAndMismatch() : Boolean { } --------------------- L0: - NEXT:[r(false)] PREV:[] - r(false) NEXT:[jt(L2)] PREV:[] - jt(L2) NEXT:[r((return false)), r(false || (return false))] PREV:[r(false)] - r((return false)) NEXT:[r(false)] PREV:[jt(L2)] - r(false) NEXT:[ret(*) L1] PREV:[r((return false))] - ret(*) L1 NEXT:[] PREV:[r(false)] + NEXT:[r(false)] PREV:[] + r(false) NEXT:[jt(L2)] PREV:[] + jt(L2) NEXT:[r(false), r(false || (return false))] PREV:[r(false)] + r(false) NEXT:[ret(*) L1] PREV:[jt(L2)] + ret(*) L1 NEXT:[] PREV:[r(false)] L2: - r(false || (return false)) NEXT:[] PREV:[jt(L2)] + r(false || (return false)) NEXT:[] PREV:[jt(L2)] L1: - NEXT:[] PREV:[ret(*) L1, r(false || (return false))] + NEXT:[] PREV:[ret(*) L1, r(false || (return false))] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== diff --git a/compiler/testData/cfg/propertySafeCall.instructions b/compiler/testData/cfg/propertySafeCall.instructions index b988c70a1f5..7c8ad64128a 100644 --- a/compiler/testData/cfg/propertySafeCall.instructions +++ b/compiler/testData/cfg/propertySafeCall.instructions @@ -4,15 +4,15 @@ fun test(s: String?) { } --------------------- L0: - NEXT:[v(s: String?)] PREV:[] - v(s: String?) NEXT:[w(s)] PREV:[] - w(s) NEXT:[r(s)] PREV:[v(s: String?)] - r(s) NEXT:[call(length, length)] PREV:[w(s)] - call(length, length) NEXT:[] PREV:[r(s)] + NEXT:[v(s: String?)] PREV:[] + v(s: String?) NEXT:[w(s)] PREV:[] + w(s) NEXT:[r(s)] PREV:[v(s: String?)] + r(s) NEXT:[r(length)] PREV:[w(s)] + r(length) NEXT:[] PREV:[r(s)] L1: - NEXT:[] PREV:[call(length, length)] + NEXT:[] PREV:[r(length)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] =====================