Commit Graph

541 Commits

Author SHA1 Message Date
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
Vladimir Sukharev 4c4afbd646 [K2/N] Don't emit and check lazy headers for ObjCExport tests. Enable these tests.
Merge-request: KT-MR-9861
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-28 19:02:47 +00:00
Alexander Shabalin 968bf424b4 [K/N] Fix interop_objc_kt56402 with different GCs ^KT-56402
Merge-request: KT-MR-9865
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-28 17:10:07 +00:00
Ilya Chernikov a045a0a81c FIR: use default getter in serializer if fir contains none
since we generate the default getter in this case in
Fir2IrDeclarationStorage.createIrProperty, so the serialized metadata
should follow the same behavior.
#KT-57373 fixed
2023-04-27 09:14:20 +00:00
Abduqodiri Qurbonzoda 2248f4ea33 Remove supportsNamedCapturingGroup flag in tests
Now it is true on all platforms
2023-04-26 10:44:21 +00:00
Sergey Bogolepov c7b100a41a [K/N] KT-56464: backend tests 2023-04-26 09:36:10 +00:00
Alexander Shabalin f058ee21b0 [K/N] Do not hold GC locks when finalizer thread is starting
Merge-request: KT-MR-9799
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-26 08:29:07 +00:00
Alexander Shabalin 82f94015f1 [K/N] Dispose ObjC objects from main thread on main thread. ^KT-56402
Merge-request: KT-MR-9515
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-26 07:35:44 +00:00
mvicsokolova 75b4469757 [K/N] Stabilization of Atomics API
`AtomicInt`, `AtomicLong`, `AtomicReference` and `AtomicNativePtr` classes were moved to `kotlin.concurrent` package. The corresponding classes from `kotlin.native.concurrent` were deprecated with warning since Kotlin 1.9.

In order to prepare for further commonization of Atomics API the following changes were made:
* `kotlin.concurrent.AtomicInt`: 
    * `increment(): Unit` and `decrement(): Unit` methods were deprecated with error
    * New methods were added: `incrementAndGet(): Int` , `decrementAndGet(): Int`, `getAndIncrement(): Int`, `getAndDecrement(): Int`, `getAndSet(newValue: Int): Int` 
* `kotlin.concurrent.AtomicLong`:
    * `increment(): Unit` and `decrement(): Unit` methods were deprecated with error
    * New methods were added: `incrementAndGet(): Long`, `decrementAndGet(): Long`, `getAndIncrement(): Long`, `getAndDecrement(): Long`, `getAndSet(newValue: Long): Long`
    * Deprecated `AtomicLong()` constructor with default parameter value
* For all atomic classes `compareAndSwap` method was renamed to `compareAndExchange`

See KT-58074 for more details.

Merge-request: KT-MR-9272
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-04-25 16:55:42 +00:00
Ilya Gorbunov ace2279631 Refactor helper function to run/not run block of common code on specific platform
Use it in StringBuilder tests
2023-04-25 13:55:04 +00:00
Pavel Punegov 1703d3a47e [K/N][test] Skip test worker10 with Aggressive GC
Merge-request: KT-MR-9729
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-04-21 17:02:32 +00:00
Pavel Punegov a98c2c178f [K/N][test] Add missing parenthesis that discovered frontend issue
See also ^KT-58131

Merge-request: KT-MR-9702
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-04-20 11:59:59 +00:00
Pavel Punegov aa85e6d95c [K2/N] Disable special backend checkers due to the ^KT-58099
Several interop tests fail with error:
"type kotlin.String? is not supported here: doesn't correspond to any C type"

Merge-request: KT-MR-9690
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-04-20 08:41:36 +00:00
Abduqodiri Qurbonzoda 5407ac1c72 [K/N] Mark UnhandledExceptionHook-related API with ExperimentalNativeApi
Instead of ExperimentalStdlibApi

As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-19 20:36:31 +00:00
Abduqodiri Qurbonzoda 208b279d2b [K/N] Internalize CharCategory.value/valueOf
As a part of efforts to stabilize K/N stdlib.
2023-04-19 20:20:42 +00:00
Pavel Punegov 1ee2d0814c [K/N][test] Exclude test interop0
See ^KT-58099

Merge-request: KT-MR-9672
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-04-19 12:49:25 +00:00
Vsevolod Tolstopyatov af9252aa96 Mark all Worker-related API as obsolete.
* Explain what obsolete means and why workers are obsolete
* Add some documentation to workers to explain its common pitfalls

^KT-54702


Merge-request: KT-MR-9563
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2023-04-19 09:28:23 +00:00
Alexander Shabalin 9fd05632f0 [K/N] Track object counts during sweep ^KT-55364
Previously object count was tracked via allocator. It adds additional
burden on every allocation. Tracking via sweeper is better because
it mostly happens on the GC thread during a concurrent sweep.
2023-04-18 12:08:02 +00:00
Vladimir Sukharev a6d93797ee [K2/N] Enable test interop_objc_foreignException
^KT-55909

Merge-request: KT-MR-9641
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-18 11:15:07 +00:00
Vladimir Sukharev ca740a4baf [K2/N] Re-enable special backend checks
^KT-55598

Merge-request: KT-MR-9625
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-18 03:37:47 +00:00
Abduqodiri Qurbonzoda 8629c92c62 Update copyright of generatedUnicodeData files 2023-04-12 23:28:12 +00:00
Abduqodiri Qurbonzoda e1c91ee50f [K/N] Move kotlin.native.internal.GC into kotlin.native.runtime
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 13:07:50 +03:00
Abduqodiri Qurbonzoda bb8498b0c5 [K/N] Move kotlin.native.internal.Debugging into kotlin.native.runtime
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 13:07:49 +03:00
Abduqodiri Qurbonzoda 16078ae8e8 [K/N] Mark WeakReference with ExperimentalNativeApi
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-12 09:44:25 +00:00
Abduqodiri Qurbonzoda 8e995e6c62 [K/N] Deprecate ArrayIndexOutOfBoundsException
As a part of efforts to stabilize Native stdlib.
2023-04-11 13:32:54 +00:00
Alexander Shabalin 375116dcf5 [K/N] Disable testPermanentObjectsFramework w/o GC ^KT-56233
Merge-request: KT-MR-9542
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-11 12:43:41 +00:00
Abduqodiri Qurbonzoda b65a68ca0d [K/N and WASM] Internalize NoWhenBranchMatchedException and UninitializedPropertyAccessException
As a part of efforts to stabilize Native stdlib.

Merge-request: KT-MR-9531
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-10 21:10:51 +00:00
Dmitriy Dolovov 468d524a74 [PL][tests] Run K/N tests (old infra) with PL enabled 2023-04-08 20:46:38 +00:00
Abduqodiri Qurbonzoda 54bbeae273 [K/N] Internalize TypeCastException
As a part of efforts to stabilize Native stdlib.
2023-04-08 21:50:34 +03:00
Vladimir Sukharev 273dcf1665 [K2/N] Mute IR verification error
^KT-57716

Merge-request: KT-MR-9522
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-07 06:11:13 +00:00
Alexander Shabalin 87da670319 [K/N] Add more tests on associated object handling ^KT-56233 2023-04-06 11:40:44 +00:00
Pavel Punegov 57904f117f [K/N][test] Add missing opt-in for setUnhandledExceptionHook
This is follow-up to KT-MR-9340

Merge-request: KT-MR-9488
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-04-05 16:04:56 +00:00
Vladimir Sukharev 185097f82e [K2/N] Enable tests fixed by KT-56030
^KT-56030

Merge-request: KT-MR-9456
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-05 14:21:16 +00:00
Vladimir Sukharev 23c3d0c36d [K2/N] KT-57716: Workaround by not verifying IR for interop_objc_smoke
Merge-request: KT-MR-9442
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-03 14:03:06 +00:00
Abduqodiri Qurbonzoda 8663239369 [K/N] Mark UnhandledExceptionHook-related API as experimental
As a part of efforts to stabilize Native stdlib.
2023-04-01 20:40:40 +03:00
Abduqodiri Qurbonzoda d738646a61 [K/N] Move kotlin.native.internal.Cleaner to kotlin.native.ref.Cleaner
As a part of efforts to stabilize Native stdlib #KT-55765.


Co-authored-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
Co-authored-by: Ilya Gorbunov <Ilya.Gorbunov@jetbrains.com>

Merge-request: KT-MR-9347
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-03-31 16:04:26 +00:00
Vladimir Sukharev b9633375b4 [K2/N] KT-56030: Support Objective-C overloading by param names only
Merge-request: KT-MR-8901
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-30 09:37:57 +00:00
Svyatoslav Scherbina 65d781758c Native: fix objc_direct tests on platforms with 32-bit NSUInteger
On some platforms, `NSUInteger` is 32-bit, while the objc_direct tests
expected it to be represented as `ULong`. So the tests failed on those
platforms.
Fix the tests by replacing `NSUInteger` with `uint64_t`.
2023-03-29 13:29:08 +00:00
Pavel Kunyavskiy ac8cbcafb4 [K/N] Do not export all operator component functions in data classes
^KT-57507
2023-03-29 10:25:51 +00:00
Abduqodiri Qurbonzoda 0d53e11851 [K/N] Internalize all annotations in kotlin.native.internal package
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-03-27 11:47:25 +00:00
Ivan Kylchik e981b1f958 [Native] Support evaluation of const intrinsics for K2
#KT-56023
#KT-55469 Fixed
2023-03-24 15:55:03 +00:00
Abduqodiri Qurbonzoda 9076e5b112 [K/N] Mark BitSet usages in stdlib with @ObsoleteNativeApi 2023-03-23 14:48:23 +00:00
Pavel Punegov 668dfdd81d [K/N][test] Exclude skia interop test that fails due to ^KT-57484
Merge-request: KT-MR-9291
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-03-21 18:45:17 +00:00
Pavel Punegov 56cd550e27 [K/N][test] Remove old lldb tests that were replaced in the new infra
These tests were replaced by the 842a66c3 and now located
in :native:native.tests project

Merge-request: KT-MR-9256
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-03-20 13:56:42 +00:00
Ilya Chernikov 8edf8573b5 Revert "[K2/N] adjust interop_objc_direct test for K2 because of ^KT-55902"
This reverts commit 8315eeaf92.
2023-03-17 08:57:52 +00:00
Ilya Chernikov be2a85be71 K2: support implicit integer to unsigned conversions...
with dedicated opt-in language feature and special
annotation or module capability.
Not intended for a general use, solves specific K/N
scenario with interop libs.
#KT-55902 fixed
2023-03-17 08:57:51 +00:00
Dmitriy Novozhilov b6a41c6d93 [CLI] Extract classes of compiler configuration from :compiler:cli to the separate module
Those classes mainly include KotlinCoreEnvironment and its dependencies

This change is needed for two reasons:
1. Splitting of some common configuration of compiler from logic of CLI
    makes code structure more clean
2. There is a need to add dependency on `:analysis:analysis-api-standalone`
    to `:compiler:cli`, because FIR analogue of AnalysysHandlerExtension uses
    services from it. But the problems is that standalone AA itself depends
    on classes for compiler configuration, which leads to circular
    dependency between those modules. Extracting configuration to
    `:compiler:cli-base` solves the problem
2023-03-16 15:16:32 +00:00
Pavel Kunyavskiy 62fb3df7f0 [K/N] Disable scope initialization on constant access
^KT-57098
2023-03-15 09:03:19 +00:00
Vladimir Sukharev 5bd0a1a0ba Disable some tests due to open issues and incompatibility with K1/MPP
Merge-request: KT-MR-9206
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-15 06:55:27 +00:00