[vmkit-commits] [vmkit] r83636 - in /vmkit/trunk: lib/JnJVM/VMCore/JavaThread.h lib/Mvm/GCMmap2/MutatorThread.h mmtk/mmtk-j3/MutatorThread.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Fri Oct 9 04:11:25 PDT 2009
Author: geoffray
Date: Fri Oct 9 06:11:25 2009
New Revision: 83636
URL: http://llvm.org/viewvc/llvm-project?rev=83636&view=rev
Log:
Add a MutatorThread.h interface, that is specialized by each GC.
Added:
vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h
vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=83636&r1=83635&r2=83636&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Fri Oct 9 06:11:25 2009
@@ -18,6 +18,8 @@
#include "mvm/Threads/Locks.h"
#include "mvm/Threads/Thread.h"
+#include "MutatorThread.h"
+
#include "JavaObject.h"
#include "JNIReferences.h"
@@ -73,7 +75,7 @@
/// It maintains thread-specific information such as its state, the current
/// exception if there is one, the layout of the stack, etc.
///
-class JavaThread : public mvm::Thread {
+class JavaThread : public mvm::MutatorThread {
public:
Added: vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h?rev=83636&view=auto
==============================================================================
--- vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h (added)
+++ vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h Fri Oct 9 06:11:25 2009
@@ -0,0 +1,23 @@
+//===--------- MutatorThread.h - Thread for GC ----------------------------===//
+//
+// The VMKit project
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef MVM_MUTATOR_THREAD_H
+#define MVM_MUTATOR_THREAD_H
+
+#include "mvm/Threads/Thread.h"
+
+namespace mvm {
+
+class MutatorThread : public mvm::Thread {
+};
+
+}
+
+#endif
Added: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h?rev=83636&view=auto
==============================================================================
--- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h (added)
+++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Fri Oct 9 06:11:25 2009
@@ -0,0 +1,43 @@
+//===--------- MutatorThread.h - Thread for GC ----------------------------===//
+//
+// The VMKit project
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef MVM_MUTATOR_THREAD_H
+#define MVM_MUTATOR_THREAD_H
+
+#include "mvm/Allocator.h"
+#include "mvm/Threads/Thread.h"
+
+namespace mvm {
+
+
+class MutatorThread : public mvm::Thread {
+public:
+ mvm::BumpPtrAllocator Allocator;
+ uintptr_t MutatorContext;
+ uintptr_t CollectorContext;
+
+ static size_t MutatorSize;
+ static size_t CollectorSize;
+
+ static void (*CollectorInit)(uintptr_t);
+ static void (*MutatorInit)(uintptr_t);
+
+ MutatorThread() {
+ MutatorContext = Allocator.Allocate(MutatorSize);
+ MutatorInit(MutatorContext);
+ CollectorContext = Allocator.Allocate(CollectorSize);
+ CollectorInit(CollectorContext);
+ }
+
+};
+
+}
+
+#endif
More information about the vmkit-commits
mailing list