[vmkit-commits] [vmkit] r62216 - /vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Wed Jan 14 02:22:47 PST 2009


Author: geoffray
Date: Wed Jan 14 04:22:37 2009
New Revision: 62216

URL: http://llvm.org/viewvc/llvm-project?rev=62216&view=rev
Log:
ANEWARRAY references a class and then get the class array. When static 
compiling, we weren't looking if the the class array was external.



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

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp Wed Jan 14 04:22:37 2009
@@ -1855,11 +1855,21 @@
             JnjvmClassLoader* JCL = cl->classLoader;
             const UTF8* arrayName = JCL->constructArrayName(1, cl->name);
           
-            UserCommonClass* dcl = JCL->constructArray(arrayName);
+            UserClassArray* dcl = JCL->constructArray(arrayName);
             valCl = module->getNativeClass(dcl);
-            if (valCl->getType() != module->JavaCommonClassType)
+            
+            // If we're static compiling and the class is not a class we
+            // are compiling, the result of getNativeClass is a pointer to
+            // the class. Load it.
+            if (module->isStaticCompiling() && 
+                valCl->getType() != module->JavaClassArrayType) {
+              valCl = new LoadInst(valCl, "", currentBlock);
+            }
+            
+            if (valCl->getType() != module->JavaCommonClassType) {
               valCl = new BitCastInst(valCl, module->JavaCommonClassType, "",
                                       currentBlock);
+            }
 
           } else {
             const llvm::Type* Ty = 





More information about the vmkit-commits mailing list