Skip to content

Commit

Permalink
FIXMES
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed May 4, 2023
1 parent 0f2ae3d commit d4bec82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/vm/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub fn get_perm_range_check_limits(
trace
.iter()
.try_fold(None, |offsets: Option<(isize, isize)>, trace| {
//TODO: try to use instruction cache; this is about 10-15% of proof runs
let instruction = memory.get_integer((0, trace.pc).into())?;
let instruction = instruction
.to_u64()
Expand Down
4 changes: 4 additions & 0 deletions src/vm/vm_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,12 +694,16 @@ impl VirtualMachine {
Some(Ok(opt_fp)) if opt_fp != fp => fp = opt_fp,
_ => break,
}
//TODO: use cache
// Try to check if the call instruction is (instruction0, instruction1) or just
// instruction1 (with no immediate).
let call_pc = match (ret_pc - 1)
.ok()
.map(|r| self.segments.memory.get_integer(r))
{
//FIXME: what if this looks like a call but is actually just a number passed as
//immediate?
//Maybe we should just keep a call stack?
Some(Ok(instruction1)) => {
match is_call_instruction(&instruction1) {
true => (ret_pc - 1).unwrap(), // This unwrap wont fail as it is checked before
Expand Down

0 comments on commit d4bec82

Please sign in to comment.