Skip to content

Test MMTk core PR #1364 #314

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
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
5 changes: 3 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 @@ -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 = "7d798ad8a71aa6df80f58f5e565e4f9274d06871" }
mmtk = { git = "https://github.com/qinsoon/mmtk-core.git", rev = "cabdd668972fb883e05385ce94259e3b01357798" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }

Expand Down
12 changes: 0 additions & 12 deletions openjdk/mmtkUpcalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,6 @@ static void mmtk_resume_mutators(void *tls) {
MutexLockerEx locker(MMTkHeap::heap()->gc_lock(), Mutex::_no_safepoint_check_flag);
MMTkHeap::heap()->gc_lock()->notify_all();
}

log_debug(gc)("Notifying mutators blocking on Heap_lock for reference pending list...");
// Note: That's the ReferenceHandler thread.
{
MutexLockerEx x(Heap_lock, Mutex::_no_safepoint_check_flag);
if (Universe::has_reference_pending_list()) {
Heap_lock->notify_all();
}
}
}

static const int GC_THREAD_KIND_WORKER = 1;
Expand Down Expand Up @@ -302,8 +293,6 @@ static void mmtk_enqueue_references(void** objects, size_t len) {
return;
}

MutexLocker x(Heap_lock);

oop first = (oop) objects[0]; // This points to the first node of the linked list.
oop last = first; // This points to the last node of the linked list.

Expand All @@ -324,7 +313,6 @@ static void mmtk_enqueue_references(void** objects, size_t len) {

oop old_first = Universe::swap_reference_pending_list(first);
HeapAccess<AS_NO_KEEPALIVE>::oop_store_at(last, java_lang_ref_Reference::discovered_offset, old_first);
assert(Universe::has_reference_pending_list(), "Reference pending list is empty after swap");
}

OpenJDK_Upcalls mmtk_upcalls = {
Expand Down
13 changes: 13 additions & 0 deletions openjdk/mmtkVMOperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,21 @@ VM_MMTkSTWOperation::VM_MMTkSTWOperation(MMTkVMCompanionThread *companion_thread
_companion_thread(companion_thread) {
}

bool VM_MMTkSTWOperation::doit_prologue() {
Heap_lock->lock();
return true;
}

void VM_MMTkSTWOperation::doit() {
log_trace(vmthread)("Entered VM_MMTkSTWOperation::doit().");
_companion_thread->do_mmtk_stw_operation();
log_trace(vmthread)("Leaving VM_MMTkSTWOperation::doit()");
}

void VM_MMTkSTWOperation::doit_epilogue() {
// Notify the reference processing thread
if (Universe::has_reference_pending_list()) {
Heap_lock->notify_all();
}
Heap_lock->unlock();
}
2 changes: 2 additions & 0 deletions openjdk/mmtkVMOperation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class VM_MMTkSTWOperation : public VM_MMTkOperation {

public:
VM_MMTkSTWOperation(MMTkVMCompanionThread *companion_thread);
virtual bool doit_prologue() override;
virtual void doit() override;
virtual void doit_epilogue() override;
};

#endif // MMTK_OPENJDK_MMTK_VM_OPERATION_HPP
Loading