Rename alloc bit to valid-object bit (VO-bit) #680
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does the following:
alloc_bit.rstovo_bit.rsand move it undersrc/util/metadata.ObjectReferenceas parameter instead ofAddress.util::is_mmtk_objectmodule intoutil::metadata::vo_bit.memory_manager::is_mmtk_objecttoutil::metadata::vo_bit::is_valid_mmtk_object, and it takesObjectReferenceparameter.We currently have a so-called "allocation bit", or "alloc bit" metadata. This name is misleading, because the name suggests it is used to identify allocated units in spaces, which is not true. It actually identifies valid objects (not allocation units) at any address, regardless of space. It is primarily designed to help conservative GC to filter potential object references on the stack or in objects. This PR renames it to valid-object bit, or VO-bit for short.
Some existing spaces use VO-bit to identify allocated units. Currently they are
MallocSpaceandMarkCompactSpace.MallocSpaceuses VO-bit to record all the memory returned bymalloc.MarkCompactSpaceuses VO-bit to iterate through all allocation units in the space.These two spaces should switch to local metadata, and such metadata should only exist if the corresponding spaces
MallocSpaceorMarkCompactSpaceexist. It should be independent from the VO-bit.This PR also does some minor refactoring related to things related to VO-bit. Particularly, the Cargo feature "is_mmtk_object" is removed. The
is_mmtk_objectfunction was designed to support conservative GC, but that is actually what VO-bit is designed for. So that function (now renamedutil::metadata::vo_bit::is_valid_mmtk_object) is enabled whenever the "vo_bit" feature is enabled.Things that are NOT done in this PR:
fecth_andandfetch_or. See Fix fetch_and_atomic and fetch_or_atomic #684util::metadata::invalidate_objectfunction. It should simply clear the VO-bit of an object, but it (1) interferes with the way MallocSpace currently works, and (2) requires the tracing code to skip objects without VO-bits. This change may affect performance.