vm: reinitialize all_blocks from scratch after gc

Faster and more likely to be correct than trying to fixup the existing set
db4
Joe Groff 2011-12-12 19:05:48 -08:00
parent 4bbb2f5b72
commit 083b856604
3 changed files with 2 additions and 16 deletions

View File

@ -129,19 +129,6 @@ void code_heap::initialize_all_blocks_set()
allocator->iterate(inserter);
}
void code_heap::update_all_blocks_set(mark_bits<code_block> *code_forwarding_map)
{
std::set<code_block *> new_all_blocks;
for (std::set<code_block *>::const_iterator oldi = all_blocks.begin();
oldi != all_blocks.end();
++oldi)
{
code_block *new_block = code_forwarding_map->forward_block(*oldi);
new_all_blocks.insert(new_block);
}
all_blocks.swap(new_all_blocks);
}
/* Allocate a code heap during startup */
void factor_vm::init_code_heap(cell size)
{

View File

@ -47,7 +47,6 @@ struct code_heap {
void unguard_safepoint();
void verify_all_blocks_set();
void initialize_all_blocks_set();
void update_all_blocks_set(mark_bits<code_block> *code_forwarding_map);
code_block *code_block_for_address(cell address);

View File

@ -185,8 +185,6 @@ void factor_vm::update_code_roots_for_compaction()
else
root->valid = false;
}
code->update_all_blocks_set(state);
}
/* Compact data and code heaps */
@ -236,6 +234,8 @@ void factor_vm::collect_compact_impl(bool trace_contexts_p)
update_code_roots_for_compaction();
callbacks->update();
code->initialize_all_blocks_set();
if(event) event->ended_compaction();
}