Commit Graph

101049 Commits

Author SHA1 Message Date
Anna Kozlova e6b8a09375 [AA] assert that shortener is not called on compiled code
KTIJ-25188


Co-authored-by: Roman Golyshev <anstreth@gmail.com>

Merge-request: KT-MR-10064
Merged-by: Anna Kozlova <Anna.Kozlova@jetbrains.com>
2023-05-10 11:12:05 +00:00
Igor Chevdar f5478bda3d Handle recently added property to K2NativeCompilerArguments 2023-05-10 11:05:06 +00:00
Simon Ogorodnik 4d1ea06c17 FIR. Document current builder inference algorithm 2023-05-10 10:40:04 +00:00
Alexander Udalov 987e8c25dc K2: do not generate line numbers for delegated members
Psi2ir does not generate them, see
https://github.com/JetBrains/kotlin/blob/1.8.20/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt#L319.

Besides influencing debugger and coverage behavior, it also affects how
conflicting JVM signature diagnostics are reported because they
use offsets to determine which element to report the error on. So after
this change, K1 and K2 behavior is the same in that regard as well.

 #KT-58215 Fixed
2023-05-10 10:32:07 +00:00
Dmitrii Gridin b3aa2dd60f [LL FIR] calculate designation path by FirFile where it is possible
This will fix problems with declaration clash.
Otherwise, a designation path to the constructor of the second class
from the snippet
```
class A
class A
```
Will contain the first class instead of the second

Also, this is more performed than trying to find a segment of
a path by providers

^KT-58546 Fixed
2023-05-10 09:59:15 +00:00
Dmitrii Gridin ae88726fae [FIR] treat constructors of local classes as local declarations
The main problem: we are trying to lazily resolve local declaration

^KT-58546
^KT-58490
2023-05-10 09:59:15 +00:00
Troels Bjerre Lund 388634e47d [K/N] custom-alloc: Encode consecutive free blocks ^KT-55364
Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-662
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-05-10 09:45:14 +00:00
Dmitriy Novozhilov 7585a406e4 Advance bootstrap to 1.9.20-dev-1095 2023-05-10 09:32:30 +00:00
Kirill Rakhman e7bad26a4c [FIR] Unmute test for #KT-58080 2023-05-10 09:01:21 +00:00
Kirill Rakhman 8dad097841 [Tests] Fix reporting when FirLoadCompiledKotlinTest can be unmuted 2023-05-10 09:01:21 +00:00
Igor Chevdar c129e91bd6 [K/N][gradle] Supported IC for caches 2023-05-10 08:37:32 +00:00
Igor Chevdar 9fcb4ece64 [K/N][tests] Added a bunch of tests on incremental compilation 2023-05-10 08:37:32 +00:00
Igor Chevdar e4f30589a4 [K/N] Incremental compilation of per-file caches 2023-05-10 08:37:32 +00:00
Igor Chevdar 74864ba1d0 [K/N][codegen] Trampoline to call virtual functions to reduce dependencies coupling 2023-05-10 08:37:32 +00:00
Igor Chevdar 281296fc2a [K/N] Rely on file fqName & path instead of unstable index 2023-05-10 08:37:32 +00:00
Igor Chevdar f90db20512 [K/N][caches] Added klib hash computing and storing 2023-05-10 08:37:32 +00:00
Dmitriy Novozhilov 1936658e40 [FIR] Consider stability of receiver for DFA variables
^KT-57425 Fixed
2023-05-10 07:50:31 +00:00
Dmitriy Novozhilov d579798169 [Serialization] Ensure that KT-57770 is fixed
^KT-57770 Fixed
2023-05-10 07:30:29 +00:00
Igor Chevdar a8135c60ce [K/N] Turn on optimistic escape analysis
For new MM (with tracing GC), it is safe to turn it on
2023-05-10 05:51:52 +00:00
Ivan Kochurkin b22e89e91d [Tests] Consider dependent fragments in IR handlers 2023-05-09 20:50:01 +00:00
Ivan Kochurkin 988927154e [Tests] Extract common dependentIrModuleFragments and diagnosticReporter for IrBackendInput 2023-05-09 20:50:01 +00:00
Dmitrii Gridin 2c294cba64 [FIR] SupertypeComputationSession: fix false positive invisible reference for local object
The problem is that FirAnonymousObject was ignored during getResolvedSuperTypeRefsForOutOfSessionDeclaration from SupertypeSupplier

^KT-58583 Fixed
2023-05-09 17:23:45 +00:00
Vladimir Sukharev c6d9821ef0 [K2/N] Rework testStdlibFramework to avoid compiler crash due to KT-58459
^KT-58459

Merge-request: KT-MR-10043
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-09 16:52:04 +00:00
Troels Bjerre Lund 918a247bcc [K/N] custom_alloc: sweep extraobjects outside stw ^KT-55364
Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-677
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-05-09 16:37:58 +00:00
Aleksei.Glushko 57707180c6 [K/N] Cooperative intrusive list (in preparations for parallel mark)
Merge-request: KOTLIN-MR-670
Merged-by: Aleksej Glushko <aleksei.glushko@jetbrains.com>
2023-05-09 15:08:32 +00:00
Kirill Rakhman f0a8d7c86f [FIR] Add TODO for ConeDestructuringDeclarationsOnTopLevel
#KT-58563
2023-05-09 13:36:34 +00:00
Kirill Rakhman 24d7c3761d [FIR, Tests] Don't filter out syntax errors in tests
#KT-58469
2023-05-09 13:36:33 +00:00
Kirill Rakhman 9187bbb710 [FIR] Fix typo 2023-05-09 13:36:33 +00:00
Kirill Rakhman 93ee4d7ce7 [FIR] Refactor DiagnosticKind.Syntax into ConeSyntaxDiagnostic
#KT-58469
2023-05-09 13:36:33 +00:00
Roman Golyshev 7a9021aa6b [AA FIR] KT-58503 Do not use resolvedStatus for visibility yet
It's done to avoid lazy resolve contract violation errors. See KT-58572
2023-05-09 13:20:17 +00:00
Roman Golyshev 105611679e [AA FIR] KT-58503 Use resolvedStatus to access visibility and modality of a class
Compiler plugins (AllOpen, for example) can modify the status of a
declaration, including visibility and modality. If we observe them
without enforcing STATUS resolve, we risk to see incorrect information,
which in turn can lead to false negatives/positives in
inspections/intentions.

Add test for light classes. See KT-58503 description for the explanation
how the initial problem was influencing Spring inspections from intellij
repository.

^KT-58503 Fixed
2023-05-09 13:20:16 +00:00
Alexander Udalov c06ec84bb1 JVM: fix type mapping of big arity suspend function types
The code in IrTypeMapper was incorrectly translated from
KotlinTypeMapper during the development of JVM IR. The
`classDescriptor.hasBigArity` condition in KotlinTypeMapper was checking
if the class represents a function or a suspend function with big arity,
and the suspend function part was lost during conversion.

This resulted in incorrect generic signature being generated, which led
to malformed type exceptions from reflection, and compilation errors
from kapt stub generation.

Also, change a comment in irCodegenUtils to avoid confusion of numbered
function types (kotlin.jvm.functions.Function1, ...) with the big-arity
type kotlin.jvm.functions.FunctionN.

 #KT-58375 Fixed
2023-05-09 12:57:07 +00:00
Artem Daugel-Dauge f659b63aef [Tests] Add missing experimental cinterop optins (after KT-57728) in various Gradle IT 2023-05-09 12:47:32 +00:00
Artem Daugel-Dauge dadb3673ba Bump Kotlin/Native version to 1.9.20-dev-810 2023-05-09 12:47:32 +00:00
Alexander Udalov 45bf70c9f9 Minor, add debug stepping test for KT-44745 2023-05-09 12:44:47 +00:00
Nataliya.Valtman 59f9d0afd9 Fix FusStatisticsIT test 2023-05-09 12:33:36 +00:00
Sergey.Shanshin c9bde57e44 [KxSerialization] Fix NPE if sealed class has self-referencing property
Fixes Kotlin/kotlinx.serialization#2294

If the serializable class contains itself as a property, and its serializer is not an object (for example, for a sealed class), in this case there is a race in the initialization of the serializer and child serializers.

To avoid this the serialization class should not cache its own serializer as a child.

Merge-request: KT-MR-10019
Merged-by: Sergey Shanshin <Sergey.Shanshin@jetbrains.com>
2023-05-09 09:59:11 +00:00
Pavel Punegov 5a95d919c7 [K/N] Add kotlinx.cinterop.ExperimentalForeignApi opt-ins
Add more opt-ins in Samples, tests and Benchmarks.
This is a follow-up to KT-MR-9788 

Merge-request: KT-MR-9997
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-05-09 09:39:40 +00:00
Ilya Goncharov 14653799b5 [Gradle, JS] Depends umbrella packageJson task onto publicPackageJson task 2023-05-09 09:29:35 +00:00
Mikhail Glukhikh 0906258d03 K2: handle suspend anonymous functions properly in various compiler parts
#KT-58332 Fixed
2023-05-09 09:19:38 +00:00
Mikhail Glukhikh aec0def5ca FE: add test for KT-58332 (K2 fails with ARGUMENT_TYPE_MISMATCH) 2023-05-09 09:19:37 +00:00
Pavel Kunyavskiy 11e1bcca1d [K/N] Avoid using deprecated functions in data class generated methods
^KT-58267
2023-05-09 09:18:42 +00:00
Pavel Kunyavskiy 2f3947d8e5 [K/N] Unmute some actually passing tests 2023-05-09 09:15:41 +00:00
Bogdan Mukvich d78e30a5f5 Generate SBOM for kotlin-compiler.zip 2023-05-09 08:46:07 +00:00
Bogdan Mukvich 60b2dffeb3 Ignore SBOM in reproducible build 2023-05-09 08:46:07 +00:00
Bogdan Mukvich dccb7a221c Add SBOM plugin and configuration 2023-05-09 08:46:06 +00:00
Bogdan Mukvich 5ac255f4dc Add JDK 11 to kotlin build env 2023-05-09 08:35:07 +00:00
Dmitriy Novozhilov af60681705 [FIR] Save declarations in metadata in source order
^KT-54792 Fixed
^KT-54801
^KT-54800
2023-05-09 07:36:32 +00:00
Dmitriy Novozhilov b359a5538c [FIR] Get rid of FirSerializerExtension.customClassMembersProducer
This service was needed in FE 1.0 because of different scope structure
  for Java classes, but seems like it has no sense for FIR
2023-05-09 07:36:32 +00:00
Anna Kozlova cf6a06fd14 [LL] [cls] don't access index to retrieve fir for given ktElement
also don't check name pattern, because
given ktElement proves that corresponding package contains something
2023-05-09 07:36:11 +00:00