vm/callstack.hpp \
vm/slot_visitor.hpp \
vm/collector.hpp \
- vm/copying_collector.hpp \
vm/nursery_collector.hpp \
vm/aging_collector.hpp \
vm/to_tenured_collector.hpp \
std::swap(data->aging, data->aging_semispace);
data->reset_aging();
- copying_collector<aging_space, aging_policy> collector(this,
- this->data->aging,
- aging_policy(this));
+ collector<aging_space, aging_policy> collector(this,
+ this->data->aging,
+ aging_policy(this));
collector.visitor.visit_all_roots();
collector.cheneys_algorithm();
cell cards_scanned;
cell decks_scanned;
cell code_blocks_scanned;
+ cell scan;
collector(factor_vm* parent, TargetGeneration* target, Policy policy)
: parent(parent),
visitor(parent, workhorse),
cards_scanned(0),
decks_scanned(0),
- code_blocks_scanned(0) {}
+ code_blocks_scanned(0) {
+ scan = target->start + target->occupied_space();
+ }
void trace_code_heap_roots(std::set<code_block*>* remembered_set) {
std::set<code_block*>::const_iterator iter = remembered_set->begin();
}
}
}
+
+ void cheneys_algorithm() {
+ while (scan && scan < this->target->here) {
+ this->visitor.visit_object((object*)scan);
+ scan = this->target->next_object_after(scan);
+ }
+ }
};
}
+++ /dev/null
-namespace factor {
-
-template <typename TargetGeneration, typename Policy>
-struct copying_collector : collector<TargetGeneration, Policy> {
- cell scan;
-
- copying_collector(factor_vm* parent, TargetGeneration* target,
- Policy policy)
- : collector<TargetGeneration, Policy>(parent, target, policy),
- scan(target->here) {}
-
- void cheneys_algorithm() {
- while (scan && scan < this->target->here) {
- this->visitor.visit_object((object*)scan);
- scan = this->target->next_object_after(scan);
- }
- }
-};
-
-}
#include "callstack.hpp"
#include "slot_visitor.hpp"
#include "collector.hpp"
-#include "copying_collector.hpp"
#include "nursery_collector.hpp"
#include "aging_collector.hpp"
#include "to_tenured_collector.hpp"
void factor_vm::collect_nursery() {
/* Copy live objects from the nursery (as determined by the root set and
marked cards in aging and tenured) to aging space. */
- copying_collector<aging_space, nursery_policy> collector(this,
- this->data->aging,
- nursery_policy(this));
+ collector<aging_space, nursery_policy> collector(this,
+ this->data->aging,
+ nursery_policy(this));
collector.visitor.visit_all_roots();
gc_event* event = current_gc->event;
void end_gc();
void set_current_gc_op(gc_op op);
void start_gc_again();
- void update_code_heap_for_minor_gc(std::set<code_block*>* remembered_set);
void collect_nursery();
void collect_aging();
void collect_to_tenured();