Commit Graph

94585 Commits

Author SHA1 Message Date
Nikolay Lunyak 24dfb14654 [FIR] KT-53493: Turn VAL_OR_VAR_ON_*_PARAMETER warnings into errors
Merge-request: KT-MR-7032
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-06 08:40:48 +00:00
Sebastian Sellmair 794c9d16a3 [Gradle] CompilationDetails: Use source set hierarchy instead of compilations to determine common sources
^KKT-50161 Verification Pending
2022-09-06 08:35:54 +00:00
Sebastian Sellmair ab73251af0 [Gradle] Implement KT50161AndroidBuildCacheTest to cover KT-50161 2022-09-06 08:35:53 +00:00
Pavel Punegov 7a7954b1e2 [K/N][samples] Exclude curl sample on Windows
Due to the linkage error caused by passing whole
mingw lib directory with -L
2022-09-06 08:05:36 +00:00
Pavel Mikhailovskii 6a14400342 KT-53804 Restore old and incorrect logic of generating InnerClasses attributes for kotlin-stdlib 2022-09-05 14:02:52 +00:00
Pavel Kunyavskiy 4d64f3a422 Ignore added test for JS backend 2022-09-05 12:20:21 +00:00
Alexander Korepanov 453faeaa45 [JS IR] Memory consumption optimization
- Remove IR after JS AST generation
 - Remove JS AST after/during JS code generation
2022-09-05 11:15:55 +00:00
Alexander Korepanov 14b7db0187 [JS IR] Optimize JS AST metadata memory consumption 2022-09-05 11:15:54 +00:00
Alexander Korepanov c747d0e742 [JS IR] Optimize JS AST blocks memory consumption 2022-09-05 11:15:54 +00:00
Alexander Korepanov ea34e10b67 [JS IR] Optimize JS AST scopes memory consumption 2022-09-05 11:15:54 +00:00
Alexander Korepanov bf53273b84 [JS IR] Cache JsLocation objects and js function signatures
Memory consumption optimization
2022-09-05 11:15:53 +00:00
Alexander Korepanov ff2f16190d [JS IR] Minor: eliminate unused vals 2022-09-05 11:15:53 +00:00
nataliya.valtman 57fdfbe860 Fix finish time for build finish event for build statistic 2022-09-05 10:39:53 +00:00
Dmitriy Novozhilov a6d3c6e5c6 [Serialization] Suppress OPT_IN errors in all diagnostic tests 2022-09-05 10:20:06 +00:00
Dmitriy Novozhilov 84b8ab1f9c [Serialization] Add DiagnosticsTests for FIR 2022-09-05 10:20:06 +00:00
Dmitriy Novozhilov 21aec49709 [Tests] Add ability to have separate asm instructions dump for fir + ir setup 2022-09-05 10:20:05 +00:00
Dmitriy Novozhilov a2ffba275c [Serialization] Migrate all tests to new test infrastructure 2022-09-05 10:20:05 +00:00
Simon Ogorodnik 4dd7437df1 Fix kind of NoBuilderInferenceWithoutAnnotationRestriction
BUG_FIX kind causes feature to enable in progressive mode, which
wasn't intended
2022-09-05 10:07:42 +00:00
Simon Ogorodnik 05d486d55a Fix receiver inconsistency when builder inference restriction disabled
In 154e53c701 update of
extensionReceiverArgument in resolvedCall was accidentally moved into
language feature dependant block
2022-09-05 10:07:41 +00:00
Alexander Korepanov 01507281a2 [Common IR] Forward the extension receiver in the reified wrapper
^KT-53672 Fixed
2022-09-05 07:40:30 +00:00
Pavel Kunyavskiy d822d3e7c6 [K/N] Reenable constant inlining except for Double nan constants
^KT-52970
2022-09-05 06:06:44 +00:00
Yahor Berdnikau b8b0b279ee Remove 'kapt.user.worker.api' property
Now Kapt is always run via Gradle workers.

^KT-48827 Fixed
2022-09-02 18:08:41 +00:00
Abduqodiri Qurbonzoda f3e8816dc3 Do not generate JVM 1.8+ annotation targets in stdlib, -jdk7, -jdk8, reflect
See #KT-53712
2022-09-02 14:59:24 +00:00
Sergej Jaskiewicz f07163125b [JS Legacy] For Unit Elvis don't forget to generate code for the RHS
^KT-53780 Fixed
2022-09-02 11:44:17 +00:00
Matthew Haughton 38d0105e74 Fix typo exists -> exist 2022-09-02 12:59:33 +02:00
Artem Kobzar 0bb0be8703 feat(KT-48814): represent all of the external declarations nullable properties as an optional fields inside d.ts. 2022-09-02 10:50:20 +00:00
Yahor Berdnikau a52d8f0364 Pass path to java source file as-is
Since Kotlin 1.7.0 plugin is tracking each java file individually in
task, rather than java SourceSet root directories. Such approach removes
requirement to pass them via `-Xjava-source-roots` compiler argument.

^KT-53390 Fixed
2022-09-02 10:49:36 +00:00
Vyacheslav Gerasimov 15d797b5b5 Build: Use protobuf from kotlin-dependencies repo
#KTI-892
2022-09-01 19:28:16 +02:00
Vyacheslav Gerasimov 46bc1d5b09 Build: Increase heap size for kotlin daemon to 3g
#KTI-915
2022-09-01 19:28:16 +02:00
Ilya Gorbunov 12d3ef41dc Use older JDK toolchains for compiling stdlib and stdlib-jdk7
To prevent using newer JDK API in kotlin sources of these projects.
Note that java sources (of stdlib mainly) are still compiled with JDK 8.

#KT-51907
2022-09-01 16:52:36 +00:00
Nikolay Lunyak 3d9c77efa8 [FIR] Add DNN checks
Merge-request: KT-MR-7000
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-01 14:25:07 +00:00
Roman Golyshev bb2bee74cf [HL API] Fix FE10 implementation of KtExpressionTypeProvider 2022-09-01 13:57:03 +00:00
nataliya.valtman c047bc3647 Advance bootstrap to 1.8.0-dev-2628 2022-09-01 11:20:11 +00:00
Alexander Udalov 13ca189825 Support -Xjdk-release=8 as alias for -Xjdk-release=1.8
#KT-53278 Fixed
2022-09-01 12:15:47 +02:00
Alexander Udalov 19bbcc5869 Do not generate metadata for callable reference classes
After an accidental change in 846537b367, we started generating metadata
into anonymous classes for callable references. This metadata contained
the Kotlin representation of the referenced function. In KT-53794, this
led to a problem where Java's protected visibility could not be
represented in Kotlin terms, which crashed the backend.

But also, this metadata is useless because there's no real use case for
interpreting it (since you already have a function reference object at
runtime with all the needed information), so it would take some extra
space in the bytecode.

 #KT-53794 Fixed
2022-09-01 12:15:25 +02:00
Pavel Kirpichenkov 24dcad0d9c [MPP] Use module's type checker for upper bound checks
The default type checker doesn't have a correct type refinement setup.
This can cause false positives in subtyping of upper bounds in edge
cases with expect type arguments.

See the tests in the intellij repo.

KTIJ-22295
2022-09-01 09:51:11 +00:00
Svyatoslav Scherbina f8462f1b0c Native: allow virtual calls in CoroutineLaunchpad intrinsic
This intrinsic was always calling the supplied suspend function
non-virtually, and this was hardcoded in the intrinsic generator.
Now this can be configured with `superQualifierSymbol` in the respective
IrCall, just the way this works with any other calls.

As a side effect, global optimizations now process this intrinsic more
correctly (before that, they didn't take the intrinsic generator into
account, and treated the call as virtual).
2022-09-01 09:35:23 +00:00
Svyatoslav Scherbina 728fe918fe Native: don't expect that startCoroutineUninterceptedOrReturn receiver is FunctionN+1
Previous implementation of startCoroutineUninterceptedOrReturn expected
that the receiver (i.e. the suspend function object to start) of type
SuspendFunctionN (i.e. suspend function type with arity = N) is also an
instance of FunctionN+1 (i.e. regular function type with arity = N + 1)
with proper convention.

While compiler tries to achieve that (for better compatibility with
Kotlin/JVM, by generating additional supertypes and methods for classes
implementing suspend function types), this doesn't work e.g. for
implementations defined in Swift.

Fix this by adding fallbacks for cases when the receiver is not
a FunctionN+1, while keeping the fastpath for default FunctionN+1
cases.

^KT-51043 Fixed
2022-09-01 09:35:22 +00:00
Svyatoslav Scherbina 15fe2c2c5c Native: remove code duplication in coroutine intrinsics implementation
Make `createCoroutineUnintercepted` invoke
`startCoroutineUninterceptedOrReturn` when suspend function object is
not a `BaseContinuationImpl` (e.g. for a custom suspend function type
subclass), instead of using the copy of its implementation.
2022-09-01 09:35:22 +00:00
Svyatoslav Scherbina e64b057131 Native: make KonanTarget.supportsMimallocAllocator() exhaustive
To prevent forgetting adding a target there again.
2022-09-01 09:24:11 +00:00
Svyatoslav Scherbina 3f9da7263a Native: enable mimalloc by default on ios_simulator_arm64
This was probably forgotten when supporting Apple silicon.
2022-09-01 09:24:11 +00:00
Johan Bay f71931d04b [K/N] Parallelize marking in CMS GC
This change parallelizes marking by making each non-native Kotlin thread
mark its own view of the heap. To make this safe, we make flipping the
marking bit atomic which ensures that threads do not try to trace the
same objects.

Co-authored-by: Johan Bay <jobay@google.com>

Merge-request: KOTLIN-MR-423
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2022-09-01 09:07:54 +00:00
Alexander Shabalin 0734456a87 [K/N] Enable extra option for mimalloc ^KT-53182
Merge-request: KT-MR-6952
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-01 09:02:23 +00:00
Vladimir Sukharev 77ab69240e Do inline safepoints for watchos_arm64
Merge-request: KT-MR-6993
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-01 08:14:41 +00:00
Ilya Muradyan b801d963a1 [Scripting] Fix obtaining virtual file for getting compilation configuration 2022-08-31 20:51:06 +00:00
Alexander Udalov a76de14026 Remove obsolete compiler argument -Xsingle-module
#KT-51622
2022-08-31 20:54:50 +02:00
Alexander Udalov abaffeddab Remove LocalClassProtoTestGenerated, replace with kotlinp tests
This test uses a hacky mode of the compiler which is not worth it to
support further (especially in K2), `USE_SINGLE_MODULE`, where
everything is compiled in one module. The purpose of the test is just to
check that metadata for local/anonymous classes is written correctly.
So we can replace it with the tests on kotlinp, which uses
kotlinx-metadata-jvm and dumps all loaded metadata to text.

This replacement is not perfect, in particular because it won't check
that the reflection machinery is able to load this metadata, and because
it won't check that annotations are loaded correctly from the bytecode.
But IMHO it's good enough, there are box tests on reflection on local
classes (e.g. `reflection/annotations/localClassLiteral.kt`), so this
way is better than having to support the weird compiler mode for just
one test.
2022-08-31 20:54:50 +02:00
Svyatoslav Scherbina 7bf6d64cfb Native: move samples to backend.native/tests/ 2022-08-31 16:10:04 +00:00
Svyatoslav Scherbina b7337d2e64 Native: use samples only as compiler tests
Remove unrelated parts.
2022-08-31 16:10:04 +00:00
Svyatoslav Scherbina 71b8089f33 Native: remove samples that are not used in tests 2022-08-31 16:10:04 +00:00