[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
+2
-4
@@ -1,6 +1,4 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
dirty: l1.kt
|
||||
added file: l1.kt
|
||||
STEP 1..6:
|
||||
dependencies: stdlib
|
||||
flags: FP
|
||||
updated exports: l1.kt
|
||||
|
||||
-1
@@ -1,2 +1 @@
|
||||
|
||||
fun qux() = foo() + bar()
|
||||
-1
@@ -1,2 +1 @@
|
||||
|
||||
fun qux() = foo() - 2
|
||||
-1
@@ -1,2 +1 @@
|
||||
|
||||
fun qux() = baz(2) + baz("test") + baz(true)
|
||||
-1
@@ -1,2 +1 @@
|
||||
|
||||
fun qux() = baz("test") + baz(true)
|
||||
-1
@@ -1,2 +1 @@
|
||||
|
||||
fun qux() = baz("test") + 100
|
||||
-1
@@ -1,2 +1 @@
|
||||
|
||||
fun qux() = foo() + 2
|
||||
|
||||
+18
-19
@@ -1,31 +1,30 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
dirty: l2.kt
|
||||
dependencies: lib1
|
||||
added file: l2.kt
|
||||
STEP 1:
|
||||
dependencies: stdlib, lib1
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : l2.kt.1.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
U : l2.1.kt -> l2.kt
|
||||
modified ir: l2.kt
|
||||
STEP 2:
|
||||
dependencies: stdlib, lib1
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : l2.kt.2.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
U : l2.2.kt -> l2.kt
|
||||
modified ir: l2.kt
|
||||
STEP 3:
|
||||
dependencies: stdlib, lib1
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : l2.kt.3.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
U : l2.3.kt -> l2.kt
|
||||
modified ir: l2.kt
|
||||
STEP 4:
|
||||
dependencies: stdlib, lib1
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : l2.kt.4.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
U : l2.4.kt -> l2.kt
|
||||
modified ir: l2.kt
|
||||
STEP 5:
|
||||
dependencies: stdlib, lib1
|
||||
flags: FP
|
||||
dependencies: lib1
|
||||
STEP 6:
|
||||
dependencies: stdlib, lib1
|
||||
dependencies: lib1
|
||||
modifications:
|
||||
U : l2.kt.6.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
U : l2.6.kt -> l2.kt
|
||||
modified ir: l2.kt
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
|
||||
fun box(stepId: Int): String {
|
||||
when (stepId) {
|
||||
5 -> if (qux() != 14) return "Fail"
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
|
||||
fun box(stepId: Int): String {
|
||||
when (stepId) {
|
||||
0 -> if (qux() != 44) return "Fail"
|
||||
|
||||
+7
-7
@@ -1,12 +1,12 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
dirty: m.kt
|
||||
dependencies: lib1, lib2
|
||||
added file: m.kt
|
||||
STEP 1..4:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
dependencies: lib1, lib2
|
||||
STEP 5:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
dependencies: lib1, lib2
|
||||
modifications:
|
||||
U : m.kt.5.txt -> m.kt
|
||||
dirty: m.kt
|
||||
U : m.5.kt -> m.kt
|
||||
modified ir: m.kt
|
||||
STEP 6:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
dependencies: lib1, lib2
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: stdlib, lib1, lib2, main
|
||||
dirty js: lib1, lib2, main
|
||||
STEP 1..4:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1, lib2
|
||||
|
||||
Reference in New Issue
Block a user