Commit Graph

803 Commits

Author SHA1 Message Date
Kevin Bourrillion 70cd547c26 Fix two other tests to treat both old and new JSpecify packages the same 2022-12-27 11:11:00 +00:00
Evgeniy.Zhelenskiy 25db5bf6e1 [IR] Enable -Xvalue-classes flag
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-12-22 12:24:16 +00:00
Sergey Bogolepov 366edcfe3c [K/N] Drop obsolete static driver 2022-12-20 06:30:36 +00:00
Ilya Muradyan db5913bbb6 KTIJ-8463: add possibility to pass additional analyzer flags 2022-12-15 10:30:43 +01:00
Dmitriy Novozhilov f8487ba545 [CLI] Filter out blank arguments from system environment 2022-12-09 12:02:09 +00:00
Troels Bjerre Lund bb1acf729b [K/N] Add custom allocator prototype ^KT-55364
Enable custom allocator with -Xallocator=custom.

If the gc is cms (default):
 * a patched version of the memory manager is used that does not build a
   list of allocated objects.
 * a patched version of the cms is used that defers to the allocator for
   sweeping.

Otherwise, a warning is printed, and the allocator is used using the
standard api.

Design doc:
https://docs.google.com/document/d/15xMp-nE-DWL8OrtOc8DoXB80AHUphFICEGjj5K0aNFc

Co-authored-by: Troels Lund <troels@google.com>

Merge-request: KOTLIN-MR-546
Merged-by: Alexander Shabalin <alexander.shabalin@jetbrains.com>
2022-12-08 17:22:04 +00:00
Alexander Korepanov 9dab8637a8 [JS Gradle] Pass incremental cache root dir to K2JS compiler 2022-11-28 20:46:40 +00:00
Ilya Chernikov e4a361a4b4 K2 Scripting: disable scripts in source roots by default
fixes ultimate FP test
2022-11-28 15:10:55 +00:00
Sebastian Sellmair 7870c82221 [Gradle][Native] K2NativeCompilerArguments.refinesPaths: Use Array<String> instead of String
^KT-55071 Verification Pending
2022-11-24 14:42:11 +00:00
Sebastian Sellmair 752ff04245 [Gradle][Native] Setup refinesPaths as expectedBy module dependencies
Previously, dependsOn dependencies were just passed as friend modules
to shared native compilations.

^KT-55071 Verification Pending
2022-11-24 14:42:10 +00:00
Artem Kobzar c1c5933c72 [K/JS] Deprecate old JS-compiler 2022-11-23 11:22:29 +00:00
Svyatoslav Kuzmich 78bd6dbdcd [Wasm] Allow implementing function interfaces 2022-11-14 11:23:18 +01:00
Ilya Chernikov 7a57e8d903 FIR JS: Add K2 support to K2JsIrCompiler 2022-11-12 16:28:24 +01:00
Alexander Korepanov 92638573ce [JS IR] Add messages about unused cli arguments 2022-11-07 17:57:42 +00:00
Alexander Korepanov 041e755c70 [JS IR] Cleanup BackendContext flags 2022-11-07 17:57:41 +00:00
Alexander Korepanov d5e9e87538 [JS BE] Drop JS scripting support
JS scripting uses the old IR to JS transformer.
 The new IR to JS transformer can not be used for
 JS scripting out of the box. Patching the new transformer for
 JS scripting is potentially dangerous and requires a lot of effort.
 Dropping JS scripting and the old IR to JS transformer allows to
 refactor and simplify JS BE codebase.
2022-11-04 14:15:15 +00:00
Yahor Berdnikau a7e1d36528 Drop compileOnly dependency on :kotlin-gradle-compiler-types in compiler
This dependency was only required for compiler options Gradle DSL
generation, but was leaking into runtime not-accessible classes.

^KT-54602 Fixed
2022-10-26 16:32:36 +02:00
Aleksei.Cherepanov 26e7c29a91 [JPS] Rebuild module on facet change
The logic of detecting changes in Kotlin facets was changed from "Include selected fields" to "Include all compiler arguments and exclude selected". This will help to avoid multiple IC issues when new change-sensitive compiler arguments will be added

(#KTIJ-17137, #KT-51536, #KTIJ-17170, #KTIJ-17300, #KT-47983) Fixed

Merge-request: KT-MR-7455
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2022-10-26 09:45:27 +00:00
Artem Kobzar 7b9aed25da [K/JS] Add the ability to turn off polyfills generating 2022-10-19 12:52:23 +00:00
Ilya Goncharov ca8b415726 [JS IR] Change names of ir-only arguments 2022-10-18 09:59:17 +00:00
Ilya Goncharov ec50036884 [JS IR] Change module name compiler flags 2022-10-18 09:59:16 +00:00
Artem Kobzar 9a4a30c9bb [K/JS] Add flag for disabling signature uniqueness checks at klib generating phase 2022-10-14 13:08:58 +00:00
Alexander Udalov d249b02cda Add JvmDefaultWithCompatibility to some interfaces
This has no effect on behavior, but will fix a binary compatibility
problem with Compose.

 #KT-54459 Fixed

Co-authored-by: Alexander Likhachev <Alexander.Likhachev@jetbrains.com>
2022-10-14 14:48:15 +02:00
Sergej Jaskiewicz 227864c6ec [JS IR] Add a compiler option for generating name entries in sourcemaps 2022-10-14 10:09:39 +00:00
Artem Kobzar de880ce9aa [K/JS] Move ES modules logic to a new transformer with IC 2022-10-13 07:32:44 +00:00
Svyatoslav Scherbina 28dea9d949 Native: remove obsolete compiler flags that have no effect
Same for compiler configuration keys.
2022-10-07 15:33:42 +00:00
Sergey Bogolepov d7fff3ca01 [K/N] Add -Xforce-compiler-driver=(static, dynamic) flag
Useful for development purposes when one wants to compare
the outputs of different drivers.
2022-10-06 13:10:50 +00:00
Simon Ogorodnik f2dee2bf85 Core. Fix data-race in ApplicationEnvironment initialization
getOrCreateApplicationEnvironment is main entrypoint to create
ApplicationEnvironment in production and compiler tests
It is subject to be called concurrently, that's why
APPLICATION_LOCK exists

ApplicationEnvironment itself hosts Application from idea-core
It is actually singleton, that is subject to be disposed, once all
operations referencing it completes

To properly dispose ApplicationEnvironment when there is no references
left, we maintain reference counter aka ourProjectCount

Originally, there was data-race caused by the fact, that ourProjectCount
was updated after publication of application

Linear, data-race occurs in following order
T1: getOrCreateApplicationEnvironment returns application
T2: Disposes its reference to application, causing ourProjectCount to
reach zero, and disposing application that is already available to T1
T1: Updates counter, but its application already disposed
2022-10-03 13:36:05 +00:00
Ilya Goncharov c726360ad2 Change policy with legacy compiler backend
[JS] Remove incremental js jps test

[JS] Remove test of maven js archetype

[JS] Fix another one test

[JS] Fix tests for jps

[JS] Try to fix maven test data

[JS] Fix test data

[JS] Fix test data for ant

[JS] Fix jsExtraHelp test

[JS] Fix test run from not-Gradle build tools

[JS] Set flag without compiler error

[JS] Disable warnings and errors in legacy compiler called from Gradle

[JS] Proofread messages

[JS] Not proofread messages

KT-42326
2022-09-29 13:56:30 +00:00
Igor Chevdar 1963860a92 [K/N][caches] Removed old slow and hacky version of per-file caches building 2022-09-27 17:06:48 +00:00
Igor Chevdar 77f24a22dd [K/N][IR][codegen][caches] Speed-up of per-file caches 2022-09-27 17:06:48 +00:00
Ilya Goncharov cab79d950f [Gradle, JS] outputName -> moduleName 2022-09-21 10:58:25 +00:00
Ilya Goncharov 55731f27a4 [Gradle, JS] Adopt changes about compilerOptions 2022-09-21 10:58:24 +00:00
Ilya Goncharov 8d90173ea5 [JS, IR] Deprecated outputFile 2022-09-21 10:58:23 +00:00
Ilya Goncharov 642fae1a5b [Gradle, JS] Migrate onto destinationDirectory and outputName 2022-09-21 10:58:20 +00:00
Ilya Goncharov d203dc35bf [JS IR] Add to IR keep possibility similar to legacy-dce one
It helps to:

- keep declarations even if they are not reachable and not exported
- not minify names of not exported declarations

Compiler argument: -Xir-keep=A,B

Can be used for top-level declarations or for member

^KT-54118 fixed
2022-09-20 16:06:17 +00:00
Yahor Berdnikau 286d0d56af Introduce Kotlin compiler options with Gradle Properties API types
Old one is deprecated and delegates to new options. All new options
are marked with task input types, so they could be used as `@Nested`
input.

Generated options are using specific types in generated
compiler options. This should simplify code completion and provide
meaningful hints to user.

At this point repository compilation will fail.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Ilya Goncharov bf8681296b [Gradle, JS] IR by default and report warnings for using legacy compiler
- just legacy - report warning about deprecation
- both - report warning about deprecation of legacy
- no compiler explicitly chosen - error about explicit setting compiler

warn from cli legacy compiler

nowarn flag - kotlin.js.compiler.nowarn

KT-42326
KT-53074
2022-09-16 09:48:41 +00:00
Alexander Udalov 0569f429dd Report error on -Xuse-old-backend, remove Gradle option useOldBackend
Allow using old JVM backend only to compile kts.

 #KT-48532 Fixed
2022-09-16 00:16:31 +02:00
Alexander Udalov 7dad47cd76 Add -X argument to disable generation of @SourceDebugExtension
This will be used in tests in the subsequent commit.
2022-09-09 14:32:35 +02:00
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