about summary refs log tree commit diff
path: root/tvix/eval/src/disassembler.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-30 r/4534 feat(tvix/eval): implement chunk disassembler outputVincent Ambo1-0/+31
This makes for a much nicer view of an execution if `--feature disassembler` is set, for example: tvix-repl> let value = [ 1 2 { a = 1; } ]; in value ++ [ 1 ] === compiled bytecode (11 operations) === 02 OpConstant(1) 02 OpConstant(2) 02 OpConstant("a") 02 OpConstant(1) 02 OpAttrs(1) 02 OpList(3) 02 OpGetLocal(0) 02 OpConstant(1) 02 OpList(1) 02 OpConcat 02 OpCloseScope(1) === runtime trace === 0001 OpConstant(ConstantIdx(0)) [ 1 ] 0002 OpConstant(ConstantIdx(1)) [ 1 2 ] 0003 OpConstant(ConstantIdx(2)) [ 1 2 "a" ] 0004 OpConstant(ConstantIdx(3)) [ 1 2 "a" 1 ] 0005 OpAttrs(1) [ 1 2 { a = 1; } ] 0006 OpList(3) [ [ 1 2 { a = 1; } ] ] 0007 OpGetLocal(0) [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } ] ] 0008 OpConstant(ConstantIdx(4)) [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } ] 1 ] 0009 OpList(1) [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } ] [ 1 ] ] 0010 OpConcat [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } 1 ] ] 0011 OpCloseScope(1) [ [ 1 2 { a = 1; } 1 ] ] => [ 1 2 { a = 1; } 1 ] :: list Change-Id: If79c7fd1f0f18255ddb3763c1ba585fda8041b1b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6195 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-30 r/4533 feat(tvix/eval): implement optional runtime tracingVincent Ambo1-0/+37
This adds a `disassembler` feature to the crate configuration that traces the operations executed and the state of the stack at runtime. This can be enabled by compiling with `--feature disassembler`. This will also gain a more sensible layout of code slices eventually. Change-Id: I34c15e1cd346ecc4362b5afba6bf82dd49359d20 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6193 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>