Commit Graph

41 Commits

Author SHA1 Message Date
Alexander Shabalin 49814ecb8a [K/N] Remove std_support allocation code ^KT-59008 2023-09-07 09:32:00 +00:00
Alexander Shabalin 958d613911 [K/N] Remove code for deprecated targets from runtime ^KT-59008 2023-09-01 10:48:07 +00:00
Alexander Shabalin 1fa0ef6f56 [K/N] Refactor allocator modules ^KT-60928
- Move std_alloc, opt_alloc and custom_alloc into alloc/std,
  alloc/mimalloc and alloc/custom to mirror convention of gc,
  gcScheduler modules.
- Add alloc/common with common allocator API
- Add alloc/legacy with common implementation details of alloc/std and
  alloc/mimalloc. alloc/custom does not depend on alloc/legacy.
- Removes experimental_memory_manager_custom as it's now unused
- Additionally, renames experimental_memory_manager module into mm
2023-08-30 17:07:21 +00:00
Alexander Shabalin 82f94015f1 [K/N] Dispose ObjC objects from main thread on main thread. ^KT-56402
Merge-request: KT-MR-9515
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2023-04-26 07:35:44 +00:00
Pavel Kunyavskiy dc2e072af2 [K/N] Make exception handling in initializers more consistent with jvm
^KT-57091
2023-03-14 12:59:14 +00:00
Igor Chevdar 44010a04b1 [K/N][runtime] Extracted compiler interface from native runtime 2022-09-06 14:03:41 +00:00
Pavel Kunyavskiy 18cda8844d [K/N] Fix possible data races found by thread sanitizer 2022-08-10 08:36:07 +00:00
Igor Chevdar 652f6923b3 [K/N][runtime][codegen] Fixed a problem with synchronization
During globals initialization proper synchronization is required for ARM cpus

 #KT-53243 Fixed
2022-07-22 16:53:07 +00:00
Alexander Shabalin 89afa4c5b5 [K/N] Use mimalloc for kotlin objects only ^KT-52130
Merge-request: KT-MR-5805
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-05-12 08:48:37 +00:00
Alexander Shabalin 4a66cd0c69 [K/N] Remove usage of legacy allocation stuff ^KT-52130
Merge-request: KT-MR-6182
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-04-29 10:12:44 +00:00
Pavel Kunyavskiy 3798920183 [K/N] Any.isFrozen is now always false when freezing is disabled 2022-01-24 13:38:30 +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
Pavel Kunyavskiy 2ba0a7b40f [K/N] Implement Platform.availableProcessors
^KT-48179
2022-01-13 12:43:03 +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
Ilya Matveev 2f32214106 [K/N][Runtime] Fix deadlock in file initialization
Issue #KT-50491 Fixed
2021-12-23 13:21:01 +00:00
Igor Chevdar e6be5e4266 [K/N][codegen][runtime] Removed remnants of main thread init logic 2021-08-27 18:22:51 +05: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
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
Alexander Shabalin 48a2b23b3a Add a separate compiler switch for runtime asserts 2021-07-28 07:43:08 +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
Svyatoslav Scherbina fa36ccedeb Native: improve ObjCExport thread state switching 2021-06-04 16:58:26 +00:00
Alexander Shabalin 858e3584a9 Disable escape analysis with the new MM 2021-05-25 10:06:40 +00:00
Alexander Shabalin 73533e4b19 Make NoOp GC support multiple mutators 2021-05-21 06:31:09 +00:00
Alexander Shabalin eac3f507b6 Make Kotlin_initRuntimeIfNeeded switch to native state 2021-05-20 13:48:49 +00:00
Pavel Kunyavskiy e4ecb3745b [K/N] Debug util for checking if object is global constant 2021-05-20 08:29:22 +00:00
Ilya Matveev 4d346d3735 [K/N][New MM] Support thread state switching
Including

* Support thread state switching in codegen
* Introduce and use GCUnsafeCall annotation
* Switch thread state in C++ runtime code

Also

* Register current thread in Mark&Sweep tests
* Store MemoryState in Worker instance
* Set worker tid in WorkerInit
2021-05-06 14:10:21 +00:00
Alexander Shabalin f312315346 Call initRuntimeIfNeeded before EnterFrame in interop adapters. (#4672) 2021-02-09 09:00:47 +01:00
Alexander Shabalin 9295d7cf60 Fix single-thread check 2021-02-09 09:00:46 +01:00
Alexander Shabalin 9e99932b24 Add a check for single-thread mutator (#4665) 2021-02-01 16:54:14 +01:00
Alexander Shabalin 77e2b9f9a0 Disable running checkers by default (#4644)
* Make checkers be disabled by default

* Allow running checkers in test launcher
2021-01-26 17:38:03 +03:00
Alexander Shabalin 92f8eff958 Cleanup Stubs.cpp (#4593) 2020-12-21 16:15:11 +01:00
Alexander Shabalin c582612bd7 Restore runtimeState value in deinitRuntime (#4587) 2020-12-14 15:25:37 +01:00
Alexander Shabalin 783517dbe8 Fix unchecked runtime shutdown (#4575) 2020-12-14 15:25:37 +01:00
Alexander Shabalin 5fc17ce5fa Tweak TLS init/deinit (#4551)
* Delete the entire TLS in one go
* Put TLS allocation separately
* Keep TLS in a single array
2020-12-14 15:25:36 +01:00
Alexander Shabalin ee508efb23 Add a switch to destroy runtime only on shutdown (#4482) 2020-11-28 21:01:54 +01:00
Alexander Shabalin 91186b4145 Extract Kotlin_shutdownRuntime (#4497) 2020-11-28 20:56:41 +01:00
Alexander Shabalin 8dc5b95337 Move main thread check to legacy mm (#4483) 2020-11-28 20:48:59 +01:00
Alexander Shabalin 4297b521e4 Remove unneeded zeroing TLS (#4480) 2020-11-28 20:48:55 +01:00
Stanislav Erokhin f624800b84 Move everything under kotlin-native folder
I was forced to manually do update the following files, because otherwise
they would be ignored according .gitignore settings. Probably they
should be deleted from repo.

Interop/.idea/compiler.xml
Interop/.idea/gradle.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_runtime_1_0_3.xml
Interop/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_0_3.xml
Interop/.idea/modules.xml
Interop/.idea/modules/Indexer/Indexer.iml
Interop/.idea/modules/Runtime/Runtime.iml
Interop/.idea/modules/StubGenerator/StubGenerator.iml
backend.native/backend.native.iml
backend.native/bc.frontend/bc.frontend.iml
backend.native/cli.bc/cli.bc.iml
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt
backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2NativeCompilerArguments.kt
backend.native/tests/link/lib/foo.kt
backend.native/tests/link/lib/foo2.kt
backend.native/tests/teamcity-test.property
2020-10-27 21:00:28 +03:00