feat(tvix/eval): implement DisassemblingObserver for compiler

This type implements an observer that is called whenever the compiler
emits a chunk (after the toplevel, thunks, or lambdas) and prints the
output of the disassembler to its internal writer.

This replaces half of the uses of the `disassembler` feature, which
has been removed from the Cargo configuration.

Note that at this commit runtime tracing is not yet implemented as an
observer.

Change-Id: I7894ca1ba445761aba4ad51d98e4a7b6445f1aea
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6449
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-09-04 16:56:20 +03:00 committed by tazjin
parent 7ae45342df
commit 8ee4d6d5db
7 changed files with 111 additions and 98 deletions

View file

@ -1,6 +1,7 @@
mod builtins;
mod chunk;
mod compiler;
mod disassembler;
mod errors;
mod eval;
mod observer;
@ -10,9 +11,6 @@ mod value;
mod vm;
mod warnings;
#[cfg(feature = "disassembler")]
mod disassembler;
#[cfg(test)]
mod tests;