feat(tvix/vm): add opcodes for new Value::NotFound sentinel
This sentinel value is going to be used for certain nested accesses into attribute sets. There is a new instruction similar to `OpAttrsSelect` which leaves the sentinel on the stack if a key is not found, instead of raising an error. Additionally, a new jump instruction makes its jump operation conditional on finding such a sentinel value. Change-Id: I2642f0a0bcc85bbe0ead68ea09a7dd794dbedeac Reviewed-on: https://cl.tvl.fyi/c/depot/+/6166 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
999b9c7a13
commit
b8cec6d61e
3 changed files with 24 additions and 3 deletions
|
|
@ -41,12 +41,14 @@ pub enum OpCode {
|
|||
OpJump(usize),
|
||||
OpJumpIfTrue(usize),
|
||||
OpJumpIfFalse(usize),
|
||||
OpJumpIfNotFound(usize),
|
||||
|
||||
// Attribute sets
|
||||
OpAttrs(usize),
|
||||
OpAttrPath(usize),
|
||||
OpAttrsUpdate,
|
||||
OpAttrsSelect,
|
||||
OpAttrOrNotFound,
|
||||
OpAttrsIsSet,
|
||||
|
||||
// Lists
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue