[vmkit-commits] [vmkit] r85228 - in /vmkit/trunk/lib/Mvm: Compiler/JIT.cpp MMTk/MvmGC.cpp MMTk/MvmGC.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Tue Oct 27 04:33:19 PDT 2009
Author: geoffray
Date: Tue Oct 27 06:33:19 2009
New Revision: 85228
URL: http://llvm.org/viewvc/llvm-project?rev=85228&view=rev
Log:
Implement scanning in MMTk.
Modified:
vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp
vmkit/trunk/lib/Mvm/MMTk/MvmGC.h
Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=85228&r1=85227&r2=85228&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Tue Oct 27 06:33:19 2009
@@ -208,6 +208,11 @@
assert(F && "Could not find processEdge from TraceLocal");
gc::MMTkProcessEdge = (gc::MMTkProcessEdgeType)
(uintptr_t)executionEngine->getPointerToFunction(F);
+
+ F = globalModule->getFunction("JnJVM_org_mmtk_plan_TraceLocal_processRootEdge__Lorg_vmmagic_unboxed_Address_2Z");
+ assert(F && "Could not find processEdge from TraceLocal");
+ gc::MMTkProcessRootEdge = (gc::MMTkProcessRootEdgeType)
+ (uintptr_t)executionEngine->getPointerToFunction(F);
}
Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp?rev=85228&r1=85227&r2=85228&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp (original)
+++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp Tue Oct 27 06:33:19 2009
@@ -15,11 +15,12 @@
using namespace mvm;
-gc::MMTkAllocType gc::MMTkGCAllocator = 0;
-gc::MMTkPostAllocType gc::MMTkGCPostAllocator = 0;
-gc::MMTkCheckAllocatorType gc::MMTkCheckAllocator = 0;
-gc::MMTkDelayedRootType gc::MMTkDelayedRoot = 0;
-gc::MMTkProcessEdgeType gc::MMTkProcessEdge = 0;
+gc::MMTkAllocType gc::MMTkGCAllocator = 0;
+gc::MMTkPostAllocType gc::MMTkGCPostAllocator = 0;
+gc::MMTkCheckAllocatorType gc::MMTkCheckAllocator = 0;
+gc::MMTkDelayedRootType gc::MMTkDelayedRoot = 0;
+gc::MMTkProcessEdgeType gc::MMTkProcessEdge = 0;
+gc::MMTkProcessRootEdgeType gc::MMTkProcessRootEdge = 0;
uintptr_t Collector::TraceLocal = 0;
Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.h?rev=85228&r1=85227&r2=85228&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/MMTk/MvmGC.h (original)
+++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Tue Oct 27 06:33:19 2009
@@ -51,8 +51,13 @@
typedef void (*MMTkDelayedRootType)(uintptr_t TraceLocal, void** slot);
- typedef void (*MMTkProcessEdgeType)(uintptr_t TraceLocal, uintptr_t source,
- void** slot);
+ typedef void (*MMTkProcessEdgeType)(uintptr_t TraceLocal, void* source,
+ void* slot);
+
+ typedef void (*MMTkProcessRootEdgeType)(uintptr_t TraceLocal, void* slot,
+ uint8_t untraced);
+
+ typedef void (*MMTkIsLiveType)(uintptr_t TraceLocal, void* obj);
static MMTkAllocType MMTkGCAllocator;
@@ -63,6 +68,8 @@
static MMTkDelayedRootType MMTkDelayedRoot;
static MMTkProcessEdgeType MMTkProcessEdge;
+
+ static MMTkProcessRootEdgeType MMTkProcessRootEdge;
void* operator new(size_t sz, VirtualTable *VT) {
@@ -103,11 +110,13 @@
}
static void markAndTrace(void* source, void* ptr) {
- abort();
+ assert(TraceLocal && "scanning without a trace local");
+ gc::MMTkProcessEdge(TraceLocal, source, ptr);
}
static void markAndTraceRoot(void* ptr) {
- abort();
+ assert(TraceLocal && "scanning without a trace local");
+ gc::MMTkProcessRootEdge(TraceLocal, ptr, true);
}
static void collect() {
More information about the vmkit-commits
mailing list