Module helper

Module helper 

Source
Expand description

This module updates of VO bits during GC. It is used for spaces that do not clear the metadata of some dead objects during GC. Currently, only ImmixSpace is affected.

PolicyWhen are VO bits of dead objects cleared
MarkSweepSpacewhen sweeping cells of dead objects
MarkCompactSpacewhen compacting
CopySpacewhen releasing the space

The policies listed above trivially clear the VO bits for dead objects (individually or in bulk), and make the VO bits available during tracing.

For ImmixSpace, if a line contains both live and dead objects, live objects will be traced, but dead objects will not be visited. Therefore we cannot clear the VO bits of individual dead objects. We cannot clear all VO bits for the line in bulk because it contains live objects. This module updates the VO bits for such regions (e.g. Immix lines, or Immix blocks if Immix is configured to be block-only).

We implement several strategies depending on whether mmtk-core or the VM binding also requires the VO bits to also be available during tracing.

The handling is very sensitive to VOBitUpdateStrategy, and may be a bit verbose. We abstract VO-bit-related code out of the main GC algorithms (such as Immix) to make it more readable.

Enumsยง

VOBitUpdateStrategy ๐Ÿ”’
The strategy to update the valid object (VO) bits.

Functionsยง

need_to_clear_vo_bits_before_tracing ๐Ÿ”’
on_object_forwarded ๐Ÿ”’
on_object_marked ๐Ÿ”’
on_region_swept ๐Ÿ”’
on_trace_object ๐Ÿ”’
strategy ๐Ÿ”’
Select a strategy for the VM. It is a const function so it always returns the same strategy for a given VM.
validate_config ๐Ÿ”’