Commit Graph

404 Commits

Author SHA1 Message Date
Dmitriy Novozhilov aab66bd623 [FIR] Support rendering diagnostic names in CLI FIR compiler 2022-01-28 16:12:12 +03:00
Ilya Muradyan 070f537ee9 REPL: Extract IDE-specific tests to a separate test set 2022-01-27 02:23:28 +03:00
Ilya Muradyan 9637b6b848 REPL: Fix REPL scripts metadata to be correctly recognized by class file decompiler 2022-01-27 02:23:27 +03:00
Georgy Bronnikov 6a3a375372 IR: pass DescriptorByIdSignatureFinder as parameter to DeclarationStubGeneratorimpl
This breaks dependency between serialization.common and psi2ir modules.
2022-01-27 01:02:23 +03:00
Georgy Bronnikov 3cc883cf7b IR: use DescriptorBySignatureFinder in DeclarationStubGenerator
Duplicating code that was used for the same purpose in
DeclarationStubGenerator is removed.
2022-01-27 01:02:14 +03:00
Dmitriy Novozhilov dd953908df [FE 1.0] Add compiler flag for rendering internal diagnostic names in error messages 2022-01-23 11:14:56 +03:00
Irene Dea 19bfc43bee Fixes and refactors 2022-01-08 15:25:07 +03:00
Ilya Muradyan bb34a74abb REPL: Fix completion for protected members 2021-12-24 08:34:40 +03:00
Stanislav Erokhin 61526c9700 Move AbstractJsScriptlikeCodeAnalyser to the kotlin-scripting-compiler-js module 2021-12-23 20:10:19 +03:00
Nikolay Krasko 1e378ed136 Stop publication for kotlin-scripting-compiler-js
Library is in undefined status and might be removed soon.

^KTI-741 Fixed
2021-12-23 03:46:33 +03:00
Nikolay Krasko 8ef20aa045 Remove test dependencies from kotlin-scripting-compiler-js 2021-12-23 03:46:31 +03:00
Roman Artemev e17f121b23 [JS REPL] Extract JS script/repl parts into separate module
- don't load js evaluation plugin in CLI compiler
2021-12-21 04:15:11 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Ilya Chernikov 1450f4d890 Implement property for explicit jvmTarget for script definition...
Apply the property to the default JSR-223 script taking the value from
java.specification.version property, so effectively implementing
jvmTarget detection from current VM.
Also drop enforcing of target 1.8, using common default.
#KT-49329 fixed
#KT-40497 fixed
2021-12-14 13:39:21 +03:00
Ilya Chernikov f0316cde54 [minor] test infrastructure: fix default handling in proc launcher 2021-12-14 13:39:21 +03:00
Ilya Chernikov ec2d6ea5f1 Restore script testing on both backends, fix some tests 2021-12-14 13:39:19 +03:00
Ilya Chernikov 670575696f Remove forced old backend for script compilation, using common default 2021-12-14 13:39:19 +03:00
Ilya Chernikov 6d6de9dd76 Implement tests for script instance capturing in the host tests 2021-12-14 13:39:18 +03:00
Ilya Chernikov 10c5071eda Implement backend error reporting on unsupported script capturing
#KT-30616 fixed
#KT-43995 fixed
#KT-19424 fixed
#KT-49443 fixed
2021-12-14 13:39:17 +03:00
Mikhael Bogdanov c599b58eb3 Remove obsolete options 2021-12-08 12:25:02 +01:00
Mikhael Bogdanov 0997207c7c Apply -Xjvm-default for specific modules only 2021-12-03 06:39:38 +01:00
Anastasiya Shadrina 37495bcba0 [FE] Change resolution scheme 2021-12-02 20:23:57 +03:00
Anastasiya Shadrina d923c95671 [FE] Add context receivers to scope 2021-12-02 20:23:22 +03:00
Anastasiya Shadrina a39fbd3822 [FE] Add getContextReceivers to CallableDescriptor interface 2021-12-02 20:23:17 +03:00
Ilya Muradyan 6917ff7d2a [scripting] Move earlierScripts to the frontend descriptor
^KT-20488 fixed
2021-11-30 09:11:59 +03:00
Dmitriy Novozhilov 93378b1a04 [FE 1.0] Resolve private constructors of sealed classes same as for regular classes
^KT-44866
^KT-49729
2021-11-18 13:54:05 +03:00
Mads Ager 6622846bc1 [JVM IR] Do not put destructuring params or underscores in LVT.
Putting them in the local variable table means that the debugger
needs to have special handling for parameters with specific names.
That forces us to generate mangled names for these.

Instead of also implementing the name mangling for FIR, this
change gets rid of the parameters from the LVT instead.
2021-11-02 15:13:14 +03:00
Aleksei.Cherepanov 276fb77155 Fix incremental build after changing Java const used as class property
Report Java static final constant with InlineConstantTracker, used as class property in Kotlin for further registration in JPS

#KT-49177 Fixed
2021-10-20 15:06:19 +03:00
Alexey Subach ca2f37f6eb Add possibility to get location of the script.main.kts file
#KT-48414 fixed
2021-10-11 15:45:57 +02:00
Ilya Muradyan 58831eacca [scripting] Make properties from destructing declarations available with reflection 2021-10-07 18:17:21 +03:00
Vyacheslav Gerasimov f91d6958a8 Build: Rework runtimeJar helper and drop redundant configuration
#KTI-559
2021-09-26 20:10:29 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Alexander Udalov 5d6ca27c93 JVM IR: introduce CodegenFactory.convertToIr
The steps of psi2ir and JVM backend need to be separated in the API
because in case of cyclic module dependencies (which are allowed in JPS)
psi2ir should be run first on all sources, and then JVM backend on each
module separately. `CodegenFactory.convertToIr` does nothing in the old
backend.

Also, move the ignoreErrors to GenerationState for simplicity.
2021-09-17 17:39:48 +02:00
Alexander Udalov 5df316a129 Minor, rename module backend.jvm:backend.jvm.entrypoint -> backend.jvm.entrypoint 2021-09-14 22:29:13 +02:00
Alexander Udalov eee8b033a6 JVM IR: minimize usages of jvmPhases outside backend.jvm 2021-09-14 22:29:12 +02:00
Dmitriy Novozhilov d46e2dd749 Fix OVERRIDE_DEPRECATION warnings in project code 2021-09-02 15:04:07 +03:00
Ilya Chernikov 4243bafd1d Scripting: implement correct disposal of REPL state on finalization
#KT-47927 fixed
2021-08-24 21:39:38 +03:00
Ilya Chernikov a45e31720c Make state of the default REPL compiler explicit and replaceable
restores proper object hierarchy in case the legacy REPL infrastructure
2021-08-24 21:39:37 +03:00
Ilya Chernikov e60e80f19a Scripting: improve reporting on cyclic dependency
#KT-48177 fixed
the issue is in fact fixed by the previous commit (report error
on duplicated import) by normalizing import path before processing,
but here we're making error reporting nicer for the case.
2021-08-24 21:39:33 +03:00
Ilya Muradyan 41e2deb751 Revert "[minor] Add the test confirming the wrong behavior of KT-48355"
This reverts commit d9c0b9ad5a.
2021-08-23 11:11:52 +03:00
Ilya Muradyan d9c0b9ad5a [minor] Add the test confirming the wrong behavior of KT-48355 2021-08-22 03:28:36 +03:00
Jinseong Jeon 5819959cce Consolidate arrayOf call names 2021-08-18 16:04:36 +03:00
Hung Nguyen 170184dce4 KT-45777: Refactor RuntimeModuleData to support classpath snapshotting
We are working on a feature in the Kotlin Gradle plugin called
`kotlin.incremental.useClasspathSnapshot` to improve incremental
Kotlin compilation.

In this feature, we need to extract ABI information from a .class file.
If the .class file is a Kotlin class, this info can be found in the
class header data. But if the .class file is a Java class, this info is
not readily available.

The RuntimeModuleData class in the ':core:descriptors.runtime' project
can help with that: It uses reflection to generate `ClassDescriptor`s.

However, reflection requires a full classpath to work correctly, whereas
we want to generate a `ClassDescriptor` directly for each class file
(also, reflection is probably slow).

To address that, this commit refactors RuntimeModuleData so that it can
support a generic Kotlin/JavaClassFinder, which can be based on either
reflection or bytecode analysis. The existing code continues to use
reflection while the new feature will use bytecode analysis (e.g., using
the existing BinaryJavaClass).

Bug: KT-45777
Test: Existing tests should pass (this is a refactoring-only change)
2021-08-10 12:29:44 +03:00
Ilya Chernikov df9a3c0300 Restore scripting-ide-services testing, fix coroutines dependency 2021-07-26 21:16:50 +03:00
Denis.Zharkov ea5157cadc Change type of KotlinCoreEnvironment::projectEnvironment type 2021-07-23 21:38:45 +03:00
Nikita Bobko 39fa2b0baf Delete Kotlin IntelliJ IDEA plugin sources
Kotlin plugin sources were migrated to intellij-community:
https://github.com/JetBrains/intellij-community/tree/master/plugins/kotlin

Preserve `jps-plugin/testData/incremental`
because it's used in `compiler/incremental-compilation-impl/test`

Preserve `idea/testData/multiModuleHighlighting/multiplatform`
because it's used in `MppHighlightingTestDataWithGradleIT`
2021-07-21 11:23:43 +02:00
Ilya Muradyan 46bbe5b1cb Replace Ivy resolver with Maven resolver in all places 2021-07-19 21:31:49 +03:00
Ilya Chernikov 0cd29adcc7 Get rid of kotlinx-coroutines usage in scripting libs and plugins
the dependency on the coroutines library caused various problems like
KT-30778, or stdlib/runtime version conflicts.
The only function used was `runBlocking`, so this change replaces it
with the internal implementation based on the similar internal thing
from the stdlib.
#KT-30778 fixed
2021-07-19 16:35:36 +03:00
Ilya Chernikov dee0487185 IR: Refactor IrBuiltIns to abstract it from descriptors 2021-07-16 02:24:18 +03:00