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

Get build info from mmtk-core #174

Merged
merged 6 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
219 changes: 214 additions & 5 deletions mmtk/Cargo.lock

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

4 changes: 2 additions & 2 deletions mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ lto = true
[package.metadata.openjdk]
# Our CI matches the following line and extract mmtk/openjdk. If this line is updated, please check ci yaml files and make sure it works.
openjdk_repo = "https://github.com/mmtk/openjdk.git"
openjdk_version = "5180a3241b7477b056f4e5c61d1267f6f48aeab3"
openjdk_version = "342847479ef5bae857053ea78d78729523234887"

[dependencies]
libc = "0.2"
Expand All @@ -28,7 +28,7 @@ once_cell = "1.10.0"
# - 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 = "a96e8f991c91a81df51e7975849441f52fdbcdcc" }
mmtk = { git = "https://github.com/qinsoon/mmtk-core.git", rev = "855207420c052de36bfd3e93f11f3fc2db4aeff8" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }

Expand Down
5 changes: 5 additions & 0 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ static NO_BARRIER: sync::Lazy<CString> = sync::Lazy::new(|| CString::new("NoBarr
static OBJECT_BARRIER: sync::Lazy<CString> =
sync::Lazy::new(|| CString::new("ObjectBarrier").unwrap());

#[no_mangle]
pub extern "C" fn get_mmtk_version() -> *const c_char {
mmtk::build_info::MMTK_FULL_BUILD_INFO.as_ptr() as _
}

#[no_mangle]
pub extern "C" fn mmtk_active_barrier() -> *const c_char {
match SINGLETON.get_plan().constraints().barrier {
Expand Down
2 changes: 2 additions & 0 deletions openjdk/mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ extern const uintptr_t GLOBAL_SIDE_METADATA_VM_BASE_ADDRESS;
extern const uintptr_t GLOBAL_ALLOC_BIT_ADDRESS;
extern const size_t MMTK_MARK_COMPACT_HEADER_RESERVED_IN_BYTES;

extern const char* get_mmtk_version();

/**
* Allocation
*/
Expand Down
4 changes: 4 additions & 0 deletions openjdk/mmtkHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ jint MMTkHeap::initialize() {

}

const char* MMTkHeap::version() {
return get_mmtk_version();
}

void MMTkHeap::schedule_finalizer() {
MMTkFinalizerThread::instance->schedule();
}
Expand Down
1 change: 1 addition & 0 deletions openjdk/mmtkHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class MMTkHeap : public CollectedHeap {
const char* name() const {
return "MMTk";
}
static const char* version();

size_t capacity() const;
size_t used() const;
Expand Down