[JS IR] IC improvements
- Reuse a built fragment - Use cache for saving built JS code
This commit is contained in:
committed by
Space
parent
f8ae097e50
commit
9952d43252
+6
@@ -0,0 +1,6 @@
|
||||
fun foo() = 42
|
||||
fun bar() = 24
|
||||
|
||||
fun baz(s: String) = s.length
|
||||
fun baz(i: Int) = i + 2
|
||||
fun baz(b: Boolean) = if (b) 10 else 1
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
dirty: l1.kt
|
||||
STEP 1..6:
|
||||
dependencies: stdlib
|
||||
flags: FP
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
fun qux() = foo() + 2
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
fun qux() = foo() + bar()
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
fun qux() = foo() - 2
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
fun qux() = baz(2) + baz("test") + baz(true)
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
fun qux() = baz("test") + baz(true)
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
fun qux() = baz("test") + 100
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
dirty: l2.kt
|
||||
STEP 1:
|
||||
dependencies: stdlib, lib1
|
||||
modifications:
|
||||
U : l2.kt.1.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
STEP 2:
|
||||
dependencies: stdlib, lib1
|
||||
modifications:
|
||||
U : l2.kt.2.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
STEP 3:
|
||||
dependencies: stdlib, lib1
|
||||
modifications:
|
||||
U : l2.kt.3.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
STEP 4:
|
||||
dependencies: stdlib, lib1
|
||||
modifications:
|
||||
U : l2.kt.4.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
STEP 5:
|
||||
dependencies: stdlib, lib1
|
||||
flags: FP
|
||||
STEP 6:
|
||||
dependencies: stdlib, lib1
|
||||
modifications:
|
||||
U : l2.kt.6.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
|
||||
fun box(stepId: Int): String {
|
||||
when (stepId) {
|
||||
0 -> if (qux() != 44) return "Fail"
|
||||
1 -> if (qux() != 66) return "Fail"
|
||||
2 -> if (qux() != 40) return "Fail"
|
||||
3 -> if (qux() != 18) return "Fail"
|
||||
4 -> if (qux() != 14) return "Fail"
|
||||
else -> return "Unknown"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
fun box(stepId: Int): String {
|
||||
when (stepId) {
|
||||
5 -> if (qux() != 14) return "Fail"
|
||||
6 -> if (qux() != 104) return "Fail"
|
||||
else -> return "Unknown"
|
||||
}
|
||||
if (baz(77) != 79) return "Fail"
|
||||
if (baz("test") != 4) return "Fail"
|
||||
return "OK"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
dirty: m.kt
|
||||
STEP 1..4:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
STEP 5:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
modifications:
|
||||
U : m.kt.5.txt -> m.kt
|
||||
dirty: m.kt
|
||||
STEP 6:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: stdlib, lib1, lib2, main
|
||||
STEP 1..4:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1, lib2
|
||||
STEP 5:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1, main
|
||||
STEP 6:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1, lib2, main
|
||||
Reference in New Issue
Block a user