Commit Graph

1315 Commits

Author SHA1 Message Date
Igor Chevdar 55632f5df2 [K/N][runtime] Used internal isInstance 2023-05-22 12:49:58 +00:00
cristiangarcia d32d5346a2 Fix gradle deprecations in Kotlin Native
Merge-request: KT-MR-10267
Merged-by: Cristian Garcia <Cristian.Garcia-Marin@jetbrains.com>
2023-05-22 12:39:57 +00:00
Vladimir Sukharev 4705207263 [K2/N] Fix lost diagnostics
^KT-58065

Merge-request: KT-MR-10264
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-22 09:18:04 +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
Sergey Bogolepov c57c34525f [K/N] KT-58562: Implement frontend checkers for HiddenFromObjC on classes 2023-05-19 11:33:17 +00:00
Vladimir Sukharev 6a8981372b [K2/N] Read KDoc strings from LightTree nodes
^KT-56090

Merge-request: KT-MR-9613
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-17 08:12:39 +00:00
Nikolay Lunyak c57d9097c2 [FIR] Add the syntax tree suffix to buildResolveAndCheckFir 2023-05-16 12:11:47 +00:00
Nikolay Lunyak 90651c5851 [FIR] KT-58065: Support LT in K2Native 2023-05-16 12:11:46 +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 2f24c6df80 [K/N] Added isSubtype intrinsic 2023-05-11 09:30:18 +00:00
Igor Chevdar 67b65ec56a [K/N] Reformat 2023-05-11 09:30:18 +00:00
Igor Chevdar 96c142569d [K/N] Slight devirtualization improvement
Make devirtualization not by an actual receiver type but rather
by an actual virtual method implementation (which sometimes can be better)
2023-05-11 09:30:18 +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
Sergej Jaskiewicz 93d1932ccb [IR] Make IrReturnTargetSymbol a sealed interface 2023-05-10 11:51:26 +00:00
Sergej Jaskiewicz 6c211f3a39 [IR] Make IrFunctionSymbol a sealed interface 2023-05-10 11:51:26 +00:00
Sergej Jaskiewicz 1a371350ea [IR] Make IrClassifierSymbol a sealed interface 2023-05-10 11:51:25 +00:00
Troels Bjerre Lund 388634e47d [K/N] custom-alloc: Encode consecutive free blocks ^KT-55364
Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-662
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-05-10 09:45:14 +00:00
Igor Chevdar e4f30589a4 [K/N] Incremental compilation of per-file caches 2023-05-10 08:37:32 +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
Igor Chevdar 281296fc2a [K/N] Rely on file fqName & path instead of unstable index 2023-05-10 08:37:32 +00:00
Igor Chevdar f90db20512 [K/N][caches] Added klib hash computing and storing 2023-05-10 08:37:32 +00:00
Igor Chevdar a8135c60ce [K/N] Turn on optimistic escape analysis
For new MM (with tracing GC), it is safe to turn it on
2023-05-10 05:51:52 +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 11e1bcca1d [K/N] Avoid using deprecated functions in data class generated methods
^KT-58267
2023-05-09 09:18:42 +00:00
Pavel Kunyavskiy 2f3947d8e5 [K/N] Unmute some actually passing tests 2023-05-09 09:15:41 +00:00
Igor Chevdar b6030b3517 [K/N] Devirtualization: virtual calls from external world fix
The fix deals with the situation where a virtual function potentially from
the external world (because of the receiver) returns a final type (if it isn't final,
then it's conservatively assumed that no devirtualization could be done on it).

 #KT-57791 Fixed
2023-05-09 05:25:11 +00:00
Igor Chevdar 197cba35eb [K/N] Added couple of reproducers for KT-57791 2023-05-09 05:25:11 +00:00
Pavel Kunyavskiy 68a68b2763 [K/N] Refactor KonanSymbols to avoid descriptors when built over FIR
^KT-58437
2023-05-08 07:51:56 +00:00
Alexander Shabalin 917f64c893 [K/N] Fix ObjCAction, ObjCOutlet not switching state. ^KT-58441 2023-05-05 19:02:34 +00:00
Alexander Shabalin 860d0e32f7 [K/N] Add tests on ObjCAction and ObjCOutlet. ^KT-58441 2023-05-05 19:02:34 +00:00
Vladimir Sukharev 98be76295f [K2/N] Insert asserts to reveal wrongly recursive Fir2IrLazy*.overriddenSymbols
^KT-58459
[Merge-request: KT-MR-9962
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-05-05 12:06:22 +00:00
Sergej Jaskiewicz a74df3b4b4 [IR] Store manglers used for signature computation in IrBackendInput
We will need them in signature dump tests later.
2023-05-04 14:58:06 +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
Nikolay Krasko 0fb5934ebd [213] Add library dependencies to kotlin-native.jar
While dependency is added to backend.native, it's than
transitively packed to :kotlin-native:shadowJar. Without it
running gradle with -Pkotlin.native.useEmbeddableCompilerJar=false fails
with

e: java.lang.NoClassDefFoundError: org/codehaus/stax2/typed/TypedXMLStreamException

KTI-1114
2023-05-01 14:58:48 +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
Gleb Lukianets 242ca73d83 rrn/rd/KT-55578 User-provided hints for linker errors
[K/N] KT-55578 Show customized user suggestions on linkage errors

Merge-request: KT-MR-9636
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2023-04-27 14:14:43 +00:00
Kirill Rakhman 6d3b911dfc [K2/Native] Configure metadata compilation mode
This fixes access to internal declarations in common source sets from
intermediate source sets that are compiled to metadata.

#KT-58219 Fixed
2023-04-27 10:49:53 +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
Sergey Bogolepov fce878d63a [K/N] KT-56464: implementation of HiddenFromObjC for classes in backend 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