removed global functions from data_gc

db4
Phil Dawes 2009-08-17 21:37:16 +01:00
parent b2f52ed109
commit 39dc71e612
3 changed files with 5 additions and 114 deletions

View File

@ -10,10 +10,6 @@ void factorvm::init_data_gc()
collecting_aging_again = false; collecting_aging_again = false;
} }
void init_data_gc()
{
return vm->init_data_gc();
}
/* Given a pointer to oldspace, copy it to newspace */ /* Given a pointer to oldspace, copy it to newspace */
object *factorvm::copy_untagged_object_impl(object *pointer, cell size) object *factorvm::copy_untagged_object_impl(object *pointer, cell size)
@ -30,10 +26,6 @@ object *factorvm::copy_untagged_object_impl(object *pointer, cell size)
return newpointer; return newpointer;
} }
object *copy_untagged_object_impl(object *pointer, cell size)
{
return vm->copy_untagged_object_impl(pointer,size);
}
object *factorvm::copy_object_impl(object *untagged) object *factorvm::copy_object_impl(object *untagged)
{ {
@ -42,10 +34,6 @@ object *factorvm::copy_object_impl(object *untagged)
return newpointer; return newpointer;
} }
object *copy_object_impl(object *untagged)
{
return vm->copy_object_impl(untagged);
}
bool factorvm::should_copy_p(object *untagged) bool factorvm::should_copy_p(object *untagged)
{ {
@ -64,10 +52,6 @@ bool factorvm::should_copy_p(object *untagged)
} }
} }
bool should_copy_p(object *untagged)
{
return vm->should_copy_p(untagged);
}
/* Follow a chain of forwarding pointers */ /* Follow a chain of forwarding pointers */
object *factorvm::resolve_forwarding(object *untagged) object *factorvm::resolve_forwarding(object *untagged)
@ -88,10 +72,6 @@ object *factorvm::resolve_forwarding(object *untagged)
} }
} }
object *resolve_forwarding(object *untagged)
{
return vm->resolve_forwarding(untagged);
}
template <typename TYPE> TYPE *factorvm::copy_untagged_object(TYPE *untagged) template <typename TYPE> TYPE *factorvm::copy_untagged_object(TYPE *untagged)
{ {
@ -108,20 +88,12 @@ template <typename TYPE> TYPE *factorvm::copy_untagged_object(TYPE *untagged)
return untagged; return untagged;
} }
template <typename TYPE> TYPE *copy_untagged_object(TYPE *untagged)
{
return vm->copy_untagged_object(untagged);
}
cell factorvm::copy_object(cell pointer) cell factorvm::copy_object(cell pointer)
{ {
return RETAG(copy_untagged_object(untag<object>(pointer)),TAG(pointer)); return RETAG(copy_untagged_object(untag<object>(pointer)),TAG(pointer));
} }
cell copy_object(cell pointer)
{
return vm->copy_object(pointer);
}
void factorvm::copy_handle(cell *handle) void factorvm::copy_handle(cell *handle)
{ {
@ -136,10 +108,6 @@ void factorvm::copy_handle(cell *handle)
} }
} }
void copy_handle(cell *handle)
{
return vm->copy_handle(handle);
}
/* Scan all the objects in the card */ /* Scan all the objects in the card */
void factorvm::copy_card(card *ptr, cell gen, cell here) void factorvm::copy_card(card *ptr, cell gen, cell here)
@ -155,10 +123,6 @@ void factorvm::copy_card(card *ptr, cell gen, cell here)
cards_scanned++; cards_scanned++;
} }
void copy_card(card *ptr, cell gen, cell here)
{
return vm->copy_card(ptr,gen,here);
}
void factorvm::copy_card_deck(card_deck *deck, cell gen, card mask, card unmask) void factorvm::copy_card_deck(card_deck *deck, cell gen, card mask, card unmask)
{ {
@ -191,10 +155,6 @@ void factorvm::copy_card_deck(card_deck *deck, cell gen, card mask, card unmask)
decks_scanned++; decks_scanned++;
} }
void copy_card_deck(card_deck *deck, cell gen, card mask, card unmask)
{
return vm->copy_card_deck(deck,gen,mask,unmask);
}
/* Copy all newspace objects referenced from marked cards to the destination */ /* Copy all newspace objects referenced from marked cards to the destination */
void factorvm::copy_gen_cards(cell gen) void factorvm::copy_gen_cards(cell gen)
@ -262,10 +222,6 @@ void factorvm::copy_gen_cards(cell gen)
} }
} }
void copy_gen_cards(cell gen)
{
return vm->copy_gen_cards(gen);
}
/* Scan cards in all generations older than the one being collected, copying /* Scan cards in all generations older than the one being collected, copying
old->new references */ old->new references */
@ -280,10 +236,6 @@ void factorvm::copy_cards()
card_scan_time += (current_micros() - start); card_scan_time += (current_micros() - start);
} }
void copy_cards()
{
return vm->copy_cards();
}
/* Copy all tagged pointers in a range of memory */ /* Copy all tagged pointers in a range of memory */
void factorvm::copy_stack_elements(segment *region, cell top) void factorvm::copy_stack_elements(segment *region, cell top)
@ -294,10 +246,6 @@ void factorvm::copy_stack_elements(segment *region, cell top)
copy_handle((cell*)ptr); copy_handle((cell*)ptr);
} }
void copy_stack_elements(segment *region, cell top)
{
return vm->copy_stack_elements(region,top);
}
void factorvm::copy_registered_locals() void factorvm::copy_registered_locals()
{ {
@ -308,10 +256,6 @@ void factorvm::copy_registered_locals()
copy_handle((cell *)(*iter)); copy_handle((cell *)(*iter));
} }
void copy_registered_locals()
{
return vm->copy_registered_locals();
}
void factorvm::copy_registered_bignums() void factorvm::copy_registered_bignums()
{ {
@ -335,10 +279,6 @@ void factorvm::copy_registered_bignums()
} }
} }
void copy_registered_bignums()
{
return vm->copy_registered_bignums();
}
/* Copy roots over at the start of GC, namely various constants, stacks, /* Copy roots over at the start of GC, namely various constants, stacks,
the user environment and extra roots registered by local_roots.hpp */ the user environment and extra roots registered by local_roots.hpp */
@ -376,10 +316,6 @@ void factorvm::copy_roots()
copy_handle(&userenv[i]); copy_handle(&userenv[i]);
} }
void copy_roots()
{
return vm->copy_roots();
}
cell factorvm::copy_next_from_nursery(cell scan) cell factorvm::copy_next_from_nursery(cell scan)
{ {
@ -409,10 +345,6 @@ cell factorvm::copy_next_from_nursery(cell scan)
return scan + untagged_object_size((object *)scan); return scan + untagged_object_size((object *)scan);
} }
cell copy_next_from_nursery(cell scan)
{
return vm->copy_next_from_nursery(scan);
}
cell factorvm::copy_next_from_aging(cell scan) cell factorvm::copy_next_from_aging(cell scan)
{ {
@ -446,10 +378,6 @@ cell factorvm::copy_next_from_aging(cell scan)
return scan + untagged_object_size((object *)scan); return scan + untagged_object_size((object *)scan);
} }
cell copy_next_from_aging(cell scan)
{
return vm->copy_next_from_aging(scan);
}
cell factorvm::copy_next_from_tenured(cell scan) cell factorvm::copy_next_from_tenured(cell scan)
{ {
@ -481,10 +409,6 @@ cell factorvm::copy_next_from_tenured(cell scan)
return scan + untagged_object_size((object *)scan); return scan + untagged_object_size((object *)scan);
} }
cell copy_next_from_tenured(cell scan)
{
return vm->copy_next_from_tenured(scan);
}
void factorvm::copy_reachable_objects(cell scan, cell *end) void factorvm::copy_reachable_objects(cell scan, cell *end)
{ {
@ -505,10 +429,6 @@ void factorvm::copy_reachable_objects(cell scan, cell *end)
} }
} }
void copy_reachable_objects(cell scan, cell *end)
{
return vm->copy_reachable_objects(scan,end);
}
/* Prepare to start copying reachable objects into an unused zone */ /* Prepare to start copying reachable objects into an unused zone */
void factorvm::begin_gc(cell requested_bytes) void factorvm::begin_gc(cell requested_bytes)
@ -544,10 +464,6 @@ void factorvm::begin_gc(cell requested_bytes)
} }
} }
void begin_gc(cell requested_bytes)
{
return vm->begin_gc(requested_bytes);
}
void factorvm::end_gc(cell gc_elapsed) void factorvm::end_gc(cell gc_elapsed)
{ {
@ -587,10 +503,6 @@ void factorvm::end_gc(cell gc_elapsed)
collecting_aging_again = false; collecting_aging_again = false;
} }
void end_gc(cell gc_elapsed)
{
return vm->end_gc(gc_elapsed);
}
/* Collect gen and all younger generations. /* Collect gen and all younger generations.
If growing_data_heap_ is true, we must grow the data heap to such a size that If growing_data_heap_ is true, we must grow the data heap to such a size that
@ -673,20 +585,12 @@ void factorvm::garbage_collection(cell gen,bool growing_data_heap_,cell requeste
performing_gc = false; performing_gc = false;
} }
void garbage_collection(cell gen,bool growing_data_heap_,cell requested_bytes)
{
return vm->garbage_collection(gen,growing_data_heap_,requested_bytes);
}
void factorvm::gc() void factorvm::gc()
{ {
garbage_collection(data->tenured(),false,0); garbage_collection(data->tenured(),false,0);
} }
void gc()
{
return vm->gc();
}
inline void factorvm::vmprim_gc() inline void factorvm::vmprim_gc()
{ {
@ -744,14 +648,14 @@ void factorvm::clear_gc_stats()
code_heap_scans = 0; code_heap_scans = 0;
} }
void clear_gc_stats() inline void factorvm::vmprim_clear_gc_stats()
{ {
return vm->clear_gc_stats(); clear_gc_stats();
} }
PRIMITIVE(clear_gc_stats) PRIMITIVE(clear_gc_stats)
{ {
clear_gc_stats(); PRIMITIVE_GETVM()->vmprim_clear_gc_stats();
} }
/* classes.tuple uses this to reshape tuples; tools.deploy.shaker uses this /* classes.tuple uses this to reshape tuples; tools.deploy.shaker uses this

View File

@ -10,30 +10,16 @@ struct gc_stats {
u64 bytes_copied; u64 bytes_copied;
}; };
void init_data_gc();
void gc();
void copy_handle(cell *handle);
void garbage_collection(volatile cell gen,
bool growing_data_heap_,
cell requested_bytes);
/* We leave this many bytes free at the top of the nursery so that inline /* We leave this many bytes free at the top of the nursery so that inline
allocation (which does not call GC because of possible roots in volatile allocation (which does not call GC because of possible roots in volatile
registers) does not run out of memory */ registers) does not run out of memory */
static const cell allot_buffer_zone = 1024; static const cell allot_buffer_zone = 1024;
void copy_reachable_objects(cell scan, cell *end);
PRIMITIVE(gc); PRIMITIVE(gc);
PRIMITIVE(gc_stats); PRIMITIVE(gc_stats);
void clear_gc_stats();
PRIMITIVE(clear_gc_stats); PRIMITIVE(clear_gc_stats);
PRIMITIVE(become); PRIMITIVE(become);
VM_ASM_API void inline_gc(cell *gc_roots_base, cell gc_roots_size); VM_ASM_API void inline_gc(cell *gc_roots_base, cell gc_roots_size);
} }

View File

@ -236,6 +236,7 @@ struct factorvm {
template <typename TYPE> TYPE *allot(cell size); template <typename TYPE> TYPE *allot(cell size);
inline void check_data_pointer(object *pointer); inline void check_data_pointer(object *pointer);
inline void check_tagged_pointer(cell tagged); inline void check_tagged_pointer(cell tagged);
inline void vmprim_clear_gc_stats();
// local roots // local roots
/* If a runtime function needs to call another function which potentially /* If a runtime function needs to call another function which potentially