Commit Graph

44 Commits

Author SHA1 Message Date
Alexander Shabalin 6619edbbac [K/N] Fix redundant sp removal tests 2023-07-10 15:45:30 +00:00
Pavel Punegov e722212502 [K/N][test] Suppress internal visibility in the test with @Retain 2023-07-06 16:22:02 +00:00
Vladimir Sukharev 767cba5211 [K/N] Adjust test objc_direct.kt to pass under both K1 and K2
^KT-54610

Merge-request: KT-MR-10825
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-26 16:57:47 +00:00
Svyatoslav Scherbina 41247e8cef Native: workaround KT-59552 in filecheck_single_tls_load test
After recent changes (0cfb801) println got inlined into the checked
function. As a result, the test became affected by KT-59552.

Fix the test by moving println out of the checked function.
2023-06-21 15:49:53 +00:00
Igor Chevdar 74a97ba730 [K/N][tests] Fixed a filecheck test 2023-06-07 05:22:49 +00:00
Igor Chevdar 1ae0350ca5 [K/N][tests] Added some file-check tests on KT-58654 2023-05-29 06:13:09 +00:00
Vsevolod Tolstopyatov f4e8ae5191 Explicitly declare stability levels of declarations in kotlinx.cinterop package
* @ExperimentalForeignApi for all declarations that operate on
    unmanaged memory (i.e. pointers and references)
* @BetaInteropApi for the rest of the interoperability declarations,
    namely Swift/CInterop-specific interfaces and convenience-functions

### Implementation details

* Some typealiases are not marked explicitly because it crashes the compiler,
    yet their experimentality is properly propagated
* License header is adjusted where it previously had been existing
* Deprecated with ERROR interop declarations that are deprecated for more than
    two years are removed
* WASM target interop declarations are deprecated
* Deliberately make Boolean.toByte and Byte.toBoolean foreign-experimental to scare
    people away

^KT-57728 fixed

Merge-request: KT-MR-9788
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-05-04 13:52:21 +00:00
Pavel Kunyavskiy f55fd481e9 [K/N] Refactor default argument lowering to avoid boxing
Current inline classes API is not compatible between different backends.
So implementing common function required for this optimization
was not possible in Native backend.

So, common default arguments lowering was refactored to make bigger
piece of code replaceable in backends.

^KT-57860
2023-05-01 13:04:21 +00:00
Gleb Lukianets fc96eb6d8d [KN] CInterop: __attribute__((objc_direct)) support
Merge-request: KT-MR-8828
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-03-02 10:36:53 +00:00
Igor Chevdar 32ce254001 [K/N] Added a filecheck test on suspend lambdas tail calls 2023-02-03 11:14:54 +00:00
Sergej Jaskiewicz 61fc3e99b1 [K/N] Fix generics in FunctionReferenceLowering for more edge cases
There were still some cases where the generated function reference class
would contain references to generic parameters that were not in scope.
One example of that was `Array<*>::get`. Before this fix the generated
function reference class would still contain a reference to the
type parameter declared in the `Array` class.

Also, the logic of generifying the generated function reference class
was incorrect. For example, for function `fun <A, B> foo()` if we had
a reference `::foo<T, T>` (where `T` comes from the outer scope),
the class would still contain two generic parameter, despite that only
one generic parameter from the outer scope was referenced.
This is also fixed here.
2023-01-27 15:26:30 +00:00
Igor Chevdar 29b7a8e435 [K/N] Supported ..< operator for BCE optimization 2023-01-26 12:54:19 +00:00
Sergej Jaskiewicz 150b8061e9 [K/N] Fix FunctionReferenceLowering for bound refs to generic functions
4a2a77d9b9 introduced a regression
where for bound references to functions generic over their receiver
the generated class was also generic even if the function reference
itself only contained concrete types. This is fixed here.
2023-01-17 18:41:08 +00:00
Igor Chevdar 0e4e53786c [K/N] Fixed a problem with built coroutine visibility
#KT-55494 Fixed
2022-12-16 18:32:43 +00:00
Pavel Kunyavskiy 68f78f1e5f [K/N] Make instance a property not a field
This enables inlining machinery, and allows to avoid frame in simple
cases.
2022-11-22 13:51:23 +00:00
Igor Chevdar 68e6317159 [K/N][tests] Added FileCheck tests on suspend tail call optimization 2022-11-21 19:32:39 +00:00
Pavel Kunyavskiy 95eaf3d234 [K/N] Add lowered suspend function mangling to avoid clashes 2022-09-30 08:48:59 +00:00
Vladimir Sukharev 77ab69240e Do inline safepoints for watchos_arm64
Merge-request: KT-MR-6993
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-01 08:14:41 +00:00
Vladimir Sukharev f4c5f5d8eb Fix filecheck for Objective-C targets
Merge-request: KT-MR-6854
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-15 15:11:52 +00:00
Vladimir Sukharev 9f2cdb0130 Fix basic blocks order for WHEN expression
Merge-request: KT-MR-6833
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-11 08:27:06 +00:00
Vladimir Sukharev c84a70c654 Always inline primitive unbox functions in IR level
Merge-request: KT-MR-6708
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-09 18:07:02 +00:00
Vladimir Sukharev 26149be44a KT53100: Optimization: <T-unbox>(CONSTANT_PRIMITIVE(x: T?)) => x
Merge-request: KT-MR-6684
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-07-21 21:45:03 +00:00
Vladimir Sukharev d378d7d5f5 KT53119: Implement String Concatenation Type Narrowing to improve escape analysis
Merge-request: KT-MR-6661
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-07-20 16:28:33 +00:00
Vladimir Sukharev 2b7ae20ac1 Don't create unnecessary temp vals during monomorphic callsite devirtualization
Merge-request: KT-MR-6633
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-07-15 10:52:45 +00:00
Sergey Bogolepov 9bdec1a051 [K/N] Fix signext_zeroext_objc_export.kt 2022-07-13 17:15:17 +00:00
Vladimir Sukharev fd52f475cb Devirtualization fails to eliminate boxing in function reference context
^KT-49847 Fixed

Merge-request: KT-MR-6460
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-07-12 08:26:27 +00:00
Pavel Kunyavskiy 9e9f26024b [K/N] Fix filecheck test for redundant safepoints removal 2022-06-20 15:21:39 +00:00
Sergey Bogolepov ba9c2e51a7 [K/N] Fix filecheck_enum_when for -opt build. 2022-04-28 13:43:03 +00:00
Sergey Bogolepov f635e450df [K/N] Add trivial test for RemoveRedundantSafepoints phase 2022-03-29 11:52:26 +00:00
Sergey Bogolepov 52c8b6166c [K/N] Fix filecheck_function_attributes_at_callsite test 2022-02-14 13:38:51 +00:00
Sergey Bogolepov b4cbe703cd [K/N] Test for KT-50970 2022-02-14 13:38:50 +00:00
Sergey Bogolepov 322bffd75a [K/N] Add FileCheck test for constants merging 2022-01-25 09:11:01 +00:00
Pavel Kunyavskiy fd63fed8b4 [K/N] Filecheck test for EnumWhenLowering 2021-12-23 11:09:29 +00:00
Pavel Kunyavskiy 60cb8543f0 [K/N] Add test for tls load optimisation
^KT-50139
2021-12-23 11:09:28 +00:00
Pavel Kunyavskiy 1956fcb14f [K/N] Add test for inlining of adopted function reference
^KT-48179
2021-12-23 11:09:28 +00:00
Elena Lepilkina f650311b11 [K/N] Support properties in BCE 2021-12-16 08:33:36 +00:00
Elena Lepilkina 15dcfa2837 [K/N] Fix new FileCheck tests after rebase 2021-11-02 12:04:45 +00:00
Elena Lepilkina d8c9536edd [K/N] Fixes in tests and check function in optimized mode 2021-11-02 12:04:44 +00:00
Elena Lepilkina 751f1a3b91 [K/N] Added FileCheck for noreturn attribute absence for suspend functions 2021-11-02 12:04:42 +00:00
Elena Lepilkina dba645bce1 [K/N] Fix FileCheck test, now compiler produces call instruction 2021-11-02 12:04:39 +00:00
Sergey Bogolepov 95bd5fcc4b [K/N] Update filecheck tests for different ABIs 2021-10-29 04:07:31 +00:00
Sergey Bogolepov fdd020eab6 [K/N] Tests for function attributes in bitcode generator
Besides, well, tests themselves, this commit extends FileCheck infra to
make it possible to test bitcode for direct and reverse interop.
2021-10-29 04:07:30 +00:00
Elena Lepilkina 453e4b1830 [K/N] Added FileCheck tests on bound check elimination 2021-10-27 12:02:06 +00:00
Sergey Bogolepov b9bb56d9c6 [K/N] FileCheck-based tests
Introduce a simple infrastructure for testing produced bitcode with
FileCheck LLVM utility.

^KT-48925
2021-10-01 14:18:01 +00:00