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:
Roland Conybeare 2026-04-10 01:10:03 -04:00
commit 4fdaa64085
28 changed files with 58 additions and 61 deletions

View file

@ -198,16 +198,12 @@ namespace xo {
}
void
DArray::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DArray::visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept
{
scope log(XO_DEBUG(false));
for (size_type i = 0; i < size_; ++i) {
log && log("DArray::visit_gco_children (loop)", xtag("i", i), xtag("z", size_));
obj<AGCObject> & elt = elts_[i];
gc.visit_child(&elt);
gc.visit_child(reason, &elt);
}
}

View file

@ -36,7 +36,7 @@ namespace xo {
}
void
DBoolean::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DBoolean::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
// no-op. childless
}

View file

@ -274,10 +274,10 @@ namespace xo {
}
void
DDictionary::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DDictionary::visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept
{
gc.visit_child(&keys_);
gc.visit_child(&values_);
gc.visit_child(reason, &keys_);
gc.visit_child(reason, &values_);
}
} /*namespace scm*/

View file

@ -34,7 +34,7 @@ namespace xo {
}
void
DFloat::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DFloat::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
// noop -- childless!
}

View file

@ -34,7 +34,7 @@ namespace xo {
}
void
DInteger::visit_gco_children(obj<AGCObjectVisitor>) noexcept
DInteger::visit_gco_children(VisitReason, obj<AGCObjectVisitor>) noexcept
{
// no-op. childless
}

View file

@ -185,12 +185,10 @@ namespace xo {
}
void
DList::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DList::visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept
{
//scope log(XO_DEBUG(true));
gc.visit_child(&head_);
gc.visit_child(&rest_);
gc.visit_child(reason, &head_);
gc.visit_child(reason, &rest_);
}
} /*namespace scm*/
} /*namespace xo*/

View file

@ -59,21 +59,10 @@ namespace xo {
}
void
DRuntimeError::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
DRuntimeError::visit_gco_children(VisitReason reason, obj<AGCObjectVisitor> gc) noexcept
{
{
gc.visit_child(&src_function_);
//auto iface = xo::facet::impl_for<AGCObject,DString>();
//gc.forward_inplace(&iface, (void **)(&src_function_));
}
{
gc.visit_child(&error_descr_);
//auto iface = xo::facet::impl_for<AGCObject,DString>();
//gc.forward_inplace(&iface, (void **)(&error_descr_));
}
gc.visit_child(reason, &src_function_);
gc.visit_child(reason, &error_descr_);
}
// ----- Printable facet -----

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DArray::visit_gco_children(DArray & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DArray::visit_gco_children(DArray & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DBoolean::visit_gco_children(DBoolean & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DBoolean::visit_gco_children(DBoolean & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DDictionary::visit_gco_children(DDictionary & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DDictionary::visit_gco_children(DDictionary & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DFloat::visit_gco_children(DFloat & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DFloat::visit_gco_children(DFloat & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DInteger::visit_gco_children(DInteger & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DInteger::visit_gco_children(DInteger & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DList::visit_gco_children(DList & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DList::visit_gco_children(DList & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/

View file

@ -21,9 +21,9 @@ namespace xo {
return self.gco_shallow_move(gc);
}
auto
IGCObject_DRuntimeError::visit_gco_children(DRuntimeError & self, obj<AGCObjectVisitor> fn) noexcept -> void
IGCObject_DRuntimeError::visit_gco_children(DRuntimeError & self, VisitReason reason, obj<AGCObjectVisitor> fn) noexcept -> void
{
self.visit_gco_children(fn);
self.visit_gco_children(reason, fn);
}
} /*namespace scm*/