Commit Graph

2999 Commits

Author SHA1 Message Date
Sebastian Sellmair 59c4c83ed5 [K/N] Samples: Update samples default Kotlin version to 1.9.20 2023-11-23 13:19:04 +00:00
Sebastian Sellmair 359f5fe7b3 [K/N] Samples: Migrate 'echoServer' to modern multiplatform
^KT-50547 Fixed
2023-11-23 13:19:04 +00:00
Ilya Gorbunov d8ee74222f [builtins-gen] Explicit visibility for companion objects and secondary constructors 2023-11-22 18:04:34 +00:00
Ilya Gorbunov c77930c1ea [stdlib] Explicit visibility and return types: Native 2023-11-22 17:57:40 +00:00
Dmitriy Dolovov ede77ea29c [KLIB tool] Warn on unknown CLI options 2023-11-21 09:36:07 +00:00
Dmitriy Dolovov b1c9791404 [Native] Warn on any usage of -repo CLI option
^KT-61098
2023-11-21 09:36:07 +00:00
Pavel Punegov 7623d5e3eb [K/N][test] Disable array allocation test on Linux
The test allocates a lot of memory and can cause OOM-killer on Linux
with 16 Gb RAM or less kill Gradle daemon.


Merge-request: KT-MR-13131
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-20 22:22:48 +00:00
Pavel Punegov 1384377fec [K/N][perf] Fixup target toolchain path for swift compilation
Fix swiftc path in the performance infrastructure. It has a separate
plugin to regular native-build-tools.

This fixes failures caused by the 3aeca1956e.
See also MR-KT-12948


Merge-request: KT-MR-13130
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-20 22:22:08 +00:00
Pavel Kunyavskiy 021a00f4ff [IR] Avoid depending from fir2ir on ir.actualization module
^KT-62292
2023-11-20 08:31:41 +00:00
Pavel Kunyavskiy faaefbd8e7 [IR] Move .parents and .parentsWithSelf to IR utils
^KT-62292
2023-11-20 08:31:41 +00:00
Ilya Gorbunov aa4419b7e3 [stdlib] Explicit visibility and return types: Collections 2023-11-20 02:24:40 +00:00
Ilya Gorbunov 23e0e40acc Create a copy of shared code for building JVM part of native interop runtime
This is required because IDEA cannot import the same directory in multiple modules.
2023-11-17 17:30:58 +00:00
Pavel Punegov 41477b25a1 [K/N][test] Fixup target toolchain path for swift compilation
Use a parent path in fallback framework path environment variable.
This fixes failures caused by the 3aeca1956e.
See also MR-KT-12948
2023-11-17 10:16:30 +00:00
Pavel Punegov a53c96e790 [K/N][test] Fixup target toolchain path for ExecClang
This fixes failures caused by the 3aeca1956e.
See also MR-KT-12948
2023-11-17 10:16:30 +00:00
Alexander Shabalin 9ad7b00613 [K/N] Migrate some runtime/workers tests to new testing infra ^KT-61259 2023-11-17 07:42:28 +00:00
Alexander Shabalin fd1579186f [K/N] Migrate misc runtime/ tests to new testing infra ^KT-61259 2023-11-17 07:42:28 +00:00
Igor Chevdar 36452b5db7 [K/N] IR version of isObjCObjectType 2023-11-16 12:17:46 +00:00
Dmitriy Dolovov 82b08a813b [Native] Fix scripts for computing dependencies in platform DEF files
Now, the scripts are able to compute and record full dependencies
(i.e. direct + transitive) to DEF files.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov f4617f405c [Native] Don't use KLIB repositories in generation of platform libs
Don't pass KLIB repositories via '-repo' or '-r' compiler parameters.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov c13c917a8a [Native] Don't use KLIB repositories in K/N build infra
Don't pass KLIB repositories via '-repo' or '-r' compiler parameters.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 4f1f06c24f [Native][tests] Use full paths to dependencies in K/N test in old infra
Affected tests:
- fake_override_0
- split_compilation_pipeline
- library_ir_provider_mismatch (reworked)
- objs tests (resolve of exported klib in framework)

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 97f1a23f8b [Native][tests] Handle errors in individual compiler invocations 2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 60c88b010d [Native] Add missing dependencies to platform lib DEF files
There are a lot of cases when a DEF file for a K/N platform library
has incomplete set of dependencies in 'depends=' property in
the manifest file. This leads to use of "KLIB resolver" - the
component inside the compiler that is responsible for finding the
missing libraries and implicitly (i.e. invisibly for the end user)
adding them to the set of dependencies of the compiler invocation.

The goal of this commit is to fix 'depends=' in manifest files so that
they should reflect the REAL set of dependencies, and as a result don't
trigger use of "KLIB resolver". This way we could be more prepared to
removed in the "KLIB resolver" in the future.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov c3da16a1d8 [Native] Use library paths instead of library names in K/N build infra
Use library paths instead of library names in K/N build infra when
passing a library through `-library` compiler argument.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov e7b8f3ecde [Native] Deprecate KLIB repositories in Kotlin/Native compiler
1. Log warnings on usage of KLIB repositories.
2. Don't block using repositories for now.

^KT-61098
2023-11-15 19:38:24 +00:00
Vladimir Sukharev c38a0e10af [K/N] Implement a concept of conditional ignore of K/N blackbox tests
^KT-59288 Fixed
2023-11-15 19:03:07 +00:00
Pavel Punegov 9f9b4d1981 [K/N][publish] Publish kotlin-native-compiler-embeddable.jar
Add an ability to publish kotlin-native-compiler-embeddable.jar and
sources to maven. Adds necessary for that sourcesJar and javadocJar
tasks. Note that Native distribution uses this jar without a version postfix.
Also cleaned up the obsolete backend.native publication and renamed 
project to match its name.


Merge-request: KT-MR-12974
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-15 14:54:04 +00:00
Svyatoslav Scherbina 8d20d5b16c Native: support objcExportReportNameCollisions=true binary option
This binary option makes the compiler emit a warning whenever it mangles
a name emitted by ObjCExport.

^KT-63153 Fixed
2023-11-14 19:24:43 +00:00
Denis Lochmelis 4b3dfe6e6e [KT-58995] Fix UPUB bug
Add an explanation comment
2023-11-14 17:34:27 +00:00
Igor Chevdar e43b232786 [K/N] Used KlibFingerprint hash instead of slow SHA-256 2023-11-14 16:06:47 +00:00
Igor Chevdar cc69df0de6 [K/N] Optimized libraries hash computation
#KT-63081 Fixed
2023-11-14 16:06:47 +00:00
Aleksei.Glushko f7057edce1 [K/N] Extract common part of gc runtime tests (2/2)
Restore ParallelMarkConcurrentSweepTest.cpp with new content.
2023-11-14 13:39:45 +00:00
Aleksei.Glushko 8180400a36 [K/N] Extract common part of gc runtime tests (1/1)
Move all the tests in a header file
    and make them instantiatable with different tracing GC implementations.
2023-11-14 13:39:45 +00:00
Troels Bjerre Lund d62dbbb1bd Simplify K/N ArrayList
This commit specializes the existing Kotlin/Native stdlib ArrayList into
two subclasses:
 * ArrayList
 * ArraySubList
This avoids repeatedly checking whether a basic ArrayList is created as a
sublist of another ArrayList.

In the iterators, checkForComodification is marked for inlining, since
this significantly improves iterations performance.

A number of benchmarks are added to the native ring benchmark suite, to
test whether the changed runtime type of ArrayList.subList(...) has an
impact.
2023-11-14 09:47:25 +00:00
Iaroslav Postovalov a3b55cf758 [IR] Drastically simplify the hierarchy of IR origins
IrStatementOriginImpl and IrDeclarationOriginImpl were made final
classes to simplify the creation of them (a delegate provider was
added) and to optimize performance when comparing the origins by type
and name
2023-11-13 17:56:09 +00:00
Pavel Punegov 6053c94c8a [K/N][build] Fix KT-56495: improve version manifest merge
Add missing input property to stdlib build task. This task should
consider kotlin/build version change.
Add a version check during the stdlib target task build. This check
should be done here instead of the final merge.

Fixes ^KT-56495


Merge-request: KT-MR-12906
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-13 14:45:06 +00:00
Vladimir Sukharev d5e391c401 [K/N] Improve manual testing script for SpecialBackendChecks 2023-11-13 11:41:02 +00:00
Vladimir Sukharev 513738b5fe [K/N] Fix test t51.kt for special backend checks 2023-11-13 11:41:02 +00:00
Svyatoslav Scherbina 0be566f6b6 Revert "Native: enable K2 for benchmarksAnalyzer"
This workaround is not needed anymore -- bootstrap KGP is now K2.

This reverts commit 096edd8937.
2023-11-13 08:38:24 +00:00
Svyatoslav Scherbina bc41309c31 Revert "Native: enable K2 for benchmarks in performance/"
This workaround is not needed anymore -- bootstrap KGP is now K2.

This reverts commit 4672727bd6.
2023-11-13 08:38:24 +00:00
Dmitriy Dolovov 4892a81178 [Native] Simplify *.isNativeStdlib() checks as much as possible
...still preserving their reliability.
2023-11-11 13:33:06 +00:00
Pavel Punegov 5f7b1761d7 [K/N][build] Add usr subdir to absoluteTargetToolchain path
absoluteTargetToolchain has started to include the usr directory while
tests use a bootstrap version that doesn't have this change.
See commit 3aeca1956e with the change to toolchain path.
2023-11-10 18:25:04 +00:00
Pavel Punegov 707482e738 [K/N][perf] Cleanup build scripts
Remove hack with including sources directories.
shared project directory was removed from native and merged with utils.
Also, remove native/utils inclusion. Bootstrap version is used instead.
2023-11-10 18:25:04 +00:00
Alexander Shabalin fa9c620261 [K/N] Migrate some runtime/basic tests to new testing infra ^KT-61259 2023-11-10 15:51:05 +00:00
Pavel Punegov 3d720f9c03 [K/N][test] Add static_everywhere caching as an alias to static
To match the options in the new infrastructure, add the same option
to the old one


Merge-request: KT-MR-12949
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-10 13:11:03 +00:00
Ilya Gorbunov 9ccce52915 Clean up WasExperimental annotation from declarations with SinceKotlin<=1.4
Since it is not possible to use -api-version < 1.4, this annotation has no effect
2023-11-10 12:20:52 +00:00
Troels Bjerre Lund 58a99da54f [K/N] Pack instance fields better
This change reorders declared fields such that LLVM can pack each class
space optimally, minimizing the padding required. The guarantee is that
an objects body will take up space equal to the sum of the sizes of its
fields (inherited and declared) rounded up to a multiple of 8 bytes.
This also implies that no object will contain more than 7 bytes of
padding.
2023-11-09 12:34:30 +00:00
Dmitriy Novozhilov 687f5fc20d [Native] Add fast check that stdlib is present in klib dependencies
Previous changes uncovered a problem with lacking of stdlib in
  dependencies, which was quite hard to debug and determine.
  So this check is supposed to discover similar issues in the future
  much more easily.
2023-11-09 10:43:31 +00:00
Dmitriy Novozhilov b4d29aa583 [Native] Enable linkViaSignatures for K2/Native compiler
Setting `linkViaSignatures = false` leads to the situation when fir2ir
  provides no guarantees about how SymbolTable is filled, so if some
  backend relies on symbol table content (JS and Native does) then
  it's required to set this flag to `true`

The issue was uncovered by previous commits because previously fir2ir
  created symbols with signatures for some declarations even with
  disabled flag, which was fixed by those commits
2023-11-09 10:43:31 +00:00
Aleksei.Glushko d22218e4e4 [K/N] Non-worker work source in ParalleProcessor
To be used as thread-local mark queue in concurrent mark.


Merge-request: KT-MR-12723
Merged-by: Alexey Glushko <aleksei.glushko@jetbrains.com>
2023-11-08 17:20:15 +00:00