Commit Graph

3360 Commits

Author SHA1 Message Date
Alexander Udalov 621fe41b17 JVM: restore incorrect DFS logic in JavaModuleGraph for compatibility
The problem is tracked in KT-66622. It should be fixed later, with a
proper deprecation, because otherwise it can potentially break a lot of
code.
2024-03-19 15:51:01 +00:00
Alexander Udalov 94e5cafb61 JVM: fix "module reads" check in JavaModuleGraph
There was a bug in the DFS. Whenever we encountered a "requires
transitive X" directive in some module, we recursively invoked DFS not
on X but on `dependencyName`, which is the target module that we're
trying to find the path to. And that always failed, because no module
requires itself.

 #KT-66275 Fixed
2024-03-19 15:51:01 +00:00
Alexander Udalov 5cbaf077f3 JVM: remove FilteredJvmDiagnostics
The purpose of this class was to avoid reporting conflicting JVM
signatures / accidental override errors when there's a similar (e.g.
conflicting overloads) diagnostic already reported.

It was not used meaningfully because it only affected diagnostics
reported by the old JVM backend. Also, in real life, backend diagnostics
would not be reported anyway in most cases because backend is not even
run if there's an error after frontend.
2024-03-15 14:39:56 +00:00
Alexander Udalov b4d65fe5cd JVM: remove obsolete code for reporting JVM backend diagnostics
The last remaining usages from diagnostic tests were removed in previous
commits.
2024-03-15 14:39:56 +00:00
Mikhail Glukhikh e22a2016b1 Revert "Temporary: make "Pre-release classes were found in dependencies" warning"
This reverts commit 92cf3e3343.
2024-03-15 11:33:10 +00:00
Mikhail Glukhikh 92cf3e3343 Temporary: make "Pre-release classes were found in dependencies" warning
See KT-66551
2024-03-13 20:38:44 +00:00
Igor Yakovlev 1e798a2527 [Wasm] Implement IrLinkageError end enable partial linker
KT-58088
2024-03-12 14:36:45 +00:00
Dmitriy Novozhilov d352cc9d96 [Frontend] Make DiagnosticSuppressor a project-level extension
Originally it was an application-level component, which caused non-trivial
  logic and cognitive load to carefully handle those extensions to avoid
  memory leaks.

6740a596 introduced a way to easily register `DiagnosticSuppressor` to
  project, and this commit continues this work, making it a proper
  project-level extension

A lot of changes caused by the fact, that this extension is needed to be
  obtained from `BindingContext` (see `BindingContextSuppressCache` and
  its usages), so almost all changes are introducing `Project` to
  `BindingContext`

^KT-66449 Fixed
2024-03-12 06:43:58 +00:00
Igor Yakovlev 84a5a9ff53 Revert "[Wasm] Implement IrLinkageError end enable partial linker"
This reverts commit c0f387dbd1.
2024-03-11 19:27:12 +00:00
Alexander Udalov 2f056fe155 JVM: remove StubClassBuilder and its usage
After legacy light classes were removed, the only remaining usage was in
KotlinLightClassBuilderFactory where we ran JVM backend in the
LIGHT_CLASSES mode, and that was only used from diagnostic tests to
report JVM backend diagnostics.

We don't actually need to build stubs here, so we can just use ASM's
class writer, which means that StubClassBuilder and all its dependencies
can be removed.
2024-03-11 18:03:49 +00:00
Ivan Kylchik c07781326b [K2] Remove performanceManager from CompilationContext 2024-03-08 15:58:33 +00:00
Ivan Kylchik 1eabff337d [K2] Move Generation perf calculation inside generateCodeFromIr
1. We don't need to include `GenerationState` initialization time
2. We don't need to include diagnostic reporting time
2024-03-08 15:58:33 +00:00
Ivan Kylchik fd961452b3 [K2] Move IRTranslation perf calculation inside convertToIr* methods 2024-03-08 15:58:33 +00:00
Ivan Kylchik 8275c92cd4 [K2] Move Analysis perf calculation inside corresponding fronted runner
This way it is easier to understand where `notifyAnalysis*`
methods were called. Also, in K1, we are not including
`checkKotlinPackageUsageFor*` in the analysis time.
2024-03-08 15:58:33 +00:00
Ivan Kylchik cbda22ab48 [K2] Don't include IRTranslation time as total Generation time
Such behavior is more on par with K1.

#KT-65094 Fixed
2024-03-08 15:58:33 +00:00
Artem Kobzar 77f0cba23f [K/JS] Introduce v2015 target 2024-03-06 12:21:38 +00:00
Ilya Goncharov b157a8eae5 [Wasm] Add wasm target to Klib manifest
^KT-66327 fixed
2024-03-06 10:57:50 +00:00
Igor Yakovlev c0f387dbd1 [Wasm] Implement IrLinkageError end enable partial linker
KT-58088
2024-03-05 17:17:32 +00:00
Alexander Udalov 3bb2ea10b6 K2: add inline JVM target version checker
#KT-60777 Fixed
2024-03-04 22:25:36 +00:00
Alexander Udalov 939a74add3 CLI: improve error message for -Xjdk-release=1.6/1.7
#KT-66174 Fixed
2024-02-29 11:05:20 +00:00
Alexander Udalov 5f261d3ad0 CLI: fix "unknown JVM target version" error message
Do not list 1.6 as supported because it was removed in KT-45165.

 #KT-66175 Fixed
2024-02-29 11:05:20 +00:00
Alexander Udalov f98a22e8e4 Fir2Ir: enable IR-based fake override builder
Invert the logic of IR/FIR2IR-based generators: change the CLI argument
to -Xuse-fir-fake-override-builder, test directive to
USE_FIR_BASED_FAKE_OVERRIDE_GENERATOR, etc.

The changes in test data caused by using IR fake override builder by
default are in the subsequent commit.

 #KT-61514
2024-02-29 10:14:31 +00:00
Alexander.Likhachev 95fd91ae16 [CLI, Gradle] Update GradleDeprecatedOption.removeAfter values
The values updated to follow the deprecation cycle "warning -> error -> removed"
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Alexander.Likhachev d20f31e963 [CLI, Gradle] Fix GradleDeprecatedOption.removeAfter processing
The expected format was Kotlin language version (e.g. `2.0`), however the actual passed values were Kotlin release versions (e.g. `2.0.0`)
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
Alexander Udalov 0b10d3a0e9 Minor, move JavaModuleResolver from frontend.java to frontend.common.jvm
To be reused in the K2 checker (KT-60797).
2024-02-21 14:10:44 +00:00
Ilya Chernikov 10dbe73828 K2 Scripting: report error on attempt to use scripts in common roots
#KT-65967 fixed
2024-02-21 07:47:15 +00:00
Ilya Chernikov e5a6900458 K2 scripting: separate scripts compilation into another session
when scripts are compiled along with other sources.
#KT-65865 fixed
2024-02-21 07:47:15 +00:00
Dmitrii Gridin 072d191306 [compiler] replace Enum values() with entries
To fix warnings. Also, use of `Enum.entries` may improve the performance

^KT-48872
2024-02-20 17:56:46 +00:00
Alexander Udalov 90ff8f0e64 JVM: support -Xjdk-release=7/1.7
#KT-59098 Fixed
2024-02-19 11:44:58 +00:00
Alexander Udalov 12f393791b JVM: allow -jvm-target 1.8 with -Xjdk-release=1.6
#KT-59098
2024-02-19 11:44:58 +00:00
Alexander Udalov 1bc08fc5b8 JVM: report error on -Xjdk-release=6 without -jvm-target
#KT-59098
2024-02-19 11:44:58 +00:00
Ilya Goncharov 12cd9c4530 [Gradle, JS] Deprecate only deprecated properties in compiler arguments copy 2024-02-09 18:20:08 +00:00
Ilya Goncharov d02be30e3b [Gradle, JS] Return back deprecated options noStdlib and metaInfo 2024-02-09 18:20:08 +00:00
Ilya Goncharov 2340d59f40 [JS] Get rid of outputFile in compiler args (KT-61116)
^KT-56753 fixed
2024-02-09 18:20:08 +00:00
Pavel Mikhailovskii 7ab9e03347 KT-65684: KAPT: (Re)enable fallback to K1 KAPT and make it default
[KAPT] KT-65684 Set languageVersion=1.9 in KaptToolIntegrationTestGenerated

[KAPT] KT-65684 Re-enable a few now-passing tests in Kapt4IT

[KAPT] KT-65684 Fix the logic setting -Xuse-kapt4 flag in Kapt4IT.forceKapt4()

The change is needed to make sure that all the tests have the flag set,
 otherwise some of them would silently switch to the fallback node.
Also disables a few now failing tests.

[KAPT] KT-65684 Revert "KT-64385 Enable K2 KAPT by default"

This reverts commit 7e9d6e60


Merge-request: KT-MR-14291
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-09 12:54:28 +00:00
Roman Efremov 1f30d076de [CLI] Introduce compiler argument to suppress error about API version
...greater than language version.

^KT-63712
2024-02-09 11:02:26 +00:00
Evgeniy.Zhelenskiy 7eab4b672d [K1, K2, CLI] Mark whole position range of compiler diagnostics in CLI
#KT-64989
2024-02-08 12:59:31 +00:00
Alexander Udalov 28797a31b4 JVM: refactor JvmDefaultMode, remove/rename some entries
- remove ENABLE/COMPATIBILITY because they can no longer be used
- remove forAllMethodsWithBody because its behavior is now equivalent to
  isEnabled
- inline isCompatibility
- inline DEFAULT
- rename ALL_INCOMPATIBLE -> ALL
2024-02-06 17:18:44 +00:00
Evgeniy.Zhelenskiy f05c972efb [K2, CLI] Support endOffset in Kotlin CLI
Duplicated messages in testdata appeared because default renderer
renders diagnostic spans ambiguously. It shows only start position.
In fact, there are 3 failures, 2 of them distinguish only by the
diagnostic end offset. See youtrack for more information.

The issue about inconvenient rendering is KT-64989.

#KT-64608
2024-02-05 13:26:13 +00:00
Alexander Udalov 77dba281a3 CLI: remove obsolete -Xbuiltins-from-sources
Looks like it has no effect anymore after 3f2e996803.
2024-02-01 23:37:23 +00:00
Alexander Udalov 2d308e7c27 CLI: remove obsolete language feature arguments
These arguments switch language features which cannot be disabled
anymore because they're enabled from some LV not later than 1.4, and the
minimal supported LV is currently 1.4.
2024-02-01 23:37:23 +00:00
Alexander Udalov c2e67619ba CLI: remove obsolete -Xdisable-ultra-light-classes 2024-02-01 23:37:23 +00:00
Alexander Udalov 9d5e1bdc47 CLI: remove obsolete -Xallow-result-return-type 2024-02-01 23:37:23 +00:00
Alexander Udalov 49c659b379 CLI: remove obsolete -Xdump-declarations-to
It was only used in the very old version of binary compatibility
validator. It was never supported in the JVM IR backend.
2024-02-01 23:37:23 +00:00
Sergej Jaskiewicz f39335b3f7 [klib] Don't pass around metadata serialization closure
Pass the metadata serializer instance instead. This allows to further
reduce code duplication by introducing the common interface
`KlibSingleFileMetadataSerializer` for abstracting away K1 and K2
representation of a source file, as well as reusing
`Fir2KlibMetadataSerializer` across different backends.

KT-64392
2024-01-29 21:07:43 +00:00
Sergej Jaskiewicz 93a1ceae75 [klib] Deduplicate KLIB serialization logic in K/JS and K/N
Introduce the new `serializeModuleIntoKlib` function that all KLIB-based
backends can use to serialize a module to a KLIB.

^KT-64392 Fixed
2024-01-29 21:07:43 +00:00
Sergej Jaskiewicz c335cd0b1e [IR] Remove unused IrMessageLogger from serialization logic 2024-01-29 21:07:43 +00:00
strangepleasures 4c8b5c699e [KAPT] [CLI] KT-65251 Run Kapt CLI with -Xmx512M by default 2024-01-29 15:47:36 +00:00
Dmitriy Novozhilov ed874262e3 [FIR] Part 3. Setup running platform checkers in CLI
^KT-58881
2024-01-24 10:45:00 +02:00