Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to MMTk core PR #949 #152

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address bumpAllocator0SpaceFat;
@Entrypoint
Address bumpAllocator0Plan;
@Entrypoint
Address bumpAllocator0PlanFat;
Address bumpAllocator0Context;

// Bump Allocator 1
@Entrypoint
Expand All @@ -48,9 +46,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address bumpAllocator1SpaceFat;
@Entrypoint
Address bumpAllocator1Plan;
@Entrypoint
Address bumpAllocator1PlanFat;
Address bumpAllocator1Context;

// Bump Allocator 2
@Entrypoint
Expand All @@ -64,9 +60,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address bumpAllocator2SpaceFat;
@Entrypoint
Address bumpAllocator2Plan;
@Entrypoint
Address bumpAllocator2PlanFat;
Address bumpAllocator2Context;

// Bump Allocator 3
@Entrypoint
Expand All @@ -80,9 +74,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address bumpAllocator3SpaceFat;
@Entrypoint
Address bumpAllocator3Plan;
@Entrypoint
Address bumpAllocator3PlanFat;
Address bumpAllocator3Context;

// Bump Allocator 4
@Entrypoint
Expand All @@ -96,9 +88,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address bumpAllocator4SpaceFat;
@Entrypoint
Address bumpAllocator4Plan;
@Entrypoint
Address bumpAllocator4PlanFat;
Address bumpAllocator4Context;

// Bump Allocator 5
@Entrypoint
Expand All @@ -112,38 +102,30 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address bumpAllocator5SpaceFat;
@Entrypoint
Address bumpAllocator5Plan;
@Entrypoint
Address bumpAllocator5PlanFat;
Address bumpAllocator5Context;

// 2 x LargeObjectAllocator (1 x 4 words)
@Entrypoint
Address largeObjectAllocator0Tls;
@Entrypoint
Address largeObjectAllocator0Space;
@Entrypoint
Address largeObjectAllocator0Plan;
@Entrypoint
Address largeObjectAllocator0PlanFat;
Address largeObjectAllocator0Context;

@Entrypoint
Address largeObjectAllocator1Tls;
@Entrypoint
Address largeObjectAllocator1Space;
@Entrypoint
Address largeObjectAllocator1Plan;
@Entrypoint
Address largeObjectAllocator1PlanFat;
Address largeObjectAllocator1Context;

// 1 x MallocAllocator
@Entrypoint
Address mallocAllocator0Tls;
@Entrypoint
Address mallocAllocator0Space;
@Entrypoint
Address mallocAllocator0Plan;
@Entrypoint
Address mallocAllocator0PlanFat;
Address mallocAllocator0Context;

// 1 x ImmixAllocator
@Entrypoint
Expand All @@ -155,9 +137,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address immixAllocator0Space;
@Entrypoint
Address immixAllocator0Plan;
@Entrypoint
Address immixAllocator0PlanFat;
Address immixAllocator0Context;
@Entrypoint
Address immixAllocator0Hot;
@Entrypoint
Expand All @@ -179,9 +159,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address freeListAllocator0Space;
@Entrypoint
Address freeListAllocator0Plan;
@Entrypoint
Address freeListAllocator0PlanFat;
Address freeListAllocator0Context;
@Entrypoint
Address freeListAllocator0AvailableBlocks;
@Entrypoint
Expand All @@ -196,9 +174,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address freeListAllocator1Space;
@Entrypoint
Address freeListAllocator1Plan;
@Entrypoint
Address freeListAllocator1PlanFat;
Address freeListAllocator1Context;
@Entrypoint
Address freeListAllocator1AvailableBlocks;
@Entrypoint
Expand All @@ -220,9 +196,7 @@ public abstract class MMTkMutatorContext extends MutatorContext {
@Entrypoint
Address markCompactAllocator0SpaceFat;
@Entrypoint
Address markCompactAllocator0Plan;
@Entrypoint
Address markCompactAllocator0PlanFat;
Address markCompactAllocator0Context;

// barrier
@Entrypoint
Expand Down Expand Up @@ -266,23 +240,22 @@ public abstract class MMTkMutatorContext extends MutatorContext {
static final int MAX_FREE_LIST_ALLOCATORS = 2;
static final int MAX_MARK_COMPACT_ALLOCATORS = 1;
// Bump allocator size
static final int BUMP_ALLOCATOR_SIZE = 7 * BYTES_IN_WORD;
static final int BUMP_ALLOCATOR_SIZE = 6 * BYTES_IN_WORD;
// Bump allocator field offsets
static final int BUMP_ALLOCATOR_TLS = 0;
static final int BUMP_ALLOCATOR_CURSOR = BYTES_IN_WORD;
static final int BUMP_ALLOCATOR_LIMIT = BYTES_IN_WORD * 2;
static final int BUMP_ALLOCATOR_SPACE = BYTES_IN_WORD * 3;
static final int BUMP_ALLOCATOR_SPACE_FAT = BYTES_IN_WORD * 4;
static final int BUMP_ALLOCATOR_PLAN = BYTES_IN_WORD * 5;
static final int BUMP_ALLOCATOR_PLAN_FAT = BYTES_IN_WORD * 6;
// Large object 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 LARGE_OBJECT_ALLOCATOR_SIZE = 4 * BYTES_IN_WORD;
static final int LARGE_OBJECT_ALLOCATOR_SIZE = 3 * BYTES_IN_WORD;
// 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 = 4 * BYTES_IN_WORD;
static final int MALLOC_ALLOCATOR_SIZE = 3 * BYTES_IN_WORD;
// Immix allocator size
static final int IMMIX_ALLOCATOR_SIZE = 13 * BYTES_IN_WORD;
static final int IMMIX_ALLOCATOR_SIZE = 12 * BYTES_IN_WORD;
// Free list allocator size
static final int FREE_LIST_ALLOCATOR_SIZE = 8 * BYTES_IN_WORD;
static final int FREE_LIST_ALLOCATOR_SIZE = 7 * BYTES_IN_WORD;
// Mark compact allocator size (the same as bump allocator)
static final int MARK_COMPACT_ALLOCATOR_SIZE = BUMP_ALLOCATOR_SIZE;

Expand Down
4 changes: 2 additions & 2 deletions mmtk/Cargo.lock

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

2 changes: 1 addition & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "9a676e68dd41272b57e6812dc404ffa6391668e2" }
mmtk = { git = "https://github.com/qinsoon/mmtk-core.git", rev = "d5f5ac9ee285b871c1985146b75e6aaa5619ded4" }
# 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" }

Expand Down
6 changes: 0 additions & 6 deletions mmtk/src/active_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ use mmtk::util::opaque_pointer::*;
use mmtk::util::Address;
use mmtk::vm::ActivePlan;
use mmtk::Mutator;
use mmtk::Plan;
use std::mem;
use JikesRVM;
use JTOC_BASE;
use SINGLETON;

use std::sync::{Mutex, MutexGuard};

Expand Down Expand Up @@ -64,10 +62,6 @@ impl ActivePlan<JikesRVM> for VMActivePlan {
Self::mutators().count()
}

fn global() -> &'static dyn Plan<VM = JikesRVM> {
SINGLETON.get_plan()
}

fn is_mutator(tls: VMThread) -> bool {
let thread: Address = unsafe { mem::transmute(tls) };
!unsafe { (thread + IS_COLLECTOR_FIELD_OFFSET).load::<bool>() }
Expand Down
4 changes: 2 additions & 2 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ pub extern "C" fn is_mapped_address(address: Address) -> i32 {
}

#[no_mangle]
pub extern "C" fn modify_check(object: ObjectReference) {
memory_manager::modify_check(&SINGLETON, object)
pub extern "C" fn modify_check(_object: ObjectReference) {
// MMTk core no longe provides this method. We just use an empty impl.
}

#[no_mangle]
Expand Down
Loading