6 aging_collector::aging_collector(factor_vm *parent_) :
7 copying_collector<aging_space,aging_policy>(
10 aging_policy(parent_)) {}
12 void factor_vm::collect_aging()
14 /* Promote objects referenced from tenured space to tenured space, copy
15 everything else to the aging semi-space, and reset the nursery pointer. */
17 /* Change the op so that if we fail here, we proceed to a full
18 tenured collection. We are collecting to tenured space, and
19 cards were unmarked, so we can't proceed with a to_tenured
21 current_gc->op = collect_to_tenured_op;
23 to_tenured_collector collector(this);
25 current_gc->event->started_code_scan();
26 collector.trace_cards(data->tenured,
29 current_gc->event->ended_card_scan(collector.cards_scanned,collector.decks_scanned);
31 current_gc->event->started_code_scan();
32 collector.trace_code_heap_roots(&code->points_to_aging);
33 current_gc->event->ended_code_scan(collector.code_blocks_scanned);
35 collector.tenure_reachable_objects();
37 current_gc->event->started_code_sweep();
38 update_code_heap_for_minor_gc(&code->points_to_aging);
39 current_gc->event->ended_code_sweep();
42 /* If collection fails here, do a to_tenured collection. */
43 current_gc->op = collect_aging_op;
45 std::swap(data->aging,data->aging_semispace);
46 data->reset_generation(data->aging);
48 aging_collector collector(this);
50 collector.trace_roots();
51 collector.trace_contexts();
53 collector.cheneys_algorithm();
55 data->reset_generation(&nursery);
56 code->points_to_nursery.clear();
57 code->points_to_aging.clear();