Revert "lists: Add list literal doc example."
[factor.git] / vm / to_tenured_collector.cpp
blob532dcaeade453bfa737850f20742910f5f0b1c9e
1 #include "master.hpp"
3 namespace factor {
5 void factor_vm::collect_to_tenured() {
6 // Copy live objects from aging space to tenured space.
7 mark_stack.clear();
8 slot_visitor<from_tenured_refs_copier>
9 visitor(this, from_tenured_refs_copier(data->tenured, &mark_stack));
11 visitor.visit_all_roots();
12 gc_event* event = current_gc->event;
14 if (event)
15 event->reset_timer();
16 visitor.visit_cards(data->tenured, card_points_to_aging, 0xff);
17 if (event) {
18 event->ended_phase(PHASE_CARD_SCAN);
19 event->cards_scanned += visitor.cards_scanned;
20 event->decks_scanned += visitor.decks_scanned;
23 if (event)
24 event->reset_timer();
25 visitor.visit_code_heap_roots(&code->points_to_aging);
26 if (event) {
27 event->ended_phase(PHASE_CODE_SCAN);
28 event->code_blocks_scanned += code->points_to_aging.size();
30 visitor.visit_mark_stack(&mark_stack);
32 data->reset_nursery();
33 data->reset_aging();
34 code->clear_remembered_set();