Skip to content

Commit 83dc4c4

Browse files
qinsoonk-sareen
andauthored
Remove dead code about vm space in immortal space (#1363)
We once used `ImmortalSpace` for VM space. #864 introduced a separate policy for `VMSpace`, and these code in `ImmortalSpace` became dead code since then. This PR removes the dead code. --------- Co-authored-by: Kunal Sareen <[email protected]>
1 parent 7d798ad commit 83dc4c4

File tree

1 file changed

+9
-37
lines changed

1 file changed

+9
-37
lines changed

src/policy/immortalspace.rs

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ pub struct ImmortalSpace<VM: VMBinding> {
2222
mark_state: MarkState,
2323
common: CommonSpace<VM>,
2424
pr: MonotonePageResource<VM>,
25-
/// Is this used as VM space? If this is used as VM space, we never allocate into this space, but we trace objects normally.
26-
vm_space: bool,
2725
}
2826

2927
impl<VM: VMBinding> SFT for ImmortalSpace<VM> {
@@ -154,46 +152,20 @@ impl<VM: VMBinding> ImmortalSpace<VM> {
154152
MonotonePageResource::new_contiguous(common.start, common.extent, vm_map)
155153
},
156154
common,
157-
vm_space: false,
158-
}
159-
}
160-
161-
#[cfg(feature = "vm_space")]
162-
pub fn new_vm_space(
163-
args: crate::policy::space::PlanCreateSpaceArgs<VM>,
164-
start: Address,
165-
size: usize,
166-
) -> Self {
167-
assert!(!args.vmrequest.is_discontiguous());
168-
ImmortalSpace {
169-
mark_state: MarkState::new(),
170-
pr: MonotonePageResource::new_contiguous(start, size, args.vm_map),
171-
common: CommonSpace::new(args.into_policy_args(
172-
false,
173-
true,
174-
metadata::extract_side_metadata(&[*VM::VMObjectModel::LOCAL_MARK_BIT_SPEC]),
175-
)),
176-
vm_space: true,
177155
}
178156
}
179157

180158
pub fn prepare(&mut self) {
181159
self.mark_state.on_global_prepare::<VM>();
182-
if self.vm_space {
183-
// If this is VM space, we never allocate into it, and we should reset the mark bit for the entire space.
184-
self.mark_state
185-
.on_block_reset::<VM>(self.common.start, self.common.extent)
186-
} else {
187-
// Otherwise, we reset the mark bit for the allocated regions.
188-
for (addr, size) in self.pr.iterate_allocated_regions() {
189-
debug!(
190-
"{:?}: reset mark bit from {} to {}",
191-
self.name(),
192-
addr,
193-
addr + size
194-
);
195-
self.mark_state.on_block_reset::<VM>(addr, size);
196-
}
160+
// Reset the mark bit for the allocated regions.
161+
for (addr, size) in self.pr.iterate_allocated_regions() {
162+
debug!(
163+
"{:?}: reset mark bit from {} to {}",
164+
self.name(),
165+
addr,
166+
addr + size
167+
);
168+
self.mark_state.on_block_reset::<VM>(addr, size);
197169
}
198170
}
199171

0 commit comments

Comments
 (0)