Commit Graph

423 Commits

Author SHA1 Message Date
Dmitriy Dolovov c2e2d3a43e [Native][tests] workers5 - remove redundant test annotations 2021-09-01 10:13:55 +03:00
Dmitriy Dolovov 51f30ed995 [Native][tests] localDelegatedPropertyLink - don't use golden data 2021-09-01 10:13:50 +03:00
Sergey Bogolepov d4c91c96d3 [K/N] Fix objc_acr_contract test in two_stage mode 2021-08-31 12:52:42 +00:00
Sergey Bogolepov 587146679d [K/N] Add tests for -Xbinary=freezing=... 2021-08-30 12:33:04 +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
Svyatoslav Scherbina 5bdfa14a37 Native: make -Xbinary=memoryModel= equivalent to -memory-model=
In particular, the former now enables lazy initialization and hook-based
worker exception handling too, as intended.
2021-08-29 07:35:32 +00:00
Igor Chevdar ce44403d1b [K/N][IR][codegen] Made lazy init logic JVM-like
Now a file will be initialized only if a top level function has been called
rather than any function like was before the commit
2021-08-27 18:22:52 +05: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 463bc22bf3 [K/N] Enable callbackOnSeparateThread test since KT-44283 is fixed 2021-08-26 14:46:07 +00:00
Ilya Matveev 99bd26c2ef [K/N][Runtime] Switch thread states in termination handlers 2021-08-26 14:46:07 +00:00
Svyatoslav Scherbina 981a6ffeb8 Native: RedundantCoercionsCleaner should rewrite nested returns too 2021-08-26 07:15:25 +00:00
Alexander Shabalin 28136d7eb0 [K/N] Fix memoryModel selection 2021-08-26 04:46:47 +00:00
Alexander Shabalin a279b2230f [K/N] Logging for runtime 2021-08-25 08:04:01 +00:00
Stanislav Erokhin 9becb2c468 Add compiler performance metrics
WIP
2021-08-24 16:33:12 +03:00
Alexander Udalov 66dbd91851 IR: minor, remove unused 'isInlined' 2021-08-24 12:28:31 +02:00
Svyatoslav Scherbina 9877a7271a Native: use binary options machinery for memory model
Old compiler flag (-memory-model) will work too.
2021-08-24 09:36:23 +00:00
Svyatoslav Scherbina ee3663afa4 Native: use binary options machinery for runtime assertions mode 2021-08-24 09:36:23 +00:00
Svyatoslav Scherbina 7cc1ea8801 Native: introduce binary options machinery 2021-08-24 09:36:22 +00:00
Svyatoslav Scherbina 7f12cda233 Native: quick fix lazy init order problem
Initialize main-thread-bound properties along with shared properties

^KT-48364 Fixed
2021-08-24 09:24:16 +00:00
Svyatoslav Scherbina ff46a63ffa Native: quick fix lazy init boxing issue
FileInitializersLowering shouldn't expect codegen to initialize field
statically if constant literal is going to be boxed

^KT-48364
2021-08-24 09:24:16 +00:00
Sergey Bogolepov 9dd8266bee [K/N] Add trivial test for llvm.objc.clang.arc.use lowering 2021-08-24 10:19:33 +03:00
Sergey Bogolepov 690d0689a1 [K/N] Add ObjCARCContract LLVM pass. 2021-08-24 10:19:31 +03:00
Sergey Bogolepov c7faf9b4df [K/N] Add -Xllvm-variant` compiler option
We need a handle that allows user to pick `dev` variant instead of
`user` one just in case.
Additionally, I added a possibility to provide a path to an arbitrary
LLVM distribution because it is useful for development purposes.
2021-08-23 10:13:36 +00:00
Alexander Shabalin a7460e9061 [K/N] Enable lazy property initialization with the new MM 2021-08-19 18:23:01 +00:00
Igor Chevdar a576160847 [K/N][IR][codegen] Lazy initialization fix for new GC
A mutable field should be registered in GC even if its initializer is a const
2021-08-19 00:50:28 +05:00
Elena Lepilkina 12d694de46 [K/N] Added returns before building DFG 2021-08-17 16:14:07 +05:00
Igor Chevdar 16f0ba8e46 [K/N][optmz] Reworked a bit work with fields 2021-08-17 16:14:07 +05:00
Pavel Punegov 7e1c776376 [Native][tests] Fix warnings in debugger tests 2021-08-17 08:42:11 +00:00
Dmitriy Dolovov af12d61388 [IR] Enhance error reporting for IR linking issues
^KT-44626

Support correct error reporting both with native static caches and without native static caches.
2021-08-17 07:53:45 +00:00
Ilmir Usmanov 486c6b3c15 Remove obsolete experimental coroutines support
in compiler.
2021-08-13 22:31:30 +02:00
Pavel Kunyavskiy d88a665fa8 [K/N] Implement Lazy for new mm 2021-08-13 13:20:59 +00:00
Pavel Punegov aef45f0997 [Native] Exclude on wasm initializers tests.
Tests use exceptions and workers that are not supported in wasm
2021-08-11 13:56:48 +00:00
Pavel Punegov cd487efbe9 [Native][test] Exclude FP parsing tests that require exceptions on WASM 2021-08-11 13:56:47 +00:00
Igor Chevdar 81ce59cf48 [K/N][IR][codegen] Implemented eager initialization
Properties marked with @EagerInitialization will be initialized at program/worker start
even in lazy initialization mode
2021-08-11 11:53:19 +05:00
Dmitriy Dolovov c1fb40a436 [IR] Enhance error reporting for IR linking issues
^KT-44626

Typical use case:
- There are two KLIB libraries: A and B.
- Library A has two versions: A.v1 (older) and A.v2 (newer).
- A.v2 is ABI-incompatible with A.v1.
- B depends on A and was compiled against A.v1.
- An attempt to build the application with A.v2 and B fails with weird error message. It's unclear for end user what's wrong and what needs to be done to fix the issue.

The fix improves error reporting for the following particular cases:
- A symbol that is gone (KT-41378)
- A class that became a typealias (KT-47285, KT-46697)
- A typealias that became a class (KT-46340)
2021-08-10 14:02:40 +03:00
Dmitriy Dolovov 672b972b38 [Native] Add '-Xexternal-dependencies' CLI parameter to pass external deps
^KT-44626
2021-08-10 14:02:35 +03: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
Ilya Matveev 6c7f04ffc6 [K/N][tests] Fix disabling stress_gc_allocations for No-op GC 2021-08-07 06:28:50 +00:00
Alexander Udalov c821aba3bd Fix warnings in native modules 2021-08-06 22:37:00 +02:00
Sergey Bogolepov d64cb24643 [K/N] Don't pass -target-cpu to clang
It is not supported by bitcode embedding on Apple platforms.
Instead, we set it in function attributes directly as Clang does.
2021-08-06 14:19:41 +00:00
Svyatoslav Scherbina a22ef02e47 Native: disable compiler caches for experimental memory model
Experimental MM doesn't support compiler caches yet.
2021-08-05 15:22:00 +00:00
Svyatoslav Scherbina 4abbac1ff1 Native: improve code that handles unsupported compiler caches 2021-08-05 15:22:00 +00:00
Dmitriy Novozhilov ca9cbf7eb7 Fix warnings in K/Native code 2021-08-03 07:40:57 +00:00
Svyatoslav Scherbina fb27459b2e Native: fix downloading dependencies when producing cache 2021-08-03 07:01:08 +00:00
Sergey Bogolepov bfc3f35d94 [K/N] Disable stress_gc_allocations for watchos_simulator_arm64 2021-08-03 05:42:07 +00:00
Sergey Bogolepov 922fcc4049 [K/N] Fix windows dynamic tests for LLD
Adjust compilation and linking flags to workaround absence of direct
DLL linkage in LLD.
2021-08-03 05:42:07 +00:00
Sergey Bogolepov c7c78e0e1a [K/N] Use LLD 12.0.1 for MinGW targets
Clang-produced and GCC-produced binaries might be ABI-incompatible on
MinGW. Explanation on GitHub: msys2/MINGW-packages/issues/6855#issuecomment-680859662.
TL;DR: GCC-generated sections are 16-byte-padded, while Clang ones are
not. It causes problems during merge of COMDAT sections.
I observed the problem during compilation of runtime tests, but it is
possible that the problem could affect main compilation pipeline as well.
https://reviews.llvm.org/D86659 (which landed in LLVM 12) fixes
the problem. So we have another motivation for switching to LLD besides
https://youtrack.jetbrains.com/issue/KT-47605.

The only known downside is unsupported defsym which causes slight binary
size increase. I think it is doable.
2021-08-03 05:42:06 +00:00
Sergey Bogolepov 02aebd6565 [K/N] Update LLVM stubs to 11.1.0
Also add necessary changes to CoverageMappingC.cpp to make it compile.
2021-08-03 05:42:02 +00:00
Igor Chevdar 2c068b8c5a [K/N][IR] Fix for https://youtrack.jetbrains.com/issue/KT-47814 2021-08-02 19:22:08 +05:00
Igor Chevdar 448376f073 [K/N][IR][optmz] Global analysis for top-level initializers
The analysis' goal is to remove redundant calls to initializers
2021-07-31 01:40:00 +05:00