xo-interpreter2: vsm uses VsmRcx for runtime context
This commit is contained in:
parent
5e1eef3fc7
commit
01df73b371
8 changed files with 139 additions and 4 deletions
|
|
@ -26,6 +26,7 @@ set(SELF_SRCS
|
|||
DLocalEnv.cpp
|
||||
|
||||
DVsmRcx.cpp
|
||||
IRuntimeContext_DVsmRcx.cpp
|
||||
|
||||
VsmInstr.cpp
|
||||
)
|
||||
|
|
|
|||
28
src/interpreter2/IRuntimeContext_DVsmRcx.cpp
Normal file
28
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue