[JS IR] Fix inline functions call graph in IC

Add a dependency for inline function references,
 because in some cases the references may be inlined.

^KT-55144 Fixed
This commit is contained in:
Alexander Korepanov
2022-11-25 17:51:51 +01:00
committed by Space Team
parent c31705240a
commit d8ab9498ab
28 changed files with 237 additions and 11 deletions
@@ -0,0 +1,2 @@
inline fun bar() = "0"
@@ -0,0 +1 @@
inline fun bar() = "1"
@@ -0,0 +1 @@
inline fun bar() = "2"
@@ -0,0 +1,3 @@
inline fun foo(callableReference: () -> String = ::bar): String {
return callableReference()
}
@@ -0,0 +1,4 @@
inline fun foo(): String {
val callableReference: () -> String = ::bar
return (callableReference().toInt() + 1).toString()
}
@@ -0,0 +1,19 @@
STEP 0:
modifications:
U : l1.0.kt -> l1.kt
U : l2.0.kt -> l2.kt
added file: l1.kt, l2.kt
STEP 1:
modifications:
U : l1.1.kt -> l1.kt
modified ir: l1.kt
updated imports: l2.kt
STEP 2:
modifications:
U : l2.2.kt -> l2.kt
modified ir: l2.kt
STEP 3:
modifications:
U : l1.3.kt -> l1.kt
modified ir: l1.kt
updated imports: l2.kt
@@ -0,0 +1,7 @@
fun box(stepId: Int): String {
val x = foo().toInt()
if (x != stepId) {
return "Fail $x != $stepId"
}
return "OK"
}
@@ -0,0 +1,12 @@
STEP 0:
dependencies: lib1
added file: m.kt
STEP 1:
dependencies: lib1
updated imports: m.kt
STEP 2:
dependencies: lib1
modified ir: m.kt
STEP 3:
dependencies: lib1
updated imports: m.kt
@@ -0,0 +1,5 @@
MODULES: lib1, main
STEP 0..3:
libs: lib1, main
dirty js: lib1, main