Commit Graph

3350 Commits

Author SHA1 Message Date
Pavel Punegov 0249b7ed74 [K/N] Stdlib: warnings as errors
Fix or suppress warnings in Native stdlib.
2021-11-25 08:08:38 +00:00
Ilya Gorbunov d7c31fbe82 Disregard PlatformImplementation class loaded from parent classloader
Such type cannot be cast to a base type, if the former is loaded from
a different, parent classloader.

#KT-47857 Fixed

Co-authored-by: Aleksei.Cherepanov <aleksei.cherepanov@jetbrains.com>
2021-11-24 01:59:48 +03:00
Ilya Goncharov f48436b35e rra/ilgonmic/eager-like-native
[JS IR] Leave JsEagerInitialization until bootstrap update

[JS IR] Fix js stdlib api

[JS IR] Change annotation on eager initialization in sources

[JS IR] Make eager initialization consistent with native

Merge-request: KT-MR-5030
2021-11-22 12:45:37 +00:00
Dmitry Petrov 77dde26c7c JVM KT-48944 improve performance of FunctionReference#equals
'getOwner()' computes KDeclarationContainer for function references,
which can be costly. Compare other FunctionReference properties first.
2021-11-20 10:31:07 +03:00
Roman Artemev 7f27ebc589 [JS IR] Add API to js runtime to throw linkage errors 2021-11-19 01:16:35 +03:00
Anton Bannykh ee6d3ea281 [JS IR] mark coroutine intrinsics as inline
They are de-facto inlined, but their bodies don't get
loaded when using the "no bodies except for inline functions"
deserializtion mode.
2021-11-19 00:39:06 +03:00
Svyatoslav Kuzmich f833fc4bcb [Wasm] Default parameter values for external functions
+ import top-level external functions wrapped in lambdas
2021-11-17 19:28:14 +00:00
Alexander Udalov 850d76f6bf Remove error on annotated types as arguments to typeOf
Instead, document that `KType.annotations` returns an empty list for
types created with `typeOf`. Annotations might be supported in the
future.

 #KT-49573 Fixed
 #KT-29919
2021-11-16 15:02:50 +01:00
Igor Yakovlev ec9fcce1bc [WASM] Add hashCode, equals and toString to KClass and KType implementations 2021-11-15 19:53:48 +03:00
Igor Yakovlev ee7f4c7278 [WASM] Implementation typeOf support 2021-11-15 19:53:48 +03:00
Igor Yakovlev 39a389c49a [WASM] Implementation qualifiedOrSimpleName 2021-11-15 19:53:47 +03:00
Igor Yakovlev ce360bb10b [WASM] Implementation of Class references 2021-11-15 19:53:46 +03:00
Igor Laevsky c7cfa97748 [Wasm] Implement Any::hashCode() 2021-11-15 18:26:46 +03:00
Igor Laevsky 9e00a2c5b4 [Wasm] Implement platform random in stdlib 2021-11-15 18:26:45 +03:00
Svyatoslav Kuzmich 08362e8b38 [Wasm] Support defineExternally 2021-11-12 18:44:46 +03:00
Alexander Udalov e7680ddbff Fix execution optimization warning for :kotlin-stdlib-common:sourcesJar
#KTI-662 Fixed
2021-11-12 13:24:08 +01:00
Sergey Bogolepov f43b5d32f9 Add tests for Char.isHighSurrogate() and Char.isLowSurrogate() 2021-11-09 08:27:59 +00:00
Igor Laevsky 22c161bcee [Wasm] Run unit tests for the wasm stdlib (fail on verifier for now) 2021-11-03 16:23:02 +03:00
Igor Laevsky 46b56c7642 [Wasm] Improve string constructor in stdlib 2021-11-03 16:23:01 +03:00
Igor Laevsky cb10bd3a95 [Wasm] Port stdlib and kotlin.test build to wasm gradle plugin 2021-11-03 16:23:01 +03:00
Svyatoslav Kuzmich 5b10396f48 [stdlib] Test that modification of the array returned by toCharArray() doesn't affect the original string 2021-10-28 15:49:00 +00:00
Svyatoslav Kuzmich 766377a041 [Wasm] Remove WasmForeign annotation
No longer needed since external interfaces are supported
2021-10-28 18:47:38 +03:00
Svyatoslav Kuzmich 4fc461a2ff [Wasm] Imporove external interface support
* Support boxing/unboxing when casting to Any
* Support ===, equals, hashCode, toString

* Support adapting String in interop boundary
2021-10-23 01:26:12 +03:00
Svyatoslav Kuzmich baa53b5cf3 [Wasm][Stdlib] Use array copy in String.toCharArray()
And don't use copy during internal non-mutating algorithms
2021-10-23 01:26:11 +03:00
Ilya Gorbunov a2b9c2bd78 Document Regex constructor using "u" flag in JS #KT-46694 2021-10-22 11:51:48 +00:00
Ilya Gorbunov 9456cd0f5d Improve Duration docs
- Document overflow situation in general
- Document possible rounding in operations involving Double
- Update kotlin.time package description
2021-10-22 11:51:48 +00:00
Ilya Gorbunov 0487261be8 Duration: postpone raising deprecation to error for top-level extension properties
#KT-46229
2021-10-19 09:29:16 +00:00
Abduqodiri Qurbonzoda f0a75e7843 Advance deprecation level of Experimental and UseExperimental annotations to ERROR 2021-10-17 21:14:36 +00:00
Svyatoslav Kuzmich 0f66f85cf9 [Wasm] Support main function 2021-10-15 13:58:55 +03:00
Igor Laevsky cb5bef1535 [Wasm] Remove unnecessary testHelpers and add assertions from stdlib 2021-10-14 17:24:06 +03:00
Igor Laevsky bede039c08 [Wasm] Add compiler support for the kotlin.test library 2021-10-14 17:24:05 +03:00
Igor Laevsky 7943298240 [Wasm] Add sorting function to the stdlib 2021-10-14 17:24:04 +03:00
Igor Laevsky 049e48e780 [Wasm] Keep error message for the IAE exception 2021-10-14 17:24:03 +03:00
Igor Laevsky 14eee7c539 [Wasm] Add kotlin-test-wasm library 2021-10-14 17:24:02 +03:00
Svyatoslav Kuzmich a6afb7cb41 [JS IR][Wasm] Preload (Suspend)FunctionN needed in lowerings
This reverts commit 15d178d850d15675ee39cbd833d13f4c8aed83ff.
2021-10-12 08:42:01 +03:00
Svyatoslav Kuzmich 3bce0cc055 [Wasm] Support coroutines
- Reuse JS IR Suspend function lowering
  - Fix types
  - Disable reinterpretCast-based optimization for inline
    classes
- Add basic support to Wasm stdlib
- Explicitly transform suspend functions into regular functions
  with continuations
- Clean suspend function handling from JS IR codegen
2021-10-12 08:42:01 +03:00
Svyatoslav Kuzmich b8a5b9bb02 [Native-Wasm][Stdlib] Workaround FE bug
Workaround bug that causes frontend to produce invalid IR (KT-49182)
2021-10-12 08:42:00 +03:00
Svyatoslav Kuzmich 9ef899ef10 [Wasm] Reuse Callable reference and SAM lowerings from JS 2021-10-08 07:24:41 +03:00
Svyatoslav Kuzmich 1ed2748334 [Wasm] Generate [K][Suspend]FunctionN on demand and support big arity 2021-10-08 07:24:41 +03:00
Ilya Gorbunov 9c4a2d4431 Leave all deprecated duration API experimental KT-46784 2021-10-06 13:51:23 +00:00
Svyatoslav Kuzmich fa3e75463e [Wasm] Support throwIAE and throwNoBranchMatchedException
Add a couple of test stubs
Unmute tests
2021-10-02 06:14:36 +00:00
Georgy Bronnikov 41e38d5a1a JVM_IR: move serialized IR to a separate annotation 2021-10-02 00:56:46 +03:00
Svyatoslav Kuzmich ab9a23cbfa [Wasm][Stdlib] Reuse K/N collections and StringBuilder 2021-10-01 17:18:49 +03:00
Svyatoslav Kuzmich 6ad6bca503 [Stdlib] Fix K/N StringBuilder insertRange capacity issue 2021-10-01 17:18:48 +03:00
Ilya Goncharov 18189ece48 [JS IR] Fix stdlib API 2021-10-01 13:32:14 +00:00
Ilya Goncharov 490ebde992 [JS IR] Commonize JsEagerInitialization 2021-10-01 13:32:13 +00:00
Ilya Goncharov 9af66d15a3 [JS IR] Fix stdlib API 2021-10-01 13:32:10 +00:00
Ilya Goncharov c2cf221965 [JS IR] Add annotation for eager property initialization 2021-10-01 13:32:10 +00:00
Ilya Goncharov b5fb0d9f33 [JS IR] Deprecate safeProperty(Get|Set) methods from stdlib 2021-10-01 13:21:19 +00:00
Abduqodiri Qurbonzoda 1ae7c2af21 Use JS substituteGroupRefs implementation in Native as well 2021-09-30 17:38:03 +00:00