813 Commits

Author SHA1 Message Date
Ilya Matveev 41c45b97e7 [K/N][Runtime] Switch thread state when triggering CMS GC 2022-01-28 12:25:03 +07:00
Ilya Matveev 1e78036a1b [K/N] Enable CMS GC by default for the new MM
Issue #KT-50713 Fixed
2022-01-28 12:24:57 +07:00
Alexander Shabalin 4c8bb93560 [K/N] Helpers for saturating arithmetics in runtime
Merge-request: KT-MR-5496
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-27 12:32:40 +00:00
Dmitriy Dolovov 15e6101608 [IR, Native] Support partial linkage in backend
^KT-50775
2022-01-26 13:36:23 +03:00
Ilya Matveev acced31bb2 [K/N] Fix CMS GC hanging on Windows
Issue #KT-50948 Fixed
2022-01-26 12:57:09 +07:00
Alexander Shabalin b29b6227c2 [K/N] Adjust timings in GCSchedulerTest
Merge-request: KT-MR-5555
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-25 09:38:32 +00:00
Pavel Kunyavskiy 3798920183 [K/N] Any.isFrozen is now always false when freezing is disabled 2022-01-24 13:38:30 +00:00
Alexander Shabalin 69bb2587eb [K/N] Make GC scheduler less aggressive
^KT-48537

Merge-request: KT-MR-5319
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-19 19:11:15 +00:00
Svyatoslav Scherbina 35cb897bdd ObjCExport: use terminatingExceptionHandler by default
If something called from an ObjCExport bridge throws a Kotlin exception,
treat it as fatal by default and terminate the process.

This affects
* Runtime calls (managing and converting Kotlin and Obj-C references and
  other types), that shouldn't throw such exceptions anyway
* User code (Kotlin function object throws Kotlin exception when
  called from Swift/Obj-C).

If an exception should be handled non-fatally (e.g. forwarded to
the caller), this intention should be expressed in the code generator
explicitly.

^KT-50830

This change makes the code more simple and efficient,
and the control flow -- more explicit.
2022-01-18 08:15:14 +00:00
Ilya Gorbunov 906a351a81 Regenerate standard library generated code 2022-01-17 15:38:27 +03:00
Alexander Shabalin c15b1ec001 [K/N] Remove certain pthread functions from runnable allow list
^KT-50713

Merge-request: KT-MR-5417
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-14 12:20:30 +00:00
Pavel Kunyavskiy 2ba0a7b40f [K/N] Implement Platform.availableProcessors
^KT-48179
2022-01-13 12:43:03 +00:00
Alexander Shabalin d8f99d8974 [K/N] Avoid global dtors in suspension and logging
^KT-50713

Merge-request: KT-MR-5426
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-12 13:28:43 +00:00
Alexander Shabalin 65fdfffeb4 [K/N] Make GC.collect wait for finalizers being run
^KT-50713

Merge-request: KT-MR-5404
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-11 11:39:22 +00:00
Igor Yakovlev e58d4163ad [WASM] Add std methods for collections 2022-01-05 13:12:32 +01:00
Pavel Punegov cffdb2c3aa [K/N][test] Disable tail calls optimization for stack trace tests
Without disable_tail_calls attribute Clang optimizes these methods on
macos_aarch64 replacing invocation (BL) with simple branch (B) that
makes stacktrace have no test methods.
2021-12-30 17:29:19 +00:00
Alexander Shabalin 3fe05233e2 [K/N] Fix set_terminate usage in ExceptionsTest.cpp
Merge-request: KT-MR-5376
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2021-12-29 12:58:35 +00:00
Alexander Shabalin a6b5339980 [K/N] Fix a race in ThreadWithContextTest
Merge-request: KT-MR-5349
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2021-12-24 18:49:26 +00:00
Alexander Shabalin 5de0f78350 [K/N] Extract SingleThreadExecutor.
^KT-48537

Merge-request: KT-MR-5338
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2021-12-24 11:04:45 +00:00
Ilya Matveev 2f32214106 [K/N][Runtime] Fix deadlock in file initialization
Issue #KT-50491 Fixed
2021-12-23 13:21:01 +00:00
Pavel Punegov d13f6744a6 [Native] Improve skipped and filed tests reporting in GTestLogger
List skipped tests appropriately like the GTest does
2021-12-22 10:11:36 +00:00
Alexander Shabalin 43b8683b9c [K/N] Separate MM from GC implementations
^KT-50291

Merge-request: KT-MR-5191
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2021-12-21 08:33:51 +00:00
Svyatoslav Scherbina 2bd53e3dea Native, old MM: fix releasing foreign refs to circular frozen graphs
^KT-49497
2021-12-20 14:56:38 +00:00
Alexander Shabalin cc8f278948 [K/N] Add a separate aggressive GC scheduler
^KT-48537

Merge-request: KT-MR-5253
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2021-12-20 11:04:46 +00:00
Alexander Shabalin 8863d48595 [K/N] Simplify safepoint slowpath in CMS
^KT-50291

Merge-request: KT-MR-5263
2021-12-15 19:34:16 +00:00
Alexander Shabalin 7eb0798d64 [K/N] Fix SafePointSlowPath in STMS
^KT-48537

Merge-request: KT-MR-5257
2021-12-15 07:54:07 +00:00
Pavel Kunyavskiy 3a8b4059c9 [K/N] Disable cms for targets not supporting threads 2021-12-13 05:32:11 +00:00
Pavel Kunyavskiy 42aaa86f10 [K/N] Mark finalizing extra objects to avoid double finalizing
When new mark phase finished before previous finalization is done,
extra objects are still in list, which would be passed to finalize.
This could lead to unpredictable effects.

After this commit such objects are marked by new flag and ignored by
next gc runs.
2021-12-13 05:32:11 +00:00
Pavel Kunyavskiy ebca4d793f [K/N] Implement non-blocking approach for sweep 2021-12-13 05:32:10 +00:00
Pavel Kunyavskiy df4b367296 [K/N] Add cms related targets and compiler option 2021-12-13 05:32:10 +00:00
Pavel Kunyavskiy 03299023f1 [K/N] Copy stms GC to start cms development 2021-12-13 05:32:09 +00:00
Pavel Kunyavskiy dd2849b7e7 [K/N] Extract collecting root set to utils 2021-12-13 05:32:09 +00:00
Pavel Kunyavskiy 7373183e6f [K/N] Rework scheduler type choosing 2021-12-13 05:32:08 +00:00
Pavel Kunyavskiy b22dec062c [K/N] Optimize finalizing of simple extra objects
There is no need to delay ExtraObject deletion when it doesn't have
associated object. We can just remove it while iterating on them.
2021-12-13 05:32:08 +00:00
Elena Lepilkina 611c402e59 [K/N] Fix building mimalloc with TSAN 2021-12-09 13:25:33 +00:00
Pavel Kunyavskiy 3442631d42 [K/N] Custom bitcode optimization pass to avoid multiple loads of TLS
^KT-50075
2021-12-09 08:06:53 +00:00
Ilya Matveev ff6889ea05 [K/N][build] Drop srcRoot from CompileToBitcode 2021-12-09 07:19:37 +00:00
Igor Yakovlev d55e16a030 [WASM] Regex std implementation 2021-12-07 21:33:31 +03:00
Alexander Shabalin c57df1ac40 [K/N] Track stats in Mark
Tracking alive heap set size after Mark GC phase.

Merge-request: KT-MR-5179
^KT-48537
2021-12-06 14:51:01 +00:00
Elena Lepilkina 219d9707ec [K/N][stdlib] Fix cases with existing pattern before matched with dot quantifier interval in regular expressions implementation(^KT-49967 Fixed) 2021-12-06 09:23:19 +00:00
Alexander Shabalin 4fd61ad1b0 [K/N] Change AtomicReference for the new MM ^KT-50026
Make AtomicReference behave like FreezableAtomicReference with the new MM: not frozen by default, don't require freezing value unless the ref itself is frozen. The behaviour with the old MM is unchanged.

Merge-request: KT-MR-5155
2021-12-03 17:08:21 +00:00
Pavel Kunyavskiy 9b366af38b [K/N] Fix String.compareTo on unicode strings
^KT-49873
2021-12-01 07:51:27 +00:00
Svyatoslav Scherbina 24e7a11abc Native: fix losing Worker.executeAfter jobs on scheduled time clash
The implementation was keeping delayed jobs in std::set sorted
only by the scheduled execution time (in microseconds since epoch).
So two jobs submitted to a worker and having the same scheduled time
were considered equivalent by the set, and one of them got lost.

Fix this by using std::multiset instead of std::set.
2021-11-26 11:59:40 +00:00
Pavel Punegov 666ecf4bfb [Native][build] Set properties for Konan plugin 2021-11-26 10:13:05 +00:00
Pavel Punegov 0249b7ed74 [K/N] Stdlib: warnings as errors
Fix or suppress warnings in Native stdlib.
2021-11-25 08:08:38 +00:00
Ilya Matveev ae128348ac [K/N][runtime] Provide API for stack-allocated stacktraces 2021-11-25 06:56:34 +00:00
Svyatoslav Scherbina 5020d5f2f9 Native: make SymbolName internal
See ^KT-46649
2021-11-23 08:09:44 +00:00
Svyatoslav Scherbina d70eacb1b2 Native: remove the opt-in for SymbolName from stdlib
This annotation is no longer used there.
2021-11-23 08:09:43 +00:00
Pavel Punegov c5a02902a7 [K/N][build] Add artifacts depending on input in library task
Depending on noPack option compiler produces file or directory.
Artifact field that contains .klib file can't use @OutputDirectory
annotation. The same applies for @OutputFile with directory.
To workaround make an artifact field internal and use two optional
fields that return either file or directory depending on noPack option.
2021-11-19 11:29:53 +00:00
Pavel Punegov e3ac2b661a [K/N][build] Remove artifact overriding in library task
Depending on noPack option compiler produces file or directory.
Artifact field that contains .klib file can't use @OutputDirectory
annotation. The same applies for @OutputFile with directory.
2021-11-19 11:29:53 +00:00