xo-interpreter2 stack: invoke closures w/ tail-call opt [WIP]

This commit is contained in:
Roland Conybeare 2026-02-13 02:05:47 -05:00
commit af4c37c575
15 changed files with 175 additions and 87 deletions

View file

@ -7,6 +7,7 @@
namespace xo {
using xo::mm::AGCObject;
using xo::reflect::typeseq;
namespace scm {
@ -18,6 +19,18 @@ namespace xo {
local_env_{local_env}
{}
DVsmApplyClosureFrame *
DVsmApplyClosureFrame::make(obj<AAllocator> mm,
obj<AGCObject> stack,
VsmInstr cont,
DLocalEnv * local_env)
{
void * mem = mm.alloc(typeseq::id<DVsmApplyClosureFrame>(),
sizeof(DVsmApplyClosureFrame));
return new (mem) DVsmApplyClosureFrame(stack, cont, local_env);
}
std::size_t
DVsmApplyClosureFrame::shallow_size() const noexcept
{