[vmkit-commits] [vmkit] r96737 - in /vmkit/trunk: include/j3/J3Intrinsics.h include/mvm/JIT.h lib/J3/Compiler/J3Intrinsics.cpp lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/Compiler/JavaLLVMCompiler.cpp lib/J3/Compiler/LLVMInfo.cpp lib/Mvm/Compiler/JIT.cpp lib/N3/Mono/MonoString.cpp lib/N3/VMCore/CLIJit.cpp lib/N3/VMCore/CLIJit.h lib/N3/VMCore/CLIJitMeta.cpp lib/N3/VMCore/N3.cpp lib/N3/VMCore/N3.h lib/N3/VMCore/Opcodes.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Feb 21 08:11:33 PST 2010


Author: geoffray
Date: Sun Feb 21 10:11:33 2010
New Revision: 96737

URL: http://llvm.org/viewvc/llvm-project?rev=96737&view=rev
Log:
Separate llvm functionalities and llvm types/constants/functions.


Modified:
    vmkit/trunk/include/j3/J3Intrinsics.h
    vmkit/trunk/include/mvm/JIT.h
    vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp
    vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp
    vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
    vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp
    vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp
    vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
    vmkit/trunk/lib/N3/Mono/MonoString.cpp
    vmkit/trunk/lib/N3/VMCore/CLIJit.cpp
    vmkit/trunk/lib/N3/VMCore/CLIJit.h
    vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp
    vmkit/trunk/lib/N3/VMCore/N3.cpp
    vmkit/trunk/lib/N3/VMCore/N3.h
    vmkit/trunk/lib/N3/VMCore/Opcodes.cpp

Modified: vmkit/trunk/include/j3/J3Intrinsics.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/include/j3/J3Intrinsics.h (original)
+++ vmkit/trunk/include/j3/J3Intrinsics.h Sun Feb 21 10:11:33 2010
@@ -14,7 +14,7 @@
 
 namespace j3 {
 
-class J3Intrinsics : public mvm::MvmModule {
+class J3Intrinsics : public mvm::BaseIntrinsics {
 
 public:
   static const llvm::Type* JavaArrayUInt8Type;

Modified: vmkit/trunk/include/mvm/JIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/JIT.h (original)
+++ vmkit/trunk/include/mvm/JIT.h Sun Feb 21 10:11:33 2010
@@ -60,11 +60,11 @@
 const float NaNFloat = NAN; //(float)(((float)0.0) / (float)0.0);
 const double NaNDouble = NAN; //0.0 / 0.0;
 
-class MvmModule {
+class BaseIntrinsics {
 
 public:
   
-  explicit MvmModule(llvm::Module*);
+  explicit BaseIntrinsics(llvm::Module*);
  
   llvm::Function* exceptionEndCatch;
   llvm::Function* exceptionBeginCatch;
@@ -172,7 +172,11 @@
    static const llvm::PointerType* ptrPtrType;
    static const llvm::Type* arrayPtrType;
    static const llvm::Type* pointerSizeType;
+};
+
 
+class MvmModule {
+public:
    static llvm::ExecutionEngine* executionEngine;
    static llvm::GCStrategy* TheGCStrategy;
    static mvm::LockRecursive protectEngine;

Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Sun Feb 21 10:11:33 2010
@@ -63,7 +63,7 @@
 }
 
 void J3Intrinsics::initialise() {
-  Module* module = globalModule;
+  Module* module = mvm::MvmModule::globalModule;
   
   if (!module->getTypeByName("JavaThread"))
     j3::llvm_runtime::makeLLVMModuleContents(module);
@@ -132,11 +132,11 @@
 }
 
 J3Intrinsics::J3Intrinsics(llvm::Module* module) :
-  MvmModule(module) {
+  BaseIntrinsics(module) {
   
   if (!VTType) {
     initialise();
-    copyDefinitions(module, globalModule);
+    mvm::MvmModule::copyDefinitions(module, mvm::MvmModule::globalModule);
   }
   
   JavaObjectNullConstant =

Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sun Feb 21 10:11:33 2010
@@ -1651,7 +1651,7 @@
   Module* Mod = getLLVMModule();
   for (Module::const_global_iterator i = Mod->global_begin(),
        e = Mod->global_end(); i != e; ++i) {
-    size += J3Intrinsics::getTypeSize(i->getType());
+    size += mvm::MvmModule::getTypeSize(i->getType());
   }
   fprintf(stderr, "%lluB\n", (unsigned long long int)size);
 }

Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sun Feb 21 10:11:33 2010
@@ -248,9 +248,9 @@
   EmitFunctionName = false;
 #endif
   
-  J3Intrinsics::protectEngine.lock();
-  J3Intrinsics::executionEngine->addModule(TheModule);
-  J3Intrinsics::protectEngine.unlock();
+  mvm::MvmModule::protectEngine.lock();
+  mvm::MvmModule::executionEngine->addModule(TheModule);
+  mvm::MvmModule::protectEngine.unlock();
   
   addJavaPasses();
 
@@ -388,7 +388,7 @@
   Function* func = getMethodInfo(meth)->getMethod();
   func->setName(name);
   assert(ptr && "No value given");
-  J3Intrinsics::executionEngine->updateGlobalMapping(func, ptr);
+  mvm::MvmModule::executionEngine->updateGlobalMapping(func, ptr);
   func->setLinkage(GlobalValue::ExternalLinkage);
 }
 
@@ -480,7 +480,7 @@
 
 JavaJITCompiler* JavaJITCompiler::CreateCompiler(const std::string& ModuleID) {
   if (LLVMLazy) {
-    J3Intrinsics::executionEngine->DisableLazyCompilation(false); 
+    mvm::MvmModule::executionEngine->DisableLazyCompilation(false); 
     return new JavaLLVMLazyJITCompiler(ModuleID);
   }
   return new JavaJ3LazyJITCompiler(ModuleID);

Modified: vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp Sun Feb 21 10:11:33 2010
@@ -61,20 +61,20 @@
   Function* func = LMI->getMethod();
   
   // We are jitting. Take the lock.
-  J3Intrinsics::protectIR();
+  mvm::MvmModule::protectIR();
   if (func->getLinkage() == GlobalValue::ExternalWeakLinkage) {
     JavaJIT jit(this, meth, func);
     if (isNative(meth->access)) {
       jit.nativeCompile();
-      J3Intrinsics::runPasses(func, JavaNativeFunctionPasses);
+      mvm::MvmModule::runPasses(func, JavaNativeFunctionPasses);
     } else {
       jit.javaCompile();
-      J3Intrinsics::runPasses(func, J3Intrinsics::globalFunctionPasses);
-      J3Intrinsics::runPasses(func, JavaFunctionPasses);
+      mvm::MvmModule::runPasses(func, mvm::MvmModule::globalFunctionPasses);
+      mvm::MvmModule::runPasses(func, JavaFunctionPasses);
     }
     func->setLinkage(GlobalValue::ExternalLinkage);
   }
-  J3Intrinsics::unprotectIR();
+  mvm::MvmModule::unprotectIR();
 
   return func;
 }

Modified: vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp Sun Feb 21 10:11:33 2010
@@ -39,7 +39,7 @@
 const Type* LLVMClassInfo::getVirtualType() {
   if (!virtualType) {
     std::vector<const llvm::Type*> fields;
-    const TargetData* targetData = J3Intrinsics::TheTargetData;
+    const TargetData* targetData = mvm::MvmModule::TheTargetData;
     const StructLayout* sl = 0;
     const StructType* structType = 0;
     JavaLLVMCompiler* Mod = 
@@ -77,7 +77,7 @@
       field.ptrOffset = sl->getElementOffset(i + 1);
     }
     
-    uint64 size = J3Intrinsics::getTypeSize(structType);
+    uint64 size = mvm::MvmModule::getTypeSize(structType);
     classDef->virtualSize = (uint32)size;
     classDef->alignment = sl->getAlignment();
     virtualSizeConstant = ConstantInt::get(Type::getInt32Ty(context), size);
@@ -109,7 +109,7 @@
   
     StructType* structType = StructType::get(context, fields, false);
     staticType = PointerType::getUnqual(structType);
-    const TargetData* targetData = J3Intrinsics::TheTargetData;
+    const TargetData* targetData = mvm::MvmModule::TheTargetData;
     const StructLayout* sl = targetData->getStructLayout(structType);
     
     for (uint32 i = 0; i < classDef->nbStaticFields; ++i) {
@@ -117,7 +117,7 @@
       field.ptrOffset = sl->getElementOffset(i);
     }
     
-    uint64 size = J3Intrinsics::getTypeSize(structType);
+    uint64 size = mvm::MvmModule::getTypeSize(structType);
     cl->staticSize = size;
   }
   return staticType;
@@ -297,7 +297,7 @@
    
     const llvm::Type* Ty = PointerType::getUnqual(J3Intrinsics::JavaObjectType);
 
-    llvmArgs.push_back(mvm::MvmModule::ptrType); // JNIEnv
+    llvmArgs.push_back(J3Intrinsics::ptrType); // JNIEnv
     llvmArgs.push_back(Ty); // Class
 
     for (uint32 i = 0; i < size; ++i) {

Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Sun Feb 21 10:11:33 2010
@@ -166,14 +166,8 @@
 
   mvm::llvm_runtime::makeLLVMModuleContents(globalModule);
   
-  LLVMContext& Context = globalModule->getContext();
+  //LLVMContext& Context = globalModule->getContext();
   //MetadataTypeKind = Context.getMDKindID("HighLevelType");
-  // Type declaration
-  ptrType = PointerType::getUnqual(Type::getInt8Ty(Context));
-  ptr32Type = PointerType::getUnqual(Type::getInt32Ty(Context));
-  ptrPtrType = PointerType::getUnqual(ptrType);
-  pointerSizeType = globalModule->getPointerSize() == Module::Pointer32 ?
-    Type::getInt32Ty(Context) : Type::getInt64Ty(Context);
  
   for (std::vector<std::string>::iterator i = LoadBytecodeFiles.begin(),
        e = LoadBytecodeFiles.end(); i != e; ++i) {
@@ -325,12 +319,21 @@
 }
 
 
-MvmModule::MvmModule(llvm::Module* module) {
+BaseIntrinsics::BaseIntrinsics(llvm::Module* module) {
 
-  module->setDataLayout(globalModule->getDataLayout());
-  module->setTargetTriple(globalModule->getTargetTriple());
+  module->setDataLayout(MvmModule::globalModule->getDataLayout());
+  module->setTargetTriple(MvmModule::globalModule->getTargetTriple());
   LLVMContext& Context = module->getContext();
   
+  if (!ptrType) {
+    // Type declaration
+    ptrType = PointerType::getUnqual(Type::getInt8Ty(Context));
+    ptr32Type = PointerType::getUnqual(Type::getInt32Ty(Context));
+    ptrPtrType = PointerType::getUnqual(ptrType);
+    pointerSizeType = module->getPointerSize() == Module::Pointer32 ?
+      Type::getInt32Ty(Context) : Type::getInt64Ty(Context);
+  }
+  
   // Constant declaration
   constantLongMinusOne = ConstantInt::get(Type::getInt64Ty(Context), (uint64_t)-1);
   constantLongZero = ConstantInt::get(Type::getInt64Ty(Context), 0);
@@ -384,7 +387,7 @@
   arrayPtrType = PointerType::getUnqual(ArrayType::get(Type::getInt8Ty(Context), 0));
 
 
-  copyDefinitions(module, globalModule); 
+  MvmModule::copyDefinitions(module, MvmModule::globalModule); 
     
   printFloatLLVM = module->getFunction("printFloat");
   printDoubleLLVM = module->getFunction("printDouble");
@@ -455,11 +458,11 @@
 }
 
 
-const llvm::PointerType* MvmModule::ptrType;
-const llvm::PointerType* MvmModule::ptr32Type;
-const llvm::PointerType* MvmModule::ptrPtrType;
-const llvm::Type* MvmModule::pointerSizeType;
-const llvm::Type* MvmModule::arrayPtrType;
+const llvm::PointerType* BaseIntrinsics::ptrType;
+const llvm::PointerType* BaseIntrinsics::ptr32Type;
+const llvm::PointerType* BaseIntrinsics::ptrPtrType;
+const llvm::Type* BaseIntrinsics::pointerSizeType;
+const llvm::Type* BaseIntrinsics::arrayPtrType;
 
 const llvm::TargetData* MvmModule::TheTargetData;
 llvm::GCStrategy* MvmModule::TheGCStrategy;

Modified: vmkit/trunk/lib/N3/Mono/MonoString.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/Mono/MonoString.cpp (original)
+++ vmkit/trunk/lib/N3/Mono/MonoString.cpp Sun Feb 21 10:11:33 2010
@@ -44,7 +44,7 @@
   if (!str->_llvmVar) {
     N3* vm = VMThread::get()->getVM();
     if (!str->_llvmVar) {
-      const Type* pty = mvm::MvmModule::ptrType;
+      const Type* pty = mvm::BaseIntrinsics::ptrType;
       Module* Mod = vm->getLLVMModule();
       Constant* cons = 
         ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (self)),

Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Sun Feb 21 10:11:33 2010
@@ -652,7 +652,7 @@
 
   } else if (type->super == MSCorlib::pValue || type->super == MSCorlib::pEnum) {
     obj = new AllocaInst(type->naturalType, "", currentBlock);
-    uint64 size = module->getTypeSize(type->naturalType);
+    uint64 size = mvm::MvmModule::getTypeSize(type->naturalType);
         
     std::vector<Value*> params;
     params.push_back(new BitCastInst(obj, module->ptrType, "", currentBlock));
@@ -759,7 +759,7 @@
   
   if (field->signature->super == MSCorlib::pValue &&
       field->signature->virtualFields.size() > 1) {
-    uint64 size = module->getTypeSize(field->signature->naturalType);
+    uint64 size = mvm::MvmModule::getTypeSize(field->signature->naturalType);
         
     std::vector<Value*> params;
     params.push_back(new BitCastInst(ptr, PointerType::getUnqual(Type::getInt8Ty(getGlobalContext())), "", currentBlock));
@@ -1255,7 +1255,7 @@
         new StoreInst(Constant::getNullValue(cl->naturalType), alloc, false,
                       currentBlock);
       } else {
-        uint64 size = module->getTypeSize(cl->naturalType);
+        uint64 size = mvm::MvmModule::getTypeSize(cl->naturalType);
         
         std::vector<Value*> params;
         params.push_back(new BitCastInst(alloc, module->ptrType, "",
@@ -1302,7 +1302,7 @@
     } else if (compilingMethod->structReturn) {
       const Type* lastType = 
         funcType->getContainedType(funcType->getNumContainedTypes() - 1);
-      uint64 size = module->getTypeSize(lastType->getContainedType(0));
+      uint64 size = mvm::MvmModule::getTypeSize(lastType->getContainedType(0));
       Value* obj = --llvmFunction->arg_end();
       std::vector<Value*> params;
       params.push_back(new BitCastInst(obj, module->ptrType, "",
@@ -1338,7 +1338,7 @@
     new UnreachableInst(getGlobalContext(), unifiedUnreachable);
   }
   
-  module->runPasses(llvmFunction, VMThread::get()->perFunctionPasses);
+  mvm::MvmModule::runPasses(llvmFunction, VMThread::get()->perFunctionPasses);
   
   if (nbe == 0 && codeLen < 50) {
     PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "%s can be inlined\n",
@@ -1432,7 +1432,7 @@
         new StoreInst(Constant::getNullValue(cl->naturalType), alloc, false,
                       currentBlock);
       } else {
-        uint64 size = module->getTypeSize(cl->naturalType);
+        uint64 size = mvm::MvmModule::getTypeSize(cl->naturalType);
         
         std::vector<Value*> params;
         params.push_back(new BitCastInst(alloc, module->ptrType, "",
@@ -1548,11 +1548,10 @@
 
 
 void CLIJit::initialiseBootstrapVM(N3* vm) {
-  mvm::MvmModule* M = vm->module;
   Module* module = vm->getLLVMModule();
-  M->protectEngine.lock();
-  M->executionEngine->addModule(module);
-  M->protectEngine.unlock();
+  mvm::MvmModule::protectEngine.lock();
+  mvm::MvmModule::executionEngine->addModule(module);
+  mvm::MvmModule::protectEngine.unlock();
     
   n3::llvm_runtime::makeLLVMModuleContents(module);
 

Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original)
+++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Sun Feb 21 10:11:33 2010
@@ -91,7 +91,7 @@
   llvm::Function* llvmFunction;
   VMMethod* compilingMethod;
   VMClass* compilingClass;
-  mvm::MvmModule* module;
+  mvm::BaseIntrinsics* module;
 
   std::vector<llvm::Value*> arguments;
   std::vector<llvm::Value*> locals;

Modified: vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp Sun Feb 21 10:11:33 2010
@@ -264,7 +264,7 @@
     aquire();
     if (!_llvmVar) {
       Module* Mod = vm->getLLVMModule();
-      const Type* pty = mvm::MvmModule::ptrType;
+      const Type* pty = mvm::BaseIntrinsics::ptrType;
       Constant* cons = 
         ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (this)),
                                     pty);
@@ -283,7 +283,7 @@
   if (!_llvmVar) {
     classDef->aquire();
     if (!_llvmVar) {
-      const Type* pty = mvm::MvmModule::ptrType;
+      const Type* pty = mvm::BaseIntrinsics::ptrType;
       Module* Mod = classDef->vm->getLLVMModule();
       Constant* cons = 
         ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (this)),
@@ -303,7 +303,7 @@
     classDef->aquire();
     if (!_llvmVar) {
       Module* Mod = classDef->vm->getLLVMModule();
-      const Type* pty = mvm::MvmModule::ptrType;
+      const Type* pty = mvm::BaseIntrinsics::ptrType;
       Constant* cons = 
         ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (this)),
                                   pty);

Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/N3.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/N3.cpp Sun Feb 21 10:11:33 2010
@@ -101,7 +101,7 @@
 
   this->scanner =           new mvm::UnpreciseStackScanner(); 
   this->LLVMModule =        new llvm::Module(name, llvm::getGlobalContext());
-  this->module =            new mvm::MvmModule(this->LLVMModule);
+  this->module =            new mvm::BaseIntrinsics(this->LLVMModule);
 
   this->LLVMModule->setDataLayout(mvm::MvmModule::executionEngine->getTargetData()->getStringRepresentation());
   this->protectModule =     new mvm::LockNormal();

Modified: vmkit/trunk/lib/N3/VMCore/N3.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/N3.h (original)
+++ vmkit/trunk/lib/N3/VMCore/N3.h Sun Feb 21 10:11:33 2010
@@ -96,7 +96,7 @@
   mvm::Lock*               protectModule;
   FunctionMap*             functions;
 
-  mvm::MvmModule*          module;
+  mvm::BaseIntrinsics*     module;
   llvm::Module*            LLVMModule;
   N3ModuleProvider*        TheModuleProvider;
 

Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=96737&r1=96736&r2=96737&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Sun Feb 21 10:11:33 2010
@@ -159,7 +159,7 @@
 }
 
 static void store(Value* val, Value* local, bool vol, 
-                  BasicBlock* currentBlock, mvm::MvmModule* module) {
+                  BasicBlock* currentBlock, mvm::BaseIntrinsics* module) {
   const Type* contained = local->getType()->getContainedType(0);
   if (contained->isSingleValueType()) {
     if (val->getType() != contained) {
@@ -167,7 +167,7 @@
     }
     new StoreInst(val, local, vol, currentBlock);
   } else if (isa<PointerType>(val->getType())) {
-    uint64 size = module->getTypeSize(contained);
+    uint64 size = mvm::MvmModule::getTypeSize(contained);
         
     std::vector<Value*> params;
     params.push_back(new BitCastInst(local, PointerType::getUnqual(Type::getInt8Ty(getGlobalContext())), "", currentBlock));
@@ -180,12 +180,12 @@
   }
 }
 
-static Value* load(Value* val, const char* name, BasicBlock* currentBlock, mvm::MvmModule* module) {
+static Value* load(Value* val, const char* name, BasicBlock* currentBlock, mvm::BaseIntrinsics* module) {
   const Type* contained = val->getType()->getContainedType(0);
   if (contained->isSingleValueType()) {
     return new LoadInst(val, name, currentBlock);
   } else {
-    uint64 size = module->getTypeSize(contained);
+    uint64 size = mvm::MvmModule::getTypeSize(contained);
     Value* ret = new AllocaInst(contained, "", currentBlock); 
     std::vector<Value*> params;
     params.push_back(new BitCastInst(ret, PointerType::getUnqual(Type::getInt8Ty(getGlobalContext())), "", currentBlock));
@@ -1303,7 +1303,7 @@
         }
         
         
-        uint64 size = module->getTypeSize(type->naturalType);
+        uint64 size = mvm::MvmModule::getTypeSize(type->naturalType);
         
         std::vector<Value*> params;
         params.push_back(new BitCastInst(ptr, PointerType::getUnqual(Type::getInt8Ty(getGlobalContext())), "", currentBlock));
@@ -1803,7 +1803,7 @@
         Value* ptr = GetElementPtrInst::Create(obj, ptrs.begin(), ptrs.end(), "", 
                                            currentBlock);
 
-        uint64 size = module->getTypeSize(type->naturalType);
+        uint64 size = mvm::MvmModule::getTypeSize(type->naturalType);
         
         std::vector<Value*> params;
         params.push_back(new BitCastInst(val, PointerType::getUnqual(Type::getInt8Ty(getGlobalContext())), "", currentBlock));
@@ -1953,7 +1953,7 @@
             VMCommonClass* type = assembly->loadType(vm, token, true, false, false,
                                                      true, genClass, genMethod);
             if (type->super == MSCorlib::pValue) {
-              uint64 size = module->getTypeSize(type->naturalType);
+              uint64 size = mvm::MvmModule::getTypeSize(type->naturalType);
         
               std::vector<Value*> params;
               params.push_back(new BitCastInst(pop(), module->ptrType, "",





More information about the vmkit-commits mailing list