Skip to content

Commit 73aab09

Browse files
committed
Revert "Avoid copying FnBounds"
This reverts commit d80b269.
1 parent 048b259 commit 73aab09

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

crates/toolchain/instructions/src/exe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::BTreeMap, sync::Arc};
1+
use std::collections::BTreeMap;
22

33
use openvm_stark_backend::p3_field::Field;
44
use serde::{Deserialize, Serialize};
@@ -24,7 +24,7 @@ pub struct VmExe<F> {
2424
/// Initial memory image.
2525
pub init_memory: MemoryImage<F>,
2626
/// Starting + ending bounds for each function.
27-
pub fn_bounds: Arc<FnBounds>,
27+
pub fn_bounds: FnBounds,
2828
}
2929

3030
impl<F> VmExe<F> {
@@ -33,7 +33,7 @@ impl<F> VmExe<F> {
3333
program,
3434
pc_start: 0,
3535
init_memory: BTreeMap::new(),
36-
fn_bounds: Arc::new(Default::default()),
36+
fn_bounds: Default::default(),
3737
}
3838
}
3939
pub fn with_pc_start(mut self, pc_start: u32) -> Self {

crates/toolchain/transpiler/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! A transpiler from custom RISC-V ELFs to OpenVM executable binaries.
22
3-
use std::sync::Arc;
4-
53
use elf::Elf;
64
use openvm_instructions::{
75
exe::VmExe,
@@ -43,7 +41,7 @@ impl<F: PrimeField32> FromElf for VmExe<F> {
4341
program,
4442
pc_start: elf.pc_start,
4543
init_memory,
46-
fn_bounds: Arc::new(elf.fn_bounds),
44+
fn_bounds: elf.fn_bounds,
4745
})
4846
}
4947
}

crates/vm/src/arch/segment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl<F: PrimeField32, VC: VmConfig<F>> ExecutionSegment<F, VC> {
170170
init_streams: Streams<F>,
171171
initial_memory: Option<MemoryImage<F>>,
172172
trace_height_constraints: Vec<LinearConstraint>,
173-
#[allow(unused_variables)] fn_bounds: Arc<FnBounds>,
173+
#[allow(unused_variables)] fn_bounds: FnBounds,
174174
) -> Self {
175175
let mut chip_complex = config.create_chip_complex().unwrap();
176176
chip_complex.set_streams(init_streams);

crates/vm/src/metrics/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::BTreeMap, mem, sync::Arc};
1+
use std::{collections::BTreeMap, mem};
22

33
use cycle_tracker::CycleTracker;
44
use metrics::counter;
@@ -23,7 +23,7 @@ pub struct VmMetrics {
2323
/// Metric collection tools. Only collected when `config.profiling` is true.
2424
pub cycle_tracker: CycleTracker,
2525
#[allow(dead_code)]
26-
pub(crate) fn_bounds: Arc<FnBounds>,
26+
pub(crate) fn_bounds: FnBounds,
2727
/// Cycle span by function if function start/end addresses are available
2828
#[allow(dead_code)]
2929
pub(crate) current_fn: FnBound,

crates/vm/tests/integration_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fn test_vm_initial_memory() {
325325
program,
326326
pc_start: 0,
327327
init_memory,
328-
fn_bounds: Arc::new(Default::default()),
328+
fn_bounds: Default::default(),
329329
};
330330
air_test(config, exe);
331331
}

0 commit comments

Comments
 (0)