[vmkit-commits] [vmkit] r121135 - in /vmkit/branches/multi-vm: include/j3/ lib/J3/Classpath/ lib/J3/Compiler/ lib/J3/VMCore/

Gael Thomas gael.thomas at lip6.fr
Tue Dec 7 07:14:15 PST 2010


Author: gthomas
Date: Tue Dec  7 09:14:15 2010
New Revision: 121135

URL: http://llvm.org/viewvc/llvm-project?rev=121135&view=rev
Log:
remove all ISOLATE-SHARING depend code

Modified:
    vmkit/branches/multi-vm/include/j3/J3Intrinsics.h
    vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMRuntime.inc
    vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp
    vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc
    vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc
    vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp
    vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp
    vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h
    vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp
    vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp
    vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp
    vmkit/branches/multi-vm/lib/J3/Compiler/LowerConstantCalls.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.h
    vmkit/branches/multi-vm/lib/J3/VMCore/JavaConstantPool.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp
    vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmConfig.h
    vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h
    vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp

Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/j3/J3Intrinsics.h?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/include/j3/J3Intrinsics.h (original)
+++ vmkit/branches/multi-vm/include/j3/J3Intrinsics.h Tue Dec  7 09:14:15 2010
@@ -43,10 +43,6 @@
   const llvm::Type* AttributType;
   const llvm::Type* JavaThreadType;
   
-#ifdef ISOLATE_SHARING
-  const llvm::Type* JnjvmType;
-#endif
-  
   llvm::Function* StartJNIFunction;
   llvm::Function* EndJNIFunction;
   llvm::Function* InterfaceLookupFunction;
@@ -82,14 +78,6 @@
   llvm::Function* MultiCallNewFunction;
   llvm::Function* GetArrayClassFunction;
 
-#ifdef ISOLATE_SHARING
-  llvm::Function* GetCtpClassFunction;
-  llvm::Function* GetJnjvmExceptionClassFunction;
-  llvm::Function* GetJnjvmArrayClassFunction;
-  llvm::Function* StaticCtpLookupFunction;
-  llvm::Function* SpecialCtpLookupFunction;
-#endif
-
 #ifdef SERVICE
   llvm::Function* ServiceCallStartFunction;
   llvm::Function* ServiceCallStopFunction;

Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMRuntime.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMRuntime.inc?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMRuntime.inc (original)
+++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMRuntime.inc Tue Dec  7 09:14:15 2010
@@ -181,12 +181,7 @@
 jclass clazz,
 #endif
 jint par1) {
-#if defined(ISOLATE_SHARING)
-  // TODO: do a longjmp
   exit(par1);
-#else
-  exit(par1);
-#endif
 }
 
 JNIEXPORT jlong Java_java_lang_VMRuntime_freeMemory(

Modified: vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp Tue Dec  7 09:14:15 2010
@@ -32,7 +32,6 @@
 
 using namespace j3;
 
-#ifndef ISOLATE_SHARING
 Class*      Classpath::newThread;
 Class*      Classpath::newVMThread;
 JavaField*  Classpath::assocThread;
@@ -227,8 +226,6 @@
 JavaMethod* Classpath::EnqueueReference;
 Class*      Classpath::newReference;
 
-#endif
-
 void Classpath::CreateJavaThread(Jnjvm* vm, JavaThread* myth,
                                  const char* thName, JavaObject* Group) {
   JavaObjectVMThread* vmth = NULL;

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc Tue Dec  7 09:14:15 2010
@@ -306,7 +306,6 @@
 
     ex->catche = reader.readU2();
 
-#ifndef ISOLATE_SHARING
     if (ex->catche) {
       UserClass* cl = 
         (UserClass*)(compilingClass->ctpInfo->isClassLoaded(ex->catche));
@@ -317,7 +316,6 @@
     } else {
       ex->catchClass = Classpath::newThrowable;
     }
-#endif
     
     ex->tester = createBasicBlock("testException");
     

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsDwarf.inc Tue Dec  7 09:14:15 2010
@@ -237,7 +237,6 @@
 
     ex->catche = reader.readU2();
 
-#ifndef ISOLATE_SHARING
     if (ex->catche) {
       UserClass* cl = 
         (UserClass*)(compilingClass->ctpInfo->isClassLoaded(ex->catche));
@@ -248,7 +247,6 @@
     } else {
       ex->catchClass = Classpath::newThrowable;
     }
-#endif
     
     ex->catcher = createBasicBlock("testException");
     
@@ -369,17 +367,11 @@
     currentBlock = cur->tester;
     
     Value* clVar = 0; 
-#ifdef ISOLATE_SHARING
-    // We're dealing with exceptions, don't catch the exception if the class can
-    // not be found.
-    if (cur->catche) clVar = getResolvedClass(cur->catche, false, false, 0);
-    else clVar = CallInst::Create(module->GetJnjvmExceptionClassFunction,
-                                  isolateLocal, "", currentBlock);
-#else
+
     // We know catchClass exists because we have loaded all exceptions catched
     // by the method when we loaded the class that defined this method.
     clVar = module->getNativeClass(cur->catchClass);
-#endif
+
     if (clVar->getType() != module->JavaCommonClassType) 
       clVar = new BitCastInst(clVar, module->JavaCommonClassType, "",
                               currentBlock);

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp Tue Dec  7 09:14:15 2010
@@ -37,10 +37,6 @@
   
   LLVMContext& Context = module->getContext();
 
-#ifdef ISOLATE_SHARING
-  JnjvmType = 
-    PointerType::getUnqual(module->getTypeByName("Jnjvm"));
-#endif
   ConstantPoolType = ptrPtrType;
   
   JavaObjectType = 
@@ -215,15 +211,6 @@
   GetFinalFloatFieldFunction = module->getFunction("getFinalFloatField");
   GetFinalDoubleFieldFunction = module->getFunction("getFinalDoubleField");
 
-#ifdef ISOLATE_SHARING
-  GetCtpClassFunction = module->getFunction("getCtpClass");
-  GetJnjvmExceptionClassFunction = 
-    module->getFunction("getJnjvmExceptionClass");
-  GetJnjvmArrayClassFunction = module->getFunction("getJnjvmArrayClass");
-  StaticCtpLookupFunction = module->getFunction("j3StaticCtpLookup");
-  SpecialCtpLookupFunction = module->getFunction("j3SpecialCtpLookup");
-#endif
- 
 #ifdef SERVICE
   ServiceCallStartFunction = module->getFunction("j3ServiceCallStart");
   ServiceCallStopFunction = module->getFunction("j3ServiceCallStop");

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Tue Dec  7 09:14:15 2010
@@ -168,17 +168,10 @@
     Value* indexes2[2];
     indexes2[0] = intrinsics->constantZero;
 
-#ifdef ISOLATE_SHARING
-    Value* indexesCtp; //[3];
-#endif
     if (meth) {
       LLVMMethodInfo* LMI = TheCompiler->getMethodInfo(meth);
       Constant* Offset = LMI->getOffset();
       indexes2[1] = Offset;
-#ifdef ISOLATE_SHARING
-      indexesCtp = ConstantInt::get(Type::getInt32Ty(*llvmContext),
-                                    Offset->getZExtValue() * -1);
-#endif
     } else {
    
       GlobalVariable* GV = new GlobalVariable(*llvmFunction->getParent(),
@@ -211,11 +204,6 @@
       currentBlock = endResolveVirtual;
 
       indexes2[1] = node;
-#ifdef ISOLATE_SHARING
-      Value* mul = BinaryOperator::CreateMul(val, intrinsics->constantMinusOne,
-                                             "", currentBlock);
-      indexesCtp = mul;
-#endif
     }
 
     makeArgs(it, index, args, signature->nbArguments + 1);
@@ -229,13 +217,6 @@
     Value* Func = new LoadInst(FuncPtr, "", currentBlock);
   
     Func = new BitCastInst(Func, LSI->getVirtualPtrType(), "", currentBlock);
-#ifdef ISOLATE_SHARING
-    Value* CTP = GetElementPtrInst::Create(VT, indexesCtp, "", currentBlock);
-    
-    CTP = new LoadInst(CTP, "", currentBlock);
-    CTP = new BitCastInst(CTP, intrinsics->ConstantPoolType, "", currentBlock);
-    args.push_back(CTP);
-#endif
     val = invoke(Func, args, "", currentBlock);
   
     if (endBlock) {
@@ -436,13 +417,7 @@
 
   uint32 index = 0;
   if (stat) {
-#ifdef ISOLATE_SHARING
-    Value* val = getClassCtp();
-    Value* cl = CallInst::Create(intrinsics->GetClassDelegateePtrFunction,
-                                 val, "", currentBlock);
-#else
     Value* cl = TheCompiler->getJavaClassPtr(compilingClass);
-#endif
     nativeArgs.push_back(cl);
     index = 2;
   } else {
@@ -698,27 +673,6 @@
   currentBlock = OK;
 }
 
-#ifdef ISOLATE_SHARING
-Value* JavaJIT::getStaticInstanceCtp() {
-  Value* cl = getClassCtp();
-  Value* indexes[2] = { intrinsics->constantZero, module->constantSeven };
-  Value* arg1 = GetElementPtrInst::Create(cl, indexes, indexes + 2,
-                                          "", currentBlock);
-  arg1 = new LoadInst(arg1, "", false, currentBlock);
-  return arg1;
-  
-}
-
-Value* JavaJIT::getClassCtp() {
-  Value* indexes = intrinsics->constantOne;
-  Value* arg1 = GetElementPtrInst::Create(ctpCache, indexes.begin(),
-                                          indexes.end(),  "", currentBlock);
-  arg1 = new LoadInst(arg1, "", false, currentBlock);
-  arg1 = new BitCastInst(arg1, intrinsics->JavaClassType, "", currentBlock);
-  return arg1;
-}
-#endif
-
 void JavaJIT::beginSynchronize() {
   Value* obj = 0;
   if (isVirtual(compilingMethod->access)) {
@@ -891,11 +845,7 @@
   
   uint32 index = 0;
   uint32 count = 0;
-#if defined(ISOLATE_SHARING)
-  uint32 max = args.size() - 2;
-#else
   uint32 max = args.size();
-#endif
   Signdef* sign = compilingMethod->getSignature();
   Typedef* const* arguments = sign->getArgumentsType();
   uint32 type = 0;
@@ -1057,11 +1007,7 @@
  
   uint32 index = 0;
   uint32 count = 0;
-#if defined(ISOLATE_SHARING)
-  uint32 max = func->arg_size() - 2;
-#else
   uint32 max = func->arg_size();
-#endif
   Function::arg_iterator i = func->arg_begin(); 
   Signdef* sign = compilingMethod->getSignature();
   Typedef* const* arguments = sign->getArgumentsType();
@@ -1113,15 +1059,6 @@
     }
 #endif
 
-#if defined(ISOLATE_SHARING)
-  ctpCache = i;
-  Value* addrCtpCache = new AllocaInst(intrinsics->ConstantPoolType, "",
-                                       currentBlock);
-  /// make it volatile to be sure it's on the stack
-  new StoreInst(ctpCache, addrCtpCache, true, currentBlock);
-#endif
- 
-
 #if defined(SERVICE)
   JnjvmClassLoader* loader = compilingClass->classLoader;
   Value* Cmp = 0;
@@ -1478,20 +1415,10 @@
 
 void JavaJIT::makeArgs(FunctionType::param_iterator it,
                        uint32 index, std::vector<Value*>& Args, uint32 nb) {
-#if defined(ISOLATE_SHARING)
-  nb += 1;
-#endif
   Args.reserve(nb + 2);
   mvm::ThreadAllocator threadAllocator;
   Value** args = (Value**)threadAllocator.Allocate(nb*sizeof(Value*));
-#if defined(ISOLATE_SHARING)
-  args[nb - 1] = isolateLocal;
-  sint32 start = nb - 2;
-  it--;
-  it--;
-#else
   sint32 start = nb - 1;
-#endif
   for (sint32 i = start; i >= 0; --i) {
     it--;
     if (it->get() == Type::getInt64Ty(*llvmContext) || it->get() == Type::getDoubleTy(*llvmContext)) {
@@ -1659,32 +1586,6 @@
   const llvm::FunctionType* virtualType = LSI->getVirtualType();
   llvm::Instruction* val = 0;
 
-#if defined(ISOLATE_SHARING)
-  const Type* Ty = intrinsics->ConstantPoolType;
-  Constant* Nil = Constant::getNullValue(Ty);
-  GlobalVariable* GV = new GlobalVariable(*llvmFunction->getParent(),Ty, false,
-                                          GlobalValue::ExternalLinkage, Nil,
-                                          "");
-  Value* res = new LoadInst(GV, "", false, currentBlock);
-  Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, res, Nil, "");
- 
-  BasicBlock* trueCl = createBasicBlock("UserCtp OK");
-  BasicBlock* falseCl = createBasicBlock("UserCtp Not OK");
-  PHINode* node = llvm::PHINode::Create(Ty, "", trueCl);
-  node->addIncoming(res, currentBlock);
-  BranchInst::Create(falseCl, trueCl, test, currentBlock);
-  std::vector<Value*> Args;
-  Args.push_back(ctpCache);
-  Args.push_back(ConstantInt::get(Type::getInt32Ty(*llvmContext), index));
-  Args.push_back(GV);
-  res = CallInst::Create(intrinsics->SpecialCtpLookupFunction, Args.begin(),
-                         Args.end(), "", falseCl);
-  node->addIncoming(res, falseCl);
-  BranchInst::Create(trueCl, falseCl);
-  currentBlock = trueCl;
-  args.push_back(node);
-#endif
-
   if (!meth) {
     meth = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_VIRTUAL, signature);
   }
@@ -1775,18 +1676,9 @@
     func = TheCompiler->getMethod(meth);
   }
 
-#if defined(ISOLATE_SHARING)
-  Value* newCtpCache = getConstantPoolAt(index,
-                                         intrinsics->StaticCtpLookupFunction,
-                                         intrinsics->ConstantPoolType, 0,
-                                         false);
-#endif
   std::vector<Value*> args; // size = [signature->nbIn + 2]; 
   FunctionType::param_iterator it  = staticType->param_end();
   makeArgs(it, index, args, signature->nbArguments);
-#if defined(ISOLATE_SHARING)
-  args.push_back(newCtpCache);
-#endif
 
   if (className->equals(loader->mathName)) {
     val = lowerMathOps(name, args);
@@ -1821,16 +1713,9 @@
 
 // This makes unswitch loop very unhappy time-wise, but makes GVN happy
 // number-wise. IMO, it's better to have this than Unswitch.
-#ifdef ISOLATE_SHARING
-  Value* CTP = ctpCache;
-  Value* Cl = GetElementPtrInst::Create(CTP, intrinsics->ConstantOne, "",
-                                        currentBlock);
-  Cl = new LoadInst(Cl, "", currentBlock);
-#else
   JavaConstantPool* ctp = compilingClass->ctpInfo;
   Value* CTP = TheCompiler->getConstantPool(ctp);
   Value* Cl = TheCompiler->getNativeClass(compilingClass);
-#endif
 
   std::vector<Value*> Args;
   Args.push_back(resolver);
@@ -1975,17 +1860,12 @@
         Cl = invoke(intrinsics->InitialisationCheckFunction, Cl, "",
                     currentBlock);
       }
-#if !defined(ISOLATE_SHARING)
       if (needsCheck) {
         CallInst::Create(intrinsics->ForceInitialisationCheckFunction, Cl, "",
                          currentBlock);
       }
 
       object = TheCompiler->getStaticInstance(field->classDef);
-#else
-      object = CallInst::Create(intrinsics->GetStaticInstanceFunction, Cl, "",
-                                currentBlock); 
-#endif
     } else {
       object = new LoadInst(
           object, "", TheCompiler->useCooperativeGC(), currentBlock);
@@ -2082,7 +1962,7 @@
   Value* ptr = ldResolved(index, true, NULL, LAI.llvmTypePtr);
   
   bool final = false;
-#if !defined(ISOLATE_SHARING)
+
   JnjvmBootstrapLoader* JBL = compilingClass->classLoader->bootstrapLoader;
   if (!compilingMethod->name->equals(JBL->clinitName)) {
     JavaField* field = compilingClass->ctpInfo->lookupField(index, true);
@@ -2135,7 +2015,6 @@
       }
     }
   }
-#endif
 
   if (!final) {
     JnjvmClassLoader* JCL = compilingClass->classLoader;

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h Tue Dec  7 09:14:15 2010
@@ -508,25 +508,6 @@
 //===--------------------- Yield point support  ---------------------------===//
 
   void checkYieldPoint();
- 
-
-#if defined(ISOLATE_SHARING)
-//===----------------- Sharing bytecode support ---------------------------===//
-  
-  /// isolateLocal - The Jnjvm object that the method is currently executing.
-  llvm::Value* isolateLocal;
-
-  /// ctpCache - The constant pool cache.
-  llvm::Value* ctpCache;
-
-  /// getStaticInstanceCtp - Get the static instance of the class of the method
-  /// being compiled.
-  llvm::Value* getStaticInstanceCtp();
-
-  /// getClassCtp - Get the class of the method being compiled.
-  llvm::Value* getClassCtp();
-#endif
-  
 };
 
 enum Opcode {

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJITOpcodes.cpp Tue Dec  7 09:14:15 2010
@@ -2056,17 +2056,11 @@
           uint8 id = reader.readU1();
           i += 1;
           uint8 charId = arrayType(compilingMethod, id);
-#ifndef ISOLATE_SHARING
           JnjvmBootstrapLoader* loader = 
             compilingClass->classLoader->bootstrapLoader;
+
           dcl = loader->getArrayClass(id);
           valCl = TheCompiler->getNativeClass(dcl);
-#else
-          Value* args[2] = { isolateLocal,
-                             ConstantInt::get(Type::getInt32Ty(*llvmContext), id - 4) };
-          valCl = CallInst::Create(intrinsics->GetJnjvmArrayClassFunction,
-                                   args, args + 2, "", currentBlock);
-#endif
 
           LLVMAssessorInfo& LAI = TheCompiler->AssessorInfo[charId];
           sizeElement = ConstantInt::get(Type::getInt32Ty(*llvmContext),

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp Tue Dec  7 09:14:15 2010
@@ -235,10 +235,6 @@
       llvmArgs.push_back(LAI.llvmType);
     }
 
-#if defined(ISOLATE_SHARING)
-    llvmArgs.push_back(Mod->getIntrinsics()->ConstantPoolType);
-#endif
-
     LLVMAssessorInfo& LAI =
       Compiler->getTypedefInfo(signature->getReturnType());
     virtualType = FunctionType::get(LAI.llvmType, llvmArgs, false);
@@ -261,11 +257,6 @@
       llvmArgs.push_back(LAI.llvmType);
     }
 
-#if defined(ISOLATE_SHARING)
-    // cached constant pool
-    llvmArgs.push_back(Compiler->getIntrinsics()->ConstantPoolType);
-#endif
-
     LLVMAssessorInfo& LAI =
       Compiler->getTypedefInfo(signature->getReturnType());
     staticType = FunctionType::get(LAI.llvmType, llvmArgs, false);
@@ -299,11 +290,6 @@
       }
     }
 
-#if defined(ISOLATE_SHARING)
-    // cached constant pool
-    llvmArgs.push_back(Compiler->getIntrinsics()->ConstantPoolType);
-#endif
-
     LLVMAssessorInfo& LAI =
       Compiler->getTypedefInfo(signature->getReturnType());
     const llvm::Type* RetType =
@@ -343,9 +329,7 @@
   BasicBlock* currentBlock = BasicBlock::Create(context, "enter", res);
   Function::arg_iterator i = res->arg_begin();
   Value *obj, *ptr, *func;
-#if defined(ISOLATE_SHARING)
-  Value* ctp = i;
-#endif
+
   ++i;
   func = i;
   ++i;
@@ -396,10 +380,6 @@
                                     currentBlock);
   }
 
-#if defined(ISOLATE_SHARING)
-  Args.push_back(ctp);
-#endif
-
   Value* val = CallInst::Create(func, Args.begin(), Args.end(), "",
                                 currentBlock);
   if (!signature->getReturnType()->isVoid()) {
@@ -435,9 +415,7 @@
   BasicBlock* currentBlock = BasicBlock::Create(context, "enter", res);
   Function::arg_iterator i = res->arg_begin();
   Value *obj, *ap, *func;
-#if defined(ISOLATE_SHARING)
-  Value* ctp = i;
-#endif
+
   ++i;
   func = i;
   ++i;
@@ -476,10 +454,6 @@
     Args.push_back(arg);
   }
 
-#if defined(ISOLATE_SHARING)
-  Args.push_back(ctp);
-#endif
-
   Value* val = CallInst::Create(func, Args.begin(), Args.end(), "",
                                 currentBlock);
   if (!signature->getReturnType()->isVoid()) {

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/LLVMMaterializer.cpp Tue Dec  7 09:14:15 2010
@@ -150,7 +150,7 @@
     LLVMMethodInfo* LMI = Comp->getMethodInfo(meth);
     uint64_t offset = dyn_cast<ConstantInt>(LMI->getOffset())->getZExtValue();
     assert(meth->classDef->isResolved() && "Class not resolved");
-#if !defined(ISOLATE_SHARING) && !defined(SERVICE)
+#if !defined(SERVICE)
     assert(meth->classDef->isInitializing() && "Class not ready");
 #endif
     assert(meth->classDef->virtualVT && "Class has no VT");

Modified: vmkit/branches/multi-vm/lib/J3/Compiler/LowerConstantCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/LowerConstantCalls.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/Compiler/LowerConstantCalls.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/Compiler/LowerConstantCalls.cpp Tue Dec  7 09:14:15 2010
@@ -423,14 +423,7 @@
             NBB = Invoke->getNormalDest();
           }
           
-#ifdef ISOLATE_SHARING
-          ConstantInt* Cons = dyn_cast<ConstantInt>(Index);
-          assert(CI && "Wrong use of GetConstantPoolAt");
-          uint64 val = Cons->getZExtValue();
-          Value* indexes = ConstantInt::get(Type::getInt32Ty(*Context), val + 1);
-#else
           Value* indexes = Index;
-#endif
           Value* arg1 = GetElementPtrInst::Create(CTP, indexes, "", CI);
           arg1 = new LoadInst(arg1, "", false, CI);
           Value* test = new ICmpInst(CI, ICmpInst::ICMP_EQ, arg1,
@@ -703,39 +696,6 @@
           // And reanalyse the current block.
           break;
         }
-#ifdef ISOLATE_SHARING
-        else if (V == intrinsics->GetCtpClassFunction) {
-          Changed = true;
-          Value* val = Call.getArgument(0); 
-          Value* indexes[2] = { intrinsics->constantZero, 
-                                intrinsics->OffsetCtpInClassConstant };
-          Value* VTPtr = GetElementPtrInst::Create(val, indexes,
-                                                   indexes + 2, "", CI);
-          Value* VT = new LoadInst(VTPtr, "", CI);
-          CI->replaceAllUsesWith(VT);
-          CI->eraseFromParent();
-        } else if (V == intrinsics->GetJnjvmArrayClassFunction) {
-          Changed = true;
-          Value* val = Call.getArgument(0); 
-          Value* index = Call.getArgument(1); 
-          Value* indexes[3] = { intrinsics->constantZero, intrinsics->constantTwo,
-                                index };
-          Value* VTPtr = GetElementPtrInst::Create(val, indexes, indexes + 3,
-                                                   "", CI);
-          Value* VT = new LoadInst(VTPtr, "", CI);
-          CI->replaceAllUsesWith(VT);
-          CI->eraseFromParent();
-        } else if (V == intrinsics->GetJnjvmExceptionClassFunction) {
-          Changed = true;
-          Value* val = Call.getArgument(0);
-          Value* indexes[2] = { intrinsics->constantZero, intrinsics->constantOne };
-          Value* VTPtr = GetElementPtrInst::Create(val, indexes, indexes + 2,
-                                                   "", CI);
-          Value* VT = new LoadInst(VTPtr, "", CI);
-          CI->replaceAllUsesWith(VT);
-          CI->eraseFromParent();
-        }
-#endif
 
       }
     }

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.cpp Tue Dec  7 09:14:15 2010
@@ -924,7 +924,6 @@
     interfaces[i]->resolveClass(); 
 }
 
-#ifndef ISOLATE_SHARING
 void Class::resolveClass() {
   if (isResolved() || isErroneous()) return;
   resolveParents();
@@ -934,12 +933,6 @@
       &(getCurrentTaskClassMirror().status), loaded, resolved);
   assert(isResolved() || isErroneous());
 }
-#else
-void Class::resolveClass() {
-  assert(status >= resolved && 
-         "Asking to resolve a not resolved-class in a isolate environment");
-}
-#endif
 
 void UserClass::resolveInnerOuterClasses() {
   if (!innerOuterResolved) {

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.h?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.h (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaClass.h Tue Dec  7 09:14:15 2010
@@ -157,10 +157,6 @@
 /// super or interfaces.
 ///
 class CommonClass : public mvm::PermanentObject {
-#ifdef ISOLATE_SHARING
-friend class UserCommonClass;
-#endif
-
 public:
   
 //===----------------------------------------------------------------------===//
@@ -341,7 +337,6 @@
   ///
   JavaObject* setDelegatee(JavaObject* val);
 
-#if !defined(ISOLATE_SHARING)
   /// getDelegatee - Get the java/lang/Class object representing this class.
   ///
   JavaObject* getDelegatee() const {
@@ -354,8 +349,6 @@
   JavaObject* const* getDelegateePtr() const {
     return delegatee;
   }
-
-#endif
   
   /// resolvedImplClass - Return the internal representation of the
   /// java.lang.Class object. The class must be resolved.
@@ -593,11 +586,9 @@
     return staticSize;
   }
   
-#ifndef ISOLATE_SHARING
   /// doNew - Allocates a Java object whose class is this class.
   ///
   JavaObject* doNew(Jnjvm* vm);
-#endif
   
   /// tracer - Tracer function of instances of Class.
   ///
@@ -1293,8 +1284,4 @@
 } // end namespace j3
 
 
-#ifdef ISOLATE_SHARING
-#include "IsolateCommonClass.h"
-#endif
-
 #endif

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaConstantPool.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaConstantPool.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaConstantPool.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaConstantPool.cpp Tue Dec  7 09:14:15 2010
@@ -282,7 +282,6 @@
 
 CommonClass* JavaConstantPool::loadClass(uint32 index, bool resolve) {
   CommonClass* temp = isClassLoaded(index);
-#ifndef ISOLATE_SHARING
   if (!temp) {
     JnjvmClassLoader* loader = classDef->classLoader;
     const UTF8* name = UTF8At(ctpDef[index]);
@@ -293,20 +292,17 @@
     } 
     ctpRes[index] = temp;
   }
-#endif
   return temp;
 }
 
 CommonClass* JavaConstantPool::getMethodClassIfLoaded(uint32 index) {
   CommonClass* temp = isClassLoaded(index);
-#ifndef ISOLATE_SHARING
   if (!temp) {
     JnjvmClassLoader* loader = classDef->classLoader;
     assert(loader && "Class has no loader?");
     const UTF8* name = UTF8At(ctpDef[index]);
     temp = loader->lookupClassOrArray(name);
   }
-#endif
 
   if (!temp && classDef->classLoader->getCompiler()->isStaticCompiling()) {
     temp = loadClass(index);
@@ -504,13 +500,10 @@
       if (field) {
         if (!stat) {
           ctpRes[index] = (void*)field->ptrOffset;
-        } 
-#ifndef ISOLATE_SHARING
-        else if (lookup->isReady()) {
+        } else if (lookup->isReady()) {
           void* S = field->classDef->getStaticInstance();
           ctpRes[index] = (void*)((uint64)S + field->ptrOffset);
         }
-#endif
       }
       return field;
     }

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp Tue Dec  7 09:14:15 2010
@@ -167,7 +167,7 @@
     *offset = dmeth->offset;
   }
 
-#if !defined(ISOLATE_SHARING) && !defined(SERVICE)
+#if !defined(SERVICE)
   assert(dmeth->classDef->isInitializing() && 
          "Class not ready in a virtual lookup.");
 #endif
@@ -595,7 +595,7 @@
 
   // Update the virtual table.
   assert(lookup->isResolved() && "Class not resolved");
-#if !defined(ISOLATE_SHARING) && !defined(SERVICE)
+#if !defined(SERVICE)
   assert(lookup->isInitializing() && "Class not ready");
 #endif
   assert(lookup->virtualVT && "Class has no VT");
@@ -764,43 +764,3 @@
 #endif
 
 
-#ifdef ISOLATE_SHARING
-extern "C" void* j3StaticCtpLookup(UserClass* cl, uint32 index) {
-  UserConstantPool* ctpInfo = cl->getConstantPool();
-  JavaConstantPool* shared = ctpInfo->getSharedPool();
-  uint32 clIndex = shared->getClassIndexFromMethod(index);
-  UserClass* refCl = (UserClass*)ctpInfo->loadClass(clIndex);
-  refCl->initialiseClass(JavaThread::get()->getJVM());
-
-  CommonClass* baseCl = 0;
-  const UTF8* utf8 = 0;
-  Signdef* sign = 0;
-
-  shared->resolveMethod(index, baseCl, utf8, sign);
-  UserClass* methodCl = 0;
-  refCl->lookupMethod(utf8, sign->keyName, true, true, &methodCl);
-  ctpInfo->ctpRes[index] = methodCl->getConstantPool();
-  shared->ctpRes[clIndex] = refCl->classDef;
-  return (void*)methodCl->getConstantPool();
-}
-
-extern "C" UserConstantPool* j3SpecialCtpLookup(UserConstantPool* ctpInfo,
-                                                   uint32 index,
-                                                   UserConstantPool** res) {
-  JavaConstantPool* shared = ctpInfo->getSharedPool();
-  uint32 clIndex = shared->getClassIndexFromMethod(index);
-  UserClass* refCl = (UserClass*)ctpInfo->loadClass(clIndex);
-
-  CommonClass* baseCl = 0;
-  const UTF8* utf8 = 0;
-  Signdef* sign = 0;
-
-  shared->resolveMethod(index, baseCl, utf8, sign);
-  UserClass* methodCl = 0;
-  refCl->lookupMethod(utf8, sign->keyName, false, true, &methodCl);
-  shared->ctpRes[clIndex] = refCl->classDef;
-  *res = methodCl->getConstantPool();
-  return methodCl->getConstantPool();
-}
-
-#endif

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp Tue Dec  7 09:14:15 2010
@@ -29,21 +29,13 @@
 UserClass* getClassFromStaticMethod(Jnjvm* vm, JavaMethod* meth,
                                     JavaObject* clazz) {
   llvm_gcroot(clazz, 0);
-#ifdef ISOLATE_SHARING
-  return (UserClass*)UserCommonClass::resolvedImplClass(vm, clazz, false);
-#else
   return meth->classDef;
-#endif
 }
 
 static UserClass* getClassFromVirtualMethod(Jnjvm* vm, 
                                             JavaMethod* meth,
                                             UserCommonClass* cl) {
-#ifdef ISOLATE_SHARING
-  return cl->lookupClassFromMethod(this);
-#else
   return meth->classDef;
-#endif
 }
 
 extern "C" const struct JNIInvokeInterface_ JNI_JavaVMTable;

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmConfig.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmConfig.h?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmConfig.h (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmConfig.h Tue Dec  7 09:14:15 2010
@@ -11,10 +11,6 @@
 #ifndef JNJVM_CONFIG_H
 #define JNJVM_CONFIG_H
 
-#ifdef ISOLATE_SHARING
-#define ISOLATE_STATIC
-#else
-
 namespace j3 {
 
 class ClassArray;
@@ -31,7 +27,6 @@
 
 }
 #define ISOLATE_STATIC static
-#endif
 
 
 #define NR_ISOLATES 1

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/LinkJavaRuntime.h Tue Dec  7 09:14:15 2010
@@ -69,17 +69,6 @@
                                      Jnjvm* NewService);
 #endif
 
-
-
-
-#ifdef ISOLATE_SHARING
-extern "C" void* j3StaticCtpLookup(UserClass* cl, uint32 index);
-extern "C" UserConstantPool* j3SpecialCtpLookup(UserConstantPool* ctpInfo,
-                                                   uint32 index,
-                                                   UserConstantPool** res);
-#endif
-
-
 namespace force_linker {
   struct ForceRuntimeLinking {
     ForceRuntimeLinking() {
@@ -121,12 +110,6 @@
       (void) j3ServiceCallStart(0, 0);
       (void) j3ServiceCallStop(0, 0);
 #endif
-
-#ifdef ISOLATE_SHARING
-      (void) j3StaticCtpLookup(0, 0);
-      (void) j3SpecialCtpLookup(0, 0, 0);
-#endif
-
     }
   } ForcePassLinking; // Force link by creating a global definition.
 }

Modified: vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp?rev=121135&r1=121134&r2=121135&view=diff
==============================================================================
--- vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp (original)
+++ vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp Tue Dec  7 09:14:15 2010
@@ -310,10 +310,6 @@
   }
 
 
-#if defined(ISOLATE_SHARING)
-  mvm::Collector::markAndTraceRoot(&JnjvmSharedLoader::sharedLoader, closure);
-#endif
-  
 #ifdef SERVICE
   parent->tracer(closure);
 #endif





More information about the vmkit-commits mailing list