Commit Graph

303 Commits

Author SHA1 Message Date
Pavel Kunyavskiy 4fa5be3e58 [K/N] Patch libbacktrace to support finding dsyms for framework 2021-09-20 11:28:08 +00:00
Pavel Kunyavskiy 8a6b997559 [K/N] Patch libbacktrace to work in ios simulator. 2021-09-20 11:28:07 +00:00
Pavel Kunyavskiy 45317ca221 [K/N] Patch libbacktrace for columns support 2021-09-20 11:28:07 +00:00
Pavel Kunyavskiy 91dd9dc9b0 [K/N] Add libbacktrace 2021-09-20 11:28:06 +00:00
Pavel Kunyavskiy a5f3b087a4 [K/N] Change getSourceInfo signature to allow returning several frames 2021-09-20 11:28:06 +00:00
Ilya Matveev 35ff131608 fixup! fixup! [K/N][New MM] Disallow getting thread data for detached threads 2021-09-20 07:28:58 +00:00
Ilya Matveev 474b2fc90e [K/N][New MM] Fix getting current thread data in thread suspension 2021-09-20 07:28:57 +00:00
Ilya Matveev bfc4ff6343 [K/N][New MM] Disallow getting thread data for detached threads
This patch fixes a performance degradation introduced by
99bd26c2ef (Switch thread states
in termination handlers).
2021-09-20 07:28:57 +00:00
Abduqodiri Qurbonzoda 718965227e Advance deprecation level of K/N StringBuilder renamed functions to ERROR #KT-46101 2021-09-16 19:45:04 +03:00
Abduqodiri Qurbonzoda d9f8ce899a Promote rotateLeft and rotateRight to stable 2021-09-16 19:27:21 +03:00
Abduqodiri Qurbonzoda 34a50e4e34 Promote regex splitToSequence to stable 2021-09-16 19:26:33 +03:00
Abduqodiri Qurbonzoda f1befc0108 Format Other_Uppercase/Other_Lowercase property as an identifier in docs 2021-09-15 17:31:52 +03:00
Svyatoslav Scherbina 8c923f6504 Native: optimize autorelease in ObjCExport calls to Kotlin
Use objc_autoreleaseReturnValue to eliminate the autorelease operation
for return value if the caller is optimized (usually it is).

This required moving autorelease operation from Kotlin -> ObjC ref
conversion to bridge epilogue.

To achieve this, also make ObjCExport Kotlin ref -> ObjC ref dynamic
converters return retained reference (instead of autoreleased one).
To reflect this, rename the corresponding entities in the code.
2021-09-15 11:48:16 +00:00
Svyatoslav Scherbina be1acc8103 Native: eliminate autorelease in ObjCExport set/getAssociatedTypeInfo 2021-09-15 11:48:14 +00:00
Alexander Shabalin d03a7993ed [K/N] Implement GCScheduler 2021-09-14 13:53:36 +00:00
Pavel Kunyavskiy 91c6ee1ebb [K/N] Replace SymbolName with GCUnsafeCall in stdlib 2021-09-10 07:46:39 +00:00
Mikhail Glukhikh ffbd574a08 Use -opt-in instead of -Xopt-in in comments and scripts 2021-09-08 23:43:55 +03:00
Elena Lepilkina e89ae81f87 [K/N] Updated mimalloc version in README 2021-09-08 13:53:19 +00:00
Elena Lepilkina 084268573c [K/N] Added some other functions in list with safe functions for state checker 2021-09-08 13:53:18 +00:00
Elena Lepilkina 8ff960fbe3 [K/N] Updated mimalloc to version 1.7.2 2021-09-08 13:53:17 +00:00
Elena Lepilkina e454c824d5 [K/N] Enable mimalloc support on Windows and Mac Arm64 2021-09-08 13:53:17 +00:00
Abduqodiri Qurbonzoda 97eb28144f Introduce Common readln() and readlnOrNull() top-level functions #KT-48456 2021-09-05 15:31:11 +00:00
Abduqodiri Qurbonzoda 94b371af5b Remove brittle ‘contains’ optimization in minus/removeAll/retainAll #KT-45438 2021-09-02 05:58:19 +03:00
Pavel Kunyavskiy 98e4d67900 [K/N] Add opt-in flag to use debug info from native libs
Unfortunately, llvm removes full debug info from module on any error.
Different version debug info in bitcode is not always compatible, also
it adds this debug info additional requirements on generated debug info.

So this feature is quite unstable and shouldn't be enabled by default,
although it has almost no downsides when worked correctly.
2021-09-01 08:35:21 +00:00
Sergey Bogolepov 4b5a7c6646 [K/N] Add binary option to disable freezing
We don't want to deprecate freezing at all, but it is possible
that freezing, new memory model and lazy global initialization
combination might not work in some cases. It might be a problem
when such case appears in 3rd-party library that user can't fix.

To mitigate this problem this commit introduces `freezing` binary
option. It has three variants:
* Full - ol' good behavior.
* Disabled - well, no freezing at all.
* ExplicitOnly - a compromise when user want to freeze something
themselves, but something is messed up during globals initialization.
2021-08-30 12:33:03 +00:00
Igor Chevdar e6be5e4266 [K/N][codegen][runtime] Removed remnants of main thread init logic 2021-08-27 18:22:51 +05:00
Ilya Matveev d32b42c538 [K/N][New MM] Add runtime asserts to state switch functions 2021-08-26 14:46:08 +00:00
Ilya Matveev 99bd26c2ef [K/N][Runtime] Switch thread states in termination handlers 2021-08-26 14:46:07 +00:00
Ilya Matveev a1f6c70355 [K/N][Runtime] Use the objc module in the unit tests
Calling initRuntime requires some machinery from the
objc module (e.g. adding the toKotlin method to NSObject).

Include this module to the tests to allow full runtime
initialization in the tests
2021-08-26 14:46:06 +00:00
Ilya Matveev e85761bc47 [K/N][Runtime] Support nice mocks for scoped mock functions 2021-08-26 14:46:06 +00:00
Alexander Shabalin a279b2230f [K/N] Logging for runtime 2021-08-25 08:04:01 +00:00
Pavel Kunyavskiy 523e9495fc [K/N] Optimize safepoint implementation 2021-08-20 07:01:06 +00:00
Pavel Kunyavskiy d88a665fa8 [K/N] Implement Lazy for new mm 2021-08-13 13:20:59 +00:00
Pavel Kunyavskiy 7bddc2a815 [K/N] Add new exception for CallsChecker 2021-08-13 13:12:21 +00:00
Pavel Punegov d7f5015faa [Native] wasm: use JS pow method
Replace usage of C pow() function with JS to fix the issue
with stack overflow caused by invocation of missing pow function
2021-08-11 13:56:47 +00:00
Alexander Shabalin 7e04bb4bf1 [K/N] Refactor unhandled exception handling API
* Do not reset unhandled exception hook
* Add processUnhandledException to perform default unhandled exception
  processing
* Add terminateWithUnhandledException to report the unhandled exception
  and terminate the program
* Use the default unhandled exception processing in entrypoint, interop
  boundaries and in Worker.executeAfter
* Add -Xworker-exception-handling to control exception processing of
  Worker.executeAfter. By default its the old behaviour with the old MM,
  and new behaviour with the new MM.
2021-08-10 08:22:55 +00:00
Abduqodiri Qurbonzoda d7b10f31b4 Add Regex splitToSequence samples 2021-08-05 10:32:32 +00:00
Sergey Bogolepov 8803a69c9d [K/N] Add ARM Neon intrinsic to CallsChecker whitelist 2021-08-03 05:42:07 +00:00
Sergey Bogolepov 601465fa81 [K/N] Change how common polyhash function are included
Recent versions of LLVM complain when caller and callee have
different vector attributes: https://reviews.llvm.org/D82562.

To mitigate this problem this commit changes how we include
polyHashUnroll* and polyHashTail into Traits: we duplicate them
inside each trait with correct attributes by using
```
#pragma clang attribute push(ATTRIBUTE, apply_to = function)
```
This solution is not pretty for sure, but Clang is not complaining
anymore.
2021-08-03 05:42:02 +00:00
Alexander Shabalin 4c3fb8697b Add FormatToSpan 2021-08-02 16:07:50 +00:00
Igor Chevdar da4113af88 [K/N][runtime] Lazy initialization fix for wasm 2021-08-02 19:20:33 +05:00
Igor Chevdar b11201be81 [K/N][IR][runtime] Implemented lazy per-file initialization strategy 2021-07-31 01:39:59 +05:00
Ilya Matveev e45b13d582 [K/N][New MM] Check if asserts are enabled in thread state asserts 2021-07-30 10:30:50 +00:00
Alexander Shabalin d9483ccb08 Enable stacktraces for RuntimeAssert, TODO 2021-07-30 08:22:32 +00:00
Ilya Matveev 3e823d62a9 [K/N][kotlin.test] Make GeneratedSuites public
Issue #KT-47915 fixed
2021-07-29 08:44:32 +00:00
Alexander Shabalin 48a2b23b3a Add a separate compiler switch for runtime asserts 2021-07-28 07:43:08 +00:00
Pavel Kunyavskiy be0a0a7784 [K/N] Support escape analysis with new mm 2021-07-27 08:22:02 +00:00
Alexander Shabalin a24eab9745 Fix STMS tests 2021-07-26 15:09:59 +00:00
Sergey Bogolepov ed44497a9b [K/N] Prepare CallsChecker for LLVM 11.1.0
LLVM 11.1.0 adds a bit more "good" external functions and intrinsics.
2021-07-23 04:52:16 +00:00
Abduqodiri Qurbonzoda b65c477e68 Regex.splitToSequence, CharSequence.splitToSequence(Regex) #KT-23351 2021-07-20 14:09:24 +00:00