VM: the aging_collector and nursery_collector classes aren't needed because they are just simple instatiations of copying_collector
parent
423e983514
commit
93134b949f
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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);
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue