Commit Graph

764 Commits

Author SHA1 Message Date
Pavel Kunyavskiy 70ca222806 [K/N] Disable external calls checker for wasm target 2021-07-05 18:49:09 +00:00
Pavel Kunyavskiy fc75486611 [K/N] Debug tool for checking state at call points of unknown functions
After linking runtime, llvm-ir is modified to add checker function
call at all points where unknown function, which can possibly run long
is called. This function checks Native state is set, to avoid long locks
at gc.
2021-07-05 08:35:23 +00:00
Pavel Kunyavskiy 1ba04fdd21 [K/N] Introduce external calls checker compiler option 2021-07-05 08:35:23 +00:00
Pavel Kunyavskiy 271fc35082 [K/N] Minor debug info fix 2021-07-05 08:35:22 +00:00
Pavel Kunyavskiy 4c2d518cf5 [K/N] Move ClearCurrentThreadData() out of TestSupport 2021-07-05 08:35:21 +00:00
Pavel Kunyavskiy 65bebd3058 [K/N] Support AddressToSymbol using dladdr, if availible 2021-07-05 08:35:20 +00:00
Pavel Kunyavskiy b7707d8755 [K/N] Introduce api for getting existing global by name from StaticData 2021-07-05 08:35:20 +00:00
Pavel Kunyavskiy 1db2903e4f [K/N] Add utilities to check if thread is registered now 2021-07-05 08:35:19 +00:00
Ilya Matveev dc8186cb83 [K/N][Interop] Fix throwing exceptions through bridges in opt mode
By default, C functions compiled to bitcode by clang have the
nounwind attribute. If such functions throws an exception, the
behaviour is undefined.

Our interop machinery can process foreign exceptions on call sites
(terminate or wrap them in Kotlin exceptions). But if the interop
bridges have the nounwind attribute, LLVM optimizations (particularly
inlining) may lead to the situation when a foreign exception is ignored by
our foreign exception handler.

This patch fixes the issue by compiling bridges with -fexceptions flag.
This flag makes clang to not set the nounwind attribute, so exceptions
can be thrown through C frames.
2021-07-02 11:51:06 +00:00
Alexander Udalov 2834c22a85 IR: add BackendContext.typeSystem and JvmIrTypeSystemContext
To be able to override JVM-specific behavior of IrTypeSystemContext in
JVM IR, for things like JVM flexible types.
2021-07-01 19:35:44 +02:00
Roman Artemev b5c28c1912 [KLIB] Introduce compatible mode for klibs.
Based on library ABI version linker could decide which signature mode
to be used to guarantee backward compatibility.
2021-07-01 17:40:36 +03:00
Roman Artemev 6cdac22a23 [IR] Introduce new IdSignatures
FileSignature, CompositeSignature, LocalSignature

They are needed to make possible reference any non-local declaration via
 signature, including private signature, type parameters and so on.

- Support those new signatures in proto and klibs
- Rename `isPublic` -> `isPubliclyVisible` due to changed semantic
- Fix FIR
- clean up code
2021-07-01 17:40:31 +03:00
Roman Artemev 0856cd82d7 [IR] Rename PublicSignature -> CommonSignature 2021-07-01 17:40:28 +03:00
Svyatoslav Scherbina 2865d8bd45 Deprecate Obj-C 'alloc' and 'allocWithZone:' methods in Kotlin
Using these methods in Kotlin is usually a mistake.
2021-07-01 12:20:24 +00:00
Ilya Matveev e5aa7e1625 [K/N] Disable some tests for noop GC 2021-07-01 10:05:02 +00:00
Alexander Shabalin c286a9d8c6 Extract StackTrace from Exceptions 2021-07-01 07:23:47 +00:00
Pavel Kunyavskiy b2f0e0e0d3 Revert "Native: exclude tests that fail due to the KT-47405 and KT-47408"
This reverts commit 6ae6209031.
2021-06-30 13:47:28 +00:00
Pavel Kunyavskiy abf6ae70e2 [K/N] Add workaround options to arm64 targets 2021-06-30 13:47:28 +00:00
Alexander Shabalin 092750e215 Fix race in Lazy for the new MM 2021-06-29 06:29:57 +00:00
Alexander Shabalin 455625bcee Use FreezableAtomicReference in unhandled exception hook 2021-06-29 06:29:57 +00:00
Svyatoslav Scherbina b3980f9555 kotlin-native/samples: fix cocoapods after faulty cherry-pick 64129314
Move its source file to where it belongs.
2021-06-28 12:56:09 +00:00
Svyatoslav Scherbina eeffa49cd9 Native: don't generate .companion in ObjCExport if the companion is not exported
^KT-47462 Fixed
2021-06-28 08:19:12 +00:00
Svyatoslav Scherbina 786cb47450 Native: improve ObjCExport test for companion enum entry clash 2021-06-28 08:19:11 +00:00
Anton Bannykh 600099585d IR: refactor IdSignatureSerializer
Use a separate instance for each file.
2021-06-27 22:56:33 +03:00
Alexander Shabalin 28b6427d3e Make FreezableAtomicReference atomic when unfrozen for the new MM. 2021-06-25 21:18:37 +00:00
Elena Lepilkina 85ecbcb8f0 [K/N] Changed inlineThreshold after BCE for varargs 2021-06-24 12:57:57 +00:00
Pavel Punegov 6ae6209031 Native: exclude tests that fail due to the KT-47405 and KT-47408 2021-06-24 10:54:45 +00:00
Alexander Shabalin cc71069a3a Do not require freezing for Worker.executeAfter on experimental MM 2021-06-24 07:57:23 +00:00
Kirill Shmakov 5fdbcb3dd1 [K/N][debug] Update LLDB bundle to support Apple Silicon
This is related to KTIJ-18889
2021-06-23 15:13:05 +03:00
Vasily Levchenko 635a0fb01c [build][performance]kotlin:kotlin-build-gradle-plugin 0.0.29 -> 0.0.30 2021-06-23 09:07:29 +00:00
Svyatoslav Scherbina 04e8140162 Native: emit _Nullable_result attribute when generating Objective-C header
^KT-47042 Fixed
2021-06-22 16:12:37 +00:00
Svyatoslav Scherbina 9b49d0cf76 Native: fix testObjCExport testdata after 53baef88
(was broken during rebase)
2021-06-22 12:49:09 +03:00
Svyatoslav Scherbina 53baef8892 Add more tests for Native ObjCExport virtual adapters machinery 2021-06-22 09:29:30 +00:00
Svyatoslav Scherbina 5d5628f56e Native: apply ObjCExport virtual adapters from interfaces of supers
Previously they were skipped, and this was an incorrect optimization:
even if super class implements the interface too, this doesn't mean
that virtual adapters provided by that interface are inherited
by non-exported subclass that needs them;
for example, this doesn't happen when the super class is exported
(i.e. Obj-C class is not created at runtime).

Remove incorrect optimization instead of making it more sophisticated,
because it is useless anyway.

^KT-46431 Fixed
2021-06-22 09:29:29 +00:00
Alexander Shabalin b7fbe09ef4 Fix Experimental MM tests on mingw 2021-06-22 08:58:00 +00:00
Alexander Shabalin ebc4e10684 Fix GC stress test. 2021-06-21 16:07:57 +00:00
Alexander Shabalin 7079ad49bc Add a test on attaching new threads while collecting 2021-06-21 12:26:01 +00:00
Elena Lepilkina 7c45154fc5 [K/N] Added copy array benchmark 2021-06-21 12:23:25 +00:00
Svyatoslav Scherbina b961812efd Native: fix thread state when calling ObjC completion for Kotlin suspend 2021-06-21 09:37:25 +00:00
Svyatoslav Scherbina 2a54f1c610 Improve exception messages for kotlin.native.concurrent.* operations 2021-06-18 13:51:21 +00:00
Ilya Matveev 94384ce2ca [K/N][Runtime] Add a lock method to thread registry 2021-06-18 12:20:04 +00:00
Ilya Matveev cece652412 [K/N][Runtime] Separate thread registering and making it 'Runnable'
The new GC will require threads to suspend right after registering
if Stop-The-World is requested. This patch changes the initial
thread state to kNative and adds a separate state switch right
after thread registering. This switch suspends if it is necessary.
2021-06-18 12:20:03 +00:00
Alexander Shabalin e240b8a8ee Add a separate aggressive GC mode 2021-06-18 12:03:02 +00:00
Igor Chevdar 1cfe1c41ef [K/N][IR] Fixed problem with klib compilation
Fixes https://youtrack.jetbrains.com/issue/KT-46896
2021-06-18 16:21:24 +05:00
Igor Chevdar 421ff68cd6 [K/N][codegen] Fix for https://youtrack.jetbrains.com/issue/KT-47183 2021-06-18 15:57:45 +05:00
Pavel Kunyavskiy d7a3310042 [K/N] KT-43780: support of more convenient objects using from objC/Swift 2021-06-18 08:02:22 +00:00
Pavel Kunyavskiy 0952a95949 [K/N] reuse common code for companionObject util 2021-06-18 08:02:21 +00:00
Alexander Shabalin 91a852d3fd Fix integer conversion on 32-bit 2021-06-17 14:16:16 +00:00
Sergey Bogolepov 4f98a0e083 [Native] Introduce optInCacheableTargets
Create an explicit list of targets that have unstable compiler caches
in konan.properties. It allows to control all lists of cacheable targets
in a single place.
2021-06-17 09:19:44 +00:00
Alexander Shabalin e3eec33b24 Add aggressively allocating stress test for GC 2021-06-16 21:34:05 +00:00