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

Alkis Evlogimenos alkis at cs.uiuc.edu
Wed Feb 2 08:18:59 PST 2005



Changes in directory llvm-java/lib/Compiler:

Compiler.cpp updated: 1.209 -> 1.210
---
Log message:

Implement ArrayCopy.java.


---
Diffs of the changes:  (+19 -0)

 Compiler.cpp |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+)


Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.209 llvm-java/lib/Compiler/Compiler.cpp:1.210
--- llvm-java/lib/Compiler/Compiler.cpp:1.209	Wed Feb  2 00:08:20 2005
+++ llvm-java/lib/Compiler/Compiler.cpp	Wed Feb  2 10:18:48 2005
@@ -381,6 +381,9 @@
       // interfaces vtable pointers
       elements.push_back(PointerType::get(PointerType::get(VTtype)));
       init.push_back(llvm::Constant::getNullValue(elements[3]));
+      // the element size (0 for classes)
+      elements.push_back(Type::IntTy);
+      init.push_back(llvm::ConstantSInt::get(elements[4], 0));
 
       // This is a static variable.
       VTableInfo::TypeInfoTy = StructType::get(elements);
@@ -750,6 +753,8 @@
       typeInfoInit.push_back(ConstantSInt::get(Type::IntTy, lastInterface));
       // The interfaces' vtables.
       typeInfoInit.push_back(interfacesVTables);
+      // the element size (0 for classes)
+      typeInfoInit.push_back(llvm::ConstantSInt::get(Type::IntTy, 0));
 
       return ConstantStruct::get(VTableInfo::TypeInfoTy, typeInfoInit);
     }
@@ -945,6 +950,10 @@
       typeInfoInit.push_back(
         llvm::Constant::getNullValue(
           PointerType::get(PointerType::get(VTableInfo::VTableTy))));
+      // the element size
+      typeInfoInit.push_back(
+        ConstantExpr::getCast(
+          ConstantExpr::getSizeOf(elementTy), Type::IntTy));
 
       init[0] = ConstantStruct::get(VTableInfo::TypeInfoTy, typeInfoInit);
       vi.vtable->setInitializer(ConstantStruct::get(init));
@@ -1049,6 +1058,9 @@
       init.push_back(
         llvm::Constant::getNullValue(
           PointerType::get(PointerType::get(VTableInfo::VTableTy))));
+      // the element size
+      init.push_back(ConstantExpr::getCast(
+                       ConstantExpr::getSizeOf(ObjectBaseRefTy), Type::IntTy));
 
       llvm::Constant* typeInfoInit =
         ConstantStruct::get(VTableInfo::TypeInfoTy, init);
@@ -1166,6 +1178,10 @@
       typeInfoInit.push_back(
         llvm::Constant::getNullValue(
           PointerType::get(PointerType::get(VTableInfo::VTableTy))));
+      // the element size
+      typeInfoInit.push_back(
+        ConstantExpr::getCast(
+          ConstantExpr::getSizeOf(ObjectBaseRefTy), Type::IntTy));
 
       init[0] = ConstantStruct::get(VTableInfo::TypeInfoTy, typeInfoInit);
       vi.vtable->setInitializer(ConstantStruct::get(init));
@@ -1319,12 +1335,15 @@
           classMethodDesc.find("java/lang/IllegalArgumentException") != 0 &&
           classMethodDesc.find("java/lang/IndexOutOfBoundsException") != 0 &&
           classMethodDesc.find("java/lang/RuntimeException") != 0 &&
+          classMethodDesc.find("java/lang/Math") != 0 &&
           classMethodDesc.find("java/lang/Number") != 0 &&
           classMethodDesc.find("java/lang/Byte") != 0 &&
           classMethodDesc.find("java/lang/Integer") != 0 &&
           classMethodDesc.find("java/lang/Long") != 0 &&
           classMethodDesc.find("java/lang/Short") != 0 &&
           classMethodDesc.find("java/lang/StringBuffer") != 0 &&
+          (classMethodDesc.find("java/lang/System") != 0 ||
+           classMethodDesc.find("java/lang/System/<cl") == 0) &&
           classMethodDesc.find("java/util/") != 0) {
         DEBUG(std::cerr << "Skipping compilation of method: "
               << classMethodDesc << '\n');






More information about the llvm-commits mailing list