[vmkit-commits] [vmkit] r69444 - /vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sat Apr 18 06:29:25 PDT 2009


Author: geoffray
Date: Sat Apr 18 08:29:18 2009
New Revision: 69444

URL: http://llvm.org/viewvc/llvm-project?rev=69444&view=rev
Log:
Fix mindo.


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

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Sat Apr 18 08:29:18 2009
@@ -1309,30 +1309,34 @@
     
     uint32 length = getDisplayLength() < depth ? getDisplayLength() : depth;
     memcpy(display, superVT->display, length * sizeof(JavaVirtualTable*)); 
+    uint32 outOfDepth = 0;
     if (depth < getDisplayLength()) {
       display[depth] = this;
       offset = getCacheIndex() + depth + 1;
     } else {
       offset = getCacheIndex();
       ++nbSecondaryTypes;
+      outOfDepth = 1;
     }
 
     mvm::BumpPtrAllocator& allocator = C->classLoader->allocator;
     secondaryTypes = (JavaVirtualTable**)
       allocator.Allocate(sizeof(JavaVirtualTable*) * nbSecondaryTypes);  
     
-    if (offset == getCacheIndex()) {
+    if (outOfDepth) {
       secondaryTypes[0] = this;
     }
 
     if (superVT->nbSecondaryTypes) {
-      memcpy(secondaryTypes + 1, superVT->secondaryTypes,
+      memcpy(secondaryTypes + outOfDepth, superVT->secondaryTypes,
              sizeof(JavaVirtualTable*) * superVT->nbSecondaryTypes);
     }
 
     for (uint32 i = 0; i < cl->nbInterfaces; ++i) {
       JavaVirtualTable* cur = cl->interfaces[i]->virtualVT;
-      secondaryTypes[superVT->nbSecondaryTypes + 1 + i] = cur;
+      assert(cur && "Interface not resolved!\n");
+      uint32 index = superVT->nbSecondaryTypes + outOfDepth + i;
+      secondaryTypes[index] = cur;
     }
 
   } else {





More information about the vmkit-commits mailing list