Commit Graph

2693 Commits

Author SHA1 Message Date
Mikhael Bogdanov a062eb04ac Release flag. Check conflicts with `-jvm-target' 2021-12-23 07:25:59 +00:00
Mikhael Bogdanov c2d17ded33 Release flag. Add diagnostics 2021-12-23 07:25:58 +00:00
Mikhael Bogdanov e5e3e9d326 Advanced modules supports
#KT-29974
2021-12-23 07:25:58 +00:00
Mikhael Bogdanov ae81aaa7b0 Tune module graph dependencies building 2021-12-23 07:25:57 +00:00
Mikhael Bogdanov 409d36c911 Basic -Xrelease option support
#KT-29974 Fixed
2021-12-23 07:25:57 +00:00
Mikhael Bogdanov 6026a96349 Add flag for ct.sym serch 2021-12-23 07:25:56 +00:00
Mikhael Bogdanov 22b3688493 Support sig files processing 2021-12-23 07:25:56 +00:00
Stanislav Erokhin 2436ca3d8b Temporary workaround for failing tests on teamcity.
This commit should be reverted later with testdata update
2021-12-22 18:51:20 +01:00
Anton Bannykh 4c33cb8016 [JS IR] IC: support per-module in K2JsIrCompiler 2021-12-22 10:14:33 +03:00
Anton Bannykh ca60caa7e9 [JS IR] IC: pass through the main args 2021-12-22 10:14:32 +03:00
Anton Bannykh aa628ae7b3 [JS IR] tests both per-module and regular mode 2021-12-22 10:14:08 +03:00
Anton Bannykh 95b5c44fba [JS IR] IC: emit source maps 2021-12-22 10:13:07 +03:00
sebastian.sellmair 3598ba1d45 [MPP][Test] Implement Diagnostics with mpp composite analysis tests
Using the 'MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE' test directive
will add support for testing "cli metadata compilation" and
"ide analysis" _like_ configurations. In this configuration,
dependsOn modules will not be analyzed together with dependents in
the same ModuleDescriptor, but will be passed as separate 'expectedBy'
dependency descriptor.

Used to cover ^KT-50120 inside kotlin.git
2021-12-21 21:31:42 +00:00
Mads Ager b5b1b38cb0 [FE] Do not repeatedly load inner classes from class files.
Java protobufs generate a lot of inner classes and when compiling
Kotlin wrappers for those Java protobufs the inner classes can
be loaded hundreds of times leading to out of memory. This change
avoids reloading by fixing a bug in the cache implementation that
caused inner classes to not be cached.
2021-12-21 13:23:48 +03:00
Alexander Udalov 6acb0c3d06 CLI: load module-info from META-INF/versions/... for any version
Not just 9, since at least some libraries are putting module-info to
META-INF/versions/11 nowadays.

 #KT-48027 Fixed
2021-12-20 18:59:07 +01: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
Roman Artemev 893582fa65 [JS IR] Setup config about path relativeness and normalization in config 2021-12-15 21:13:51 +03:00
Roman Artemev 526c85f820 [KLIB] Add CLI key to provide relative path base 2021-12-15 21:13:50 +03:00
Ilya Goncharov db9640c3b3 [Gradle, JS] Add gradle property for per-module/whole-program
Merge-request: KT-MR-5200
2021-12-15 09:08:45 +00:00
Roman Artemev b719865c25 [JS IR IC] Implement fast path invalidation check
Compute library md5 hash and check it first with cached one. If hashes
are equal it means that cache is up-to-date and no additional checks are
needed

 - store library hashes (flat + trans) into cache info file
 - change invalidator return value
2021-12-13 20:57:52 +03:00
Dmitriy Novozhilov 7bcd3c7948 [FIR] Add FirExtensionRegistrarAdapter to fix extension points in FE 1.0 IDE plugin
FirExtensionRegistrar is FIR specific extension which requires FIR
  classes to work, which are missing in dependencies of FE 1.0 IDE plugin.
  To fix this issue FirExtensionRegistrarAdapter is introduced. This
  class is a base class for FirExtensionRegistrar and it does not have
  any FIR specific classes in it's API, so it can be safely registered
  in IDE
2021-12-06 17:19:34 +03:00
Anton Bannykh 8c558fb6ba [JS IR] fix compilation 2021-12-05 15:38:04 +03:00
Anton Bannykh 53fe540884 [JS IR] use correct factory for new IR2JS 2021-12-05 15:38:04 +03:00
Anton Bannykh 038514ed65 [JS IR] fix IC (KT-49878 fixed) 2021-12-05 15:38:04 +03:00
Anton Bannykh bca9f19c86 [JS IR] enable new Ir2JS by default 2021-12-05 15:38:04 +03:00
Mikhael Bogdanov c0ffbe03c6 Remove '-Xjvm-default-allow-non-default-inheritance' flag. Enable such inheritance by default
#KT-47000 Fixed
2021-12-03 06:39:38 +01:00
Anastasiya Shadrina 910660a083 [FE] Add language feature for context receivers 2021-12-02 20:24:16 +03:00
Dmitriy Novozhilov ce218b8a0b [FIR] Make FirExtensionRegistrar a proper extension point
After that commit it's allowed to register any FIR plugin using
  existing extension infrastructure (`-Xplugin` CLI argument,
  plugin.xml for IDE plugins, etc)
2021-11-30 12:57:50 +03:00
Ilya Muradyan 6917ff7d2a [scripting] Move earlierScripts to the frontend descriptor
^KT-20488 fixed
2021-11-30 09:11:59 +03:00
Sergej Jaskiewicz 887e91328f [JS IR] Allow value classes in external decls
Instances of value classes are passed unboxed, unless the instance is
nullable _and_ the value class wraps another nullable value.

#KT-43224 Fixed
2021-11-29 21:51:29 +00:00
Andrey Uskov 95648f1a9e Fix incremental compilation in some compiler plugins
If compiler plugin removes source files between rounds of incremental
compilation, it may result into incorrect state of stubs. But rebuilding
stubs may require services available in UI mode only and cause
compiler failure.
This commit contains work-around allowing to avoid incorrect state of
stubs.
#KT-49340 Fixed
2021-11-26 14:25:45 +03:00
Artem Kobzar 08b0e17d47 feat(polyfills): use stdlib for js polyfills. 2021-11-26 08:14:34 +00:00
Alexander Udalov 40162dbf89 Proofread -Xjvm-default description 2021-11-25 19:42:56 +01:00
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