-
Notifications
You must be signed in to change notification settings - Fork 78
Allow setting object metadata for VM space objects. Expose VO bit under a feature. #1248
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
Changes from 3 commits
8087bef
021a01d
21d008c
ed4ea46
ba27407
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ use crate::vm::VMBinding; | |
| pub(crate) const VO_BIT_SIDE_METADATA_SPEC: SideMetadataSpec = | ||
| crate::util::metadata::side_metadata::spec_defs::VO_BIT; | ||
|
|
||
| #[cfg(target_pointer_width = "64")] | ||
| pub const VO_BIT_SIDE_METADATA_ADDR: Address = VO_BIT_SIDE_METADATA_SPEC.get_absolute_offset(); | ||
|
|
||
| /// Atomically set the VO bit for an object. | ||
|
|
@@ -222,3 +223,23 @@ pub fn is_internal_ptr_from_vo_bit<VM: VMBinding>( | |
| pub unsafe fn is_vo_addr(addr: Address) -> bool { | ||
| VO_BIT_SIDE_METADATA_SPEC.load::<u8>(addr) != 0 | ||
| } | ||
|
|
||
| #[cfg(feature = "vm_space")] | ||
| use crate::MMTK; | ||
|
|
||
| /// Set VO bit for a VM space object. | ||
| /// Objects in the VM space are allocated/managed by the binding. This functio provides a way for | ||
| /// the binding to set VO bit for an object in the space. | ||
| #[cfg(feature = "vm_space")] | ||
| pub fn set_vo_bit_for_vm_space_object<VM: VMBinding>( | ||
|
||
| mmtk: &'static MMTK<VM>, | ||
| object: ObjectReference, | ||
| ) { | ||
| use crate::policy::space::Space; | ||
| debug_assert!( | ||
| mmtk.get_plan().base().vm_space.in_space(object), | ||
| "{} is not in VM space", | ||
| object | ||
| ); | ||
| set_vo_bit(object); | ||
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.