Commit Graph

103203 Commits

Author SHA1 Message Date
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
mvicsokolova b6f8991072 [atomicfu-JVM]: Commonization of K/N and JVM (part 2)
The following transformations were commonized:

* generation of the transformed atomic extension signature
* building atomic array fields (arrays are now supported on both backends JVM and K/N)
* transformation of function calls on atomic array elements
* Generation and invocation of atomic extensions (the only difference is generation of synthetic value parameters)
* Changed synthetic parameters passed to the generated atomic extensions

See, KT-60528

Merge-request: KT-MR-11249
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-07-28 11:45:10 +00:00
Ilya Goncharov 8363bae527 [Gradle, JS] Add test on whole-program output-granularity 2023-07-28 11:19:53 +00:00
Ilya Goncharov a1a046d164 [Gradle, JS] whole-program not produce compiler argument 2023-07-28 11:19:53 +00:00
Sergej Jaskiewicz 2727163a63 [test] Introduce DeserializedIrBackend backend kind
We have `BackendKinds.IrBackend` for IR emitted by the frontend.

We need a different backend kind for IR deserialized from klibs.

We cannot use `BackendKinds.IrBackend` for that purpose, because we
cannot have two different `IrBackendInput` subclasses with the same
kind.

We need a different `IrBackendInput` subclass for deserialized IR
because the `IrBackendInput` for frontend-emitted IR contains some
properties like `sourceFiles` which don't make sense for
deserialized IR.

Since we now have two backend kinds for IR artifacts, we need to make
certain functions and classes in the test infrastructure generic
over backend kinds.

Note: the JsIrDeserializedFromKlibBackendInput class is not used
anywhere yet. We will use it in the coming commits.
2023-07-28 11:19:21 +00:00
mvicsokolova 0521b63cb1 [K/N] Do not cast the result of atomicGet/atomicSet invocation from Boolean to Byte in VolatileFieldsLowering, because this cast is done by the property getter.
Merge-request: KT-MR-11347
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-07-28 10:14:27 +00:00
Dmitriy Dolovov 5171d92fb9 [KLIB] API for dumping KLIB ABI
^KT-54402
2023-07-28 09:52:18 +00:00
Dmitriy Dolovov 8d9954c0b4 [CODEOWNERS] Assign Native Team as owner of new 'util-klib-abi' module 2023-07-28 09:52:18 +00:00
Dmitry Savvinov c9b7063d96 [mpp] Report commonTest with dependsOn similarly to commonMain
^KT-60556
2023-07-28 09:41:51 +00:00
Ilya Goncharov 890e53b8e7 [Gradle, JS] Use jsIr preset 2023-07-28 09:29:03 +00:00
Ilya Goncharov 4c82206d3b [Gradle,JS] Return legacy target to Gradle plugin back 2023-07-28 09:29:03 +00:00
Ivan Kylchik fe9de6875a [FIR2IR] Use a fully expanded type when generating IrClassReference
#KT-60639 Fixed
2023-07-28 09:02:45 +00:00
Ivan Kylchik 7e5e2fe1e4 [FIR] Drop dependency on ir.serialization from fir-serialization 2023-07-28 09:02:44 +00:00
Ivan Kylchik 88191e8b1a [IR] Add new test to check that nullable access to enum is not evaluated
Just a safety check. If an expression like `EnumClass.Value?.name` was
evaluated, we would consider it as breaking change.
2023-07-27 22:50:21 +00:00
Ivan Kylchik d0da736b13 [FIR] Add the new test set to render diagnostics from IR const evaluator 2023-07-27 22:50:21 +00:00
Ivan Kylchik 87b3d69d1b [FIR] Add new error diagnostic EVALUATION_ERROR
This diagnostic will be used to report errors from IR constant
evaluator.
2023-07-27 22:50:21 +00:00
Ivan Kylchik 84159596bd [FIR] Pass diagnosticReporter in Fir2IrConfiguration
This parameter will be used to report diagnostics from constant
evaluator, in addition to report diagnostic from actualizer.
2023-07-27 22:50:21 +00:00
Ivan Kylchik 6e45c9d4c7 [Test] Drop convertToIr method from AbstractFirAnalyzerFacade
We are going to use `convertToIr` from `ModuleCompilerAnalyzedOutput`
without an intermediate wrapper.
2023-07-27 22:50:21 +00:00