Commit Graph

1023 Commits

Author SHA1 Message Date
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
Ilya Gorbunov c2e28149e6 [stdlib] Enable link-via-signatures to workaround KT-62798 2024-02-20 19:59:16 +00:00
Alexander Udalov 3f034e8b67 Enable lightweight lambdas (aka invokedynamic) since 2.0
#KT-45375 Fixed
 #KT-58173 Open
2024-02-08 19:46:18 +00:00
Ilmir Usmanov 19283048a8 Replace bytecode text test with a stepping test
#KT-62965
2024-01-19 10:52:39 +00:00
Xin Wang 2e32e13466 JVM Codegen: Mark line number before calling of indy in SAM Conversion
Fixes: KT-62965
2024-01-19 10:52:39 +00:00
Kirill Rakhman 0cebf2b39f [Tests] Remove irrelevant code from test 2024-01-17 08:20:06 +00:00
vladislav.grechko 34bac48541 Add JVM ABI K1/K2 consistency tests 2023-12-26 10:18:19 +00:00
Kirill Rakhman ad2689ecbf [FIR] Prefer the non-smartcasted receiver in resolution if it's visible
Previously, we would ignore the candidate with the non-smartcasted
receiver if they have the same symbol.
Now we prefer them when they're visible or when the smart cast changes
the nullability.
2023-12-21 13:29:01 +00:00
Dmitriy Novozhilov 4a2f9a5123 [FIR] Mute some tests back due to KT-64081
They were accidentally fixed with `[FIR] Process all overridden members from intersection scopes`
  commit, which itself introduced incorrect behavior, which was properly
  fixed with ... commit. So KT-64081 started to appear again
2023-12-08 15:19:55 +00:00
Dmitriy Novozhilov 385bff3be1 [FIR] Update all required places according to changed overridden processing contract
This commit fixes all places that relied on the contract described in
  the previous commit and also updates corresponding tests

^KT-63738
2023-12-08 15:19:55 +00:00
Xin Wang 11749d7c89 [Codegen][JVM]: Mark line number before invoking intrinsics
Fixes #KT-61768
2023-12-07 11:54:12 +00:00
Alexander Udalov 6219f7fc0d JVM IR: fix detection of enum entries in the same module
Use the new `IrClass.hasEnumEntries` flag added in the previous commit.

 #KT-61208 Fixed
2023-10-16 20:22:20 +00:00
Alexander Udalov db31f1f926 Tests: update some backend tests on enum entries
The enumEntriesIntrinsicMultipleEnums.kt test was supposed to check that
JVM backend generates 3 `$EntriesIntrinsicMappings` classes: for X, for
Y, and for Z. Mappings classes are generated for enums without
`entries`, i.e. Kotlin enums compiled without `EnumEntries` language
feature, and Java enums. The test incorrectly _enabled_ the language
feature for X though, and `$EntriesIntrinsicMappings` for X was
generated anyway because of KT-61208.

To keep the original intention of the test, I'm disabling the language
feature for X, so that it will be considered as enum without `entries`.
KT-61208 will be fixed in a separate commit (with separate tests).

The boxInline and bytecodeText tests changed their meaning when language
feature EnumEntries started to be enabled by default, so those changes
are a continuation to ebd43fc8c0. The behavior did not change after
enabling the feature, once again because of KT-61208.

Also, remove obsolete error suppressions which are no longer needed
after 64c8ce18a0.
2023-10-16 20:22:20 +00:00
Mikhail Glukhikh c33a6a665d Revert "Mute a pair of intrinsic trim tests for old BE in LV 2.0"
This reverts commit 876a0768e4.
Related to KT-59171
2023-09-21 12:38:22 +00:00
Mikhail Glukhikh 876a0768e4 Mute a pair of intrinsic trim tests for old BE in LV 2.0
We muted tests in this commit because LV 2.0 shouldn't support old BE,
so this behavior is not important
2023-09-19 15:46:27 +00:00
Alexander Udalov 03fdba5aa7 Tests: minor, remove obsolete suppressions about enumEntries
The `enumEntries` intrinsic has been made public in 64c8ce18a0.
2023-08-04 09:57:34 +00:00
Alexander Udalov 971b4e63e7 JVM: support enumEntries intrinsic for Java & old Kotlin enums
#KT-59710 Fixed
2023-07-25 09:55:43 +00:00
Alexander Udalov 874d1c514a JVM: support enumEntries intrinsic for Kotlin enums
Implementation is very similar to the `enumValues` intrinsic.

Java enums and old (pre-1.9) Kotlin enums will be supported in a
subsequent commit.

 #KT-59710
2023-07-25 09:55:43 +00:00
Ivan Kylchik 8f88f08573 [FIR] Use correct source for implicit this receiver
#KT-57489 Fixed
#KT-56139 Fixed
#KT-56755 Fixed
2023-06-23 07:23:39 +00:00
Abduqodiri Qurbonzoda fd4d4f516f Fix data class hashcode generation
It considers Boolean hashCode equal to 1/0 for true/false,
which is different from actual hashCode of the Boolean type.
2023-06-14 08:19:47 +00:00
Ilmir Usmanov d7fd2471b8 JVM IR: Remove remains of 1.2 coroutines from tests
Remove CoroutineAdapter and LANGUAGE: +ReleaseContinuation,
which are meaninless now.
Update the tests accordingly.
2023-05-31 05:56:18 +00:00
Alexander Udalov a4121fa8f3 Enable NoSourceCodeInNotNullAssertionExceptions since 1.9
#KT-57570 Fixed
2023-05-24 11:29:51 +00:00
Alexander Udalov e4e1bcefbd JVM: remove tests on JVM target 1.6 2023-05-19 13:23:59 +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
Alexander Udalov cd9209a7ee JVM: enable -Xlambdas=class in some codegen tests
Most of these tests check the specific structure of lambdas when they
are generated as classes, and they start to fail once invokedynamic
lambdas are enabled by default.
2023-04-28 21:34:19 +00:00
Alexander Udalov 3120a35a88 JvmDefault: remove most tests on @JvmDefault
The tests are removed because JvmDefault is going to be deprecated with
error in KT-54746 and removed later in KT-57696.

Many of the removed tests already had existing counterparts with the new
modes `all` and `all-compatibility`. In this change, I've added such
tests where they were missing, and removed tests which were testing
behavior specific to the JvmDefault annotation, such as some
diagnostics.

 #KT-54746
2023-04-25 14:33:00 +00:00
Alexander Udalov f04d01cf21 JVM IR: fix behavior of Enum.entries for unlowered enums
#KT-57671 Fixed
2023-04-24 12:43:43 +00:00
Pavel Mikhailovskii 3bb66e8432 KT-57714 Fix remapping of signatures with reified type parameters 2023-04-19 07:20:51 +00:00
Ilya Gorbunov b8da3e69ce KT-55268 Make k.c.Volatile stable 2023-04-08 15:07:56 +00:00
Alexander Udalov 562b27db4e JVM IR: initialize enum entries without invokedynamic
#KT-57316 Fixed
2023-03-24 13:38:32 +00:00
Evgeniy.Zhelenskiy 3b5ad0681f [IR] Fix compiler bugs with MFVC to let KorGE run
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-13 13:09:56 +00:00
vladislav.grechko 17e6099b53 Initialize 'source' property of FirCatch objects properly
^KT-56923: Fixed
^KT-56755: Fixed
2023-03-08 12:03:35 +00:00
Evgeniy.Zhelenskiy 5b868becf4 [IR] Hide regular class constructor with MFVC parameters
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2023-03-07 21:44:41 +00:00
Nikolay Lunyak 72823657c9 [FIR] Assume SafeCallsAreAlwaysNullable is always on 2023-02-27 15:00:30 +00:00
Alexander Udalov d73d3c46e2 K2 JVM IR: fix access to Java field shadowed by Kotlin property
#KT-56386 Fixed

Co-authored-by: Mikhail Glukhikh <Mikhail.Glukhikh@jetbrains.com>
2023-02-23 12:54:00 +01:00
Dmitriy Novozhilov 86ee855170 [Test] Mute test due to KT-56756 2023-02-20 08:40:31 +00:00
Mads Sig Ager 7c3cc1d5c1 [JVM_IR] Limit inner class attributes to types in class file (#5081)
* [JVM_IR] Limit inner class attributes to types in class file

Inner class attributes should only be recorded for types that
are materialized in the result class file. In particular, we
should not emit inner classes attributes for types that appear
only in fake overrides. We do map these types to track the
fake overrides for JVM signature clashes but they are not
materialized in the class file.

^KT-56104 Fixed

* [JVM_IR] Consistently pass around materialized boolean in mapType.
2023-01-30 14:11:07 +01:00
Dmitriy Novozhilov 83cbd322fd [Test] Prohibit declaring dependency on the same module with different kinds in module structure 2023-01-17 14:51:27 +00:00
Ilya Gorbunov 916f733f73 Make k.c.Volatile since 1.9 in JVM and Common KT-55268, KT-55609
Leave it experimental since 1.8 for K/Native.
2023-01-04 17:28:46 +00:00
Alexander Udalov 28759a3ac3 Optimize rangeUntil operator in for-loops and contains
Newly added tests are basically copies of the existing tests on `until`.
Note that this operator is optimized for all backends, but the fact that
it's optimized is only checked for the JVM backend in bytecode text
tests.

 #KT-53330 Fixed
2023-01-02 12:55:48 +00:00
Ilya Gorbunov e2d96da396 Introduce experimental kotlin.concurrent.Volatile annotation KT-55268, KT-55609
Use this annotation in tests to ensure it works the same at least on JVM
2022-12-23 19:07:30 +01:00
Steven Schäfer 6af616d3c3 FIR: make declarations marked with 'override' implicitly open
#KT-52236 Fixed
2022-12-14 21:46:41 +00:00
Dmitriy Novozhilov 3cffb33ab7 [FE] Drop ApproximateIntegerLiteralTypesInReceiverPosition language feature
This feature is not needed because it is unconditionally disabled for K1
  (because of not fully correct implementation) and unconditionally enabled
  in K2 (K2 does not support old behavior)

^KT-38895
2022-12-09 15:10:02 +00:00
Evgeniy.Zhelenskiy 40f38c8adb [IR] Eliminate redundant boxing/unboxing of MFVC after inlining
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-12-08 15:12:28 +00:00
Evgeniy.Zhelenskiy fa4a4e56f3 [Tests] Remove unnecessary usages of OPTIONAL_JVM_INLINE_ANNOTATION
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:42 +00:00
Evgeniy.Zhelenskiy 68fb8aa2a1 [IR] Replace indexes with names for mfvc methods and fields
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:41 +00:00
Evgeniy.Zhelenskiy b692748938 [IR] Always add getter methods to value classes even if not used
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:40 +00:00
Evgeniy.Zhelenskiy 3653c86f08 [IR] Rename static replacement of MFVC typed equals to "equals-impl0"
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:40 +00:00
Evgeniy.Zhelenskiy adee33d3e5 [IR] Forbid MFVC primary constructors default arguments
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:38 +00:00
Evgeniy.Zhelenskiy f2d98eac5e [IR] Make use a temp variable for flattened non-local non-MFVC getters
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:37 +00:00