From ab6f615eb96cedb21df4975498bc5cd76de46b78 Mon Sep 17 00:00:00 2001 From: Tianle Qiu Date: Fri, 25 Jul 2025 03:07:49 +0000 Subject: [PATCH 01/42] WIP --- mmtk/Cargo.lock | 2 - mmtk/Cargo.toml | 4 +- mmtk/src/api.rs | 15 + mmtk/src/collection.rs | 4 + mmtk/src/lib.rs | 3 + openjdk/barriers/mmtkObjectBarrier.cpp | 53 ++- openjdk/barriers/mmtkObjectBarrier.hpp | 3 + openjdk/barriers/mmtkSATBBarrier.cpp | 536 ++++++++++++++++++++++++ openjdk/barriers/mmtkSATBBarrier.hpp | 86 ++++ openjdk/mmtk.h | 6 + openjdk/mmtkBarrierSet.cpp | 10 + openjdk/mmtkBarrierSet.hpp | 42 +- openjdk/mmtkBarrierSetAssembler_x86.cpp | 35 +- openjdk/mmtkBarrierSetAssembler_x86.hpp | 15 +- openjdk/mmtkBarrierSetC1.cpp | 52 ++- openjdk/mmtkBarrierSetC1.hpp | 78 +++- openjdk/mmtkBarrierSetC2.hpp | 15 +- 17 files changed, 908 insertions(+), 51 deletions(-) create mode 100644 openjdk/barriers/mmtkSATBBarrier.cpp create mode 100644 openjdk/barriers/mmtkSATBBarrier.hpp diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index a86422fe..5c18686a 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,6 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=c5ead72a87bcc8cc49b5e7a62cf71d848b4b4c9b#c5ead72a87bcc8cc49b5e7a62cf71d848b4b4c9b" dependencies = [ "atomic", "atomic-traits", @@ -497,7 +496,6 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=c5ead72a87bcc8cc49b5e7a62cf71d848b4b4c9b#c5ead72a87bcc8cc49b5e7a62cf71d848b4b4c9b" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 5a3086c4..7f758b48 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -35,9 +35,9 @@ 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 = "c5ead72a87bcc8cc49b5e7a62cf71d848b4b4c9b" } +# mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "c5ead72a87bcc8cc49b5e7a62cf71d848b4b4c9b" } # Uncomment the following to build locally -# mmtk = { path = "../repos/mmtk-core" } +mmtk = { path = "../../mmtk-core" } [build-dependencies] built = { version = "0.7.7", features = ["git2"] } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 19c59580..0b813ba0 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -47,6 +47,7 @@ macro_rules! with_mutator { static NO_BARRIER: sync::Lazy = sync::Lazy::new(|| CString::new("NoBarrier").unwrap()); static OBJECT_BARRIER: sync::Lazy = sync::Lazy::new(|| CString::new("ObjectBarrier").unwrap()); +static SATB_BARRIER: sync::Lazy = sync::Lazy::new(|| CString::new("SATBBarrier").unwrap()); #[no_mangle] pub extern "C" fn get_mmtk_version() -> *const c_char { @@ -59,6 +60,7 @@ pub extern "C" fn mmtk_active_barrier() -> *const c_char { match singleton.get_plan().constraints().barrier { BarrierSelector::NoBarrier => NO_BARRIER.as_ptr(), BarrierSelector::ObjectBarrier => OBJECT_BARRIER.as_ptr(), + BarrierSelector::SATBBarrier => SATB_BARRIER.as_ptr(), // In case we have more barriers in mmtk-core. #[allow(unreachable_patterns)] _ => unimplemented!(), @@ -381,6 +383,19 @@ pub extern "C" fn executable() -> bool { true } +#[no_mangle] +pub extern "C" fn mmtk_load_reference(mutator: *mut libc::c_void, o: ObjectReference) { + with_mutator!(|mutator| mutator.barrier().load_reference(o)) +} + +#[no_mangle] +pub extern "C" fn mmtk_object_reference_clone_pre( + mutator: *mut libc::c_void, + obj: ObjectReference, +) { + with_mutator!(|mutator| mutator.barrier().object_reference_clone_pre(obj)) +} + /// Full pre barrier #[no_mangle] pub extern "C" fn mmtk_object_reference_write_pre( diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index 2924c14e..ddbcbc8d 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -57,4 +57,8 @@ impl Collection> for VMCollection { ((*UPCALLS).schedule_finalizer)(); } } + + fn set_concurrent_marking_state(active: bool) { + unsafe { crate::CONCURRENT_MARKING_ACTIVE = if active { 1 } else { 0 } } + } } diff --git a/mmtk/src/lib.rs b/mmtk/src/lib.rs index 3b1f54a2..cd37988b 100644 --- a/mmtk/src/lib.rs +++ b/mmtk/src/lib.rs @@ -139,6 +139,9 @@ pub static VO_BIT_ADDRESS: uintptr_t = pub static FREE_LIST_ALLOCATOR_SIZE: uintptr_t = std::mem::size_of::>>(); +#[no_mangle] +pub static mut CONCURRENT_MARKING_ACTIVE: u8 = 0; + #[derive(Default)] pub struct OpenJDK; diff --git a/openjdk/barriers/mmtkObjectBarrier.cpp b/openjdk/barriers/mmtkObjectBarrier.cpp index fcf2b349..df56ac74 100644 --- a/openjdk/barriers/mmtkObjectBarrier.cpp +++ b/openjdk/barriers/mmtkObjectBarrier.cpp @@ -136,6 +136,57 @@ void MMTkObjectBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, Dec #undef __ +#define __ sasm-> + +void MMTkObjectBarrierSetAssembler::generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const { + __ prologue("mmtk_object_barrier", false); + + Label done, runtime; + + __ push(c_rarg0); + __ push(c_rarg1); + __ push(c_rarg2); + __ push(rax); + + __ load_parameter(0, c_rarg0); + __ load_parameter(1, c_rarg1); + __ load_parameter(2, c_rarg2); + + __ bind(runtime); + + __ save_live_registers_no_oop_map(true); + +#if MMTK_ENABLE_BARRIER_FASTPATH + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); +#else + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), 3); +#endif + + __ restore_live_registers(true); + + __ bind(done); + __ pop(rax); + __ pop(c_rarg2); + __ pop(c_rarg1); + __ pop(c_rarg0); + + __ epilogue(); +} + +#undef __ +#define __ ce->masm()-> + +void MMTkObjectBarrierSetAssembler::generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const { + MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); + ce->store_parameter(stub->src->as_pointer_register(), 0); + ce->store_parameter(stub->slot->as_pointer_register(), 1); + ce->store_parameter(stub->new_val->as_pointer_register(), 2); + __ call(RuntimeAddress(bs->post_barrier_c1_runtime_code_blob()->code_begin())); + __ jmp(*stub->continuation()); +} +#undef __ + #ifdef ASSERT #define __ gen->lir(__FILE__, __LINE__)-> #else @@ -176,7 +227,7 @@ void MMTkObjectBarrierSetC1::object_reference_write_post(LIRAccess& access, LIR_ new_val = new_val_reg; } assert(new_val->is_register(), "must be a register at this point"); - CodeStub* slow = new MMTkC1BarrierStub(src, slot, new_val); + CodeStub* slow = new MMTkC1PostBarrierStub(src, slot, new_val); #if MMTK_ENABLE_BARRIER_FASTPATH LIR_Opr addr = src; diff --git a/openjdk/barriers/mmtkObjectBarrier.hpp b/openjdk/barriers/mmtkObjectBarrier.hpp index 6baf7bae..179cc1ef 100644 --- a/openjdk/barriers/mmtkObjectBarrier.hpp +++ b/openjdk/barriers/mmtkObjectBarrier.hpp @@ -31,7 +31,10 @@ class MMTkObjectBarrierSetRuntime: public MMTkBarrierSetRuntime { class MMTkObjectBarrierSetAssembler: public MMTkBarrierSetAssembler { protected: virtual void object_reference_write_post(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2, bool compensate_val_reg) const override; + /// Generate C1 write barrier slow-call assembly code + virtual void generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const; public: + virtual void generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const; virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; }; diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp new file mode 100644 index 00000000..42551a70 --- /dev/null +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -0,0 +1,536 @@ +#define private public // too lazy to change openjdk... + +#include "precompiled.hpp" +#include "mmtkSATBBarrier.hpp" +#include "runtime/interfaceSupport.inline.hpp" + +#define SOFT_REFERENCE_LOAD_BARRIER true + +constexpr int kUnloggedValue = 1; + +static inline intptr_t side_metadata_base_address() { + return UseCompressedOops ? SATB_METADATA_BASE_ADDRESS : SATB_METADATA_BASE_ADDRESS; +} + +void MMTkSATBBarrierSetRuntime::load_reference(DecoratorSet decorators, oop value) const { +#if SOFT_REFERENCE_LOAD_BARRIER + if (CONCURRENT_MARKING_ACTIVE == 1 && value != NULL) + ::mmtk_load_reference((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) value); +#endif +}; + +void MMTkSATBBarrierSetRuntime::object_probable_write(oop new_obj) const { + // The slow-call will do the unlog bit check again (same as the above fast-path check) + mmtk_object_probable_write((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) new_obj); +} + +void MMTkSATBBarrierSetRuntime::object_reference_write_pre(oop src, oop* slot, oop target) const { +#if MMTK_ENABLE_BARRIER_FASTPATH + // oop pre_val = *slot; + // if (pre_val == NULL) return; + intptr_t addr = ((intptr_t) (void*) src); + const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> (UseCompressedOops ? 5 : 6))); + intptr_t shift = (addr >> (UseCompressedOops ? 2 : 3)) & 0b111; + uint8_t byte_val = *meta_addr; + if (((byte_val >> shift) & 1) == kUnloggedValue) { + object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + } +#else + object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); +#endif +} + +#define __ masm-> + +void MMTkSATBBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp_thread) { + bool on_oop = type == T_OBJECT || type == T_ARRAY; + bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0; + bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0; + bool on_reference = on_weak || on_phantom; + BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread); +#if SOFT_REFERENCE_LOAD_BARRIER + if (on_oop && on_reference) { + Label done; + // No slow-call if SATB is not active + Register tmp = rscratch1; + Register tmp2 = rscratch2; + __ movptr(tmp, intptr_t(&CONCURRENT_MARKING_ACTIVE)); + __ xorq(tmp2, tmp2); + __ movb(tmp2, Address(tmp, 0)); + __ cmpptr(tmp2, 1); + __ jcc(Assembler::notEqual, done); + // No slow-call if dst is NULL + __ cmpptr(dst, 0); + __ jcc(Assembler::equal, done); + // Do slow-call + __ pusha(); + __ mov(c_rarg0, dst); + __ MacroAssembler::call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::load_reference_call), 1); + __ popa(); + __ bind(done); + } +#endif +} + +void MMTkSATBBarrierSetAssembler::object_reference_write_pre(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2) const { + if (can_remove_barrier(decorators, val, /* skip_const_null */ false)) return; + + #if MMTK_ENABLE_BARRIER_FASTPATH + Label done; + + Register obj = dst.base(); + Register tmp3 = rscratch1; + Register tmp4 = rscratch2; + Register tmp5 = tmp1 == dst.base() || tmp1 == dst.index() ? tmp2 : tmp1; + + // tmp5 = load-byte (side_metadata_base_address() + (obj >> 6)); + __ movptr(tmp3, obj); + // __ load_heap_oop(tmp3, dst, noreg, noreg, AS_RAW); + // // Is the previous value null? + // __ cmpptr(tmp3, (int32_t) NULL_WORD); + // __ jcc(Assembler::equal, done); + + __ shrptr(tmp3, UseCompressedOops ? 5 : 6); + __ movptr(tmp5, side_metadata_base_address()); + __ movzbl(tmp5, Address(tmp5, tmp3)); + + // tmp3 = (obj >> 3) & 7 + __ mov(tmp3, obj); + __ shrptr(tmp3, UseCompressedOops ? 2 : 3); + __ andptr(tmp3, 7); + // tmp5 = tmp5 >> tmp3 + __ movptr(tmp4, rcx); + __ movl(rcx, tmp3); + __ shrptr(tmp5); + __ movptr(rcx, tmp4); + // if ((tmp5 & 1) == 1) goto slowpath; + __ andptr(tmp5, 1); + __ cmpptr(tmp5, kUnloggedValue); + __ jcc(Assembler::notEqual, done); + + // TODO: Spill fewer registers + __ pusha(); + __ movptr(c_rarg0, dst.base()); + __ lea(c_rarg1, dst); + __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); + __ popa(); + + __ bind(done); +#else + __ pusha(); + __ movptr(c_rarg0, dst.base()); + __ lea(c_rarg1, dst); + __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); + __ popa(); +#endif +} + +void MMTkSATBBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) { + // `count` or `dst` register values may get overwritten after the array copy, and `arraycopy_epilogue` can receive invalid addresses. + // Save the register values here and restore them in `arraycopy_epilogue`. + // See https://github.com/openjdk/jdk/blob/jdk-11%2B19/src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp#L37-L50 + + if (type == T_OBJECT || type == T_ARRAY) { + Label done; + // // Bailout if count is zero + __ cmpptr(count, 0); + __ jcc(Assembler::equal, done); + __ pusha(); + __ movptr(c_rarg0, src); + __ movptr(c_rarg1, dst); + __ movptr(c_rarg2, count); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_array_copy_pre_call), 3); + __ popa(); + __ bind(done); + } +} + +#undef __ + +#define __ sasm-> + +void MMTkSATBBarrierSetAssembler::generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const { + __ prologue("mmtk_satb_barrier", false); + + Label done, runtime; + + __ push(c_rarg0); + __ push(c_rarg1); + __ push(c_rarg2); + __ push(rax); + + __ load_parameter(0, c_rarg0); + __ load_parameter(1, c_rarg1); + __ load_parameter(2, c_rarg2); + + __ bind(runtime); + + __ save_live_registers_no_oop_map(true); + +#if MMTK_ENABLE_BARRIER_FASTPATH + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); +#else + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); +#endif + + __ restore_live_registers(true); + + __ bind(done); + __ pop(rax); + __ pop(c_rarg2); + __ pop(c_rarg1); + __ pop(c_rarg0); + + __ epilogue(); +} + +#undef __ +#define __ ce->masm()-> + +void MMTkSATBBarrierSetAssembler::generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const { + MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); + + // For pre-barriers, stub->slot may not be a resolved address. + // Manually patch the address + address runtime_address; + if (stub->patch_code != lir_patch_none) { + // Patch + assert(stub->scratch->is_single_cpu(), "must be"); + assert(stub->scratch->is_register(), "Precondition."); + ce->mem2reg(stub->slot, stub->scratch, T_OBJECT, stub->patch_code, stub->info, false /*wide*/, false /*unaligned*/); + // Now stub->scratch contains the pre_val instead of the slot address + // So the following is to load the slot address into scrach register + // Resolve address + auto masm = ce->masm(); + LIR_Address* addr = stub->slot->as_address_ptr(); + Address from_addr = ce->as_Address(addr); + __ lea(stub->scratch->as_register(), from_addr); + // Store parameter + ce->store_parameter(stub->scratch->as_pointer_register(), 1); + } else { + // Store parameter + ce->store_parameter(stub->slot->as_pointer_register(), 1); + } + + ce->store_parameter(stub->src->as_pointer_register(), 0); + ce->store_parameter(stub->new_val->as_pointer_register(), 2); + __ call(RuntimeAddress(bs->pre_barrier_c1_runtime_code_blob()->code_begin())); + __ jmp(*stub->continuation()); +} + +#undef __ + +#ifdef ASSERT +#define __ gen->lir(__FILE__, __LINE__)-> +#else +#define __ gen->lir()-> +#endif + + +void MMTkSATBBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) { + DecoratorSet decorators = access.decorators(); + bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0; + bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0; + bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; + LIRGenerator *gen = access.gen(); + + BarrierSetC1::load_at_resolved(access, result); + +#if SOFT_REFERENCE_LOAD_BARRIER + if (access.is_oop() && (is_weak || is_phantom || is_anonymous)) { + // Register the value in the referent field with the pre-barrier + LabelObj *Lcont_anonymous; + if (is_anonymous) { + Lcont_anonymous = new LabelObj(); + generate_referent_check(access, Lcont_anonymous); + } + assert(result->is_register(), "must be"); + assert(result->type() == T_OBJECT, "must be an object"); + auto slow = new MMTkC1ReferenceLoadBarrierStub(result, access.patch_emit_info()); + // Call slow-path only when concurrent marking is active + LIR_Opr cm_flag_addr_opr = gen->new_pointer_register(); + __ move(LIR_OprFact::longConst(uintptr_t(&CONCURRENT_MARKING_ACTIVE)), cm_flag_addr_opr); + LIR_Address* cm_flag_addr = new LIR_Address(cm_flag_addr_opr, T_BYTE); + LIR_Opr cm_flag = gen->new_register(T_INT); + __ move(cm_flag_addr, cm_flag); + // No slow-call if SATB is not active + __ cmp(lir_cond_equal, cm_flag, LIR_OprFact::intConst(1)); + __ branch(lir_cond_equal, T_BYTE, slow); + __ branch_destination(slow->continuation()); + if (is_anonymous) { + __ branch_destination(Lcont_anonymous->label()); + } + } +#endif +} + +void MMTkSATBBarrierSetC1::object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info) const { + LIRGenerator* gen = access.gen(); + DecoratorSet decorators = access.decorators(); + if ((decorators & IN_HEAP) == 0) return; // Not sure if this line is sound + bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; + if (!src->is_register()) { + LIR_Opr reg = gen->new_pointer_register(); + if (src->is_constant()) { + __ move(src, reg); + } else { + __ leal(src, reg); + } + src = reg; + } + assert(src->is_register(), "must be a register at this point"); + + if (!slot->is_register() && !needs_patching) { + LIR_Address* address = slot->as_address_ptr(); + LIR_Opr ptr = gen->new_pointer_register(); + if (!address->index()->is_valid() && address->disp() == 0) { + __ move(address->base(), ptr); + } else { + assert(address->disp() != max_jint, "lea doesn't support patched addresses!"); + __ leal(slot, ptr); + } + slot = ptr; + } else if (needs_patching && !slot->is_address()) { + assert(slot->is_register(), "must be"); + slot = LIR_OprFact::address(new LIR_Address(slot, T_OBJECT)); + } + assert(needs_patching || slot->is_register(), "must be a register at this point unless needs_patching"); + if (!new_val->is_register()) { + LIR_Opr new_val_reg = gen->new_register(T_OBJECT); + if (new_val->is_constant()) { + __ move(new_val, new_val_reg); + } else { + __ leal(new_val, new_val_reg); + } + new_val = new_val_reg; + } + assert(new_val->is_register(), "must be a register at this point"); + MMTkC1PreBarrierStub* slow = new MMTkC1PreBarrierStub(src, slot, new_val, info, needs_patching ? lir_patch_normal : lir_patch_none); + if (needs_patching) slow->scratch = gen->new_register(T_OBJECT); + +#if MMTK_ENABLE_BARRIER_FASTPATH + if (needs_patching) { + // At this stage, slot address is not available, so cannot do the fast-path check until + // its address get resolved + // FIXME: Jump to a medium-path for code patching without entering slow-path + __ jump(slow); + } else { + // // load pre_val + // LIR_Address* slot_addr = new LIR_Address(slot, T_OBJECT); + // LIR_Opr addr = slot; + // __ load(slot_addr, addr); + // // if pre_val == NULL skip the barrier + // __ cmp(lir_cond_equal, addr, LIR_OprFact::oopConst(NULL)); + // __ branch(lir_cond_equal, T_OBJECT, slow->continuation()); + LIR_Opr addr = src; + // uint8_t* meta_addr = (uint8_t*) (side_metadata_base_address() + (addr >> 6)); + LIR_Opr offset = gen->new_pointer_register(); + __ move(addr, offset); + __ unsigned_shift_right(offset, UseCompressedOops ? 5 : 6, offset); + LIR_Opr base = gen->new_pointer_register(); + __ move(LIR_OprFact::longConst(side_metadata_base_address()), base); + LIR_Address* meta_addr = new LIR_Address(base, offset, T_BYTE); + // uint8_t byte_val = *meta_addr; + LIR_Opr byte_val = gen->new_register(T_INT); + __ move(meta_addr, byte_val); + + // intptr_t shift = (addr >> 3) & 0b111; + LIR_Opr shift = gen->new_register(T_INT); + __ move(addr, shift); + __ unsigned_shift_right(shift, UseCompressedOops ? 2 : 3, shift); + __ logical_and(shift, LIR_OprFact::intConst(0b111), shift); + // if (((byte_val >> shift) & 1) == 1) slow; + LIR_Opr result = byte_val; + __ unsigned_shift_right(result, shift, result, LIR_OprFact::illegalOpr); + __ logical_and(result, LIR_OprFact::intConst(1), result); + __ cmp(lir_cond_equal, result, LIR_OprFact::intConst(1)); + __ branch(lir_cond_equal, T_BYTE, slow); + } +#else + __ jump(slow); +#endif + + __ branch_destination(slow->continuation()); +} + +#undef __ + +#define __ ideal. + +void MMTkSATBBarrierSetC2::object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* pre_val, Node* val) const { + if (can_remove_barrier(kit, &kit->gvn(), src, slot, val, /* skip_const_null */ false)) return; + + MMTkIdealKit ideal(kit, true); + +#if MMTK_ENABLE_BARRIER_FASTPATH + Node* no_base = __ top(); + float unlikely = PROB_UNLIKELY(0.999); + + Node* zero = __ ConI(0); + Node* addr = __ CastPX(__ ctrl(), src); + Node* meta_addr = __ AddP(no_base, __ ConP(side_metadata_base_address()), __ URShiftX(addr, __ ConI(UseCompressedOops ? 5 : 6))); + Node* byte = __ load(__ ctrl(), meta_addr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); + + Node* shift = __ URShiftX(addr, __ ConI(UseCompressedOops ? 2 : 3)); + shift = __ AndI(__ ConvL2I(shift), __ ConI(7)); + Node* result = __ AndI(__ URShiftI(byte, shift), __ ConI(1)); + __ if_then(result, BoolTest::ne, zero, unlikely); { + const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM); + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), "mmtk_barrier_call", src, slot, val); + } __ end_if(); +#else + const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM); + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), "mmtk_barrier_call", src, slot, val); + // Looks like this is necessary + // See https://github.com/mmtk/openjdk/blob/c82e5c44adced4383162826c2c3933a83cfb139b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp#L288-L291 + Node* call = __ ctrl()->in(0); + call->add_req(slot); +#endif + + kit->final_sync(ideal); // Final sync IdealKit and GraphKit. +} + +static void reference_load_barrier(GraphKit* kit, Node* slot, Node* val, bool emit_barrier) { + MMTkIdealKit ideal(kit, true); + Node* no_base = __ top(); + float unlikely = PROB_UNLIKELY(0.999); + Node* zero = __ ConI(0); + Node* cm_flag = __ load(__ ctrl(), __ ConP(uintptr_t(&CONCURRENT_MARKING_ACTIVE)), TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); + // No slow-call if SATB is not active + __ if_then(cm_flag, BoolTest::ne, zero, unlikely); { + // No slow-call if dst is NULL + __ if_then(val, BoolTest::ne, kit->null()); { + const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM); + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::load_reference_call), "mmtk_barrier_call", val); + } __ end_if(); + } __ end_if(); + kit->sync_kit(ideal); + if (emit_barrier) kit->insert_mem_bar(Op_MemBarCPUOrder); + kit->final_sync(ideal); // Final sync IdealKit and GraphKit. +} + +static void reference_load_barrier_for_unknown_load(GraphKit* kit, Node* base_oop, Node* offset, Node* slot, Node* val, bool need_mem_bar) { + // We could be accessing the referent field of a reference object. If so, when G1 + // is enabled, we need to log the value in the referent field in an SATB buffer. + // This routine performs some compile time filters and generates suitable + // runtime filters that guard the pre-barrier code. + // Also add memory barrier for non volatile load from the referent field + // to prevent commoning of loads across safepoint. + + // Some compile time checks. + + // If offset is a constant, is it java_lang_ref_Reference::_reference_offset? + const TypeX* otype = offset->find_intptr_t_type(); + if (otype != NULL && otype->is_con() && + otype->get_con() != java_lang_ref_Reference::referent_offset) { + // Constant offset but not the reference_offset so just return + return; + } + + // We only need to generate the runtime guards for instances. + const TypeOopPtr* btype = base_oop->bottom_type()->isa_oopptr(); + if (btype != NULL) { + if (btype->isa_aryptr()) { + // Array type so nothing to do + return; + } + + const TypeInstPtr* itype = btype->isa_instptr(); + if (itype != NULL) { + // Can the klass of base_oop be statically determined to be + // _not_ a sub-class of Reference and _not_ Object? + ciKlass* klass = itype->klass(); + if ( klass->is_loaded() && + !klass->is_subtype_of(kit->env()->Reference_klass()) && + !kit->env()->Object_klass()->is_subtype_of(klass)) { + return; + } + } + } + + float likely = PROB_LIKELY( 0.999); + float unlikely = PROB_UNLIKELY(0.999); + + IdealKit ideal(kit); + + Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset); + + __ if_then(offset, BoolTest::eq, referent_off, unlikely); { + // Update graphKit memory and control from IdealKit. + kit->sync_kit(ideal); + Node* ref_klass_con = kit->makecon(TypeKlassPtr::make(kit->env()->Reference_klass())); + Node* is_instof = kit->gen_instanceof(base_oop, ref_klass_con); + // Update IdealKit memory and control from graphKit. + __ sync_kit(kit); + Node* one = __ ConI(1); + // is_instof == 0 if base_oop == NULL + __ if_then(is_instof, BoolTest::eq, one, unlikely); { + // Update graphKit from IdeakKit. + kit->sync_kit(ideal); + // Use the pre-barrier to record the value in the referent field + reference_load_barrier(kit, slot, val, false); + if (need_mem_bar) { + // Add memory barrier to prevent commoning reads from this field + // across safepoint since GC can change its value. + kit->insert_mem_bar(Op_MemBarCPUOrder); + } + // Update IdealKit from graphKit. + __ sync_kit(kit); + } __ end_if(); // _ref_type != ref_none + } __ end_if(); // offset == referent_offset + + // Final sync IdealKit and GraphKit. + kit->final_sync(ideal); +} + +Node* MMTkSATBBarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) const { + + DecoratorSet decorators = access.decorators(); + GraphKit* kit = access.kit(); + + Node* adr = access.addr().node(); + Node* obj = access.base(); + + bool mismatched = (decorators & C2_MISMATCHED) != 0; + bool unknown = (decorators & ON_UNKNOWN_OOP_REF) != 0; + bool in_heap = (decorators & IN_HEAP) != 0; + bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0; + bool is_unordered = (decorators & MO_UNORDERED) != 0; + bool need_cpu_mem_bar = !is_unordered || mismatched || !in_heap; + + Node* offset = adr->is_AddP() ? adr->in(AddPNode::Offset) : kit->top(); + Node* load = BarrierSetC2::load_at_resolved(access, val_type); + + // If we are reading the value of the referent field of a Reference + // object (either by using Unsafe directly or through reflection) + // then, if G1 is enabled, we need to record the referent in an + // SATB log buffer using the pre-barrier mechanism. + // Also we need to add memory barrier to prevent commoning reads + // from this field across safepoint since GC can change its value. + bool need_read_barrier = in_heap && (on_weak || (unknown && offset != kit->top() && obj != kit->top())); + + if (!access.is_oop() || !need_read_barrier) { + return load; + } + +#if SOFT_REFERENCE_LOAD_BARRIER + if (on_weak) { + reference_load_barrier(kit, adr, load, true); + } else if (unknown) { + reference_load_barrier_for_unknown_load(kit, obj, offset, adr, load, !need_cpu_mem_bar); + } +#endif + + return load; +} + +void MMTkSATBBarrierSetC2::clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const { + BarrierSetC2::clone(kit, src, dst, size, is_array); +} + + + +#undef __ diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp new file mode 100644 index 00000000..11c59e0c --- /dev/null +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -0,0 +1,86 @@ +#ifndef MMTK_OPENJDK_BARRIERS_MMTK_SATB_BARRIER_HPP +#define MMTK_OPENJDK_BARRIERS_MMTK_SATB_BARRIER_HPP + +#include "../mmtk.h" +#include "../mmtkBarrierSet.hpp" +#include "../mmtkBarrierSetAssembler_x86.hpp" +#include "../mmtkBarrierSetC1.hpp" +#include "../mmtkBarrierSetC2.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "gc/shared/barrierSet.hpp" +#include "opto/callnode.hpp" +#include "opto/idealKit.hpp" + +#define SIDE_METADATA_WORST_CASE_RATIO_LOG 1 +#define LOG_BYTES_IN_CHUNK 22 +#define CHUNK_MASK ((1L << LOG_BYTES_IN_CHUNK) - 1) + +const intptr_t SATB_METADATA_BASE_ADDRESS = (intptr_t) GLOBAL_SIDE_METADATA_VM_BASE_ADDRESS; + +class MMTkSATBBarrierSetRuntime: public MMTkBarrierSetRuntime { +public: + // Interfaces called by `MMTkBarrierSet::AccessBarrier` + virtual void object_reference_write_pre(oop src, oop* slot, oop target) const override; + virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const override { + if (count == 0) return; + ::mmtk_array_copy_pre((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) src, (void*) dst, count); + } + virtual void object_probable_write(oop new_obj) const override; + virtual void load_reference(DecoratorSet decorators, oop value) const override; + virtual void clone_pre(DecoratorSet decorators, oop value) const override { + }; +}; + +class MMTkSATBBarrierSetAssembler: public MMTkBarrierSetAssembler { +protected: + virtual void object_reference_write_pre(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2) const override; + /// Generate C1 write barrier slow-call assembly code + virtual void generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const; +public: + virtual void generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const; + virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; + virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp_thread) override; +}; + +class MMTkSATBBarrierSetC1: public MMTkBarrierSetC1 { +protected: + virtual void object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info) const override; + + virtual void load_at_resolved(LIRAccess& access, LIR_Opr result) override; + + virtual LIR_Opr resolve_address(LIRAccess& access, bool resolve_in_register) override { + return MMTkBarrierSetC1::resolve_address_in_register(access, resolve_in_register); + } +}; + +class MMTkSATBBarrierSetC2: public MMTkBarrierSetC2 { +protected: + virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* pre_val, Node* val) const override; + +public: + virtual bool array_copy_requires_gc_barriers(BasicType type) const override { + return false; + } + virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const override; + virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const override; + + virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const { + Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type); + if (access.is_oop()) { + object_reference_write_pre(access.kit(), access.base(), access.addr().node(), result, new_val); + object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); + } + return result; + } + +}; + +struct MMTkSATBBarrier: MMTkBarrierImpl< + MMTkSATBBarrierSetRuntime, + MMTkSATBBarrierSetAssembler, + MMTkSATBBarrierSetC1, + MMTkSATBBarrierSetC2 +> {}; + +#endif // MMTK_OPENJDK_BARRIERS_MMTK_OBJECT_BARRIER_HPP diff --git a/openjdk/mmtk.h b/openjdk/mmtk.h index 89930abd..98bbffba 100644 --- a/openjdk/mmtk.h +++ b/openjdk/mmtk.h @@ -23,6 +23,7 @@ extern const uintptr_t GLOBAL_SIDE_METADATA_VM_BASE_ADDRESS; extern const uintptr_t VO_BIT_ADDRESS; extern const size_t MMTK_MARK_COMPACT_HEADER_RESERVED_IN_BYTES; extern const uintptr_t FREE_LIST_ALLOCATOR_SIZE; +extern uint8_t CONCURRENT_MARKING_ACTIVE; extern const char* get_mmtk_version(); @@ -46,6 +47,9 @@ extern void* alloc_slow_largeobject(MMTk_Mutator mutator, size_t size, extern void post_alloc(MMTk_Mutator mutator, void* refer, size_t bytes, int allocator); +/// java.lang.Reference load barrier +extern void mmtk_load_reference(MMTk_Mutator mutator, void* obj); + /// Full pre-barrier extern void mmtk_object_reference_write_pre(MMTk_Mutator mutator, void* src, void* slot, void* target); @@ -61,6 +65,8 @@ extern void mmtk_array_copy_pre(MMTk_Mutator mutator, void* src, void* dst, size /// Full array-copy post-barrier extern void mmtk_array_copy_post(MMTk_Mutator mutator, void* src, void* dst, size_t count); +extern void mmtk_object_reference_clone_pre(MMTk_Mutator mutator, void* obj); + /// C2 slowpath allocation barrier extern void mmtk_object_probable_write(MMTk_Mutator mutator, void* obj); diff --git a/openjdk/mmtkBarrierSet.cpp b/openjdk/mmtkBarrierSet.cpp index 178b7011..95452d13 100644 --- a/openjdk/mmtkBarrierSet.cpp +++ b/openjdk/mmtkBarrierSet.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "barriers/mmtkNoBarrier.hpp" #include "barriers/mmtkObjectBarrier.hpp" +#include "barriers/mmtkSATBBarrier.hpp" #include "mmtkBarrierSet.hpp" #include "mmtkBarrierSetAssembler_x86.hpp" #include "runtime/interfaceSupport.inline.hpp" @@ -79,6 +80,7 @@ MMTkBarrierBase* get_selected_barrier() { const char* barrier = mmtk_active_barrier(); if (strcmp(barrier, "NoBarrier") == 0) selected_barrier = new MMTkNoBarrier(); else if (strcmp(barrier, "ObjectBarrier") == 0) selected_barrier = new MMTkObjectBarrier(); + else if (strcmp(barrier, "SATBBarrier") == 0) selected_barrier = new MMTkSATBBarrier(); else guarantee(false, "Unimplemented"); return selected_barrier; } @@ -151,3 +153,11 @@ void MMTkBarrierSetRuntime::object_reference_array_copy_pre_call(void* src, void void MMTkBarrierSetRuntime::object_reference_array_copy_post_call(void* src, void* dst, size_t count) { ::mmtk_array_copy_post((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, src, dst, count); } + +void MMTkBarrierSetRuntime::load_reference_call(void* ref) { + ::mmtk_load_reference((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, ref); +} + +void MMTkBarrierSetRuntime::object_reference_clone_pre_call(void* ref) { + ::mmtk_object_reference_clone_pre((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, ref); +} \ No newline at end of file diff --git a/openjdk/mmtkBarrierSet.hpp b/openjdk/mmtkBarrierSet.hpp index 07990706..9154e811 100644 --- a/openjdk/mmtkBarrierSet.hpp +++ b/openjdk/mmtkBarrierSet.hpp @@ -60,6 +60,8 @@ MMTkAllocatorOffsets get_tlab_top_and_end_offsets(AllocatorSelector selector); class MMTkBarrierSetRuntime: public CHeapObj { public: + /// Weak ref load barrier + static void load_reference_call(void* ref); /// Generic pre-write barrier. Called by fast-paths. static void object_reference_write_pre_call(void* src, void* slot, void* target); /// Generic post-write barrier. Called by fast-paths. @@ -70,13 +72,16 @@ class MMTkBarrierSetRuntime: public CHeapObj { static void object_reference_array_copy_pre_call(void* src, void* dst, size_t count); /// Generic arraycopy pre-barrier. Called by fast-paths. static void object_reference_array_copy_post_call(void* src, void* dst, size_t count); + static void object_reference_clone_pre_call(void* obj); /// Check if the address is a slow-path function. virtual bool is_slow_path_call(address call) const { return call == CAST_FROM_FN_PTR(address, object_reference_write_pre_call) || call == CAST_FROM_FN_PTR(address, object_reference_write_post_call) || call == CAST_FROM_FN_PTR(address, object_reference_write_slow_call) || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_pre_call) - || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_post_call); + || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_post_call) + || call == CAST_FROM_FN_PTR(address, load_reference_call) + || call == CAST_FROM_FN_PTR(address, object_reference_clone_pre_call); } /// Full pre-barrier @@ -87,6 +92,10 @@ class MMTkBarrierSetRuntime: public CHeapObj { virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const {}; /// Full arraycopy post-barrier virtual void object_reference_array_copy_post(oop* src, oop* dst, size_t count) const {}; + /// java.lang.Reference load barrier + virtual void load_reference(DecoratorSet decorators, oop value) const {}; + /// Object clone pre-barrier + virtual void clone_pre(DecoratorSet decorators, oop value) const {}; /// Called at the end of every C2 slowpath allocation. /// Deoptimization can happen after C2 slowpath allocation, and the newly allocated object can be promoted. /// So this callback is requierd for any generational collectors. @@ -173,6 +182,37 @@ class MMTkBarrierSet : public BarrierSet { private: typedef BarrierSet::AccessBarrier Raw; public: + // Needed for weak references + static oop oop_load_in_heap_at(oop base, ptrdiff_t offset) { + oop value = Raw::oop_load_in_heap_at(base, offset); + const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0; + const bool peek = (decorators & AS_NO_KEEPALIVE) != 0; + const bool needs_enqueue = (!peek && !on_strong_oop_ref); + if (needs_enqueue && value != NULL) { + runtime()->load_reference(decorators, value); + } + return value; + } + + template + static oop oop_load_not_in_heap(T* addr) { + oop value = Raw::template oop_load(addr); + const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0; + const bool peek = (decorators & AS_NO_KEEPALIVE) != 0; + const bool needs_enqueue = (!peek && !on_strong_oop_ref); + if (needs_enqueue && value != NULL) { + runtime()->load_reference(decorators, value); + } + return value; + } + + // Defensive: will catch weak oops at addresses in heap + template + static oop oop_load_in_heap(T* addr) { + UNREACHABLE(); + return NULL; + } + template static void oop_store_in_heap(T* addr, oop value) { UNREACHABLE(); diff --git a/openjdk/mmtkBarrierSetAssembler_x86.cpp b/openjdk/mmtkBarrierSetAssembler_x86.cpp index dc59274e..167fbcc7 100644 --- a/openjdk/mmtkBarrierSetAssembler_x86.cpp +++ b/openjdk/mmtkBarrierSetAssembler_x86.cpp @@ -144,38 +144,28 @@ void MMTkBarrierSetAssembler::eden_allocate(MacroAssembler* masm, Register threa #define __ sasm-> -void MMTkBarrierSetAssembler::generate_c1_write_barrier_runtime_stub(StubAssembler* sasm) const { - __ prologue("mmtk_write_barrier", false); +void MMTkBarrierSetAssembler::generate_c1_ref_load_barrier_runtime_stub(StubAssembler* sasm) const { + __ prologue("mmtk_ref_load_barrier", false); - Address store_addr(rbp, 4*BytesPerWord); + // Address store_addr(rbp, 2*BytesPerWord); Label done, runtime; __ push(c_rarg0); - __ push(c_rarg1); - __ push(c_rarg2); __ push(rax); __ load_parameter(0, c_rarg0); - __ load_parameter(1, c_rarg1); - __ load_parameter(2, c_rarg2); __ bind(runtime); __ save_live_registers_no_oop_map(true); -#if MMTK_ENABLE_BARRIER_FASTPATH - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); -#else - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), 3); -#endif + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::load_reference_call), 1); __ restore_live_registers(true); __ bind(done); __ pop(rax); - __ pop(c_rarg2); - __ pop(c_rarg1); __ pop(c_rarg0); __ epilogue(); @@ -185,13 +175,18 @@ void MMTkBarrierSetAssembler::generate_c1_write_barrier_runtime_stub(StubAssembl #define __ ce->masm()-> -void MMTkBarrierSetAssembler::generate_c1_write_barrier_stub_call(LIR_Assembler* ce, MMTkC1BarrierStub* stub) { - MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*) BarrierSet::barrier_set()->barrier_set_c1(); +void MMTkBarrierSetAssembler::generate_c1_ref_load_barrier_stub_call(LIR_Assembler* ce, MMTkC1ReferenceLoadBarrierStub* stub) { + MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1(); + __ bind(*stub->entry()); - ce->store_parameter(stub->src->as_pointer_register(), 0); - ce->store_parameter(stub->slot->as_pointer_register(), 1); - ce->store_parameter(stub->new_val->as_pointer_register(), 2); - __ call(RuntimeAddress(bs->_write_barrier_c1_runtime_code_blob->code_begin())); + assert(stub->val->is_register(), "Precondition."); + + Register val_reg = stub->val->as_register(); + + __ cmpptr(val_reg, (int32_t) NULL_WORD); + __ jcc(Assembler::equal, *stub->continuation()); + ce->store_parameter(stub->val->as_register(), 0); + __ call(RuntimeAddress(bs->_ref_load_barrier_c1_runtime_code_blob->code_begin())); __ jmp(*stub->continuation()); } diff --git a/openjdk/mmtkBarrierSetAssembler_x86.hpp b/openjdk/mmtkBarrierSetAssembler_x86.hpp index 383b688f..e8c5c8b6 100644 --- a/openjdk/mmtkBarrierSetAssembler_x86.hpp +++ b/openjdk/mmtkBarrierSetAssembler_x86.hpp @@ -5,7 +5,9 @@ #include "gc/shared/barrierSetAssembler.hpp" class MMTkBarrierSetC1; -class MMTkC1BarrierStub; +class MMTkC1PreBarrierStub; +class MMTkC1PostBarrierStub; +class MMTkC1ReferenceLoadBarrierStub; class LIR_Assembler; class StubAssembler; @@ -27,8 +29,11 @@ class MMTkBarrierSetAssembler: public BarrierSetAssembler { return !in_heap || (skip_const_null && val == noreg); } - /// Generate C1 write barrier slow-call assembly code - virtual void generate_c1_write_barrier_runtime_stub(StubAssembler* sasm) const; + /// Generate C1 pre write barrier slow-call assembly code + virtual void generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const {}; + /// Generate C1 post write barrier slow-call assembly code + virtual void generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const {}; + virtual void generate_c1_ref_load_barrier_runtime_stub(StubAssembler* sasm) const; public: virtual void eden_allocate(MacroAssembler* masm, Register thread, Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Label& slow_case) override; @@ -41,6 +46,8 @@ class MMTkBarrierSetAssembler: public BarrierSetAssembler { } /// Generate C1 write barrier slow-call stub - static void generate_c1_write_barrier_stub_call(LIR_Assembler* ce, MMTkC1BarrierStub* stub); + virtual void generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const {}; + virtual void generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const {}; + static void generate_c1_ref_load_barrier_stub_call(LIR_Assembler* ce, MMTkC1ReferenceLoadBarrierStub* stub); }; #endif // MMTK_OPENJDK_MMTK_BARRIER_SET_ASSEMBLER_X86_HPP diff --git a/openjdk/mmtkBarrierSetC1.cpp b/openjdk/mmtkBarrierSetC1.cpp index b2c9a683..8df47147 100644 --- a/openjdk/mmtkBarrierSetC1.cpp +++ b/openjdk/mmtkBarrierSetC1.cpp @@ -4,18 +4,58 @@ #include "mmtkBarrierSetC1.hpp" void MMTkBarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) { - class MMTkBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + class MMTkPreBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + virtual OopMapSet* generate_code(StubAssembler* sasm) override { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); - bs->generate_c1_write_barrier_runtime_stub(sasm); + bs->generate_c1_pre_write_barrier_runtime_stub(sasm); return NULL; } + public: + MMTkPreBarrierCodeGenClosure() {} }; - MMTkBarrierCodeGenClosure write_code_gen_cl; - _write_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "write_code_gen_cl", false, &write_code_gen_cl); + + class MMTkPostBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + virtual OopMapSet* generate_code(StubAssembler* sasm) override { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_post_write_barrier_runtime_stub(sasm); + return NULL; + } + public: + MMTkPostBarrierCodeGenClosure() {} + }; + + MMTkPreBarrierCodeGenClosure pre_write_code_gen_cl; + _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "mmtk_pre_write_code_gen_cl", false, &pre_write_code_gen_cl); + MMTkPostBarrierCodeGenClosure post_write_code_gen_cl; + _post_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "mmtk_post_write_code_gen_cl", false, &post_write_code_gen_cl); + // MMTkBarrierCodeGenClosure write_code_gen_cl_patch_fix(true); + // _write_barrier_c1_runtime_code_blob_with_patch_fix = Runtime1::generate_blob(buffer_blob, -1, "write_code_gen_cl_patch_fix", false, &write_code_gen_cl_patch_fix); + +class MMTkRefLoadBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + virtual OopMapSet* generate_code(StubAssembler* sasm) override { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_ref_load_barrier_runtime_stub(sasm); + return NULL; + } + }; + MMTkRefLoadBarrierCodeGenClosure load_code_gen_cl; + _ref_load_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "load_code_gen_cl", false, &load_code_gen_cl); + +} + +void MMTkC1PostBarrierStub::emit_code(LIR_Assembler* ce) { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_post_write_barrier_stub(ce, this); } -void MMTkC1BarrierStub::emit_code(LIR_Assembler* ce) { +void MMTkC1PreBarrierStub::emit_code(LIR_Assembler* ce) { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); - bs->generate_c1_write_barrier_stub_call(ce, this); + bs->generate_c1_pre_write_barrier_stub(ce, this); } + + +void MMTkC1ReferenceLoadBarrierStub::emit_code(LIR_Assembler* ce) { + MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); + bs->generate_c1_ref_load_barrier_stub_call(ce, this); +} \ No newline at end of file diff --git a/openjdk/mmtkBarrierSetC1.hpp b/openjdk/mmtkBarrierSetC1.hpp index dea0712e..487b996c 100644 --- a/openjdk/mmtkBarrierSetC1.hpp +++ b/openjdk/mmtkBarrierSetC1.hpp @@ -10,23 +10,25 @@ class MMTkBarrierSetC1 : public BarrierSetC1 { friend class MMTkBarrierSetAssembler; protected: - CodeBlob* _write_barrier_c1_runtime_code_blob; + CodeBlob* _pre_barrier_c1_runtime_code_blob; + CodeBlob* _post_barrier_c1_runtime_code_blob; + CodeBlob* _ref_load_barrier_c1_runtime_code_blob; /// Full pre-barrier - virtual void object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val) const {} + virtual void object_reference_write_pre(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info) const {} /// Full post-barrier virtual void object_reference_write_post(LIRAccess& access, LIR_Opr src, LIR_Opr slot, LIR_Opr new_val) const {} /// Substituting write barrier virtual void store_at_resolved(LIRAccess& access, LIR_Opr value) override { - if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value); + if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value, access.patch_emit_info()); BarrierSetC1::store_at_resolved(access, value); if (access.is_oop()) object_reference_write_post(access, access.base().opr(), access.resolved_addr(), value); } /// Substituting write barrier (cmpxchg) virtual LIR_Opr atomic_cmpxchg_at_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value) override { - if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), new_value.result()); + if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), new_value.result(), NULL); LIR_Opr result = BarrierSetC1::atomic_cmpxchg_at_resolved(access, cmp_value, new_value); if (access.is_oop()) object_reference_write_post(access, access.base().opr(), access.resolved_addr(), new_value.result()); return result; @@ -34,7 +36,7 @@ class MMTkBarrierSetC1 : public BarrierSetC1 { /// Substituting write barrier (xchg) virtual LIR_Opr atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value) override { - if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value.result()); + if (access.is_oop()) object_reference_write_pre(access, access.base().opr(), access.resolved_addr(), value.result(), NULL); LIR_Opr result = BarrierSetC1::atomic_xchg_at_resolved(access, value); if (access.is_oop()) object_reference_write_post(access, access.base().opr(), access.resolved_addr(), value.result()); return result; @@ -58,30 +60,86 @@ class MMTkBarrierSetC1 : public BarrierSetC1 { public: - MMTkBarrierSetC1() {} + MMTkBarrierSetC1() + : _pre_barrier_c1_runtime_code_blob(NULL), + _post_barrier_c1_runtime_code_blob(NULL) {} + + CodeBlob* pre_barrier_c1_runtime_code_blob() { return _pre_barrier_c1_runtime_code_blob; } + CodeBlob* post_barrier_c1_runtime_code_blob() { return _post_barrier_c1_runtime_code_blob; } /// Generate C1 write barrier slow-call C1-LIR code virtual void generate_c1_runtime_stubs(BufferBlob* buffer_blob) override; }; -/// C1 write barrier slow-call stub. +/// C1 pre write barrier slow-call stub. +/// The default behaviour is to call `MMTkBarrierSetRuntime::object_reference_write_pre_call` and pass all the three args. +/// Barrier implementations may inherit from this class, and override `emit_code` to perform a specialized slow-path call. +struct MMTkC1PreBarrierStub: CodeStub { + LIR_Opr src, slot, new_val; + CodeEmitInfo* info; // Code patching info + LIR_PatchCode patch_code; // Enable code patching? + LIR_Opr scratch = NULL; // Scratch register for the resolved field + +MMTkC1PreBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none): src(src), slot(slot), new_val(new_val), info(info), patch_code(patch_code) {} + + virtual void emit_code(LIR_Assembler* ce) override; + + virtual void visit(LIR_OpVisitState* visitor) override { + if (info != NULL) + visitor->do_slow_case(info); + else + visitor->do_slow_case(); + if (src != NULL) visitor->do_input(src); + if (slot != NULL) visitor->do_input(slot); + if (new_val != NULL) visitor->do_input(new_val); + if (scratch != NULL) { + assert(scratch->is_oop(), "must be"); + visitor->do_temp(scratch); + } + } + + NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1PreBarrierStub"); }); +}; + +/// C1 post write barrier slow-call stub. /// The default behaviour is to call `MMTkBarrierSetRuntime::object_reference_write_post_call` and pass all the three args. /// Barrier implementations may inherit from this class, and override `emit_code` to perform a specialized slow-path call. -struct MMTkC1BarrierStub: CodeStub { +struct MMTkC1PostBarrierStub: CodeStub { LIR_Opr src, slot, new_val; - MMTkC1BarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val): src(src), slot(slot), new_val(new_val) {} +MMTkC1PostBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val): src(src), slot(slot), new_val(new_val) {} virtual void emit_code(LIR_Assembler* ce) override; virtual void visit(LIR_OpVisitState* visitor) override { + visitor->do_slow_case(); if (src != NULL) visitor->do_input(src); if (slot != NULL) visitor->do_input(slot); if (new_val != NULL) visitor->do_input(new_val); + + } + + NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1PostBarrierStub"); }); +}; + +struct MMTkC1ReferenceLoadBarrierStub: CodeStub { + LIR_Opr val; + CodeEmitInfo* info; // Code patching info + + MMTkC1ReferenceLoadBarrierStub(LIR_Opr val, CodeEmitInfo* info = NULL): val(val), info(info) {} + + virtual void emit_code(LIR_Assembler* ce) override; + + virtual void visit(LIR_OpVisitState* visitor) override { + if (info != NULL) + visitor->do_slow_case(info); + else + visitor->do_slow_case(); + if (val != NULL) visitor->do_input(val); } - NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1BarrierStub"); }); + NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1ReferenceLoadBarrierStub"); }); }; #endif // MMTK_OPENJDK_MMTK_BARRIER_SET_C1_HPP diff --git a/openjdk/mmtkBarrierSetC2.hpp b/openjdk/mmtkBarrierSetC2.hpp index d8052d9a..2755f672 100644 --- a/openjdk/mmtkBarrierSetC2.hpp +++ b/openjdk/mmtkBarrierSetC2.hpp @@ -49,30 +49,35 @@ class MMTkBarrierSetC2: public BarrierSetC2 { /// Barrier elision test virtual bool can_remove_barrier(GraphKit* kit, PhaseTransform* phase, Node* src, Node* slot, Node* val, bool skip_const_null) const; /// Full pre-barrier - virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* val) const {} + virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* pre_val, Node* val) const {} /// Full post-barrier virtual void object_reference_write_post(GraphKit* kit, Node* src, Node* slot, Node* val) const {} virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const { - if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), val.node()); + if (access.is_oop()) { + IdealKit ideal(access.kit(), true); + uint alias_idx = access.kit()->C->get_alias_index(access.addr().type()); + Node* pre_val = ideal.load(ideal.ctrl(), access.addr().node(), static_cast(val.type()), access.type(), alias_idx); + object_reference_write_pre(access.kit(), access.base(), access.addr().node(), pre_val, val.node()); + } Node* store = BarrierSetC2::store_at_resolved(access, val); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), val.node()); return store; } virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access, Node* expected_val, Node* new_val, const Type* value_type) const { - if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); + if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), expected_val, new_val); Node* result = BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); return result; } virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val, Node* new_val, const Type* value_type) const { - if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); + if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), expected_val, new_val); Node* load_store = BarrierSetC2::atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); return load_store; } virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const { - if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); + if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), NULL, new_val); Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); return result; From b6a589f21d4179a4bfc60d73f937292217ff2ff0 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 29 Jul 2025 04:32:14 +0000 Subject: [PATCH 02/42] Update mmtk-core dep, add tests --- .github/configs/base.yml | 1 + .github/scripts/ci-expected-results.yml | 37 +++++++++++++++++++++++++ .github/scripts/ci-test-minimal.sh | 1 + mmtk/Cargo.lock | 4 +-- mmtk/Cargo.toml | 2 +- 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/configs/base.yml b/.github/configs/base.yml index 505202f5..b20551f0 100644 --- a/.github/configs/base.yml +++ b/.github/configs/base.yml @@ -102,6 +102,7 @@ configs: # TODO: We need to disable compressed oops for Compressor temporarily until it supports # discontiguous spaces. - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-Compressor" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix" benchmarks: dacapo-23.9-RC3-chopin-ci: diff --git a/.github/scripts/ci-expected-results.yml b/.github/scripts/ci-expected-results.yml index 1bbcc3e8..b91a7f56 100644 --- a/.github/scripts/ci-expected-results.yml +++ b/.github/scripts/ci-expected-results.yml @@ -10,6 +10,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass batik: SemiSpace: pass GenCopy: pass @@ -19,6 +20,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass biojava: SemiSpace: pass GenCopy: pass @@ -28,6 +30,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass cassandra: SemiSpace: pass GenCopy: pass @@ -37,6 +40,7 @@ results: MarkSweep: ignore MarkCompact: ignore Compressor: ignore + ConcurrentImmix: ignore eclipse: SemiSpace: pass GenCopy: pass @@ -46,6 +50,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass fop: SemiSpace: pass GenCopy: pass @@ -55,6 +60,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass graphchi: SemiSpace: pass GenCopy: pass @@ -64,6 +70,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2: SemiSpace: pass GenCopy: pass @@ -73,6 +80,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2o: SemiSpace: pass GenCopy: pass @@ -82,6 +90,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jme: SemiSpace: pass GenCopy: pass @@ -91,6 +100,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jython: SemiSpace: pass GenCopy: pass @@ -100,6 +110,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass kafka: SemiSpace: pass GenCopy: pass @@ -109,6 +120,7 @@ results: MarkSweep: pass MarkCompact: ignore Compressor: pass + ConcurrentImmix: pass luindex: SemiSpace: pass GenCopy: pass @@ -118,6 +130,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass lusearch: SemiSpace: pass GenCopy: pass @@ -127,6 +140,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass pmd: SemiSpace: pass GenCopy: pass @@ -136,6 +150,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass sunflow: SemiSpace: pass GenCopy: pass @@ -145,6 +160,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass tomcat: SemiSpace: pass GenCopy: pass @@ -154,6 +170,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass xalan: SemiSpace: pass GenCopy: pass @@ -172,6 +189,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass release: avrora: @@ -183,6 +201,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass batik: SemiSpace: pass GenCopy: pass @@ -192,6 +211,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass biojava: SemiSpace: pass GenCopy: pass @@ -201,6 +221,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass cassandra: SemiSpace: pass GenCopy: pass @@ -210,6 +231,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass eclipse: SemiSpace: pass GenCopy: pass @@ -219,6 +241,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass fop: SemiSpace: pass GenCopy: pass @@ -228,6 +251,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass graphchi: SemiSpace: pass GenCopy: pass @@ -237,6 +261,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2: SemiSpace: pass GenCopy: pass @@ -246,6 +271,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass h2o: SemiSpace: pass GenCopy: pass @@ -255,6 +281,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jme: SemiSpace: pass GenCopy: pass @@ -264,6 +291,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass jython: SemiSpace: pass GenCopy: pass @@ -273,6 +301,7 @@ results: MarkSweep: ignore MarkCompact: pass Compressor: pass + ConcurrentImmix: pass kafka: SemiSpace: pass GenCopy: pass @@ -282,6 +311,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass luindex: SemiSpace: pass GenCopy: pass @@ -291,6 +321,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass lusearch: SemiSpace: pass GenCopy: pass @@ -300,6 +331,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass pmd: SemiSpace: pass GenCopy: pass @@ -309,6 +341,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass sunflow: SemiSpace: pass GenCopy: pass @@ -318,6 +351,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass tomcat: SemiSpace: pass GenCopy: pass @@ -327,6 +361,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass xalan: SemiSpace: ignore GenCopy: ignore @@ -336,6 +371,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass zxing: SemiSpace: pass GenCopy: pass @@ -345,3 +381,4 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass diff --git a/.github/scripts/ci-test-minimal.sh b/.github/scripts/ci-test-minimal.sh index f0a74ad9..e2d9aa5a 100755 --- a/.github/scripts/ci-test-minimal.sh +++ b/.github/scripts/ci-test-minimal.sh @@ -26,6 +26,7 @@ MMTK_PLAN=MarkCompact runbms_dacapo2006_with_heap_multiplier fop 4 # TODO: Need to temporarily disable compressed oops for the Compressor until it supports # discontiguous spaces. MMTK_PLAN=Compressor runbms_dacapo2006_with_heap_multiplier fop 4 -XX:-UseCompressedOops -XX:-UseCompressedClassPointers +MMTK_PLAN=ConcurrentImmix runbms_dacapo2006_with_heap_multiplier fop 4 MMTK_PLAN=MarkSweep runbms_dacapo2006_with_heap_multiplier fop 8 MMTK_PLAN=NoGC runbms_dacapo2006_with_heap_size fop 1000 1000 # Test heap resizing diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index fe214905..7efbb743 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=d93262b4397df4866a64a1d268689ae20f208713#d93262b4397df4866a64a1d268689ae20f208713" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=100c04969bb6241339eaa45eba0e9b9ba219ebb3#100c04969bb6241339eaa45eba0e9b9ba219ebb3" dependencies = [ "atomic", "atomic-traits", @@ -497,7 +497,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=d93262b4397df4866a64a1d268689ae20f208713#d93262b4397df4866a64a1d268689ae20f208713" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=100c04969bb6241339eaa45eba0e9b9ba219ebb3#100c04969bb6241339eaa45eba0e9b9ba219ebb3" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 9b92fa77..0de325fc 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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 = "d93262b4397df4866a64a1d268689ae20f208713" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "100c04969bb6241339eaa45eba0e9b9ba219ebb3" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 22fbc69620530c3681e7b383f4e3d581210128cd Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 29 Jul 2025 05:25:42 +0000 Subject: [PATCH 03/42] Run ConcurrentImmix without compressed pointer. --- .github/configs/base.yml | 2 +- .github/scripts/ci-expected-results.yml | 1 + .github/scripts/ci-test-minimal.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/configs/base.yml b/.github/configs/base.yml index b20551f0..8adf6d10 100644 --- a/.github/configs/base.yml +++ b/.github/configs/base.yml @@ -102,7 +102,7 @@ configs: # TODO: We need to disable compressed oops for Compressor temporarily until it supports # discontiguous spaces. - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-Compressor" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-ConcurrentImmix" benchmarks: dacapo-23.9-RC3-chopin-ci: diff --git a/.github/scripts/ci-expected-results.yml b/.github/scripts/ci-expected-results.yml index b91a7f56..4d07d89d 100644 --- a/.github/scripts/ci-expected-results.yml +++ b/.github/scripts/ci-expected-results.yml @@ -180,6 +180,7 @@ results: MarkSweep: pass MarkCompact: pass Compressor: pass + ConcurrentImmix: pass zxing: SemiSpace: pass GenCopy: pass diff --git a/.github/scripts/ci-test-minimal.sh b/.github/scripts/ci-test-minimal.sh index e2d9aa5a..e1c50ef7 100755 --- a/.github/scripts/ci-test-minimal.sh +++ b/.github/scripts/ci-test-minimal.sh @@ -26,7 +26,7 @@ MMTK_PLAN=MarkCompact runbms_dacapo2006_with_heap_multiplier fop 4 # TODO: Need to temporarily disable compressed oops for the Compressor until it supports # discontiguous spaces. MMTK_PLAN=Compressor runbms_dacapo2006_with_heap_multiplier fop 4 -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -MMTK_PLAN=ConcurrentImmix runbms_dacapo2006_with_heap_multiplier fop 4 +MMTK_PLAN=ConcurrentImmix runbms_dacapo2006_with_heap_multiplier fop 4 -XX:-UseCompressedOops -XX:-UseCompressedClassPointers MMTK_PLAN=MarkSweep runbms_dacapo2006_with_heap_multiplier fop 8 MMTK_PLAN=NoGC runbms_dacapo2006_with_heap_size fop 1000 1000 # Test heap resizing From 5018b70a10f1d256591355a71e4def2186e5f5c7 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 30 Jul 2025 04:49:41 +0000 Subject: [PATCH 04/42] Run ConcurrentImmix with larger heap --- .github/configs/base.yml | 17 +- .github/configs/large-heap.yml | 9 + .github/configs/normal-heap.yml | 18 ++ .github/scripts/ci-matrix-result-check.py | 10 +- .github/workflows/run-dacapo-chopin-inner.yml | 161 ++++++++++++++++++ .github/workflows/run-dacapo-chopin.yml | 155 ++--------------- 6 files changed, 204 insertions(+), 166 deletions(-) create mode 100644 .github/configs/large-heap.yml create mode 100644 .github/configs/normal-heap.yml create mode 100644 .github/workflows/run-dacapo-chopin-inner.yml diff --git a/.github/configs/base.yml b/.github/configs/base.yml index 8adf6d10..d420cd31 100644 --- a/.github/configs/base.yml +++ b/.github/configs/base.yml @@ -6,6 +6,7 @@ suites: type: DaCapo # Need running-ng to support 23.9 release: evaluation + # This is expanded in CI when we run with the config. path: "DACAPO_PATH/dacapo-23.9-RC3-chopin.jar" minheap: mmtk-openjdk-11-MarkCompact # Min heap values are from dacapo-evaluation-git-04132797 @@ -90,19 +91,3 @@ runtimes: type: OpenJDK release: 11 home: "/home/runner/work/mmtk-openjdk/mmtk-openjdk/bundles/jdk" - -configs: - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-SemiSpace" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenCopy" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-Immix" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenImmix" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-StickyImmix" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkSweep" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkCompact" - # TODO: We need to disable compressed oops for Compressor temporarily until it supports - # discontiguous spaces. - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-Compressor" - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-ConcurrentImmix" - -benchmarks: - dacapo-23.9-RC3-chopin-ci: diff --git a/.github/configs/large-heap.yml b/.github/configs/large-heap.yml new file mode 100644 index 00000000..d5ac4b73 --- /dev/null +++ b/.github/configs/large-heap.yml @@ -0,0 +1,9 @@ +includes: + - "./base.yml" + +configs: + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-ConcurrentImmix" + +# This will be expanded in CI when we run with the config. Keep a new line at the end. +benchmarks: + dacapo-23.9-RC3-chopin-ci: diff --git a/.github/configs/normal-heap.yml b/.github/configs/normal-heap.yml new file mode 100644 index 00000000..7a61e313 --- /dev/null +++ b/.github/configs/normal-heap.yml @@ -0,0 +1,18 @@ +includes: + - "./base.yml" + +configs: + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-SemiSpace" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenCopy" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-Immix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-GenImmix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-StickyImmix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkSweep" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkCompact" + # TODO: We need to disable compressed oops for Compressor temporarily until it supports + # discontiguous spaces. + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-Compressor" + +# This will be expanded in CI when we run with the config. Keep a new line at the end. +benchmarks: + dacapo-23.9-RC3-chopin-ci: diff --git a/.github/scripts/ci-matrix-result-check.py b/.github/scripts/ci-matrix-result-check.py index aa5856af..b5664a87 100644 --- a/.github/scripts/ci-matrix-result-check.py +++ b/.github/scripts/ci-matrix-result-check.py @@ -3,19 +3,19 @@ import os import re -if len(sys.argv) < 5: +if len(sys.argv) < 6: raise ValueError("Invalid arguments") -script_dir = os.path.dirname(os.path.abspath(__file__)); -config_path = os.path.join(script_dir, "..", "configs", "base.yml") +script_dir = os.path.dirname(os.path.abspath(__file__)) expected_results_path = os.path.join(script_dir, "ci-expected-results.yml") arch = sys.argv[1] build = sys.argv[2] benchmark = sys.argv[3] log_dir = sys.argv[4] +config_file = sys.argv[5] -def read_in_plans(): +def read_in_plans(config_path): # Load the YAML file with open(config_path, "r") as f: data = yaml.safe_load(f) @@ -119,7 +119,7 @@ def print_log(directory, search_string): print(f"----------------------------------------------") # dict['a'] = 'SemiSpace', etc -plan_dict = read_in_plans() +plan_dict = read_in_plans(config_file) actual = read_in_actual_results(sys.stdin.readline(), plan_dict) expected = read_in_expected_results(build, benchmark) diff --git a/.github/workflows/run-dacapo-chopin-inner.yml b/.github/workflows/run-dacapo-chopin-inner.yml new file mode 100644 index 00000000..78850ef0 --- /dev/null +++ b/.github/workflows/run-dacapo-chopin-inner.yml @@ -0,0 +1,161 @@ +name: "Test Normal Build" + +on: + workflow_call: + inputs: + config-file: + description: 'Config file name' + required: true + type: string + heap-factor: + description: 'Heap factor' + required: true + type: string + +env: + DACAPO_VERSION: dacapo-23.9-RC3-chopin + DACAPO_FILE: dacapo-23.9-RC3-chopin.zip + DACAPO_DOWNLOAD_URL: https://download.dacapobench.org/chopin/dacapo-23.9-RC3-chopin.zip + +jobs: + cache-dacapo: + runs-on: ubuntu-22.04 + steps: + - name: Check ${{ env.DACAPO_VERSION }} cache + id: check-cache + uses: actions/cache@v3 + with: + path: dacapo/${{ env.DACAPO_FILE }} + key: ${{ env.DACAPO_VERSION }} + lookup-only: true + - name: Install ${{ env.DACAPO_VERSION }} + if: steps.check-cache.outputs.cache-hit != 'true' + run: | + mkdir -p dacapo + pushd dacapo + wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} + popd + + test-normal-build: + needs: + - cache-dacapo + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + debug-level: ["fastdebug", "release"] + benchmark: + - avrora + - batik + - biojava + - cassandra + - eclipse + - fop + - graphchi + - h2 + - h2o + - jme + - jython + - kafka + - luindex + - lusearch + - pmd + # spring + - sunflow + - tomcat + # tradebeans + # tradesoap + - xalan + - zxing + steps: + - name: Check free space + run: df -h + - name: Maximize build space + uses: easimon/maximize-build-space@master + with: + remove-dotnet: true + remove-android: true + remove-haskell: true + remove-codeql: true + remove-docker-images: true + # Leave some room for the runner for logging in /dev/root + root-reserve-mb: 6000 + temp-reserve-mb: 1024 + - name: Check free space + run: df -h + - name: Checkout MMTk OpenJDK binding + uses: actions/checkout@v4 + - name: Setup environment + run: | + pip3 install running-ng + sudo apt-get update -y + sudo apt-get install -y build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev libxrandr-dev + - name: Check free space and runner log path + run: | + df -h + df . -h + # FIXME: Commenting because GitHub has changed location the home directory + # df /home/runner/runners + - name: Fetch ${{ env.DACAPO_VERSION }} cache + id: fetch-cache + uses: actions/cache@v3 + with: + path: dacapo/${{ env.DACAPO_FILE }} + key: ${{ env.DACAPO_VERSION }} + # fail-on-cache-miss: true # We should never have a cache miss here as we cache DaCapo in an earlier job + # Temporarily change this to false in case the cache download gets + # stuck -- if the cache download is stuck then we go straight to + # upstream and fetch the zip file + fail-on-cache-miss: false + - name: Install ${{ env.DACAPO_VERSION }} + if: steps.fetch-cache.outputs.cache-hit != 'true' + run: | + mkdir -p dacapo + pushd dacapo + wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} + popd + - name: Unzip ${{ env.DACAPO_VERSION }} + run: | + pushd dacapo + unzip ${{ env.DACAPO_FILE }} + rm ${{ env.DACAPO_FILE }} + popd + - name: Check free space + run: df -h + - name: Download bundles + uses: actions/download-artifact@v4 + with: + name: linux-x86_64-server-${{ matrix.debug-level }}-bundles-normal + path: bundles + - name: Extract OpenJDK + run: | + pushd bundles + tar xvf *.tar.gz + BIN_DIR=`find . -name bin` + mv `dirname $BIN_DIR` jdk + popd + - name: Check free space + run: df -h + - name: Run ${{ env.DACAPO_VERSION }} ${{ matrix.benchmark }} on MMTk OpenJDK ${{ matrix.debug-level }} with ${{ inputs.heap-factor }}x MarkCompact minheap + run: | + DACAPO_PATH=`realpath ./dacapo` + sed -i "s;DACAPO_PATH;$DACAPO_PATH;g" .github/configs/base.yml + echo " - ${{ matrix.benchmark }}" >> .github/configs/${{ inputs.config-file }} + set -o pipefail + running runbms /tmp .github/configs/${{ inputs.config-file }} -s ${{ inputs.heap-factor }} -p linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} | tee /tmp/running.stdout + - name: Extract running run id + id: extract-running-run-id + run: | + RUN_ID=`sed -n 's/^Run id:.\(.*\)$/\1/p' < /tmp/running.stdout` + echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT + - name: Upload running artifacts + uses: actions/upload-artifact@v4 + with: + name: linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} + path: /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ + - name: Check for test failures + run: | + RUNNING_OUTPUT=`sed -n "s/^\(${{ matrix.benchmark }} .*\)$/\1/p" < /tmp/running.stdout` + echo $RUNNING_OUTPUT + pip3 install pyyaml + echo $RUNNING_OUTPUT | python3 .github/scripts/ci-matrix-result-check.py linux-x64 ${{ matrix.debug-level }} ${{ matrix.benchmark }} /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ .github/configs/${{ inputs.config-file}} diff --git a/.github/workflows/run-dacapo-chopin.yml b/.github/workflows/run-dacapo-chopin.yml index e7615dd8..49a89854 100644 --- a/.github/workflows/run-dacapo-chopin.yml +++ b/.github/workflows/run-dacapo-chopin.yml @@ -3,150 +3,15 @@ name: "Test with DaCapo Chopin" on: workflow_call: -env: - DACAPO_VERSION: dacapo-23.9-RC3-chopin - DACAPO_FILE: dacapo-23.9-RC3-chopin.zip - DACAPO_DOWNLOAD_URL: https://download.dacapobench.org/chopin/dacapo-23.9-RC3-chopin.zip - jobs: - cache-dacapo: - runs-on: ubuntu-22.04 - steps: - - name: Check ${{ env.DACAPO_VERSION }} cache - id: check-cache - uses: actions/cache@v3 - with: - path: dacapo/${{ env.DACAPO_FILE }} - key: ${{ env.DACAPO_VERSION }} - lookup-only: true - - name: Install ${{ env.DACAPO_VERSION }} - if: steps.check-cache.outputs.cache-hit != 'true' - run: | - mkdir -p dacapo - pushd dacapo - wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} - popd + heap-2500: + uses: ./.github/workflows/run-dacapo-chopin-inner.yml + with: + config-file: "normal-heap.yml" + heap-factor: "2.5" - test-normal-build: - needs: - - cache-dacapo - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - debug-level: ["fastdebug", "release"] - benchmark: - - avrora - - batik - - biojava - - cassandra - - eclipse - - fop - - graphchi - - h2 - - h2o - - jme - - jython - - kafka - - luindex - - lusearch - - pmd - # spring - - sunflow - - tomcat - # tradebeans - # tradesoap - - xalan - - zxing - steps: - - name: Check free space - run: df -h - - name: Maximize build space - uses: easimon/maximize-build-space@master - with: - remove-dotnet: true - remove-android: true - remove-haskell: true - remove-codeql: true - remove-docker-images: true - # Leave some room for the runner for logging in /dev/root - root-reserve-mb: 6000 - temp-reserve-mb: 1024 - - name: Check free space - run: df -h - - name: Checkout MMTk OpenJDK binding - uses: actions/checkout@v4 - - name: Setup environment - run: | - pip3 install running-ng - sudo apt-get update -y - sudo apt-get install -y build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev libxrandr-dev - - name: Check free space and runner log path - run: | - df -h - df . -h - # FIXME: Commenting because GitHub has changed location the home directory - # df /home/runner/runners - - name: Fetch ${{ env.DACAPO_VERSION }} cache - id: fetch-cache - uses: actions/cache@v3 - with: - path: dacapo/${{ env.DACAPO_FILE }} - key: ${{ env.DACAPO_VERSION }} - # fail-on-cache-miss: true # We should never have a cache miss here as we cache DaCapo in an earlier job - # Temporarily change this to false in case the cache download gets - # stuck -- if the cache download is stuck then we go straight to - # upstream and fetch the zip file - fail-on-cache-miss: false - - name: Install ${{ env.DACAPO_VERSION }} - if: steps.fetch-cache.outputs.cache-hit != 'true' - run: | - mkdir -p dacapo - pushd dacapo - wget -q "${{ env.DACAPO_DOWNLOAD_URL }}" -O ${{ env.DACAPO_FILE }} - popd - - name: Unzip ${{ env.DACAPO_VERSION }} - run: | - pushd dacapo - unzip ${{ env.DACAPO_FILE }} - rm ${{ env.DACAPO_FILE }} - popd - - name: Check free space - run: df -h - - name: Download bundles - uses: actions/download-artifact@v4 - with: - name: linux-x86_64-server-${{ matrix.debug-level }}-bundles-normal - path: bundles - - name: Extract OpenJDK - run: | - pushd bundles - tar xvf *.tar.gz - BIN_DIR=`find . -name bin` - mv `dirname $BIN_DIR` jdk - popd - - name: Check free space - run: df -h - - name: Run ${{ env.DACAPO_VERSION }} ${{ matrix.benchmark }} on MMTk OpenJDK ${{ matrix.debug-level }} with 2.5x MarkCompact minheap - run: | - DACAPO_PATH=`realpath ./dacapo` - sed -i "s;DACAPO_PATH;$DACAPO_PATH;g" .github/configs/base.yml - echo " - ${{ matrix.benchmark }}" >> .github/configs/base.yml - set -o pipefail - running runbms /tmp .github/configs/base.yml -s 2.5 -p linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} | tee /tmp/running.stdout - - name: Extract running run id - id: extract-running-run-id - run: | - RUN_ID=`sed -n 's/^Run id:.\(.*\)$/\1/p' < /tmp/running.stdout` - echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT - - name: Upload running artifacts - uses: actions/upload-artifact@v4 - with: - name: linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} - path: /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ - - name: Check for test failures - run: | - RUNNING_OUTPUT=`sed -n "s/^\(${{ matrix.benchmark }} .*\)$/\1/p" < /tmp/running.stdout` - echo $RUNNING_OUTPUT - pip3 install pyyaml - echo $RUNNING_OUTPUT | python3 .github/scripts/ci-matrix-result-check.py linux-x64 ${{ matrix.debug-level }} ${{ matrix.benchmark }} /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ + heap-4000: + uses: ./.github/workflows/run-dacapo-chopin-inner.yml + with: + config-file: "large-heap.yml" + heap-factor: "4" From ded5dcbec36f7924af6653acd97af66ba1871de4 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 30 Jul 2025 20:44:31 +1200 Subject: [PATCH 05/42] Add heap factor to artifact name --- .github/workflows/run-dacapo-chopin-inner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-dacapo-chopin-inner.yml b/.github/workflows/run-dacapo-chopin-inner.yml index 78850ef0..8307b0c1 100644 --- a/.github/workflows/run-dacapo-chopin-inner.yml +++ b/.github/workflows/run-dacapo-chopin-inner.yml @@ -151,7 +151,7 @@ jobs: - name: Upload running artifacts uses: actions/upload-artifact@v4 with: - name: linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }} + name: linux-x86_64-${{ matrix.benchmark }}-${{ matrix.debug-level }}-${{ inputs.heap-factor }} path: /tmp/${{ steps.extract-running-run-id.outputs.run-id }}/ - name: Check for test failures run: | From 2c739a1cf297c9afb6dfeb3f415ef0382db7e6a8 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 31 Jul 2025 02:23:53 +0000 Subject: [PATCH 06/42] Update mmtk-core. Run conix with 6x heap. --- .github/workflows/run-dacapo-chopin.yml | 2 +- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-dacapo-chopin.yml b/.github/workflows/run-dacapo-chopin.yml index 49a89854..cdcd829c 100644 --- a/.github/workflows/run-dacapo-chopin.yml +++ b/.github/workflows/run-dacapo-chopin.yml @@ -14,4 +14,4 @@ jobs: uses: ./.github/workflows/run-dacapo-chopin-inner.yml with: config-file: "large-heap.yml" - heap-factor: "4" + heap-factor: "6" diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 7efbb743..0c6078ed 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=100c04969bb6241339eaa45eba0e9b9ba219ebb3#100c04969bb6241339eaa45eba0e9b9ba219ebb3" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=2bbb200c195ac372acaa862e95c67fd3094f58a7#2bbb200c195ac372acaa862e95c67fd3094f58a7" dependencies = [ "atomic", "atomic-traits", @@ -497,7 +497,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=100c04969bb6241339eaa45eba0e9b9ba219ebb3#100c04969bb6241339eaa45eba0e9b9ba219ebb3" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=2bbb200c195ac372acaa862e95c67fd3094f58a7#2bbb200c195ac372acaa862e95c67fd3094f58a7" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 0de325fc..f2129e67 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "100c04969bb6241339eaa45eba0e9b9ba219ebb3" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "2bbb200c195ac372acaa862e95c67fd3094f58a7" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 15ca15cd17cc9266969346e24a418809f9738a78 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Thu, 31 Jul 2025 12:36:24 +0800 Subject: [PATCH 07/42] Fix metadata shifting. Because this is object-remembering barrier, the alignment is only related to object alignment, not field alignment. So we don't need to test if compressed oops is enabled. --- openjdk/barriers/mmtkSATBBarrier.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 42551a70..19a23e79 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -9,7 +9,7 @@ constexpr int kUnloggedValue = 1; static inline intptr_t side_metadata_base_address() { - return UseCompressedOops ? SATB_METADATA_BASE_ADDRESS : SATB_METADATA_BASE_ADDRESS; + return SATB_METADATA_BASE_ADDRESS; } void MMTkSATBBarrierSetRuntime::load_reference(DecoratorSet decorators, oop value) const { @@ -29,8 +29,8 @@ void MMTkSATBBarrierSetRuntime::object_reference_write_pre(oop src, oop* slot, o // oop pre_val = *slot; // if (pre_val == NULL) return; intptr_t addr = ((intptr_t) (void*) src); - const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> (UseCompressedOops ? 5 : 6))); - intptr_t shift = (addr >> (UseCompressedOops ? 2 : 3)) & 0b111; + const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> 6)); + intptr_t shift = (addr >> 3) & 0b111; uint8_t byte_val = *meta_addr; if (((byte_val >> shift) & 1) == kUnloggedValue) { object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); @@ -90,13 +90,13 @@ void MMTkSATBBarrierSetAssembler::object_reference_write_pre(MacroAssembler* mas // __ cmpptr(tmp3, (int32_t) NULL_WORD); // __ jcc(Assembler::equal, done); - __ shrptr(tmp3, UseCompressedOops ? 5 : 6); + __ shrptr(tmp3, 6); __ movptr(tmp5, side_metadata_base_address()); __ movzbl(tmp5, Address(tmp5, tmp3)); // tmp3 = (obj >> 3) & 7 __ mov(tmp3, obj); - __ shrptr(tmp3, UseCompressedOops ? 2 : 3); + __ shrptr(tmp3, 3); __ andptr(tmp3, 7); // tmp5 = tmp5 >> tmp3 __ movptr(tmp4, rcx); @@ -329,7 +329,7 @@ void MMTkSATBBarrierSetC1::object_reference_write_pre(LIRAccess& access, LIR_Opr // uint8_t* meta_addr = (uint8_t*) (side_metadata_base_address() + (addr >> 6)); LIR_Opr offset = gen->new_pointer_register(); __ move(addr, offset); - __ unsigned_shift_right(offset, UseCompressedOops ? 5 : 6, offset); + __ unsigned_shift_right(offset, 6, offset); LIR_Opr base = gen->new_pointer_register(); __ move(LIR_OprFact::longConst(side_metadata_base_address()), base); LIR_Address* meta_addr = new LIR_Address(base, offset, T_BYTE); @@ -340,7 +340,7 @@ void MMTkSATBBarrierSetC1::object_reference_write_pre(LIRAccess& access, LIR_Opr // intptr_t shift = (addr >> 3) & 0b111; LIR_Opr shift = gen->new_register(T_INT); __ move(addr, shift); - __ unsigned_shift_right(shift, UseCompressedOops ? 2 : 3, shift); + __ unsigned_shift_right(shift, 3, shift); __ logical_and(shift, LIR_OprFact::intConst(0b111), shift); // if (((byte_val >> shift) & 1) == 1) slow; LIR_Opr result = byte_val; @@ -371,10 +371,10 @@ void MMTkSATBBarrierSetC2::object_reference_write_pre(GraphKit* kit, Node* src, Node* zero = __ ConI(0); Node* addr = __ CastPX(__ ctrl(), src); - Node* meta_addr = __ AddP(no_base, __ ConP(side_metadata_base_address()), __ URShiftX(addr, __ ConI(UseCompressedOops ? 5 : 6))); + Node* meta_addr = __ AddP(no_base, __ ConP(side_metadata_base_address()), __ URShiftX(addr, __ ConI(6))); Node* byte = __ load(__ ctrl(), meta_addr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); - Node* shift = __ URShiftX(addr, __ ConI(UseCompressedOops ? 2 : 3)); + Node* shift = __ URShiftX(addr, __ ConI(3)); shift = __ AndI(__ ConvL2I(shift), __ ConI(7)); Node* result = __ AndI(__ URShiftI(byte, shift), __ ConI(1)); __ if_then(result, BoolTest::ne, zero, unlikely); { From 772bb1acfaa85c5433fd755a6959c6ac36ec17d3 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 31 Jul 2025 04:35:36 +0000 Subject: [PATCH 08/42] Rename CI jobs --- .github/workflows/run-dacapo-chopin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-dacapo-chopin.yml b/.github/workflows/run-dacapo-chopin.yml index cdcd829c..6c19da22 100644 --- a/.github/workflows/run-dacapo-chopin.yml +++ b/.github/workflows/run-dacapo-chopin.yml @@ -4,13 +4,13 @@ on: workflow_call: jobs: - heap-2500: + normal-heap: uses: ./.github/workflows/run-dacapo-chopin-inner.yml with: config-file: "normal-heap.yml" heap-factor: "2.5" - heap-4000: + large-heap: uses: ./.github/workflows/run-dacapo-chopin-inner.yml with: config-file: "large-heap.yml" From f8be111204d05267feddc6aae8b9205c1e8d2c92 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 31 Jul 2025 05:36:56 +0000 Subject: [PATCH 09/42] Update mmtk-core (schedule_concurrent_packets before resuming mutators) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 0c6078ed..65bcb864 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=2bbb200c195ac372acaa862e95c67fd3094f58a7#2bbb200c195ac372acaa862e95c67fd3094f58a7" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=90f451886da0cceb0c87d770ac9294192cda7355#90f451886da0cceb0c87d770ac9294192cda7355" dependencies = [ "atomic", "atomic-traits", @@ -497,7 +497,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=2bbb200c195ac372acaa862e95c67fd3094f58a7#2bbb200c195ac372acaa862e95c67fd3094f58a7" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=90f451886da0cceb0c87d770ac9294192cda7355#90f451886da0cceb0c87d770ac9294192cda7355" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index f2129e67..028a0f59 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "2bbb200c195ac372acaa862e95c67fd3094f58a7" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "90f451886da0cceb0c87d770ac9294192cda7355" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 5aa00cd32344bda65d35bba42f9df6b2757991ae Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 31 Jul 2025 19:27:43 +1200 Subject: [PATCH 10/42] CI: Use 7x min heap. Use compressed pointer. --- .github/configs/large-heap.yml | 2 +- .github/workflows/run-dacapo-chopin.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/configs/large-heap.yml b/.github/configs/large-heap.yml index d5ac4b73..807f3c8c 100644 --- a/.github/configs/large-heap.yml +++ b/.github/configs/large-heap.yml @@ -2,7 +2,7 @@ includes: - "./base.yml" configs: - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-ConcurrentImmix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix" # This will be expanded in CI when we run with the config. Keep a new line at the end. benchmarks: diff --git a/.github/workflows/run-dacapo-chopin.yml b/.github/workflows/run-dacapo-chopin.yml index 6c19da22..30458897 100644 --- a/.github/workflows/run-dacapo-chopin.yml +++ b/.github/workflows/run-dacapo-chopin.yml @@ -14,4 +14,4 @@ jobs: uses: ./.github/workflows/run-dacapo-chopin-inner.yml with: config-file: "large-heap.yml" - heap-factor: "6" + heap-factor: "7" From cae60f1011fe72cabe2e9e44feca6dabb1248104 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Fri, 1 Aug 2025 14:46:00 +0800 Subject: [PATCH 11/42] mmtk-core renamed load_reference to load_weak_reference --- mmtk/Cargo.toml | 2 +- mmtk/src/api.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 028a0f59..719f7697 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "90f451886da0cceb0c87d770ac9294192cda7355" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "1db4743e6fe3ec837c2a1b0c3c1f3944e2b825a8" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 0b813ba0..ab537d7e 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -385,7 +385,7 @@ pub extern "C" fn executable() -> bool { #[no_mangle] pub extern "C" fn mmtk_load_reference(mutator: *mut libc::c_void, o: ObjectReference) { - with_mutator!(|mutator| mutator.barrier().load_reference(o)) + with_mutator!(|mutator| mutator.barrier().load_weak_reference(o)) } #[no_mangle] From 6b0493643b3b39d7d6d9a5b56daf64aca762ce2e Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 5 Aug 2025 01:44:46 +0000 Subject: [PATCH 12/42] Update mmtk-core, fix style check --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- mmtk/src/api.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 65bcb864..df32951d 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=90f451886da0cceb0c87d770ac9294192cda7355#90f451886da0cceb0c87d770ac9294192cda7355" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=eacc9599d3cad5968fd06131d4639ebf9622ae64#eacc9599d3cad5968fd06131d4639ebf9622ae64" dependencies = [ "atomic", "atomic-traits", @@ -497,7 +497,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=90f451886da0cceb0c87d770ac9294192cda7355#90f451886da0cceb0c87d770ac9294192cda7355" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=eacc9599d3cad5968fd06131d4639ebf9622ae64#eacc9599d3cad5968fd06131d4639ebf9622ae64" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 719f7697..2e87bc1c 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "1db4743e6fe3ec837c2a1b0c3c1f3944e2b825a8" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "eacc9599d3cad5968fd06131d4639ebf9622ae64" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index ab537d7e..f0471b31 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -60,7 +60,7 @@ pub extern "C" fn mmtk_active_barrier() -> *const c_char { match singleton.get_plan().constraints().barrier { BarrierSelector::NoBarrier => NO_BARRIER.as_ptr(), BarrierSelector::ObjectBarrier => OBJECT_BARRIER.as_ptr(), - BarrierSelector::SATBBarrier => SATB_BARRIER.as_ptr(), + BarrierSelector::SATBBarrier => SATB_BARRIER.as_ptr(), // In case we have more barriers in mmtk-core. #[allow(unreachable_patterns)] _ => unimplemented!(), From b120bae7814c5a4ccc2228476d0b17d8879be554 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 6 Aug 2025 00:14:35 +0000 Subject: [PATCH 13/42] Run ConcurrentImmix without weak refs --- .github/configs/base.yml | 4 ++++ .github/configs/large-heap.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/configs/base.yml b/.github/configs/base.yml index d420cd31..8d24a793 100644 --- a/.github/configs/base.yml +++ b/.github/configs/base.yml @@ -78,6 +78,10 @@ modifiers: no_compressed_oops: type: JVMArg val: "-XX:-UseCompressedOops -XX:-UseCompressedClassPointers" + no_weak_ref: + type: EnvVar + var: "MMTK_NO_REFERENCE_TYPES" + val: "true" plugins: keep_stdout_stderr: diff --git a/.github/configs/large-heap.yml b/.github/configs/large-heap.yml index 807f3c8c..776156c0 100644 --- a/.github/configs/large-heap.yml +++ b/.github/configs/large-heap.yml @@ -2,7 +2,7 @@ includes: - "./base.yml" configs: - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix|no_weak_ref" # This will be expanded in CI when we run with the config. Keep a new line at the end. benchmarks: From b0109edeff7f3ad661b9fb3ebd56c420c0e323b7 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 6 Aug 2025 03:57:52 +0000 Subject: [PATCH 14/42] Pass DecoratorSet to MMTk's object_reference_write_pre/post. Skip barrier in SATB's object_reference_write_pre --- openjdk/barriers/mmtkObjectBarrier.cpp | 15 +-------------- openjdk/barriers/mmtkObjectBarrier.hpp | 16 +++++++++++++++- openjdk/barriers/mmtkSATBBarrier.cpp | 16 +--------------- openjdk/barriers/mmtkSATBBarrier.hpp | 22 +++++++++++++++++++++- openjdk/mmtkBarrierSet.hpp | 18 ++++++++++-------- 5 files changed, 48 insertions(+), 39 deletions(-) diff --git a/openjdk/barriers/mmtkObjectBarrier.cpp b/openjdk/barriers/mmtkObjectBarrier.cpp index df56ac74..5226c67d 100644 --- a/openjdk/barriers/mmtkObjectBarrier.cpp +++ b/openjdk/barriers/mmtkObjectBarrier.cpp @@ -21,20 +21,7 @@ void MMTkObjectBarrierSetRuntime::object_probable_write(oop new_obj) const { #endif } -void MMTkObjectBarrierSetRuntime::object_reference_write_post(oop src, oop* slot, oop target) const { -#if MMTK_ENABLE_BARRIER_FASTPATH - intptr_t addr = (intptr_t) (void*) src; - uint8_t* meta_addr = (uint8_t*) (SIDE_METADATA_BASE_ADDRESS + (addr >> 6)); - intptr_t shift = (addr >> 3) & 0b111; - uint8_t byte_val = *meta_addr; - if (((byte_val >> shift) & 1) == 1) { - // MMTkObjectBarrierSetRuntime::object_reference_write_pre_slow()((void*) src); - object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); - } -#else - object_reference_write_post_call((void*) src, (void*) slot, (void*) target); -#endif -} +// Template implementation moved to header file #define __ masm-> diff --git a/openjdk/barriers/mmtkObjectBarrier.hpp b/openjdk/barriers/mmtkObjectBarrier.hpp index 179cc1ef..54266f4b 100644 --- a/openjdk/barriers/mmtkObjectBarrier.hpp +++ b/openjdk/barriers/mmtkObjectBarrier.hpp @@ -21,7 +21,21 @@ const intptr_t SIDE_METADATA_BASE_ADDRESS = (intptr_t) GLOBAL_SIDE_METADATA_VM_B class MMTkObjectBarrierSetRuntime: public MMTkBarrierSetRuntime { public: // Interfaces called by `MMTkBarrierSet::AccessBarrier` - virtual void object_reference_write_post(oop src, oop* slot, oop target) const override; + template + void object_reference_write_post(oop src, oop* slot, oop target) const { +#if MMTK_ENABLE_BARRIER_FASTPATH + intptr_t addr = (intptr_t) (void*) src; + uint8_t* meta_addr = (uint8_t*) (SIDE_METADATA_BASE_ADDRESS + (addr >> 6)); + intptr_t shift = (addr >> 3) & 0b111; + uint8_t byte_val = *meta_addr; + if (((byte_val >> shift) & 1) == 1) { + // MMTkObjectBarrierSetRuntime::object_reference_write_pre_slow()((void*) src); + object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + } +#else + object_reference_write_post_call((void*) src, (void*) slot, (void*) target); +#endif + } virtual void object_reference_array_copy_post(oop* src, oop* dst, size_t count) const override { object_reference_array_copy_post_call((void*) src, (void*) dst, count); } diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 19a23e79..9c8068cd 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -24,21 +24,7 @@ void MMTkSATBBarrierSetRuntime::object_probable_write(oop new_obj) const { mmtk_object_probable_write((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) new_obj); } -void MMTkSATBBarrierSetRuntime::object_reference_write_pre(oop src, oop* slot, oop target) const { -#if MMTK_ENABLE_BARRIER_FASTPATH - // oop pre_val = *slot; - // if (pre_val == NULL) return; - intptr_t addr = ((intptr_t) (void*) src); - const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> 6)); - intptr_t shift = (addr >> 3) & 0b111; - uint8_t byte_val = *meta_addr; - if (((byte_val >> shift) & 1) == kUnloggedValue) { - object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); - } -#else - object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); -#endif -} +// Template implementation moved to header file #define __ masm-> diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp index 11c59e0c..58c22130 100644 --- a/openjdk/barriers/mmtkSATBBarrier.hpp +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -21,7 +21,27 @@ const intptr_t SATB_METADATA_BASE_ADDRESS = (intptr_t) GLOBAL_SIDE_METADATA_VM_B class MMTkSATBBarrierSetRuntime: public MMTkBarrierSetRuntime { public: // Interfaces called by `MMTkBarrierSet::AccessBarrier` - virtual void object_reference_write_pre(oop src, oop* slot, oop target) const override; + template + void object_reference_write_pre(oop src, oop* slot, oop target) const { + if (HasDecorator::value || + HasDecorator::value) { + return; + } + +#if MMTK_ENABLE_BARRIER_FASTPATH + // oop pre_val = *slot; + // if (pre_val == NULL) return; + intptr_t addr = ((intptr_t) (void*) src); + const volatile uint8_t * meta_addr = (const volatile uint8_t *) (SATB_METADATA_BASE_ADDRESS + (addr >> 6)); + intptr_t shift = (addr >> 3) & 0b111; + uint8_t byte_val = *meta_addr; + if (((byte_val >> shift) & 1) == 1) { // kUnloggedValue + object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + } +#else + object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); +#endif + } virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const override { if (count == 0) return; ::mmtk_array_copy_pre((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) src, (void*) dst, count); diff --git a/openjdk/mmtkBarrierSet.hpp b/openjdk/mmtkBarrierSet.hpp index 9154e811..a6f00304 100644 --- a/openjdk/mmtkBarrierSet.hpp +++ b/openjdk/mmtkBarrierSet.hpp @@ -85,9 +85,11 @@ class MMTkBarrierSetRuntime: public CHeapObj { } /// Full pre-barrier - virtual void object_reference_write_pre(oop src, oop* slot, oop target) const {}; + template + void object_reference_write_pre(oop src, oop* slot, oop target) const {} /// Full post-barrier - virtual void object_reference_write_post(oop src, oop* slot, oop target) const {}; + template + void object_reference_write_post(oop src, oop* slot, oop target) const {} /// Full arraycopy pre-barrier virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const {}; /// Full arraycopy post-barrier @@ -219,9 +221,9 @@ class MMTkBarrierSet : public BarrierSet { } static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) { - runtime()->object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), value); + runtime()->template object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), value); Raw::oop_store_at(base, offset, value); - runtime()->object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), value); + runtime()->template object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), value); } template @@ -231,9 +233,9 @@ class MMTkBarrierSet : public BarrierSet { } static oop oop_atomic_cmpxchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset, oop compare_value) { - runtime()->object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->template object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); oop result = Raw::oop_atomic_cmpxchg_at(new_value, base, offset, compare_value); - runtime()->object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->template object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); return result; } @@ -244,9 +246,9 @@ class MMTkBarrierSet : public BarrierSet { } static oop oop_atomic_xchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset) { - runtime()->object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->template object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); oop result = Raw::oop_atomic_xchg_at(new_value, base, offset); - runtime()->object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->template object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); return result; } From 803f57b3248a8f2d61d469d1c79885cc37e16bbc Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 6 Aug 2025 03:58:52 +0000 Subject: [PATCH 15/42] Revert "Run ConcurrentImmix without weak refs" This reverts commit b120bae7814c5a4ccc2228476d0b17d8879be554. --- .github/configs/base.yml | 4 ---- .github/configs/large-heap.yml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/configs/base.yml b/.github/configs/base.yml index 8d24a793..d420cd31 100644 --- a/.github/configs/base.yml +++ b/.github/configs/base.yml @@ -78,10 +78,6 @@ modifiers: no_compressed_oops: type: JVMArg val: "-XX:-UseCompressedOops -XX:-UseCompressedClassPointers" - no_weak_ref: - type: EnvVar - var: "MMTK_NO_REFERENCE_TYPES" - val: "true" plugins: keep_stdout_stderr: diff --git a/.github/configs/large-heap.yml b/.github/configs/large-heap.yml index 776156c0..807f3c8c 100644 --- a/.github/configs/large-heap.yml +++ b/.github/configs/large-heap.yml @@ -2,7 +2,7 @@ includes: - "./base.yml" configs: - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix|no_weak_ref" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-ConcurrentImmix" # This will be expanded in CI when we run with the config. Keep a new line at the end. benchmarks: From 69512a0c2abcb69009d345b74e7b29d22acc3335 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 6 Aug 2025 05:11:43 +0000 Subject: [PATCH 16/42] Revert "Pass DecoratorSet to MMTk's object_reference_write_pre/post. Skip" This reverts commit b0109edeff7f3ad661b9fb3ebd56c420c0e323b7. --- openjdk/barriers/mmtkObjectBarrier.cpp | 15 ++++++++++++++- openjdk/barriers/mmtkObjectBarrier.hpp | 16 +--------------- openjdk/barriers/mmtkSATBBarrier.cpp | 16 +++++++++++++++- openjdk/barriers/mmtkSATBBarrier.hpp | 22 +--------------------- openjdk/mmtkBarrierSet.hpp | 18 ++++++++---------- 5 files changed, 39 insertions(+), 48 deletions(-) diff --git a/openjdk/barriers/mmtkObjectBarrier.cpp b/openjdk/barriers/mmtkObjectBarrier.cpp index 5226c67d..df56ac74 100644 --- a/openjdk/barriers/mmtkObjectBarrier.cpp +++ b/openjdk/barriers/mmtkObjectBarrier.cpp @@ -21,7 +21,20 @@ void MMTkObjectBarrierSetRuntime::object_probable_write(oop new_obj) const { #endif } -// Template implementation moved to header file +void MMTkObjectBarrierSetRuntime::object_reference_write_post(oop src, oop* slot, oop target) const { +#if MMTK_ENABLE_BARRIER_FASTPATH + intptr_t addr = (intptr_t) (void*) src; + uint8_t* meta_addr = (uint8_t*) (SIDE_METADATA_BASE_ADDRESS + (addr >> 6)); + intptr_t shift = (addr >> 3) & 0b111; + uint8_t byte_val = *meta_addr; + if (((byte_val >> shift) & 1) == 1) { + // MMTkObjectBarrierSetRuntime::object_reference_write_pre_slow()((void*) src); + object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + } +#else + object_reference_write_post_call((void*) src, (void*) slot, (void*) target); +#endif +} #define __ masm-> diff --git a/openjdk/barriers/mmtkObjectBarrier.hpp b/openjdk/barriers/mmtkObjectBarrier.hpp index 54266f4b..179cc1ef 100644 --- a/openjdk/barriers/mmtkObjectBarrier.hpp +++ b/openjdk/barriers/mmtkObjectBarrier.hpp @@ -21,21 +21,7 @@ const intptr_t SIDE_METADATA_BASE_ADDRESS = (intptr_t) GLOBAL_SIDE_METADATA_VM_B class MMTkObjectBarrierSetRuntime: public MMTkBarrierSetRuntime { public: // Interfaces called by `MMTkBarrierSet::AccessBarrier` - template - void object_reference_write_post(oop src, oop* slot, oop target) const { -#if MMTK_ENABLE_BARRIER_FASTPATH - intptr_t addr = (intptr_t) (void*) src; - uint8_t* meta_addr = (uint8_t*) (SIDE_METADATA_BASE_ADDRESS + (addr >> 6)); - intptr_t shift = (addr >> 3) & 0b111; - uint8_t byte_val = *meta_addr; - if (((byte_val >> shift) & 1) == 1) { - // MMTkObjectBarrierSetRuntime::object_reference_write_pre_slow()((void*) src); - object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); - } -#else - object_reference_write_post_call((void*) src, (void*) slot, (void*) target); -#endif - } + virtual void object_reference_write_post(oop src, oop* slot, oop target) const override; virtual void object_reference_array_copy_post(oop* src, oop* dst, size_t count) const override { object_reference_array_copy_post_call((void*) src, (void*) dst, count); } diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 9c8068cd..19a23e79 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -24,7 +24,21 @@ void MMTkSATBBarrierSetRuntime::object_probable_write(oop new_obj) const { mmtk_object_probable_write((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) new_obj); } -// Template implementation moved to header file +void MMTkSATBBarrierSetRuntime::object_reference_write_pre(oop src, oop* slot, oop target) const { +#if MMTK_ENABLE_BARRIER_FASTPATH + // oop pre_val = *slot; + // if (pre_val == NULL) return; + intptr_t addr = ((intptr_t) (void*) src); + const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> 6)); + intptr_t shift = (addr >> 3) & 0b111; + uint8_t byte_val = *meta_addr; + if (((byte_val >> shift) & 1) == kUnloggedValue) { + object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + } +#else + object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); +#endif +} #define __ masm-> diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp index 58c22130..11c59e0c 100644 --- a/openjdk/barriers/mmtkSATBBarrier.hpp +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -21,27 +21,7 @@ const intptr_t SATB_METADATA_BASE_ADDRESS = (intptr_t) GLOBAL_SIDE_METADATA_VM_B class MMTkSATBBarrierSetRuntime: public MMTkBarrierSetRuntime { public: // Interfaces called by `MMTkBarrierSet::AccessBarrier` - template - void object_reference_write_pre(oop src, oop* slot, oop target) const { - if (HasDecorator::value || - HasDecorator::value) { - return; - } - -#if MMTK_ENABLE_BARRIER_FASTPATH - // oop pre_val = *slot; - // if (pre_val == NULL) return; - intptr_t addr = ((intptr_t) (void*) src); - const volatile uint8_t * meta_addr = (const volatile uint8_t *) (SATB_METADATA_BASE_ADDRESS + (addr >> 6)); - intptr_t shift = (addr >> 3) & 0b111; - uint8_t byte_val = *meta_addr; - if (((byte_val >> shift) & 1) == 1) { // kUnloggedValue - object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); - } -#else - object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); -#endif - } + virtual void object_reference_write_pre(oop src, oop* slot, oop target) const override; virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const override { if (count == 0) return; ::mmtk_array_copy_pre((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) src, (void*) dst, count); diff --git a/openjdk/mmtkBarrierSet.hpp b/openjdk/mmtkBarrierSet.hpp index a6f00304..9154e811 100644 --- a/openjdk/mmtkBarrierSet.hpp +++ b/openjdk/mmtkBarrierSet.hpp @@ -85,11 +85,9 @@ class MMTkBarrierSetRuntime: public CHeapObj { } /// Full pre-barrier - template - void object_reference_write_pre(oop src, oop* slot, oop target) const {} + virtual void object_reference_write_pre(oop src, oop* slot, oop target) const {}; /// Full post-barrier - template - void object_reference_write_post(oop src, oop* slot, oop target) const {} + virtual void object_reference_write_post(oop src, oop* slot, oop target) const {}; /// Full arraycopy pre-barrier virtual void object_reference_array_copy_pre(oop* src, oop* dst, size_t count) const {}; /// Full arraycopy post-barrier @@ -221,9 +219,9 @@ class MMTkBarrierSet : public BarrierSet { } static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) { - runtime()->template object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), value); + runtime()->object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), value); Raw::oop_store_at(base, offset, value); - runtime()->template object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), value); + runtime()->object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), value); } template @@ -233,9 +231,9 @@ class MMTkBarrierSet : public BarrierSet { } static oop oop_atomic_cmpxchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset, oop compare_value) { - runtime()->template object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); oop result = Raw::oop_atomic_cmpxchg_at(new_value, base, offset, compare_value); - runtime()->template object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); return result; } @@ -246,9 +244,9 @@ class MMTkBarrierSet : public BarrierSet { } static oop oop_atomic_xchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset) { - runtime()->template object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->object_reference_write_pre(base, (oop*) (size_t((void*) base) + offset), new_value); oop result = Raw::oop_atomic_xchg_at(new_value, base, offset); - runtime()->template object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); + runtime()->object_reference_write_post(base, (oop*) (size_t((void*) base) + offset), new_value); return result; } From 0d869df5438f286e4110b26361d09bf82983f3b2 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 6 Aug 2025 05:23:55 +0000 Subject: [PATCH 17/42] Update mmtk-core (ref enqueue workaround) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 7175c5a5..02397b15 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=028bd0e109fb747867db83d1782872576292deef#028bd0e109fb747867db83d1782872576292deef" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=fe29529297163f406d43c06af5a271fc946399e2#fe29529297163f406d43c06af5a271fc946399e2" dependencies = [ "atomic", "atomic-traits", @@ -497,7 +497,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=028bd0e109fb747867db83d1782872576292deef#028bd0e109fb747867db83d1782872576292deef" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=fe29529297163f406d43c06af5a271fc946399e2#fe29529297163f406d43c06af5a271fc946399e2" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 4e6a5465..4c3db3ae 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "028bd0e109fb747867db83d1782872576292deef" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "fe29529297163f406d43c06af5a271fc946399e2" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 948db29806f3047a3e7f13c96441ab92b251da05 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 13 Aug 2025 05:40:00 +0000 Subject: [PATCH 18/42] Update mmtk-core (ConcurrentPlan and trace object refactoring) --- mmtk/Cargo.lock | 5 +++-- mmtk/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 02397b15..77072189 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=fe29529297163f406d43c06af5a271fc946399e2#fe29529297163f406d43c06af5a271fc946399e2" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=7487c1be0572c045d552da64d99e47c858a42f8b#7487c1be0572c045d552da64d99e47c858a42f8b" dependencies = [ "atomic", "atomic-traits", @@ -485,6 +485,7 @@ dependencies = [ "num_cpus", "portable-atomic", "probe", + "rayon-core", "regex", "rustversion", "spin", @@ -497,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=fe29529297163f406d43c06af5a271fc946399e2#fe29529297163f406d43c06af5a271fc946399e2" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=7487c1be0572c045d552da64d99e47c858a42f8b#7487c1be0572c045d552da64d99e47c858a42f8b" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 4c3db3ae..fd1becd4 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "fe29529297163f406d43c06af5a271fc946399e2" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "7487c1be0572c045d552da64d99e47c858a42f8b" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 3f437d003b52066c9f70709f6a81d01ba4f92c1f Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 14 Aug 2025 04:14:13 +0000 Subject: [PATCH 19/42] Update mmtk-core (minor fix) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 77072189..552f7003 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=7487c1be0572c045d552da64d99e47c858a42f8b#7487c1be0572c045d552da64d99e47c858a42f8b" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2#6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=7487c1be0572c045d552da64d99e47c858a42f8b#7487c1be0572c045d552da64d99e47c858a42f8b" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2#6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index fd1becd4..79fd127e 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "7487c1be0572c045d552da64d99e47c858a42f8b" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From d141c5fdaa461f013ca676de5eb1f2be81065efa Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 14 Aug 2025 05:15:38 +0000 Subject: [PATCH 20/42] Update mmtk-core (wrong assertions) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 552f7003..3cf61c23 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2#6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=ad41d7e67629d72a6918cc02e498b053bd91f8b1#ad41d7e67629d72a6918cc02e498b053bd91f8b1" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2#6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=ad41d7e67629d72a6918cc02e498b053bd91f8b1#ad41d7e67629d72a6918cc02e498b053bd91f8b1" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 79fd127e..1b5a0427 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "6bb03c08bd5f98a36e0be8f879bf1f8e973cf1e2" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "ad41d7e67629d72a6918cc02e498b053bd91f8b1" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 19f0a8d315fc52aab8610983e811277f0dd867b3 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Mon, 25 Aug 2025 01:30:04 +0000 Subject: [PATCH 21/42] Udpate mmtk-core (refactor log bits) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 3cf61c23..a2ac847d 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=ad41d7e67629d72a6918cc02e498b053bd91f8b1#ad41d7e67629d72a6918cc02e498b053bd91f8b1" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=c9315b9cb3b1282093ceae8c911ae3094a7f75e7#c9315b9cb3b1282093ceae8c911ae3094a7f75e7" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=ad41d7e67629d72a6918cc02e498b053bd91f8b1#ad41d7e67629d72a6918cc02e498b053bd91f8b1" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=c9315b9cb3b1282093ceae8c911ae3094a7f75e7#c9315b9cb3b1282093ceae8c911ae3094a7f75e7" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 1b5a0427..2189ae58 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "ad41d7e67629d72a6918cc02e498b053bd91f8b1" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "c9315b9cb3b1282093ceae8c911ae3094a7f75e7" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 6f4b7a50c02b77b8a50c72dc8fe775b3295a5392 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 26 Aug 2025 00:22:20 +0000 Subject: [PATCH 22/42] Update mmtk-core (work bucket refactoring) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index a2ac847d..272d337e 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=c9315b9cb3b1282093ceae8c911ae3094a7f75e7#c9315b9cb3b1282093ceae8c911ae3094a7f75e7" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=74572eb4664303242799d07db4ccc03f4ea7fb37#74572eb4664303242799d07db4ccc03f4ea7fb37" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=c9315b9cb3b1282093ceae8c911ae3094a7f75e7#c9315b9cb3b1282093ceae8c911ae3094a7f75e7" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=74572eb4664303242799d07db4ccc03f4ea7fb37#74572eb4664303242799d07db4ccc03f4ea7fb37" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 2189ae58..0d713330 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "c9315b9cb3b1282093ceae8c911ae3094a7f75e7" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "74572eb4664303242799d07db4ccc03f4ea7fb37" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 9095a902e1b77267177a6fc35e1f89b76b900fdc Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 26 Aug 2025 00:56:51 +0000 Subject: [PATCH 23/42] Update mmtk-core (fix weak ref bucket, concurrent gc heuristics change) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 272d337e..da67f30d 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=74572eb4664303242799d07db4ccc03f4ea7fb37#74572eb4664303242799d07db4ccc03f4ea7fb37" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=bdcf723cc58dc4d268cc794b816e8bdf9694fa91#bdcf723cc58dc4d268cc794b816e8bdf9694fa91" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=74572eb4664303242799d07db4ccc03f4ea7fb37#74572eb4664303242799d07db4ccc03f4ea7fb37" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=bdcf723cc58dc4d268cc794b816e8bdf9694fa91#bdcf723cc58dc4d268cc794b816e8bdf9694fa91" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 0d713330..20aca8da 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "74572eb4664303242799d07db4ccc03f4ea7fb37" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "bdcf723cc58dc4d268cc794b816e8bdf9694fa91" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 4e7d086e2da82a6bfcab050e49b984c66583b141 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 26 Aug 2025 04:07:02 +0000 Subject: [PATCH 24/42] Update mmtk-core (Remove NUM_CONCURRENT_TRACING_PACKETS., fix enabling bucket) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index da67f30d..093e5ca6 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=bdcf723cc58dc4d268cc794b816e8bdf9694fa91#bdcf723cc58dc4d268cc794b816e8bdf9694fa91" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=1368ac55be6089933445cdf442d3458b6f5a9c64#1368ac55be6089933445cdf442d3458b6f5a9c64" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=bdcf723cc58dc4d268cc794b816e8bdf9694fa91#bdcf723cc58dc4d268cc794b816e8bdf9694fa91" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=1368ac55be6089933445cdf442d3458b6f5a9c64#1368ac55be6089933445cdf442d3458b6f5a9c64" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 20aca8da..3d07b9eb 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "bdcf723cc58dc4d268cc794b816e8bdf9694fa91" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "1368ac55be6089933445cdf442d3458b6f5a9c64" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 68439bd928f08ae5a2fe480a00cfbc4d6c80f4ec Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 26 Aug 2025 05:31:52 +0000 Subject: [PATCH 25/42] Update mmtk-core (allow defrag in full pause) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 093e5ca6..2c91b7f8 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=1368ac55be6089933445cdf442d3458b6f5a9c64#1368ac55be6089933445cdf442d3458b6f5a9c64" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=35cf25ad47a4c09d24b6e9da0effd97116678d15#35cf25ad47a4c09d24b6e9da0effd97116678d15" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=1368ac55be6089933445cdf442d3458b6f5a9c64#1368ac55be6089933445cdf442d3458b6f5a9c64" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=35cf25ad47a4c09d24b6e9da0effd97116678d15#35cf25ad47a4c09d24b6e9da0effd97116678d15" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 3d07b9eb..aa177ffc 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "1368ac55be6089933445cdf442d3458b6f5a9c64" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "35cf25ad47a4c09d24b6e9da0effd97116678d15" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From c01583e3640e01a2f77153b9a89a02a4777dd39d Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 26 Aug 2025 23:33:52 +0000 Subject: [PATCH 26/42] Update mmtk-core (mark line change) --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 2c91b7f8..eb3f431c 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=35cf25ad47a4c09d24b6e9da0effd97116678d15#35cf25ad47a4c09d24b6e9da0effd97116678d15" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=26537168389bc415b5b5c407e476faa80fa4163a#26537168389bc415b5b5c407e476faa80fa4163a" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=35cf25ad47a4c09d24b6e9da0effd97116678d15#35cf25ad47a4c09d24b6e9da0effd97116678d15" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=26537168389bc415b5b5c407e476faa80fa4163a#26537168389bc415b5b5c407e476faa80fa4163a" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index aa177ffc..5f520842 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -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/tianleq/mmtk-core.git", rev = "35cf25ad47a4c09d24b6e9da0effd97116678d15" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "26537168389bc415b5b5c407e476faa80fa4163a" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From e38dec6cb5c69e8bc2be012b4a258cfae5c0b03f Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Wed, 27 Aug 2025 05:07:08 +0000 Subject: [PATCH 27/42] Update mmtk-core (StopMutators refactoring, barrier active refactoring) --- mmtk/Cargo.lock | 5 +++-- mmtk/Cargo.toml | 3 ++- mmtk/src/collection.rs | 15 +++++++++++---- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index eb3f431c..84704f93 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=26537168389bc415b5b5c407e476faa80fa4163a#26537168389bc415b5b5c407e476faa80fa4163a" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=e3163d8bbb77c701b28e6e53ae75faf5727166d2#e3163d8bbb77c701b28e6e53ae75faf5727166d2" dependencies = [ "atomic", "atomic-traits", @@ -498,7 +498,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=26537168389bc415b5b5c407e476faa80fa4163a#26537168389bc415b5b5c407e476faa80fa4163a" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=e3163d8bbb77c701b28e6e53ae75faf5727166d2#e3163d8bbb77c701b28e6e53ae75faf5727166d2" dependencies = [ "proc-macro-error", "proc-macro2", @@ -515,6 +515,7 @@ dependencies = [ "cfg-if", "lazy_static", "libc", + "log", "memoffset", "mmtk", "once_cell", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 5f520842..40651556 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -23,6 +23,7 @@ openjdk_version = "28e56ee32525c32c5a88391d0b01f24e5cd16c0f" [dependencies] libc = "0.2" lazy_static = "1.1" +log = { version = "0.4", features = ["max_level_trace"] } once_cell = "1.10.0" atomic = "0.6.0" memoffset = "0.9.0" @@ -35,7 +36,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/tianleq/mmtk-core.git", rev = "26537168389bc415b5b5c407e476faa80fa4163a" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "e3163d8bbb77c701b28e6e53ae75faf5727166d2" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index ddbcbc8d..e2267b0f 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -24,6 +24,17 @@ impl Collection> for VMCollection { } fn resume_mutators(tls: VMWorkerThread) { + if *crate::singleton::().get_options().plan == mmtk::util::options::PlanSelector::ConcurrentImmix { + // For concurrent Immix, we need to check if SATB is active + use mmtk::vm::ActivePlan; + use mmtk::MutatorContext; + + // Just get the first mutator: we assume all mutators have the same barrier active state. + let mutator: &mut Mutator> = crate::active_plan::VMActivePlan::mutators().next().unwrap(); + unsafe { crate::CONCURRENT_MARKING_ACTIVE = if mutator.barrier().is_active() { 1 } else { 0 }; } + log::debug!("Use mutator: {:?}", mutator as *mut _); + log::debug!("Set CONCURRENT_MARKING_ACTIVE to {}", unsafe { crate::CONCURRENT_MARKING_ACTIVE }); + } unsafe { ((*UPCALLS).resume_mutators)(tls); } @@ -57,8 +68,4 @@ impl Collection> for VMCollection { ((*UPCALLS).schedule_finalizer)(); } } - - fn set_concurrent_marking_state(active: bool) { - unsafe { crate::CONCURRENT_MARKING_ACTIVE = if active { 1 } else { 0 } } - } } From 68c747d5aef4063997a62ac260921c3035a6a977 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Thu, 28 Aug 2025 16:11:09 +0800 Subject: [PATCH 28/42] Remove unused clone pre barrier We will introduce it later when we implement a plan that needs it. --- mmtk/Cargo.lock | 469 ++++++++++++++++++--------- mmtk/Cargo.toml | 2 +- mmtk/src/api.rs | 8 - openjdk/barriers/mmtkSATBBarrier.hpp | 2 - openjdk/mmtk.h | 2 - openjdk/mmtkBarrierSet.cpp | 4 - openjdk/mmtkBarrierSet.hpp | 6 +- 7 files changed, 319 insertions(+), 174 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 84704f93..95f34d82 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -28,43 +28,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", - "windows-sys", + "once_cell_polyfill", + "windows-sys 0.60.2", ] [[package]] name = "atomic" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" dependencies = [ "bytemuck", ] @@ -87,15 +88,15 @@ checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" [[package]] name = "built" @@ -108,9 +109,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" dependencies = [ "bytemuck_derive", ] @@ -123,14 +124,14 @@ checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] name = "cc" -version = "1.1.18" +version = "1.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc" dependencies = [ "jobserver", "libc", @@ -139,15 +140,15 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "core-foundation-sys" @@ -170,18 +171,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -198,28 +199,28 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "delegate" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b6483c2bbed26f97861cf57651d4f2b731964a28cd2257f934a4b452480d21" +checksum = "6178a82cf56c836a3ba61a7935cdb1c49bfaa6fa4327cd5bf554a503087de26b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] @@ -230,9 +231,9 @@ checksum = "ea8a8b81cacc08888170eef4d13b775126db426d0b348bee9d18c2c1eaf123cf" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "enum-map" @@ -251,14 +252,14 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -266,31 +267,43 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", "env_filter", - "humantime", + "jiff", "log", ] [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + [[package]] name = "git2" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5220b8ba44c68a9a7f7a7659e864dd73692e417ef0211bea133c7b74e031eeb9" +checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110" dependencies = [ "bitflags", "libc", @@ -307,27 +320,15 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -347,22 +348,22 @@ dependencies = [ [[package]] name = "idna_mapping" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5422cc5bc64289a77dbb45e970b86b5e9a04cb500abc7240505aedc1bf40f38" +checksum = "11c13906586a4b339310541a274dd927aff6fcbb5b8e3af90634c4b31681c792" dependencies = [ "unicode-joining-type", ] [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ - "hermit-abi 0.4.0", + "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -380,12 +381,37 @@ dependencies = [ "either", ] +[[package]] +name = "jiff" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ + "getrandom", "libc", ] @@ -397,15 +423,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "libgit2-sys" -version = "0.18.1+1.9.0" +version = "0.18.2+1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1dcb20f84ffcdd825c7a311ae347cce604a6f084a767dec4a4929829645290e" +checksum = "1c42fe03df2bd3c53a3a9c7317ad91d80c81cd1fb0caec8d7cc4cd2bfa10c222" dependencies = [ "cc", "libc", @@ -415,9 +441,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.20" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" dependencies = [ "cc", "libc", @@ -427,9 +453,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -437,15 +463,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memoffset" @@ -459,7 +485,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=e3163d8bbb77c701b28e6e53ae75faf5727166d2#e3163d8bbb77c701b28e6e53ae75faf5727166d2" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=553227a81dd73368e749e30e2cf5d7457fcc9f68#553227a81dd73368e749e30e2cf5d7457fcc9f68" dependencies = [ "atomic", "atomic-traits", @@ -498,12 +524,12 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=e3163d8bbb77c701b28e6e53ae75faf5727166d2#e3163d8bbb77c701b28e6e53ae75faf5727166d2" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=553227a81dd73368e749e30e2cf5d7457fcc9f68#553227a81dd73368e749e30e2cf5d7457fcc9f68" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] @@ -542,37 +568,52 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" -version = "1.7.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] [[package]] name = "probe" @@ -606,22 +647,28 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rayon" version = "1.10.0" @@ -644,9 +691,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" dependencies = [ "aho-corasick", "memchr", @@ -656,9 +703,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" dependencies = [ "aho-corasick", "memchr", @@ -667,9 +714,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" [[package]] name = "rustc_version" @@ -682,9 +729,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "scopeguard" @@ -694,9 +741,29 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] [[package]] name = "shlex" @@ -706,9 +773,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "spin" @@ -727,21 +794,20 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strum" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" [[package]] name = "strum_macros" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" dependencies = [ "heck", "proc-macro2", "quote", - "rustversion", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] @@ -756,9 +822,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -781,9 +847,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -796,40 +862,41 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-joining-type" -version = "0.7.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f8cb47ccb8bc750808755af3071da4a10dcd147b68fc874b7ae4b12543f6f5" +checksum = "d8d00a78170970967fdb83f9d49b92f959ab2bb829186b113e4f4604ad98e180" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -856,6 +923,15 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "winapi" version = "0.3.9" @@ -885,7 +961,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ "windows-core", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -897,7 +973,7 @@ dependencies = [ "windows-implement", "windows-interface", "windows-result", - "windows-targets", + "windows-targets 0.52.6", ] [[package]] @@ -908,7 +984,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] [[package]] @@ -919,25 +995,40 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.106", ] +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + [[package]] name = "windows-result" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", ] [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", ] [[package]] @@ -946,14 +1037,31 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] [[package]] @@ -962,44 +1070,101 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 40651556..8716ca95 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -36,7 +36,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/tianleq/mmtk-core.git", rev = "e3163d8bbb77c701b28e6e53ae75faf5727166d2" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "553227a81dd73368e749e30e2cf5d7457fcc9f68" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index f0471b31..5520e88b 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -388,14 +388,6 @@ pub extern "C" fn mmtk_load_reference(mutator: *mut libc::c_void, o: ObjectRefer with_mutator!(|mutator| mutator.barrier().load_weak_reference(o)) } -#[no_mangle] -pub extern "C" fn mmtk_object_reference_clone_pre( - mutator: *mut libc::c_void, - obj: ObjectReference, -) { - with_mutator!(|mutator| mutator.barrier().object_reference_clone_pre(obj)) -} - /// Full pre barrier #[no_mangle] pub extern "C" fn mmtk_object_reference_write_pre( diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp index 11c59e0c..9d338cca 100644 --- a/openjdk/barriers/mmtkSATBBarrier.hpp +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -28,8 +28,6 @@ class MMTkSATBBarrierSetRuntime: public MMTkBarrierSetRuntime { } virtual void object_probable_write(oop new_obj) const override; virtual void load_reference(DecoratorSet decorators, oop value) const override; - virtual void clone_pre(DecoratorSet decorators, oop value) const override { - }; }; class MMTkSATBBarrierSetAssembler: public MMTkBarrierSetAssembler { diff --git a/openjdk/mmtk.h b/openjdk/mmtk.h index 98bbffba..da750071 100644 --- a/openjdk/mmtk.h +++ b/openjdk/mmtk.h @@ -65,8 +65,6 @@ extern void mmtk_array_copy_pre(MMTk_Mutator mutator, void* src, void* dst, size /// Full array-copy post-barrier extern void mmtk_array_copy_post(MMTk_Mutator mutator, void* src, void* dst, size_t count); -extern void mmtk_object_reference_clone_pre(MMTk_Mutator mutator, void* obj); - /// C2 slowpath allocation barrier extern void mmtk_object_probable_write(MMTk_Mutator mutator, void* obj); diff --git a/openjdk/mmtkBarrierSet.cpp b/openjdk/mmtkBarrierSet.cpp index 88f59d12..d0c4838a 100644 --- a/openjdk/mmtkBarrierSet.cpp +++ b/openjdk/mmtkBarrierSet.cpp @@ -160,7 +160,3 @@ void MMTkBarrierSetRuntime::object_reference_array_copy_post_call(void* src, voi void MMTkBarrierSetRuntime::load_reference_call(void* ref) { ::mmtk_load_reference((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, ref); } - -void MMTkBarrierSetRuntime::object_reference_clone_pre_call(void* ref) { - ::mmtk_object_reference_clone_pre((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, ref); -} \ No newline at end of file diff --git a/openjdk/mmtkBarrierSet.hpp b/openjdk/mmtkBarrierSet.hpp index c4415e82..37400e2a 100644 --- a/openjdk/mmtkBarrierSet.hpp +++ b/openjdk/mmtkBarrierSet.hpp @@ -72,7 +72,6 @@ class MMTkBarrierSetRuntime: public CHeapObj { static void object_reference_array_copy_pre_call(void* src, void* dst, size_t count); /// Generic arraycopy pre-barrier. Called by fast-paths. static void object_reference_array_copy_post_call(void* src, void* dst, size_t count); - static void object_reference_clone_pre_call(void* obj); /// Check if the address is a slow-path function. virtual bool is_slow_path_call(address call) const { return call == CAST_FROM_FN_PTR(address, object_reference_write_pre_call) @@ -80,8 +79,7 @@ class MMTkBarrierSetRuntime: public CHeapObj { || call == CAST_FROM_FN_PTR(address, object_reference_write_slow_call) || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_pre_call) || call == CAST_FROM_FN_PTR(address, object_reference_array_copy_post_call) - || call == CAST_FROM_FN_PTR(address, load_reference_call) - || call == CAST_FROM_FN_PTR(address, object_reference_clone_pre_call); + || call == CAST_FROM_FN_PTR(address, load_reference_call); } /// Full pre-barrier @@ -94,8 +92,6 @@ class MMTkBarrierSetRuntime: public CHeapObj { virtual void object_reference_array_copy_post(oop* src, oop* dst, size_t count) const {}; /// java.lang.Reference load barrier virtual void load_reference(DecoratorSet decorators, oop value) const {}; - /// Object clone pre-barrier - virtual void clone_pre(DecoratorSet decorators, oop value) const {}; /// Called at the end of every C2 slowpath allocation. /// Deoptimization can happen after C2 slowpath allocation, and the newly allocated object can be promoted. /// So this callback is requierd for any generational collectors. From f8cb6e66ba15b8bff7543d89f5095145a0959557 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 9 Sep 2025 22:08:31 +0800 Subject: [PATCH 29/42] Read concurrent_marking_active from plan ... instead of from a mutator instance. --- mmtk/Cargo.lock | 1174 ++++++++++++++++++++++++++++++++++++++++ mmtk/Cargo.toml | 2 +- mmtk/src/collection.rs | 19 +- 3 files changed, 1185 insertions(+), 10 deletions(-) create mode 100644 mmtk/Cargo.lock diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock new file mode 100644 index 00000000..10c98f23 --- /dev/null +++ b/mmtk/Cargo.lock @@ -0,0 +1,1174 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + +[[package]] +name = "atomic" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "atomic-traits" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707f750b93bd1b739cf9ddf85f8fe7c97a4a62c60ccf8b6f232514bd9103bedc" +dependencies = [ + "cfg-if", + "rustc_version", +] + +[[package]] +name = "atomic_refcell" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "bitflags" +version = "2.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" + +[[package]] +name = "built" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" +dependencies = [ + "git2", +] + +[[package]] +name = "bytemuck" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "cc" +version = "1.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5252b3d2648e5eedbc1a6f501e3c795e07025c1e93bbf8bbdd6eef7f447a6d54" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "delegate" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6178a82cf56c836a3ba61a7935cdb1c49bfaa6fa4327cd5bf554a503087de26b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "downcast-rs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117240f60069e65410b3ae1bb213295bd828f707b5bec6596a1afc8793ce0cbc" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "env_filter" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + +[[package]] +name = "git2" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "url", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279259b0ac81c89d11c290495fdcfa96ea3643b7df311c138b6fe8ca5237f0f8" +dependencies = [ + "idna_mapping", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna_mapping" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c13906586a4b339310541a274dd927aff6fcbb5b8e3af90634c4b31681c792" +dependencies = [ + "unicode-joining-type", +] + +[[package]] +name = "is-terminal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "jiff" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", +] + +[[package]] +name = "jiff-static" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom", + "libc", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "libgit2-sys" +version = "0.18.2+1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c42fe03df2bd3c53a3a9c7317ad91d80c81cd1fb0caec8d7cc4cd2bfa10c222" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + +[[package]] +name = "libz-sys" +version = "1.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mmtk" +version = "0.31.0" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=70ef1db7e064d8517b5ba47419cea007940ed864#70ef1db7e064d8517b5ba47419cea007940ed864" +dependencies = [ + "atomic", + "atomic-traits", + "atomic_refcell", + "built", + "bytemuck", + "bytemuck_derive", + "cfg-if", + "crossbeam", + "delegate", + "downcast-rs", + "enum-map", + "env_logger", + "idna_adapter", + "is-terminal", + "itertools", + "lazy_static", + "libc", + "log", + "memoffset", + "mmtk-macros", + "num-traits", + "num_cpus", + "portable-atomic", + "probe", + "rayon-core", + "regex", + "rustversion", + "spin", + "static_assertions", + "strum", + "strum_macros", + "sysinfo", +] + +[[package]] +name = "mmtk-macros" +version = "0.31.0" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=70ef1db7e064d8517b5ba47419cea007940ed864#70ef1db7e064d8517b5ba47419cea007940ed864" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "mmtk_openjdk" +version = "0.31.0" +dependencies = [ + "atomic", + "built", + "cfg-if", + "lazy_static", + "libc", + "log", + "memoffset", + "mmtk", + "once_cell", + "probe", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "portable-atomic" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "probe" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e2d2444b730c8f027344c60f9e1f1554d7a3342df9bdd425142ed119a6e5a3" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strum" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" + +[[package]] +name = "strum_macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows", +] + +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-joining-type" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d00a78170970967fdb83f9d49b92f959ab2bb829186b113e4f4604ad98e180" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.14.4+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a5f4a424faf49c3c2c344f166f0662341d470ea185e939657aaff130f0ec4a" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.3", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "wit-bindgen" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index e9176d0d..04177e73 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -36,7 +36,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/tianleq/mmtk-core.git", rev = "c442dcd36e45ba0ed2021afdd3703861458b50ea" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "70ef1db7e064d8517b5ba47419cea007940ed864" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index e2267b0f..4e71d610 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -3,7 +3,7 @@ use mmtk::util::opaque_pointer::*; use mmtk::vm::{Collection, GCThreadContext}; use mmtk::Mutator; -use crate::UPCALLS; +use crate::{singleton, UPCALLS}; use crate::{MutatorClosure, OpenJDK}; pub struct VMCollection {} @@ -24,16 +24,17 @@ impl Collection> for VMCollection { } fn resume_mutators(tls: VMWorkerThread) { - if *crate::singleton::().get_options().plan == mmtk::util::options::PlanSelector::ConcurrentImmix { + if *crate::singleton::().get_options().plan + == mmtk::util::options::PlanSelector::ConcurrentImmix + { // For concurrent Immix, we need to check if SATB is active - use mmtk::vm::ActivePlan; - use mmtk::MutatorContext; + let concurrent_plan = singleton::().get_plan().concurrent().unwrap(); + let concurrent_marking_active = concurrent_plan.concurrent_work_in_progress(); - // Just get the first mutator: we assume all mutators have the same barrier active state. - let mutator: &mut Mutator> = crate::active_plan::VMActivePlan::mutators().next().unwrap(); - unsafe { crate::CONCURRENT_MARKING_ACTIVE = if mutator.barrier().is_active() { 1 } else { 0 }; } - log::debug!("Use mutator: {:?}", mutator as *mut _); - log::debug!("Set CONCURRENT_MARKING_ACTIVE to {}", unsafe { crate::CONCURRENT_MARKING_ACTIVE }); + unsafe { + crate::CONCURRENT_MARKING_ACTIVE = if concurrent_marking_active { 1 } else { 0 }; + } + log::debug!("Set CONCURRENT_MARKING_ACTIVE to {concurrent_marking_active}"); } unsafe { ((*UPCALLS).resume_mutators)(tls); From 4340fd65d582829ca5399d19f27ca77d31235caf Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 16 Sep 2025 11:22:18 +0800 Subject: [PATCH 30/42] Edit comment of CI script --- .github/configs/base.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/configs/base.yml b/.github/configs/base.yml index d420cd31..85837d0b 100644 --- a/.github/configs/base.yml +++ b/.github/configs/base.yml @@ -6,7 +6,6 @@ suites: type: DaCapo # Need running-ng to support 23.9 release: evaluation - # This is expanded in CI when we run with the config. path: "DACAPO_PATH/dacapo-23.9-RC3-chopin.jar" minheap: mmtk-openjdk-11-MarkCompact # Min heap values are from dacapo-evaluation-git-04132797 @@ -91,3 +90,7 @@ runtimes: type: OpenJDK release: 11 home: "/home/runner/work/mmtk-openjdk/mmtk-openjdk/bundles/jdk" + +# We don't include `configs` or `benchmarks` here. +# This file will be included by `large-heap.yml` and `normal-heap.yml` +# so that we can test different plans with different heap sizes. From aee8a7da3cf51044b2dd248fd6666d1bc0d2c60a Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 16 Sep 2025 11:41:50 +0800 Subject: [PATCH 31/42] Check mmtk_enable_barrier_fastpath at run time --- openjdk/barriers/mmtkObjectBarrier.cpp | 10 +- openjdk/barriers/mmtkSATBBarrier.cpp | 256 ++++++++++++------------- 2 files changed, 133 insertions(+), 133 deletions(-) diff --git a/openjdk/barriers/mmtkObjectBarrier.cpp b/openjdk/barriers/mmtkObjectBarrier.cpp index f3a3269c..5f14723c 100644 --- a/openjdk/barriers/mmtkObjectBarrier.cpp +++ b/openjdk/barriers/mmtkObjectBarrier.cpp @@ -155,11 +155,11 @@ void MMTkObjectBarrierSetAssembler::generate_c1_post_write_barrier_runtime_stub( __ save_live_registers_no_oop_map(true); -#if MMTK_ENABLE_BARRIER_FASTPATH - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); -#else - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), 3); -#endif + if (mmtk_enable_barrier_fastpath) { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); + } else { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_post_call), 3); + } __ restore_live_registers(true); diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 19a23e79..7b2af9b1 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -25,19 +25,19 @@ void MMTkSATBBarrierSetRuntime::object_probable_write(oop new_obj) const { } void MMTkSATBBarrierSetRuntime::object_reference_write_pre(oop src, oop* slot, oop target) const { -#if MMTK_ENABLE_BARRIER_FASTPATH - // oop pre_val = *slot; - // if (pre_val == NULL) return; - intptr_t addr = ((intptr_t) (void*) src); - const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> 6)); - intptr_t shift = (addr >> 3) & 0b111; - uint8_t byte_val = *meta_addr; - if (((byte_val >> shift) & 1) == kUnloggedValue) { - object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + if (mmtk_enable_barrier_fastpath) { + // oop pre_val = *slot; + // if (pre_val == NULL) return; + intptr_t addr = ((intptr_t) (void*) src); + const volatile uint8_t * meta_addr = (const volatile uint8_t *) (side_metadata_base_address() + (addr >> 6)); + intptr_t shift = (addr >> 3) & 0b111; + uint8_t byte_val = *meta_addr; + if (((byte_val >> shift) & 1) == kUnloggedValue) { + object_reference_write_slow_call((void*) src, (void*) slot, (void*) target); + } + } else { + object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); } -#else - object_reference_write_pre_call((void*) src, (void*) slot, (void*) target); -#endif } #define __ masm-> @@ -75,56 +75,56 @@ void MMTkSATBBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet dec void MMTkSATBBarrierSetAssembler::object_reference_write_pre(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2) const { if (can_remove_barrier(decorators, val, /* skip_const_null */ false)) return; - #if MMTK_ENABLE_BARRIER_FASTPATH - Label done; - - Register obj = dst.base(); - Register tmp3 = rscratch1; - Register tmp4 = rscratch2; - Register tmp5 = tmp1 == dst.base() || tmp1 == dst.index() ? tmp2 : tmp1; - - // tmp5 = load-byte (side_metadata_base_address() + (obj >> 6)); - __ movptr(tmp3, obj); - // __ load_heap_oop(tmp3, dst, noreg, noreg, AS_RAW); - // // Is the previous value null? - // __ cmpptr(tmp3, (int32_t) NULL_WORD); - // __ jcc(Assembler::equal, done); - - __ shrptr(tmp3, 6); - __ movptr(tmp5, side_metadata_base_address()); - __ movzbl(tmp5, Address(tmp5, tmp3)); - - // tmp3 = (obj >> 3) & 7 - __ mov(tmp3, obj); - __ shrptr(tmp3, 3); - __ andptr(tmp3, 7); - // tmp5 = tmp5 >> tmp3 - __ movptr(tmp4, rcx); - __ movl(rcx, tmp3); - __ shrptr(tmp5); - __ movptr(rcx, tmp4); - // if ((tmp5 & 1) == 1) goto slowpath; - __ andptr(tmp5, 1); - __ cmpptr(tmp5, kUnloggedValue); - __ jcc(Assembler::notEqual, done); - - // TODO: Spill fewer registers - __ pusha(); - __ movptr(c_rarg0, dst.base()); - __ lea(c_rarg1, dst); - __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); - __ popa(); + if (mmtk_enable_barrier_fastpath) { + Label done; + + Register obj = dst.base(); + Register tmp3 = rscratch1; + Register tmp4 = rscratch2; + Register tmp5 = tmp1 == dst.base() || tmp1 == dst.index() ? tmp2 : tmp1; + + // tmp5 = load-byte (side_metadata_base_address() + (obj >> 6)); + __ movptr(tmp3, obj); + // __ load_heap_oop(tmp3, dst, noreg, noreg, AS_RAW); + // // Is the previous value null? + // __ cmpptr(tmp3, (int32_t) NULL_WORD); + // __ jcc(Assembler::equal, done); + + __ shrptr(tmp3, 6); + __ movptr(tmp5, side_metadata_base_address()); + __ movzbl(tmp5, Address(tmp5, tmp3)); + + // tmp3 = (obj >> 3) & 7 + __ mov(tmp3, obj); + __ shrptr(tmp3, 3); + __ andptr(tmp3, 7); + // tmp5 = tmp5 >> tmp3 + __ movptr(tmp4, rcx); + __ movl(rcx, tmp3); + __ shrptr(tmp5); + __ movptr(rcx, tmp4); + // if ((tmp5 & 1) == 1) goto slowpath; + __ andptr(tmp5, 1); + __ cmpptr(tmp5, kUnloggedValue); + __ jcc(Assembler::notEqual, done); - __ bind(done); -#else - __ pusha(); - __ movptr(c_rarg0, dst.base()); - __ lea(c_rarg1, dst); - __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); - __ popa(); -#endif + // TODO: Spill fewer registers + __ pusha(); + __ movptr(c_rarg0, dst.base()); + __ lea(c_rarg1, dst); + __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); + __ popa(); + + __ bind(done); + } else { + __ pusha(); + __ movptr(c_rarg0, dst.base()); + __ lea(c_rarg1, dst); + __ movptr(c_rarg2, val == noreg ? (int32_t) NULL_WORD : val); + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); + __ popa(); + } } void MMTkSATBBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) { @@ -169,11 +169,11 @@ void MMTkSATBBarrierSetAssembler::generate_c1_pre_write_barrier_runtime_stub(Stu __ save_live_registers_no_oop_map(true); -#if MMTK_ENABLE_BARRIER_FASTPATH - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); -#else - __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); -#endif + if (mmtk_enable_barrier_fastpath) { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), 3); + } else { + __ call_VM_leaf_base(FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), 3); + } __ restore_live_registers(true); @@ -311,47 +311,47 @@ void MMTkSATBBarrierSetC1::object_reference_write_pre(LIRAccess& access, LIR_Opr MMTkC1PreBarrierStub* slow = new MMTkC1PreBarrierStub(src, slot, new_val, info, needs_patching ? lir_patch_normal : lir_patch_none); if (needs_patching) slow->scratch = gen->new_register(T_OBJECT); -#if MMTK_ENABLE_BARRIER_FASTPATH - if (needs_patching) { - // At this stage, slot address is not available, so cannot do the fast-path check until - // its address get resolved - // FIXME: Jump to a medium-path for code patching without entering slow-path - __ jump(slow); + if (mmtk_enable_barrier_fastpath) { + if (needs_patching) { + // At this stage, slot address is not available, so cannot do the fast-path check until + // its address get resolved + // FIXME: Jump to a medium-path for code patching without entering slow-path + __ jump(slow); + } else { + // // load pre_val + // LIR_Address* slot_addr = new LIR_Address(slot, T_OBJECT); + // LIR_Opr addr = slot; + // __ load(slot_addr, addr); + // // if pre_val == NULL skip the barrier + // __ cmp(lir_cond_equal, addr, LIR_OprFact::oopConst(NULL)); + // __ branch(lir_cond_equal, T_OBJECT, slow->continuation()); + LIR_Opr addr = src; + // uint8_t* meta_addr = (uint8_t*) (side_metadata_base_address() + (addr >> 6)); + LIR_Opr offset = gen->new_pointer_register(); + __ move(addr, offset); + __ unsigned_shift_right(offset, 6, offset); + LIR_Opr base = gen->new_pointer_register(); + __ move(LIR_OprFact::longConst(side_metadata_base_address()), base); + LIR_Address* meta_addr = new LIR_Address(base, offset, T_BYTE); + // uint8_t byte_val = *meta_addr; + LIR_Opr byte_val = gen->new_register(T_INT); + __ move(meta_addr, byte_val); + + // intptr_t shift = (addr >> 3) & 0b111; + LIR_Opr shift = gen->new_register(T_INT); + __ move(addr, shift); + __ unsigned_shift_right(shift, 3, shift); + __ logical_and(shift, LIR_OprFact::intConst(0b111), shift); + // if (((byte_val >> shift) & 1) == 1) slow; + LIR_Opr result = byte_val; + __ unsigned_shift_right(result, shift, result, LIR_OprFact::illegalOpr); + __ logical_and(result, LIR_OprFact::intConst(1), result); + __ cmp(lir_cond_equal, result, LIR_OprFact::intConst(1)); + __ branch(lir_cond_equal, T_BYTE, slow); + } } else { - // // load pre_val - // LIR_Address* slot_addr = new LIR_Address(slot, T_OBJECT); - // LIR_Opr addr = slot; - // __ load(slot_addr, addr); - // // if pre_val == NULL skip the barrier - // __ cmp(lir_cond_equal, addr, LIR_OprFact::oopConst(NULL)); - // __ branch(lir_cond_equal, T_OBJECT, slow->continuation()); - LIR_Opr addr = src; - // uint8_t* meta_addr = (uint8_t*) (side_metadata_base_address() + (addr >> 6)); - LIR_Opr offset = gen->new_pointer_register(); - __ move(addr, offset); - __ unsigned_shift_right(offset, 6, offset); - LIR_Opr base = gen->new_pointer_register(); - __ move(LIR_OprFact::longConst(side_metadata_base_address()), base); - LIR_Address* meta_addr = new LIR_Address(base, offset, T_BYTE); - // uint8_t byte_val = *meta_addr; - LIR_Opr byte_val = gen->new_register(T_INT); - __ move(meta_addr, byte_val); - - // intptr_t shift = (addr >> 3) & 0b111; - LIR_Opr shift = gen->new_register(T_INT); - __ move(addr, shift); - __ unsigned_shift_right(shift, 3, shift); - __ logical_and(shift, LIR_OprFact::intConst(0b111), shift); - // if (((byte_val >> shift) & 1) == 1) slow; - LIR_Opr result = byte_val; - __ unsigned_shift_right(result, shift, result, LIR_OprFact::illegalOpr); - __ logical_and(result, LIR_OprFact::intConst(1), result); - __ cmp(lir_cond_equal, result, LIR_OprFact::intConst(1)); - __ branch(lir_cond_equal, T_BYTE, slow); + __ jump(slow); } -#else - __ jump(slow); -#endif __ branch_destination(slow->continuation()); } @@ -365,30 +365,30 @@ void MMTkSATBBarrierSetC2::object_reference_write_pre(GraphKit* kit, Node* src, MMTkIdealKit ideal(kit, true); -#if MMTK_ENABLE_BARRIER_FASTPATH - Node* no_base = __ top(); - float unlikely = PROB_UNLIKELY(0.999); - - Node* zero = __ ConI(0); - Node* addr = __ CastPX(__ ctrl(), src); - Node* meta_addr = __ AddP(no_base, __ ConP(side_metadata_base_address()), __ URShiftX(addr, __ ConI(6))); - Node* byte = __ load(__ ctrl(), meta_addr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); - - Node* shift = __ URShiftX(addr, __ ConI(3)); - shift = __ AndI(__ ConvL2I(shift), __ ConI(7)); - Node* result = __ AndI(__ URShiftI(byte, shift), __ ConI(1)); - __ if_then(result, BoolTest::ne, zero, unlikely); { + if (mmtk_enable_barrier_fastpath) { + Node* no_base = __ top(); + float unlikely = PROB_UNLIKELY(0.999); + + Node* zero = __ ConI(0); + Node* addr = __ CastPX(__ ctrl(), src); + Node* meta_addr = __ AddP(no_base, __ ConP(side_metadata_base_address()), __ URShiftX(addr, __ ConI(6))); + Node* byte = __ load(__ ctrl(), meta_addr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw); + + Node* shift = __ URShiftX(addr, __ ConI(3)); + shift = __ AndI(__ ConvL2I(shift), __ ConI(7)); + Node* result = __ AndI(__ URShiftI(byte, shift), __ ConI(1)); + __ if_then(result, BoolTest::ne, zero, unlikely); { + const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM); + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), "mmtk_barrier_call", src, slot, val); + } __ end_if(); + } else { const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM); - Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_slow_call), "mmtk_barrier_call", src, slot, val); - } __ end_if(); -#else - const TypeFunc* tf = __ func_type(TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM, TypeOopPtr::BOTTOM); - Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), "mmtk_barrier_call", src, slot, val); - // Looks like this is necessary - // See https://github.com/mmtk/openjdk/blob/c82e5c44adced4383162826c2c3933a83cfb139b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp#L288-L291 - Node* call = __ ctrl()->in(0); - call->add_req(slot); -#endif + Node* x = __ make_leaf_call(tf, FN_ADDR(MMTkBarrierSetRuntime::object_reference_write_pre_call), "mmtk_barrier_call", src, slot, val); + // Looks like this is necessary + // See https://github.com/mmtk/openjdk/blob/c82e5c44adced4383162826c2c3933a83cfb139b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp#L288-L291 + Node* call = __ ctrl()->in(0); + call->add_req(slot); + } kit->final_sync(ideal); // Final sync IdealKit and GraphKit. } From 68a23826eeb2c1aefc6906fa82e47275da6b949f Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 16 Sep 2025 12:32:19 +0800 Subject: [PATCH 32/42] Edit comment --- openjdk/barriers/mmtkSATBBarrier.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 7b2af9b1..35c6e941 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -1,4 +1,5 @@ -#define private public // too lazy to change openjdk... +// Workaround the fact that LIR_Assembler::as_Address is private. +#define private public #include "precompiled.hpp" #include "mmtkSATBBarrier.hpp" From fa45277d2e02795214ccafda996c112173d312ef Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 16 Sep 2025 12:50:57 +0800 Subject: [PATCH 33/42] Bump mmtk repo revision --- mmtk/Cargo.lock | 51 +++++++++++++++++++++++++++++++++---------------- mmtk/Cargo.toml | 2 +- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 10c98f23..46601bbd 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.36" +version = "1.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5252b3d2648e5eedbc1a6f501e3c795e07025c1e93bbf8bbdd6eef7f447a6d54" +checksum = "65193589c6404eb80b450d618eaf9a2cafaaafd57ecce47370519ef674a7bd44" dependencies = [ "find-msvc-tools", "jobserver", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=70ef1db7e064d8517b5ba47419cea007940ed864#70ef1db7e064d8517b5ba47419cea007940ed864" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=815cc172a0422c21ab8cf4922c856a3883446ec7#815cc172a0422c21ab8cf4922c856a3883446ec7" dependencies = [ "atomic", "atomic-traits", @@ -531,7 +531,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=70ef1db7e064d8517b5ba47419cea007940ed864#70ef1db7e064d8517b5ba47419cea007940ed864" +source = "git+https://github.com/tianleq/mmtk-core.git?rev=815cc172a0422c21ab8cf4922c856a3883446ec7#815cc172a0422c21ab8cf4922c856a3883446ec7" dependencies = [ "proc-macro-error", "proc-macro2", @@ -748,24 +748,34 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.224" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "6aaeb1e94f53b16384af593c71e20b095e958dab1d26939c1b70645c5cfbcc0b" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.224" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f39390fa6346e24defbcdd3d9544ba8a19985d0af74df8501fbfe9a64341ab" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.224" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "87ff78ab5e8561c9a675bfc1785cb07ae721f0ee53329a595cefd8c04c2ac4e0" dependencies = [ "proc-macro2", "quote", @@ -875,9 +885,9 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-joining-type" @@ -932,9 +942,18 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" -version = "0.14.4+wasi-0.2.4" +version = "0.14.7+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" +dependencies = [ + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a5f4a424faf49c3c2c344f166f0662341d470ea185e939657aaff130f0ec4a" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ "wit-bindgen", ] @@ -1169,6 +1188,6 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "wit-bindgen" -version = "0.45.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 04177e73..8e0ca743 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -36,7 +36,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/tianleq/mmtk-core.git", rev = "70ef1db7e064d8517b5ba47419cea007940ed864" } +mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "815cc172a0422c21ab8cf4922c856a3883446ec7" } # Uncomment the following to build locally # mmtk = { path = "../../mmtk-core" } From 822da6be4f7fb51b7e21b34264a0fac35900a74c Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 16 Sep 2025 12:52:20 +0800 Subject: [PATCH 34/42] Ensure files end with newline --- openjdk/mmtkBarrierSetC1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjdk/mmtkBarrierSetC1.cpp b/openjdk/mmtkBarrierSetC1.cpp index 8df47147..df978ce2 100644 --- a/openjdk/mmtkBarrierSetC1.cpp +++ b/openjdk/mmtkBarrierSetC1.cpp @@ -58,4 +58,4 @@ void MMTkC1PreBarrierStub::emit_code(LIR_Assembler* ce) { void MMTkC1ReferenceLoadBarrierStub::emit_code(LIR_Assembler* ce) { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); bs->generate_c1_ref_load_barrier_stub_call(ce, this); -} \ No newline at end of file +} From 52d73c74f1acabb76cb74e152fbec51e597d8042 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Wed, 17 Sep 2025 09:18:28 +0800 Subject: [PATCH 35/42] Compressed oops for compressor --- .github/configs/normal-heap.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/configs/normal-heap.yml b/.github/configs/normal-heap.yml index 7a61e313..43b7b9ee 100644 --- a/.github/configs/normal-heap.yml +++ b/.github/configs/normal-heap.yml @@ -9,9 +9,7 @@ configs: - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-StickyImmix" - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkSweep" - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-MarkCompact" - # TODO: We need to disable compressed oops for Compressor temporarily until it supports - # discontiguous spaces. - - "jdk11-master|ms|s|fail_on_oom|tph|preserve|no_compressed_oops|mmtk_gc-Compressor" + - "jdk11-master|ms|s|fail_on_oom|tph|preserve|mmtk_gc-Compressor" # This will be expanded in CI when we run with the config. Keep a new line at the end. benchmarks: From 726f1aa57eecc9fb97970ab8fd2983143671b239 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Wed, 17 Sep 2025 09:28:46 +0800 Subject: [PATCH 36/42] Formatting and indentation. --- openjdk/barriers/mmtkSATBBarrier.cpp | 40 ++++++++++++------------- openjdk/mmtkBarrierSetAssembler_x86.cpp | 2 +- openjdk/mmtkBarrierSetAssembler_x86.hpp | 2 +- openjdk/mmtkBarrierSetC1.cpp | 6 ++-- openjdk/mmtkBarrierSetC1.hpp | 24 +++++++-------- 5 files changed, 35 insertions(+), 39 deletions(-) diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 35c6e941..5be6d94c 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -460,27 +460,27 @@ static void reference_load_barrier_for_unknown_load(GraphKit* kit, Node* base_oo Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset); __ if_then(offset, BoolTest::eq, referent_off, unlikely); { - // Update graphKit memory and control from IdealKit. + // Update graphKit memory and control from IdealKit. + kit->sync_kit(ideal); + Node* ref_klass_con = kit->makecon(TypeKlassPtr::make(kit->env()->Reference_klass())); + Node* is_instof = kit->gen_instanceof(base_oop, ref_klass_con); + // Update IdealKit memory and control from graphKit. + __ sync_kit(kit); + Node* one = __ ConI(1); + // is_instof == 0 if base_oop == NULL + __ if_then(is_instof, BoolTest::eq, one, unlikely); { + // Update graphKit from IdeakKit. kit->sync_kit(ideal); - Node* ref_klass_con = kit->makecon(TypeKlassPtr::make(kit->env()->Reference_klass())); - Node* is_instof = kit->gen_instanceof(base_oop, ref_klass_con); - // Update IdealKit memory and control from graphKit. + // Use the pre-barrier to record the value in the referent field + reference_load_barrier(kit, slot, val, false); + if (need_mem_bar) { + // Add memory barrier to prevent commoning reads from this field + // across safepoint since GC can change its value. + kit->insert_mem_bar(Op_MemBarCPUOrder); + } + // Update IdealKit from graphKit. __ sync_kit(kit); - Node* one = __ ConI(1); - // is_instof == 0 if base_oop == NULL - __ if_then(is_instof, BoolTest::eq, one, unlikely); { - // Update graphKit from IdeakKit. - kit->sync_kit(ideal); - // Use the pre-barrier to record the value in the referent field - reference_load_barrier(kit, slot, val, false); - if (need_mem_bar) { - // Add memory barrier to prevent commoning reads from this field - // across safepoint since GC can change its value. - kit->insert_mem_bar(Op_MemBarCPUOrder); - } - // Update IdealKit from graphKit. - __ sync_kit(kit); - } __ end_if(); // _ref_type != ref_none + } __ end_if(); // _ref_type != ref_none } __ end_if(); // offset == referent_offset // Final sync IdealKit and GraphKit. @@ -532,6 +532,4 @@ void MMTkSATBBarrierSetC2::clone(GraphKit* kit, Node* src, Node* dst, Node* size BarrierSetC2::clone(kit, src, dst, size, is_array); } - - #undef __ diff --git a/openjdk/mmtkBarrierSetAssembler_x86.cpp b/openjdk/mmtkBarrierSetAssembler_x86.cpp index 23dc090b..112cf97a 100644 --- a/openjdk/mmtkBarrierSetAssembler_x86.cpp +++ b/openjdk/mmtkBarrierSetAssembler_x86.cpp @@ -176,7 +176,7 @@ void MMTkBarrierSetAssembler::generate_c1_ref_load_barrier_runtime_stub(StubAsse #define __ ce->masm()-> void MMTkBarrierSetAssembler::generate_c1_ref_load_barrier_stub_call(LIR_Assembler* ce, MMTkC1ReferenceLoadBarrierStub* stub) { - MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1(); + MMTkBarrierSetC1* bs = (MMTkBarrierSetC1*)BarrierSet::barrier_set()->barrier_set_c1(); __ bind(*stub->entry()); assert(stub->val->is_register(), "Precondition."); diff --git a/openjdk/mmtkBarrierSetAssembler_x86.hpp b/openjdk/mmtkBarrierSetAssembler_x86.hpp index e8c5c8b6..47bade05 100644 --- a/openjdk/mmtkBarrierSetAssembler_x86.hpp +++ b/openjdk/mmtkBarrierSetAssembler_x86.hpp @@ -29,7 +29,7 @@ class MMTkBarrierSetAssembler: public BarrierSetAssembler { return !in_heap || (skip_const_null && val == noreg); } - /// Generate C1 pre write barrier slow-call assembly code + /// Generate C1 pre write barrier slow-call assembly code virtual void generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const {}; /// Generate C1 post write barrier slow-call assembly code virtual void generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const {}; diff --git a/openjdk/mmtkBarrierSetC1.cpp b/openjdk/mmtkBarrierSetC1.cpp index df978ce2..09f6e469 100644 --- a/openjdk/mmtkBarrierSetC1.cpp +++ b/openjdk/mmtkBarrierSetC1.cpp @@ -5,7 +5,6 @@ void MMTkBarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) { class MMTkPreBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { - virtual OopMapSet* generate_code(StubAssembler* sasm) override { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); bs->generate_c1_pre_write_barrier_runtime_stub(sasm); @@ -32,16 +31,16 @@ void MMTkBarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) { // MMTkBarrierCodeGenClosure write_code_gen_cl_patch_fix(true); // _write_barrier_c1_runtime_code_blob_with_patch_fix = Runtime1::generate_blob(buffer_blob, -1, "write_code_gen_cl_patch_fix", false, &write_code_gen_cl_patch_fix); -class MMTkRefLoadBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { + class MMTkRefLoadBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { virtual OopMapSet* generate_code(StubAssembler* sasm) override { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); bs->generate_c1_ref_load_barrier_runtime_stub(sasm); return NULL; } }; + MMTkRefLoadBarrierCodeGenClosure load_code_gen_cl; _ref_load_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1, "load_code_gen_cl", false, &load_code_gen_cl); - } void MMTkC1PostBarrierStub::emit_code(LIR_Assembler* ce) { @@ -54,7 +53,6 @@ void MMTkC1PreBarrierStub::emit_code(LIR_Assembler* ce) { bs->generate_c1_pre_write_barrier_stub(ce, this); } - void MMTkC1ReferenceLoadBarrierStub::emit_code(LIR_Assembler* ce) { MMTkBarrierSetAssembler* bs = (MMTkBarrierSetAssembler*) BarrierSet::barrier_set()->barrier_set_assembler(); bs->generate_c1_ref_load_barrier_stub_call(ce, this); diff --git a/openjdk/mmtkBarrierSetC1.hpp b/openjdk/mmtkBarrierSetC1.hpp index 487b996c..8d65b6b3 100644 --- a/openjdk/mmtkBarrierSetC1.hpp +++ b/openjdk/mmtkBarrierSetC1.hpp @@ -80,15 +80,16 @@ struct MMTkC1PreBarrierStub: CodeStub { LIR_PatchCode patch_code; // Enable code patching? LIR_Opr scratch = NULL; // Scratch register for the resolved field -MMTkC1PreBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none): src(src), slot(slot), new_val(new_val), info(info), patch_code(patch_code) {} + MMTkC1PreBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* info = NULL, LIR_PatchCode patch_code = lir_patch_none): src(src), slot(slot), new_val(new_val), info(info), patch_code(patch_code) {} virtual void emit_code(LIR_Assembler* ce) override; virtual void visit(LIR_OpVisitState* visitor) override { - if (info != NULL) - visitor->do_slow_case(info); - else - visitor->do_slow_case(); + if (info != NULL) { + visitor->do_slow_case(info); + } else { + visitor->do_slow_case(); + } if (src != NULL) visitor->do_input(src); if (slot != NULL) visitor->do_input(slot); if (new_val != NULL) visitor->do_input(new_val); @@ -107,17 +108,15 @@ MMTkC1PreBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val, CodeEmitInfo* i struct MMTkC1PostBarrierStub: CodeStub { LIR_Opr src, slot, new_val; -MMTkC1PostBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val): src(src), slot(slot), new_val(new_val) {} + MMTkC1PostBarrierStub(LIR_Opr src, LIR_Opr slot, LIR_Opr new_val): src(src), slot(slot), new_val(new_val) {} virtual void emit_code(LIR_Assembler* ce) override; virtual void visit(LIR_OpVisitState* visitor) override { - visitor->do_slow_case(); if (src != NULL) visitor->do_input(src); if (slot != NULL) visitor->do_input(slot); if (new_val != NULL) visitor->do_input(new_val); - } NOT_PRODUCT(virtual void print_name(outputStream* out) const { out->print("MMTkC1PostBarrierStub"); }); @@ -132,10 +131,11 @@ struct MMTkC1ReferenceLoadBarrierStub: CodeStub { virtual void emit_code(LIR_Assembler* ce) override; virtual void visit(LIR_OpVisitState* visitor) override { - if (info != NULL) - visitor->do_slow_case(info); - else - visitor->do_slow_case(); + if (info != NULL) { + visitor->do_slow_case(info); + } else { + visitor->do_slow_case(); + } if (val != NULL) visitor->do_input(val); } From 90a544e4b2aebcc7753d6c433fb2a6a0d12382ab Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Wed, 17 Sep 2025 14:31:35 +0800 Subject: [PATCH 37/42] Remove pre_val and fix atomic xchg --- openjdk/barriers/mmtkSATBBarrier.cpp | 2 +- openjdk/barriers/mmtkSATBBarrier.hpp | 9 +++++---- openjdk/mmtkBarrierSetC2.hpp | 15 +++++---------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 5be6d94c..c9415b33 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -361,7 +361,7 @@ void MMTkSATBBarrierSetC1::object_reference_write_pre(LIRAccess& access, LIR_Opr #define __ ideal. -void MMTkSATBBarrierSetC2::object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* pre_val, Node* val) const { +void MMTkSATBBarrierSetC2::object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* val) const { if (can_remove_barrier(kit, &kit->gvn(), src, slot, val, /* skip_const_null */ false)) return; MMTkIdealKit ideal(kit, true); diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp index 9d338cca..8fe0736a 100644 --- a/openjdk/barriers/mmtkSATBBarrier.hpp +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -54,7 +54,7 @@ class MMTkSATBBarrierSetC1: public MMTkBarrierSetC1 { class MMTkSATBBarrierSetC2: public MMTkBarrierSetC2 { protected: - virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* pre_val, Node* val) const override; + virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* val) const override; public: virtual bool array_copy_requires_gc_barriers(BasicType type) const override { @@ -63,15 +63,16 @@ class MMTkSATBBarrierSetC2: public MMTkBarrierSetC2 { virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const override; virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const override; - virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const { + virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const override { + if (access.is_oop()) { + object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); + } Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type); if (access.is_oop()) { - object_reference_write_pre(access.kit(), access.base(), access.addr().node(), result, new_val); object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); } return result; } - }; struct MMTkSATBBarrier: MMTkBarrierImpl< diff --git a/openjdk/mmtkBarrierSetC2.hpp b/openjdk/mmtkBarrierSetC2.hpp index 2755f672..d8052d9a 100644 --- a/openjdk/mmtkBarrierSetC2.hpp +++ b/openjdk/mmtkBarrierSetC2.hpp @@ -49,35 +49,30 @@ class MMTkBarrierSetC2: public BarrierSetC2 { /// Barrier elision test virtual bool can_remove_barrier(GraphKit* kit, PhaseTransform* phase, Node* src, Node* slot, Node* val, bool skip_const_null) const; /// Full pre-barrier - virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* pre_val, Node* val) const {} + virtual void object_reference_write_pre(GraphKit* kit, Node* src, Node* slot, Node* val) const {} /// Full post-barrier virtual void object_reference_write_post(GraphKit* kit, Node* src, Node* slot, Node* val) const {} virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const { - if (access.is_oop()) { - IdealKit ideal(access.kit(), true); - uint alias_idx = access.kit()->C->get_alias_index(access.addr().type()); - Node* pre_val = ideal.load(ideal.ctrl(), access.addr().node(), static_cast(val.type()), access.type(), alias_idx); - object_reference_write_pre(access.kit(), access.base(), access.addr().node(), pre_val, val.node()); - } + if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), val.node()); Node* store = BarrierSetC2::store_at_resolved(access, val); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), val.node()); return store; } virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicAccess& access, Node* expected_val, Node* new_val, const Type* value_type) const { - if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), expected_val, new_val); + if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); Node* result = BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); return result; } virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicAccess& access, Node* expected_val, Node* new_val, const Type* value_type) const { - if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), expected_val, new_val); + if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); Node* load_store = BarrierSetC2::atomic_cmpxchg_bool_at_resolved(access, expected_val, new_val, value_type); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); return load_store; } virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const { - if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), NULL, new_val); + if (access.is_oop()) object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type); if (access.is_oop()) object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); return result; From f8f612981291499e83f83fdb5698b096cb073fdb Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Wed, 17 Sep 2025 14:53:39 +0800 Subject: [PATCH 38/42] Remove unnecessary overrides --- openjdk/barriers/mmtkSATBBarrier.cpp | 4 ---- openjdk/barriers/mmtkSATBBarrier.hpp | 12 ------------ 2 files changed, 16 deletions(-) diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index c9415b33..3d3b7d5e 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -528,8 +528,4 @@ Node* MMTkSATBBarrierSetC2::load_at_resolved(C2Access& access, const Type* val_t return load; } -void MMTkSATBBarrierSetC2::clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const { - BarrierSetC2::clone(kit, src, dst, size, is_array); -} - #undef __ diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp index 8fe0736a..7eade0d9 100644 --- a/openjdk/barriers/mmtkSATBBarrier.hpp +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -61,18 +61,6 @@ class MMTkSATBBarrierSetC2: public MMTkBarrierSetC2 { return false; } virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const override; - virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const override; - - virtual Node* atomic_xchg_at_resolved(C2AtomicAccess& access, Node* new_val, const Type* value_type) const override { - if (access.is_oop()) { - object_reference_write_pre(access.kit(), access.base(), access.addr().node(), new_val); - } - Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, new_val, value_type); - if (access.is_oop()) { - object_reference_write_post(access.kit(), access.base(), access.addr().node(), new_val); - } - return result; - } }; struct MMTkSATBBarrier: MMTkBarrierImpl< From ad0e7376d4e722b769e9684b46016ca893a47827 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Wed, 17 Sep 2025 16:50:54 +0800 Subject: [PATCH 39/42] Blank object_probable_write for SATB barrier --- openjdk/barriers/mmtkSATBBarrier.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openjdk/barriers/mmtkSATBBarrier.cpp b/openjdk/barriers/mmtkSATBBarrier.cpp index 3d3b7d5e..3a75ccc5 100644 --- a/openjdk/barriers/mmtkSATBBarrier.cpp +++ b/openjdk/barriers/mmtkSATBBarrier.cpp @@ -21,8 +21,10 @@ void MMTkSATBBarrierSetRuntime::load_reference(DecoratorSet decorators, oop valu }; void MMTkSATBBarrierSetRuntime::object_probable_write(oop new_obj) const { - // The slow-call will do the unlog bit check again (same as the above fast-path check) - mmtk_object_probable_write((MMTk_Mutator) &Thread::current()->third_party_heap_mutator, (void*) new_obj); + // We intentionally leave this method blank. + // This method is called after slowpath allocation exits. + // Because the new_obj is just allocated, + // it does not have any fields holding old values for the SATB barrier to remember. } void MMTkSATBBarrierSetRuntime::object_reference_write_pre(oop src, oop* slot, oop target) const { From 168942ffac8b493ed50903e81585a0f5633f5ac9 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Wed, 17 Sep 2025 17:26:57 +0800 Subject: [PATCH 40/42] Use the `override` keyword where applicable --- openjdk/barriers/mmtkObjectBarrier.hpp | 4 ++-- openjdk/barriers/mmtkSATBBarrier.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openjdk/barriers/mmtkObjectBarrier.hpp b/openjdk/barriers/mmtkObjectBarrier.hpp index 179cc1ef..c04081d3 100644 --- a/openjdk/barriers/mmtkObjectBarrier.hpp +++ b/openjdk/barriers/mmtkObjectBarrier.hpp @@ -32,9 +32,9 @@ class MMTkObjectBarrierSetAssembler: public MMTkBarrierSetAssembler { protected: virtual void object_reference_write_post(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2, bool compensate_val_reg) const override; /// Generate C1 write barrier slow-call assembly code - virtual void generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const; + virtual void generate_c1_post_write_barrier_runtime_stub(StubAssembler* sasm) const override; public: - virtual void generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const; + virtual void generate_c1_post_write_barrier_stub(LIR_Assembler* ce, MMTkC1PostBarrierStub* stub) const override; virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; virtual void arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; }; diff --git a/openjdk/barriers/mmtkSATBBarrier.hpp b/openjdk/barriers/mmtkSATBBarrier.hpp index 7eade0d9..1f5cf639 100644 --- a/openjdk/barriers/mmtkSATBBarrier.hpp +++ b/openjdk/barriers/mmtkSATBBarrier.hpp @@ -34,9 +34,9 @@ class MMTkSATBBarrierSetAssembler: public MMTkBarrierSetAssembler { protected: virtual void object_reference_write_pre(MacroAssembler* masm, DecoratorSet decorators, Address dst, Register val, Register tmp1, Register tmp2) const override; /// Generate C1 write barrier slow-call assembly code - virtual void generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const; + virtual void generate_c1_pre_write_barrier_runtime_stub(StubAssembler* sasm) const override; public: - virtual void generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const; + virtual void generate_c1_pre_write_barrier_stub(LIR_Assembler* ce, MMTkC1PreBarrierStub* stub) const override; virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) override; virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register dst, Address src, Register tmp1, Register tmp_thread) override; }; From 9ca08807593fb94d899c51613ba386fab87580db Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Thu, 18 Sep 2025 12:33:06 +1200 Subject: [PATCH 41/42] Update Cargo.toml --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 8e0ca743..00154029 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -38,7 +38,7 @@ probe = "0.5" # But other changes including adding/removing whitespaces in commented lines may break the CI. mmtk = { git = "https://github.com/tianleq/mmtk-core.git", rev = "815cc172a0422c21ab8cf4922c856a3883446ec7" } # Uncomment the following to build locally -# mmtk = { path = "../../mmtk-core" } +# mmtk = { path = "../repos/mmtk-core" } [build-dependencies] built = { version = "0.7.7", features = ["git2"] } From a569aa943188fe33cc33aad7115d9e92ca6725f4 Mon Sep 17 00:00:00 2001 From: mmtkgc-bot Date: Thu, 18 Sep 2025 07:01:34 +0000 Subject: [PATCH 42/42] Update mmtk-core to a4dd70cb70a116a32b1bbb20501c48f77f49181b --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 46601bbd..0e0c77a7 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=815cc172a0422c21ab8cf4922c856a3883446ec7#815cc172a0422c21ab8cf4922c856a3883446ec7" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=a4dd70cb70a116a32b1bbb20501c48f77f49181b#a4dd70cb70a116a32b1bbb20501c48f77f49181b" dependencies = [ "atomic", "atomic-traits", @@ -531,7 +531,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.31.0" -source = "git+https://github.com/tianleq/mmtk-core.git?rev=815cc172a0422c21ab8cf4922c856a3883446ec7#815cc172a0422c21ab8cf4922c856a3883446ec7" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=a4dd70cb70a116a32b1bbb20501c48f77f49181b#a4dd70cb70a116a32b1bbb20501c48f77f49181b" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 00154029..dee30842 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -36,7 +36,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/tianleq/mmtk-core.git", rev = "815cc172a0422c21ab8cf4922c856a3883446ec7" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "a4dd70cb70a116a32b1bbb20501c48f77f49181b" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" }