[vmkit-commits] [vmkit] r96736 - in /vmkit/trunk: include/j3/LLVMInfo.h include/mvm/JIT.h lib/J3/Compiler/JavaJITCompiler.cpp lib/Mvm/Compiler/JIT.cpp lib/Mvm/Compiler/VmkitGC.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sun Feb 21 07:20:12 PST 2010
Author: geoffray
Date: Sun Feb 21 09:20:12 2010
New Revision: 96736
URL: http://llvm.org/viewvc/llvm-project?rev=96736&view=rev
Log:
Remove unused code anr rename the GCStrategy to something more grepable.
Modified:
vmkit/trunk/include/j3/LLVMInfo.h
vmkit/trunk/include/mvm/JIT.h
vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp
Modified: vmkit/trunk/include/j3/LLVMInfo.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/LLVMInfo.h?rev=96736&r1=96735&r2=96736&view=diff
==============================================================================
--- vmkit/trunk/include/j3/LLVMInfo.h (original)
+++ vmkit/trunk/include/j3/LLVMInfo.h Sun Feb 21 09:20:12 2010
@@ -85,19 +85,17 @@
public:
- llvm::GCFunctionInfo* GCInfo;
llvm::Function* getMethod();
llvm::Constant* getOffset();
const llvm::FunctionType* getFunctionType();
LLVMMethodInfo(JavaMethod* M) : methodDef(M), methodFunction(0),
- offsetConstant(0), functionType(0), DbgSubprogram(0), GCInfo(0) {}
+ offsetConstant(0), functionType(0), DbgSubprogram(0) {}
void setDbgSubprogram(llvm::MDNode* node) { DbgSubprogram = node; }
llvm::MDNode* getDbgSubprogram() { return DbgSubprogram; }
virtual void clear() {
- GCInfo = 0;
methodFunction = 0;
offsetConstant = 0;
functionType = 0;
Modified: vmkit/trunk/include/mvm/JIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=96736&r1=96735&r2=96736&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/JIT.h (original)
+++ vmkit/trunk/include/mvm/JIT.h Sun Feb 21 09:20:12 2010
@@ -174,7 +174,7 @@
static const llvm::Type* pointerSizeType;
static llvm::ExecutionEngine* executionEngine;
- static llvm::GCStrategy* GC;
+ static llvm::GCStrategy* TheGCStrategy;
static mvm::LockRecursive protectEngine;
static llvm::Module *globalModule;
static llvm::FunctionPassManager* globalFunctionPasses;
Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=96736&r1=96735&r2=96736&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sun Feb 21 09:20:12 2010
@@ -84,7 +84,7 @@
llvm::GCFunctionInfo* GFI = 0;
// We know the last GC info is for this method.
if (F.hasGC()) {
- GCStrategy::iterator I = mvm::MvmModule::GC->end();
+ GCStrategy::iterator I = mvm::MvmModule::TheGCStrategy->end();
I--;
DEBUG(errs() << (*I)->getFunction().getName() << '\n');
DEBUG(errs() << F.getName() << '\n');
@@ -399,20 +399,6 @@
void* res = mvm::MvmModule::executionEngine->getPointerToGlobal(func);
JITListener->setCurrentCompiledMethod(0);
func->deleteBody();
-
- // Update the GC info.
- LLVMMethodInfo* LMI = getMethodInfo(meth);
- // If it's not, we know the last GC info is for this method.
- if (func->hasGC() && !LMI->GCInfo) {
- GCStrategy::iterator I = mvm::MvmModule::GC->end();
- I--;
- DEBUG(errs() << (*I)->getFunction().getName() << '\n');
- DEBUG(errs() << LMI->getMethod()->getName() << '\n');
- assert(&(*I)->getFunction() == LMI->getMethod() &&
- "GC Info and method do not correspond");
- LMI->GCInfo = *I;
- }
-
mvm::MvmModule::unprotectIR();
return res;
Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=96736&r1=96735&r2=96736&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Sun Feb 21 09:20:12 2010
@@ -82,12 +82,14 @@
virtual void NotifyFunctionEmitted(const Function &F,
void *Code, size_t Size,
const EmittedFunctionDetails &Details) {
-
+ // Functions compiled in the global module are MMTk functions and the
+ // interfaces with VMKit.
if (F.getParent() == MvmModule::globalModule) {
llvm::GCFunctionInfo* GFI = 0;
// We know the last GC info is for this method.
if (F.hasGC()) {
- GCStrategy::iterator I = mvm::MvmModule::GC->end();
+ // Only the interface functions have GC informations.
+ GCStrategy::iterator I = mvm::MvmModule::TheGCStrategy->end();
I--;
DEBUG(errs() << (*I)->getFunction().getName() << '\n');
DEBUG(errs() << F.getName() << '\n');
@@ -267,7 +269,11 @@
Boot = (BootType)(uintptr_t)executionEngine->getPointerToFunction(F);
Boot(Plan);
-
+ F = globalModule->getFunction("Java_org_j3_mmtk_Collection_triggerCollection__I");
+ assert(F && "Could not find external collect");
+ gc::MMTkTriggerCollection = (gc::MMTkCollectType)
+ (uintptr_t)executionEngine->getPointerToFunction(F);
+
//===-------------------- TODO: make those virtual. -------------------===//
F = globalModule->getFunction("JnJVM_org_mmtk_plan_TraceLocal_reportDelayedRootEdge__Lorg_vmmagic_unboxed_Address_2");
assert(F && "Could not find reportDelayedRootEdge from TraceLocal");
@@ -314,11 +320,6 @@
gc::MMTkGetForwardedFinalizable = (gc::MMTkGetForwardedFinalizableType)
(uintptr_t)executionEngine->getPointerToFunction(F);
- F = globalModule->getFunction("Java_org_j3_mmtk_Collection_triggerCollection__I");
- assert(F && "Could not find external collect");
- gc::MMTkTriggerCollection = (gc::MMTkCollectType)
- (uintptr_t)executionEngine->getPointerToFunction(F);
-
}
#endif
}
@@ -461,7 +462,7 @@
const llvm::Type* MvmModule::arrayPtrType;
const llvm::TargetData* MvmModule::TheTargetData;
-llvm::GCStrategy* MvmModule::GC;
+llvm::GCStrategy* MvmModule::TheGCStrategy;
llvm::Module *MvmModule::globalModule;
llvm::FunctionPassManager* MvmModule::globalFunctionPasses;
llvm::ExecutionEngine* MvmModule::executionEngine;
Modified: vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp?rev=96736&r1=96735&r2=96736&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp (original)
+++ vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp Sun Feb 21 09:20:12 2010
@@ -32,5 +32,5 @@
VmkitGC::VmkitGC() {
NeededSafePoints = 1 << GC::PostCall;
- mvm::MvmModule::GC = this;
+ mvm::MvmModule::TheGCStrategy = this;
}
More information about the vmkit-commits
mailing list