-
Notifications
You must be signed in to change notification settings - Fork 66
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
Rename "alloc bit" to "valid-object bit" (VO bit), the second attempt. #791
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally good. But I think we should use valid object instead of VO in the comments, keep mentioning VO without explaining it could be confusing.
We also need to update the bindings (at least the OpenJDK binding). I think it uses the feature, as long with the base address for the side metadata (ALLOC_SIDE_METADATA_ADDR
/VO_BIT_SIDE_METADATA_ADDR
).
Ensure the full name is used when first mentioned in public interfaces.
src/util/linear_scan.rs
Outdated
@@ -5,6 +5,9 @@ use crate::vm::ObjectModel; | |||
use crate::vm::VMBinding; | |||
use std::marker::PhantomData; | |||
|
|||
// FIXME: This linear scanning algorithm is only used by MarkCompact. It should use a local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently linear scan can be used by any plan or by the binding (as a utility/debug tool) as long as vo bit is turned on. I don't know if it will be useful or not. Maybe we can engineer the linear scan code to take a side metadata spec as an argument (or const generic).
But you are right -- mark compact probably should use its own local metadata rather than the VO bit.
Malloc mark sweep also uses the vo bit. But I remember that we have some difficulties of using local metadata for it. We have to use the global vo/alloc bit in malloc mark sweep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rephrased this comment a little bit.
Yes. Malloc mark sweep and MarkCompact are the two cases which I think are misuses of the VO bit metadata. As for malloc space, it needs a global metadata that has different semantics than the VO bit. For example, if the user explicitly clears the VO bit to indicate that "the object's type metadata is destroyed and the GC shouldn't scan it or it will crash", malloc still needs a way to know it has an allocation at that address so that it can free it. We may consider adding another per-16-bit (granularity of malloc) global metadata, and we may consider making the VO bit a tri-state metadata where the third state means "there is an allocation, but is no longer valid".
binding-refs |
The OpenJDK binding test passed. The V8 binding failed, but the failure doesn't appear to be related to this change. |
My previous PR #680 tried to do too many things in one PR, and I didn't feel I could finish all the work in the short term.
This PR only renames "alloc bit" to "VO bit", and is intended to quickly remove the notion of "alloc bit" from mmtk-core. Cargo features, identifier, strings and comments are renamed. But this PR does not change how we use (or misuse) the VO bit metadata.
Things that are not done in this PR include:
is_mmtk_object
feature: Theis_mmtk_object
method should be available as long as the VO bit metadata is present.ObjectReference
: Because VO bit is set on the address of theObjectReference
, we should refactor the API to emphasise this and prevent misuse.Those changes will be left to other PRs.