[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:
Alexander Korepanov
2022-05-04 11:56:25 +03:00
committed by Space
parent f003f19e1d
commit 9e780afdca
439 changed files with 2904 additions and 1988 deletions
@@ -1,4 +1,3 @@
fun isEqual(l: Any?, r: Any?) = if (l == r) true else null
fun box(stepId: Int): String {
@@ -1,4 +1,3 @@
fun isEqual(l: Any?, r: Any?) = if (l == r) true else null
fun box(stepId: Int): String {
@@ -1,11 +1,38 @@
STEP 0..7:
dependencies: stdlib, lib1
dirty: m.kt
STEP 0:
dependencies: lib1
added file: m.kt
STEP 1:
dependencies: lib1
updated inline imports: m.kt
STEP 2..6:
dependencies: lib1
modified ir: m.kt
STEP 7:
dependencies: lib1
updated inline imports: m.kt
STEP 8:
dependencies: stdlib, lib1, libProxy
dependencies: lib1, libProxy
modifications:
U : m.proxy.kt.txt -> m.kt
dirty: m.kt
STEP 9..23:
dependencies: stdlib, lib1, libProxy
dirty: m.kt
U : m.proxy.kt -> m.kt
modified ir: m.kt
STEP 9..13:
dependencies: lib1, libProxy
updated inline imports: m.kt
STEP 14:
dependencies: lib1, libProxy
modified ir: m.kt
STEP 15:
dependencies: lib1, libProxy
updated inline imports: m.kt
STEP 16:
dependencies: lib1, libProxy
modified ir: m.kt
STEP 17..21:
dependencies: lib1, libProxy
updated inline imports: m.kt
STEP 22:
dependencies: lib1, libProxy
modified ir: m.kt
STEP 23:
dependencies: lib1, libProxy
updated inline imports: m.kt