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

index 943ee8d7c09855db75d754b20325faceee94526f..3d5d2c955a185e9224c9441a3cb85b1d79c66966 100755 (executable)
@@ -3,8 +3,6 @@
 namespace factor
 {
 
-heap code;
-
 /* Allocate a code heap during startup */
 void factorvm::init_code_heap(cell size)
 {
@@ -159,7 +157,6 @@ PRIMITIVE(code_room)
        PRIMITIVE_GETVM()->vmprim_code_room();
 }
 
-static unordered_map<heap_block *,char *> forwarding;
 
 code_block *factorvm::forward_xt(code_block *compiled)
 {
index 6f139a47280d0dba3ab9ae92c0c770aa9deedc90..31116590ad4c5085752d6a4562e3a5600e9be30a 100755 (executable)
@@ -1,8 +1,6 @@
 namespace factor
 {
 
-/* compiled code */
-extern heap code;
 
 void init_code_heap(cell size);
 
index 1e30c131361ce9df3427ec6614880da61bc54210..8eda721992cb0d27c2bc6179b8bbfa0a55d0b4ed 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -468,6 +468,8 @@ struct factorvm {
        code_block *add_code_block(cell type,cell code_,cell labels_,cell relocation_,cell literals_);
 
        //code_heap
+       heap code;
+       unordered_map<heap_block *,char *> forwarding;
        void init_code_heap(cell size);
        bool in_code_heap_p(cell ptr);
        void jit_compile_word(cell word_, cell def_, bool relocate);