VM: the aging_collector and nursery_collector classes aren't needed because they are just simple instatiations of copying_collector

db4
Björn Lindqvist 2014-12-01 21:26:46 +01:00 committed by John Benediktsson
parent 423e983514
commit 93134b949f
4 changed files with 6 additions and 21 deletions

View File

@ -2,11 +2,6 @@
namespace factor { namespace factor {
aging_collector::aging_collector(factor_vm* parent)
: copying_collector<aging_space, aging_policy>(parent,
parent->data->aging,
aging_policy(parent)) {}
void factor_vm::collect_aging() { void factor_vm::collect_aging() {
/* Promote objects referenced from tenured space to tenured space, copy /* Promote objects referenced from tenured space to tenured space, copy
everything else to the aging semi-space, and reset the nursery pointer. */ everything else to the aging semi-space, and reset the nursery pointer. */
@ -40,8 +35,9 @@ void factor_vm::collect_aging() {
std::swap(data->aging, data->aging_semispace); std::swap(data->aging, data->aging_semispace);
data->reset_generation(data->aging); data->reset_generation(data->aging);
aging_collector collector(this); copying_collector<aging_space, aging_policy> collector(this,
this->data->aging,
aging_policy(this));
collector.trace_roots(); collector.trace_roots();
collector.trace_contexts(); collector.trace_contexts();

View File

@ -19,8 +19,4 @@ struct aging_policy {
void visited_object(object* obj) {} void visited_object(object* obj) {}
}; };
struct aging_collector : copying_collector<aging_space, aging_policy> {
explicit aging_collector(factor_vm* parent);
};
} }

View File

@ -2,15 +2,12 @@
namespace factor { namespace factor {
nursery_collector::nursery_collector(factor_vm* parent)
: copying_collector<aging_space, nursery_policy>(parent,
parent->data->aging,
nursery_policy(parent)) {}
void factor_vm::collect_nursery() { void factor_vm::collect_nursery() {
/* Copy live objects from the nursery (as determined by the root set and /* Copy live objects from the nursery (as determined by the root set and
marked cards in aging and tenured) to aging space. */ marked cards in aging and tenured) to aging space. */
nursery_collector collector(this); copying_collector<aging_space, nursery_policy> collector(this,
this->data->aging,
nursery_policy(this));
collector.trace_roots(); collector.trace_roots();
collector.trace_contexts(); collector.trace_contexts();

View File

@ -14,8 +14,4 @@ struct nursery_policy {
void visited_object(object* obj) {} void visited_object(object* obj) {}
}; };
struct nursery_collector : copying_collector<aging_space, nursery_policy> {
explicit nursery_collector(factor_vm* parent);
};
} }