Commit Graph

1093 Commits

Author SHA1 Message Date
Mikhail Glukhikh a22d7aea25 Native: don't set allWarningsAsErrors = true in K2 mode
Related to KT-54123
2022-09-29 15:32:01 +00:00
Mikhail Glukhikh e6804d2601 Native: drop duplicated function and object from IrUtils2.kt
Related to KT-54123
2022-09-29 15:32:00 +00:00
Igor Chevdar e7b5e74f78 [K/N][lower] Fixed bug with phases for metadata klibs 2022-09-28 15:41:56 +00:00
Igor Chevdar eb1f81b404 [K/N][IR] Moved tests dumping to the lowering 2022-09-27 17:06:49 +00:00
Igor Chevdar 1963860a92 [K/N][caches] Removed old slow and hacky version of per-file caches building 2022-09-27 17:06:48 +00:00
Igor Chevdar 9250de42a5 [K/N][IR][codegen] Introduced NativeGenerationState 2022-09-27 17:06:48 +00:00
Igor Chevdar 77f24a22dd [K/N][IR][codegen][caches] Speed-up of per-file caches 2022-09-27 17:06:48 +00:00
Igor Chevdar aba8d8a859 [K/N][caches] Aligned caches layout for per-module and per-file cases 2022-09-27 17:06:47 +00:00
Igor Chevdar b92580937a [K/N][codegen] Slightly refactored invocation of CAdapterGenerator 2022-09-27 17:06:47 +00:00
Yahor Berdnikau c198d4d90d Simplify cache-redirector script apply method
Now it could be only be applied inside settings file pluginManagement
block. This will update both settings repositories and all projects in
the repo with cache redirection settings.
2022-09-27 14:04:43 +00:00
Alexander Shabalin f009d9b633 [K/N] Manually compact mimalloc heap ^KT-53182
Merge-request: KT-MR-7111
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-23 15:07:16 +00:00
Svyatoslav Scherbina 38f2b20e1a Native: add more tests for Swift Set and Dictionary used in Kotlin 2022-09-22 07:37:44 +00:00
Svyatoslav Scherbina 39c73e25a4 Native: improve thread state switches for NSSet/NSDictionary adapters
^KT-54119
2022-09-22 07:37:44 +00:00
Dmitriy Dolovov e4556ecc0d [IR] User-friendly message about unexpected unlinked symbols
^KT-53649
2022-09-13 17:12:13 +00:00
Vladimir Sukharev 046f0ad95d Adjust test kt53119_append_generated.kt to changes in KT-53864
Merge-request: KT-MR-7080
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-09 14:42:11 +00:00
Igor Chevdar 1e6f7f6d58 [K/N] Fixed problem with non-empty output directory 2022-09-09 12:23:05 +00:00
Rick Clephas b406722e20 [K/N] Prohibit empty ObjCNames 2022-09-09 12:31:36 +02:00
Pavel Kunyavskiy 2a36c08e1f [K/N] Fix nan tests on mips 2022-09-08 12:13:43 +00:00
Igor Chevdar d8fb9560d1 [K/N] Used compiler_interface.bc instead of runtime.bc 2022-09-08 07:56:15 +03:00
Igor Chevdar b8bf82114b [K/N][codegen] Refactored getting types from runtime 2022-09-06 14:03:41 +00:00
Pavel Punegov 7a7954b1e2 [K/N][samples] Exclude curl sample on Windows
Due to the linkage error caused by passing whole
mingw lib directory with -L
2022-09-06 08:05:36 +00:00
Pavel Kunyavskiy d822d3e7c6 [K/N] Reenable constant inlining except for Double nan constants
^KT-52970
2022-09-05 06:06:44 +00:00
Svyatoslav Scherbina f8462f1b0c Native: allow virtual calls in CoroutineLaunchpad intrinsic
This intrinsic was always calling the supplied suspend function
non-virtually, and this was hardcoded in the intrinsic generator.
Now this can be configured with `superQualifierSymbol` in the respective
IrCall, just the way this works with any other calls.

As a side effect, global optimizations now process this intrinsic more
correctly (before that, they didn't take the intrinsic generator into
account, and treated the call as virtual).
2022-09-01 09:35:23 +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
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
Vladimir Sukharev 77ab69240e Do inline safepoints for watchos_arm64
Merge-request: KT-MR-6993
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-01 08:14:41 +00:00
Svyatoslav Scherbina 7bf6d64cfb Native: move samples to backend.native/tests/ 2022-08-31 16:10:04 +00:00
Artem Kobzar 8b826a865b [K/JS, K/WASM] feat(Enum.entries): add support of new enum static field for JS and WASM. 2022-08-29 16:04:12 +00:00
Vladimir Sukharev 99fe242b38 Disable failed test on linux_mips32
^KT-48949 Turn off failed test

Merge-request: KT-MR-6935
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-25 13:11:56 +00:00
Pavel Kunyavskiy 895a8ff149 [K/N] Basic support of Enum.entries for Native
No forward compatibility yet, with old klib IR linker will fail.

^KT-53324
2022-08-25 12:40:30 +00:00
Pavel Kunyavskiy c279facc28 [K/N] More localized debug info rejection is supported
Sometimes plugins generate code with UNDEFINED_OFFSET debug info.
Probably, we can't control it, and just need to deal with it.

^KT-53667
2022-08-24 10:27:08 +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
Svyatoslav Scherbina 860f99482a Native: prohibit calling suspend functions from autoreleasepool {}
If a suspend function is called from `autoreleasepool {}` block, this
might cause the autoreleasepool frame to be removed earlier than
expected. See https://youtrack.jetbrains.com/issue/KT-50786 for more
details.

^KT-50786 Fixed
2022-08-23 14:30:54 +00:00
Rick Clephas 6ae517a2df [Native] Add HiddenFromObjC and ShouldRefineInSwift annotations 2022-08-22 16:10:44 +02:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 6eb3f1ac05 Refactor: Inline kotlinReflectModule
Review: https://jetbrains.team/p/kt/reviews/6753

In the next commits, source dependency on kotlin-reflect will be
replaced with binary dependency. Thus, it won't be technically be a a
"module" anynmore. So I either have to rename "kotlinReflectModule" or
get rid of it. I decided to get rid of it (inline it) because there is
only one usage.
2022-08-22 15:42:56 +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
Igor Chevdar 0f9ae605d0 [K/N][codegen] Fixed bug with stack allocated strings
#KT-53667 Fixed
2022-08-22 06:05:53 +00:00
Igor Chevdar 16eaba8f68 [K/N][tests] Added a test on stack allocated string 2022-08-22 06:05:53 +00:00
Igor Chevdar d3eedd791e [K/N][IR] Turned off prerequisite for ReturnsInsertionsPhase
Sometimes we have 0 files in the module and CompilerPhase thinks no work has been done
causing the prerequisite requirement to fail
2022-08-19 16:19:53 +03:00
Igor Chevdar 3462d4e5e8 [K/N][IR] Made caches ABI lowerings per file 2022-08-19 10:33:22 +00:00
Igor Chevdar 85379159be [K/N][IR] Reworked caches ABI lowering 2022-08-19 10:33:21 +00:00
Igor Chevdar c1d63fa6dd [K/N][IR] Moved caches ABI lowerings to a separate file 2022-08-19 10:33:20 +00:00
Pavel Kunyavskiy 5034581788 [K/N] Fix references for inline function
Corresponding lowering creating wrappers from JS Backend was used.

Also, the lowering was changed to create local function, instead of
normal one in outer scope, as a lot of logic from local declarations
lowering should be duplicated otherwise for correct type parameters
handling.

^KT-38535
2022-08-18 13:23:10 +00:00
Abduqodiri Qurbonzoda 6c4777dcdd Fix JDK-dependent stdlib tests after advancing jvmTarget 2022-08-17 22:55:43 +03:00
Vladimir Sukharev 70db3b4c68 Count in interfaces/classes/packages when resolving name clashes with "_" suffix mangling
^KT-41904 Fixed

Merge-request: KT-MR-6862
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-17 14:23:12 +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