8 tenured_space* tenured;
10 explicit aging_policy(factor_vm* parent)
12 aging(parent->data->aging),
13 tenured(parent->data->tenured) {}
15 bool should_copy_p(object* untagged) {
16 return !(aging->contains_p(untagged) || tenured->contains_p(untagged));
19 void promoted_object(object* obj) {}
21 void visited_object(object* obj) {}
24 void factor_vm::collect_aging() {
25 /* Promote objects referenced from tenured space to tenured space, copy
26 everything else to the aging semi-space, and reset the nursery pointer. */
28 /* Change the op so that if we fail here, an assertion will be
30 current_gc->op = collect_to_tenured_op;
32 collector<tenured_space, to_tenured_policy> collector(this,
34 to_tenured_policy(this));
35 gc_event* event = current_gc->event;
38 event->started_card_scan();
39 collector.trace_cards(data->tenured, card_points_to_aging, 0xff);
41 event->ended_card_scan(collector.cards_scanned, collector.decks_scanned);
44 event->started_code_scan();
45 collector.trace_code_heap_roots(&code->points_to_aging);
47 event->ended_code_scan(collector.code_blocks_scanned);
49 collector.visitor.visit_mark_stack(&mark_stack);
52 /* If collection fails here, do a to_tenured collection. */
53 current_gc->op = collect_aging_op;
55 std::swap(data->aging, data->aging_semispace);
58 collector<aging_space, aging_policy> collector(this,
62 collector.visitor.visit_all_roots();
63 collector.cheneys_algorithm();
65 data->reset_nursery();
66 code->clear_remembered_set();