[vmkit-commits] [vmkit] r120699 - in /vmkit/branches/multi-vm: include/mvm/GC.h include/mvm/VirtualMachine.h lib/Mvm/Allocator/gcchunk.h lib/Mvm/CommonThread/CollectionRV.cpp lib/Mvm/GCMmap2/MvmGC.h lib/Mvm/GCMmap2/ObjectHeader.h lib/Mvm/GCMmap2/gc.cpp lib/Mvm/GCMmap2/gccollector.cpp
Gael Thomas
gael.thomas at lip6.fr
Thu Dec 2 01:43:09 PST 2010
Author: gthomas
Date: Thu Dec 2 03:43:09 2010
New Revision: 120699
URL: http://llvm.org/viewvc/llvm-project?rev=120699&view=rev
Log:
gc mmap2 uses also the new interfaces
Modified:
vmkit/branches/multi-vm/include/mvm/GC.h
vmkit/branches/multi-vm/include/mvm/VirtualMachine.h
vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h
vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp
vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h
vmkit/branches/multi-vm/lib/Mvm/GCMmap2/ObjectHeader.h
vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gc.cpp
vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gccollector.cpp
Modified: vmkit/branches/multi-vm/include/mvm/GC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/GC.h?rev=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/GC.h (original)
+++ vmkit/branches/multi-vm/include/mvm/GC.h Thu Dec 2 03:43:09 2010
@@ -16,6 +16,7 @@
namespace mvm {
+ class VirtualMachine;
class VirtualTable;
class gc;
@@ -40,9 +41,10 @@
class CommonVirtualTable {
public:
- uintptr_t destructor;
- uintptr_t operatorDelete;
- uintptr_t tracer;
+ uintptr_t destructor;
+ uintptr_t operatorDelete;
+ uintptr_t tracer;
+ // VirtualMachine* vm;
uintptr_t* getFunctions() {
return &destructor;
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=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/mvm/VirtualMachine.h (original)
+++ vmkit/branches/multi-vm/include/mvm/VirtualMachine.h Thu Dec 2 03:43:09 2010
@@ -13,7 +13,6 @@
#include "mvm/Allocator.h"
#include "mvm/Threads/CollectionRV.h"
#include "mvm/Threads/Locks.h"
-#include "mvm/GC.h"
#include <cassert>
#include <map>
@@ -22,6 +21,7 @@
class MethodInfo;
class VMKit;
+class gc;
class FunctionMap {
public:
Modified: vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h?rev=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/Allocator/gcchunk.h Thu Dec 2 03:43:09 2010
@@ -10,12 +10,16 @@
#ifndef _GC_CHUNK_H_
#define _GC_CHUNK_H_
-#include "mvm/VirtualMachine.h"
-#include "mvm/GC.h"
+//#include "mvm/VirtualMachine.h"
+//#include "mvm/GC.h"
#include "gcmapper.h"
#include "types.h"
+namespace mvm {
+ class gcRoot;
+}
+
using namespace mvm;
/* description d'un bout de mémoire */
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=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/CommonThread/CollectionRV.cpp Thu Dec 2 03:43:09 2010
@@ -9,10 +9,10 @@
#include <cassert>
#include <signal.h>
-#include "mvm/GC.h"
#include "mvm/VirtualMachine.h"
#include "mvm/Threads/CollectionRV.h"
#include "mvm/VMKit.h"
+#include "mvm/GC.h"
#include "debug.h"
Modified: vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h?rev=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/GCMmap2/MvmGC.h Thu Dec 2 03:43:09 2010
@@ -1,4 +1,4 @@
-//===----------- GC.h - Garbage Collection Interface -----------------------===//
+//===----------- MvmGC.h - Garbage Collection Interface -------------------===//
//
// The Micro Virtual Machine
//
@@ -13,10 +13,16 @@
#include "types.h"
#include "gcalloc.h"
+#include "mvm/VirtualMachine.h"
#define gc_allocator std::allocator
+using namespace mvm;
+
namespace mvm {
+ class Thread;
+ class VirtualMachine;
+
class GCVirtualTable : public CommonVirtualTable {
public:
static uint32_t numberOfBaseFunctions() {
@@ -31,8 +37,6 @@
GCVirtualTable() {}
};
-class Thread;
-
class Collector {
friend class GCThread;
friend class CollectionRV;
@@ -185,7 +189,7 @@
unlock();
- if (vt->destructor)
+ if (((CommonVirtualTable*)vt)->destructor)
mvm::Thread::get()->MyVM->addFinalizationCandidate((gc*)p);
@@ -342,7 +346,6 @@
static gc* getForwardedFinalizable(gc* val, uintptr_t closure) {
return val;
}
-
};
class collectable : public gcRoot {
@@ -369,7 +372,6 @@
}
};
-
}
#endif
Modified: vmkit/branches/multi-vm/lib/Mvm/GCMmap2/ObjectHeader.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/GCMmap2/ObjectHeader.h?rev=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/GCMmap2/ObjectHeader.h (original)
+++ vmkit/branches/multi-vm/lib/Mvm/GCMmap2/ObjectHeader.h Thu Dec 2 03:43:09 2010
@@ -14,7 +14,6 @@
namespace mvm {
static const uint32_t GCBits = 2;
- static const uint64_t GCBitMask = 0x3;
static const bool MovesObject = false;
}
Modified: vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gc.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gc.cpp?rev=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gc.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gc.cpp Thu Dec 2 03:43:09 2010
@@ -7,7 +7,6 @@
//
//===----------------------------------------------------------------------===//
-#include "mvm/GC/GC.h"
#include "mvm/Threads/Thread.h"
#include "mvm/GC.h"
Modified: vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gccollector.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gccollector.cpp?rev=120699&r1=120698&r2=120699&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gccollector.cpp (original)
+++ vmkit/branches/multi-vm/lib/Mvm/GCMmap2/gccollector.cpp Thu Dec 2 03:43:09 2010
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "mvm/GC.h"
+#include "mvm/VMKit.h"
using namespace mvm;
@@ -40,10 +41,10 @@
unused_nodes->attrape(used_nodes);
mvm::Thread* th = mvm::Thread::get();
- th->MyVM->rendezvous.startRV();
+ th->vmkit->rendezvous.startRV();
th->MyVM->startCollection();
- th->MyVM->rendezvous.synchronize();
+ th->vmkit->rendezvous.synchronize();
mvm::Thread* tcur = th;
@@ -89,7 +90,7 @@
status = stat_alloc;
// Wake up all threads.
- th->MyVM->rendezvous.finishRV();
+ th->vmkit->rendezvous.finishRV();
th->MyVM->endCollection();
// Kill unreachable objects.
More information about the vmkit-commits
mailing list