vm: flush icache after GC
parent
69b4e8e2c3
commit
73e105bfc4
|
@ -3,11 +3,6 @@
|
|||
namespace factor
|
||||
{
|
||||
|
||||
void factor_vm::flush_icache_for(code_block *block)
|
||||
{
|
||||
flush_icache((cell)block,block->size());
|
||||
}
|
||||
|
||||
void *factor_vm::object_xt(cell obj)
|
||||
{
|
||||
switch(tagged<object>(obj).type())
|
||||
|
@ -196,7 +191,7 @@ void factor_vm::update_word_references(code_block *compiled)
|
|||
{
|
||||
word_references_updater updater(this);
|
||||
iterate_relocations(compiled,updater);
|
||||
flush_icache_for(compiled);
|
||||
compiled->flush_icache();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,7 +219,7 @@ void factor_vm::relocate_code_block(code_block *compiled)
|
|||
code->needs_fixup.erase(compiled);
|
||||
code_block_relocator relocator(this);
|
||||
iterate_relocations(compiled,relocator);
|
||||
flush_icache_for(compiled);
|
||||
compiled->flush_icache();
|
||||
}
|
||||
|
||||
/* Fixup labels. This is done at compile time, not image load time */
|
||||
|
|
|
@ -43,6 +43,11 @@ struct code_block
|
|||
{
|
||||
return (void *)(this + 1);
|
||||
}
|
||||
|
||||
void flush_icache()
|
||||
{
|
||||
factor::flush_icache((cell)this,size());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -145,8 +145,10 @@ struct collector {
|
|||
|
||||
for(; iter != end; iter++)
|
||||
{
|
||||
trace_code_block_objects(*iter);
|
||||
trace_embedded_literals(*iter);
|
||||
code_block *compiled = *iter;
|
||||
trace_code_block_objects(compiled);
|
||||
trace_embedded_literals(compiled);
|
||||
compiled->flush_icache();
|
||||
code_blocks_scanned++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,12 +149,14 @@ void factor_vm::collect_full(bool trace_contexts_p)
|
|||
current_gc->event->op = collect_compact_op;
|
||||
collect_compact_impl(trace_contexts_p);
|
||||
}
|
||||
flush_icache(code->seg->start,code->seg->size);
|
||||
}
|
||||
|
||||
void factor_vm::collect_compact(bool trace_contexts_p)
|
||||
{
|
||||
collect_mark_impl(trace_contexts_p);
|
||||
collect_compact_impl(trace_contexts_p);
|
||||
flush_icache(code->seg->start,code->seg->size);
|
||||
}
|
||||
|
||||
void factor_vm::collect_growing_heap(cell requested_bytes, bool trace_contexts_p)
|
||||
|
@ -164,6 +166,7 @@ void factor_vm::collect_growing_heap(cell requested_bytes, bool trace_contexts_p
|
|||
set_data_heap(data->grow(requested_bytes));
|
||||
collect_mark_impl(trace_contexts_p);
|
||||
collect_compact_code_impl(trace_contexts_p);
|
||||
flush_icache(code->seg->start,code->seg->size);
|
||||
delete old;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue