[JS IR] Rework incremental cache invalidation
Replace loading the whole world IR with loading only exported (reachable) IR.
For that purpose the direct and inverse dependency graph is used.
It is stored in a cache directory and the cache updater keeps it up to date.
If after loading it is found that other files must be also implicitly rebuilt
(see rebuilt reasons below), IR for that files also will be loaded.
This algorithm repeats until the number of implicitly rebuilt files is not 0.
More rebuilt reasons (dirty state) have been added:
- added file: this is a new file;
- modified ir: ir of the file has been updated;
- updated exports: exports from the file have been added or removed
(e.g. a function has been used from another file);
- updated inline imports: imported inline function has been modified
(transitively);
- removed inverse depends: a dependent file has been removed;
- removed direct depends: a dependency file has been removed;
- removed file: this file has been removed.
Incremental cache tests has been refactored:
- The supporting of all rebuilt reasons (dirty states) has been added;
- New file name format "*.$suffix.kt" for the test steps has been allowed,
so the syntax highlight works now;
- Explicit stdlib dependency usage has been removed.
This commit is contained in:
committed by
Space
parent
f003f19e1d
commit
9e780afdca
Vendored
+1
@@ -0,0 +1 @@
|
||||
fun foo(x: Any = 99): Any = x
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(x: Any = 99): Any = x
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
fun foo(x: Int = 77): Int = 42 + x
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(x: Int = 77): Int = 42 + x
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(x: Int = 98, y: String = "s"): Int = 42 + x + y.length
|
||||
-1
@@ -1 +0,0 @@
|
||||
fun foo(x: Int = 98, y: String = "s"): Int = 42 + x + y.length
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(vararg x: Int): Int = 42
|
||||
-1
@@ -1 +0,0 @@
|
||||
fun foo(vararg x: Int): Int = 42
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(): Any = "string"
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(): Any = "string"
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
fun foo(): Any? = "string"
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(): Any? = "string"
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(): Boolean = false
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(): Boolean = false
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(): Double = 3.14
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(): Double = 3.14
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(): Int = 42
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(): Int = 42
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo(): String = "string"
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo(): String = "string"
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
fun foo(): String? = null
|
||||
-1
@@ -1 +0,0 @@
|
||||
fun foo(): String? = null
|
||||
+1
@@ -0,0 +1 @@
|
||||
fun foo() : Unit {}
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
fun foo() : Unit {}
|
||||
+34
-51
@@ -1,85 +1,68 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.int.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.int.kt -> l1.kt
|
||||
added file: l1.kt
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.bool.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.bool.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 2:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.double.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.double.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 3:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.string.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.string.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 4:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.string_or_null.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.string_or_null.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 5:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.any.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.any.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 6:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.any_or_null.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.any_or_null.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 7:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.unit.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.unit.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 8:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.int.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.int.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 9:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.in.int.out.int.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.in.int.out.int.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 10:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.in.int.string.out.int.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.in.int.string.out.int.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 11:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.in.int.string_or_null.out.int.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.in.int.string_or_null.out.int.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 12:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.any.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.any.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 13:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.in.any.out.any.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.in.any.out.any.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 14:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.in.any_or_null.out.any.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.in.any_or_null.out.any.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 15:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.out.int.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.out.int.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 16:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.in.vararg_int.out.int.kt.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.in.vararg_int.out.int.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
|
||||
fun isEqual(l: Any?, r: Any?) = if (l == r) true else null
|
||||
|
||||
fun box(stepId: Int): String {
|
||||
|
||||
+6
-3
@@ -1,3 +1,6 @@
|
||||
STEP 0..16:
|
||||
dependencies: stdlib, lib1
|
||||
dirty: m.kt
|
||||
STEP 0:
|
||||
dependencies: lib1
|
||||
added file: m.kt
|
||||
STEP 1..16:
|
||||
dependencies: lib1
|
||||
modified ir: m.kt
|
||||
|
||||
+2
-2
@@ -2,13 +2,13 @@ MODULES: lib1, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, main
|
||||
dirty js: stdlib, lib1, main
|
||||
dirty js: lib1, main
|
||||
STEP 1..6:
|
||||
libs: lib1, main
|
||||
dirty js: lib1, main
|
||||
STEP 7..8:
|
||||
libs: lib1, main
|
||||
dirty js: stdlib, lib1, main
|
||||
dirty js: lib1, main
|
||||
STEP 9..16:
|
||||
libs: lib1, main
|
||||
dirty js: lib1, main
|
||||
|
||||
Reference in New Issue
Block a user