Skip to content

Move to Rust 1.83 #296

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

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ probe = "0.5"
# - change branch
# - change repo name
# But other changes including adding/removing whitespaces in commented lines may break the CI.
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "c0f97884234b51b13c8ba5d1563a8e0f592d11c2" }
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "ec745353a8de72b645613e0fef3ab7f5f1ad9bd1" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }

Expand Down Expand Up @@ -72,3 +72,4 @@ pageprotect = []
immix = []
genimmix = []
stickyimmix = []
markcompact = []
2 changes: 1 addition & 1 deletion mmtk/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.77.0
1.83.0
4 changes: 3 additions & 1 deletion mmtk/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ impl OopDesc {

impl fmt::Debug for OopDesc {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let c_string = unsafe { ((*UPCALLS).dump_object_string)(mem::transmute(self)) };
let c_string = unsafe {
((*UPCALLS).dump_object_string)(mem::transmute::<&OopDesc, ObjectReference>(self))
};
let c_str: &CStr = unsafe { CStr::from_ptr(c_string) };
let s: &str = c_str.to_str().unwrap();
write!(f, "{}", s)
Expand Down
2 changes: 1 addition & 1 deletion mmtk/src/active_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct OpenJDKMutatorIterator<'a, const COMPRESSED: bool> {
phantom_data: PhantomData<&'a ()>,
}

impl<'a, const COMPRESSED: bool> OpenJDKMutatorIterator<'a, COMPRESSED> {
impl<const COMPRESSED: bool> OpenJDKMutatorIterator<'_, COMPRESSED> {
fn new() -> Self {
let mut mutators = VecDeque::new();
unsafe {
Expand Down
6 changes: 0 additions & 6 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ pub extern "C" fn total_bytes() -> usize {
with_singleton!(|singleton| memory_manager::total_bytes(singleton))
}

#[no_mangle]
#[cfg(feature = "sanity")]
pub extern "C" fn scan_region() {
with_singleton!(|singleton| memory_manager::scan_region(singleton))
}

#[no_mangle]
pub extern "C" fn handle_user_collection_request(tls: VMMutatorThread) {
with_singleton!(|singleton| {
Expand Down
8 changes: 5 additions & 3 deletions mmtk/src/object_scanning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ fn oop_iterate_slow<const COMPRESSED: bool, V: SlotVisitor<S<COMPRESSED>>>(
unsafe {
CLOSURE.with(|x| *x.get() = closure as *mut V as *mut u8);
((*UPCALLS).scan_object)(
mem::transmute(
mem::transmute::<*const unsafe extern "C" fn(Address), *mut libc::c_void>(
scan_object_fn::<COMPRESSED, V> as *const unsafe extern "C" fn(slot: Address),
),
mem::transmute(oop),
mem::transmute::<&OopDesc, ObjectReference>(oop),
tls,
);
}
Expand Down Expand Up @@ -235,5 +235,7 @@ pub fn scan_object<const COMPRESSED: bool>(
closure: &mut impl SlotVisitor<S<COMPRESSED>>,
_tls: VMWorkerThread,
) {
unsafe { oop_iterate::<COMPRESSED>(mem::transmute(object), closure) }
unsafe {
oop_iterate::<COMPRESSED>(mem::transmute::<ObjectReference, &OopDesc>(object), closure)
}
}
Loading