Commit Graph

393 Commits

Author SHA1 Message Date
Igor Yakovlev eea3c3624c [WasmJs] Generate a wrapper that run in Deno
Fixed #KT-65713
2024-02-22 14:45:09 +00:00
Artem Kobzar 79cce48aa9 [K/Wasm] Add enum entries comparison optimization 2024-02-21 13:30:12 +00:00
Ivan Kylchik b0171dea63 [IR] Move FunctionInlining into separate module
#KT-64806 Fixed
2024-02-19 20:14:16 +00:00
Ilya Goncharov abb5f55087 [Wasm] Use static import for wasm imports
^KT-65777 fixed
2024-02-19 10:01:10 +00:00
Igor Yakovlev be6b9e8a9a [Wasm] Support lazy associated object initialisation
Fix #KT-63939
2024-02-08 14:15:17 +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 8c69ffe8c9 [K/Wasm] Generate wasm-specific unsigned implementations ^KT-58039 Fixed 2024-01-29 20:11:41 +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
Anastasiia Spaseeva 945f602b91 Revert "[Wasm] Support lazy associated object initialisation"
This reverts commit 552ee1ee38.
2024-01-25 14:11:56 +01:00
Igor Yakovlev 552ee1ee38 [Wasm] Support lazy associated object initialisation
Fix #KT-63939
2024-01-24 16:24:44 +00:00
Artem Kobzar 57a4d09ad2 [K/Wasm] Add tests for nested external declarations + fix them 2024-01-22 11:55:09 +00:00
Igor Chevdar 978bf3d38d [IR] Refactored a bit InlineFunctionResolver 2024-01-22 09:34:42 +00:00
Artem Kobzar a55c65e3e2 [K/Wasm] Add simple TypeScript definitions generating ^KT-65009 Fixed 2024-01-16 11:10:27 +00:00
Igor Yakovlev 931cc48def [Wasm/WASI] Implementation of a callback on root exported function exit
Fixed #KT-64486
2024-01-15 11:37:37 +00:00
Igor Yakovlev c80854eb7c [Wasm/WASI] Extract js-wasi mode to context property 2024-01-05 22:04:25 +00:00
Artem Kobzar e4c244d5db [K/Wasm] Generate source-map for WAT-files 2024-01-05 14:16:32 +00:00
Artem Kobzar 327085e026 [K/Wasm] Unmute most of the stepping tests for Wasm in K1 2023-12-28 16:32:10 +00:00
Svyatoslav Kuzmich 76e132e758 [Wasm] Fix overloading virtual methods by vararg and array element type
Context:
- Kotlin allows functions overloaded with different array element types.
- Varargs are lowered to Array parameters.
- Before this commit, K/Wasm erased an array element type
  from the signature, similar to type argument erasure in other cases.

Fix:
Stop erasing type arguments in arrays when computing v-table signatures.

^KT-58852 Fixed
2023-12-13 13:30:50 +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
Yair Morgenstern 88e35fafd9 [Wasm] Use final Wasm structs for types without subtypes
A version of PR https://github.com/JetBrains/kotlin/pull/5175
 contributed by Yair Morgenstern, modified by Slava Kuzmich

^KT-60505 Fixed
2023-12-12 19:05:57 +00:00
Artem Kobzar 2eb1e65bbf [K/Wasm] Allow to export unsigned numbers 2023-12-08 09:06:19 +00:00
Ivan Kylchik c82bc8f0ce [WASM] Add ConstEvaluationLowering to the lowering list 2023-11-22 14:54:19 +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
Ivan Kylchik 48a0274989 [WASM] Reuse common makeIrModulePhase to create lowerings
#KT-63074
2023-11-16 12:03:41 +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
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
Ivan Kylchik 350ee4be1d [Native] Replace consequence line and column calls with a single one 2023-10-13 08:50:47 +00:00
Ivan Kylchik 6039d39546 [IR] Add new method IrFileEntry.getLineAndColumnNumbers
Calling this method instead of sequence of `getLineNumber` and
`getLineNumber` is faster because we eliminate one exess
`getLineNumber` call.
2023-10-13 08:50:47 +00:00
Igor Yakovlev 758484a01f [Wasm] Fix generation optimised when expression with Nothing type
Fixed #KT-62147
2023-09-23 10:18:30 +02:00
Artem Kobzar 94eefba824 [K/Wasm] Optimize range checks 2023-09-19 17:04:41 +00:00
Zalim Bashorov 86e854a980 Revert "[Wasm] Don't use the new br_on_cast* instructions since they are not supported in Node.js yet"
This reverts commit 2d728727

#KT-60828 Fixed
2023-09-19 09:23:26 +00:00
Zalim Bashorov eecfc2c6d3 [Wasm] Simplify a message printed in case of WebAssembly.CompileError
#KT-59720
2023-09-19 09:23:26 +00:00
Dmitriy Novozhilov 697d0d5638 [IR] Mark IrSymbol.owner with OptIn annotation
^KT-60923 Fixed
2023-08-16 17:47:29 +00:00
Artem Kobzar 05ed134fbb [K/Wasm] Introduce stepping tests for Wasm 2023-08-15 17:03:11 +00:00
Igor Yakovlev 98329f30f8 [Wasm] Rename wasm initialize function 2023-08-08 18:10:19 +02:00
Svyatoslav Kuzmich 47ade4530c [Wasm] Add compiler flag to disable exception handling proposal
Fail with unreachable instead of throwing an exception

Merge-request: KT-MR-11481
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-08-07 16:19:29 +00:00
Igor Yakovlev 69c97688c0 [Wasi] Add default wasi ejs runner (for nodejs) 2023-08-03 16:38:05 +00:00
Zalim Bashorov acc3dc0daa [Wasm] Take into account nullability for primitives while recovering a stack type
#KT-60496 Fixed
2023-08-01 23:48:24 +02:00
Zalim Bashorov 141645c5d7 [Wasm] Generate proper code in stack type recovering:
* When the actual type is some nullable type but nullable `Nothing` is expected.
* Respect nullability when casting reference types.

#KT-60113 Fixed
2023-08-01 23:48:23 +02:00
Zalim Bashorov 1946476e58 [Wasm] Generate comments for inlined calls 2023-08-01 23:48:23 +02:00
Igor Yakovlev 5e14ccbccc [Wasm] Backend support for wasi mode 2023-08-01 18:47:38 +00:00
Artem Kobzar cd840997b1 [K/Wasm] Rework Wasm enumEntriesIntrinsic declaration to fix stdlib compilation 2023-08-01 11:53:14 +00:00
Zalim Bashorov 2d728727da [Wasm] Don't use the new br_on_cast* instructions since they are not supported in Node.js yet
#KT-60835 Fixed
2023-08-01 08:46:59 +00:00
Zalim Bashorov 4572680877 [Wasm] Migrate to the latest br_on_cast* instructions
#KT-59722 Fixed
2023-07-28 16:16:33 +00:00
Artem Kobzar 029c71ebb1 [K/JS, K/Wasm] Implement enumEntries top-level function ^KT-59712 Fixed 2023-07-27 09:43:01 +00:00
Svyatoslav Kuzmich 384c700a85 [Wasm] Fix access to WebIDL dictionary members
Evaluate external interface companion objects as an empty JS object
instead of null due to null checks on interop boundary.

^KT-59082 Fixed
2023-07-25 15:27:22 +00:00
Igor Yakovlev e8e8a26cd1 [Wasm] Fixed invalid delegated property getters lowering
#Fixed KT-58941
2023-07-24 18:15:16 +00:00