Commit Graph

106093 Commits

Author SHA1 Message Date
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
Mikhail Glukhikh cf9bd44cf7 K2: add test to confirm KT-54139 now works properly 2023-11-14 13:33:18 +00:00
Svyatoslav Scherbina bb608740cd Bump Kotlin/Native version in KGP to 2.0.0-dev-7404 2023-11-14 12:47:34 +00:00
Svyatoslav Kuzmich 1c230c8f27 [Wasm] Port WasmImport/WasmExport checker to K2 (KT-56849) 2023-11-14 12:24:10 +00:00
Dmitrii Gridin 28895a2613 [FIR] FirAnnotationArgumentsTransformer: fix scope problem with type parameters
We should wrap outer declaration to avoid FirTowerDataMode.CLASS_HEADER_ANNOTATIONS

^KT-63396 Fixed
2023-11-14 10:46:43 +00:00
Dmitrii Gridin 2ee9fcab9b [FIR] add diagnostic test for annotations inside type parameters
^KT-63396
2023-11-14 10:46:43 +00:00
Artem Kobzar bec434d534 [K/JS] Save nullability from the original type of value parameters ^KT-63013 Fixed 2023-11-14 10:40:07 +00:00
Aleksandra.Arsenteva 83c90d0e4f Add one more test for KT-61959
Generate FE tests
2023-11-14 10:09:54 +00:00
Abduqodiri Qurbonzoda a3f5db566c Remove KDoc for K/N ArrayList primary constructor
The documentation is provided for ArrayList class but describes its
primary constructor. Thus, in documentation website it appears
as ArrayList documentation. When no KDoc is provided, website generator
takes it from other platforms.
2023-11-14 09:47:25 +00:00
Troels Bjerre Lund 5a8faa8775 Align ListBuilder with native ArrayList
Furthermore, add test for ListBuilder.subList detection of concurrent
modification, and fix error in ListBuilder and ArrayList.

Fix KT-62346
2023-11-14 09:47:25 +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
Alexander Udalov 39fda3535a IR: fix internal visibility check in override builder
In case there are Java sources in the module, K2 creates two instances
of `FirModuleDescriptor` with the same name: one for Kotlin sources, one
for Java sources. When building fake overrides in IR, it's important to
understand that those are the same module. Currently it's done by
comparing the names, but in the future it may be improved in KT-62534.

The changed test was in fact unrelated to KT-61805, and the problem
there was rather that no fake override was created for internal property
`schemeState` in `InspectionProfileModifiableModel`.
2023-11-14 09:45:06 +00:00
Abduqodiri Qurbonzoda c30eb1c56a Stdlib buildscript error: file included in two modules #KT-63447
The error is reported only when K2 is enabled in stdlib


Merge-request: KT-MR-12930
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-11-13 22:52:50 +00:00
Alexander Udalov 54705e5afc IR: copy context receiver parameters count in FakeOverrideCopier
#KT-63430 Fixed
2023-11-13 21:36:22 +00:00
Ilya Gorbunov fc64e30829 [stdlib-js] Move jsTypeOf to a documentable source root and restore its kdoc 2023-11-13 20:06:27 +00:00
Ilya Gorbunov 27ed611e70 [stdlib] Minor cleanup of JS stdlib build
- Remove unused jsIrTarget variable
- Rename the directory with copied builtin sources
2023-11-13 19:21:08 +00:00
Ilya Gorbunov 5e61cb5098 [stdlib-docs] Fix JS stdlib source paths in API docs builds 2023-11-13 19:21:08 +00:00
Ilya Gorbunov c69f36a8be [stdlib-js] Move public API out of runtime helpers directory 2023-11-13 19:21:08 +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
Anton Lakotka f2ddae533e [Gradle] Create archive tasks for custom compilations
This change is needed for kotlin-test in order to support
correct project dependencies in kotlin.git repository.

^KT-62943 Verification Pending
2023-11-13 16:56:58 +00:00
Mikhail Glukhikh e747793e62 FIR2IR: simplify applyAssigningArrayElementsToVarargInNamedForm a bit 2023-11-13 16:23:26 +00:00
Mikhail Glukhikh 4913c38e98 FIR2IR: insert spread for named argument against primitive vararg
#KT-60312 Fixed
2023-11-13 16:23:26 +00:00
Mikhail Glukhikh 4abce54748 K2: reproduce KT-60312 2023-11-13 16:23:26 +00:00
Mikhail Glukhikh 53ab32e0fb Rename: ConeTypeVariableType.lookupTag -> typeConstructor 2023-11-13 15:10:48 +00:00
Mikhail Glukhikh 1ceec4d6d7 K2: make type variable based types not class like
#KT-57921 Fixed
#KT-62420 Fixed
2023-11-13 15:10:48 +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
Mikhail Glukhikh 5c56f0ef77 K2: drop obsolete TODO about use-site targeted annotations
See comments in KT-59824
#KT-59824 Obsolete
2023-11-13 13:59:32 +00:00
Mikhail Glukhikh 9903b70e0a K2: add test to confirm KT-58874 now works properly
#KT-58874 Obsolete
2023-11-13 12:26:28 +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
Ilya Goncharov 87e81d8562 [Gradle, JS] Distribution is copy task, webpack targeting to separate directory
^KT-63040 fixed
2023-11-13 10:56:04 +00:00
Marco Pennekamp dd219cb6e6 [LL] Commit pending diagnostics from file checkers on script declarations
- In addition to file declarations and class members, we also need to
  commit pending diagnostics on declarations in scripts, to honor
  suppressions before the diagnostics are committed indiscriminately.

^KT-62899
2023-11-13 10:20:26 +00:00
Marco Pennekamp c482786bc4 [AA] Add tests for diagnostics suppression on top-level declarations in scripts
- `scriptUninitializedTopLevelProperty` is currently disabled in FIR
  because it fails with a mismatch between diagnostics from the file and
  the individual elements. It will be enabled in the next commit.

^KT-62899
2023-11-13 10:20:26 +00:00
Marco Pennekamp c9cb2062bd [LL] Commit pending diagnostics from file checkers on top-level declarations
- In KT-62899, diagnostics produced by file checkers weren't suppressed
  because the top-level declarations on which the diagnostics are
  reported were never visited by the same reporter.
  `LLFirDiagnosticVisitor` skips nested declarations by design, as
  diagnostics are collected for each structure element separately.
  However, suppression takes effect when diagnostics are committed on
  some element. If the element is not visited, suppression is skipped
  and the diagnostic is committed at the end without a check by
  `FileStructureElementDiagnosticsCollector.collectForStructureElement`.
- The fix ensures that diagnostics are committed on top-level
  declarations, similar to how this was already done for class members.

^KT-62899 fixed
2023-11-13 10:20:26 +00:00
Marco Pennekamp 88d307d52c [AA] Add tests for diagnostics suppression on top-level declarations and class members
- `testConflictingOverloadsAtTopLevel` is currently disabled in FIR
  because it fails with a mismatch between diagnostics from the file and
  the individual elements. It will be enabled in the next commit.

^KT-62899
2023-11-13 10:20:26 +00:00
Pranav 6c7963fe47 fix: Fix memory leak in ZipImplementation with -Xuse-fast-jar-file-system
When using the compiler with `-Xuse-fast-jar-file-system` enabled, the compiler causes memory leak in ZipImplementation class at MappedByteBuffer.contentsToByteArray method since the Inflater used to deflate zip/jar files, isn't released/ended after the task.
2023-11-13 10:04:39 +00:00
Chris Povirk 72c9378500 Fix error message for -Xjspecify-annotations.
The message currently claims that you can pass the value "disable," but
in fact the value it means is "ignore."
2023-11-13 09:59:27 +00:00
Marco Pennekamp d89e29f289 [FIR] FirSymbolNamesProvider: Provide default implementation for mayHaveSyntheticFunctionType
- Composite providers may call `mayHaveSyntheticFunctionType` on *all*
  of their children if *one* child has
  `mayHaveSyntheticFunctionTypes == true`, so
  `mayHaveSyntheticFunctionType` should have a proper default
  implementation to avoid runtime errors.
- The alternative of requiring to check `mayHaveSyntheticFunctionTypes`
  before calling `mayHaveSyntheticFunctionType` at the call-site was
  considered, but deemed too error-prone. Given that
  `mayHaveSyntheticFunctionType` is an optimization and admits false
  positives, an imprecise default implementation of it is allowed.

Thanks to Mikhail Glukhikh for discovering this problem.
2023-11-13 09:47:41 +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 d65fc00578 [KLIB] Introduce isJsStdlib() and isWasmStdlib() checks for KLIBs 2023-11-11 13:33:06 +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
Alexander Udalov 6a0a64eb6d JVM: remove usages of trove4j
#KTI-1135
2023-11-10 21:56:34 +00:00
Alexander Udalov e0b2f2040b Minor, add regression test for K1 issue KT-61101 2023-11-10 21:51:53 +00:00
Roman Efremov 37b839f2c2 [Tests] Refactor: move one more annotation arguments lazy resolve test
for `ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` checker near to
other tests of this diagnostic. It is fine to move it out of
`multiplatformCompositeAnalysis` dir, because, actually, it tests
the case with comparison of FirAnnotationCall and FirAnnotationImpl,
which doesn't require composite analysis mode.

^KT-62559
2023-11-10 19:36:10 +00:00
Roman Efremov 99bf96e747 [Tests] Refactor: move annotation arguments lazy resolve test for
...`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` checker near to
other tests of this diagnostic. This is because now such tests
are run in lazy resolve test suite, so no need to store them
separately.

^KT-62559
2023-11-10 19:36:10 +00:00
Roman Efremov c20a5fc650 [Tests] Fix .ll.kt KMP tests data added in previous commit
It is expected, that in some complex cases
`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` reports in .ll.kt disappeared
at all. This is because FIR checker doesn't catch comlex cases,
which are handled by IR checker.

Also add comments about bugs KT-62886 and KT-63382 found by tests.

^KT-62559
2023-11-10 19:36:09 +00:00
Roman Efremov 29980c6b85 [Tests] Run KMP tests in Analysis API LL FIR test suites
New tests are red in current commit!
All `.ll.kt` files are just copies of `.fir.kt` or `.kt`. This will be
fixed in the next commit to clearly show difference between LL and FIR.

The original purpose of this change was to test
`ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT` diagnostic, for which FIR checker
will be run only in IDE (to be changed in next MR), so its reports
a lost from usual KMP tests.
But this looks like a useful change for all KMP tests, not only this
diagnostic.

^KT-62559
2023-11-10 19:36:09 +00:00
Roman Efremov 026ad1cebc [Tests] Refactor: move unrelated tests out of annotationMatching dir
It will be used only for ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT
diagnostic tests.

^KT-62559
2023-11-10 19:36:09 +00:00