removed some global functions from code_heap
parent
00087e6814
commit
afe1cf0c73
|
@ -9,10 +9,6 @@ void factorvm::init_code_heap(cell size)
|
|||
new_heap(&code,size);
|
||||
}
|
||||
|
||||
void init_code_heap(cell size)
|
||||
{
|
||||
return vm->init_code_heap(size);
|
||||
}
|
||||
|
||||
bool factorvm::in_code_heap_p(cell ptr)
|
||||
{
|
||||
|
@ -38,10 +34,6 @@ void factorvm::jit_compile_word(cell word_, cell def_, bool relocate)
|
|||
if(word->pic_tail_def != F) jit_compile(word->pic_tail_def,relocate);
|
||||
}
|
||||
|
||||
void jit_compile_word(cell word_, cell def_, bool relocate)
|
||||
{
|
||||
return vm->jit_compile_word(word_,def_,relocate);
|
||||
}
|
||||
|
||||
/* Apply a function to every code block */
|
||||
void factorvm::iterate_code_heap(code_heap_iterator iter)
|
||||
|
@ -56,10 +48,6 @@ void factorvm::iterate_code_heap(code_heap_iterator iter)
|
|||
}
|
||||
}
|
||||
|
||||
void iterate_code_heap(code_heap_iterator iter)
|
||||
{
|
||||
return vm->iterate_code_heap(iter);
|
||||
}
|
||||
|
||||
/* Copy literals referenced from all code blocks to newspace. Only for
|
||||
aging and nursery collections */
|
||||
|
@ -68,10 +56,6 @@ void factorvm::copy_code_heap_roots()
|
|||
iterate_code_heap(factor::copy_literal_references);
|
||||
}
|
||||
|
||||
void copy_code_heap_roots()
|
||||
{
|
||||
return vm->copy_code_heap_roots();
|
||||
}
|
||||
|
||||
/* Update pointers to words referenced from all code blocks. Only after
|
||||
defining a new word. */
|
||||
|
@ -80,10 +64,6 @@ void factorvm::update_code_heap_words()
|
|||
iterate_code_heap(factor::update_word_references);
|
||||
}
|
||||
|
||||
void update_code_heap_words()
|
||||
{
|
||||
return vm->update_code_heap_words();
|
||||
}
|
||||
|
||||
inline void factorvm::vmprim_modify_code_heap()
|
||||
{
|
||||
|
@ -163,10 +143,6 @@ code_block *factorvm::forward_xt(code_block *compiled)
|
|||
return (code_block *)forwarding[compiled];
|
||||
}
|
||||
|
||||
code_block *forward_xt(code_block *compiled)
|
||||
{
|
||||
return vm->forward_xt(compiled);
|
||||
}
|
||||
|
||||
void factorvm::forward_frame_xt(stack_frame *frame)
|
||||
{
|
||||
|
@ -223,10 +199,6 @@ void factorvm::forward_object_xts()
|
|||
end_scan();
|
||||
}
|
||||
|
||||
void forward_object_xts()
|
||||
{
|
||||
return vm->forward_object_xts();
|
||||
}
|
||||
|
||||
/* Set the XT fields now that the heap has been compacted */
|
||||
void factorvm::fixup_object_xts()
|
||||
|
@ -257,10 +229,6 @@ void factorvm::fixup_object_xts()
|
|||
end_scan();
|
||||
}
|
||||
|
||||
void fixup_object_xts()
|
||||
{
|
||||
return vm->fixup_object_xts();
|
||||
}
|
||||
|
||||
/* Move all free space to the end of the code heap. This is not very efficient,
|
||||
since it makes several passes over the code and data heaps, but we only ever
|
||||
|
@ -288,9 +256,4 @@ void factorvm::compact_code_heap()
|
|||
build_free_list(&code,size);
|
||||
}
|
||||
|
||||
void compact_code_heap()
|
||||
{
|
||||
return vm->compact_code_heap();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,31 +1,12 @@
|
|||
namespace factor
|
||||
{
|
||||
|
||||
|
||||
void init_code_heap(cell size);
|
||||
|
||||
bool in_code_heap_p(cell ptr);
|
||||
|
||||
void jit_compile_word(cell word, cell def, bool relocate);
|
||||
bool in_code_heap_p(cell ptr); // Used by platform specific code
|
||||
|
||||
struct factorvm;
|
||||
typedef void (*code_heap_iterator)(code_block *compiled,factorvm *myvm);
|
||||
|
||||
void iterate_code_heap(code_heap_iterator iter);
|
||||
|
||||
void copy_code_heap_roots();
|
||||
|
||||
PRIMITIVE(modify_code_heap);
|
||||
|
||||
PRIMITIVE(code_room);
|
||||
|
||||
void compact_code_heap();
|
||||
|
||||
inline static void check_code_pointer(cell ptr)
|
||||
{
|
||||
#ifdef FACTOR_DEBUG
|
||||
assert(in_code_heap_p(ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -541,4 +541,13 @@ inline void do_slots(cell obj, void (* iter)(cell *,factorvm*))
|
|||
return vm->do_slots(obj,iter);
|
||||
}
|
||||
|
||||
// code_heap.hpp
|
||||
|
||||
inline void factorvm::check_code_pointer(cell ptr)
|
||||
{
|
||||
#ifdef FACTOR_DEBUG
|
||||
assert(in_code_heap_p(ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -155,7 +155,6 @@ struct factorvm {
|
|||
template<typename T> void each_object(T &functor);
|
||||
cell find_all_words();
|
||||
cell object_size(cell tagged);
|
||||
// next method here:
|
||||
|
||||
|
||||
//write barrier
|
||||
|
@ -499,6 +498,8 @@ struct factorvm {
|
|||
void forward_object_xts();
|
||||
void fixup_object_xts();
|
||||
void compact_code_heap();
|
||||
inline void check_code_pointer(cell ptr);
|
||||
// next method here:
|
||||
|
||||
//image
|
||||
cell code_relocation_base;
|
||||
|
|
Loading…
Reference in New Issue