Skip to content
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

Feature/four state forwarding bits #977

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wks
Copy link
Collaborator

@wks wks commented Oct 12, 2023

DRAFT: This PR depends on cyclic marking state if forwarding bits are in the header.

Currently the forwarding bits is a 2-bits-per-object metadata, but it only has three states, namely "not triggered", "being forwarded" and "forwarded". Marking is supported by a separate marking bit. This PR uses the fourth state of the forwarding bits to represent the state that "the object is marked and should not move". With this change, Immix (and other GCs that do not evacuate all objects in a GC) will no longer need to "set the state to 'being forwarded' and then revert it if the object is marked". Instead, one CMPXCHG will be enough to atomically initiate forwarding as well as atomically mark an object, and fail if another thread is trying to mark or forward the same object.

The name is likely inherited from JikesRVM.  But since we changed its
name, we should just use the module name "object_forwarding" directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant