Skip to content

Commit 101c6c3

Browse files
committed
refactor
1 parent 2eb4afe commit 101c6c3

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

crates/lean_vm/src/core/types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ pub type SourceLineNumber = usize;
1111

1212
/// String label for bytecode locations
1313
pub type Label = String;
14+
15+
/// Bytecode address (i.e., a value of the program counter)
16+
pub type CodeAddress = usize;

crates/lean_vm/src/isa/bytecode.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
//! Bytecode representation and management
22
3-
use crate::Hint;
3+
use crate::{CodeAddress, Hint};
44

55
use super::Instruction;
66
use std::collections::BTreeMap;
77
use std::fmt::{Display, Formatter};
88

9-
pub type CodeAddress = usize;
10-
119
/// Complete bytecode representation with instructions and hints
1210
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1311
pub struct Bytecode {

crates/lean_vm/src/isa/hint.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use crate::Label;
2-
use crate::core::{DIMENSION, F, LOG_VECTOR_LEN, SourceLineNumber, VECTOR_LEN};
1+
use crate::core::{Label, DIMENSION, F, LOG_VECTOR_LEN, SourceLineNumber, VECTOR_LEN};
32
use crate::diagnostics::RunnerError;
43
use crate::execution::{ExecutionHistory, Memory};
54
use crate::isa::operands::MemOrConstant;

crates/lean_vm/src/isa/instruction.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
33
use super::Operation;
44
use super::operands::{MemOrConstant, MemOrFp, MemOrFpOrConstant};
5-
use crate::Label;
6-
use crate::core::{DIMENSION, EF, F, VECTOR_LEN};
5+
use crate::core::{Label, DIMENSION, EF, F, VECTOR_LEN};
76
use crate::diagnostics::RunnerError;
87
use crate::execution::Memory;
98
use crate::witness::{

crates/lean_vm/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ pub use execution::*;
1212
pub use isa::*;
1313
pub use witness::*;
1414

15-
pub type SourceLineNumber = usize;
16-
1715
/// Main execution entry point for the VM
1816
pub fn execute_bytecode(
1917
bytecode: &Bytecode,

0 commit comments

Comments
 (0)