Skip to content

Update to MMTk core PR #949 #109

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

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 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 @@ -31,7 +31,7 @@ lazy_static = "1.1"
# - change branch
# - change repo name
# But other changes including adding/removing whitespaces in commented lines may break the CI
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="61d20e2dcd5b4743ef04a8118eb807bcd6f6e2e2" }
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="57af17fbfd94ff0df2cd3b1e504abe299ce4f0ab" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }
log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] }
Expand Down
1 change: 0 additions & 1 deletion mmtk/api/mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ extern void mmtk_post_alloc(MMTk_Mutator mutator, void* refer,
extern bool mmtk_is_live_object(void* ref);
extern bool mmtk_is_mapped_object(void* ref);
extern bool mmtk_is_mapped_address(void* addr);
extern void mmtk_modify_check(void* ref);
extern int mmtk_object_is_managed_by_mmtk(void* addr);
extern void mmtk_runtime_panic(void);
extern void mmtk_unreachable(void);
Expand Down
13 changes: 8 additions & 5 deletions mmtk/api/mmtkMutator.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef MMTK_JULIA_MMTK_MUTATOR_H
#define MMTK_JULIA_MMTK_MUTATOR_H

// mmtk_julia_types.h refers to the types in this file.
// So if this file is updated, make sure you regenerate Rust types for mmtk_julia_types.h.

enum Allocator {
AllocatorDefault = 0,
AllocatorImmortal = 1,
Expand Down Expand Up @@ -29,21 +32,21 @@ typedef struct {
void* cursor;
void* limit;
RustDynPtr space;
RustDynPtr plan;
void* context;
} BumpAllocator;

typedef struct {
void* tls;
void* space;
RustDynPtr plan;
void* context;
} LargeObjectAllocator;

typedef struct {
void* tls;
void* cursor;
void* limit;
void* immix_space;
RustDynPtr plan;
void* context;
uint8_t hot;
uint8_t copy;
void* large_cursor;
Expand All @@ -68,7 +71,7 @@ typedef struct {
typedef struct {
void* tls;
void* space;
RustDynPtr plan;
void* context;
FLBlockList* available_blocks;
FLBlockList* available_blocks_stress;
FLBlockList* unswept_blocks;
Expand All @@ -78,7 +81,7 @@ typedef struct {
typedef struct {
void* tls;
void* space;
RustDynPtr plan;
void* context;
} MMTkMallocAllocator; // Prefix with MMTk to avoid name clash

typedef struct {
Expand Down
7 changes: 1 addition & 6 deletions mmtk/src/active_plan.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::JuliaVM;
use crate::{MUTATORS, SINGLETON};
use crate::MUTATORS;
use mmtk::util::opaque_pointer::*;
use mmtk::util::Address;
use mmtk::vm::ActivePlan;
use mmtk::Mutator;
use mmtk::Plan;
use mmtk::{plan::ObjectQueue, scheduler::GCWorker, util::ObjectReference};

use std::collections::HashMap;
Expand Down Expand Up @@ -44,10 +43,6 @@ impl<'a> Iterator for JuliaMutatorIterator<'a> {
pub struct VMActivePlan {}

impl ActivePlan<JuliaVM> for VMActivePlan {
fn global() -> &'static dyn Plan<VM = JuliaVM> {
SINGLETON.get_plan()
}

fn number_of_mutators() -> usize {
Self::mutators().count()
}
Expand Down
13 changes: 2 additions & 11 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ pub extern "C" fn mmtk_is_mapped_address(address: Address) -> bool {
address.is_mapped()
}

#[no_mangle]
pub extern "C" fn mmtk_modify_check(object: ObjectReference) {
memory_manager::modify_check(&SINGLETON, object)
}

#[no_mangle]
pub extern "C" fn mmtk_handle_user_collection_request(tls: VMMutatorThread, collection: u8) {
AtomicIsize::fetch_add(&USER_TRIGGERED_GC, 1, Ordering::SeqCst);
Expand All @@ -306,13 +301,9 @@ pub extern "C" fn mmtk_handle_user_collection_request(tls: VMMutatorThread, coll
// auto
0 => memory_manager::handle_user_collection_request::<JuliaVM>(&SINGLETON, tls),
// full
1 => SINGLETON
.get_plan()
.handle_user_collection_request(tls, true, true),
1 => SINGLETON.handle_user_collection_request(tls, true, true),
// incremental
2 => SINGLETON
.get_plan()
.handle_user_collection_request(tls, true, false),
2 => SINGLETON.handle_user_collection_request(tls, true, false),
_ => unreachable!(),
}
}
Expand Down
Loading