[vmkit-commits] [vmkit] r67513 - /vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Mon Mar 23 01:59:27 PDT 2009


Author: geoffray
Date: Mon Mar 23 03:58:41 2009
New Revision: 67513

URL: http://llvm.org/viewvc/llvm-project?rev=67513&view=rev
Log:
Do not add the initializer of java.lang.Object in all VTs.


Modified:
    vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp

Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp?rev=67513&r1=67512&r2=67513&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Mon Mar 23 03:58:41 2009
@@ -1164,9 +1164,12 @@
   std::vector<Constant*> Elemts;
    
   // Destructor
+  Function* Finalizer = 0;
   JavaMethod* meth = ((JavaMethod**)VT)[0];
-  LLVMMethodInfo* LMI = getMethodInfo(meth);
-  Function* Finalizer = LMI->getMethod();
+  if (meth) {
+    LLVMMethodInfo* LMI = getMethodInfo(meth);
+    Finalizer = LMI->getMethod();
+  }
   Elemts.push_back(Finalizer ? 
       ConstantExpr::getCast(Instruction::BitCast, Finalizer, PTy) : N);
   
@@ -1442,6 +1445,7 @@
     JavaMethod& meth = cl->virtualMethods[i];
     ((void**)VT)[meth.offset] = &meth;
   }
+  if (!cl->super) ((void**)VT)[0] = 0;
 #endif 
 }
 





More information about the vmkit-commits mailing list