xo-object2: streamline write barriers for DList,DArray muts
This commit is contained in:
parent
0defad229f
commit
4ab49af785
5 changed files with 5 additions and 26 deletions
|
|
@ -80,16 +80,10 @@ namespace xo {
|
||||||
lhs_iface, lhs_data,
|
lhs_iface, lhs_data,
|
||||||
rhs_iface, rhs_data); }
|
rhs_iface, rhs_data); }
|
||||||
|
|
||||||
|
// see [RAllocator_aux.hpp] for implementation.
|
||||||
void barrier_assign(void * parent,
|
void barrier_assign(void * parent,
|
||||||
obj<AGCObject> * p_lhs,
|
obj<AGCObject> * p_lhs,
|
||||||
obj<AGCObject> rhs) noexcept;
|
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;
|
static bool _valid;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ namespace xo {
|
||||||
void assign_head(obj<AAllocator> mm, obj<AGCObject> h);
|
void assign_head(obj<AAllocator> mm, obj<AGCObject> h);
|
||||||
void assign_head_gc(obj<ACollector> gc, obj<AGCObject> h);
|
void assign_head_gc(obj<ACollector> gc, obj<AGCObject> h);
|
||||||
/** assign rest-pointer. Caller responsible for preserving acyclic property! **/
|
/** 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 **/
|
/** pretty-printing driver; combine layout+printing **/
|
||||||
bool pretty(const ppindentinfo & ppii) const;
|
bool pretty(const ppindentinfo & ppii) const;
|
||||||
|
|
|
||||||
|
|
@ -80,14 +80,8 @@ namespace xo {
|
||||||
if (ix >= size_)
|
if (ix >= size_)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
scope log(XO_DEBUG(true), "need write barrier");
|
|
||||||
|
|
||||||
mm.barrier_assign(this, &elts_[ix], x);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,10 +98,6 @@ namespace xo {
|
||||||
|
|
||||||
mm.barrier_assign(this, &elts_[size_], elt);
|
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_);
|
++(this->size_);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -141,20 +141,15 @@ namespace xo {
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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);
|
obj<AGCObject,DList> rest_gco(rest);
|
||||||
|
|
||||||
mm.barrier_assign_aux(this,
|
mm.barrier_assign_aux(this,
|
||||||
nullptr /*lhs iface unused*/,
|
nullptr /*lhs iface unused*/,
|
||||||
&(this->rest_),
|
(void**)&(this->rest_),
|
||||||
rest_gco.iface(),
|
rest_gco.iface(),
|
||||||
rest);
|
rest);
|
||||||
#endif
|
|
||||||
this->rest_ = rest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ namespace xo {
|
||||||
if (this->end_) {
|
if (this->end_) {
|
||||||
/* DExpectQListSsm owns {start_, end_} -> preserves acyclic property */
|
/* 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;
|
this->end_ = new_last;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue