JS: fix inlining in a new flat JS generator

This commit is contained in:
Alexey Andreev
2016-10-17 16:24:02 +03:00
parent e13d34e08d
commit 20396b0e5f
257 changed files with 384 additions and 4228 deletions
@@ -1,8 +1,8 @@
package foo
// CHECK_NOT_CALLED: f1_0
// CHECK_NOT_CALLED: f2_0
// CHECK_BREAKS_COUNT: function=test_0 count=3
// CHECK_NOT_CALLED: f1
// CHECK_NOT_CALLED: f2
// CHECK_BREAKS_COUNT: function=test count=3
internal var even = arrayListOf<Int>()
internal var odd = arrayListOf<Int>()
@@ -1,6 +1,6 @@
package foo
// CHECK_VARS_COUNT: function=test_za3lpa$ count=2
// CHECK_VARS_COUNT: function=test count=2
inline fun if1(f: (Int) -> Int, a: Int, b: Int, c: Int): Int {
val result = f(a)
@@ -1,9 +1,9 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test1_0
// CHECK_CONTAINS_NO_CALLS: test2_0
// CHECK_VARS_COUNT: function=test1_0 count=0
// CHECK_VARS_COUNT: function=test2_0 count=1
// CHECK_CONTAINS_NO_CALLS: test1
// CHECK_CONTAINS_NO_CALLS: test2
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=1
var log = ""
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test except=SumHolder_getInstance
// CHECK_VARS_COUNT: function=test count=1
object SumHolder {
var sum = 0
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=0
internal inline fun sign(x: Int): Int {
if (x < 0) return -1
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=0
// A copy of stdlib run function.
// Copied to not to depend on run implementation.
@@ -1,8 +1,8 @@
package foo
// CHECK_VARS_COUNT: function=test1_za3lpa$ count=0
// CHECK_VARS_COUNT: function=test2_za3lpa$ count=1
// CHECK_VARS_COUNT: function=test3_za3lpa$ count=0
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=1
// CHECK_VARS_COUNT: function=test3 count=0
inline fun a(x: Int) = b(x)
+2 -2
View File
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=0
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=0
internal class A(val x: Int) {
inline fun f(): Int = x
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=1
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=1
internal inline fun sum(x: Int, y: Int): Int {
if (x == 0 || y == 0) return 0
@@ -1,7 +1,7 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test_0
// CHECK_VARS_COUNT: function=test_0 count=1
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=1
internal inline fun sum(x: Int, y: Int): Int {
if (x == 0 || y == 0) return 0