[vmkit-commits] [vmkit] r98517 - /vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Mar 14 14:54:57 PDT 2010


Author: geoffray
Date: Sun Mar 14 16:54:56 2010
New Revision: 98517

URL: http://llvm.org/viewvc/llvm-project?rev=98517&view=rev
Log:
Lookup the GC info instead of getting the first one.


Modified:
    vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp

Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=98517&r1=98516&r2=98517&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sun Mar 14 16:54:56 2010
@@ -82,12 +82,14 @@
       mvm::BumpPtrAllocator& Alloc = 
         currentCompiledMethod->classDef->classLoader->allocator;
       llvm::GCFunctionInfo* GFI = 0;
-      // We know the last GC info is for this method.
       if (F.hasGC()) {
         GCStrategy::iterator I = mvm::MvmModule::TheGCStrategy->end();
         I--;
-        DEBUG(errs() << (*I)->getFunction().getName() << '\n');
-        DEBUG(errs() << F.getName() << '\n');
+        // TODO: see why this is not true in a non- LLVM lazy mode.
+        while (&(*I)->getFunction() != &F) {
+          assert(I != mvm::MvmModule::TheGCStrategy->begin() && "No GC info");
+          I--;
+        }
         assert(&(*I)->getFunction() == &F &&
            "GC Info and method do not correspond");
         GFI = *I;
@@ -116,6 +118,7 @@
   }
 
   void setCurrentCompiledMethod(JavaMethod* meth, llvm::Function* func) {
+    assert(currentCompiledMethod == NULL && "Recursive compilation detected");
     currentCompiledMethod = meth;
     currentCompiledFunction = func;
   }





More information about the vmkit-commits mailing list