refactor(tvix/eval): introduce UpvalueCarrier trait

This trait abstracts over the commonalities of upvalue handling
between closures and thunks.

It allows the VM to simplify the code used for setting up upvalues,
without duplicating between the two different types.

Note that this does not yet refactor the VM code to optimally make use
of this.

Change-Id: If8de5181f26ae1fa00d554f1ae6ea473ee4b6070
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6347
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-08-29 18:07:58 +03:00 committed by tazjin
parent 8033a7abae
commit 25c62dd0ef
5 changed files with 81 additions and 18 deletions

View file

@ -4,6 +4,7 @@ mod compiler;
mod errors;
mod eval;
mod opcode;
mod upvalues;
mod value;
mod vm;
mod warnings;