[vmkit-commits] [vmkit] r65443 - /vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Wed Feb 25 03:15:57 PST 2009


Author: geoffray
Date: Wed Feb 25 05:15:57 2009
New Revision: 65443

URL: http://llvm.org/viewvc/llvm-project?rev=65443&view=rev
Log:
During AOT, get all the Functions before compiling them, so that an LLVM pass
can reason on them.


Modified:
    vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp

Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=65443&r1=65442&r2=65443&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Wed Feb 25 05:15:57 2009
@@ -1102,21 +1102,23 @@
 
 
 static void compileClass(Class* cl) {
+  JnjvmModule* Mod = cl->classLoader->getModule();
+  
   // Make sure the class is emitted.
-  cl->classLoader->getModule()->getNativeClass(cl);
+  Mod->getNativeClass(cl);
 
   for (uint32 i = 0; i < cl->nbVirtualMethods; ++i) {
     JavaMethod& meth = cl->virtualMethods[i];
     if (!isAbstract(meth.access))
       cl->classLoader->getModuleProvider()->parseFunction(&meth);
-    meth.getSignature()->compileAllStubs();
+    if (Mod->generateStubs) meth.getSignature()->compileAllStubs();
   }
   
   for (uint32 i = 0; i < cl->nbStaticMethods; ++i) {
     JavaMethod& meth = cl->staticMethods[i];
     if (!isAbstract(meth.access))
       cl->classLoader->getModuleProvider()->parseFunction(&meth);
-    meth.getSignature()->compileAllStubs();
+    if (Mod->generateStubs) meth.getSignature()->compileAllStubs();
   }
 }
 
@@ -1173,6 +1175,17 @@
         Class* cl = *i;
         cl->resolveClass();
         cl->setOwnerClass(JavaThread::get());
+        
+        for (uint32 i = 0; i < cl->nbVirtualMethods; ++i) {
+          LLVMMethodInfo* LMI = M->getMethodInfo(&cl->virtualMethods[i]);
+          LMI->getMethod();
+        }
+
+        for (uint32 i = 0; i < cl->nbStaticMethods; ++i) {
+          LLVMMethodInfo* LMI = M->getMethodInfo(&cl->staticMethods[i]);
+          LMI->getMethod();
+        }
+
       }
       
       for (std::vector<Class*>::iterator i = classes.begin(), e = classes.end();





More information about the vmkit-commits mailing list