Replace single use of Frame::with_parameters with Frame::set_all
This commit is contained in:
committed by
Benjamin Bouvier
parent
d73cb48c29
commit
6e7276e48d
@@ -30,16 +30,6 @@ impl<'a> Frame<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Construct a new [Frame] with the given `values` assigned to their corresponding slot
|
||||
/// (from the SSA references in `parameters`) in the [Frame].
|
||||
pub fn with_parameters(mut self, parameters: &[ValueRef], values: &[DataValue]) -> Self {
|
||||
assert_eq!(parameters.len(), values.len());
|
||||
for (n, v) in parameters.iter().zip(values) {
|
||||
self.registers.insert(*n, v.clone());
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
/// Retrieve the actual value associated with an SSA reference.
|
||||
#[inline]
|
||||
pub fn get(&self, name: &ValueRef) -> &DataValue {
|
||||
|
||||
@@ -112,7 +112,8 @@ impl Interpreter {
|
||||
.next()
|
||||
.expect("to have a first block");
|
||||
let parameters = function.dfg.block_params(first_block);
|
||||
let mut frame = Frame::new(function).with_parameters(parameters, arguments);
|
||||
let mut frame = Frame::new(function);
|
||||
frame.set_all(parameters, arguments.to_vec());
|
||||
self.block(&mut frame, first_block)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user