[vmkit-commits] [vmkit] r62321 - in /vmkit/trunk/lib/JnJVM/VMCore: JnjvmModule.cpp JnjvmModule.h

Nicolas Geoffray nicolas.geoffray at lip6.fr
Fri Jan 16 07:07:37 PST 2009


Author: geoffray
Date: Fri Jan 16 09:07:37 2009
New Revision: 62321

URL: http://llvm.org/viewvc/llvm-project?rev=62321&view=rev
Log:
Just index in the virtualMethods array, don't bother with staticMethods.


Modified:
    vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
    vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp Fri Jan 16 09:07:37 2009
@@ -208,26 +208,14 @@
     Class* cl = meth->classDef;
     Constant* MOffset = 0;
     Constant* Array = 0;
-    if (isVirtual(meth->access)) {
-      method_iterator SI = virtualMethods.find(cl);
-      for (uint32 i = 0; i < cl->nbVirtualMethods; ++i) {
-        if (&cl->virtualMethods[i] == meth) {
-          MOffset = ConstantInt::get(Type::Int32Ty, i);
-          break;
-        }
+    method_iterator SI = virtualMethods.find(cl);
+    for (uint32 i = 0; i < cl->nbVirtualMethods + cl->nbStaticMethods; ++i) {
+      if (&cl->virtualMethods[i] == meth) {
+        MOffset = ConstantInt::get(Type::Int32Ty, i);
+        break;
       }
-      Array = SI->second;
-    } else {
-      method_iterator SI = staticMethods.find(cl);
-      for (uint32 i = 0; i < cl->nbStaticMethods; ++i) {
-        if (&cl->staticMethods[i] == meth) {
-          MOffset = ConstantInt::get(Type::Int32Ty, i);
-          break;
-        }
-      }
-      Array = SI->second;
     }
-    
+    Array = SI->second; 
     Constant* GEPs[2] = { constantZero, MOffset };
     return ConstantExpr::getGetElementPtr(Array, GEPs, 2);
     
@@ -1130,7 +1118,6 @@
     Constant* I[1] = { nbVirtualMethods };
     Constant* C = ConstantExpr::getGetElementPtr(methods, I, 1);
     ClassElts.push_back(C);
-    staticMethods.insert(std::make_pair(cl, C));
   } else {
     ClassElts.push_back(Constant::getNullValue(JavaMethodType));
   }

Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h?rev=62321&r1=62320&r2=62321&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h Fri Jan 16 09:07:37 2009
@@ -192,7 +192,6 @@
   std::map<const JavaMethod*, llvm::Constant*> nativeFunctions;
   std::map<const UTF8*, llvm::Constant*> utf8s;
   std::map<const Class*, llvm::Constant*> virtualMethods;
-  std::map<const Class*, llvm::Constant*> staticMethods;
   
   typedef std::map<const Class*, llvm::Constant*>::iterator
     method_iterator;





More information about the vmkit-commits mailing list