Commit Graph

588 Commits

Author SHA1 Message Date
Pavel Kunyavskiy d797505f06 [K/N] Drop merging forward and real declaration in deserializer
^KT-59643
2023-07-24 08:24:20 +00:00
mvicsokolova 298c4f8c32 [K/N] Introduce atomic arrays in K/N stdlib
This commit introduces API for AtomicIntArray, AtomicLongArray and AtomicArray<T>.

The current set of functions is implemented via atomic arrays intrinsics (see KT-58360) and provides sequentially consistent memory ordering guarantees and no spurious failures in compareAndSet/compareAndExchange operations.

For details see: KT-60608

Merge-request: KT-MR-11071
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-07-21 15:30:20 +00:00
Svyatoslav Scherbina 3280d3ef80 Native: prepare existing tests for cinterop adding ExperimentalForeignApi
cinterop tool should add ExperimentalForeignApi to all generated
declarations by default. This commit prepares existing tests for this.

^KT-58362
2023-07-21 11:54:14 +00:00
Pavel Kunyavskiy b6060f8440 [K/N] Fix lazy header export in one-shot compilation mode 2023-07-21 09:37:52 +00:00
Pavel Punegov 61ba29a775 [K/N][test] Excluded filecheck_signext_zeroext_objc_export
With enabled two-stage compilation test fails to match bridges
which generation depends on order
See ^KT-58863
2023-07-12 14:46:27 +00:00
Alexander Shabalin 6619edbbac [K/N] Fix redundant sp removal tests 2023-07-10 15:45:30 +00:00
Pavel Punegov d5c6dd5f5c [K/N][test] Improve testStackTrace test
Make it print stack trace before the checks
2023-07-07 17:09:40 +00:00
Pavel Punegov e722212502 [K/N][test] Suppress internal visibility in the test with @Retain 2023-07-06 16:22:02 +00:00
Pavel Punegov 7cb0875bd8 [K/N][test] Add ExperimentalNativeApi opt-in in the samples 2023-07-05 18:20:35 +00:00
Pavel Kunyavskiy 396cfb3956 [K/N] Make cast to objc forward declaration unchecked
Before this commit it caused compiler crash.
Unchecked cast warning to be done later.

^KT-59645
2023-07-05 06:49:34 +00:00
Yahor Berdnikau 5de2b5aeb4 [repo] Migrate Groovy build scripts to use 'kotlinStdlib()' directly from buildSrc 2023-07-04 19:26:38 +00:00
Sergey Bogolepov 2d945b7226 [K/N] Disable KT-59167 test on watchOS 2023-07-03 14:45:21 +00:00
Abduqodiri Qurbonzoda 209c916a7e OptIn ExperimentalNativeApi 2023-06-30 15:27:09 +00:00
Sergey Bogolepov aee9b7aae3 [K/N] Add a trivial test-case for KT-59167 2023-06-30 09:01:38 +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
Pavel Kunyavskiy f486fc942b [K/N] Fix special backend checks tests 2023-06-22 16:22:59 +00:00
Alexander.Likhachev 01276bbe49 [Build] Fix buildscripts deprecation warnings
#KTI-1221 In Progress
2023-06-22 15:16:08 +00:00
Vladimir Sukharev a3758bf70b [K2/N] Mute failed test
^KT-58863

Merge-request: KT-MR-10762
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-06-22 10:01:01 +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
Pavel Kunyavskiy 12455451fc [K/N] Call class static initializer in constructors
^KT-59058
2023-06-20 08:41:11 +00:00
Igor Chevdar 95bef03d3e [K/N][tests] Added a reproducer for KT-59501 2023-06-20 06:20:52 +00:00
Abduqodiri Qurbonzoda 4ae19b2b44 [K/N] Deprecate SharedImmutable annotation #KT-57837
As a part of efforts to stabilize Native stdlib.
2023-06-19 11:35:32 +00:00
Pavel Punegov d5bdc7cf8e [K/N][test] Fix sample that uses watchos_x86 target
Simply replace it with watchos_x64
2023-06-15 14:07:42 +00:00
Abduqodiri Qurbonzoda 193aa0f935 Align the Boolean.hashCode() value across platforms
Boolean.hashCode() should return 1231/1237 for true/false correspondingly.

As a part of efforts to stabilize Native stdlib.
2023-06-14 08:19:46 +00:00
Alexander Shabalin da1fde2477 [K/N] Enable custom allocator by default ^KT-55364 2023-06-13 10:22:04 +00:00
Alexander Shabalin 7815eec7c1 [K/N] Rework GC switches with better naming
Additionally, deprecate -Xgc in favour of a new binary option "gc".
This will allow setting gc right in gradle.properties

Merge-request: KT-MR-10498
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-06-09 12:04:19 +00:00
Svyatoslav Scherbina 1bf3d55bdf Native: add detachObjCObject internal function for Obj-C objects
For a Kotlin wrapper of an Objective-C object, this functions zeroes
and releases the strong reference from the Kotlin wrapper to the
Objective-C object.
Usually, such a release happens only when the Kotlin wrapper is GCed.
So using this function can help that happen sooner.

^KT-59134
2023-06-07 11:57:54 +00:00
Igor Chevdar 74a97ba730 [K/N][tests] Fixed a filecheck test 2023-06-07 05:22:49 +00:00
cristiangarcia 46d113605b Adopt configuration-avoidance where possible
Before this change `./gradlew help` (with native enabled)
Created immediately: 1322
Created during configuration: 1541

after this change:
Created immediately: 596
Created during configuration: 1509

To know more about configuration avoidance: https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
2023-06-06 14:27:42 +00:00
Alexander Shabalin aea8bac7d2 [K/N] Do not compile for deprecated targets and legacy MM
^KT-56533
^KT-58853
2023-05-30 16:44:58 +00:00
Igor Chevdar 1ae0350ca5 [K/N][tests] Added some file-check tests on KT-58654 2023-05-29 06:13:09 +00:00
Vladimir Sukharev 1b1cfd45a0 [K2/N] Turn off IR verification for failed test interop_objc_smoke
This reverts commit 62901e22ec.

^KT-57716

Merge-request: KT-MR-10351
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-26 14:11:16 +00:00
Sergey Bogolepov 89be94f123 [K/N] Fix KT-58839
Do not export extensions of classes that are
hidden from the generated Objective-C API.

Merge-request: KT-MR-10330
Merged-by: Sergey Bogolepov <sergey.bogolepov@jetbrains.com>
2023-05-25 15:17:18 +00:00
Vladimir Sukharev 74c57e6057 [K2/N] Compile to native binary in two stages
^KT-56855 Fixed

Merge-request: KT-MR-10219
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-24 13:07:12 +00:00
Vladimir Sukharev 62901e22ec [K2/N] Turn on IR verification for passed tests
^KT-57716 Fixed

Merge-request: KT-MR-10300
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-24 12:23:00 +00:00
Vladimir Sukharev fde8909e6f [K2/N] IntegerLiteralType coercion only to unsigned integer types
^KT-57484 Fixed

Merge-request: KT-MR-10270
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-24 07:56:14 +00:00
Vladimir Sukharev 363c56e226 [K2/N] Export C adapters for non-root packages
^KT-56182

Merge-request: KT-MR-10160
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-19 11:40:59 +00:00
Vladimir Sukharev bbe1e708f9 [K2/N] Rewrite mpp tests from old native infra to new
^KT-58543

Merge-request: KT-MR-10065
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-16 08:41:39 +00:00
Kirill Rakhman e2dafdb5b9 [Native/Tests] Add explicit import for SharedImmutable
This fixes an overload resolution ambiguity in K2.

#KT-56272
2023-05-11 13:10:34 +00:00
Igor Chevdar 1ef81c005e [K/N][tests] Fixed a test for KT-55938
Used in the test cache directory should be prepared before the test
2023-05-10 13:12:09 +00:00
Igor Chevdar 74864ba1d0 [K/N][codegen] Trampoline to call virtual functions to reduce dependencies coupling 2023-05-10 08:37:32 +00:00
Vladimir Sukharev c6d9821ef0 [K2/N] Rework testStdlibFramework to avoid compiler crash due to KT-58459
^KT-58459

Merge-request: KT-MR-10043
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-09 16:52:04 +00:00
Pavel Punegov 5a95d919c7 [K/N] Add kotlinx.cinterop.ExperimentalForeignApi opt-ins
Add more opt-ins in Samples, tests and Benchmarks.
This is a follow-up to KT-MR-9788 

Merge-request: KT-MR-9997
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-05-09 09:39:40 +00:00
Pavel Kunyavskiy 2f3947d8e5 [K/N] Unmute some actually passing tests 2023-05-09 09:15:41 +00:00
Igor Chevdar 197cba35eb [K/N] Added couple of reproducers for KT-57791 2023-05-09 05:25:11 +00:00
Alexander Shabalin 860d0e32f7 [K/N] Add tests on ObjCAction and ObjCOutlet. ^KT-58441 2023-05-05 19:02:34 +00:00
Sergey Bogolepov a8b7306342 [K/N] KT-58422: Mute obsolete tests 2023-05-04 14:14:55 +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
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