Commit Graph

103220 Commits

Author SHA1 Message Date
Alexander Udalov 69c698134b Tests: do not depend on PSI in JvmBackendDiagnosticsHandler
#KT-59586
2023-07-29 01:14:29 +02:00
Alexander Udalov b81c637fed Minor, simplify FirDiagnosticsCompilerResultsReporter.reportByFile 2023-07-29 01:14:29 +02:00
Igor Yakovlev f2ea2021d7 [Wasm] Add wasi target attribute 2023-07-28 20:19:55 +02:00
Sebastian Sellmair db5655d6ce [Gradle] Implement InternalKotlinTargetPreset
^KT-59321 In Progress
2023-07-28 17:53:45 +00:00
Timofey Solonin 969deb639c [MPP] Deprecate preset APIs
^KT-59321
2023-07-28 17:53:45 +00:00
Timofey Solonin a580d4e5aa [MPP] Validate fromPreset API changes 2023-07-28 17:53:45 +00:00
Timofey Solonin 0ad8407b57 [MPP] Add TargetPreset APIs deprecation tests
^KT-59321
2023-07-28 17:53:45 +00:00
Dmitrii Gridin da71a152cd [FIR] update FirRenderer for scripts
^KT-60728
2023-07-28 17:49:14 +00:00
Dmitrii Gridin 2bacba5a9a [LL FIR] add one more complex test case for scripts
^KT-60728
2023-07-28 17:49:14 +00:00
Zalim Bashorov 0bdee00ca2 [Wasm] Use Node.js with "canary" v8 (11.7.310.0) in tests
There are no other non-canary Node.js versions using fresh enough v8.
2023-07-28 16:16:34 +00:00
Zalim Bashorov cead5c8aae [Wasm] Update Binaryen to 114
This version supports new br_on_cast* instructions.

Also, stop passing to binaryen no longer supported option.
2023-07-28 16:16:34 +00:00
Zalim Bashorov a1115236f9 [Wasm] Disable deprecated instructions while running tests in V8
To make sure that our implementation is up-to-date with the spec.
2023-07-28 16:16:34 +00:00
Zalim Bashorov 4572680877 [Wasm] Migrate to the latest br_on_cast* instructions
#KT-59722 Fixed
2023-07-28 16:16:33 +00:00
Zalim Bashorov 9254f70c2a [Wasm] Update SpiderMonkey to 2023-07-24-09-16-21 2023-07-28 16:16:33 +00:00
Yan Zhulanow 6c6cf9977b [fir2ir] Disable resolve contract check in FIR/IR builtins
In the compiler, 'FirLazyDeclarationResolver' assumes
'lazyResolveToPhase()' appear only during code analysis. So there is
a check that requires calls to be wrapped with 'startResolvingPhase()'
and 'finishResolvingPhase()'. Checkers and backend are run on fully
analyzed code, so there is no need in calling 'lazyResolveToPhase()'
in the first place.

In the IDE, however, it's impossible to analyze all code in a project
before running the backend. Generally, it's not a problem as files that
are explicitly passed to the backend go through all FIR phases.
'IrBuiltInsOverFir', though, perform symbol lookups, so unresolved-yet
declarations might appear.
2023-07-28 16:05:34 +00:00
Yan Zhulanow 22fc147d60 [fir2ir] Refactoring, use 'createIrTypeParameterWithoutBounds()' utility 2023-07-28 16:05:34 +00:00
Yan Zhulanow 82855fbf0f [fir2ir] Add missing 'lazyResolveToPhase()' to FIR/IR builtins 2023-07-28 16:05:34 +00:00
Yan Zhulanow 8286ffd232 [fir2ir] Create separate symbols for serialized parameters 2023-07-28 16:05:34 +00:00
Yan Zhulanow a92c479344 [fir2ir] Pass 'ProcessCancelledException' 2023-07-28 16:05:34 +00:00
Yan Zhulanow 2600dc7f1e [fir2ir] Allow non-cached source parents for non-cached declarations
In the IDE, there might come declarations from other files/modules
that we link against, but not pass to the backend. As only declarations
from the compiled files end up being in the cache, the consistency check
should be relaxed.
2023-07-28 16:05:34 +00:00
Yan Zhulanow f5c9c1d78e [fir2ir] Use the correct 'FirProvider' for fetching the containing file
In the IDE, declarations may come from different modules.
2023-07-28 16:05:34 +00:00
Yan Zhulanow ba0f8c8735 [fir2ir] Generate facade stubs for external source declarations
In the IDE, it's impossible to pass classes from all modules to the
backend, so symbols for 'external' source declarations need to be
generated ad-hoc.

Such declarations do not go through the lowering phase, including one
that replaces the containing package fragment with a facade class.
2023-07-28 16:05:34 +00:00
Yan Zhulanow 7d88ade005 [fir2ir] Allow non-cached type parameters
In the IDE, there might come declarations from other files/modules
that we link against, but not compile. Type parameters are one of such
declaration kinds.
2023-07-28 16:05:34 +00:00
Yan Zhulanow 14f83566d0 [fir2ir] Support stub-based FIR declarations
In the IDE, FIR declarations for libraries are built on top of binary
stubs. This helps to improve memory usage significantly, as Protobuf
metadata isn't loaded all the time. However, the containing file type
for stubs is different.
2023-07-28 16:05:34 +00:00
Kirill Rakhman dc9e4f8d99 [FIR2IR] Fix UninitializedPropertyAccessException
#KT-60735 Fixed
2023-07-28 15:59:24 +00:00
Sebastian Sellmair 8aee8ad3c4 [Gradle] KpmLocalModuleIdentifier: Migrate to 'BuildIdentifier.getBuildPath'
^KT-58157 Verification Pending
2023-07-28 15:55:52 +00:00
Sebastian Sellmair d7d6d7ebca [Gradle] Implement MppCompositeBuildIT to check shape of project coordinates across different versions of Gradle
^KT-58157 Verification Pending
2023-07-28 15:55:52 +00:00
Sebastian Sellmair 749f13ca09 [Gradle] Implement CurrentBuildIdentifier to replace 'BuildIdentifier.isCurrentBuild()' usages
^KT-58157 Verification Pending
2023-07-28 15:55:52 +00:00
Sebastian Sellmair e9e0a4741c [Gradle] Implement 'BuildIdentifier.isCurrentBuildCompat'
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair 33a61c62ba [Gradle] IdeaKotlinProjectArtifactDependencyMatcher: Migrate to 'BuildIdentifier.getBuildPath'
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair fc359acb37 [Gradle] MetadataDependencyTransformationTask: Migrate to 'BuildIdentifier.getBuildPath'
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair 71e779375f [Gradle] IdeKotlinSourceDependencyMatcher: Migrate to 'BuildIdentifier.getBuildPath'
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair 9913ea2e20 [Gradle] KotlinProjectStructureMetadata: Migrate to 'BuildIdentifier.getBuildPath'
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair e07ae23df9 [Gradle] Multiplatform import: Migrate to 'BuildIdentifier.getBuildPath'
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair c174bb9aa9 [Gradle] Implement 'buildNameCompat' and 'buildPathCompat' utilities
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair f5e946c0b2 [Gradle] IdeaKotlinProjectCoordinates: Replace 'buildId' with 'buildName' and 'buildPath'
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Sebastian Sellmair fe3d5014ce [Gradle] Compile against Gradle 8.2
^KT-58157 In Progress
2023-07-28 15:55:51 +00:00
Pavel Kunyavskiy 858f432807 [K/N] Normalize on nan values in code generator
^KT-56041
2023-07-28 15:53:34 +00:00
Sergey.Shanshin 6417f6456f [KxSerialization] Implemented addition of annotations to the named companion
For a more efficient lookup of a companion with the functions of obtaining a serializer, a special annotation is added to the named companions.


Merge-request: KT-MR-11003
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-07-28 15:53:09 +00:00
Alexander.Likhachev 175c00e5c7 [BT] Introduce the project build uuid
This allows to perform some cleanups after the entire project build finished.
#KT-57398 In Progress
2023-07-28 15:48:28 +00:00
Alexander.Likhachev 28c059f25b [BT] Implement basic non-incremental in-process JVM compilation 2023-07-28 15:48:28 +00:00
Alexander.Likhachev 6356a40fe8 [BT] Introduce KotlinBuildToolsException
#KT-57398 In Progress
2023-07-28 15:48:28 +00:00
Alexander.Likhachev b3fbe4c484 [BT] Introduce CompilationResult
#KT-57398 In Progress
2023-07-28 15:48:28 +00:00
Alexander.Likhachev 754f4830b9 [Gradle] Add integration tests for JVM compilation via the Build Tools API 2023-07-28 15:48:28 +00:00
Andrei Klunnyi 419381af7f KT-60749 Scripting: default definition as a fallback
This commit effectively reverts changes made in the scope of KT-60193,
namely c9eebffb and 2d50bd68.

^KT-60749 fixed
2023-07-28 15:46:45 +00:00
Dmitriy Novozhilov 69a35970eb [FIR] Introduce different synthetic origins for FIR declarations
This is needed to be able to precisely distinguish different synthetic
  declarations (like fields for delegates and functions for data classes)
  in fir2ir
2023-07-28 13:59:38 +00:00
Dmitriy Novozhilov 5b7b885dac [FIR] Remove unused import
This import breaks JPS compilation of the project
2023-07-28 13:59:38 +00:00
Kirill Rakhman ed6948959c [FIR] Make rendering of properties for diagnostics more user-friendly
#KT-60137 Fixed
2023-07-28 13:28:06 +00:00
Simon Ogorodnik b5ea059861 [FIR] Remove dead-code in transformFunctionCallInternal
Logic that was used to complete receiver expression is no longer needed
after the `invoke receiver completion` change:
7b46c59d57

Before that change, we could have generated a new receiver expression
during resolution in case of `call() -> call.<invoke>()` resolution,
Here - `call` is newly generated qualified access that wasn't completed.
We were detecting such situations by detecting change in the receiver
between original `call()` shape and output `___.invoke()` shape in
the expression.

After that change, we always complete the receiver of invoke during
`callResolver.resolveCallAndSelectCandidate`
So the logic that detects receiver mismatch and invokes receiver
completion after it isn't needed anymore
2023-07-28 13:02:24 +00:00
Alexander Udalov 72d048bd62 JVM: introduce JvmBackendConfig
Move language version settings, compiler configuration and different
flags there, and use this config everywhere in both backends instead of
GenerationState.

This will hopefully make GenerationState less of a "god object" and
remove the need to have it available everywhere, in particular in JVM IR
lowerings code, in the future.

Also, future refactorings will make it easier to inject backend-specific
behavior into common code, so that we would not need to handle support
of new features in the old backend.
2023-07-28 12:19:32 +00:00