[llvm-commits] CVS: llvm-java/lib/Compiler/VMClass.h VMClass.cpp Compiler.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Tue Apr 19 00:03:38 PDT 2005



Changes in directory llvm-java/lib/Compiler:

VMClass.h updated: 1.32 -> 1.33
VMClass.cpp updated: 1.42 -> 1.43
Compiler.cpp updated: 1.280 -> 1.281
---
Log message:

Rename dynamicallyBoundMethod to dynamicMethod.


---
Diffs of the changes:  (+23 -25)

 Compiler.cpp |    5 ++---
 VMClass.cpp  |   32 +++++++++++++++-----------------
 VMClass.h    |   11 ++++++-----
 3 files changed, 23 insertions(+), 25 deletions(-)


Index: llvm-java/lib/Compiler/VMClass.h
diff -u llvm-java/lib/Compiler/VMClass.h:1.32 llvm-java/lib/Compiler/VMClass.h:1.33
--- llvm-java/lib/Compiler/VMClass.h:1.32	Sat Apr  2 20:49:44 2005
+++ llvm-java/lib/Compiler/VMClass.h	Tue Apr 19 02:03:27 2005
@@ -49,7 +49,8 @@
     std::vector<const VMClass*> interfaces_;
     std::vector<const VMField*> memberFields_;
     std::vector<const VMField*> staticFields_;
-    std::vector<const VMMethod*> dynamicallyBoundMethods_;
+    std::vector<const VMMethod*> dynamicMethods_;
+    std::vector<const VMMethod*> staticMethods_;
     GlobalVariable* classRecord_;
 
     void init();
@@ -109,11 +110,11 @@
     bool isPrimitive() const { return getType() == getLayoutType(); }
     bool isInterface() const { return classFile_ && classFile_->isInterface(); }
     int getInterfaceIndex() const { return interfaceIndex_; }
-    unsigned getNumDynamicallyBoundMethods() const {
-      return dynamicallyBoundMethods_.size();
+    unsigned getNumDynamicMethods() const {
+      return dynamicMethods_.size();
     }
-    const VMMethod* getDynamicallyBoundMethod(unsigned i) const {
-      return dynamicallyBoundMethods_[i];
+    const VMMethod* getDynamicMethod(unsigned i) const {
+      return dynamicMethods_[i];
     }
     llvm::Constant* getClassRecord() const { return classRecord_; }
 


Index: llvm-java/lib/Compiler/VMClass.cpp
diff -u llvm-java/lib/Compiler/VMClass.cpp:1.42 llvm-java/lib/Compiler/VMClass.cpp:1.43
--- llvm-java/lib/Compiler/VMClass.cpp:1.42	Sat Apr  2 20:49:44 2005
+++ llvm-java/lib/Compiler/VMClass.cpp	Tue Apr 19 02:03:27 2005
@@ -215,17 +215,16 @@
   assert(interface->isInterface() && "Must be passed an interface!");
 
   std::vector<llvm::Constant*> init;
-  init.reserve(interface->dynamicallyBoundMethods_.size()+1);
+  init.reserve(interface->getNumDynamicMethods() + 1);
   // Insert a null type info for this interface.
   init.push_back(llvm::Constant::getNullValue(resolver_->getTypeInfoType()));
   // For each method this interface declares, find the corresponding
   // method in this class and put it in its slot.
-  for (unsigned i = 0, e = interface->dynamicallyBoundMethods_.size();
-       i != e; ++i) {
+  for (unsigned i = 0, e = interface->getNumDynamicMethods(); i != e; ++i) {
     assert(init.size() == i+1 && "Interface method not found in class!");
-    const VMMethod* interfaceMethod = interface->dynamicallyBoundMethods_[i];
-    for (unsigned j = 0, f = dynamicallyBoundMethods_.size(); j != f; ++j) {
-      const VMMethod* method = dynamicallyBoundMethods_[j];
+    const VMMethod* interfaceMethod = interface->getDynamicMethod(i);
+    for (unsigned j = 0, f = getNumDynamicMethods(); j != f; ++j) {
+      const VMMethod* method = getDynamicMethod(j);
       if (method->getName() == interfaceMethod->getName() &&
           method->getDescriptor() == interfaceMethod->getDescriptor()) {
         init.push_back(method->getFunction());
@@ -435,7 +434,7 @@
   // Find dynamically bound methods.
   if (!isPrimitive()) {
     if (const VMClass* superClass = getSuperClass())
-      dynamicallyBoundMethods_ = superClass->dynamicallyBoundMethods_;
+      dynamicMethods_ = superClass->dynamicMethods_;
 
     if (getClassFile()) {
       const Methods& methods = classFile_->getMethods();
@@ -449,12 +448,11 @@
           methodMap_.insert(
             std::make_pair(name + descriptor, VMMethod(this, method)));
         // Otherwise we need to assign an index for it and update the
-        // dynamicallyBoundMethods_ vector.
+        // dynamicMethods_ vector.
         else {
           const VMMethod* overridenMethod = NULL;
-          for (unsigned i = 0, e = getNumDynamicallyBoundMethods();
-               i != e; ++i) {
-            const VMMethod* m = getDynamicallyBoundMethod(i);
+          for (unsigned i = 0, e = getNumDynamicMethods(); i != e; ++i) {
+            const VMMethod* m = getDynamicMethod(i);
             if (m->getName() == name && m->getDescriptor() == descriptor)
               overridenMethod = m;
           }
@@ -466,15 +464,15 @@
             MethodMap::iterator i = methodMap_.insert(
               std::make_pair(name + descriptor,
                              VMMethod(this, method, index))).first;
-            dynamicallyBoundMethods_[index] = &i->second;
+            dynamicMethods_[index] = &i->second;
           }
           // Otherwise assign it a new index.
           else {
-            int index = dynamicallyBoundMethods_.size();
+            int index = dynamicMethods_.size();
             MethodMap::iterator i = methodMap_.insert(
               std::make_pair(
                 name + descriptor, VMMethod(this, method, index))).first;
-            dynamicallyBoundMethods_.push_back(&i->second);
+            dynamicMethods_.push_back(&i->second);
           }
         }
       }
@@ -482,10 +480,10 @@
   }
 
   std::vector<llvm::Constant*> init;
-  init.reserve(1 + getNumDynamicallyBoundMethods());
+  init.reserve(1 + getNumDynamicMethods());
   init.push_back(buildClassTypeInfo());
-  for (unsigned i = 0, e = getNumDynamicallyBoundMethods(); i != e; ++i) {
-    const VMMethod* method = getDynamicallyBoundMethod(i);
+  for (unsigned i = 0, e = getNumDynamicMethods(); i != e; ++i) {
+    const VMMethod* method = getDynamicMethod(i);
     init.push_back(
       method->isAbstract() ?
       llvm::Constant::getNullValue(method->getFunction()->getType()) :


Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.280 llvm-java/lib/Compiler/Compiler.cpp:1.281
--- llvm-java/lib/Compiler/Compiler.cpp:1.280	Sat Apr  2 20:43:09 2005
+++ llvm-java/lib/Compiler/Compiler.cpp	Tue Apr 19 02:03:27 2005
@@ -451,9 +451,8 @@
 
       // Schedule all its dynamically bound non abstract methods for
       // compilation.
-      for (unsigned i = 0, e = clazz->getNumDynamicallyBoundMethods();
-           i != e; ++i) {
-        const VMMethod* method = clazz->getDynamicallyBoundMethod(i);
+      for (unsigned i = 0, e = clazz->getNumDynamicMethods(); i != e; ++i) {
+        const VMMethod* method = clazz->getDynamicMethod(i);
         if (!method->isAbstract())
           scheduleMethod(method);
       }






More information about the llvm-commits mailing list