Commit Graph

24 Commits

Author SHA1 Message Date
Ilya Matveev 0b46ed3cde [K/N][New MM] Add thread state asserts to reference updates 2021-05-06 14:10:20 +00: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
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
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
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
Alexander Shabalin 97262c273f Misc changes for GC in new MM (#4699) 2021-02-15 10:16:10 +01:00
Alexander Shabalin d875cb39c9 Sketch GC interface (#4682) 2021-02-09 09:00:48 +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 5b6a8a3bdb Make freezing stuff non-terminating TODO 2021-02-09 09:00:46 +01:00
Alexander Shabalin 04ee3e37e7 Implement ref updates in new MM (#4653) 2021-02-01 16:54:15 +01:00
Alexander Shabalin e2280ce855 Add a bunch of symbols required by Kotlin runtime part (#4655) 2021-02-01 16:54:14 +01:00
Alexander Shabalin 687cf20d7d Deal with FrameOverlay in the new mm (#4646) 2021-01-26 17:38:03 +03:00
Alexander Shabalin d46b2e927c Add ExtraObjectData (#4602) 2020-12-28 22:55:51 +03:00
Alexander Shabalin 72fc5f5aee Sketch mm::ObjectFactory (#4583) 2020-12-28 22:55:50 +03:00
Alexander Shabalin 92f8eff958 Cleanup Stubs.cpp (#4593) 2020-12-21 16:15:11 +01:00
Alexander Shabalin 658530e820 StableRef registry (#4567) 2020-12-14 15:25:37 +01:00
Alexander Shabalin 211c160558 TLS registry (#4554) 2020-12-14 15:25:36 +01:00
Alexander Shabalin 2057e5c8f1 Tracking globals (#4542) 2020-12-14 15:25:36 +01:00
Alexander Shabalin 83de4e174a Keep MemoryState empty. (#4544) 2020-11-28 21:13:48 +01:00
Alexander Shabalin e548bde89f Thread registry (#4518) 2020-11-28 21:13:46 +01:00