xo-object2: streamline write barriers for DList,DArray muts

This commit is contained in:
Roland Conybeare 2026-05-01 20:38:38 -04:00
commit 4ab49af785
5 changed files with 5 additions and 26 deletions

View file

@ -80,16 +80,10 @@ namespace xo {
lhs_iface, lhs_data,
rhs_iface, rhs_data); }
// see [RAllocator_aux.hpp] for implementation.
void barrier_assign(void * parent,
obj<AGCObject> * p_lhs,
obj<AGCObject> rhs) noexcept;
#ifdef NOT_YET
this->barrier_assign_aux(parent,
p_lhs->iface(),
p_lhs->opaque_data_addr(),
rhs.iface(),
rhs.opaque_data());
#endif
static bool _valid;
};

View file

@ -67,7 +67,7 @@ namespace xo {
void assign_head(obj<AAllocator> mm, obj<AGCObject> h);
void assign_head_gc(obj<ACollector> gc, obj<AGCObject> h);
/** assign rest-pointer. Caller responsible for preserving acyclic property! **/
void _assign_rest(DList * r);
void _assign_rest(obj<AAllocator> mm, DList * r);
/** pretty-printing driver; combine layout+printing **/
bool pretty(const ppindentinfo & ppii) const;

View file

@ -80,14 +80,8 @@ namespace xo {
if (ix >= size_)
return false;
scope log(XO_DEBUG(true), "need write barrier");
mm.barrier_assign(this, &elts_[ix], x);
//mm.barrier_assign_aux(this,
// elts_[ix].iface(), elts_[ix].opaque_data_addr(),
// x.iface(), x.opaque_data());
return true;
}
@ -104,10 +98,6 @@ namespace xo {
mm.barrier_assign(this, &elts_[size_], elt);
//mm.barrier_assign_aux(this,
// elts_[size_].iface(), elts_[size_].opaque_data_addr(),
// elt.iface(), elt.opaque_data());
++(this->size_);
return true;

View file

@ -141,20 +141,15 @@ namespace xo {
}
void
DList::_assign_rest(DList * rest)
DList::_assign_rest(obj<AAllocator> mm, DList * rest)
{
scope log(XO_DEBUG(true), "need write barrier");
#ifdef NOT_YET
obj<AGCObject,DList> rest_gco(rest);
mm.barrier_assign_aux(this,
nullptr /*lhs iface unused*/,
&(this->rest_),
(void**)&(this->rest_),
rest_gco.iface(),
rest);
#endif
this->rest_ = rest;
}
bool

View file

@ -184,7 +184,7 @@ namespace xo {
if (this->end_) {
/* DExpectQListSsm owns {start_, end_} -> preserves acyclic property */
end_->_assign_rest(new_last);
end_->_assign_rest(p_psm->expr_alloc(), new_last);
this->end_ = new_last;
} else {