diff --git a/include/xo/interpreter2/DClosure.hpp b/include/xo/interpreter2/DClosure.hpp index e57f6a1a..4d24d72e 100644 --- a/include/xo/interpreter2/DClosure.hpp +++ b/include/xo/interpreter2/DClosure.hpp @@ -20,8 +20,9 @@ namespace xo { public: using ARuntimeContext = xo::scm::ARuntimeContext; using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; + using AAllocator = xo::mm::AAllocator; using ppindentinfo = xo::print::ppindentinfo; using size_type = std::int32_t; @@ -57,9 +58,8 @@ namespace xo { /** @defgroup scm-closure-gcobject-facet **/ ///@{ - std::size_t shallow_size() const noexcept; DClosure * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; ///@} /** @defgroup scm-closure-printable-facet **/ diff --git a/include/xo/interpreter2/DLocalEnv.hpp b/include/xo/interpreter2/DLocalEnv.hpp index 6ecd3eb6..5270dec1 100644 --- a/include/xo/interpreter2/DLocalEnv.hpp +++ b/include/xo/interpreter2/DLocalEnv.hpp @@ -17,8 +17,9 @@ namespace xo { public: using DArray = xo::scm::DArray; using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; + using AAllocator = xo::mm::AAllocator; using ppindentinfo = xo::print::ppindentinfo; using size_type = std::uint32_t; @@ -54,9 +55,8 @@ namespace xo { /** @defgroup scm-localenv-gcobject-facet **/ ///@{ - std::size_t shallow_size() const noexcept; DLocalEnv * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; ///@} /** @defgroup scm-localenv-printable-facet **/ diff --git a/include/xo/interpreter2/DVsmApplyClosureFrame.hpp b/include/xo/interpreter2/DVsmApplyClosureFrame.hpp index ae422cb1..8dd30efb 100644 --- a/include/xo/interpreter2/DVsmApplyClosureFrame.hpp +++ b/include/xo/interpreter2/DVsmApplyClosureFrame.hpp @@ -19,8 +19,9 @@ namespace xo { class DVsmApplyClosureFrame { public: using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; + using AAllocator = xo::mm::AAllocator; using ppindentinfo = xo::print::ppindentinfo; public: @@ -41,7 +42,7 @@ namespace xo { /** gcobject facet **/ std::size_t shallow_size() const noexcept; DVsmApplyClosureFrame * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; /** pretty-printing support **/ bool pretty(const ppindentinfo & ppii) const; diff --git a/include/xo/interpreter2/DVsmApplyFrame.hpp b/include/xo/interpreter2/DVsmApplyFrame.hpp index 99093f37..d8e9ab79 100644 --- a/include/xo/interpreter2/DVsmApplyFrame.hpp +++ b/include/xo/interpreter2/DVsmApplyFrame.hpp @@ -15,8 +15,9 @@ namespace xo { public: using AProcedure = xo::scm::AProcedure; using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; + using AAllocator = xo::mm::AAllocator; using ppindentinfo = xo::print::ppindentinfo; public: @@ -37,9 +38,8 @@ namespace xo { void assign_fn(obj x) { this->fn_ = x; } - std::size_t shallow_size() const noexcept; DVsmApplyFrame * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; /** pretty-printing support **/ bool pretty(const ppindentinfo & ppii) const; diff --git a/include/xo/interpreter2/DVsmDefContFrame.hpp b/include/xo/interpreter2/DVsmDefContFrame.hpp index 0ad31cca..acdd8a90 100644 --- a/include/xo/interpreter2/DVsmDefContFrame.hpp +++ b/include/xo/interpreter2/DVsmDefContFrame.hpp @@ -16,6 +16,7 @@ namespace xo { class DVsmDefContFrame { public: using ACollector = xo::mm::ACollector; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; using ppindentinfo = xo::print::ppindentinfo; @@ -50,9 +51,8 @@ namespace xo { /** @defgroup scm-vsmdefcontframe-gcobject-facet gcobject facet **/ ///@{ - std::size_t shallow_size() const noexcept; DVsmDefContFrame * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; ///@} /** @defgrouop scm-vsmseqcontframe-printable-facet printable facet **/ diff --git a/include/xo/interpreter2/DVsmEvalArgsFrame.hpp b/include/xo/interpreter2/DVsmEvalArgsFrame.hpp index a1903e94..ab7a4607 100644 --- a/include/xo/interpreter2/DVsmEvalArgsFrame.hpp +++ b/include/xo/interpreter2/DVsmEvalArgsFrame.hpp @@ -15,8 +15,9 @@ namespace xo { class DVsmEvalArgsFrame { public: using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; + using AAllocator = xo::mm::AAllocator; using ppindentinfo = xo::print::ppindentinfo; public: @@ -42,9 +43,8 @@ namespace xo { int32_t increment_arg() { return ++i_arg_; } - std::size_t shallow_size() const noexcept; DVsmEvalArgsFrame * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; bool pretty(const ppindentinfo & ppii) const; diff --git a/include/xo/interpreter2/DVsmIfElseContFrame.hpp b/include/xo/interpreter2/DVsmIfElseContFrame.hpp index 3c438e51..82c5ee31 100644 --- a/include/xo/interpreter2/DVsmIfElseContFrame.hpp +++ b/include/xo/interpreter2/DVsmIfElseContFrame.hpp @@ -16,8 +16,9 @@ namespace xo { class DVsmIfElseContFrame { public: using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using AGCObject = xo::mm::AGCObject; + using AAllocator = xo::mm::AAllocator; using ppindentinfo = xo::print::ppindentinfo; public: @@ -50,9 +51,8 @@ namespace xo { /** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/ ///@{ - std::size_t shallow_size() const noexcept; DVsmIfElseContFrame * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; ///@} /** @defgrouop scm-vsmseqcontframe-printable-facet printable facet **/ diff --git a/include/xo/interpreter2/DVsmSeqContFrame.hpp b/include/xo/interpreter2/DVsmSeqContFrame.hpp index 959edfb0..65532996 100644 --- a/include/xo/interpreter2/DVsmSeqContFrame.hpp +++ b/include/xo/interpreter2/DVsmSeqContFrame.hpp @@ -18,6 +18,7 @@ namespace xo { using ACollector = xo::mm::ACollector; using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; using ppindentinfo = xo::print::ppindentinfo; public: @@ -55,9 +56,8 @@ namespace xo { /** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/ ///@{ - std::size_t shallow_size() const noexcept; DVsmSeqContFrame * shallow_move(obj gc) noexcept; - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; ///@} /** @defgrouop scm-vsmseqcontframe-printable-facet printable facet **/ diff --git a/include/xo/interpreter2/define/IGCObject_DVsmDefContFrame.hpp b/include/xo/interpreter2/define/IGCObject_DVsmDefContFrame.hpp index 7d082c38..85949311 100644 --- a/include/xo/interpreter2/define/IGCObject_DVsmDefContFrame.hpp +++ b/include/xo/interpreter2/define/IGCObject_DVsmDefContFrame.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DVsmDefContFrame & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DVsmDefContFrame & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DVsmDefContFrame & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/detail/IGCObject_DClosure.hpp b/include/xo/interpreter2/detail/IGCObject_DClosure.hpp index 84502baa..284199eb 100644 --- a/include/xo/interpreter2/detail/IGCObject_DClosure.hpp +++ b/include/xo/interpreter2/detail/IGCObject_DClosure.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DClosure & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DClosure & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DClosure & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/detail/IGCObject_DVsmApplyClosureFrame.hpp b/include/xo/interpreter2/detail/IGCObject_DVsmApplyClosureFrame.hpp index 9a2e478d..b6a92890 100644 --- a/include/xo/interpreter2/detail/IGCObject_DVsmApplyClosureFrame.hpp +++ b/include/xo/interpreter2/detail/IGCObject_DVsmApplyClosureFrame.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DVsmApplyClosureFrame & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DVsmApplyClosureFrame & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DVsmApplyClosureFrame & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/detail/IGCObject_DVsmApplyFrame.hpp b/include/xo/interpreter2/detail/IGCObject_DVsmApplyFrame.hpp index 9de1e8f3..85b3f614 100644 --- a/include/xo/interpreter2/detail/IGCObject_DVsmApplyFrame.hpp +++ b/include/xo/interpreter2/detail/IGCObject_DVsmApplyFrame.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DVsmApplyFrame & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DVsmApplyFrame & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DVsmApplyFrame & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/detail/IGCObject_DVsmEvalArgsFrame.hpp b/include/xo/interpreter2/detail/IGCObject_DVsmEvalArgsFrame.hpp index 9e2841a6..d62489c3 100644 --- a/include/xo/interpreter2/detail/IGCObject_DVsmEvalArgsFrame.hpp +++ b/include/xo/interpreter2/detail/IGCObject_DVsmEvalArgsFrame.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DVsmEvalArgsFrame & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DVsmEvalArgsFrame & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DVsmEvalArgsFrame & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/env/IGCObject_DLocalEnv.hpp b/include/xo/interpreter2/env/IGCObject_DLocalEnv.hpp index e4de912e..599829a9 100644 --- a/include/xo/interpreter2/env/IGCObject_DLocalEnv.hpp +++ b/include/xo/interpreter2/env/IGCObject_DLocalEnv.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DLocalEnv & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DLocalEnv & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DLocalEnv & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/ifelse/IGCObject_DVsmIfElseContFrame.hpp b/include/xo/interpreter2/ifelse/IGCObject_DVsmIfElseContFrame.hpp index a3cede47..c0c25c65 100644 --- a/include/xo/interpreter2/ifelse/IGCObject_DVsmIfElseContFrame.hpp +++ b/include/xo/interpreter2/ifelse/IGCObject_DVsmIfElseContFrame.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DVsmIfElseContFrame & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DVsmIfElseContFrame & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DVsmIfElseContFrame & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/sequence/IGCObject_DVsmSeqContFrame.hpp b/include/xo/interpreter2/sequence/IGCObject_DVsmSeqContFrame.hpp index 14367b50..0c9fe148 100644 --- a/include/xo/interpreter2/sequence/IGCObject_DVsmSeqContFrame.hpp +++ b/include/xo/interpreter2/sequence/IGCObject_DVsmSeqContFrame.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DVsmSeqContFrame & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DVsmSeqContFrame & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DVsmSeqContFrame & self, obj fn) noexcept; ///@} }; diff --git a/include/xo/interpreter2/vsm/DVirtualSchematikaMachine.hpp b/include/xo/interpreter2/vsm/DVirtualSchematikaMachine.hpp index fa9a6929..28343528 100644 --- a/include/xo/interpreter2/vsm/DVirtualSchematikaMachine.hpp +++ b/include/xo/interpreter2/vsm/DVirtualSchematikaMachine.hpp @@ -72,8 +72,9 @@ namespace xo { // will be DArenaVector> probably using Stack = void *; using ACollector = xo::mm::ACollector; - using AAllocator = xo::mm::AAllocator; using AGCObject = xo::mm::AGCObject; + using AGCObjectVisitor = xo::mm::AGCObjectVisitor; + using AAllocator = xo::mm::AAllocator; using MemorySizeVisitor = xo::mm::MemorySizeVisitor; using span_type = xo::mm::span; @@ -157,7 +158,7 @@ namespace xo { /** forward gc-aware child pointers **/ - std::size_t forward_children(obj gc) noexcept; + void visit_gco_children(obj gc) noexcept; ///@} diff --git a/include/xo/interpreter2/vsm/IGCObject_DVirtualSchematikaMachine.hpp b/include/xo/interpreter2/vsm/IGCObject_DVirtualSchematikaMachine.hpp index 073e9fac..3d72b7af 100644 --- a/include/xo/interpreter2/vsm/IGCObject_DVirtualSchematikaMachine.hpp +++ b/include/xo/interpreter2/vsm/IGCObject_DVirtualSchematikaMachine.hpp @@ -44,6 +44,7 @@ namespace xo { using size_type = xo::mm::AGCObject::size_type; using AAllocator = xo::mm::AGCObject::AAllocator; using ACollector = xo::mm::AGCObject::ACollector; + using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; using Copaque = xo::mm::AGCObject::Copaque; using Opaque = xo::mm::AGCObject::Opaque; ///@} @@ -54,8 +55,10 @@ namespace xo { // non-const methods /** move instance using allocator **/ static Opaque shallow_move(DVirtualSchematikaMachine & self, obj gc) noexcept; - /** during GC: forward immdiate children **/ - static void forward_children(DVirtualSchematikaMachine & self, obj gc) noexcept; + /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. +Context: provides address of data pointer so it can be updated in place +when @p fn invokes garbage collector reentry point **/ + static void visit_gco_children(DVirtualSchematikaMachine & self, obj fn) noexcept; ///@} }; diff --git a/src/interpreter2/DClosure.cpp b/src/interpreter2/DClosure.cpp index 6b346463..ea8bcb15 100644 --- a/src/interpreter2/DClosure.cpp +++ b/src/interpreter2/DClosure.cpp @@ -64,32 +64,16 @@ namespace xo { return err; } - size_t - DClosure::shallow_size() const noexcept { - return sizeof(DClosure); - } - DClosure * DClosure::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DClosure::forward_children(obj gc) noexcept + void + DClosure::visit_gco_children(obj gc) noexcept { - { - gc.forward_inplace(&lambda_); - //auto iface = xo::facet::impl_for(); - //gc.forward_inplace(&iface, (void **)(&lambda_)); - - } - { - gc.forward_inplace(&env_); - //auto iface = xo::facet::impl_for(); - //gc.forward_inplace(&iface, (void **)(&env_)); - } - - return this->shallow_size(); + gc.visit_child(&lambda_); + gc.visit_child(&env_); } // ----- printable facet ----- diff --git a/src/interpreter2/DLocalEnv.cpp b/src/interpreter2/DLocalEnv.cpp index 4124e280..3da6fd9b 100644 --- a/src/interpreter2/DLocalEnv.cpp +++ b/src/interpreter2/DLocalEnv.cpp @@ -91,33 +91,29 @@ namespace xo { /* something terribly wrong if control here */ } - std::size_t - DLocalEnv::shallow_size() const noexcept { - return sizeof(DLocalEnv); - } - DLocalEnv * DLocalEnv::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DLocalEnv::forward_children(obj gc) noexcept + void + DLocalEnv::visit_gco_children(obj gc) noexcept { { - auto iface = xo::facet::impl_for(); - gc.forward_inplace(&iface, (void **)(&parent_)); + gc.visit_child(&parent_); + //auto iface = xo::facet::impl_for(); + //gc.forward_inplace(&iface, (void **)(&parent_)); } { - auto iface = xo::facet::impl_for(); - gc.forward_inplace(&iface, (void **)(&symtab_)); + gc.visit_child(&symtab_); + //auto iface = xo::facet::impl_for(); + //gc.forward_inplace(&iface, (void **)(&symtab_)); } { - auto iface = xo::facet::impl_for(); - gc.forward_inplace(&iface, (void **)(&args_)); + gc.visit_child(&args_); + //auto iface = xo::facet::impl_for(); + //gc.forward_inplace(&iface, (void **)(&args_)); } - - return shallow_size(); } // ----- printable facet ----- diff --git a/src/interpreter2/DVirtualSchematikaMachine.cpp b/src/interpreter2/DVirtualSchematikaMachine.cpp index 06a4c23f..8f9d3967 100644 --- a/src/interpreter2/DVirtualSchematikaMachine.cpp +++ b/src/interpreter2/DVirtualSchematikaMachine.cpp @@ -968,22 +968,20 @@ namespace xo { return nullptr; } - std::size_t - DVirtualSchematikaMachine::forward_children(obj gc) noexcept + void + DVirtualSchematikaMachine::visit_gco_children(obj gc) noexcept { - reader_.forward_children(gc); + reader_.visit_gco_children(gc); - gc.forward_inplace(&stack_); - gc.forward_pivot_inplace(&expr_); - gc.forward_inplace(&global_env_); - gc.forward_inplace(&local_env_); - gc.forward_inplace(&fn_); - gc.forward_inplace(&args_); + gc.visit_child(&stack_); + gc.visit_poly_child(&expr_); + gc.visit_child(&global_env_); + gc.visit_child(&local_env_); + gc.visit_child(&fn_); + gc.visit_child(&args_); if (value_.is_value()) { - gc.forward_inplace(const_cast *>(&value_.value_ref())); + gc.visit_child(const_cast *>(&value_.value_ref())); } - - return this->shallow_size(); } } /*namespace scm*/ diff --git a/src/interpreter2/DVsmApplyClosureFrame.cpp b/src/interpreter2/DVsmApplyClosureFrame.cpp index 129d0d46..c17414b8 100644 --- a/src/interpreter2/DVsmApplyClosureFrame.cpp +++ b/src/interpreter2/DVsmApplyClosureFrame.cpp @@ -32,25 +32,17 @@ namespace xo { return new (mem) DVsmApplyClosureFrame(stack, cont, local_env); } - std::size_t - DVsmApplyClosureFrame::shallow_size() const noexcept - { - return sizeof(DVsmApplyClosureFrame); - } - DVsmApplyClosureFrame * DVsmApplyClosureFrame::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DVsmApplyClosureFrame::forward_children(obj gc) noexcept + void + DVsmApplyClosureFrame::visit_gco_children(obj gc) noexcept { - gc.forward_inplace(&stack_); - gc.forward_inplace(&local_env_); - - return this->shallow_size(); + gc.visit_child(&stack_); + gc.visit_child(&local_env_); } bool diff --git a/src/interpreter2/DVsmApplyFrame.cpp b/src/interpreter2/DVsmApplyFrame.cpp index d388f9c4..1a9a946d 100644 --- a/src/interpreter2/DVsmApplyFrame.cpp +++ b/src/interpreter2/DVsmApplyFrame.cpp @@ -40,26 +40,18 @@ namespace xo { return result; } - std::size_t - DVsmApplyFrame::shallow_size() const noexcept - { - return sizeof(DVsmApplyFrame); - } - DVsmApplyFrame * DVsmApplyFrame::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DVsmApplyFrame::forward_children(obj gc) noexcept + void + DVsmApplyFrame::visit_gco_children(obj gc) noexcept { - gc.forward_inplace(&parent_); - gc.forward_inplace(&fn_); - gc.forward_inplace(&args_); - - return this->shallow_size(); + gc.visit_child(&parent_); + gc.visit_child(&fn_); + gc.visit_child(&args_); } bool diff --git a/src/interpreter2/DVsmDefContFrame.cpp b/src/interpreter2/DVsmDefContFrame.cpp index 02094534..0014f1a3 100644 --- a/src/interpreter2/DVsmDefContFrame.cpp +++ b/src/interpreter2/DVsmDefContFrame.cpp @@ -31,25 +31,17 @@ namespace xo { // gcobject facet - std::size_t - DVsmDefContFrame::shallow_size() const noexcept - { - return sizeof(*this); - } - DVsmDefContFrame * DVsmDefContFrame::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DVsmDefContFrame::forward_children(obj gc) noexcept + void + DVsmDefContFrame::visit_gco_children(obj gc) noexcept { - gc.forward_inplace(&parent_); - gc.forward_inplace(&def_expr_); - - return this->shallow_size(); + gc.visit_child(&parent_); + gc.visit_child(&def_expr_); } // printable facet diff --git a/src/interpreter2/DVsmEvalArgsFrame.cpp b/src/interpreter2/DVsmEvalArgsFrame.cpp index 204bfb44..b796bb78 100644 --- a/src/interpreter2/DVsmEvalArgsFrame.cpp +++ b/src/interpreter2/DVsmEvalArgsFrame.cpp @@ -41,25 +41,17 @@ namespace xo { return result; } - std::size_t - DVsmEvalArgsFrame::shallow_size() const noexcept - { - return sizeof(DVsmEvalArgsFrame); - } - DVsmEvalArgsFrame * DVsmEvalArgsFrame::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DVsmEvalArgsFrame::forward_children(obj gc) noexcept + void + DVsmEvalArgsFrame::visit_gco_children(obj gc) noexcept { - gc.forward_inplace(&parent_); - gc.forward_inplace(&apply_expr_); - - return this->shallow_size(); + gc.visit_child(&parent_); + gc.visit_child(&apply_expr_); } bool diff --git a/src/interpreter2/DVsmIfElseContFrame.cpp b/src/interpreter2/DVsmIfElseContFrame.cpp index 511af900..d0edd976 100644 --- a/src/interpreter2/DVsmIfElseContFrame.cpp +++ b/src/interpreter2/DVsmIfElseContFrame.cpp @@ -29,25 +29,17 @@ namespace xo { // gcobject facet - std::size_t - DVsmIfElseContFrame::shallow_size() const noexcept - { - return sizeof(*this); - } - DVsmIfElseContFrame * DVsmIfElseContFrame::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DVsmIfElseContFrame::forward_children(obj gc) noexcept + void + DVsmIfElseContFrame::visit_gco_children(obj gc) noexcept { - gc.forward_inplace(&parent_); - gc.forward_inplace(&ifelse_expr_); - - return this->shallow_size(); + gc.visit_child(&parent_); + gc.visit_child(&ifelse_expr_); } // printable facet diff --git a/src/interpreter2/DVsmSeqContFrame.cpp b/src/interpreter2/DVsmSeqContFrame.cpp index ad006def..f9ef2f0b 100644 --- a/src/interpreter2/DVsmSeqContFrame.cpp +++ b/src/interpreter2/DVsmSeqContFrame.cpp @@ -32,25 +32,17 @@ namespace xo { // gcobject facet - std::size_t - DVsmSeqContFrame::shallow_size() const noexcept - { - return sizeof(*this); - } - DVsmSeqContFrame * DVsmSeqContFrame::shallow_move(obj gc) noexcept { return gc.std_move_for(this); } - std::size_t - DVsmSeqContFrame::forward_children(obj gc) noexcept + void + DVsmSeqContFrame::visit_gco_children(obj gc) noexcept { - gc.forward_inplace(&parent_); - gc.forward_inplace(&seq_expr_); - - return this->shallow_size(); + gc.visit_child(&parent_); + gc.visit_child(&seq_expr_); } // printable facet diff --git a/src/interpreter2/IGCObject_DClosure.cpp b/src/interpreter2/IGCObject_DClosure.cpp index 3f6af457..889567bc 100644 --- a/src/interpreter2/IGCObject_DClosure.cpp +++ b/src/interpreter2/IGCObject_DClosure.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DClosure::forward_children(DClosure & self, obj gc) noexcept -> void + IGCObject_DClosure::visit_gco_children(DClosure & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/IGCObject_DVsmApplyClosureFrame.cpp b/src/interpreter2/IGCObject_DVsmApplyClosureFrame.cpp index cd0bed84..be67179b 100644 --- a/src/interpreter2/IGCObject_DVsmApplyClosureFrame.cpp +++ b/src/interpreter2/IGCObject_DVsmApplyClosureFrame.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DVsmApplyClosureFrame::forward_children(DVsmApplyClosureFrame & self, obj gc) noexcept -> void + IGCObject_DVsmApplyClosureFrame::visit_gco_children(DVsmApplyClosureFrame & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/IGCObject_DVsmApplyFrame.cpp b/src/interpreter2/IGCObject_DVsmApplyFrame.cpp index 0024df69..d3078821 100644 --- a/src/interpreter2/IGCObject_DVsmApplyFrame.cpp +++ b/src/interpreter2/IGCObject_DVsmApplyFrame.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DVsmApplyFrame::forward_children(DVsmApplyFrame & self, obj gc) noexcept -> void + IGCObject_DVsmApplyFrame::visit_gco_children(DVsmApplyFrame & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/IGCObject_DVsmDefContFrame.cpp b/src/interpreter2/IGCObject_DVsmDefContFrame.cpp index e0cc2158..b3de6d94 100644 --- a/src/interpreter2/IGCObject_DVsmDefContFrame.cpp +++ b/src/interpreter2/IGCObject_DVsmDefContFrame.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DVsmDefContFrame::forward_children(DVsmDefContFrame & self, obj gc) noexcept -> void + IGCObject_DVsmDefContFrame::visit_gco_children(DVsmDefContFrame & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/IGCObject_DVsmEvalArgsFrame.cpp b/src/interpreter2/IGCObject_DVsmEvalArgsFrame.cpp index 8107e7d9..edf1768b 100644 --- a/src/interpreter2/IGCObject_DVsmEvalArgsFrame.cpp +++ b/src/interpreter2/IGCObject_DVsmEvalArgsFrame.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DVsmEvalArgsFrame::forward_children(DVsmEvalArgsFrame & self, obj gc) noexcept -> void + IGCObject_DVsmEvalArgsFrame::visit_gco_children(DVsmEvalArgsFrame & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/IGCObject_DVsmIfElseContFrame.cpp b/src/interpreter2/IGCObject_DVsmIfElseContFrame.cpp index 7b95a521..6f73f5a8 100644 --- a/src/interpreter2/IGCObject_DVsmIfElseContFrame.cpp +++ b/src/interpreter2/IGCObject_DVsmIfElseContFrame.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DVsmIfElseContFrame::forward_children(DVsmIfElseContFrame & self, obj gc) noexcept -> void + IGCObject_DVsmIfElseContFrame::visit_gco_children(DVsmIfElseContFrame & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/IGCObject_DVsmSeqContFrame.cpp b/src/interpreter2/IGCObject_DVsmSeqContFrame.cpp index c9651507..437ac776 100644 --- a/src/interpreter2/IGCObject_DVsmSeqContFrame.cpp +++ b/src/interpreter2/IGCObject_DVsmSeqContFrame.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DVsmSeqContFrame::forward_children(DVsmSeqContFrame & self, obj gc) noexcept -> void + IGCObject_DVsmSeqContFrame::visit_gco_children(DVsmSeqContFrame & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/facet/IGCObject_DLocalEnv.cpp b/src/interpreter2/facet/IGCObject_DLocalEnv.cpp index 25b84b4e..2b8e4e93 100644 --- a/src/interpreter2/facet/IGCObject_DLocalEnv.cpp +++ b/src/interpreter2/facet/IGCObject_DLocalEnv.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DLocalEnv::forward_children(DLocalEnv & self, obj gc) noexcept -> void + IGCObject_DLocalEnv::visit_gco_children(DLocalEnv & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/ diff --git a/src/interpreter2/facet/IGCObject_DVirtualSchematikaMachine.cpp b/src/interpreter2/facet/IGCObject_DVirtualSchematikaMachine.cpp index 8f071003..7fa74f97 100644 --- a/src/interpreter2/facet/IGCObject_DVirtualSchematikaMachine.cpp +++ b/src/interpreter2/facet/IGCObject_DVirtualSchematikaMachine.cpp @@ -21,9 +21,9 @@ namespace xo { return self.shallow_move(gc); } auto - IGCObject_DVirtualSchematikaMachine::forward_children(DVirtualSchematikaMachine & self, obj gc) noexcept -> void + IGCObject_DVirtualSchematikaMachine::visit_gco_children(DVirtualSchematikaMachine & self, obj fn) noexcept -> void { - self.forward_children(gc); + self.visit_gco_children(fn); } } /*namespace scm*/