Commit Graph

117 Commits

Author SHA1 Message Date
Artem Kobzar 46dc478c03 [K/Wasm] Reduce debug information for the internal Kotlin functions 2024-03-12 17:37:03 +00:00
Igor Yakovlev 8fe5cf2641 [WasmJs] Support catching JS exceptions
Fixed #KT-65660
2024-03-11 14:27:12 +00:00
Artem Kobzar 2e4d02e9f4 [PSI2IR, K/Wasm] Sync start and end offsets on PSI and FIR for primary constructors 2024-02-29 14:42:33 +00:00
Yahor Berdnikau 6b19b8b9d0 [Repo] Don't use kotlinOptions in repo build scripts
^KT-63419 In Progress
2024-02-22 14:48:10 +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
Ilya Gorbunov d2aae67e03 Replace kotlin-test project dependencies in the project
Use dependency helper function that chooses whether to take them
from the bootstrap repository or from a configuration of kotlin-test

KT-61969
2023-12-13 15:40:25 +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
Alexander.Likhachev a19bd2ed2e [Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
2023-12-07 18:31:06 +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 9ec6fea9d5 [Wasm] Update Wasm GC to final codes 🎉
#KT-59720 Fixed
2023-09-19 09:23:26 +00:00
Alexander.Likhachev 357d12fc8e [Build] Move JUnit dependencies into the version catalog
The `kotlin-test` dependencies are left untouched as changing them affects publications, thus these versions are independent from the used inside our build
#KTI-1349 In Progress
2023-09-06 22:47:33 +00: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
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
Zalim Bashorov 8a645e9c0a [Wasm] Don't print recursion group in wat when it's empty 2023-07-20 11:49:28 +00:00
Zalim Bashorov 590400071b [Wasm] Define canonical representation for NaNs explicitly instead of depending on Kotlin's one
Surprisingly with `Float.NaN.toRawBits()` you can observe different values,
which can lead to different wat files for the same input.
2023-07-20 11:49:28 +00:00
Zalim Bashorov 151f5b90c7 [Wasm] Wrap a recursion group by a "rec" block in wat 2023-07-20 11:49:28 +00:00
Zalim Bashorov 8a9531ce3c [Wasm] Don't print "field" for array types in wat 2023-07-20 11:49:28 +00:00
Zalim Bashorov 8d440a61e2 [Wasm] Make types for none and noextern consistent with the spec 2023-07-20 11:49:28 +00:00
Zalim Bashorov 2d13cbae80 [Wasm] make adding sections a bit more typesafe and extract possible values to WasmBinary 2023-07-20 11:49:28 +00:00
Zalim Bashorov a819a734b8 [Wasm] extract some "mages numbers" to simplify their update and improve readability
In preparation for KT-59720
2023-07-20 11:49:28 +00:00
Zalim Bashorov 1cf3841588 [Wasm] Always use -0x30/sub when defining a struct type
Otherwise, according to the spec, a type will be treated as a final,
which is not correct in many cases.
Later, we can generate final struct types when it's applicable.

#KT-60200 Fixed
2023-07-17 23:57:34 +02:00
Vyacheslav Gerasimov 61664c6c4d Build: Add webassembly wabt and test suite to cachedDependencies
#KTI-72
2023-06-16 12:19:01 +00:00
Vyacheslav Gerasimov 965b00549f Build: Download webassembly wabt and test suite using configuration 2023-06-07 10:12:39 +00:00
Artem Kobzar bfd57fd2df [K/JS, K/Wasm] Optimize simple objects declaration and usage ^Fixed KT-58797 2023-06-02 14:23:40 +00:00
Igor Yakovlev 1749bafc30 [Wasm] Rename dateref to structref 2023-05-19 15:50:07 +00:00
Igor Yakovlev 6adfd91169 Revert "[Wasm] Revert a7ed496a and few fixes to make Kotlin/Wasm compatible with Firefox"
This reverts commit 1d793f7bec.
2023-05-19 15:50:06 +00:00
Igor Yakovlev 6437d0919c [Wasm] Replace deprecated cast instructions 2023-05-19 15:50:06 +00:00
Zalim Bashorov 885381dd63 [Wasm] Change externRefToAny to make it compatible with SpiderMonkey and V8
It's hard to achieve that without implementing part of `externRefToAny` using an intrinsic. It should be rewritten when all VMs and tools update to the latest spec.

Also, stop using (deprecated) instructions unsupported by SpiderMonkey.

#KT-56166 In-Progress
2023-01-27 17:57:50 +01:00
Zalim Bashorov 1d793f7bec [Wasm] Revert a7ed496a and few fixes to make Kotlin/Wasm compatible with Firefox
Revert changes as soon as the bug is fixed https://bugzilla.mozilla.org/show_bug.cgi?id=1811932

a7ed496a "[WASM] Use wasm bottom types for Nothing?"

#KT-56166 In-Progress
2023-01-27 17:57:49 +01:00
Zalim Bashorov 2573201a87 [Wasm] provide "location" for pseudo-instructions using to add comments 2023-01-17 19:37:06 +01:00
Zalim Bashorov ab1cbc49dd [Wasm] Minor: move buildUnreachable* helpers to more specific module 2023-01-17 19:37:05 +01:00
Zalim Bashorov 9e4b2b78e6 [Wasm] Remove unnecessary location from WasmDataMode constructor 2023-01-17 19:37:05 +01:00
Zalim Bashorov 2fa2725012 [Wasm] Add a comment about location into WasmExpressionBuilder 2023-01-17 19:37:05 +01:00
Zalim Bashorov aa8a0fd7d7 [Wasm] Remove LocationHolder and helper functions
It turned out that dedicated scoping function for locations are not so useful.
Now, if you want to scope a location use functions from stdlib, like `let`.
2023-01-17 19:37:05 +01:00
Zalim Bashorov e62add937b [Wasm] Remove SourceLocation.TBDLocation and related things 2023-01-17 19:37:05 +01:00
Zalim Bashorov 0d203d190e [Wasm] Remove buildInstr without location and fix usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov 42f2edd282 [Wasm] Require location for buildThrow and fix all usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov 1244cd1259 [Wasm] Require location for buildBr* and fix all usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov 95c84d5d3f [Wasm] Require location for buildDrop and fix all usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov 6eba0392db [Wasm] Require location for buildRefNull and fix all usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov 12854af0a2 [Wasm] Require location for buildRefTestStatic and fix all usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov 7bd92bc412 [Wasm] Require location for buildRefCastNullStatic and fix all usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov 158a307334 [Wasm] Require location for buildStructSet and fix all usages 2023-01-17 19:37:05 +01:00
Zalim Bashorov e7dc443c18 [Wasm] Require location for buildStructGet and fix all usages 2023-01-17 19:37:04 +01:00
Zalim Bashorov 530438dfcb [Wasm] Require location for buildStructNew and fix all usages 2023-01-17 19:37:04 +01:00
Zalim Bashorov 3967bd2755 [Wasm] Require location for buildSetGlobal and fix all usages 2023-01-17 19:37:04 +01:00
Zalim Bashorov 65e1b53027 [Wasm] Require location for buildGetGlobal and fix all usages 2023-01-17 19:37:04 +01:00
Zalim Bashorov 00d0c38fc3 [Wasm] Require location for buildSetLocal and fix all usages 2023-01-17 19:37:04 +01:00