Commit Graph

1412 Commits

Author SHA1 Message Date
Ivan Kylchik b0171dea63 [IR] Move FunctionInlining into separate module
#KT-64806 Fixed
2024-02-19 20:14:16 +00:00
Igor Yakovlev b6ef1e08e1 [WasmJs] Fix kotlin.test AfterTest for test with Promise return type
Fix #KT-61888
2024-02-06 13:55:20 +00:00
Artem Kobzar 2fdc8b6c14 [K/Wasm] Refactor the fix for the non-capturing lambda singletons 2024-02-01 18:13:37 +00:00
Artem Kobzar 1fe77705b0 [K/Wasm] Convert non-capturing lambdas into singletons ^KT-64803 Fixed 2024-01-29 12:52:18 +00:00
vladislav.grechko f318b5969d Erase non-reified type parameters by-default when inlining.
Substitution of type arguments to non-reified type parameters may lead
to accidental reification, which should not be done (see ^KT-60174 for
examples). So, we should erase them, except the few cases.

^KT-60174: Fixed
^KT-60175: Fixed
2024-01-26 18:31:20 +00:00
Anton Bannykh 245409dede [JS] Support custom Promise declarations for kotlin.test @AfterTest
^KT-63359 fixed


Merge-request: KT-MR-14001
Merged-by: Anton Bannykh <Anton.Bannykh@jetbrains.com>
2024-01-24 12:43:51 +00:00
Artem Kobzar 8d1a90c23c [K/JS] Support essential Kotlin collections (List, MutableList, Set, MutableSet, Map, MutableMap) for exporting into JS
^KT-34995 Fixed
^KT-44871 Fixed
2024-01-24 11:14:46 +00:00
Igor Chevdar 006410641b [IR][K/JS] Removed unused function 2024-01-22 09:34:42 +00:00
Igor Chevdar 978bf3d38d [IR] Refactored a bit InlineFunctionResolver 2024-01-22 09:34:42 +00:00
Artem Kobzar 7568ee5a79 [K/JS] Add VOID optimization on object properties + align with the optimization the JS Plain Object plugin 2024-01-19 13:03:06 +00:00
Artem Kobzar a55c65e3e2 [K/Wasm] Add simple TypeScript definitions generating ^KT-65009 Fixed 2024-01-16 11:10:27 +00:00
Artem Kobzar 300702a7e7 [K/JS] Create JavaScript Simple Object plugin that helps create typed JS objects 2024-01-10 16:30:02 +00:00
Alexander Korepanov 56e1c5cbc6 [JS IR] Add comments about JS IR BE IC 2023-12-20 06:34:13 +00:00
Sergej Jaskiewicz 1b557c1657 [IR] Mark IrExpressionBodyImpl with an opt-in annotation
KT-59318
2023-12-19 16:20:02 +00:00
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Dmitriy Dolovov 46081f968d [KLIB Resolver] Report KLIB resolver issues as compiler messages
The reason of this change is to make messages (especially warnings)
that are reported by the KLIB resolver become visible to the end user.
This can be achieved to forwarding such messages to the appropriate
compiler's components such as
`org.jetbrains.kotlin.cli.common.messages.MessageCollector` and
`org.jetbrains.kotlin.ir.util.IrMessageLogger`.

Also: The default `DummyLogger` should be used as minimal as possible.
Because it just forwards messages to the standard output (console)
where they can remain unattended. When the compiler is executed
from the Gradle plugin such messages appear only in DEBUG Gradle's log.

^KT-63573
2023-12-18 13:03:40 +00:00
Svyatoslav Kuzmich b5def88ff4 [Wasm] NFC refactor: eraseGenerics -> toWasmSignatureType
Use a more concrete name, make it private,
and split out:

 IrSimpleType.toWasmSignatureSimpleType

This does not change the behavior,
but helps to set the stage for the following bugfix
 (KT-58852)
2023-12-13 13:30:50 +00:00
Alexander Korepanov 41ebe498f2 [JS IR] Explicitly cast to a string all types except specific ones
^KT-62763 Fixed
2023-12-12 09:53:19 +00:00
Artem Kobzar 98186ec283 [K/JS] Add ES6 typescript tests + fix a few bugs for it 2023-11-30 13:37:06 +00:00
Artem Kobzar f26b0a5be6 [K/JS] Fix case with boxing/unboxing inside the BlockDecomposerLowering ^KT-63808 Fixed 2023-11-28 11:51:08 +00:00
Artem Kobzar 6615b77213 [K/JS] Rework symbol hash calculation to make IC works with @JsExport and @JsName changes 2023-11-27 13:49:56 +00:00
Artem Kobzar 33ab1871c7 [K/JS] Fix coroutines but turn back the fix for coroutines intrinsics intercepted and releaseIntercepted 2023-11-22 18:10:08 +00:00
Alexander Korepanov 45c166abf8 [JS IR] Introduce special setMetadataFor*() for synthetic classes
^KT-63436 Fixed
2023-11-22 09:21:44 +00:00
Alexander Korepanov c13cc38758 [JS IR] Remove unused code 2023-11-22 09:21:44 +00:00
Pavel Kunyavskiy e80d4b1d60 [IR] Move IrDeclaration.isExpect to IrUtils
^KT-62292
2023-11-20 08:31:41 +00:00
Pavel Kunyavskiy faaefbd8e7 [IR] Move .parents and .parentsWithSelf to IR utils
^KT-62292
2023-11-20 08:31:41 +00:00
Artem Kobzar 1832f5a3f7 [K/JS] Introduce the ability to consume platform-specific cli arguments inside the main function ^KT-16981 Fixed 2023-11-18 11:01:34 +00:00
Artem Kobzar ff50d40b32 [K/JS] Rework kotlin tests compilation to make it works with per-file granularity ^KT-61525 Fixed 2023-11-16 19:02:04 +00:00
Artem Kobzar 890fbd6b0b [K/JS] Process JS-specific returnable blocks before the state machine building
^KT-60785 Fixed
^KT-63207 Fixed
2023-11-16 13:25:51 +00:00
Ivan Kylchik b3e485c649 [JS_IR] Try to find generated default stub fun before creating a new one
This change is required to support a new approach to lowering
execution. There will be no more guarantee that every module
will execute `JsDefaultArgumentStubGenerator` lowering before
moving on.

#KT-63073
2023-11-16 12:03:41 +00:00
Ivan Kylchik 917b9481c1 [JS_IR] Drop old comment from loweringList
This comment is not needed anymore after
64158a8a2f
2023-11-16 12:03:41 +00:00
Ivan Kylchik 1db595c676 [JS_IR] Reuse common makeIrModulePhase to create lowerings
#KT-63073
2023-11-16 12:03:41 +00:00
Ivan Kylchik 0a6f711a41 [JS_IR] Use IrModuleFragment as input to lowering instead of iterable
This way we will be able to reuse existing utils
to create a lowering.

#KT-63073
2023-11-16 12:03:41 +00:00
Artem Kobzar f4d088a886 [K/JS] Don't add nested classes generated by plugins into ExportModel for interfaces ^KT-63184 Fixed 2023-11-15 10:21:22 +00:00
Artem Kobzar 82bca7a04f [K/JS] Rework member-exportability check in a right way ^KT-61957 Fixed 2023-11-15 10:18:05 +00:00
Iaroslav Postovalov a3b55cf758 [IR] Drastically simplify the hierarchy of IR origins
IrStatementOriginImpl and IrDeclarationOriginImpl were made final
classes to simplify the creation of them (a delegate provider was
added) and to optimize performance when comparing the origins by type
and name
2023-11-13 17:56:09 +00:00
Sergej Jaskiewicz 5a86147e9c [JS IR] Remove dead code 2023-11-10 12:31:40 +00:00
Alexander Korepanov ec71fe20e2 [JS IR] Fix file name clashes during JS BE invalidation 2023-10-30 09:14:16 +00:00
Alexander Korepanov 188cdf2f98 [JS IR] Allow constant inlining in JS IR
Fixed the incremental compilation issue,
which had prevented enabling const inlining during constant
evaluation and folding a constant expression with JS code.

^KT-62425
2023-10-26 19:22:14 +00:00
Artem Kobzar 6cd42eeb71 [K/JS] Fix reexport with CommonJS and incremental compilation 2023-10-26 09:58:35 +00:00
Artem Kobzar 4101d01744 Revert "[K/JS] Fix ES6-classes compilation for objects without constructor generated by plugins" 2023-10-26 09:06:19 +00:00
Ilya Goncharov 573bc34b56 [JS] Invoke processing separately for suspend and non-suspend function
^KT-62771 fixed
2023-10-25 13:28:58 +00:00
Dmitriy Novozhilov fb8bf19091 [IR] Rename IrSymbolInternals to UnsafeDuringIrConstructionAPI
The new name more precisely describes the meaning of this opt-int
2023-10-25 11:32:46 +00:00
Ivan Kochurkin 1827df82c4 Removed useless as casts from compiler code
It allows compiling code with K2 and enabled `-Werror`
2023-10-24 20:59:56 +00:00
Alexander Udalov b5ba9ee671 IR: refactor resolveFakeOverride call sites
Split it to 4 functions for clarity: resolveFakeOverride,
resolveFakeOverrideOrFail, resolveFakeOverrideMaybeAbstract,
resolveFakeOverrideMaybeAbstractOrFail. Remove/inline duplicated
utilities and remove unused parameters.
2023-10-23 23:38:47 +00:00
Artem Kobzar 4a042dafef [K/JS] Fix nameBindings for ES-modules after the ES-modules external declarations optimization 2023-10-20 14:04:39 +00:00
Artem Kobzar df14f044cd [K/JS] Remove unconditional cast to IrClass in KClass expression 2023-10-19 17:34:00 +00:00
Artem Kobzar d625d9a988 [K/JS] Fix ES6-classes compilation for objects without constructor generated by plugins 2023-10-18 13:29:15 +00:00
Dmitriy Novozhilov 704e2ef5c5 Suppress K2 specific warnings in the codebase
^KT-62472
2023-10-18 07:59:27 +00:00
Ivan Kylchik 350ee4be1d [Native] Replace consequence line and column calls with a single one 2023-10-13 08:50:47 +00:00