Commit Graph

226 Commits

Author SHA1 Message Date
Artem Kobzar d39fd9416a [Build] Fix compilation of kotlin-js(-ir) libraries in 1.9.0 (stdlib and test) 2023-02-18 13:26:53 +00:00
Alexander.Likhachev 18752fc1ad Revert "[Build] Add a temporary workaround for KT-56357"
This reverts commit ca60a4fcf9.
2023-02-17 15:03:53 +01:00
Yahor Berdnikau 6f8422eab3 Revert "[Build] Temporary disable hmpp metadata tasks with CoCa"
This reverts commit e42bed07fa.
2023-02-08 16:27:27 +00:00
Yahor Berdnikau 8d41c87b6b Revert "[Build] Add configuration cache compatibility workaround for MetadataDependencyTransformationTask"
This reverts commit a5f48e295e.
2023-02-08 16:27:27 +00:00
Alexander Korepanov 9324cf3360 [JS IR] Support function type interfaces in incremental cache infrastructure
The patch removes logic of generating extra IrFiles (fake file) into
 IrModuleFragment for the function type interfaces during klib deserialization,
 because IC infrastructure can not process files which do not exist in klib.

 Instead of adding extra IrFiles during deserialization, the empty files
 with required packages are added into Kotlin/JS stdlib physically.
 These files are used as containers for function type interface declarations.

 Since Kotlin/WASM uses the same klib loading infrastructure as Kotlin/JS,
 the the empty files are added into Kotlin/WASM stdlib as well.

 The patch also adds a check that IrModuleFagment has files only from klib.

^KT-55720 Fixed
2023-02-03 12:23:48 +00:00
Svyatoslav Kuzmich abf70a586c [Wasm] stdlib API: make kotlin.assert internal
Being disabled by default
 and not well-documented, these functions cause confusion among early
 adopters as to why their code don't work properly.

Assert APIs need a proper design across Kotlin platforms.
 Since APIs are not available in common code and K/JS, it is premature
  to have such a general feature in a new experimental platform.

Compiler tests:
* Mute tests that rely on assert.
* Replace JVM-specific assert calls with require calls and unmute passed K/JS tests.

Merge-request: KT-MR-8636
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-02-02 07:06:12 +00:00
Alexander.Likhachev ca60a4fcf9 [Build] Add a temporary workaround for KT-56357 2023-02-01 14:56:07 +01:00
Dmitriy Novozhilov a5f48e295e [Build] Add configuration cache compatibility workaround for MetadataDependencyTransformationTask 2023-02-01 11:31:45 +00:00
Zalim Bashorov 58e523b890 [Wasm] Change target directory for wasm intrinsics for finer tuning code owners
Also, minor cleanup in the generator.
2023-02-01 00:35:49 +01: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
Svyatoslav Kuzmich 983140ca04 [Wasm] stdlib NFC: suppress unchecked cast 2023-01-24 16:02:48 +01:00
Svyatoslav Kuzmich feca26e481 [Wasm] stdlib NFC: remove experimentalPackageStub.kt
Common sources now include `kotlin.experimental` and this file is no longer needed.
2023-01-24 14:55:00 +01:00
Svyatoslav Kuzmich e1f72d60dc [Wasm] stdlib API: Mark primitives constructor properties as private
These are implementation detail and were not meant to be public
2023-01-24 14:55:00 +01:00
Svyatoslav Kuzmich 354b231ea2 [Wasm] stdlib API: Mark internal compareTo functions as internal
Default public visibility was a mistake.
They were not intended to be public.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich e109662cdc [Wasm] Enable warnings in stdlib and treat them as errors 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 72d9b8ddae [Wasm] stdlib NFC: Fix or suppress remaining warnings 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 238da4c793 [Wasm] stdlib NFC: Suppress cast warnings in org.w3c
Also fix dukat build and update copyright year in generated files.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 7fed003531 [Wasm] stdlib: Remove unchecked cast in PrimitiveClasses::functionClass
This half-stub function is used for compatibility with Kotlin/JS
lowering and doesn't need full KClassImpl<Any> return type.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich dba5d401bb [Wasm] fdlibm NFC: Remove dead code in expm1
Fixes warning that value of y is never used before it is read.

Removed dead code is not present in FreeBSD codebase since at least 1994
https://github.com/freebsd/freebsd-src/blame/34ac629b40e68e5394fe0a27e47c73a875d9f8cb/lib/msun/src/s_expm1.c#L141
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich d6a713ad39 [Wasm] fdlibm NFC: Remove dead code in __ieee754_pow
Fixes warnings.
i0 and i1 are not used in the original C code.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 3acf371f8a [Wasm] fdlibm NFC: Replace division by zero with inf and NaN constants
Fixes warnings.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 181e1023ed [Wasm] fdlibm NFC: Suppress name shadowing for "mutable parameters" 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 5faa430904 [Wasm] fdlibm NFC: Remove unnecessary variable initializers in
Fixes warnings.
These initializers were not in the original C code anyway.
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich ffb8138ae2 [Wasm] stdlib NFC: Suppress warnings in _WasmArrays.kt 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 14cf0a0b3f [Wasm] stdlib NFC: Remove dead code in Number2String.kt
This fixes compiler warning
`w_exp` corresponds to unused field of `w` struct
in the original C code
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich d0b25e5a90 [Wasm] stdlib NFC: Suppress warnings for @WasmPrimitiveConstructor 2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 8973ba294e [Wasm] stdlib API: Mark all Double and Float companion values as const
Make it consistent with core/builtins and K/N runtime
2023-01-24 14:54:59 +01:00
Svyatoslav Kuzmich 6efeee2037 [Wasm] stdlib API: remove bitwise Byte and Short operations from builtins
They shadow kotlin.experimental extensions
2023-01-24 14:54:59 +01:00
Ilya Goncharov d7c31f79a8 Do not suppress NPM related tasks, but be aware about checking of them in task graph 2023-01-19 13:43:57 +00:00
Ilmir Usmanov d18672bfb1 Wrap continuation with ContinuationImpl on callable references
in startCoroutineUninterceptedOrReturn. Otherwise, the coroutine will
not be interceptable later.

Add a test, which checks, that intercepted continuation is released.

 #KT-55869
2023-01-19 00:35:36 +00:00
Abduqodiri Qurbonzoda ba2833b90f Mark Base64 API with ExperimentalEncodingApi 2023-01-16 11:24:50 +00:00
Svyatoslav Kuzmich d14d4c8510 [Wasm] Support JsModule and JsQualifier 2023-01-13 21:58:34 +00:00
Svyatoslav Kuzmich 1564de5859 [Wasm] Support external vararg
Initial implementation copies Wasm array to JS array and spreads it
2023-01-11 10:35:36 +00:00
Alexander Udalov ae6d4d268d Use short copyright from COPYRIGHT_HEADER in generated files 2023-01-02 22:52:18 +01:00
Svyatoslav Kuzmich 9bc6b420a9 [Wasm][Stdlib] Add public APIs for linear memory access
Needed for interop with APIs that use linear memory.
2022-12-29 19:25:23 +00:00
Igor Yakovlev 35340f2f04 [Wasm] Fix stdlib String to Float parse 2022-12-29 11:57:47 +00:00
Igor Yakovlev 1b2b7ce34c [Wasm] Support Number type for external functions 2022-12-29 11:57:45 +00:00
Igor Yakovlev 4bd187ccea [Wasm] Move ItemArrayLike w3c declarations into the right package 2022-12-29 11:57:44 +00:00
Svyatoslav Kuzmich add5fa6e0d [Wasm] Minor: remove unused stdlib stub
Merge-request: KT-MR-8140
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2022-12-29 05:29:32 +00:00
Svyatoslav Kuzmich 3bbd8c291a [Wasm] Add @WasmImport annotation
Imports top-level function from given module
2022-12-28 12:13:18 +01:00
Svyatoslav Kuzmich 7ec6608e29 [Wasm] Add Promise and support tests that return Promise
Co-authored-by: Ilya Gorbunov <Ilya.Gorbunov@jetbrains.com>

Merge-request: KT-MR-7717
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2022-11-25 20:56:47 +00:00
Zalim Bashorov 7f8f7aa050 [Wasm] Revert ref cast and test instructions to be compatible with Binaryen 2022-11-25 15:31:48 +01:00
Zalim Bashorov 5f140dac21 [Wasm] Remove wasm_ref_cast and use wasm_ref_cast_null inside the compiler 2022-11-25 15:31:47 +01:00
Igor Yakovlev c8306f1a3b [Wasm] Mark rotate functions with WasExperimental 2022-11-19 11:49:06 +01:00
Zalim Bashorov 919029f34f [Wasm] Add fast path for null in externRefToAny
- Introduce new intrinsics `wasm_ref_cast_null` & `wasm_ref_test_null`.
- Support getting type for immediate from generic argument.
- Remove redundant null check in `tryGetOrSetExternrefBox`.
2022-11-18 17:30:10 +01:00
Zalim Bashorov ab590e1279 [Wasm, stdlib] Change visibility for wasm_* helper functions to internal 2022-11-15 12:55:10 +01:00
Zalim Bashorov 2fc6cea681 [Wasm] Migrate to the new GC M6 instructions 2022-11-15 12:55:10 +01:00
Igor Yakovlev 210212c284 [WASM] Remove redundant parameters for w3c dynamic getters 2022-11-11 10:53:05 +00:00
Igor Yakovlev b6eb2b3620 [WASM] Add w3c bindings 2022-11-10 14:22:44 +00:00
Zalim Bashorov 9ed94b25fa [Wasm] Cleanup instructions list
* Split by proposal, at least for work-in-progress ones
* Add a link to the repo for WIP proposals
* Move some instructions to right group
2022-11-09 13:44:38 +01:00