Commit Graph

1403 Commits

Author SHA1 Message Date
Svyatoslav Scherbina a65b278f71 Native: generate debug locations for catch parameters
^KT-50558 Fixed
2022-01-21 16:08:13 +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
Alexander Udalov 6445a29893 IR: remove type parameter in visitConst
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-01-19 17:50:35 +01:00
Alexander Udalov 81106526b1 IR: remove IrConstantObject.putArgument, IrConstantArray.putElement
Change `valueArguments` and `elements` types to be mutable lists. This
will simplify IR tree generator.
2022-01-19 17:50:35 +01:00
Pavel Punegov 816acaadc3 [K/N][samples] Properly disable HMPP for ^KT-50547
Properties file inside subproject isn't read. Moved to root
Fixup to 8d0b511e95
2022-01-19 16:10:10 +00:00
Pavel Kunyavskiy 2f853175c7 [K/N] Get rid of using base class default values for annotations
They can be not available in incremental compilation case

^KT-50211
2022-01-19 13:17:17 +00:00
Pavel Punegov 3db341213b [K/N] Synchronize LLVM target initialization
Race conditions should be avoided during initialization.
See llvm/lib/Support/TargetRegistry.cpp in LLVM repo
2022-01-19 11:18:43 +00:00
Pavel Punegov a22e267b05 [K/N] Set JDK17 as a toolchain for endorsedLibs project
Older JDKs sometimes make build fail with obscure errors
2022-01-19 11:18:14 +00:00
Pavel Punegov 8d0b511e95 [K/N][samples] Turn off hmpp and metadata due to ^KT-50547 2022-01-18 15:24:06 +00:00
Elena Lepilkina b8af589137 [K/N][perf] Added workaround to build benchmarks analyzer artifacts 2022-01-18 17:08:10 +03:00
Svyatoslav Scherbina ec3a2c9671 Native: remove cleanup landingpad if it is unused
Useful for ObjCExport, because most of its bridges don't use it.
2022-01-18 08:15:15 +00:00
Svyatoslav Scherbina 47a0bdc1bc Native: remove forwardingForeignExceptionsTerminatedWith
It is no longer used, and was generally misdesigned.
2022-01-18 08:15: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
Svyatoslav Scherbina bc2cc026db ObjCExport: use ObjCExportFunctionGenerationContext when generating code
instead of its supertype, FunctionGenerationContext.
2022-01-18 08:15:14 +00:00
Svyatoslav Scherbina e8e4a850d4 ObjCExport: remove state switching from callFromBridge
It is not required anymore.
2022-01-18 08:15:14 +00:00
Svyatoslav Scherbina 776154881b ObjCExport: prohibit Kotlin exceptions leaking through native code back
If a Kotlin exceptions is thrown out of a native code in ObjCExport
(when calling Swift/Obj-C method overriding Kotlin method, or calling
Swift/Obj-C block as Kotlin function type), treat this exception as
fatal and terminate the process.
This could happen if the Kotlin exception leaked from Kotlin to native
code before.
In other words, when calling Kotlin -> Swift/Obj-C -> Kotlin, if Kotlin
exception passes from the last to the first part, terminate.

^KT-50830
2022-01-18 08:15:13 +00:00
Svyatoslav Scherbina f7a1fa86a9 ObjCExport: introduce terminatingExceptionHandler 2022-01-18 08:15:13 +00:00
Svyatoslav Scherbina eaa6a75de4 ObjCExport: don't generate redundant exception handler for objc_release 2022-01-18 08:15:12 +00:00
Svyatoslav Scherbina cdfcffbd57 ObjCExport: make objc_release nounwind
Also replace it by an LLVM intrinsic, llvm.objc.release,
which is lowered to objc_release.

This is close to what Clang does.
2022-01-18 08:15:12 +00:00
Ilya Gorbunov 906a351a81 Regenerate standard library generated code 2022-01-17 15:38:27 +03:00
Pavel Punegov 377b6d9204 [K/N] Fix FunctionReference lowering in coercion
See fix for ^KT-50204
2022-01-17 09:33:09 +00:00
Pavel Punegov 6dac9fd2a3 [K/N][test] Improve available processors test
Pass expected number of processors as arguments. Don't check it on
linux-arm32/64 which run remotely
2022-01-17 09:32:37 +00:00
Evgeniy.Zhelenskiy e97ca2ada4 [Psi2Ir, Fir2Ir] Generate toString, hashCode, equals methods for MF VC 2022-01-14 13:51:57 +00: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
Igor Chevdar f724b5c29d [K/N][gradle][interop] Workaround for loading readonly native libs 2022-01-14 10:29:12 +05:00
Igor Chevdar 7a4ef76527 [K/N][gradle] Automatic cleaning of the class loaders map 2022-01-14 10:29:11 +05:00
Igor Chevdar bd6ea71ead [K/N][gradle][interop] Refactored ToolConfig
Added possibility to create different strategies for loading libclang
2022-01-14 10:29:10 +05:00
Igor Chevdar 650d4c78e9 [K/N][interop] A small optimization 2022-01-14 10:29:08 +05:00
Igor Chevdar 0211509795 [K/N][build] Refactored K/N tool runner 2022-01-14 10:29:07 +05:00
Igor Chevdar 8ac234fd6b [K/N][interop] Made NativeMemoryAllocator lock-free 2022-01-14 10:29:06 +05:00
Igor Chevdar 993816a400 [K/N][runtime][interop] Refactoring to run cinterop in daemon 2022-01-14 10:29:05 +05:00
Igor Chevdar 41e1fbe971 [K/N][gradle][interop] Arg to specify relative dir for libraryPath 2022-01-14 10:29:04 +05:00
Pavel Kunyavskiy 2ba0a7b40f [K/N] Implement Platform.availableProcessors
^KT-48179
2022-01-13 12:43:03 +00:00
Pavel Kunyavskiy afc548d5d9 [K/N] Fix equality on fun-interface constructor references
^KT-50204
2022-01-13 09:45:58 +00:00
Pavel Kunyavskiy 541f6b0c88 [K/N] Fix handling of legacy suspend-function superclass
^KT-50737
2022-01-12 19:42:37 +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
Dmitriy Dolovov 99300bd885 [IR] IrModuleDeserializerKind API cleanup
Related to #KT-50591
2022-01-12 11:05:12 +03:00
Dmitriy Dolovov cb5a052227 [IR] Distinguish IrModuleDeserializers with and w/o underlying KLIBs
Fixes #KT-50591
2022-01-11 21:53:06 +03:00
Svyatoslav Scherbina c2f03b4d28 Deprecate freezing in kotlin-native/NEW_MM.md 2022-01-11 12:21:55 +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
Alexander Udalov 8b57675002 Revert "Remove obsolete check for language version and IR backends"
This check is no longer obsolete since language version 1.3 support is
restored for Kotlin/JVM, but JS and Native never supported LV 1.3.

This is a partial revert of 0213c25c9b,
without the diagnostic in K2JVMCompilerArguments (which is not needed
since the earliest supported LV is 1.3).

 #KT-50695 Fixed
2022-01-10 21:15:51 +01:00
Elena Lepilkina d907c0ac4f [K/N][perf] Update npm packages versions 2022-01-10 12:36:57 +00:00
Elena Lepilkina 745c5e2b05 [K/N][perf] Update pattern for release branches 2022-01-10 12:36:57 +00:00
dkhalanskyjb ac8553cfd4 kotlin-native/NEW_MM.md: mention the new release of the coroutines 2022-01-10 13:38:01 +03: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
Martin Petrov 50250ccf65 [Native] Escape the module name in the C adapter.
This previously failed if the module name contaned dots or dashes, e.g.

```
kotlinc-native ~/test.kt -produce static -module-name="foo-bar.baz"
```

This change espaces `-` and `.` similar to `ObjCExportNamer`'s `abbreviate`.
2021-12-27 19:45:14 +03:00
Igor Chevdar af09fb51ac [K/N][IR] Made the compiler pipeline to do per file lowerings 2021-12-27 14:28:29 +05:00
Igor Chevdar d3a7aefe36 [K/N][IR] Turned off SAM super types checker
Fixes https://youtrack.jetbrains.com/issue/KT-50399
2021-12-27 08:42:30 +00:00