]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/gc.hpp
xmode.rules: removing test no longer needed
[factor.git] / vm / gc.hpp
index b353c00a66a9925799059bcdfa15928b783b6db4..b28038e8029fd6e89f1126802da4e8f81623551d 100644 (file)
--- a/vm/gc.hpp
+++ b/vm/gc.hpp
@@ -12,6 +12,16 @@ enum gc_op {
   COLLECT_GROWING_DATA_HEAP_OP
 };
 
+// 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,
+  PHASE_MARKING
+};
+
 struct gc_event {
   gc_op op;
   data_heap_room data_heap_before;
@@ -23,20 +33,12 @@ struct gc_event {
   cell code_blocks_scanned;
   uint64_t start_time;
   cell total_time;
-  cell card_scan_time;
-  cell code_scan_time;
-  cell data_sweep_time;
-  cell code_sweep_time;
-  cell compaction_time;
+  cell times[6];
   uint64_t temp_time;
 
   gc_event(gc_op op, factor_vm* parent);
   void reset_timer();
-  void ended_card_scan(cell cards_scanned_, cell decks_scanned_);
-  void ended_code_scan(cell code_blocks_scanned_);
-  void ended_data_sweep();
-  void ended_code_sweep();
-  void ended_compaction();
+  void ended_phase(gc_phase phase);
   void ended_gc(factor_vm* parent);
 };