Commit Graph

105 Commits

Author SHA1 Message Date
Ilya Gorbunov 35ae913a5e Stabilize new string and char case conversion API KT-45873 2021-04-03 10:39:17 +03:00
Ilya Gorbunov 8b85bae020 Stabilize Char-to-Int conversions KT-45874 2021-04-03 10:30:50 +03:00
Ilya Gorbunov fa7460ba48 Store Duration value as a multi-range Long
Now precision loss happens at bigger durations.

This changes the binary API due different underlying type of Duration.
2021-04-02 17:43:20 +03:00
Alexander Shabalin 71397a06fb Add Stop-the-World Mark & Sweep GC for single-threaded programs.
GC implementation for testing purposes

* Only works for a single mutator
* Runs on the same thread as the mutator
* Runs every nth checkpoint and after every m bytes are allocated
* Runs finalizers after sweeping on the mutator thread.
2021-04-02 12:13:44 +00:00
Elena Lepilkina 393aaac2b9 [Native] Removed old gradle properties for kotlin repo and versions 2021-04-02 05:42:13 +00:00
Alexander Shabalin 770401801b Implement freezing in the new MM
Currently, it uses suboptimal storage for the freeze bit. This'll be revised later when we finalize stack objects handling in the new MM.
2021-03-26 15:00:14 +00:00
Svyatoslav Scherbina ce239ccc3e Native runtime: remove unused dependency on common/src/hash
No longer required after c8633d8bda.
2021-03-22 16:03:30 +00:00
Svyatoslav Scherbina 8b3ff11a2b Provide CName annotation in common stdlib as optional 2021-03-22 09:20:05 +00:00
Alexander Shabalin 5b1c30c198 Extract initializing singleton marker
* Extract kInitializingSingleton marker
* Extract isNullOrMarker helper function
2021-03-19 08:19:10 +00:00
Ilya Matveev 6643119f08 [K/N][New MM] Move ThreadStateGuard to the main Memory.h
Integrating the stdlib with the thread states machinery requires
accessing to some parts of the new MM. This patch provides this
access by moving these parts to the main Memory.h header.
2021-03-16 17:04:26 +03:00
Ilya Matveev 482305cfb2 [K/N][New MM] Move RunInNewThread to the main ThreadSupport.hpp
Some of unit-tests for the C++ part of the stdlib will require
thread state switching. In the new MM, we already have a helper
function that allows us to scopely initialize the memory subsystem
for a separate thread. This patch makes this helper available
for tests in the main runtime module by moving it to the main
ThreadSupport.hpp.
2021-03-16 17:04:25 +03:00
Ilya Matveev fc43fbf578 [K/N][New MM] Move MemoryState conversions to separate header 2021-03-16 17:04:23 +03:00
Alexander Shabalin f51c85a63f Add test support for types and objects creation
* test_support::TypeInfoHolder to create TypeInfo given payload description
* test_support::Object<Payload> to create objects with Payload and to get them from ObjHeader* after checking that their type_info are layout compatible.
* test_support::*Array<Count> to create various arrays with given length and similarly get them from ArrayHeader*.
2021-03-15 11:25:04 +00:00
Abduqodiri Qurbonzoda d4b3ae92cb [K/N] Strict version of String.toBoolean() #KT-42071 2021-03-12 09:26:58 +03:00
Alexander Shabalin e53c8ba6ca Add FinalizerQueue to ObjectFactory (#4725)
(cherry picked from commit af70866594c31c81dfcc41b2e8b33c7a0cdc38f5)
2021-03-09 20:19:36 +00:00
Sergey Bogolepov f840b45ae1 Add hack for kotlinx-datetime:0.1.1 linkage
Provide a `std::system_category` wrapper with
the same mangling as in GCC 4.8.5

(cherry picked from commit ec5828a1f375a74a09aa49182571201e1f67b4fa)
2021-03-09 20:19:35 +00:00
LepilkinaElena fcbb921194 [LEGACY MM] Escape making extra increments and decrements during coping to the same array (#4731)
(cherry picked from commit 8b601d8e2c6bc772386ebd88d303a032a6f54237)
2021-03-09 20:19:34 +00:00
LepilkinaElena 6641b4f029 [LEGACY MM] Fixed types in messages for tracing GC (#4729)
(cherry picked from commit 2f34b0f98e77226f02809a685a96ebb683a69e9d)
2021-03-09 20:19:30 +00:00
Vladimir Ivanov fd02802028 [Native] Export KDoc into generated native header 2021-03-09 16:50:23 +03:00
Abduqodiri Qurbonzoda 4401589974 [K/N] Fix @SinceKotlin in Common titlecase and titlecaseChar functions 2021-03-07 07:38:05 +03:00
Abduqodiri Qurbonzoda aa5874e073 [K/N] Mark with @SinceKotlin("1.5") the Common char category API 2021-03-07 07:37:47 +03:00
Abduqodiri Qurbonzoda 1c1492da3d Optimize K/N ArrayList.toArray #KT-42720 2021-03-06 11:15:08 +03:00
Abduqodiri Qurbonzoda c2f6a2cb96 [K/N] Commonize and generalize JVM-only String.contentEquals #KT-42840 2021-03-06 11:14:32 +03:00
Abduqodiri Qurbonzoda 85fe636d60 Commonize Char.titlecaseChar() and Char.titlecase() #KT-44369
(cherry picked from commit 7b991613bb577a58235519b76ebec8b33270f783)
2021-03-02 17:11:25 +00:00
Abduqodiri Qurbonzoda 63897b5aca Update Unicode version in Char and String case conversion functions #KT-45213
(cherry picked from commit 25b0dac947cb55f842b8e503351f4ebd2064628c)
2021-03-02 17:11:23 +00:00
Alexander Shabalin 27e4b21020 Extract object traversals (#4724)
(cherry picked from commit c3131ea2f51c31881ea068f28035f4d015daf609)
2021-03-02 17:11:22 +00:00
Alexander Shabalin 248e340cd9 Extract finalizer hooks (#4723)
(cherry picked from commit 31aa3521925a22f077acb723315aabb0a7274121)
2021-03-02 17:11:21 +00:00
Vasily Levchenko 7b73917217 [build][dist] global dist fixed 2021-02-24 11:07:17 +01:00
Vasily Levchenko 840c1e612c [build] joint (step 2)
- dist:
  - compiler
  - tools(cinterop,klib)
  - stdlib
  - cache
2021-02-24 11:07:13 +01:00
Alexander Shabalin 3a5c6480a3 Track current exception (#4701) 2021-02-24 11:00:05 +01:00
Alexander Shabalin a38e64a7c8 Update runtimeDefinitions after toolchain upgrade (#4714) 2021-02-24 11:00:05 +01:00
Svyatoslav Scherbina f766a3eae4 Optimize CPointer.toKStringFromUtf8 on Native
Use strlen and stop allocating intermediate ByteArray
to make the performance comparable to ByteArray.decodeToString().

Partially fix KT-44357.
2021-02-24 10:53:42 +01:00
Alexander Shabalin d5ca285a79 Move unhandledExceptionHook to kotlin code (#4704) 2021-02-24 10:53:42 +01:00
Alexander Shabalin 97262c273f Misc changes for GC in new MM (#4699) 2021-02-15 10:16:10 +01:00
Igor Chevdar 3164709fb7 [runtime] Fixed bug in x86 polynomial hash
Forced compiler to use legacy SSE instructions form instead of modern AVX form
2021-02-09 09:00:48 +01:00
Alexander Shabalin eedfea7f40 Add RootSet to unify iterating across the entire rootset (#4685) 2021-02-09 09:00:48 +01:00
Alexander Shabalin d875cb39c9 Sketch GC interface (#4682) 2021-02-09 09:00:48 +01:00
Svyatoslav Scherbina 61d3ae1477 Refactor building of reverse adapters in ObjCExportCodeGenerator
* Make it more understandable and reliable: don't predict which reverse
  adapters are inherited, reuse information from generating super types
  instead.
* Drop usages of obsolete "IrDeclaration.descriptor"
2021-02-09 09:00:48 +01:00
Ilya Matveev e45c2d31bc [kotlin.test] Do not run test suites containing only ignored tests
Popular frameworks such as JUnit, TestNG and Google Test do not
run @BeforeClass/@AfterClass hooks of test suites containing only
ignored tests.

This patch introduces the same behaviour to the Kotlin/Native's
kotlin.test runner.

See also: #4522, #4615.
2021-02-09 09:00:47 +01:00
Ilya Matveev 4f037b8b81 [kotlin.test] Don't run filtered out test suites by default
Popular frameworks such as JUnit, TestNG and Google Test do not
run test suites whose tests were fully filtered out. Thus
@BeforeClass/@AfterClass of such suites are not executed and the
suites are not reported in a test report.

This patch introduces the same behaviour to the Kotlin/Native's
kotlin.test runner.

See also: #4522, #4615.
2021-02-09 09:00:47 +01:00
Egor Zhdan c866dc7303 Fix reporting of filtered out test suites
This fixes the `--ktest_no_excluded_test_suites` command line option behavior to match its description in the help page.
2021-02-09 09:00:47 +01:00
Alexander Shabalin f312315346 Call initRuntimeIfNeeded before EnterFrame in interop adapters. (#4672) 2021-02-09 09:00:47 +01:00
Alexander Shabalin 99dc9e8e0c Relax setUnhandledExceptionHook requirements with the new MM (#4675) 2021-02-09 09:00:46 +01:00
Alexander Shabalin 2b69a0d03a Fix InitAndRegisterGlobal in new MM (#4673) 2021-02-09 09:00:46 +01:00
Alexander Shabalin 3bf1f55990 Handle nullptr in StablePointer API (#4671) 2021-02-09 09:00:46 +01:00
Alexander Shabalin 9295d7cf60 Fix single-thread check 2021-02-09 09:00:46 +01:00
Alexander Shabalin 5b6a8a3bdb Make freezing stuff non-terminating TODO 2021-02-09 09:00:46 +01:00
Abduqodiri Qurbonzoda e63b405f58 Commonize CharCategory and related functions #KT-39177 #KT-43216 #KT-39906 #KT-30652
(cherry picked from commit fc5c01b9a72498f9bd200817936a629689c0bff0)
2021-02-01 16:54:15 +01:00
Alexander Shabalin 04ee3e37e7 Implement ref updates in new MM (#4653) 2021-02-01 16:54:15 +01:00
Alexander Shabalin 9e99932b24 Add a check for single-thread mutator (#4665) 2021-02-01 16:54:14 +01:00