Commit Graph

2615 Commits

Author SHA1 Message Date
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
Ilya Goncharov 064744fae7 [JS IR] Remove redundant legacy property access property 2021-09-24 07:07:12 +00:00
Denis.Zharkov 54a97a860a FIR: Minor. Rename JavaClassConverter -> FirJavaFacade 2021-09-23 16:58:24 +03:00
Denis.Zharkov 1fc2f13a35 FIR: Pull creation of JavaClassConverter to session factory 2021-09-23 16:58:22 +03:00
Igor Yakovlev b8d11f7938 [WASM] Add text section to implement debug info 2021-09-20 19:08:21 +03:00
Dmitriy Novozhilov 8286927e8c [FIR] Support .jar output with -Xuse-fir flag
To proper support we need to fully implement main function detector,
  see KT-44557

^KT-42868 Fixed
2021-09-20 15:29:45 +03:00
Alexander Udalov 987a346015 JVM IR: support cyclic module dependencies
The only way to make the compiler compile several modules with a
dependency loop is via the "build file", given by -Xbuild-file and used
in the JPS (IntelliJ built-in build system) plugin.

For the old frontend/backend it works like this: we _analyze_ sources of
all modules once, as if it's one big module, and then for each module,
we _generate_ (invoke backend) only sources of that module. Backend
needs to be invoked separately per-module because every module has its
own destination directory specified in the build file.

For JVM IR, this separation into just two steps, analyze and generate,
was problematic because there's psi2ir, which works like frontend, in
that it needs the global analysis result to be able to create and link
IR correctly. So, in case of JVM IR, we need to run psi2ir on the whole
module after analysis and before generation.

In this change, psi2ir is run on the whole module via
`CodegenFactory.convertToIr` (which does nothing in the old backend),
and then parts of the resulting IR module are extracted according to the
original separation of the combined module into individual modules via
`getModuleChunkBackendInput` by matching IrFile against KtFile. And
then, backend is run for each such module.

 #KT-45915 Fixed
 #KT-48668 Fixed
2021-09-17 17:39:49 +02:00
Svyatoslav Kuzmich 7e399202a2 [Wasm] Support generating browser-compatible JS harness
* Use fetch and instantiateStreaming
* Call main export if it is present
* Produce a variable with module name that contains a
  promise of module exports
2021-09-16 14:14:58 +03: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 7efc9dac9b JVM IR: extract lowerings to a separate module
Together with extracting codegen to a separate (unrelated) module in the
future, hopefully it'll speed up the build of JVM IR by making it more
parallel, and helping incremental compilation to avoid recompiling code
that depends on lowerings because of `implementation` dependency.
2021-09-14 22:29:12 +02:00
Alexander Udalov eee8b033a6 JVM IR: minimize usages of jvmPhases outside backend.jvm 2021-09-14 22:29:12 +02:00
pyos 3a80cb1808 FIR: hide construction of JavaSymbolProvider 2021-09-14 19:00:45 +03:00
Roman Artemev a2e4ebd820 [JS IC] Support //RECOMPILE directive in js box tests
- change test runner to production mode when sources are being compiled
 into klib and then klib is being translated into js, not directly from
 kt to js
 - fix IC cache format
 - support IC tests
2021-09-13 13:44:55 +03:00
Aleksei.Cherepanov cc5382b37e [JPS] Fix incremental build after changing Java constant
InlineConstantTracker implemented for tracking changed java static final constants, that used in kotlin.

#KT-46506 Fixed
2021-09-11 13:00:00 +03:00
Mikhail Glukhikh 007cf2ce7c Rename AnalysisFlags.useExperimental to optIn 2021-09-10 16:29:18 +03:00
Ivan Kochurkin cfd2835254 [FIR] Add JVM Default diagnostics 2021-09-10 00:48:59 +03:00
Dmitriy Novozhilov 405670e111 Merge :compiler:fir:jvm module into :compiler:fir:java 2021-09-09 17:20:14 +03:00
Dmitriy Novozhilov 8ffe3764ef Remove dependency on descriptors from :compiler:config.jvm 2021-09-09 17:20:13 +03:00
Victor Petukhov 86d8468b8b Introduce a compiler X-flag to use the builder inference by default for all calls
^KT-48622 Fixed
2021-09-08 13:09:19 +03:00
pyos 090b90f62e FIR: load type qualifiers from module, package, and parent classes 2021-09-06 13:11:13 +03:00
Alexander Udalov 0a10cec579 Remove obsolete -X compiler arguments for JVM backend
-Xno-exception-on-explicit-equals-for-boxed-null
-Xstrict-java-nullability-assertions
-Xuse-old-spilled-var-type-analysis
-Xpolymorphic-signature
2021-09-02 22:11:22 +02:00
Alexander Udalov 1864716c83 Remove -Xnormalize-constructor-calls
Constructor call normalization is enabled by default since 1.3.
2021-09-02 22:11:22 +02:00
Denis.Zharkov c9a93eb1b5 Get rid of hard referencing to LanguageLevel entries
It should make easier to use different intellij-core versions
Some of them doesn't have JDK_15_PREVIEW while the other don't have
JDK_17, while we're ok with both of them since they support records and
sealed interfaces
2021-09-01 18:39:00 +03:00
Alexander Udalov 0213c25c9b Remove obsolete check for language version and IR backends 2021-09-01 16:30:41 +02:00
Alexander Udalov a6336ec134 Report deprecation warning when -Xuse-old-backend is specified
#KT-48532
2021-09-01 16:30:19 +02:00
Georgy Bronnikov 778b04ae34 JVM_IR: rename -Xparallel-backend-threads to -Xbackend-threads 2021-09-01 17:28:23 +03:00
Ilya Goncharov ecefda58fb [JS IR] Add separate key to enable extensions in external interfaces 2021-09-01 13:47:12 +00:00
Alexander Udalov 473ed2e410 Fix JVM target and language version info in CLI and Gradle 2021-09-01 14:32:53 +02:00
Alexander Udalov fbfbb0c72c CLI: support false and true values for boolean -X arguments
#KT-48417 Fixed
2021-08-30 19:45:03 +02:00
Alexander Udalov a37642e5af Minor, cleanup CLITool
Reformat, remove unused code which was copied to another place in
04b04ea0ee.
2021-08-30 19:45:02 +02:00
Ilmir Usmanov 1f8dd45c2b Remove experimental coroutines support. Part 2 2021-08-30 14:21:57 +03:00
ov7a 5ddf0cc7b2 JVM Cli: Proper Main-class manifest attribute for JvmStatic entry point.
`findMainClass` could handle main entry point from object and companion
object, not just top-level function.

Fixes [KT-32376](https://youtrack.jetbrains.com/issue/KT-32376).
2021-08-25 23:38:51 +02: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
Stanislav Erokhin 9becb2c468 Add compiler performance metrics
WIP
2021-08-24 16:33:12 +03:00
nataliya.valtman 64da19cb2d Add Artifact Transform stat into ES 2021-08-24 16:33:11 +03:00
Roman Artemev 22cd20781e [JS IC] Support per-file invalidation in CLI
- now disabled
2021-08-24 01:09:18 +03:00
Steven Schäfer a54503cede JVM: Add an extension point for file output 2021-08-23 18:25:33 +02:00
Ilya Chernikov caa44e413d Abstract FIR cli pipeline from core environment and related entities 2021-08-23 16:50:40 +03:00
Ilmir Usmanov 486c6b3c15 Remove obsolete experimental coroutines support
in compiler.
2021-08-13 22:31:30 +02:00
Ting-Yuan Huang 39c6be86cb K2JsIrCompiler: pass right configuration when creating lib module 2021-08-12 18:01:59 +03:00
Ting-Yuan Huang 06d3c6f233 Support repeated analysis and frontend-only-mode in K2JsIrCompiler 2021-08-12 18:01:58 +03:00
Ting-Yuan Huang e75ca75e3e K2JsIrCompiler: hoist common front-end preparation logic
Instead of creating ModuleStructure and run analysis in each backend,
the common preparation logic is moved into K2JsIrCompiler.doExecute().
2021-08-12 18:01:56 +03:00
Igor Laevsky 4ffed54f76 WASM: Fix JS runner for standalone compiles 2021-08-06 17:34:20 +03:00
Victor Petukhov dc8dbad0bc Add compiler X-flag to enable self upper bound type inference
^KT-48026 Fixed
2021-08-04 17:36:52 +03:00
Denis.Zharkov bc75a21852 Optimize Strings representation at FastJarHandler 2021-08-04 17:04:50 +03:00