xo-interpreter2: vsm uses VsmRcx for runtime context
This commit is contained in:
parent
c60a2506fc
commit
83156ef2d0
9 changed files with 140 additions and 4 deletions
|
|
@ -141,6 +141,19 @@ xo_add_genfacetimpl(
|
|||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
xo_add_genfacetimpl(
|
||||
TARGET xo-interpreter2-facetimpl-runtimecontext-vsmrcx
|
||||
FACET_PKG xo_procedure2
|
||||
FACET RuntimeContext
|
||||
REPR DVsmRcx
|
||||
INPUT idl/IRuntimeContext_DVsmRcx.json5
|
||||
OUTPUT_HPP_DIR include/xo/interpreter2
|
||||
OUTPUT_IMPL_SUBDIR detail
|
||||
OUTPUT_CPP_DIR src/interpreter2
|
||||
)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
xo_add_genfacet_all(xo-interpreter2-genfacet-all)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
|
|
|||
15
xo-interpreter2/idl/IRuntimeContext_DVsmRcx.json5
Normal file
15
xo-interpreter2/idl/IRuntimeContext_DVsmRcx.json5
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
mode: "implementation",
|
||||
includes: [
|
||||
//"<xo/procedure2/RuntimeContext.hpp>",
|
||||
//"<xo/procedure2/detail/IRuntimeContext_Xfer.hpp>",
|
||||
],
|
||||
local_types: [ ],
|
||||
namespace1: "xo",
|
||||
namespace2: "scm",
|
||||
facet_idl: "idl/RuntimeContext.json5",
|
||||
brief: "provide ARuntimeContext interface for DVsmRcx",
|
||||
using_doxygen: true,
|
||||
repr: "DVsmRcx",
|
||||
doc: [ "implement ARuntimeContext for DVsmRcx" ],
|
||||
}
|
||||
11
xo-interpreter2/include/xo/interpreter2/VsmRcx.hpp
Normal file
11
xo-interpreter2/include/xo/interpreter2/VsmRcx.hpp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/** @file VsmRcx.hpp
|
||||
*
|
||||
* @author Roland Conybeare, Feb 2026
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DVsmRcx.hpp"
|
||||
#include "detail/IRuntimeContext_DVsmRcx.hpp"
|
||||
|
||||
/* end VsmRcx.hpp */
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/** @file IRuntimeContext_DVsmRcx.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IRuntimeContext_DVsmRcx.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_repr.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IRuntimeContext_DVsmRcx.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RuntimeContext.hpp"
|
||||
#include "DVsmRcx.hpp"
|
||||
|
||||
namespace xo { namespace scm { class IRuntimeContext_DVsmRcx; } }
|
||||
|
||||
namespace xo {
|
||||
namespace facet {
|
||||
template <>
|
||||
struct FacetImplementation<xo::scm::ARuntimeContext,
|
||||
xo::scm::DVsmRcx>
|
||||
{
|
||||
using ImplType = xo::scm::IRuntimeContext_Xfer
|
||||
<xo::scm::DVsmRcx,
|
||||
xo::scm::IRuntimeContext_DVsmRcx>;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
/** @class IRuntimeContext_DVsmRcx
|
||||
**/
|
||||
class IRuntimeContext_DVsmRcx {
|
||||
public:
|
||||
/** @defgroup scm-runtimecontext-dvsmrcx-type-traits **/
|
||||
///@{
|
||||
using AAllocator = xo::scm::ARuntimeContext::AAllocator;
|
||||
using Copaque = xo::scm::ARuntimeContext::Copaque;
|
||||
using Opaque = xo::scm::ARuntimeContext::Opaque;
|
||||
///@}
|
||||
/** @defgroup scm-runtimecontext-dvsmrcx-methods **/
|
||||
///@{
|
||||
// const methods
|
||||
/** default allocator to use for objects **/
|
||||
static obj<AAllocator> allocator(const DVsmRcx & self) noexcept;
|
||||
|
||||
// non-const methods
|
||||
///@}
|
||||
};
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end */
|
||||
|
|
@ -26,6 +26,7 @@ set(SELF_SRCS
|
|||
DLocalEnv.cpp
|
||||
|
||||
DVsmRcx.cpp
|
||||
IRuntimeContext_DVsmRcx.cpp
|
||||
|
||||
VsmInstr.cpp
|
||||
)
|
||||
|
|
|
|||
28
xo-interpreter2/src/interpreter2/IRuntimeContext_DVsmRcx.cpp
Normal file
28
xo-interpreter2/src/interpreter2/IRuntimeContext_DVsmRcx.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/** @file IRuntimeContext_DVsmRcx.cpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/IRuntimeContext_DVsmRcx.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [idl/IRuntimeContext_DVsmRcx.json5]
|
||||
**/
|
||||
|
||||
#include "detail/IRuntimeContext_DVsmRcx.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
auto
|
||||
IRuntimeContext_DVsmRcx::allocator(const DVsmRcx & self) noexcept -> obj<AAllocator>
|
||||
{
|
||||
return self.allocator();
|
||||
}
|
||||
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IRuntimeContext_DVsmRcx.cpp */
|
||||
|
|
@ -6,12 +6,13 @@
|
|||
#include "VirtualSchematikaMachine.hpp"
|
||||
#include "VsmApplyFrame.hpp"
|
||||
#include "VsmEvalArgsFrame.hpp"
|
||||
#include "VsmRcx.hpp"
|
||||
#include "Closure.hpp"
|
||||
#include <xo/expression2/ApplyExpr.hpp>
|
||||
#include <xo/expression2/LambdaExpr.hpp>
|
||||
#include <xo/expression2/Constant.hpp>
|
||||
#include <xo/procedure2/RuntimeContext.hpp>
|
||||
#include <xo/procedure2/SimpleRcx.hpp>
|
||||
//#include <xo/procedure2/SimpleRcx.hpp>
|
||||
#include <xo/gc/DX1Collector.hpp>
|
||||
#include <xo/gc/detail/IAllocator_DX1Collector.hpp>
|
||||
#include <xo/printable2/Printable.hpp>
|
||||
|
|
@ -31,13 +32,13 @@ namespace xo {
|
|||
|
||||
namespace scm {
|
||||
|
||||
// NOTE: using heap for {DX1Collector, DSimpleRcx} instances
|
||||
// (though allocation from explictly mmap'd memory)
|
||||
// NOTE: using heap here for {DX1Collector, DVsmRcx} instances
|
||||
// (though DX1Collector allocations will be from explictly mmap'd memory)
|
||||
//
|
||||
VirtualSchematikaMachine::VirtualSchematikaMachine(const VsmConfig & config)
|
||||
: config_{config},
|
||||
mm_(box<AAllocator,DX1Collector>(new DX1Collector(config.x1_config_))),
|
||||
rcx_(box<ARuntimeContext,DSimpleRcx>(new DSimpleRcx(mm_.to_op()))),
|
||||
rcx_(box<ARuntimeContext,DVsmRcx>(new DVsmRcx(this))),
|
||||
reader_{config.rdr_config_, mm_.to_op()}
|
||||
{
|
||||
// TODO: allocate global_env
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "VsmEvalArgsFrame.hpp"
|
||||
#include "Closure.hpp"
|
||||
#include "LocalEnv.hpp"
|
||||
#include "VsmRcx.hpp"
|
||||
|
||||
#include <xo/printable2/detail/APrintable.hpp>
|
||||
#include <xo/facet/FacetRegistry.hpp>
|
||||
|
|
@ -51,10 +52,16 @@ namespace xo {
|
|||
|
||||
FacetRegistry::register_impl<AProcedure, DClosure>();
|
||||
|
||||
// RuntimeContext
|
||||
// \- VsmRcx
|
||||
|
||||
FacetRegistry::register_impl<ARuntimeContext, DVsmRcx>();
|
||||
|
||||
log && log(xtag("DVsmApplyFrame.tseq", typeseq::id<DVsmApplyFrame>()));
|
||||
log && log(xtag("DVsmEvalArgsFrame.tseq", typeseq::id<DVsmEvalArgsFrame>()));
|
||||
log && log(xtag("DClosure.tseq", typeseq::id<DClosure>()));
|
||||
log && log(xtag("DLocalEnv.tseq", typeseq::id<DLocalEnv>()));
|
||||
log && log(xtag("DVsmRcx.tseq", typeseq::id<DVsmRcx>()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,4 +40,5 @@
|
|||
],
|
||||
nonconst_methods: [
|
||||
],
|
||||
router_facet_explicit_content: [ ],
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue