diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fc9464c..f1e10f32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,9 @@ jobs: # Run the tests - name: Dacapo Tests run: ./.github/scripts/ci-test-normal.sh + - name: Setup tmate session + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 # Run these checks after build diff --git a/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MMTkMutatorContext.java b/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MMTkMutatorContext.java index 1a616655..acd41407 100644 --- a/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MMTkMutatorContext.java +++ b/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MMTkMutatorContext.java @@ -139,9 +139,11 @@ public abstract class MMTkMutatorContext extends MutatorContext { @Entrypoint Address immixAllocator0Context; @Entrypoint - Address immixAllocator0Hot; + byte immixAllocator0Hot; @Entrypoint - Address immixAllocator0Copy; + byte immixAllocator0Copy; + byte immixAllocator0Pad0; + byte immixAllocator0Pad1; @Entrypoint Address immixAllocator0LargeCursor; @Entrypoint @@ -253,7 +255,7 @@ public abstract class MMTkMutatorContext extends MutatorContext { // Malloc allocator size. We do not need offsets for each field, as we don't need to implement fastpath for large object allocator. static final int MALLOC_ALLOCATOR_SIZE = 3 * BYTES_IN_WORD; // Immix allocator size - static final int IMMIX_ALLOCATOR_SIZE = 12 * BYTES_IN_WORD; + static final int IMMIX_ALLOCATOR_SIZE = 11 * BYTES_IN_WORD; // Free list allocator size static final int FREE_LIST_ALLOCATOR_SIZE = 7 * BYTES_IN_WORD; // Mark compact allocator size (the same as bump allocator) @@ -420,4 +422,9 @@ public void deinitMutator() { Address handle = Magic.objectAsAddress(this).plus(MUTATOR_BASE_OFFSET); sysCall.sysDestroyMutator(handle); } + + @Entrypoint + public static final int getInlinedMutatorSize() { + return MUTATOR_SIZE; + } } \ No newline at end of file diff --git a/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MSContext.java b/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MSContext.java index 692a0288..3a14abef 100644 --- a/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MSContext.java +++ b/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/MSContext.java @@ -19,15 +19,15 @@ @Uninterruptible public class MSContext extends MMTkMutatorContext { // DEFAULT: FreeListAllocator #0 (MarkSweepSpace) + // NonMomving: FreeListAllocator #1 (MarkSweepSpace) // CODE: BumpAllocator #0 (ImmortalSpace) // LARGECODE: BumpAllocator #1 (ImmortalSpace) // Immortal: BumpAllocator #2 (ImmortalSpace) - // NonMomving: BumpAllocator #3 (ImmortalSpace) // LOS: LargeObjectAllocator #0 (LargeObjectSpace) @Inline protected final int getAllocatorTag(int allocator) { - if (allocator == MMTkAllocator.DEFAULT) + if (allocator == MMTkAllocator.DEFAULT || allocator == MMTkAllocator.NONMOVING) return MMTkMutatorContext.TAG_FREE_LIST; else if (allocator == MMTkAllocator.LOS) return MMTkMutatorContext.TAG_LARGE_OBJECT; @@ -37,12 +37,10 @@ else if (allocator == MMTkAllocator.LOS) protected final int getAllocatorIndex(int allocator) { if (allocator == MMTkAllocator.DEFAULT || allocator == MMTkAllocator.CODE || allocator == MMTkAllocator.LOS) { return 0; - } else if (allocator == MMTkAllocator.LARGE_CODE) { + } else if (allocator == MMTkAllocator.LARGE_CODE || allocator == MMTkAllocator.NONMOVING) { return 1; } else if (allocator == MMTkAllocator.IMMORTAL) { return 2; - } else if (allocator == MMTkAllocator.NONMOVING) { - return 3; } else { VM.sysFail("Unexpected allocator", allocator); return 0; @@ -50,7 +48,7 @@ protected final int getAllocatorIndex(int allocator) { } @Inline protected final int getSpaceTag(int allocator) { - if (allocator == MMTkAllocator.DEFAULT) + if (allocator == MMTkAllocator.DEFAULT || allocator == MMTkAllocator.NONMOVING) return MMTkMutatorContext.MARK_SWEEP_SPACE; else if (allocator == MMTkAllocator.LOS) return MMTkMutatorContext.LARGE_OBJECT_SPACE; diff --git a/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/SSContext.java b/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/SSContext.java index 9a1365af..8f675129 100644 --- a/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/SSContext.java +++ b/jikesrvm/rvm/src/org/jikesrvm/mm/mminterface/SSContext.java @@ -22,13 +22,15 @@ public class SSContext extends MMTkMutatorContext { // CODE: BumpAllocator #1 (ImmortalSpace) // LARGE_CODE: BumpAllocator #2 (ImmortalSpace) // Immortal: BumpAllocator #3 (ImmortalSpace) - // NonMoving: BumpAllocator #4 (ImmortalSpace) // LOS: LargeObjectAllocator #0 (LargeObjectSpace) + // NonMoving: FreeListAllocator #0 (MarkSweepSpace) @Inline protected final int getAllocatorTag(int allocator) { if (allocator == MMTkAllocator.LOS) { return MMTkMutatorContext.TAG_LARGE_OBJECT; + } else if (allocator == MMTkAllocator.NONMOVING) { + return MMTkMutatorContext.TAG_FREE_LIST; } else { return MMTkMutatorContext.TAG_BUMP_POINTER; } @@ -44,7 +46,7 @@ protected final int getAllocatorIndex(int allocator) { } else if (allocator == MMTkAllocator.IMMORTAL) { return 3; } else if (allocator == MMTkAllocator.NONMOVING) { - return 4; + return 0; } else { VM.sysFail("Unexpected allocator", allocator); return 0; @@ -56,6 +58,8 @@ protected final int getSpaceTag(int allocator) { return COPY_SPACE; } else if (allocator == MMTkAllocator.LOS) { return LARGE_OBJECT_SPACE; + } else if (allocator == MMTkAllocator.NONMOVING) { + return MARK_SWEEP_SPACE; } else { return IMMORTAL_SPACE; } diff --git a/jikesrvm/rvm/src/org/jikesrvm/runtime/Entrypoints.java b/jikesrvm/rvm/src/org/jikesrvm/runtime/Entrypoints.java index f02bab40..5a0704a3 100644 --- a/jikesrvm/rvm/src/org/jikesrvm/runtime/Entrypoints.java +++ b/jikesrvm/rvm/src/org/jikesrvm/runtime/Entrypoints.java @@ -181,6 +181,9 @@ public class Entrypoints { public static final NormalMethod enqueueReferenceMethod = getMethod(org.jikesrvm.mm.mminterface.MemoryManager.class, "enqueueReference", "(Lorg/vmmagic/unboxed/Address;)V"); + public static final NormalMethod getInlinedMutatorSizeMethod = + getMethod(org.jikesrvm.mm.mminterface.MMTkMutatorContext.class, "getInlinedMutatorSize", "()I"); + public static final RVMField numThreadsField = getField(org.jikesrvm.scheduler.RVMThread.class, "numThreads", int.class); public static final RVMField isCollectorField = diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index c7a4a2c0..0d31cdea 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -424,7 +424,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.24.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=e79e94e744660c486d5471f252ff05c4248bcea9#e79e94e744660c486d5471f252ff05c4248bcea9" +source = "git+https://github.com/qinsoon/mmtk-core.git?rev=b4424295ebfd146cf45c5b1568524a5c64440093#b4424295ebfd146cf45c5b1568524a5c64440093" dependencies = [ "atomic", "atomic-traits", @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.24.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=e79e94e744660c486d5471f252ff05c4248bcea9#e79e94e744660c486d5471f252ff05c4248bcea9" +source = "git+https://github.com/qinsoon/mmtk-core.git?rev=b4424295ebfd146cf45c5b1568524a5c64440093#b4424295ebfd146cf45c5b1568524a5c64440093" dependencies = [ "proc-macro-error", "proc-macro2", @@ -710,9 +710,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.10" +version = "0.30.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d7c217777061d5a2d652aea771fb9ba98b6dade657204b08c4b9604d11555b" +checksum = "87341a165d73787554941cd5ef55ad728011566fe714e987d1b976c15dbc3a83" dependencies = [ "cfg-if", "core-foundation-sys", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 49ce2716..5db41b86 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -15,8 +15,8 @@ lto = true # Metadata for the JikesRVM repository [package.metadata.jikesrvm] # Our CI matches the following line and extract mmtk/jikesrvm. If this line is updated, please check ci yaml files and make sure it works. -jikesrvm_repo = "https://github.com/mmtk/jikesrvm.git" -jikesrvm_version = "a43efe4f33a6a69aabeb03e5c5e2e8880f96f047" +jikesrvm_repo = "https://github.com/qinsoon/jikesrvm.git" +jikesrvm_version = "9d04231d8a241e6309d99feea3850d936cc4ec68" [dependencies] libc = "0.2" @@ -28,7 +28,7 @@ log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] # - change branch/rev # - 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 = "e79e94e744660c486d5471f252ff05c4248bcea9" } +mmtk = { git = "https://github.com/qinsoon/mmtk-core.git", rev = "b4424295ebfd146cf45c5b1568524a5c64440093" } # Uncomment the following to build locally - if you change the path locally, do not commit the change in a PR # mmtk = { path = "../repos/mmtk-core" } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index d38206f9..fdb1e3f5 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -64,7 +64,7 @@ pub extern "C" fn jikesrvm_gc_init(jtoc: *mut c_void, heap_size: usize) { builder .options .vm_space_start - .set(unsafe { Address::from_usize(0x6000_0000) }); + .set(unsafe { Address::from_usize(0x7000_0000) }); builder.options.vm_space_size.set(0x800_0000); } @@ -133,6 +133,14 @@ pub extern "C" fn start_worker(tls: VMWorkerThread, worker: *mut GCWorker>(); + assert_eq!(java_inlined_mutator_size, rust_inlined_mutator_size); + } + // MMTk core renamed enable_collection() to initialize_collection(). The JikesRVM binding // never uses the new enable_collection() API so we just expose this as enable_collection(). // Also this is used by JikesRVM for third party heaps in places where it uses JavaMMTK's enableCollection().