Commit Graph

93033 Commits

Author SHA1 Message Date
Yahor Berdnikau c495c07b1a Drop convention usage on accessing Java SourceSet
This is only valid for Gradle 7.1+, so new plugin variant was added -
"gradle71". For Gradle <=7.0 old convention approach is still used.

^KT-47047 In Progress
2022-06-14 10:53:20 +00:00
Sergey.Shanshin f192c2a541 Use EnumSerializer for explicitly serializable enum instead of auto-generated
Resolves Kotlin/kotlinx.serialization#683 Kotlin/kotlinx.serialization#1372
2022-06-14 10:21:48 +00:00
Ilya Kirillov f8310a4763 [analysis api] enable AnalysisApiMissingLifetimeCheck by default 2022-06-14 11:12:06 +02:00
Pavel Kunyavskiy df950d010a [K/N] Fix lambda naming in debugger tests
^KT-51883
2022-06-14 08:03:37 +00:00
Alexander Korepanov 9e780afdca [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.
2022-06-13 20:04:05 +00:00
Alexander Udalov f003f19e1d IR tree gen: restore IrWhileLoop children visit order 2022-06-13 18:58:05 +02:00
Alexander Udalov bf5ab49342 IR tree gen: restore strict cast in IrProperty.transformChildren 2022-06-13 18:58:05 +02:00
mcpiroman 529c03ab08 Switch to auto generated IR tree
Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2022-06-13 18:58:05 +02:00
Alexander Udalov c6608de879 Minor, move some files in ir.tree from 'src' to 'gen'
To help git understand that they are moved in the subsequent commit.
2022-06-13 18:58:05 +02:00
mcpiroman c11d01bebb Extract some common source generator logic from FIR tree generator 2022-06-13 18:58:05 +02:00
Jinseong Jeon 2eab61d75f FIR CLI: remove redundant cast and run 2022-06-13 18:41:17 +02:00
Jinseong Jeon d2663cfb94 FIR CLI: fix typos in contentRootToVirtualFile util 2022-06-13 18:41:17 +02:00
Artem Kobzar e790607af5 feat(KT-51123): save comments from js-function call inside arguments list. 2022-06-13 12:58:18 +00:00
Alexander Udalov ec9d929532 Remove dependency of fir2ir:jvm-backend on backend.jvm.entrypoint
Extract JvmIrDeserializer(Impl), similarly to the existing
JvmIrSerializer(Impl). Remove `allowErrorNodes` which is always false
anyway.
2022-06-13 12:35:51 +00:00
Artem Kobzar ef157b5b2e [K/JS] chore: rewrok klib generating with LazyIr. 2022-06-13 12:13:22 +00:00
sebastian.sellmair 9c67276201 [Gradle][MPP] Cache kotlinProjectStructureMetadata for multiplatform projects
GranularMetadataTransformation requires the metadata for dependency
projects, for every given source set multiple times. This lead
to the metadata being built extremely often, causing a significant
bottleneck during import.
2022-06-13 11:34:41 +00:00
sebastian.sellmair d8b4a88400 [Gradle][MPP] GradleKpmFragmentGranularMetadataResolver: Avoid re-processing dependencies 2022-06-13 11:34:39 +00:00
sebastian.sellmair 8b595cd804 [Gradle][MPP] GranularMetadataTransformation: Avoid re-processing dependencies
Do not process any dependency that was already processed previously.
When filling up the 'resolvedDependencyQueue' there is already
one filter present, checking that the resolved dependency was not
already visited.

However, this filter is insufficient, since the queue is just an
ArrayDeque and not a set. It happened that many dependencies
were enqueued multiple, multiple times.
2022-06-13 11:34:38 +00:00
sebastian.sellmair 8c904fdab2 [Gradle][MPP] reportSourceSetCommonizerDependencies: Fix parentsClosure 2022-06-13 11:34:37 +00:00
sebastian.sellmair e6f04c84fa [Gradle][MPP] Increase test failure readability in reportSourceSetCommonizerDependencies 2022-06-13 11:34:36 +00:00
sebastian.sellmair 3c8a4c5896 [Gradle][MPP] Mark 'commonizeNativeDistribution' as UP-TO-DATE when cache hits
^KT-52632 Verification Pending
2022-06-13 11:34:35 +00:00
sebastian.sellmair 02601745a9 [Gradle] Simplify 'isHostSpecificKonanTargetsSet' implementation
The method is called pretty often during import and can return
faster and create less objects.
2022-06-13 11:34:34 +00:00
Mikhael Bogdanov 3d1bde470b Regenerate tests 2022-06-13 11:58:15 +02:00
pyos e18105e0dc JVM: remove default masks from parameters after inlining conditions 2022-06-13 11:58:15 +02:00
pyos a1f0c6208c Add a test from KT-51950 2022-06-13 11:58:15 +02:00
pyos 7bdc09301d JVM: add inline lambdas' captured parameters to constructor first
This makes the code a bit cleaner, but has no effect other than that.
2022-06-13 11:58:15 +02:00
pyos ae5acc0de1 JVM: do not remap regenerated constructor parameters to fields
^KT-51950 Fixed
2022-06-13 11:58:15 +02:00
pyos 64e8bc31e2 JVM: keep track of which regenerated field is for which parameter 2022-06-13 11:58:15 +02:00
pyos 60c27affbb JVM: inline (!) some DescriptorAsmUtils methods into the inliner
Easier to work with it that way
2022-06-13 11:58:15 +02:00
pyos 2f6c80f06f JVM: more correctly track inline lambdas in local slots
The analyzer can now handle the case where a parameter containing an
inline lambda is overwritten with something else. The local variable
remapper still can't handle that, and KT-51950 is caused by a deeper
underlying issue (the slot should't get overwritten in the first place),
but at least the problem is more visible now:

>java.lang.RuntimeException: Trying to access skipped parameter:
>  Lkotlin/jvm/functions/Function1; at 2
2022-06-13 11:58:14 +02:00
pyos 51dbc60722 JVM: use various Interpreter.new* methods in FastMethodAnalyzer
These allow e.g. specifying different values for parameters depending on
their indices.
2022-06-13 11:58:14 +02:00
Anton Lakotka de875f6349 [Gradle] Support configuration cache for buildKotlinToolingMetadata
^KT-52694 Verification Pending
2022-06-13 07:26:24 +00:00
Anton Lakotka d8bc17a53c [Gradle] Test buildKotlinToolingMetadata with configuration cache
^KT-52694
2022-06-13 07:26:24 +00:00
Pavel Mikhailovskii bcd8a28d4c KT-47823 IR.JVM Fix handling of for loop ranges with inline types and break/continue/return 2022-06-10 18:42:28 +00:00
Pavel Mikhailovskii ecb3cc193c KT-51883 Don't use "-" in generated unique lifted declaration names 2022-06-10 18:36:04 +00:00
Kristoffer Andersen fb9c5c13bd [IR] Have JVM codegen respect the GenerateClassFilter supplied to GenerationState
ClassCodegen bails before generating code if the filter supplied to
the GenerationState rejects it based on the containing file or class
declaration itself.
2022-06-10 19:10:34 +02:00
Zac Sweers 3896482e4f Fix wrong replacement name for Enum.declaringClass
Resolves https://youtrack.jetbrains.com/issue/KT-52718
2022-06-10 13:53:03 +00:00
Diego Gomez Olvera 9a430efbe7 [KT-52681] Remove unnecessary semicolon after Objective-C @end
Objective-c `@end` doesn't need a semicolon, however KMM exported header
file, for instance:
```
__attribute__((swift_name("KotlinIterator")))
@protocol MyProjectKotlinIterator
@required
- (BOOL)hasNext __attribute__((swift_name("hasNext()")));
- (id _Nullable)next __attribute__((swift_name("next()")));
@end;
```
This creates problems with some code checkers that will not expect it
there, so it seems best to remove it.
2022-06-10 15:46:27 +03:00
pyos 3840d09314 FIR: fix check for plugins that support K2 2022-06-10 09:47:35 +03:00
Dmitriy Novozhilov b23092b447 jvm-abi-gen: report compilation errors instead of throwing exceptions during configuration 2022-06-10 09:47:35 +03:00
pyos 60405237d2 jvm-abi-gen: mark as supporting K2 (in new mode) 2022-06-10 09:44:31 +03:00
pyos 526e46cffc FIR: fix some errors in local variable assignment analyzer
* wrong method was called from FirDataFlowAnalyzer.exitFunctionCall;
 * map from function to affected properties should be keyed by symbol,
   not FirFunction, as the latter may change;
 * arguments of `return` and assignment statements should be visited,
   as they may contain lambdas.
2022-06-10 09:43:48 +03:00
pyos 9968fa252a FIR: fork flow on function entry, restore receivers on exit
^KT-52680 Fixed
2022-06-10 09:42:02 +03:00
Denis.Zharkov 3ba11711d2 Adjust test data after reverting fix for KT-35811
(see previous commit)

^KT-52684 Fixed
2022-06-09 15:44:36 +00:00
Denis.Zharkov 9caa60d389 Revert "KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing"
This reverts commit ba5c85d6

^KT-52684 Related
2022-06-09 15:44:36 +00:00
Denis.Zharkov 67f9025f9e Add test data for parsing of complicated <..> and <..>= combinations
^KT-52684 Related
^KT-8263 Related
2022-06-09 15:44:35 +00:00
Nikolay Egorov 149402cf00 Make TypeMapper use signatureWriter for scripts expression evaluation;
Support nullability detection for IrScriptSymbol;

tests in IJ commit: "[scripting] Introduce tests for KT-51755"
2022-06-09 14:08:28 +00:00
Nikolay Egorov 1c04162690 Proper script receiverValue for synthetic evaluation expression class;
tests in IJ commit: "[scripting] Introduce tests for KT-51755"
2022-06-09 14:08:27 +00:00
Alexander Shabalin ac395b21ea [K/N] Fix state switch in CAdapterGenerator ^KT-52692
Merge-request: KT-MR-6429
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-06-09 13:01:17 +00:00
Vladimir Sukharev 83d7524232 Fix KT-26478: Objective-C-objects-class-name-is-null-in-ClassCastExceptions-message
#KT-26478 Fixed

Merge-request: KT-MR-6405
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-06-09 12:57:11 +00:00