diff options
author | Vincent Ambo <mail@tazj.in> | 2022-09-13T12·58+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-13T14·41+0000 |
commit | d5ee893fb15f9d2aae676763f12b507ad33243b0 (patch) | |
tree | 6731461c6ca5ff54982648b4372fac56d89b7ea9 /tvix/eval/src/observer.rs | |
parent | a9914a79a0e55741efc7f8b6d694c043248abf2c (diff) |
refactor(tvix/eval): use CodeIdx wrapper for instruction pointer r/4838
As suggested by sterni in cl/6453. Change-Id: I3cf80d97c11fd7d085ab510f6be4b5f937c791ec Reviewed-on: https://cl.tvl.fyi/c/depot/+/6562 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/observer.rs')
-rw-r--r-- | tvix/eval/src/observer.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tvix/eval/src/observer.rs b/tvix/eval/src/observer.rs index d662ea8a3867..e5562e3697d3 100644 --- a/tvix/eval/src/observer.rs +++ b/tvix/eval/src/observer.rs @@ -53,7 +53,7 @@ pub trait Observer { /// Called when the runtime *begins* executing an instruction. The /// provided stack is the state at the beginning of the operation. - fn observe_execute_op(&mut self, _ip: usize, _: &OpCode, _: &[Value]) {} + fn observe_execute_op(&mut self, _ip: CodeIdx, _: &OpCode, _: &[Value]) {} } #[derive(Default)] @@ -162,8 +162,8 @@ impl<W: Write> Observer for TracingObserver<W> { ); } - fn observe_execute_op(&mut self, ip: usize, op: &OpCode, stack: &[Value]) { - let _ = write!(&mut self.writer, "{:04} {:?}\t[ ", ip, op); + fn observe_execute_op(&mut self, ip: CodeIdx, op: &OpCode, stack: &[Value]) { + let _ = write!(&mut self.writer, "{:04} {:?}\t[ ", ip.0, op); for val in stack { let _ = write!(&mut self.writer, "{} ", val); |