VM: removing update_code_roots_for_sweep()

char-rename
Björn Lindqvist 2016-10-19 08:12:40 +02:00
parent e187d63d3c
commit 4f6381587c
2 changed files with 11 additions and 17 deletions

View File

@ -56,21 +56,6 @@ struct full_collection_copier : no_fixup {
}
};
// After a sweep, invalidate any code heap roots which are not marked,
// so that if a block makes a tail call to a generic word, and the PIC
// compiler triggers a GC, and the caller block gets GCd as a result,
// the PIC code won't try to overwrite the call site
void factor_vm::update_code_roots_for_sweep() {
mark_bits* state = &code->allocator->state;
FACTOR_FOR_EACH(code_roots) {
code_root* root = *iter;
cell block = root->value & (~data_alignment - 1);
if (root->valid && !state->marked_p(block))
root->valid = false;
}
}
void factor_vm::collect_mark_impl() {
slot_visitor<full_collection_copier>
visitor(this, full_collection_copier(data->tenured, code, &mark_stack));
@ -101,7 +86,17 @@ void factor_vm::collect_sweep_impl() {
if (event)
event->ended_data_sweep();
update_code_roots_for_sweep();
// After a sweep, invalidate any code heap roots which are not
// marked, so that if a block makes a tail call to a generic word,
// and the PIC compiler triggers a GC, and the caller block gets GCd
// as a result, the PIC code won't try to overwrite the call site
mark_bits* state = &code->allocator->state;
FACTOR_FOR_EACH(code_roots) {
code_root* root = *iter;
cell block = root->value & (~data_alignment - 1);
if (root->valid && !state->marked_p(block))
root->valid = false;
}
if (event)
event->reset_timer();

View File

@ -341,7 +341,6 @@ struct factor_vm {
void collect_nursery();
void collect_aging();
void collect_to_tenured();
void update_code_roots_for_sweep();
void update_code_roots_for_compaction();
void collect_mark_impl();
void collect_sweep_impl();