Skip to content

Commit

Permalink
Only expose VO bit side metadata base address on 64bits target
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon committed Dec 5, 2024
1 parent 37652f5 commit 1e1d9f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ no_mmap_annotation = []
# However, in rare cases, a binding may want to directly access and manipulate VO bit. For example, a binding cannot cooperate
# with MMTk to identify each object for setting the VO bit. This is usually due to the limitation of the VM.
# In such cases, a binding may use this feature and manipulate the VO bit to their needs. The binding's manipulation on VO bit
# may violate MMTk's semantics, and may result in undefined behaviors for VO bit related APIs.
# may violate MMTk's semantics, and may result in undefined behaviors for VO bit related APIs. This feature should
# only be used if you understand how VO bit works internally. Use at your own risk.
vo_bit_access = []

# Do not modify the following line - ci-common.sh matches it
Expand Down
1 change: 1 addition & 0 deletions src/util/metadata/side_metadata/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub(crate) const GLOBAL_SIDE_METADATA_BASE_OFFSET: SideMetadataOffset =
SideMetadataOffset::addr(GLOBAL_SIDE_METADATA_BASE_ADDRESS);

/// Base address of VO bit, public to VM bindings which may need to use this.
#[cfg(target_pointer_width = "64")]
pub const VO_BIT_SIDE_METADATA_ADDR: Address =
crate::util::metadata::vo_bit::VO_BIT_SIDE_METADATA_ADDR;

Expand Down
1 change: 1 addition & 0 deletions src/util/metadata/vo_bit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1e1d9f3

Please sign in to comment.