]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: the aging_policy and nursery_policy classes are so small that they
authorBjörn Lindqvist <bjourne@gmail.com>
Mon, 4 May 2015 01:57:35 +0000 (03:57 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 10 May 2015 03:04:21 +0000 (20:04 -0700)
can be in the same cpp file with the methods that use them

GNUmakefile
vm/aging_collector.cpp
vm/aging_collector.hpp [deleted file]
vm/master.hpp
vm/nursery_collector.cpp
vm/nursery_collector.hpp [deleted file]

index 2089b0787a147030e1500d78682e9f5dd42723d6..335cba6ec13fca3cf0fb8804a5e4208b0f1859fd 100644 (file)
@@ -115,8 +115,6 @@ ifdef CONFIG
                vm/callstack.hpp \
                vm/slot_visitor.hpp \
                vm/collector.hpp \
-               vm/nursery_collector.hpp \
-               vm/aging_collector.hpp \
                vm/to_tenured_collector.hpp \
                vm/full_collector.hpp \
                vm/arrays.hpp \
index 0765409d90821687a3003e6401f8b00e54c3d282..b0dfca174583440dc193b9347d788ebca8b7c425 100644 (file)
@@ -2,6 +2,25 @@
 
 namespace factor {
 
+struct aging_policy {
+  factor_vm* parent;
+  aging_space* aging;
+  tenured_space* tenured;
+
+  explicit aging_policy(factor_vm* parent)
+      : parent(parent),
+        aging(parent->data->aging),
+        tenured(parent->data->tenured) {}
+
+  bool should_copy_p(object* untagged) {
+    return !(aging->contains_p(untagged) || tenured->contains_p(untagged));
+  }
+
+  void promoted_object(object* obj) {}
+
+  void visited_object(object* obj) {}
+};
+
 void factor_vm::collect_aging() {
   /* Promote objects referenced from tenured space to tenured space, copy
      everything else to the aging semi-space, and reset the nursery pointer. */
diff --git a/vm/aging_collector.hpp b/vm/aging_collector.hpp
deleted file mode 100644 (file)
index ed6b15b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace factor {
-
-struct aging_policy {
-  factor_vm* parent;
-  aging_space* aging;
-  tenured_space* tenured;
-
-  explicit aging_policy(factor_vm* parent)
-      : parent(parent),
-        aging(parent->data->aging),
-        tenured(parent->data->tenured) {}
-
-  bool should_copy_p(object* untagged) {
-    return !(aging->contains_p(untagged) || tenured->contains_p(untagged));
-  }
-
-  void promoted_object(object* obj) {}
-
-  void visited_object(object* obj) {}
-};
-
-}
index 27e823252f749b8dfac3640eae77266280716be1..e7a43d27cd765975637726b7aaf9a3f62c95cf0f 100644 (file)
@@ -135,8 +135,6 @@ namespace factor { struct factor_vm; }
 #include "callstack.hpp"
 #include "slot_visitor.hpp"
 #include "collector.hpp"
-#include "nursery_collector.hpp"
-#include "aging_collector.hpp"
 #include "to_tenured_collector.hpp"
 #include "full_collector.hpp"
 #include "arrays.hpp"
index 2ba4937c8eb17b2be1f7c869a3895ee99c06f360..33e9dfd826c5e4b85eb7b4ea7f41d2125a109ea5 100644 (file)
@@ -2,6 +2,20 @@
 
 namespace factor {
 
+struct nursery_policy {
+  factor_vm* parent;
+
+  explicit nursery_policy(factor_vm* parent) : parent(parent) {}
+
+  bool should_copy_p(object* obj) {
+    return parent->data->nursery->contains_p(obj);
+  }
+
+  void promoted_object(object* obj) {}
+
+  void visited_object(object* obj) {}
+};
+
 void factor_vm::collect_nursery() {
   /* Copy live objects from the nursery (as determined by the root set and
      marked cards in aging and tenured) to aging space. */
diff --git a/vm/nursery_collector.hpp b/vm/nursery_collector.hpp
deleted file mode 100644 (file)
index bf8dbd5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace factor {
-
-struct nursery_policy {
-  factor_vm* parent;
-
-  explicit nursery_policy(factor_vm* parent) : parent(parent) {}
-
-  bool should_copy_p(object* obj) {
-    return parent->data->nursery->contains_p(obj);
-  }
-
-  void promoted_object(object* obj) {}
-
-  void visited_object(object* obj) {}
-};
-
-}