From 025a9a4a0a66c8593cd6b7e4b0f0fa7aea84c353 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 28 Aug 2022 17:28:20 +0300 Subject: feat(tvix/eval): implement OpFinalise instruction This instruction finalises the initialisation of deferred upvalues in closures (and soon, thunks). The compiler does not yet emit this instruction, some more accounting is needed for that. Change-Id: Ic4181b26e19779e206f51e17388559400da5f93a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6337 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/opcode.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tvix/eval/src/opcode.rs') diff --git a/tvix/eval/src/opcode.rs b/tvix/eval/src/opcode.rs index 12a76d368e4f..45a6337229d2 100644 --- a/tvix/eval/src/opcode.rs +++ b/tvix/eval/src/opcode.rs @@ -32,7 +32,6 @@ pub struct JumpOffset(pub usize); #[derive(Clone, Copy, Debug)] pub struct Count(pub usize); -#[allow(clippy::enum_variant_names)] #[warn(variant_size_differences)] #[derive(Clone, Copy, Debug)] pub enum OpCode { @@ -108,6 +107,10 @@ pub enum OpCode { OpGetUpvalue(UpvalueIdx), OpClosure(ConstantIdx), + /// Finalise initialisation of the upvalues of the value in the + /// given stack index after the scope is fully bound. + OpFinalise(StackIdx), + // The closure and thunk creation instructions have a variable // number of arguments to the instruction, which is represented // here by making their data part of the opcodes. -- cgit 1.4.1