xo-jit: + runtime_binding_path, ++ to activation_record

This commit is contained in:
Roland Conybeare 2024-07-05 20:26:07 -04:00
commit fdc5d46fd7
3 changed files with 86 additions and 8 deletions

View file

@ -736,7 +736,7 @@ namespace xo {
/** Actual parameters will need their own activation record.
* Track its shape here.
**/
this->env_stack_.push(activation_record());
this->env_stack_.push(activation_record(lambda.get()));
{
log && log("lambda: stack size Z", xtag("Z", env_stack_.size()));
@ -769,7 +769,7 @@ namespace xo {
* in lambda body.
*
*/
env_stack_.top().alloc_var(arg_name, alloca);
env_stack_.top().alloc_var(i, arg_name, alloca);
++i;
}
}

View file

@ -25,7 +25,8 @@ namespace xo {
} /*lookup_var*/
llvm::AllocaInst *
activation_record::alloc_var(const std::string & x,
activation_record::alloc_var(std::size_t j_slot,
const std::string & x,
llvm::AllocaInst * alloca)
{
if (frame_.find(x) != frame_.end()) {
@ -35,6 +36,11 @@ namespace xo {
return nullptr;
}
if (j_slot >= binding_v_.size())
binding_v_.resize(j_slot + 1);
binding_v_[j_slot] = runtime_binding_path::local(j_slot);
frame_[x] = alloca;
return alloca;
} /*alloc_var*/