[vmkit-commits] [vmkit] r120581 - in /vmkit/branches/multi-vm: include/mvm/Threads/CollectionRV.h include/mvm/Threads/Thread.h lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/ReferenceQueue.cpp lib/Mvm/Compiler/mvm-runtime.ll lib/Mvm/GCMmap2/MutatorThread.h lib/Mvm/MMTk/MutatorThread.h

Gael Thomas gael.thomas at lip6.fr
Wed Dec 1 09:05:14 PST 2010


Author: gthomas
Date: Wed Dec  1 11:05:14 2010
New Revision: 120581

URL: http://llvm.org/viewvc/llvm-project?rev=120581&view=rev
Log:
add a shortcut to vmkit in mvm::Thread

Modified:
    vmkit/branches/multi-vm/include/mvm/Threads/CollectionRV.h
    vmkit/branches/multi-vm/include/mvm/Threads/Thread.h
    vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp
    vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll
    vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MutatorThread.h
    vmkit/branches/multi-vm/lib/Mvm/MMTk/MutatorThread.h

Modified: vmkit/branches/multi-vm/include/mvm/Threads/CollectionRV.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/CollectionRV.h?rev=120581&r1=120580&r2=120581&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/Threads/CollectionRV.h (original)
+++ vmkit/branches/multi-vm/include/mvm/Threads/CollectionRV.h Wed Dec  1 11:05:14 2010
@@ -18,7 +18,7 @@
 
 class CollectionRV {
 public:
-  /// oneThread - The main thread of this VM.
+  /// oneThread - One of the threads
   mvm::Thread* oneThread;
 
 protected: 

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=120581&r1=120580&r2=120581&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original)
+++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Wed Dec  1 11:05:14 2010
@@ -142,6 +142,7 @@
 
 class ExceptionBuffer;
 class MutatorThread;
+class VMKit;
 
 class VMThreadData {
 public:
@@ -166,12 +167,13 @@
 /// contains all thread-specific informations.
 class Thread : public CircularBase {
 public:
-  Thread() {
+  Thread(VMKit* vmk) {
 #ifdef RUNTIME_DWARF_EXCEPTIONS
 		internalPendingException = 0;
 #else
 		lastExceptionBuffer = 0;
 #endif
+		vmkit = vmk;
 		lastKnownFrame = 0;
 		pendingException = 0;
   }
@@ -377,6 +379,10 @@
   /// pendingException - the pending exception
   ///
 	gc* pendingException;
+
+	/// vmkit - a (shortcut) pointer to vmkit that contains information on all the vms
+	///
+	mvm::VMKit* vmkit;
 };
 
 #ifndef RUNTIME_DWARF_EXCEPTIONS

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120581&r1=120580&r2=120581&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Wed Dec  1 11:05:14 2010
@@ -41,7 +41,7 @@
 }
 
 JavaThread *JavaThread::create(Jnjvm* isolate) {
-	mvm::MutatorThread *mut = new mvm::MutatorThread();
+	mvm::MutatorThread *mut = new mvm::MutatorThread(isolate->vmkit);
 	JavaThread *th   = new JavaThread(mut, isolate);
 	th->attach();
 	return th;

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp?rev=120581&r1=120580&r2=120581&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp Wed Dec  1 11:05:14 2010
@@ -15,7 +15,8 @@
 
 using namespace j3;
 
-ReferenceThread::ReferenceThread(Jnjvm* vm) : 
+ReferenceThread::ReferenceThread(Jnjvm* vm) :
+	  MutatorThread(vm->vmkit),
     WeakReferencesQueue(ReferenceQueue::WEAK),
     SoftReferencesQueue(ReferenceQueue::SOFT), 
     PhantomReferencesQueue(ReferenceQueue::PHANTOM) {
@@ -158,7 +159,7 @@
 }
 
 
-FinalizerThread::FinalizerThread(Jnjvm* vm) {
+FinalizerThread::FinalizerThread(Jnjvm* vm) : MutatorThread(vm->vmkit) {
   FinalizationQueue = new gc*[INITIAL_QUEUE_SIZE];
   QueueLength = INITIAL_QUEUE_SIZE;
   CurrentIndex = 0;

Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll?rev=120581&r1=120580&r2=120581&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll (original)
+++ vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll Wed Dec  1 11:05:14 2010
@@ -21,7 +21,8 @@
 ;;; field 11: void*  lastExceptionBuffer
 ;;; field 12: void*  vmData
 ;;; field 13: gc*    pendingException
-%Thread       = type { %CircularBase, i32, i8*, i8*, i1, i1, i1, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
+;;; field 14: VMkit* vmkit
+%Thread       = type { %CircularBase, i32, i8*, i8*, i1, i1, i1, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
 
 ;;; field 0: VT
 ;;; field 1: mvm::MutatorThread*  mut

Modified: vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MutatorThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MutatorThread.h?rev=120581&r1=120580&r2=120581&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MutatorThread.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MutatorThread.h Wed Dec  1 11:05:14 2010
@@ -17,7 +17,7 @@
 
 class MutatorThread : public mvm::Thread {
 public:
-  MutatorThread() : mvm::Thread() {}
+  MutatorThread(VMKit* vmkit) : mvm::Thread(vmkit) {}
 };
 
 }

Modified: vmkit/branches/multi-vm/lib/Mvm/MMTk/MutatorThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/MMTk/MutatorThread.h?rev=120581&r1=120580&r2=120581&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/MMTk/MutatorThread.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/MMTk/MutatorThread.h Wed Dec  1 11:05:14 2010
@@ -18,7 +18,7 @@
 
 class MutatorThread : public mvm::Thread {
 public:
-  MutatorThread() : mvm::Thread() {
+  MutatorThread(VMKit* vmkit) : mvm::Thread(vmkit) {
     MutatorContext = 0;
   }
   mvm::ThreadAllocator Allocator;





More information about the vmkit-commits mailing list