xo-interpreter2 stack: + reason arg to visit_gco_children()
Helps streamline DX1Collector in xo-gc/. Want both forward and verify entry points for the same representation.
This commit is contained in:
parent
7d3d2d7070
commit
997b67d791
8 changed files with 15 additions and 10 deletions
|
|
@ -50,6 +50,8 @@ namespace xo {
|
|||
//using ACollector = xo::mm::ACollector;
|
||||
/** object visitor (garbage collector proxy) **/
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
/** visitor hint **/
|
||||
using VisitReason = xo::mm::VisitReason;
|
||||
/** ppindentinfo for APrintable **/
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
///@}
|
||||
|
|
@ -251,7 +253,7 @@ namespace xo {
|
|||
/** fixup child pointers (trivial for DString, no children)
|
||||
* note: cref so we can use forward decl
|
||||
**/
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ namespace xo {
|
|||
using AAllocator = xo::mm::AAllocator;
|
||||
using ACollector = xo::mm::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::VisitReason;
|
||||
using size_type = DString::size_type;
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
|
||||
|
|
@ -93,7 +94,7 @@ namespace xo {
|
|||
DUniqueString * gco_shallow_move(obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
/** fixup child pointers (trivial for DUniqueString, no gc-owned children **/
|
||||
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
|
||||
void visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept;
|
||||
|
||||
///@}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ namespace xo {
|
|||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using ACollector = xo::mm::AGCObject::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
|
|
@ -59,7 +60,7 @@ Arguably abusing the word 'visitor' here **/
|
|||
/** 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(DString & self, obj<AGCObjectVisitor> fn) noexcept;
|
||||
static void visit_gco_children(DString & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ namespace xo {
|
|||
using AAllocator = xo::mm::AGCObject::AAllocator;
|
||||
using ACollector = xo::mm::AGCObject::ACollector;
|
||||
using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor;
|
||||
using VisitReason = xo::mm::AGCObject::VisitReason;
|
||||
using Copaque = xo::mm::AGCObject::Copaque;
|
||||
using Opaque = xo::mm::AGCObject::Opaque;
|
||||
///@}
|
||||
|
|
@ -59,7 +60,7 @@ Arguably abusing the word 'visitor' here **/
|
|||
/** 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(DUniqueString & self, obj<AGCObjectVisitor> fn) noexcept;
|
||||
static void visit_gco_children(DUniqueString & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept;
|
||||
///@}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DString::visit_gco_children(obj<AGCObjectVisitor>) noexcept
|
||||
DString::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
|
||||
{
|
||||
// no-op. no children!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ namespace xo {
|
|||
}
|
||||
|
||||
void
|
||||
DUniqueString::visit_gco_children(obj<AGCObjectVisitor>) noexcept
|
||||
DUniqueString::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
|
||||
{
|
||||
// no-op -- childless!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ namespace xo {
|
|||
return self.gco_shallow_move(gc);
|
||||
}
|
||||
auto
|
||||
IGCObject_DString::visit_gco_children(DString & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
IGCObject_DString::visit_gco_children(DString & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
{
|
||||
self.visit_gco_children(fn);
|
||||
self.visit_gco_children(reason, fn);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ namespace xo {
|
|||
return self.gco_shallow_move(gc);
|
||||
}
|
||||
auto
|
||||
IGCObject_DUniqueString::visit_gco_children(DUniqueString & self, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
IGCObject_DUniqueString::visit_gco_children(DUniqueString & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
|
||||
{
|
||||
self.visit_gco_children(fn);
|
||||
self.visit_gco_children(reason, fn);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue