Commit Graph

1474 Commits

Author SHA1 Message Date
Sergey Bogolepov 52c8b6166c [K/N] Fix filecheck_function_attributes_at_callsite test 2022-02-14 13:38:51 +00:00
Sergey Bogolepov fbbe5cbd03 [K/N] Disable filecheck tests in some cases 2022-02-14 13:38:50 +00:00
Sergey Bogolepov b4cbe703cd [K/N] Test for KT-50970 2022-02-14 13:38:50 +00:00
Sergey Bogolepov ad793ac624 [K/N] Support cross targets in FileCheckTest
Also mark property's getter with Input and Optional annotations instead of
property itself.
2022-02-14 13:38:49 +00:00
Sergey Bogolepov 34cb79fc9f [K/N] Fix KT-50970
Force generation of ARM instruction set for iosArm32 and
watchosArm32 targets for C++ code. There is no need for such
adjustments for Kotlin code because we don't specify any target
features in IrToBitcode and compiler backend infers target features
from target architecture (which is armv7* and not thumbv7).
2022-02-14 13:38:49 +00:00
Pavel Punegov 423e5a6530 [K/N][build] Rewrite endorsed libraries build to kts 2022-02-14 15:58:39 +03:00
Pavel Punegov 361d922119 [K/N][build] Rewrite kotlinx.cli build to kts
Rewrite to kts and use konan plugin instead of simple JavaExec task.
Produce cache in the project instead of the upper one.
2022-02-14 15:58:38 +03:00
Dmitriy Dolovov f62dcf65fc [Native][tests] Fix generation of *.def file in accidentally disappeared dir 2022-02-14 13:41:00 +03:00
Dmitriy Dolovov 334dffd3e4 [Native][tests] Remove external tests from old test infra 2022-02-14 13:41:00 +03:00
Svyatoslav Scherbina 5afbbecea4 Native: rename Xcode.current to .findCurrent()
To reflect that it is a non-trivial operation with possible performance
overhead.
2022-02-14 08:52:14 +00:00
Svyatoslav Scherbina e92f7b5ec3 Native: don't cache Xcode.current between different compiler invocations
The compiler might be executed in a Gradle daemon process,
so current Xcode might actually change between different invocations.

^KT-49496 Fixed
2022-02-14 08:52:13 +00:00
Svyatoslav Scherbina 86ad804848 Native: remove support for pre-Xcode 12 libclang_rt
Kotlin/Native doesn't support Xcode versions older than 12.5 anymore,
so just remove the obsolete code.
2022-02-14 08:52:13 +00:00
Pavel Kunyavskiy b575d98272 [K/N] Eliminate frame creation in some cases 2022-02-11 13:52:07 +00:00
Svyatoslav Scherbina d8b1992fde Native: fix cinterop for Swift-produced Objective-C categories
For some reason, libclang's indexer doesn't index categories with
__attribute__((external_source_symbol(language="Swift",...))),
so we have to additionally enumerate them explicitly.

^KT-49455 Fixed
2022-02-11 12:45:39 +00:00
Svyatoslav Scherbina ad72545647 ObjCExport: deprecate exporting data class componentN methods to Obj-C
The Objective-C methods for Kotlin data class componentN methods
shouldn't have been generated in the first place -- the corresponding
Kotlin methods are required to make the destructuring work in Kotlin,
and don't help in Objective-C or Swift.

Calling them manually from Objective-C or Swift doesn't make much sense.
So now we deprecate this, in order to remove these methods from
Objective-C header completely later.

^KT-42641
^KT-49516 Fixed
2022-02-11 06:55:47 +00:00
Pavel Punegov 4f981ff745 [K/N] Use toBits() in Float and Double hashCode()
toBits() is aware of NaNs comparing to bits()
2022-02-10 16:25:18 +00:00
Sergey Bogolepov f7cc23a13b [K/N] Mention test_compile_only in HACKING.md 2022-02-10 13:38:48 +00:00
Sergey Bogolepov 072acf688e [K/N] Support compile-only mode for legacy test infra 2022-02-10 13:38:48 +00:00
Svyatoslav Scherbina 62c1bd0044 Native: fix using nested expect enum entry in a default argument
^KT-51156 Fixed
2022-02-09 14:41:11 +00:00
Svyatoslav Scherbina eb78f5e1ca Native: make xcrun failures a bit more useful again
^KT-50923
2022-02-09 12:46:19 +00:00
Svyatoslav Scherbina 76672a4abf Native: terminate if cinterop ObjC reference conversion throws exception
To avoid forwarding Obj-C exceptions to Kotlin or vice versa.
Otherwise this might lead to a crash or other undesirable behaviour.

^KT-50648 Fixed
2022-02-09 07:47:42 +00:00
Svyatoslav Scherbina d235fc4dbe Native: add thread state switches to blockToKotlinImp 2022-02-09 07:47:42 +00:00
Svyatoslav Scherbina 925e7801aa Native: improve message when Obj-C block can't be converted to Any 2022-02-09 07:47:41 +00:00
Svyatoslav Scherbina cd62b5b3b3 ObjCExport: optimize receiving autoreleased references from Obj-C/Swift
when the callee supports this.
2022-02-08 15:17:06 +00:00
Svyatoslav Scherbina 874cc6c51c Native: add LLVMSetNoTailCall to LLVM C API 2022-02-08 15:17:05 +00:00
Svyatoslav Scherbina 085e2448cd ObjCExport: don't use autorelease when sending arguments to Swift/Obj-C 2022-02-08 15:17:04 +00:00
Svyatoslav Scherbina 9326978327 ObjCExport: fix noAutorelease tests for the new MM 2022-02-08 15:17:04 +00:00
Svyatoslav Scherbina d161108be3 ObjCExport: fix noAutorelease/testReceiveBlockFromSwiftAndCall
The test expects to track block result lifetime in Swift, so we should
add it to the tracker.

Also fix the same problem for testReceiveBlockFromKotlinAndCall
(which didn't fail because we added the block itself to the tracker).
2022-02-08 15:17:04 +00:00
Igor Yakovlev 195513d4f2 [WASM] Workaround about call toTypedArray on AbstractCollection 2022-02-03 21:25:58 +01:00
Alexander Shabalin 434213f416 [K/N] Add ScopedThread
* thread that by default joins in the destructor (like C++20 jthread)
* can be given a name

Merge-request: KT-MR-5619
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-02-03 15:38:07 +00:00
Pavel Kunyavskiy 85633771da [K/N] Replace escape analysis correctness check to RuntimeAssert to avoid checks in release mode 2022-02-03 08:08:21 +00:00
Ilya Matveev 23d606b053 [K/N][tests] Support setting GC scheduler in the new infra 2022-02-03 07:30:33 +00:00
Ilya Matveev 8668797afd [K/N][tests] Do not run backed.native tests with aggressive GC 2022-02-03 07:30:33 +00:00
Igor Chevdar c0715cfb0c [K/N][IR][caches] Fixed problems with inline classes
Fixes https://youtrack.jetbrains.com/issue/KT-50978
2022-02-02 22:46:16 +05:00
Igor Chevdar 554e94a322 [K/N][IR] Never consider a enum a final class
Unfortunately, neither descriptors nor Lazy IR have enough information
to correctly deduce a enum's modality as psi2ir does, so to avoid the RTTI generator
generating different vtables in different setups (whether a klib is cached or not),
conservatively consider all enums non-final.
2022-02-02 22:46:15 +05:00
Igor Chevdar 97a28df43d [K/N][IR] Handle some corner cases for enums when building caches
Helps workaround https://youtrack.jetbrains.com/issue/KT-50977
2022-02-02 22:43:53 +05:00
Svyatoslav Scherbina 9a967952b5 ObjCExport: fix crash when KotlinBase +initialize is called before +load
This generally shouldn't happen, but sometimes it does.

^KT-50982 Fixed
2022-02-02 12:57:20 +00:00
Pavel Punegov 74cf792b41 [K/N][test] Don't rebuild platform libs in non default dist if exist 2022-02-02 10:53:07 +00:00
Ilya Matveev 6c173b2b6c [K/N] Add mmap to thread state checker exclude list 2022-02-02 05:22:59 +00:00
Ilya Matveev c35b8342d8 [K/N][Runtime] Support equality and hashcode for stacktraces 2022-02-01 10:02:50 +00:00
Igor Chevdar 9e7d8808bd [K/N][IR] Used new declaration parents checker 2022-01-28 18:21:13 +00:00
Alexander Shabalin 4c97b55adf [K/N] Simplify SingleThreadExecutor
Merge-request: KT-MR-5591
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-01-28 12:11:44 +00:00
Svyatoslav Scherbina 4cd60090e0 ObjCExport: fix replacing Kotlin class methods by Swift extensions
^KT-49937 Fixed
2022-01-28 11:15:39 +00:00
Igor Chevdar 1aea2d0437 [K/N][IR] Respect -Xlazy-ir-for-caches on caches building 2022-01-28 13:14:37 +05:00
Igor Chevdar 0cc48440e1 [K/N][IR] Properly handle enums when building caches
Helps to fix https://youtrack.jetbrains.com/issue/KT-50977 but not entirely
2022-01-28 12:35:50 +05:00
Pavel Kunyavskiy 1bc8061667 [K/N] Refactor suspension to reduce generated code size 2022-01-28 06:44:47 +00:00
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
Mikhail Glukhikh 3e00f41a99 Replace useExperimentalAnnotation with optIn in scripts 2022-01-27 11:48:20 +00:00