From 52df3173266d4eb2827cf82fe543009d255ac115 Mon Sep 17 00:00:00 2001
From: _ <_@_>
Date: Mon, 2 Oct 2023 18:54:09 -0500
Subject: [PATCH] measuring
---
lunar_wave_vm/src/state.rs | 45 ++++++++++++++++++++++++--------------
1 file changed, 28 insertions(+), 17 deletions(-)
diff --git a/lunar_wave_vm/src/state.rs b/lunar_wave_vm/src/state.rs
index 23bf773..6863a6f 100644
--- a/lunar_wave_vm/src/state.rs
+++ b/lunar_wave_vm/src/state.rs
@@ -261,7 +261,8 @@ impl State {
/// Short form to get access to a register within our window
pub fn reg (&self, i: u8) -> &Value {
- &self.registers [self.stack_top.register_offset + i as usize]
+ let idx = self.stack_top.register_offset + i as usize;
+ &self.registers [idx]
}
pub fn reg_mut (&mut self, i: u8) -> &mut Value {
@@ -487,18 +488,28 @@ impl State {
true
}
- pub fn step (&mut self) -> Result