Commit Graph

799 Commits

Author SHA1 Message Date
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
Alexander Shabalin 17dc60aac9 [K/N] Migrate runtime/text tests to new testing infra ^KT-61259 2023-11-01 13:56:10 +00:00
Aleksei.Glushko 2b2b8dd090 [K/N] Make runtime logs enablement compile-time evaluatable 2023-10-26 17:40:06 +00:00
Alexander Shabalin b3e13fb2c2 [K/N] Migrate runtime/collections tests to new testing infra ^KT-61259 2023-10-24 09:27:46 +00:00
Nikita Bobko 14029b0ebc [STDLIB] 1/2 Drop AllowDifferentMembersInActual from stdlib
^KT-62656 Fixed

I blindly converted all `@AllowDifferentMembersInActual` to suppresses.
But some suppresses in stdlib are redundant. I'm too lazy properly
annotate only the necessary places. All these suppresses will go away
after the bootstrap update anyway

I drop allowDifferentMembersInActual_class and
allowDifferentMembersInActual_typealias tests because their only purpose
was to check that `@AllowDifferentMembersInActual` works as expected

Note: some tests are failing in the compiler because of that. I will fix
them in the next commit
2023-10-20 14:37:09 +00:00
Pavel Punegov e01cea6669 [K/N][build] Add providers to klib install and cache tasks 2023-10-19 12:12:02 +00:00
Alexander Shabalin 27c85a059f [K/N] Move memmem from Porting.h to KString.cpp ^KT-59008 2023-10-17 09:37:34 +00:00
Troels Bjerre Lund 239f3a30cb [K/N] Add flag to disable allocator overhead estimate 2023-10-05 13:18:20 +00:00
Troels Bjerre Lund 3ae7b790a9 [K/N] Update HeapTest
This adds TypeInfo to the objects allocated in HeapTest, which is now
needed by SweepObject to gather problem live set statistics.
2023-10-05 13:18:20 +00:00
Troels Bjerre Lund bb195749c8 [K/N] Re-enable mutator assist
Also remove disabling of GC scheduling during GC
2023-10-05 13:18:20 +00:00
Troels Bjerre Lund a752d5d000 [K/N] Estimate allocator overhead
This increases the boundary for the next GC scheduling by how much is
estimated is currently being wasted by the allocator due to paging. This
is necessary, since the gc scheduling boundary is set based on the size
of the live set at the last GC, while the current memory use is only
tracked in whole allocator pages. This patch avoids some of the
situations where the GC would be triggered again immediately upon
completion, which happens with many sparsely filled pages.
2023-10-05 13:18:20 +00:00
Troels Bjerre Lund fc13dbdb91 [K/N] Track live size on sweep
After the change to track allocations in big chunks (KT-57773), the
scheduler no longer had information about how much of the allocated
memory was used on live objects, which lead to a lot of extra memory
usage (KT-61914). This patch adds the tracking of live objects size to
sweeping, which is enough to mitigate the problem.

co-authored by Alexander Shabalin

^KT-61914
2023-10-05 13:18:20 +00:00
Aleksei.Glushko 6405a174e2 [K/N] Do not CAS when marking newly allocated object
Merge-request: KT-MR-12038
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-09-09 12:42:54 +00:00
Alexander Shabalin 2f22b0a6b0 [K/N] Migrate runtime/atomics tests to new testing infra ^KT-61259 2023-09-09 07:25:35 +00:00
Alexander Shabalin eb0a301a8f [K/N] Update CallsChecker list 2023-09-08 17:13:00 +00:00
Alexander Shabalin 49814ecb8a [K/N] Remove std_support allocation code ^KT-59008 2023-09-07 09:32:00 +00:00
Alexander Shabalin 798e832943 [K/N] Remove fast paths phase checks in parallel mark ^KT-61741 2023-09-06 16:41:14 +00:00
Alexander Shabalin f47a09e55e [K/N] Move allocator-specific data into allocators. ^KT-60928 2023-09-06 14:18:08 +00:00
Alexander Shabalin 9ab6a5ff56 [K/N] Migrate all stdlib_external tests to new testing infra ^KT-61259
- Move backend.native/tests/stdlib_external to runtime/test This mirrors
  tests location (in relation to sources) on other backends.
- Remove all backend.native/tests tasks using stdlib_external.
  Additionally remove now unused KonanGTest.
- Include complete native-wasm/test and runtime/test in
  native/native.test
- In runtime/test/numbers/MathTest.kt leave only native-specific part.
2023-09-04 18:51:10 +00:00
Nikita Bobko 01fc708a0f Mark expect/actual classifiers as experimental
^KT-61573 Fixed
Review: https://jetbrains.team/p/kt/reviews/11969/timeline

Tests:
- MultiPlatformIntegrationTestGenerated
- CliTestGenerated
- MultiPlatformIntegrationTestGenerated
- DiagnosticTestGenerated.Multiplatform
- FirLightTreeOldFrontendDiagnosticsTestGenerated

Also add -Xexpect-actual-classes flag to all necessary ./libraries/* modules
Otherwise compilation of those modules failes because of `-Werror`
2023-09-04 12:21:37 +00:00
Ilya Gorbunov 78ef58f59d [Generator] Do not use explicit final modifier in Native primitive classes
'final' is the default modality, safe to omit
2023-09-04 11:32:39 +00:00
Ilya Gorbunov 1c149925b7 [Generator] Always put expression body on a new line 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 68a9b9c312 [Generator] Reference generator class in generated code files 2023-09-04 11:32:39 +00:00
Ilya Gorbunov 74ac48851a [Generator] Canonical order of modifiers 2023-09-04 11:32:39 +00:00
Alexander Shabalin 70996035fc [K/N] Move AllocatorImpl.hpp into alloc/ ^KT-60928
- Hide allocator-specific data into Allocator::*::Impl
  like with gc and gcScheduler modules.
- These *::Impl are still owned by specific GCs
- Additionally moved "stateless" allocator APIs into Allocator.hpp
2023-09-01 17:00:59 +00:00
Alexander Shabalin 958d613911 [K/N] Remove code for deprecated targets from runtime ^KT-59008 2023-09-01 10:48:07 +00:00
Abduqodiri Qurbonzoda 64fd4ac510 Native Enum.hashCode() is not final #KT-61507
Merge-request: KT-MR-11937
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-08-30 21:34:46 +00:00
Alexander Shabalin 1fa0ef6f56 [K/N] Refactor allocator modules ^KT-60928
- Move std_alloc, opt_alloc and custom_alloc into alloc/std,
  alloc/mimalloc and alloc/custom to mirror convention of gc,
  gcScheduler modules.
- Add alloc/common with common allocator API
- Add alloc/legacy with common implementation details of alloc/std and
  alloc/mimalloc. alloc/custom does not depend on alloc/legacy.
- Removes experimental_memory_manager_custom as it's now unused
- Additionally, renames experimental_memory_manager module into mm
2023-08-30 17:07:21 +00:00
Alexander Shabalin 3ec4f2e0ee [K/N] Remove jsinterop because K/N wasm32 target is removed ^KT-59008
See https://kotl.in/native-targets-tiers for details
2023-08-30 12:17:52 +00:00
Aleksei.Glushko 4eac193463 [K/N] Generalize GC-assistance pause logic
Merge-request: KT-MR-11790
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-08-29 19:31:02 +00:00