Updated tests for control flow: call instruction stores call element

instead of callee expression
This commit is contained in:
Svetlana Isakova
2014-07-02 18:27:19 +04:00
parent 72e9822d99
commit aa26db0538
110 changed files with 1084 additions and 1084 deletions
@@ -19,13 +19,13 @@ L2 [onExceptionToFinallyBlock]:
L4 [start finally]:
3 mark({ test() }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
mark(test())
call(test, test) -> <v0>
call(test(), test) -> <v0>
L5 [finish finally]:
2 jmp(error) NEXT:[<ERROR>]
L3 [skipFinallyToErrorBlock]:
3 mark({ test() }) PREV:[jmp(L3 [skipFinallyToErrorBlock])]
mark(test())
call(test, test) -> <v0>
call(test(), test) -> <v0>
L1:
1 <END> NEXT:[<SINK>]
error:
@@ -7,6 +7,6 @@ tailRecursive fun test() : Int {
}
}
---------------------
test() <v0>: * NEW: call(test, test) -> <v0>
test() <v0>: * NEW: call(test(), test) -> <v0>
{ test() } <v0>: * COPY
=====================
=====================
@@ -19,14 +19,14 @@ L2 [onExceptionToFinallyBlock]:
L4 [start finally]:
3 mark({ return test() }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
mark(test())
call(test, test) -> <v0>
call(test(), test) -> <v0>
ret(*|<v0>) L1 NEXT:[<END>]
L5 [finish finally]:
- 2 jmp(error) NEXT:[<ERROR>] PREV:[]
L3 [skipFinallyToErrorBlock]:
3 mark({ return test() }) PREV:[jmp(L3 [skipFinallyToErrorBlock])]
mark(test())
call(test, test) -> <v0>
call(test(), test) -> <v0>
ret(*|<v0>) L1
L1:
1 <END> NEXT:[<SINK>] PREV:[ret(*|<v0>) L1, ret(*|<v0>) L1]
@@ -7,5 +7,5 @@ tailRecursive fun test() : Int {
}
}
---------------------
test() <v0>: Int NEW: call(test, test) -> <v0>
=====================
test() <v0>: Int NEW: call(test(), test) -> <v0>
=====================
@@ -18,9 +18,9 @@ L0:
mark(0.toLong())
r(0) -> <v3>
mark(toLong())
call(toLong, toLong|<v3>) -> <v4>
call(toLong(), toLong|<v3>) -> <v4>
mark(x == 0.toLong())
call(==, equals|<v2>, <v4>) -> <v5>
call(x == 0.toLong(), equals|<v2>, <v4>) -> <v5>
jf(L2|<v5>) NEXT:[read (Unit), r(sum) -> <v6>]
r(sum) -> <v6>
ret(*|<v6>) L1 NEXT:[<END>]
@@ -31,13 +31,13 @@ L3:
r(x) -> <v7>
r(1) -> <v8>
mark(x - 1)
call(-, minus|<v7>, <v8>) -> <v9>
call(x - 1, minus|<v7>, <v8>) -> <v9>
r(sum) -> <v10>
r(x) -> <v11>
mark(sum + x)
call(+, plus|<v10>, <v11>) -> <v12>
call(sum + x, plus|<v10>, <v11>) -> <v12>
mark(sum(x - 1, sum + x))
call(sum, sum|<v9>, <v12>) -> <v13>
call(sum(x - 1, sum + x), sum|<v9>, <v12>) -> <v13>
ret(*|<v13>) L1
L1:
1 <END> NEXT:[<SINK>] PREV:[ret(*|<v6>) L1, ret(*|<v13>) L1]
+16 -16
View File
@@ -4,19 +4,19 @@ tailRecursive fun sum(x: Long, sum: Long): Long {
return sum(x - 1, sum + x)
}
---------------------
<v0>: Long NEW: magic(x: Long) -> <v0>
<v1>: Long NEW: magic(sum: Long) -> <v1>
x <v2>: OR{{<: Any}, {<: Any}} NEW: r(x) -> <v2>
0 <v3>: {<: Number} NEW: r(0) -> <v3>
toLong() <v4>: {<: Any?} NEW: call(toLong, toLong|<v3>) -> <v4>
0.toLong() <v4>: {<: Any?} COPY
x == 0.toLong() <v5>: Boolean NEW: call(==, equals|<v2>, <v4>) -> <v5>
sum <v6>: Long NEW: r(sum) -> <v6>
x <v7>: Long NEW: r(x) -> <v7>
1 <v8>: Int NEW: r(1) -> <v8>
x - 1 <v9>: Long NEW: call(-, minus|<v7>, <v8>) -> <v9>
sum <v10>: Long NEW: r(sum) -> <v10>
x <v11>: Long NEW: r(x) -> <v11>
sum + x <v12>: Long NEW: call(+, plus|<v10>, <v11>) -> <v12>
sum(x - 1, sum + x) <v13>: Long NEW: call(sum, sum|<v9>, <v12>) -> <v13>
=====================
<v0>: Long NEW: magic(x: Long) -> <v0>
<v1>: Long NEW: magic(sum: Long) -> <v1>
x <v2>: OR{{<: Any}, {<: Any}} NEW: r(x) -> <v2>
0 <v3>: {<: Number} NEW: r(0) -> <v3>
toLong() <v4>: {<: Any?} NEW: call(toLong(), toLong|<v3>) -> <v4>
0.toLong() <v4>: {<: Any?} COPY
x == 0.toLong() <v5>: Boolean NEW: call(x == 0.toLong(), equals|<v2>, <v4>) -> <v5>
sum <v6>: Long NEW: r(sum) -> <v6>
x <v7>: Long NEW: r(x) -> <v7>
1 <v8>: Int NEW: r(1) -> <v8>
x - 1 <v9>: Long NEW: call(x - 1, minus|<v7>, <v8>) -> <v9>
sum <v10>: Long NEW: r(sum) -> <v10>
x <v11>: Long NEW: r(x) -> <v11>
sum + x <v12>: Long NEW: call(sum + x, plus|<v10>, <v11>) -> <v12>
sum(x - 1, sum + x) <v13>: Long NEW: call(sum(x - 1, sum + x), sum|<v9>, <v12>) -> <v13>
=====================
@@ -14,7 +14,7 @@ L0:
jmp?(L2 [onException]) NEXT:[v(e: Throwable), mark({ return foo() })]
3 mark({ return foo() })
mark(foo())
call(foo, foo) -> <v0>
call(foo(), foo) -> <v0>
ret(*|<v0>) L1 NEXT:[<END>]
- 2 jmp(L3 [afterCatches]) NEXT:[<END>] PREV:[]
L2 [onException]:
+2 -2
View File
@@ -8,5 +8,5 @@ tailRecursive fun foo() {
}
---------------------
<v1>: {<: Throwable} NEW: magic(e: Throwable) -> <v1>
foo() <v0>: Unit NEW: call(foo, foo) -> <v0>
=====================
foo() <v0>: Unit NEW: call(foo(), foo) -> <v0>
=====================
@@ -17,7 +17,7 @@ L0:
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ test() }), mark({ test() })]
3 mark({ test() })
mark(test())
call(test, test) -> <v0>
call(test(), test) -> <v0>
2 jmp(L4 [afterCatches]) NEXT:[jmp(L5 [skipFinallyToErrorBlock])]
L2 [onException]:
3 v(any : Exception) PREV:[jmp?(L2 [onException])]
@@ -25,7 +25,7 @@ L2 [onException]:
w(any|<v1>)
4 mark({ test() })
mark(test())
call(test, test) -> <v2>
call(test(), test) -> <v2>
3 jmp(L4 [afterCatches])
L4 [afterCatches]:
2 jmp(L5 [skipFinallyToErrorBlock]) NEXT:[mark({ test() })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches])]
@@ -33,13 +33,13 @@ L3 [onExceptionToFinallyBlock]:
L6 [start finally]:
3 mark({ test() }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
mark(test())
call(test, test) -> <v3>
call(test(), test) -> <v3>
L7 [finish finally]:
2 jmp(error) NEXT:[<ERROR>]
L5 [skipFinallyToErrorBlock]:
3 mark({ test() }) PREV:[jmp(L5 [skipFinallyToErrorBlock])]
mark(test())
call(test, test) -> <v3>
call(test(), test) -> <v3>
2 merge(try { test() } catch (any : Exception) { test() } finally { test() }|<v0>, <v2>) -> <v4>
L1:
1 <END> NEXT:[<SINK>]
@@ -9,13 +9,13 @@ fun test() : Unit {
}
}
---------------------
<v1>: {<: Exception} NEW: magic(any : Exception) -> <v1>
test() <v0>: * NEW: call(test, test) -> <v0>
{ test() } <v0>: * COPY
test() <v2>: * NEW: call(test, test) -> <v2>
{ test() } <v2>: * COPY
test() <v3>: * NEW: call(test, test) -> <v3>
{ test() } <v3>: * COPY
<v1>: {<: Exception} NEW: magic(any : Exception) -> <v1>
test() <v0>: * NEW: call(test(), test) -> <v0>
{ test() } <v0>: * COPY
test() <v2>: * NEW: call(test(), test) -> <v2>
{ test() } <v2>: * COPY
test() <v3>: * NEW: call(test(), test) -> <v3>
{ test() } <v3>: * COPY
try { test() } catch (any : Exception) { test() } finally { test() } <v4>: * NEW: merge(try { test() } catch (any : Exception) { test() } finally { test() }|<v0>, <v2>) -> <v4>
{ try { test() } catch (any : Exception) { test() } finally { test() } } <v4>: * COPY
=====================
{ try { test() } catch (any : Exception) { test() } finally { test() } } <v4>: * COPY
=====================