Commit Graph

694 Commits

Author SHA1 Message Date
Victor Petukhov 25a06bdc56 [Compiler CLI] Make language version description not in capital letters
^KT-51673 Fixed
2022-03-22 13:41:46 +00:00
Alexander Udalov 07ebf4ed29 Do not suppress errors with -Xsuppress-version-warnings
#KT-48833 Fixed
2022-03-18 12:28:28 +01:00
Mikhail Glukhikh 5810ac01d2 FE1.0/FIR: slightly fix diagnostic messages about OptIn 2022-03-15 13:08:19 +00:00
Mikhail Glukhikh 779aa75855 Make FE1.0/FIR OptIn override message more clear 2022-03-10 09:09:51 +00:00
Mikhail Glukhikh d823020c07 Make FIR/FE1.0 report similar OptIn messages 2022-03-10 09:09:50 +00:00
Mikhail Glukhikh b42c236fb3 Replace blank messages in OptIn diagnostics #KT-51358 Fixed 2022-03-10 09:09:50 +00:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Mikhail Glukhikh 8274c43ee6 Make useExperimental non-CLI argument 2022-02-21 22:32:53 +03:00
Dmitriy Novozhilov 23af5510a6 [FIR] Render full declaration header in diagnostic messages 2022-02-18 17:44:38 +03:00
Victor Petukhov 683a3e74a0 [Compiler CLI] Implement reading language version settings from environment variable
^KT-51306 Fixed
2022-02-16 18:41:50 +03:00
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