Commit Graph

684 Commits

Author SHA1 Message Date
Alexander Udalov 7952e8b28f Add JVM target bytecode version 18
#KT-51309 Fixed
2022-02-14 21:21:57 +01:00
Victor Petukhov 78f4b9f1cd [FE 1.0] Fix mistakes in error messages for resolution ambiguity with stub types
^KT-51022 Fixed
2022-02-14 15:43:47 +03:00
Svyatoslav Kuzmich 4636f71076 [Wasm] Loader improvements
- Output ES modules instead of plain files
- Support -Xwasm-launcher=d8 for d8 shell used in tests and benchmarks.
- Reuse launcher generation logic in CLI and box tests runners.
- Create separate output directory for each box since
  there are multiple output files generated for each test.
- Stop using absolute paths in generate JS files
  to simplify running generated code on different machine
- Remove ">>>" from println output


Merge-request: KT-MR-5729
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2022-02-10 22:59:44 +00:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Alexander Udalov 6601b8b62c Write snapshot by chunks in ProfilingCompilerPerformanceManager.dumpProfile
To prevent OutOfMemoryError from converting the whole string to byte
array, in case the snapshot is very big (see KT-51058).

Also, remove 'framebuf' option from -Xprofile help, since async-profiler
2.0+ has unlimited frame buffer.
2022-02-03 22:09:44 +01:00
Alexander Udalov 9826172720 CLI: support "arg=value" for argument's deprecatedName
#KT-51093 Fixed
2022-02-03 16:23:12 +01:00
Alexander Udalov 6379fe4c4c JVM IR: link via descriptors instead of signatures by default
Doing so speeds up psi2ir ~2 times, and thus improves total compiler
performance by about 6-8%.

Unless JVM IR is in the mode where linking via signatures is the only
way (-Xserialize-ir, -Xklib), signatures are actually not needed at all,
SymbolTable can use the frontend representation (descriptors for FE1.0,
and hopefully FIR elements for K2) as hash table keys. The only catch is
that since other backends still need to work with signatures, all the
common IR utilities, such as irTypePredicates.kt, need to work correctly
for IR elements both with signatures and without.

Also, introduce a fallback compiler flag -Xlink-via-signatures, in case
something goes wrong, to be able to troubleshoot and workaround any
issues.

 #KT-48233
2022-02-03 02:48:05 +01:00
Mikhail Glukhikh eeadd8588d Drop CommonCompilerArguments.optInDeprecated
On the way to KT-22956
2022-01-27 11:48:22 +00: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
Andrey Uskov 2adc851f1b Don't use global state for keeping incremental compilation state
Previously IC state was stored in System properties. As result parallel
compilation might cause incorrect state of IC, what led to corruption
of kotlin_module files. Now IC state is stored via CompilerArguments
and CompilerConfiguration
#KT-46038 Fixed
2022-01-12 13:37:46 +03:00
Alexander Udalov 9a9a8f1999 Restore support of language version 1.3
#KT-50251 Fixed

(cherry picked from commit a0004ed03adc9f50f26c8b11d178afcc2abf2a9c)
2021-12-28 13:21:18 +01:00
Roman Artemev 353bfe9018 [JS IR] Cleanup pir IC code 2021-12-24 16:50:40 +03:00
Mikhael Bogdanov 860d0a4296 Add cli test with default JDK8 and -Xjdk-release=1.8 2021-12-23 07:26:01 +00:00
Mikhael Bogdanov a6052dce44 -Xjdk-release. Review fixes 2021-12-23 07:26:01 +00:00
Mikhael Bogdanov b8ca22da87 Update extraHelp test 2021-12-23 07:26:00 +00:00
Roman Artemev 526c85f820 [KLIB] Add CLI key to provide relative path base 2021-12-15 21:13:50 +03:00
Victor Petukhov 7475d26902 [FE 1.0] Implement checker to detect changed resolve for progressions and ranges due to the start of implementing Collection<T>
^KT-49276 Fixed
2021-12-07 18:48:27 +03:00
Mikhael Bogdanov 0997207c7c Apply -Xjvm-default for specific modules only 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
Mikhail Glukhikh cebe25ff39 FE: don't create KtFile stubs on virtual files without ids
This commit is kinda revert of the change in platform 203:
https://github.com/JetBrains/intellij-community/commit/5d91f7bf2e5718d715c0d90ed1a212ea845fb2a3

#KT-49833 Fixed
2021-11-29 18:42:23 +03:00
Mikhail Glukhikh d16b5c8bd8 FE: make error message more precise #KT-49598 Fixed 2021-11-28 11:32:11 +03:00
Mikhail Glukhikh 4550999288 FE: use proper version in version requirement error message
#KT-48690 Fixed
2021-11-28 11:31:51 +03:00
Alexander Udalov 40162dbf89 Proofread -Xjvm-default description 2021-11-25 19:42:56 +01: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 d565cc4262 [JS IR] support new Ir2Js in tests and in K2JsTranslator 2021-11-19 00:38:42 +03: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
Igor Yakovlev ee7f4c7278 [WASM] Implementation typeOf support 2021-11-15 19:53:48 +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
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
Mikhail Glukhikh 37b95972db Uncomment warning about -Xopt-in deprecation 2021-10-26 13:38:40 +03:00
Dmitriy Novozhilov f7bb55433d Add LanguageVersion and ApiVersion for 1.8 2021-10-25 12:54:10 +03:00
Svyatoslav Kuzmich 3f8dce4b53 [JS IR] Support per-file mode and ES modules 2021-10-12 23:29:39 +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
Victor Petukhov 70d70b9042 Use warn mode by default for jspecify nullability annotations in 1.6
^KT-48851 Fixed
2021-09-30 20:08:35 +03: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 Kirillov 451464d635 FIR: do not leak ConeTypeVariableType via diagnostics
ConeTypeVariableType is an internal part of type inference
and should not be leaked outside it
2021-09-30 01:45:57 +03: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
Dmitriy Novozhilov ce3562f0e8 Migrate all JDK 15 related tests to JDK 17 2021-09-28 13:01:45 +03:00
Ilya Goncharov 064744fae7 [JS IR] Remove redundant legacy property access property 2021-09-24 07:07:12 +00:00
Igor Yakovlev b8d11f7938 [WASM] Add text section to implement debug info 2021-09-20 19:08:21 +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
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
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
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