Commit Graph

778 Commits

Author SHA1 Message Date
Alexander Shabalin 266208c500 [K/N] Fix finalizer handling with mimalloc ^KT-63423 2024-01-18 17:53:04 +00:00
Alexander Shabalin ccba52aae4 [K/N][test] Mitigate a race in WorkerTest.executeAfterOrdering
Mostly affects linux aarch64 because we run it under qemu.
2024-01-18 08:12:22 +00:00
Alexander Shabalin 30d6fa730e [K/N] Add separate FinalizerProcessor for main thread ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin 8a86fec38f [K/N] Add RunLoopFinalizerProcessor ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin d8fdc4d31a [K/N] Add RunLoopTimer ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin b2d957b990 [K/N] Extract RunLoopSource ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin 2dd7a9ef21 [K/N] Support CF objects in ObjectPtr ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin e5269daa74 [K/N] Constructor of ObjectPtr with retain ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin c4992f1912 [K/N] Move AutoreleasePool into objc_support ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin 815b452435 [K/N] Remove old release-on-main ^KT-63423 2024-01-17 18:26:00 +00:00
Alexander Shabalin 7d35c1087e [K/N] Make GlobalData be initialized lazily ^KT-64313 2024-01-16 16:54:58 +00:00
Vladimir Sukharev 5f51f5e1fc [K/N] Migrate more cinterop tests
^KT-61259
2024-01-16 11:58:31 +00:00
Alexander Shabalin d2cf4548f6 [K/N] Fix ExtraObjectData not being collected ^KT-63423 2024-01-15 13:04:37 +00:00
Igor Yakovlev 2d08953c91 [stdlib] Remove unused kotlin.time.formatUpToDecimals 2024-01-12 18:28:00 +00:00
Alexander Shabalin 30550a6da1 [K/N] Immediately destroy objects that finalize only via ExtraObjectData ^KT-63423 2024-01-12 15:03:46 +00:00
Aleksei.Glushko 8ed806ebe0 [K/N] Concurrent phase in GC mark (KT-58865)
+ Log Stop The World reasons

Merge-request: KT-MR-13759
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2024-01-09 18:34:36 +00:00
Dmitrii Gridin b6d373d8e5 Update copyright to 2024 2024-01-05 13:43:17 +00:00
Alexander Shabalin 3f2584bb02 [K/N] Move calls checker into separate module ^KT-62091 2024-01-05 13:35:35 +00:00
Alexander Shabalin e959e97992 [K/N] Fix :kotlin-native:runtime:clean
The task erroneously deleted the build directory during
configuration phase.
2024-01-05 12:17:08 +00:00
Alexander Shabalin 5208b3c024 [K/N] Put FinalizerProcessor CFRunLoop usage under a flag ^KT-64313 2024-01-05 10:46:49 +00:00
Alexander Shabalin d665eb3575 [K/N] Fix calls checker allow list for signposts ^KT-62689 2024-01-04 16:58:20 +00:00
Pavel Punegov fc1d7df0bc [K/N][build] Simplify stdlib build
Build stdlib with a single task that also sets all supported targets
to the manifest file.
Remove manifest merging as it is not needed anymore.
2023-12-14 11:33:20 +00:00
Pavel Punegov 2d2714c8de [K/N] Move runtime bitcode files out of stdlib
Native bitcode files were moved out of the stdlib to the default
location of bitcode files in the dist.
Now it is possible to build stdlib separately and once as a klib
without bitcode files inside.
2023-12-14 11:33:20 +00:00
Ilya Gorbunov 35aa17e1d0 Pack K/N stdlib sources into single zip
With the directory structure similar to one of a multiplatform library,
where each source set sources are placed into the directory
named after this source set.

Do not use legacy projects for building relative paths
2023-12-13 15:40:25 +00:00
Sergey Bogolepov ce4eecebf4 KT-63264: Introduce a new ExportedBridge annotation
Swift Export Frontend generates a Kotlin file/library that contains a
set of simple bridging functions that connect Swift wrappers to their
Kotlin counterparts.
There are certain requirements for these wrappers:
1. They should not be DCEd when compiling a binary library.
In other words, these functions are roots.
2. They should provide a stable simple binary name.
3. Their signatures should be much simpler and restricted comparing to
other Kotlin functions.

Altogether, these requirements should be covered by introducing the new
ExportedBridge annotation.

Note: Frontend checks of ExportedBridge functions are not implemented
yet.
2023-12-12 07:03:25 +00:00
Aleksei.Glushko 569d37028f [K/N] Mark barriers implementation
Merge-request: KT-MR-13409
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-12-08 17:52:14 +00:00
Troels Bjerre Lund f1b6c2df45 Native: add missing stubs for objc for non-objc targets
Kotlin code for Objective-C interop is always included to stdlib.
It depends on some C++ code. The latter is compiled conditionally -
only for targets supporting Objective-C interop. That might cause
undefined symbols problems when DCE is not enabled.

To deal with it, we usually have trivial stubs in C++ code, used
for targets not supporting Objective-C interop.

This commit adds a couple of such missing stubs.
2023-12-08 11:43:45 +00:00
Alexander.Likhachev a19bd2ed2e [Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Troels Bjerre Lund 4f77434ea5 [K/N] Remove LLVM coverage
The -Xcoverage feature has not worked and has been disabled for a while.
This fix removes it, and all of its uses.


Co-authored-by: Troels Lund <troels@google.com>


Merge-request: KOTLIN-MR-821
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2023-12-06 14:07:16 +00:00
Aleksei.Glushko 7eccfe969c [K/N] Runtime reference accessors
Encapsulate reference-access-related logic,
    such as GC barriers and tsan workarounds
    inside (Direct)RefAccessor classes.
2023-11-30 11:04:21 +00:00
Aleksei.Glushko 24becdad7e [K/N] Backport std::atomic_ref from C++20 2023-11-30 11:04:21 +00:00
Svyatoslav Scherbina d15ee71b6c Native: get rid of __NSCFBoolean references in ObjCExport
ObjCExport accessed `__NSCFBoolean` using
`objc_getClass("__NSCFBoolean")`. This class is a private API.
Remove this private API usage by getting the same class from
`[[NSNumber numberWithBool:YES] class]` instead.

Also remove `__NSCFBoolean` from the related error messages.

`__NSCFBoolean` didn't cause Kotlin-compiled apps to be rejected by
Apple, but this commit reduces the risk that this might happen in the
future, and addresses related user concerns.

^KT-62091
2023-11-28 17:57:47 +00:00
Ilya Gorbunov 88bbe8d92d [stdlib] Enable explicit API mode 2023-11-24 01:45:45 +00:00
Ilya Gorbunov d8ee74222f [builtins-gen] Explicit visibility for companion objects and secondary constructors 2023-11-22 18:04:34 +00:00
Ilya Gorbunov c77930c1ea [stdlib] Explicit visibility and return types: Native 2023-11-22 17:57:40 +00:00
Ilya Gorbunov aa4419b7e3 [stdlib] Explicit visibility and return types: Collections 2023-11-20 02:24:40 +00:00
Alexander Shabalin 9ad7b00613 [K/N] Migrate some runtime/workers tests to new testing infra ^KT-61259 2023-11-17 07:42:28 +00:00
Alexander Shabalin fd1579186f [K/N] Migrate misc runtime/ tests to new testing infra ^KT-61259 2023-11-17 07:42:28 +00:00
Denis Lochmelis 4b3dfe6e6e [KT-58995] Fix UPUB bug
Add an explanation comment
2023-11-14 17:34:27 +00:00
Aleksei.Glushko f7057edce1 [K/N] Extract common part of gc runtime tests (2/2)
Restore ParallelMarkConcurrentSweepTest.cpp with new content.
2023-11-14 13:39:45 +00:00
Aleksei.Glushko 8180400a36 [K/N] Extract common part of gc runtime tests (1/1)
Move all the tests in a header file
    and make them instantiatable with different tracing GC implementations.
2023-11-14 13:39:45 +00:00
Pavel Punegov 6053c94c8a [K/N][build] Fix KT-56495: improve version manifest merge
Add missing input property to stdlib build task. This task should
consider kotlin/build version change.
Add a version check during the stdlib target task build. This check
should be done here instead of the final merge.

Fixes ^KT-56495


Merge-request: KT-MR-12906
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-13 14:45:06 +00:00
Alexander Shabalin fa9c620261 [K/N] Migrate some runtime/basic tests to new testing infra ^KT-61259 2023-11-10 15:51:05 +00:00
Ilya Gorbunov 9ccce52915 Clean up WasExperimental annotation from declarations with SinceKotlin<=1.4
Since it is not possible to use -api-version < 1.4, this annotation has no effect
2023-11-10 12:20:52 +00:00
Aleksei.Glushko d22218e4e4 [K/N] Non-worker work source in ParalleProcessor
To be used as thread-local mark queue in concurrent mark.


Merge-request: KT-MR-12723
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-11-08 17:20:15 +00:00
Aleksei.Glushko b6639ae128 [K/N] Fork concurrent-mark-and-sweep GC sources 2023-11-07 17:20:12 +00:00
Aleksei.Glushko 8726608973 [K/N] Move parallel-mark-concurrent-sweep GC sources 2023-11-07 17:20:12 +00:00
Pavel Punegov 0d8960088e [K/N] XCTest launcher for CompilerOutput's TEST_BUNDLE
This change adds a Native Obj-C launcher that implements XCTestCase
and overrides defaultTestSuite property to provide XCTest with generated
test suites and test cases.

The defaultTestSuite method is essentially a starting point with runtime
initialization. It requires a `Konan_create_testSuite()` method to be
implemented in a Kotlin library that returns a list of XCTestCases.

This launcher should be compiled as a TEST_BUNDLE to be used then with
XCTest.

This commit is a part of ^KT-58928


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

Merge-request: KT-MR-12841
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-07 11:56:08 +00:00
Alexander Shabalin 4c36538646 [K/N] Add signposts to safepoints ^KT-62689
Disabled by default.

Merge-request: KT-MR-12679
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-11-06 23:10:08 +00:00
Nikita Bobko 4050285fef Drop unnecessary suppress from stdlib
^KT-62785 Fixed
Review: https://jetbrains.team/p/kt/reviews/12858/files
2023-11-06 19:00:35 +00:00