Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2009-11-06 01:57:29 -06:00
commit bacd69dcd6
5 changed files with 12 additions and 20 deletions

View File

@ -50,7 +50,7 @@ template<typename Visitor> struct code_block_visitor {
if(w->code)
w->code = visitor(w->code);
if(w->profiling)
w->code = visitor(w->profiling);
w->profiling = visitor(w->profiling);
parent->update_word_xt(w);
break;

View File

@ -183,11 +183,8 @@ template<typename TargetGeneration, typename Policy> struct collector {
cell *slot_ptr = (cell *)start;
cell *end_ptr = (cell *)end;
if(slot_ptr != end_ptr)
{
for(; slot_ptr < end_ptr; slot_ptr++)
workhorse.visit_handle(slot_ptr);
}
for(; slot_ptr < end_ptr; slot_ptr++)
workhorse.visit_handle(slot_ptr);
}
}

View File

@ -245,7 +245,7 @@ cell factor_vm::instances(cell type)
each_object(accum);
cell object_count = accum.objects.size();
data_roots.push_back(accum.objects[0]);
data_roots.push_back((cell)&accum.objects[0]);
data_roots.push_back(object_count);
array *objects = allot_array(object_count,false_object);

View File

@ -25,17 +25,16 @@ void factor_vm::set_profiling(bool profiling)
if(profiling == profiling_p)
return;
profiling_p = profiling;
/* Push everything to tenured space so that we can heap scan
and allocate profiling blocks if necessary */
primitive_full_gc();
data_root<array> words(find_all_words(),this);
cell i;
profiling_p = profiling;
cell length = array_capacity(words.untagged());
for(i = 0; i < length; i++)
for(cell i = 0; i < length; i++)
{
tagged<word> word(array_nth(words.untagged(),i));
if(profiling)

View File

@ -8,18 +8,14 @@ template<typename Visitor> struct slot_visitor {
explicit slot_visitor<Visitor>(factor_vm *parent_, Visitor visitor_) :
parent(parent_), visitor(visitor_) {}
cell visit_pointer(cell pointer)
{
object *untagged = untag<object>(pointer);
untagged = visitor(untagged);
return RETAG(untagged,TAG(pointer));
}
void visit_handle(cell *handle)
{
cell pointer = *handle;
if(!immediate_p(pointer))
*handle = visit_pointer(pointer);
if(immediate_p(pointer)) return;
object *untagged = untag<object>(pointer);
untagged = visitor(untagged);
*handle = RETAG(untagged,TAG(pointer));
}
void visit_slots(object *ptr, cell payload_start)