]> gitweb.factorcode.org Git - factor.git/commitdiff
removed some global functions from code_heap
authorPhil Dawes <phil@phildawes.net>
Mon, 17 Aug 2009 20:37:16 +0000 (21:37 +0100)
committerPhil Dawes <phil@phildawes.net>
Wed, 16 Sep 2009 07:16:27 +0000 (08:16 +0100)
vm/code_heap.cpp
vm/code_heap.hpp
vm/inlineimpls.hpp
vm/vm.hpp

index fb24af4044f0d5433fe4ba24d30ab32cc6da421c..39f0dfd52ac29c50a71abe8c6517c9f6efb05e27 100755 (executable)
@@ -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();
-}
-
 }
index 26e1faeb199e3ab2495bc09fb635d3300a28f6f4..32e1dacfeed3bef6c24417f039ba9d465945b0e7 100755 (executable)
@@ -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
-}
-
 }
index b7aaacbc582e7e0845d50aab4f6f213d49a363b3..241c958b2cd4dbc88cd6da3cc87ca3ed8c1e3bcb 100644 (file)
@@ -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
+}
+
 }
index 1c4832e28970d5df65702425313b383d9db6eb72..a4c58a2a0b8d0925319b345d3b74171bd5cd5e2a 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -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;