| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  | namespace factor { | 
					
						
							| 
									
										
										
										
											2009-05-04 02:46:13 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-22 06:35:38 -04:00
										 |  |  | struct must_start_gc_again { | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-15 06:51:11 -04:00
										 |  |  | enum gc_op { | 
					
						
							| 
									
										
										
										
											2016-10-19 03:05:15 -04:00
										 |  |  |   COLLECT_NURSERY_OP, | 
					
						
							|  |  |  |   COLLECT_AGING_OP, | 
					
						
							|  |  |  |   COLLECT_TO_TENURED_OP, | 
					
						
							|  |  |  |   COLLECT_FULL_OP, | 
					
						
							|  |  |  |   COLLECT_COMPACT_OP, | 
					
						
							|  |  |  |   COLLECT_GROWING_DATA_HEAP_OP | 
					
						
							| 
									
										
										
										
											2009-10-15 06:51:11 -04:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-19 04:31:53 -04:00
										 |  |  | // These are the phases of the gc cycles we record the times of.
 | 
					
						
							|  |  |  | enum gc_phase { | 
					
						
							|  |  |  |   PHASE_CARD_SCAN, | 
					
						
							|  |  |  |   PHASE_CODE_SCAN, | 
					
						
							|  |  |  |   PHASE_DATA_SWEEP, | 
					
						
							|  |  |  |   PHASE_CODE_SWEEP, | 
					
						
							|  |  |  |   PHASE_DATA_COMPACTION, | 
					
						
							| 
									
										
										
										
											2016-10-20 01:46:21 -04:00
										 |  |  |   PHASE_MARKING | 
					
						
							| 
									
										
										
										
											2016-10-19 04:31:53 -04:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-26 23:12:44 -04:00
										 |  |  | struct gc_event { | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   gc_op op; | 
					
						
							|  |  |  |   data_heap_room data_heap_before; | 
					
						
							| 
									
										
										
										
											2014-09-10 11:01:48 -04:00
										 |  |  |   allocator_room code_heap_before; | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   data_heap_room data_heap_after; | 
					
						
							| 
									
										
										
										
											2014-09-10 11:01:48 -04:00
										 |  |  |   allocator_room code_heap_after; | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   cell cards_scanned; | 
					
						
							|  |  |  |   cell decks_scanned; | 
					
						
							|  |  |  |   cell code_blocks_scanned; | 
					
						
							| 
									
										
										
										
											2013-05-13 00:28:25 -04:00
										 |  |  |   uint64_t start_time; | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   cell total_time; | 
					
						
							| 
									
										
										
										
											2016-10-20 01:46:21 -04:00
										 |  |  |   cell times[6]; | 
					
						
							| 
									
										
										
										
											2013-05-13 00:28:25 -04:00
										 |  |  |   uint64_t temp_time; | 
					
						
							| 
									
										
										
										
											2009-10-26 23:12:44 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-12 23:20:43 -04:00
										 |  |  |   gc_event(gc_op op, factor_vm* parent); | 
					
						
							| 
									
										
										
										
											2016-04-24 09:21:17 -04:00
										 |  |  |   void reset_timer(); | 
					
						
							| 
									
										
										
										
											2016-10-19 04:31:53 -04:00
										 |  |  |   void ended_phase(gc_phase phase); | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   void ended_gc(factor_vm* parent); | 
					
						
							| 
									
										
										
										
											2009-10-26 23:12:44 -04:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-27 00:57:26 -04:00
										 |  |  | struct gc_state { | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   gc_op op; | 
					
						
							| 
									
										
										
										
											2013-05-13 00:28:25 -04:00
										 |  |  |   uint64_t start_time; | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   gc_event* event; | 
					
						
							| 
									
										
										
										
											2009-10-27 00:57:26 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-12 23:20:43 -04:00
										 |  |  |   gc_state(gc_op op, factor_vm* parent); | 
					
						
							| 
									
										
										
										
											2013-05-11 22:04:08 -04:00
										 |  |  |   ~gc_state(); | 
					
						
							|  |  |  |   void start_again(gc_op op_, factor_vm* parent); | 
					
						
							| 
									
										
										
										
											2009-10-27 00:57:26 -04:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-05-04 02:46:13 -04:00
										 |  |  | } |