Skip to content

Remove dead trace_object methods. #1277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/userguide/src/tutorial/code/mygc_semispace/gc_work.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ impl<VM: VMBinding> ProcessEdgesWork for MyGCProcessEdges<VM> {
worker,
)
} else {
self.plan.common.trace_object(queue, object, worker)
use crate::plan::PlanTraceObject;
use crate::policy::gc_work::DEFAULT_TRACE;
self.plan.common.trace_object::<_, DEFAULT_TRACE>(queue, object, worker)
}
}

Expand Down
19 changes: 0 additions & 19 deletions src/plan/generational/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,25 +202,6 @@ impl<VM: VMBinding> CommonGenPlan<VM> {
is_full_heap
}

/// Trace objects for spaces in generational and common plans for a full heap GC.
#[allow(unused)] // We now use `PlanTraceObject`, and this mehtod is not used.
pub fn trace_object_full_heap<Q: ObjectQueue>(
&self,
queue: &mut Q,
object: ObjectReference,
worker: &mut GCWorker<VM>,
) -> ObjectReference {
if self.nursery.in_space(object) {
return self.nursery.trace_object::<Q>(
queue,
object,
Some(CopySemantics::PromoteToMature),
worker,
);
}
self.common.trace_object::<Q>(queue, object, worker)
}

/// Trace objects for spaces in generational and common plans for a nursery GC.
pub fn trace_object_nursery<Q: ObjectQueue, const KIND: TraceKind>(
&self,
Expand Down
54 changes: 0 additions & 54 deletions src/plan/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,39 +489,6 @@ impl<VM: VMBinding> BasePlan<VM> {
pages
}

pub fn trace_object<Q: ObjectQueue>(
&self,
queue: &mut Q,
object: ObjectReference,
worker: &mut GCWorker<VM>,
) -> ObjectReference {
#[cfg(feature = "code_space")]
if self.code_space.in_space(object) {
trace!("trace_object: object in code space");
return self.code_space.trace_object::<Q>(queue, object);
}

#[cfg(feature = "code_space")]
if self.code_lo_space.in_space(object) {
trace!("trace_object: object in large code space");
return self.code_lo_space.trace_object::<Q>(queue, object);
}

#[cfg(feature = "ro_space")]
if self.ro_space.in_space(object) {
trace!("trace_object: object in ro_space space");
return self.ro_space.trace_object(queue, object);
}

#[cfg(feature = "vm_space")]
if self.vm_space.in_space(object) {
trace!("trace_object: object in boot space");
return self.vm_space.trace_object(queue, object);
}

VM::VMActivePlan::vm_trace_object::<Q>(queue, object, worker)
}

pub fn prepare(&mut self, _tls: VMWorkerThread, _full_heap: bool) {
#[cfg(feature = "code_space")]
self.code_space.prepare();
Expand Down Expand Up @@ -621,27 +588,6 @@ impl<VM: VMBinding> CommonPlan<VM> {
+ self.base.get_used_pages()
}

pub fn trace_object<Q: ObjectQueue>(
&self,
queue: &mut Q,
object: ObjectReference,
worker: &mut GCWorker<VM>,
) -> ObjectReference {
if self.immortal.in_space(object) {
trace!("trace_object: object in immortal space");
return self.immortal.trace_object(queue, object);
}
if self.los.in_space(object) {
trace!("trace_object: object in los");
return self.los.trace_object(queue, object);
}
if self.nonmoving.in_space(object) {
trace!("trace_object: object in nonmoving space");
return self.nonmoving.trace_object(queue, object);
}
self.base.trace_object::<Q>(queue, object, worker)
}

pub fn prepare(&mut self, tls: VMWorkerThread, full_heap: bool) {
self.immortal.prepare();
self.los.prepare(full_heap);
Expand Down
Loading