Commit Graph

2309 Commits

Author SHA1 Message Date
Andrey Uskov f07f193938 Make line number field public in PerformanceMeasurement
Required for KT-55537
2022-12-26 17:16:02 +03:00
Dmitriy Novozhilov 5d6cb2b691 [Test] Use IrPluginContext for searching declarations for DUMP_EXTERNAL_CLASS check 2022-12-09 12:02:07 +00:00
Sergej Jaskiewicz 1539d7ef1a [klib] Bring package names in sync with the directory layout
Basically, some package names were Native-specific, whilst the packages
themselves were not Native-specific at all. This was already reflected
in the directory layout, but not in the package names.
This is fixed here.

NFC, just an automatic rename of packages with fixes of imports.
2022-12-01 21:46:43 +00:00
Sergey Bogolepov c22cad07ed Introduce FlexiblePhaseConfig
For dynamic Kotlin/Native driver we need a PhaseConfigurationService
that does not force us to provide a list of phases upfront.
2022-11-30 11:24:38 +00:00
Mikhael Bogdanov edc54524aa Xjdk-release: support mixed compilation of Java and Kotlin
#KT-52815 Fixed
2022-11-14 06:57:12 +00:00
Xin Wang 7b3ce35613 JVM_IR: Prevent writing output after an error is reported
#KT-53825 Fixed
2022-11-09 23:14:11 +01:00
Ilya Chernikov 23144b92d8 Fix FastJarFS caches cleaning
- add FastJarFS cache cleaning to the daemon implementation, so
the behavior is now the same as for CoreJarFS
- clear not only mappings but also handlers cache: this may result some
slowdown on comparison with the previous cleaning implementation,
but should avoid unreliable behavior on heavy parallel build usages.
2022-10-31 16:02:50 +00:00
Ilya Chernikov 8566589cf5 Add minimal roots deduplication on classpath update
duplication was detected e.g. in some scripting scenarios
2022-10-21 06:11:42 +00:00
Ilya Chernikov b50a803b6f Make jdk root processing more robust
#KT-54337 fixed
2022-10-21 06:11:42 +00:00
Ilya Chernikov 7d5257c258 Preserve FastJarFS in app env and implement intermediate cleanup
FastJarFS was behaving differently than the regular CoreJarFS it
tries to replace, namely it was cleaned after each compilation
(had the lifetime tied to core env).
This commit preserve it in the app env the same way as CoreJarFS,
so it could be reused in parallel builds and preserved if automatic
cleanup of the app env is turned off,
But since FastJarFS caches also mmf handles, the additional handles
cleaning is introduced that triggers after all possibly parallel
compilations are finished.
2022-10-21 06:11:41 +00:00
Ilya Chernikov 61e9aaf113 Convert java to kotlin 2022-10-21 06:11:41 +00:00
Ilya Chernikov bccfc2ad18 Rename .java to .kt 2022-10-21 06:11:40 +00:00
Ilya Chernikov 6627b62c21 Fix sources extraction when processing extension is on
The latter is used e.g. for scripts in source roots handling
as implemented in the commit
"Scripting: update scripts in source roots handling"
The former implementation did not covered all the cases.

#KT-54355 fixed
2022-10-18 16:29:06 +00:00
Ivan Kochurkin 40a01180ff [FIR] Move createSessionWithDependencies and createEmptySession into FirSessionFactoryHelper 2022-10-13 18:11:48 +00:00
Dmitriy Novozhilov d423782fac [FE 1.0] Remove usages of safeAs and cast from most of FE 1.0 modules:
- :core:descriptors
- :core:descriptors.jvm
- :core:deserialization
- :compiler:cli
- :compiler:frontend
- :compiler:frontend:cfg
- :compiler:frontend.java
- :compiler:frontend.common.jvm
- :compiler:psi
- :compiler:resolution
- :compiler:resolution.common
- :compiler:resolution.common.jvm
- :kotlin-reflect-api
2022-10-12 13:58:56 +00:00
Denis.Zharkov d9701c71b7 Minor. Clean ZipImplementation.kt 2022-10-05 15:03:41 +00:00
Denis.Zharkov 337f461ad8 Fix IndexOutOfBoundsException at FastJarFS
If there are more than 0xffff files in the jar,
we have to use Zip64 format

^KT-52786 Fixed
2022-10-05 15:03:41 +00:00
Simon Ogorodnik 53069ee03f Fix application disposer registered only once due to deduplication
Disposer uses passed object identity to decide should it be registered
Since lambda, that passed into disposer doesn't capture anything, it has
only one instance, so it ends up being registered only once
While it should be registered for every parentDisposable
2022-10-03 13:36:05 +00:00
Simon Ogorodnik f2dee2bf85 Core. Fix data-race in ApplicationEnvironment initialization
getOrCreateApplicationEnvironment is main entrypoint to create
ApplicationEnvironment in production and compiler tests
It is subject to be called concurrently, that's why
APPLICATION_LOCK exists

ApplicationEnvironment itself hosts Application from idea-core
It is actually singleton, that is subject to be disposed, once all
operations referencing it completes

To properly dispose ApplicationEnvironment when there is no references
left, we maintain reference counter aka ourProjectCount

Originally, there was data-race caused by the fact, that ourProjectCount
was updated after publication of application

Linear, data-race occurs in following order
T1: getOrCreateApplicationEnvironment returns application
T2: Disposes its reference to application, causing ourProjectCount to
reach zero, and disposing application that is already available to T1
T1: Updates counter, but its application already disposed
2022-10-03 13:36:05 +00:00
Alexander Udalov 4a00d1f978 Add internal way to enable old backend
Needed for tests on debugger in Kotlin IDE plugin.
2022-09-26 13:35:41 +00:00
Anže Sodja 09d6dfc8bf [Assign plugin] Add a compiler plugin for overloading assign ('=') operator 2022-09-16 10:12:41 +03:00
Anže Sodja 6052962f50 Register AssignResolutionAltererExtension in KotlinCoreEnvironment 2022-09-16 10:12:41 +03:00
Alexander Udalov 0569f429dd Report error on -Xuse-old-backend, remove Gradle option useOldBackend
Allow using old JVM backend only to compile kts.

 #KT-48532 Fixed
2022-09-16 00:16:31 +02:00
Aleksei.Cherepanov 782dc55800 Make exception more user-friendly (2)
Add stacktrace and given error to error message

#KTIJ-21077 Fixed


Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>

Merge-request: KT-MR-7122
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2022-09-15 13:33:11 +00:00
Aleksei.Cherepanov 0d1b748cd5 Make exception more user-friendly
Accompany registration of non-compatible compiler plugin with readable error

#KTIJ-21077 Fixed
2022-09-14 10:30:42 +00:00
Mikhail Glukhikh 036f9affd8 K2: link via signatures if -Xlink-via-signatures is set
Related to KT-53505
2022-09-14 10:15:22 +00:00
Alexander Udalov 7dad47cd76 Add -X argument to disable generation of @SourceDebugExtension
This will be used in tests in the subsequent commit.
2022-09-09 14:32:35 +02:00
Dmitry Gridin aa31ca67e2 [lc] KotlinAsJavaSupportBase: make librariesTracker abstract
^KT-50241
2022-09-08 13:47:40 +00:00
Dmitry Gridin ec1b6f4f3e [lc] KotlinAsJavaSupportBase: reduce number of findModule calls
^KT-50241
2022-09-08 13:47:39 +00:00
Dmitry Gridin e58b98bb5c [lc] KotlinAsJavaSupportBase: implement getLightClassForScript
^KT-50241
2022-09-08 13:47:39 +00:00
Dmitry Gridin 46548e5443 [lc] KotlinAsJavaSupportBase: implement getLightClass
add more caching

^KT-50241
2022-09-08 13:47:38 +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
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 a76de14026 Remove obsolete compiler argument -Xsingle-module
#KT-51622
2022-08-31 20:54:50 +02:00
Mikhael Bogdanov bd6aff7f6a Xjdk-release: avoid folder duplication 2022-08-29 12:26:27 +00:00
Dmitry Gridin 924dd38144 [lc] introduce KotlinAsJavaSupportBase with new common facade logic
^KT-53543
2022-08-29 11:51:42 +00:00
Alexander Udalov 690322b203 Add flag -Xno-new-java-annotation-targets
Do not generate TYPE_USE/TYPE_PARAMETER Java annotation targets when
this flag is specified.

 #KT-53712 Fixed
2022-08-29 13:43:49 +02:00
Ivan Kylchik 3027ea9551 Add new jvm compilation key ignoreConstOptimizationErrors
This key suppose to be a workaround in keys if something goes
wrong in ir interpreter.
2022-08-18 16:50:06 +00:00
Andrey Uskov 339868305e Fixed handling of special symbols in paths when reporting errors
#KT-53246 Fixed
2022-08-17 10:38:28 +04:00
Aleksei.Cherepanov df017ea187 Clean JavaClassesTracker and LookupTracker on call RetryWithAdditionalRoots
#KT-38576 Fixed
2022-08-16 14:38:01 +00:00
Abduqodiri Qurbonzoda 983c7adb1e Remove :libraries:tools:stdlib-compiler-classpath project
It was used as a workaround to allow jvmTarget=1.6 in stdlib.
2022-08-13 01:42:43 +03:00
Jiaxiang Chen 94abeb64c5 use top level classId for looking up java classes in KotlinCliJavaFileManagerImpl 2022-08-12 14:24:13 +02:00
Aleksei.Cherepanov 92551b7685 Prevent overwriting output dir to empty string
#KTIJ-921 Fixed

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>

Merge-request: KT-MR-6183
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2022-08-03 14:46:32 +00:00
Mikhael Bogdanov 90f8f8e14e Support inner classes in -Xjdk-release
#KT-52823 Fixed
2022-08-02 04:56:20 +00:00
Ivan Kochurkin 2f56b29b3f [FIR] Extract FirSessionConfigurator and IncrementalCompilationContext to separated classes
With FirSessionFactory and FirJsSessionFactory
2022-07-25 23:30:09 +02:00
Mikhail Glukhikh 9add6f3d55 K2: add more accurate & more automatic control of diagnostic suppression
#KT-51363 Fixed
2022-07-22 11:35:26 +00:00
Dmitriy Novozhilov b2e558a174 [CLI] Make -Xcompiler-plugin experimental and K2 only 2022-07-20 09:07:27 +00:00
Dmitriy Novozhilov 928416c9c5 [CLI] Introduce new compiler arguments for registering compiler plugins
With new syntax each plugin should be registered in separate argument with syntax
`-Xcompiler-plugin=classpath1,classpath2[=argument1=value1,argument2=value2]`
2022-07-20 09:07:26 +00:00
Dmitry Gridin 0e17d9b452 [light classes] extract KotlinLightClassFactory to service
^KT-53097
2022-07-19 15:42:07 +00:00
Dmitry Gridin e5519064f4 [light classes] move script creation logic to KotlinLightClassFactory
^KT-53097
2022-07-19 15:41:45 +00:00