Faster GC
parent
b6245ddc74
commit
c123129b95
55
vm/data_gc.c
55
vm/data_gc.c
|
@ -648,12 +648,63 @@ void do_code_slots(CELL scan)
|
|||
}
|
||||
}
|
||||
|
||||
/* This function is performance-critical */
|
||||
CELL collect_next(CELL scan)
|
||||
{
|
||||
do_slots(scan,copy_handle);
|
||||
CELL *obj = (CELL *)scan;
|
||||
CELL *end = (CELL *)(scan + binary_payload_start(scan));
|
||||
|
||||
obj++;
|
||||
|
||||
CELL newspace_start = newspace->start;
|
||||
CELL newspace_end = newspace->end;
|
||||
|
||||
if(HAVE_NURSERY_P && collecting_gen == NURSERY)
|
||||
{
|
||||
CELL nursery_start = nursery.start;
|
||||
CELL nursery_end = nursery.end;
|
||||
|
||||
for(; obj < end; obj++)
|
||||
{
|
||||
CELL pointer = *obj;
|
||||
|
||||
if(!immediate_p(pointer)
|
||||
&& (pointer >= nursery_start && pointer < nursery_end))
|
||||
*obj = copy_object(pointer);
|
||||
}
|
||||
}
|
||||
else if(HAVE_AGING_P && collecting_gen == AGING)
|
||||
{
|
||||
F_ZONE *tenured = &data_heap->generations[TENURED];
|
||||
|
||||
CELL tenured_start = tenured->start;
|
||||
CELL tenured_end = tenured->end;
|
||||
|
||||
for(; obj < end; obj++)
|
||||
{
|
||||
CELL pointer = *obj;
|
||||
|
||||
if(!immediate_p(pointer)
|
||||
&& !(pointer >= newspace_start && pointer < newspace_end)
|
||||
&& !(pointer >= tenured_start && pointer < tenured_end))
|
||||
*obj = copy_object(pointer);
|
||||
}
|
||||
}
|
||||
else if(collecting_gen == TENURED)
|
||||
{
|
||||
for(; obj < end; obj++)
|
||||
{
|
||||
CELL pointer = *obj;
|
||||
|
||||
if(!immediate_p(pointer)
|
||||
&& !(pointer >= newspace_start && pointer < newspace_end))
|
||||
*obj = copy_object(pointer);
|
||||
}
|
||||
|
||||
if(collecting_gen == TENURED)
|
||||
do_code_slots(scan);
|
||||
}
|
||||
else
|
||||
critical_error("Bug in collect_next",0);
|
||||
|
||||
return scan + untagged_object_size(scan);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ typedef signed long long s64;
|
|||
|
||||
INLINE bool immediate_p(CELL obj)
|
||||
{
|
||||
return (TAG(obj) == FIXNUM_TYPE || obj == F);
|
||||
return (obj == F || TAG(obj) == FIXNUM_TYPE);
|
||||
}
|
||||
|
||||
INLINE F_FIXNUM untag_fixnum_fast(CELL tagged)
|
||||
|
|
Loading…
Reference in New Issue