Invocation of Logger.fatal() may cause severe side effects such as
throwing an exception or even terminating the current JVM process
(check various implementations of this function for details).
The code that uses Logger.fatal() sometimes expects a particular kind
of side effect. This is totally a design flaw. And it's definitely not
a responsibility of Logger to influence the execution flow of
the program.
- See KT-63718 for a detailed description of the issue. This fix is a
workaround (see KT-64236).
- It's worth mentioning that it's too expensive to compute package sets
for "all libraries except one". Package sets are just an optimization.
^KT-63718 fixed
The commit removes all the KLib resolution logic,
now Analysis API Standalone clients need to provide all the KLib
list directly.
The resolution logic was removed as too error-prone and requiring compiler configurations.
Kotlin Gradle plugin can provide a full set of required KLibs,
so if a client is a Gradle plugin, this should not be an issue.
Probably, some fancy API which will explicitly perform all KLib dependency searches
should be introduced in the future (KT-63395)
^KT-63126 fixed
StubBasedBuiltInsSymbolProvider does not work for now for common modules (KT-61757)
but compiler builtins provider `FirBuiltinSymbolProvider` works.
Also, stub-based symbol providers should not be used in standalone mode.
Testdata from standalone is updated because of the difference
in property accessors (KT-62449) between stub and compiler builtin symbol providers.
Additionally, this commit fixes the behavior of `KotlinStaticPsiDeclarationFromBinaryModuleProvider`.
As compiler builtin declarations have no PSI attached,
`KotlinStaticPsiDeclarationFromBinaryModuleProvider` is used to get PSI
from `DecompiledPsiDeclarationProvider.findPsi`.
`DecompiledPsiDeclarationProvider` is only used in UAST standalone mode.
- This commit replaces session modification trackers with event-based
session invalidation. The removal of modification trackers should
improve overall performance, because session invalidation events
happen less frequently than sessions are accessed. Getting rid of
modification trackers also allows sessions to refer to other sessions
lazily, which is essential when cyclic dependencies occur.
- The new `LLFirSession` validity tracker has constant complexity and
will not cause the same kind of performance issues as dependency
modification trackers. It is a bridge to support modification trackers
in certain parts of the code (e.g. for `CachedValue`s), while being
backed by event-based invalidation.
- `LLFirSessionInvalidationService` is the bridge between modification
events and `LLFirSessionCache`. It finds out which modules should be
invalidated and instructs the session cache to remove the associated
sessions.
- Session invalidation must always happen in a write action to preserve
consistency between sessions. Otherwise, while a session A is already
removed from the cache, it might still be referenced by a dependent
session B which is in the process of being invalidated. Such a session
must never be returned from `getSession`.
^KT-57515 fixed
Use existing stub-based JVM library symbol provider for .knm and
.kotlin_metadata files. The only real difference is the scope filtering
by file types
KT-58769