diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 98599456..a00b407d 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -472,8 +472,8 @@ dependencies = [ [[package]] name = "mmtk" -version = "0.19.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=61d20e2dcd5b4743ef04a8118eb807bcd6f6e2e2#61d20e2dcd5b4743ef04a8118eb807bcd6f6e2e2" +version = "0.20.0" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab#57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" dependencies = [ "atomic 0.5.3", "atomic-traits", @@ -522,8 +522,8 @@ dependencies = [ [[package]] name = "mmtk-macros" -version = "0.19.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=61d20e2dcd5b4743ef04a8118eb807bcd6f6e2e2#61d20e2dcd5b4743ef04a8118eb807bcd6f6e2e2" +version = "0.20.0" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab#57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index e9f86f0d..d33857db 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,7 +31,7 @@ lazy_static = "1.1" # - 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="61d20e2dcd5b4743ef04a8118eb807bcd6f6e2e2" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } diff --git a/mmtk/api/mmtk.h b/mmtk/api/mmtk.h index 7c3f9d49..e3d10c4a 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -44,7 +44,6 @@ extern void mmtk_post_alloc(MMTk_Mutator mutator, void* refer, extern bool mmtk_is_live_object(void* ref); extern bool mmtk_is_mapped_object(void* ref); extern bool mmtk_is_mapped_address(void* addr); -extern void mmtk_modify_check(void* ref); extern int mmtk_object_is_managed_by_mmtk(void* addr); extern void mmtk_runtime_panic(void); extern void mmtk_unreachable(void); diff --git a/mmtk/api/mmtkMutator.h b/mmtk/api/mmtkMutator.h index ba1d5ab0..4f91c951 100644 --- a/mmtk/api/mmtkMutator.h +++ b/mmtk/api/mmtkMutator.h @@ -1,6 +1,9 @@ #ifndef MMTK_JULIA_MMTK_MUTATOR_H #define MMTK_JULIA_MMTK_MUTATOR_H +// mmtk_julia_types.h refers to the types in this file. +// So if this file is updated, make sure you regenerate Rust types for mmtk_julia_types.h. + enum Allocator { AllocatorDefault = 0, AllocatorImmortal = 1, @@ -29,13 +32,13 @@ typedef struct { void* cursor; void* limit; RustDynPtr space; - RustDynPtr plan; + void* context; } BumpAllocator; typedef struct { void* tls; void* space; - RustDynPtr plan; + void* context; } LargeObjectAllocator; typedef struct { @@ -43,7 +46,7 @@ typedef struct { void* cursor; void* limit; void* immix_space; - RustDynPtr plan; + void* context; uint8_t hot; uint8_t copy; void* large_cursor; @@ -68,7 +71,7 @@ typedef struct { typedef struct { void* tls; void* space; - RustDynPtr plan; + void* context; FLBlockList* available_blocks; FLBlockList* available_blocks_stress; FLBlockList* unswept_blocks; @@ -78,7 +81,7 @@ typedef struct { typedef struct { void* tls; void* space; - RustDynPtr plan; + void* context; } MMTkMallocAllocator; // Prefix with MMTk to avoid name clash typedef struct { diff --git a/mmtk/src/active_plan.rs b/mmtk/src/active_plan.rs index d1caa76c..dd704b7c 100644 --- a/mmtk/src/active_plan.rs +++ b/mmtk/src/active_plan.rs @@ -1,10 +1,9 @@ use crate::JuliaVM; -use crate::{MUTATORS, SINGLETON}; +use crate::MUTATORS; use mmtk::util::opaque_pointer::*; use mmtk::util::Address; use mmtk::vm::ActivePlan; use mmtk::Mutator; -use mmtk::Plan; use mmtk::{plan::ObjectQueue, scheduler::GCWorker, util::ObjectReference}; use std::collections::HashMap; @@ -44,10 +43,6 @@ impl<'a> Iterator for JuliaMutatorIterator<'a> { pub struct VMActivePlan {} impl ActivePlan for VMActivePlan { - fn global() -> &'static dyn Plan { - SINGLETON.get_plan() - } - fn number_of_mutators() -> usize { Self::mutators().count() } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index e8fcd58a..0e647ed2 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -289,11 +289,6 @@ pub extern "C" fn mmtk_is_mapped_address(address: Address) -> bool { address.is_mapped() } -#[no_mangle] -pub extern "C" fn mmtk_modify_check(object: ObjectReference) { - memory_manager::modify_check(&SINGLETON, object) -} - #[no_mangle] pub extern "C" fn mmtk_handle_user_collection_request(tls: VMMutatorThread, collection: u8) { AtomicIsize::fetch_add(&USER_TRIGGERED_GC, 1, Ordering::SeqCst); @@ -306,13 +301,9 @@ pub extern "C" fn mmtk_handle_user_collection_request(tls: VMMutatorThread, coll // auto 0 => memory_manager::handle_user_collection_request::(&SINGLETON, tls), // full - 1 => SINGLETON - .get_plan() - .handle_user_collection_request(tls, true, true), + 1 => SINGLETON.handle_user_collection_request(tls, true, true), // incremental - 2 => SINGLETON - .get_plan() - .handle_user_collection_request(tls, true, false), + 2 => SINGLETON.handle_user_collection_request(tls, true, false), _ => unreachable!(), } } diff --git a/mmtk/src/julia_types.rs b/mmtk/src/julia_types.rs index bb555719..fcbdc1d0 100644 --- a/mmtk/src/julia_types.rs +++ b/mmtk/src/julia_types.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.66.1 */ +/* automatically generated by rust-bindgen 0.68.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -2791,7 +2791,7 @@ pub struct BumpAllocator { pub cursor: *mut ::std::os::raw::c_void, pub limit: *mut ::std::os::raw::c_void, pub space: RustDynPtr, - pub plan: RustDynPtr, + pub context: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_BumpAllocator() { @@ -2799,7 +2799,7 @@ fn bindgen_test_layout_BumpAllocator() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 56usize, + 48usize, concat!("Size of: ", stringify!(BumpAllocator)) ); assert_eq!( @@ -2848,13 +2848,13 @@ fn bindgen_test_layout_BumpAllocator() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plan) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, 40usize, concat!( "Offset of field: ", stringify!(BumpAllocator), "::", - stringify!(plan) + stringify!(context) ) ); } @@ -2863,7 +2863,7 @@ fn bindgen_test_layout_BumpAllocator() { pub struct LargeObjectAllocator { pub tls: *mut ::std::os::raw::c_void, pub space: *mut ::std::os::raw::c_void, - pub plan: RustDynPtr, + pub context: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_LargeObjectAllocator() { @@ -2871,7 +2871,7 @@ fn bindgen_test_layout_LargeObjectAllocator() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 24usize, concat!("Size of: ", stringify!(LargeObjectAllocator)) ); assert_eq!( @@ -2900,13 +2900,13 @@ fn bindgen_test_layout_LargeObjectAllocator() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plan) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(LargeObjectAllocator), "::", - stringify!(plan) + stringify!(context) ) ); } @@ -2917,7 +2917,7 @@ pub struct ImmixAllocator { pub cursor: *mut ::std::os::raw::c_void, pub limit: *mut ::std::os::raw::c_void, pub immix_space: *mut ::std::os::raw::c_void, - pub plan: RustDynPtr, + pub context: *mut ::std::os::raw::c_void, pub hot: u8, pub copy: u8, pub large_cursor: *mut ::std::os::raw::c_void, @@ -2933,7 +2933,7 @@ fn bindgen_test_layout_ImmixAllocator() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 96usize, + 88usize, concat!("Size of: ", stringify!(ImmixAllocator)) ); assert_eq!( @@ -2982,18 +2982,18 @@ fn bindgen_test_layout_ImmixAllocator() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plan) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, 32usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), "::", - stringify!(plan) + stringify!(context) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).hot) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3003,7 +3003,7 @@ fn bindgen_test_layout_ImmixAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).copy) as usize - ptr as usize }, - 49usize, + 41usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3013,7 +3013,7 @@ fn bindgen_test_layout_ImmixAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).large_cursor) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3023,7 +3023,7 @@ fn bindgen_test_layout_ImmixAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).large_limit) as usize - ptr as usize }, - 64usize, + 56usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3033,7 +3033,7 @@ fn bindgen_test_layout_ImmixAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).request_for_large) as usize - ptr as usize }, - 72usize, + 64usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3043,7 +3043,7 @@ fn bindgen_test_layout_ImmixAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr)._align) as usize - ptr as usize }, - 73usize, + 65usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3053,7 +3053,7 @@ fn bindgen_test_layout_ImmixAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).line_opt_tag) as usize - ptr as usize }, - 80usize, + 72usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3063,7 +3063,7 @@ fn bindgen_test_layout_ImmixAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).line_opt) as usize - ptr as usize }, - 88usize, + 80usize, concat!( "Offset of field: ", stringify!(ImmixAllocator), @@ -3170,7 +3170,7 @@ fn bindgen_test_layout_FLBlockList() { pub struct FreeListAllocator { pub tls: *mut ::std::os::raw::c_void, pub space: *mut ::std::os::raw::c_void, - pub plan: RustDynPtr, + pub context: *mut ::std::os::raw::c_void, pub available_blocks: *mut FLBlockList, pub available_blocks_stress: *mut FLBlockList, pub unswept_blocks: *mut FLBlockList, @@ -3182,7 +3182,7 @@ fn bindgen_test_layout_FreeListAllocator() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 64usize, + 56usize, concat!("Size of: ", stringify!(FreeListAllocator)) ); assert_eq!( @@ -3211,18 +3211,18 @@ fn bindgen_test_layout_FreeListAllocator() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plan) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(FreeListAllocator), "::", - stringify!(plan) + stringify!(context) ) ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).available_blocks) as usize - ptr as usize }, - 32usize, + 24usize, concat!( "Offset of field: ", stringify!(FreeListAllocator), @@ -3232,7 +3232,7 @@ fn bindgen_test_layout_FreeListAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).available_blocks_stress) as usize - ptr as usize }, - 40usize, + 32usize, concat!( "Offset of field: ", stringify!(FreeListAllocator), @@ -3242,7 +3242,7 @@ fn bindgen_test_layout_FreeListAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).unswept_blocks) as usize - ptr as usize }, - 48usize, + 40usize, concat!( "Offset of field: ", stringify!(FreeListAllocator), @@ -3252,7 +3252,7 @@ fn bindgen_test_layout_FreeListAllocator() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).consumed_blocks) as usize - ptr as usize }, - 56usize, + 48usize, concat!( "Offset of field: ", stringify!(FreeListAllocator), @@ -3266,7 +3266,7 @@ fn bindgen_test_layout_FreeListAllocator() { pub struct MMTkMallocAllocator { pub tls: *mut ::std::os::raw::c_void, pub space: *mut ::std::os::raw::c_void, - pub plan: RustDynPtr, + pub context: *mut ::std::os::raw::c_void, } #[test] fn bindgen_test_layout_MMTkMallocAllocator() { @@ -3274,7 +3274,7 @@ fn bindgen_test_layout_MMTkMallocAllocator() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 32usize, + 24usize, concat!("Size of: ", stringify!(MMTkMallocAllocator)) ); assert_eq!( @@ -3303,13 +3303,13 @@ fn bindgen_test_layout_MMTkMallocAllocator() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plan) as usize - ptr as usize }, + unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(MMTkMallocAllocator), "::", - stringify!(plan) + stringify!(context) ) ); } @@ -3324,7 +3324,7 @@ fn bindgen_test_layout_MarkCompactAllocator() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 56usize, + 48usize, concat!("Size of: ", stringify!(MarkCompactAllocator)) ); assert_eq!( @@ -3359,7 +3359,7 @@ fn bindgen_test_layout_Allocators() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 712usize, + 608usize, concat!("Size of: ", stringify!(Allocators)) ); assert_eq!( @@ -3379,7 +3379,7 @@ fn bindgen_test_layout_Allocators() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).large_object) as usize - ptr as usize }, - 336usize, + 288usize, concat!( "Offset of field: ", stringify!(Allocators), @@ -3389,7 +3389,7 @@ fn bindgen_test_layout_Allocators() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).malloc) as usize - ptr as usize }, - 400usize, + 336usize, concat!( "Offset of field: ", stringify!(Allocators), @@ -3399,7 +3399,7 @@ fn bindgen_test_layout_Allocators() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).immix) as usize - ptr as usize }, - 432usize, + 360usize, concat!( "Offset of field: ", stringify!(Allocators), @@ -3409,7 +3409,7 @@ fn bindgen_test_layout_Allocators() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).free_list) as usize - ptr as usize }, - 528usize, + 448usize, concat!( "Offset of field: ", stringify!(Allocators), @@ -3419,7 +3419,7 @@ fn bindgen_test_layout_Allocators() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).markcompact) as usize - ptr as usize }, - 656usize, + 560usize, concat!( "Offset of field: ", stringify!(Allocators), @@ -3494,13 +3494,13 @@ fn bindgen_test_layout_MutatorConfig() { #[repr(C)] #[repr(align(8))] pub struct MMTkMutatorContext { - pub _bindgen_opaque_blob: [u64; 100usize], + pub _bindgen_opaque_blob: [u64; 87usize], } #[test] fn bindgen_test_layout_MMTkMutatorContext() { assert_eq!( ::std::mem::size_of::(), - 800usize, + 696usize, concat!("Size of: ", stringify!(MMTkMutatorContext)) ); assert_eq!( @@ -6146,7 +6146,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 16672usize, + 16568usize, concat!("Size of: ", stringify!(mmtk__jl_tls_states_t)) ); assert_eq!( @@ -6506,7 +6506,7 @@ fn bindgen_test_layout_mmtk__jl_tls_states_t() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).malloc_sz_since_last_poll) as usize - ptr as usize }, - 16664usize, + 16560usize, concat!( "Offset of field: ", stringify!(mmtk__jl_tls_states_t),