Commit Graph

103075 Commits

Author SHA1 Message Date
mvicsokolova 298c4f8c32 [K/N] Introduce atomic arrays in K/N stdlib
This commit introduces API for AtomicIntArray, AtomicLongArray and AtomicArray<T>.

The current set of functions is implemented via atomic arrays intrinsics (see KT-58360) and provides sequentially consistent memory ordering guarantees and no spurious failures in compareAndSet/compareAndExchange operations.

For details see: KT-60608

Merge-request: KT-MR-11071
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2023-07-21 15:30:20 +00:00
Alexander Udalov ebd43fc8c0 Tests: minor, improve tests on $EntriesMappings classes
These tests were initially testing that $EntriesMappings classes were
correctly generated, but started to check something else once the
language feature EnumEntries was enabled by default.
2023-07-21 14:55:22 +00:00
Alexander Udalov 56ed240774 JVM: rename IrIntrinsicFunction -> IntrinsicFunction
To avoid confusion that this might be an IR tree element.
2023-07-21 14:55:22 +00:00
Alexander Udalov f8faa0fe5a JVM: cleanup intrinsics code
Remove unused methods, remove dependency on old backend structures,
reformat, fix some inspections.
2023-07-21 14:55:21 +00:00
Alexander Korepanov ad3583ac38 [JS IR] Fix KClass equals for Nothing type 2023-07-21 14:48:30 +00:00
Alexander Korepanov 90498593f3 [JS IR] Fix review comments. 2023-07-21 14:48:30 +00:00
Alexander Korepanov 09501224e8 [JS IR] Add comments
^KT-59001
2023-07-21 14:48:30 +00:00
Alexander Korepanov bfb7f74e47 [JS IR] Add linkedHashMap tests
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 2fdb605a03 [JS IR] Fix tests
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 0b4a9499f0 [JS IR] Catch concurrent modifications of HashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 5e2c1761fc [JS IR] Implement InternalStringLinkedMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 058cc9def2 [JS IR] Rework HashSet
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov f834007da6 [JS IR] Remove unused code & comments & style fixes
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 2300facead [JS IR] Rework HashMapEntries, get rid of LinkedHashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov f202865080 [JS IR] Improve InternalStringMap iterators & Extend InternalMap interface
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 6f0628cb8a [JS IR] Replace InternalHashCodeMap with InternalHashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 6a1e14df0b [JS IR] Implement InternalMap interface
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 6a77514a83 [JS IR] Get rid of HashMap EqualityComparator
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov 402d5e63fd [JS IR] Cleanup InternalHashMap
^KT-59001
2023-07-21 14:48:29 +00:00
Alexander Korepanov e26c06f0e1 [JS IR] Copy paste native-wasm HashMap implementation
Copy from libraries/stdlib/native-wasm/src/kotlin/collections/HashMap.kt

^KT-59001
2023-07-21 14:48:29 +00:00
Sebastian Sellmair 96b33007e5 [Gradle] Implement 'publishJvmEnvironmentAttribute' flag
When the flag is 'on', then publications will include
The 'org.gradle.jvm.environment' Gradle attribute.

We previously did not publish this attribute, as it lead
to problems for 'old' consumers.

We will roll out publications gradually with this feature flag.
The external Android target is expected to opt into this flag
as it is necessary for disambiguating Android from JVM targets
when the external Android target also uses KotlinPlatformType.jvm
2023-07-21 14:24:10 +00:00
Alexander Korepanov 89c3781c8e [JS FIR] Support NAME_CONTAINS_ILLEGAL_CHARS diagnostic
^KT-59392 Fixed
2023-07-21 13:54:34 +00:00
Alexander Korepanov 37c8ec1e51 [JS FIR] Support JS_BUILTIN_NAME_CLASH diagnostic
^KT-59391 Fixed
2023-07-21 13:54:34 +00:00
Sergej Jaskiewicz f061215ee9 [IR] Reorder parameters in IrFactory#createFunctionWithLateBinding
This is to prepare for IrFactory auto-generation (KT-59308).
2023-07-21 13:12:37 +00:00
Sergej Jaskiewicz 3828552a1c [IR] Make IrFunctionWithLateBinding a subclass of IrSimpleFunction 2023-07-21 13:12:37 +00:00
Dmitrii Gridin 88da053408 [AA] forbid analyze from write action
Analysis is not supposed to be called from write action.
Such actions can lead to IDE freezes and incorrect behavior

^KT-60586 Fixed
2023-07-21 13:03:04 +00:00
Sergej Jaskiewicz c624bba8cd [klib] Introduce the "ir_signature_versions" in klib manifests
^KT-60576 Fixed
2023-07-21 12:51:47 +00:00
Sergej Jaskiewicz d16445aef2 [klib] Drop the addDebugInfo setting that was always true 2023-07-21 12:51:47 +00:00
Dmitrii Gridin 82061a73eb [util] SmartPrinter: override toString to print content instead of identity hash
Otherwise, all current exceptions contain only something like SmartPrinter@1234
2023-07-21 12:40:00 +00:00
Svyatoslav Scherbina bcc4a891be Native: add tests for ExperimentalForeignApi on cinterop declarations
Add tests checking that all (top-level) declarations generated by
cinterop now have ExperimentalForeignApi annotation.

^KT-58362
2023-07-21 11:54:14 +00:00
Svyatoslav Scherbina 3f3f6eb5a8 Native: add ExperimentalForeignApi to generated cinterop declarations
cinterop tool should add ExperimentalForeignApi to all generated
declarations by default. This commit implements adding the annotation.
Nested declarations don't get the annotation, because they inherit the
opt-in requirement from the enclosing classes implicitly.

The annotation is not added to platform libraries, as intended. See
previous commits.

^KT-58362
2023-07-21 11:54:14 +00:00
Svyatoslav Scherbina 3280d3ef80 Native: prepare existing tests for cinterop adding ExperimentalForeignApi
cinterop tool should add ExperimentalForeignApi to all generated
declarations by default. This commit prepares existing tests for this.

^KT-58362
2023-07-21 11:54:14 +00:00
Svyatoslav Scherbina 93ef98cbec Native: make .annotations mutable for some Stub IR nodes
cinterop tool should add ExperimentalForeignApi to all generated
declarations by default. To make this possible to implement in a
non-intrusive manner, this commit enables adding annotations to some of
the existing Stub IR nodes.
After that, one can add annotations to all generated declarations with
a simple post pass.

^KT-58362
2023-07-21 11:54:14 +00:00
Svyatoslav Scherbina d118844b17 Native: represent ExperimentalForeignApi in cinterop's Stub IR
cinterop tool should add ExperimentalForeignApi to all generated
declarations by default. This commit supports this annotation in
cinterop intermediate representation -- Stub IR.

^KT-58362
2023-07-21 11:54:14 +00:00
Svyatoslav Scherbina 7ca0cb1077 Native: don't add ExperimentalForeignApi to platform libs
Use -Xdisable-experimental-annotation when generating platform libs.
As a result, unlike all other cinterop libraries, declarations in
platform libs won't require ExperimentalForeignApi opt-in

^KT-58362
2023-07-21 11:54:14 +00:00
Svyatoslav Scherbina cabb25d3e0 Native: add -Xdisable-experimental-annotation flag to cinterop
It disables adding `ExperimentalForeignApi` opt-in to declarations
generated by cinterop.
Main use case is platform libraries, which are not supposed to have this
annotation. Applying the flag to user cinterop libraries is discouraged
and effectively means opting in.

^KT-58362
2023-07-21 11:54:14 +00:00
Svyatoslav Scherbina 1053d18871 Native: add support for annotations on typealiases in cinterop
^KT-58362
2023-07-21 11:54:14 +00:00
Anton Lakotka 67f4343137 [Gradle] rework addSourceSet to not let sourceSets be exposed in groovy
Also mark it as deprecated to prevent internal misuses.

^KT-58234 Verification Pending
2023-07-21 11:47:01 +00:00
Anton Lakotka f05856f6a0 [Gradle] Lower deprecation level of KotlinCompilation source method
It makes IDE Import failing when method is used.
So tooling diagnostic with ERROR level is preferred in such cases.

^KT-58234 Verification Pending
2023-07-21 11:47:01 +00:00
Anton Lakotka c3b09e148b [Gradle] Add KotlinCompilationSourceDeprecation diagnostic
^KT-58235 Verification Pending
2023-07-21 11:47:01 +00:00
Anton Lakotka 245825cf8b [Gradle] Elevate KotlinCompilation.source deprecation to ERROR
Fix internal use of this API with dedicated internal function.

^KT-58234 Verification Pending
2023-07-21 11:47:01 +00:00
Svyatoslav Scherbina aecf18b842 Native: move copying of toolchain builder artifact from Docker to host
Don't make Docker container copy artifact to a host directory mounted
with -v, because this fails due to a file permission issue:
build is run by a regular user, but the volume directory inside the
container is owned by root.

Instead, make the host copy the artifact from the container.

Also, make the container print the artifact path before that.
Just in case, in order to easily copy file manually, should something
go wrong.

^KT-58864
2023-07-21 10:40:13 +00:00
Svyatoslav Scherbina a276ad48a0 Native: don't use -it for docker run in toolchain builder
To make it more suitable for running in a CI

^KT-58864
2023-07-21 10:40:13 +00:00
Svyatoslav Scherbina 28a736ea30 Native: update isl download URL in a toolchain builder config
The previous URL no longer works. The isl project has moved hosting to
sourceforge.io. Update the mirror accordingly.
This is fixed in Crosstool-NG 1.25.0, but the URL is included in config
and needs to be updated there.

Note: to make the rest of toolchains buildable, the same change should
be applied to their configs.

See also https://github.com/crosstool-ng/crosstool-ng/pull/1614.

^KT-58864
2023-07-21 10:40:12 +00:00
Svyatoslav Scherbina 4e563aa299 Native: add arm toolchain gcc-8.3.0-glibc-2.12.1-kernel-4.9.config
Based on gcc-8.3.0-glibc-2.19-kernel-4.9.config, but with glibc version
downgraded from 2.19 to 2.12.1.

^KT-58864
2023-07-21 10:40:12 +00:00
Svyatoslav Scherbina 3c568e7b86 Native: update zlib download URL in toolchain builder
zlib 1.2.11 has been moved to fossils/ on the official website.

^KT-58864
2023-07-21 10:40:12 +00:00
Svyatoslav Scherbina 785e70c31a Native: update toolchain builder Docker image to Ubuntu 16.04
Ubuntu 14.04, used before, has expired root SSL certificate for
Let's Encrypt. As a result, OpenSSL couldn't verify SSL certificates
issued by Let's Encrypt, failing, in particular, kernel download.

^KT-58864
2023-07-21 10:40:12 +00:00
Sergey Bogolepov becbca2284 [K/N] Fix DeclarationDescriptor.findObjCExportMetaAnnotations
`require` is failing in the presence of error types,
so use nullability instead.
2023-07-21 09:57:22 +00:00
Pavel Kunyavskiy b6060f8440 [K/N] Fix lazy header export in one-shot compilation mode 2023-07-21 09:37:52 +00:00
Kirill Rakhman e35a28d36d [FIR2IR] Correctly map arguments of type alias constructor call
Previously, we applied type arguments as is when converting type alias
constructor calls to IR.
Now, we map them using the expansion of the type alias.

#KT-59743 Fixed
2023-07-21 07:45:52 +00:00