[vmkit-commits] [vmkit] r120942 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/VMCore/JnjvmClassLoader.cpp lib/Mvm/CommonThread/CollectionRV.cpp lib/Mvm/CommonThread/ctthread.cpp lib/Mvm/Compiler/JIT.cpp mmtk/mmtk-j3/ActivePlan.cpp mmtk/mmtk-j3/Collection.cpp mmtk/mmtk-j3/Scanning.cpp

Gael Thomas gael.thomas at lip6.fr
Sun Dec 5 09:19:46 PST 2010


Author: gthomas
Date: Sun Dec  5 11:19:46 2010
New Revision: 120942

URL: http://llvm.org/viewvc/llvm-project?rev=120942&view=rev
Log:
remove the function vmkit() from Thread, uses directly the field vmkit

Modified:
    vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
    vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp
    vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp
    vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp
    vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp
    vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp
    vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp
    vmkit/branches/multi-vm/mmtk/mmtk-j3/Scanning.cpp

Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original)
+++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Sun Dec  5 11:19:46 2010
@@ -364,13 +364,10 @@
   ///
 	gc* pendingException;
 
-private:
-	/// _vmkit - a (shortcut) pointer to vmkit that contains information on all the vms
-	///
-	mvm::VMKit* _vmkit;
-
 public:
-	mvm::VMKit* vmkit();
+	/// vmkit - a (shortcut) pointer to vmkit that contains information on all the vms
+	///
+	mvm::VMKit* vmkit;
 
   /// allVmsData - the array of thread specific data.
   ///

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp?rev=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITCompiler.cpp Sun Dec  5 11:19:46 2010
@@ -359,7 +359,7 @@
     llvm::GCFunctionInfo* GFI = &(GCInfo->getFunctionInfo(*func));
     assert((GFI != NULL) && "No GC information");
   
-		mvm::VMKit* vmkit = mvm::Thread::get()->vmkit();
+		mvm::VMKit* vmkit = mvm::Thread::get()->vmkit;
     mvm::JITMethodInfo* MI = 
       new(allocator, "JavaJITMethodInfo") JavaJITMethodInfo(GFI, meth);
     MI->addToVMKit(vmkit, (JIT*)executionEngine);
@@ -401,7 +401,7 @@
   llvm::GCFunctionInfo* GFI = &(GCInfo->getFunctionInfo(*F));
   assert((GFI != NULL) && "No GC information");
   
-	mvm::VMKit* vmkit = mvm::Thread::get()->vmkit();
+	mvm::VMKit* vmkit = mvm::Thread::get()->vmkit;
   mvm::JITMethodInfo* MI = 
     new(allocator, "JITMethodInfo") mvm::MvmJITMethodInfo(GFI, F, this);
   MI->addToVMKit(vmkit, (JIT*)executionEngine);

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp Sun Dec  5 11:19:46 2010
@@ -920,7 +920,7 @@
   if (isolate) {
     isolate->vmkit->removeMethodInfos(TheCompiler);
   } else {
-		mvm::Thread::get()->vmkit()->removeMethodInfos(TheCompiler);
+		mvm::Thread::get()->vmkit->removeMethodInfos(TheCompiler);
 	}
 
   if (classes) {

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=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp Sun Dec  5 11:19:46 2010
@@ -19,7 +19,7 @@
 using namespace mvm;
 
 void CollectionRV::another_mark() {
-	VMKit *vmkit = mvm::Thread::get()->vmkit();
+	VMKit *vmkit = mvm::Thread::get()->vmkit;
   assert(th->getLastSP() != NULL);
   assert(nbJoined < vmkit->NumberOfThreads);
   nbJoined++;
@@ -41,7 +41,7 @@
   // Add myself.
   nbJoined++;
 
-  while (nbJoined != mvm::Thread::get()->vmkit()->numberOfRunningThreads) {
+  while (nbJoined != mvm::Thread::get()->vmkit->numberOfRunningThreads) {
     condInitiator.wait(&_lockRV);
   } 
 }
@@ -49,7 +49,7 @@
 void CooperativeCollectionRV::synchronize() {
   assert(nbJoined == 0);
   mvm::Thread* self = mvm::Thread::get();
-	mvm::VMKit* vmkit = self->vmkit();
+	mvm::VMKit* vmkit = self->vmkit;
 
   // Lock thread lock, so that we can traverse the thread list safely. This will
   // be released on finishRV.
@@ -90,11 +90,11 @@
 void UncooperativeCollectionRV::synchronize() { 
   assert(nbJoined == 0);
   mvm::Thread* self = mvm::Thread::get();
-	mvm::VMKit* vmkit = self->vmkit();
+	mvm::VMKit* vmkit = self->vmkit;
 
   // Lock thread lock, so that we can traverse the thread list safely. This will
   // be released on finishRV.
-  self->vmkit()->vmkitLock.lock();
+  self->vmkit->vmkitLock.lock();
 
 	for(Thread* cur=vmkit->runningThreads.next(); cur!=&vmkit->runningThreads; cur=cur->next()) { 
 		if(cur!=self) {
@@ -189,14 +189,14 @@
 
 extern "C" void conditionalSafePoint() {
   mvm::Thread* th = mvm::Thread::get();
-  th->vmkit()->rendezvous.join();
+  th->vmkit->rendezvous.join();
 }
 
 void CooperativeCollectionRV::finishRV() {
   lockRV();
     
   mvm::Thread* initiator = mvm::Thread::get();
-	mvm::VMKit* vmkit = initiator->vmkit();
+	mvm::VMKit* vmkit = initiator->vmkit;
 
   for(mvm::Thread* cur=vmkit->runningThreads.next(); cur!=&vmkit->runningThreads; cur=cur->next()) {
     assert(cur->doYield && "Inconsistent state");
@@ -207,7 +207,7 @@
 	
   assert(nbJoined == initiator->MyVM->NumberOfThreads && "Inconsistent state");
   nbJoined = 0;
-  initiator->vmkit()->vmkitLock.unlock();
+  initiator->vmkit->vmkitLock.unlock();
   condEndRV.broadcast();
   unlockRV();
   initiator->inRV = false;
@@ -220,9 +220,9 @@
 void UncooperativeCollectionRV::finishRV() {
   lockRV();
   mvm::Thread* initiator = mvm::Thread::get();
-  assert(nbJoined == initiator->vmkit()->NumberOfThreads && "Inconsistent state");
+  assert(nbJoined == initiator->vmkit->NumberOfThreads && "Inconsistent state");
   nbJoined = 0;
-  initiator->vmkit()->vmkitLock.unlock();
+  initiator->vmkit->vmkitLock.unlock();
   condEndRV.broadcast();
   unlockRV();
   initiator->inRV = false;
@@ -238,7 +238,7 @@
 
 static void siggcHandler(int) {
   mvm::Thread* th = mvm::Thread::get();
-  th->vmkit()->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=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp Sun Dec  5 11:19:46 2010
@@ -37,7 +37,7 @@
 #else
 	lastExceptionBuffer = 0;
 #endif
-	_vmkit = vmk;
+	vmkit = vmk;
 	lastKnownFrame = 0;
 	pendingException = 0;
 	allVmsData = 0;
@@ -45,7 +45,7 @@
 }
 
 Thread::~Thread() {
-	vmkit()->unregisterPreparedThread(this);
+	vmkit->unregisterPreparedThread(this);
 }
 
 void Thread::attach(VirtualMachine* vm) {
@@ -70,10 +70,6 @@
 		allVmsData = newData;
 }
 
-mvm::VMKit* Thread::vmkit() {
-	return vmData->vm->vmkit; 
-}
-
 void Thread::tracer(uintptr_t closure) {
 	mvm::Collector::markAndTraceRoot(&pendingException, closure);
 	vmData->tracer(closure);
@@ -95,18 +91,18 @@
   Thread* th = mvm::Thread::get();
   if (th->isMvmThread()) {
     if (th->doYield && !th->inRV) {
-      th->vmkit()->rendezvous.join();
+      th->vmkit->rendezvous.join();
     }
   }
   sched_yield();
 }
 
 void Thread::joinRVBeforeEnter() {
-  vmkit()->rendezvous.joinBeforeUncooperative(); 
+  vmkit->rendezvous.joinBeforeUncooperative(); 
 }
 
 void Thread::joinRVAfterLeave(void* savedSP) {
-  vmkit()->rendezvous.joinAfterUncooperative(savedSP); 
+  vmkit->rendezvous.joinAfterUncooperative(savedSP); 
 }
 
 void Thread::startKnownFrame(KnownFrame& F) {
@@ -220,7 +216,7 @@
   ip = FRAME_IP(addr);
   bool isStub = ((unsigned char*)ip)[0] == 0xCE;
   if (isStub) ip = addr[2];
-  return thread->vmkit()->IPToMethodInfo(ip);
+  return thread->vmkit->IPToMethodInfo(ip);
 }
 
 void* StackWalker::operator*() {
@@ -472,9 +468,9 @@
 #ifdef ISOLATE
   th->IsolateID = th->MyVM->IsolateID;
 #endif
-  th->vmkit()->rendezvous.prepareForJoin();
+  th->vmkit->rendezvous.prepareForJoin();
   th->routine(th);
-  th->vmkit()->unregisterRunningThread(th);
+  th->vmkit->unregisterRunningThread(th);
 }
 
 
@@ -489,7 +485,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.
-  vmkit()->registerRunningThread(this);
+  vmkit->registerRunningThread(this);
   int res = pthread_create((pthread_t*)(void*)(&internalThreadID), &attributs,
                            (void* (*)(void *))internalThreadStart, this);
   pthread_detach((pthread_t)internalThreadID);

Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp?rev=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp Sun Dec  5 11:19:46 2010
@@ -100,7 +100,7 @@
     llvm::GCFunctionInfo* GFI = *I;
     JITMethodInfo* MI = new(*MvmModule::Allocator, "MvmJITMethodInfo")
         MvmJITMethodInfo(GFI, &F, MvmModule::executionEngine);
-    MI->addToVMKit(mvm::Thread::get()->vmkit(), (JIT*)MvmModule::executionEngine);
+    MI->addToVMKit(mvm::Thread::get()->vmkit, (JIT*)MvmModule::executionEngine);
   }
 };
 

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=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp (original)
+++ vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp Sun Dec  5 11:19:46 2010
@@ -21,11 +21,11 @@
 	mvm::CircularBase<mvm::Thread>* mut = A->current;
 
 	if(!mut)
-		mut = &mvm::Thread::get()->vmkit()->runningThreads;
+		mut = &mvm::Thread::get()->vmkit->runningThreads;
 
 	mut = mut->next();
 
-	if(mut == &mvm::Thread::get()->vmkit()->runningThreads) {
+	if(mut == &mvm::Thread::get()->vmkit->runningThreads) {
 		A->current = NULL;
 		return NULL;
 	}

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=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp (original)
+++ vmkit/branches/multi-vm/mmtk/mmtk-j3/Collection.cpp Sun Dec  5 11:19:46 2010
@@ -36,14 +36,14 @@
   mvm::Thread* th = mvm::Thread::get();
 
   // Verify that another collection is not happening.
-  th->vmkit()->rendezvous.startRV();
+  th->vmkit->rendezvous.startRV();
   if (th->doYield) {
-    th->vmkit()->rendezvous.cancelRV();
-    th->vmkit()->rendezvous.join();
+    th->vmkit->rendezvous.cancelRV();
+    th->vmkit->rendezvous.join();
     return;
   } else {
     th->MyVM->startCollection();
-    th->vmkit()->rendezvous.synchronize();
+    th->vmkit->rendezvous.synchronize();
   
     JnJVM_org_mmtk_plan_Plan_setCollectionTriggered__();
 
@@ -73,7 +73,7 @@
               elapsedTime / 1000000);
     }
 
-    th->vmkit()->rendezvous.finishRV();
+    th->vmkit->rendezvous.finishRV();
     th->MyVM->endCollection();
   }
 
@@ -82,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->vmkit()->rendezvous.join();
+  th->vmkit->rendezvous.join();
 }
 
 extern "C" int Java_org_j3_mmtk_Collection_rendezvous__I (MMTkObject* C, int where) {

Modified: vmkit/branches/multi-vm/mmtk/mmtk-j3/Scanning.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/mmtk/mmtk-j3/Scanning.cpp?rev=120942&r1=120941&r2=120942&view=diff
==============================================================================
--- vmkit/branches/multi-vm/mmtk/mmtk-j3/Scanning.cpp (original)
+++ vmkit/branches/multi-vm/mmtk/mmtk-j3/Scanning.cpp Sun Dec  5 11:19:46 2010
@@ -18,7 +18,7 @@
 extern "C" void Java_org_j3_mmtk_Scanning_computeThreadRoots__Lorg_mmtk_plan_TraceLocal_2 (MMTkObject* Scanning, MMTkObject* TL) {
   // When entering this function, all threads are waiting on the rendezvous to
   // finish.
-  mvm::VMKit* vmkit = mvm::Thread::get()->vmkit();
+  mvm::VMKit* vmkit = mvm::Thread::get()->vmkit;
   mvm::Thread* tcur;
   
 	for(tcur=vmkit->runningThreads.next(); tcur!=&vmkit->runningThreads; tcur=tcur->next()) {
@@ -29,7 +29,7 @@
 extern "C" void Java_org_j3_mmtk_Scanning_computeGlobalRoots__Lorg_mmtk_plan_TraceLocal_2 (MMTkObject* Scanning, MMTkObject* TL) { 
   mvm::Thread::get()->MyVM->tracer(reinterpret_cast<uintptr_t>(TL));
 
-	mvm::VMKit* vmkit = mvm::Thread::get()->vmkit();
+	mvm::VMKit* vmkit = mvm::Thread::get()->vmkit;
   mvm::Thread* tcur;
   
 	for(tcur=vmkit->runningThreads.next(); tcur!=&vmkit->runningThreads; tcur=tcur->next()) {





More information about the vmkit-commits mailing list