From 93134b949fbecc4719b85316918e7632717df93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Mon, 1 Dec 2014 21:26:46 +0100 Subject: [PATCH] VM: the aging_collector and nursery_collector classes aren't needed because they are just simple instatiations of copying_collector --- vm/aging_collector.cpp | 10 +++------- vm/aging_collector.hpp | 4 ---- vm/nursery_collector.cpp | 9 +++------ vm/nursery_collector.hpp | 4 ---- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/vm/aging_collector.cpp b/vm/aging_collector.cpp index de5ce3450c..2683a29986 100644 --- a/vm/aging_collector.cpp +++ b/vm/aging_collector.cpp @@ -2,11 +2,6 @@ namespace factor { -aging_collector::aging_collector(factor_vm* parent) - : copying_collector(parent, - parent->data->aging, - aging_policy(parent)) {} - 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. */ @@ -40,8 +35,9 @@ void factor_vm::collect_aging() { std::swap(data->aging, data->aging_semispace); data->reset_generation(data->aging); - aging_collector collector(this); - + copying_collector collector(this, + this->data->aging, + aging_policy(this)); collector.trace_roots(); collector.trace_contexts(); diff --git a/vm/aging_collector.hpp b/vm/aging_collector.hpp index 4184c92a8c..ed6b15be35 100644 --- a/vm/aging_collector.hpp +++ b/vm/aging_collector.hpp @@ -19,8 +19,4 @@ struct aging_policy { void visited_object(object* obj) {} }; -struct aging_collector : copying_collector { - explicit aging_collector(factor_vm* parent); -}; - } diff --git a/vm/nursery_collector.cpp b/vm/nursery_collector.cpp index b966a56200..08ba0fb139 100644 --- a/vm/nursery_collector.cpp +++ b/vm/nursery_collector.cpp @@ -2,15 +2,12 @@ namespace factor { -nursery_collector::nursery_collector(factor_vm* parent) - : copying_collector(parent, - parent->data->aging, - nursery_policy(parent)) {} - 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. */ - nursery_collector collector(this); + copying_collector collector(this, + this->data->aging, + nursery_policy(this)); collector.trace_roots(); collector.trace_contexts(); diff --git a/vm/nursery_collector.hpp b/vm/nursery_collector.hpp index cb0860e9e7..bf8dbd57c3 100644 --- a/vm/nursery_collector.hpp +++ b/vm/nursery_collector.hpp @@ -14,8 +14,4 @@ struct nursery_policy { void visited_object(object* obj) {} }; -struct nursery_collector : copying_collector { - explicit nursery_collector(factor_vm* parent); -}; - }