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

Nicolas Geoffray nicolas.geoffray at lip6.fr
Fri Dec 19 14:46:01 PST 2008


Author: geoffray
Date: Fri Dec 19 16:46:00 2008
New Revision: 61266

URL: http://llvm.org/viewvc/llvm-project?rev=61266&view=rev
Log:
Code cleanup.


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

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp Fri Dec 19 16:46:00 2008
@@ -93,7 +93,7 @@
   if (meth && !isAbstract(meth->access) && canBeInlined(meth)) {
     Value* cl = CallInst::Create(module->GetClassFunction, args[0], "",
                                   currentBlock);
-    Value* cl2 = module->getNativeClass((Class*)cl, currentBlock);
+    Value* cl2 = module->getNativeClass(meth->classDef);
 
     Value* test = new ICmpInst(ICmpInst::ICMP_EQ, cl, cl2, "", currentBlock);
 
@@ -245,7 +245,7 @@
                                   val, "", currentBlock);
     nativeArgs.push_back(res);
 #else
-    Value* cl = module->getJavaClass(compilingClass, currentBlock);
+    Value* cl = module->getJavaClass(compilingClass);
     nativeArgs.push_back(cl);
 #endif
     index = 2;
@@ -258,8 +258,7 @@
     nativeArgs.push_back(i);
   }
   
-  Value* nativeFunc = module->getNativeFunction(compilingMethod, (void*)natPtr,
-                                                currentBlock);
+  Value* nativeFunc = module->getNativeFunction(compilingMethod, (void*)natPtr);
 
   Value* result = llvm::CallInst::Create(nativeFunc, nativeArgs.begin(),
                                          nativeArgs.end(), "", currentBlock);
@@ -399,7 +398,7 @@
   if (isVirtual(compilingMethod->access)) {
     obj = llvmFunction->arg_begin();
   } else {
-    obj = module->getJavaClass(compilingClass, currentBlock);
+    obj = module->getJavaClass(compilingClass);
   }
   monitorEnter(obj);
 }
@@ -409,7 +408,7 @@
   if (isVirtual(compilingMethod->access)) {
     obj = llvmFunction->arg_begin();
   } else {
-    obj = module->getJavaClass(compilingClass, currentBlock);
+    obj = module->getJavaClass(compilingClass);
   }
   monitorExit(obj);
 }
@@ -833,8 +832,7 @@
     if (isVirtual(compilingMethod->access)) {
       argsSync = llvmFunction->arg_begin();
     } else {
-      Value* cl = module->getJavaClass(compilingClass,
-                                       synchronizeExceptionBlock);
+      Value* cl = module->getJavaClass(compilingClass);
       argsSync = cl;
     }
     CallInst::Create(module->ReleaseObjectFunction, argsSync, "",
@@ -994,7 +992,7 @@
                                isolateLocal, "", currentBlock);
 #else
     assert(cur->catchClass);
-    cl = module->getNativeClass(cur->catchClass, currentBlock);
+    cl = module->getNativeClass(cur->catchClass);
 #endif
     
 #ifdef SERVICE
@@ -1155,7 +1153,7 @@
     const UTF8* utf8 = ctpInfo->UTF8At(ctpInfo->ctpDef[index]);
     JavaString* str = compilingClass->classLoader->UTF8ToStr(utf8);
 
-    Value* val = module->getString(str, currentBlock);
+    Value* val = module->getString(str);
     push(val, false);
 #endif
         
@@ -1176,7 +1174,7 @@
     Value* res = getResolvedCommonClass(index, false, &cl);
 
 #ifndef ISOLATE
-    if (cl) res = module->getJavaClass(cl, currentBlock);
+    if (cl) res = module->getJavaClass(cl);
     else
 #endif
     
@@ -1640,8 +1638,8 @@
   Cl = new LoadInst(Cl, "", currentBlock);
 #else
   JavaConstantPool* ctp = compilingClass->ctpInfo;
-  Value* CTP = module->getConstantPool(ctp, currentBlock);
-  Value* Cl = module->getNativeClass(compilingClass, currentBlock);
+  Value* CTP = module->getConstantPool(ctp);
+  Value* Cl = module->getNativeClass(compilingClass);
 #endif
 
   std::vector<Value*> Args;
@@ -1679,7 +1677,7 @@
   Value* node = 0;
   if (cl && (!cl->isClass() || cl->asClass()->isResolved())) {
     if (alreadyResolved) *alreadyResolved = cl;
-    node = module->getNativeClass(cl, currentBlock);
+    node = module->getNativeClass(cl);
     if (node->getType() != module->JavaCommonClassType) {
       node = new BitCastInst(node, module->JavaCommonClassType, "",
                              currentBlock);
@@ -1700,7 +1698,7 @@
   Value* node = 0;
   if (cl && cl->isResolved()) {
     if (alreadyResolved) (*alreadyResolved) = cl;
-    node = module->getNativeClass(cl, currentBlock);
+    node = module->getNativeClass(cl);
   } else {
     node = getConstantPoolAt(index, module->ClassLookupFunction,
                              module->JavaCommonClassType, 0, doThrow);
@@ -1726,7 +1724,7 @@
   Value* Size = 0;
   
   if (cl) {
-    VT = module->getVirtualTable(cl, currentBlock);
+    VT = module->getVirtualTable(cl);
     LLVMClassInfo* LCI = module->getClassInfo(cl);
     Size = LCI->getVirtualSize();
   } else {
@@ -1791,7 +1789,7 @@
     const Type* type = 0;
     if (stat) {
       type = LCI->getStaticType();
-      Value* Cl = module->getNativeClass(field->classDef, currentBlock);
+      Value* Cl = module->getNativeClass(field->classDef);
       bool needsCheck = needsInitialisationCheck(field->classDef,
                                                  compilingClass);
       if (needsCheck) {
@@ -1804,7 +1802,7 @@
                          currentBlock);
       }
 
-      object = module->getStaticInstance(field->classDef, currentBlock);
+      object = module->getStaticInstance(field->classDef);
 #else
       object = CallInst::Create(module->GetStaticInstanceFunction, Cl, "",
                                 currentBlock); 
@@ -2036,7 +2034,7 @@
     enveloppe.initialise(compilingClass->classLoader->allocator, name,
                          signature->keyName);
    
-  Value* llvmEnv = module->getEnveloppe(&enveloppe, currentBlock);
+  Value* llvmEnv = module->getEnveloppe(&enveloppe);
 #else
   Value* llvmEnv = getConstantPoolAt(index,
                                      module->EnveloppeLookupFunction,

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp Fri Dec 19 16:46:00 2008
@@ -1838,7 +1838,7 @@
           JnjvmBootstrapLoader* loader = 
             compilingClass->classLoader->bootstrapLoader;
           UserClassArray* dcl = loader->getArrayClass(id);
-          valCl = module->getNativeClass(dcl, currentBlock);
+          valCl = module->getNativeClass(dcl);
 #else
           Value* args[2] = { isolateLocal,
                              ConstantInt::get(Type::Int32Ty, id - 4) };
@@ -1848,7 +1848,7 @@
 
           LLVMAssessorInfo& LAI = LLVMAssessorInfo::AssessorInfo[charId];
           sizeElement = LAI.sizeInBytesConstant;
-          TheVT = module->getPrimitiveArrayVT(currentBlock);
+          TheVT = module->getPrimitiveArrayVT();
         } else {
           uint16 index = readU2(bytecodes, i);
           CommonClass* cl = 0;
@@ -1859,7 +1859,7 @@
             const UTF8* arrayName = JCL->constructArrayName(1, cl->name);
           
             UserCommonClass* dcl = JCL->constructArray(arrayName);
-            valCl = module->getNativeClass(dcl, currentBlock);
+            valCl = module->getNativeClass(dcl);
 
           } else {
             const llvm::Type* Ty = 
@@ -1870,9 +1870,9 @@
           }
 
           sizeElement = module->constantPtrSize;
-          TheVT = module->getReferenceArrayVT(currentBlock);
+          TheVT = module->getReferenceArrayVT();
         }
-        llvm::Value* arg1 = popAsInt();
+        Value* arg1 = popAsInt();
 
         Value* cmp = new ICmpInst(ICmpInst::ICMP_SLT, arg1,
                                   module->constantZero, "", currentBlock);

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp Fri Dec 19 16:46:00 2008
@@ -82,7 +82,7 @@
 llvm::ConstantInt*  JnjvmModule::JavaObjectLockOffsetConstant;
 llvm::ConstantInt*  JnjvmModule::JavaObjectClassOffsetConstant;
 
-Constant* JnjvmModule::getNativeClass(CommonClass* classDef, Value* Where) {
+Constant* JnjvmModule::getNativeClass(CommonClass* classDef) {
 
   if (staticCompilation) {
     native_class_iterator End = nativeClasses.end();
@@ -129,7 +129,7 @@
   }
 }
 
-Constant* JnjvmModule::getConstantPool(JavaConstantPool* ctp, Value* Where) {
+Constant* JnjvmModule::getConstantPool(JavaConstantPool* ctp) {
   if (staticCompilation) {
     llvm::Constant* varGV = 0;
     constant_pool_iterator End = constantPools.end();
@@ -152,7 +152,7 @@
   }
 }
 
-Constant* JnjvmModule::getString(JavaString* str, Value* Where) {
+Constant* JnjvmModule::getString(JavaString* str) {
   if (staticCompilation) {
     string_iterator SI = strings.find(str);
     if (SI != strings.end()) {
@@ -180,7 +180,7 @@
   }
 }
 
-Constant* JnjvmModule::getEnveloppe(Enveloppe* enveloppe, Value* Where) {
+Constant* JnjvmModule::getEnveloppe(Enveloppe* enveloppe) {
   if (staticCompilation) {
     enveloppe_iterator SI = enveloppes.find(enveloppe);
     if (SI != enveloppes.end()) {
@@ -203,7 +203,7 @@
   }
 }
 
-Constant* JnjvmModule::getJavaClass(CommonClass* cl, Value* Where) {
+Constant* JnjvmModule::getJavaClass(CommonClass* cl) {
   if (staticCompilation) {
     java_class_iterator End = javaClasses.end();
     java_class_iterator I = javaClasses.find(cl);
@@ -234,7 +234,7 @@
   }
 }
 
-Constant* JnjvmModule::getStaticInstance(Class* classDef, Value* Where) {
+Constant* JnjvmModule::getStaticInstance(Class* classDef) {
 #ifdef ISOLATE
   assert(0 && "Should not be here");
   abort();
@@ -275,7 +275,7 @@
   }
 }
 
-Constant* JnjvmModule::getVirtualTable(Class* classDef, Value* Where) {
+Constant* JnjvmModule::getVirtualTable(Class* classDef) {
   if (staticCompilation) {
     llvm::Constant* res = 0;
     virtual_table_iterator End = virtualTables.end();
@@ -310,8 +310,7 @@
   }
 }
 
-Constant* JnjvmModule::getNativeFunction(JavaMethod* meth, void* ptr,
-                                         Value* Where) {
+Constant* JnjvmModule::getNativeFunction(JavaMethod* meth, void* ptr) {
   if (staticCompilation) {
     llvm::Constant* varGV = 0;
     native_function_iterator End = nativeFunctions.end();
@@ -466,7 +465,7 @@
   std::vector<Constant*> Elmts;
  
   if (cl->isClass()) {
-    Elmts.push_back(getVirtualTable(cl->asClass(), 0));
+    Elmts.push_back(getVirtualTable(cl->asClass()));
   } else {
     ClassArray* clA = cl->asArrayClass();
     if (clA->baseClass()->isPrimitive()) {
@@ -476,7 +475,7 @@
     }
   }
   
-  Constant* Cl = getNativeClass(cl, 0);
+  Constant* Cl = getNativeClass(cl);
   Constant* ClGEPs[2] = { constantZero, constantZero };
   Cl = ConstantExpr::getGetElementPtr(Cl, ClGEPs, 2);
     
@@ -503,7 +502,7 @@
   Elmts.push_back(Constant::getNullValue(JavaObjectType));
   
   // vmdata
-  Constant* Cl = getNativeClass(cl, 0);
+  Constant* Cl = getNativeClass(cl);
   Cl = ConstantExpr::getCast(Instruction::BitCast, Cl, JavaObjectType);
   Elmts.push_back(Cl);
 
@@ -544,7 +543,7 @@
   Elmts.push_back(Constant::getNullValue(STy->getContainedType(0)));
   Elmts.push_back(Constant::getNullValue(STy->getContainedType(1)));
   Elmts.push_back(Constant::getNullValue(STy->getContainedType(2)));
-  Elmts.push_back(getEnveloppe(CN->enveloppe, 0));
+  Elmts.push_back(getEnveloppe(CN->enveloppe));
   
   return ConstantStruct::get(STy, Elmts);
 }
@@ -604,7 +603,7 @@
 
   // display
   for (uint32 i = 0; i <= cl->depth; ++i) {
-    Constant* Cl = getNativeClass(cl->display[i], 0);
+    Constant* Cl = getNativeClass(cl->display[i]);
     if (Cl->getType() != JavaCommonClassType)
       Cl = ConstantExpr::getGetElementPtr(Cl, ClGEPs, 2);
     
@@ -635,7 +634,7 @@
   // interfaces
   if (cl->nbInterfaces) {
     for (uint32 i = 0; i < cl->nbInterfaces; ++i) {
-      TempElmts.push_back(getNativeClass(cl->interfaces[i], 0));
+      TempElmts.push_back(getNativeClass(cl->interfaces[i]));
     }
 
     ATy = ArrayType::get(JavaClassType, cl->nbInterfaces);
@@ -659,7 +658,7 @@
 
   // super
   if (cl->super) {
-    CommonClassElts.push_back(getNativeClass(cl->super, 0));
+    CommonClassElts.push_back(getNativeClass(cl->super));
   } else {
     CommonClassElts.push_back(Constant::getNullValue(JavaClassType));
   }
@@ -713,7 +712,7 @@
   FieldElts.push_back(ConstantInt::get(Type::Int16Ty, field.nbAttributs));
 
   // classDef
-  FieldElts.push_back(getNativeClass(field.classDef, 0));
+  FieldElts.push_back(getNativeClass(field.classDef));
 
   // ptrOffset
   FieldElts.push_back(ConstantInt::get(Type::Int32Ty, field.ptrOffset));
@@ -772,7 +771,7 @@
   MethodElts.push_back(ConstantInt::get(Type::Int16Ty, 0));
   
   // classDef
-  MethodElts.push_back(getNativeClass(method.classDef, 0));
+  MethodElts.push_back(getNativeClass(method.classDef));
   
   // name
   MethodElts.push_back(getUTF8(method.name));
@@ -824,7 +823,7 @@
   ClassElts.push_back(CreateConstantFromCommonClass(cl));
 
   // baseClass
-  Constant* Cl = getNativeClass(cl->baseClass(), 0);
+  Constant* Cl = getNativeClass(cl->baseClass());
   if (Cl->getType() != JavaCommonClassType)
     Cl = ConstantExpr::getGetElementPtr(Cl, ClGEPs, 2);
     
@@ -847,7 +846,7 @@
   ClassElts.push_back(ConstantInt::get(Type::Int32Ty, cl->virtualSize));
 
   // virtualTable
-  ClassElts.push_back(getVirtualTable(cl, 0));
+  ClassElts.push_back(getVirtualTable(cl));
 
   // IsolateInfo
   const ArrayType* ATy = dyn_cast<ArrayType>(STy->getContainedType(3));
@@ -857,7 +856,7 @@
   assert(TCMTy && "Malformed type");
                        
   TempElts.push_back(ConstantInt::get(Type::Int32Ty, ready)); 
-  TempElts.push_back(getStaticInstance(cl, 0));
+  TempElts.push_back(getStaticInstance(cl));
   Constant* CStr[1] = { ConstantStruct::get(TCMTy, TempElts) };
   TempElts.clear();
   ClassElts.push_back(ConstantArray::get(ATy, CStr, 1));
@@ -988,7 +987,7 @@
   // innerClasses
   if (cl->nbInnerClasses) {
     for (uint32 i = 0; i < cl->nbInnerClasses; ++i) {
-      TempElts.push_back(getNativeClass(cl->innerClasses[i], 0));
+      TempElts.push_back(getNativeClass(cl->innerClasses[i]));
     }
 
     ATy = ArrayType::get(JavaClassType, cl->nbInnerClasses);
@@ -1009,7 +1008,7 @@
 
   // outerClass
   if (cl->outerClass) {
-    ClassElts.push_back(getNativeClass(cl->outerClass, 0));
+    ClassElts.push_back(getNativeClass(cl->outerClass));
   } else {
     ClassElts.push_back(Constant::getNullValue(JavaClassType));
   }
@@ -1802,11 +1801,11 @@
   LLVMAssessorInfo::initialise();
 }
 
-Constant* JnjvmModule::getReferenceArrayVT(Value* Where) {
+Constant* JnjvmModule::getReferenceArrayVT() {
   return ReferenceArrayVT;
 }
 
-Constant* JnjvmModule::getPrimitiveArrayVT(Value* Where) {
+Constant* JnjvmModule::getPrimitiveArrayVT() {
   return PrimitiveArrayVT;
 }
 

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

==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h Fri Dec 19 16:46:00 2008
@@ -389,18 +389,18 @@
   void initialise();
   void printStats();
 
-  llvm::Constant* getNativeClass(CommonClass* cl, llvm::Value* Where);
-  llvm::Constant* getJavaClass(CommonClass* cl, llvm::Value* Where);
-  llvm::Constant* getStaticInstance(Class* cl, llvm::Value* Where);
-  llvm::Constant* getVirtualTable(Class* cl, llvm::Value* Where);
-  
-  llvm::Constant* getEnveloppe(Enveloppe* enveloppe, llvm::Value* Where);
-  llvm::Constant* getString(JavaString* str, llvm::Value* Where);
-  llvm::Constant* getConstantPool(JavaConstantPool* ctp, llvm::Value* Where);
-  llvm::Constant* getNativeFunction(JavaMethod* meth, void* natPtr, llvm::Value* Where);
+  llvm::Constant* getNativeClass(CommonClass* cl);
+  llvm::Constant* getJavaClass(CommonClass* cl);
+  llvm::Constant* getStaticInstance(Class* cl);
+  llvm::Constant* getVirtualTable(Class* cl);
+  
+  llvm::Constant* getEnveloppe(Enveloppe* enveloppe);
+  llvm::Constant* getString(JavaString* str);
+  llvm::Constant* getConstantPool(JavaConstantPool* ctp);
+  llvm::Constant* getNativeFunction(JavaMethod* meth, void* natPtr);
   
-  llvm::Constant* getReferenceArrayVT(llvm::Value* Where);
-  llvm::Constant* getPrimitiveArrayVT(llvm::Value* Where);
+  llvm::Constant* getReferenceArrayVT();
+  llvm::Constant* getPrimitiveArrayVT();
 
 #ifdef SERVICE
   std::map<const Jnjvm*, llvm::GlobalVariable*> isolates;





More information about the vmkit-commits mailing list