[vmkit-commits] [vmkit] r85000 - in /vmkit/trunk/lib/Mvm: Compiler/JIT.cpp MMTk/MutatorThread.cpp MMTk/MutatorThread.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sat Oct 24 04:54:33 PDT 2009
Author: geoffray
Date: Sat Oct 24 06:54:32 2009
New Revision: 85000
URL: http://llvm.org/viewvc/llvm-project?rev=85000&view=rev
Log:
Also put the VT in mutator and collector informations for MMTk.
Modified:
vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp
vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h
Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=85000&r1=84999&r2=85000&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Sat Oct 24 06:54:32 2009
@@ -143,11 +143,19 @@
assert(F && "Could not find <init> from Mutator");
MutatorThread::MutatorInit = (MutatorThread::MMTkInitType)
(uintptr_t)executionEngine->getPointerToFunction(F);
+
+ GV = globalModule->getGlobalVariable("org_j3_config_Selected_4Mutator_VT", false);
+ assert(GV && "Could not find VT from Mutator");
+ MutatorThread::MutatorVT = (VirtualTable*)executionEngine->getPointerToGlobal(GV);
F = globalModule->getFunction("JnJVM_org_j3_config_Selected_00024Collector__0003Cinit_0003E__");
assert(F && "Could not find <init> from Collector");
MutatorThread::CollectorInit = (MutatorThread::MMTkInitType)
(uintptr_t)executionEngine->getPointerToFunction(F);
+
+ GV = globalModule->getGlobalVariable("org_j3_config_Selected_4Collector_VT", false);
+ assert(GV && "Could not find VT from Collector");
+ MutatorThread::CollectorVT = (VirtualTable*)executionEngine->getPointerToGlobal(GV);
GlobalAlias* GA = dyn_cast<GlobalAlias>(globalModule->getNamedValue("MMTkAlloc"));
assert(GA && "Could not find MMTkAlloc alias");
Modified: vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp?rev=85000&r1=84999&r2=85000&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp (original)
+++ vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp Sat Oct 24 06:54:32 2009
@@ -19,6 +19,9 @@
MutatorThread::MMTkInitType MutatorThread::MutatorInit = 0;
MutatorThread::MMTkInitType MutatorThread::CollectorInit = 0;
+VirtualTable* MutatorThread::MutatorVT = 0;
+VirtualTable* MutatorThread::CollectorVT = 0;
+
extern "C" void* MMTkMutatorAllocate(uint32_t size, VirtualTable* VT) {
void* val = MutatorThread::get()->Allocator.Allocate(size, "MMTk");
((void**)val)[0] = VT;
Modified: vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h?rev=85000&r1=84999&r2=85000&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h (original)
+++ vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h Sat Oct 24 06:54:32 2009
@@ -34,14 +34,18 @@
static MMTkInitType MutatorInit;
static MMTkInitType CollectorInit;
+ static VirtualTable* MutatorVT;
+ static VirtualTable* CollectorVT;
static void init(Thread* _th) {
MutatorThread* th = (MutatorThread*)_th;
th->MutatorContext =
(uintptr_t)th->Allocator.Allocate(MMTkMutatorSize, "Mutator");
+ ((VirtualTable**)th->MutatorContext)[0] = MutatorVT;
MutatorInit(th->MutatorContext);
th->CollectorContext =
(uintptr_t)th->Allocator.Allocate(MMTkCollectorSize, "Collector");
+ ((VirtualTable**)th->CollectorContext)[0] = CollectorVT;
CollectorInit(th->CollectorContext);
th->realRoutine(_th);
}
More information about the vmkit-commits
mailing list