Commit Graph

2364 Commits

Author SHA1 Message Date
Abduqodiri Qurbonzoda df642dd3fb [K/N] Internalize valueOfForEnum and valuesForEnum functions
As a part of efforts to stabilize Native stdlib.
2023-04-08 21:50:33 +03:00
Abduqodiri Qurbonzoda 72f87ba55f [K/N] Internalize functions for throwing specific exception from C++ code
As a part of efforts to stabilize Native stdlib.
2023-04-08 21:50:33 +03:00
Abduqodiri Qurbonzoda 95f1d0b6ae [K/N] Internalize getNativeNullPtr() functions
As a part of efforts to stabilize Native stdlib.
2023-04-08 21:50:32 +03:00
Abduqodiri Qurbonzoda dbfdda2ba1 [K/N] Internalize Ref
As a part of efforts to stabilize Native stdlib.
2023-04-08 21:37:39 +03:00
Abduqodiri Qurbonzoda d51763c240 [K/N] Internalize IntrinsicType
As a part of efforts to stabilize Native stdlib.
2023-04-08 21:37:38 +03:00
Abduqodiri Qurbonzoda bd3f528da4 [K/N] Internalize NumberConverter
As a part of efforts to stabilize K/N stdlib.
2023-04-08 21:36:59 +03:00
Abduqodiri Qurbonzoda 2328cf5fcf [K/N] Internalize FloatingPointParser
As a part of efforts to stabilize K/N stdlib.
2023-04-08 21:36:59 +03:00
Ilya Gorbunov b8da3e69ce KT-55268 Make k.c.Volatile stable 2023-04-08 15:07:56 +00:00
Abduqodiri Qurbonzoda 5cc6338fb9 [K/N] Deprecate Retain and RetainForTarget annotations
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-07 17:03:36 +00: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
Abduqodiri Qurbonzoda 4969a0e4f6 [K/N] Deprecate kotlin.native.ThreadLocal typealias
As a part of efforts to stabilize Native stdlib #KT-55765.
2023-04-06 17:34:48 +00:00
Alexander Shabalin 4cd1f2ff82 [K/N] Fix a race in MemorySharedRefs ^KT-56233 2023-04-06 11:40:47 +00:00
Alexander Shabalin 8a8aeed998 [K/N] Handle permanent objects in new MM MemorySharedRefs ^KT-56233
Do not create a foreign ref to the permanent objects. There's no need to
do it, and, moreover, this ref would have leaked.
2023-04-06 11:40:45 +00:00
Alexander Shabalin 1f1b26f2a5 [K/N] Split Weak and MemorySharedRefs between mm implementations ^KT-56233
* A separate RegularWeakReferenceImpl for the new mm. Name is chosen for
  better consistency with other WeakReferenceImpl implementations.
* KRefSharedHolder and BackRefFromAssociatedObject implementations are
  independent between the legacy and the new mm.
* Better support for WeakReference in runtime unit tests.
2023-04-06 11:40:45 +00:00
Alexander Shabalin 87da670319 [K/N] Add more tests on associated object handling ^KT-56233 2023-04-06 11:40:44 +00:00
Alexander Shabalin dbe14a0a90 [K/N] Make gc::SweepExtraObjects similar to gc::Sweep. ^KT-56233 2023-04-06 11:40:44 +00:00
Alexander Shabalin eec3987e85 [K/N] Fix RunFinalizerHooks ^KT-56233 2023-04-06 11:40:43 +00:00
Alexander Shabalin aad6d2c8f8 [K/N] Add kotlin::ManuallyScoped<T> ^KT-56233
kotlin::ManuallyScoped<T> is a wrapper over T that pins T in place
and has a trivial constructor and destructor. Creation and destruction
of T must be carried out manually by construct and destroy methods.
2023-04-06 11:40:43 +00:00
Alexander Shabalin 6a0e6b11bd [K/N] Add kotlin::RWSpinLock ^KT-56233
Trivially constructible and destructible std::shared_mutex
implementation with additional guarantee that try_* methods fail only if
the mutex is locked.
2023-04-06 11:40:42 +00:00
Alexander Shabalin 9e5a2efb03 [K/N] Add kotlin::raw_ptr<T> helper class ^KT-56233
kotlin::raw_ptr<T> is exactly T* but with the default constructor
setting value to nullptr and with destructive move.
2023-04-06 11:40:42 +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
Sergey Bogolepov d87f3cb9cd [K/N] Fix coverage phase condition 2023-04-05 15:46:08 +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
Alexander Shabalin 759d5009d6 [K/N] Fix combination of aggressive GC and state check
Merge-request: KT-MR-9483
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-05 13:16:01 +00:00
Dmitriy Novozhilov 59d126abc5 [Native] Rename FirSerializer.kt to FirNativeSerializer.kt
This is needed to avoid confusion with files with common parts of
  FIR serialization
2023-04-05 07:31:34 +00:00
Dmitriy Novozhilov 92a59279d5 [FIR] Properly implement serializer extension for klib compilation
^KT-57654 Fixed
2023-04-05 07:31:33 +00:00
Dmitriy Dolovov f86fa807cf [PL][Native] Propagate PL configuration to cache compilation 2023-04-04 22:24:02 +02:00
Ivan Kylchik 32297c0f21 Serialize and deserialize const val's properly for K2 klib
#KT-57312 Fixed
2023-04-04 12:35:54 +00:00
Vladimir Sukharev c3734aa9ce [K2/N] Build platform libs with XCode 14.3
Merge-request: KT-MR-9458
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-04 11:41:08 +00:00
Vladimir Sukharev 176325eaa7 [K2/N] KT-55598: Use InteropBuiltIns only in KonanSymbols and DescriptorsLookup
Merge-request: KT-MR-9431
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-04-03 14:05:43 +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 352316ba9f [K/N] Add @SinceKotlin for ObjC annotations #KT-57197 2023-04-03 12:21:31 +00:00
Abduqodiri Qurbonzoda 2f8e4a9775 [K/N] Deprecate ImmutableBlob
As a part of stabilizing Native stdlib.

Merge-request: KT-MR-9310
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-01 17:55:57 +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
Dmitriy Dolovov b7d0209e4b [PL] Disallow partial linkage when compiler is configured to produce KLIB
Partial linkage is intended for producing binaries, not libraries.
2023-03-31 18:29:44 +00:00
Dmitriy Dolovov 1fef48bb60 [PL] Log partial linkage messages at different severity
As specified in -Xpartial-linkage-loglevel CLI argument.
2023-03-31 18:29:44 +00: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
Mark Mann b6f669189b Use protocol name when creating objc protocol wrapper class 2023-03-31 09:50:25 +00:00
Svyatoslav Scherbina f5532abd11 Native: support compileBitcodeWithXcodeLlvm=false binary option
This option makes the compiler use Kotlin/Native-provided LLVM
instead of Xcode-provided LLVM when compiling bitcode to machine code
for Apple targets.

^KT-54799 Fixed
2023-03-30 18:05:00 +00:00
Dmitriy Dolovov 46ed6e5766 [PL] Change semantics of CLI parameter -Xpartial-linkage
This parameter accepts the name of the "mode" in which the partial linkage would work. Currently, only two options are supported: 'enable', 'disable'. But the list may be extended in the future as needed.

At the moment the 'disable' option is the default one. This will be changed in #KT-51447, #KT-51443.
2023-03-30 12:38:07 +00:00
Dmitriy Dolovov a450866db3 [PL] Commonize Native & JS compiler configuration keys 2023-03-30 12:38:07 +00:00
Dmitriy Dolovov 831611d577 [PL] Introduce new CLI parameter: -Xpartial-linkage-loglevel
The parameter controls the level of logs produced during the compile time by the partial linkage: 'info', 'warn' (default for now), and 'error'.
2023-03-30 12:38:06 +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
Dmitriy Novozhilov c957a0b43b [IR] Properly serialize IrDeclarationOrigin.GeneratedByPlugin to klibs
^KT-56911 Fixed
2023-03-30 07:52:56 +00:00
Vladimir Sukharev 639b0cc525 Revert "[K2/N] KT-56190 Serialize simple const property initializers"
This reverts commit 2ace8ba9bd.
2023-03-29 18:00:09 +02: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
Vladimir Sukharev 2ace8ba9bd [K2/N] KT-56190 Serialize simple const property initializers
Merge-request: KT-MR-8623
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-03-29 13:26:43 +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
Dmitriy Dolovov 7382b31fdc [PL] Native: Remove harmful private visibility guard in deserialization of LazyIr
Kotlin/Native codegen needs to deserialize all fields throughout the class hierarchy to build the proper binary class layout. That becomes impossible with the guard condition that prevents loading private top-level classes from another module in LazyIR (see https://github.com/JetBrains/kotlin/blob/2a4d8800374578c1aa9ec9c996b393a98f5a6e3b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/serialization/KonanIrlinker.kt#L701). The guard suits well for the partial linkage needs, but it causes the codegen to fail with `Unbound public symbol IrClassPublicSymbolImpl: [ File '/file/in/the/library.kt' <- private.top.level/ClassDeclaration|null[0] ]` error.

To prevent this the guard is removed. This does not influence the partial linkage in general except for the different error message being generated: `Function 'foo' can not be called: Private function declared in module <A> can not be accessed in module <B>` instead of `Function 'foo' can not be called: No function found for symbol '<symbol>'`.

#KT-54469
2023-03-27 15:50:13 +02:00
Abduqodiri Qurbonzoda 9dd778bc89 [K/N] Deprecate initRuntimeIfNeeded() with WARNING
As a part of stabilizing Native stdlib.
2023-03-27 14:52:26 +03:00