about summary refs log tree commit diff
path: root/tvix/eval/src/eval.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-04T16·38+0300
committertazjin <tazjin@tvl.su>2022-09-09T21·10+0000
commit14ff889d607635083a030fc73d76b0263759be83 (patch)
tree42b84f7ea79a51ffe64b033ef105e6f04738733e /tvix/eval/src/eval.rs
parentcbf2d2d29293af56d60fa7e04ee1969c18b9845f (diff)
feat(tvix/eval): implement runtime tracing methods for Observer r/4778
These methods make it possible to trace the runtime execution of the
VM through an observer.

Change-Id: I90e26853ba2fe44748613e7f761ed5c1c5fc9ff7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6452
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/eval.rs')
-rw-r--r--tvix/eval/src/eval.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs
index f510cb6a5e..47c7203d28 100644
--- a/tvix/eval/src/eval.rs
+++ b/tvix/eval/src/eval.rs
@@ -3,7 +3,7 @@ use std::{path::PathBuf, rc::Rc};
 use crate::{
     builtins::global_builtins,
     errors::{Error, ErrorKind, EvalResult},
-    observer::DisassemblingObserver,
+    observer::{DisassemblingObserver, NoOpObserver},
     value::Value,
 };
 
@@ -68,5 +68,6 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> {
         return Err(err.clone());
     }
 
-    crate::vm::run_lambda(result.lambda)
+    let mut tracer = NoOpObserver::default();
+    crate::vm::run_lambda(&mut tracer, result.lambda)
 }