]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: merge full_collector.hpp into full_collector.cpp
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 3 Aug 2015 22:06:57 +0000 (00:06 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Tue, 4 Aug 2015 14:02:10 +0000 (16:02 +0200)
GNUmakefile
vm/full_collector.cpp
vm/full_collector.hpp [deleted file]
vm/master.hpp

index e5a6d5dee87264d25624bfb87157ba5f29651eb7..e98dbd07afae8127655e33473671006d241d0c8c 100644 (file)
@@ -115,7 +115,6 @@ ifdef CONFIG
                vm/slot_visitor.hpp \
                vm/collector.hpp \
                vm/to_tenured_collector.hpp \
-               vm/full_collector.hpp \
                vm/arrays.hpp \
                vm/math.hpp \
                vm/byte_arrays.hpp \
index f3bc39870a6b041845151bd5fd66e8872a401c48..ce693a81701591601ea075d78b417a462c5b9758 100644 (file)
@@ -2,6 +2,28 @@
 
 namespace factor {
 
+struct full_policy {
+  factor_vm* parent;
+  tenured_space* tenured;
+
+  explicit full_policy(factor_vm* parent)
+      : parent(parent), tenured(parent->data->tenured) {}
+
+  bool should_copy_p(object* untagged) {
+    return !tenured->contains_p(untagged);
+  }
+
+  void promoted_object(object* obj) {
+    tenured->state.set_marked_p((cell)obj, obj->size());
+    parent->mark_stack.push_back((cell)obj);
+  }
+
+  void visited_object(object* obj) {
+    if (!tenured->state.marked_p((cell)obj))
+      promoted_object(obj);
+  }
+};
+
 /* After a sweep, invalidate any code heap roots which are not marked,
    so that if a block makes a tail call to a generic word, and the PIC
    compiler triggers a GC, and the caller block gets GCd as a result,
diff --git a/vm/full_collector.hpp b/vm/full_collector.hpp
deleted file mode 100644 (file)
index 80dd59a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace factor {
-
-struct full_policy {
-  factor_vm* parent;
-  tenured_space* tenured;
-
-  explicit full_policy(factor_vm* parent)
-      : parent(parent), tenured(parent->data->tenured) {}
-
-  bool should_copy_p(object* untagged) {
-    return !tenured->contains_p(untagged);
-  }
-
-  void promoted_object(object* obj) {
-    tenured->state.set_marked_p((cell)obj, obj->size());
-    parent->mark_stack.push_back((cell)obj);
-  }
-
-  void visited_object(object* obj) {
-    if (!tenured->state.marked_p((cell)obj))
-      promoted_object(obj);
-  }
-};
-
-}
index a657093fdf43d2ed9a0e071a15001ecf04ccb3d4..90ec5e595db8a63c40fc807a8d8665b6796b6884 100644 (file)
@@ -133,7 +133,6 @@ namespace factor { struct factor_vm; }
 #include "slot_visitor.hpp"
 #include "collector.hpp"
 #include "to_tenured_collector.hpp"
-#include "full_collector.hpp"
 #include "arrays.hpp"
 #include "math.hpp"
 #include "byte_arrays.hpp"