Commit graph

354 commits

Author SHA1 Message Date
Justin Ethier
72eda149c5 Use minor GC code to move GC coop result to heap
This allows the code to move any object to the heap, instead of the previous hack. There may be more overhead calling the full minor GC code, however, most objects should already have been moved and by definition this would only happen after a function has blocked for a length of time. So, both should minimize the additional overhead.
2016-01-04 22:39:37 -05:00
Justin Ethier
a2ba71f965 Two changes:
- Remove debug code from gc module
- Handle receiving non-heap allocated objects during GC cooperation
2016-01-04 22:13:55 -05:00
Justin Ethier
e28951a8d5 Move the mutation table into thread data. 2016-01-04 22:54:23 -05:00
Justin Ethier
d89a81eca6 More cleanup 2016-01-03 22:30:30 -05:00
Justin Ethier
4d7cd020cc Cleanup 2016-01-03 22:17:47 -05:00
Justin Ethier
ac7fec70a0 Finalize mutex prior to sweeping 2016-01-03 21:59:09 -05:00
Justin Ethier
de33b567a3 Missed a couple things... 2016-01-02 22:49:57 -05:00
Justin Ethier
36752be311 Stubs for mutex functions 2016-01-02 21:56:36 -05:00
Justin Ethier
71af17d7e7 Use atomic operations from libck 2015-12-29 22:05:07 -05:00
Justin Ethier
deae1693d5 Updated header comments 2015-12-23 23:02:38 -05:00
Justin Ethier
eaac66ab37 WIP 2015-12-23 22:09:10 -05:00
Justin Ethier
1f21b4688a WIP 2015-12-24 02:20:18 -05:00
Justin Ethier
6ae7a88e53 Bugfix 2015-12-24 01:56:00 -05:00
Justin Ethier
43ff5c5454 Re-enable cooperation code 2015-12-24 01:32:40 -05:00
Justin Ethier
2e9c5addd5 WIP 2015-12-24 00:50:37 -05:00
Justin Ethier
c09dc43dde First crack at gc_mutator_thread_runnable 2015-12-23 22:34:11 -05:00
Justin Ethier
cc36d6459d Added collector_cooperated flag 2015-12-22 22:49:55 -05:00
Justin Ethier
8aefcbfd13 New mutator signatures 2015-12-22 22:39:51 -05:00
Justin Ethier
247b09fc88 Store cont before mutator is blocked 2015-12-22 22:19:04 -05:00
Justin Ethier
9fd4929bb0 Added notes 2015-12-23 02:25:52 -05:00
Justin Ethier
785923f955 Partial GC coop for blocked mutator 2015-12-22 23:07:35 -05:00
Justin Ethier
ec8821b9ef Use atomics to access thd->gc_status 2015-12-22 22:57:28 -05:00
Justin Ethier
6693b4533a Fixed bug with previous change
Do not change mutator status prior to checking it
2015-12-22 03:15:45 -05:00
Justin Ethier
66ef2e2646 Added thread state helpers, avoid races during coop 2015-12-22 03:09:11 -05:00
Justin Ethier
be13df2abb Perform deferred free of thread data
Mark a mutator's thread as old when a thread is terminated, and free it at a later time. This is done to prevent race conditions with the collector thread, which could be in the middle of working with a thread's data.
2015-12-21 22:57:36 -05:00
Justin Ethier
a5fefda485 WIP - thread cleanup 2015-12-20 22:48:22 -05:00
Justin Ethier
38c1ca7b31 Added thread_sleep 2015-12-18 23:53:24 -05:00
Justin Ethier
4110c6a4e1 New container for mutator threads 2015-12-18 22:05:37 -05:00
Justin Ethier
4e9bd1ea02 Added GC thread state, and notes 2015-12-18 23:49:32 -05:00
Justin Ethier
e57688a774 Added thread start/end functions to runtime 2015-12-17 22:45:45 -05:00
Justin Ethier
dfed77639a Adding thread application stubs 2015-12-15 22:58:15 -05:00
Justin Ethier
ff18c50aac Cleanup all thread data members 2015-12-14 21:30:51 -05:00
Justin Ethier
d8a96d17b7 Added header comment 2015-12-11 21:16:17 -05:00
Justin Ethier
29e6cb38e9 Tweaked GC thresholds 2015-12-10 21:48:19 -05:00
Justin Ethier
be9a07551e Added notes 2015-12-10 23:13:40 -05:00
Justin Ethier
ded3f76cc8 Scheduling of GC 2015-12-10 23:11:22 -05:00
Justin Ethier
5fa6f19418 Adding stubs for collector scheduling 2015-12-09 22:55:46 -05:00
Justin Ethier
de0c19e1cd Keep track of the amount of free space in the heap 2015-12-09 22:46:00 -05:00
Justin Ethier
15ac239d2f Mark current continuation during GC coop
Mark both current cont (gc_cont + args) as well as all moved objects during cooperation. Trying to prevent cases of valid objects being collected when they should have been part of the continuation chain (IE, parens in read:parse).
2015-12-09 23:38:15 -05:00
Justin Ethier
ce500fff3e Removed dead code and errant gc_mark_gray 2015-12-08 22:49:20 -05:00
Justin Ethier
a5dcb6c6a2 Potential debug tracing 2015-12-09 02:59:25 -05:00
Justin Ethier
9199bf512a Separate debug printing in gc_mut_cooperate 2015-12-08 21:42:18 -05:00
Justin Ethier
6ad9e6098f Removed hacky gc_stack functions 2015-12-08 21:37:01 -05:00
Justin Ethier
33447ebc57 New write barrier implementation 2015-12-07 22:34:29 -05:00
Justin Ethier
598c981ecb Adding an experimental safety check 2015-12-08 03:02:30 -05:00
Justin Ethier
c4554c5af6 Added notes 2015-12-07 23:29:51 -05:00
Justin Ethier
5818ffc0eb Temporarily reverting gc_stack change 2015-12-07 22:54:54 -05:00
Justin Ethier
e994d4aa76 Do thread locking outside of gc_mark_gray
Changed the locking to attempt to avoid race conditions where not all of the heap objects have been moved prior to the collector staring to process them.
2015-12-07 22:02:38 -05:00
Justin Ethier
9ded782a06 New approach to stack graying from write barrier 2015-12-06 22:37:08 -05:00
Justin Ethier
3d0d966e6d Changed GC cooperation
Mark all objects moved to the heap, instead of just the typical roots.
2015-12-05 22:44:06 -05:00