Commit Graph

2659 Commits

Author SHA1 Message Date
Ilya Goncharov 98bedf7eed [IR] More user-friendly compilation exceptions from lowerings and JS codegen
Merge-request: KT-MR-5004
2021-11-25 13:21:34 +00:00
Stanislav Erokhin 8a0969156f Do not set "idea.plugins.compatible.build" -- fix plugin update issue
In the IDEA plugin update there are a code that used system property
"idea.plugins.compatible.build" to calculate the IDEA version
that will be sent to plugin marketplace to download last version of
the plugins. It seems like by some reason setupIdeaStandaloneExecution()
was called from the IDEA thread and because of that idea version was
calculated incorrectly and incorrect version of the plugins was
downloaded.

It is still unclear how the setupIdeaStandaloneExecution() could be
called from the IDEA, so added logging for that.

Relevant issue: MP-3702
Relevant code in the IDEA:
- ApplicationInfoImpl.getPluginsCompatibleBuildAsNumber
2021-11-25 15:50:37 +03:00
Roman Artemev a01d9b77c3 [JS IR] Delegate invalidated files processing to the caller
This change is needed to test invalidation somehow
2021-11-25 11:22:45 +03:00
Roman Artemev 7d8f71d107 [JS IR] Add CLI flag and configuration key about partial linkage
- make possible to turn on/off linkage if klib contains unbound symbols
 - update jsExtraHelp test data
2021-11-19 01:16:32 +03:00
Anton Bannykh 75368a2c06 [JS IR] tie together IC code in tests and K2JsIrCompiler 2021-11-19 00:39:37 +03:00
Anton Bannykh 1ae042edc3 [JS IR] make old Ir2Js pass all tests 2021-11-19 00:38:46 +03:00
Anton Bannykh d565cc4262 [JS IR] support new Ir2Js in tests and in K2JsTranslator 2021-11-19 00:38:42 +03:00
Ivan Gavrilovic 684273783f Kotlin Gradle Plugin - clean caches for in-process compilation
This is to prevent file handle leaks on Windows. This
commit disposes KotlinCoreEnvironment used during
in-process compilation.

^KT-49772 Fixed
2021-11-18 16:20:10 +01:00
Alexander Udalov a7fef487c1 JVM IR: fix support of cyclic module dependencies
Previous episode was at 987a3460 (KT-45915).

Apparently, it's not enough to run psi2ir for all modules, and then
backend for all modules. If there are several modules in the chunk, IR
in any one of them can reference IR of any other one after psi2ir.

So we would end up in a situation where we're running codegen for the
first module, but the second module is completely unlowered. This would
break some assumptions in the codegen, for example in KT-49575, codegen
would see a reference to a top-level function from another module, and
would fail because the function has no containing class (since file
facades have not been generated yet!), and thus must be an intrinsic,
yet no such intrinsic is known to the codegen.

The solution is to run lowerings first on all modules, and then run
codegen on all modules. The kind of error explained above shouldn't be
possible anymore, because lowerings have to deal both with lowered and
unlowered code from other files all the time, so lowerings can't assume
that reference from other module is lowered either (or unlowered).

The code is not very nice, but hopefully it can be improved as soon as
we get rid of the old JVM backend (and maybe later with the migration to
FIR too).

 #KT-49575 Fixed
2021-11-16 20:20:20 +01:00
Alexander Udalov f701f04326 JVM IR: move jvmPhases to backend.jvm.entrypoint
This will be used for two purposes:
1) call lowerings and codegen separately from
   KotlinToJVMBytecodeCompiler to support cyclical module dependencies
   (KT-49575)
2) split lowerings and codegen into separate modules
2021-11-16 20:20:19 +01:00
Alexander Udalov 38273e6b3c Minor, remove comments in JvmContentRoots.kt, suppress unused
The kdocs were almost self-evident, as opposed to the fact that
JvmClasspathRoot is unused in the project, which could make it a victim
of an innocent refactoring.
2021-11-16 02:20:52 +01:00
aragos 466acc6132 Allow the usage of virtual JVM content roots in kotlinc (#4645) 2021-11-16 02:20:40 +01:00
Igor Yakovlev ee7f4c7278 [WASM] Implementation typeOf support 2021-11-15 19:53:48 +03:00
Xin Wang b24c3a106e CLI: Allow running class files with '.class' extension in 'kotlin' script
Catch NoClassDefFoundError and print message with cause.

 #KT-11164 Fixed
 #KT-46171 Fixed
2021-11-14 18:50:39 +01:00
Artem Kobzar 7aa8de55a5 fix(use strict): move global this polyfill after "use strict" pragma. 2021-11-12 15:59:27 +00:00
Svyatoslav Kuzmich 3aafb76077 [Wasm] Enable name section in CLI by default 2021-11-12 18:44:47 +03:00
Alexander Udalov 73f0540d5b Remove runtime jar files version checker
... and the compiler argument -Xskip-runtime-version-check.

The vast majority of warnings reported by this checker in practice has
proven to be false positives. In addition to that, it was needlessly
verbose, and also completely untested.

If we decide to reintroduce some of these checks, it's probably a better
idea to perform them in tools, such as Kotlin Gradle plugin, which
usually have slightly more information about the way the project is
built and can suggest some meaningful solutions (as opposed to "remove
this jar $HOME/.gradle/... from the classpath" which was the best
JvmRuntimeVersionsConsistencyChecker could do.)

 #KT-27256 Obsolete
 #KT-41664 Fixed
2021-11-09 14:56:10 +01:00
Igor Laevsky 43eeaa925f [Wasm] Add ability to choose flavor for the wasm launcher 2021-11-03 16:23:01 +03:00
Mikhael Bogdanov 40158d1ce6 Update -Xjvm-default description 2021-11-01 13:30:58 +01:00
Mikhael Bogdanov afc149d460 JvmDefault. Allow non default inheritance with special flag
#KT-47000
2021-11-01 13:30:57 +01:00
Artem Kobzar 979e9f94ef feat(Escaped Identifiers): add ability to use any symbol wrapped in back ticks. 2021-10-29 17:55:59 +00:00
Ilya Chernikov 70366dc7a6 Refactor diagnostic & result reporters...
to better reflect actual roles
2021-10-27 22:17:41 +02:00
Ilya Chernikov fc176e9845 Refactor IR reporting and infrastructure 2021-10-27 22:17:41 +02:00
Ilya Chernikov da2d3f29da Add multiple renderer sources support to new diagnostics infrastructure 2021-10-27 22:17:41 +02:00
Ilya Chernikov 1ce4075112 Prepare CLI reporting infrastructure for non-PSI diagnostics 2021-10-27 22:17:40 +02:00
Ilya Chernikov 9e60c70db7 Add abstract source element and switch diagnostics to it 2021-10-27 22:17:40 +02:00
Ilya Chernikov e9f59e8d1d Move common diagnostics infrastructure to frontend.common 2021-10-27 22:17:39 +02:00
Ilya Chernikov 31c58767cf Rearrange fir diagnostic for further reuse 2021-10-27 22:17:39 +02:00
Ilya Chernikov a65beb2dc5 Move Fir*SourceElement to frontend.common, rename to Kt* (complete) 2021-10-27 21:44:11 +02:00
Victor Petukhov 012f1f6013 Introduce a compiler X flag to enable enhancing not null annotated type parameter's types to definitely not null types 2021-10-26 19:37:59 +03:00
Ilya Gorbunov 4e6243c4f7 Restore useIR Gradle option as HIDDEN (KT-45504)
This will allow to KEEP binary compatibility with
the Compose plugin 1.0.1 for a bit longer

Merge-request: KT-MR-4857
2021-10-26 15:37:31 +00:00
Mikhail Glukhikh 37b95972db Uncomment warning about -Xopt-in deprecation 2021-10-26 13:38:40 +03:00
Ivan Kochurkin c13822a2c5 Optimize containsKey -> get pattern 2021-10-25 21:21:44 +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
Dmitriy Novozhilov bee44c6e0f [FIR] Split :compiler:fir:resolve module into three different modules
Those modules are:
- :compiler:fir:providers, which contains Fir and Symbol providers,
    scopes, and different utilities used by them
- :compiler:fir:semantics, which contains different abstractions and
    entities which are used in resolution and in checkers
- :compiler:fir:resolve, which contains all stuff related to resolution
    and inference

There are two pros of this change:
1. It may increase gradle build, because it allows to compile :fir:resolve
  and :fir:checkers modules in parallel
2. Logic of working FIR (scopes, providers, DFA logic system, etc) is
  now separated from logic of resolution phases, so for example checkers,
  which are depend on scopes physically will not be able to run resolve
  in any way
2021-10-18 11:10:47 +03:00
Anton Bannykh 546ce501cb [JS IR] run IC box tests 2021-10-15 20:14:51 +03:00
Svyatoslav Kuzmich 0f66f85cf9 [Wasm] Support main function 2021-10-15 13:58:55 +03:00
Igor Laevsky bede039c08 [Wasm] Add compiler support for the kotlin.test library 2021-10-14 17:24:05 +03:00
Svyatoslav Kuzmich 3f8dce4b53 [JS IR] Support per-file mode and ES modules 2021-10-12 23:29:39 +03:00
Dmitriy Novozhilov fc1f2e9c72 [FIR2IR] Run IrGenerationExtensions after fir2ir stage 2021-10-12 17:26:38 +03:00
Georgy Bronnikov 4caa71538d JVM_IR: introduce modes for IR serialization
Instead of a Boolean flag -Xserialize-ir, use modes: none,inline,all.
In "inline" mode, only information needed to deserialize bodies of inline
functions is serialized.
In the "all" mode, all declarations are serialized completely.
2021-10-11 11:53:29 +03:00
Simon Ogorodnik 64a30cd95e KT-44765: Fix classloader leak in CoreJrtFileSystem 2021-10-08 04:09:56 +03:00
Denis.Zharkov 0d072de737 Do not check package validness for ones that we just checked already 2021-10-07 17:26:28 +03:00
Ilya Goncharov 01fbe6bacc [JS IR] Use property lazy initialization by default 2021-10-01 13:32:11 +00:00
Alexander Udalov aa247726b6 Prohibit using old JVM backend with LV >= 1.6
#KT-48928 Fixed
2021-09-30 13:56:34 +02:00
Ilya Gorbunov ec5c06238d Split language and api version lifetimes, restore apiVersion 1.3 support
KT-49007
2021-09-29 21:46:53 +03:00
Ilya Gorbunov 47adc4fdaa Prolong -no-stdlib option lifetime and regenerate Gradle compilation options
-no-stdlib may still be required internally for kotlin gradle plugin
to launch the compiler with the correct options.
2021-09-29 21:46:52 +03:00
Svyatoslav Kuzmich 841f5a583e [Wasm] Support wasm target in multiplatform plugin 2021-09-28 18:26:07 +03:00
nataliya.valtman 452dfd6edd Use default performance manager for K2JVMCompiler 2021-09-28 09:20:50 +00: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