The IR linker is responsible for detecting unbound symbols,
if it skips them for some reason, IC infrastructure must not fail
with unbound symbols exceptions. Anyway, the IR validator
verifies later if there are unbound symbols in
reachable IR and generates the corresponding error.
^KT-56602 Fixed
JS IR BE incremental compilation infrastructure uses
LanguageVersionSettings::toString method to detect if any
compiler features or flags were enabled or disabled.
It is important that the features and flags order are stable
in the result string.
^KT-56580 Fixed
The dependency signature may refer to function type interface properties
(e.g. name) or methods. It is impossible to detect (without hacks)
which binary symbol for loading is required. However, when loading
a property or a method the entire function type interface is loaded.
And vice versa, a loading of function type interface loads
properties and methods as well. Therefore, load the top level signature only,
it must be the signature of function type interface.
^KT-56582 Fixed
The patch removes logic of generating extra IrFiles (fake file) into
IrModuleFragment for the function type interfaces during klib deserialization,
because IC infrastructure can not process files which do not exist in klib.
Instead of adding extra IrFiles during deserialization, the empty files
with required packages are added into Kotlin/JS stdlib physically.
These files are used as containers for function type interface declarations.
Since Kotlin/WASM uses the same klib loading infrastructure as Kotlin/JS,
the the empty files are added into Kotlin/WASM stdlib as well.
The patch also adds a check that IrModuleFagment has files only from klib.
^KT-55720 Fixed
Optimization: often we don't need all hashes for all available symbols.
This patch allows the calculation of the symbol hash only on demand.
This patch also allows cycles for the inline function dependency
graph in the IC infrastructure. Note that the inline function cycles
may crash the inliner, however it is not the IC infrastructure
responsibility to check the cycles.
We do not need to check a default implementation of the interface during
the translation to JS because it must be checked before.
Moreover, this check breaks the produced JS code
if IR is partial loaded, e.g. during the incremental rebuild.
^KT-55716 Fixed
Generally, the library order doesn't matter.
However, after lowering we need to post process
lowered klibs in topological order:
- commit incremental cache artifacts,
- produce JS AST.
The patch uses an ability of the Kotlin library resolver to load klibs
in topological order and drops its reimplementation from IC infrastructure.
There is one side effect:
klibs which are not reachable from the main module, will produce their JS.
This should be more correct than just ignoring them.
A suspend stub for the abstract function
may be created in the context of the child function.
If on an incremental rebuild the stub is created from
the parent context (e.g. a file with the child is not modified),
the resulting LoweredDeclarationSignature will be different.
It will lead to a broken cross-module reference and broken JS code.
Therefore it is required to wrap the creation routine
into StageController::restrictTo() explicitly.
^KT-54934 Fixed
- Remove unused params from compilerWithIC wrapper.
- Move JsIrBackendContext creation logic into separate function
- Introduce and use compiler interface for IC infrastructure
On dirty rebuild we may reload IR from stdlib,
such reloading may affect files with intrinsics and builtins.
As soon as we load only exported symbols, we must track dependencies
for files with intrinsics or builtins as for others.
This patch implements the logic which updates dependencies for
the stdlib files after loading of intrinsics and builtins.
^KT-54323 Fixed
JsIrLinker can't load nested declarations,
therefore it is required to load their parent.
This patch adds a dependency in the incremental cache graph
between nested declaration user and nested declaration parent.
^KT-53931 Fixed
^KT-54120 Fixed
JS IR generates bridges with type checks for special class methods,
however if parent and child type parameters are same,
the JS signature for the generated brige will be clashed with
the JS signature of original method.
This patch changes type parameter name of EnumEntriesList to avoid the clash.
^KT-54011 Fixed
The patch fixes lost IC dependencies for inherited class or interface methods.
Especially between a fake override function and its implementation.
Since IrSymbolDeserializer doesn't provide all class methods,
they are collected from the class definitions.
^KT-53063 Fixed
The patch fixes the cases of IC invalidation when symbols are modified:
adding and removing inline, data, in, out, suspend qualifiers.
For that purpose an extra hash is used.
It is written in a direct dependency graph into an IC cache metadata file.
For inline functions a transitive hash is used.
For non-inline functions, classes, and others a symbol hash is used.
The invalidation routine marks the file as dirty
(with 'updated imports' state) if hash is modified.
^KT-51083 Fixed
^KT-51088 Fixed
^KT-51090 Fixed
^KT-51099 Fixed
The patch enables the direct dependency between
fake override inline function and its implementation from the base class.
Because klibs do not keep a signature of fake override implementation,
incremental cache can not use the signature index,
therefore the signature is serialized to a cache file as is.
^KT-51896 Fixed
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.
Fake overrides don't have a signature and can't be assiciated with klib index,
therefore they can't be tracked with incremental cache invalidation logic.
Should be fixed after KT-51896.
- Huge refactoring for IC
- Update hash combination logic
- Introduce value class for IC hashes
- Calc md5 directly by function IR
- Split IC logic by classes
- Move JsIrLinkerLoader into separate file
- CacheUpdateStatus is a sealed class
- Render TYPE_PARAMETER reified flag
^KT-51081 Fixed
^KT-51084 Fixed
- Cache signature readers and deserializers
- Cache inline function hashes
- IC refactoring
- [gradle] Use hash of module path for cache dir; Fix KT-51238
^KT-51238 Fixed