diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 6f0573af..893d36a0 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -534,7 +534,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.18.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=638d3287023c77fb4b6906a8bab35a77a5fb6a1f#638d3287023c77fb4b6906a8bab35a77a5fb6a1f" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=2cc34abe2b3ce4ee213b9ac4b9295160dac754cc#2cc34abe2b3ce4ee213b9ac4b9295160dac754cc" dependencies = [ "atomic 0.5.1", "atomic-traits", @@ -578,7 +578,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.18.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=638d3287023c77fb4b6906a8bab35a77a5fb6a1f#638d3287023c77fb4b6906a8bab35a77a5fb6a1f" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=2cc34abe2b3ce4ee213b9ac4b9295160dac754cc#2cc34abe2b3ce4ee213b9ac4b9295160dac754cc" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 8a4aa638..e3d3705c 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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 = "9dbc8fc65e1e273cefbbe87b20e35e4c43a7ebaf" +julia_version = "a760a7ee28150261669cb0b31a8284214b3635c7" [lib] crate-type = ["staticlib", "rlib", "dylib"] @@ -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 = "638d3287023c77fb4b6906a8bab35a77a5fb6a1f" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "2cc34abe2b3ce4ee213b9ac4b9295160dac754cc" } # 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 caf1c402..2841f0a2 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -57,7 +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_object_reference_write_post(MMTk_Mutator mutator, const void* src, const void* target); +extern uint8_t mmtk_needs_write_barrier(void); /** * Tracing diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 2e0df1a1..e54339b2 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -447,3 +447,29 @@ pub extern "C" fn mmtk_gc_poll(tls: VMMutatorThread) { pub extern "C" fn runtime_panic() { panic!("Panicking at runtime!") } + +#[no_mangle] +pub extern "C" fn mmtk_object_reference_write_post( + mutator: *mut Mutator, + src: ObjectReference, + target: ObjectReference, +) { + let mutator = unsafe { &mut *mutator }; + memory_manager::object_reference_write_post( + mutator, + src, + crate::edges::JuliaVMEdge::Simple(mmtk::vm::edge_shape::SimpleEdge::from_address( + Address::ZERO, + )), + target, + ) +} + +#[no_mangle] +pub extern "C" fn mmtk_needs_write_barrier() -> u8 { + use mmtk::plan::BarrierSelector; + match SINGLETON.get_plan().constraints().barrier { + BarrierSelector::NoBarrier => 0, + BarrierSelector::ObjectBarrier => 1, + } +}