Commit Graph

43 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
vladislav.grechko 29eb1c7a63 Do not add nullability annotations to the methods of anonymous classes
Nullability annotations are useless for the methods of anonymous classes
due to their restricted scope.

^KT-62044: Fixed
2023-10-10 10:34:33 +00:00
Alexander Udalov e4e1bcefbd JVM: remove tests on JVM target 1.6 2023-05-19 13:23:59 +00:00
Alexander Udalov 163afc94bc JVM: prepare asmLike tests for indy lambdas by default
Use -Xlambdas=class in tests which were checking specific things related
to how anonymous classes for lambdas work (such as receiver mangling,
function arity etc.)
2023-04-28 21:34:19 +00:00
Alexander Udalov 562b27db4e JVM IR: initialize enum entries without invokedynamic
#KT-57316 Fixed
2023-03-24 13:38:32 +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
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
Dmitriy Novozhilov 88efa6bfb6 Update tests after switching to LV 1.9 2023-01-30 09:29:57 +00:00
Steven Schäfer 7e472301b6 Re-enable "JVM IR: Move direct invoke optimization into a separate pass" 2022-07-29 01:06:44 +02:00
Alexander Udalov b50d2ff20a Revert "JVM IR: Move direct invoke optimization into a separate pass"
This reverts commit f0760e0550.

The reason is that it leads to KT-53202.
2022-07-15 18:29:07 +02:00
Steven Schäfer f0760e0550 JVM IR: Move direct invoke optimization into a separate pass
This also changes the transformation to inline the body of a directly
invoked lambda rather than producing a call to an anonymous local
function. The latter is unsupported in inline functions and problematic
from an ABI perspective, since it results in functions whose name
depends on the entire source code up to this point.
2022-07-14 23:24:18 +02:00
Pavel Mikhailovskii ecb3cc193c KT-51883 Don't use "-" in generated unique lifted declaration names 2022-06-10 18:36:04 +00:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Mads Ager 6622846bc1 [JVM IR] Do not put destructuring params or underscores in LVT.
Putting them in the local variable table means that the debugger
needs to have special handling for parameters with specific names.
That forces us to generate mangled names for these.

Instead of also implementing the name mangling for FIR, this
change gets rid of the parameters from the LVT instead.
2021-11-02 15:13:14 +03:00
Dmitriy Novozhilov aab8870903 [Test] Migrate AbstractAsmLikeInstructionListingTest to new test infrastructure 2021-10-07 13:08:44 +03:00
Mikhael Bogdanov 70fe984738 Update classTypeParameter.kt test 2021-07-29 19:45:55 +02:00
Dmitry Petrov 851980e36f JVM_IR KT-45103 optimize direct invoke for lambdas and callable refs 2021-05-18 22:20:12 +03:00
Mikhael Bogdanov cd7841ceed Generate type annotations on class type parameters bounds
#KT-13228
 #KT-46539 Fixed
2021-05-10 12:12:21 +03:00
Mikhael Bogdanov cbe3c66156 Generate function type parameter annotations and type annotations on their bounds into bytecode
Generate type parameter annotation by default for `-Xjvm-target 1.8` and above

 #KT-46539
 #KT-13228
 #KT-46545 Fixed
2021-05-10 12:12:18 +03:00
Mikhael Bogdanov 209ec68591 Make copy for disabled ir tests 2021-05-10 12:12:16 +03:00
Mikhael Bogdanov 5ff4d648f4 Render generic signature in type parameters tests 2021-05-10 12:12:15 +03:00
Mikhael Bogdanov 6182228de8 Render all annotations in type parameters tests 2021-05-10 12:12:14 +03:00
Kristoffer Andersen edd3b457d4 [JVM+IR] Migrate/improve receiver mangling test suite 2020-11-18 15:18:10 +01:00
Mark Punzalan 89836a2c9a Minor, test-data-only: Remove unused "IGNORE_BACKEND_FIR" directives in
asmLike test-data.
2020-11-02 19:37:14 +01:00
Mikhael Bogdanov 9e26491631 Beatify names for enum name and ordinal local variables 2020-01-31 11:39:54 +01:00
Mikhael Bogdanov cd0c45c832 JVM_IR. Generate proper suffix for companion backing field accessor and parameter name 2020-01-31 11:39:53 +01:00
Mikhael Bogdanov f5f25224b0 JVM_IR. Add IrAsmLikeInstructionListingTestGenerated tests 2020-01-29 17:00:00 +01:00
Mikhael Bogdanov 342ff50e31 Minor. Update test 2020-01-29 16:59:59 +01:00
Mikhael Bogdanov 504d79577d JVM_IR. Align outer parameter name generation between backends 2020-01-29 16:59:57 +01:00
Dmitriy Novozhilov 76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Mikhael Bogdanov 70d71f0f07 Don't generate type annotations on synthetic accessors
#KT-35843 Fixed
2020-01-09 14:00:12 +01:00
Mikhael Bogdanov 1032e3a17c Support field type annotations
#KT-35843 Fixed
2020-01-09 14:00:11 +01:00
Mikhael Bogdanov 2ed0cb2a89 Support type annotations
#KT-35843 Fixed
2020-01-09 14:00:11 +01:00
Mads Ager 3b2843fe7a Introduce local variable type checker.
CheckLocalVariablesTableTests will now check the validity of
the locals table against types of locals computed based on the
bytecode.

These checks and the new destructuringInFor test act as a
regression test for the changes in
https://github.com/JetBrains/kotlin/pull/2613

These checks also caught a similar issue for destructuring
lambda parameters, where the local is introduced before the
value has been written to the local slot. This change also
fixes that.

Finally, this change fixes the asmLike tests to correctly
look up the name of parameters in the locals table.
2019-10-07 15:06:44 +02:00
Yan Zhulanow 28e4356e6e Restore original variable name mangling for captured/receiver $this
Design for the new one is still not finished.
2019-02-25 14:43:59 +03:00
Yan Zhulanow 488418d960 Change mangling for local functions 2019-02-25 14:43:56 +03:00
Yan Zhulanow aca3be12e9 Change illegal local variable mangling rules 2019-02-25 14:43:56 +03:00
Yan Zhulanow 47f0b68a8c Change mangling for destructured lambda parameters 2019-02-25 14:43:56 +03:00
Yan Zhulanow ea462091c4 Support new convention for local variables name mangling: '$receiver' -> '$this$<label>' (KT-26913) 2019-02-25 14:43:53 +03:00
Ilmir Usmanov 871134cff8 Update test data
#KT-28309
2018-12-28 14:18:39 +03:00
Alexander Udalov 5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Yan Zhulanow dd49d35320 Fix backend tests after changing format of synthetic variables for inline functions 2018-12-12 21:40:44 +09:00
Yan Zhulanow d16b55033e Introduce new naming convention for captured receiver backing fields
'receiver$0' -> '$this_<label>'
2018-09-11 16:41:20 +03:00