Skip to content
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

Use MMTK VM space #56

Merged
merged 13 commits into from
May 8, 2023
16 changes: 14 additions & 2 deletions mmtk/Cargo.lock

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

6 changes: 3 additions & 3 deletions mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2018"
[package.metadata.julia]
# Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works.
julia_repo = "https://github.com/mmtk/julia.git"
julia_version = "95bc54ab673fcdf11604324638f597f32158a22f"
julia_version = "eb407eb68ea976df72c8e1cd6ec8607ff8d98fa5"

[lib]
crate-type = ["staticlib", "rlib", "dylib"]
Expand All @@ -29,7 +29,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 = "ed347f19f230dfec8c05a24032f1529e9079478c" }
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "e309f9351dff9cd0c8f3f590002c6edafd158c82" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }
log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] }
Expand All @@ -46,7 +46,7 @@ semispace = []
gencopy = []
pageprotect = []
malloc_counted_size = ["mmtk/malloc_counted_size"]
immix = ["malloc_counted_size", "mmtk/immix_non_moving", "mmtk/immix_smaller_block", "scan_obj_c"]
immix = ["malloc_counted_size", "mmtk/immix_non_moving", "mmtk/immix_smaller_block", "scan_obj_c", "mmtk/vm_space"]
marksweep = ["malloc_counted_size", "scan_obj_c"]
# FIXME update and use rust object scanner as default for immix
scan_obj_c = []
2 changes: 2 additions & 0 deletions mmtk/api/mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ extern void modify_check(void* ref);
extern int object_is_managed_by_mmtk(void* addr);
extern void runtime_panic(void);

extern void mmtk_set_vm_space(void* addr, size_t size);

// Write barriers
extern void mmtk_memory_region_copy(MMTk_Mutator mutator, void* src_obj, void* src_addr, void* dst_obj, void* dst_addr, size_t size);
extern void mmtk_object_reference_write_post(MMTk_Mutator mutator, const void* src, const void* target);
Expand Down
8 changes: 8 additions & 0 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,14 @@ pub extern "C" fn runtime_panic() {
panic!("Panicking at runtime!")
}

#[no_mangle]
#[allow(mutable_transmutes)]
pub extern "C" fn mmtk_set_vm_space(start: Address, size: usize) {
let mmtk: &mmtk::MMTK<JuliaVM> = &SINGLETON;
let mmtk_mut: &mut mmtk::MMTK<JuliaVM> = unsafe { std::mem::transmute(mmtk) };
memory_manager::lazy_init_vm_space(mmtk_mut, start, size);
}

#[no_mangle]
pub extern "C" fn mmtk_memory_region_copy(
mutator: *mut Mutator<JuliaVM>,
Expand Down