2009-10-07 16:48:09 -04:00
|
|
|
namespace factor
|
|
|
|
{
|
|
|
|
|
|
|
|
struct full_policy {
|
2009-10-18 21:31:59 -04:00
|
|
|
factor_vm *parent;
|
2009-10-20 16:15:05 -04:00
|
|
|
tenured_space *tenured;
|
2009-10-07 16:48:09 -04:00
|
|
|
|
2009-10-25 00:02:58 -04:00
|
|
|
explicit full_policy(factor_vm *parent_) : parent(parent_), tenured(parent->data->tenured) {}
|
2009-10-07 16:48:09 -04:00
|
|
|
|
|
|
|
bool should_copy_p(object *untagged)
|
|
|
|
{
|
|
|
|
return !tenured->contains_p(untagged);
|
|
|
|
}
|
2009-10-20 23:20:49 -04:00
|
|
|
|
|
|
|
void promoted_object(object *obj)
|
|
|
|
{
|
|
|
|
tenured->mark_and_push(obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
void visited_object(object *obj)
|
|
|
|
{
|
|
|
|
if(!tenured->marked_p(obj))
|
|
|
|
tenured->mark_and_push(obj);
|
|
|
|
}
|
2009-10-07 16:48:09 -04:00
|
|
|
};
|
|
|
|
|
2009-10-20 23:20:49 -04:00
|
|
|
struct full_collector : collector<tenured_space,full_policy> {
|
2009-10-07 16:48:09 -04:00
|
|
|
bool trace_contexts_p;
|
|
|
|
|
2009-10-25 00:02:58 -04:00
|
|
|
explicit full_collector(factor_vm *parent_);
|
2009-10-07 16:48:09 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|