From b76e7758b7bbd20cefd7c3f315bdf8fe066ced57 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Sat, 25 Feb 2023 17:29:17 -0800 Subject: [PATCH] WIP. --- src/backend/localify.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/backend/localify.rs b/src/backend/localify.rs index 4a95427..aa23ac3 100644 --- a/src/backend/localify.rs +++ b/src/backend/localify.rs @@ -242,6 +242,16 @@ impl<'a> Context<'a> { let mut freelist: HashMap> = HashMap::new(); for i in 0..self.points { + // Process ends. (Ends are exclusive, so we do them + // first; another range can grab the local at the same + // point index in this same iteration.) + if let Some(expiring) = expiring.remove(&i) { + for (ty, local) in expiring { + log::trace!(" -> expiring {} of type {} back to freelist", local, ty); + freelist.entry(ty).or_insert_with(|| vec![]).push(local); + } + } + // Process starts. while range_idx < ranges.len() && ranges[range_idx].1.start == i { let (value, range) = ranges[range_idx].clone(); @@ -279,16 +289,6 @@ impl<'a> Context<'a> { } self.results.values[value] = allocs; } - - // Process ends. (Ends are exclusive, so we do them - // first; another range can grab the local at the same - // point index in this same iteration.) - if let Some(expiring) = expiring.remove(&i) { - for (ty, local) in expiring { - log::trace!(" -> expiring {} of type {} back to freelist", local, ty); - freelist.entry(ty).or_insert_with(|| vec![]).push(local); - } - } } }