[vmkit-commits] [vmkit] r55586 - /vmkit/branches/isolate/lib/JnJVM/VMCore/LowerConstantCalls.cpp

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Aug 31 02:52:28 PDT 2008


Author: geoffray
Date: Sun Aug 31 04:52:28 2008
New Revision: 55586

URL: http://llvm.org/viewvc/llvm-project?rev=55586&view=rev
Log:
Implement GetJnjvmArrayClassFunction and bugfix for GetConstantPoolAtFunction.


Modified:
    vmkit/branches/isolate/lib/JnJVM/VMCore/LowerConstantCalls.cpp

Modified: vmkit/branches/isolate/lib/JnJVM/VMCore/LowerConstantCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/isolate/lib/JnJVM/VMCore/LowerConstantCalls.cpp?rev=55586&r1=55585&r2=55586&view=diff

==============================================================================
--- vmkit/branches/isolate/lib/JnJVM/VMCore/LowerConstantCalls.cpp (original)
+++ vmkit/branches/isolate/lib/JnJVM/VMCore/LowerConstantCalls.cpp Sun Aug 31 04:52:28 2008
@@ -247,7 +247,14 @@
           }
           
           std::vector<Value*> indexes; //[3];
+#ifdef MULTIPLE_VM
+          ConstantInt* Cons = dyn_cast<ConstantInt>(Index);
+          assert(CI && "Wrong use of GetConstantPoolAt");
+          uint64 val = Cons->getZExtValue();
+          indexes.push_back(ConstantInt::get(Type::Int32Ty, val + 1));
+#else
           indexes.push_back(Index);
+#endif
           Value* arg1 = GetElementPtrInst::Create(CTP, indexes.begin(),
                                                   indexes.end(),  "", CI);
           arg1 = new LoadInst(arg1, "", false, CI);
@@ -323,6 +330,19 @@
           Value* VT = new LoadInst(VTPtr, "", CI);
           CI->replaceAllUsesWith(VT);
           CI->eraseFromParent();
+        } else if (V == jnjvm::JnjvmModule::GetJnjvmArrayClassFunction) {
+          Changed = true;
+          Value* val = Call.getArgument(0); 
+          Value* index = Call.getArgument(1); 
+          std::vector<Value*> indexes; 
+          indexes.push_back(mvm::jit::constantZero);
+          indexes.push_back(mvm::jit::constantTwo);
+          indexes.push_back(index);
+          Value* VTPtr = GetElementPtrInst::Create(val, indexes.begin(),
+                                                   indexes.end(), "", CI);
+          Value* VT = new LoadInst(VTPtr, "", CI);
+          CI->replaceAllUsesWith(VT);
+          CI->eraseFromParent();
         }
 #endif
       }





More information about the vmkit-commits mailing list