[vmkit-commits] [vmkit] r120591 - in /vmkit/branches/multi-vm: include/mvm/VMKit.h include/mvm/VirtualMachine.h lib/Mvm/CommonThread/CollectionRV.cpp lib/Mvm/CommonThread/ctthread.cpp mmtk/mmtk-j3/ActivePlan.cpp mmtk/mmtk-j3/Collection.cpp
Gael Thomas
gael.thomas at lip6.fr
Wed Dec 1 11:28:33 PST 2010
Author: gthomas
Date: Wed Dec 1 13:28:33 2010
New Revision: 120591
URL: http://llvm.org/viewvc/llvm-project?rev=120591&view=rev
Log:
move the rendezvous in mvm::VMKit
Modified:
vmkit/branches/multi-vm/include/mvm/VMKit.h
vmkit/branches/multi-vm/include/mvm/VirtualMachine.h
vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp
vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp
vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp
vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp
Modified: vmkit/branches/multi-vm/include/mvm/VMKit.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/VMKit.h?rev=120591&r1=120590&r2=120591&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/VMKit.h (original)
+++ vmkit/branches/multi-vm/include/mvm/VMKit.h Wed Dec 1 13:28:33 2010
@@ -2,6 +2,7 @@
#define _VMKIT_H_
#include "mvm/Allocator.h"
+#include "mvm/Threads/CollectionRV.h"
namespace mvm {
@@ -16,6 +17,15 @@
/// ------------------------------------------------- ///
/// --- thread managment --- ///
/// ------------------------------------------------- ///
+
+ /// rendezvous - The rendezvous implementation for garbage collection.
+ ///
+#ifdef WITH_LLVM_GCC
+ CooperativeCollectionRV rendezvous;
+#else
+ UncooperativeCollectionRV rendezvous;
+#endif
+
};
}
Modified: vmkit/branches/multi-vm/include/mvm/VirtualMachine.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/VirtualMachine.h?rev=120591&r1=120590&r2=120591&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/VirtualMachine.h (original)
+++ vmkit/branches/multi-vm/include/mvm/VirtualMachine.h Wed Dec 1 13:28:33 2010
@@ -127,14 +127,6 @@
///
virtual const char* getObjectTypeName(gc* object) { return "An object"; }
- /// rendezvous - The rendezvous implementation for garbage collection.
- ///
-#ifdef WITH_LLVM_GCC
- CooperativeCollectionRV rendezvous;
-#else
- UncooperativeCollectionRV rendezvous;
-#endif
-
//===----------------------------------------------------------------------===//
// (3) Backtrace-related methods.
//===----------------------------------------------------------------------===//
Modified: vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp?rev=120591&r1=120590&r2=120591&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp Wed Dec 1 13:28:33 2010
@@ -12,6 +12,7 @@
#include "MvmGC.h"
#include "mvm/VirtualMachine.h"
#include "mvm/Threads/CollectionRV.h"
+#include "mvm/VMKit.h"
#include "debug.h"
@@ -204,7 +205,7 @@
extern "C" void conditionalSafePoint() {
mvm::Thread* th = mvm::Thread::get();
- th->MyVM->rendezvous.join();
+ th->vmkit->rendezvous.join();
}
void CooperativeCollectionRV::finishRV() {
@@ -253,7 +254,7 @@
static void siggcHandler(int) {
mvm::Thread* th = mvm::Thread::get();
- th->MyVM->rendezvous.join();
+ th->vmkit->rendezvous.join();
}
void UncooperativeCollectionRV::prepareForJoin() {
Modified: vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp?rev=120591&r1=120590&r2=120591&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp Wed Dec 1 13:28:33 2010
@@ -15,6 +15,7 @@
#include "mvm/Threads/Cond.h"
#include "mvm/Threads/Locks.h"
#include "mvm/Threads/Thread.h"
+#include "mvm/VMKit.h"
#include <cassert>
#include <csetjmp>
@@ -51,18 +52,18 @@
Thread* th = mvm::Thread::get();
if (th->isMvmThread()) {
if (th->doYield && !th->inRV) {
- th->MyVM->rendezvous.join();
+ th->vmkit->rendezvous.join();
}
}
sched_yield();
}
void Thread::joinRVBeforeEnter() {
- MyVM->rendezvous.joinBeforeUncooperative();
+ vmkit->rendezvous.joinBeforeUncooperative();
}
void Thread::joinRVAfterLeave(void* savedSP) {
- MyVM->rendezvous.joinAfterUncooperative(savedSP);
+ vmkit->rendezvous.joinAfterUncooperative(savedSP);
}
void Thread::startKnownFrame(KnownFrame& F) {
@@ -428,9 +429,9 @@
#ifdef ISOLATE
th->IsolateID = th->MyVM->IsolateID;
#endif
- th->MyVM->rendezvous.prepareForJoin();
+ th->vmkit->rendezvous.prepareForJoin();
th->routine(th);
- th->MyVM->rendezvous.removeThread(th);
+ th->vmkit->rendezvous.removeThread(th);
}
@@ -445,7 +446,7 @@
routine = fct;
// Make sure to add it in the list of threads before leaving this function:
// the garbage collector wants to trace this thread.
- MyVM->rendezvous.addThread(this);
+ vmkit->rendezvous.addThread(this);
int res = pthread_create((pthread_t*)(void*)(&internalThreadID), &attributs,
(void* (*)(void *))internalThreadStart, this);
pthread_detach((pthread_t)internalThreadID);
Modified: vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp?rev=120591&r1=120590&r2=120591&view=diff
==============================================================================
--- vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp (original)
+++ vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp Wed Dec 1 13:28:33 2010
@@ -9,6 +9,7 @@
#include "debug.h"
#include "mvm/VirtualMachine.h"
+#include "mvm/VMKit.h"
#include "MMTkObject.h"
#include "MutatorThread.h"
@@ -18,8 +19,8 @@
assert(A && "No active plan");
if (A->current == NULL) {
- A->current = (mvm::MutatorThread*)mvm::Thread::get()->MyVM->rendezvous.oneThread;
- } else if (A->current->next() == mvm::Thread::get()->MyVM->rendezvous.oneThread) {
+ A->current = (mvm::MutatorThread*)mvm::Thread::get()->vmkit->rendezvous.oneThread;
+ } else if (A->current->next() == mvm::Thread::get()->vmkit->rendezvous.oneThread) {
A->current = NULL;
return NULL;
} else {
Modified: vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp?rev=120591&r1=120590&r2=120591&view=diff
==============================================================================
--- vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp (original)
+++ vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp Wed Dec 1 13:28:33 2010
@@ -9,6 +9,7 @@
#include "debug.h"
#include "mvm/VirtualMachine.h"
+#include "mvm/VMKit.h"
#include "MMTkObject.h"
#include "MvmGC.h"
@@ -35,14 +36,14 @@
mvm::Thread* th = mvm::Thread::get();
// Verify that another collection is not happening.
- th->MyVM->rendezvous.startRV();
+ th->vmkit->rendezvous.startRV();
if (th->doYield) {
- th->MyVM->rendezvous.cancelRV();
- th->MyVM->rendezvous.join();
+ th->vmkit->rendezvous.cancelRV();
+ th->vmkit->rendezvous.join();
return;
} else {
th->MyVM->startCollection();
- th->MyVM->rendezvous.synchronize();
+ th->vmkit->rendezvous.synchronize();
JnJVM_org_mmtk_plan_Plan_setCollectionTriggered__();
@@ -72,7 +73,7 @@
elapsedTime / 1000000);
}
- th->MyVM->rendezvous.finishRV();
+ th->vmkit->rendezvous.finishRV();
th->MyVM->endCollection();
}
@@ -81,7 +82,7 @@
extern "C" void Java_org_j3_mmtk_Collection_joinCollection__ (MMTkObject* C) {
mvm::Thread* th = mvm::Thread::get();
assert(th->inRV && "Joining collection without a rendezvous");
- th->MyVM->rendezvous.join();
+ th->vmkit->rendezvous.join();
}
extern "C" int Java_org_j3_mmtk_Collection_rendezvous__I (MMTkObject* C, int where) {
More information about the vmkit-commits
mailing list