Commit Graph

471 Commits

Author SHA1 Message Date
Nikolay Krasko 1630386712 Move to JDK_X_Y variables 2022-09-21 22:53:19 +00:00
Ilya Gorbunov 57c9d61291 ComparableTimeMark and specialized TimeSource KT-54082
- Introduce ComparableTimeMark interface extending TimeMark,
and TimeSource.WithComparableMarks - a time source that returns such time marks.
- Implement ComparableTimeMark in ValueTimeMark and AbstractLong/DoubleTimeMark classes.
2022-09-19 19:16:40 +00:00
Alexander Shabalin 529a29ae52 [K/N] Use TargetDomainObjectContainer ^KT-53776
Merge-request: KT-MR-7110
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-17 08:40:09 +00:00
Sergey Bogolepov 5f847ac40d [K/N] Add workaround for NS_FORMAT_ARGUMENT(A)
See KT-48807 for explanation
2022-09-17 07:51:34 +03:00
Johan Bay 4b92d2e76c Add OnSuspendForGC hook to GCImpl::ThreadData
Co-authored-by: Johan Bay <jobay@google.com>

Merge-request: KOTLIN-MR-506
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2022-09-16 14:43:54 +00:00
Pavel Kunyavskiy 7293dd6d65 [K/N] Require small binaries for all watchos targets 2022-09-16 12:24:11 +00:00
Svyatoslav Scherbina 1b17dbff09 Native: compile runtime/src/cpp/math code only for wasm32 2022-09-15 09:32:32 +00:00
Alexander Shabalin e6e7feb985 [K/N] Do not check for external calls in SpinLock<Ignore>
Merge-request: KT-MR-7099
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-13 13:37:12 +00:00
Abduqodiri Qurbonzoda 73a65c1bb1 Promote top-level kotlin.math.cbrt() to stable #KT-53277 2022-09-08 12:00:58 +00:00
Igor Chevdar 44010a04b1 [K/N][runtime] Extracted compiler interface from native runtime 2022-09-06 14:03:41 +00:00
Svyatoslav Scherbina 728fe918fe Native: don't expect that startCoroutineUninterceptedOrReturn receiver is FunctionN+1
Previous implementation of startCoroutineUninterceptedOrReturn expected
that the receiver (i.e. the suspend function object to start) of type
SuspendFunctionN (i.e. suspend function type with arity = N) is also an
instance of FunctionN+1 (i.e. regular function type with arity = N + 1)
with proper convention.

While compiler tries to achieve that (for better compatibility with
Kotlin/JVM, by generating additional supertypes and methods for classes
implementing suspend function types), this doesn't work e.g. for
implementations defined in Swift.

Fix this by adding fallbacks for cases when the receiver is not
a FunctionN+1, while keeping the fastpath for default FunctionN+1
cases.

^KT-51043 Fixed
2022-09-01 09:35:22 +00:00
Svyatoslav Scherbina 15fe2c2c5c Native: remove code duplication in coroutine intrinsics implementation
Make `createCoroutineUnintercepted` invoke
`startCoroutineUninterceptedOrReturn` when suspend function object is
not a `BaseContinuationImpl` (e.g. for a custom suspend function type
subclass), instead of using the copy of its implementation.
2022-09-01 09:35:22 +00:00
Johan Bay f71931d04b [K/N] Parallelize marking in CMS GC
This change parallelizes marking by making each non-native Kotlin thread
mark its own view of the heap. To make this safe, we make flipping the
marking bit atomic which ensures that threads do not try to trace the
same objects.

Co-authored-by: Johan Bay <jobay@google.com>

Merge-request: KOTLIN-MR-423
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2022-09-01 09:07:54 +00:00
Alexander Shabalin 0734456a87 [K/N] Enable extra option for mimalloc ^KT-53182
Merge-request: KT-MR-6952
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-01 09:02:23 +00:00
Sergey Bogolepov f946496979 [K/N] Deprecate obsolete GC handles. 2022-08-26 14:35:08 +00:00
Sergey Bogolepov 8010203ee5 [K/N] Update Throwable.kt documentation for the new MM 2022-08-26 14:35:08 +00:00
Sergey Bogolepov aaf24c897f [K/N] Update ObjectTransfer.kt documentation for the new MM 2022-08-26 14:35:08 +00:00
Sergey Bogolepov 122f3033f2 [K/N] Update Atomics.kt documentation for the new MM 2022-08-26 14:35:07 +00:00
Sergey Bogolepov 5d11e0d408 [K/N] Update Worker.kt documentation for the new MM 2022-08-26 14:35:06 +00:00
Sergey Bogolepov 2e22a5bd41 [K/N] Update annotations documentation for the new MM 2022-08-26 14:35:05 +00:00
Sergey Bogolepov abed99bdb7 [K/N] Update GC.kt documentation 2022-08-26 14:35:04 +00:00
Ilya Gorbunov 203a00151d rangeUntil member operator in builtins #KT-52933 2022-08-24 22:22:53 +00:00
Vladimir Sukharev 7f1ab29668 Fix Windows targets has bad addresses in stacktrace
^KT-49240 Fixed

Merge-request: KT-MR-6883
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-24 09:05:06 +00:00
Alexander Shabalin 58569f2eee Fix pthread to number converstion ^KT-52429
Merge-request: KT-MR-6918
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-08-23 16:36:24 +00:00
Rick Clephas 6ae517a2df [Native] Add HiddenFromObjC and ShouldRefineInSwift annotations 2022-08-22 16:10:44 +02:00
Alexander Shabalin 6f844f15e0 [K/N] Worker API improvements ^KT-52429
Merge-request: KT-MR-6898
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-08-22 10:41:14 +00:00
Vladimir Sukharev 6f945aa2fc [KT-42830][Reverse C Interop] Add API to get value of boxed primitives
Merge-request: KT-MR-6836
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-17 13:24:27 +00:00
Pavel Kunyavskiy de1dd47ab1 [K/N] Rework defines passing to runtime compilation 2022-08-17 08:32:47 +00:00
Pavel Kunyavskiy a082aeb29e [K/N] Make atomic ordering weaker for less performance harm 2022-08-10 08:36:08 +00:00
Pavel Kunyavskiy 18cda8844d [K/N] Fix possible data races found by thread sanitizer 2022-08-10 08:36:07 +00:00
Svyatoslav Scherbina ad1b10cdb0 Native: switch to "Native" thread state for some Obj-C runtime calls
A lot of calls to Objective-C runtime are potentially blocking. This
commit adds a number of thread state switches to ensure these Obj-C
runtime calls happen in "Native" thread state.

Also, remove a bunch of such functions from CallsChecker exclude list.
2022-08-02 09:24:02 +00:00
Svyatoslav Scherbina 2e8c25aeff Native: rewrite Kotlin_Interop_getObjCClass in Objective-C
This allows calling it in "Native" thread state.
2022-08-02 09:24:01 +00:00
Svyatoslav Scherbina dc27391cc7 Native: remove close from CallsChecker exclude list
The tests pass without it.
2022-08-02 09:24:00 +00:00
Alexander Shabalin 8a71d75ee9 [K/N] Update setUnhandledExceptionHook documentation ^KT-52908 2022-08-01 19:53:23 +00:00
Alexander Shabalin 41d6dc5914 [K/N] Allow to unset unhandled exception hook ^KT-49228 2022-08-01 19:53:21 +00:00
Alexander Shabalin 8b2f761c75 [K/N] Compile each cpp file separately.
Merge-request: KT-MR-6711
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-08-01 14:13:22 +00:00
Svyatoslav Scherbina cee0731cef [Native][tests] Keep reflection package name when renaming packages
The test engine renames packages in test files to allow group many tests
into single compilation for performance reasons.

As a result, reflection APIs return different package names. To deal
with this, the test engine uses certain heuristics to detect tests using
reflection APIs, and disables grouping (and thus package renaming) for
them.

This commit provides an alternative solution for the same problem --
now the test engine instructs the compiler to use original package names
for reflection information, by means of the introduced
`ReflectionPackageName` annotation.
2022-08-01 15:23:32 +02:00
Alexander Shabalin 29a0bbca4d [K/N] Fix ScopedThreadTest
Merge-request: KT-MR-6744
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-07-26 08:47:08 +00:00
Rick Clephas 5a5e6ad8cd [K/N] Add ObjCName annotation (#4815) 2022-07-23 18:58:06 +02:00
Igor Chevdar 652f6923b3 [K/N][runtime][codegen] Fixed a problem with synchronization
During globals initialization proper synchronization is required for ARM cpus

 #KT-53243 Fixed
2022-07-22 16:53:07 +00:00
Vladimir Sukharev d378d7d5f5 KT53119: Implement String Concatenation Type Narrowing to improve escape analysis
Merge-request: KT-MR-6661
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-07-20 16:28:33 +00:00
Pavel Kunyavskiy c7131a68ce [K/N] Support of collectReferenceFieldValues function 2022-07-19 08:40:14 +00:00
Alexander Shabalin bfe0d4108b [K/N] Modernize CompileToBitcode
Merge-request: KT-MR-6367
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-07-19 06:54:12 +00:00
Sergey Bogolepov 8ef73fe6bf [K/N] Add GetLastError to CallsChecker exclusions 2022-07-13 12:28:25 +00:00
Alexander Shabalin d47193d36f [K/N] Add tracking of application state to the GC scheduler.
Merge-request: KT-MR-6435
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-06-28 06:38:36 +00:00
Ilya Gorbunov cd9b36b4c3 Introduce OpenEndRange and make primitive ranges implement it
#KT-52932
2022-06-28 00:08:03 +00:00
Alexander Shabalin eaad75fd52 [K/N] Refactor runtime testing tasks
Merge-request: KT-MR-6360
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-06-25 09:55:27 +00:00
Johan Bay e380d7d495 [K/N] fix minor typos and outdated documentation 2022-06-24 20:27:33 +02:00
Sergey Bogolepov 26d09040a4 [K/N] Add own gettid implementation
Call-checker can't handle syscalls yet, so instead we wrap it
inside function.
2022-06-24 13:15:29 +00:00
Sergey Bogolepov 4e4b1c1d4d [K/N] Add GetCurrentThreadId to state checker exceptions
It is called from `CallInitGlobalPossiblyLock` which is executed in
the runnable state.
2022-06-24 13:15:28 +00:00