refactor: make AGCObject.shallow_copy() non-const

prep for moving to ACollector interface
This commit is contained in:
Roland Conybeare 2026-04-04 14:38:14 -04:00
commit 761bff734e
27 changed files with 34 additions and 113 deletions

View file

@ -172,7 +172,6 @@ xo_add_genfacetimpl(
xo_add_genfacetimpl(
TARGET xo-interpreter2-facetimpl-gcobject-localenv
FACET_PKG xo_alloc2
# REPR LocalEnv
INPUT idl/IGCObject_DLocalEnv.json5
)
@ -180,7 +179,6 @@ xo_add_genfacetimpl(
xo_add_genfacetimpl(
TARGET xo-interpreter2-facetimpl-printable-localenv
FACET_PKG xo_printable2
# REPR LocalEnv
INPUT idl/IPrintable_DLocalEnv.json5
)
@ -189,7 +187,6 @@ xo_add_genfacetimpl(
xo_add_genfacetimpl(
TARGET xo-interpreter2-facetimpl-runtimecontext-vsmrcx
FACET_PKG xo_procedure2
# REPR DVsmRcx
INPUT idl/IRuntimeContext_DVsmRcx.json5
)

View file

@ -51,7 +51,7 @@ namespace xo {
///@{
std::size_t shallow_size() const noexcept;
DVsmDefContFrame * shallow_copy(obj<AAllocator> mm) const noexcept;
DVsmDefContFrame * shallow_copy(obj<AAllocator> mm) noexcept;
std::size_t forward_children(obj<ACollector> gc) noexcept;
///@}

View file

@ -51,7 +51,7 @@ namespace xo {
///@{
std::size_t shallow_size() const noexcept;
DVsmIfElseContFrame * shallow_copy(obj<AAllocator> mm) const noexcept;
DVsmIfElseContFrame * shallow_copy(obj<AAllocator> mm) noexcept;
std::size_t forward_children(obj<ACollector> gc) noexcept;
///@}

View file

@ -56,7 +56,7 @@ namespace xo {
///@{
std::size_t shallow_size() const noexcept;
DVsmSeqContFrame * shallow_copy(obj<AAllocator> mm) const noexcept;
DVsmSeqContFrame * shallow_copy(obj<AAllocator> mm) noexcept;
std::size_t forward_children(obj<ACollector> gc) noexcept;
///@}

View file

@ -6,7 +6,7 @@
#pragma once
#include "DLocalEnv.hpp"
#include "detail/IGCObject_DLocalEnv.hpp"
#include "env/IGCObject_DLocalEnv.hpp"
#include "detail/IPrintable_DLocalEnv.hpp"
/* end LocalEnv.hpp */

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DVsmDefContFrame & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DVsmDefContFrame & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DVsmDefContFrame & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DVsmDefContFrame & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DClosure & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DClosure & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DClosure & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DClosure & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -1,67 +0,0 @@
/** @file IGCObject_DLocalEnv.hpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IGCObject_DLocalEnv.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_repr.hpp.j2]
* 3. idl for facet methods
* [idl/IGCObject_DLocalEnv.json5]
**/
#pragma once
#include "GCObject.hpp"
#include <xo/alloc2/GCObject.hpp>
#include <xo/alloc2/Allocator.hpp>
#include "DLocalEnv.hpp"
namespace xo { namespace scm { class IGCObject_DLocalEnv; } }
namespace xo {
namespace facet {
template <>
struct FacetImplementation<xo::mm::AGCObject,
xo::scm::DLocalEnv>
{
using ImplType = xo::mm::IGCObject_Xfer
<xo::scm::DLocalEnv,
xo::scm::IGCObject_DLocalEnv>;
};
}
}
namespace xo {
namespace scm {
/** @class IGCObject_DLocalEnv
**/
class IGCObject_DLocalEnv {
public:
/** @defgroup scm-gcobject-dlocalenv-type-traits **/
///@{
using size_type = xo::mm::AGCObject::size_type;
using AAllocator = xo::mm::AGCObject::AAllocator;
using ACollector = xo::mm::AGCObject::ACollector;
using Copaque = xo::mm::AGCObject::Copaque;
using Opaque = xo::mm::AGCObject::Opaque;
///@}
/** @defgroup scm-gcobject-dlocalenv-methods **/
///@{
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DLocalEnv & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DLocalEnv & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** during GC: forward immdiate children **/
static size_type forward_children(DLocalEnv & self, obj<ACollector> gc) noexcept;
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end */

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DVsmApplyClosureFrame & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DVsmApplyClosureFrame & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DVsmApplyClosureFrame & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DVsmApplyClosureFrame & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DVsmApplyFrame & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DVsmApplyFrame & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DVsmApplyFrame & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DVsmApplyFrame & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DVsmEvalArgsFrame & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DVsmEvalArgsFrame & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DVsmEvalArgsFrame & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DVsmEvalArgsFrame & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DLocalEnv & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DLocalEnv & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DLocalEnv & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DLocalEnv & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DVsmIfElseContFrame & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DVsmIfElseContFrame & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DVsmIfElseContFrame & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DVsmIfElseContFrame & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DVsmSeqContFrame & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DVsmSeqContFrame & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DVsmSeqContFrame & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DVsmSeqContFrame & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -52,10 +52,10 @@ namespace xo {
// const methods
/** memory consumption for this instance **/
static size_type shallow_size(const DVirtualSchematikaMachine & self) noexcept;
/** copy instance using allocator **/
static Opaque shallow_copy(const DVirtualSchematikaMachine & self, obj<AAllocator> mm) noexcept;
// non-const methods
/** copy instance using allocator **/
static Opaque shallow_copy(DVirtualSchematikaMachine & self, obj<AAllocator> mm) noexcept;
/** during GC: forward immdiate children **/
static size_type forward_children(DVirtualSchematikaMachine & self, obj<ACollector> gc) noexcept;
///@}

View file

@ -38,7 +38,7 @@ namespace xo {
}
DVsmDefContFrame *
DVsmDefContFrame::shallow_copy(obj<AAllocator> mm) const noexcept
DVsmDefContFrame::shallow_copy(obj<AAllocator> mm) noexcept
{
return mm.std_copy_for<DVsmDefContFrame>(this);
}

View file

@ -36,7 +36,7 @@ namespace xo {
}
DVsmIfElseContFrame *
DVsmIfElseContFrame::shallow_copy(obj<AAllocator> mm) const noexcept
DVsmIfElseContFrame::shallow_copy(obj<AAllocator> mm) noexcept
{
return mm.std_copy_for<DVsmIfElseContFrame>(this);
}

View file

@ -39,7 +39,7 @@ namespace xo {
}
DVsmSeqContFrame *
DVsmSeqContFrame::shallow_copy(obj<AAllocator> mm) const noexcept
DVsmSeqContFrame::shallow_copy(obj<AAllocator> mm) noexcept
{
return mm.std_copy_for<DVsmSeqContFrame>(this);
}

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DClosure::shallow_copy(const DClosure & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DClosure::shallow_copy(DClosure & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DClosure::forward_children(DClosure & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DVsmApplyClosureFrame::shallow_copy(const DVsmApplyClosureFrame & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DVsmApplyClosureFrame::shallow_copy(DVsmApplyClosureFrame & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DVsmApplyClosureFrame::forward_children(DVsmApplyClosureFrame & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DVsmApplyFrame::shallow_copy(const DVsmApplyFrame & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DVsmApplyFrame::shallow_copy(DVsmApplyFrame & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DVsmApplyFrame::forward_children(DVsmApplyFrame & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DVsmDefContFrame::shallow_copy(const DVsmDefContFrame & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DVsmDefContFrame::shallow_copy(DVsmDefContFrame & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DVsmDefContFrame::forward_children(DVsmDefContFrame & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DVsmEvalArgsFrame::shallow_copy(const DVsmEvalArgsFrame & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DVsmEvalArgsFrame::shallow_copy(DVsmEvalArgsFrame & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DVsmEvalArgsFrame::forward_children(DVsmEvalArgsFrame & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DVsmIfElseContFrame::shallow_copy(const DVsmIfElseContFrame & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DVsmIfElseContFrame::shallow_copy(DVsmIfElseContFrame & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DVsmIfElseContFrame::forward_children(DVsmIfElseContFrame & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DVsmSeqContFrame::shallow_copy(const DVsmSeqContFrame & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DVsmSeqContFrame::shallow_copy(DVsmSeqContFrame & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DVsmSeqContFrame::forward_children(DVsmSeqContFrame & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DLocalEnv::shallow_copy(const DLocalEnv & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DLocalEnv::shallow_copy(DLocalEnv & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DLocalEnv::forward_children(DLocalEnv & self, obj<ACollector> gc) noexcept -> size_type
{

View file

@ -22,11 +22,10 @@ namespace xo {
}
auto
IGCObject_DVirtualSchematikaMachine::shallow_copy(const DVirtualSchematikaMachine & self, obj<AAllocator> mm) noexcept -> Opaque
IGCObject_DVirtualSchematikaMachine::shallow_copy(DVirtualSchematikaMachine & self, obj<AAllocator> mm) noexcept -> Opaque
{
return self.shallow_copy(mm);
}
auto
IGCObject_DVirtualSchematikaMachine::forward_children(DVirtualSchematikaMachine & self, obj<ACollector> gc) noexcept -> size_type
{