Commit Graph

3000 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich dd53998c2d [Wasm] Add uninstantiated MJS wrapper
It allows

* Custom imports
* Ability to skip initializer
2022-12-28 12:13:52 +01:00
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
Andrey Uskov f07f193938 Make line number field public in PerformanceMeasurement
Required for KT-55537
2022-12-26 17:16:02 +03: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
Ilya Kirillov 7bac119f20 [FIR] add lazy resolution contract checks in resolve 2022-12-12 16:21:06 +00:00
Dmitriy Novozhilov f8487ba545 [CLI] Filter out blank arguments from system environment 2022-12-09 12:02:09 +00:00
Dmitriy Novozhilov 5d6cb2b691 [Test] Use IrPluginContext for searching declarations for DUMP_EXTERNAL_CLASS check 2022-12-09 12:02:07 +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
Zalim Bashorov 49c3ba33f1 [Wasm] Add a basic end-to-end sourcemap generation in wasm backend
More constructions/instructions will be supported separately.
2022-12-08 12:44:26 +00:00
Alexander Korepanov 0a35d84193 [JS IR] DTS generation refactoring
Keep a DTS fragment in JsIrProgramFragment
 for each file and build the module DTS from them.
2022-12-07 18:05:52 +00:00
Zalim Bashorov fb4dcc6a6a [Sourcemap] Introduce getCurrentColumn and stop using TextOutput directly
The general goal is remove dependency on TextOutput and
make it simpler to use for wasm backend.
2022-12-07 12:03:54 +00:00
Alexander Korepanov c31705240a [JS IR] Support a module friendship in IC infrastructure
^KT-55097 Fixed
2022-12-02 13:50:36 +00:00
Artem Kobzar 76e629340f [K/JS] Add miss LazyIr into klib Ir generation process 2022-12-02 13:28:18 +00:00
Sergej Jaskiewicz 1539d7ef1a [klib] Bring package names in sync with the directory layout
Basically, some package names were Native-specific, whilst the packages
themselves were not Native-specific at all. This was already reflected
in the directory layout, but not in the package names.
This is fixed here.

NFC, just an automatic rename of packages with fixes of imports.
2022-12-01 21:46:43 +00:00
Artem Kobzar 3f4a937ad6 [K/JS] Don't generate TypeScript definitions from ExportModel if the -Xgenerate-dts flag was not provided ^Fixed KT-53940 2022-12-01 15:47:08 +00:00
Sergey Bogolepov c22cad07ed Introduce FlexiblePhaseConfig
For dynamic Kotlin/Native driver we need a PhaseConfigurationService
that does not force us to provide a list of phases upfront.
2022-11-30 11:24:38 +00:00
Alexander Korepanov 9dab8637a8 [JS Gradle] Pass incremental cache root dir to K2JS compiler 2022-11-28 20:46:40 +00:00
Alexander Korepanov 693258ae91 [JS IR] Invalidate all klib dependencies after removing it
Without the invalidation, broken JS code
 (with broken cross-module references) may appear.

 ^KT-54911 Fixed
2022-11-28 20:46:40 +00:00
Alexander Korepanov ca19d71a00 [JS IR] Commit cache header after lowering
Commiting cache header before lowering may
 break caches in case of lowering errors.

^KT-54912 Fixed
2022-11-28 20:46:40 +00:00
Alexander Korepanov 8cde0a81bc [JS IR] Use topological order for loading klibs in JS IR IC
Generally, the library order doesn't matter.

 However, after lowering we need to post process
 lowered klibs in topological order:
  - commit incremental cache artifacts,
  - produce JS AST.

 The patch uses an ability of the Kotlin library resolver to load klibs
 in topological order and drops its reimplementation from IC infrastructure.

 There is one side effect:
   klibs which are not reachable from the main module, will produce their JS.
   This should be more correct than just ignoring them.
2022-11-28 20:46:39 +00:00
Alexander Korepanov ec6a7094e6 [JS IR] Manage cache root dir from IC cache updater
- pass cache root directory instead of dir list
 - manage klib cache dirs from cache updater
2022-11-28 20:46:39 +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
Mikhael Bogdanov edc54524aa Xjdk-release: support mixed compilation of Java and Kotlin
#KT-52815 Fixed
2022-11-14 06:57:12 +00:00
Ilya Chernikov 7a57e8d903 FIR JS: Add K2 support to K2JsIrCompiler 2022-11-12 16:28:24 +01:00
Ilya Chernikov 1f11a2865f FIR: refactor session factory to better support JS scenarios 2022-11-12 16:28:23 +01:00
Ilya Chernikov 8bf108dc17 FIR JS: Prepare JS/KLib infrastructure for FIR integration
rearrange declarations, abstract things that should be done differently
with FIR, etc.
2022-11-12 14:34:07 +01:00
Xin Wang 7b3ce35613 JVM_IR: Prevent writing output after an error is reported
#KT-53825 Fixed
2022-11-09 23:14:11 +01:00
Alexander Korepanov 731dd9c3e8 [JS IR] More detailed time measurement for the IC infrastructure 2022-11-08 15:18:43 +00:00
Alexander Korepanov 92638573ce [JS IR] Add messages about unused cli arguments 2022-11-07 17:57:42 +00:00
Alexander Korepanov cb7df4d428 [JS IR] IrModuleToJsTransformerTmp.kt -> IrModuleToJsTransformer.kt 2022-11-07 17:57:41 +00:00
Alexander Korepanov 041e755c70 [JS IR] Cleanup BackendContext flags 2022-11-07 17:57:41 +00:00
Alexander Korepanov d17794481d [JS IR] Replace IrModuleToJsTransformer with IrModuleToJsTransformerTmp 2022-11-07 17:57:38 +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
Ilya Chernikov 23144b92d8 Fix FastJarFS caches cleaning
- add FastJarFS cache cleaning to the daemon implementation, so
the behavior is now the same as for CoreJarFS
- clear not only mappings but also handlers cache: this may result some
slowdown on comparison with the previous cleaning implementation,
but should avoid unreliable behavior on heavy parallel build usages.
2022-10-31 16:02:50 +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
Alexander Korepanov 39666dafa5 [JS IR] Make JS IR IC info messages more pretty and usable 2022-10-24 12:05:05 +00:00
Ilya Chernikov 8566589cf5 Add minimal roots deduplication on classpath update
duplication was detected e.g. in some scripting scenarios
2022-10-21 06:11:42 +00:00
Ilya Chernikov b50a803b6f Make jdk root processing more robust
#KT-54337 fixed
2022-10-21 06:11:42 +00:00
Ilya Chernikov 7d5257c258 Preserve FastJarFS in app env and implement intermediate cleanup
FastJarFS was behaving differently than the regular CoreJarFS it
tries to replace, namely it was cleaned after each compilation
(had the lifetime tied to core env).
This commit preserve it in the app env the same way as CoreJarFS,
so it could be reused in parallel builds and preserved if automatic
cleanup of the app env is turned off,
But since FastJarFS caches also mmf handles, the additional handles
cleaning is introduced that triggers after all possibly parallel
compilations are finished.
2022-10-21 06:11:41 +00:00
Ilya Chernikov 61e9aaf113 Convert java to kotlin 2022-10-21 06:11:41 +00:00
Ilya Chernikov bccfc2ad18 Rename .java to .kt 2022-10-21 06:11:40 +00:00
Artem Kobzar 7b9aed25da [K/JS] Add the ability to turn off polyfills generating 2022-10-19 12:52:23 +00:00
Alexander Korepanov 621e361366 [JS IR] Pass a js generation granularity param to IC infrastructure 2022-10-19 10:21:44 +00:00