From nicolas.geoffray at gmail.com Fri Oct 1 00:29:23 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Fri, 1 Oct 2010 09:29:23 +0200 Subject: [vmkit-commits] [vmkit] r114976 - in /vmkit/trunk/lib/J3: Compiler/JavaAOTCompiler.cpp VMCore/JavaClass.cpp VMCore/JavaClass.h VMCore/JnjvmClassLoader.cpp VMCore/JnjvmClassLoader.h In-Reply-To: References: <20100928191712.91ECD2A6C12C@llvm.org> Message-ID: Thanks very much Alan for reporting the issue. I am working on a fix. Nicolas On Thu, Sep 30, 2010 at 2:20 AM, Allan Tong wrote: > Unfortunately now it won't even compile libvmjc.so: > > $ make REQUIRES_FRAME_POINTER=1 > llvm[0]: Compiling glibj.zip to llvm > Segmentation fault > make: *** [glibj.zip.bc] Error 139 > > The eager resolution of classes causes a stack overflow; gdb showed > over 10,000 stack frames at the time of segfault. > > - Allan > > On Tue, Sep 28, 2010 at 3:17 PM, Nicolas Geoffray > wrote: > > Log: > > - Change locking of a class by using the java.lang.Class instance > > - Resolve eagerly classes > > > > This should fix the AOT compilation of classes. > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Sat Oct 2 14:48:51 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 02 Oct 2010 21:48:51 -0000 Subject: [vmkit-commits] [vmkit] r115424 - in /vmkit/trunk/lib/J3/VMCore: JavaClass.cpp JavaClass.h Jni.cpp JnjvmClassLoader.cpp JnjvmClassLoader.h Message-ID: <20101002214851.420D82A6C12E@llvm.org> Author: geoffray Date: Sat Oct 2 16:48:51 2010 New Revision: 115424 URL: http://llvm.org/viewvc/llvm-project?rev=115424&view=rev Log: Set the resolution to be only loading exceptions used by methods in the class. Now constructing a class creates the VT. Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.h vmkit/trunk/lib/J3/VMCore/Jni.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=115424&r1=115423&r2=115424&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sat Oct 2 16:48:51 2010 @@ -705,19 +705,6 @@ } -void UserClass::loadParents() { - if (super == 0) { - virtualTableSize = JavaVirtualTable::getFirstJavaMethodIndex(); - } else { - super->resolveClass(); - virtualTableSize = super->virtualTableSize; - } - - for (unsigned i = 0; i < nbInterfaces; i++) - interfaces[i]->resolveClass(); -} - - void internalLoadExceptions(JavaMethod& meth) { Attribut* codeAtt = meth.lookupAttribut(Attribut::codeAttribut); @@ -742,7 +729,7 @@ reader.readU2(); uint16 catche = reader.readU2(); - if (catche) meth.classDef->ctpInfo->loadClass(catche); + if (catche) meth.classDef->ctpInfo->loadClass(catche, false); } } } @@ -815,6 +802,11 @@ } void Class::makeVT() { + if (super == NULL) { + virtualTableSize = JavaVirtualTable::getFirstJavaMethodIndex(); + } else { + virtualTableSize = super->virtualTableSize; + } for (uint32 i = 0; i < nbVirtualMethods; ++i) { JavaMethod& meth = virtualMethods[i]; @@ -837,11 +829,6 @@ } } - if (super) { - assert(virtualTableSize >= super->virtualTableSize && - "Size of virtual table less than super!"); - } - mvm::BumpPtrAllocator& allocator = classLoader->allocator; virtualVT = new(allocator, virtualTableSize) JavaVirtualTable(this); } @@ -948,24 +935,24 @@ readFields(reader); readMethods(reader); attributs = readAttributs(reader, nbAttributs); - setIsRead(); } +void UserClass::resolveParents() { + if (super != NULL) { + super->resolveClass(); + } + + for (unsigned i = 0; i < nbInterfaces; i++) + interfaces[i]->resolveClass(); +} + + #ifndef ISOLATE_SHARING void Class::resolveClass() { if (isResolved() || isErroneous()) return; - readClass(); - loadParents(); - makeVT(); - JavaCompiler *Comp = classLoader->getCompiler(); - Comp->resolveVirtualClass(this); - Comp->resolveStaticClass(this); + resolveParents(); loadExceptions(); setResolved(); - if (!needsInitialisationCheck()) { - setInitializationState(ready); - } - assert(virtualVT && "No virtual VT after resolution"); } #else void Class::resolveClass() { @@ -1339,8 +1326,6 @@ bool UserClass::needsInitialisationCheck() { - if (!isClassRead()) return true; - if (isReady()) return false; if (super && super->needsInitialisationCheck()) Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.h?rev=115424&r1=115423&r2=115424&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.h Sat Oct 2 16:48:51 2010 @@ -50,7 +50,7 @@ /// and accessing static fields of the class) when it is in the ready state. /// #define loaded 0 /// The .class file has been found. -#define classRead 1 /// The .class file has been read. +#define resolving 1 /// The .class file is being resolved. #define resolved 2 /// The class has been resolved. #define vmjc 3 /// The class is defined in a shared library. #define inClinit 4 /// The class is cliniting. @@ -627,11 +627,6 @@ /// void readParents(Reader& reader); - /// loadParents - Loads and resolves the parents, i.e. super and interfarces, - /// of the class. - /// - void loadParents(); - /// loadExceptions - Loads and resolves the exception classes used in catch /// clauses of methods defined in this class. /// @@ -676,6 +671,7 @@ /// resolveClass - If the class has not been resolved yet, resolve it. /// void resolveClass(); + void resolveParents(); /// initialiseClass - If the class has not been initialized yet, /// initialize it. @@ -726,10 +722,10 @@ getCurrentTaskClassMirror().status = erroneous; } - /// setIsRead - The class file has been read. + /// setIsResolving - The class file is being resolved. /// - void setIsRead() { - getCurrentTaskClassMirror().status = classRead; + void setIsResolving() { + getCurrentTaskClassMirror().status = resolving; } @@ -747,9 +743,9 @@ } } - void setIsRead() { + void setIsResolving() { for (uint32 i = 0; i < NR_ISOLATES; ++i) { - IsolateInfo[i].status = classRead; + IsolateInfo[i].status = resolving; } } @@ -815,15 +811,9 @@ /// isResolving - Is the class currently being resolved? /// bool isResolving() { - return getCurrentTaskClassMirror().status == classRead; + return getCurrentTaskClassMirror().status == resolving; } - /// isClassRead - Has the .class file been read? - /// - bool isClassRead() { - return getCurrentTaskClassMirror().status >= classRead; - } - /// isNativeOverloaded - Is the method overloaded with a native function? /// bool isNativeOverloaded(JavaMethod* meth); @@ -837,8 +827,6 @@ /// void fillIMT(std::set* meths); -private: - /// makeVT - Create the virtual table of this class. /// void makeVT(); Modified: vmkit/trunk/lib/J3/VMCore/Jni.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jni.cpp?rev=115424&r1=115423&r2=115424&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jni.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jni.cpp Sat Oct 2 16:48:51 2010 @@ -73,7 +73,10 @@ else loader = vm->appClassLoader; UserCommonClass* cl = loader->loadClassFromAsciiz(asciiz, true, true); - if (cl && cl->asClass()) cl->asClass()->initialiseClass(vm); + if (cl && cl->asClass()) { + assert(cl->asClass()->isResolved()); + cl->asClass()->initialiseClass(vm); + } jclass res = (jclass)cl->getClassDelegateePtr(vm); RETURN_FROM_JNI(res); Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=115424&r1=115423&r2=115424&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Oct 2 16:48:51 2010 @@ -528,7 +528,7 @@ return loadName(name, doResolve, doThrow, strName); } - return 0; + return NULL; } UserCommonClass* JnjvmClassLoader::loadClassFromAsciiz(const char* asciiz, @@ -536,6 +536,7 @@ bool doThrow) { const UTF8* name = hashUTF8->lookupAsciiz(asciiz); mvm::ThreadAllocator threadAllocator; + UserCommonClass* result = NULL; if (!name) name = bootstrapLoader->hashUTF8->lookupAsciiz(asciiz); if (!name) { uint32 size = strlen(asciiz); @@ -549,12 +550,15 @@ name = temp; } - UserCommonClass* temp = lookupClass(name); - if (temp) return temp; - - if (this != bootstrapLoader) { - temp = bootstrapLoader->lookupClassOrArray(name); - if (temp) return temp; + result = lookupClass(name); + if ((result == NULL) && (this != bootstrapLoader)) { + result = bootstrapLoader->lookupClassOrArray(name); + if (result != NULL) { + if (result->isClass() && doResolve) { + result->asClass()->resolveClass(); + } + return result; + } } return loadClassFromUserUTF8(name, doResolve, doThrow, NULL); @@ -679,7 +683,10 @@ TRY { const UTF8* internalName = readerConstructUTF8(name->elements, name->size); res = new(allocator, "Class") UserClass(this, internalName, bytes); - res->resolveClass(); + res->readClass(); + res->makeVT(); + getCompiler()->resolveVirtualClass(res); + getCompiler()->resolveStaticClass(res); classes->lock.lock(); bool success = classes->map.insert(std::make_pair(internalName, res)).second; classes->lock.unlock(); Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=115424&r1=115423&r2=115424&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Sat Oct 2 16:48:51 2010 @@ -302,6 +302,7 @@ /// Class* loadClassFromSelf(Jnjvm* vm, const char* name); + friend class Class; }; /// JnjvmBootstrapLoader - This class is for the bootstrap class loader, which From nicolas.geoffray at lip6.fr Sun Oct 3 10:43:11 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 03 Oct 2010 17:43:11 -0000 Subject: [vmkit-commits] [vmkit] r115464 - in /vmkit/trunk: lib/J3/Compiler/ExceptionsCheck.inc lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h lib/J3/Compiler/JavaJITOpcodes.cpp lib/J3/Compiler/LowerConstantCalls.cpp mmtk/config/marksweep/MMTkInline.inc Message-ID: <20101003174311.393162A6C12E@llvm.org> Author: geoffray Date: Sun Oct 3 12:43:10 2010 New Revision: 115464 URL: http://llvm.org/viewvc/llvm-project?rev=115464&view=rev Log: - Re-compile MMTkInline.inc. - Volatile loads are enabled only with cooperative GC. Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.h vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc?rev=115464&r1=115463&r2=115464&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc Sun Oct 3 12:43:10 2010 @@ -34,7 +34,7 @@ // Make the load volatile to force the instruction after the call. // Otherwise, LLVM will merge the load with a previous load because // the function is readnone. - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); @@ -86,7 +86,7 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); @@ -139,7 +139,7 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); @@ -189,7 +189,7 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=115464&r1=115463&r2=115464&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sun Oct 3 12:43:10 2010 @@ -176,9 +176,11 @@ const llvm::Type* Ty = LCI->getVirtualType(); Module& Mod = *getLLVMModule(); + const char* name = JavaString::strToAsciiz(str); GlobalVariable* varGV = new GlobalVariable(Mod, Ty->getContainedType(0), false, - GlobalValue::InternalLinkage, 0, ""); + GlobalValue::ExternalLinkage, 0, "str"); + delete[] name; Constant* res = ConstantExpr::getCast(Instruction::BitCast, varGV, JavaIntrinsics.JavaObjectType); strings.insert(std::make_pair(str, res)); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=115464&r1=115463&r2=115464&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sun Oct 3 12:43:10 2010 @@ -204,7 +204,8 @@ Args.push_back(GV); Value* targetObject = getTarget(virtualType->param_end(), signature->nbArguments + 1); - Args.push_back(new LoadInst(targetObject, "", true, currentBlock)); + Args.push_back(new LoadInst( + targetObject, "", TheCompiler->useCooperativeGC(), currentBlock)); load = invoke(intrinsics->VirtualLookupFunction, Args, "", currentBlock); node->addIncoming(load, currentBlock); BranchInst::Create(endResolveVirtual, currentBlock); @@ -494,7 +495,8 @@ BranchInst::Create(endBlock, loadBlock, cmp, currentBlock); currentBlock = loadBlock; - result = new LoadInst(result, "", true, currentBlock); + result = new LoadInst( + result, "", TheCompiler->useCooperativeGC(), currentBlock); new StoreInst(result, ResultObject, "", currentBlock); endNode->addIncoming(result, currentBlock); @@ -662,7 +664,8 @@ Value* obj = 0; if (isVirtual(compilingMethod->access)) { assert(thisObject != NULL && "beginSynchronize without this"); - obj = new LoadInst(thisObject, "", true, currentBlock); + obj = new LoadInst( + thisObject, "", TheCompiler->useCooperativeGC(), currentBlock); } else { obj = TheCompiler->getJavaClassPtr(compilingClass); obj = new LoadInst(obj, "", false, currentBlock); @@ -674,7 +677,8 @@ Value* obj = 0; if (isVirtual(compilingMethod->access)) { assert(thisObject != NULL && "endSynchronize without this"); - obj = new LoadInst(thisObject, "", true, currentBlock); + obj = new LoadInst( + thisObject, "", TheCompiler->useCooperativeGC(), currentBlock); } else { obj = TheCompiler->getJavaClassPtr(compilingClass); obj = new LoadInst(obj, "", false, currentBlock); @@ -1271,7 +1275,8 @@ } else { if (returnType != Type::getVoidTy(*llvmContext)) { if (returnValue != NULL) { - Value* obj = new LoadInst(returnValue, "", true, currentBlock); + Value* obj = new LoadInst( + returnValue, "", TheCompiler->useCooperativeGC(), currentBlock); ReturnInst::Create(*llvmContext, obj, currentBlock); } else { ReturnInst::Create(*llvmContext, endNode, currentBlock); @@ -1320,7 +1325,7 @@ const UTF8* name = compilingClass->ctpInfo->UTF8At(AR.AnnotationNameIndex); if (name->equals(TheCompiler->InlinePragma)) { - llvmFunction->addFnAttr(Attribute::NoInline); + llvmFunction->addFnAttr(Attribute::AlwaysInline); } else if (name->equals(TheCompiler->NoInlinePragma)) { llvmFunction->addFnAttr(Attribute::NoInline); } @@ -1989,7 +1994,8 @@ currentBlock); #endif } else { - object = new LoadInst(object, "", true, currentBlock); + object = new LoadInst( + object, "", TheCompiler->useCooperativeGC(), currentBlock); JITVerifyNull(object); type = LCI->getVirtualType(); } @@ -2018,7 +2024,8 @@ Value* ptr = getConstantPoolAt(index, func, returnType, 0, true); if (!stat) { - object = new LoadInst(object, "", true, currentBlock); + object = new LoadInst( + object, "", TheCompiler->useCooperativeGC(), currentBlock); Value* tmp = new BitCastInst(object, Pty, "", currentBlock); Value* args[2] = { zero, ptr }; ptr = GetElementPtrInst::Create(tmp, args, args + 2, "", currentBlock); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=115464&r1=115463&r2=115464&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Sun Oct 3 12:43:10 2010 @@ -326,8 +326,8 @@ return new llvm::LoadInst(longStack[currentStackIndex - 1], "", false, currentBlock); } else { - return new llvm::LoadInst(objectStack[currentStackIndex - 1], "", true, - currentBlock); + return new llvm::LoadInst(objectStack[currentStackIndex - 1], "", + TheCompiler->useCooperativeGC(), currentBlock); } } Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=115464&r1=115463&r2=115464&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sun Oct 3 12:43:10 2010 @@ -296,8 +296,8 @@ break; case ALOAD : - push(new LoadInst(objectLocals[WREAD_U1(reader, false, i, wide)], "", true, - currentBlock), false); + push(new LoadInst(objectLocals[WREAD_U1(reader, false, i, wide)], "", + TheCompiler->useCooperativeGC(), currentBlock), false); break; case ILOAD_0 : @@ -385,22 +385,22 @@ break; case ALOAD_0 : - push(new LoadInst(objectLocals[0], "", true, currentBlock), + push(new LoadInst(objectLocals[0], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; case ALOAD_1 : - push(new LoadInst(objectLocals[1], "", true, currentBlock), + push(new LoadInst(objectLocals[1], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; case ALOAD_2 : - push(new LoadInst(objectLocals[2], "", true, currentBlock), + push(new LoadInst(objectLocals[2], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; case ALOAD_3 : - push(new LoadInst(objectLocals[3], "", true, currentBlock), + push(new LoadInst(objectLocals[3], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; @@ -687,9 +687,11 @@ // may go into runtime and we don't want values in registers at that // point. Value* val = new LoadInst(objectStack[currentStackIndex - 1], "", - true, currentBlock); + TheCompiler->useCooperativeGC(), + currentBlock); Value* obj = new LoadInst(objectStack[currentStackIndex - 3], "", - true, currentBlock); + TheCompiler->useCooperativeGC(), + currentBlock); Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, val, intrinsics->JavaObjectNullConstant, ""); @@ -1868,7 +1870,8 @@ case RET : { uint8 local = reader.readU1(); i += 1; - Value* _val = new LoadInst(objectLocals[local], "", true, currentBlock); + Value* _val = new LoadInst( + objectLocals[local], "", TheCompiler->useCooperativeGC(), currentBlock); Value* val = new PtrToIntInst(_val, Type::getInt32Ty(*llvmContext), "", currentBlock); SwitchInst* inst = SwitchInst::Create(val, jsrs[0], jsrs.size(), currentBlock); Modified: vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp?rev=115464&r1=115463&r2=115464&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp Sun Oct 3 12:43:10 2010 @@ -210,7 +210,11 @@ if (LoadInst* LI = dyn_cast(I)) { if (LI->getType() == intrinsics->JavaObjectType && dyn_cast(LI->getPointerOperand()) != NULL) { - assert(LI->isVolatile()); + if (TheCompiler->useCooperativeGC()) { + assert(LI->isVolatile()); + } else { + assert(!LI->isVolatile()); + } } } Modified: vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc?rev=115464&r1=115463&r2=115464&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Sun Oct 3 12:43:10 2010 @@ -14,61 +14,732 @@ /*Params=*/FuncTy_1_args, /*isVarArg=*/false); -std::vectorStructTy_JavaObject_fields; -std::vectorFuncTy_5_args; -FunctionType* FuncTy_5 = FunctionType::get( +std::vectorFuncTy_3_args; +FuncTy_3_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_3 = FunctionType::get( + /*Result=*/PointerTy_0, + /*Params=*/FuncTy_3_args, + /*isVarArg=*/false); + +PointerType* PointerTy_2 = PointerType::get(FuncTy_3, 0); + +std::vectorStructTy_struct_mvm__MutatorThread_fields; +std::vectorStructTy_struct_mvm__Thread_fields; +std::vectorStructTy_struct_mvm__CircularBase_fields; +std::vectorFuncTy_7_args; +FunctionType* FuncTy_7 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), - /*Params=*/FuncTy_5_args, + /*Params=*/FuncTy_7_args, /*isVarArg=*/true); -PointerType* PointerTy_4 = PointerType::get(FuncTy_5, 0); +PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0); + +PointerType* PointerTy_5 = PointerType::get(PointerTy_6, 0); + +StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_5); +PATypeHolder StructTy_struct_mvm__CircularBase_fwd = OpaqueType::get(mod->getContext()); +PointerType* PointerTy_8 = PointerType::get(StructTy_struct_mvm__CircularBase_fwd, 0); + +StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8); +StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8); +StructType* StructTy_struct_mvm__CircularBase = StructType::get(mod->getContext(), StructTy_struct_mvm__CircularBase_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::CircularBase", StructTy_struct_mvm__CircularBase); +cast(StructTy_struct_mvm__CircularBase_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__CircularBase); +StructTy_struct_mvm__CircularBase = cast(StructTy_struct_mvm__CircularBase_fwd.get()); + + +StructTy_struct_mvm__Thread_fields.push_back(StructTy_struct_mvm__CircularBase); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct_mvm__VirtualMachine_fields; +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_5); +std::vectorStructTy_struct_mvm__BumpPtrAllocator_fields; +std::vectorStructTy_struct_mvm__SpinLock_fields; +StructTy_struct_mvm__SpinLock_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_mvm__SpinLock = StructType::get(mod->getContext(), StructTy_struct_mvm__SpinLock_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::SpinLock", StructTy_struct_mvm__SpinLock); + +StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_mvm__SpinLock); +std::vectorStructTy_struct_llvm__BumpPtrAllocator_fields; +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct_llvm__SlabAllocator_fields; +StructTy_struct_llvm__SlabAllocator_fields.push_back(PointerTy_5); +StructType* StructTy_struct_llvm__SlabAllocator = StructType::get(mod->getContext(), StructTy_struct_llvm__SlabAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.llvm::SlabAllocator", StructTy_struct_llvm__SlabAllocator); + +PointerType* PointerTy_11 = PointerType::get(StructTy_struct_llvm__SlabAllocator, 0); + +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_11); +std::vectorStructTy_struct_llvm__MemSlab_fields; +StructTy_struct_llvm__MemSlab_fields.push_back(IntegerType::get(mod->getContext(), 32)); +PATypeHolder PointerTy_12_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_llvm__MemSlab_fields.push_back(PointerTy_12_fwd); +StructType* StructTy_struct_llvm__MemSlab = StructType::get(mod->getContext(), StructTy_struct_llvm__MemSlab_fields, /*isPacked=*/false); +mod->addTypeName("struct.llvm::MemSlab", StructTy_struct_llvm__MemSlab); + +PointerType* PointerTy_12 = PointerType::get(StructTy_struct_llvm__MemSlab, 0); +cast(PointerTy_12_fwd.get())->refineAbstractTypeTo(PointerTy_12); +PointerTy_12 = cast(PointerTy_12_fwd.get()); + + +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_12); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_llvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_llvm__BumpPtrAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.llvm::BumpPtrAllocator", StructTy_struct_llvm__BumpPtrAllocator); + +StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator); +StructType* StructTy_struct_mvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__BumpPtrAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::BumpPtrAllocator", StructTy_struct_mvm__BumpPtrAllocator); + +PointerType* PointerTy_10 = PointerType::get(StructTy_struct_mvm__BumpPtrAllocator, 0); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_10); +PATypeHolder StructTy_struct_mvm__Thread_fwd = OpaqueType::get(mod->getContext()); +PointerType* PointerTy_13 = PointerType::get(StructTy_struct_mvm__Thread_fwd, 0); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_13); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); +std::vectorStructTy_struct_mvm__ReferenceQueue_fields; +std::vectorStructTy_struct_gc_fields; +std::vectorStructTy_struct_gcRoot_fields; +StructTy_struct_gcRoot_fields.push_back(PointerTy_5); +StructTy_struct_gcRoot_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); +mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); + +StructTy_struct_gc_fields.push_back(StructTy_struct_gcRoot); +StructType* StructTy_struct_gc = StructType::get(mod->getContext(), StructTy_struct_gc_fields, /*isPacked=*/false); +mod->addTypeName("struct.gc", StructTy_struct_gc); + +PointerType* PointerTy_15 = PointerType::get(StructTy_struct_gc, 0); + +PointerType* PointerTy_14 = PointerType::get(PointerTy_15, 0); + +StructTy_struct_mvm__ReferenceQueue_fields.push_back(PointerTy_14); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(StructTy_struct_mvm__SpinLock); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_struct_mvm__ReferenceQueue = StructType::get(mod->getContext(), StructTy_struct_mvm__ReferenceQueue_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ReferenceQueue", StructTy_struct_mvm__ReferenceQueue); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct_mvm__Cond_fields; +std::vectorStructTy_union_pthread_cond_t_fields; +std::vectorStructTy_struct__2__13_fields; +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); +StructTy_struct__2__13_fields.push_back(PointerTy_0); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct__2__13 = StructType::get(mod->getContext(), StructTy_struct__2__13_fields, /*isPacked=*/false); +mod->addTypeName("struct..2._13", StructTy_struct__2__13); + +StructTy_union_pthread_cond_t_fields.push_back(StructTy_struct__2__13); +ArrayType* ArrayTy_16 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1); + +StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_16); +StructType* StructTy_union_pthread_cond_t = StructType::get(mod->getContext(), StructTy_union_pthread_cond_t_fields, /*isPacked=*/false); +mod->addTypeName("union.pthread_cond_t", StructTy_union_pthread_cond_t); + +StructTy_struct_mvm__Cond_fields.push_back(StructTy_union_pthread_cond_t); +StructType* StructTy_struct_mvm__Cond = StructType::get(mod->getContext(), StructTy_struct_mvm__Cond_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::Cond", StructTy_struct_mvm__Cond); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond); +std::vectorStructTy_struct_mvm__LockNormal_fields; +std::vectorStructTy_struct_mvm__Lock_fields; +StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5); +StructTy_struct_mvm__Lock_fields.push_back(PointerTy_13); +std::vectorStructTy_union_pthread_mutex_t_fields; +std::vectorStructTy_struct__1__pthread_mutex_s_fields; +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(StructTy_struct_mvm__SpinLock); +StructType* StructTy_struct__1__pthread_mutex_s = StructType::get(mod->getContext(), StructTy_struct__1__pthread_mutex_s_fields, /*isPacked=*/false); +mod->addTypeName("struct..1__pthread_mutex_s", StructTy_struct__1__pthread_mutex_s); + +StructTy_union_pthread_mutex_t_fields.push_back(StructTy_struct__1__pthread_mutex_s); +StructType* StructTy_union_pthread_mutex_t = StructType::get(mod->getContext(), StructTy_union_pthread_mutex_t_fields, /*isPacked=*/false); +mod->addTypeName("union.pthread_mutex_t", StructTy_union_pthread_mutex_t); + +StructTy_struct_mvm__Lock_fields.push_back(StructTy_union_pthread_mutex_t); +StructType* StructTy_struct_mvm__Lock = StructType::get(mod->getContext(), StructTy_struct_mvm__Lock_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::Lock", StructTy_struct_mvm__Lock); + +StructTy_struct_mvm__LockNormal_fields.push_back(StructTy_struct_mvm__Lock); +StructType* StructTy_struct_mvm__LockNormal = StructType::get(mod->getContext(), StructTy_struct_mvm__LockNormal_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::LockNormal", StructTy_struct_mvm__LockNormal); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_11); +std::vectorStructTy_struct_mvm__CooperativeCollectionRV_fields; +std::vectorStructTy_struct_mvm__CollectionRV_fields; +StructTy_struct_mvm__CollectionRV_fields.push_back(PointerTy_5); +StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__LockNormal); +StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond); +StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond); +StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_mvm__CollectionRV = StructType::get(mod->getContext(), StructTy_struct_mvm__CollectionRV_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::CollectionRV", StructTy_struct_mvm__CollectionRV); + +StructTy_struct_mvm__CooperativeCollectionRV_fields.push_back(StructTy_struct_mvm__CollectionRV); +StructType* StructTy_struct_mvm__CooperativeCollectionRV = StructType::get(mod->getContext(), StructTy_struct_mvm__CooperativeCollectionRV_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::CooperativeCollectionRV", StructTy_struct_mvm__CooperativeCollectionRV); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__CooperativeCollectionRV); +std::vectorStructTy_struct_mvm__StartEndFunctionMap_fields; +std::vectorStructTy_struct_mvm__FunctionMap_fields; +std::vectorStructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields; +std::vectorStructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields; +std::vectorStructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields; +std::vectorStructTy_struct___gnu_cxx__new_allocator_gc___fields; +StructTy_struct___gnu_cxx__new_allocator_gc___fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_struct___gnu_cxx__new_allocator_gc__ = StructType::get(mod->getContext(), StructTy_struct___gnu_cxx__new_allocator_gc___fields, /*isPacked=*/true); +mod->addTypeName("struct.__gnu_cxx::new_allocator", StructTy_struct___gnu_cxx__new_allocator_gc__); + +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct___gnu_cxx__new_allocator_gc__); +std::vectorStructTy_struct_std___Rb_tree_node_base_fields; +StructTy_struct_std___Rb_tree_node_base_fields.push_back(IntegerType::get(mod->getContext(), 32)); +PATypeHolder StructTy_struct_std___Rb_tree_node_base_fwd = OpaqueType::get(mod->getContext()); +PointerType* PointerTy_17 = PointerType::get(StructTy_struct_std___Rb_tree_node_base_fwd, 0); + +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); +StructType* StructTy_struct_std___Rb_tree_node_base = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_node_base_fields, /*isPacked=*/false); +mod->addTypeName("struct.std::_Rb_tree_node_base", StructTy_struct_std___Rb_tree_node_base); +cast(StructTy_struct_std___Rb_tree_node_base_fwd.get())->refineAbstractTypeTo(StructTy_struct_std___Rb_tree_node_base); +StructTy_struct_std___Rb_tree_node_base = cast(StructTy_struct_std___Rb_tree_node_base_fwd.get()); + + +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct_std___Rb_tree_node_base); +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields, /*isPacked=*/false); +mod->addTypeName("struct.std::_Rb_tree,std::_Select1st >,std::less,std::allocator > >::_Rb_tree_impl,false>", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_); + +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_); +StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false); +mod->addTypeName("struct.std::_Rb_tree,std::_Select1st >,std::less,std::allocator > >", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); + +StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); +StructType* StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false); +mod->addTypeName("struct.std::map,std::allocator > >", StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); + +StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); +StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_mvm__SpinLock); +StructType* StructTy_struct_mvm__FunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__FunctionMap_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::FunctionMap", StructTy_struct_mvm__FunctionMap); + +StructTy_struct_mvm__StartEndFunctionMap_fields.push_back(StructTy_struct_mvm__FunctionMap); +StructType* StructTy_struct_mvm__StartEndFunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__StartEndFunctionMap_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::StartEndFunctionMap", StructTy_struct_mvm__StartEndFunctionMap); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap); +StructType* StructTy_struct_mvm__VirtualMachine = StructType::get(mod->getContext(), StructTy_struct_mvm__VirtualMachine_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::VirtualMachine", StructTy_struct_mvm__VirtualMachine); + +PointerType* PointerTy_9 = PointerType::get(StructTy_struct_mvm__VirtualMachine, 0); + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_9); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); +std::vectorFuncTy_19_args; +FuncTy_19_args.push_back(PointerTy_13); +FunctionType* FuncTy_19 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_19_args, + /*isVarArg=*/false); + +PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); +std::vectorStructTy_struct_mvm__KnownFrame_fields; +PATypeHolder PointerTy_20_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_20_fwd); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); +StructType* StructTy_struct_mvm__KnownFrame = StructType::get(mod->getContext(), StructTy_struct_mvm__KnownFrame_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::KnownFrame", StructTy_struct_mvm__KnownFrame); + +PointerType* PointerTy_20 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0); +cast(PointerTy_20_fwd.get())->refineAbstractTypeTo(PointerTy_20); +PointerTy_20 = cast(PointerTy_20_fwd.get()); -ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_4, 0); + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20); +std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; +PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd); +std::vectorStructTy_struct___jmp_buf_tag_fields; +ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); + +StructTy_struct___jmp_buf_tag_fields.push_back(ArrayTy_23); +StructTy_struct___jmp_buf_tag_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct___sigset_t_fields; +ArrayType* ArrayTy_24 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); + +StructTy_struct___sigset_t_fields.push_back(ArrayTy_24); +StructType* StructTy_struct___sigset_t = StructType::get(mod->getContext(), StructTy_struct___sigset_t_fields, /*isPacked=*/false); +mod->addTypeName("struct.__sigset_t", StructTy_struct___sigset_t); + +StructTy_struct___jmp_buf_tag_fields.push_back(StructTy_struct___sigset_t); +StructType* StructTy_struct___jmp_buf_tag = StructType::get(mod->getContext(), StructTy_struct___jmp_buf_tag_fields, /*isPacked=*/false); +mod->addTypeName("struct.__jmp_buf_tag", StructTy_struct___jmp_buf_tag); + +ArrayType* ArrayTy_22 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); + +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22); +StructType* StructTy_struct_mvm__ExceptionBuffer = StructType::get(mod->getContext(), StructTy_struct_mvm__ExceptionBuffer_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ExceptionBuffer", StructTy_struct_mvm__ExceptionBuffer); + +PointerType* PointerTy_21 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); +cast(PointerTy_21_fwd.get())->refineAbstractTypeTo(PointerTy_21); +PointerTy_21 = cast(PointerTy_21_fwd.get()); + + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21); +StructType* StructTy_struct_mvm__Thread = StructType::get(mod->getContext(), StructTy_struct_mvm__Thread_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::Thread", StructTy_struct_mvm__Thread); +cast(StructTy_struct_mvm__Thread_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__Thread); +StructTy_struct_mvm__Thread = cast(StructTy_struct_mvm__Thread_fwd.get()); + + +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread); +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator); +StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18); +StructType* StructTy_struct_mvm__MutatorThread = StructType::get(mod->getContext(), StructTy_struct_mvm__MutatorThread_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::MutatorThread", StructTy_struct_mvm__MutatorThread); + +PointerType* PointerTy_4 = PointerType::get(StructTy_struct_mvm__MutatorThread, 0); + +PointerType* PointerTy_25 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); + +std::vectorStructTy_struct_j3__JavaObject_fields; +StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_gc); +StructType* StructTy_struct_j3__JavaObject = StructType::get(mod->getContext(), StructTy_struct_j3__JavaObject_fields, /*isPacked=*/false); +mod->addTypeName("struct.j3::JavaObject", StructTy_struct_j3__JavaObject); + +PointerType* PointerTy_26 = PointerType::get(StructTy_struct_j3__JavaObject, 0); + +std::vectorStructTy_JavaObject_fields; +ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_6, 0); mod->addTypeName("VT", ArrayTy_VT); -PointerType* PointerTy_3 = PointerType::get(ArrayTy_VT, 0); +PointerType* PointerTy_29 = PointerType::get(ArrayTy_VT, 0); -StructTy_JavaObject_fields.push_back(PointerTy_3); +StructTy_JavaObject_fields.push_back(PointerTy_29); StructTy_JavaObject_fields.push_back(PointerTy_0); StructType* StructTy_JavaObject = StructType::get(mod->getContext(), StructTy_JavaObject_fields, /*isPacked=*/false); mod->addTypeName("JavaObject", StructTy_JavaObject); -PointerType* PointerTy_2 = PointerType::get(StructTy_JavaObject, 0); +PointerType* PointerTy_28 = PointerType::get(StructTy_JavaObject, 0); -std::vectorFuncTy_7_args; -FuncTy_7_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_7_args.push_back(PointerTy_2); -FunctionType* FuncTy_7 = FunctionType::get( - /*Result=*/PointerTy_2, - /*Params=*/FuncTy_7_args, +PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); + +PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); + +std::vectorFuncTy_32_args; +FuncTy_32_args.push_back(PointerTy_28); +FuncTy_32_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_32_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_32_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_32 = FunctionType::get( + /*Result=*/PointerTy_28, + /*Params=*/FuncTy_32_args, /*isVarArg=*/false); -PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0); +PointerType* PointerTy_31 = PointerType::get(FuncTy_32, 0); + +PointerType* PointerTy_33 = PointerType::get(PointerTy_29, 0); + +std::vectorFuncTy_35_args; +FuncTy_35_args.push_back(PointerTy_28); +FuncTy_35_args.push_back(PointerTy_28); +FuncTy_35_args.push_back(PointerTy_28); +FuncTy_35_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_35_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_35 = FunctionType::get( + /*Result=*/PointerTy_28, + /*Params=*/FuncTy_35_args, + /*isVarArg=*/false); + +PointerType* PointerTy_34 = PointerType::get(FuncTy_35, 0); + +std::vectorStructTy_37_fields; +std::vectorStructTy_38_fields; +std::vectorStructTy_39_fields; +StructTy_39_fields.push_back(StructTy_JavaObject); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_39 = StructType::get(mod->getContext(), StructTy_39_fields, /*isPacked=*/false); + +StructTy_38_fields.push_back(StructTy_39); +StructType* StructTy_38 = StructType::get(mod->getContext(), StructTy_38_fields, /*isPacked=*/false); + +StructTy_37_fields.push_back(StructTy_38); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_37_fields.push_back(PointerTy_28); +StructType* StructTy_37 = StructType::get(mod->getContext(), StructTy_37_fields, /*isPacked=*/false); + +PointerType* PointerTy_36 = PointerType::get(StructTy_37, 0); + +std::vectorStructTy_41_fields; +std::vectorStructTy_42_fields; +StructTy_42_fields.push_back(StructTy_39); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructType* StructTy_42 = StructType::get(mod->getContext(), StructTy_42_fields, /*isPacked=*/false); + +StructTy_41_fields.push_back(StructTy_42); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_41 = StructType::get(mod->getContext(), StructTy_41_fields, /*isPacked=*/false); + +PointerType* PointerTy_40 = PointerType::get(StructTy_41, 0); + +std::vectorStructTy_44_fields; +StructTy_44_fields.push_back(StructTy_39); +StructTy_44_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_44 = StructType::get(mod->getContext(), StructTy_44_fields, /*isPacked=*/false); + +PointerType* PointerTy_43 = PointerType::get(StructTy_44, 0); + +std::vectorFuncTy_46_args; +FunctionType* FuncTy_46 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_46_args, + /*isVarArg=*/false); + +PointerType* PointerTy_45 = PointerType::get(FuncTy_46, 0); + +std::vectorStructTy_48_fields; +StructTy_48_fields.push_back(PointerTy_28); +StructTy_48_fields.push_back(PointerTy_28); +StructTy_48_fields.push_back(PointerTy_28); +StructTy_48_fields.push_back(PointerTy_28); +StructType* StructTy_48 = StructType::get(mod->getContext(), StructTy_48_fields, /*isPacked=*/false); + +PointerType* PointerTy_47 = PointerType::get(StructTy_48, 0); + +std::vectorFuncTy_50_args; +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FunctionType* FuncTy_50 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_50_args, + /*isVarArg=*/false); + +PointerType* PointerTy_49 = PointerType::get(FuncTy_50, 0); + +std::vectorFuncTy_52_args; +FuncTy_52_args.push_back(PointerTy_25); +FuncTy_52_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_52_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_52 = FunctionType::get( + /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Params=*/FuncTy_52_args, + /*isVarArg=*/false); + +PointerType* PointerTy_51 = PointerType::get(FuncTy_52, 0); // Function Declarations -Function* func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2 = Function::Create( - /*Type=*/FuncTy_7, +Function* func_llvm_frameaddress = Function::Create( + /*Type=*/FuncTy_3, /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2", mod); -func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2->setCallingConv(CallingConv::C); -AttrListPtr func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL; + /*Name=*/"llvm.frameaddress", mod); // (external, no body) +func_llvm_frameaddress->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_frameaddress_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind | Attribute::ReadNone; + Attrs.push_back(PAWI); + func_llvm_frameaddress_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); + +Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create( + /*Type=*/FuncTy_32, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III", mod); +func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setCallingConv(CallingConv::C); +AttrListPtr func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; + Attrs.push_back(PAWI); + func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL); + +Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( + /*Type=*/FuncTy_35, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II", mod); +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setCallingConv(CallingConv::C); +AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; Attrs.push_back(PAWI); - func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setAttributes(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL); + +Function* func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III = Function::Create( + /*Type=*/FuncTy_32, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III", mod); +func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setCallingConv(CallingConv::C); +AttrListPtr func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; + Attrs.push_back(PAWI); + func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL); + +Function* func_llvm_trap = Function::Create( + /*Type=*/FuncTy_46, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.trap", mod); // (external, no body) +func_llvm_trap->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_trap_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_trap_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_llvm_trap->setAttributes(func_llvm_trap_PAL); + +Function* func_llvm_memory_barrier = Function::Create( + /*Type=*/FuncTy_50, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.memory.barrier", mod); // (external, no body) +func_llvm_memory_barrier->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_memory_barrier_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_memory_barrier_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2->setAttributes(func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL); +func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL); + +Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create( + /*Type=*/FuncTy_52, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.atomic.cmp.swap.i32.p0i32", mod); // (external, no body) +func_llvm_atomic_cmp_swap_i32_p0i32->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_atomic_cmp_swap_i32_p0i32_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoCapture; + Attrs.push_back(PAWI); + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_atomic_cmp_swap_i32_p0i32_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL); + +Function* func__ZN3mvm6Thread5yieldEv = Function::Create( + /*Type=*/FuncTy_46, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) +func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C); +AttrListPtr func__ZN3mvm6Thread5yieldEv_PAL; +func__ZN3mvm6Thread5yieldEv->setAttributes(func__ZN3mvm6Thread5yieldEv_PAL); // Global Variable Declarations +GlobalVariable* gvar_struct_finalObject32 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_37, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject32"); + +GlobalVariable* gvar_struct_finalObject101 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_37, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject101"); + +GlobalVariable* gvar_struct_finalObject122 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_41, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject122"); + +GlobalVariable* gvar_struct_finalObject67 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_41, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject67"); + +GlobalVariable* gvar_struct_finalObject2 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_44, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject2"); + +GlobalVariable* gvar_struct_finalObject85 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_41, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject85"); + +GlobalVariable* gvar_struct_org_mmtk_utility_DoublyLinkedList_static = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_48, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"org_mmtk_utility_DoublyLinkedList_static"); + // Constant Definitions -ConstantInt* const_int32_8 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -ConstantInt* const_int32_9 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_53 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_55 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_56 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_57 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_58 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8193"), 10)); +ConstantInt* const_int32_59 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("4"), 10)); +ConstantInt* const_int32_60 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("7"), 10)); +ConstantInt* const_int32_61 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8"), 10)); +ConstantInt* const_int32_62 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-1"), 10)); +ConstantInt* const_int32_63 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("63"), 10)); +ConstantInt* const_int32_64 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("127"), 10)); +ConstantInt* const_int32_65 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("255"), 10)); +ConstantInt* const_int32_66 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("511"), 10)); +ConstantInt* const_int32_67 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2047"), 10)); +ConstantInt* const_int32_68 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("10"), 10)); +ConstantInt* const_int32_69 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("32"), 10)); +ConstantInt* const_int32_70 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("12"), 10)); +ConstantInt* const_int32_71 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_72 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("16"), 10)); +ConstantInt* const_int32_73 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("6"), 10)); +ConstantInt* const_int32_74 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("20"), 10)); +ConstantInt* const_int32_75 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10)); +ConstantInt* const_int32_76 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantPointerNull* const_ptr_77 = ConstantPointerNull::get(PointerTy_29); +ConstantInt* const_int8_78 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("-4"), 10)); +std::vector const_ptr_79_indices; +const_ptr_79_indices.push_back(const_int32_55); +const_ptr_79_indices.push_back(const_int32_76); +Constant* const_ptr_79 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_79_indices[0], const_ptr_79_indices.size()); +ConstantInt* const_int8_80 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("2"), 10)); +std::vector const_ptr_81_indices; +const_ptr_81_indices.push_back(const_int32_55); +const_ptr_81_indices.push_back(const_int32_53); +Constant* const_ptr_81 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_81_indices[0], const_ptr_81_indices.size()); +ConstantInt* const_int32_82 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); +ConstantPointerNull* const_ptr_83 = ConstantPointerNull::get(PointerTy_0); +std::vector const_ptr_84_indices; +const_ptr_84_indices.push_back(const_int32_55); +const_ptr_84_indices.push_back(const_int32_76); +Constant* const_ptr_84 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_84_indices[0], const_ptr_84_indices.size()); +std::vector const_ptr_85_indices; +const_ptr_85_indices.push_back(const_int32_55); +const_ptr_85_indices.push_back(const_int32_53); +Constant* const_ptr_85 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_85_indices[0], const_ptr_85_indices.size()); +std::vector const_ptr_86_indices; +const_ptr_86_indices.push_back(const_int32_55); +const_ptr_86_indices.push_back(const_int32_57); +Constant* const_ptr_86 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject122, &const_ptr_86_indices[0], const_ptr_86_indices.size()); +std::vector const_ptr_87_indices; +const_ptr_87_indices.push_back(const_int32_55); +const_ptr_87_indices.push_back(const_int32_57); +Constant* const_ptr_87 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject67, &const_ptr_87_indices[0], const_ptr_87_indices.size()); +ConstantInt* const_int8_88 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("1"), 10)); +std::vector const_ptr_89_indices; +const_ptr_89_indices.push_back(const_int32_55); +const_ptr_89_indices.push_back(const_int32_76); +Constant* const_ptr_89 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject2, &const_ptr_89_indices[0], const_ptr_89_indices.size()); +std::vector const_ptr_90_indices; +const_ptr_90_indices.push_back(const_int32_55); +const_ptr_90_indices.push_back(const_int32_57); +Constant* const_ptr_90 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject85, &const_ptr_90_indices[0], const_ptr_90_indices.size()); +std::vector const_ptr_91_indices; +const_ptr_91_indices.push_back(const_int32_55); +const_ptr_91_indices.push_back(const_int32_57); +Constant* const_ptr_91 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_91_indices[0], const_ptr_91_indices.size()); +ConstantPointerNull* const_ptr_92 = ConstantPointerNull::get(PointerTy_28); +ConstantInt* const_int32_93 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); +ConstantInt* const_int1_94 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10)); // Global Variable Definitions @@ -94,29 +765,1151 @@ ptr_VT->setName("VT"); BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF__i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFEQ_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread19.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_4_i_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i6.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_6_i_i_i7_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i7.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_7_i_i1_i8_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i8.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_8_i_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i9.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_9_i_i_i10_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i10.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT16_i_i_i11_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i11.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT17_i_i_i12_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i12.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT18_i_i_i13_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i13.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT19_i_i_i14_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i14.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT20_i_i_i15_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i15.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF__i17_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i17.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i21_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i21.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread21.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF__i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread9.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread13.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread17.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i",func_gcmalloc,0); +BasicBlock* label_true_IF_NULL_i1_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_1_i3_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL_i5_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb_i_i20_i = BasicBlock::Create(mod->getContext(), "bb.i.i20.i",func_gcmalloc,0); +BasicBlock* label_bb1_i_i21_i = BasicBlock::Create(mod->getContext(), "bb1.i.i21.i",func_gcmalloc,0); +BasicBlock* label_bb2_i_i22_i = BasicBlock::Create(mod->getContext(), "bb2.i.i22.i",func_gcmalloc,0); +BasicBlock* label_bb4_preheader_i_i23_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i23.i",func_gcmalloc,0); +BasicBlock* label_bb3_i_i24_i = BasicBlock::Create(mod->getContext(), "bb3.i.i24.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i7_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL3_i8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IF_NULL_i1_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i6.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_1_i3_i_i8_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i8.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL_i5_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i9.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb_i_i_i = BasicBlock::Create(mod->getContext(), "bb.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb1_i_i_i = BasicBlock::Create(mod->getContext(), "bb1.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb2_i_i_i = BasicBlock::Create(mod->getContext(), "bb2.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb4_preheader_i_i_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb3_i_i_i = BasicBlock::Create(mod->getContext(), "bb3.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i7_i_i11_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i11.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL3_i8_i_i12_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i12.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit = BasicBlock::Create(mod->getContext(), "JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit",func_gcmalloc,0); // Block entry (label_entry) -BinaryOperator* int32_10 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_8, "", label_entry); -BinaryOperator* int32_11 = BinaryOperator::Create(Instruction::And, int32_10, const_int32_9, "", label_entry); -CastInst* ptr_tmp = new BitCastInst(ptr_VT, PointerTy_2, "tmp", label_entry); -std::vector ptr_12_params; -ptr_12_params.push_back(int32_11); -ptr_12_params.push_back(ptr_tmp); -CallInst* ptr_12 = CallInst::Create(func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2, ptr_12_params.begin(), ptr_12_params.end(), "", label_entry); -ptr_12->setCallingConv(CallingConv::C); -ptr_12->setTailCall(true); -AttrListPtr ptr_12_PAL; +BinaryOperator* int32_95 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_53, "", label_entry); +BinaryOperator* int32_96 = BinaryOperator::Create(Instruction::And, int32_95, const_int32_54, "", label_entry); +CallInst* ptr_97 = CallInst::Create(func_llvm_frameaddress, const_int32_55, "", label_entry); +ptr_97->setCallingConv(CallingConv::C); +ptr_97->setTailCall(true); +AttrListPtr ptr_97_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_97_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_97->setAttributes(ptr_97_PAL); + +CastInst* int32_98 = new PtrToIntInst(ptr_97, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_99 = BinaryOperator::Create(Instruction::And, int32_98, const_int32_56, "", label_entry); +CastInst* ptr_100 = new IntToPtrInst(int32_99, PointerTy_4, "", label_entry); +std::vector ptr_101_indices; +ptr_101_indices.push_back(const_int32_55); +ptr_101_indices.push_back(const_int32_57); +Instruction* ptr_101 = GetElementPtrInst::Create(ptr_100, ptr_101_indices.begin(), ptr_101_indices.end(), "", label_entry); +LoadInst* int32_102 = new LoadInst(ptr_101, "", false, label_entry); +CastInst* ptr_103 = new IntToPtrInst(int32_102, PointerTy_26, "", label_entry); +ICmpInst* int1_104 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_96, const_int32_58, ""); +SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_104, const_int32_55, const_int32_59, "storemerge.i.i", label_entry); +SwitchInst* void_105 = SwitchInst::Create(int32_storemerge_i_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, 7, label_entry); +void_105->addCase(const_int32_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +void_105->addCase(const_int32_57, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +void_105->addCase(const_int32_53, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +void_105->addCase(const_int32_59, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +void_105->addCase(const_int32_60, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +void_105->addCase(const_int32_61, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i) +GetElementPtrInst* ptr_106 = GetElementPtrInst::Create(ptr_103, const_int32_59, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +CastInst* ptr_107 = new BitCastInst(ptr_106, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +LoadInst* ptr_108 = new LoadInst(ptr_107, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +BinaryOperator* int32_109 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +ICmpInst* int1_110 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_110, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); + +// Block GOTO or IF*4.i.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i_i) +ICmpInst* int1_112 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_112, label_GOTO_or_IF_4_i_i_i_i_i_i); + +// Block GOTO or IF*6.i.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i_i) +ICmpInst* int1_114 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_114, label_GOTO_or_IF_6_i_i_i_i_i_i); + +// Block GOTO or IF*7.i.i1.i.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i_i) +ICmpInst* int1_116 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_116, label_GOTO_or_IF_7_i_i1_i_i_i_i); + +// Block GOTO or IF*8.i.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i_i) +ICmpInst* int1_118 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_118, label_GOTO_or_IF_8_i_i_i_i_i_i); + +// Block GOTO or IF*9.i.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i_i) +BinaryOperator* int32_120 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_68, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BinaryOperator* int32_121 = BinaryOperator::Create(Instruction::Add, int32_120, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i_i); + +// Block false IF_ICMPGT16.i.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i_i) +BinaryOperator* int32_123 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i); + +// Block false IF_ICMPGT17.i.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i_i) +BinaryOperator* int32_125 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BinaryOperator* int32_126 = BinaryOperator::Create(Instruction::Add, int32_125, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i); + +// Block false IF_ICMPGT18.i.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i_i) +BinaryOperator* int32_128 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BinaryOperator* int32_129 = BinaryOperator::Create(Instruction::Add, int32_128, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i); + +// Block false IF_ICMPGT19.i.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i_i) +BinaryOperator* int32_131 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BinaryOperator* int32_132 = BinaryOperator::Create(Instruction::Add, int32_131, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i); + +// Block false IF_ICMPGT20.i.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i_i) +BinaryOperator* int32_134 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BinaryOperator* int32_135 = BinaryOperator::Create(Instruction::Add, int32_134, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i) +PHINode* int32_137 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +int32_137->reserveOperandSpace(6); +int32_137->addIncoming(int32_123, label_false_IF_ICMPGT16_i_i_i_i_i_i); +int32_137->addIncoming(int32_126, label_false_IF_ICMPGT17_i_i_i_i_i_i); +int32_137->addIncoming(int32_129, label_false_IF_ICMPGT18_i_i_i_i_i_i); +int32_137->addIncoming(int32_132, label_false_IF_ICMPGT19_i_i_i_i_i_i); +int32_137->addIncoming(int32_135, label_false_IF_ICMPGT20_i_i_i_i_i_i); +int32_137->addIncoming(int32_121, label_GOTO_or_IF_9_i_i_i_i_i_i); + +std::vector ptr_138_indices; +ptr_138_indices.push_back(const_int32_76); +ptr_138_indices.push_back(const_int32_76); +Instruction* ptr_138 = GetElementPtrInst::Create(ptr_108, ptr_138_indices.begin(), ptr_138_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* ptr_139 = new LoadInst(ptr_138, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +BinaryOperator* int32_140 = BinaryOperator::Create(Instruction::Add, int32_137, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_141 = new BitCastInst(ptr_139, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +GetElementPtrInst* ptr_142 = GetElementPtrInst::Create(ptr_141, int32_140, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* int32_143 = new LoadInst(ptr_142, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_144 = new IntToPtrInst(int32_143, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +ICmpInst* int1_145 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_143, const_int32_55, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_145, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); + +// Block GOTO or IF*.i.i.i.i (label_GOTO_or_IF__i_i_i_i) +std::vector ptr_147_params; +ptr_147_params.push_back(ptr_108); +ptr_147_params.push_back(int32_96); +ptr_147_params.push_back(const_int32_55); +ptr_147_params.push_back(const_int32_55); +CallInst* ptr_147 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_147_params.begin(), ptr_147_params.end(), "", label_GOTO_or_IF__i_i_i_i); +ptr_147->setCallingConv(CallingConv::C); +ptr_147->setTailCall(true); +AttrListPtr ptr_147_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_147_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_147->setAttributes(ptr_147_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i, label_GOTO_or_IF__i_i_i_i); + +// Block false IFNE.i.i.i.i (label_false_IFNE_i_i_i_i) +CastInst* ptr_149 = new IntToPtrInst(int32_143, PointerTy_27, "", label_false_IFNE_i_i_i_i); +LoadInst* ptr_150 = new LoadInst(ptr_149, "", false, label_false_IFNE_i_i_i_i); +CastInst* int32_151 = new PtrToIntInst(ptr_150, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i); + new StoreInst(int32_151, ptr_142, false, label_false_IFNE_i_i_i_i); +std::vector ptr_153_indices; +ptr_153_indices.push_back(const_int32_55); +ptr_153_indices.push_back(const_int32_55); +Instruction* ptr_153 = GetElementPtrInst::Create(ptr_144, ptr_153_indices.begin(), ptr_153_indices.end(), "", label_false_IFNE_i_i_i_i); + new StoreInst(const_ptr_77, ptr_153, false, label_false_IFNE_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i, label_false_IFNE_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i) +GetElementPtrInst* ptr_156 = GetElementPtrInst::Create(ptr_103, const_int32_57, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_157 = new BitCastInst(ptr_156, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_158 = new LoadInst(ptr_157, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +GetElementPtrInst* ptr_159 = GetElementPtrInst::Create(ptr_158, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_160 = new BitCastInst(ptr_159, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_161 = new LoadInst(ptr_160, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* int32_162 = new PtrToIntInst(ptr_161, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +BinaryOperator* int32_163 = BinaryOperator::Create(Instruction::Add, int32_162, int32_96, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_164 = new IntToPtrInst(int32_163, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +std::vector ptr_165_indices; +ptr_165_indices.push_back(const_int32_76); +ptr_165_indices.push_back(const_int32_76); +Instruction* ptr_165 = GetElementPtrInst::Create(ptr_158, ptr_165_indices.begin(), ptr_165_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_166 = new LoadInst(ptr_165, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_167 = new BitCastInst(ptr_166, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +ICmpInst* int1_168 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_164, ptr_167, ""); +BranchInst::Create(label_false_IFEQ_i_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i, int1_168, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i) +std::vector ptr_170_indices; +ptr_170_indices.push_back(const_int32_76); +ptr_170_indices.push_back(const_int32_55); +Instruction* ptr_170 = GetElementPtrInst::Create(ptr_158, ptr_170_indices.begin(), ptr_170_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); +CastInst* ptr__c_i_i_i_i = new IntToPtrInst(int32_163, PointerTy_29, ".c.i.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); + new StoreInst(ptr__c_i_i_i_i, ptr_170, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); + +// Block false IFEQ.i.i.i.i (label_false_IFEQ_i_i_i_i) +std::vector ptr_173_params; +ptr_173_params.push_back(ptr_158); +ptr_173_params.push_back(ptr_161); +ptr_173_params.push_back(ptr_164); +ptr_173_params.push_back(const_int32_55); +ptr_173_params.push_back(const_int32_55); +CallInst* ptr_173 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_173_params.begin(), ptr_173_params.end(), "", label_false_IFEQ_i_i_i_i); +ptr_173->setCallingConv(CallingConv::C); +ptr_173->setTailCall(true); +AttrListPtr ptr_173_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_12_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_173_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_12->setAttributes(ptr_12_PAL); +ptr_173->setAttributes(ptr_173_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i, label_false_IFEQ_i_i_i_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread19.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i) +std::vector ptr_175_indices; +ptr_175_indices.push_back(const_int32_57); +ptr_175_indices.push_back(const_int32_55); +ptr_175_indices.push_back(const_int32_55); +ptr_175_indices.push_back(const_int32_76); +Instruction* ptr_175 = GetElementPtrInst::Create(ptr_103, ptr_175_indices.begin(), ptr_175_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_176 = new BitCastInst(ptr_175, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_177 = new LoadInst(ptr_176, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_178 = new BitCastInst(ptr_177, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_179_params; +ptr_179_params.push_back(ptr_178); +ptr_179_params.push_back(int32_96); +ptr_179_params.push_back(const_int32_55); +ptr_179_params.push_back(const_int32_55); +CallInst* ptr_179 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_179_params.begin(), ptr_179_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ptr_179->setCallingConv(CallingConv::C); +ptr_179->setTailCall(true); +AttrListPtr ptr_179_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_179_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_179->setAttributes(ptr_179_PAL); + +std::vector ptr_180_indices; +ptr_180_indices.push_back(const_int32_55); +ptr_180_indices.push_back(const_int32_55); +Instruction* ptr_180 = GetElementPtrInst::Create(ptr_179, ptr_180_indices.begin(), ptr_180_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr__c20_i = new BitCastInst(ptr_VT, PointerTy_29, ".c20.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(ptr__c20_i, ptr_180, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_182_indices; +ptr_182_indices.push_back(const_int32_55); +ptr_182_indices.push_back(const_int32_76); +Instruction* ptr_182 = GetElementPtrInst::Create(ptr_179, ptr_182_indices.begin(), ptr_182_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_183 = new BitCastInst(ptr_182, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_184 = new LoadInst(ptr_183, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_185 = BinaryOperator::Create(Instruction::And, int8_184, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_186 = new LoadInst(const_ptr_79, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_187 = BinaryOperator::Create(Instruction::Or, int8_185, int8_186, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_188 = BinaryOperator::Create(Instruction::Or, int8_187, const_int8_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(int8_188, ptr_183, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_190 = new LoadInst(const_ptr_81, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* int32_191 = new PtrToIntInst(ptr_179, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int32_192 = BinaryOperator::Create(Instruction::And, int32_191, const_int32_82, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_193 = new IntToPtrInst(int32_192, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_194_indices; +ptr_194_indices.push_back(const_int32_57); +ptr_194_indices.push_back(const_int32_76); +Instruction* ptr_194 = GetElementPtrInst::Create(ptr_190, ptr_194_indices.begin(), ptr_194_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_195 = new LoadInst(ptr_194, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +GetElementPtrInst* ptr_196 = GetElementPtrInst::Create(ptr_195, const_int32_70, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_197 = new BitCastInst(ptr_196, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_198 = new LoadInst(ptr_197, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ICmpInst* int1_199 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i, ICmpInst::ICMP_EQ, ptr_198, const_ptr_83, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i5_i_i_i_i_i, int1_199, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i) +GetElementPtrInst* ptr_201 = GetElementPtrInst::Create(ptr_103, const_int32_53, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +CastInst* ptr_202 = new BitCastInst(ptr_201, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +LoadInst* ptr_203 = new LoadInst(ptr_202, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +BinaryOperator* int32_204 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +ICmpInst* int1_205 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_205, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); + +// Block GOTO or IF*4.i.i.i6.i.i.i (label_GOTO_or_IF_4_i_i_i6_i_i_i) +ICmpInst* int1_207 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_207, label_GOTO_or_IF_4_i_i_i6_i_i_i); + +// Block GOTO or IF*6.i.i.i7.i.i.i (label_GOTO_or_IF_6_i_i_i7_i_i_i) +ICmpInst* int1_209 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_209, label_GOTO_or_IF_6_i_i_i7_i_i_i); + +// Block GOTO or IF*7.i.i1.i8.i.i.i (label_GOTO_or_IF_7_i_i1_i8_i_i_i) +ICmpInst* int1_211 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_211, label_GOTO_or_IF_7_i_i1_i8_i_i_i); + +// Block GOTO or IF*8.i.i.i9.i.i.i (label_GOTO_or_IF_8_i_i_i9_i_i_i) +ICmpInst* int1_213 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_213, label_GOTO_or_IF_8_i_i_i9_i_i_i); + +// Block GOTO or IF*9.i.i.i10.i.i.i (label_GOTO_or_IF_9_i_i_i10_i_i_i) +BinaryOperator* int32_215 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_68, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BinaryOperator* int32_216 = BinaryOperator::Create(Instruction::Add, int32_215, const_int32_69, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_GOTO_or_IF_9_i_i_i10_i_i_i); + +// Block false IF_ICMPGT16.i.i.i11.i.i.i (label_false_IF_ICMPGT16_i_i_i11_i_i_i) +BinaryOperator* int32_218 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i11_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i); + +// Block false IF_ICMPGT17.i.i.i12.i.i.i (label_false_IF_ICMPGT17_i_i_i12_i_i_i) +BinaryOperator* int32_220 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BinaryOperator* int32_221 = BinaryOperator::Create(Instruction::Add, int32_220, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i); + +// Block false IF_ICMPGT18.i.i.i13.i.i.i (label_false_IF_ICMPGT18_i_i_i13_i_i_i) +BinaryOperator* int32_223 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BinaryOperator* int32_224 = BinaryOperator::Create(Instruction::Add, int32_223, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i); + +// Block false IF_ICMPGT19.i.i.i14.i.i.i (label_false_IF_ICMPGT19_i_i_i14_i_i_i) +BinaryOperator* int32_226 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BinaryOperator* int32_227 = BinaryOperator::Create(Instruction::Add, int32_226, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i); + +// Block false IF_ICMPGT20.i.i.i15.i.i.i (label_false_IF_ICMPGT20_i_i_i15_i_i_i) +BinaryOperator* int32_229 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BinaryOperator* int32_230 = BinaryOperator::Create(Instruction::Add, int32_229, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i) +PHINode* int32_232 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +int32_232->reserveOperandSpace(6); +int32_232->addIncoming(int32_218, label_false_IF_ICMPGT16_i_i_i11_i_i_i); +int32_232->addIncoming(int32_221, label_false_IF_ICMPGT17_i_i_i12_i_i_i); +int32_232->addIncoming(int32_224, label_false_IF_ICMPGT18_i_i_i13_i_i_i); +int32_232->addIncoming(int32_227, label_false_IF_ICMPGT19_i_i_i14_i_i_i); +int32_232->addIncoming(int32_230, label_false_IF_ICMPGT20_i_i_i15_i_i_i); +int32_232->addIncoming(int32_216, label_GOTO_or_IF_9_i_i_i10_i_i_i); + +std::vector ptr_233_indices; +ptr_233_indices.push_back(const_int32_76); +ptr_233_indices.push_back(const_int32_76); +Instruction* ptr_233 = GetElementPtrInst::Create(ptr_203, ptr_233_indices.begin(), ptr_233_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* ptr_234 = new LoadInst(ptr_233, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +BinaryOperator* int32_235 = BinaryOperator::Create(Instruction::Add, int32_232, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_236 = new BitCastInst(ptr_234, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +GetElementPtrInst* ptr_237 = GetElementPtrInst::Create(ptr_236, int32_235, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* int32_238 = new LoadInst(ptr_237, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_239 = new IntToPtrInst(int32_238, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +ICmpInst* int1_240 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_238, const_int32_55, ""); +BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_240, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); + +// Block GOTO or IF*.i17.i.i.i (label_GOTO_or_IF__i17_i_i_i) +std::vector ptr_242_params; +ptr_242_params.push_back(ptr_203); +ptr_242_params.push_back(int32_96); +ptr_242_params.push_back(const_int32_55); +ptr_242_params.push_back(const_int32_55); +CallInst* ptr_242 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_242_params.begin(), ptr_242_params.end(), "", label_GOTO_or_IF__i17_i_i_i); +ptr_242->setCallingConv(CallingConv::C); +ptr_242->setTailCall(true); +AttrListPtr ptr_242_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_242_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_242->setAttributes(ptr_242_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i, label_GOTO_or_IF__i17_i_i_i); + +// Block false IFNE.i21.i.i.i (label_false_IFNE_i21_i_i_i) +CastInst* ptr_244 = new IntToPtrInst(int32_238, PointerTy_27, "", label_false_IFNE_i21_i_i_i); +LoadInst* ptr_245 = new LoadInst(ptr_244, "", false, label_false_IFNE_i21_i_i_i); +CastInst* int32_246 = new PtrToIntInst(ptr_245, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i); + new StoreInst(int32_246, ptr_237, false, label_false_IFNE_i21_i_i_i); +std::vector ptr_248_indices; +ptr_248_indices.push_back(const_int32_55); +ptr_248_indices.push_back(const_int32_55); +Instruction* ptr_248 = GetElementPtrInst::Create(ptr_239, ptr_248_indices.begin(), ptr_248_indices.end(), "", label_false_IFNE_i21_i_i_i); + new StoreInst(const_ptr_77, ptr_248, false, label_false_IFNE_i21_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i, label_false_IFNE_i21_i_i_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread21.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i) +std::vector ptr_251_indices; +ptr_251_indices.push_back(const_int32_53); +ptr_251_indices.push_back(const_int32_55); +ptr_251_indices.push_back(const_int32_55); +ptr_251_indices.push_back(const_int32_76); +Instruction* ptr_251 = GetElementPtrInst::Create(ptr_103, ptr_251_indices.begin(), ptr_251_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_252 = new BitCastInst(ptr_251, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_253 = new LoadInst(ptr_252, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_254 = new BitCastInst(ptr_253, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_255_params; +ptr_255_params.push_back(ptr_254); +ptr_255_params.push_back(int32_96); +ptr_255_params.push_back(const_int32_55); +ptr_255_params.push_back(const_int32_55); +CallInst* ptr_255 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_255_params.begin(), ptr_255_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ptr_255->setCallingConv(CallingConv::C); +ptr_255->setTailCall(true); +AttrListPtr ptr_255_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_255_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_255->setAttributes(ptr_255_PAL); + +std::vector ptr_256_indices; +ptr_256_indices.push_back(const_int32_55); +ptr_256_indices.push_back(const_int32_55); +Instruction* ptr_256 = GetElementPtrInst::Create(ptr_255, ptr_256_indices.begin(), ptr_256_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr__c22_i = new BitCastInst(ptr_VT, PointerTy_29, ".c22.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(ptr__c22_i, ptr_256, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_258_indices; +ptr_258_indices.push_back(const_int32_55); +ptr_258_indices.push_back(const_int32_76); +Instruction* ptr_258 = GetElementPtrInst::Create(ptr_255, ptr_258_indices.begin(), ptr_258_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_259 = new BitCastInst(ptr_258, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_260 = new LoadInst(ptr_259, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_261 = BinaryOperator::Create(Instruction::And, int8_260, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_262 = new LoadInst(const_ptr_84, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_263 = BinaryOperator::Create(Instruction::Or, int8_261, int8_262, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_264 = BinaryOperator::Create(Instruction::Or, int8_263, const_int8_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(int8_264, ptr_259, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_266 = new LoadInst(const_ptr_85, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* int32_267 = new PtrToIntInst(ptr_255, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int32_268 = BinaryOperator::Create(Instruction::And, int32_267, const_int32_82, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_269 = new IntToPtrInst(int32_268, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_270_indices; +ptr_270_indices.push_back(const_int32_57); +ptr_270_indices.push_back(const_int32_76); +Instruction* ptr_270 = GetElementPtrInst::Create(ptr_266, ptr_270_indices.begin(), ptr_270_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_271 = new LoadInst(ptr_270, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +GetElementPtrInst* ptr_272 = GetElementPtrInst::Create(ptr_271, const_int32_70, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_273 = new BitCastInst(ptr_272, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_274 = new LoadInst(ptr_273, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ICmpInst* int1_275 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i, ICmpInst::ICMP_EQ, ptr_274, const_ptr_83, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_true_IFNULL_i5_i_i9_i_i_i, int1_275, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i) +std::vector ptr_277_indices; +ptr_277_indices.push_back(const_int32_59); +ptr_277_indices.push_back(const_int32_55); +ptr_277_indices.push_back(const_int32_55); +ptr_277_indices.push_back(const_int32_76); +Instruction* ptr_277 = GetElementPtrInst::Create(ptr_103, ptr_277_indices.begin(), ptr_277_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_278 = new BitCastInst(ptr_277, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +LoadInst* ptr_279 = new LoadInst(ptr_278, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_280 = new BitCastInst(ptr_279, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +BinaryOperator* int32_281 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +ICmpInst* int1_282 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_282, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); + +// Block GOTO or IF*4.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i) +ICmpInst* int1_284 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_284, label_GOTO_or_IF_4_i_i_i_i_i); + +// Block GOTO or IF*6.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i) +ICmpInst* int1_286 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_286, label_GOTO_or_IF_6_i_i_i_i_i); + +// Block GOTO or IF*7.i.i1.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i) +ICmpInst* int1_288 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_288, label_GOTO_or_IF_7_i_i1_i_i_i); + +// Block GOTO or IF*8.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i) +ICmpInst* int1_290 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_290, label_GOTO_or_IF_8_i_i_i_i_i); + +// Block GOTO or IF*9.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i) +BinaryOperator* int32_292 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_68, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_293 = BinaryOperator::Create(Instruction::Add, int32_292, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i); + +// Block false IF_ICMPGT16.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i) +BinaryOperator* int32_295 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i); + +// Block false IF_ICMPGT17.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i) +BinaryOperator* int32_297 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_298 = BinaryOperator::Create(Instruction::Add, int32_297, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i); + +// Block false IF_ICMPGT18.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i) +BinaryOperator* int32_300 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_301 = BinaryOperator::Create(Instruction::Add, int32_300, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i); + +// Block false IF_ICMPGT19.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i) +BinaryOperator* int32_303 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_304 = BinaryOperator::Create(Instruction::Add, int32_303, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i); + +// Block false IF_ICMPGT20.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i) +BinaryOperator* int32_306 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_307 = BinaryOperator::Create(Instruction::Add, int32_306, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i) +PHINode* int32_309 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +int32_309->reserveOperandSpace(6); +int32_309->addIncoming(int32_295, label_false_IF_ICMPGT16_i_i_i_i_i); +int32_309->addIncoming(int32_298, label_false_IF_ICMPGT17_i_i_i_i_i); +int32_309->addIncoming(int32_301, label_false_IF_ICMPGT18_i_i_i_i_i); +int32_309->addIncoming(int32_304, label_false_IF_ICMPGT19_i_i_i_i_i); +int32_309->addIncoming(int32_307, label_false_IF_ICMPGT20_i_i_i_i_i); +int32_309->addIncoming(int32_293, label_GOTO_or_IF_9_i_i_i_i_i); + +GetElementPtrInst* ptr_310 = GetElementPtrInst::Create(ptr_279, const_int32_70, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_311 = new BitCastInst(ptr_310, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* ptr_312 = new LoadInst(ptr_311, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +BinaryOperator* int32_313 = BinaryOperator::Create(Instruction::Add, int32_309, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_314 = new BitCastInst(ptr_312, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +GetElementPtrInst* ptr_315 = GetElementPtrInst::Create(ptr_314, int32_313, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* int32_316 = new LoadInst(ptr_315, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_317 = new IntToPtrInst(int32_316, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +ICmpInst* int1_318 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_316, const_int32_55, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_318, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); + +// Block GOTO or IF*.i.i.i (label_GOTO_or_IF__i_i_i) +std::vector ptr_320_params; +ptr_320_params.push_back(ptr_280); +ptr_320_params.push_back(int32_96); +ptr_320_params.push_back(const_int32_55); +ptr_320_params.push_back(const_int32_55); +CallInst* ptr_320 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_320_params.begin(), ptr_320_params.end(), "", label_GOTO_or_IF__i_i_i); +ptr_320->setCallingConv(CallingConv::C); +ptr_320->setTailCall(true); +AttrListPtr ptr_320_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_320_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_320->setAttributes(ptr_320_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i, label_GOTO_or_IF__i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i) +CastInst* ptr_322 = new IntToPtrInst(int32_316, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +LoadInst* ptr_323 = new LoadInst(ptr_322, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +CastInst* int32_324 = new PtrToIntInst(ptr_323, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(int32_324, ptr_315, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +std::vector ptr_326_indices; +ptr_326_indices.push_back(const_int32_55); +ptr_326_indices.push_back(const_int32_55); +Instruction* ptr_326 = GetElementPtrInst::Create(ptr_317, ptr_326_indices.begin(), ptr_326_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(const_ptr_77, ptr_326, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i) +PHINode* ptr__ph_i = PHINode::Create(PointerTy_28, ".ph.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +ptr__ph_i->reserveOperandSpace(2); +ptr__ph_i->addIncoming(ptr_320, label_GOTO_or_IF__i_i_i); +ptr__ph_i->addIncoming(ptr_317, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + +std::vector ptr_329_indices; +ptr_329_indices.push_back(const_int32_55); +ptr_329_indices.push_back(const_int32_55); +Instruction* ptr_329 = GetElementPtrInst::Create(ptr__ph_i, ptr_329_indices.begin(), ptr_329_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +CastInst* ptr__c6_i = new BitCastInst(ptr_VT, PointerTy_29, ".c6.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(ptr__c6_i, ptr_329, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +LoadInst* int8_storemerge_in_i_i1_i_i = new LoadInst(const_ptr_86, "storemerge.in.i.i1.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +std::vector ptr_331_indices; +ptr_331_indices.push_back(const_int32_55); +ptr_331_indices.push_back(const_int32_76); +Instruction* ptr_331 = GetElementPtrInst::Create(ptr__ph_i, ptr_331_indices.begin(), ptr_331_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +CastInst* ptr_332 = new BitCastInst(ptr_331, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(int8_storemerge_in_i_i1_i_i, ptr_332, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread9.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i) +PHINode* ptr__ph8_i = PHINode::Create(PointerTy_28, ".ph8.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +ptr__ph8_i->reserveOperandSpace(2); +ptr__ph8_i->addIncoming(ptr_144, label_false_IFNE_i_i_i_i); +ptr__ph8_i->addIncoming(ptr_147, label_GOTO_or_IF__i_i_i_i); + +std::vector ptr_335_indices; +ptr_335_indices.push_back(const_int32_55); +ptr_335_indices.push_back(const_int32_55); +Instruction* ptr_335 = GetElementPtrInst::Create(ptr__ph8_i, ptr_335_indices.begin(), ptr_335_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +CastInst* ptr__c10_i = new BitCastInst(ptr_VT, PointerTy_29, ".c10.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(ptr__c10_i, ptr_335, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +LoadInst* int8_storemerge_in_i_i_i_i = new LoadInst(const_ptr_87, "storemerge.in.i.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +std::vector ptr_337_indices; +ptr_337_indices.push_back(const_int32_55); +ptr_337_indices.push_back(const_int32_76); +Instruction* ptr_337 = GetElementPtrInst::Create(ptr__ph8_i, ptr_337_indices.begin(), ptr_337_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +CastInst* ptr_338 = new BitCastInst(ptr_337, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(int8_storemerge_in_i_i_i_i, ptr_338, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread13.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i) +PHINode* ptr__ph12_i = PHINode::Create(PointerTy_28, ".ph12.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +ptr__ph12_i->reserveOperandSpace(2); +ptr__ph12_i->addIncoming(ptr_173, label_false_IFEQ_i_i_i_i); +ptr__ph12_i->addIncoming(ptr_161, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); + +std::vector ptr_341_indices; +ptr_341_indices.push_back(const_int32_55); +ptr_341_indices.push_back(const_int32_55); +Instruction* ptr_341 = GetElementPtrInst::Create(ptr__ph12_i, ptr_341_indices.begin(), ptr_341_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +CastInst* ptr__c14_i = new BitCastInst(ptr_VT, PointerTy_29, ".c14.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(ptr__c14_i, ptr_341, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +std::vector ptr_343_indices; +ptr_343_indices.push_back(const_int32_55); +ptr_343_indices.push_back(const_int32_76); +Instruction* ptr_343 = GetElementPtrInst::Create(ptr__ph12_i, ptr_343_indices.begin(), ptr_343_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +CastInst* ptr_344 = new BitCastInst(ptr_343, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_345 = new LoadInst(ptr_344, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_346 = BinaryOperator::Create(Instruction::And, int8_345, const_int8_88, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_347 = new LoadInst(const_ptr_89, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_348 = BinaryOperator::Create(Instruction::Or, int8_346, int8_347, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(int8_348, ptr_344, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread17.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i) +PHINode* ptr__ph16_i = PHINode::Create(PointerTy_28, ".ph16.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +ptr__ph16_i->reserveOperandSpace(2); +ptr__ph16_i->addIncoming(ptr_239, label_false_IFNE_i21_i_i_i); +ptr__ph16_i->addIncoming(ptr_242, label_GOTO_or_IF__i17_i_i_i); + +std::vector ptr_351_indices; +ptr_351_indices.push_back(const_int32_55); +ptr_351_indices.push_back(const_int32_55); +Instruction* ptr_351 = GetElementPtrInst::Create(ptr__ph16_i, ptr_351_indices.begin(), ptr_351_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +CastInst* ptr__c18_i = new BitCastInst(ptr_VT, PointerTy_29, ".c18.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(ptr__c18_i, ptr_351, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +LoadInst* int8_storemerge_in_i2_i_i_i = new LoadInst(const_ptr_90, "storemerge.in.i2.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +std::vector ptr_353_indices; +ptr_353_indices.push_back(const_int32_55); +ptr_353_indices.push_back(const_int32_76); +Instruction* ptr_353 = GetElementPtrInst::Create(ptr__ph16_i, ptr_353_indices.begin(), ptr_353_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +CastInst* ptr_354 = new BitCastInst(ptr_353, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(int8_storemerge_in_i2_i_i_i, ptr_354, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i) +CallInst* void_357 = CallInst::Create(func_llvm_trap, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +void_357->setCallingConv(CallingConv::C); +void_357->setTailCall(true); +AttrListPtr void_357_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_357_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_357->setAttributes(void_357_PAL); + +new UnreachableInst(mod->getContext(), label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); + +// Block true IF*NULL.i1.i.i.i.i.i (label_true_IF_NULL_i1_i_i_i_i_i) +std::vector ptr_359_indices; +ptr_359_indices.push_back(const_int32_55); +ptr_359_indices.push_back(const_int32_55); +Instruction* ptr_359 = GetElementPtrInst::Create(ptr_193, ptr_359_indices.begin(), ptr_359_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(const_ptr_77, ptr_359, false, label_true_IF_NULL_i1_i_i_i_i_i); +GetElementPtrInst* ptr_361 = GetElementPtrInst::Create(ptr_195, const_int32_61, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_362 = new BitCastInst(ptr_361, PointerTy_27, "", label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_363 = new LoadInst(ptr_362, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_364 = new LoadInst(const_ptr_91, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* int32_365 = new PtrToIntInst(ptr_364, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i); +BinaryOperator* int32_366 = BinaryOperator::Create(Instruction::Add, int32_365, int32_192, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_367 = new IntToPtrInst(int32_366, PointerTy_27, "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(ptr_363, ptr_367, false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_369 = new LoadInst(ptr_362, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +ICmpInst* int1_370 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_369, const_ptr_92, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i, int1_370, label_true_IF_NULL_i1_i_i_i_i_i); + +// Block GOTO or IF*1.i3.i.i.i.i.i (label_GOTO_or_IF_1_i3_i_i_i_i_i) +CastInst* ptr_372 = new BitCastInst(ptr_361, PointerTy_33, "", label_GOTO_or_IF_1_i3_i_i_i_i_i); +CastInst* ptr__c1_i2_i_i_i_i_i = new IntToPtrInst(int32_192, PointerTy_29, ".c1.i2.i.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i_i); + new StoreInst(ptr__c1_i2_i_i_i_i_i, ptr_372, false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +LoadInst* ptr_374 = new LoadInst(ptr_197, "", false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +ICmpInst* int1_375 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_374, const_ptr_83, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i, int1_375, label_GOTO_or_IF_1_i3_i_i_i_i_i); + +// Block true IFNULL.i5.i.i.i.i.i (label_true_IFNULL_i5_i_i_i_i_i) +GetElementPtrInst* ptr_377 = GetElementPtrInst::Create(ptr_198, const_int32_61, "", label_true_IFNULL_i5_i_i_i_i_i); +CastInst* ptr_378 = new BitCastInst(ptr_377, PointerTy_25, "", label_true_IFNULL_i5_i_i_i_i_i); +BranchInst::Create(label_bb2_i_i22_i, label_true_IFNULL_i5_i_i_i_i_i); + +// Block bb.i.i20.i (label_bb_i_i20_i) +Argument* fwdref_381 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb1_i_i21_i, fwdref_381, label_bb_i_i20_i); + +// Block bb1.i.i21.i (label_bb1_i_i21_i) +Argument* fwdref_383 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_382 = BinaryOperator::Create(Instruction::Add, fwdref_383, const_int32_76, "", label_bb1_i_i21_i); +BranchInst::Create(label_bb2_i_i22_i, label_bb1_i_i21_i); + +// Block bb2.i.i22.i (label_bb2_i_i22_i) +PHINode* int32_385 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i22_i); +int32_385->reserveOperandSpace(2); +int32_385->addIncoming(const_int32_55, label_true_IFNULL_i5_i_i_i_i_i); +int32_385->addIncoming(int32_382, label_bb1_i_i21_i); + +ICmpInst* int1_386 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_ULT, int32_385, const_int32_93, ""); +std::vector void_387_params; +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +CallInst* void_387 = CallInst::Create(func_llvm_memory_barrier, void_387_params.begin(), void_387_params.end(), "", label_bb2_i_i22_i); +void_387->setCallingConv(CallingConv::C); +void_387->setTailCall(true); +AttrListPtr void_387_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_387_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_387->setAttributes(void_387_PAL); + +std::vector int32_388_params; +int32_388_params.push_back(ptr_378); +int32_388_params.push_back(const_int32_55); +int32_388_params.push_back(const_int32_76); +CallInst* int32_388 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_388_params.begin(), int32_388_params.end(), "", label_bb2_i_i22_i); +int32_388->setCallingConv(CallingConv::C); +int32_388->setTailCall(true); +AttrListPtr int32_388_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_388_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_388->setAttributes(int32_388_PAL); + +std::vector void_389_params; +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +CallInst* void_389 = CallInst::Create(func_llvm_memory_barrier, void_389_params.begin(), void_389_params.end(), "", label_bb2_i_i22_i); +void_389->setCallingConv(CallingConv::C); +void_389->setTailCall(true); +AttrListPtr void_389_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_389_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_389->setAttributes(void_389_PAL); + +ICmpInst* int1_390 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_EQ, int32_388, const_int32_55, ""); +BranchInst::Create(label_bb_i_i20_i, label_bb4_preheader_i_i23_i, int1_386, label_bb2_i_i22_i); + +// Block bb4.preheader.i.i23.i (label_bb4_preheader_i_i23_i) +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i24_i, int1_390, label_bb4_preheader_i_i23_i); + +// Block bb3.i.i24.i (label_bb3_i_i24_i) +CallInst* void_393 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i24_i); +void_393->setCallingConv(CallingConv::C); +void_393->setTailCall(true); +AttrListPtr void_393_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_393_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_393->setAttributes(void_393_PAL); + +std::vector void_394_params; +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +CallInst* void_394 = CallInst::Create(func_llvm_memory_barrier, void_394_params.begin(), void_394_params.end(), "", label_bb3_i_i24_i); +void_394->setCallingConv(CallingConv::C); +void_394->setTailCall(true); +AttrListPtr void_394_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_394_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_394->setAttributes(void_394_PAL); + +std::vector int32_395_params; +int32_395_params.push_back(ptr_378); +int32_395_params.push_back(const_int32_55); +int32_395_params.push_back(const_int32_76); +CallInst* int32_395 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_395_params.begin(), int32_395_params.end(), "", label_bb3_i_i24_i); +int32_395->setCallingConv(CallingConv::C); +int32_395->setTailCall(true); +AttrListPtr int32_395_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_395_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_395->setAttributes(int32_395_PAL); + +std::vector void_396_params; +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +CallInst* void_396 = CallInst::Create(func_llvm_memory_barrier, void_396_params.begin(), void_396_params.end(), "", label_bb3_i_i24_i); +void_396->setCallingConv(CallingConv::C); +void_396->setTailCall(true); +AttrListPtr void_396_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_396_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_396->setAttributes(void_396_PAL); + +ICmpInst* int1_397 = new ICmpInst(*label_bb3_i_i24_i, ICmpInst::ICMP_EQ, int32_395, const_int32_55, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i24_i, int1_397, label_bb3_i_i24_i); + +// Block false IFNE.i7.i.i.i.i.i (label_false_IFNE_i7_i_i_i_i_i) +std::vector ptr_399_indices; +ptr_399_indices.push_back(const_int32_55); +ptr_399_indices.push_back(const_int32_55); +Instruction* ptr_399 = GetElementPtrInst::Create(ptr_369, ptr_399_indices.begin(), ptr_399_indices.end(), "", label_false_IFNE_i7_i_i_i_i_i); +CastInst* ptr__c_i6_i_i_i_i_i = new IntToPtrInst(int32_192, PointerTy_29, ".c.i6.i.i.i.i.i", label_false_IFNE_i7_i_i_i_i_i); + new StoreInst(ptr__c_i6_i_i_i_i_i, ptr_399, false, label_false_IFNE_i7_i_i_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i); + +// Block true IFNULL3.i8.i.i.i.i.i (label_true_IFNULL3_i8_i_i_i_i_i) +GetElementPtrInst* ptr_402 = GetElementPtrInst::Create(ptr_374, const_int32_61, "", label_true_IFNULL3_i8_i_i_i_i_i); +CastInst* ptr_403 = new BitCastInst(ptr_402, PointerTy_25, "", label_true_IFNULL3_i8_i_i_i_i_i); + new StoreInst(const_int32_55, ptr_403, false, label_true_IFNULL3_i8_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i); + +// Block true IF*NULL.i1.i.i6.i.i.i (label_true_IF_NULL_i1_i_i6_i_i_i) +std::vector ptr_406_indices; +ptr_406_indices.push_back(const_int32_55); +ptr_406_indices.push_back(const_int32_55); +Instruction* ptr_406 = GetElementPtrInst::Create(ptr_269, ptr_406_indices.begin(), ptr_406_indices.end(), "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(const_ptr_77, ptr_406, false, label_true_IF_NULL_i1_i_i6_i_i_i); +GetElementPtrInst* ptr_408 = GetElementPtrInst::Create(ptr_271, const_int32_61, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_409 = new BitCastInst(ptr_408, PointerTy_27, "", label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_410 = new LoadInst(ptr_409, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_411 = new LoadInst(const_ptr_91, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* int32_412 = new PtrToIntInst(ptr_411, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i6_i_i_i); +BinaryOperator* int32_413 = BinaryOperator::Create(Instruction::Add, int32_412, int32_268, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_414 = new IntToPtrInst(int32_413, PointerTy_27, "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(ptr_410, ptr_414, false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_416 = new LoadInst(ptr_409, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +ICmpInst* int1_417 = new ICmpInst(*label_true_IF_NULL_i1_i_i6_i_i_i, ICmpInst::ICMP_EQ, ptr_416, const_ptr_92, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i8_i_i_i, label_false_IFNE_i7_i_i11_i_i_i, int1_417, label_true_IF_NULL_i1_i_i6_i_i_i); + +// Block GOTO or IF*1.i3.i.i8.i.i.i (label_GOTO_or_IF_1_i3_i_i8_i_i_i) +CastInst* ptr_419 = new BitCastInst(ptr_408, PointerTy_33, "", label_GOTO_or_IF_1_i3_i_i8_i_i_i); +CastInst* ptr__c1_i2_i_i7_i_i_i = new IntToPtrInst(int32_268, PointerTy_29, ".c1.i2.i.i7.i.i.i", label_GOTO_or_IF_1_i3_i_i8_i_i_i); + new StoreInst(ptr__c1_i2_i_i7_i_i_i, ptr_419, false, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +LoadInst* ptr_421 = new LoadInst(ptr_273, "", false, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +ICmpInst* int1_422 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i8_i_i_i, ICmpInst::ICMP_EQ, ptr_421, const_ptr_83, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i12_i_i_i, int1_422, label_GOTO_or_IF_1_i3_i_i8_i_i_i); + +// Block true IFNULL.i5.i.i9.i.i.i (label_true_IFNULL_i5_i_i9_i_i_i) +GetElementPtrInst* ptr_424 = GetElementPtrInst::Create(ptr_274, const_int32_61, "", label_true_IFNULL_i5_i_i9_i_i_i); +CastInst* ptr_425 = new BitCastInst(ptr_424, PointerTy_25, "", label_true_IFNULL_i5_i_i9_i_i_i); +BranchInst::Create(label_bb2_i_i_i, label_true_IFNULL_i5_i_i9_i_i_i); + +// Block bb.i.i.i (label_bb_i_i_i) +Argument* fwdref_428 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb1_i_i_i, fwdref_428, label_bb_i_i_i); + +// Block bb1.i.i.i (label_bb1_i_i_i) +Argument* fwdref_430 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_429 = BinaryOperator::Create(Instruction::Add, fwdref_430, const_int32_76, "", label_bb1_i_i_i); +BranchInst::Create(label_bb2_i_i_i, label_bb1_i_i_i); + +// Block bb2.i.i.i (label_bb2_i_i_i) +PHINode* int32_432 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); +int32_432->reserveOperandSpace(2); +int32_432->addIncoming(const_int32_55, label_true_IFNULL_i5_i_i9_i_i_i); +int32_432->addIncoming(int32_429, label_bb1_i_i_i); + +ICmpInst* int1_433 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_432, const_int32_93, ""); +std::vector void_434_params; +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +CallInst* void_434 = CallInst::Create(func_llvm_memory_barrier, void_434_params.begin(), void_434_params.end(), "", label_bb2_i_i_i); +void_434->setCallingConv(CallingConv::C); +void_434->setTailCall(true); +AttrListPtr void_434_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_434_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_434->setAttributes(void_434_PAL); + +std::vector int32_435_params; +int32_435_params.push_back(ptr_425); +int32_435_params.push_back(const_int32_55); +int32_435_params.push_back(const_int32_76); +CallInst* int32_435 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_435_params.begin(), int32_435_params.end(), "", label_bb2_i_i_i); +int32_435->setCallingConv(CallingConv::C); +int32_435->setTailCall(true); +AttrListPtr int32_435_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_435_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_435->setAttributes(int32_435_PAL); + +std::vector void_436_params; +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +CallInst* void_436 = CallInst::Create(func_llvm_memory_barrier, void_436_params.begin(), void_436_params.end(), "", label_bb2_i_i_i); +void_436->setCallingConv(CallingConv::C); +void_436->setTailCall(true); +AttrListPtr void_436_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_436_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_436->setAttributes(void_436_PAL); + +ICmpInst* int1_437 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_435, const_int32_55, ""); +BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_433, label_bb2_i_i_i); + +// Block bb4.preheader.i.i.i (label_bb4_preheader_i_i_i) +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb3_i_i_i, int1_437, label_bb4_preheader_i_i_i); + +// Block bb3.i.i.i (label_bb3_i_i_i) +CallInst* void_440 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); +void_440->setCallingConv(CallingConv::C); +void_440->setTailCall(true); +AttrListPtr void_440_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_440_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_440->setAttributes(void_440_PAL); + +std::vector void_441_params; +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +CallInst* void_441 = CallInst::Create(func_llvm_memory_barrier, void_441_params.begin(), void_441_params.end(), "", label_bb3_i_i_i); +void_441->setCallingConv(CallingConv::C); +void_441->setTailCall(true); +AttrListPtr void_441_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_441_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_441->setAttributes(void_441_PAL); + +std::vector int32_442_params; +int32_442_params.push_back(ptr_425); +int32_442_params.push_back(const_int32_55); +int32_442_params.push_back(const_int32_76); +CallInst* int32_442 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_442_params.begin(), int32_442_params.end(), "", label_bb3_i_i_i); +int32_442->setCallingConv(CallingConv::C); +int32_442->setTailCall(true); +AttrListPtr int32_442_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_442_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_442->setAttributes(int32_442_PAL); + +std::vector void_443_params; +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +CallInst* void_443 = CallInst::Create(func_llvm_memory_barrier, void_443_params.begin(), void_443_params.end(), "", label_bb3_i_i_i); +void_443->setCallingConv(CallingConv::C); +void_443->setTailCall(true); +AttrListPtr void_443_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_443_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_443->setAttributes(void_443_PAL); + +ICmpInst* int1_444 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_442, const_int32_55, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb3_i_i_i, int1_444, label_bb3_i_i_i); + +// Block false IFNE.i7.i.i11.i.i.i (label_false_IFNE_i7_i_i11_i_i_i) +std::vector ptr_446_indices; +ptr_446_indices.push_back(const_int32_55); +ptr_446_indices.push_back(const_int32_55); +Instruction* ptr_446 = GetElementPtrInst::Create(ptr_416, ptr_446_indices.begin(), ptr_446_indices.end(), "", label_false_IFNE_i7_i_i11_i_i_i); +CastInst* ptr__c_i6_i_i10_i_i_i = new IntToPtrInst(int32_268, PointerTy_29, ".c.i6.i.i10.i.i.i", label_false_IFNE_i7_i_i11_i_i_i); + new StoreInst(ptr__c_i6_i_i10_i_i_i, ptr_446, false, label_false_IFNE_i7_i_i11_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i8_i_i_i, label_false_IFNE_i7_i_i11_i_i_i); + +// Block true IFNULL3.i8.i.i12.i.i.i (label_true_IFNULL3_i8_i_i12_i_i_i) +GetElementPtrInst* ptr_449 = GetElementPtrInst::Create(ptr_421, const_int32_61, "", label_true_IFNULL3_i8_i_i12_i_i_i); +CastInst* ptr_450 = new BitCastInst(ptr_449, PointerTy_25, "", label_true_IFNULL3_i8_i_i12_i_i_i); + new StoreInst(const_int32_55, ptr_450, false, label_true_IFNULL3_i8_i_i12_i_i_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i12_i_i_i); + +// Block JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit (label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit) +PHINode* ptr_453 = PHINode::Create(PointerTy_28, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_453->reserveOperandSpace(8); +ptr_453->addIncoming(ptr_255, label_true_IFNULL3_i8_i_i12_i_i_i); +ptr_453->addIncoming(ptr__ph16_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +ptr_453->addIncoming(ptr_179, label_true_IFNULL3_i8_i_i_i_i_i); +ptr_453->addIncoming(ptr__ph12_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +ptr_453->addIncoming(ptr__ph8_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +ptr_453->addIncoming(ptr__ph_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +ptr_453->addIncoming(ptr_255, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +ptr_453->addIncoming(ptr_179, label_GOTO_or_IF_1_i3_i_i_i_i_i); + +CastInst* ptr_tmp1 = new BitCastInst(ptr_453, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ReturnInst::Create(mod->getContext(), ptr_tmp1, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr_tmp1 = new BitCastInst(ptr_12, PointerTy_0, "tmp1", label_entry); -ReturnInst::Create(mod->getContext(), ptr_tmp1, label_entry); +// Resolve Forward References +fwdref_383->replaceAllUsesWith(int32_385); delete fwdref_383; +fwdref_381->replaceAllUsesWith(int1_390); delete fwdref_381; +fwdref_430->replaceAllUsesWith(int32_432); delete fwdref_430; +fwdref_428->replaceAllUsesWith(int1_437); delete fwdref_428; return func_gcmalloc; } From nicolas.geoffray at lip6.fr Sun Oct 3 10:47:34 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 03 Oct 2010 17:47:34 -0000 Subject: [vmkit-commits] [vmkit] r115465 - /vmkit/branches/release_028/ Message-ID: <20101003174734.0D1D72A6C12E@llvm.org> Author: geoffray Date: Sun Oct 3 12:47:33 2010 New Revision: 115465 URL: http://llvm.org/viewvc/llvm-project?rev=115465&view=rev Log: Branch for new release 0.28. Added: vmkit/branches/release_028/ - copied from r115464, vmkit/trunk/ From nicolas.geoffray at lip6.fr Sun Oct 3 13:49:15 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 03 Oct 2010 20:49:15 -0000 Subject: [vmkit-commits] [vmkit] r115478 - in /vmkit/branches/release_028: autoconf/configure.ac configure lib/J3/Classpath/ClasspathVMSystemProperties.inc Message-ID: <20101003204915.D58E72A6C12E@llvm.org> Author: geoffray Date: Sun Oct 3 15:49:15 2010 New Revision: 115478 URL: http://llvm.org/viewvc/llvm-project?rev=115478&view=rev Log: Move to version 0.28. Modified: vmkit/branches/release_028/autoconf/configure.ac vmkit/branches/release_028/configure vmkit/branches/release_028/lib/J3/Classpath/ClasspathVMSystemProperties.inc Modified: vmkit/branches/release_028/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/autoconf/configure.ac?rev=115478&r1=115477&r2=115478&view=diff ============================================================================== --- vmkit/branches/release_028/autoconf/configure.ac (original) +++ vmkit/branches/release_028/autoconf/configure.ac Sun Oct 3 15:49:15 2010 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([vmkit],[0.28svn],[nicolas.geoffray at gmail.com]) +AC_INIT([vmkit],[0.28],[nicolas.geoffray at gmail.com]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. @@ -624,8 +624,6 @@ AC_CONFIG_FILES(Makefile.common) AC_CONFIG_FILES(Makefile.config) AC_CONFIG_FILES([lib/J3/Classpath/Classpath.h]) -AC_CONFIG_FILES([lib/N3/PNetLib/PNetPath.inc]) -AC_CONFIG_FILES([lib/N3/Mono/MonoPath.inc]) AC_CONFIG_FILES([tools/llcj/LinkPaths.h]) AC_CONFIG_FILES([mmtk/java/build.xml]) Modified: vmkit/branches/release_028/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/configure?rev=115478&r1=115477&r2=115478&view=diff ============================================================================== --- vmkit/branches/release_028/configure (original) +++ vmkit/branches/release_028/configure Sun Oct 3 15:49:15 2010 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for vmkit 0.28svn. +# Generated by GNU Autoconf 2.65 for vmkit 0.28. # # Report bugs to . # @@ -554,8 +554,8 @@ # Identity of this package. PACKAGE_NAME='vmkit' PACKAGE_TARNAME='vmkit' -PACKAGE_VERSION='0.28svn' -PACKAGE_STRING='vmkit 0.28svn' +PACKAGE_VERSION='0.28' +PACKAGE_STRING='vmkit 0.28' PACKAGE_BUGREPORT='nicolas.geoffray at gmail.com' PACKAGE_URL='' @@ -1289,7 +1289,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vmkit 0.28svn to adapt to many kinds of systems. +\`configure' configures vmkit 0.28 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1355,7 +1355,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vmkit 0.28svn:";; + short | recursive ) echo "Configuration of vmkit 0.28:";; esac cat <<\_ACEOF @@ -1470,7 +1470,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vmkit configure 0.28svn +vmkit configure 0.28 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1935,7 +1935,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vmkit $as_me 0.28svn, which was +It was created by vmkit $as_me 0.28, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -6131,10 +6131,6 @@ ac_config_files="$ac_config_files lib/J3/Classpath/Classpath.h" -ac_config_files="$ac_config_files lib/N3/PNetLib/PNetPath.inc" - -ac_config_files="$ac_config_files lib/N3/Mono/MonoPath.inc" - ac_config_files="$ac_config_files tools/llcj/LinkPaths.h" ac_config_files="$ac_config_files mmtk/java/build.xml" @@ -6653,7 +6649,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vmkit $as_me 0.28svn, which was +This file was extended by vmkit $as_me 0.28, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6719,7 +6715,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -vmkit config.status 0.28svn +vmkit config.status 0.28 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" @@ -6845,8 +6841,6 @@ "Makefile.common") CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; "lib/J3/Classpath/Classpath.h") CONFIG_FILES="$CONFIG_FILES lib/J3/Classpath/Classpath.h" ;; - "lib/N3/PNetLib/PNetPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/PNetLib/PNetPath.inc" ;; - "lib/N3/Mono/MonoPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/Mono/MonoPath.inc" ;; "tools/llcj/LinkPaths.h") CONFIG_FILES="$CONFIG_FILES tools/llcj/LinkPaths.h" ;; "mmtk/java/build.xml") CONFIG_FILES="$CONFIG_FILES mmtk/java/build.xml" ;; "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; Modified: vmkit/branches/release_028/lib/J3/Classpath/ClasspathVMSystemProperties.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/lib/J3/Classpath/ClasspathVMSystemProperties.inc?rev=115478&r1=115477&r2=115478&view=diff ============================================================================== --- vmkit/branches/release_028/lib/J3/Classpath/ClasspathVMSystemProperties.inc (original) +++ vmkit/branches/release_028/lib/J3/Classpath/ClasspathVMSystemProperties.inc Sun Oct 3 15:49:15 2010 @@ -92,7 +92,7 @@ setProperty(vm, prop, "java.class.path", vm->classpath); setProperty(vm, prop, "java.boot.class.path", JCL->bootClasspathEnv); setProperty(vm, prop, "sun.boot.class.path", JCL->bootClasspathEnv); - setProperty(vm, prop, "java.vm.version", "0.27"); + setProperty(vm, prop, "java.vm.version", "0.28"); setProperty(vm, prop, "java.vm.vendor", "The VMKit Project"); setProperty(vm, prop, "java.vm.name", "J3"); setProperty(vm, prop, "java.specification.version", "1.5"); From nicolas.geoffray at lip6.fr Sat Oct 9 16:23:51 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 09 Oct 2010 23:23:51 -0000 Subject: [vmkit-commits] [vmkit] r116159 - in /vmkit/branches/release_028: Makefile.rules lib/J3/VMCore/LinkJavaRuntime.h mmtk/java/Makefile mmtk/java/build.xml.in Message-ID: <20101009232351.70D602A6C12E@llvm.org> Author: geoffray Date: Sat Oct 9 18:23:51 2010 New Revision: 116159 URL: http://llvm.org/viewvc/llvm-project?rev=116159&view=rev Log: Fix build issues. Modified: vmkit/branches/release_028/Makefile.rules vmkit/branches/release_028/lib/J3/VMCore/LinkJavaRuntime.h vmkit/branches/release_028/mmtk/java/Makefile vmkit/branches/release_028/mmtk/java/build.xml.in Modified: vmkit/branches/release_028/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/Makefile.rules?rev=116159&r1=116158&r2=116159&view=diff ============================================================================== --- vmkit/branches/release_028/Makefile.rules (original) +++ vmkit/branches/release_028/Makefile.rules Sat Oct 9 18:23:51 2010 @@ -131,10 +131,10 @@ ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc all:: - $(Verb) $(ANT) -buildfile $(PROJ_SRC_ROOT)/mmtk/java/build.xml + $(Verb) $(ANT) -buildfile $(PROJ_OBJ_ROOT)/mmtk/java/build.xml $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) $(Verb) $(LOPT) -load=$(LibDir)/JITGCPass$(SHLIBEXT) -std-compile-opts -JITGCPass -f $(LibDir)/MMTKAlloc.bc -o $(LibDir)/MMTKAlloc.bc - $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(PROJ_SRC_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy + $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(PROJ_OBJ_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc Modified: vmkit/branches/release_028/lib/J3/VMCore/LinkJavaRuntime.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/lib/J3/VMCore/LinkJavaRuntime.h?rev=116159&r1=116158&r2=116159&view=diff ============================================================================== --- vmkit/branches/release_028/lib/J3/VMCore/LinkJavaRuntime.h (original) +++ vmkit/branches/release_028/lib/J3/VMCore/LinkJavaRuntime.h Sat Oct 9 18:23:51 2010 @@ -80,7 +80,7 @@ #endif -namespace { +namespace force_linker { struct ForceRuntimeLinking { ForceRuntimeLinking() { // We must reference the passes in such a way that compilers will not Modified: vmkit/branches/release_028/mmtk/java/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/mmtk/java/Makefile?rev=116159&r1=116158&r2=116159&view=diff ============================================================================== --- vmkit/branches/release_028/mmtk/java/Makefile (original) +++ vmkit/branches/release_028/mmtk/java/Makefile Sat Oct 9 18:23:51 2010 @@ -12,6 +12,6 @@ RUN_ANT = 1 JARNAME = mmtk-vmkit -EXTRA_DIST = vmkit.properties build.xml src +EXTRA_DIST = vmkit.properties build.xml.in src include $(LEVEL)/Makefile.common Modified: vmkit/branches/release_028/mmtk/java/build.xml.in URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/mmtk/java/build.xml.in?rev=116159&r1=116158&r2=116159&view=diff ============================================================================== --- vmkit/branches/release_028/mmtk/java/build.xml.in (original) +++ vmkit/branches/release_028/mmtk/java/build.xml.in Sat Oct 9 18:23:51 2010 @@ -1,7 +1,7 @@ - + From nicolas.geoffray at lip6.fr Sat Oct 9 16:26:19 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 09 Oct 2010 23:26:19 -0000 Subject: [vmkit-commits] [vmkit] r116160 - /vmkit/branches/release_028/lib/Mvm/Runtime/Object.cpp Message-ID: <20101009232619.CC2BE2A6C12E@llvm.org> Author: geoffray Date: Sat Oct 9 18:26:19 2010 New Revision: 116160 URL: http://llvm.org/viewvc/llvm-project?rev=116160&view=rev Log: Move the TRY statement out of the function to avoid clobbering variables. GCC gets really confused about it (but not llvm-gcc). Modified: vmkit/branches/release_028/lib/Mvm/Runtime/Object.cpp Modified: vmkit/branches/release_028/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/lib/Mvm/Runtime/Object.cpp?rev=116160&r1=116159&r2=116160&view=diff ============================================================================== --- vmkit/branches/release_028/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/branches/release_028/lib/Mvm/Runtime/Object.cpp Sat Oct 9 18:26:19 2010 @@ -61,6 +61,21 @@ typedef void (*destructor_t)(void*); +void invokeFinalize(mvm::Thread* th, gc* res) { + llvm_gcroot(res, 0); + TRY { + th->MyVM->invokeFinalizer(res); + } IGNORE; + th->clearException(); +} + +void invokeEnqueue(mvm::Thread* th, gc* res) { + llvm_gcroot(res, 0); + TRY { + th->MyVM->enqueueReference(res); + } IGNORE; + th->clearException(); +} void VirtualMachine::finalizerStart(mvm::Thread* th) { VirtualMachine* vm = th->MyVM; @@ -83,17 +98,14 @@ vm->FinalizationQueueLock.release(); if (!res) break; - TRY { - VirtualTable* VT = res->getVirtualTable(); - if (VT->operatorDelete) { - destructor_t dest = (destructor_t)VT->destructor; - dest(res); - } else { - vm->invokeFinalizer(res); - } - } IGNORE; + VirtualTable* VT = res->getVirtualTable(); + if (VT->operatorDelete) { + destructor_t dest = (destructor_t)VT->destructor; + dest(res); + } else { + invokeFinalize(th, res); + } res = 0; - th->clearException(); } } } @@ -119,11 +131,8 @@ vm->ToEnqueueLock.release(); if (!res) break; - TRY { - vm->enqueueReference(res); - } IGNORE; + invokeEnqueue(th, res); res = 0; - th->clearException(); } } } From nicolas.geoffray at lip6.fr Tue Oct 12 02:47:52 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 12 Oct 2010 09:47:52 -0000 Subject: [vmkit-commits] [vmkit] r116298 - /vmkit/branches/release_028/include/mvm/VirtualMachine.h Message-ID: <20101012094752.DF8622A6C12E@llvm.org> Author: geoffray Date: Tue Oct 12 04:47:52 2010 New Revision: 116298 URL: http://llvm.org/viewvc/llvm-project?rev=116298&view=rev Log: Forgot to commit this file from last commit. Modified: vmkit/branches/release_028/include/mvm/VirtualMachine.h Modified: vmkit/branches/release_028/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/include/mvm/VirtualMachine.h?rev=116298&r1=116297&r2=116298&view=diff ============================================================================== --- vmkit/branches/release_028/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/release_028/include/mvm/VirtualMachine.h Tue Oct 12 04:47:52 2010 @@ -400,14 +400,17 @@ ToEnqueue[ToEnqueueIndex++] = obj; } -protected: +public: /// invokeFinalizer - Invoke the finalizer of the object. This may involve /// changing the environment, e.g. going to native to Java. /// virtual void invokeFinalizer(gc*) {} - - -public: + + /// enqueueReference - Calls the enqueue method. Should be overriden + /// by the VM. + /// + virtual bool enqueueReference(gc*) { return false; } + /// finalizerStart - The start function of a finalizer. Will poll the /// finalizationQueue. /// @@ -505,12 +508,6 @@ /// by the VM. virtual void setReferent(gc* reference, gc* referent) { } - /// enqueueReference - Calls the enqueue method. Should be overriden - /// by the VM. - /// - virtual bool enqueueReference(gc*) { return false; } - - public: /// scanner - Scanner of threads' stacks. From nicolas.geoffray at lip6.fr Tue Oct 12 06:28:08 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 12 Oct 2010 13:28:08 -0000 Subject: [vmkit-commits] [vmkit] r116299 - /vmkit/branches/release_028/www/releases/vmkit-0.28.tar.bz2 Message-ID: <20101012132808.EE7022A6C12C@llvm.org> Author: geoffray Date: Tue Oct 12 08:28:08 2010 New Revision: 116299 URL: http://llvm.org/viewvc/llvm-project?rev=116299&view=rev Log: Add VMKit 0.28 release. Added: vmkit/branches/release_028/www/releases/vmkit-0.28.tar.bz2 (with props) Added: vmkit/branches/release_028/www/releases/vmkit-0.28.tar.bz2 URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_028/www/releases/vmkit-0.28.tar.bz2?rev=116299&view=auto ============================================================================== Binary file - no diff available. Propchange: vmkit/branches/release_028/www/releases/vmkit-0.28.tar.bz2 ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream From nicolas.geoffray at lip6.fr Tue Oct 12 08:34:50 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 12 Oct 2010 15:34:50 -0000 Subject: [vmkit-commits] [vmkit] r116307 - in /vmkit/trunk: ./ Makefile.rules autoconf/configure.ac configure include/mvm/VirtualMachine.h lib/J3/Classpath/ClasspathVMSystemProperties.inc lib/J3/VMCore/LinkJavaRuntime.h lib/Mvm/Runtime/Object.cpp mmtk/java/Makefile mmtk/java/build.xml.in Message-ID: <20101012153450.456202A6C12C@llvm.org> Author: geoffray Date: Tue Oct 12 10:34:50 2010 New Revision: 116307 URL: http://llvm.org/viewvc/llvm-project?rev=116307&view=rev Log: Merge with release 0.28 changes. Modified: vmkit/trunk/ (props changed) vmkit/trunk/Makefile.rules vmkit/trunk/autoconf/configure.ac vmkit/trunk/configure vmkit/trunk/include/mvm/VirtualMachine.h vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h vmkit/trunk/lib/Mvm/Runtime/Object.cpp vmkit/trunk/mmtk/java/Makefile vmkit/trunk/mmtk/java/build.xml.in Propchange: vmkit/trunk/ ------------------------------------------------------------------------------ svn:mergeinfo = /vmkit/branches/release_028:115466-116298 Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Oct 12 10:34:50 2010 @@ -131,10 +131,10 @@ ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc all:: - $(Verb) $(ANT) -buildfile $(PROJ_SRC_ROOT)/mmtk/java/build.xml + $(Verb) $(ANT) -buildfile $(PROJ_OBJ_ROOT)/mmtk/java/build.xml $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) $(Verb) $(LOPT) -load=$(LibDir)/JITGCPass$(SHLIBEXT) -std-compile-opts -JITGCPass -f $(LibDir)/MMTKAlloc.bc -o $(LibDir)/MMTKAlloc.bc - $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(PROJ_SRC_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy + $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(PROJ_OBJ_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Oct 12 10:34:50 2010 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([vmkit],[0.28svn],[nicolas.geoffray at gmail.com]) +AC_INIT([vmkit],[0.29svn],[nicolas.geoffray at gmail.com]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. @@ -624,8 +624,6 @@ AC_CONFIG_FILES(Makefile.common) AC_CONFIG_FILES(Makefile.config) AC_CONFIG_FILES([lib/J3/Classpath/Classpath.h]) -AC_CONFIG_FILES([lib/N3/PNetLib/PNetPath.inc]) -AC_CONFIG_FILES([lib/N3/Mono/MonoPath.inc]) AC_CONFIG_FILES([tools/llcj/LinkPaths.h]) AC_CONFIG_FILES([mmtk/java/build.xml]) Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Tue Oct 12 10:34:50 2010 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for vmkit 0.28svn. +# Generated by GNU Autoconf 2.65 for vmkit 0.29svn. # # Report bugs to . # @@ -554,8 +554,8 @@ # Identity of this package. PACKAGE_NAME='vmkit' PACKAGE_TARNAME='vmkit' -PACKAGE_VERSION='0.28svn' -PACKAGE_STRING='vmkit 0.28svn' +PACKAGE_VERSION='0.29svn' +PACKAGE_STRING='vmkit 0.29svn' PACKAGE_BUGREPORT='nicolas.geoffray at gmail.com' PACKAGE_URL='' @@ -1289,7 +1289,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vmkit 0.28svn to adapt to many kinds of systems. +\`configure' configures vmkit 0.29svn to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1355,7 +1355,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vmkit 0.28svn:";; + short | recursive ) echo "Configuration of vmkit 0.29svn:";; esac cat <<\_ACEOF @@ -1470,7 +1470,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vmkit configure 0.28svn +vmkit configure 0.29svn generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1935,7 +1935,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vmkit $as_me 0.28svn, which was +It was created by vmkit $as_me 0.29svn, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -6131,10 +6131,6 @@ ac_config_files="$ac_config_files lib/J3/Classpath/Classpath.h" -ac_config_files="$ac_config_files lib/N3/PNetLib/PNetPath.inc" - -ac_config_files="$ac_config_files lib/N3/Mono/MonoPath.inc" - ac_config_files="$ac_config_files tools/llcj/LinkPaths.h" ac_config_files="$ac_config_files mmtk/java/build.xml" @@ -6653,7 +6649,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vmkit $as_me 0.28svn, which was +This file was extended by vmkit $as_me 0.29svn, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6719,7 +6715,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -vmkit config.status 0.28svn +vmkit config.status 0.29svn configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" @@ -6845,8 +6841,6 @@ "Makefile.common") CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; "lib/J3/Classpath/Classpath.h") CONFIG_FILES="$CONFIG_FILES lib/J3/Classpath/Classpath.h" ;; - "lib/N3/PNetLib/PNetPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/PNetLib/PNetPath.inc" ;; - "lib/N3/Mono/MonoPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/Mono/MonoPath.inc" ;; "tools/llcj/LinkPaths.h") CONFIG_FILES="$CONFIG_FILES tools/llcj/LinkPaths.h" ;; "mmtk/java/build.xml") CONFIG_FILES="$CONFIG_FILES mmtk/java/build.xml" ;; "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; Modified: vmkit/trunk/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/VirtualMachine.h?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/include/mvm/VirtualMachine.h (original) +++ vmkit/trunk/include/mvm/VirtualMachine.h Tue Oct 12 10:34:50 2010 @@ -400,14 +400,17 @@ ToEnqueue[ToEnqueueIndex++] = obj; } -protected: +public: /// invokeFinalizer - Invoke the finalizer of the object. This may involve /// changing the environment, e.g. going to native to Java. /// virtual void invokeFinalizer(gc*) {} - - -public: + + /// enqueueReference - Calls the enqueue method. Should be overriden + /// by the VM. + /// + virtual bool enqueueReference(gc*) { return false; } + /// finalizerStart - The start function of a finalizer. Will poll the /// finalizationQueue. /// @@ -505,12 +508,6 @@ /// by the VM. virtual void setReferent(gc* reference, gc* referent) { } - /// enqueueReference - Calls the enqueue method. Should be overriden - /// by the VM. - /// - virtual bool enqueueReference(gc*) { return false; } - - public: /// scanner - Scanner of threads' stacks. Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc Tue Oct 12 10:34:50 2010 @@ -92,7 +92,7 @@ setProperty(vm, prop, "java.class.path", vm->classpath); setProperty(vm, prop, "java.boot.class.path", JCL->bootClasspathEnv); setProperty(vm, prop, "sun.boot.class.path", JCL->bootClasspathEnv); - setProperty(vm, prop, "java.vm.version", "0.27"); + setProperty(vm, prop, "java.vm.version", "0.28"); setProperty(vm, prop, "java.vm.vendor", "The VMKit Project"); setProperty(vm, prop, "java.vm.name", "J3"); setProperty(vm, prop, "java.specification.version", "1.5"); Modified: vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h (original) +++ vmkit/trunk/lib/J3/VMCore/LinkJavaRuntime.h Tue Oct 12 10:34:50 2010 @@ -80,7 +80,7 @@ #endif -namespace { +namespace force_linker { struct ForceRuntimeLinking { ForceRuntimeLinking() { // We must reference the passes in such a way that compilers will not Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Tue Oct 12 10:34:50 2010 @@ -61,6 +61,21 @@ typedef void (*destructor_t)(void*); +void invokeFinalize(mvm::Thread* th, gc* res) { + llvm_gcroot(res, 0); + TRY { + th->MyVM->invokeFinalizer(res); + } IGNORE; + th->clearException(); +} + +void invokeEnqueue(mvm::Thread* th, gc* res) { + llvm_gcroot(res, 0); + TRY { + th->MyVM->enqueueReference(res); + } IGNORE; + th->clearException(); +} void VirtualMachine::finalizerStart(mvm::Thread* th) { VirtualMachine* vm = th->MyVM; @@ -83,17 +98,14 @@ vm->FinalizationQueueLock.release(); if (!res) break; - TRY { - VirtualTable* VT = res->getVirtualTable(); - if (VT->operatorDelete) { - destructor_t dest = (destructor_t)VT->destructor; - dest(res); - } else { - vm->invokeFinalizer(res); - } - } IGNORE; + VirtualTable* VT = res->getVirtualTable(); + if (VT->operatorDelete) { + destructor_t dest = (destructor_t)VT->destructor; + dest(res); + } else { + invokeFinalize(th, res); + } res = 0; - th->clearException(); } } } @@ -119,11 +131,8 @@ vm->ToEnqueueLock.release(); if (!res) break; - TRY { - vm->enqueueReference(res); - } IGNORE; + invokeEnqueue(th, res); res = 0; - th->clearException(); } } } Modified: vmkit/trunk/mmtk/java/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/Makefile?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/Makefile (original) +++ vmkit/trunk/mmtk/java/Makefile Tue Oct 12 10:34:50 2010 @@ -12,6 +12,6 @@ RUN_ANT = 1 JARNAME = mmtk-vmkit -EXTRA_DIST = vmkit.properties build.xml src +EXTRA_DIST = vmkit.properties build.xml.in src include $(LEVEL)/Makefile.common Modified: vmkit/trunk/mmtk/java/build.xml.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/build.xml.in?rev=116307&r1=116306&r2=116307&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/build.xml.in (original) +++ vmkit/trunk/mmtk/java/build.xml.in Tue Oct 12 10:34:50 2010 @@ -1,7 +1,7 @@ - + From nicolas.geoffray at lip6.fr Tue Oct 12 08:37:57 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 12 Oct 2010 15:37:57 -0000 Subject: [vmkit-commits] [vmkit] r116308 - in /vmkit/branches/precise: ./ autoconf/ include/mvm/ lib/J3/Classpath/ lib/J3/Compiler/ lib/J3/VMCore/ lib/Mvm/Runtime/ mmtk/config/marksweep/ mmtk/java/ Message-ID: <20101012153757.976AA2A6C12C@llvm.org> Author: geoffray Date: Tue Oct 12 10:37:57 2010 New Revision: 116308 URL: http://llvm.org/viewvc/llvm-project?rev=116308&view=rev Log: Merge with trunk. Modified: vmkit/branches/precise/ (props changed) vmkit/branches/precise/Makefile.rules vmkit/branches/precise/autoconf/configure.ac vmkit/branches/precise/configure vmkit/branches/precise/include/mvm/VirtualMachine.h vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystemProperties.inc vmkit/branches/precise/lib/J3/Compiler/ExceptionsCheck.inc vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h vmkit/branches/precise/lib/J3/Compiler/JavaJITOpcodes.cpp vmkit/branches/precise/lib/J3/Compiler/LowerConstantCalls.cpp vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp vmkit/branches/precise/lib/J3/VMCore/JavaClass.h vmkit/branches/precise/lib/J3/VMCore/Jni.cpp vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h vmkit/branches/precise/lib/J3/VMCore/LinkJavaRuntime.h vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc vmkit/branches/precise/mmtk/java/Makefile vmkit/branches/precise/mmtk/java/build.xml.in Propchange: vmkit/branches/precise/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Oct 12 10:37:57 2010 @@ -1 +1,2 @@ -/vmkit/trunk:112509-114734 +/vmkit/branches/release_028:115466-116298 +/vmkit/trunk:112509-114734,114741-116307 Modified: vmkit/branches/precise/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/Makefile.rules?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/Makefile.rules (original) +++ vmkit/branches/precise/Makefile.rules Tue Oct 12 10:37:57 2010 @@ -131,10 +131,10 @@ ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc all:: - $(Verb) $(ANT) -buildfile $(PROJ_SRC_ROOT)/mmtk/java/build.xml + $(Verb) $(ANT) -buildfile $(PROJ_OBJ_ROOT)/mmtk/java/build.xml $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) $(Verb) $(LOPT) -load=$(LibDir)/JITGCPass$(SHLIBEXT) -std-compile-opts -JITGCPass -f $(LibDir)/MMTKAlloc.bc -o $(LibDir)/MMTKAlloc.bc - $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(PROJ_SRC_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy + $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(PROJ_OBJ_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc Modified: vmkit/branches/precise/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/autoconf/configure.ac?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/autoconf/configure.ac (original) +++ vmkit/branches/precise/autoconf/configure.ac Tue Oct 12 10:37:57 2010 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([vmkit],[0.28svn],[nicolas.geoffray at gmail.com]) +AC_INIT([vmkit],[0.29svn],[nicolas.geoffray at gmail.com]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. @@ -624,8 +624,6 @@ AC_CONFIG_FILES(Makefile.common) AC_CONFIG_FILES(Makefile.config) AC_CONFIG_FILES([lib/J3/Classpath/Classpath.h]) -AC_CONFIG_FILES([lib/N3/PNetLib/PNetPath.inc]) -AC_CONFIG_FILES([lib/N3/Mono/MonoPath.inc]) AC_CONFIG_FILES([tools/llcj/LinkPaths.h]) AC_CONFIG_FILES([mmtk/java/build.xml]) Modified: vmkit/branches/precise/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/configure?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/configure (original) +++ vmkit/branches/precise/configure Tue Oct 12 10:37:57 2010 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for vmkit 0.28svn. +# Generated by GNU Autoconf 2.65 for vmkit 0.29svn. # # Report bugs to . # @@ -554,8 +554,8 @@ # Identity of this package. PACKAGE_NAME='vmkit' PACKAGE_TARNAME='vmkit' -PACKAGE_VERSION='0.28svn' -PACKAGE_STRING='vmkit 0.28svn' +PACKAGE_VERSION='0.29svn' +PACKAGE_STRING='vmkit 0.29svn' PACKAGE_BUGREPORT='nicolas.geoffray at gmail.com' PACKAGE_URL='' @@ -1289,7 +1289,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vmkit 0.28svn to adapt to many kinds of systems. +\`configure' configures vmkit 0.29svn to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1355,7 +1355,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vmkit 0.28svn:";; + short | recursive ) echo "Configuration of vmkit 0.29svn:";; esac cat <<\_ACEOF @@ -1470,7 +1470,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vmkit configure 0.28svn +vmkit configure 0.29svn generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1935,7 +1935,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vmkit $as_me 0.28svn, which was +It was created by vmkit $as_me 0.29svn, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -6131,10 +6131,6 @@ ac_config_files="$ac_config_files lib/J3/Classpath/Classpath.h" -ac_config_files="$ac_config_files lib/N3/PNetLib/PNetPath.inc" - -ac_config_files="$ac_config_files lib/N3/Mono/MonoPath.inc" - ac_config_files="$ac_config_files tools/llcj/LinkPaths.h" ac_config_files="$ac_config_files mmtk/java/build.xml" @@ -6653,7 +6649,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vmkit $as_me 0.28svn, which was +This file was extended by vmkit $as_me 0.29svn, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6719,7 +6715,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -vmkit config.status 0.28svn +vmkit config.status 0.29svn configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" @@ -6845,8 +6841,6 @@ "Makefile.common") CONFIG_FILES="$CONFIG_FILES Makefile.common" ;; "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; "lib/J3/Classpath/Classpath.h") CONFIG_FILES="$CONFIG_FILES lib/J3/Classpath/Classpath.h" ;; - "lib/N3/PNetLib/PNetPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/PNetLib/PNetPath.inc" ;; - "lib/N3/Mono/MonoPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/Mono/MonoPath.inc" ;; "tools/llcj/LinkPaths.h") CONFIG_FILES="$CONFIG_FILES tools/llcj/LinkPaths.h" ;; "mmtk/java/build.xml") CONFIG_FILES="$CONFIG_FILES mmtk/java/build.xml" ;; "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/VirtualMachine.h?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/precise/include/mvm/VirtualMachine.h Tue Oct 12 10:37:57 2010 @@ -336,14 +336,17 @@ ToEnqueue[ToEnqueueIndex++] = obj; } -protected: +public: /// invokeFinalizer - Invoke the finalizer of the object. This may involve /// changing the environment, e.g. going to native to Java. /// virtual void invokeFinalizer(gc*) {} - - -public: + + /// enqueueReference - Calls the enqueue method. Should be overriden + /// by the VM. + /// + virtual bool enqueueReference(gc*) { return false; } + /// finalizerStart - The start function of a finalizer. Will poll the /// finalizationQueue. /// @@ -441,12 +444,6 @@ /// by the VM. virtual void setReferent(gc* reference, gc* referent) { } - /// enqueueReference - Calls the enqueue method. Should be overriden - /// by the VM. - /// - virtual bool enqueueReference(gc*) { return false; } - - public: /// scanner - Scanner of threads' stacks. Modified: vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystemProperties.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystemProperties.inc?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystemProperties.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystemProperties.inc Tue Oct 12 10:37:57 2010 @@ -92,7 +92,7 @@ setProperty(vm, prop, "java.class.path", vm->classpath); setProperty(vm, prop, "java.boot.class.path", JCL->bootClasspathEnv); setProperty(vm, prop, "sun.boot.class.path", JCL->bootClasspathEnv); - setProperty(vm, prop, "java.vm.version", "0.27"); + setProperty(vm, prop, "java.vm.version", "0.28"); setProperty(vm, prop, "java.vm.vendor", "The VMKit Project"); setProperty(vm, prop, "java.vm.name", "J3"); setProperty(vm, prop, "java.specification.version", "1.5"); Modified: vmkit/branches/precise/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/ExceptionsCheck.inc?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/branches/precise/lib/J3/Compiler/ExceptionsCheck.inc Tue Oct 12 10:37:57 2010 @@ -34,7 +34,7 @@ // Make the load volatile to force the instruction after the call. // Otherwise, LLVM will merge the load with a previous load because // the function is readnone. - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); @@ -86,7 +86,7 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); @@ -139,7 +139,7 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); @@ -189,7 +189,7 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", true, currentBlock); + obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); test = new BitCastInst(res, intrinsics->JavaObjectType, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test, obj, ""); Value* T = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); Modified: vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Oct 12 10:37:57 2010 @@ -177,9 +177,11 @@ const llvm::Type* Ty = LCI->getVirtualType(); Module& Mod = *getLLVMModule(); + const char* name = JavaString::strToAsciiz(str); GlobalVariable* varGV = new GlobalVariable(Mod, Ty->getContainedType(0), false, - GlobalValue::InternalLinkage, 0, ""); + GlobalValue::ExternalLinkage, 0, "str"); + delete[] name; Constant* res = ConstantExpr::getCast(Instruction::BitCast, varGV, JavaIntrinsics.JavaObjectType); strings.insert(std::make_pair(str, res)); @@ -1917,16 +1919,11 @@ char* name = file->filename; uint32 size = strlen(name); if (size > 6 && !strcmp(&(name[size - 6]), ".class")) { - UserClassArray* array = bootstrapLoader->upcalls->ArrayOfByte; - ArrayUInt8* res = - (ArrayUInt8*)array->doNew(file->ucsize, JavaThread::get()->getJVM()); - int ok = archive.readFile(res, file); - if (!ok) return; - memcpy(realName, name, size); realName[size - 6] = 0; const UTF8* utf8 = bootstrapLoader->asciizConstructUTF8(realName); - Class* cl = bootstrapLoader->constructClass(utf8, res); + Class* cl = bootstrapLoader->loadName(utf8, true, false, NULL); + assert(cl && "Class not created"); if (cl == ClassArray::SuperArray) M->compileRT = true; classes.push_back(cl); } else if (size > 4 && (!strcmp(&name[size - 4], ".jar") || @@ -1953,6 +1950,12 @@ JavaJITCompiler* Comp = 0; mvm::ThreadAllocator allocator; bootstrapLoader->analyseClasspathEnv(vm->bootstrapLoader->bootClasspathEnv); + uint32 size = strlen(name); + if (size > 4 && + (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { + bootstrapLoader->analyseClasspathEnv(name); + } + if (!M->clinits->empty()) { Comp = JavaJITCompiler::CreateCompiler("JIT"); Comp->EmitFunctionName = true; @@ -1963,7 +1966,6 @@ bootstrapLoader->upcalls->initialiseClasspath(bootstrapLoader); } - uint32 size = strlen(name); if (size > 4 && (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { Modified: vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp Tue Oct 12 10:37:57 2010 @@ -204,7 +204,8 @@ Args.push_back(GV); Value* targetObject = getTarget(virtualType->param_end(), signature->nbArguments + 1); - Args.push_back(new LoadInst(targetObject, "", true, currentBlock)); + Args.push_back(new LoadInst( + targetObject, "", TheCompiler->useCooperativeGC(), currentBlock)); load = invoke(intrinsics->VirtualLookupFunction, Args, "", currentBlock); node->addIncoming(load, currentBlock); BranchInst::Create(endResolveVirtual, currentBlock); @@ -514,7 +515,8 @@ BranchInst::Create(endBlock, loadBlock, cmp, currentBlock); currentBlock = loadBlock; - result = new LoadInst(result, "", true, currentBlock); + result = new LoadInst( + result, "", TheCompiler->useCooperativeGC(), currentBlock); new StoreInst(result, ResultObject, "", currentBlock); endNode->addIncoming(result, currentBlock); @@ -670,7 +672,8 @@ Value* obj = 0; if (isVirtual(compilingMethod->access)) { assert(thisObject != NULL && "beginSynchronize without this"); - obj = new LoadInst(thisObject, "", true, currentBlock); + obj = new LoadInst( + thisObject, "", TheCompiler->useCooperativeGC(), currentBlock); } else { obj = TheCompiler->getJavaClassPtr(compilingClass); obj = new LoadInst(obj, "", false, currentBlock); @@ -682,7 +685,8 @@ Value* obj = 0; if (isVirtual(compilingMethod->access)) { assert(thisObject != NULL && "endSynchronize without this"); - obj = new LoadInst(thisObject, "", true, currentBlock); + obj = new LoadInst( + thisObject, "", TheCompiler->useCooperativeGC(), currentBlock); } else { obj = TheCompiler->getJavaClassPtr(compilingClass); obj = new LoadInst(obj, "", false, currentBlock); @@ -1245,7 +1249,8 @@ } else { if (returnType != Type::getVoidTy(*llvmContext)) { if (returnValue != NULL) { - Value* obj = new LoadInst(returnValue, "", true, currentBlock); + Value* obj = new LoadInst( + returnValue, "", TheCompiler->useCooperativeGC(), currentBlock); ReturnInst::Create(*llvmContext, obj, currentBlock); } else { ReturnInst::Create(*llvmContext, endNode, currentBlock); @@ -1294,7 +1299,7 @@ const UTF8* name = compilingClass->ctpInfo->UTF8At(AR.AnnotationNameIndex); if (name->equals(TheCompiler->InlinePragma)) { - llvmFunction->addFnAttr(Attribute::NoInline); + llvmFunction->addFnAttr(Attribute::AlwaysInline); } else if (name->equals(TheCompiler->NoInlinePragma)) { llvmFunction->addFnAttr(Attribute::NoInline); } @@ -1951,7 +1956,8 @@ currentBlock); #endif } else { - object = new LoadInst(object, "", true, currentBlock); + object = new LoadInst( + object, "", TheCompiler->useCooperativeGC(), currentBlock); JITVerifyNull(object); type = LCI->getVirtualType(); } @@ -1980,7 +1986,8 @@ Value* ptr = getConstantPoolAt(index, func, returnType, 0, true); if (!stat) { - object = new LoadInst(object, "", true, currentBlock); + object = new LoadInst( + object, "", TheCompiler->useCooperativeGC(), currentBlock); Value* tmp = new BitCastInst(object, Pty, "", currentBlock); Value* args[2] = { zero, ptr }; ptr = GetElementPtrInst::Create(tmp, args, args + 2, "", currentBlock); Modified: vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h Tue Oct 12 10:37:57 2010 @@ -297,8 +297,8 @@ return new llvm::LoadInst(longStack[currentStackIndex - 1], "", false, currentBlock); } else { - return new llvm::LoadInst(objectStack[currentStackIndex - 1], "", true, - currentBlock); + return new llvm::LoadInst(objectStack[currentStackIndex - 1], "", + TheCompiler->useCooperativeGC(), currentBlock); } } Modified: vmkit/branches/precise/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJITOpcodes.cpp Tue Oct 12 10:37:57 2010 @@ -290,8 +290,8 @@ break; case ALOAD : - push(new LoadInst(objectLocals[WREAD_U1(reader, false, i, wide)], "", true, - currentBlock), false); + push(new LoadInst(objectLocals[WREAD_U1(reader, false, i, wide)], "", + TheCompiler->useCooperativeGC(), currentBlock), false); break; case ILOAD_0 : @@ -379,22 +379,22 @@ break; case ALOAD_0 : - push(new LoadInst(objectLocals[0], "", true, currentBlock), + push(new LoadInst(objectLocals[0], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; case ALOAD_1 : - push(new LoadInst(objectLocals[1], "", true, currentBlock), + push(new LoadInst(objectLocals[1], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; case ALOAD_2 : - push(new LoadInst(objectLocals[2], "", true, currentBlock), + push(new LoadInst(objectLocals[2], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; case ALOAD_3 : - push(new LoadInst(objectLocals[3], "", true, currentBlock), + push(new LoadInst(objectLocals[3], "", TheCompiler->useCooperativeGC(), currentBlock), false); break; @@ -681,9 +681,11 @@ // may go into runtime and we don't want values in registers at that // point. Value* val = new LoadInst(objectStack[currentStackIndex - 1], "", - true, currentBlock); + TheCompiler->useCooperativeGC(), + currentBlock); Value* obj = new LoadInst(objectStack[currentStackIndex - 3], "", - true, currentBlock); + TheCompiler->useCooperativeGC(), + currentBlock); Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, val, intrinsics->JavaObjectNullConstant, ""); @@ -1862,7 +1864,8 @@ case RET : { uint8 local = reader.readU1(); i += 1; - Value* _val = new LoadInst(objectLocals[local], "", true, currentBlock); + Value* _val = new LoadInst( + objectLocals[local], "", TheCompiler->useCooperativeGC(), currentBlock); Value* val = new PtrToIntInst(_val, Type::getInt32Ty(*llvmContext), "", currentBlock); SwitchInst* inst = SwitchInst::Create(val, jsrs[0], jsrs.size(), currentBlock); Modified: vmkit/branches/precise/lib/J3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/LowerConstantCalls.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/LowerConstantCalls.cpp Tue Oct 12 10:37:57 2010 @@ -210,7 +210,11 @@ if (LoadInst* LI = dyn_cast(I)) { if (LI->getType() == intrinsics->JavaObjectType && dyn_cast(LI->getPointerOperand()) != NULL) { - assert(LI->isVolatile()); + if (TheCompiler->useCooperativeGC()) { + assert(LI->isVolatile()); + } else { + assert(!LI->isVolatile()); + } } } Modified: vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp Tue Oct 12 10:37:57 2010 @@ -464,7 +464,8 @@ llvm_gcroot(res, 0); assert(this && "No class when allocating."); assert((this->isInitializing() || - classLoader->getCompiler()->isStaticCompiling()) + classLoader->getCompiler()->isStaticCompiling() || + this == classLoader->bootstrapLoader->upcalls->newClass) && "Uninitialized class when allocating."); assert(getVirtualVT() && "No VT\n"); res = (JavaObject*)gc::operator new(getVirtualSize(), getVirtualVT()); @@ -692,19 +693,6 @@ } -void UserClass::loadParents() { - if (super == 0) { - virtualTableSize = JavaVirtualTable::getFirstJavaMethodIndex(); - } else { - super->resolveClass(); - virtualTableSize = super->virtualTableSize; - } - - for (unsigned i = 0; i < nbInterfaces; i++) - interfaces[i]->resolveClass(); -} - - void internalLoadExceptions(JavaMethod& meth) { Attribut* codeAtt = meth.lookupAttribut(Attribut::codeAttribut); @@ -729,7 +717,7 @@ reader.readU2(); uint16 catche = reader.readU2(); - if (catche) meth.classDef->ctpInfo->loadClass(catche); + if (catche) meth.classDef->ctpInfo->loadClass(catche, false); } } } @@ -802,6 +790,11 @@ } void Class::makeVT() { + if (super == NULL) { + virtualTableSize = JavaVirtualTable::getFirstJavaMethodIndex(); + } else { + virtualTableSize = super->virtualTableSize; + } for (uint32 i = 0; i < nbVirtualMethods; ++i) { JavaMethod& meth = virtualMethods[i]; @@ -824,11 +817,6 @@ } } - if (super) { - assert(virtualTableSize >= super->virtualTableSize && - "Size of virtual table less than super!"); - } - mvm::BumpPtrAllocator& allocator = classLoader->allocator; virtualVT = new(allocator, virtualTableSize) JavaVirtualTable(this); } @@ -935,84 +923,24 @@ readFields(reader); readMethods(reader); attributs = readAttributs(reader, nbAttributs); - setIsRead(); } +void UserClass::resolveParents() { + if (super != NULL) { + super->resolveClass(); + } + + for (unsigned i = 0; i < nbInterfaces; i++) + interfaces[i]->resolveClass(); +} + + #ifndef ISOLATE_SHARING void Class::resolveClass() { - JavaObject* exc = 0; - llvm_gcroot(exc, 0); - if (!isResolved() && !isErroneous()) { - acquire(); - if (isResolved() || isErroneous()) { - release(); - } else if (!isResolving()) { - setOwnerClass(JavaThread::get()); - TRY { - readClass(); - } CATCH { - exc = JavaThread::get()->pendingException; - JavaThread::get()->clearException(); - } END_CATCH; - - if (exc != NULL) { - setErroneous(); - setOwnerClass(0); - broadcastClass(); - release(); - JavaThread::get()->throwException(exc); - } - - release(); - - TRY { - loadParents(); - } CATCH { - setInitializationState(loaded); - exc = JavaThread::get()->pendingException; - JavaThread::get()->clearException(); - } END_CATCH; - - if (exc != NULL) { - setErroneous(); - setOwnerClass(0); - JavaThread::get()->throwException(exc); - } - - makeVT(); - JavaCompiler *Comp = classLoader->getCompiler(); - Comp->resolveVirtualClass(this); - Comp->resolveStaticClass(this); - loadExceptions(); - setResolved(); - if (!needsInitialisationCheck()) { - setInitializationState(ready); - } - if (!super) ClassArray::initialiseVT(this); - - bool needInit = needsInitialisationCheck(); - - acquire(); - if (needInit) setResolved(); - setOwnerClass(0); - broadcastClass(); - release(); - } else if (JavaThread::get() != getOwnerClass()) { - while (!isResolved()) { - waitClass(); - if (isErroneous()) break; - } - release(); - - } - } - - if (isErroneous()) { - JavaThread* th = JavaThread::get(); - th->getJVM()->noClassDefFoundError(name); - } - - assert(virtualVT && "No virtual VT after resolution"); + if (isResolved() || isErroneous()) return; + resolveParents(); + loadExceptions(); + setResolved(); } #else void Class::resolveClass() { @@ -1402,8 +1330,6 @@ bool UserClass::needsInitialisationCheck() { - if (!isClassRead()) return true; - if (isReady()) return false; if (super && super->needsInitialisationCheck()) @@ -1881,3 +1807,31 @@ } return 0; } + +void Class::acquire() { + JavaObject* delegatee = NULL; + llvm_gcroot(delegatee, 0); + delegatee = getClassDelegatee(JavaThread::get()->getJVM()); + JavaObject::acquire(delegatee); +} + +void Class::release() { + JavaObject* delegatee = NULL; + llvm_gcroot(delegatee, 0); + delegatee = getClassDelegatee(JavaThread::get()->getJVM()); + JavaObject::release(delegatee); +} + +void Class::waitClass() { + JavaObject* delegatee = NULL; + llvm_gcroot(delegatee, 0); + delegatee = getClassDelegatee(JavaThread::get()->getJVM()); + JavaObject::wait(delegatee); +} + +void Class::broadcastClass() { + JavaObject* delegatee = NULL; + llvm_gcroot(delegatee, 0); + delegatee = getClassDelegatee(JavaThread::get()->getJVM()); + JavaObject::notifyAll(delegatee); +} Modified: vmkit/branches/precise/lib/J3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaClass.h?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.h Tue Oct 12 10:37:57 2010 @@ -50,7 +50,7 @@ /// and accessing static fields of the class) when it is in the ready state. /// #define loaded 0 /// The .class file has been found. -#define classRead 1 /// The .class file has been read. +#define resolving 1 /// The .class file is being resolved. #define resolved 2 /// The class has been resolved. #define vmjc 3 /// The class is defined in a shared library. #define inClinit 4 /// The class is cliniting. @@ -503,10 +503,6 @@ /// uint32 staticSize; - /// lock - The lock of this class. - mvm::LockRecursive lock; - mvm::Cond condition; - /// getVirtualSize - Get the virtual size of instances of this class. /// uint32 getVirtualSize() const { return virtualSize; } @@ -631,11 +627,6 @@ /// void readParents(Reader& reader); - /// loadParents - Loads and resolves the parents, i.e. super and interfarces, - /// of the class. - /// - void loadParents(); - /// loadExceptions - Loads and resolves the exception classes used in catch /// clauses of methods defined in this class. /// @@ -680,6 +671,7 @@ /// resolveClass - If the class has not been resolved yet, resolve it. /// void resolveClass(); + void resolveParents(); /// initialiseClass - If the class has not been initialized yet, /// initialize it. @@ -688,28 +680,20 @@ /// acquire - Acquire this class lock. /// - void acquire() { - lock.lock(); - } + void acquire(); /// release - Release this class lock. /// - void release() { - lock.unlock(); - } + void release(); /// waitClass - Wait for the class to be loaded/initialized/resolved. /// - void waitClass() { - condition.wait(&lock); - } + void waitClass(); /// broadcastClass - Unblock threads that were waiting on the class being /// loaded/initialized/resolved. /// - void broadcastClass() { - condition.broadcast(); - } + void broadcastClass(); #ifndef ISOLATE @@ -738,10 +722,10 @@ getCurrentTaskClassMirror().status = erroneous; } - /// setIsRead - The class file has been read. + /// setIsResolving - The class file is being resolved. /// - void setIsRead() { - getCurrentTaskClassMirror().status = classRead; + void setIsResolving() { + getCurrentTaskClassMirror().status = resolving; } @@ -759,9 +743,9 @@ } } - void setIsRead() { + void setIsResolving() { for (uint32 i = 0; i < NR_ISOLATES; ++i) { - IsolateInfo[i].status = classRead; + IsolateInfo[i].status = resolving; } } @@ -827,15 +811,9 @@ /// isResolving - Is the class currently being resolved? /// bool isResolving() { - return getCurrentTaskClassMirror().status == classRead; + return getCurrentTaskClassMirror().status == resolving; } - /// isClassRead - Has the .class file been read? - /// - bool isClassRead() { - return getCurrentTaskClassMirror().status >= classRead; - } - /// isNativeOverloaded - Is the method overloaded with a native function? /// bool isNativeOverloaded(JavaMethod* meth); @@ -849,8 +827,6 @@ /// void fillIMT(std::set* meths); -private: - /// makeVT - Create the virtual table of this class. /// void makeVT(); Modified: vmkit/branches/precise/lib/J3/VMCore/Jni.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jni.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jni.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jni.cpp Tue Oct 12 10:37:57 2010 @@ -73,7 +73,10 @@ else loader = vm->appClassLoader; UserCommonClass* cl = loader->loadClassFromAsciiz(asciiz, true, true); - if (cl && cl->asClass()) cl->asClass()->initialiseClass(vm); + if (cl && cl->asClass()) { + assert(cl->asClass()->isResolved()); + cl->asClass()->initialiseClass(vm); + } jclass res = (jclass)cl->getClassDelegateePtr(vm); RETURN_FROM_JNI(res); Modified: vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp Tue Oct 12 10:37:57 2010 @@ -528,7 +528,7 @@ return loadName(name, doResolve, doThrow, strName); } - return 0; + return NULL; } UserCommonClass* JnjvmClassLoader::loadClassFromAsciiz(const char* asciiz, @@ -536,6 +536,7 @@ bool doThrow) { const UTF8* name = hashUTF8->lookupAsciiz(asciiz); mvm::ThreadAllocator threadAllocator; + UserCommonClass* result = NULL; if (!name) name = bootstrapLoader->hashUTF8->lookupAsciiz(asciiz); if (!name) { uint32 size = strlen(asciiz); @@ -549,12 +550,15 @@ name = temp; } - UserCommonClass* temp = lookupClass(name); - if (temp) return temp; - - if (this != bootstrapLoader) { - temp = bootstrapLoader->lookupClassOrArray(name); - if (temp) return temp; + result = lookupClass(name); + if ((result == NULL) && (this != bootstrapLoader)) { + result = bootstrapLoader->lookupClassOrArray(name); + if (result != NULL) { + if (result->isClass() && doResolve) { + result->asClass()->resolveClass(); + } + return result; + } } return loadClassFromUserUTF8(name, doResolve, doThrow, NULL); @@ -664,21 +668,43 @@ UserClass* JnjvmClassLoader::constructClass(const UTF8* name, ArrayUInt8* bytes) { - llvm_gcroot(bytes, 0); - assert(bytes && "constructing a class without bytes"); + JavaObject* excp = NULL; + llvm_gcroot(bytes, 0); + llvm_gcroot(excp, 0); + UserClass* res = NULL; + lock.lock(); classes->lock.lock(); ClassMap::iterator End = classes->map.end(); ClassMap::iterator I = classes->map.find(name); - UserClass* res = 0; - if (I == End) { - const UTF8* internalName = readerConstructUTF8(name->elements, name->size); - res = new(allocator, "Class") UserClass(this, internalName, bytes); - bool success = classes->map.insert(std::make_pair(internalName, res)).second; - assert(success && "Could not add class in map"); - } else { + classes->lock.unlock(); + if (I != End) { res = ((UserClass*)(I->second)); + } else { + TRY { + const UTF8* internalName = readerConstructUTF8(name->elements, name->size); + res = new(allocator, "Class") UserClass(this, internalName, bytes); + res->readClass(); + res->makeVT(); + getCompiler()->resolveVirtualClass(res); + getCompiler()->resolveStaticClass(res); + classes->lock.lock(); + bool success = classes->map.insert(std::make_pair(internalName, res)).second; + classes->lock.unlock(); + assert(success && "Could not add class in map"); + } CATCH { + excp = JavaThread::get()->pendingException; + JavaThread::get()->clearException(); + } END_CATCH; + } + if (excp != NULL) { + JavaThread::get()->throwException(excp); + } + lock.unlock(); + + if (res->super == NULL) { + // java.lang.Object just got created, initialise VTs of arrays. + ClassArray::initialiseVT(res); } - classes->lock.unlock(); return res; } Modified: vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h Tue Oct 12 10:37:57 2010 @@ -105,6 +105,10 @@ /// SignMap* javaSignatures; + /// lock - Lock when loading classes. + /// + mvm::LockRecursive lock; + public: /// allocator - Reference to the memory allocator, which will allocate UTF8s, @@ -298,6 +302,7 @@ /// Class* loadClassFromSelf(Jnjvm* vm, const char* name); + friend class Class; }; /// JnjvmBootstrapLoader - This class is for the bootstrap class loader, which Modified: vmkit/branches/precise/lib/J3/VMCore/LinkJavaRuntime.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/LinkJavaRuntime.h?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/LinkJavaRuntime.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/LinkJavaRuntime.h Tue Oct 12 10:37:57 2010 @@ -80,7 +80,7 @@ #endif -namespace { +namespace force_linker { struct ForceRuntimeLinking { ForceRuntimeLinking() { // We must reference the passes in such a way that compilers will not Modified: vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp Tue Oct 12 10:37:57 2010 @@ -61,6 +61,21 @@ typedef void (*destructor_t)(void*); +void invokeFinalize(mvm::Thread* th, gc* res) { + llvm_gcroot(res, 0); + TRY { + th->MyVM->invokeFinalizer(res); + } IGNORE; + th->clearException(); +} + +void invokeEnqueue(mvm::Thread* th, gc* res) { + llvm_gcroot(res, 0); + TRY { + th->MyVM->enqueueReference(res); + } IGNORE; + th->clearException(); +} void VirtualMachine::finalizerStart(mvm::Thread* th) { VirtualMachine* vm = th->MyVM; @@ -83,17 +98,14 @@ vm->FinalizationQueueLock.release(); if (!res) break; - TRY { - VirtualTable* VT = res->getVirtualTable(); - if (VT->operatorDelete) { - destructor_t dest = (destructor_t)VT->destructor; - dest(res); - } else { - vm->invokeFinalizer(res); - } - } IGNORE; + VirtualTable* VT = res->getVirtualTable(); + if (VT->operatorDelete) { + destructor_t dest = (destructor_t)VT->destructor; + dest(res); + } else { + invokeFinalize(th, res); + } res = 0; - th->clearException(); } } } @@ -119,11 +131,8 @@ vm->ToEnqueueLock.release(); if (!res) break; - TRY { - vm->enqueueReference(res); - } IGNORE; + invokeEnqueue(th, res); res = 0; - th->clearException(); } } } Modified: vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc Tue Oct 12 10:37:57 2010 @@ -14,61 +14,732 @@ /*Params=*/FuncTy_1_args, /*isVarArg=*/false); -std::vectorStructTy_JavaObject_fields; -std::vectorFuncTy_5_args; -FunctionType* FuncTy_5 = FunctionType::get( +std::vectorFuncTy_3_args; +FuncTy_3_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_3 = FunctionType::get( + /*Result=*/PointerTy_0, + /*Params=*/FuncTy_3_args, + /*isVarArg=*/false); + +PointerType* PointerTy_2 = PointerType::get(FuncTy_3, 0); + +std::vectorStructTy_struct_mvm__MutatorThread_fields; +std::vectorStructTy_struct_mvm__Thread_fields; +std::vectorStructTy_struct_mvm__CircularBase_fields; +std::vectorFuncTy_7_args; +FunctionType* FuncTy_7 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), - /*Params=*/FuncTy_5_args, + /*Params=*/FuncTy_7_args, /*isVarArg=*/true); -PointerType* PointerTy_4 = PointerType::get(FuncTy_5, 0); +PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0); + +PointerType* PointerTy_5 = PointerType::get(PointerTy_6, 0); + +StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_5); +PATypeHolder StructTy_struct_mvm__CircularBase_fwd = OpaqueType::get(mod->getContext()); +PointerType* PointerTy_8 = PointerType::get(StructTy_struct_mvm__CircularBase_fwd, 0); + +StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8); +StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8); +StructType* StructTy_struct_mvm__CircularBase = StructType::get(mod->getContext(), StructTy_struct_mvm__CircularBase_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::CircularBase", StructTy_struct_mvm__CircularBase); +cast(StructTy_struct_mvm__CircularBase_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__CircularBase); +StructTy_struct_mvm__CircularBase = cast(StructTy_struct_mvm__CircularBase_fwd.get()); + + +StructTy_struct_mvm__Thread_fields.push_back(StructTy_struct_mvm__CircularBase); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct_mvm__VirtualMachine_fields; +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_5); +std::vectorStructTy_struct_mvm__BumpPtrAllocator_fields; +std::vectorStructTy_struct_mvm__SpinLock_fields; +StructTy_struct_mvm__SpinLock_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_mvm__SpinLock = StructType::get(mod->getContext(), StructTy_struct_mvm__SpinLock_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::SpinLock", StructTy_struct_mvm__SpinLock); + +StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_mvm__SpinLock); +std::vectorStructTy_struct_llvm__BumpPtrAllocator_fields; +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct_llvm__SlabAllocator_fields; +StructTy_struct_llvm__SlabAllocator_fields.push_back(PointerTy_5); +StructType* StructTy_struct_llvm__SlabAllocator = StructType::get(mod->getContext(), StructTy_struct_llvm__SlabAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.llvm::SlabAllocator", StructTy_struct_llvm__SlabAllocator); + +PointerType* PointerTy_11 = PointerType::get(StructTy_struct_llvm__SlabAllocator, 0); + +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_11); +std::vectorStructTy_struct_llvm__MemSlab_fields; +StructTy_struct_llvm__MemSlab_fields.push_back(IntegerType::get(mod->getContext(), 32)); +PATypeHolder PointerTy_12_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_llvm__MemSlab_fields.push_back(PointerTy_12_fwd); +StructType* StructTy_struct_llvm__MemSlab = StructType::get(mod->getContext(), StructTy_struct_llvm__MemSlab_fields, /*isPacked=*/false); +mod->addTypeName("struct.llvm::MemSlab", StructTy_struct_llvm__MemSlab); + +PointerType* PointerTy_12 = PointerType::get(StructTy_struct_llvm__MemSlab, 0); +cast(PointerTy_12_fwd.get())->refineAbstractTypeTo(PointerTy_12); +PointerTy_12 = cast(PointerTy_12_fwd.get()); + + +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_12); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0); +StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_llvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_llvm__BumpPtrAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.llvm::BumpPtrAllocator", StructTy_struct_llvm__BumpPtrAllocator); + +StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator); +StructType* StructTy_struct_mvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__BumpPtrAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::BumpPtrAllocator", StructTy_struct_mvm__BumpPtrAllocator); + +PointerType* PointerTy_10 = PointerType::get(StructTy_struct_mvm__BumpPtrAllocator, 0); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_10); +PATypeHolder StructTy_struct_mvm__Thread_fwd = OpaqueType::get(mod->getContext()); +PointerType* PointerTy_13 = PointerType::get(StructTy_struct_mvm__Thread_fwd, 0); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_13); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); +std::vectorStructTy_struct_mvm__ReferenceQueue_fields; +std::vectorStructTy_struct_gc_fields; +std::vectorStructTy_struct_gcRoot_fields; +StructTy_struct_gcRoot_fields.push_back(PointerTy_5); +StructTy_struct_gcRoot_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); +mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); + +StructTy_struct_gc_fields.push_back(StructTy_struct_gcRoot); +StructType* StructTy_struct_gc = StructType::get(mod->getContext(), StructTy_struct_gc_fields, /*isPacked=*/false); +mod->addTypeName("struct.gc", StructTy_struct_gc); + +PointerType* PointerTy_15 = PointerType::get(StructTy_struct_gc, 0); + +PointerType* PointerTy_14 = PointerType::get(PointerTy_15, 0); + +StructTy_struct_mvm__ReferenceQueue_fields.push_back(PointerTy_14); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(StructTy_struct_mvm__SpinLock); +StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_struct_mvm__ReferenceQueue = StructType::get(mod->getContext(), StructTy_struct_mvm__ReferenceQueue_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ReferenceQueue", StructTy_struct_mvm__ReferenceQueue); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct_mvm__Cond_fields; +std::vectorStructTy_union_pthread_cond_t_fields; +std::vectorStructTy_struct__2__13_fields; +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); +StructTy_struct__2__13_fields.push_back(PointerTy_0); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct__2__13 = StructType::get(mod->getContext(), StructTy_struct__2__13_fields, /*isPacked=*/false); +mod->addTypeName("struct..2._13", StructTy_struct__2__13); + +StructTy_union_pthread_cond_t_fields.push_back(StructTy_struct__2__13); +ArrayType* ArrayTy_16 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1); + +StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_16); +StructType* StructTy_union_pthread_cond_t = StructType::get(mod->getContext(), StructTy_union_pthread_cond_t_fields, /*isPacked=*/false); +mod->addTypeName("union.pthread_cond_t", StructTy_union_pthread_cond_t); + +StructTy_struct_mvm__Cond_fields.push_back(StructTy_union_pthread_cond_t); +StructType* StructTy_struct_mvm__Cond = StructType::get(mod->getContext(), StructTy_struct_mvm__Cond_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::Cond", StructTy_struct_mvm__Cond); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond); +std::vectorStructTy_struct_mvm__LockNormal_fields; +std::vectorStructTy_struct_mvm__Lock_fields; +StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5); +StructTy_struct_mvm__Lock_fields.push_back(PointerTy_13); +std::vectorStructTy_union_pthread_mutex_t_fields; +std::vectorStructTy_struct__1__pthread_mutex_s_fields; +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__1__pthread_mutex_s_fields.push_back(StructTy_struct_mvm__SpinLock); +StructType* StructTy_struct__1__pthread_mutex_s = StructType::get(mod->getContext(), StructTy_struct__1__pthread_mutex_s_fields, /*isPacked=*/false); +mod->addTypeName("struct..1__pthread_mutex_s", StructTy_struct__1__pthread_mutex_s); + +StructTy_union_pthread_mutex_t_fields.push_back(StructTy_struct__1__pthread_mutex_s); +StructType* StructTy_union_pthread_mutex_t = StructType::get(mod->getContext(), StructTy_union_pthread_mutex_t_fields, /*isPacked=*/false); +mod->addTypeName("union.pthread_mutex_t", StructTy_union_pthread_mutex_t); + +StructTy_struct_mvm__Lock_fields.push_back(StructTy_union_pthread_mutex_t); +StructType* StructTy_struct_mvm__Lock = StructType::get(mod->getContext(), StructTy_struct_mvm__Lock_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::Lock", StructTy_struct_mvm__Lock); + +StructTy_struct_mvm__LockNormal_fields.push_back(StructTy_struct_mvm__Lock); +StructType* StructTy_struct_mvm__LockNormal = StructType::get(mod->getContext(), StructTy_struct_mvm__LockNormal_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::LockNormal", StructTy_struct_mvm__LockNormal); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); +StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_11); +std::vectorStructTy_struct_mvm__CooperativeCollectionRV_fields; +std::vectorStructTy_struct_mvm__CollectionRV_fields; +StructTy_struct_mvm__CollectionRV_fields.push_back(PointerTy_5); +StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__LockNormal); +StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond); +StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond); +StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_mvm__CollectionRV = StructType::get(mod->getContext(), StructTy_struct_mvm__CollectionRV_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::CollectionRV", StructTy_struct_mvm__CollectionRV); + +StructTy_struct_mvm__CooperativeCollectionRV_fields.push_back(StructTy_struct_mvm__CollectionRV); +StructType* StructTy_struct_mvm__CooperativeCollectionRV = StructType::get(mod->getContext(), StructTy_struct_mvm__CooperativeCollectionRV_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::CooperativeCollectionRV", StructTy_struct_mvm__CooperativeCollectionRV); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__CooperativeCollectionRV); +std::vectorStructTy_struct_mvm__StartEndFunctionMap_fields; +std::vectorStructTy_struct_mvm__FunctionMap_fields; +std::vectorStructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields; +std::vectorStructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields; +std::vectorStructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields; +std::vectorStructTy_struct___gnu_cxx__new_allocator_gc___fields; +StructTy_struct___gnu_cxx__new_allocator_gc___fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_struct___gnu_cxx__new_allocator_gc__ = StructType::get(mod->getContext(), StructTy_struct___gnu_cxx__new_allocator_gc___fields, /*isPacked=*/true); +mod->addTypeName("struct.__gnu_cxx::new_allocator", StructTy_struct___gnu_cxx__new_allocator_gc__); + +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct___gnu_cxx__new_allocator_gc__); +std::vectorStructTy_struct_std___Rb_tree_node_base_fields; +StructTy_struct_std___Rb_tree_node_base_fields.push_back(IntegerType::get(mod->getContext(), 32)); +PATypeHolder StructTy_struct_std___Rb_tree_node_base_fwd = OpaqueType::get(mod->getContext()); +PointerType* PointerTy_17 = PointerType::get(StructTy_struct_std___Rb_tree_node_base_fwd, 0); + +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); +StructType* StructTy_struct_std___Rb_tree_node_base = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_node_base_fields, /*isPacked=*/false); +mod->addTypeName("struct.std::_Rb_tree_node_base", StructTy_struct_std___Rb_tree_node_base); +cast(StructTy_struct_std___Rb_tree_node_base_fwd.get())->refineAbstractTypeTo(StructTy_struct_std___Rb_tree_node_base); +StructTy_struct_std___Rb_tree_node_base = cast(StructTy_struct_std___Rb_tree_node_base_fwd.get()); + + +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct_std___Rb_tree_node_base); +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields, /*isPacked=*/false); +mod->addTypeName("struct.std::_Rb_tree,std::_Select1st >,std::less,std::allocator > >::_Rb_tree_impl,false>", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_); + +StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_); +StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false); +mod->addTypeName("struct.std::_Rb_tree,std::_Select1st >,std::less,std::allocator > >", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); + +StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); +StructType* StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false); +mod->addTypeName("struct.std::map,std::allocator > >", StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); + +StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); +StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_mvm__SpinLock); +StructType* StructTy_struct_mvm__FunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__FunctionMap_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::FunctionMap", StructTy_struct_mvm__FunctionMap); + +StructTy_struct_mvm__StartEndFunctionMap_fields.push_back(StructTy_struct_mvm__FunctionMap); +StructType* StructTy_struct_mvm__StartEndFunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__StartEndFunctionMap_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::StartEndFunctionMap", StructTy_struct_mvm__StartEndFunctionMap); + +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap); +StructType* StructTy_struct_mvm__VirtualMachine = StructType::get(mod->getContext(), StructTy_struct_mvm__VirtualMachine_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::VirtualMachine", StructTy_struct_mvm__VirtualMachine); + +PointerType* PointerTy_9 = PointerType::get(StructTy_struct_mvm__VirtualMachine, 0); + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_9); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); +std::vectorFuncTy_19_args; +FuncTy_19_args.push_back(PointerTy_13); +FunctionType* FuncTy_19 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_19_args, + /*isVarArg=*/false); + +PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); +std::vectorStructTy_struct_mvm__KnownFrame_fields; +PATypeHolder PointerTy_20_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_20_fwd); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); +StructType* StructTy_struct_mvm__KnownFrame = StructType::get(mod->getContext(), StructTy_struct_mvm__KnownFrame_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::KnownFrame", StructTy_struct_mvm__KnownFrame); + +PointerType* PointerTy_20 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0); +cast(PointerTy_20_fwd.get())->refineAbstractTypeTo(PointerTy_20); +PointerTy_20 = cast(PointerTy_20_fwd.get()); -ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_4, 0); + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20); +std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; +PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd); +std::vectorStructTy_struct___jmp_buf_tag_fields; +ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); + +StructTy_struct___jmp_buf_tag_fields.push_back(ArrayTy_23); +StructTy_struct___jmp_buf_tag_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct___sigset_t_fields; +ArrayType* ArrayTy_24 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); + +StructTy_struct___sigset_t_fields.push_back(ArrayTy_24); +StructType* StructTy_struct___sigset_t = StructType::get(mod->getContext(), StructTy_struct___sigset_t_fields, /*isPacked=*/false); +mod->addTypeName("struct.__sigset_t", StructTy_struct___sigset_t); + +StructTy_struct___jmp_buf_tag_fields.push_back(StructTy_struct___sigset_t); +StructType* StructTy_struct___jmp_buf_tag = StructType::get(mod->getContext(), StructTy_struct___jmp_buf_tag_fields, /*isPacked=*/false); +mod->addTypeName("struct.__jmp_buf_tag", StructTy_struct___jmp_buf_tag); + +ArrayType* ArrayTy_22 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); + +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22); +StructType* StructTy_struct_mvm__ExceptionBuffer = StructType::get(mod->getContext(), StructTy_struct_mvm__ExceptionBuffer_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ExceptionBuffer", StructTy_struct_mvm__ExceptionBuffer); + +PointerType* PointerTy_21 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); +cast(PointerTy_21_fwd.get())->refineAbstractTypeTo(PointerTy_21); +PointerTy_21 = cast(PointerTy_21_fwd.get()); + + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21); +StructType* StructTy_struct_mvm__Thread = StructType::get(mod->getContext(), StructTy_struct_mvm__Thread_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::Thread", StructTy_struct_mvm__Thread); +cast(StructTy_struct_mvm__Thread_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__Thread); +StructTy_struct_mvm__Thread = cast(StructTy_struct_mvm__Thread_fwd.get()); + + +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread); +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator); +StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18); +StructType* StructTy_struct_mvm__MutatorThread = StructType::get(mod->getContext(), StructTy_struct_mvm__MutatorThread_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::MutatorThread", StructTy_struct_mvm__MutatorThread); + +PointerType* PointerTy_4 = PointerType::get(StructTy_struct_mvm__MutatorThread, 0); + +PointerType* PointerTy_25 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); + +std::vectorStructTy_struct_j3__JavaObject_fields; +StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_gc); +StructType* StructTy_struct_j3__JavaObject = StructType::get(mod->getContext(), StructTy_struct_j3__JavaObject_fields, /*isPacked=*/false); +mod->addTypeName("struct.j3::JavaObject", StructTy_struct_j3__JavaObject); + +PointerType* PointerTy_26 = PointerType::get(StructTy_struct_j3__JavaObject, 0); + +std::vectorStructTy_JavaObject_fields; +ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_6, 0); mod->addTypeName("VT", ArrayTy_VT); -PointerType* PointerTy_3 = PointerType::get(ArrayTy_VT, 0); +PointerType* PointerTy_29 = PointerType::get(ArrayTy_VT, 0); -StructTy_JavaObject_fields.push_back(PointerTy_3); +StructTy_JavaObject_fields.push_back(PointerTy_29); StructTy_JavaObject_fields.push_back(PointerTy_0); StructType* StructTy_JavaObject = StructType::get(mod->getContext(), StructTy_JavaObject_fields, /*isPacked=*/false); mod->addTypeName("JavaObject", StructTy_JavaObject); -PointerType* PointerTy_2 = PointerType::get(StructTy_JavaObject, 0); +PointerType* PointerTy_28 = PointerType::get(StructTy_JavaObject, 0); -std::vectorFuncTy_7_args; -FuncTy_7_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_7_args.push_back(PointerTy_2); -FunctionType* FuncTy_7 = FunctionType::get( - /*Result=*/PointerTy_2, - /*Params=*/FuncTy_7_args, +PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); + +PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); + +std::vectorFuncTy_32_args; +FuncTy_32_args.push_back(PointerTy_28); +FuncTy_32_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_32_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_32_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_32 = FunctionType::get( + /*Result=*/PointerTy_28, + /*Params=*/FuncTy_32_args, /*isVarArg=*/false); -PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0); +PointerType* PointerTy_31 = PointerType::get(FuncTy_32, 0); + +PointerType* PointerTy_33 = PointerType::get(PointerTy_29, 0); + +std::vectorFuncTy_35_args; +FuncTy_35_args.push_back(PointerTy_28); +FuncTy_35_args.push_back(PointerTy_28); +FuncTy_35_args.push_back(PointerTy_28); +FuncTy_35_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_35_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_35 = FunctionType::get( + /*Result=*/PointerTy_28, + /*Params=*/FuncTy_35_args, + /*isVarArg=*/false); + +PointerType* PointerTy_34 = PointerType::get(FuncTy_35, 0); + +std::vectorStructTy_37_fields; +std::vectorStructTy_38_fields; +std::vectorStructTy_39_fields; +StructTy_39_fields.push_back(StructTy_JavaObject); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(PointerTy_28); +StructTy_39_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_39 = StructType::get(mod->getContext(), StructTy_39_fields, /*isPacked=*/false); + +StructTy_38_fields.push_back(StructTy_39); +StructType* StructTy_38 = StructType::get(mod->getContext(), StructTy_38_fields, /*isPacked=*/false); + +StructTy_37_fields.push_back(StructTy_38); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_37_fields.push_back(PointerTy_28); +StructType* StructTy_37 = StructType::get(mod->getContext(), StructTy_37_fields, /*isPacked=*/false); + +PointerType* PointerTy_36 = PointerType::get(StructTy_37, 0); + +std::vectorStructTy_41_fields; +std::vectorStructTy_42_fields; +StructTy_42_fields.push_back(StructTy_39); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructTy_42_fields.push_back(PointerTy_28); +StructType* StructTy_42 = StructType::get(mod->getContext(), StructTy_42_fields, /*isPacked=*/false); + +StructTy_41_fields.push_back(StructTy_42); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_41_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_41 = StructType::get(mod->getContext(), StructTy_41_fields, /*isPacked=*/false); + +PointerType* PointerTy_40 = PointerType::get(StructTy_41, 0); + +std::vectorStructTy_44_fields; +StructTy_44_fields.push_back(StructTy_39); +StructTy_44_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_44 = StructType::get(mod->getContext(), StructTy_44_fields, /*isPacked=*/false); + +PointerType* PointerTy_43 = PointerType::get(StructTy_44, 0); + +std::vectorFuncTy_46_args; +FunctionType* FuncTy_46 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_46_args, + /*isVarArg=*/false); + +PointerType* PointerTy_45 = PointerType::get(FuncTy_46, 0); + +std::vectorStructTy_48_fields; +StructTy_48_fields.push_back(PointerTy_28); +StructTy_48_fields.push_back(PointerTy_28); +StructTy_48_fields.push_back(PointerTy_28); +StructTy_48_fields.push_back(PointerTy_28); +StructType* StructTy_48 = StructType::get(mod->getContext(), StructTy_48_fields, /*isPacked=*/false); + +PointerType* PointerTy_47 = PointerType::get(StructTy_48, 0); + +std::vectorFuncTy_50_args; +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 1)); +FunctionType* FuncTy_50 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_50_args, + /*isVarArg=*/false); + +PointerType* PointerTy_49 = PointerType::get(FuncTy_50, 0); + +std::vectorFuncTy_52_args; +FuncTy_52_args.push_back(PointerTy_25); +FuncTy_52_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_52_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_52 = FunctionType::get( + /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Params=*/FuncTy_52_args, + /*isVarArg=*/false); + +PointerType* PointerTy_51 = PointerType::get(FuncTy_52, 0); // Function Declarations -Function* func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2 = Function::Create( - /*Type=*/FuncTy_7, +Function* func_llvm_frameaddress = Function::Create( + /*Type=*/FuncTy_3, /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2", mod); -func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2->setCallingConv(CallingConv::C); -AttrListPtr func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL; + /*Name=*/"llvm.frameaddress", mod); // (external, no body) +func_llvm_frameaddress->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_frameaddress_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind | Attribute::ReadNone; + Attrs.push_back(PAWI); + func_llvm_frameaddress_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); + +Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create( + /*Type=*/FuncTy_32, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III", mod); +func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setCallingConv(CallingConv::C); +AttrListPtr func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; + Attrs.push_back(PAWI); + func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL); + +Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( + /*Type=*/FuncTy_35, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II", mod); +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setCallingConv(CallingConv::C); +AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; Attrs.push_back(PAWI); - func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setAttributes(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL); + +Function* func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III = Function::Create( + /*Type=*/FuncTy_32, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III", mod); +func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setCallingConv(CallingConv::C); +AttrListPtr func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; + Attrs.push_back(PAWI); + func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL); + +Function* func_llvm_trap = Function::Create( + /*Type=*/FuncTy_46, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.trap", mod); // (external, no body) +func_llvm_trap->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_trap_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_trap_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_llvm_trap->setAttributes(func_llvm_trap_PAL); + +Function* func_llvm_memory_barrier = Function::Create( + /*Type=*/FuncTy_50, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.memory.barrier", mod); // (external, no body) +func_llvm_memory_barrier->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_memory_barrier_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_memory_barrier_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2->setAttributes(func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL); +func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL); + +Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create( + /*Type=*/FuncTy_52, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.atomic.cmp.swap.i32.p0i32", mod); // (external, no body) +func_llvm_atomic_cmp_swap_i32_p0i32->setCallingConv(CallingConv::C); +AttrListPtr func_llvm_atomic_cmp_swap_i32_p0i32_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoCapture; + Attrs.push_back(PAWI); + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_atomic_cmp_swap_i32_p0i32_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL); + +Function* func__ZN3mvm6Thread5yieldEv = Function::Create( + /*Type=*/FuncTy_46, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) +func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C); +AttrListPtr func__ZN3mvm6Thread5yieldEv_PAL; +func__ZN3mvm6Thread5yieldEv->setAttributes(func__ZN3mvm6Thread5yieldEv_PAL); // Global Variable Declarations +GlobalVariable* gvar_struct_finalObject32 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_37, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject32"); + +GlobalVariable* gvar_struct_finalObject101 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_37, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject101"); + +GlobalVariable* gvar_struct_finalObject122 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_41, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject122"); + +GlobalVariable* gvar_struct_finalObject67 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_41, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject67"); + +GlobalVariable* gvar_struct_finalObject2 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_44, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject2"); + +GlobalVariable* gvar_struct_finalObject85 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_41, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"finalObject85"); + +GlobalVariable* gvar_struct_org_mmtk_utility_DoublyLinkedList_static = new GlobalVariable(/*Module=*/*mod, +/*Type=*/StructTy_48, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/"org_mmtk_utility_DoublyLinkedList_static"); + // Constant Definitions -ConstantInt* const_int32_8 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -ConstantInt* const_int32_9 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_53 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_55 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_56 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_57 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_58 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8193"), 10)); +ConstantInt* const_int32_59 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("4"), 10)); +ConstantInt* const_int32_60 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("7"), 10)); +ConstantInt* const_int32_61 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8"), 10)); +ConstantInt* const_int32_62 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-1"), 10)); +ConstantInt* const_int32_63 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("63"), 10)); +ConstantInt* const_int32_64 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("127"), 10)); +ConstantInt* const_int32_65 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("255"), 10)); +ConstantInt* const_int32_66 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("511"), 10)); +ConstantInt* const_int32_67 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2047"), 10)); +ConstantInt* const_int32_68 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("10"), 10)); +ConstantInt* const_int32_69 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("32"), 10)); +ConstantInt* const_int32_70 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("12"), 10)); +ConstantInt* const_int32_71 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_72 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("16"), 10)); +ConstantInt* const_int32_73 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("6"), 10)); +ConstantInt* const_int32_74 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("20"), 10)); +ConstantInt* const_int32_75 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10)); +ConstantInt* const_int32_76 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantPointerNull* const_ptr_77 = ConstantPointerNull::get(PointerTy_29); +ConstantInt* const_int8_78 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("-4"), 10)); +std::vector const_ptr_79_indices; +const_ptr_79_indices.push_back(const_int32_55); +const_ptr_79_indices.push_back(const_int32_76); +Constant* const_ptr_79 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_79_indices[0], const_ptr_79_indices.size()); +ConstantInt* const_int8_80 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("2"), 10)); +std::vector const_ptr_81_indices; +const_ptr_81_indices.push_back(const_int32_55); +const_ptr_81_indices.push_back(const_int32_53); +Constant* const_ptr_81 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_81_indices[0], const_ptr_81_indices.size()); +ConstantInt* const_int32_82 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); +ConstantPointerNull* const_ptr_83 = ConstantPointerNull::get(PointerTy_0); +std::vector const_ptr_84_indices; +const_ptr_84_indices.push_back(const_int32_55); +const_ptr_84_indices.push_back(const_int32_76); +Constant* const_ptr_84 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_84_indices[0], const_ptr_84_indices.size()); +std::vector const_ptr_85_indices; +const_ptr_85_indices.push_back(const_int32_55); +const_ptr_85_indices.push_back(const_int32_53); +Constant* const_ptr_85 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_85_indices[0], const_ptr_85_indices.size()); +std::vector const_ptr_86_indices; +const_ptr_86_indices.push_back(const_int32_55); +const_ptr_86_indices.push_back(const_int32_57); +Constant* const_ptr_86 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject122, &const_ptr_86_indices[0], const_ptr_86_indices.size()); +std::vector const_ptr_87_indices; +const_ptr_87_indices.push_back(const_int32_55); +const_ptr_87_indices.push_back(const_int32_57); +Constant* const_ptr_87 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject67, &const_ptr_87_indices[0], const_ptr_87_indices.size()); +ConstantInt* const_int8_88 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("1"), 10)); +std::vector const_ptr_89_indices; +const_ptr_89_indices.push_back(const_int32_55); +const_ptr_89_indices.push_back(const_int32_76); +Constant* const_ptr_89 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject2, &const_ptr_89_indices[0], const_ptr_89_indices.size()); +std::vector const_ptr_90_indices; +const_ptr_90_indices.push_back(const_int32_55); +const_ptr_90_indices.push_back(const_int32_57); +Constant* const_ptr_90 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject85, &const_ptr_90_indices[0], const_ptr_90_indices.size()); +std::vector const_ptr_91_indices; +const_ptr_91_indices.push_back(const_int32_55); +const_ptr_91_indices.push_back(const_int32_57); +Constant* const_ptr_91 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_91_indices[0], const_ptr_91_indices.size()); +ConstantPointerNull* const_ptr_92 = ConstantPointerNull::get(PointerTy_28); +ConstantInt* const_int32_93 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); +ConstantInt* const_int1_94 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10)); // Global Variable Definitions @@ -94,29 +765,1151 @@ ptr_VT->setName("VT"); BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF__i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFEQ_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread19.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_4_i_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i6.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_6_i_i_i7_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i7.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_7_i_i1_i8_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i8.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_8_i_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i9.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_9_i_i_i10_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i10.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT16_i_i_i11_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i11.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT17_i_i_i12_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i12.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT18_i_i_i13_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i13.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT19_i_i_i14_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i14.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT20_i_i_i15_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i15.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF__i17_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i17.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i21_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i21.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread21.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF__i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread9.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread13.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread17.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i",func_gcmalloc,0); +BasicBlock* label_true_IF_NULL_i1_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_1_i3_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL_i5_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb_i_i20_i = BasicBlock::Create(mod->getContext(), "bb.i.i20.i",func_gcmalloc,0); +BasicBlock* label_bb1_i_i21_i = BasicBlock::Create(mod->getContext(), "bb1.i.i21.i",func_gcmalloc,0); +BasicBlock* label_bb2_i_i22_i = BasicBlock::Create(mod->getContext(), "bb2.i.i22.i",func_gcmalloc,0); +BasicBlock* label_bb4_preheader_i_i23_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i23.i",func_gcmalloc,0); +BasicBlock* label_bb3_i_i24_i = BasicBlock::Create(mod->getContext(), "bb3.i.i24.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i7_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL3_i8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IF_NULL_i1_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i6.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_1_i3_i_i8_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i8.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL_i5_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i9.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb_i_i_i = BasicBlock::Create(mod->getContext(), "bb.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb1_i_i_i = BasicBlock::Create(mod->getContext(), "bb1.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb2_i_i_i = BasicBlock::Create(mod->getContext(), "bb2.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb4_preheader_i_i_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i.i",func_gcmalloc,0); +BasicBlock* label_bb3_i_i_i = BasicBlock::Create(mod->getContext(), "bb3.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i7_i_i11_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i11.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL3_i8_i_i12_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i12.i.i.i",func_gcmalloc,0); +BasicBlock* label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit = BasicBlock::Create(mod->getContext(), "JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit",func_gcmalloc,0); // Block entry (label_entry) -BinaryOperator* int32_10 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_8, "", label_entry); -BinaryOperator* int32_11 = BinaryOperator::Create(Instruction::And, int32_10, const_int32_9, "", label_entry); -CastInst* ptr_tmp = new BitCastInst(ptr_VT, PointerTy_2, "tmp", label_entry); -std::vector ptr_12_params; -ptr_12_params.push_back(int32_11); -ptr_12_params.push_back(ptr_tmp); -CallInst* ptr_12 = CallInst::Create(func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2, ptr_12_params.begin(), ptr_12_params.end(), "", label_entry); -ptr_12->setCallingConv(CallingConv::C); -ptr_12->setTailCall(true); -AttrListPtr ptr_12_PAL; +BinaryOperator* int32_95 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_53, "", label_entry); +BinaryOperator* int32_96 = BinaryOperator::Create(Instruction::And, int32_95, const_int32_54, "", label_entry); +CallInst* ptr_97 = CallInst::Create(func_llvm_frameaddress, const_int32_55, "", label_entry); +ptr_97->setCallingConv(CallingConv::C); +ptr_97->setTailCall(true); +AttrListPtr ptr_97_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_97_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_97->setAttributes(ptr_97_PAL); + +CastInst* int32_98 = new PtrToIntInst(ptr_97, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_99 = BinaryOperator::Create(Instruction::And, int32_98, const_int32_56, "", label_entry); +CastInst* ptr_100 = new IntToPtrInst(int32_99, PointerTy_4, "", label_entry); +std::vector ptr_101_indices; +ptr_101_indices.push_back(const_int32_55); +ptr_101_indices.push_back(const_int32_57); +Instruction* ptr_101 = GetElementPtrInst::Create(ptr_100, ptr_101_indices.begin(), ptr_101_indices.end(), "", label_entry); +LoadInst* int32_102 = new LoadInst(ptr_101, "", false, label_entry); +CastInst* ptr_103 = new IntToPtrInst(int32_102, PointerTy_26, "", label_entry); +ICmpInst* int1_104 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_96, const_int32_58, ""); +SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_104, const_int32_55, const_int32_59, "storemerge.i.i", label_entry); +SwitchInst* void_105 = SwitchInst::Create(int32_storemerge_i_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, 7, label_entry); +void_105->addCase(const_int32_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +void_105->addCase(const_int32_57, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +void_105->addCase(const_int32_53, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +void_105->addCase(const_int32_59, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +void_105->addCase(const_int32_60, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +void_105->addCase(const_int32_61, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i) +GetElementPtrInst* ptr_106 = GetElementPtrInst::Create(ptr_103, const_int32_59, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +CastInst* ptr_107 = new BitCastInst(ptr_106, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +LoadInst* ptr_108 = new LoadInst(ptr_107, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +BinaryOperator* int32_109 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +ICmpInst* int1_110 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_110, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); + +// Block GOTO or IF*4.i.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i_i) +ICmpInst* int1_112 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_112, label_GOTO_or_IF_4_i_i_i_i_i_i); + +// Block GOTO or IF*6.i.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i_i) +ICmpInst* int1_114 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_114, label_GOTO_or_IF_6_i_i_i_i_i_i); + +// Block GOTO or IF*7.i.i1.i.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i_i) +ICmpInst* int1_116 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_116, label_GOTO_or_IF_7_i_i1_i_i_i_i); + +// Block GOTO or IF*8.i.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i_i) +ICmpInst* int1_118 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_109, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_118, label_GOTO_or_IF_8_i_i_i_i_i_i); + +// Block GOTO or IF*9.i.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i_i) +BinaryOperator* int32_120 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_68, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BinaryOperator* int32_121 = BinaryOperator::Create(Instruction::Add, int32_120, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i_i); + +// Block false IF_ICMPGT16.i.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i_i) +BinaryOperator* int32_123 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i); + +// Block false IF_ICMPGT17.i.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i_i) +BinaryOperator* int32_125 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BinaryOperator* int32_126 = BinaryOperator::Create(Instruction::Add, int32_125, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i); + +// Block false IF_ICMPGT18.i.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i_i) +BinaryOperator* int32_128 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BinaryOperator* int32_129 = BinaryOperator::Create(Instruction::Add, int32_128, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i); + +// Block false IF_ICMPGT19.i.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i_i) +BinaryOperator* int32_131 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BinaryOperator* int32_132 = BinaryOperator::Create(Instruction::Add, int32_131, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i); + +// Block false IF_ICMPGT20.i.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i_i) +BinaryOperator* int32_134 = BinaryOperator::Create(Instruction::AShr, int32_109, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BinaryOperator* int32_135 = BinaryOperator::Create(Instruction::Add, int32_134, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i) +PHINode* int32_137 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +int32_137->reserveOperandSpace(6); +int32_137->addIncoming(int32_123, label_false_IF_ICMPGT16_i_i_i_i_i_i); +int32_137->addIncoming(int32_126, label_false_IF_ICMPGT17_i_i_i_i_i_i); +int32_137->addIncoming(int32_129, label_false_IF_ICMPGT18_i_i_i_i_i_i); +int32_137->addIncoming(int32_132, label_false_IF_ICMPGT19_i_i_i_i_i_i); +int32_137->addIncoming(int32_135, label_false_IF_ICMPGT20_i_i_i_i_i_i); +int32_137->addIncoming(int32_121, label_GOTO_or_IF_9_i_i_i_i_i_i); + +std::vector ptr_138_indices; +ptr_138_indices.push_back(const_int32_76); +ptr_138_indices.push_back(const_int32_76); +Instruction* ptr_138 = GetElementPtrInst::Create(ptr_108, ptr_138_indices.begin(), ptr_138_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* ptr_139 = new LoadInst(ptr_138, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +BinaryOperator* int32_140 = BinaryOperator::Create(Instruction::Add, int32_137, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_141 = new BitCastInst(ptr_139, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +GetElementPtrInst* ptr_142 = GetElementPtrInst::Create(ptr_141, int32_140, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* int32_143 = new LoadInst(ptr_142, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_144 = new IntToPtrInst(int32_143, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +ICmpInst* int1_145 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_143, const_int32_55, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_145, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); + +// Block GOTO or IF*.i.i.i.i (label_GOTO_or_IF__i_i_i_i) +std::vector ptr_147_params; +ptr_147_params.push_back(ptr_108); +ptr_147_params.push_back(int32_96); +ptr_147_params.push_back(const_int32_55); +ptr_147_params.push_back(const_int32_55); +CallInst* ptr_147 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_147_params.begin(), ptr_147_params.end(), "", label_GOTO_or_IF__i_i_i_i); +ptr_147->setCallingConv(CallingConv::C); +ptr_147->setTailCall(true); +AttrListPtr ptr_147_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_147_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_147->setAttributes(ptr_147_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i, label_GOTO_or_IF__i_i_i_i); + +// Block false IFNE.i.i.i.i (label_false_IFNE_i_i_i_i) +CastInst* ptr_149 = new IntToPtrInst(int32_143, PointerTy_27, "", label_false_IFNE_i_i_i_i); +LoadInst* ptr_150 = new LoadInst(ptr_149, "", false, label_false_IFNE_i_i_i_i); +CastInst* int32_151 = new PtrToIntInst(ptr_150, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i); + new StoreInst(int32_151, ptr_142, false, label_false_IFNE_i_i_i_i); +std::vector ptr_153_indices; +ptr_153_indices.push_back(const_int32_55); +ptr_153_indices.push_back(const_int32_55); +Instruction* ptr_153 = GetElementPtrInst::Create(ptr_144, ptr_153_indices.begin(), ptr_153_indices.end(), "", label_false_IFNE_i_i_i_i); + new StoreInst(const_ptr_77, ptr_153, false, label_false_IFNE_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i, label_false_IFNE_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i) +GetElementPtrInst* ptr_156 = GetElementPtrInst::Create(ptr_103, const_int32_57, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_157 = new BitCastInst(ptr_156, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_158 = new LoadInst(ptr_157, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +GetElementPtrInst* ptr_159 = GetElementPtrInst::Create(ptr_158, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_160 = new BitCastInst(ptr_159, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_161 = new LoadInst(ptr_160, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* int32_162 = new PtrToIntInst(ptr_161, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +BinaryOperator* int32_163 = BinaryOperator::Create(Instruction::Add, int32_162, int32_96, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_164 = new IntToPtrInst(int32_163, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +std::vector ptr_165_indices; +ptr_165_indices.push_back(const_int32_76); +ptr_165_indices.push_back(const_int32_76); +Instruction* ptr_165 = GetElementPtrInst::Create(ptr_158, ptr_165_indices.begin(), ptr_165_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_166 = new LoadInst(ptr_165, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_167 = new BitCastInst(ptr_166, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +ICmpInst* int1_168 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_164, ptr_167, ""); +BranchInst::Create(label_false_IFEQ_i_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i, int1_168, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i) +std::vector ptr_170_indices; +ptr_170_indices.push_back(const_int32_76); +ptr_170_indices.push_back(const_int32_55); +Instruction* ptr_170 = GetElementPtrInst::Create(ptr_158, ptr_170_indices.begin(), ptr_170_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); +CastInst* ptr__c_i_i_i_i = new IntToPtrInst(int32_163, PointerTy_29, ".c.i.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); + new StoreInst(ptr__c_i_i_i_i, ptr_170, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); + +// Block false IFEQ.i.i.i.i (label_false_IFEQ_i_i_i_i) +std::vector ptr_173_params; +ptr_173_params.push_back(ptr_158); +ptr_173_params.push_back(ptr_161); +ptr_173_params.push_back(ptr_164); +ptr_173_params.push_back(const_int32_55); +ptr_173_params.push_back(const_int32_55); +CallInst* ptr_173 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_173_params.begin(), ptr_173_params.end(), "", label_false_IFEQ_i_i_i_i); +ptr_173->setCallingConv(CallingConv::C); +ptr_173->setTailCall(true); +AttrListPtr ptr_173_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_12_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_173_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_12->setAttributes(ptr_12_PAL); +ptr_173->setAttributes(ptr_173_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i, label_false_IFEQ_i_i_i_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread19.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i) +std::vector ptr_175_indices; +ptr_175_indices.push_back(const_int32_57); +ptr_175_indices.push_back(const_int32_55); +ptr_175_indices.push_back(const_int32_55); +ptr_175_indices.push_back(const_int32_76); +Instruction* ptr_175 = GetElementPtrInst::Create(ptr_103, ptr_175_indices.begin(), ptr_175_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_176 = new BitCastInst(ptr_175, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_177 = new LoadInst(ptr_176, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_178 = new BitCastInst(ptr_177, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_179_params; +ptr_179_params.push_back(ptr_178); +ptr_179_params.push_back(int32_96); +ptr_179_params.push_back(const_int32_55); +ptr_179_params.push_back(const_int32_55); +CallInst* ptr_179 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_179_params.begin(), ptr_179_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ptr_179->setCallingConv(CallingConv::C); +ptr_179->setTailCall(true); +AttrListPtr ptr_179_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_179_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_179->setAttributes(ptr_179_PAL); + +std::vector ptr_180_indices; +ptr_180_indices.push_back(const_int32_55); +ptr_180_indices.push_back(const_int32_55); +Instruction* ptr_180 = GetElementPtrInst::Create(ptr_179, ptr_180_indices.begin(), ptr_180_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr__c20_i = new BitCastInst(ptr_VT, PointerTy_29, ".c20.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(ptr__c20_i, ptr_180, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_182_indices; +ptr_182_indices.push_back(const_int32_55); +ptr_182_indices.push_back(const_int32_76); +Instruction* ptr_182 = GetElementPtrInst::Create(ptr_179, ptr_182_indices.begin(), ptr_182_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_183 = new BitCastInst(ptr_182, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_184 = new LoadInst(ptr_183, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_185 = BinaryOperator::Create(Instruction::And, int8_184, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_186 = new LoadInst(const_ptr_79, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_187 = BinaryOperator::Create(Instruction::Or, int8_185, int8_186, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_188 = BinaryOperator::Create(Instruction::Or, int8_187, const_int8_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(int8_188, ptr_183, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_190 = new LoadInst(const_ptr_81, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* int32_191 = new PtrToIntInst(ptr_179, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int32_192 = BinaryOperator::Create(Instruction::And, int32_191, const_int32_82, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_193 = new IntToPtrInst(int32_192, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_194_indices; +ptr_194_indices.push_back(const_int32_57); +ptr_194_indices.push_back(const_int32_76); +Instruction* ptr_194 = GetElementPtrInst::Create(ptr_190, ptr_194_indices.begin(), ptr_194_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_195 = new LoadInst(ptr_194, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +GetElementPtrInst* ptr_196 = GetElementPtrInst::Create(ptr_195, const_int32_70, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_197 = new BitCastInst(ptr_196, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_198 = new LoadInst(ptr_197, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ICmpInst* int1_199 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i, ICmpInst::ICMP_EQ, ptr_198, const_ptr_83, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i5_i_i_i_i_i, int1_199, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i) +GetElementPtrInst* ptr_201 = GetElementPtrInst::Create(ptr_103, const_int32_53, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +CastInst* ptr_202 = new BitCastInst(ptr_201, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +LoadInst* ptr_203 = new LoadInst(ptr_202, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +BinaryOperator* int32_204 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +ICmpInst* int1_205 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_205, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); + +// Block GOTO or IF*4.i.i.i6.i.i.i (label_GOTO_or_IF_4_i_i_i6_i_i_i) +ICmpInst* int1_207 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_207, label_GOTO_or_IF_4_i_i_i6_i_i_i); + +// Block GOTO or IF*6.i.i.i7.i.i.i (label_GOTO_or_IF_6_i_i_i7_i_i_i) +ICmpInst* int1_209 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_209, label_GOTO_or_IF_6_i_i_i7_i_i_i); + +// Block GOTO or IF*7.i.i1.i8.i.i.i (label_GOTO_or_IF_7_i_i1_i8_i_i_i) +ICmpInst* int1_211 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_211, label_GOTO_or_IF_7_i_i1_i8_i_i_i); + +// Block GOTO or IF*8.i.i.i9.i.i.i (label_GOTO_or_IF_8_i_i_i9_i_i_i) +ICmpInst* int1_213 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_204, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_213, label_GOTO_or_IF_8_i_i_i9_i_i_i); + +// Block GOTO or IF*9.i.i.i10.i.i.i (label_GOTO_or_IF_9_i_i_i10_i_i_i) +BinaryOperator* int32_215 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_68, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BinaryOperator* int32_216 = BinaryOperator::Create(Instruction::Add, int32_215, const_int32_69, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_GOTO_or_IF_9_i_i_i10_i_i_i); + +// Block false IF_ICMPGT16.i.i.i11.i.i.i (label_false_IF_ICMPGT16_i_i_i11_i_i_i) +BinaryOperator* int32_218 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i11_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i); + +// Block false IF_ICMPGT17.i.i.i12.i.i.i (label_false_IF_ICMPGT17_i_i_i12_i_i_i) +BinaryOperator* int32_220 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BinaryOperator* int32_221 = BinaryOperator::Create(Instruction::Add, int32_220, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i); + +// Block false IF_ICMPGT18.i.i.i13.i.i.i (label_false_IF_ICMPGT18_i_i_i13_i_i_i) +BinaryOperator* int32_223 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BinaryOperator* int32_224 = BinaryOperator::Create(Instruction::Add, int32_223, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i); + +// Block false IF_ICMPGT19.i.i.i14.i.i.i (label_false_IF_ICMPGT19_i_i_i14_i_i_i) +BinaryOperator* int32_226 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BinaryOperator* int32_227 = BinaryOperator::Create(Instruction::Add, int32_226, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i); + +// Block false IF_ICMPGT20.i.i.i15.i.i.i (label_false_IF_ICMPGT20_i_i_i15_i_i_i) +BinaryOperator* int32_229 = BinaryOperator::Create(Instruction::AShr, int32_204, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BinaryOperator* int32_230 = BinaryOperator::Create(Instruction::Add, int32_229, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i) +PHINode* int32_232 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +int32_232->reserveOperandSpace(6); +int32_232->addIncoming(int32_218, label_false_IF_ICMPGT16_i_i_i11_i_i_i); +int32_232->addIncoming(int32_221, label_false_IF_ICMPGT17_i_i_i12_i_i_i); +int32_232->addIncoming(int32_224, label_false_IF_ICMPGT18_i_i_i13_i_i_i); +int32_232->addIncoming(int32_227, label_false_IF_ICMPGT19_i_i_i14_i_i_i); +int32_232->addIncoming(int32_230, label_false_IF_ICMPGT20_i_i_i15_i_i_i); +int32_232->addIncoming(int32_216, label_GOTO_or_IF_9_i_i_i10_i_i_i); + +std::vector ptr_233_indices; +ptr_233_indices.push_back(const_int32_76); +ptr_233_indices.push_back(const_int32_76); +Instruction* ptr_233 = GetElementPtrInst::Create(ptr_203, ptr_233_indices.begin(), ptr_233_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* ptr_234 = new LoadInst(ptr_233, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +BinaryOperator* int32_235 = BinaryOperator::Create(Instruction::Add, int32_232, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_236 = new BitCastInst(ptr_234, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +GetElementPtrInst* ptr_237 = GetElementPtrInst::Create(ptr_236, int32_235, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* int32_238 = new LoadInst(ptr_237, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_239 = new IntToPtrInst(int32_238, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +ICmpInst* int1_240 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_238, const_int32_55, ""); +BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_240, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); + +// Block GOTO or IF*.i17.i.i.i (label_GOTO_or_IF__i17_i_i_i) +std::vector ptr_242_params; +ptr_242_params.push_back(ptr_203); +ptr_242_params.push_back(int32_96); +ptr_242_params.push_back(const_int32_55); +ptr_242_params.push_back(const_int32_55); +CallInst* ptr_242 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_242_params.begin(), ptr_242_params.end(), "", label_GOTO_or_IF__i17_i_i_i); +ptr_242->setCallingConv(CallingConv::C); +ptr_242->setTailCall(true); +AttrListPtr ptr_242_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_242_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_242->setAttributes(ptr_242_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i, label_GOTO_or_IF__i17_i_i_i); + +// Block false IFNE.i21.i.i.i (label_false_IFNE_i21_i_i_i) +CastInst* ptr_244 = new IntToPtrInst(int32_238, PointerTy_27, "", label_false_IFNE_i21_i_i_i); +LoadInst* ptr_245 = new LoadInst(ptr_244, "", false, label_false_IFNE_i21_i_i_i); +CastInst* int32_246 = new PtrToIntInst(ptr_245, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i); + new StoreInst(int32_246, ptr_237, false, label_false_IFNE_i21_i_i_i); +std::vector ptr_248_indices; +ptr_248_indices.push_back(const_int32_55); +ptr_248_indices.push_back(const_int32_55); +Instruction* ptr_248 = GetElementPtrInst::Create(ptr_239, ptr_248_indices.begin(), ptr_248_indices.end(), "", label_false_IFNE_i21_i_i_i); + new StoreInst(const_ptr_77, ptr_248, false, label_false_IFNE_i21_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i, label_false_IFNE_i21_i_i_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread21.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i) +std::vector ptr_251_indices; +ptr_251_indices.push_back(const_int32_53); +ptr_251_indices.push_back(const_int32_55); +ptr_251_indices.push_back(const_int32_55); +ptr_251_indices.push_back(const_int32_76); +Instruction* ptr_251 = GetElementPtrInst::Create(ptr_103, ptr_251_indices.begin(), ptr_251_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_252 = new BitCastInst(ptr_251, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_253 = new LoadInst(ptr_252, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_254 = new BitCastInst(ptr_253, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_255_params; +ptr_255_params.push_back(ptr_254); +ptr_255_params.push_back(int32_96); +ptr_255_params.push_back(const_int32_55); +ptr_255_params.push_back(const_int32_55); +CallInst* ptr_255 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_255_params.begin(), ptr_255_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ptr_255->setCallingConv(CallingConv::C); +ptr_255->setTailCall(true); +AttrListPtr ptr_255_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_255_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_255->setAttributes(ptr_255_PAL); + +std::vector ptr_256_indices; +ptr_256_indices.push_back(const_int32_55); +ptr_256_indices.push_back(const_int32_55); +Instruction* ptr_256 = GetElementPtrInst::Create(ptr_255, ptr_256_indices.begin(), ptr_256_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr__c22_i = new BitCastInst(ptr_VT, PointerTy_29, ".c22.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(ptr__c22_i, ptr_256, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_258_indices; +ptr_258_indices.push_back(const_int32_55); +ptr_258_indices.push_back(const_int32_76); +Instruction* ptr_258 = GetElementPtrInst::Create(ptr_255, ptr_258_indices.begin(), ptr_258_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_259 = new BitCastInst(ptr_258, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_260 = new LoadInst(ptr_259, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_261 = BinaryOperator::Create(Instruction::And, int8_260, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_262 = new LoadInst(const_ptr_84, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_263 = BinaryOperator::Create(Instruction::Or, int8_261, int8_262, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_264 = BinaryOperator::Create(Instruction::Or, int8_263, const_int8_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(int8_264, ptr_259, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_266 = new LoadInst(const_ptr_85, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* int32_267 = new PtrToIntInst(ptr_255, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int32_268 = BinaryOperator::Create(Instruction::And, int32_267, const_int32_82, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_269 = new IntToPtrInst(int32_268, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_270_indices; +ptr_270_indices.push_back(const_int32_57); +ptr_270_indices.push_back(const_int32_76); +Instruction* ptr_270 = GetElementPtrInst::Create(ptr_266, ptr_270_indices.begin(), ptr_270_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_271 = new LoadInst(ptr_270, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +GetElementPtrInst* ptr_272 = GetElementPtrInst::Create(ptr_271, const_int32_70, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_273 = new BitCastInst(ptr_272, PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_274 = new LoadInst(ptr_273, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ICmpInst* int1_275 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i, ICmpInst::ICMP_EQ, ptr_274, const_ptr_83, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_true_IFNULL_i5_i_i9_i_i_i, int1_275, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i) +std::vector ptr_277_indices; +ptr_277_indices.push_back(const_int32_59); +ptr_277_indices.push_back(const_int32_55); +ptr_277_indices.push_back(const_int32_55); +ptr_277_indices.push_back(const_int32_76); +Instruction* ptr_277 = GetElementPtrInst::Create(ptr_103, ptr_277_indices.begin(), ptr_277_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_278 = new BitCastInst(ptr_277, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +LoadInst* ptr_279 = new LoadInst(ptr_278, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_280 = new BitCastInst(ptr_279, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +BinaryOperator* int32_281 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +ICmpInst* int1_282 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_282, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); + +// Block GOTO or IF*4.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i) +ICmpInst* int1_284 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_284, label_GOTO_or_IF_4_i_i_i_i_i); + +// Block GOTO or IF*6.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i) +ICmpInst* int1_286 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_286, label_GOTO_or_IF_6_i_i_i_i_i); + +// Block GOTO or IF*7.i.i1.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i) +ICmpInst* int1_288 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_288, label_GOTO_or_IF_7_i_i1_i_i_i); + +// Block GOTO or IF*8.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i) +ICmpInst* int1_290 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_281, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_290, label_GOTO_or_IF_8_i_i_i_i_i); + +// Block GOTO or IF*9.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i) +BinaryOperator* int32_292 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_68, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_293 = BinaryOperator::Create(Instruction::Add, int32_292, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i); + +// Block false IF_ICMPGT16.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i) +BinaryOperator* int32_295 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i); + +// Block false IF_ICMPGT17.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i) +BinaryOperator* int32_297 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_298 = BinaryOperator::Create(Instruction::Add, int32_297, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i); + +// Block false IF_ICMPGT18.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i) +BinaryOperator* int32_300 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_301 = BinaryOperator::Create(Instruction::Add, int32_300, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i); + +// Block false IF_ICMPGT19.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i) +BinaryOperator* int32_303 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_304 = BinaryOperator::Create(Instruction::Add, int32_303, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i); + +// Block false IF_ICMPGT20.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i) +BinaryOperator* int32_306 = BinaryOperator::Create(Instruction::AShr, int32_281, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_307 = BinaryOperator::Create(Instruction::Add, int32_306, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i) +PHINode* int32_309 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +int32_309->reserveOperandSpace(6); +int32_309->addIncoming(int32_295, label_false_IF_ICMPGT16_i_i_i_i_i); +int32_309->addIncoming(int32_298, label_false_IF_ICMPGT17_i_i_i_i_i); +int32_309->addIncoming(int32_301, label_false_IF_ICMPGT18_i_i_i_i_i); +int32_309->addIncoming(int32_304, label_false_IF_ICMPGT19_i_i_i_i_i); +int32_309->addIncoming(int32_307, label_false_IF_ICMPGT20_i_i_i_i_i); +int32_309->addIncoming(int32_293, label_GOTO_or_IF_9_i_i_i_i_i); + +GetElementPtrInst* ptr_310 = GetElementPtrInst::Create(ptr_279, const_int32_70, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_311 = new BitCastInst(ptr_310, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* ptr_312 = new LoadInst(ptr_311, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +BinaryOperator* int32_313 = BinaryOperator::Create(Instruction::Add, int32_309, const_int32_76, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_314 = new BitCastInst(ptr_312, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +GetElementPtrInst* ptr_315 = GetElementPtrInst::Create(ptr_314, int32_313, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* int32_316 = new LoadInst(ptr_315, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_317 = new IntToPtrInst(int32_316, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +ICmpInst* int1_318 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_316, const_int32_55, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_318, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); + +// Block GOTO or IF*.i.i.i (label_GOTO_or_IF__i_i_i) +std::vector ptr_320_params; +ptr_320_params.push_back(ptr_280); +ptr_320_params.push_back(int32_96); +ptr_320_params.push_back(const_int32_55); +ptr_320_params.push_back(const_int32_55); +CallInst* ptr_320 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_320_params.begin(), ptr_320_params.end(), "", label_GOTO_or_IF__i_i_i); +ptr_320->setCallingConv(CallingConv::C); +ptr_320->setTailCall(true); +AttrListPtr ptr_320_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_320_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_320->setAttributes(ptr_320_PAL); + +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i, label_GOTO_or_IF__i_i_i); + +// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i) +CastInst* ptr_322 = new IntToPtrInst(int32_316, PointerTy_27, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +LoadInst* ptr_323 = new LoadInst(ptr_322, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +CastInst* int32_324 = new PtrToIntInst(ptr_323, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(int32_324, ptr_315, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +std::vector ptr_326_indices; +ptr_326_indices.push_back(const_int32_55); +ptr_326_indices.push_back(const_int32_55); +Instruction* ptr_326 = GetElementPtrInst::Create(ptr_317, ptr_326_indices.begin(), ptr_326_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(const_ptr_77, ptr_326, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i) +PHINode* ptr__ph_i = PHINode::Create(PointerTy_28, ".ph.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +ptr__ph_i->reserveOperandSpace(2); +ptr__ph_i->addIncoming(ptr_320, label_GOTO_or_IF__i_i_i); +ptr__ph_i->addIncoming(ptr_317, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + +std::vector ptr_329_indices; +ptr_329_indices.push_back(const_int32_55); +ptr_329_indices.push_back(const_int32_55); +Instruction* ptr_329 = GetElementPtrInst::Create(ptr__ph_i, ptr_329_indices.begin(), ptr_329_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +CastInst* ptr__c6_i = new BitCastInst(ptr_VT, PointerTy_29, ".c6.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(ptr__c6_i, ptr_329, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +LoadInst* int8_storemerge_in_i_i1_i_i = new LoadInst(const_ptr_86, "storemerge.in.i.i1.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +std::vector ptr_331_indices; +ptr_331_indices.push_back(const_int32_55); +ptr_331_indices.push_back(const_int32_76); +Instruction* ptr_331 = GetElementPtrInst::Create(ptr__ph_i, ptr_331_indices.begin(), ptr_331_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +CastInst* ptr_332 = new BitCastInst(ptr_331, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(int8_storemerge_in_i_i1_i_i, ptr_332, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread9.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i) +PHINode* ptr__ph8_i = PHINode::Create(PointerTy_28, ".ph8.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +ptr__ph8_i->reserveOperandSpace(2); +ptr__ph8_i->addIncoming(ptr_144, label_false_IFNE_i_i_i_i); +ptr__ph8_i->addIncoming(ptr_147, label_GOTO_or_IF__i_i_i_i); + +std::vector ptr_335_indices; +ptr_335_indices.push_back(const_int32_55); +ptr_335_indices.push_back(const_int32_55); +Instruction* ptr_335 = GetElementPtrInst::Create(ptr__ph8_i, ptr_335_indices.begin(), ptr_335_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +CastInst* ptr__c10_i = new BitCastInst(ptr_VT, PointerTy_29, ".c10.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(ptr__c10_i, ptr_335, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +LoadInst* int8_storemerge_in_i_i_i_i = new LoadInst(const_ptr_87, "storemerge.in.i.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +std::vector ptr_337_indices; +ptr_337_indices.push_back(const_int32_55); +ptr_337_indices.push_back(const_int32_76); +Instruction* ptr_337 = GetElementPtrInst::Create(ptr__ph8_i, ptr_337_indices.begin(), ptr_337_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +CastInst* ptr_338 = new BitCastInst(ptr_337, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(int8_storemerge_in_i_i_i_i, ptr_338, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread13.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i) +PHINode* ptr__ph12_i = PHINode::Create(PointerTy_28, ".ph12.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +ptr__ph12_i->reserveOperandSpace(2); +ptr__ph12_i->addIncoming(ptr_173, label_false_IFEQ_i_i_i_i); +ptr__ph12_i->addIncoming(ptr_161, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); + +std::vector ptr_341_indices; +ptr_341_indices.push_back(const_int32_55); +ptr_341_indices.push_back(const_int32_55); +Instruction* ptr_341 = GetElementPtrInst::Create(ptr__ph12_i, ptr_341_indices.begin(), ptr_341_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +CastInst* ptr__c14_i = new BitCastInst(ptr_VT, PointerTy_29, ".c14.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(ptr__c14_i, ptr_341, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +std::vector ptr_343_indices; +ptr_343_indices.push_back(const_int32_55); +ptr_343_indices.push_back(const_int32_76); +Instruction* ptr_343 = GetElementPtrInst::Create(ptr__ph12_i, ptr_343_indices.begin(), ptr_343_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +CastInst* ptr_344 = new BitCastInst(ptr_343, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_345 = new LoadInst(ptr_344, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_346 = BinaryOperator::Create(Instruction::And, int8_345, const_int8_88, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_347 = new LoadInst(const_ptr_89, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_348 = BinaryOperator::Create(Instruction::Or, int8_346, int8_347, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(int8_348, ptr_344, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.thread17.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i) +PHINode* ptr__ph16_i = PHINode::Create(PointerTy_28, ".ph16.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +ptr__ph16_i->reserveOperandSpace(2); +ptr__ph16_i->addIncoming(ptr_239, label_false_IFNE_i21_i_i_i); +ptr__ph16_i->addIncoming(ptr_242, label_GOTO_or_IF__i17_i_i_i); + +std::vector ptr_351_indices; +ptr_351_indices.push_back(const_int32_55); +ptr_351_indices.push_back(const_int32_55); +Instruction* ptr_351 = GetElementPtrInst::Create(ptr__ph16_i, ptr_351_indices.begin(), ptr_351_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +CastInst* ptr__c18_i = new BitCastInst(ptr_VT, PointerTy_29, ".c18.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(ptr__c18_i, ptr_351, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +LoadInst* int8_storemerge_in_i2_i_i_i = new LoadInst(const_ptr_90, "storemerge.in.i2.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +std::vector ptr_353_indices; +ptr_353_indices.push_back(const_int32_55); +ptr_353_indices.push_back(const_int32_76); +Instruction* ptr_353 = GetElementPtrInst::Create(ptr__ph16_i, ptr_353_indices.begin(), ptr_353_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +CastInst* ptr_354 = new BitCastInst(ptr_353, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(int8_storemerge_in_i2_i_i_i, ptr_354, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + +// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i) +CallInst* void_357 = CallInst::Create(func_llvm_trap, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +void_357->setCallingConv(CallingConv::C); +void_357->setTailCall(true); +AttrListPtr void_357_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_357_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_357->setAttributes(void_357_PAL); + +new UnreachableInst(mod->getContext(), label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); + +// Block true IF*NULL.i1.i.i.i.i.i (label_true_IF_NULL_i1_i_i_i_i_i) +std::vector ptr_359_indices; +ptr_359_indices.push_back(const_int32_55); +ptr_359_indices.push_back(const_int32_55); +Instruction* ptr_359 = GetElementPtrInst::Create(ptr_193, ptr_359_indices.begin(), ptr_359_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(const_ptr_77, ptr_359, false, label_true_IF_NULL_i1_i_i_i_i_i); +GetElementPtrInst* ptr_361 = GetElementPtrInst::Create(ptr_195, const_int32_61, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_362 = new BitCastInst(ptr_361, PointerTy_27, "", label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_363 = new LoadInst(ptr_362, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_364 = new LoadInst(const_ptr_91, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* int32_365 = new PtrToIntInst(ptr_364, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i); +BinaryOperator* int32_366 = BinaryOperator::Create(Instruction::Add, int32_365, int32_192, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_367 = new IntToPtrInst(int32_366, PointerTy_27, "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(ptr_363, ptr_367, false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_369 = new LoadInst(ptr_362, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +ICmpInst* int1_370 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_369, const_ptr_92, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i, int1_370, label_true_IF_NULL_i1_i_i_i_i_i); + +// Block GOTO or IF*1.i3.i.i.i.i.i (label_GOTO_or_IF_1_i3_i_i_i_i_i) +CastInst* ptr_372 = new BitCastInst(ptr_361, PointerTy_33, "", label_GOTO_or_IF_1_i3_i_i_i_i_i); +CastInst* ptr__c1_i2_i_i_i_i_i = new IntToPtrInst(int32_192, PointerTy_29, ".c1.i2.i.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i_i); + new StoreInst(ptr__c1_i2_i_i_i_i_i, ptr_372, false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +LoadInst* ptr_374 = new LoadInst(ptr_197, "", false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +ICmpInst* int1_375 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_374, const_ptr_83, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i, int1_375, label_GOTO_or_IF_1_i3_i_i_i_i_i); + +// Block true IFNULL.i5.i.i.i.i.i (label_true_IFNULL_i5_i_i_i_i_i) +GetElementPtrInst* ptr_377 = GetElementPtrInst::Create(ptr_198, const_int32_61, "", label_true_IFNULL_i5_i_i_i_i_i); +CastInst* ptr_378 = new BitCastInst(ptr_377, PointerTy_25, "", label_true_IFNULL_i5_i_i_i_i_i); +BranchInst::Create(label_bb2_i_i22_i, label_true_IFNULL_i5_i_i_i_i_i); + +// Block bb.i.i20.i (label_bb_i_i20_i) +Argument* fwdref_381 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb1_i_i21_i, fwdref_381, label_bb_i_i20_i); + +// Block bb1.i.i21.i (label_bb1_i_i21_i) +Argument* fwdref_383 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_382 = BinaryOperator::Create(Instruction::Add, fwdref_383, const_int32_76, "", label_bb1_i_i21_i); +BranchInst::Create(label_bb2_i_i22_i, label_bb1_i_i21_i); + +// Block bb2.i.i22.i (label_bb2_i_i22_i) +PHINode* int32_385 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i22_i); +int32_385->reserveOperandSpace(2); +int32_385->addIncoming(const_int32_55, label_true_IFNULL_i5_i_i_i_i_i); +int32_385->addIncoming(int32_382, label_bb1_i_i21_i); + +ICmpInst* int1_386 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_ULT, int32_385, const_int32_93, ""); +std::vector void_387_params; +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +void_387_params.push_back(const_int1_94); +CallInst* void_387 = CallInst::Create(func_llvm_memory_barrier, void_387_params.begin(), void_387_params.end(), "", label_bb2_i_i22_i); +void_387->setCallingConv(CallingConv::C); +void_387->setTailCall(true); +AttrListPtr void_387_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_387_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_387->setAttributes(void_387_PAL); + +std::vector int32_388_params; +int32_388_params.push_back(ptr_378); +int32_388_params.push_back(const_int32_55); +int32_388_params.push_back(const_int32_76); +CallInst* int32_388 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_388_params.begin(), int32_388_params.end(), "", label_bb2_i_i22_i); +int32_388->setCallingConv(CallingConv::C); +int32_388->setTailCall(true); +AttrListPtr int32_388_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_388_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_388->setAttributes(int32_388_PAL); + +std::vector void_389_params; +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +void_389_params.push_back(const_int1_94); +CallInst* void_389 = CallInst::Create(func_llvm_memory_barrier, void_389_params.begin(), void_389_params.end(), "", label_bb2_i_i22_i); +void_389->setCallingConv(CallingConv::C); +void_389->setTailCall(true); +AttrListPtr void_389_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_389_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_389->setAttributes(void_389_PAL); + +ICmpInst* int1_390 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_EQ, int32_388, const_int32_55, ""); +BranchInst::Create(label_bb_i_i20_i, label_bb4_preheader_i_i23_i, int1_386, label_bb2_i_i22_i); + +// Block bb4.preheader.i.i23.i (label_bb4_preheader_i_i23_i) +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i24_i, int1_390, label_bb4_preheader_i_i23_i); + +// Block bb3.i.i24.i (label_bb3_i_i24_i) +CallInst* void_393 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i24_i); +void_393->setCallingConv(CallingConv::C); +void_393->setTailCall(true); +AttrListPtr void_393_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_393_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_393->setAttributes(void_393_PAL); + +std::vector void_394_params; +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +void_394_params.push_back(const_int1_94); +CallInst* void_394 = CallInst::Create(func_llvm_memory_barrier, void_394_params.begin(), void_394_params.end(), "", label_bb3_i_i24_i); +void_394->setCallingConv(CallingConv::C); +void_394->setTailCall(true); +AttrListPtr void_394_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_394_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_394->setAttributes(void_394_PAL); + +std::vector int32_395_params; +int32_395_params.push_back(ptr_378); +int32_395_params.push_back(const_int32_55); +int32_395_params.push_back(const_int32_76); +CallInst* int32_395 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_395_params.begin(), int32_395_params.end(), "", label_bb3_i_i24_i); +int32_395->setCallingConv(CallingConv::C); +int32_395->setTailCall(true); +AttrListPtr int32_395_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_395_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_395->setAttributes(int32_395_PAL); + +std::vector void_396_params; +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +void_396_params.push_back(const_int1_94); +CallInst* void_396 = CallInst::Create(func_llvm_memory_barrier, void_396_params.begin(), void_396_params.end(), "", label_bb3_i_i24_i); +void_396->setCallingConv(CallingConv::C); +void_396->setTailCall(true); +AttrListPtr void_396_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_396_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_396->setAttributes(void_396_PAL); + +ICmpInst* int1_397 = new ICmpInst(*label_bb3_i_i24_i, ICmpInst::ICMP_EQ, int32_395, const_int32_55, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i24_i, int1_397, label_bb3_i_i24_i); + +// Block false IFNE.i7.i.i.i.i.i (label_false_IFNE_i7_i_i_i_i_i) +std::vector ptr_399_indices; +ptr_399_indices.push_back(const_int32_55); +ptr_399_indices.push_back(const_int32_55); +Instruction* ptr_399 = GetElementPtrInst::Create(ptr_369, ptr_399_indices.begin(), ptr_399_indices.end(), "", label_false_IFNE_i7_i_i_i_i_i); +CastInst* ptr__c_i6_i_i_i_i_i = new IntToPtrInst(int32_192, PointerTy_29, ".c.i6.i.i.i.i.i", label_false_IFNE_i7_i_i_i_i_i); + new StoreInst(ptr__c_i6_i_i_i_i_i, ptr_399, false, label_false_IFNE_i7_i_i_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i); + +// Block true IFNULL3.i8.i.i.i.i.i (label_true_IFNULL3_i8_i_i_i_i_i) +GetElementPtrInst* ptr_402 = GetElementPtrInst::Create(ptr_374, const_int32_61, "", label_true_IFNULL3_i8_i_i_i_i_i); +CastInst* ptr_403 = new BitCastInst(ptr_402, PointerTy_25, "", label_true_IFNULL3_i8_i_i_i_i_i); + new StoreInst(const_int32_55, ptr_403, false, label_true_IFNULL3_i8_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i); + +// Block true IF*NULL.i1.i.i6.i.i.i (label_true_IF_NULL_i1_i_i6_i_i_i) +std::vector ptr_406_indices; +ptr_406_indices.push_back(const_int32_55); +ptr_406_indices.push_back(const_int32_55); +Instruction* ptr_406 = GetElementPtrInst::Create(ptr_269, ptr_406_indices.begin(), ptr_406_indices.end(), "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(const_ptr_77, ptr_406, false, label_true_IF_NULL_i1_i_i6_i_i_i); +GetElementPtrInst* ptr_408 = GetElementPtrInst::Create(ptr_271, const_int32_61, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_409 = new BitCastInst(ptr_408, PointerTy_27, "", label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_410 = new LoadInst(ptr_409, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_411 = new LoadInst(const_ptr_91, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* int32_412 = new PtrToIntInst(ptr_411, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i6_i_i_i); +BinaryOperator* int32_413 = BinaryOperator::Create(Instruction::Add, int32_412, int32_268, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_414 = new IntToPtrInst(int32_413, PointerTy_27, "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(ptr_410, ptr_414, false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_416 = new LoadInst(ptr_409, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +ICmpInst* int1_417 = new ICmpInst(*label_true_IF_NULL_i1_i_i6_i_i_i, ICmpInst::ICMP_EQ, ptr_416, const_ptr_92, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i8_i_i_i, label_false_IFNE_i7_i_i11_i_i_i, int1_417, label_true_IF_NULL_i1_i_i6_i_i_i); + +// Block GOTO or IF*1.i3.i.i8.i.i.i (label_GOTO_or_IF_1_i3_i_i8_i_i_i) +CastInst* ptr_419 = new BitCastInst(ptr_408, PointerTy_33, "", label_GOTO_or_IF_1_i3_i_i8_i_i_i); +CastInst* ptr__c1_i2_i_i7_i_i_i = new IntToPtrInst(int32_268, PointerTy_29, ".c1.i2.i.i7.i.i.i", label_GOTO_or_IF_1_i3_i_i8_i_i_i); + new StoreInst(ptr__c1_i2_i_i7_i_i_i, ptr_419, false, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +LoadInst* ptr_421 = new LoadInst(ptr_273, "", false, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +ICmpInst* int1_422 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i8_i_i_i, ICmpInst::ICMP_EQ, ptr_421, const_ptr_83, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i12_i_i_i, int1_422, label_GOTO_or_IF_1_i3_i_i8_i_i_i); + +// Block true IFNULL.i5.i.i9.i.i.i (label_true_IFNULL_i5_i_i9_i_i_i) +GetElementPtrInst* ptr_424 = GetElementPtrInst::Create(ptr_274, const_int32_61, "", label_true_IFNULL_i5_i_i9_i_i_i); +CastInst* ptr_425 = new BitCastInst(ptr_424, PointerTy_25, "", label_true_IFNULL_i5_i_i9_i_i_i); +BranchInst::Create(label_bb2_i_i_i, label_true_IFNULL_i5_i_i9_i_i_i); + +// Block bb.i.i.i (label_bb_i_i_i) +Argument* fwdref_428 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb1_i_i_i, fwdref_428, label_bb_i_i_i); + +// Block bb1.i.i.i (label_bb1_i_i_i) +Argument* fwdref_430 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_429 = BinaryOperator::Create(Instruction::Add, fwdref_430, const_int32_76, "", label_bb1_i_i_i); +BranchInst::Create(label_bb2_i_i_i, label_bb1_i_i_i); + +// Block bb2.i.i.i (label_bb2_i_i_i) +PHINode* int32_432 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); +int32_432->reserveOperandSpace(2); +int32_432->addIncoming(const_int32_55, label_true_IFNULL_i5_i_i9_i_i_i); +int32_432->addIncoming(int32_429, label_bb1_i_i_i); + +ICmpInst* int1_433 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_432, const_int32_93, ""); +std::vector void_434_params; +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +void_434_params.push_back(const_int1_94); +CallInst* void_434 = CallInst::Create(func_llvm_memory_barrier, void_434_params.begin(), void_434_params.end(), "", label_bb2_i_i_i); +void_434->setCallingConv(CallingConv::C); +void_434->setTailCall(true); +AttrListPtr void_434_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_434_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_434->setAttributes(void_434_PAL); + +std::vector int32_435_params; +int32_435_params.push_back(ptr_425); +int32_435_params.push_back(const_int32_55); +int32_435_params.push_back(const_int32_76); +CallInst* int32_435 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_435_params.begin(), int32_435_params.end(), "", label_bb2_i_i_i); +int32_435->setCallingConv(CallingConv::C); +int32_435->setTailCall(true); +AttrListPtr int32_435_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_435_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_435->setAttributes(int32_435_PAL); + +std::vector void_436_params; +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +void_436_params.push_back(const_int1_94); +CallInst* void_436 = CallInst::Create(func_llvm_memory_barrier, void_436_params.begin(), void_436_params.end(), "", label_bb2_i_i_i); +void_436->setCallingConv(CallingConv::C); +void_436->setTailCall(true); +AttrListPtr void_436_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_436_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_436->setAttributes(void_436_PAL); + +ICmpInst* int1_437 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_435, const_int32_55, ""); +BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_433, label_bb2_i_i_i); + +// Block bb4.preheader.i.i.i (label_bb4_preheader_i_i_i) +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb3_i_i_i, int1_437, label_bb4_preheader_i_i_i); + +// Block bb3.i.i.i (label_bb3_i_i_i) +CallInst* void_440 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); +void_440->setCallingConv(CallingConv::C); +void_440->setTailCall(true); +AttrListPtr void_440_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_440_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_440->setAttributes(void_440_PAL); + +std::vector void_441_params; +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +void_441_params.push_back(const_int1_94); +CallInst* void_441 = CallInst::Create(func_llvm_memory_barrier, void_441_params.begin(), void_441_params.end(), "", label_bb3_i_i_i); +void_441->setCallingConv(CallingConv::C); +void_441->setTailCall(true); +AttrListPtr void_441_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_441_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_441->setAttributes(void_441_PAL); + +std::vector int32_442_params; +int32_442_params.push_back(ptr_425); +int32_442_params.push_back(const_int32_55); +int32_442_params.push_back(const_int32_76); +CallInst* int32_442 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_442_params.begin(), int32_442_params.end(), "", label_bb3_i_i_i); +int32_442->setCallingConv(CallingConv::C); +int32_442->setTailCall(true); +AttrListPtr int32_442_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_442_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_442->setAttributes(int32_442_PAL); + +std::vector void_443_params; +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +void_443_params.push_back(const_int1_94); +CallInst* void_443 = CallInst::Create(func_llvm_memory_barrier, void_443_params.begin(), void_443_params.end(), "", label_bb3_i_i_i); +void_443->setCallingConv(CallingConv::C); +void_443->setTailCall(true); +AttrListPtr void_443_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_443_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_443->setAttributes(void_443_PAL); + +ICmpInst* int1_444 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_442, const_int32_55, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb3_i_i_i, int1_444, label_bb3_i_i_i); + +// Block false IFNE.i7.i.i11.i.i.i (label_false_IFNE_i7_i_i11_i_i_i) +std::vector ptr_446_indices; +ptr_446_indices.push_back(const_int32_55); +ptr_446_indices.push_back(const_int32_55); +Instruction* ptr_446 = GetElementPtrInst::Create(ptr_416, ptr_446_indices.begin(), ptr_446_indices.end(), "", label_false_IFNE_i7_i_i11_i_i_i); +CastInst* ptr__c_i6_i_i10_i_i_i = new IntToPtrInst(int32_268, PointerTy_29, ".c.i6.i.i10.i.i.i", label_false_IFNE_i7_i_i11_i_i_i); + new StoreInst(ptr__c_i6_i_i10_i_i_i, ptr_446, false, label_false_IFNE_i7_i_i11_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i8_i_i_i, label_false_IFNE_i7_i_i11_i_i_i); + +// Block true IFNULL3.i8.i.i12.i.i.i (label_true_IFNULL3_i8_i_i12_i_i_i) +GetElementPtrInst* ptr_449 = GetElementPtrInst::Create(ptr_421, const_int32_61, "", label_true_IFNULL3_i8_i_i12_i_i_i); +CastInst* ptr_450 = new BitCastInst(ptr_449, PointerTy_25, "", label_true_IFNULL3_i8_i_i12_i_i_i); + new StoreInst(const_int32_55, ptr_450, false, label_true_IFNULL3_i8_i_i12_i_i_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i12_i_i_i); + +// Block JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit (label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit) +PHINode* ptr_453 = PHINode::Create(PointerTy_28, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_453->reserveOperandSpace(8); +ptr_453->addIncoming(ptr_255, label_true_IFNULL3_i8_i_i12_i_i_i); +ptr_453->addIncoming(ptr__ph16_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +ptr_453->addIncoming(ptr_179, label_true_IFNULL3_i8_i_i_i_i_i); +ptr_453->addIncoming(ptr__ph12_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +ptr_453->addIncoming(ptr__ph8_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +ptr_453->addIncoming(ptr__ph_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +ptr_453->addIncoming(ptr_255, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +ptr_453->addIncoming(ptr_179, label_GOTO_or_IF_1_i3_i_i_i_i_i); + +CastInst* ptr_tmp1 = new BitCastInst(ptr_453, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ReturnInst::Create(mod->getContext(), ptr_tmp1, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr_tmp1 = new BitCastInst(ptr_12, PointerTy_0, "tmp1", label_entry); -ReturnInst::Create(mod->getContext(), ptr_tmp1, label_entry); +// Resolve Forward References +fwdref_383->replaceAllUsesWith(int32_385); delete fwdref_383; +fwdref_381->replaceAllUsesWith(int1_390); delete fwdref_381; +fwdref_430->replaceAllUsesWith(int32_432); delete fwdref_430; +fwdref_428->replaceAllUsesWith(int1_437); delete fwdref_428; return func_gcmalloc; } Modified: vmkit/branches/precise/mmtk/java/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/java/Makefile?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/java/Makefile (original) +++ vmkit/branches/precise/mmtk/java/Makefile Tue Oct 12 10:37:57 2010 @@ -12,6 +12,6 @@ RUN_ANT = 1 JARNAME = mmtk-vmkit -EXTRA_DIST = vmkit.properties build.xml src +EXTRA_DIST = vmkit.properties build.xml.in src include $(LEVEL)/Makefile.common Modified: vmkit/branches/precise/mmtk/java/build.xml.in URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/java/build.xml.in?rev=116308&r1=116307&r2=116308&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/java/build.xml.in (original) +++ vmkit/branches/precise/mmtk/java/build.xml.in Tue Oct 12 10:37:57 2010 @@ -1,7 +1,7 @@ - + From nicolas.geoffray at lip6.fr Sat Oct 23 11:54:29 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 23 Oct 2010 18:54:29 -0000 Subject: [vmkit-commits] [vmkit] r117215 - in /vmkit/branches/precise: lib/J3/VMCore/JavaObject.cpp mmtk/config/copyms/ObjectHeader.h mmtk/config/marksweep/ObjectHeader.h Message-ID: <20101023185429.C4A212A6C12C@llvm.org> Author: geoffray Date: Sat Oct 23 13:54:29 2010 New Revision: 117215 URL: http://llvm.org/viewvc/llvm-project?rev=117215&view=rev Log: The header must now be 8 bits (since MMTk 3.1.1). Modified: vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp vmkit/branches/precise/mmtk/config/copyms/ObjectHeader.h vmkit/branches/precise/mmtk/config/marksweep/ObjectHeader.h Modified: vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp?rev=117215&r1=117214&r2=117215&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp Sat Oct 23 13:54:29 2010 @@ -45,7 +45,6 @@ } assert(val > mvm::GCBitMask); assert(val <= mvm::HashMask); - assert(val != hashCodeGenerator); do { header = self->header; Modified: vmkit/branches/precise/mmtk/config/copyms/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/config/copyms/ObjectHeader.h?rev=117215&r1=117214&r2=117215&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/config/copyms/ObjectHeader.h (original) +++ vmkit/branches/precise/mmtk/config/copyms/ObjectHeader.h Sat Oct 23 13:54:29 2010 @@ -24,12 +24,12 @@ static const uint64_t ThinCountAdd = 0x1000; static const uint64_t NonLockBitsMask = 0xFFF; - static const uint64_t HashMask = 0xFF0; - static const uint64_t GCBitMask = 0xF; + static const uint64_t HashMask = 0xF00; + static const uint64_t GCBitMask = 0xFF; static const uint32_t NonLockBits = 12; - static const uint32_t HashBits = 8; - static const uint32_t GCBits = 4; + static const uint32_t HashBits = 4; + static const uint32_t GCBits = 8; static const bool MovesObject = true; } Modified: vmkit/branches/precise/mmtk/config/marksweep/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/config/marksweep/ObjectHeader.h?rev=117215&r1=117214&r2=117215&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/config/marksweep/ObjectHeader.h (original) +++ vmkit/branches/precise/mmtk/config/marksweep/ObjectHeader.h Sat Oct 23 13:54:29 2010 @@ -24,12 +24,12 @@ static const uint64_t ThinCountAdd = 0x1000; static const uint64_t NonLockBitsMask = 0xFFF; - static const uint64_t HashMask = 0xFF0; - static const uint64_t GCBitMask = 0xF; + static const uint64_t HashMask = 0xF00; + static const uint64_t GCBitMask = 0xFF; static const uint32_t NonLockBits = 12; static const uint32_t HashBits = 0; - static const uint32_t GCBits = 4; + static const uint32_t GCBits = 8; static const bool MovesObject = false; } From nicolas.geoffray at lip6.fr Sat Oct 23 11:56:31 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 23 Oct 2010 18:56:31 -0000 Subject: [vmkit-commits] [vmkit] r117216 - in /vmkit/branches/precise: include/j3/JavaJITCompiler.h include/j3/JavaLLVMCompiler.h include/j3/LLVMMaterializer.h lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/Compiler/JavaLLVMCompiler.cpp lib/J3/Compiler/LLVMMaterializer.cpp lib/J3/VMCore/JavaClass.cpp Message-ID: <20101023185631.6073C2A6C12C@llvm.org> Author: geoffray Date: Sat Oct 23 13:56:31 2010 New Revision: 117216 URL: http://llvm.org/viewvc/llvm-project?rev=117216&view=rev Log: The bootstrap classes can not really be trusted either (eg Array.sort). Modified: vmkit/branches/precise/include/j3/JavaJITCompiler.h vmkit/branches/precise/include/j3/JavaLLVMCompiler.h vmkit/branches/precise/include/j3/LLVMMaterializer.h vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp vmkit/branches/precise/lib/J3/Compiler/JavaLLVMCompiler.cpp vmkit/branches/precise/lib/J3/Compiler/LLVMMaterializer.cpp vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp Modified: vmkit/branches/precise/include/j3/JavaJITCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/j3/JavaJITCompiler.h?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/include/j3/JavaJITCompiler.h (original) +++ vmkit/branches/precise/include/j3/JavaJITCompiler.h Sat Oct 23 13:56:31 2010 @@ -40,7 +40,7 @@ llvm::ExecutionEngine* executionEngine; llvm::GCStrategy* TheGCStrategy; - JavaJITCompiler(const std::string &ModuleID, bool trusted = false); + JavaJITCompiler(const std::string &ModuleID); ~JavaJITCompiler(); virtual bool isStaticCompiling() { @@ -104,10 +104,10 @@ virtual uintptr_t getPointerOrStub(JavaMethod& meth, int side); virtual JavaCompiler* Create(const std::string& ModuleID) { - return new JavaJ3LazyJITCompiler(ModuleID, false); + return new JavaJ3LazyJITCompiler(ModuleID); } - JavaJ3LazyJITCompiler(const std::string& ModuleID, bool trusted); + JavaJ3LazyJITCompiler(const std::string& ModuleID); }; } // end namespace j3 Modified: vmkit/branches/precise/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/j3/JavaLLVMCompiler.h?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/branches/precise/include/j3/JavaLLVMCompiler.h Sat Oct 23 13:56:31 2010 @@ -80,7 +80,7 @@ virtual bool isStaticCompiling() = 0; virtual bool emitFunctionName() = 0; virtual void* GenerateStub(llvm::Function* F) = 0; - void addJavaPasses(bool trusted); + void addJavaPasses(); llvm::DIFactory* getDebugFactory() { return DebugFactory; Modified: vmkit/branches/precise/include/j3/LLVMMaterializer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/j3/LLVMMaterializer.h?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/include/j3/LLVMMaterializer.h (original) +++ vmkit/branches/precise/include/j3/LLVMMaterializer.h Sat Oct 23 13:56:31 2010 @@ -41,10 +41,10 @@ virtual uintptr_t getPointerOrStub(JavaMethod& meth, int side); virtual JavaCompiler* Create(const std::string& ModuleID) { - return new JavaLLVMLazyJITCompiler(ModuleID, false); + return new JavaLLVMLazyJITCompiler(ModuleID); } - JavaLLVMLazyJITCompiler(const std::string& ModuleID, bool trusted); + JavaLLVMLazyJITCompiler(const std::string& ModuleID); virtual ~JavaLLVMLazyJITCompiler(); Modified: vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp Sat Oct 23 13:56:31 2010 @@ -1959,6 +1959,9 @@ if (!M->clinits->empty()) { Comp = JavaJITCompiler::CreateCompiler("JIT"); Comp->EmitFunctionName = true; + if (!M->useCooperativeGC()) { + Comp->disableCooperativeGC(); + } bootstrapLoader->setCompiler(Comp); bootstrapLoader->analyseClasspathEnv(vm->classpath); } else { @@ -1980,7 +1983,7 @@ extractFiles(bytes, M, bootstrapLoader, classes); // Now that we know if we can trust this compiler, add the Java passes. - M->addJavaPasses(M->compileRT); + M->addJavaPasses(); // First resolve everyone so that there can not be unknown references in @@ -2058,7 +2061,7 @@ } } else { - M->addJavaPasses(false); + M->addJavaPasses(); char* realName = (char*)allocator.Allocate(size + 1); if (size > 6 && !strcmp(&name[size - 6], ".class")) { memcpy(realName, name, size - 6); Modified: vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp Sat Oct 23 13:56:31 2010 @@ -243,7 +243,7 @@ return ConstantExpr::getIntToPtr(CI, valPtrType); } -JavaJITCompiler::JavaJITCompiler(const std::string &ModuleID, bool trusted) : +JavaJITCompiler::JavaJITCompiler(const std::string &ModuleID) : JavaLLVMCompiler(ModuleID), listener(this) { EmitFunctionName = false; @@ -258,7 +258,7 @@ executionEngine->RegisterJITEventListener(&listener); - addJavaPasses(trusted); + addJavaPasses(); } JavaJITCompiler::~JavaJITCompiler() { @@ -482,9 +482,8 @@ return (meth == NULL || meth->code == NULL); } -JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler(const std::string& ModuleID, - bool trusted) - : JavaJITCompiler(ModuleID, trusted) {} +JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler(const std::string& ModuleID) + : JavaJITCompiler(ModuleID) {} static llvm::cl::opt LLVMLazy("llvm-lazy", @@ -494,7 +493,7 @@ JavaJITCompiler* JavaJITCompiler::CreateCompiler(const std::string& ModuleID) { // This is called for the first compiler. if (LLVMLazy) { - return new JavaLLVMLazyJITCompiler(ModuleID, true); + return new JavaLLVMLazyJITCompiler(ModuleID); } - return new JavaJ3LazyJITCompiler(ModuleID, true); + return new JavaJ3LazyJITCompiler(ModuleID); } Modified: vmkit/branches/precise/lib/J3/Compiler/JavaLLVMCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaLLVMCompiler.cpp?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaLLVMCompiler.cpp Sat Oct 23 13:56:31 2010 @@ -116,7 +116,7 @@ llvm::FunctionPass* createLowerConstantCallsPass(JavaLLVMCompiler* I); } -void JavaLLVMCompiler::addJavaPasses(bool trusted) { +void JavaLLVMCompiler::addJavaPasses() { JavaNativeFunctionPasses = new FunctionPassManager(TheModule); JavaNativeFunctionPasses->add(new TargetData(TheModule)); // Lower constant calls to lower things like getClass used @@ -124,9 +124,7 @@ JavaNativeFunctionPasses->add(createLowerConstantCallsPass(this)); JavaFunctionPasses = new FunctionPassManager(TheModule); - // Add safe points in loops if we don't trust the code (trusted code doesn't - // do infinite loops). - if (cooperativeGC && !trusted) + if (cooperativeGC) JavaFunctionPasses->add(mvm::createLoopSafePointsPass()); // Add other passes after the loop pass, because safepoints may move objects. // Moving objects disable many optimizations. Modified: vmkit/branches/precise/lib/J3/Compiler/LLVMMaterializer.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/LLVMMaterializer.cpp?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/LLVMMaterializer.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/LLVMMaterializer.cpp Sat Oct 23 13:56:31 2010 @@ -27,9 +27,8 @@ using namespace j3; -JavaLLVMLazyJITCompiler::JavaLLVMLazyJITCompiler(const std::string& ModuleID, - bool trusted) - : JavaJITCompiler(ModuleID, trusted) { +JavaLLVMLazyJITCompiler::JavaLLVMLazyJITCompiler(const std::string& ModuleID) + : JavaJITCompiler(ModuleID) { TheMaterializer = new LLVMMaterializer(TheModule, this); executionEngine->DisableLazyCompilation(false); } Modified: vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp?rev=117216&r1=117215&r2=117216&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp Sat Oct 23 13:56:31 2010 @@ -1767,6 +1767,7 @@ for(uint16 i = 0; i < codeInfoLength; ++i) { if (codeInfo[i].address == ip) { Attribut* codeAtt = lookupAttribut(Attribut::codeAttribut); + if (codeAtt == NULL) return 0; Reader reader(codeAtt, &(classDef->bytes)); reader.readU2(); // max_stack reader.readU2(); // max_locals; From nicolas.geoffray at lip6.fr Sun Oct 24 04:00:06 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 11:00:06 -0000 Subject: [vmkit-commits] [vmkit] r117221 - in /vmkit/branches/precise: Makefile.rules include/mvm/Threads/Locks.h include/mvm/Threads/ObjectLocks.h include/mvm/VirtualMachine.h lib/J3/Classpath/ClasspathVMThread.inc lib/J3/VMCore/JavaLocks.cpp lib/J3/VMCore/JavaLocks.h lib/J3/VMCore/JavaObject.cpp lib/J3/VMCore/JavaObject.h lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/Jnjvm.h lib/J3/VMCore/VirtualTables.cpp lib/Mvm/CommonThread/ObjectLocks.cpp lib/Mvm/CommonThread/ctlock.cpp Message-ID: <20101024110006.573762A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 06:00:06 2010 New Revision: 117221 URL: http://llvm.org/viewvc/llvm-project?rev=117221&view=rev Log: Refactor locking code, to put ThinLock/FatLock in CommonThread instead of J3. Added: vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Modified: vmkit/branches/precise/Makefile.rules vmkit/branches/precise/include/mvm/Threads/Locks.h vmkit/branches/precise/include/mvm/VirtualMachine.h vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp vmkit/branches/precise/lib/J3/VMCore/JavaObject.h vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp vmkit/branches/precise/lib/J3/VMCore/JavaThread.h vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp vmkit/branches/precise/lib/Mvm/CommonThread/ctlock.cpp Modified: vmkit/branches/precise/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/Makefile.rules?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/Makefile.rules (original) +++ vmkit/branches/precise/Makefile.rules Sun Oct 24 06:00:06 2010 @@ -134,7 +134,7 @@ $(Verb) $(ANT) -buildfile $(PROJ_OBJ_ROOT)/mmtk/java/build.xml $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) $(Verb) $(LOPT) -load=$(LibDir)/JITGCPass$(SHLIBEXT) -std-compile-opts -JITGCPass -f $(LibDir)/MMTKAlloc.bc -o $(LibDir)/MMTKAlloc.bc - $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(PROJ_OBJ_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy + $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic $(PROJ_OBJ_ROOT)/mmtk/java/$(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled -llvm-lazy $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc Modified: vmkit/branches/precise/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/Threads/Locks.h?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/Locks.h (original) +++ vmkit/branches/precise/include/mvm/Threads/Locks.h Sun Oct 24 06:00:06 2010 @@ -188,36 +188,6 @@ void lockAll(int count); }; -class ThinLock { -public: - - /// initialise - Initialise the value of the lock. - /// - static void initialise(gc* object); - - /// overflowThinlock - Change the lock of this object to a fat lock because - /// we have reached 0xFF locks. - static void overflowThinLock(gc* object); - - /// changeToFatlock - Change the lock of this object to a fat lock. The lock - /// may be in a thin lock or fat lock state. - static FatLock* changeToFatlock(gc* object); - - /// acquire - Acquire the lock. - static void acquire(gc* object); - - /// release - Release the lock. - static void release(gc* object); - - /// owner - Returns true if the curren thread is the owner of this object's - /// lock. - static bool owner(gc* object); - - /// getFatLock - Get the fat lock is the lock is a fat lock, 0 otherwise. - static FatLock* getFatLock(gc* object); -}; - - /// SpinLock - This class implements a spin lock. A spin lock is OK to use /// when it is held during short period of times. It is CPU expensive /// otherwise. Added: vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h?rev=117221&view=auto ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h (added) +++ vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h Sun Oct 24 06:00:06 2010 @@ -0,0 +1,183 @@ +//===----------- ObjectLocks.h - Object based locks -----------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef MVM_OBJECT_LOCKS_H +#define MVM_OBJECT_LOCKS_H + +#include "ObjectHeader.h" +#include "mvm/Allocator.h" +#include "mvm/Threads/Cond.h" +#include "mvm/Threads/Locks.h" +#include "mvm/Threads/Thread.h" + +namespace mvm { + +class FatLock; +class LockSystem; + +class LockingThread { +public: + /// varcond - Condition variable when the thread needs to be awaken from + /// a wait. + /// + mvm::Cond varcond; + + /// interruptFlag - Has this thread been interrupted? + /// + uint32 interruptFlag; + + /// nextWaiting - Next thread waiting on the same monitor. + /// + LockingThread* nextWaiting; + + /// prevWaiting - Previous thread waiting on the same monitor. + /// + LockingThread* prevWaiting; + + /// waitsOn - The lock on which the thread is waiting on. + /// + FatLock* waitsOn; + + static const unsigned int StateRunning = 0; + static const unsigned int StateWaiting = 1; + static const unsigned int StateInterrupted = 2; + + /// state - The current state of this thread: Running, Waiting or Interrupted. + uint32 state; + + LockingThread() { + interruptFlag = 0; + nextWaiting = NULL; + prevWaiting = NULL; + waitsOn = NULL; + state = StateRunning; + } + + bool wait(gc* object, LockSystem& table, struct timeval* info, bool timed); + void notify(gc* object, LockSystem& table); + void notifyAll(gc* object, LockSystem& table); +}; + + +class FatLock : public mvm::PermanentObject { +private: + mvm::LockRecursive internalLock; + mvm::SpinLock spinLock; + uint32_t waitingThreads; + uint32_t lockingThreads; + LockingThread* firstThread; + gc* associatedObject; + uint32_t index; + FatLock* nextFreeLock; +public: + FatLock(uint32_t index, gc* object); + uintptr_t getID(); + int tryAcquire() { return internalLock.tryLock(); } + bool acquire(gc* object); + void acquireAll(gc* object, uint32_t count); + void release(gc* object, LockSystem& table); + mvm::Thread* getOwner(); + bool owner(); + gc* getAssociatedObject() { return associatedObject; } + gc** getAssociatedObjectPtr() { return &associatedObject; } + + friend class LockSystem; + friend class LockingThread; +}; + + +/// LockSystem - This class manages all Java locks used by the applications. +/// Each JVM must own an instance of this class and allocate Java locks +/// with it. +/// +class LockSystem { + friend class FatLock; +public: + + // Fixed values. With these values, an index is on 18 bits. + static const uint32_t GlobalSize = 128; + static const uint32_t BitIndex = 11; + static const uint32_t IndexSize = 1 << BitIndex; + static const uint32_t BitMask = IndexSize - 1; + static const uint32_t MaxLocks = GlobalSize * IndexSize; + + mvm::BumpPtrAllocator& allocator; + + /// LockTable - The global table that will hold the locks. The table is + /// a two-dimensional array, and only one entry is created, so that + /// the lock system does not eat up all memory on startup. + /// + FatLock* ** LockTable; + + /// currentIndex - The current index in the tables. Always incremented, + /// never decremented. + /// + uint32_t currentIndex; + + /// freeLock - The list of locks that are allocated and available. + /// + FatLock* freeLock; + + /// threadLock - Spin lock to protect the currentIndex field. + /// + mvm::SpinLock threadLock; + + /// allocate - Allocate a FatLock. + /// + FatLock* allocate(gc* obj); + + /// deallocate - Put a lock in the free list lock. + /// + void deallocate(FatLock* lock); + + /// LockSystem - Default constructor. Initialize the table. + /// + LockSystem(mvm::BumpPtrAllocator& allocator); + + /// getLock - Get a lock from an index in the table. + /// + FatLock* getLock(uint32_t index) { + return LockTable[index >> BitIndex][index & BitMask]; + } + + FatLock* getFatLockFromID(uintptr_t ID); +}; + +class ThinLock { +public: + + /// initialise - Initialise the value of the lock. + /// + static void initialise(gc* object, LockSystem& table); + + /// overflowThinlock - Change the lock of this object to a fat lock because + /// we have reached 0xFF locks. + static void overflowThinLock(gc* object, LockSystem& table); + + /// changeToFatlock - Change the lock of this object to a fat lock. The lock + /// may be in a thin lock or fat lock state. + static FatLock* changeToFatlock(gc* object, LockSystem& table); + + /// acquire - Acquire the lock. + static void acquire(gc* object, LockSystem& table); + + /// release - Release the lock. + static void release(gc* object, LockSystem& table); + + /// owner - Returns true if the curren thread is the owner of this object's + /// lock. + static bool owner(gc* object, LockSystem& table); + + /// getFatLock - Get the fat lock is the lock is a fat lock, 0 otherwise. + static FatLock* getFatLock(gc* object, LockSystem& table); +}; + +} // end namespace mvm + +#endif // MVM_OBJECT_LOCKS_H Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/VirtualMachine.h?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/precise/include/mvm/VirtualMachine.h Sun Oct 24 06:00:06 2010 @@ -122,17 +122,6 @@ void scan(VirtualMachine* vm, uintptr_t closure); }; -class FatLock : public mvm::PermanentObject { -public: - virtual void deallocate() = 0; - virtual uintptr_t getID() = 0; - virtual bool acquire(gc* object) = 0; - virtual void acquireAll(gc* object, uint32_t count) = 0; - virtual void release(gc* object) = 0; - virtual mvm::Thread* getOwner() = 0; - virtual bool owner() = 0; -}; - /// VirtualMachine - This class is the root of virtual machine classes. It /// defines what a VM should be. /// @@ -237,9 +226,6 @@ /// waitForExit - Wait until the virtual machine stops its execution. virtual void waitForExit() = 0; - virtual FatLock* allocateFatLock(gc* object) = 0; - virtual FatLock* getFatLockFromID(uintptr_t header) = 0; - static j3::JnjvmClassLoader* initialiseJVM(j3::JavaCompiler* C, bool dlLoad = true); static VirtualMachine* createJVM(j3::JnjvmClassLoader* C = 0); Modified: vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc Sun Oct 24 06:00:06 2010 @@ -112,13 +112,13 @@ mvm::Thread::yield(); JavaThread* th = (JavaThread*)field->getInstanceObjectField(vmthread); - th->interruptFlag = 1; - JavaLock* lock = th->waitsOn; + th->lockingThread.interruptFlag = 1; + mvm::FatLock* lock = th->lockingThread.waitsOn; // If the thread is blocked on a wait. We also verify nextWaiting in case // the thread has been notified. - if (lock && th->nextWaiting) { - th->state = JavaThread::StateInterrupted; + if (lock && th->lockingThread.nextWaiting) { + th->lockingThread.state = mvm::LockingThread::StateInterrupted; // Make sure the thread is waiting. uint32 locked = 0; @@ -130,10 +130,10 @@ } // Interrupt the thread. - th->varcond.signal(); + th->lockingThread.varcond.signal(); // Release the lock if we acquired it. - if (locked) lock->release(lock->getAssociatedObject()); + if (locked) lock->release(lock->getAssociatedObject(), vm->lockSystem); } // Here we could also raise a signal for interrupting I/O @@ -150,8 +150,8 @@ #endif ) { JavaThread* th = JavaThread::get(); - uint32 interrupt = th->interruptFlag; - th->interruptFlag = 0; + uint32 interrupt = th->lockingThread.interruptFlag; + th->lockingThread.interruptFlag = 0; return (jboolean)interrupt; } @@ -168,7 +168,7 @@ Jnjvm* vm = JavaThread::get()->getJVM(); JavaField* field = vm->upcalls->vmdataVMThread; JavaThread* th = (JavaThread*)field->getInstanceObjectField(vmthread); - return (jboolean)th->interruptFlag; + return (jboolean)th->lockingThread.interruptFlag; } // Never throws. Modified: vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp Sun Oct 24 06:00:06 2010 @@ -13,121 +13,3 @@ using namespace j3; -JavaLock* Jnjvm::allocateFatLock(gc* obj) { - llvm_gcroot(obj, 0); - JavaLock* res = lockSystem.allocate((JavaObject*)obj); - return res; -} - -void JavaLock::deallocate() { - Jnjvm* vm = JavaThread::get()->getJVM(); - vm->lockSystem.deallocate(this); -} - -JavaLock* LockSystem::allocate(JavaObject* obj) { - - llvm_gcroot(obj, 0); - JavaLock* res = 0; - threadLock.lock(); - - // Try the freeLock list. - if (freeLock != NULL) { - res = freeLock; - freeLock = res->nextFreeLock; - res->nextFreeLock = 0; - assert(res->associatedObject == NULL); - threadLock.unlock(); - res->associatedObject = obj; - } else { - // Get an index. - uint32_t index = currentIndex++; - if (index == MaxLocks) { - fprintf(stderr, "Ran out of space for allocating locks"); - abort(); - } - - JavaLock** tab = LockTable[index >> BitIndex]; - - if (tab == NULL) { - tab = (JavaLock**)associatedVM->allocator.Allocate( - IndexSize * sizeof(JavaLock*), "Index LockTable"); - } - threadLock.unlock(); - - // Allocate the lock. - res = new(associatedVM->allocator, "Lock") JavaLock(index, obj); - - // Add the lock to the table. - uint32_t internalIndex = index & BitMask; - tab[internalIndex] = res; - } - - // Return the lock. - return res; -} - -void LockSystem::deallocate(JavaLock* lock) { - lock->associatedObject = NULL; - threadLock.lock(); - lock->nextFreeLock = freeLock; - freeLock = lock; - threadLock.unlock(); -} - -LockSystem::LockSystem(Jnjvm* vm) { - associatedVM = vm; - LockTable = (JavaLock* **) - vm->allocator.Allocate(GlobalSize * sizeof(JavaLock**), "Global LockTable"); - LockTable[0] = (JavaLock**) - vm->allocator.Allocate(IndexSize * sizeof(JavaLock*), "Index LockTable"); - currentIndex = 0; - freeLock = NULL; -} - -uintptr_t JavaLock::getID() { - return (index << mvm::NonLockBits) | mvm::FatMask; -} - -JavaLock* Jnjvm::getFatLockFromID(uintptr_t ID) { - if (ID & mvm::FatMask) { - uint32_t index = (ID & ~mvm::FatMask) >> mvm::NonLockBits; - JavaLock* res = lockSystem.getLock(index); - return res; - } else { - return NULL; - } -} - -void JavaLock::release(gc* obj) { - llvm_gcroot(obj, 0); - assert(associatedObject && "No associated object when releasing"); - assert(associatedObject == obj && "Mismatch object in lock"); - if (!waitingThreads && !lockingThreads && - internalLock.recursionCount() == 1) { - mvm::ThinLock::initialise(associatedObject); - deallocate(); - } - internalLock.unlock(); -} - -/// acquire - Acquires the internalLock. -/// -bool JavaLock::acquire(gc* obj) { - llvm_gcroot(obj, 0); - - spinLock.lock(); - lockingThreads++; - spinLock.unlock(); - - internalLock.lock(); - - spinLock.lock(); - lockingThreads--; - spinLock.unlock(); - - if (associatedObject != obj) { - internalLock.unlock(); - return false; - } - return true; -} Modified: vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h Sun Oct 24 06:00:06 2010 @@ -20,140 +20,6 @@ namespace j3 { -class JavaObject; -class JavaThread; -class Jnjvm; - -class JavaLock : public mvm::FatLock { - -friend class JavaObject; -friend class LockSystem; - -private: - mvm::LockRecursive internalLock; - mvm::SpinLock spinLock; - uint32_t waitingThreads; - uint32_t lockingThreads; - JavaThread* firstThread; - JavaObject* associatedObject; - uint32_t index; - JavaLock* nextFreeLock; - -public: - - JavaObject* getAssociatedObject() { - return associatedObject; - } - - JavaObject** getAssociatedObjectPtr() { - return &associatedObject; - } - - /// acquire - Acquires the internalLock. - /// - bool acquire(gc* obj); - - /// tryAcquire - Tries to acquire the lock. - /// - int tryAcquire() { - return internalLock.tryLock(); - } - - - /// acquireAll - Acquires the lock nb times. - void acquireAll(gc* obj, uint32 nb) { - internalLock.lockAll(nb); - } - - /// release - Releases the internalLock. - /// - void release(gc* obj); - - /// owner - Returns if the current thread owns this internalLock. - /// - bool owner() { - return internalLock.selfOwner(); - } - - /// getOwner - Get the owner of this internalLock. - /// - mvm::Thread* getOwner() { - return internalLock.getOwner(); - } - - /// JavaLock - Default constructor. - JavaLock(uint32_t i, JavaObject* a) { - llvm_gcroot(a, 0); - firstThread = 0; - index = i; - associatedObject = a; - waitingThreads = 0; - lockingThreads = 0; - nextFreeLock = NULL; - } - - void deallocate(); - - uintptr_t getID(); -}; - -/// LockSystem - This class manages all Java locks used by the applications. -/// Each JVM must own an instance of this class and allocate Java locks -/// with it. -/// -class LockSystem { - friend class JavaLock; -public: - - // Fixed values. With these values, an index is on 18 bits. - static const uint32_t GlobalSize = 128; - static const uint32_t BitIndex = 11; - static const uint32_t IndexSize = 1 << BitIndex; - static const uint32_t BitMask = IndexSize - 1; - static const uint32_t MaxLocks = GlobalSize * IndexSize; - - /// LockTable - The global table that will hold the locks. The table is - /// a two-dimensional array, and only one entry is created, so that - /// the lock system does not eat up all memory on startup. - /// - JavaLock* ** LockTable; - - /// currentIndex - The current index in the tables. Always incremented, - /// never decremented. - /// - uint32_t currentIndex; - - /// freeLock - The list of locks that are allocated and available. - /// - JavaLock* freeLock; - - /// threadLock - Spin lock to protect the currentIndex field. - /// - mvm::SpinLock threadLock; - - /// associatedVM - The JVM associated with this lock system. - /// - Jnjvm* associatedVM; - - /// allocate - Allocate a JavaLock. - /// - JavaLock* allocate(JavaObject* obj); - - /// deallocate - Put a lock in the free list lock. - /// - void deallocate(JavaLock* lock); - - /// LockSystem - Default constructor. Initialize the table. - /// - LockSystem(Jnjvm* vm); - - /// getLock - Get a lock from an index in the table. - /// - JavaLock* getLock(uint32_t index) { - return LockTable[index >> BitIndex][index & BitMask]; - } -}; - } #endif Modified: vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaObject.cpp Sun Oct 24 06:00:06 2010 @@ -17,6 +17,7 @@ #include "Jnjvm.h" #include +#include "debug.h" using namespace j3; @@ -63,103 +64,20 @@ void JavaObject::waitIntern( JavaObject* self, struct timeval* info, bool timed) { llvm_gcroot(self, 0); - JavaLock* l = 0; + JavaThread* thread = JavaThread::get(); + mvm::LockSystem& table = thread->getJVM()->lockSystem; - if (owner(self)) { - l = (JavaLock*)mvm::ThinLock::changeToFatlock(self); - JavaThread* thread = JavaThread::get(); - thread->waitsOn = l; - mvm::Cond& varcondThread = thread->varcond; - - if (thread->interruptFlag != 0) { - thread->interruptFlag = 0; - thread->waitsOn = 0; - thread->getJVM()->interruptedException(self); - } else { - thread->state = JavaThread::StateWaiting; - if (l->firstThread) { - assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && - "Inconsistent list"); - if (l->firstThread->nextWaiting == l->firstThread) { - l->firstThread->nextWaiting = thread; - } else { - l->firstThread->prevWaiting->nextWaiting = thread; - } - thread->prevWaiting = l->firstThread->prevWaiting; - thread->nextWaiting = l->firstThread; - l->firstThread->prevWaiting = thread; - } else { - l->firstThread = thread; - thread->nextWaiting = thread; - thread->prevWaiting = thread; - } - assert(thread->prevWaiting && thread->nextWaiting && "Inconsistent list"); - assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && - "Inconsistent list"); - - bool timeout = false; - - l->waitingThreads++; - - while (!thread->interruptFlag && thread->nextWaiting) { - if (timed) { - timeout = varcondThread.timedWait(&l->internalLock, info); - if (timeout) break; - } else { - varcondThread.wait(&l->internalLock); - } - } - - l->waitingThreads--; - - assert((!l->firstThread || (l->firstThread->prevWaiting && - l->firstThread->nextWaiting)) && "Inconsistent list"); - - bool interrupted = (thread->interruptFlag != 0); - - if (interrupted || timeout) { - - if (thread->nextWaiting) { - assert(thread->prevWaiting && "Inconsistent list"); - if (l->firstThread != thread) { - thread->nextWaiting->prevWaiting = thread->prevWaiting; - thread->prevWaiting->nextWaiting = thread->nextWaiting; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } else if (thread->nextWaiting == thread) { - l->firstThread = 0; - } else { - l->firstThread = thread->nextWaiting; - l->firstThread->prevWaiting = thread->prevWaiting; - thread->prevWaiting->nextWaiting = l->firstThread; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } - thread->nextWaiting = 0; - thread->prevWaiting = 0; - } else { - assert(!thread->prevWaiting && "Inconstitent state"); - // Notify lost, notify someone else. - notify(self); - } - } else { - assert(!thread->prevWaiting && !thread->nextWaiting && - "Inconsistent state"); - } - - thread->state = JavaThread::StateRunning; - thread->waitsOn = 0; - - if (interrupted) { - thread->interruptFlag = 0; - thread->getJVM()->interruptedException(self); - } - } - } else { - JavaThread::get()->getJVM()->illegalMonitorStateException(self); + if (!owner(self)) { + thread->getJVM()->illegalMonitorStateException(self); + UNREACHABLE(); + } + + bool interrupted = thread->lockingThread.wait(self, table, info, timed); + + if (interrupted) { + thread->getJVM()->interruptedException(self); + UNREACHABLE(); } - - assert(owner(self) && "Not owner after wait"); } void JavaObject::wait(JavaObject* self) { @@ -174,72 +92,46 @@ void JavaObject::notify(JavaObject* self) { llvm_gcroot(self, 0); - JavaLock* l = 0; + JavaThread* thread = JavaThread::get(); + mvm::LockSystem& table = thread->getJVM()->lockSystem; - if (owner(self)) { - l = (JavaLock*)mvm::ThinLock::getFatLock(self); - if (l) { - JavaThread* cur = l->firstThread; - if (cur) { - do { - if (cur->interruptFlag != 0) { - cur = cur->nextWaiting; - } else { - assert(cur->javaThread && "No java thread"); - assert(cur->prevWaiting && cur->nextWaiting && - "Inconsistent list"); - if (cur != l->firstThread) { - cur->prevWaiting->nextWaiting = cur->nextWaiting; - cur->nextWaiting->prevWaiting = cur->prevWaiting; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } else if (cur->nextWaiting == cur) { - l->firstThread = 0; - } else { - l->firstThread = cur->nextWaiting; - l->firstThread->prevWaiting = cur->prevWaiting; - cur->prevWaiting->nextWaiting = l->firstThread; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } - cur->prevWaiting = 0; - cur->nextWaiting = 0; - cur->varcond.signal(); - break; - } - } while (cur != l->firstThread); - } - } - } else { - JavaThread::get()->getJVM()->illegalMonitorStateException(self); + if (!owner(self)) { + thread->getJVM()->illegalMonitorStateException(self); + UNREACHABLE(); } - assert(owner(self) && "Not owner after notify"); + thread->lockingThread.notify(self, table); } void JavaObject::notifyAll(JavaObject* self) { llvm_gcroot(self, 0); - JavaLock* l = 0; - - if (owner(self)) { - l = (JavaLock*)mvm::ThinLock::getFatLock(self); - if (l) { - JavaThread* cur = l->firstThread; - if (cur) { - do { - JavaThread* temp = cur->nextWaiting; - cur->prevWaiting = 0; - cur->nextWaiting = 0; - cur->varcond.signal(); - cur = temp; - } while (cur != l->firstThread); - l->firstThread = 0; - } - } - } else { - JavaThread::get()->getJVM()->illegalMonitorStateException(self); + JavaThread* thread = JavaThread::get(); + mvm::LockSystem& table = thread->getJVM()->lockSystem; + + if (!owner(self)) { + thread->getJVM()->illegalMonitorStateException(self); + UNREACHABLE(); } + thread->lockingThread.notifyAll(self, table); +} + +void JavaObject::overflowThinLock(JavaObject* self) { + llvm_gcroot(self, 0); + mvm::ThinLock::overflowThinLock(self, JavaThread::get()->getJVM()->lockSystem); +} - assert(owner(self) && "Not owner after notifyAll"); +void JavaObject::acquire(JavaObject* self) { + llvm_gcroot(self, 0); + mvm::ThinLock::acquire(self, JavaThread::get()->getJVM()->lockSystem); +} + +void JavaObject::release(JavaObject* self) { + llvm_gcroot(self, 0); + mvm::ThinLock::release(self, JavaThread::get()->getJVM()->lockSystem); +} + +bool JavaObject::owner(JavaObject* self) { + llvm_gcroot(self, 0); + return mvm::ThinLock::owner(self, JavaThread::get()->getJVM()->lockSystem); } void JavaObject::decapsulePrimitive(JavaObject* obj, Jnjvm *vm, jvalue* buf, Modified: vmkit/branches/precise/lib/J3/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaObject.h?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaObject.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaObject.h Sun Oct 24 06:00:06 2010 @@ -244,6 +244,10 @@ llvm_gcroot(self, 0); return ((JavaVirtualTable*)self->getVirtualTable())->cl; } + + /// instanceOf - Is this object's class of type the given class? + /// + static bool instanceOf(JavaObject* self, UserCommonClass* cl); /// wait - Java wait. Makes the current thread waiting on a monitor. /// @@ -264,35 +268,19 @@ /// static void notifyAll(JavaObject* self); - /// overflowmvm::ThinLock - Notify that the thin lock has overflowed. - /// - static void overflowThinLock(JavaObject* self) { - llvm_gcroot(self, 0); - mvm::ThinLock::overflowThinLock(self); - } - - /// instanceOf - Is this object's class of type the given class? + /// overflowThinLock - Notify that the thin lock has overflowed. /// - static bool instanceOf(JavaObject* self, UserCommonClass* cl); + static void overflowThinLock(JavaObject* self); /// acquire - Acquire the lock on this object. - static void acquire(JavaObject* self) { - llvm_gcroot(self, 0); - mvm::ThinLock::acquire(self); - } + static void acquire(JavaObject* self); /// release - Release the lock on this object - static void release(JavaObject* self) { - llvm_gcroot(self, 0); - mvm::ThinLock::release(self); - } + static void release(JavaObject* self); /// owner - Returns true if the current thread is the owner of this object's /// lock. - static bool owner(JavaObject* self) { - llvm_gcroot(self, 0); - return mvm::ThinLock::owner(self); - } + static bool owner(JavaObject* self); #ifdef SIGSEGV_THROW_NULL #define verifyNull(obj) {} @@ -301,12 +289,6 @@ if (obj == NULL) JavaThread::get()->getJVM()->nullPointerException(); #endif - /// lockObj - Get the LockObj if the lock is a fat lock. - static JavaLock* lockObj(JavaObject* self) { - llvm_gcroot(self, 0); - return (JavaLock*)mvm::ThinLock::getFatLock(self); - } - /// decapsulePrimitive - Based on the signature argument, decapsule /// obj as a primitive and put it in the buffer. /// Modified: vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp Sun Oct 24 06:00:06 2010 @@ -19,10 +19,6 @@ using namespace j3; -const unsigned int JavaThread::StateRunning = 0; -const unsigned int JavaThread::StateWaiting = 1; -const unsigned int JavaThread::StateInterrupted = 2; - JavaThread::JavaThread(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) : MutatorThread() { llvm_gcroot(thread, 0); @@ -31,8 +27,6 @@ javaThread = thread; vmThread = vmth; MyVM = isolate; - interruptFlag = 0; - state = StateRunning; pendingException = 0; jniEnv = isolate->jniEnv; localJNIRefs = new JNILocalReferences(); Modified: vmkit/branches/precise/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaThread.h?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaThread.h Sun Oct 24 06:00:06 2010 @@ -13,6 +13,7 @@ #include "mvm/Object.h" #include "mvm/Threads/Cond.h" #include "mvm/Threads/Locks.h" +#include "mvm/Threads/ObjectLocks.h" #include "mvm/Threads/Thread.h" #include "MutatorThread.h" @@ -84,33 +85,7 @@ /// JavaObject* vmThread; - /// varcond - Condition variable when the thread needs to be awaken from - /// a wait. - /// - mvm::Cond varcond; - - /// interruptFlag - Has this thread been interrupted? - /// - uint32 interruptFlag; - - /// nextWaiting - Next thread waiting on the same monitor. - /// - JavaThread* nextWaiting; - - /// prevWaiting - Previous thread waiting on the same monitor. - /// - JavaThread* prevWaiting; - - /// waitsOn - The monitor on which the thread is waiting on. - /// - JavaLock* waitsOn; - - static const unsigned int StateRunning; - static const unsigned int StateWaiting; - static const unsigned int StateInterrupted; - - /// state - The current state of this thread: Running, Waiting or Interrupted. - uint32 state; + mvm::LockingThread lockingThread; /// currentAddedReferences - Current number of added local references. /// Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp Sun Oct 24 06:00:06 2010 @@ -1402,7 +1402,7 @@ } Jnjvm::Jnjvm(mvm::BumpPtrAllocator& Alloc, JnjvmBootstrapLoader* loader) : - VirtualMachine(Alloc), lockSystem(this) { + VirtualMachine(Alloc), lockSystem(Alloc) { classpath = getenv("CLASSPATH"); if (!classpath) classpath = "."; Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h Sun Oct 24 06:00:06 2010 @@ -19,8 +19,8 @@ #include "mvm/VirtualMachine.h" #include "mvm/Threads/Cond.h" #include "mvm/Threads/Locks.h" +#include "mvm/Threads/ObjectLocks.h" -#include "JavaLocks.h" #include "JnjvmConfig.h" #include "JNIReferences.h" #include "LockedMap.h" @@ -202,7 +202,7 @@ /// lockSystem - The lock system to allocate and manage Java locks. /// - LockSystem lockSystem; + mvm::LockSystem lockSystem; /// argumentsInfo - The command line arguments given to the vm /// @@ -341,9 +341,6 @@ /// virtual void waitForExit(); - virtual JavaLock* allocateFatLock(gc*); - virtual JavaLock* getFatLockFromID(uintptr_t val); - private: /// internalRemoveMethodsInFunctionMap - Removes all methods compiled by this /// class loader from the function map. @@ -357,7 +354,7 @@ void removeMethodsInFunctionMaps(JnjvmClassLoader* loader); /// loadBootstrap - Bootstraps the JVM, getting the class loader, initializing - /// bootstrap classes (e.g. java/lang/Class, java/lang/*Exception) and + /// bootstrap classes (e.g. java/lang/Class, java/lang/Exception) and /// mapping the initial thread. /// void loadBootstrap(); Modified: vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Sun Oct 24 06:00:06 2010 @@ -291,20 +291,20 @@ } uint32 i = 0; - for (; i < LockSystem::GlobalSize; i++) { - JavaLock** array = lockSystem.LockTable[i]; + for (; i < mvm::LockSystem::GlobalSize; i++) { + mvm::FatLock** array = lockSystem.LockTable[i]; if (array == NULL) break; uint32 j = 0; - for (; j < LockSystem::IndexSize; j++) { + for (; j < mvm::LockSystem::IndexSize; j++) { if (array[j] == NULL) break; - JavaLock* lock = array[j]; + mvm::FatLock* lock = array[j]; mvm::Collector::markAndTraceRoot(lock->getAssociatedObjectPtr(), closure); } - for (j = j + 1; j < LockSystem::IndexSize; j++) { + for (j = j + 1; j < mvm::LockSystem::IndexSize; j++) { assert(array[j] == NULL); } } - for (i = i + 1; i < LockSystem::GlobalSize; i++) { + for (i = i + 1; i < mvm::LockSystem::GlobalSize; i++) { assert(lockSystem.LockTable[i] == NULL); } #if defined(ISOLATE_SHARING) Added: vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp?rev=117221&view=auto ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp (added) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Sun Oct 24 06:00:06 2010 @@ -0,0 +1,489 @@ +//===--------- ObjectLocks.cpp - Object-based locks -----------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include + +#include "mvm/Threads/Cond.h" +#include "mvm/Threads/Locks.h" +#include "mvm/Threads/ObjectLocks.h" +#include "mvm/Threads/Thread.h" +#include "mvm/VirtualMachine.h" +#include "MvmGC.h" +#include "cterror.h" +#include +#include +#include + + +using namespace mvm; + +void ThinLock::overflowThinLock(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + FatLock* obj = table.allocate(object); + obj->acquireAll(object, (ThinCountMask >> ThinCountShift) + 1); + uintptr_t oldValue = 0; + uintptr_t newValue = 0; + uintptr_t yieldedValue = 0; + do { + oldValue = object->header; + newValue = obj->getID() | (oldValue & NonLockBitsMask); + yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); + } while (yieldedValue != oldValue); +} + +/// initialise - Initialise the value of the lock. +/// +void ThinLock::initialise(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + uintptr_t oldValue = 0; + uintptr_t newValue = 0; + uintptr_t yieldedValue = 0; + do { + oldValue = object->header; + newValue = oldValue & NonLockBitsMask; + yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); + } while (yieldedValue != oldValue); +} + +FatLock* ThinLock::changeToFatlock(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + if (!(object->header & FatMask)) { + FatLock* obj = table.allocate(object); + uint32 count = (object->header & ThinCountMask) >> ThinCountShift; + obj->acquireAll(object, count + 1); + uintptr_t oldValue = 0; + uintptr_t newValue = 0; + uintptr_t yieldedValue = 0; + do { + oldValue = object->header; + newValue = obj->getID() | (oldValue & NonLockBitsMask); + yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); + } while (yieldedValue != oldValue); + return obj; + } else { + FatLock* res = table.getFatLockFromID(object->header); + assert(res && "Lock deallocated while held."); + return res; + } +} + +void ThinLock::acquire(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + uint64_t id = mvm::Thread::get()->getThreadID(); + uintptr_t oldValue = 0; + uintptr_t newValue = 0; + uintptr_t yieldedValue = 0; + do { + oldValue = object->header & NonLockBitsMask; + newValue = oldValue | id; + yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); + } while ((object->header & ~NonLockBitsMask) == 0); + + if (yieldedValue == oldValue) { + assert(owner(object, table) && "Not owner after quitting acquire!"); + return; + } + + if ((yieldedValue & Thread::IDMask) == id) { + assert(owner(object, table) && "Inconsistent lock"); + if ((yieldedValue & ThinCountMask) != ThinCountMask) { + do { + oldValue = object->header; + newValue = oldValue + ThinCountAdd; + yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); + } while (oldValue != yieldedValue); + } else { + overflowThinLock(object, table); + } + assert(owner(object, table) && "Not owner after quitting acquire!"); + return; + } + + while (true) { + if (object->header & FatMask) { + FatLock* obj = table.getFatLockFromID(object->header); + if (obj != NULL) { + if (obj->acquire(object)) { + break; + } + } + } + + while (object->header & ~NonLockBitsMask) { + if (object->header & FatMask) { + break; + } else { + mvm::Thread::yield(); + } + } + + if ((object->header & ~NonLockBitsMask) == 0) { + FatLock* obj = table.allocate(object); + do { + oldValue = object->header & NonLockBitsMask; + newValue = oldValue | obj->getID(); + yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); + } while ((object->header & ~NonLockBitsMask) == 0); + + if (oldValue != yieldedValue) { + assert((getFatLock(object, table) != obj) && "Inconsistent lock"); + table.deallocate(obj); + } else { + assert((getFatLock(object, table) == obj) && "Inconsistent lock"); + } + assert(!owner(object, table) && "Inconsistent lock"); + } + } + + assert(owner(object, table) && "Not owner after quitting acquire!"); +} + +/// release - Release the lock. +void ThinLock::release(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + assert(owner(object, table) && "Not owner when entering release!"); + uint64 id = mvm::Thread::get()->getThreadID(); + uintptr_t oldValue = 0; + uintptr_t newValue = 0; + uintptr_t yieldedValue = 0; + if ((object->header & ~NonLockBitsMask) == id) { + do { + oldValue = object->header; + newValue = oldValue & NonLockBitsMask; + yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); + } while (yieldedValue != oldValue); + } else if (object->header & FatMask) { + FatLock* obj = table.getFatLockFromID(object->header); + assert(obj && "Lock deallocated while held."); + obj->release(object, table); + } else { + assert(((object->header & ThinCountMask) > 0) && "Inconsistent state"); + do { + oldValue = object->header; + newValue = oldValue - ThinCountAdd; + yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); + } while (yieldedValue != oldValue); + } +} + +/// owner - Returns true if the curren thread is the owner of this object's +/// lock. +bool ThinLock::owner(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + if (object->header & FatMask) { + FatLock* obj = table.getFatLockFromID(object->header); + if (obj != NULL) return obj->owner(); + } else { + uint64 id = mvm::Thread::get()->getThreadID(); + if ((object->header & Thread::IDMask) == id) return true; + } + return false; +} + +/// getFatLock - Get the fat lock is the lock is a fat lock, 0 otherwise. +FatLock* ThinLock::getFatLock(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + if (object->header & FatMask) { + return table.getFatLockFromID(object->header); + } else { + return NULL; + } +} + +void FatLock::acquireAll(gc* obj, uint32 nb) { + internalLock.lockAll(nb); +} + +bool FatLock::owner() { + return internalLock.selfOwner(); +} + +mvm::Thread* FatLock::getOwner() { + return internalLock.getOwner(); +} + +FatLock::FatLock(uint32_t i, gc* a) { + llvm_gcroot(a, 0); + firstThread = NULL; + index = i; + associatedObject = a; + waitingThreads = 0; + lockingThreads = 0; + nextFreeLock = NULL; +} + +uintptr_t FatLock::getID() { + return (index << mvm::NonLockBits) | mvm::FatMask; +} + +void FatLock::release(gc* obj, LockSystem& table) { + llvm_gcroot(obj, 0); + assert(associatedObject && "No associated object when releasing"); + assert(associatedObject == obj && "Mismatch object in lock"); + if (!waitingThreads && !lockingThreads && + internalLock.recursionCount() == 1) { + mvm::ThinLock::initialise(associatedObject, table); + table.deallocate(this); + } + internalLock.unlock(); +} + +/// acquire - Acquires the internalLock. +/// +bool FatLock::acquire(gc* obj) { + llvm_gcroot(obj, 0); + + spinLock.lock(); + lockingThreads++; + spinLock.unlock(); + + internalLock.lock(); + + spinLock.lock(); + lockingThreads--; + spinLock.unlock(); + + if (associatedObject != obj) { + internalLock.unlock(); + return false; + } + return true; +} + + +void LockSystem::deallocate(FatLock* lock) { + lock->associatedObject = NULL; + threadLock.lock(); + lock->nextFreeLock = freeLock; + freeLock = lock; + threadLock.unlock(); +} + +LockSystem::LockSystem(mvm::BumpPtrAllocator& all) : allocator(all) { + LockTable = (FatLock* **) + allocator.Allocate(GlobalSize * sizeof(FatLock**), "Global LockTable"); + LockTable[0] = (FatLock**) + allocator.Allocate(IndexSize * sizeof(FatLock*), "Index LockTable"); + currentIndex = 0; + freeLock = NULL; +} + +FatLock* LockSystem::allocate(gc* obj) { + llvm_gcroot(obj, 0); + FatLock* res = 0; + threadLock.lock(); + + // Try the freeLock list. + if (freeLock != NULL) { + res = freeLock; + freeLock = res->nextFreeLock; + res->nextFreeLock = 0; + assert(res->associatedObject == NULL); + threadLock.unlock(); + res->associatedObject = obj; + } else { + // Get an index. + uint32_t index = currentIndex++; + if (index == MaxLocks) { + fprintf(stderr, "Ran out of space for allocating locks"); + abort(); + } + + FatLock** tab = LockTable[index >> BitIndex]; + + VirtualMachine* vm = mvm::Thread::get()->MyVM; + if (tab == NULL) { + tab = (FatLock**)vm->allocator.Allocate( + IndexSize * sizeof(FatLock*), "Index LockTable"); + } + threadLock.unlock(); + + // Allocate the lock. + res = new(vm->allocator, "Lock") FatLock(index, obj); + + // Add the lock to the table. + uint32_t internalIndex = index & BitMask; + tab[internalIndex] = res; + } + + // Return the lock. + return res; +} + + +FatLock* LockSystem::getFatLockFromID(uintptr_t ID) { + if (ID & mvm::FatMask) { + uint32_t index = (ID & ~mvm::FatMask) >> mvm::NonLockBits; + FatLock* res = getLock(index); + return res; + } else { + return NULL; + } +} + + + +bool LockingThread::wait( + gc* self, LockSystem& table, struct timeval* info, bool timed) { + llvm_gcroot(self, 0); + FatLock* l = 0; + + assert(mvm::ThinLock::owner(self, table)); + l = mvm::ThinLock::changeToFatlock(self, table); + this->waitsOn = l; + mvm::Cond& varcondThread = this->varcond; + + if (this->interruptFlag != 0) { + this->interruptFlag = 0; + this->waitsOn = 0; + return true; + } else { + this->state = LockingThread::StateWaiting; + if (l->firstThread) { + assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && + "Inconsistent list"); + if (l->firstThread->nextWaiting == l->firstThread) { + l->firstThread->nextWaiting = this; + } else { + l->firstThread->prevWaiting->nextWaiting = this; + } + this->prevWaiting = l->firstThread->prevWaiting; + this->nextWaiting = l->firstThread; + l->firstThread->prevWaiting = this; + } else { + l->firstThread = this; + this->nextWaiting = this; + this->prevWaiting = this; + } + assert(this->prevWaiting && this->nextWaiting && "Inconsistent list"); + assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && + "Inconsistent list"); + + bool timeout = false; + + l->waitingThreads++; + + while (!this->interruptFlag && this->nextWaiting) { + if (timed) { + timeout = varcondThread.timedWait(&l->internalLock, info); + if (timeout) break; + } else { + varcondThread.wait(&l->internalLock); + } + } + + l->waitingThreads--; + + assert((!l->firstThread || (l->firstThread->prevWaiting && + l->firstThread->nextWaiting)) && "Inconsistent list"); + + bool interrupted = (this->interruptFlag != 0); + + if (interrupted || timeout) { + + if (this->nextWaiting) { + assert(this->prevWaiting && "Inconsistent list"); + if (l->firstThread != this) { + this->nextWaiting->prevWaiting = this->prevWaiting; + this->prevWaiting->nextWaiting = this->nextWaiting; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } else if (this->nextWaiting == this) { + l->firstThread = NULL; + } else { + l->firstThread = this->nextWaiting; + l->firstThread->prevWaiting = this->prevWaiting; + this->prevWaiting->nextWaiting = l->firstThread; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } + this->nextWaiting = NULL; + this->prevWaiting = NULL; + } else { + assert(!this->prevWaiting && "Inconstitent state"); + // Notify lost, notify someone else. + notify(self, table); + } + } else { + assert(!this->prevWaiting && !this->nextWaiting && + "Inconsistent state"); + } + + this->state = LockingThread::StateRunning; + this->waitsOn = 0; + + if (interrupted) { + this->interruptFlag = 0; + return true; + } + } + + assert(mvm::ThinLock::owner(self, table) && "Not owner after wait"); + return false; +} + +void LockingThread::notify(gc* self, LockSystem& table) { + llvm_gcroot(self, 0); + assert(mvm::ThinLock::owner(self, table)); + FatLock* l = mvm::ThinLock::getFatLock(self, table); + if (l) { + LockingThread* cur = l->firstThread; + if (cur) { + do { + if (cur->interruptFlag != 0) { + cur = cur->nextWaiting; + } else { + assert(cur->prevWaiting && cur->nextWaiting && + "Inconsistent list"); + if (cur != l->firstThread) { + cur->prevWaiting->nextWaiting = cur->nextWaiting; + cur->nextWaiting->prevWaiting = cur->prevWaiting; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } else if (cur->nextWaiting == cur) { + l->firstThread = 0; + } else { + l->firstThread = cur->nextWaiting; + l->firstThread->prevWaiting = cur->prevWaiting; + cur->prevWaiting->nextWaiting = l->firstThread; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } + cur->prevWaiting = 0; + cur->nextWaiting = 0; + cur->varcond.signal(); + break; + } + } while (cur != l->firstThread); + } + } + + assert(mvm::ThinLock::owner(self, table) && "Not owner after notify"); +} + +void LockingThread::notifyAll(gc* self, LockSystem& table) { + llvm_gcroot(self, 0); + assert(mvm::ThinLock::owner(self, table)); + FatLock* l = mvm::ThinLock::getFatLock(self, table); + if (l) { + LockingThread* cur = l->firstThread; + if (cur) { + do { + LockingThread* temp = cur->nextWaiting; + cur->prevWaiting = 0; + cur->nextWaiting = 0; + cur->varcond.signal(); + cur = temp; + } while (cur != l->firstThread); + l->firstThread = 0; + } + } + + assert(mvm::ThinLock::owner(self, table) && "Not owner after notifyAll"); +} Modified: vmkit/branches/precise/lib/Mvm/CommonThread/ctlock.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/CommonThread/ctlock.cpp?rev=117221&r1=117220&r2=117221&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ctlock.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ctlock.cpp Sun Oct 24 06:00:06 2010 @@ -188,176 +188,3 @@ return res; } - -void ThinLock::overflowThinLock(gc* object) { - llvm_gcroot(object, 0); - FatLock* obj = Thread::get()->MyVM->allocateFatLock(object); - obj->acquireAll(object, (ThinCountMask >> ThinCountShift) + 1); - uintptr_t oldValue = 0; - uintptr_t newValue = 0; - uintptr_t yieldedValue = 0; - do { - oldValue = object->header; - newValue = obj->getID() | (oldValue & NonLockBitsMask); - yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (yieldedValue != oldValue); -} - -/// initialise - Initialise the value of the lock. -/// -void ThinLock::initialise(gc* object) { - llvm_gcroot(object, 0); - uintptr_t oldValue = 0; - uintptr_t newValue = 0; - uintptr_t yieldedValue = 0; - do { - oldValue = object->header; - newValue = oldValue & NonLockBitsMask; - yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); - } while (yieldedValue != oldValue); -} - -FatLock* ThinLock::changeToFatlock(gc* object) { - llvm_gcroot(object, 0); - if (!(object->header & FatMask)) { - FatLock* obj = Thread::get()->MyVM->allocateFatLock(object); - uint32 count = (object->header & ThinCountMask) >> ThinCountShift; - obj->acquireAll(object, count + 1); - uintptr_t oldValue = 0; - uintptr_t newValue = 0; - uintptr_t yieldedValue = 0; - do { - oldValue = object->header; - newValue = obj->getID() | (oldValue & NonLockBitsMask); - yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (yieldedValue != oldValue); - return obj; - } else { - FatLock* res = Thread::get()->MyVM->getFatLockFromID(object->header); - assert(res && "Lock deallocated while held."); - return res; - } -} - -void ThinLock::acquire(gc* object) { - llvm_gcroot(object, 0); - uint64_t id = mvm::Thread::get()->getThreadID(); - uintptr_t oldValue = 0; - uintptr_t newValue = 0; - uintptr_t yieldedValue = 0; - do { - oldValue = object->header & NonLockBitsMask; - newValue = oldValue | id; - yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while ((object->header & ~NonLockBitsMask) == 0); - - if (yieldedValue == oldValue) { - assert(owner(object) && "Not owner after quitting acquire!"); - return; - } - - if ((yieldedValue & Thread::IDMask) == id) { - assert(owner(object) && "Inconsistent lock"); - if ((yieldedValue & ThinCountMask) != ThinCountMask) { - do { - oldValue = object->header; - newValue = oldValue + ThinCountAdd; - yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (oldValue != yieldedValue); - } else { - overflowThinLock(object); - } - assert(owner(object) && "Not owner after quitting acquire!"); - return; - } - - while (true) { - if (object->header & FatMask) { - FatLock* obj = Thread::get()->MyVM->getFatLockFromID(object->header); - if (obj != NULL) { - if (obj->acquire(object)) { - break; - } - } - } - - while (object->header & ~NonLockBitsMask) { - if (object->header & FatMask) { - break; - } else { - mvm::Thread::yield(); - } - } - - if ((object->header & ~NonLockBitsMask) == 0) { - FatLock* obj = Thread::get()->MyVM->allocateFatLock(object); - do { - oldValue = object->header & NonLockBitsMask; - newValue = oldValue | obj->getID(); - yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); - } while ((object->header & ~NonLockBitsMask) == 0); - - if (oldValue != yieldedValue) { - assert((getFatLock(object) != obj) && "Inconsistent lock"); - obj->deallocate(); - } else { - assert((getFatLock(object) == obj) && "Inconsistent lock"); - } - assert(!owner(object) && "Inconsistent lock"); - } - } - - assert(owner(object) && "Not owner after quitting acquire!"); -} - -/// release - Release the lock. -void ThinLock::release(gc* object) { - llvm_gcroot(object, 0); - assert(owner(object) && "Not owner when entering release!"); - uint64 id = mvm::Thread::get()->getThreadID(); - uintptr_t oldValue = 0; - uintptr_t newValue = 0; - uintptr_t yieldedValue = 0; - if ((object->header & ~NonLockBitsMask) == id) { - do { - oldValue = object->header; - newValue = oldValue & NonLockBitsMask; - yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); - } while (yieldedValue != oldValue); - } else if (object->header & FatMask) { - FatLock* obj = Thread::get()->MyVM->getFatLockFromID(object->header); - assert(obj && "Lock deallocated while held."); - obj->release(object); - } else { - assert(((object->header & ThinCountMask) > 0) && "Inconsistent state"); - do { - oldValue = object->header; - newValue = oldValue - ThinCountAdd; - yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (yieldedValue != oldValue); - } -} - -/// owner - Returns true if the curren thread is the owner of this object's -/// lock. -bool ThinLock::owner(gc* object) { - llvm_gcroot(object, 0); - if (object->header & FatMask) { - FatLock* obj = Thread::get()->MyVM->getFatLockFromID(object->header); - if (obj != NULL) return obj->owner(); - } else { - uint64 id = mvm::Thread::get()->getThreadID(); - if ((object->header & Thread::IDMask) == id) return true; - } - return false; -} - -/// getFatLock - Get the fat lock is the lock is a fat lock, 0 otherwise. -FatLock* ThinLock::getFatLock(gc* object) { - llvm_gcroot(object, 0); - if (object->header & FatMask) { - return Thread::get()->MyVM->getFatLockFromID(object->header); - } else { - return NULL; - } -} From nicolas.geoffray at lip6.fr Sun Oct 24 04:09:20 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 11:09:20 -0000 Subject: [vmkit-commits] [vmkit] r117222 - in /vmkit/branches/precise/lib/J3/VMCore: JavaLocks.cpp JavaLocks.h JavaObject.h Message-ID: <20101024110920.269242A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 06:09:19 2010 New Revision: 117222 URL: http://llvm.org/viewvc/llvm-project?rev=117222&view=rev Log: Remove unused files. Removed: vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h Modified: vmkit/branches/precise/lib/J3/VMCore/JavaObject.h Removed: vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp?rev=117221&view=auto ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaLocks.cpp (removed) @@ -1,15 +0,0 @@ -//===------------- JavaLocks.cpp - Fat lock management --------------------===// -// -// The VMKit project -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "JavaLocks.h" -#include "JavaThread.h" -#include "Jnjvm.h" - -using namespace j3; - Removed: vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h?rev=117221&view=auto ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaLocks.h (removed) @@ -1,25 +0,0 @@ -//===--------------- JavaLocks.h - Fat lock management --------------------===// -// -// The VMKit project -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef JAVA_LOCKS_H -#define JAVA_LOCKS_H - -#include "mvm/Allocator.h" -#include "mvm/Threads/Locks.h" -#include "mvm/VirtualMachine.h" - -namespace mvm { - class Thread; -} - -namespace j3 { - -} - -#endif Modified: vmkit/branches/precise/lib/J3/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaObject.h?rev=117222&r1=117221&r2=117222&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaObject.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaObject.h Sun Oct 24 06:09:19 2010 @@ -18,7 +18,6 @@ #include "types.h" -#include "JavaLocks.h" #include "JnjvmConfig.h" union jvalue; From nicolas.geoffray at lip6.fr Sun Oct 24 04:28:00 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 11:28:00 -0000 Subject: [vmkit-commits] [vmkit] r117223 - /vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Message-ID: <20101024112800.174582A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 06:27:59 2010 New Revision: 117223 URL: http://llvm.org/viewvc/llvm-project?rev=117223&view=rev Log: Code cleanup. No functionality change. Modified: vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Modified: vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp?rev=117223&r1=117222&r2=117223&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Sun Oct 24 06:27:59 2010 @@ -332,97 +332,96 @@ bool LockingThread::wait( gc* self, LockSystem& table, struct timeval* info, bool timed) { llvm_gcroot(self, 0); - FatLock* l = 0; - assert(mvm::ThinLock::owner(self, table)); - l = mvm::ThinLock::changeToFatlock(self, table); - this->waitsOn = l; - mvm::Cond& varcondThread = this->varcond; - - if (this->interruptFlag != 0) { - this->interruptFlag = 0; - this->waitsOn = 0; - return true; - } else { - this->state = LockingThread::StateWaiting; - if (l->firstThread) { - assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && - "Inconsistent list"); - if (l->firstThread->nextWaiting == l->firstThread) { - l->firstThread->nextWaiting = this; - } else { - l->firstThread->prevWaiting->nextWaiting = this; - } - this->prevWaiting = l->firstThread->prevWaiting; - this->nextWaiting = l->firstThread; - l->firstThread->prevWaiting = this; - } else { - l->firstThread = this; - this->nextWaiting = this; - this->prevWaiting = this; - } - assert(this->prevWaiting && this->nextWaiting && "Inconsistent list"); - assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && - "Inconsistent list"); + + FatLock* l = mvm::ThinLock::changeToFatlock(self, table); + this->waitsOn = l; + mvm::Cond& varcondThread = this->varcond; + + if (this->interruptFlag != 0) { + this->interruptFlag = 0; + this->waitsOn = 0; + return true; + } + + this->state = LockingThread::StateWaiting; + if (l->firstThread) { + assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && + "Inconsistent list"); + if (l->firstThread->nextWaiting == l->firstThread) { + l->firstThread->nextWaiting = this; + } else { + l->firstThread->prevWaiting->nextWaiting = this; + } + this->prevWaiting = l->firstThread->prevWaiting; + this->nextWaiting = l->firstThread; + l->firstThread->prevWaiting = this; + } else { + l->firstThread = this; + this->nextWaiting = this; + this->prevWaiting = this; + } + + assert(this->prevWaiting && this->nextWaiting && "Inconsistent list"); + assert(l->firstThread->prevWaiting && l->firstThread->nextWaiting && + "Inconsistent list"); - bool timeout = false; + bool timeout = false; - l->waitingThreads++; + l->waitingThreads++; - while (!this->interruptFlag && this->nextWaiting) { - if (timed) { - timeout = varcondThread.timedWait(&l->internalLock, info); - if (timeout) break; - } else { - varcondThread.wait(&l->internalLock); - } - } + while (!this->interruptFlag && this->nextWaiting) { + if (timed) { + timeout = varcondThread.timedWait(&l->internalLock, info); + if (timeout) break; + } else { + varcondThread.wait(&l->internalLock); + } + } - l->waitingThreads--; + l->waitingThreads--; - assert((!l->firstThread || (l->firstThread->prevWaiting && - l->firstThread->nextWaiting)) && "Inconsistent list"); + assert((!l->firstThread || (l->firstThread->prevWaiting && + l->firstThread->nextWaiting)) && "Inconsistent list"); - bool interrupted = (this->interruptFlag != 0); + bool interrupted = (this->interruptFlag != 0); - if (interrupted || timeout) { - - if (this->nextWaiting) { - assert(this->prevWaiting && "Inconsistent list"); - if (l->firstThread != this) { - this->nextWaiting->prevWaiting = this->prevWaiting; - this->prevWaiting->nextWaiting = this->nextWaiting; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } else if (this->nextWaiting == this) { - l->firstThread = NULL; - } else { - l->firstThread = this->nextWaiting; - l->firstThread->prevWaiting = this->prevWaiting; - this->prevWaiting->nextWaiting = l->firstThread; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } - this->nextWaiting = NULL; - this->prevWaiting = NULL; - } else { - assert(!this->prevWaiting && "Inconstitent state"); - // Notify lost, notify someone else. - notify(self, table); - } + if (interrupted || timeout) { + if (this->nextWaiting) { + assert(this->prevWaiting && "Inconsistent list"); + if (l->firstThread != this) { + this->nextWaiting->prevWaiting = this->prevWaiting; + this->prevWaiting->nextWaiting = this->nextWaiting; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } else if (this->nextWaiting == this) { + l->firstThread = NULL; } else { - assert(!this->prevWaiting && !this->nextWaiting && - "Inconsistent state"); - } + l->firstThread = this->nextWaiting; + l->firstThread->prevWaiting = this->prevWaiting; + this->prevWaiting->nextWaiting = l->firstThread; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } + this->nextWaiting = NULL; + this->prevWaiting = NULL; + } else { + assert(!this->prevWaiting && "Inconstitent state"); + // Notify lost, notify someone else. + notify(self, table); + } + } else { + assert(!this->prevWaiting && !this->nextWaiting && + "Inconsistent state"); + } - this->state = LockingThread::StateRunning; - this->waitsOn = 0; + this->state = LockingThread::StateRunning; + this->waitsOn = NULL; - if (interrupted) { - this->interruptFlag = 0; - return true; - } - } + if (interrupted) { + this->interruptFlag = 0; + return true; + } assert(mvm::ThinLock::owner(self, table) && "Not owner after wait"); return false; @@ -432,37 +431,37 @@ llvm_gcroot(self, 0); assert(mvm::ThinLock::owner(self, table)); FatLock* l = mvm::ThinLock::getFatLock(self, table); - if (l) { - LockingThread* cur = l->firstThread; - if (cur) { - do { - if (cur->interruptFlag != 0) { - cur = cur->nextWaiting; - } else { - assert(cur->prevWaiting && cur->nextWaiting && - "Inconsistent list"); - if (cur != l->firstThread) { - cur->prevWaiting->nextWaiting = cur->nextWaiting; - cur->nextWaiting->prevWaiting = cur->prevWaiting; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } else if (cur->nextWaiting == cur) { - l->firstThread = 0; - } else { - l->firstThread = cur->nextWaiting; - l->firstThread->prevWaiting = cur->prevWaiting; - cur->prevWaiting->nextWaiting = l->firstThread; - assert(l->firstThread->prevWaiting && - l->firstThread->nextWaiting && "Inconsistent list"); - } - cur->prevWaiting = 0; - cur->nextWaiting = 0; - cur->varcond.signal(); - break; - } - } while (cur != l->firstThread); - } + + if (l == NULL) return; + LockingThread* cur = l->firstThread; + if (cur == NULL) return; + + do { + if (cur->interruptFlag != 0) { + cur = cur->nextWaiting; + } else { + assert(cur->prevWaiting && cur->nextWaiting && + "Inconsistent list"); + if (cur != l->firstThread) { + cur->prevWaiting->nextWaiting = cur->nextWaiting; + cur->nextWaiting->prevWaiting = cur->prevWaiting; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } else if (cur->nextWaiting == cur) { + l->firstThread = NULL; + } else { + l->firstThread = cur->nextWaiting; + l->firstThread->prevWaiting = cur->prevWaiting; + cur->prevWaiting->nextWaiting = l->firstThread; + assert(l->firstThread->prevWaiting && + l->firstThread->nextWaiting && "Inconsistent list"); + } + cur->prevWaiting = NULL; + cur->nextWaiting = NULL; + cur->varcond.signal(); + break; } + } while (cur != l->firstThread); assert(mvm::ThinLock::owner(self, table) && "Not owner after notify"); } @@ -471,19 +470,16 @@ llvm_gcroot(self, 0); assert(mvm::ThinLock::owner(self, table)); FatLock* l = mvm::ThinLock::getFatLock(self, table); - if (l) { - LockingThread* cur = l->firstThread; - if (cur) { - do { - LockingThread* temp = cur->nextWaiting; - cur->prevWaiting = 0; - cur->nextWaiting = 0; - cur->varcond.signal(); - cur = temp; - } while (cur != l->firstThread); - l->firstThread = 0; - } - } - + if (l == NULL) return; + LockingThread* cur = l->firstThread; + if (cur == NULL) return; + do { + LockingThread* temp = cur->nextWaiting; + cur->prevWaiting = NULL; + cur->nextWaiting = NULL; + cur->varcond.signal(); + cur = temp; + } while (cur != l->firstThread); + l->firstThread = NULL; assert(mvm::ThinLock::owner(self, table) && "Not owner after notifyAll"); } From nicolas.geoffray at lip6.fr Sun Oct 24 07:37:39 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 14:37:39 -0000 Subject: [vmkit-commits] [vmkit] r117226 - in /vmkit/branches/precise: include/mvm/VirtualMachine.h lib/J3/Classpath/ClasspathVMRuntime.inc lib/J3/Classpath/JavaUpcalls.cpp lib/J3/VMCore/JavaMetaJIT.cpp lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/Jnjvm.h lib/J3/VMCore/ReferenceQueue.cpp lib/J3/VMCore/ReferenceQueue.h lib/J3/VMCore/VirtualTables.cpp lib/Mvm/GCMmap2/gccollector.cpp lib/Mvm/Runtime/Object.cpp mmtk/mmtk-j3/Collection.cpp Message-ID: <20101024143739.A720D2A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 09:37:39 2010 New Revision: 117226 URL: http://llvm.org/viewvc/llvm-project?rev=117226&view=rev Log: Refactor code around references and finalizer. Now the VM only has empty stubs for them. Added: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h vmkit/branches/precise/lib/J3/Classpath/ClasspathVMRuntime.inc vmkit/branches/precise/lib/J3/Classpath/JavaUpcalls.cpp vmkit/branches/precise/lib/J3/VMCore/JavaMetaJIT.cpp vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp vmkit/branches/precise/mmtk/mmtk-j3/Collection.cpp Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/VirtualMachine.h?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/precise/include/mvm/VirtualMachine.h Sun Oct 24 09:37:39 2010 @@ -6,11 +6,6 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// Ultimately, this would be like a generic way of defining a VM. But we're not -// quite there yet. -// -//===----------------------------------------------------------------------===// #ifndef MVM_VIRTUALMACHINE_H #define MVM_VIRTUALMACHINE_H @@ -30,8 +25,6 @@ class JnjvmClassLoader; } -class gc; - namespace mvm { class FunctionMap { @@ -57,84 +50,16 @@ FunctionMap(); }; - -// Same values than JikesRVM -#define INITIAL_QUEUE_SIZE 256 -#define GROW_FACTOR 2 - class CompilationUnit; -class VirtualMachine; - -class ReferenceQueue { -private: - gc** References; - uint32 QueueLength; - uint32 CurrentIndex; - mvm::SpinLock QueueLock; - uint8_t semantics; - - gc* processReference(gc*, VirtualMachine*, uintptr_t closure); -public: - - static const uint8_t WEAK = 1; - static const uint8_t SOFT = 2; - static const uint8_t PHANTOM = 3; - - - - ReferenceQueue(uint8_t s) { - References = new gc*[INITIAL_QUEUE_SIZE]; - QueueLength = INITIAL_QUEUE_SIZE; - CurrentIndex = 0; - semantics = s; - } - - ~ReferenceQueue() { - delete[] References; - } - - void addReference(gc* ref) { - QueueLock.acquire(); - if (CurrentIndex >= QueueLength) { - uint32 newLength = QueueLength * GROW_FACTOR; - gc** newQueue = new gc*[newLength]; - if (!newQueue) { - fprintf(stderr, "I don't know how to handle reference overflow yet!\n"); - abort(); - } - for (uint32 i = 0; i < QueueLength; ++i) newQueue[i] = References[i]; - delete[] References; - References = newQueue; - QueueLength = newLength; - } - References[CurrentIndex++] = ref; - QueueLock.release(); - } - - void acquire() { - QueueLock.acquire(); - } - void release() { - QueueLock.release(); - } - - void scan(VirtualMachine* vm, uintptr_t closure); -}; /// VirtualMachine - This class is the root of virtual machine classes. It /// defines what a VM should be. /// class VirtualMachine : public mvm::PermanentObject { - friend class ReferenceQueue; - protected: - VirtualMachine(mvm::BumpPtrAllocator &Alloc) : - allocator(Alloc), - WeakReferencesQueue(ReferenceQueue::WEAK), - SoftReferencesQueue(ReferenceQueue::SOFT), - PhantomReferencesQueue(ReferenceQueue::PHANTOM) { + allocator(Alloc) { #ifdef SERVICE memoryLimit = ~0; executionLimit = ~0; @@ -144,21 +69,14 @@ status = 1; _since_last_collection = 4*1024*1024; #endif - FinalizationQueue = new gc*[INITIAL_QUEUE_SIZE]; - QueueLength = INITIAL_QUEUE_SIZE; - CurrentIndex = 0; - - ToBeFinalized = new gc*[INITIAL_QUEUE_SIZE]; - ToBeFinalizedLength = INITIAL_QUEUE_SIZE; - CurrentFinalizedIndex = 0; - - ToEnqueue = new gc*[INITIAL_QUEUE_SIZE]; - ToEnqueueLength = INITIAL_QUEUE_SIZE; - ToEnqueueIndex = 0; - mainThread = 0; NumberOfThreads = 0; } + + virtual ~VirtualMachine() { + if (scanner) delete scanner; + } + public: /// allocator - Bump pointer allocator to allocate permanent memory @@ -166,6 +84,10 @@ /// mvm::BumpPtrAllocator& allocator; +//===----------------------------------------------------------------------===// +// (1) Thread-related methods. +//===----------------------------------------------------------------------===// + /// mainThread - The main thread of this VM. /// mvm::Thread* mainThread; @@ -210,227 +132,46 @@ } - virtual void tracer(uintptr_t closure); - - virtual ~VirtualMachine() { - if (scanner) delete scanner; - delete[] FinalizationQueue; - delete[] ToBeFinalized; - delete[] ToEnqueue; - } - - /// runApplication - Run an application. The application name is in - /// the arguments, hence it is the virtual machine's job to parse them. - virtual void runApplication(int argc, char** argv) = 0; - - /// waitForExit - Wait until the virtual machine stops its execution. - virtual void waitForExit() = 0; - - static j3::JnjvmClassLoader* initialiseJVM(j3::JavaCompiler* C, - bool dlLoad = true); - static VirtualMachine* createJVM(j3::JnjvmClassLoader* C = 0); - - static CompilationUnit* initialiseCLIVM(); - static VirtualMachine* createCLIVM(CompilationUnit* C = 0); - -private: - /// WeakReferencesQueue - The queue of weak references. - /// - ReferenceQueue WeakReferencesQueue; - - /// SoftReferencesQueue - The queue of soft references. - /// - ReferenceQueue SoftReferencesQueue; - - /// PhantomReferencesQueue - The queue of phantom references. - /// - ReferenceQueue PhantomReferencesQueue; - - - /// FinalizationQueueLock - A lock to protect access to the queue. - /// - mvm::SpinLock FinalizationQueueLock; - - /// finalizationQueue - A list of allocated objets that contain a finalize - /// method. - /// - gc** FinalizationQueue; - - /// CurrentIndex - Current index in the queue of finalizable objects. - /// - uint32 CurrentIndex; - - /// QueueLength - Current length of the queue of finalizable objects. - /// - uint32 QueueLength; - - /// growFinalizationQueue - Grow the queue of finalizable objects. - /// - void growFinalizationQueue(); - - /// ToBeFinalized - List of objects that are scheduled to be finalized. - /// - gc** ToBeFinalized; - - /// ToBeFinalizedLength - Current length of the queue of objects scheduled - /// for finalization. - /// - uint32 ToBeFinalizedLength; - - /// CurrentFinalizedIndex - The current index in the ToBeFinalized queue - /// that will be sceduled for finalization. - /// - uint32 CurrentFinalizedIndex; - - /// growToBeFinalizedQueue - Grow the queue of the to-be finalized objects. - /// - void growToBeFinalizedQueue(); - - /// finalizationCond - Condition variable to wake up finalization threads. - /// - mvm::Cond FinalizationCond; - - /// finalizationLock - Lock for the condition variable. - /// - mvm::LockNormal FinalizationLock; - - gc** ToEnqueue; - uint32 ToEnqueueLength; - uint32 ToEnqueueIndex; - - /// ToEnqueueLock - A lock to protect access to the queue. - /// - mvm::LockNormal EnqueueLock; - mvm::Cond EnqueueCond; - mvm::SpinLock ToEnqueueLock; - - void addToEnqueue(gc* obj) { - if (ToEnqueueIndex >= ToEnqueueLength) { - uint32 newLength = ToEnqueueLength * GROW_FACTOR; - gc** newQueue = new gc*[newLength]; - if (!newQueue) { - fprintf(stderr, "I don't know how to handle reference overflow yet!\n"); - abort(); - } - for (uint32 i = 0; i < ToEnqueueLength; ++i) { - newQueue[i] = ToEnqueue[i]; - } - delete[] ToEnqueue; - ToEnqueue = newQueue; - ToEnqueueLength = newLength; - } - ToEnqueue[ToEnqueueIndex++] = obj; - } - -public: - /// invokeFinalizer - Invoke the finalizer of the object. This may involve - /// changing the environment, e.g. going to native to Java. - /// - virtual void invokeFinalizer(gc*) {} - - /// enqueueReference - Calls the enqueue method. Should be overriden - /// by the VM. - /// - virtual bool enqueueReference(gc*) { return false; } - - /// finalizerStart - The start function of a finalizer. Will poll the - /// finalizationQueue. - /// - static void finalizerStart(mvm::Thread*); - - /// enqueueStart - The start function of a thread for references. Will poll - /// ToEnqueue. - /// - static void enqueueStart(mvm::Thread*); - - /// addFinalizationCandidate - Add an object to the queue of objects with - /// a finalization method. - /// - void addFinalizationCandidate(gc*); - - /// scanFinalizationQueue - Scan objets with a finalized method and schedule - /// them for finalization if they are not live. - /// - void scanFinalizationQueue(uintptr_t closure); +//===----------------------------------------------------------------------===// +// (2) GC-related methods. +//===----------------------------------------------------------------------===// - /// wakeUpFinalizers - Wake the finalizers. + /// startCollection - Preliminary code before starting a GC. /// - void wakeUpFinalizers() { FinalizationCond.broadcast(); } + virtual void startCollection() {} - /// wakeUpEnqueue - Wake the threads for enqueueing. + /// endCollection - Code after running a GC. /// - void wakeUpEnqueue() { EnqueueCond.broadcast(); } - - virtual void startCollection() { - FinalizationQueueLock.acquire(); - ToEnqueueLock.acquire(); - SoftReferencesQueue.acquire(); - WeakReferencesQueue.acquire(); - PhantomReferencesQueue.acquire(); - } - - virtual void endCollection() { - FinalizationQueueLock.release(); - ToEnqueueLock.release(); - SoftReferencesQueue.release(); - WeakReferencesQueue.release(); - PhantomReferencesQueue.release(); - } + virtual void endCollection() {} /// scanWeakReferencesQueue - Scan all weak references. Called by the GC /// before scanning the finalization queue. /// - void scanWeakReferencesQueue(uintptr_t closure) { - WeakReferencesQueue.scan(this, closure); - } + virtual void scanWeakReferencesQueue(uintptr_t closure) {} /// scanSoftReferencesQueue - Scan all soft references. Called by the GC /// before scanning the finalization queue. /// - void scanSoftReferencesQueue(uintptr_t closure) { - SoftReferencesQueue.scan(this, closure); - } + virtual void scanSoftReferencesQueue(uintptr_t closure) {} /// scanPhantomReferencesQueue - Scan all phantom references. Called by the GC /// after the finalization queue. /// - void scanPhantomReferencesQueue(uintptr_t closure) { - PhantomReferencesQueue.scan(this, closure); - } - - /// addWeakReference - Add a weak reference to the queue. - /// - void addWeakReference(gc* ref) { - WeakReferencesQueue.addReference(ref); - } - - /// addSoftReference - Add a weak reference to the queue. - /// - void addSoftReference(gc* ref) { - SoftReferencesQueue.addReference(ref); - } - - /// addPhantomReference - Add a weak reference to the queue. - /// - void addPhantomReference(gc* ref) { - PhantomReferencesQueue.addReference(ref); - } + virtual void scanPhantomReferencesQueue(uintptr_t closure) {} - /// clearReferent - Clear the referent in a reference. Should be overriden - /// by the VM. - /// - virtual void clearReferent(gc*) {} + /// scanFinalizationQueue - Scan objets with a finalized method and schedule + /// them for finalization if they are not live. + /// + virtual void scanFinalizationQueue(uintptr_t closure) {} - /// getReferent - Get the referent of the reference. Should be overriden - /// by the VM. - // - virtual gc** getReferentPtr(gc*) { return 0; } - - /// setReferent - Set the referent of the reference. Should be overriden - /// by the VM. - virtual void setReferent(gc* reference, gc* referent) { } + /// addFinalizationCandidate - Add an object to the queue of objects with + /// a finalization method. + /// + virtual void addFinalizationCandidate(gc* object) {} -public: + /// tracer - Trace this virtual machine's GC-objects. + /// + virtual void tracer(uintptr_t closure) {} /// scanner - Scanner of threads' stacks. /// @@ -448,10 +189,32 @@ UncooperativeCollectionRV rendezvous; #endif +//===----------------------------------------------------------------------===// +// (3) Backtrace-related methods. +//===----------------------------------------------------------------------===// + FunctionMap FunctionsCache; MethodInfo* IPToMethodInfo(void* ip) { return FunctionsCache.IPToMethodInfo(ip); } + +//===----------------------------------------------------------------------===// +// (4) Launch-related methods. +//===----------------------------------------------------------------------===// + + /// runApplication - Run an application. The application name is in + /// the arguments, hence it is the virtual machine's job to parse them. + virtual void runApplication(int argc, char** argv) = 0; + + /// waitForExit - Wait until the virtual machine stops its execution. + virtual void waitForExit() = 0; + + static j3::JnjvmClassLoader* initialiseJVM(j3::JavaCompiler* C, + bool dlLoad = true); + static VirtualMachine* createJVM(j3::JnjvmClassLoader* C = 0); + + static CompilationUnit* initialiseCLIVM(); + static VirtualMachine* createCLIVM(CompilationUnit* C = 0); #ifdef ISOLATE size_t IsolateID; @@ -477,6 +240,5 @@ }; - } // end namespace mvm #endif // MVM_VIRTUALMACHINE_H Modified: vmkit/branches/precise/lib/J3/Classpath/ClasspathVMRuntime.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/ClasspathVMRuntime.inc?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMRuntime.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMRuntime.inc Sun Oct 24 09:37:39 2010 @@ -150,8 +150,7 @@ jclass clazz, #endif ) { - Jnjvm* vm = JavaThread::get()->getJVM(); - vm->wakeUpFinalizers(); + mvm::Collector::collect(); // Sleep a bit. sleep(1); return; Modified: vmkit/branches/precise/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/JavaUpcalls.cpp?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/branches/precise/lib/J3/Classpath/JavaUpcalls.cpp Sun Oct 24 09:37:39 2010 @@ -15,6 +15,7 @@ #include "JavaThread.h" #include "JavaUpcalls.h" #include "Jnjvm.h" +#include "ReferenceQueue.h" #define COMPILE_METHODS(cl) \ for (CommonClass::method_iterator i = cl->virtualMethods.begin(), \ @@ -292,8 +293,8 @@ CreateJavaThread(vm, vm->getFinalizerThread(), "Finalizer", SystemGroup); // Create the enqueue thread. - assert(vm->getEnqueueThread() && "VM did not set its enqueue thread"); - CreateJavaThread(vm, vm->getEnqueueThread(), "Reference", SystemGroup); + assert(vm->getReferenceThread() && "VM did not set its enqueue thread"); + CreateJavaThread(vm, vm->getReferenceThread(), "Reference", SystemGroup); } extern "C" void Java_java_lang_ref_WeakReference__0003Cinit_0003E__Ljava_lang_Object_2( @@ -304,7 +305,7 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, 0); - JavaThread::get()->getJVM()->addWeakReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addWeakReference(reference); END_NATIVE_EXCEPTION @@ -321,7 +322,7 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, queue); - JavaThread::get()->getJVM()->addWeakReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addWeakReference(reference); END_NATIVE_EXCEPTION @@ -335,7 +336,7 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, 0); - JavaThread::get()->getJVM()->addSoftReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addSoftReference(reference); END_NATIVE_EXCEPTION @@ -352,7 +353,7 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, queue); - JavaThread::get()->getJVM()->addSoftReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addSoftReference(reference); END_NATIVE_EXCEPTION @@ -369,7 +370,7 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, queue); - JavaThread::get()->getJVM()->addPhantomReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addPhantomReference(reference); END_NATIVE_EXCEPTION } @@ -1059,25 +1060,6 @@ initPhantomReference->setNative(); } -gc** Jnjvm::getReferentPtr(gc* _obj) { - JavaObjectReference* obj = (JavaObjectReference*)_obj; - llvm_gcroot(obj, 0); - return (gc**)JavaObjectReference::getReferentPtr(obj); -} - -void Jnjvm::setReferent(gc* _obj, gc* val) { - JavaObjectReference* obj = (JavaObjectReference*)_obj; - llvm_gcroot(obj, 0); - llvm_gcroot(val, 0); - JavaObjectReference::setReferent(obj, (JavaObject*)val); -} - -void Jnjvm::clearReferent(gc* _obj) { - JavaObjectReference* obj = (JavaObjectReference*)_obj; - llvm_gcroot(obj, 0); - JavaObjectReference::setReferent(obj, NULL); -} - #include "ClasspathConstructor.inc" #include "Classpath.inc" #include "ClasspathField.inc" Modified: vmkit/branches/precise/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaMetaJIT.cpp?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaMetaJIT.cpp Sun Oct 24 09:37:39 2010 @@ -289,19 +289,3 @@ INVOKE(float, Float, float_virtual_ap, float_static_ap, float_virtual_buf, float_static_buf) INVOKE(double, Double, double_virtual_ap, double_static_ap, double_virtual_buf, double_static_buf) INVOKE(JavaObject*, JavaObject, object_virtual_ap, object_static_ap, object_virtual_buf, object_static_buf) - -void Jnjvm::invokeFinalizer(gc* _obj) { - JavaObject* obj = (JavaObject*)_obj; - llvm_gcroot(obj, 0); - JavaMethod* meth = upcalls->FinalizeObject; - UserClass* cl = JavaObject::getClass(obj)->asClass(); - meth->invokeIntVirtualBuf(this, cl, obj, 0); -} - -bool Jnjvm::enqueueReference(gc* _obj) { - JavaObject* obj = (JavaObject*)_obj; - llvm_gcroot(obj, 0); - JavaMethod* meth = upcalls->EnqueueReference; - UserClass* cl = JavaObject::getClass(obj)->asClass(); - return (bool)meth->invokeIntSpecialBuf(this, cl, obj, 0); -} Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp Sun Oct 24 09:37:39 2010 @@ -34,6 +34,7 @@ #include "LinkJavaRuntime.h" #include "LockedMap.h" #include "Reader.h" +#include "ReferenceQueue.h" #include "Zip.h" using namespace j3; @@ -1088,11 +1089,13 @@ JnjvmClassLoader* loader = bootstrapLoader; // First create system threads. - finalizerThread = new JavaThread(0, 0, this); - finalizerThread->start((void (*)(mvm::Thread*))finalizerStart); + finalizerThread = new FinalizerThread(this); + finalizerThread->start( + (void (*)(mvm::Thread*))FinalizerThread::finalizerStart); - enqueueThread = new JavaThread(0, 0, this); - enqueueThread->start((void (*)(mvm::Thread*))enqueueStart); + referenceThread = new ReferenceThread(this); + referenceThread->start( + (void (*)(mvm::Thread*))ReferenceThread::enqueueStart); // Initialise the bootstrap class loader if it's not // done already. @@ -1491,6 +1494,45 @@ } +void Jnjvm::startCollection() { + finalizerThread->FinalizationQueueLock.acquire(); + referenceThread->ToEnqueueLock.acquire(); + referenceThread->SoftReferencesQueue.acquire(); + referenceThread->WeakReferencesQueue.acquire(); + referenceThread->PhantomReferencesQueue.acquire(); +} + +void Jnjvm::endCollection() { + finalizerThread->FinalizationQueueLock.release(); + referenceThread->ToEnqueueLock.release(); + referenceThread->SoftReferencesQueue.release(); + referenceThread->WeakReferencesQueue.release(); + referenceThread->PhantomReferencesQueue.release(); + finalizerThread->FinalizationCond.broadcast(); + referenceThread->EnqueueCond.broadcast(); +} + +void Jnjvm::scanWeakReferencesQueue(uintptr_t closure) { + referenceThread->WeakReferencesQueue.scan(referenceThread, closure); +} + +void Jnjvm::scanSoftReferencesQueue(uintptr_t closure) { + referenceThread->SoftReferencesQueue.scan(referenceThread, closure); +} + +void Jnjvm::scanPhantomReferencesQueue(uintptr_t closure) { + referenceThread->PhantomReferencesQueue.scan(referenceThread, closure); +} + +void Jnjvm::scanFinalizationQueue(uintptr_t closure) { + finalizerThread->scanFinalizationQueue(closure); +} + +void Jnjvm::addFinalizationCandidate(gc* object) { + llvm_gcroot(object, 0); + finalizerThread->addFinalizationCandidate(object); +} + /// JavaStaticCompiler - Compiler for AOT-compiled programs that /// do not use the JIT. class JavaStaticCompiler : public JavaCompiler { Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h Sun Oct 24 09:37:39 2010 @@ -30,6 +30,7 @@ class ArrayObject; class Classpath; class CommonClass; +class FinalizerThread; class JavaField; class JavaMethod; class JavaObject; @@ -38,6 +39,7 @@ class JavaVirtualTable; class JnjvmBootstrapLoader; class JnjvmClassLoader; +class ReferenceThread; class UserClass; class UserClassArray; class UserClassPrimitive; @@ -120,11 +122,19 @@ /// finalizerThread - The thread that finalizes Java objects. /// - JavaThread* finalizerThread; + FinalizerThread* finalizerThread; /// enqueueThread - The thread that enqueue Java references. /// - JavaThread* enqueueThread; + ReferenceThread* referenceThread; + + virtual void startCollection(); + virtual void endCollection(); + virtual void scanWeakReferencesQueue(uintptr_t closure); + virtual void scanSoftReferencesQueue(uintptr_t closure); + virtual void scanPhantomReferencesQueue(uintptr_t closure); + virtual void scanFinalizationQueue(uintptr_t closure); + virtual void addFinalizationCandidate(gc* obj); /// CreateError - Creates a Java object of the specified exception class /// and calling its function. @@ -300,19 +310,19 @@ /// setFinalizerThread - Set the finalizer thread of this VM. /// - void setFinalizerThread(JavaThread* th) { finalizerThread = th; } + void setFinalizerThread(FinalizerThread* th) { finalizerThread = th; } /// getFinalizerThread - Get the finalizer thread of this VM. /// - JavaThread* getFinalizerThread() const { return finalizerThread; } + FinalizerThread* getFinalizerThread() const { return finalizerThread; } - /// setEnqueueThread - Set the enqueue thread of this VM. + /// setReferenceThread - Set the enqueue thread of this VM. /// - void setEnqueueThread(JavaThread* th) { enqueueThread = th; } + void setReferenceThread(ReferenceThread* th) { referenceThread = th; } - /// getEnqueueThread - Get the enqueue thread of this VM. + /// getReferenceThread - Get the enqueue thread of this VM. /// - JavaThread* getEnqueueThread() const { return enqueueThread; } + ReferenceThread* getReferenceThread() const { return referenceThread; } /// ~Jnjvm - Destroy the JVM. /// @@ -367,15 +377,6 @@ #ifdef SERVICE virtual void stopService(); #endif - - virtual void clearReferent(gc*); - virtual gc** getReferentPtr(gc*); - virtual void setReferent(gc*, gc*); - virtual bool enqueueReference(gc*); - -protected: - virtual void invokeFinalizer(gc*); - }; } // end namespace j3 Added: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp?rev=117226&view=auto ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp (added) +++ vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp Sun Oct 24 09:37:39 2010 @@ -0,0 +1,281 @@ +//===--ReferenceQueue.cpp - Implementation of soft/weak/phantom references-===// +// +// The VMKit project +// +// This file is distributed under the University of Pierre et Marie Curie +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "ClasspathReflect.h" +#include "JavaClass.h" +#include "JavaUpcalls.h" +#include "Jnjvm.h" +#include "ReferenceQueue.h" + +using namespace j3; + +ReferenceThread::ReferenceThread(Jnjvm* vm) : JavaThread(NULL, NULL, vm), + WeakReferencesQueue(ReferenceQueue::WEAK), + SoftReferencesQueue(ReferenceQueue::SOFT), + PhantomReferencesQueue(ReferenceQueue::PHANTOM) { + + ToEnqueue = new gc*[INITIAL_QUEUE_SIZE]; + ToEnqueueLength = INITIAL_QUEUE_SIZE; + ToEnqueueIndex = 0; +} + + +bool enqueueReference(gc* _obj) { + Jnjvm* vm = JavaThread::get()->getJVM(); + JavaObject* obj = (JavaObject*)_obj; + llvm_gcroot(obj, 0); + JavaMethod* meth = vm->upcalls->EnqueueReference; + UserClass* cl = JavaObject::getClass(obj)->asClass(); + return (bool)meth->invokeIntSpecialBuf(vm, cl, obj, 0); +} + +void invokeEnqueue(gc* res) { + llvm_gcroot(res, 0); + TRY { + enqueueReference(res); + } IGNORE; + mvm::Thread::get()->clearException(); +} + +void ReferenceThread::enqueueStart(ReferenceThread* th) { + gc* res = NULL; + llvm_gcroot(res, 0); + + while (true) { + th->EnqueueLock.lock(); + while (th->ToEnqueueIndex == 0) { + th->EnqueueCond.wait(&th->EnqueueLock); + } + th->EnqueueLock.unlock(); + + while (true) { + th->ToEnqueueLock.acquire(); + if (th->ToEnqueueIndex != 0) { + res = th->ToEnqueue[th->ToEnqueueIndex - 1]; + --th->ToEnqueueIndex; + } + th->ToEnqueueLock.release(); + if (!res) break; + + invokeEnqueue(res); + res = NULL; + } + } +} + + +void ReferenceThread::addToEnqueue(gc* obj) { + if (ToEnqueueIndex >= ToEnqueueLength) { + uint32 newLength = ToEnqueueLength * GROW_FACTOR; + gc** newQueue = new gc*[newLength]; + if (!newQueue) { + fprintf(stderr, "I don't know how to handle reference overflow yet!\n"); + abort(); + } + for (uint32 i = 0; i < ToEnqueueLength; ++i) { + newQueue[i] = ToEnqueue[i]; + } + delete[] ToEnqueue; + ToEnqueue = newQueue; + ToEnqueueLength = newLength; + } + ToEnqueue[ToEnqueueIndex++] = obj; +} + +gc** getReferentPtr(gc* _obj) { + JavaObjectReference* obj = (JavaObjectReference*)_obj; + llvm_gcroot(obj, 0); + return (gc**)JavaObjectReference::getReferentPtr(obj); +} + +void setReferent(gc* _obj, gc* val) { + JavaObjectReference* obj = (JavaObjectReference*)_obj; + llvm_gcroot(obj, 0); + llvm_gcroot(val, 0); + JavaObjectReference::setReferent(obj, (JavaObject*)val); +} + +void clearReferent(gc* _obj) { + JavaObjectReference* obj = (JavaObjectReference*)_obj; + llvm_gcroot(obj, 0); + JavaObjectReference::setReferent(obj, NULL); +} + +gc* ReferenceQueue::processReference(gc* reference, ReferenceThread* th, uintptr_t closure) { + if (!mvm::Collector::isLive(reference, closure)) { + clearReferent(reference); + return NULL; + } + + gc* referent = *(getReferentPtr(reference)); + + if (!referent) { + return NULL; + } + + if (semantics == SOFT) { + // TODO: are we are out of memory? Consider that we always are for now. + if (false) { + mvm::Collector::retainReferent(referent, closure); + } + } else if (semantics == PHANTOM) { + // Nothing to do. + } + + gc* newReference = + mvm::Collector::getForwardedReference(reference, closure); + if (mvm::Collector::isLive(referent, closure)) { + gc* newReferent = mvm::Collector::getForwardedReferent(referent, closure); + setReferent(newReference, newReferent); + return newReference; + } else { + clearReferent(newReference); + th->addToEnqueue(newReference); + return NULL; + } +} + + +void ReferenceQueue::scan(ReferenceThread* th, uintptr_t closure) { + uint32 NewIndex = 0; + + for (uint32 i = 0; i < CurrentIndex; ++i) { + gc* obj = References[i]; + gc* res = processReference(obj, th, closure); + if (res) References[NewIndex++] = res; + } + + CurrentIndex = NewIndex; +} + + +FinalizerThread::FinalizerThread(Jnjvm* vm) : JavaThread(NULL, NULL, vm) { + FinalizationQueue = new gc*[INITIAL_QUEUE_SIZE]; + QueueLength = INITIAL_QUEUE_SIZE; + CurrentIndex = 0; + + ToBeFinalized = new gc*[INITIAL_QUEUE_SIZE]; + ToBeFinalizedLength = INITIAL_QUEUE_SIZE; + CurrentFinalizedIndex = 0; +} + +void FinalizerThread::growFinalizationQueue() { + if (CurrentIndex >= QueueLength) { + uint32 newLength = QueueLength * GROW_FACTOR; + gc** newQueue = new gc*[newLength]; + if (!newQueue) { + fprintf(stderr, "I don't know how to handle finalizer overflows yet!\n"); + abort(); + } + for (uint32 i = 0; i < QueueLength; ++i) newQueue[i] = FinalizationQueue[i]; + delete[] FinalizationQueue; + FinalizationQueue = newQueue; + QueueLength = newLength; + } +} + +void FinalizerThread::growToBeFinalizedQueue() { + if (CurrentFinalizedIndex >= ToBeFinalizedLength) { + uint32 newLength = ToBeFinalizedLength * GROW_FACTOR; + gc** newQueue = new gc*[newLength]; + if (!newQueue) { + fprintf(stderr, "I don't know how to handle finalizer overflows yet!\n"); + abort(); + } + for (uint32 i = 0; i < ToBeFinalizedLength; ++i) newQueue[i] = ToBeFinalized[i]; + delete[] ToBeFinalized; + ToBeFinalized = newQueue; + ToBeFinalizedLength = newLength; + } +} + + +void FinalizerThread::addFinalizationCandidate(gc* obj) { + FinalizationQueueLock.acquire(); + + if (CurrentIndex >= QueueLength) { + growFinalizationQueue(); + } + + FinalizationQueue[CurrentIndex++] = obj; + FinalizationQueueLock.release(); +} + + +void FinalizerThread::scanFinalizationQueue(uintptr_t closure) { + uint32 NewIndex = 0; + for (uint32 i = 0; i < CurrentIndex; ++i) { + gc* obj = FinalizationQueue[i]; + + if (!mvm::Collector::isLive(obj, closure)) { + obj = mvm::Collector::retainForFinalize(FinalizationQueue[i], closure); + + if (CurrentFinalizedIndex >= ToBeFinalizedLength) + growToBeFinalizedQueue(); + + /* Add to object table */ + ToBeFinalized[CurrentFinalizedIndex++] = obj; + } else { + FinalizationQueue[NewIndex++] = + mvm::Collector::getForwardedFinalizable(obj, closure); + } + } + CurrentIndex = NewIndex; +} + +typedef void (*destructor_t)(void*); + +void invokeFinalizer(gc* _obj) { + Jnjvm* vm = JavaThread::get()->getJVM(); + JavaObject* obj = (JavaObject*)_obj; + llvm_gcroot(obj, 0); + JavaMethod* meth = vm->upcalls->FinalizeObject; + UserClass* cl = JavaObject::getClass(obj)->asClass(); + meth->invokeIntVirtualBuf(vm, cl, obj, 0); +} + +void invokeFinalize(gc* res) { + llvm_gcroot(res, 0); + TRY { + invokeFinalizer(res); + } IGNORE; + mvm::Thread::get()->clearException(); +} + +void FinalizerThread::finalizerStart(FinalizerThread* th) { + gc* res = NULL; + llvm_gcroot(res, 0); + + while (true) { + th->FinalizationLock.lock(); + while (th->CurrentFinalizedIndex == 0) { + th->FinalizationCond.wait(&th->FinalizationLock); + } + th->FinalizationLock.unlock(); + + while (true) { + th->FinalizationQueueLock.acquire(); + if (th->CurrentFinalizedIndex != 0) { + res = th->ToBeFinalized[th->CurrentFinalizedIndex - 1]; + --th->CurrentFinalizedIndex; + } + th->FinalizationQueueLock.release(); + if (!res) break; + + VirtualTable* VT = res->getVirtualTable(); + if (VT->operatorDelete) { + destructor_t dest = (destructor_t)VT->destructor; + dest(res); + } else { + invokeFinalize(res); + } + res = NULL; + } + } +} Added: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h?rev=117226&view=auto ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h (added) +++ vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h Sun Oct 24 09:37:39 2010 @@ -0,0 +1,207 @@ +//===---ReferenceQueue.h - Implementation of soft/weak/phantom references--===// +// +// The VMKit project +// +// This file is distributed under the University of Pierre et Marie Curie +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef J3_REFERENCE_QUEUE_H +#define J3_REFERENCE_QUEUE_H + +#include "mvm/Threads/Locks.h" + +#include "JavaThread.h" + +// Same values than JikesRVM +#define INITIAL_QUEUE_SIZE 256 +#define GROW_FACTOR 2 + +namespace j3 { + +class ReferenceThread; +class Jnjvm; + +class ReferenceQueue { +private: + gc** References; + uint32 QueueLength; + uint32 CurrentIndex; + mvm::SpinLock QueueLock; + uint8_t semantics; + + gc* processReference(gc*, ReferenceThread*, uintptr_t closure); +public: + + static const uint8_t WEAK = 1; + static const uint8_t SOFT = 2; + static const uint8_t PHANTOM = 3; + + + ReferenceQueue(uint8_t s) { + References = new gc*[INITIAL_QUEUE_SIZE]; + QueueLength = INITIAL_QUEUE_SIZE; + CurrentIndex = 0; + semantics = s; + } + + ~ReferenceQueue() { + delete[] References; + } + + void addReference(gc* ref) { + QueueLock.acquire(); + if (CurrentIndex >= QueueLength) { + uint32 newLength = QueueLength * GROW_FACTOR; + gc** newQueue = new gc*[newLength]; + if (!newQueue) { + fprintf(stderr, "I don't know how to handle reference overflow yet!\n"); + abort(); + } + for (uint32 i = 0; i < QueueLength; ++i) newQueue[i] = References[i]; + delete[] References; + References = newQueue; + QueueLength = newLength; + } + References[CurrentIndex++] = ref; + QueueLock.release(); + } + + void acquire() { + QueueLock.acquire(); + } + + void release() { + QueueLock.release(); + } + + void scan(ReferenceThread* thread, uintptr_t closure); +}; + +class ReferenceThread : public JavaThread { +public: + /// WeakReferencesQueue - The queue of weak references. + /// + ReferenceQueue WeakReferencesQueue; + + /// SoftReferencesQueue - The queue of soft references. + /// + ReferenceQueue SoftReferencesQueue; + + /// PhantomReferencesQueue - The queue of phantom references. + /// + ReferenceQueue PhantomReferencesQueue; + + gc** ToEnqueue; + uint32 ToEnqueueLength; + uint32 ToEnqueueIndex; + + /// ToEnqueueLock - A lock to protect access to the queue. + /// + mvm::LockNormal EnqueueLock; + mvm::Cond EnqueueCond; + mvm::SpinLock ToEnqueueLock; + + void addToEnqueue(gc* obj); + + static void enqueueStart(ReferenceThread*); + + /// addWeakReference - Add a weak reference to the queue. + /// + void addWeakReference(gc* ref) { + WeakReferencesQueue.addReference(ref); + } + + /// addSoftReference - Add a weak reference to the queue. + /// + void addSoftReference(gc* ref) { + SoftReferencesQueue.addReference(ref); + } + + /// addPhantomReference - Add a weak reference to the queue. + /// + void addPhantomReference(gc* ref) { + PhantomReferencesQueue.addReference(ref); + } + + ReferenceThread(Jnjvm* vm); + + ~ReferenceThread() { + delete[] ToEnqueue; + } +}; + +class FinalizerThread : public JavaThread { +public: + /// FinalizationQueueLock - A lock to protect access to the queue. + /// + mvm::SpinLock FinalizationQueueLock; + + /// finalizationQueue - A list of allocated objets that contain a finalize + /// method. + /// + gc** FinalizationQueue; + + /// CurrentIndex - Current index in the queue of finalizable objects. + /// + uint32 CurrentIndex; + + /// QueueLength - Current length of the queue of finalizable objects. + /// + uint32 QueueLength; + + /// growFinalizationQueue - Grow the queue of finalizable objects. + /// + void growFinalizationQueue(); + + /// ToBeFinalized - List of objects that are scheduled to be finalized. + /// + gc** ToBeFinalized; + + /// ToBeFinalizedLength - Current length of the queue of objects scheduled + /// for finalization. + /// + uint32 ToBeFinalizedLength; + + /// CurrentFinalizedIndex - The current index in the ToBeFinalized queue + /// that will be sceduled for finalization. + /// + uint32 CurrentFinalizedIndex; + + /// growToBeFinalizedQueue - Grow the queue of the to-be finalized objects. + /// + void growToBeFinalizedQueue(); + + /// finalizationCond - Condition variable to wake up finalization threads. + /// + mvm::Cond FinalizationCond; + + /// finalizationLock - Lock for the condition variable. + /// + mvm::LockNormal FinalizationLock; + + static void finalizerStart(FinalizerThread*); + + /// addFinalizationCandidate - Add an object to the queue of objects with + /// a finalization method. + /// + void addFinalizationCandidate(gc*); + + /// scanFinalizationQueue - Scan objets with a finalized method and schedule + /// them for finalization if they are not live. + /// + void scanFinalizationQueue(uintptr_t closure); + + FinalizerThread(Jnjvm* vm); + + ~FinalizerThread() { + delete[] FinalizationQueue; + delete[] ToBeFinalized; + } + +}; + +} // namespace j3 + +#endif //J3_REFERENCE_QUEUE_H Modified: vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Sun Oct 24 09:37:39 2010 @@ -30,6 +30,7 @@ #include "Jnjvm.h" #include "JnjvmClassLoader.h" #include "LockedMap.h" +#include "ReferenceQueue.h" #include "Zip.h" using namespace j3; @@ -264,15 +265,16 @@ void Jnjvm::tracer(uintptr_t closure) { - - VirtualMachine::tracer(closure); + // (1) Trace the bootrap loader. bootstrapLoader->tracer(closure); + // (2) Trace the application class loader. if (appClassLoader != NULL) { mvm::Collector::markAndTraceRoot( appClassLoader->getJavaClassLoaderPtr(), closure); } + // (3) Trace JNI global references. JNIGlobalReferences* start = &globalRefs; while (start != NULL) { for (uint32 i = 0; i < start->length; ++i) { @@ -282,6 +284,7 @@ start = start->next; } + // (4) Trace the interned strings. for (StringMap::iterator i = hashStr.map.begin(), e = hashStr.map.end(); i!= e; ++i) { JavaString** str = &(i->second); @@ -289,7 +292,13 @@ ArrayUInt16** key = const_cast(&(i->first)); mvm::Collector::markAndTraceRoot(key, closure); } + + // (5) Trace the finalization queue. + for (uint32 i = 0; i < finalizerThread->CurrentFinalizedIndex; ++i) { + mvm::Collector::markAndTraceRoot(finalizerThread->ToBeFinalized + i, closure); + } + // (6) Trace the locks and their associated object. uint32 i = 0; for (; i < mvm::LockSystem::GlobalSize; i++) { mvm::FatLock** array = lockSystem.LockTable[i]; @@ -307,6 +316,8 @@ for (i = i + 1; i < mvm::LockSystem::GlobalSize; i++) { assert(lockSystem.LockTable[i] == NULL); } + + #if defined(ISOLATE_SHARING) mvm::Collector::markAndTraceRoot(&JnjvmSharedLoader::sharedLoader, closure); #endif Modified: vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp (original) +++ vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp Sun Oct 24 09:37:39 2010 @@ -94,10 +94,8 @@ status = stat_alloc; // Wake up all threads. - th->MyVM->endCollection(); th->MyVM->rendezvous.finishRV(); - th->MyVM->wakeUpFinalizers(); - th->MyVM->wakeUpEnqueue(); + th->MyVM->endCollection(); // Kill unreachable objects. GCChunkNode *next = 0; Modified: vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp Sun Oct 24 09:37:39 2010 @@ -59,202 +59,6 @@ buf->write(">"); } -typedef void (*destructor_t)(void*); - -void invokeFinalize(mvm::Thread* th, gc* res) { - llvm_gcroot(res, 0); - TRY { - th->MyVM->invokeFinalizer(res); - } IGNORE; - th->clearException(); -} - -void invokeEnqueue(mvm::Thread* th, gc* res) { - llvm_gcroot(res, 0); - TRY { - th->MyVM->enqueueReference(res); - } IGNORE; - th->clearException(); -} - -void VirtualMachine::finalizerStart(mvm::Thread* th) { - VirtualMachine* vm = th->MyVM; - gc* res = 0; - llvm_gcroot(res, 0); - - while (true) { - vm->FinalizationLock.lock(); - while (vm->CurrentFinalizedIndex == 0) { - vm->FinalizationCond.wait(&vm->FinalizationLock); - } - vm->FinalizationLock.unlock(); - - while (true) { - vm->FinalizationQueueLock.acquire(); - if (vm->CurrentFinalizedIndex != 0) { - res = vm->ToBeFinalized[vm->CurrentFinalizedIndex - 1]; - --vm->CurrentFinalizedIndex; - } - vm->FinalizationQueueLock.release(); - if (!res) break; - - VirtualTable* VT = res->getVirtualTable(); - if (VT->operatorDelete) { - destructor_t dest = (destructor_t)VT->destructor; - dest(res); - } else { - invokeFinalize(th, res); - } - res = 0; - } - } -} - -void VirtualMachine::enqueueStart(mvm::Thread* th) { - VirtualMachine* vm = th->MyVM; - gc* res = 0; - llvm_gcroot(res, 0); - - while (true) { - vm->EnqueueLock.lock(); - while (vm->ToEnqueueIndex == 0) { - vm->EnqueueCond.wait(&vm->EnqueueLock); - } - vm->EnqueueLock.unlock(); - - while (true) { - vm->ToEnqueueLock.acquire(); - if (vm->ToEnqueueIndex != 0) { - res = vm->ToEnqueue[vm->ToEnqueueIndex - 1]; - --vm->ToEnqueueIndex; - } - vm->ToEnqueueLock.release(); - if (!res) break; - - invokeEnqueue(th, res); - res = 0; - } - } -} - -void VirtualMachine::growFinalizationQueue() { - if (CurrentIndex >= QueueLength) { - uint32 newLength = QueueLength * GROW_FACTOR; - gc** newQueue = new gc*[newLength]; - if (!newQueue) { - fprintf(stderr, "I don't know how to handle finalizer overflows yet!\n"); - abort(); - } - for (uint32 i = 0; i < QueueLength; ++i) newQueue[i] = FinalizationQueue[i]; - delete[] FinalizationQueue; - FinalizationQueue = newQueue; - QueueLength = newLength; - } -} - -void VirtualMachine::growToBeFinalizedQueue() { - if (CurrentFinalizedIndex >= ToBeFinalizedLength) { - uint32 newLength = ToBeFinalizedLength * GROW_FACTOR; - gc** newQueue = new gc*[newLength]; - if (!newQueue) { - fprintf(stderr, "I don't know how to handle finalizer overflows yet!\n"); - abort(); - } - for (uint32 i = 0; i < ToBeFinalizedLength; ++i) newQueue[i] = ToBeFinalized[i]; - delete[] ToBeFinalized; - ToBeFinalized = newQueue; - ToBeFinalizedLength = newLength; - } -} - - -void VirtualMachine::addFinalizationCandidate(gc* obj) { - FinalizationQueueLock.acquire(); - - if (CurrentIndex >= QueueLength) { - growFinalizationQueue(); - } - - FinalizationQueue[CurrentIndex++] = obj; - FinalizationQueueLock.release(); -} - - -void VirtualMachine::scanFinalizationQueue(uintptr_t closure) { - uint32 NewIndex = 0; - for (uint32 i = 0; i < CurrentIndex; ++i) { - gc* obj = FinalizationQueue[i]; - - if (!Collector::isLive(obj, closure)) { - obj = Collector::retainForFinalize(FinalizationQueue[i], closure); - - if (CurrentFinalizedIndex >= ToBeFinalizedLength) - growToBeFinalizedQueue(); - - /* Add to object table */ - ToBeFinalized[CurrentFinalizedIndex++] = obj; - } else { - FinalizationQueue[NewIndex++] = - Collector::getForwardedFinalizable(obj, closure); - } - } - CurrentIndex = NewIndex; -} - -void VirtualMachine::tracer(uintptr_t closure) { - for (uint32 i = 0; i < CurrentFinalizedIndex; ++i) { - Collector::markAndTraceRoot(ToBeFinalized + i, closure); - } -} - -gc* ReferenceQueue::processReference( - gc* reference, VirtualMachine* vm, uintptr_t closure) { - if (!Collector::isLive(reference, closure)) { - vm->clearReferent(reference); - return NULL; - } - - gc* referent = *(vm->getReferentPtr(reference)); - - if (!referent) { - return NULL; - } - - if (semantics == SOFT) { - // TODO: are we are out of memory? Consider that we always are for now. - if (false) { - Collector::retainReferent(referent, closure); - } - } else if (semantics == PHANTOM) { - // Nothing to do. - } - - gc* newReference = - mvm::Collector::getForwardedReference(reference, closure); - if (Collector::isLive(referent, closure)) { - gc* newReferent = mvm::Collector::getForwardedReferent(referent, closure); - vm->setReferent(newReference, newReferent); - return newReference; - } else { - vm->clearReferent(newReference); - vm->addToEnqueue(newReference); - return NULL; - } -} - - -void ReferenceQueue::scan(VirtualMachine* vm, uintptr_t closure) { - uint32 NewIndex = 0; - - for (uint32 i = 0; i < CurrentIndex; ++i) { - gc* obj = References[i]; - gc* res = processReference(obj, vm, closure); - if (res) References[NewIndex++] = res; - } - - CurrentIndex = NewIndex; -} - void PreciseStackScanner::scanStack(mvm::Thread* th, uintptr_t closure) { StackWalker Walker(th); Modified: vmkit/branches/precise/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/Collection.cpp?rev=117226&r1=117225&r2=117226&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/Collection.cpp Sun Oct 24 09:37:39 2010 @@ -81,10 +81,6 @@ } th->MyVM->rendezvous.finishRV(); - - th->MyVM->wakeUpFinalizers(); - th->MyVM->wakeUpEnqueue(); - th->MyVM->endCollection(); } From nicolas.geoffray at lip6.fr Sun Oct 24 08:15:30 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 15:15:30 -0000 Subject: [vmkit-commits] [vmkit] r117227 - in /vmkit/branches/precise: include/mvm/VirtualMachine.h lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/VMCore/JavaInitialise.cpp lib/J3/VMCore/Jnjvm.cpp tools/vmjc/vmjc.cpp tools/vmkit/Launcher.cpp Message-ID: <20101024151530.E67772A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 10:15:30 2010 New Revision: 117227 URL: http://llvm.org/viewvc/llvm-project?rev=117227&view=rev Log: Code cleanup. No functionality change. Removed: vmkit/branches/precise/lib/J3/VMCore/JavaInitialise.cpp Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/precise/tools/vmjc/vmjc.cpp vmkit/branches/precise/tools/vmkit/Launcher.cpp Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/VirtualMachine.h?rev=117227&r1=117226&r2=117227&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/precise/include/mvm/VirtualMachine.h Sun Oct 24 10:15:30 2010 @@ -50,25 +50,13 @@ FunctionMap(); }; -class CompilationUnit; - - /// VirtualMachine - This class is the root of virtual machine classes. It /// defines what a VM should be. /// class VirtualMachine : public mvm::PermanentObject { protected: VirtualMachine(mvm::BumpPtrAllocator &Alloc) : - allocator(Alloc) { -#ifdef SERVICE - memoryLimit = ~0; - executionLimit = ~0; - GCLimit = ~0; - threadLimit = ~0; - parent = this; - status = 1; - _since_last_collection = 4*1024*1024; -#endif + allocator(Alloc) { mainThread = 0; NumberOfThreads = 0; } @@ -208,36 +196,6 @@ /// waitForExit - Wait until the virtual machine stops its execution. virtual void waitForExit() = 0; - - static j3::JnjvmClassLoader* initialiseJVM(j3::JavaCompiler* C, - bool dlLoad = true); - static VirtualMachine* createJVM(j3::JnjvmClassLoader* C = 0); - - static CompilationUnit* initialiseCLIVM(); - static VirtualMachine* createCLIVM(CompilationUnit* C = 0); - -#ifdef ISOLATE - size_t IsolateID; -#endif - -#ifdef SERVICE - uint64_t memoryUsed; - uint64_t gcTriggered; - uint64_t executionTime; - uint64_t numThreads; - CompilationUnit* CU; - virtual void stopService() {} - - uint64_t memoryLimit; - uint64_t executionLimit; - uint64_t threadLimit; - uint64_t GCLimit; - - int _since_last_collection; - VirtualMachine* parent; - uint32 status; -#endif - }; } // end namespace mvm Modified: vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp?rev=117227&r1=117226&r2=117227&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp Sun Oct 24 10:15:30 2010 @@ -430,9 +430,11 @@ newArgv[0] = newArgv[1]; newArgv[1] = mainClass; + mvm::BumpPtrAllocator Allocator; JavaJITCompiler* Comp = JavaJITCompiler::CreateCompiler("JITModule"); - JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp); - mvm::VirtualMachine* vm = mvm::VirtualMachine::createJVM(JCL); + JnjvmBootstrapLoader* loader = new(Allocator, "Bootstrap loader") + JnjvmBootstrapLoader(Allocator, Comp, true); + Jnjvm* vm = new(Allocator, "VM") Jnjvm(Allocator, loader); vm->runApplication(argc + 1, newArgv); vm->waitForExit(); Removed: vmkit/branches/precise/lib/J3/VMCore/JavaInitialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaInitialise.cpp?rev=117226&view=auto ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaInitialise.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaInitialise.cpp (removed) @@ -1,56 +0,0 @@ -//===-------- JavaInitialise.cpp - Initialization of JnJVM ----------------===// -// -// The VMKit project -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "mvm/VirtualMachine.h" -#include "j3/JavaCompiler.h" - -#include "JavaArray.h" -#include "JavaClass.h" -#include "JavaObject.h" -#include "Jnjvm.h" -#include "JnjvmClassLoader.h" - -#ifdef ISOLATE_SHARING -#include "SharedMaps.h" -#include "IsolateSharedLoader.h" -#endif - -using namespace j3; - - -#ifdef ISOLATE_SHARING -JnjvmClassLoader* mvm::VirtualMachine::initialiseJVM(JavaCompiler* Comp) { - JnjvmSharedLoader::sharedLoader = JnjvmSharedLoader::createSharedLoader(Comp); - return JnjvmSharedLoader::sharedLoader; -} - -mvm::VirtualMachine* mvm::VirtualMachine::createJVM(JnjvClassLoader* JCL) { - mvm::BumpPtrAllocator* A = new mvm::BumpPtrAllocator(); - mvm::BumpPtrAllocator* C = new mvm::BumpPtrAllocator(); - JnjvmBootstraLoader* bootstrapLoader = - new(*C) JnjvmBootstrapLoader(*C, JCL->getCompiler()); - Jnjvm* vm = new(*A, "VM") Jnjvm(*A, bootstrapLoader); - vm->scanner = JCL->getCompiler()->createStackScanner(); - return vm; -} -#else - -JnjvmClassLoader* -mvm::VirtualMachine::initialiseJVM(JavaCompiler* Comp, bool dlLoad) { - mvm::BumpPtrAllocator* A = new mvm::BumpPtrAllocator(); - return new(*A, "Bootstrap loader") JnjvmBootstrapLoader(*A, Comp, dlLoad); -} - -mvm::VirtualMachine* mvm::VirtualMachine::createJVM(JnjvmClassLoader* C) { - mvm::BumpPtrAllocator* A = new mvm::BumpPtrAllocator(); - Jnjvm* vm = new(*A, "VM") Jnjvm(*A, (JnjvmBootstrapLoader*)C); - return vm; -} - -#endif Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp?rev=117227&r1=117226&r2=117227&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp Sun Oct 24 10:15:30 2010 @@ -1545,7 +1545,7 @@ }; -// Helper function to run Jnjvm without JIT. +// Helper function to run J3 without JIT. extern "C" int StartJnjvmWithoutJIT(int argc, char** argv, char* mainClass) { mvm::Collector::initialise(); @@ -1555,9 +1555,12 @@ newArgv[0] = newArgv[1]; newArgv[1] = mainClass; + mvm::BumpPtrAllocator Allocator; JavaCompiler* Comp = new JavaStaticCompiler(); - JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp); - mvm::VirtualMachine* vm = mvm::VirtualMachine::createJVM(JCL); + JnjvmBootstrapLoader* loader = new(Allocator, "Bootstrap loader") + JnjvmBootstrapLoader(Allocator, Comp, true); + Jnjvm* vm = new(Allocator, "VM") Jnjvm(Allocator, loader); + vm->runApplication(argc + 1, newArgv); vm->waitForExit(); Modified: vmkit/branches/precise/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/tools/vmjc/vmjc.cpp?rev=117227&r1=117226&r2=117227&view=diff ============================================================================== --- vmkit/branches/precise/tools/vmjc/vmjc.cpp (original) +++ vmkit/branches/precise/tools/vmjc/vmjc.cpp Sun Oct 24 10:15:30 2010 @@ -178,15 +178,16 @@ mvm::Collector::initialise(); - JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp, false); + mvm::BumpPtrAllocator allocator; + JnjvmBootstrapLoader* loader = new(allocator, "Bootstrap loader") + JnjvmBootstrapLoader(allocator, Comp, false); if (DisableExceptions) Comp->disableExceptions(); if (DisableStubs) Comp->generateStubs = false; if (AssumeCompiled) Comp->assumeCompiled = true; if (DisableCooperativeGC) Comp->disableCooperativeGC(); - mvm::BumpPtrAllocator A; - Jnjvm* vm = new(A, "Bootstrap loader") Jnjvm(A, (JnjvmBootstrapLoader*)JCL); + Jnjvm* vm = new(allocator, "Bootstrap loader") Jnjvm(allocator, loader); for (std::vector::iterator i = Properties.begin(), e = Properties.end(); i != e; ++i) { Modified: vmkit/branches/precise/tools/vmkit/Launcher.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/tools/vmkit/Launcher.cpp?rev=117227&r1=117226&r2=117227&view=diff ============================================================================== --- vmkit/branches/precise/tools/vmkit/Launcher.cpp (original) +++ vmkit/branches/precise/tools/vmkit/Launcher.cpp Sun Oct 24 10:15:30 2010 @@ -26,6 +26,8 @@ #include "mvm/Threads/Thread.h" #include "j3/JavaJITCompiler.h" +#include "../../lib/J3/VMCore/JnjvmClassLoader.h" +#include "../../lib/J3/VMCore/Jnjvm.h" #include "CommandLine.h" @@ -33,14 +35,12 @@ using namespace llvm; enum VMType { - Interactive, RunJava, RunNet + RunJava }; static llvm::cl::opt VMToRun(llvm::cl::desc("Choose VM to run:"), llvm::cl::values( - clEnumValN(Interactive , "i", "Run in interactive mode"), clEnumValN(RunJava , "java", "Run the JVM"), - clEnumValN(RunNet, "net", "Run the CLI VM"), clEnumValEnd)); static llvm::cl::opt Fast("fast", @@ -57,55 +57,26 @@ } int main(int argc, char** argv) { - // Disable the lcean shutdown, as deamon threads may still - // continue to execute and use LLVM things. - //llvm::llvm_shutdown_obj X; - + llvm::llvm_shutdown_obj X; int pos = found(argv, argc, "-java"); if (pos) { llvm::cl::ParseCommandLineOptions(pos, argv); } else { - pos = found(argv, argc, "-net"); - if (pos) { - llvm::cl::ParseCommandLineOptions(pos, argv); - } else { - llvm::cl::ParseCommandLineOptions(argc, argv); - } + fprintf(stderr, "Only -java is supported\n"); + return 0; } mvm::MvmModule::initialise(Fast ? CodeGenOpt::None : CodeGenOpt::Aggressive); mvm::Collector::initialise(); if (VMToRun == RunJava) { -#if WITH_J3 + mvm::BumpPtrAllocator Allocator; JavaJITCompiler* Comp = JavaJITCompiler::CreateCompiler("JITModule"); - JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp); - mvm::VirtualMachine* vm = mvm::VirtualMachine::createJVM(JCL); - vm->runApplication(argc, argv); - vm->waitForExit(); -#endif - } else if (VMToRun == RunNet) { -#if WITH_N3 - mvm::CompilationUnit* CU = mvm::VirtualMachine::initialiseCLIVM(); - mvm::VirtualMachine* vm = mvm::VirtualMachine::createCLIVM(CU); + JnjvmBootstrapLoader* loader = new(Allocator, "Bootstrap loader") + JnjvmBootstrapLoader(Allocator, Comp, true); + Jnjvm* vm = new(Allocator, "VM") Jnjvm(Allocator, loader); vm->runApplication(argc, argv); vm->waitForExit(); -#endif - } else { - mvm::CommandLine MyCl; -#if WITH_J3 - JavaJITCompiler* Comp = JavaJITCompiler::CreateCompiler("JITModule"); - JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp); - MyCl.vmlets["java"] = (create_vm_t)(mvm::VirtualMachine::createJVM); - MyCl.compilers["java"] = (mvm::Object*)JCL; -#endif -#if WITH_N3 - mvm::CompilationUnit* CLICompiler = - mvm::VirtualMachine::initialiseCLIVM(); - MyCl.vmlets["net"] = (create_vm_t)(mvm::VirtualMachine::createCLIVM); - MyCl.compilers["net"] = (mvm::Object*)CLICompiler; -#endif - MyCl.start(); } return 0; From nicolas.geoffray at lip6.fr Sun Oct 24 08:50:13 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 15:50:13 -0000 Subject: [vmkit-commits] [vmkit] r117229 - in /vmkit/branches/precise: include/j3/JavaCompiler.h include/j3/JavaJITCompiler.h include/mvm/CompilationUnit.h include/mvm/VirtualMachine.h lib/J3/VMCore/Jnjvm.cpp lib/Mvm/GCMmap2/gccollector.cpp mmtk/mmtk-j3/Scanning.cpp Message-ID: <20101024155013.CB8D62A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 10:50:13 2010 New Revision: 117229 URL: http://llvm.org/viewvc/llvm-project?rev=117229&view=rev Log: Continue the cleanup. Removed: vmkit/branches/precise/include/mvm/CompilationUnit.h Modified: vmkit/branches/precise/include/j3/JavaCompiler.h vmkit/branches/precise/include/j3/JavaJITCompiler.h vmkit/branches/precise/include/mvm/VirtualMachine.h vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp vmkit/branches/precise/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/branches/precise/include/j3/JavaCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/j3/JavaCompiler.h?rev=117229&r1=117228&r2=117229&view=diff ============================================================================== --- vmkit/branches/precise/include/j3/JavaCompiler.h (original) +++ vmkit/branches/precise/include/j3/JavaCompiler.h Sun Oct 24 10:50:13 2010 @@ -102,10 +102,6 @@ virtual ~JavaCompiler() {} - virtual mvm::StackScanner* createStackScanner() { - return new mvm::UnpreciseStackScanner(); - } - virtual void* loadMethod(void* handle, const char* symbol) { return dlsym(handle, symbol); } Modified: vmkit/branches/precise/include/j3/JavaJITCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/j3/JavaJITCompiler.h?rev=117229&r1=117228&r2=117229&view=diff ============================================================================== --- vmkit/branches/precise/include/j3/JavaJITCompiler.h (original) +++ vmkit/branches/precise/include/j3/JavaJITCompiler.h Sun Oct 24 10:50:13 2010 @@ -74,26 +74,11 @@ virtual void setMethod(llvm::Function* func, void* ptr, const char* name); - -#ifdef SERVICE - virtual llvm::Value* getIsolate(Jnjvm* vm, llvm::Value* Where); -#endif - virtual llvm::Value* addCallback(Class* cl, uint16 index, Signdef* sign, bool stat, llvm::BasicBlock* insert) = 0; virtual uintptr_t getPointerOrStub(JavaMethod& meth, int type) = 0; -#ifdef WITH_LLVM_GCC - virtual mvm::StackScanner* createStackScanner() { - if (useCooperativeGC()) - return new mvm::PreciseStackScanner(); - - return new mvm::UnpreciseStackScanner(); - } -#endif - static JavaJITCompiler* CreateCompiler(const std::string& ModuleID); - }; class JavaJ3LazyJITCompiler : public JavaJITCompiler { Removed: vmkit/branches/precise/include/mvm/CompilationUnit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/CompilationUnit.h?rev=117228&view=auto ============================================================================== --- vmkit/branches/precise/include/mvm/CompilationUnit.h (original) +++ vmkit/branches/precise/include/mvm/CompilationUnit.h (removed) @@ -1,33 +0,0 @@ -//===---- CompilingUnit.h - A compilation unit to compile source files ----===// -// -// The VMKit project -// -// This file is distributed under the University of Pierre et Marie Curie -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// A compilation unit contains a module and a module provider to compile source -// files of a virtual machine, e.g .java files in Java. -// -//===----------------------------------------------------------------------===// - -#ifndef MVM_COMPILATION_UNIT_H -#define MVM_COMPILATION_UNIT_H - -#include "mvm/Object.h" - -namespace mvm { - -class MvmModule; - -class CompilationUnit : public mvm::Object { -public: - MvmModule* TheModule; - - void AddStandardCompilePasses(); -}; -} - - -#endif Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/VirtualMachine.h?rev=117229&r1=117228&r2=117229&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/precise/include/mvm/VirtualMachine.h Sun Oct 24 10:50:13 2010 @@ -62,7 +62,6 @@ } virtual ~VirtualMachine() { - if (scanner) delete scanner; } public: @@ -161,20 +160,16 @@ /// virtual void tracer(uintptr_t closure) {} - /// scanner - Scanner of threads' stacks. - /// - mvm::StackScanner* scanner; - - mvm::StackScanner* getScanner() { - return scanner; - } - /// rendezvous - The rendezvous implementation for garbage collection. /// + /// scanner - Scanner of threads' stacks. + /// #ifdef WITH_LLVM_GCC CooperativeCollectionRV rendezvous; + PreciseStackScanner scanner; #else UncooperativeCollectionRV rendezvous; + UnpreciseStackScanner scanner; #endif //===----------------------------------------------------------------------===// Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp?rev=117229&r1=117228&r2=117229&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp Sun Oct 24 10:50:13 2010 @@ -43,12 +43,6 @@ const char* Jnjvm::envSeparator = ":"; const unsigned int Jnjvm::Magic = 0xcafebabe; -#ifdef ISOLATE -Jnjvm* Jnjvm::RunningIsolates[NR_ISOLATES]; -mvm::LockNormal Jnjvm::IsolateLock; -#endif - - /// initialiseClass - Java class initialisation. Java specification §2.17.5. void UserClass::initialiseClass(Jnjvm* vm) { @@ -124,16 +118,12 @@ bool vmjced = (getInitializationState() == vmjc); setInitializationState(inClinit); UserClass* cl = (UserClass*)this; -#if defined(ISOLATE) || defined(ISOLATE_SHARING) - // Isolate environments allocate the static instance on their own, not when - // the class is being resolved. - cl->allocateStaticInstance(vm); -#else + // Single environment allocates the static instance during resolution, so // that compiled code can access it directly (with an initialization // check just before the access) if (!cl->getStaticInstance()) cl->allocateStaticInstance(vm); -#endif + release(); @@ -162,11 +152,6 @@ } } -#ifdef SERVICE - if (classLoader == classLoader->bootstrapLoader || - classLoader->getIsolate() == vm) { -#endif - // 8. Next, execute either the class variable initializers and static // initializers of the class or the field initializers of the interface, // in textual order, as though they were a single block, except that @@ -201,9 +186,6 @@ self->clearException(); } END_CATCH; } -#ifdef SERVICE - } -#endif // 9. If the execution of the initializers completes normally, then lock // this Class object, label it fully initialized, notify all waiting @@ -1130,9 +1112,6 @@ } upcalls->newString->initialiseClass(this); -#ifdef SERVICE - if (!IsolateID) -#endif // The initialization code of the classes initialized below may require // to get the Java thread, so we create the Java thread object first. upcalls->InitializeThreading(this); @@ -1191,9 +1170,6 @@ obj = JavaThread::get()->currentThread(); javaLoader = appClassLoader->getJavaClassLoader(); -#ifdef SERVICE - if (!IsolateID) -#endif upcalls->setContextClassLoader->invokeIntSpecial(this, upcalls->newThread, obj, &javaLoader); // load and initialise math since it is responsible for dlopen'ing @@ -1321,10 +1297,6 @@ fprintf(stderr, "Exception %s while bootstrapping VM.", UTF8Buffer(JavaObject::getClass(exc)->name).cString()); } else { -#ifdef SERVICE - thread->ServiceException = vm->upcalls->newThrowable->doNew(vm); -#endif - ClArgumentsInfo& info = vm->argumentsInfo; if (info.agents.size()) { @@ -1361,45 +1333,9 @@ nonDaemonLock.unlock(); } -#ifdef SERVICE - -#include - -extern void terminationHandler(int); - -static void serviceCPUMonitor(mvm::Thread* th) { - while (true) { - sleep(1); - for(JavaThread* cur = (Java*)th->next(); cur != th; - cur = (JavaThread*)cur->next()) { - JavaThread* th = (JavaThread*)cur; - if (!(th->StateWaiting)) { - mvm::VirtualMachine* executingVM = cur->MyVM; - assert(executingVM && "Thread with no VM!"); - ++executingVM->executionTime; - } - } - } -} -#endif - void Jnjvm::runApplication(int argc, char** argv) { argumentsInfo.argc = argc; argumentsInfo.argv = argv; -#ifdef SERVICE - struct sigaction sa; - sigset_t mask; - sigfillset(&mask); - sigaction(SIGUSR1, 0, &sa); - sa.sa_mask = mask; - sa.sa_handler = terminationHandler; - sa.sa_flags |= SA_RESTART; - sigaction(SIGUSR1, &sa, NULL); - - mvm::Thread* th = new JavaThread(0, 0, this); - th->start(serviceCPUMonitor); -#endif - mainThread = new JavaThread(0, 0, this); mainThread->start((void (*)(mvm::Thread*))mainJavaStart); } @@ -1414,7 +1350,6 @@ jniEnv = &JNI_JNIEnvTable; javavmEnv = &JNI_JavaVMTable; - bootstrapLoader = loader; upcalls = bootstrapLoader->upcalls; @@ -1430,26 +1365,9 @@ } bootstrapLoader->insertAllMethodsInVM(this); - -#ifdef ISOLATE - IsolateLock.lock(); - for (uint32 i = 0; i < NR_ISOLATES; ++i) { - if (RunningIsolates[i] == 0) { - RunningIsolates[i] = this; - IsolateID = i; - break; - } - } - IsolateLock.unlock(); -#endif - - scanner = loader->getCompiler()->createStackScanner(); } Jnjvm::~Jnjvm() { -#ifdef ISOLATE - RunningIsolates[IsolateID] = 0; -#endif } ArrayUInt16* Jnjvm::asciizToArray(const char* asciiz) { @@ -1533,18 +1451,6 @@ finalizerThread->addFinalizationCandidate(object); } -/// JavaStaticCompiler - Compiler for AOT-compiled programs that -/// do not use the JIT. -class JavaStaticCompiler : public JavaCompiler { -public: -#ifdef WITH_LLVM_GCC - virtual mvm::StackScanner* createStackScanner() { - return new mvm::PreciseStackScanner(); - } -#endif -}; - - // Helper function to run J3 without JIT. extern "C" int StartJnjvmWithoutJIT(int argc, char** argv, char* mainClass) { mvm::Collector::initialise(); @@ -1556,7 +1462,7 @@ newArgv[1] = mainClass; mvm::BumpPtrAllocator Allocator; - JavaCompiler* Comp = new JavaStaticCompiler(); + JavaCompiler* Comp = new JavaCompiler(); JnjvmBootstrapLoader* loader = new(Allocator, "Bootstrap loader") JnjvmBootstrapLoader(Allocator, Comp, true); Jnjvm* vm = new(Allocator, "VM") Jnjvm(Allocator, loader); Modified: vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp?rev=117229&r1=117228&r2=117229&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp (original) +++ vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp Sun Oct 24 10:50:13 2010 @@ -33,18 +33,14 @@ void Collector::do_collect() { GCChunkNode *cur; -#ifdef SERVICE - mvm::Thread::get()->MyVM->_since_last_collection = _collect_freq_auto; -#else _since_last_collection = _collect_freq_auto; -#endif current_mark++; unused_nodes->attrape(used_nodes); mvm::Thread* th = mvm::Thread::get(); - mvm::StackScanner* sc = th->MyVM->getScanner(); + mvm::StackScanner& sc = th->MyVM->scanner; th->MyVM->rendezvous.startRV(); th->MyVM->startCollection(); @@ -57,7 +53,7 @@ // (2) Trace the threads. do { - sc->scanStack(tcur, 0); + sc.scanStack(tcur, 0); tcur->tracer(0); tcur = (mvm::Thread*)tcur->next(); } while (tcur != th); Modified: vmkit/branches/precise/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/Scanning.cpp?rev=117229&r1=117228&r2=117229&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/Scanning.cpp Sun Oct 24 10:50:13 2010 @@ -20,11 +20,11 @@ // When entering this function, all threads are waiting on the rendezvous to // finish. mvm::Thread* th = mvm::Thread::get(); - mvm::StackScanner* sc = th->MyVM->getScanner(); + mvm::StackScanner& sc = th->MyVM->scanner; mvm::Thread* tcur = th; do { - sc->scanStack(tcur, reinterpret_cast(TL)); + sc.scanStack(tcur, reinterpret_cast(TL)); tcur = (mvm::Thread*)tcur->next(); } while (tcur != th); } From nicolas.geoffray at lip6.fr Sun Oct 24 09:18:26 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 16:18:26 -0000 Subject: [vmkit-commits] [vmkit] r117231 - in /vmkit/branches/precise: include/mvm/GC/GC.h include/mvm/Threads/Thread.h include/mvm/VirtualMachine.h lib/J3/VMCore/LockedMap.h lib/Mvm/CommonThread/ctthread.cpp lib/Mvm/GCMmap2/gccollector.cpp lib/Mvm/Runtime/Object.cpp mmtk/mmtk-j3/Scanning.cpp Message-ID: <20101024161826.312EA2A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 11:18:25 2010 New Revision: 117231 URL: http://llvm.org/viewvc/llvm-project?rev=117231&view=rev Log: Some more code cleanup, related to stack walking. Modified: vmkit/branches/precise/include/mvm/GC/GC.h vmkit/branches/precise/include/mvm/Threads/Thread.h vmkit/branches/precise/include/mvm/VirtualMachine.h vmkit/branches/precise/lib/J3/VMCore/LockedMap.h vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp vmkit/branches/precise/lib/Mvm/GCMmap2/gccollector.cpp vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp vmkit/branches/precise/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/branches/precise/include/mvm/GC/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/GC/GC.h?rev=117231&r1=117230&r2=117231&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/GC/GC.h (original) +++ vmkit/branches/precise/include/mvm/GC/GC.h Sun Oct 24 11:18:25 2010 @@ -34,26 +34,4 @@ } }; -namespace mvm { - -class Thread; - -class StackScanner { -public: - virtual void scanStack(mvm::Thread* th, uintptr_t closure) = 0; - virtual ~StackScanner() {} -}; - -class UnpreciseStackScanner : public StackScanner { -public: - virtual void scanStack(mvm::Thread* th, uintptr_t closure); -}; - -class PreciseStackScanner : public StackScanner { -public: - virtual void scanStack(mvm::Thread* th, uintptr_t closure); -}; - -} - #endif Modified: vmkit/branches/precise/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/Threads/Thread.h?rev=117231&r1=117230&r2=117231&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/precise/include/mvm/Threads/Thread.h Sun Oct 24 11:18:25 2010 @@ -237,6 +237,7 @@ /// a tracer. /// virtual void tracer(uintptr_t closure) {} + void scanStack(uintptr_t closure); void* getLastSP() { return lastSP; } void setLastSP(void* V) { lastSP = V; } Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/VirtualMachine.h?rev=117231&r1=117230&r2=117231&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/precise/include/mvm/VirtualMachine.h Sun Oct 24 11:18:25 2010 @@ -11,22 +11,17 @@ #define MVM_VIRTUALMACHINE_H #include "mvm/Allocator.h" -#include "mvm/MethodInfo.h" #include "mvm/Threads/CollectionRV.h" -#include "mvm/Threads/Cond.h" #include "mvm/Threads/Locks.h" #include "mvm/GC/GC.h" #include #include -namespace j3 { - class JavaCompiler; - class JnjvmClassLoader; -} - namespace mvm { +class MethodInfo; + class FunctionMap { public: /// Functions - Map of applicative methods to function pointers. This map is @@ -162,14 +157,10 @@ /// rendezvous - The rendezvous implementation for garbage collection. /// - /// scanner - Scanner of threads' stacks. - /// #ifdef WITH_LLVM_GCC CooperativeCollectionRV rendezvous; - PreciseStackScanner scanner; #else UncooperativeCollectionRV rendezvous; - UnpreciseStackScanner scanner; #endif //===----------------------------------------------------------------------===// Modified: vmkit/branches/precise/lib/J3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/LockedMap.h?rev=117231&r1=117230&r2=117231&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/LockedMap.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/LockedMap.h Sun Oct 24 11:18:25 2010 @@ -31,6 +31,7 @@ namespace j3 { class JavaString; +class JnjvmClassLoader; class Signdef; class Typedef; class UserCommonClass; Modified: vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp?rev=117231&r1=117230&r2=117231&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp Sun Oct 24 11:18:25 2010 @@ -10,13 +10,14 @@ #include "debug.h" #include "MvmGC.h" +#include "mvm/MethodInfo.h" #include "mvm/VirtualMachine.h" #include "mvm/Threads/Cond.h" #include "mvm/Threads/Locks.h" #include "mvm/Threads/Thread.h" #include -#include +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include using namespace mvm; @@ -361,3 +363,30 @@ int res = kill(SIGGC); assert(!res && "Error on kill"); } + + +#ifdef WITH_LLVM_GCC +void Thread::scanStack(uintptr_t closure) { + StackWalker Walker(this); + + while (MethodInfo* MI = Walker.get()) { + MI->scan(closure, Walker.ip, Walker.addr); + ++Walker; + } +} + +#else + +void Thread::scanStack(uintptr_t closure) { + register unsigned int **max = (unsigned int**)(void*)this->baseSP; + if (mvm::Thread::get() != this) { + register unsigned int **cur = (unsigned int**)this->waitOnSP(); + for(; curattrape(used_nodes); mvm::Thread* th = mvm::Thread::get(); - mvm::StackScanner& sc = th->MyVM->scanner; th->MyVM->rendezvous.startRV(); th->MyVM->startCollection(); @@ -53,7 +52,7 @@ // (2) Trace the threads. do { - sc.scanStack(tcur, 0); + tcur->scanStack(0); tcur->tracer(0); tcur = (mvm::Thread*)tcur->next(); } while (tcur != th); Modified: vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp?rev=117231&r1=117230&r2=117231&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Runtime/Object.cpp Sun Oct 24 11:18:25 2010 @@ -9,14 +9,10 @@ #include #include -#include #include "MvmGC.h" -#include "mvm/Allocator.h" #include "mvm/Object.h" #include "mvm/PrintBuffer.h" -#include "mvm/VirtualMachine.h" -#include "mvm/Threads/Thread.h" using namespace mvm; @@ -58,26 +54,3 @@ buf->writePtr((void*)o); buf->write(">"); } - -void PreciseStackScanner::scanStack(mvm::Thread* th, uintptr_t closure) { - StackWalker Walker(th); - - while (MethodInfo* MI = Walker.get()) { - MI->scan(closure, Walker.ip, Walker.addr); - ++Walker; - } -} - - -void UnpreciseStackScanner::scanStack(mvm::Thread* th, uintptr_t closure) { - register unsigned int **max = (unsigned int**)(void*)th->baseSP; - if (mvm::Thread::get() != th) { - register unsigned int **cur = (unsigned int**)th->waitOnSP(); - for(; curMyVM->scanner; mvm::Thread* tcur = th; do { - sc.scanStack(tcur, reinterpret_cast(TL)); + tcur->scanStack(reinterpret_cast(TL)); tcur = (mvm::Thread*)tcur->next(); } while (tcur != th); } @@ -39,7 +38,6 @@ tcur->tracer(reinterpret_cast(TL)); tcur = (mvm::Thread*)tcur->next(); } while (tcur != th); - } extern "C" void Java_org_j3_mmtk_Scanning_computeStaticRoots__Lorg_mmtk_plan_TraceLocal_2 (JavaObject* Scanning, JavaObject* TL) { From nicolas.geoffray at lip6.fr Sun Oct 24 10:51:11 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 17:51:11 -0000 Subject: [vmkit-commits] [vmkit] r117242 - in /vmkit/branches/precise: include/mvm/JIT.h include/mvm/MethodInfo.h include/mvm/VirtualMachine.h lib/J3/Classpath/ClasspathVMThrowable.inc lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/JavaClass.h lib/J3/VMCore/JavaRuntimeJIT.cpp lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/Jnjvm.h lib/J3/VMCore/JnjvmClassLoader.cpp lib/Mvm/Compiler/JIT.cpp lib/Mvm/Runtime/MethodInfo.cpp Message-ID: <20101024175111.A29C22A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 12:51:11 2010 New Revision: 117242 URL: http://llvm.org/viewvc/llvm-project?rev=117242&view=rev Log: Code cleanup on MethodInfo. Modified: vmkit/branches/precise/include/mvm/JIT.h vmkit/branches/precise/include/mvm/MethodInfo.h vmkit/branches/precise/include/mvm/VirtualMachine.h vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp vmkit/branches/precise/lib/J3/VMCore/JavaClass.h vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp Modified: vmkit/branches/precise/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/JIT.h?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/JIT.h (original) +++ vmkit/branches/precise/include/mvm/JIT.h Sun Oct 24 12:51:11 2010 @@ -214,10 +214,12 @@ class MvmJITMethodInfo : public JITMethodInfo { public: virtual void print(void* ip, void* addr); - MvmJITMethodInfo(llvm::GCFunctionInfo* GFI, const llvm::Function* F) : + MvmJITMethodInfo(llvm::GCFunctionInfo* GFI, + const llvm::Function* F, + void* owner) : JITMethodInfo(GFI) { MetaInfo = const_cast(F); - MethodType = 0; + Owner = owner; } }; Modified: vmkit/branches/precise/include/mvm/MethodInfo.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/MethodInfo.h?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/MethodInfo.h (original) +++ vmkit/branches/precise/include/mvm/MethodInfo.h Sun Oct 24 12:51:11 2010 @@ -19,6 +19,9 @@ public: virtual void print(void* ip, void* addr) = 0; virtual void scan(uintptr_t closure, void* ip, void* addr) = 0; + virtual bool isHighLevelMethod() { + return false; + } static void* isStub(void* ip, void* addr) { bool isStub = ((unsigned char*)ip)[0] == 0xCE; @@ -26,10 +29,8 @@ return ip; } - void* getMetaInfo() const { return MetaInfo; } - - unsigned MethodType; void* MetaInfo; + void* Owner; }; class CamlFrame { @@ -44,7 +45,10 @@ public: CamlFrame* CF; virtual void scan(uintptr_t closure, void* ip, void* addr); - CamlMethodInfo(CamlFrame* C) : CF(C) { } + CamlMethodInfo(CamlFrame* C) : CF(C) { + Owner = NULL; + MetaInfo = NULL; + } }; class StaticCamlMethodInfo : public CamlMethodInfo { @@ -53,8 +57,9 @@ virtual void print(void* ip, void* addr); StaticCamlMethodInfo(CamlFrame* CF, const char* n) : CamlMethodInfo(CF) { + Owner = NULL; + MetaInfo = NULL; name = n; - MethodType = 0; } }; @@ -65,7 +70,8 @@ static DefaultMethodInfo DM; DefaultMethodInfo() { - MethodType = -1; + Owner = NULL; + MetaInfo = NULL; } }; Modified: vmkit/branches/precise/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/VirtualMachine.h?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/VirtualMachine.h (original) +++ vmkit/branches/precise/include/mvm/VirtualMachine.h Sun Oct 24 12:51:11 2010 @@ -42,6 +42,9 @@ /// void addMethodInfo(MethodInfo* meth, void* ip); + /// removeMethodInfos - Remove all MethodInfo owned by the given owner. + void removeMethodInfos(void* owner); + FunctionMap(); }; @@ -171,6 +174,9 @@ MethodInfo* IPToMethodInfo(void* ip) { return FunctionsCache.IPToMethodInfo(ip); } + void removeMethodInfos(void* owner) { + FunctionsCache.removeMethodInfos(owner); + } //===----------------------------------------------------------------------===// // (4) Launch-related methods. Modified: vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc Sun Oct 24 12:51:11 2010 @@ -144,9 +144,9 @@ sint32 index = 2;; while (index != JavaArray::getSize(stack)) { mvm::MethodInfo* MI = vm->IPToMethodInfo(ArrayPtr::getElement((ArrayPtr*)stack, index)); - if (MI->MethodType != 1) ++index; + if (!MI->isHighLevelMethod()) ++index; else { - JavaMethod* meth = (JavaMethod*)MI->getMetaInfo(); + JavaMethod* meth = (JavaMethod*)MI->MetaInfo; assert(meth && "Wrong stack trace"); if (meth->classDef->isAssignableFrom(vm->upcalls->newThrowable)) { ++index; @@ -159,7 +159,7 @@ while (cur < JavaArray::getSize(stack)) { mvm::MethodInfo* MI = vm->IPToMethodInfo(ArrayPtr::getElement((ArrayPtr*)stack, cur)); ++cur; - if (MI->MethodType == 1) ++size; + if (MI->isHighLevelMethod()) ++size; } result = (ArrayObject*) @@ -168,8 +168,8 @@ cur = 0; for (sint32 i = index; i < JavaArray::getSize(stack); ++i) { mvm::MethodInfo* MI = vm->IPToMethodInfo(ArrayPtr::getElement((ArrayPtr*)stack, i)); - if (MI->MethodType == 1) { - JavaMethod* meth = (JavaMethod*)MI->getMetaInfo(); + if (MI->isHighLevelMethod()) { + JavaMethod* meth = (JavaMethod*)MI->MetaInfo; ArrayObject::setElement(result, consStackElement(meth, ArrayPtr::getElement((ArrayPtr*)stack, i)), cur); cur++; } Modified: vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp Sun Oct 24 12:51:11 2010 @@ -40,15 +40,18 @@ using namespace j3; using namespace llvm; - class JavaJITMethodInfo : public mvm::JITMethodInfo { public: virtual void print(void* ip, void* addr); + virtual bool isHighLevelMethod() { + return true; + } - JavaJITMethodInfo(llvm::GCFunctionInfo* GFI, JavaMethod* m) : - mvm::JITMethodInfo(GFI) { + JavaJITMethodInfo(llvm::GCFunctionInfo* GFI, + JavaMethod* m) : + mvm::JITMethodInfo(GFI) { MetaInfo = m; - MethodType = 1; + Owner = m->classDef->classLoader->getCompiler(); } }; @@ -105,7 +108,7 @@ mvm::JITMethodInfo* MI = NULL; if (meth == NULL) { // This is a stub. - MI = new(Alloc, "JITMethodInfo") mvm::MvmJITMethodInfo(GFI, &F); + MI = new(Alloc, "JITMethodInfo") mvm::MvmJITMethodInfo(GFI, &F, TheCompiler); } else { MI = new(Alloc, "JavaJITMethodInfo") JavaJITMethodInfo(GFI, meth); } Modified: vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp Sun Oct 24 12:51:11 2010 @@ -287,17 +287,6 @@ return code; } -void JavaStaticMethodInfo::print(void* ip, void* addr) { - void* new_ip = NULL; - if (ip) new_ip = mvm::MethodInfo::isStub(ip, addr); - JavaMethod* meth = (JavaMethod*)MetaInfo; - fprintf(stderr, "; %p in %s.%s", new_ip, - UTF8Buffer(meth->classDef->name).cString(), - UTF8Buffer(meth->name).cString()); - if (ip != new_ip) fprintf(stderr, " (from stub)"); - fprintf(stderr, "\n"); -} - void JavaMethod::setNative() { access |= ACC_NATIVE; } Modified: vmkit/branches/precise/lib/J3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaClass.h?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.h Sun Oct 24 12:51:11 2010 @@ -873,18 +873,6 @@ }; -class JavaStaticMethodInfo : public mvm::CamlMethodInfo { -public: - virtual void print(void* ip, void* addr); - - JavaStaticMethodInfo(mvm::CamlMethodInfo* super, void* ip, JavaMethod* M) : - mvm::CamlMethodInfo(super->CF) { - MetaInfo = M; - MethodType = 1; - } - -}; - class CodeLineInfo : public mvm::PermanentObject { public: uintptr_t address; Modified: vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp Sun Oct 24 12:51:11 2010 @@ -608,9 +608,10 @@ // Lookup the caller of this class. mvm::StackWalker Walker(th); - while (Walker.get()->MethodType != 1) ++Walker; + ++Walker; // Remove the stub. mvm::MethodInfo* MI = Walker.get(); - JavaMethod* meth = (JavaMethod*)MI->getMetaInfo(); + assert(MI->isHighLevelMethod() && "Wrong stack trace"); + JavaMethod* meth = (JavaMethod*)MI->MetaInfo; void* ip = *Walker; // Lookup the method info in the constant pool of the caller. @@ -671,10 +672,10 @@ // Lookup the caller of this class. mvm::StackWalker Walker(th); - while (Walker.get()->MethodType != 1) ++Walker; + ++Walker; // Remove the stub. mvm::MethodInfo* MI = Walker.get(); - assert(MI->MethodType == 1 && "Wrong call to stub"); - JavaMethod* caller = (JavaMethod*)MI->getMetaInfo(); + assert(MI->isHighLevelMethod() && "Wrong stack trace"); + JavaMethod* caller = (JavaMethod*)MI->MetaInfo; void* ip = *Walker; // Lookup the method info in the constant pool of the caller. @@ -709,10 +710,10 @@ // Lookup the caller of this class. mvm::StackWalker Walker(th); - while (Walker.get()->MethodType != 1) ++Walker; + ++Walker; // Remove the stub. mvm::MethodInfo* MI = Walker.get(); - assert(MI->MethodType == 1 && "Wrong call to stub"); - JavaMethod* caller = (JavaMethod*)MI->getMetaInfo(); + assert(MI->isHighLevelMethod() && "Wrong stack trace"); + JavaMethod* caller = (JavaMethod*)MI->MetaInfo; void* ip = *Walker; // Lookup the method info in the constant pool of the caller. Modified: vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp Sun Oct 24 12:51:11 2010 @@ -72,8 +72,8 @@ uint32 i = 0; while (mvm::MethodInfo* MI = Walker.get()) { - if (MI->MethodType == 1) { - JavaMethod* M = (JavaMethod*)MI->getMetaInfo(); + if (MI->isHighLevelMethod()) { + JavaMethod* M = (JavaMethod*)MI->MetaInfo; buffer[i++] = M; } ++Walker; @@ -86,9 +86,9 @@ uint32 index = 0; while (mvm::MethodInfo* MI = Walker.get()) { - if (MI->MethodType == 1) { + if (MI->isHighLevelMethod()) { if (index == level) { - return (JavaMethod*)MI->getMetaInfo(); + return (JavaMethod*)MI->MetaInfo; } ++index; } @@ -111,8 +111,8 @@ mvm::StackWalker Walker(this); while (mvm::MethodInfo* MI = Walker.get()) { - if (MI->MethodType == 1) { - JavaMethod* meth = (JavaMethod*)MI->getMetaInfo(); + if (MI->isHighLevelMethod() == 1) { + JavaMethod* meth = (JavaMethod*)MI->MetaInfo; JnjvmClassLoader* loader = meth->classDef->classLoader; obj = loader->getJavaClassLoader(); if (obj) return obj; @@ -127,7 +127,7 @@ mvm::StackWalker Walker(this); while (mvm::MethodInfo* MI = Walker.get()) { - if (MI->MethodType == 1) + if (MI->isHighLevelMethod()) MI->print(Walker.ip, Walker.addr); ++Walker; } Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp Sun Oct 24 12:51:11 2010 @@ -1383,35 +1383,6 @@ return tmp; } -void Jnjvm::internalRemoveMethods(JnjvmClassLoader* loader, mvm::FunctionMap& Map) { - // Loop over all methods in the map to find which ones belong - // to this class loader. - Map.FunctionMapLock.acquire(); - std::map::iterator temp; - for (std::map::iterator i = Map.Functions.begin(), - e = Map.Functions.end(); i != e;) { - mvm::MethodInfo* MI = i->second; - if (MI->MethodType == 1) { - JavaMethod* meth = (JavaMethod*)i->second->getMetaInfo(); - if (meth->classDef->classLoader == loader) { - temp = i; - ++i; - Map.Functions.erase(temp); - } else { - ++i; - } - } else { - ++i; - } - } - Map.FunctionMapLock.release(); -} - -void Jnjvm::removeMethodsInFunctionMaps(JnjvmClassLoader* loader) { - internalRemoveMethods(loader, FunctionsCache); -} - - void Jnjvm::startCollection() { finalizerThread->FinalizationQueueLock.acquire(); referenceThread->ToEnqueueLock.acquire(); Modified: vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.h Sun Oct 24 12:51:11 2010 @@ -351,32 +351,11 @@ /// virtual void waitForExit(); -private: - /// internalRemoveMethodsInFunctionMap - Removes all methods compiled by this - /// class loader from the function map. - /// - void internalRemoveMethods(JnjvmClassLoader* loader, mvm::FunctionMap& Map); - -public: - /// removeMethodsInFunctionMaps - Removes all methods compiled by this - /// class loader from the function maps. - /// - void removeMethodsInFunctionMaps(JnjvmClassLoader* loader); - /// loadBootstrap - Bootstraps the JVM, getting the class loader, initializing /// bootstrap classes (e.g. java/lang/Class, java/lang/Exception) and /// mapping the initial thread. /// void loadBootstrap(); - -#ifdef ISOLATE - static Jnjvm* RunningIsolates[NR_ISOLATES]; - static mvm::LockNormal IsolateLock; -#endif - -#ifdef SERVICE - virtual void stopService(); -#endif }; } // end namespace j3 Modified: vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp Sun Oct 24 12:51:11 2010 @@ -912,8 +912,9 @@ JnjvmClassLoader::~JnjvmClassLoader() { - if (isolate) - isolate->removeMethodsInFunctionMaps(this); + if (isolate) { + isolate->removeMethodInfos(TheCompiler); + } if (classes) { classes->~ClassMap(); @@ -1087,6 +1088,31 @@ return res; } +class JavaStaticMethodInfo : public mvm::CamlMethodInfo { +public: + virtual void print(void* ip, void* addr); + virtual bool isHighLevelMethod() { + return true; + } + + JavaStaticMethodInfo(mvm::CamlMethodInfo* super, void* ip, JavaMethod* M) : + mvm::CamlMethodInfo(super->CF) { + MetaInfo = M; + Owner = M->classDef->classLoader->getCompiler(); + } +}; + +void JavaStaticMethodInfo::print(void* ip, void* addr) { + void* new_ip = NULL; + if (ip) new_ip = mvm::MethodInfo::isStub(ip, addr); + JavaMethod* meth = (JavaMethod*)MetaInfo; + fprintf(stderr, "; %p in %s.%s", new_ip, + UTF8Buffer(meth->classDef->name).cString(), + UTF8Buffer(meth->name).cString()); + if (ip != new_ip) fprintf(stderr, " (from stub)"); + fprintf(stderr, "\n"); +} + void JnjvmClassLoader::insertAllMethodsInVM(Jnjvm* vm) { for (ClassMap::iterator i = classes->map.begin(), e = classes->map.end(); i != e; ++i) { Modified: vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp Sun Oct 24 12:51:11 2010 @@ -104,8 +104,8 @@ assert(&(*I)->getFunction() == &F && "GC Info and method do not correspond"); llvm::GCFunctionInfo* GFI = *I; - JITMethodInfo* MI = - new(*MvmModule::Allocator, "MvmJITMethodInfo") MvmJITMethodInfo(GFI, &F); + JITMethodInfo* MI = new(*MvmModule::Allocator, "MvmJITMethodInfo") + MvmJITMethodInfo(GFI, &F, MvmModule::executionEngine); MI->addToVM(mvm::Thread::get()->MyVM, (JIT*)MvmModule::executionEngine); } }; Modified: vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp?rev=117242&r1=117241&r2=117242&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp Sun Oct 24 12:51:11 2010 @@ -126,3 +126,19 @@ Functions.insert(std::make_pair(ip, meth)); FunctionMapLock.release(); } + + +void FunctionMap::removeMethodInfos(void* owner) { + FunctionMapLock.acquire(); + std::map::iterator temp; + for (std::map::iterator i = Functions.begin(), + e = Functions.end(); i != e;) { + mvm::MethodInfo* MI = i->second; + if (MI->Owner == owner) { + temp = i; + i++; + Functions.erase(temp); + } + } + FunctionMapLock.release(); +} From nicolas.geoffray at lip6.fr Sun Oct 24 13:04:23 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 24 Oct 2010 20:04:23 -0000 Subject: [vmkit-commits] [vmkit] r117246 - in /vmkit/branches/precise/lib/Mvm: CommonThread/Sigsegv.cpp Runtime/MethodInfo.cpp Message-ID: <20101024200423.337382A6C12C@llvm.org> Author: geoffray Date: Sun Oct 24 15:04:23 2010 New Revision: 117246 URL: http://llvm.org/viewvc/llvm-project?rev=117246&view=rev Log: Fix mindo in removeMethodInfos. Modified: vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp Modified: vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp?rev=117246&r1=117245&r2=117246&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp Sun Oct 24 15:04:23 2010 @@ -54,8 +54,8 @@ "the bottom of the stack is always available when entering" "\nthe VM.\n"); } else { - fprintf(stderr, "I received a SIGSEGV: either the VM code or an external\n" - "native method is bogus. Aborting...\n"); + fprintf(stderr, "Thread %p received a SIGSEGV: either the VM code or an external\n" + "native method is bogus. Aborting...\n", th); } th->printBacktrace(); abort(); Modified: vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp?rev=117246&r1=117245&r2=117246&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Runtime/MethodInfo.cpp Sun Oct 24 15:04:23 2010 @@ -134,9 +134,9 @@ for (std::map::iterator i = Functions.begin(), e = Functions.end(); i != e;) { mvm::MethodInfo* MI = i->second; + temp = i; + i++; if (MI->Owner == owner) { - temp = i; - i++; Functions.erase(temp); } } From gael.thomas at lip6.fr Tue Oct 26 06:21:40 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 26 Oct 2010 13:21:40 -0000 Subject: [vmkit-commits] [vmkit] r117363 - in /vmkit/trunk: include/j3/J3Intrinsics.h lib/J3/Compiler/ExceptionsCheck.inc lib/J3/Compiler/ExceptionsDwarf.inc lib/J3/Compiler/J3Intrinsics.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/LowerConstantCalls.cpp lib/J3/LLVMRuntime/runtime-default-thread.ll lib/J3/LLVMRuntime/runtime-default.ll lib/J3/LLVMRuntime/runtime-mmtk-thread.ll lib/Mvm/JITGCPass/ mmtk/java/ tools/j3/ Message-ID: <20101026132140.B73DB2A6C12C@llvm.org> Author: gthomas Date: Tue Oct 26 08:21:40 2010 New Revision: 117363 URL: http://llvm.org/viewvc/llvm-project?rev=117363&view=rev Log: begin the unification between the C++ code and the (meta) llvm type definitions Modified: vmkit/trunk/include/j3/J3Intrinsics.h vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll vmkit/trunk/lib/Mvm/JITGCPass/ (props changed) vmkit/trunk/mmtk/java/ (props changed) vmkit/trunk/tools/j3/ (props changed) Modified: vmkit/trunk/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/include/j3/J3Intrinsics.h (original) +++ vmkit/trunk/include/j3/J3Intrinsics.h Tue Oct 26 08:21:40 2010 @@ -133,9 +133,10 @@ llvm::Constant* OffsetDoYieldInThreadConstant; llvm::Constant* OffsetIsolateInThreadConstant; - llvm::Constant* OffsetJNIInThreadConstant; - llvm::Constant* OffsetJavaExceptionInThreadConstant; llvm::Constant* OffsetCXXExceptionInThreadConstant; + llvm::Constant* OffsetThreadInMutatorThreadConstant; + llvm::Constant* OffsetJNIInJavaThreadConstant; + llvm::Constant* OffsetJavaExceptionInJavaThreadConstant; llvm::Constant* OffsetClassInVTConstant; llvm::Constant* OffsetDepthInVTConstant; Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc Tue Oct 26 08:21:40 2010 @@ -10,7 +10,7 @@ if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInThreadConstant }; + intrinsics->OffsetJavaExceptionInJavaThreadConstant }; Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", @@ -69,7 +69,7 @@ if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInThreadConstant }; + intrinsics->OffsetJavaExceptionInJavaThreadConstant }; Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", @@ -122,7 +122,7 @@ if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInThreadConstant }; + intrinsics->OffsetJavaExceptionInJavaThreadConstant }; Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", @@ -172,7 +172,7 @@ if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInThreadConstant }; + intrinsics->OffsetJavaExceptionInJavaThreadConstant }; Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", @@ -236,7 +236,7 @@ JITVerifyNull(obj); Value* threadId = getCurrentThread(intrinsics->JavaThreadType); Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInThreadConstant }; + intrinsics->OffsetJavaExceptionInJavaThreadConstant }; Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", @@ -491,7 +491,7 @@ // First thing in the handler: clear the exception. Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInThreadConstant }; + intrinsics->OffsetJavaExceptionInJavaThreadConstant }; Value* threadId = getCurrentThread(intrinsics->JavaThreadType); Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc Tue Oct 26 08:21:40 2010 @@ -417,7 +417,7 @@ Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps[2] = { module->constantZero, - module->OffsetJavaExceptionInThreadConstant }; + module->OffsetJavaExceptionInJavaThreadConstant }; Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", @@ -474,12 +474,13 @@ // Get the Java exception. Value* exc = new LoadInst(javaExceptionPtr, "", currentBlock); - Value* geps2[3] = { module->constantZero, + Value* geps2[4] = { module->constantZero, module->constantZero, + module->OffsetThreadInMutatorThreadConstant, module->OffsetCXXExceptionInThreadConstant }; Value* cxxExceptionPtr = GetElementPtrInst::Create(threadId, geps2, - geps2 + 3, "", + geps2 + 4, "", currentBlock); // Clear exceptions. @@ -562,12 +563,13 @@ endExceptionBlock->eraseFromParent(); } else { Value* threadId = getCurrentThread(module->JavaThreadType); - Value* geps2[3] = { module->constantZero, + Value* geps2[4] = { module->constantZero, module->constantZero, + module->OffsetThreadInMutatorThreadConstant, module->OffsetCXXExceptionInThreadConstant }; Value* cxxExceptionPtr = GetElementPtrInst::Create(threadId, geps2, - geps2 + 3, "", + geps2 + 4, "", currentBlock); cxxExceptionPtr = new LoadInst(cxxExceptionPtr, "", currentBlock); llvm::CallInst::Create(module->unwindResume, cxxExceptionPtr, "", Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Tue Oct 26 08:21:40 2010 @@ -142,15 +142,12 @@ OffsetStatusInTaskClassMirrorConstant = constantZero; OffsetInitializedInTaskClassMirrorConstant = constantOne; - OffsetIsolateInThreadConstant = - ConstantInt::get(Type::getInt32Ty(Context), 3); - OffsetDoYieldInThreadConstant = - ConstantInt::get(Type::getInt32Ty(Context), 6); - OffsetJNIInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); - OffsetJavaExceptionInThreadConstant = - ConstantInt::get(Type::getInt32Ty(Context), 2); - OffsetCXXExceptionInThreadConstant = - ConstantInt::get(Type::getInt32Ty(Context), 13); + OffsetIsolateInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); + OffsetDoYieldInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 4); + OffsetCXXExceptionInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 11); + OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); + OffsetJNIInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); + OffsetJavaExceptionInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); ClassReadyConstant = ConstantInt::get(Type::getInt8Ty(Context), ready); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Tue Oct 26 08:21:40 2010 @@ -354,7 +354,7 @@ Value* threadId = getCurrentThread(intrinsics->JavaThreadType); Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJNIInThreadConstant }; + intrinsics->OffsetJNIInJavaThreadConstant }; Value* jniEnv = GetElementPtrInst::Create(threadId, geps, geps + 2, "", currentBlock); @@ -1164,10 +1164,11 @@ if (TheCompiler->useCooperativeGC()) { Value* threadId = getCurrentThread(intrinsics->MutatorThreadType); - Value* GEP[2] = { intrinsics->constantZero, + Value* GEP[3] = { intrinsics->constantZero, + intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetDoYieldInThreadConstant }; - Value* YieldPtr = GetElementPtrInst::Create(threadId, GEP, GEP + 2, "", + Value* YieldPtr = GetElementPtrInst::Create(threadId, GEP, GEP + 3, "", currentBlock); Value* Yield = new LoadInst(YieldPtr, "", currentBlock); Modified: vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp Tue Oct 26 08:21:40 2010 @@ -55,9 +55,9 @@ "", CI); threadId = new IntToPtrInst(threadId, intrinsics->ptr32Type, "", CI); - - Value* IsolateID = GetElementPtrInst::Create(threadId, - intrinsics->OffsetIsolateInThreadConstant, "", CI); + + Value* GEP1[2] = { intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetIsolateInThreadConstant } + Value* IsolateID = GetElementPtrInst::Create(threadId, GEP1, GEP1 + 2, "", CI); IsolateID = new LoadInst(IsolateID, "", CI); @@ -81,8 +81,8 @@ threadId = new IntToPtrInst(threadId, intrinsics->ptr32Type, "", CI); - Value* IsolateID = GetElementPtrInst::Create(threadId, - intrinsics->OffsetIsolateInThreadConstant, "", CI); + Value* GEP1[2] = { intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetIsolateInThreadConstant } + Value* IsolateID = GetElementPtrInst::Create(threadId, GEP1, GEP1 + 2, "", CI); IsolateID = new LoadInst(IsolateID, "", CI); Modified: vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll Tue Oct 26 08:21:40 2010 @@ -1,16 +1,2 @@ -;;; Field 0: the VT of threads -;;; Field 1: next -;;; Field 2: prev -;;; Field 3: IsolateID -;;; Field 4: MyVM -;;; Field 5: baseSP -;;; Field 6: doYield -;;; Field 7: inGC -;;; Field 8: stackScanned -;;; Field 9: lastSP -;;; Field 10: internalThreadID -;;; field 11: routine -;;; field 12: lastKnownFrame -;;; field 13: lastExceptionBuffer -%MutatorThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, - i1, i8*, i8*, i8*, i8*, i8*} +;;; Field 0: the thread +%MutatorThread = type { %Thread } Modified: vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Tue Oct 26 08:21:40 2010 @@ -27,6 +27,22 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } +%CircularBase = type { %VT*, %CircularBase*, %CircularBase* } + +;;; Field 0: the parent (circular base) +;;; Field 1: IsolateID +;;; Field 2: MyVM +;;; Field 3: baseSP +;;; Field 4: doYield +;;; Field 5: inGC +;;; Field 6: stackScanned +;;; Field 7: lastSP +;;; Field 8: internalThreadID +;;; field 9: routine +;;; field 10: lastKnownFrame +;;; field 11: lastExceptionBuffer +%Thread = type { %CircularBase, i8*, i8*, i8*, i1, i1, i1, i8*, i8*, i8*, i8*, i8*} + %JavaThread = type { %MutatorThread, i8*, %JavaObject* } Modified: vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll?rev=117363&r1=117362&r2=117363&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll Tue Oct 26 08:21:40 2010 @@ -1,21 +1,7 @@ %BumpPtrAllocator = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* } -;;; Field 0: the VT of threads -;;; Field 1: next -;;; Field 2: prev -;;; Field 3: IsolateID -;;; Field 4: MyVM -;;; Field 5: baseSP -;;; Field 6: doYield -;;; Field 7: inGC -;;; Field 8: stackScanned -;;; Field 9: lastSP -;;; Field 10: internalThreadID -;;; field 11: routine -;;; field 12: lastKnownFrame -;;; field 13: lastKnownBufer -;;; field 14: allocator -;;; field 15: MutatorContext -;;; field 16: realRoutine -%MutatorThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, - i1, i8*, i8*, i8*, i8*, i8*, %BumpPtrAllocator, i8*, i8* } +;;; Field 0: the thread +;;; field 1: allocator +;;; field 2: MutatorContext +;;; field 3: realRoutine +%MutatorThread = type { %Thread, %BumpPtrAllocator, i8*, i8* } Propchange: vmkit/trunk/lib/Mvm/JITGCPass/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 26 08:21:40 2010 @@ -0,0 +1 @@ +Release Propchange: vmkit/trunk/mmtk/java/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 26 08:21:40 2010 @@ -0,0 +1 @@ +build.xml Propchange: vmkit/trunk/tools/j3/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 26 08:21:40 2010 @@ -4,3 +4,5 @@ vmkit.bc jnjvm.s jnjvm.bc +j3.bc +j3.s From gael.thomas at lip6.fr Tue Oct 26 07:23:08 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 26 Oct 2010 14:23:08 -0000 Subject: [vmkit-commits] [vmkit] r117365 - in /vmkit/trunk: include/j3/J3Intrinsics.h lib/J3/Compiler/ExceptionsDwarf.inc lib/J3/Compiler/J3Intrinsics.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h Message-ID: <20101026142308.6D72C2A6C12C@llvm.org> Author: gthomas Date: Tue Oct 26 09:23:08 2010 New Revision: 117365 URL: http://llvm.org/viewvc/llvm-project?rev=117365&view=rev Log: continue the unification Modified: vmkit/trunk/include/j3/J3Intrinsics.h vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.h Modified: vmkit/trunk/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=117365&r1=117364&r2=117365&view=diff ============================================================================== --- vmkit/trunk/include/j3/J3Intrinsics.h (original) +++ vmkit/trunk/include/j3/J3Intrinsics.h Tue Oct 26 09:23:08 2010 @@ -132,7 +132,8 @@ llvm::Constant* OffsetStatusInTaskClassMirrorConstant; llvm::Constant* OffsetDoYieldInThreadConstant; - llvm::Constant* OffsetIsolateInThreadConstant; + llvm::Constant* OffsetIsolateIDInThreadConstant; + llvm::Constant* OffsetVMInThreadConstant; llvm::Constant* OffsetCXXExceptionInThreadConstant; llvm::Constant* OffsetThreadInMutatorThreadConstant; llvm::Constant* OffsetJNIInJavaThreadConstant; Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc?rev=117365&r1=117364&r2=117365&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc Tue Oct 26 09:23:08 2010 @@ -390,10 +390,7 @@ // catch the exception but resume unwinding. JnjvmClassLoader* loader = compilingClass->classLoader;; if (loader != loader->bootstrapLoader) { - Value* threadId = getCurrentThread(module->MutatorThreadType); - Value* Isolate = GetElementPtrInst::Create(threadId, - module->constantFour, "", - currentBlock); + Value* Isolate = genGetVMPtr(genGetMutatorThreadPtr()); Isolate = new LoadInst(Isolate, "", currentBlock); Isolate = new BitCastInst(Isolate, module->ptrPtrType, "", currentBlock); @@ -415,13 +412,9 @@ } #endif - Value* threadId = getCurrentThread(module->JavaThreadType); - Value* geps[2] = { module->constantZero, - module->OffsetJavaExceptionInJavaThreadConstant }; - - Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, - geps + 2, "", - currentBlock); + Value* mutatorThreadId = genGetMutatorThreadPtr(); + Value* javaThreadId = genGetJavaThreadPtr(mutatorThreadId); + Value* javaExceptionPtr = getGetJavaExceptionPtr(javaThreadId); // Get the Java exception. Value* obj = new LoadInst(javaExceptionPtr, "", currentBlock); @@ -467,21 +460,13 @@ currentBlock = cur->nativeHandler; - threadId = getCurrentThread(module->JavaThreadType); - javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", - currentBlock); + mutatorThreadId = genGetMutatorThreadPtr(); + javaThreadId = genGetJavaThreadPtr(mutatorThreadId); + javaExceptionPtr = getGetJavaExceptionPtr(javaThreadId); // Get the Java exception. Value* exc = new LoadInst(javaExceptionPtr, "", currentBlock); - - Value* geps2[4] = { module->constantZero, - module->constantZero, - module->OffsetThreadInMutatorThreadConstant, - module->OffsetCXXExceptionInThreadConstant }; - - Value* cxxExceptionPtr = GetElementPtrInst::Create(threadId, geps2, - geps2 + 4, "", - currentBlock); + Value* cxxExceptionPtr = genGetCXXExceptionPtr(mutatorThreadId); // Clear exceptions. new StoreInst(module->constantPtrNull, cxxExceptionPtr, currentBlock); @@ -517,7 +502,7 @@ // Change the isolate we are currently running, now that we have catched // the exception: the exception may have been thrown by another isolate. - Value* threadId = 0; + Value* mutatorThreadId = 0; Value* OldIsolateID = 0; Value* IsolateIDPtr = 0; Value* OldIsolate = 0; @@ -525,10 +510,10 @@ Value* IsolatePtr = 0; currentBlock = cur->javaHandler; if (loader != loader->bootstrapLoader) { - threadId = getCurrentThread(module->MutatorThreadType); + mutatorThreadId = genGetMutatorThreadPtr(); - IsolateIDPtr = GetElementPtrInst::Create(threadId, module->constantThree, - "", cur->javaHandler); + IsolateIDPtr = genGetIsolateIDPtr(mutatorThreadId); + const Type* realType = PointerType::getUnqual(module->pointerSizeType); IsolateIDPtr = new BitCastInst(IsolateIDPtr, realType, "", cur->javaHandler); @@ -538,8 +523,7 @@ loader->getIsolate()->IsolateID); new StoreInst(MyID, IsolateIDPtr, cur->javaHandler); - IsolatePtr = GetElementPtrInst::Create(threadId, module->constantFour, "", - cur->javaHandler); + IsolatePtr = genGetVMPtr(mutatorThreadId); OldIsolate = new LoadInst(IsolatePtr, "", cur->javaHandler); NewIsolate = module->getIsolate(loader->getIsolate(), currentBlock); @@ -562,18 +546,9 @@ if (PI == PE) { endExceptionBlock->eraseFromParent(); } else { - Value* threadId = getCurrentThread(module->JavaThreadType); - Value* geps2[4] = { module->constantZero, - module->constantZero, - module->OffsetThreadInMutatorThreadConstant, - module->OffsetCXXExceptionInThreadConstant }; - - Value* cxxExceptionPtr = GetElementPtrInst::Create(threadId, geps2, - geps2 + 4, "", - currentBlock); - cxxExceptionPtr = new LoadInst(cxxExceptionPtr, "", currentBlock); - llvm::CallInst::Create(module->unwindResume, cxxExceptionPtr, "", - currentBlock); + Value* cxxExceptionPtr = genGetCXXExceptionPtr(genGetMutatorThreadPtr()); + Value* cxxException = new LoadInst(cxxExceptionPtr, "", currentBlock); + llvm::CallInst::Create(module->unwindResume, cxxException, "", currentBlock); new UnreachableInst(currentBlock); } Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=117365&r1=117364&r2=117365&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Tue Oct 26 09:23:08 2010 @@ -142,7 +142,8 @@ OffsetStatusInTaskClassMirrorConstant = constantZero; OffsetInitializedInTaskClassMirrorConstant = constantOne; - OffsetIsolateInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); + OffsetIsolateIDInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); + OffsetVMInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); OffsetDoYieldInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 4); OffsetCXXExceptionInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 11); OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=117365&r1=117364&r2=117365&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Tue Oct 26 09:23:08 2010 @@ -274,6 +274,69 @@ return threadId; } +llvm::Value* JavaJIT::genGetMutatorThreadPtr() { + Value* FrameAddr = CallInst::Create(intrinsics->llvm_frameaddress, + intrinsics->constantZero, "", currentBlock); + Value* threadId = new PtrToIntInst(FrameAddr, intrinsics->pointerSizeType, "", + currentBlock); + threadId = BinaryOperator::CreateAnd(threadId, intrinsics->constantThreadIDMask, + "", currentBlock); + threadId = new IntToPtrInst(threadId, intrinsics->MutatorThreadType, "", currentBlock); + + return threadId; +} + +llvm::Value* JavaJIT::genGetJavaThreadPtr(llvm::Value* mutatorThreadPtr) { + return new BitCastInst(mutatorThreadPtr, intrinsics->JavaThreadType, "", currentBlock); +} + +llvm::Value* JavaJIT::genGetIsolateIDPtr(llvm::Value* mutatorThreadPtr) { + Value* GEP[3] = { intrinsics->constantZero, + intrinsics->OffsetThreadInMutatorThreadConstant, + intrinsics->OffsetIsolateIDInThreadConstant }; + + return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); +} + +llvm::Value* JavaJIT::genGetVMPtr(llvm::Value* mutatorThreadPtr) { + Value* GEP[3] = { intrinsics->constantZero, + intrinsics->OffsetThreadInMutatorThreadConstant, + intrinsics->OffsetVMInThreadConstant }; + + return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); +} + +llvm::Value* JavaJIT::genGetDoYieldPtr(llvm::Value* mutatorThreadPtr) { + Value* GEP[3] = { intrinsics->constantZero, + intrinsics->OffsetThreadInMutatorThreadConstant, + intrinsics->OffsetDoYieldInThreadConstant }; + + return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); +} + +llvm::Value* JavaJIT::genGetCXXExceptionPtr(llvm::Value* mutatorThreadPtr) { + Value* GEP[3] = { intrinsics->constantZero, + intrinsics->OffsetThreadInMutatorThreadConstant, + intrinsics->OffsetCXXExceptionInThreadConstant }; + + return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); +} + +llvm::Value* JavaJIT::genGetJNIEnvPtr(llvm::Value* javaThreadPtr) { + Value* GEP[2] = { intrinsics->constantZero, + intrinsics->OffsetJNIInJavaThreadConstant }; + + return GetElementPtrInst::Create(javaThreadPtr, GEP, GEP + 2, "", currentBlock); +} + +llvm::Value* JavaJIT::genGetJavaExceptionPtr(llvm::Value* javaThreadPtr) { + Value* GEP[2] = { intrinsics->constantZero, + intrinsics->OffsetJavaExceptionInJavaThreadConstant }; + + return GetElementPtrInst::Create(javaThreadPtr, GEP, GEP + 2, "", currentBlock); +} + + extern "C" void j3ThrowExceptionFromJIT(); llvm::Function* JavaJIT::nativeCompile(intptr_t natPtr) { @@ -351,13 +414,7 @@ std::vector nativeArgs; - Value* threadId = getCurrentThread(intrinsics->JavaThreadType); - - Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJNIInJavaThreadConstant }; - - Value* jniEnv = GetElementPtrInst::Create(threadId, geps, geps + 2, "", - currentBlock); + Value* jniEnv = genGetJNIEnvPtr(genGetJavaThreadPtr(genGetMutatorThreadPtr())); jniEnv = new BitCastInst(jniEnv, intrinsics->ptrType, "", currentBlock); @@ -1162,14 +1219,7 @@ } if (TheCompiler->useCooperativeGC()) { - Value* threadId = getCurrentThread(intrinsics->MutatorThreadType); - - Value* GEP[3] = { intrinsics->constantZero, - intrinsics->OffsetThreadInMutatorThreadConstant, - intrinsics->OffsetDoYieldInThreadConstant }; - - Value* YieldPtr = GetElementPtrInst::Create(threadId, GEP, GEP + 3, "", - currentBlock); + Value* YieldPtr = genGetDoYieldPtr(genGetMutatorThreadPtr()); Value* Yield = new LoadInst(YieldPtr, "", currentBlock); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=117365&r1=117364&r2=117365&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Tue Oct 26 09:23:08 2010 @@ -154,6 +154,17 @@ /// getCurrentThread - Emit code to get the current thread. llvm::Value* getCurrentThread(const llvm::Type* Ty); + llvm::Value* genGetMutatorThreadPtr(); + llvm::Value* genGetIsolateIDPtr(llvm::Value* mutatorThreadPtr); + llvm::Value* genGetVMPtr(llvm::Value* mutatorThreadPtr); + llvm::Value* genGetDoYieldPtr(llvm::Value* mutatorThreadPtr); + llvm::Value* genGetCXXExceptionPtr(llvm::Value* mutatorThreadPtr); + + llvm::Value* genGetJavaThreadPtr(llvm::Value* mutatorThreadPtr); + llvm::Value* genGetJNIEnvPtr(llvm::Value* javaThreadPtr); + llvm::Value* genGetJavaExceptionPtr(llvm::Value* javaThreadPtr); + + //===------------------------- Debugging support --------------------------===// llvm::MDNode* DbgSubprogram; From gael.thomas at lip6.fr Tue Oct 26 07:55:11 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 26 Oct 2010 14:55:11 -0000 Subject: [vmkit-commits] [vmkit] r117366 - in /vmkit/trunk: Makefile lib/J3/Compiler/ExceptionsCheck.inc lib/J3/Compiler/ExceptionsDwarf.inc lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h lib/Makefile Message-ID: <20101026145511.B84DA2A6C12C@llvm.org> Author: gthomas Date: Tue Oct 26 09:55:11 2010 New Revision: 117366 URL: http://llvm.org/viewvc/llvm-project?rev=117366&view=rev Log: continue the unification between C++ code and llvm types Modified: vmkit/trunk/Makefile (contents, props changed) vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.h vmkit/trunk/lib/Makefile (contents, props changed) Modified: vmkit/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile?rev=117366&r1=117365&r2=117366&view=diff ============================================================================== (empty) Propchange: vmkit/trunk/Makefile ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc?rev=117366&r1=117365&r2=117366&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc Tue Oct 26 09:55:11 2010 @@ -8,13 +8,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(intrinsics->JavaThreadType); - Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInJavaThreadConstant }; - - Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, - geps + 2, "", - currentBlock); + Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); // Get the Java exception. Value* obj = 0; @@ -67,13 +61,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(intrinsics->JavaThreadType); - Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInJavaThreadConstant }; - - Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, - geps + 2, "", - currentBlock); + Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); // Get the Java exception. Value* obj = 0; @@ -120,13 +108,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(intrinsics->JavaThreadType); - Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInJavaThreadConstant }; - - Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, - geps + 2, "", - currentBlock); + Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); // Get the Java exception. Value* obj = 0; @@ -170,13 +152,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(intrinsics->JavaThreadType); - Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInJavaThreadConstant }; - - Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, - geps + 2, "", - currentBlock); + Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); // Get the Java exception. Value* obj = 0; @@ -234,13 +210,8 @@ void JavaJIT::throwException(Value* obj) { JITVerifyNull(obj); - Value* threadId = getCurrentThread(intrinsics->JavaThreadType); - Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInJavaThreadConstant }; - - Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, - geps + 2, "", - currentBlock); + Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); + new StoreInst(obj, javaExceptionPtr, currentBlock); if (currentExceptionBlock != endExceptionBlock) { Instruction* insn = currentExceptionBlock->begin(); @@ -417,10 +388,7 @@ // catch the exception but resume unwinding. JnjvmClassLoader* loader = compilingClass->classLoader;; if (loader != loader->bootstrapLoader) { - Value* threadId = getCurrentThread(intrinsics->MutatorThreadType); - Value* Isolate = GetElementPtrInst::Create(threadId, - intrinsics->constantFour, "", - currentBlock); + Value* Isolate = getVMPtr(getMutatorThread()); Isolate = new LoadInst(Isolate, "", currentBlock); Isolate = new BitCastInst(Isolate, intrinsics->ptrPtrType, "", currentBlock); @@ -490,22 +458,17 @@ currentBlock = cur->javaHandler; // First thing in the handler: clear the exception. - Value* geps[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInJavaThreadConstant }; - Value* threadId = getCurrentThread(intrinsics->JavaThreadType); - Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, - geps + 2, "", - currentBlock); + Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); // Clear exceptions. new StoreInst(intrinsics->JavaObjectNullConstant, javaExceptionPtr, currentBlock); #if defined(SERVICE) - + // Change the isolate we are currently running, now that we have catched // the exception: the exception may have been thrown by another isolate. - Value* threadId = 0; + Value* mutatorThreadId = 0; Value* OldIsolateID = 0; Value* IsolateIDPtr = 0; Value* OldIsolate = 0; @@ -513,25 +476,22 @@ Value* IsolatePtr = 0; currentBlock = cur->javaHandler; if (loader != loader->bootstrapLoader) { - threadId = getCurrentThread(intrinsics->MutatorThreadType); - - IsolateIDPtr = GetElementPtrInst::Create(threadId, intrinsics->constantThree, - "", cur->javaHandler); + mutatorThreadId = getGetMutatorThreadPtr(); + IsolateIDPtr = getIsolateIDPtr(mutatorThreadId); const Type* realType = PointerType::getUnqual(intrinsics->pointerSizeType); IsolateIDPtr = new BitCastInst(IsolateIDPtr, realType, "", - cur->javaHandler); - OldIsolateID = new LoadInst(IsolateIDPtr, "", cur->javaHandler); + currentBlock); + OldIsolateID = new LoadInst(IsolateIDPtr, "", currentBlock); Value* MyID = ConstantInt::get(intrinsics->pointerSizeType, loader->getIsolate()->IsolateID); - new StoreInst(MyID, IsolateIDPtr, cur->javaHandler); - IsolatePtr = GetElementPtrInst::Create(threadId, intrinsics->constantFour, "", - cur->javaHandler); + new StoreInst(MyID, IsolateIDPtr, currentBlock); + IsolatePtr = getVMPtr(mutatorThreadPtr); - OldIsolate = new LoadInst(IsolatePtr, "", cur->javaHandler); + OldIsolate = new LoadInst(IsolatePtr, "", currentBlock); NewIsolate = intrinsics->getIsolate(loader->getIsolate(), currentBlock); - new StoreInst(NewIsolate, IsolatePtr, cur->javaHandler); + new StoreInst(NewIsolate, IsolatePtr, currentBlock); } #endif Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc?rev=117366&r1=117365&r2=117366&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc Tue Oct 26 09:55:11 2010 @@ -390,7 +390,7 @@ // catch the exception but resume unwinding. JnjvmClassLoader* loader = compilingClass->classLoader;; if (loader != loader->bootstrapLoader) { - Value* Isolate = genGetVMPtr(genGetMutatorThreadPtr()); + Value* Isolate = getVMPtr(getMutatorThreadPtr()); Isolate = new LoadInst(Isolate, "", currentBlock); Isolate = new BitCastInst(Isolate, module->ptrPtrType, "", currentBlock); @@ -412,8 +412,8 @@ } #endif - Value* mutatorThreadId = genGetMutatorThreadPtr(); - Value* javaThreadId = genGetJavaThreadPtr(mutatorThreadId); + Value* mutatorThreadId = getMutatorThreadPtr(); + Value* javaThreadId = getJavaThreadPtr(mutatorThreadId); Value* javaExceptionPtr = getGetJavaExceptionPtr(javaThreadId); // Get the Java exception. @@ -460,13 +460,13 @@ currentBlock = cur->nativeHandler; - mutatorThreadId = genGetMutatorThreadPtr(); - javaThreadId = genGetJavaThreadPtr(mutatorThreadId); + mutatorThreadId = getMutatorThreadPtr(); + javaThreadId = getJavaThreadPtr(mutatorThreadId); javaExceptionPtr = getGetJavaExceptionPtr(javaThreadId); // Get the Java exception. Value* exc = new LoadInst(javaExceptionPtr, "", currentBlock); - Value* cxxExceptionPtr = genGetCXXExceptionPtr(mutatorThreadId); + Value* cxxExceptionPtr = getCXXExceptionPtr(mutatorThreadId); // Clear exceptions. new StoreInst(module->constantPtrNull, cxxExceptionPtr, currentBlock); @@ -499,7 +499,7 @@ #if defined(SERVICE) - + // Change the isolate we are currently running, now that we have catched // the exception: the exception may have been thrown by another isolate. Value* mutatorThreadId = 0; @@ -510,24 +510,22 @@ Value* IsolatePtr = 0; currentBlock = cur->javaHandler; if (loader != loader->bootstrapLoader) { - mutatorThreadId = genGetMutatorThreadPtr(); - - IsolateIDPtr = genGetIsolateIDPtr(mutatorThreadId); - - const Type* realType = PointerType::getUnqual(module->pointerSizeType); + mutatorThreadId = getGetMutatorThreadPtr(); + IsolateIDPtr = getIsolateIDPtr(mutatorThreadId); + const Type* realType = PointerType::getUnqual(intrinsics->pointerSizeType); IsolateIDPtr = new BitCastInst(IsolateIDPtr, realType, "", - cur->javaHandler); - OldIsolateID = new LoadInst(IsolateIDPtr, "", cur->javaHandler); + currentBlock); + OldIsolateID = new LoadInst(IsolateIDPtr, "", currentBlock); - Value* MyID = ConstantInt::get(module->pointerSizeType, + Value* MyID = ConstantInt::get(intrinsics->pointerSizeType, loader->getIsolate()->IsolateID); - new StoreInst(MyID, IsolateIDPtr, cur->javaHandler); - IsolatePtr = genGetVMPtr(mutatorThreadId); + new StoreInst(MyID, IsolateIDPtr, currentBlock); + IsolatePtr = getVMPtr(mutatorThreadPtr); - OldIsolate = new LoadInst(IsolatePtr, "", cur->javaHandler); - NewIsolate = module->getIsolate(loader->getIsolate(), currentBlock); - new StoreInst(NewIsolate, IsolatePtr, cur->javaHandler); + OldIsolate = new LoadInst(IsolatePtr, "", currentBlock); + NewIsolate = intrinsics->getIsolate(loader->getIsolate(), currentBlock); + new StoreInst(NewIsolate, IsolatePtr, currentBlock); } #endif @@ -546,7 +544,7 @@ if (PI == PE) { endExceptionBlock->eraseFromParent(); } else { - Value* cxxExceptionPtr = genGetCXXExceptionPtr(genGetMutatorThreadPtr()); + Value* cxxExceptionPtr = getCXXExceptionPtr(getMutatorThreadPtr()); Value* cxxException = new LoadInst(cxxExceptionPtr, "", currentBlock); llvm::CallInst::Create(module->unwindResume, cxxException, "", currentBlock); new UnreachableInst(currentBlock); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=117366&r1=117365&r2=117366&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Tue Oct 26 09:55:11 2010 @@ -262,19 +262,7 @@ } } -llvm::Value* JavaJIT::getCurrentThread(const llvm::Type* Ty) { - Value* FrameAddr = CallInst::Create(intrinsics->llvm_frameaddress, - intrinsics->constantZero, "", currentBlock); - Value* threadId = new PtrToIntInst(FrameAddr, intrinsics->pointerSizeType, "", - currentBlock); - threadId = BinaryOperator::CreateAnd(threadId, intrinsics->constantThreadIDMask, - "", currentBlock); - threadId = new IntToPtrInst(threadId, Ty, "", currentBlock); - - return threadId; -} - -llvm::Value* JavaJIT::genGetMutatorThreadPtr() { +llvm::Value* JavaJIT::getMutatorThreadPtr() { Value* FrameAddr = CallInst::Create(intrinsics->llvm_frameaddress, intrinsics->constantZero, "", currentBlock); Value* threadId = new PtrToIntInst(FrameAddr, intrinsics->pointerSizeType, "", @@ -286,11 +274,11 @@ return threadId; } -llvm::Value* JavaJIT::genGetJavaThreadPtr(llvm::Value* mutatorThreadPtr) { +llvm::Value* JavaJIT::getJavaThreadPtr(llvm::Value* mutatorThreadPtr) { return new BitCastInst(mutatorThreadPtr, intrinsics->JavaThreadType, "", currentBlock); } -llvm::Value* JavaJIT::genGetIsolateIDPtr(llvm::Value* mutatorThreadPtr) { +llvm::Value* JavaJIT::getIsolateIDPtr(llvm::Value* mutatorThreadPtr) { Value* GEP[3] = { intrinsics->constantZero, intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetIsolateIDInThreadConstant }; @@ -298,7 +286,7 @@ return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); } -llvm::Value* JavaJIT::genGetVMPtr(llvm::Value* mutatorThreadPtr) { +llvm::Value* JavaJIT::getVMPtr(llvm::Value* mutatorThreadPtr) { Value* GEP[3] = { intrinsics->constantZero, intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetVMInThreadConstant }; @@ -306,7 +294,7 @@ return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); } -llvm::Value* JavaJIT::genGetDoYieldPtr(llvm::Value* mutatorThreadPtr) { +llvm::Value* JavaJIT::getDoYieldPtr(llvm::Value* mutatorThreadPtr) { Value* GEP[3] = { intrinsics->constantZero, intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetDoYieldInThreadConstant }; @@ -314,7 +302,7 @@ return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); } -llvm::Value* JavaJIT::genGetCXXExceptionPtr(llvm::Value* mutatorThreadPtr) { +llvm::Value* JavaJIT::getCXXExceptionPtr(llvm::Value* mutatorThreadPtr) { Value* GEP[3] = { intrinsics->constantZero, intrinsics->OffsetThreadInMutatorThreadConstant, intrinsics->OffsetCXXExceptionInThreadConstant }; @@ -322,14 +310,14 @@ return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); } -llvm::Value* JavaJIT::genGetJNIEnvPtr(llvm::Value* javaThreadPtr) { +llvm::Value* JavaJIT::getJNIEnvPtr(llvm::Value* javaThreadPtr) { Value* GEP[2] = { intrinsics->constantZero, intrinsics->OffsetJNIInJavaThreadConstant }; return GetElementPtrInst::Create(javaThreadPtr, GEP, GEP + 2, "", currentBlock); } -llvm::Value* JavaJIT::genGetJavaExceptionPtr(llvm::Value* javaThreadPtr) { +llvm::Value* JavaJIT::getJavaExceptionPtr(llvm::Value* javaThreadPtr) { Value* GEP[2] = { intrinsics->constantZero, intrinsics->OffsetJavaExceptionInJavaThreadConstant }; @@ -414,7 +402,7 @@ std::vector nativeArgs; - Value* jniEnv = genGetJNIEnvPtr(genGetJavaThreadPtr(genGetMutatorThreadPtr())); + Value* jniEnv = getJNIEnvPtr(getJavaThreadPtr(getMutatorThreadPtr())); jniEnv = new BitCastInst(jniEnv, intrinsics->ptrType, "", currentBlock); @@ -615,7 +603,7 @@ lockPtr = new BitCastInst(lockPtr, PointerType::getUnqual(intrinsics->pointerSizeType), "", currentBlock); - Value* threadId = getCurrentThread(intrinsics->MutatorThreadType); + Value* threadId = getMutatorThreadPtr(); threadId = new PtrToIntInst(threadId, intrinsics->pointerSizeType, "", currentBlock); Value* newValMask = BinaryOperator::CreateOr(threadId, lock, "", @@ -663,7 +651,7 @@ Value* lockedMask = BinaryOperator::CreateAnd( lock, NonLockBitsMask, "", currentBlock); - Value* threadId = getCurrentThread(intrinsics->MutatorThreadType); + Value* threadId = getMutatorThreadPtr(); threadId = new PtrToIntInst(threadId, intrinsics->pointerSizeType, "", currentBlock); @@ -1140,17 +1128,16 @@ #if defined(SERVICE) JnjvmClassLoader* loader = compilingClass->classLoader; Value* Cmp = 0; - Value* threadId = 0; + Value* mutatorThreadId = 0; Value* OldIsolateID = 0; Value* IsolateIDPtr = 0; Value* OldIsolate = 0; Value* NewIsolate = 0; Value* IsolatePtr = 0; if (loader != loader->bootstrapLoader && isPublic(compilingMethod->access)) { - threadId = getCurrentThread(intrinsics->MutatorThreadType); + mutatorThreadId = getMutatorThreadPtr(); - IsolateIDPtr = GetElementPtrInst::Create(threadId, intrinsics->constantThree, - "", currentBlock); + IsolateIDPtr = getIsolateIDPtr(mutatorThreadPtr); const Type* realType = PointerType::getUnqual(intrinsics->pointerSizeType); IsolateIDPtr = new BitCastInst(IsolateIDPtr, realType, "", currentBlock); @@ -1169,8 +1156,7 @@ currentBlock = ServiceBB; new StoreInst(MyID, IsolateIDPtr, currentBlock); - IsolatePtr = GetElementPtrInst::Create(threadId, intrinsics->constantFour, "", - currentBlock); + IsolatePtr = getVMPtr(mutatorThreadId); OldIsolate = new LoadInst(IsolatePtr, "", currentBlock); NewIsolate = intrinsics->getIsolate(loader->getIsolate(), currentBlock); @@ -1219,7 +1205,7 @@ } if (TheCompiler->useCooperativeGC()) { - Value* YieldPtr = genGetDoYieldPtr(genGetMutatorThreadPtr()); + Value* YieldPtr = getDoYieldPtr(getMutatorThreadPtr()); Value* Yield = new LoadInst(YieldPtr, "", currentBlock); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=117366&r1=117365&r2=117366&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Tue Oct 26 09:55:11 2010 @@ -151,18 +151,29 @@ void convertValue(llvm::Value*& val, const llvm::Type* t1, llvm::BasicBlock* currentBlock, bool usign); - /// getCurrentThread - Emit code to get the current thread. - llvm::Value* getCurrentThread(const llvm::Type* Ty); + /// getMutatorThreadPtr - Emit code to get a pointer to the current MutatorThread. + llvm::Value* getMutatorThreadPtr(); - llvm::Value* genGetMutatorThreadPtr(); - llvm::Value* genGetIsolateIDPtr(llvm::Value* mutatorThreadPtr); - llvm::Value* genGetVMPtr(llvm::Value* mutatorThreadPtr); - llvm::Value* genGetDoYieldPtr(llvm::Value* mutatorThreadPtr); - llvm::Value* genGetCXXExceptionPtr(llvm::Value* mutatorThreadPtr); - - llvm::Value* genGetJavaThreadPtr(llvm::Value* mutatorThreadPtr); - llvm::Value* genGetJNIEnvPtr(llvm::Value* javaThreadPtr); - llvm::Value* genGetJavaExceptionPtr(llvm::Value* javaThreadPtr); + /// getIsolateIDPtr - Emit code to get a pointer to IsolateID. + llvm::Value* getIsolateIDPtr(llvm::Value* mutatorThreadPtr); + + /// getVMPtr - Emit code to get a pointer to MyVM. + llvm::Value* getVMPtr(llvm::Value* mutatorThreadPtr); + + /// getDoYieldPtr - Emit code to get a pointer to doYield. + llvm::Value* getDoYieldPtr(llvm::Value* mutatorThreadPtr); + + /// getCXXExceptionPtr - Emit code to get a pointer to internalPendingException. + llvm::Value* getCXXExceptionPtr(llvm::Value* mutatorThreadPtr); + + /// getJavaThreadPtr - Emit code to get a pointer to the current JavaThread. + llvm::Value* getJavaThreadPtr(llvm::Value* mutatorThreadPtr); + + /// getJNIEnvPtr - Emit code to get a pointer to JNIEnv + llvm::Value* getJNIEnvPtr(llvm::Value* javaThreadPtr); + + /// getJavaExceptionPtr - Emit code to get a pointer to the Java pending exception + llvm::Value* getJavaExceptionPtr(llvm::Value* javaThreadPtr); //===------------------------- Debugging support --------------------------===// Modified: vmkit/trunk/lib/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Makefile?rev=117366&r1=117365&r2=117366&view=diff ============================================================================== (empty) Propchange: vmkit/trunk/lib/Makefile ------------------------------------------------------------------------------ --- svn:executable (original) +++ svn:executable (removed) @@ -1 +0,0 @@ -* From barteo at gmail.com Wed Oct 20 07:02:52 2010 From: barteo at gmail.com (Bartek Teodorczyk) Date: Wed, 20 Oct 2010 14:02:52 -0000 Subject: [vmkit-commits] Vmjc reports Illegal instruction when converting glibj.zip Message-ID: Hi, I was trying to convert the classpath library: ./vmkit/Release+Asserts/bin/vmjc -f -std-compile-opts ./classpath-0.97.2/lib/glibj.zip -o glibj.zip.bc It gives the following error: Illegal instruction What can be a possible cause? LLVM revision: 116920 VMKIT revision: 116307 Bartek