refactor: use GCObjectVisitor api w/ gco_shallow_move
This commit is contained in:
parent
ffa4d99583
commit
a312b5f20c
36 changed files with 79 additions and 67 deletions
|
|
@ -19,7 +19,7 @@ namespace xo {
|
|||
class DClosure {
|
||||
public:
|
||||
using ARuntimeContext = xo::scm::ARuntimeContext;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -58,7 +58,7 @@ namespace xo {
|
|||
/** @defgroup scm-closure-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
DClosure * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DClosure * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace xo {
|
|||
class DLocalEnv {
|
||||
public:
|
||||
using DArray = xo::scm::DArray;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -55,7 +55,7 @@ namespace xo {
|
|||
/** @defgroup scm-localenv-gcobject-facet **/
|
||||
///@{
|
||||
|
||||
DLocalEnv * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DLocalEnv * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace xo {
|
|||
|
||||
/** gcobject facet **/
|
||||
std::size_t shallow_size() const noexcept;
|
||||
DVsmApplyClosureFrame * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVsmApplyClosureFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
/** pretty-printing support **/
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace xo {
|
|||
class DVsmApplyFrame {
|
||||
public:
|
||||
using AProcedure = xo::scm::AProcedure;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -38,7 +38,7 @@ namespace xo {
|
|||
|
||||
void assign_fn(obj<AGCObject> x) { this->fn_ = x; }
|
||||
|
||||
DVsmApplyFrame * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVsmApplyFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
/** pretty-printing support **/
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
**/
|
||||
class DVsmDefContFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
|
|
@ -51,7 +51,7 @@ namespace xo {
|
|||
/** @defgroup scm-vsmdefcontframe-gcobject-facet gcobject facet **/
|
||||
///@{
|
||||
|
||||
DVsmDefContFrame * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVsmDefContFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace xo {
|
|||
/** frame for executing an apply expression **/
|
||||
class DVsmEvalArgsFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -43,7 +43,7 @@ namespace xo {
|
|||
|
||||
int32_t increment_arg() { return ++i_arg_; }
|
||||
|
||||
DVsmEvalArgsFrame * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVsmEvalArgsFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
bool pretty(const ppindentinfo & ppii) const;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
**/
|
||||
class DVsmIfElseContFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -51,7 +51,7 @@ namespace xo {
|
|||
/** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/
|
||||
///@{
|
||||
|
||||
DVsmIfElseContFrame * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVsmIfElseContFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace xo {
|
|||
**/
|
||||
class DVsmSeqContFrame {
|
||||
public:
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
|
|
@ -32,10 +32,10 @@ namespace xo {
|
|||
|
||||
/** create instance using memory from allocator @p mm **/
|
||||
static DVsmSeqContFrame * make(obj<AAllocator> mm,
|
||||
obj<AGCObject> parent,
|
||||
VsmInstr cont,
|
||||
DSequenceExpr * seq_expr,
|
||||
uint32_t i_seq);
|
||||
obj<AGCObject> parent,
|
||||
VsmInstr cont,
|
||||
DSequenceExpr * seq_expr,
|
||||
uint32_t i_seq);
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-vsmevalsequenceframe-access-methods access methods **/
|
||||
|
|
@ -56,7 +56,7 @@ namespace xo {
|
|||
/** @defgroup scm-vsmevalsequenceframe-gcobject-facet gcobject facet **/
|
||||
///@{
|
||||
|
||||
DVsmSeqContFrame * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVsmSeqContFrame * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmDefContFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVsmDefContFrame & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DClosure & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DClosure & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmApplyClosureFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVsmApplyClosureFrame & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmApplyFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVsmApplyFrame & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmEvalArgsFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVsmEvalArgsFrame & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DLocalEnv & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DLocalEnv & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmIfElseContFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVsmIfElseContFrame & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVsmSeqContFrame & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVsmSeqContFrame & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace xo {
|
|||
public:
|
||||
// will be DArenaVector<obj<StackFrame>> probably
|
||||
using Stack = void *;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
//using ACollector = xo::mm::ACollector;
|
||||
using AGCObject = xo::mm::AGCObject;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using AAllocator = xo::mm::AAllocator;
|
||||
|
|
@ -154,7 +154,7 @@ namespace xo {
|
|||
/** shallow copy during gc cycle. Not implemented! Only intending to support
|
||||
* VSM as virtual root
|
||||
**/
|
||||
DVirtualSchematikaMachine * shallow_move(obj<ACollector> gc) noexcept;
|
||||
DVirtualSchematikaMachine * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
/** forward gc-aware child pointers
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -53,8 +53,9 @@ namespace xo {
|
|||
// const methods
|
||||
|
||||
// non-const methods
|
||||
/** move instance using collector **/
|
||||
static Opaque shallow_move(DVirtualSchematikaMachine & self, obj<ACollector> gc) noexcept;
|
||||
/** move instance using object visitor.
|
||||
Arguably abusing the word 'visitor' here **/
|
||||
static Opaque gco_shallow_move(DVirtualSchematikaMachine & self, obj<AGCObjectVisitor> 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 **/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue