Pseudocode: Do not bind call value to callee expressions
This commit is contained in:
@@ -7,7 +7,6 @@ tailRecursive fun test() : Int {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
test <v0> NEW()
|
||||
test() <v0> COPY
|
||||
{ test() } <v0> COPY
|
||||
test() <v0> NEW()
|
||||
{ test() } <v0> COPY
|
||||
=====================
|
||||
|
||||
@@ -7,6 +7,5 @@ tailRecursive fun test() : Int {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
test <v0> NEW()
|
||||
test() <v0> COPY
|
||||
test() <v0> NEW()
|
||||
=====================
|
||||
|
||||
@@ -5,21 +5,16 @@ tailRecursive fun sum(x: Long, sum: Long): Long {
|
||||
}
|
||||
---------------------
|
||||
x <v2> NEW()
|
||||
== <v5> NEW(<v2>, <v4>)
|
||||
0 <v3> NEW()
|
||||
toLong <v4> NEW(<v3>)
|
||||
toLong() <v4> COPY
|
||||
0.toLong() <v4> COPY
|
||||
x == 0.toLong() <v5> COPY
|
||||
0 <v3> NEW()
|
||||
toLong() <v4> NEW(<v3>)
|
||||
0.toLong() <v4> COPY
|
||||
x == 0.toLong() <v5> NEW(<v2>, <v4>)
|
||||
sum <v6> NEW()
|
||||
sum <v13> NEW(<v9>, <v12>)
|
||||
x <v7> NEW()
|
||||
- <v9> NEW(<v7>, <v8>)
|
||||
1 <v8> NEW()
|
||||
x - 1 <v9> COPY
|
||||
x <v7> NEW()
|
||||
1 <v8> NEW()
|
||||
x - 1 <v9> NEW(<v7>, <v8>)
|
||||
sum <v10> NEW()
|
||||
+ <v12> NEW(<v10>, <v11>)
|
||||
x <v11> NEW()
|
||||
sum + x <v12> COPY
|
||||
sum(x - 1, sum + x) <v13> COPY
|
||||
x <v11> NEW()
|
||||
sum + x <v12> NEW(<v10>, <v11>)
|
||||
sum(x - 1, sum + x) <v13> NEW(<v9>, <v12>)
|
||||
=====================
|
||||
|
||||
@@ -7,6 +7,5 @@ tailRecursive fun foo() {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
foo <v0> NEW()
|
||||
foo() <v0> COPY
|
||||
foo() <v0> NEW()
|
||||
=====================
|
||||
|
||||
@@ -9,15 +9,12 @@ fun test() : Unit {
|
||||
}
|
||||
}
|
||||
---------------------
|
||||
test <v0> NEW()
|
||||
test() <v0> COPY
|
||||
{ test() } <v0> COPY
|
||||
test <v2> NEW()
|
||||
test() <v2> COPY
|
||||
{ test() } <v2> COPY
|
||||
test <v3> NEW()
|
||||
test() <v3> COPY
|
||||
{ test() } <v3> COPY
|
||||
test() <v0> NEW()
|
||||
{ test() } <v0> COPY
|
||||
test() <v2> NEW()
|
||||
{ test() } <v2> COPY
|
||||
test() <v3> NEW()
|
||||
{ test() } <v3> COPY
|
||||
try { test() } catch (any : Exception) { test() } finally { test() } <v4> NEW(<v0>, <v2>)
|
||||
{ try { test() } catch (any : Exception) { test() } finally { test() } } <v4> COPY
|
||||
=====================
|
||||
|
||||
Reference in New Issue
Block a user