Pseudocode: Do not bind call value to callee expressions

This commit is contained in:
Alexey Sedunov
2014-06-10 17:25:16 +04:00
parent e94f96d457
commit 168b32920b
52 changed files with 351 additions and 477 deletions
+10 -15
View File
@@ -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>)
=====================