[JS IR] IC improvements

- Reuse a built fragment
  - Use cache for saving built JS code
This commit is contained in:
Alexander Korepanov
2022-03-30 18:19:28 +03:00
committed by Space
parent f8ae097e50
commit 9952d43252
137 changed files with 1280 additions and 899 deletions
@@ -1 +1 @@
inline fun foo() = js("40 + 2")
inline fun foo() = js("42 + 1")
@@ -1 +1 @@
inline fun foo() = js("'42'")
inline fun foo() = js("'44'")
@@ -1,2 +1,11 @@
fun box() = foo()
fun box(stepId: Int): String {
when (stepId) {
0 -> if (foo() != 42) return "Fail"
1 -> if (foo() != 43) return "Fail"
2 -> if (foo() != "44") return "Fail"
3 -> if (foo() != "hello") return "Fail"
else -> return "Unknown"
}
return "OK"
}
@@ -1,13 +1,3 @@
STEP 0:
STEP 0..3:
dependencies: stdlib, lib1
dirty: m.kt
STEP 1:
dependencies: stdlib, lib1
dirty: m.kt
STEP 2:
dependencies: stdlib, lib1
dirty: m.kt
STEP 3:
dependencies: stdlib, lib1
dirty: m.kt
@@ -2,9 +2,7 @@ MODULES: lib1, main
STEP 0:
libs: lib1, main
STEP 1:
libs: lib1, main
STEP 2:
libs: lib1, main
STEP 3:
dirty js: stdlib, lib1, main
STEP 1..3:
libs: lib1, main
dirty js: lib1, main