refactor parts of machine_state_impl.rs that consume copier.rs
This commit is contained in:
@@ -1348,9 +1348,7 @@ impl MachineState {
|
|||||||
pub(super) fn set_ball(&mut self) {
|
pub(super) fn set_ball(&mut self) {
|
||||||
let addr = self[temp_v!(1)].clone();
|
let addr = self[temp_v!(1)].clone();
|
||||||
self.ball.boundary = self.heap.h;
|
self.ball.boundary = self.heap.h;
|
||||||
|
copy_term(CopyBallTerm::new(self), addr);
|
||||||
let duplicator = CopyBallTerm::new(self);
|
|
||||||
copy_term(duplicator, addr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn setup_call_n(&mut self, arity: usize) -> Option<PredicateKey>
|
pub(super) fn setup_call_n(&mut self, arity: usize) -> Option<PredicateKey>
|
||||||
@@ -2029,13 +2027,7 @@ impl MachineState {
|
|||||||
let a1 = self[temp_v!(1)].clone();
|
let a1 = self[temp_v!(1)].clone();
|
||||||
let a2 = self[temp_v!(2)].clone();
|
let a2 = self[temp_v!(2)].clone();
|
||||||
|
|
||||||
// drop the mutable references contained in gadget
|
copy_term(CopyTerm::new(self), a1);
|
||||||
// once the term has been duplicated.
|
|
||||||
{
|
|
||||||
let gadget = CopyTerm::new(self);
|
|
||||||
copy_term(gadget, a1);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.unify(Addr::HeapCell(old_h), a2);
|
self.unify(Addr::HeapCell(old_h), a2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user