Commit Graph

709 Commits

Author SHA1 Message Date
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 ecd20b1348 [JVM_IR] Properly handle inlined local var located in regenerated object
#KT-58778
2023-07-20 09:01:42 +00:00
Ivan Kylchik 2ecbb21a9f [IR] Add new tests on inline to check issues with type parameters
#KT-58241
2023-07-20 09:01:42 +00:00
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Vladimir Sukharev f3fcaa69eb [Test] Convert IGNORE: NATIVE directives in box tests from T to W and boxInline
^KT-59057

Merge-request: KT-MR-10752
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-22 18:33:24 +00:00
vladislav.grechko 38e9dfc823 Evaluate apiVersionIsAtLeast on compile time while IR-inlining
IR inliner should evaluate `apiVersionIsAtLeast` on compile-time (except
cases of inlining to inline functions from kotlin runtime) just as
bytecode inliner does.

^KT-59291: Fixed
2023-06-22 11:55:04 +00:00
vladislav.grechko e4f1c10bc1 [JVM_IR] Do not compile-time evaluate apiVersionIsAtLeast in stdlib
Function `apiVersionIsAtLeast` was introduced to be able to have
different inline function content inlined to user code call sites
depending on their api version settings. Thus, it should not be
compile-time evaluated when being called in the body of inline stdlib
function.

^KT-59452: Fixed
2023-06-19 16:24:57 +00:00
Vladimir Sukharev 67b00f86b7 [K/N] Remove "IGNORE_BACKEND: NATIVE" from tests already ignored due to incompatible language setting found in test
^KT-59057

Merge-request: KT-MR-10587
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-15 19:58:04 +00:00
vladislav.grechko d600d768a6 Do not assert existence of metadata for local delegated properties
Local delegated property may origin from a body of inlined function.
In that case, they contain no metatada - which is ok, as the original
local delegated properties contain it and will be serialized.

^KT-58780: Fixed
2023-06-13 10:04:28 +00:00
Pavel Kunyavskiy 733ca5a358 [K/N] Unmute tests already working on native
Also, add issue references for some tests
2023-06-06 14:29:21 +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
Nikolay Lunyak 83f2c2e1f0 [FIR] KT-58623: Unify FirInlineDeclarationChecker
> Condition 'isSuspendFunctionType' is always false when reached

The change in the native tests is needed, because K2
doesn't support disabling old language features

^KT-58623 Fixed
2023-05-25 12:19:51 +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 Korepanov 79d378f2bd [JS IR] Perform optimizations on the generated JS code
The patch adopts and reuses the optimizations from the legacy backend.

The optimizations remove useless temporary variables,
statements and simplify generated JS code.

The optimizations can be disabled by `-Xoptimize-generated-js=false`.

Related to KT-51139
2023-04-18 12:49:33 +00:00
Igor Yakovlev 993334e5e4 [Wasm] Support feature InstantiationOfAnnotationClasses 2023-04-04 18:39:17 +00:00
Kirill Rakhman 45d2424ad8 [FIR] Let prefix inc/dec call getter twice for compatibility with K1
#KT-57179 Fixed
2023-03-21 08:48:38 +00:00
Ivan Kylchik 49fdfc2992 Suppress some JMV IR inliner delegation tests for K2 2023-03-14 20:47:46 +00:00
Ivan Kylchik d2e92fd70d Add additional test cases and notes for KT44429 2023-03-14 20:47:45 +00:00
Ivan Kylchik 0af4ef8ee9 Fix typo in test name: inlinInDefault -> inlineInDefault 2023-03-14 20:47:43 +00:00
Ivan Kylchik b812a6c6f5 Ignore tests that are currently not working with IR inliner 2023-03-14 20:47:42 +00:00
Ivan Kylchik bb401c39d9 Add several new SMAP tests
Some of them are still failing and suppose to be
fixed later
2023-03-14 20:47:39 +00:00
Svyatoslav Kuzmich a99ea1d3ce [Wasm] Support enumValues and enumValueOf functions
^KT-57276 Fixed

Merge-request: KT-MR-9169
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-03-13 14:13:31 +00:00
Igor Chevdar 315d9089b0 [box-tests] Another version of reproducer for KT-56965 2023-03-08 06:48:52 +00:00
Igor Chevdar 99ec3215d9 [box-tests] Added a reproducer for KT-57053 2023-03-08 06:48:51 +00:00
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00
Igor Chevdar c038bbde08 [box-tests] Added a reproducer for KT-56965 2023-03-01 08:09:51 +00:00
pyos 7420008af9 FIR2IR: load property setter noinline/crossinline flags
#KT-56234 Fixed
2023-02-28 10:07:27 +00:00
Igor Chevdar 5d3b61364a Added a test for KT-56500 2023-02-23 15:32:25 +00:00
Svyatoslav Kuzmich 26c1098a4f [Wasm] Fix inliner issues (KT-56584)
* Fix objects in inline functions and lambdas:
  * Add common lowerings used in K/JS and K/Native
* Fix inline lambda call detection logic in presence of additional casts


Merge-request: KT-MR-8791
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-02-13 13:14:43 +00:00
Nikolay Lunyak a9343aeb7d [FIR] KT-55840: Ensure everything actually works
This inconsistency is present due to not using the `// WITH_STDLIB`
in the above tests. When K1 creates the enum, it tries to generate
`entries()`, and for that it tries to load `kotlin.enums.EnumEntries`,
but this is actually an unresolved reference. K1 silently swallows it,
and proceeds.

The reason K2 doesn't fail is that in order to generate `entries()` it
simply creates the necessary `ConeClassLikeType` with the desired
`classId` instead of loading the whole `ClassDescriptor`.

The reason we can still observe `$ENTRIES` and `$entries` in K1
is because they are generated during the JVM codegen, and it
only checks if the `EnumEntries` language feature is supported. It
doesn't check if the `entries` property has really existed in IR
(by this time it's expected to have already been lowered to the
`get-entries` function - that's why "has ... existed").

The reason why the codegen doesn't fail when working with
`kotlin.enums.EnumEntries` is because it creates its
own `IrClassSymbol`.

^KT-55840 Fixed

Merge-request: KT-MR-8727
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2023-02-10 16:57:51 +00:00
Svyatoslav Kuzmich e1f72d60dc [Wasm] stdlib API: Mark primitives constructor properties as private
These are implementation detail and were not meant to be public
2023-01-24 14:55:00 +01:00
Vladimir Sukharev 924898afb7 [K/N] KFC-446: K2 platform: Native alpha
Merge-request: KT-MR-7905
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-01-04 16:10:40 +00:00
xiaozihan.larryxiao 64d40aa285 KT-55398 Add test case
Add KT-55398 test case into boxInline/reified
2022-12-23 01:15:18 +00:00
Dmitriy Novozhilov 6b343515e1 [Test] Save IR bytecode dumps from BytecodeListingHandler to .ir.txt file instead of _ir.txt
This is needed to keep consistency with other dumps and to allow
  test helper plugin to recognize those dumps
2022-12-01 07:29:37 +00:00
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
Igor Yakovlev 033e2c45f1 [WASM] Caching string literals in global pool 2022-11-01 13:15:09 +00:00
vladislav.grechko 70c2f2b86f Support specifying different bytecode listings for FIR and old frontend 2022-10-21 12:57:11 +00:00
Igor Yakovlev 5218acd5c9 [WASM] Optimise interop adapters 2022-10-18 20:48:12 +02:00
Igor Yakovlev 38dd68f1f4 [WASM] Enable passing tests 2022-09-15 16:27:46 +00:00
Vsevolod Tolstopyatov 22e26d0756 Move EnumEntries LVS to 1.9
* Also cleanup tests to avoid using obsolete WITH_RUNTIME
2022-08-12 09:35:32 +00:00
Vsevolod Tolstopyatov c0f81cbc45 [JVM] Improve code coverage of EntriesMapping
Ensure that when .entries is accessed from an inline function body
or lambda argument, EntriesMapping are properly generated and used
without excessive mappings and duplicated fields

#KT-53236
2022-08-12 09:35:24 +00:00
Alexander Korepanov bb8da65188 [Common IR] Do inlining of callable references of inline functions
^KT-52805 Fixed
2022-08-08 17:40:45 +00:00
Alexander Korepanov 794229d012 [box-tests] Add tests about anonymous classes uplifting
^KT-50175 Fixed by commits before
2022-08-08 08:39:59 +00:00
Igor Chevdar e38f02b53a [box-tests] Added a bunch of tests on local objects in inline lambdas 2022-08-08 08:39:57 +00:00
Mads Ager 59c2bde10a [K/N] Unmute passing tests. 2022-08-01 08:57:16 +00:00
Igor Chevdar 8981eb85de [box-tests] Added a couple of reproducers for KT-52795 2022-07-28 16:01:17 +00:00
Steven Schäfer 2acfb3a41f JVM IR: Avoid direct lambda invokes in inline tests 2022-07-14 23:24:18 +02:00
Igor Chevdar e36bd5fe90 [box-tests] Added a multi-module box test 2022-07-13 08:01:51 +00:00