[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
+3
@@ -0,0 +1,3 @@
|
||||
open class Parent(open var objectName: String) {
|
||||
val isValid = true
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
open class Parent(objectName: String) {
|
||||
var objectName: String
|
||||
get() = _name
|
||||
set(objectName) {
|
||||
isValid = true
|
||||
_name = objectName
|
||||
}
|
||||
|
||||
var isValid = false
|
||||
private set
|
||||
|
||||
private var _name: String = objectName;
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
open class Parent(open var objectName: String) {
|
||||
open val isValid = true
|
||||
}
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
open class Parent(var name: String) {
|
||||
open class Parent(var objectName: String) {
|
||||
val isValid = true
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
open class Parent(open var name: String) {
|
||||
val isValid = true
|
||||
}
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
open class Parent(name: String) {
|
||||
var name: String
|
||||
get() = _name
|
||||
set(name) {
|
||||
isValid = true
|
||||
_name = name
|
||||
}
|
||||
|
||||
var isValid = false
|
||||
private set
|
||||
|
||||
private var _name: String = name;
|
||||
}
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
open class Parent(open var name: String) {
|
||||
open val isValid = true
|
||||
}
|
||||
Vendored
+7
-13
@@ -1,21 +1,15 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
dirty: l1.kt
|
||||
added file: l1.kt
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.1.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 2:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.2.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.2.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 3:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.3.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
U : l1.3.kt -> l1.kt
|
||||
modified ir: l1.kt
|
||||
STEP 4:
|
||||
dependencies: stdlib
|
||||
flags: FP
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
class Child(objectName: String) : Parent(objectName) {
|
||||
override var objectName: String
|
||||
get() = _name
|
||||
set(objectName) {
|
||||
_name = objectName
|
||||
isValid = true
|
||||
}
|
||||
|
||||
private var _name: String = objectName
|
||||
|
||||
override var isValid = false
|
||||
private set
|
||||
}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
class Child(name: String) : Parent(name)
|
||||
class Child(objectName: String) : Parent(objectName)
|
||||
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
class Child(name: String) : Parent(name) {
|
||||
override var name: String
|
||||
get() = _name
|
||||
set(name) {
|
||||
_name = name
|
||||
isValid = true
|
||||
}
|
||||
|
||||
private var _name: String = name
|
||||
|
||||
override var isValid = false
|
||||
private set
|
||||
}
|
||||
Vendored
+6
-6
@@ -1,10 +1,10 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
dirty: l2.kt
|
||||
dependencies: lib1
|
||||
added file: l2.kt
|
||||
STEP 1..3:
|
||||
dependencies: stdlib, lib1
|
||||
dependencies: lib1
|
||||
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
|
||||
|
||||
+6
-6
@@ -2,16 +2,16 @@ fun box(stepId: Int): String {
|
||||
val parent = Parent("parent")
|
||||
val child = Child("child")
|
||||
|
||||
if (parent.name != "parent") return "fail: initial parent name at step $stepId"
|
||||
if (child.name != "child") return "fail: initial child name at step $stepId"
|
||||
if (parent.objectName != "parent") return "fail: initial parent objectName at step $stepId"
|
||||
if (child.objectName != "child") return "fail: initial child objectName at step $stepId"
|
||||
|
||||
parent.name = "updated parent"
|
||||
parent.objectName = "updated parent"
|
||||
|
||||
if (parent.name != "updated parent") return "fail: updated parent name at step $stepId"
|
||||
if (parent.objectName != "updated parent") return "fail: updated parent objectName at step $stepId"
|
||||
|
||||
child.name = "updated child"
|
||||
child.objectName = "updated child"
|
||||
|
||||
if (child.name != "updated child") return "fail: updated child name at step $stepId"
|
||||
if (child.objectName != "updated child") return "fail: updated child objectName at step $stepId"
|
||||
|
||||
if (!parent.isValid) return "fail: parent is invalid at step $stepId"
|
||||
if (!child.isValid) return "fail: child is invalid at step $stepId"
|
||||
|
||||
Vendored
+3
-3
@@ -1,5 +1,5 @@
|
||||
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
|
||||
|
||||
+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..3:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1
|
||||
|
||||
Reference in New Issue
Block a user