Alexander Udalov
acd29481bd
Regenerate sources of builtins and stdlib
2021-01-03 22:31:06 +01:00
Ilya Gorbunov
3c37bbaf64
Duration: normalize to avoid negative zeroes (KT-44168)
...
The current comparison method of inline classes makes
durations of positive and negative zeroes non-equal.
To avoid that, normalize the duration value upon construction
preventing negative zero being stored.
2020-12-31 19:44:39 +03:00
Ilya Gorbunov
ae6f10df3b
Duration: reject NaN duration values (KT-44168)
2020-12-31 19:44:10 +03:00
Ilya Gorbunov
1d40ed39d0
KotlinVersion: Advance snapshot version 1.4.255 -> 1.5.255
...
KTI-421
2020-12-31 19:20:29 +03:00
Abduqodiri Qurbonzoda
662787b12b
Straighten Char-to-code and Char-to-digit conversions out #KT-23451
2020-12-31 12:07:41 +03:00
Ilya Gorbunov
79e426270c
Rename Random.Default serialization surrogate object (KT-25571)
2020-12-31 06:57:17 +03:00
Iaroslav Postovalov
00506a75d3
Make Random implementations serializable (KT-25571)
...
Make Random.Default, XorWowRandom, and wrapper classes for JDK Random implement Serializable interface.
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com >
2020-12-31 04:10:28 +03:00
Svyatoslav Kuzmich
22239e2733
[Wasm] Remove unused super class field in type info
2020-12-30 19:29:11 +03:00
Svyatoslav Kuzmich
785c947782
[Wasm] Improve class type checks
...
Use wasm ref.test instad of manual type info linked list traversal
2020-12-30 19:29:10 +03:00
Svyatoslav Kuzmich
b6ad1584c9
[Wasm] Improve interface method dispatch
...
- Use typed Wasm tables for each interface method to avoid runtime
function type check
- Use linear search by implemented interface rather than by individual
virtual function signature
2020-12-30 19:29:10 +03:00
Abduqodiri Qurbonzoda
1314adb6f7
Locale-agnostic case conversions by default #KT-43023
2020-12-30 10:08:25 +03:00
Zalim Bashorov
72593e3d30
[JS IR] Revert jsClass_js-ir.kt to not break compatibility with older compiler versions
2020-12-24 20:03:23 +03:00
Zalim Bashorov
d7e3f826bb
[JS IR] Generate jsClass function inside the compiler instead of relying on declaration inside stdlib
...
We want to make its type parameter reified to do it we have to make it inline and non-external.
But we don't want to inline it in call sites and want prevent using it anywhere except places generated by the compiler.
In user code, including stdlib, we should use `K::class.js` instead.
Separately we have to intrinsify `K::class.js` to reduce overhead.
2020-12-24 20:03:23 +03:00
Zalim Bashorov
df6635085b
[JS IR] Replace calls with invalid type arguments for type parameters with call to errorCode function from runtime.
2020-12-24 20:03:22 +03:00
Alexander Udalov
3f517d7e8d
Add new metadata flag for class files compiled with FIR
...
Report a separate error when class files compiled with FIR are in
dependencies, in addition to the one for class files compiled with FE
1.0 + JVM IR.
#KT-43592
2020-12-20 23:14:30 +01:00
Ilya Gorbunov
43c04dfd08
[Wasm] Publish stdlib: remove separate project
2020-12-17 14:13:51 +03:00
Svyatoslav Kuzmich
602ed42b99
[Wasm] Move intrinsic generators to generators/wasm
...
Reason: avoid kotlin-stdlib-gen dependency on kotlinStdlib() via wasm.ir
2020-12-15 19:44:19 +03:00
Svyatoslav Scherbina
0f4173cdfa
Fix running stdlib tests in worker on Native
...
Add `@SharedImmutable` or `@ThreadLocal` where required.
2020-12-14 19:03:06 +03:00
Ilya Gorbunov
8f4e4a4d40
Specify common sources for stdlib test compilation tasks
...
Some multiplatform tests are compiled in single-platform projects:
- in kotlin-stdlib-jdk7
- in kotlin-stdlib-jdk8
- in kotlin-stdlib-js-ir. The latter is technically MPP but with a
single platform, so its common sources are not considered as common.
Pass information about common sources to test compilation tasks in order
to use OptionalExpectation annotations there.
Co-authored-by: Svyatoslav Scherbina <svyatoslav.scherbina@jetbrains.com >
2020-12-14 19:03:04 +03:00
Svyatoslav Scherbina
c094d77794
Fix DeepRecursiveFunction in worker on Native
...
Add `@SharedImmutable` to `UNDEFINED_RESULT` top-level property.
2020-12-14 19:03:03 +03:00
Svyatoslav Kuzmich
7efc95705a
[Wasm] Publish stdlib klib to maven
2020-12-14 17:47:19 +03:00
Svyatoslav Kuzmich
d37271bf35
[Wasm] Support packed integer array elements
2020-12-14 14:40:38 +03:00
Ilya Gorbunov
28168bf230
Correctly implement specialized MutableEntrySet.contains KT-41278
...
This is a workaround for the problem KT-43321.
Introduce an intermediate abstract set specialized for Map.Entry elements
and implement 'contains(Map.Entry)' method there.
Then inherit that intermediate set in entrysets of JS HashMap,
JS LinkedHashMap, JVM MapBuilder, that are specialized for
MutableMap.MutableEntry elements, so that no override of 'contains' is
required anymore.
This allows to avoid incorrect special 'contains' bridge being generated
that otherwise rejects all arguments except ones of MutableEntry type.
2020-12-14 12:42:47 +03:00
Denis.Zharkov
6e4f84dddf
Add @SinceKotlin("1.5") on JvmRecord annotation
2020-12-09 16:47:23 +03:00
Denis.Zharkov
4f5db241ea
Add @JvmRecord annotation and relevant diagnostics
...
^KT-43677 In Progress
2020-12-09 16:29:03 +03:00
Svyatoslav Kuzmich
d4233f3f0e
[Wasm] Use Wasm GC arrays instead of JS arrays
...
JS arrays was a workaround for lack of arrays in Firefox Wasm GC prototype
Now with V8 as a test runner we can use proper arrays
2020-12-09 15:56:45 +03:00
Svyatoslav Kuzmich
4bb163fd1f
[Wasm IR] Add missing GC and function reference instructions
2020-12-09 15:56:44 +03:00
Svyatoslav Kuzmich
6063353b64
[Wasm] Generate stdlib WasmOp based on WasmOp from Wasm IR
2020-12-09 15:56:44 +03:00
Ilya Gorbunov
149bcc2d22
Revert using regex Pattern in String.replace
...
Use String.indexOf(..., ignoreCase) instead in all branches to preserve
compatibility with behavior before 1.4.20 that used String.split which
essentially relied on that String.indexOf
#KT-43745 Fixed
2020-12-04 17:43:54 +03:00
Vyacheslav Gerasimov
235813736e
Build: Set file access rights explicitly in kotlin-stdlib-js jar
...
Workaround for #KTI-401. Since gradle 6.6 ant.replaceregexp call sets
incorrect access rights `-rw-------` instead of `-rw-r--r--`
2020-12-04 01:47:18 +03:00
Ilmir Usmanov
f0a787551a
Value classes: Raise retention of @JvmInline to RUNTIME
...
so it will be visible by reflection
2020-12-01 23:45:50 +01:00
Ilya Gorbunov
0634351fbc
Introduce pathString/absolute/absolutePathString
...
Rename invariantSeparatorsPath to invariantSeparatorsPathString
to have more consistent names of methods returning path strings.
KT-19192
2020-11-29 17:46:47 +03:00
Ilya Gorbunov
84f5a294f7
Allow passing null parent directory to createTempFile/Directory
...
null signifies the default temp directory.
KT-19192
2020-11-29 17:46:47 +03:00
Ilya Gorbunov
64d85f259c
Relax writeText/appendText parameter type to CharSequence
...
KT-19192
2020-11-29 17:46:47 +03:00
Ilya Gorbunov
7fd96f5773
Fix annotation spelling in docs
...
KT-43586
2020-11-26 15:37:22 +03:00
Ilmir Usmanov
aabe709079
Value classes: Add @JvmInline annotation to stdlib
2020-11-25 01:08:31 +01:00
Ilmir Usmanov
9070d6d581
IC mangling: Use old mangling scheme in stdlib
2020-11-19 17:39:31 +01:00
Ilya Gorbunov
4767696840
Qualify replacement expression with receiver to workaround KT-42874
2020-11-12 05:29:39 +03:00
Kris
173954b3b3
Add samples for Random.nextX() functions
2020-11-11 01:37:37 +03:00
Kris
ebdd023633
Add samples for last() and lastOrNull() functions
2020-11-11 01:37:24 +03:00
Ilya Gorbunov
66f5c98505
Deprecate createTempFile/createTempDir functions
...
Document their potential permission problems.
Suppress this deprecation in tests.
2020-11-10 18:25:48 +03:00
Svyatoslav Kuzmich
03e63f1103
[Wasm] Enable maven-publish plugin in wasm stdlib
2020-11-10 13:08:04 +03:00
Svyatoslav Kuzmich
4d59a58291
[Wasm] Add interop annotation @JsFun
2020-11-10 13:08:04 +03:00
Svyatoslav Kuzmich
e51a76bc4e
[Wasm] Basic CLI
...
-Xwasm option that will produce wasm instead of JS when used with -Xir-produce-js
Does not affect klib production
2020-11-10 13:08:04 +03:00
Alexander Udalov
d9efc2d922
Fix warnings in compiler code and tests
2020-11-09 19:46:10 +01:00
Svyatoslav Kuzmich
bfd0f21e9d
[Wasm] Major compiler and stdlib update
2020-11-09 16:04:43 +03:00
Alexander Udalov
d326d6a693
Specify module name via moduleName option instead of freeCompilerArgs
...
This allows to get rid of warnings about duplicate module name in some
of the modules.
2020-11-06 19:27:32 +01:00
Dominik Wuttke
3acb468d48
Add a link to scope functions overview for takeIf and takeUnless
...
Co-authored-by: Dominik Wuttke <Dominik.wu@gmx.net >
2020-10-30 04:09:50 +03:00
Uzi Landsmann
f48f7c6dca
Added samples for the kotlin.system package (measureTime* functions)
...
Co-authored-by: Ilya Gorbunov <ilya.gorbunov@jetbrains.com >
2020-10-30 03:35:15 +03:00
Uzi Landsmann
15381c4662
Added samples for the kotlin.streams package
...
Co-authored-by: Uzi Landsmann <uzi.landsmann@bisnode.com >
2020-10-30 02:23:31 +03:00