Commit Graph

763 Commits

Author SHA1 Message Date
Pavel Mikhailovskii 6a14400342 KT-53804 Restore old and incorrect logic of generating InnerClasses attributes for kotlin-stdlib 2022-09-05 14:02:52 +00:00
Alexander Udalov a76de14026 Remove obsolete compiler argument -Xsingle-module
#KT-51622
2022-08-31 20:54:50 +02:00
Alexander Udalov 690322b203 Add flag -Xno-new-java-annotation-targets
Do not generate TYPE_USE/TYPE_PARAMETER Java annotation targets when
this flag is specified.

 #KT-53712 Fixed
2022-08-29 13:43:49 +02:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 0874fb71c6 Replace all kotlin-reflect-api dependencies with kotlin-reflect
Review: https://jetbrains.team/p/kt/reviews/6753

Why: I'm going to replace source dependency on kotlin-reflect with
binary dependency. Normalize reflect dependency before global
processing.
2022-08-22 15:43:11 +02:00
Dmitriy Novozhilov f843883985 [FE 1.0] Introduce AssignResolutionAltererExtension
This extension can be used to override resolution of assign statements
  with custom logic

WARNING: there is no compatibility guarantees for this extension
2022-08-19 07:44:08 +00:00
Ivan Kylchik 3027ea9551 Add new jvm compilation key ignoreConstOptimizationErrors
This key suppose to be a workaround in keys if something goes
wrong in ir interpreter.
2022-08-18 16:50:06 +00:00
Artem Kobzar 87038e7d8a [K/JS] feat: add logic under the flag for strict implicit export generating inside d.ts files. 2022-08-09 16:48:59 +00:00
Igor Chevdar 030e3b306f [K/N][build] Added -Xmake-per-file-cache compiler option 2022-08-06 17:40:24 +00:00
Igor Chevdar 7e79b2b500 [K/N][IR][codegen] Preliminary support of per-file caches 2022-08-06 17:40:23 +00:00
Sergey Bogolepov cd54afea8f [K/N] Add option to omit generation of binary when producing framework
`-Xomit-framework-binary` is useful when the user does not care about
generated machine code, but only about its public interface.
Current use-case is for development purposes only: to iterate faster
on ObjCExport. But potentially it can be turned into user-facing feature
2022-07-22 11:57:15 +00:00
Dmitriy Novozhilov 928416c9c5 [CLI] Introduce new compiler arguments for registering compiler plugins
With new syntax each plugin should be registered in separate argument with syntax
`-Xcompiler-plugin=classpath1,classpath2[=argument1=value1,argument2=value2]`
2022-07-20 09:07:26 +00:00
Yahor Berdnikau 603d043abc Move Kotlin/Native compiler arguments into :compiler:cli:cli-common
This allows to reference them in the Gradle plugins without enabling
kotlin-native part of the repository

^KT-53108 In Progress
2022-07-14 10:57:28 +00:00
Nikita Nazarov 2ab92bcb7e Add a key to enable spilling of all variables in a suspending context
This commit adds a new key that will allow users to enhance their
debugging experience in suspending contexts when using the IR backend.
After the key is enabled, the following things are changed:
1. All variables in a suspending context are spilled regardless their
liveness.
2. Their LVT records are not shrunk.
3. ACONST_NULL is not spilled to dead variables.

#KT-48678 In progress

(cherry picked from commit 38d97d0621)
2022-07-07 14:51:24 +03:00
Nikolay Krasko c6299ee277 Revert "Add a key to enable spilling of all variables in a suspending context"
This reverts commit 38d97d0621.
2022-07-05 11:04:50 +00:00
Nikita Nazarov 38d97d0621 Add a key to enable spilling of all variables in a suspending context
This commit adds a new key that will allow users to enhance their
debugging experience in suspending contexts when using the IR backend.
After the key is enabled, the following things are changed:
1. All variables in a suspending context are spilled regardless their
liveness.
2. Their LVT records are not shrunk.
3. ACONST_NULL is not spilled to dead variables.

#KT-48678 In progress
2022-07-02 18:29:18 +03:00
Dmitriy Novozhilov 1a8496757e [Compiler] Mark all entrypoints to compiler API as experimental 2022-06-29 12:00:01 +00:00
Dmitriy Novozhilov 65e240679e [FE] Move utility of parsing plugin options to :compiler:frontend.common
This is needed to be able to use this utility inside FIR part of IDE plugin
2022-06-29 12:00:00 +00:00
Alexander Udalov 2a9fd47755 Minor, update JVM target versions in -Xjdk-release help 2022-06-17 10:40:35 +00:00
Ilya Chernikov 855059b93c Scripting: update scripts in source roots handling
#KT-52525 fixed
related to #KT-52735
2022-06-16 21:28:06 +00:00
Ilya Chernikov bffe94e48a minor: simplify dependencies of setIdeaIoUseFallback
since kotlin needs now jvm 8 or above, we can drop the checks
2022-06-16 21:28:05 +00:00
Ilya Chernikov 597677dae3 Scripting: refactor history handling in legacy REPL using new infra
#KT-47187 fixed
2022-06-16 21:28:03 +00:00
Ilya Chernikov 92bf260057 Scripting: Implement conditional conversion for REPL result values
to support value types erased from runtime classes. See example
in added tests for motivation.
#KT-45065 fixed
also refactor launcher repl test and result type rendering
2022-06-16 21:28:03 +00:00
Ilya Chernikov b36d1be5f8 Scripting: switch legacy CLI REPL to the new infrastructure 2022-06-16 21:28:02 +00:00
Igor Yakovlev f996278171 [WASM] Support for mjs universal launcher 2022-06-07 20:59:03 +00:00
Sergej Jaskiewicz e03747ea7d [JS IR] Introduce the GENERATE_INLINE_ANONYMOUS_FUNCTIONS feature flag 2022-06-01 09:02:31 +00:00
Victor Petukhov fbb2e18bea [FE 1.0] Use 1.7.20 as default language version for java type enhancement
^KT-50478
2022-05-23 12:36:31 +02:00
Simon Ogorodnik 58885a1b07 KT-52217 Rename 'use-fir' to 'use-k2', update message 2022-04-28 15:42:42 +00:00
Igor Laevsky 3de1235fda [WASM] Add command line option to enable/disable assertions 2022-04-26 20:41:52 +00:00
Alexander Udalov 2e515f3945 Prohibit JVM target 1.6
But still compile stdlib, reflect, kotlin.test and scripting runtimes
with JVM target 1.6 to simplify migration from Kotlin 1.6 to 1.7.

 #KT-45165 Fixed
2022-04-19 22:54:40 +02:00
Alexander Udalov 6402c3908c Validate -Xbackend-threads CLI argument value
#KT-51846 Fixed
2022-04-08 14:01:21 +02:00
Igor Laevsky 81eae94821 [Wasm] Disable range checks for arrays. Add cli argument to enable them back. 2022-04-05 18:00:32 +00:00
Alexander Udalov 9c78d57de2 Configure SAXParserFactory to avoid XXE references
#KT-51519 Fixed
2022-04-03 00:49:21 +02:00
Ilya Chernikov a239f02a30 Add cli argumens for FIR "tight" IC and LightTree usage 2022-03-30 08:32:03 +00:00
Ilya Goncharov c67c1a69b9 rra/ilgonmic/reducing-size
[JS IR] Fix review remarks

- Fix translation mode from flags calculation
- comment why not top level could be safely inlined

[JS IR] Add test on exportness of internal val

Revert "[Gradle, JS] Disable minimizing names in production by default"

This reverts commit 700ff8634a73f155a2f0eaf963778216d6877075.

[JS IR] Adopt reserved names

Revert "[JS IR] Reserve interop names"

This reverts commit 63f30becaf1a45750ff85aea3753aae9a85985f4.

Revert "[JS IR] Clear minimized namer states"

This reverts commit ef7f19fa8a928021e8bdfbee7fbb5285fc74b7ab.

[JS IR] Clear minimized namer states

[JS IR] Reserve interop names

[JS IR] Separate arguments for users

[JS IR] Minimized member names in tests

[Gradle, JS] Disable minimizing names in production by default

[JS IR] Fix extra helps

[JS IR] Move mangling of signatures to linking namer

[JS IR] Add key and minimized name generator

[JS IR] cross module dependencies minimized

[JS IR] Minimize names

[JS IR] Cross module by index

[JS IR] Fix warning

[JS IR] Fix inlining accessors

[JS IR] Bridges for property accessors

[JS IR] Special case of jsFunctionSignature with property accessors

[JS IR] Inline property accessor for non top level properties

[JS IR] Reduce crossModule size

Merge-request: KT-MR-5785
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51735 fixed
^KT-50504 fixed
2022-03-28 10:39:15 +00:00
Alexander Udalov 07ebf4ed29 Do not suppress errors with -Xsuppress-version-warnings
#KT-48833 Fixed
2022-03-18 12:28:28 +01:00
nataliya.valtman c38dd1c004 Fix unstable testIncrementalCompilationAfterCacheHit test 2022-03-14 20:08:14 +03:00
Nikita Bobko f0290d8c98 Freezable: fix binary compatibility
Intellij API Compatibility Check reports that compatibility was broken
for IJ Bazel plugin. This commit fixes this problem.

Binary compatibility was broken in
705a2881fab109ab7d3e365255d01e0491b17d6d.

Ideally, I'd rename extension functions to names other than "frozen" and
"unfrozen" because this would allow keeping source compatibility for
Java clients as well. But the new extension functions API has been
already released in EAP versions of IDEA, and I don't want change the
API back and forth for clients that already migrated to the new API. I
wish I knew earlier that this API is used by external plugins
2022-03-08 11:53:43 +00:00
Yahor Berdnikau cb474f9b43 Remove 'jdkHome' option from Gradle options
Toolchain feature is replaced it.

^KT-46541 Fixed
2022-02-28 10:08:50 +00:00
Mikhail Glukhikh 8274c43ee6 Make useExperimental non-CLI argument 2022-02-21 22:32:53 +03:00
Mikhail Glukhikh 570189e833 Mark deprecated 'useExperimental' with IDEAPluginsCompatibilityAPI 2022-02-21 14:33:10 +00: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
nataliya.valtman d4d5c701fe Make statistic more readable 2022-02-11 17:23:38 +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
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
Yahor Berdnikau 52a21a4e1a Remove 'noStdlib' from Gradle options
^KT-49011 Fixed
2022-01-31 17:28:13 +01:00
Yahor Berdnikau 57c342fec8 Remove 'noReflect' from Gradle options
^KT-49011 In Progress
2022-01-31 17:28:13 +01:00