From nicolas.geoffray at lip6.fr Thu Nov 4 15:19:38 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 04 Nov 2010 22:19:38 -0000 Subject: [vmkit-commits] [vmkit] r118261 - /vmkit/branches/precise/mmtk/java/src/org/j3/mmtk/Barriers.java Message-ID: <20101104221938.35C8E2A6C12C@llvm.org> Author: geoffray Date: Thu Nov 4 17:19:38 2010 New Revision: 118261 URL: http://llvm.org/viewvc/llvm-project?rev=118261&view=rev Log: Fix an indexing bug in objectArrayStoreNoGCBarrier. Modified: vmkit/branches/precise/mmtk/java/src/org/j3/mmtk/Barriers.java Modified: vmkit/branches/precise/mmtk/java/src/org/j3/mmtk/Barriers.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/java/src/org/j3/mmtk/Barriers.java?rev=118261&r1=118260&r2=118261&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/java/src/org/j3/mmtk/Barriers.java (original) +++ vmkit/branches/precise/mmtk/java/src/org/j3/mmtk/Barriers.java Thu Nov 4 17:19:38 2010 @@ -600,7 +600,8 @@ @Override public final void objectArrayStoreNoGCBarrier(Object[] dst, int index, Object value) { Address base = ObjectReference.fromObject(dst).toAddress(); - Address slot = base.plus(Offset.fromIntZeroExtend(index << LOG_BYTES_IN_ADDRESS)); + // Add 3 for the header, the class, and the length. + Address slot = base.plus(Offset.fromIntZeroExtend((index + 3) << LOG_BYTES_IN_ADDRESS)); VM.activePlan.global().storeObjectReference(slot, ObjectReference.fromObject(value)); } } From nicolas.geoffray at lip6.fr Thu Nov 4 15:20:14 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 04 Nov 2010 22:20:14 -0000 Subject: [vmkit-commits] [vmkit] r118262 - /vmkit/branches/precise/mmtk/mmtk-j3/ObjectModel.cpp Message-ID: <20101104222014.447D32A6C12C@llvm.org> Author: geoffray Date: Thu Nov 4 17:20:14 2010 New Revision: 118262 URL: http://llvm.org/viewvc/llvm-project?rev=118262&view=rev Log: Implement getTypeDescriptor. Modified: vmkit/branches/precise/mmtk/mmtk-j3/ObjectModel.cpp Modified: vmkit/branches/precise/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/ObjectModel.cpp?rev=118262&r1=118261&r2=118262&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/ObjectModel.cpp Thu Nov 4 17:20:14 2010 @@ -10,6 +10,7 @@ #include "JavaArray.h" #include "JavaClass.h" #include "JavaObject.h" +#include "JavaString.h" #include "JavaThread.h" #include "debug.h" @@ -137,8 +138,42 @@ extern "C" void Java_org_j3_mmtk_ObjectModel_getNextObject__Lorg_vmmagic_unboxed_ObjectReference_2 ( JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 ( - JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +class FakeByteArray { + public: + void* operator new(size_t size, int length) { + return new char[size + length]; + } + + FakeByteArray(const char* name) { + length = strlen(name); + for (uint32 i = 0; i < length; i++) { + elements[i] = name[i]; + } + } + + FakeByteArray(const UTF8* name) { + length = name->size; + for (uint32 i = 0; i < length; i++) { + elements[i] = name->elements[i]; + } + } + private: + JavaObject header; + size_t length; + uint8_t elements[1]; +}; + +extern "C" FakeByteArray* Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, JavaObject* src) { + if (VMClassLoader::isVMClassLoader(src)) { + return new (14) FakeByteArray("VMClassLoader"); + } else { + CommonClass* cl = JavaObject::getClass(src); + return new (cl->name->size) FakeByteArray(cl->name); + } +} + extern "C" void Java_org_j3_mmtk_ObjectModel_getArrayLength__Lorg_vmmagic_unboxed_ObjectReference_2 ( JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } From nicolas.geoffray at lip6.fr Thu Nov 4 15:22:28 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 04 Nov 2010 22:22:28 -0000 Subject: [vmkit-commits] [vmkit] r118263 - /vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp Message-ID: <20101104222228.65C3F2A6C12C@llvm.org> Author: geoffray Date: Thu Nov 4 17:22:28 2010 New Revision: 118263 URL: http://llvm.org/viewvc/llvm-project?rev=118263&view=rev Log: Add an assert when creating the IMT. Modified: vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp 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=118263&r1=118262&r2=118263&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp Thu Nov 4 17:22:28 2010 @@ -375,13 +375,13 @@ IMT->contents[i] = (uintptr_t)table | 1; - int j = 0; + uint32_t j = 0; std::set::iterator Interf = atIndex.begin(); for (std::vector::iterator it = methods.begin(), et = methods.end(); it != et; ++it, j += 2, ++Interf) { JavaMethod* Imeth = *Interf; JavaMethod* Cmeth = *it; - + assert(j < 2 * size - 1); table[j] = (uintptr_t)Imeth; if (Cmeth) { table[j + 1] = getPointerOrStub(*Cmeth, JavaMethod::Interface); From nicolas.geoffray at lip6.fr Wed Nov 10 12:00:39 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 10 Nov 2010 20:00:39 -0000 Subject: [vmkit-commits] [vmkit] r118707 - in /vmkit/branches/precise: include/j3/ include/mvm/Threads/ lib/J3/Classpath/ lib/J3/Compiler/ lib/J3/LLVMRuntime/ lib/J3/VMCore/ lib/Mvm/CommonThread/ lib/Mvm/Compiler/ lib/Mvm/MMTk/ mmtk/config/copyms/ mmtk/mmtk-alloc/ mmtk/mmtk-j3/ Message-ID: <20101110200040.3F2362A6C12C@llvm.org> Author: geoffray Date: Wed Nov 10 14:00:39 2010 New Revision: 118707 URL: http://llvm.org/viewvc/llvm-project?rev=118707&view=rev Log: Lots of GC fixes wrt to stack walking. Also class bytes are now allocated with malloc, not the GC. - Modified: vmkit/branches/precise/include/j3/JavaJITCompiler.h vmkit/branches/precise/include/mvm/Threads/CollectionRV.h vmkit/branches/precise/include/mvm/Threads/Locks.h vmkit/branches/precise/include/mvm/Threads/Thread.h vmkit/branches/precise/lib/J3/Classpath/ClasspathVMClassLoader.inc vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll vmkit/branches/precise/lib/J3/VMCore/JavaArray.h vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp vmkit/branches/precise/lib/J3/VMCore/JavaClass.h vmkit/branches/precise/lib/J3/VMCore/JavaConstantPool.cpp vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp 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/JnjvmClassLoader.cpp vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h vmkit/branches/precise/lib/J3/VMCore/Reader.cpp vmkit/branches/precise/lib/J3/VMCore/Reader.h vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp vmkit/branches/precise/lib/J3/VMCore/Zip.cpp vmkit/branches/precise/lib/J3/VMCore/Zip.h vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp vmkit/branches/precise/lib/Mvm/Compiler/VmkitGC.cpp vmkit/branches/precise/lib/Mvm/MMTk/MutatorThread.h vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp vmkit/branches/precise/mmtk/mmtk-j3/Memory.cpp vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Modified: vmkit/branches/precise/include/j3/JavaJITCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/j3/JavaJITCompiler.h?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/include/j3/JavaJITCompiler.h (original) +++ vmkit/branches/precise/include/j3/JavaJITCompiler.h Wed Nov 10 14:00:39 2010 @@ -10,6 +10,7 @@ #ifndef J3_JIT_COMPILER_H #define J3_JIT_COMPILER_H +#include "llvm/CodeGen/GCMetadata.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITEventListener.h" #include "j3/JavaLLVMCompiler.h" @@ -38,7 +39,7 @@ bool EmitFunctionName; JavaJITListener listener; llvm::ExecutionEngine* executionEngine; - llvm::GCStrategy* TheGCStrategy; + llvm::GCModuleInfo* GCInfo; JavaJITCompiler(const std::string &ModuleID); ~JavaJITCompiler(); Modified: vmkit/branches/precise/include/mvm/Threads/CollectionRV.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/Threads/CollectionRV.h?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/CollectionRV.h (original) +++ vmkit/branches/precise/include/mvm/Threads/CollectionRV.h Wed Nov 10 14:00:39 2010 @@ -57,7 +57,7 @@ virtual void synchronize() = 0; virtual void join() = 0; - virtual void joinAfterUncooperative() = 0; + virtual void joinAfterUncooperative(void* SP) = 0; virtual void joinBeforeUncooperative() = 0; }; @@ -67,7 +67,7 @@ void synchronize(); void join(); - void joinAfterUncooperative(); + void joinAfterUncooperative(void* SP); void joinBeforeUncooperative(); }; @@ -77,7 +77,7 @@ void synchronize(); void join(); - void joinAfterUncooperative(); + void joinAfterUncooperative(void* SP); void joinBeforeUncooperative(); }; 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/Locks.h (original) +++ vmkit/branches/precise/include/mvm/Threads/Locks.h Wed Nov 10 14:00:39 2010 @@ -110,7 +110,7 @@ /// lock - Acquire the lock. /// - virtual void lock() = 0; + virtual void lock() __attribute__ ((noinline)) = 0; /// unlock - Release the lock. /// @@ -141,7 +141,7 @@ public: LockNormal() : Lock() {} - virtual void lock(); + virtual void lock() __attribute__ ((noinline)); virtual void unlock(); }; @@ -170,7 +170,7 @@ public: LockRecursive() : Lock() { n = 0; } - virtual void lock(); + virtual void lock() __attribute__ ((noinline)); virtual void unlock(); virtual int tryLock(); @@ -185,7 +185,7 @@ /// lockAll - Acquire the lock count times. /// - void lockAll(int count); + void lockAll(int count) __attribute__ ((noinline)); }; /// SpinLock - This class implements a spin lock. A spin lock is OK to use 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/precise/include/mvm/Threads/Thread.h Wed Nov 10 14:00:39 2010 @@ -131,8 +131,9 @@ class KnownFrame { public: - KnownFrame* previousFrame; void* currentFP; + void* currentIP; + KnownFrame* previousFrame; }; @@ -243,65 +244,12 @@ void setLastSP(void* V) { lastSP = V; } void joinRVBeforeEnter(); - void joinRVAfterLeave(); + void joinRVAfterLeave(void* savedSP); - void enterUncooperativeCode(unsigned level = 0) __attribute__ ((noinline)) { - if (isMvmThread()) { - if (!inRV) { - assert(!lastSP && "SP already set when entering uncooperative code"); - ++level; - void* temp = __builtin_frame_address(0); - while (level--) temp = ((void**)temp)[0]; - // The cas is not necessary, but it does a memory barrier. - __sync_bool_compare_and_swap(&lastSP, 0, temp); - if (doYield) joinRVBeforeEnter(); - assert(lastSP && "No last SP when entering uncooperative code"); - } - } - } - - void enterUncooperativeCode(void* SP) { - if (isMvmThread()) { - if (!inRV) { - assert(!lastSP && "SP already set when entering uncooperative code"); - // The cas is not necessary, but it does a memory barrier. - __sync_bool_compare_and_swap(&lastSP, 0, SP); - if (doYield) joinRVBeforeEnter(); - assert(lastSP && "No last SP when entering uncooperative code"); - } - } - } - - void leaveUncooperativeCode() { - if (isMvmThread()) { - if (!inRV) { - assert(lastSP && "No last SP when leaving uncooperative code"); - // The cas is not necessary, but it does a memory barrier. - __sync_bool_compare_and_swap(&lastSP, lastSP, 0); - // A rendezvous has just been initiated, join it. - if (doYield) joinRVAfterLeave(); - assert(!lastSP && "SP has a value after leaving uncooperative code"); - } - } - } - - void* waitOnSP() { - // First see if we can get lastSP directly. - void* sp = lastSP; - if (sp) return sp; - - // Then loop a fixed number of iterations to get lastSP. - for (uint32 count = 0; count < 1000; ++count) { - sp = lastSP; - if (sp) return sp; - } - - // Finally, yield until lastSP is not set. - while ((sp = lastSP) == NULL) mvm::Thread::yield(); - - assert(sp != NULL && "Still no sp"); - return sp; - } + void enterUncooperativeCode(unsigned level = 0) __attribute__ ((noinline)); + void enterUncooperativeCode(void* SP); + void leaveUncooperativeCode(); + void* waitOnSP(); /// clearException - Clear any pending exception of the current thread. @@ -392,6 +340,8 @@ void startKnownFrame(KnownFrame& F) __attribute__ ((noinline)); void endKnownFrame(); + void startUnknownFrame(KnownFrame& F) __attribute__ ((noinline)); + void endUnknownFrame(); }; #ifndef RUNTIME_DWARF_EXCEPTIONS @@ -423,17 +373,9 @@ KnownFrame* frame; mvm::Thread* thread; - StackWalker(mvm::Thread* th) { - thread = th; - addr = mvm::Thread::get() == th ? (void**)FRAME_PTR() : - (void**)th->waitOnSP(); - frame = th->lastKnownFrame; - assert(addr && "No address to start with"); - } - + StackWalker(mvm::Thread* th) __attribute__ ((noinline)); void operator++(); void* operator*(); - MethodInfo* get(); }; Modified: vmkit/branches/precise/lib/J3/Classpath/ClasspathVMClassLoader.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/ClasspathVMClassLoader.inc?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMClassLoader.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMClassLoader.inc Wed Nov 10 14:00:39 2010 @@ -131,22 +131,27 @@ BEGIN_NATIVE_EXCEPTION(0) Jnjvm* vm = JavaThread::get()->getJVM(); + + JnjvmClassLoader* JCL = + JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loader, vm); + int32_t size = JavaArray::getSize(bytes); + ClassBytes* classBytes = new (JCL->allocator, size) ClassBytes(size); + memcpy(classBytes->elements, JavaArray::getElements(bytes), size); + // Before creating a class, do a check on the bytes. - Reader reader(&bytes); + Reader reader(classBytes); uint32 magic = reader.readU4(); if (magic != Jnjvm::Magic) { JavaThread::get()->getJVM()->classFormatError("bad magic number"); } - JnjvmClassLoader* JCL = - JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loader, vm); const UTF8* name = JavaString::javaToInternal(str, JCL->hashUTF8); UserCommonClass* cl = JCL->lookupClass(name); if (!cl) { - UserClass* cl = JCL->constructClass(name, bytes); + UserClass* cl = JCL->constructClass(name, classBytes); cl->resolveClass(); res = cl->getClassDelegatee(vm, pd); 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThrowable.inc Wed Nov 10 14:00:39 2010 @@ -103,7 +103,7 @@ // We don't have the bytes if the class was vmjc'ed. if (sourceAtt && cl->getBytes()) { - Reader reader(sourceAtt, cl->getBytesPtr()); + Reader reader(sourceAtt, cl->bytes); uint16 index = reader.readU2(); sourceName = vm->internalUTF8ToStr(cl->getConstantPool()->UTF8At(index)); } 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp Wed Nov 10 14:00:39 2010 @@ -446,7 +446,7 @@ Elts.push_back(Constant::getNullValue(Ty)); } } else { - Reader reader(attribut, &(cl->bytes)); + Reader reader(attribut, cl->bytes); JavaConstantPool * ctpInfo = cl->ctpInfo; uint16 idx = reader.readU2(); if (type->isPrimitive()) { @@ -1904,14 +1904,14 @@ -void extractFiles(ArrayUInt8* bytes, +void extractFiles(ClassBytes* bytes, JavaAOTCompiler* M, JnjvmBootstrapLoader* bootstrapLoader, std::vector& classes) { ZipArchive archive(bytes, bootstrapLoader->allocator); - mvm::ThreadAllocator allocator; - char* realName = (char*)allocator.Allocate(4096); + mvm::BumpPtrAllocator allocator; + char* realName = (char*)allocator.Allocate(4096, "temp"); for (ZipArchive::table_iterator i = archive.filetable.begin(), e = archive.filetable.end(); i != e; ++i) { ZipFile* file = i->second; @@ -1928,9 +1928,7 @@ classes.push_back(cl); } else if (size > 4 && (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { - UserClassArray* array = bootstrapLoader->upcalls->ArrayOfByte; - ArrayUInt8* res = - (ArrayUInt8*)array->doNew(file->ucsize, JavaThread::get()->getJVM()); + ClassBytes* res = new (allocator, file->ucsize) ClassBytes(file->ucsize); int ok = archive.readFile(res, file); if (!ok) return; @@ -1974,7 +1972,7 @@ (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { std::vector classes; - ArrayUInt8* bytes = Reader::openFile(bootstrapLoader, name); + ClassBytes* bytes = Reader::openFile(bootstrapLoader, name); if (!bytes) { fprintf(stderr, "Can't find zip file.\n"); 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp Wed Nov 10 14:00:39 2010 @@ -364,7 +364,7 @@ Value* oldCLIN = new AllocaInst(PointerType::getUnqual(Type::getInt32Ty(*llvmContext)), "", currentBlock); - Constant* sizeF = ConstantInt::get(Type::getInt32Ty(*llvmContext), 2 * sizeof(void*)); + Constant* sizeF = ConstantInt::get(Type::getInt32Ty(*llvmContext), sizeof(mvm::KnownFrame)); Value* Frame = new AllocaInst(Type::getInt8Ty(*llvmContext), sizeF, "", currentBlock); uint32 nargs = func->arg_size() + 1 + (stat ? 1 : 0); @@ -752,7 +752,7 @@ abort(); } - Reader reader(codeAtt, &(compilingClass->bytes)); + Reader reader(codeAtt, compilingClass->bytes); uint16 maxStack = reader.readU2(); uint16 maxLocals = reader.readU2(); uint32 codeLen = reader.readU4(); @@ -942,7 +942,7 @@ abort(); } - Reader reader(codeAtt, &(compilingClass->bytes)); + Reader reader(codeAtt, compilingClass->bytes); uint16 maxStack = reader.readU2(); uint16 maxLocals = reader.readU2(); uint32 codeLen = reader.readU4(); @@ -1291,7 +1291,7 @@ compilingMethod->lookupAttribut(Attribut::annotationsAttribut); if (annotationsAtt) { - Reader reader(annotationsAtt, &(compilingClass->bytes)); + Reader reader(annotationsAtt, compilingClass->bytes); AnnotationReader AR(reader, compilingClass); uint16 numAnnotations = reader.readU2(); for (uint16 i = 0; i < numAnnotations; ++i) { @@ -1473,25 +1473,7 @@ } Value* JavaJIT::getTarget(FunctionType::param_iterator it, uint32 nb) { -#if defined(ISOLATE_SHARING) - nb += 1; -#endif -#if defined(ISOLATE_SHARING) - sint32 start = nb - 2; - it--; - it--; -#else - sint32 start = nb - 1; -#endif - uint32 nbObjects = 0; - for (sint32 i = start; i >= 0; --i) { - it--; - if (it->get() == intrinsics->JavaObjectType) { - nbObjects++; - } - } - assert(nbObjects > 0 && "No this"); - return objectStack[currentStackIndex - nbObjects]; + return objectStack[currentStackIndex - nb]; } Instruction* JavaJIT::lowerMathOps(const UTF8* name, @@ -2212,12 +2194,8 @@ const llvm::Type* retType = virtualType->getReturnType(); BasicBlock* endBlock = createBasicBlock("end interface invoke"); - PHINode * node = 0; - if (retType != Type::getVoidTy(*llvmContext)) { - node = PHINode::Create(retType, "", endBlock); - } - - + PHINode * node = PHINode::Create(virtualPtrType, "", endBlock); + CommonClass* cl = 0; JavaMethod* meth = 0; ctpInfo->infoOfMethod(index, ACC_VIRTUAL, cl, meth); @@ -2230,13 +2208,11 @@ intrinsics->JavaMethodType, 0, true); } - // Compute the arguments after calling getConstantPoolAt because the - // arguments will be loaded and the runtime may trigger GC. - std::vector args; // size = [signature->nbIn + 3]; - - FunctionType::param_iterator it = virtualType->param_end(); - makeArgs(it, index, args, signature->nbArguments + 1); - JITVerifyNull(args[0]); + Value* targetObject = getTarget(virtualType->param_end(), + signature->nbArguments + 1); + targetObject = new LoadInst( + targetObject, "", TheCompiler->useCooperativeGC(), currentBlock); + JITVerifyNull(targetObject); BasicBlock* label_bb = createBasicBlock("bb"); BasicBlock* label_bb4 = createBasicBlock("bb4"); @@ -2244,7 +2220,7 @@ BasicBlock* label_bb7 = createBasicBlock("bb7"); // Block entry (label_entry) - Value* VT = CallInst::Create(intrinsics->GetVTFunction, args[0], "", + Value* VT = CallInst::Create(intrinsics->GetVTFunction, targetObject, "", currentBlock); Value* IMT = CallInst::Create(intrinsics->GetIMTFunction, VT, "", currentBlock); @@ -2270,8 +2246,8 @@ // Block bb (label_bb) currentBlock = label_bb; CastInst* ptr_22 = new IntToPtrInst(int32_19, virtualPtrType, "", currentBlock); - Value* ret = invoke(ptr_22, args, "", currentBlock); - if (node) node->addIncoming(ret, currentBlock); + + node->addIncoming(ptr_22, currentBlock); BranchInst::Create(endBlock, currentBlock); // Block bb4 (label_bb4) @@ -2300,8 +2276,8 @@ LoadInst* int32_32 = new LoadInst(ptr_31, "", false, currentBlock); CastInst* ptr_33 = new BitCastInst(int32_32, virtualPtrType, "", currentBlock); - ret = invoke(ptr_33, args, "", currentBlock); - if (node) node->addIncoming(ret, currentBlock); + node->addIncoming(ptr_33, currentBlock); + BranchInst::Create(endBlock, currentBlock); // Block bb7 (label_bb7) @@ -2332,12 +2308,17 @@ ptr_table_0_lcssa->addIncoming(ptr_37, currentBlock); currentBlock = endBlock; - if (node) { - if (node->getType() == intrinsics->JavaObjectType) { + + std::vector args; // size = [signature->nbIn + 3]; + FunctionType::param_iterator it = virtualType->param_end(); + makeArgs(it, index, args, signature->nbArguments + 1); + Value* ret = invoke(node, args, "", currentBlock); + if (retType != Type::getVoidTy(*llvmContext)) { + if (ret->getType() == intrinsics->JavaObjectType) { JnjvmClassLoader* JCL = compilingClass->classLoader; - push(node, false, signature->getReturnType()->findAssocClass(JCL)); + push(ret, false, signature->getReturnType()->findAssocClass(JCL)); } else { - push(node, signature->getReturnType()->isUnsigned()); + push(ret, signature->getReturnType()->isUnsigned()); if (retType == Type::getDoubleTy(*llvmContext) || retType == Type::getInt64Ty(*llvmContext)) { push(intrinsics->constantZero, false); 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp Wed Nov 10 14:00:39 2010 @@ -61,13 +61,13 @@ JavaMethod* meth = (JavaMethod*)MetaInfo; CodeLineInfo* info = meth->lookupCodeLineInfo((uintptr_t)ip); if (info != NULL) { - fprintf(stderr, "; %p in %s.%s (line %d, bytecode %d, code start %p)", new_ip, + fprintf(stderr, "; %p (%p) in %s.%s (line %d, bytecode %d, code start %p)", new_ip, addr, UTF8Buffer(meth->classDef->name).cString(), UTF8Buffer(meth->name).cString(), meth->lookupLineNumber((uintptr_t)ip), info->bytecodeIndex, meth->code); } else { - fprintf(stderr, "; %p in %s.%s (native method, code start %p)", new_ip, + fprintf(stderr, "; %p (%p) in %s.%s (native method, code start %p)", new_ip, addr, UTF8Buffer(meth->classDef->name).cString(), UTF8Buffer(meth->name).cString(), meth->code); } @@ -83,65 +83,14 @@ // The following is necessary for -load-bc. if (F.getParent() != TheCompiler->getLLVMModule()) return; assert(F.hasGC()); - - Jnjvm* vm = JavaThread::get()->getJVM(); - mvm::BumpPtrAllocator& Alloc = TheCompiler->allocator; - - // Fetch the GCStrategy if it wasn't created before. - if (TheCompiler->TheGCStrategy == NULL) { - assert(mvm::MvmModule::TheGCStrategy != NULL && "No GC strategy"); - TheCompiler->TheGCStrategy = mvm::MvmModule::TheGCStrategy; - mvm::MvmModule::TheGCStrategy = NULL; - } - - GCStrategy::iterator I = TheCompiler->TheGCStrategy->end(); - I--; - while (&(*I)->getFunction() != &F) { - // This happens when the compilation of a function was post-poned. - assert(I != TheCompiler->TheGCStrategy->begin() && "No GC info"); - I--; - } - assert(&(*I)->getFunction() == &F && "GC Info and method do not correspond"); - llvm::GCFunctionInfo* GFI = *I; - - JavaMethod* meth = TheCompiler->getJavaMethod(F); - mvm::JITMethodInfo* MI = NULL; - if (meth == NULL) { - // This is a stub. - MI = new(Alloc, "JITMethodInfo") mvm::MvmJITMethodInfo(GFI, &F, TheCompiler); - } else { - MI = new(Alloc, "JavaJITMethodInfo") JavaJITMethodInfo(GFI, meth); - } - JIT* jit = (JIT*)TheCompiler->executionEngine; - MI->addToVM(vm, jit); - - if (meth == NULL) return; - - uint32_t infoLength = GFI->size(); - meth->codeInfoLength = infoLength; - if (infoLength == 0) { - meth->codeInfo = NULL; + if (TheCompiler->GCInfo != NULL) { + assert(TheCompiler->GCInfo == Details.MF->getGMI()); return; } - - mvm::BumpPtrAllocator& JavaAlloc = meth->classDef->classLoader->allocator; - CodeLineInfo* infoTable = - new(JavaAlloc, "CodeLineInfo") CodeLineInfo[infoLength]; - uint32_t index = 0; - for (GCFunctionInfo::iterator I = GFI->begin(), E = GFI->end(); - I != E; - I++, index++) { - DebugLoc DL = I->Loc; - uint32_t bytecodeIndex = DL.getLine(); - uint32_t second = DL.getCol(); - assert(second == 0 && "Wrong column number"); - uintptr_t address = jit->getCodeEmitter()->getLabelAddress(I->Label); - infoTable[index].address = address; - infoTable[index].bytecodeIndex = bytecodeIndex; - } - meth->codeInfo = infoTable; + TheCompiler->GCInfo = Details.MF->getGMI(); } + Constant* JavaJITCompiler::getNativeClass(CommonClass* classDef) { const llvm::Type* Ty = classDef->isClass() ? JavaIntrinsics.JavaClassType : JavaIntrinsics.JavaCommonClassType; @@ -250,15 +199,10 @@ JavaLLVMCompiler(ModuleID), listener(this) { EmitFunctionName = false; + GCInfo = NULL; - // Protect IR for the GC. - mvm::MvmModule::protectIR(); executionEngine = ExecutionEngine::createJIT(TheModule, 0, 0, llvm::CodeGenOpt::Default, false); - TheGCStrategy = mvm::MvmModule::TheGCStrategy; - mvm::MvmModule::TheGCStrategy = NULL; - mvm::MvmModule::unprotectIR(); - executionEngine->RegisterJITEventListener(&listener); addJavaPasses(); @@ -405,7 +349,41 @@ mvm::MvmModule::protectIR(); Function* func = parseFunction(meth); void* res = executionEngine->getPointerToGlobal(func); - // Now that it's compiled, we don't need the IR anymore + + if (!func->isDeclaration()) { + llvm::GCFunctionInfo* GFI = &(GCInfo->getFunctionInfo(*func)); + assert((GFI != NULL) && "No GC information"); + + Jnjvm* vm = JavaThread::get()->getJVM(); + mvm::JITMethodInfo* MI = + new(allocator, "JavaJITMethodInfo") JavaJITMethodInfo(GFI, meth); + MI->addToVM(vm, (JIT*)executionEngine); + + uint32_t infoLength = GFI->size(); + meth->codeInfoLength = infoLength; + if (infoLength == 0) { + meth->codeInfo = NULL; + } else { + mvm::BumpPtrAllocator& JavaAlloc = meth->classDef->classLoader->allocator; + CodeLineInfo* infoTable = + new(JavaAlloc, "CodeLineInfo") CodeLineInfo[infoLength]; + uint32_t index = 0; + for (GCFunctionInfo::iterator I = GFI->begin(), E = GFI->end(); + I != E; + I++, index++) { + DebugLoc DL = I->Loc; + uint32_t bytecodeIndex = DL.getLine(); + uint32_t second = DL.getCol(); + assert(second == 0 && "Wrong column number"); + uintptr_t address = + ((JIT*)executionEngine)->getCodeEmitter()->getLabelAddress(I->Label); + infoTable[index].address = address; + infoTable[index].bytecodeIndex = bytecodeIndex; + } + meth->codeInfo = infoTable; + } + } + // Now that it's compiled, we don't need the IR anymore func->deleteBody(); mvm::MvmModule::unprotectIR(); return res; @@ -414,6 +392,15 @@ void* JavaJITCompiler::GenerateStub(llvm::Function* F) { mvm::MvmModule::protectIR(); void* res = executionEngine->getPointerToGlobal(F); + + llvm::GCFunctionInfo* GFI = &(GCInfo->getFunctionInfo(*F)); + assert((GFI != NULL) && "No GC information"); + + Jnjvm* vm = JavaThread::get()->getJVM(); + mvm::JITMethodInfo* MI = + new(allocator, "JITMethodInfo") mvm::MvmJITMethodInfo(GFI, F, this); + MI->addToVM(vm, (JIT*)executionEngine); + // Now that it's compiled, we don't need the IR anymore F->deleteBody(); mvm::MvmModule::unprotectIR(); Modified: vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (original) +++ vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll Wed Nov 10 14:00:39 2010 @@ -1,4 +1,4 @@ -%BumpPtrAllocator = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* } +%ThreadAllocator = type { i8*, i8*, i8*, i8*, i8*, i8*, i8* } ;;; Field 0: the VT of threads ;;; Field 1: next @@ -13,9 +13,9 @@ ;;; Field 10: internalThreadID ;;; field 11: routine ;;; field 12: lastKnownFrame -;;; field 13: lastKnownBufer +;;; field 13: lastKnownBuffer ;;; 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* } + i1, i8*, i8*, i8*, i8*, i8*, %ThreadAllocator, i8*, i8* } Modified: vmkit/branches/precise/lib/J3/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaArray.h?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaArray.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaArray.h Wed Nov 10 14:00:39 2010 @@ -98,6 +98,7 @@ static void setElement(ArrayObject* self, JavaObject* value, uint32_t i) { llvm_gcroot(self, 0); llvm_gcroot(value, 0); + if (value != NULL) assert(value->getVirtualTable()); self->elements[i] = value; } 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp Wed Nov 10 14:00:39 2010 @@ -216,9 +216,8 @@ logSize = nb; } -Class::Class(JnjvmClassLoader* loader, const UTF8* n, ArrayUInt8* B) : +Class::Class(JnjvmClassLoader* loader, const UTF8* n, ClassBytes* B) : CommonClass(loader, n) { - llvm_gcroot(B, 0); virtualVT = 0; bytes = B; super = 0; @@ -601,7 +600,7 @@ if (!attribut) { InitNullStaticField(); } else { - Reader reader(attribut, &(classDef->bytes)); + Reader reader(attribut, classDef->bytes); JavaConstantPool * ctpInfo = classDef->ctpInfo; uint16 idx = reader.readU2(); if (type->isPrimitive()) { @@ -687,7 +686,7 @@ Attribut* codeAtt = meth.lookupAttribut(Attribut::codeAttribut); if (codeAtt) { - Reader reader(codeAtt, &(meth.classDef->bytes)); + Reader reader(codeAtt, meth.classDef->bytes); //uint16 maxStack = reader.readU2(); //uint16 maxLocals = @@ -888,7 +887,7 @@ PRINT_DEBUG(JNJVM_LOAD, 0, LIGHT_GREEN, "reading ", 0); PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "%s\n", mvm::PrintBuffer(this).cString()); - Reader reader(&bytes); + Reader reader(bytes); uint32 magic = reader.readU4(); assert(magic == Jnjvm::Magic && "I've created a class but magic is no good!"); @@ -942,7 +941,7 @@ if (!innerOuterResolved) { Attribut* attribut = lookupAttribut(Attribut::innerClassesAttribut); if (attribut != 0) { - Reader reader(attribut, getBytesPtr()); + Reader reader(attribut, bytes); uint16 nbi = reader.readU2(); for (uint16 i = 0; i < nbi; ++i) { uint16 inner = reader.readU2(); @@ -1019,7 +1018,7 @@ return (ArrayObject*)vm->upcalls->classArrayClass->doNew(0, vm); } else { UserConstantPool* ctp = classDef->getConstantPool(); - Reader reader(exceptionAtt, classDef->getBytesPtr()); + Reader reader(exceptionAtt, classDef->bytes); uint16 nbe = reader.readU2(); res = (ArrayObject*)vm->upcalls->classArrayClass->doNew(nbe, vm); @@ -1757,7 +1756,7 @@ if (codeInfo[i].address == ip) { Attribut* codeAtt = lookupAttribut(Attribut::codeAttribut); if (codeAtt == NULL) return 0; - Reader reader(codeAtt, &(classDef->bytes)); + Reader reader(codeAtt, classDef->bytes); reader.readU2(); // max_stack reader.readU2(); // max_locals; uint32_t codeLength = reader.readU4(); @@ -1790,7 +1789,7 @@ for(uint16 i = 0; i < codeInfoLength; ++i) { if (codeInfo[i].address == ip) { Attribut* codeAtt = lookupAttribut(Attribut::codeAttribut); - Reader reader(codeAtt, &(classDef->bytes)); + Reader reader(codeAtt, classDef->bytes); reader.cursor = reader.cursor + 2 + 2 + 4 + codeInfo[i].bytecodeIndex + 1; return reader.readU2(); } 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.h Wed Nov 10 14:00:39 2010 @@ -34,6 +34,7 @@ class ArrayUInt16; class Class; class ClassArray; +class ClassBytes; class JavaArray; class JavaConstantPool; class JavaField; @@ -457,7 +458,7 @@ /// bytes - The .class file of this class. /// - ArrayUInt8* bytes; + ClassBytes* bytes; /// ctpInfo - The constant pool info of this class. /// @@ -621,7 +622,7 @@ /// Class - Create a class in the given virtual machine and with the given /// name. - Class(JnjvmClassLoader* loader, const UTF8* name, ArrayUInt8* bytes); + Class(JnjvmClassLoader* loader, const UTF8* name, ClassBytes* bytes); /// readParents - Reads the parents, i.e. super and interfaces, of the class. /// @@ -656,14 +657,10 @@ /// getBytes - Get the bytes of the class file. /// - ArrayUInt8* getBytes() const { + ClassBytes* getBytes() const { return bytes; } - ArrayUInt8** getBytesPtr() { - return &bytes; - } - /// resolveInnerOuterClasses - Resolve the inner/outer information. /// void resolveInnerOuterClasses(); @@ -1300,6 +1297,7 @@ void setStaticObjectField(JavaObject* val) { llvm_gcroot(val, 0); + if (val != NULL) assert(val->getVirtualTable()); assert(classDef->isResolved()); void* ptr = (void*)((uint64)classDef->getStaticInstance() + ptrOffset); ((JavaObject**)ptr)[0] = val; @@ -1315,6 +1313,7 @@ void setInstanceObjectField(JavaObject* obj, JavaObject* val) { llvm_gcroot(obj, 0); llvm_gcroot(val, 0); + if (val != NULL) assert(val->getVirtualTable()); assert(classDef->isResolved()); void* ptr = (void*)((uint64)obj + ptrOffset); ((JavaObject**)ptr)[0] = val; Modified: vmkit/branches/precise/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaConstantPool.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaConstantPool.cpp Wed Nov 10 14:00:39 2010 @@ -190,7 +190,7 @@ if (!ctpRes[entry]) { mvm::ThreadAllocator allocator; - Reader reader(&(classDef->bytes), ctpDef[entry]); + Reader reader(classDef->bytes, ctpDef[entry]); uint32 len = reader.readU2(); uint16* buf = (uint16*)allocator.Allocate(len * sizeof(uint16)); uint32 n = 0; 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp Wed Nov 10 14:00:39 2010 @@ -360,9 +360,10 @@ *oldLocalReferencesNumber = th->currentAddedReferences; th->currentAddedReferences = localReferencesNumber; - th->startKnownFrame(*Frame); - - th->startJNI(1); + th->startJNI(); + th->startUnknownFrame(*Frame); + th->enterUncooperativeCode(); + assert(th->getLastSP() == th->lastKnownFrame->currentFP); return Frame->currentFP; } 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp Wed Nov 10 14:00:39 2010 @@ -62,9 +62,16 @@ th->internalThrowException(); } -void JavaThread::startJNI(int level) { - // Start uncooperative mode. - enterUncooperativeCode(level); +void JavaThread::startJNI() { + // Interesting, but no need to do anything. +} + +void JavaThread::endJNI() { + localJNIRefs->removeJNIReferences(this, *currentAddedReferences); + endUnknownFrame(); + + // Go back to cooperative mode. + leaveUncooperativeCode(); } uint32 JavaThread::getJavaFrameContext(void** buffer) { 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaThread.h Wed Nov 10 14:00:39 2010 @@ -186,16 +186,9 @@ /// startJNI - Record that we are entering native code. /// - void startJNI(int level) __attribute__ ((noinline)); + void startJNI(); - void endJNI() { - localJNIRefs->removeJNIReferences(this, *currentAddedReferences); - - // Go back to cooperative mode. - leaveUncooperativeCode(); - - endKnownFrame(); - } + void endJNI(); /// getCallingMethod - Get the Java method in the stack at the specified /// level. 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp Wed Nov 10 14:00:39 2010 @@ -811,19 +811,18 @@ } -char* findInformation(Jnjvm* vm, ArrayUInt8* manifest, const char* entry, - uint32 len) { - llvm_gcroot(manifest, 0); - sint32 index = sys_strnstr((char*)ArrayUInt8::getElements(manifest), entry); +static char* findInformation(Jnjvm* vm, ClassBytes* manifest, const char* entry, + uint32 len) { + sint32 index = sys_strnstr((char*)manifest->elements, entry); if (index != -1) { index += len; - sint32 end = sys_strnstr((char*)ArrayUInt8::getElements(manifest) + index, "\n"); - if (end == -1) end = ArrayUInt8::getSize(manifest); + sint32 end = sys_strnstr((char*)manifest->elements + index, "\n"); + if (end == -1) end = manifest->size; else end += index; sint32 length = end - index - 1; char* name = (char*)vm->allocator.Allocate(length + 1, "class name"); - memcpy(name, ArrayUInt8::getElements(manifest) + index, length); + memcpy(name, manifest->elements + index, length); name[length] = 0; return name; } else { @@ -833,10 +832,8 @@ void ClArgumentsInfo::extractClassFromJar(Jnjvm* vm, int argc, char** argv, int i) { - ArrayUInt8* bytes = NULL; - ArrayUInt8* res = NULL; - llvm_gcroot(bytes, 0); - llvm_gcroot(res, 0); + ClassBytes* bytes = NULL; + ClassBytes* res = NULL; jarFile = argv[i]; vm->setClasspath(jarFile); @@ -851,13 +848,10 @@ mvm::BumpPtrAllocator allocator; ZipArchive* archive = new(allocator, "TempZipArchive") ZipArchive(bytes, allocator); - // Make sure it gets GC'd. - vm->bootstrapLoader->bootArchives.push_back(archive); if (archive->getOfscd() != -1) { ZipFile* file = archive->getFile(PATH_MANIFEST); if (file != NULL) { - UserClassArray* array = vm->bootstrapLoader->upcalls->ArrayOfByte; - res = (ArrayUInt8*)array->doNew(file->ucsize, vm); + res = new (allocator, file->ucsize) ClassBytes(file->ucsize); int ok = archive->readFile(res, file); if (ok) { char* mainClass = findInformation(vm, res, MAIN_CLASS, @@ -880,8 +874,6 @@ } else { printf("Can't find archive %s\n", jarFile); } - // We don't need this archive anymore. - vm->bootstrapLoader->bootArchives.pop_back(); } void ClArgumentsInfo::nyi() { 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.cpp Wed Nov 10 14:00:39 2010 @@ -308,9 +308,8 @@ TheCompiler = Comp; } -ArrayUInt8* JnjvmBootstrapLoader::openName(const UTF8* utf8) { - ArrayUInt8* res = 0; - llvm_gcroot(res, 0); +ClassBytes* JnjvmBootstrapLoader::openName(const UTF8* utf8) { + ClassBytes* res = 0; mvm::ThreadAllocator threadAllocator; char* asciiz = (char*)threadAllocator.Allocate(utf8->size + 1); @@ -348,8 +347,7 @@ UserClass* JnjvmBootstrapLoader::internalLoad(const UTF8* name, bool doResolve, JavaString* strName) { - ArrayUInt8* bytes = NULL; - llvm_gcroot(bytes, 0); + ClassBytes* bytes = NULL; llvm_gcroot(strName, 0); UserCommonClass* cl = lookupClass(name); @@ -667,9 +665,8 @@ } UserClass* JnjvmClassLoader::constructClass(const UTF8* name, - ArrayUInt8* bytes) { + ClassBytes* bytes) { JavaObject* excp = NULL; - llvm_gcroot(bytes, 0); llvm_gcroot(excp, 0); UserClass* res = NULL; lock.lock(); @@ -688,6 +685,8 @@ getCompiler()->resolveVirtualClass(res); getCompiler()->resolveStaticClass(res); classes->lock.lock(); + assert(res->getDelegatee() == NULL); + assert(res->getStaticInstance() == NULL); bool success = classes->map.insert(std::make_pair(internalName, res)).second; classes->lock.unlock(); assert(success && "Could not add class in map"); @@ -967,8 +966,7 @@ } void JnjvmBootstrapLoader::analyseClasspathEnv(const char* str) { - ArrayUInt8* bytes = NULL; - llvm_gcroot(bytes, 0); + ClassBytes* bytes = NULL; mvm::ThreadAllocator threadAllocator; if (str != 0) { unsigned int len = strlen(str); 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JnjvmClassLoader.h Wed Nov 10 14:00:39 2010 @@ -26,9 +26,9 @@ namespace j3 { -class ArrayUInt8; class UserClass; class UserClassArray; +class ClassBytes; class ClassMap; class Classpath; class UserCommonClass; @@ -209,7 +209,7 @@ /// constructClass - Hashes a runtime representation of a class with /// the given name. /// - UserClass* constructClass(const UTF8* name, ArrayUInt8* bytes); + UserClass* constructClass(const UTF8* name, ClassBytes* bytes); /// constructType - Hashes a Typedef, an internal representation of a class /// still not loaded. @@ -326,7 +326,7 @@ /// openName - Opens a file of the given name and returns it as an array /// of byte. /// - ArrayUInt8* openName(const UTF8* utf8); + ClassBytes* openName(const UTF8* utf8); public: Modified: vmkit/branches/precise/lib/J3/VMCore/Reader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Reader.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Reader.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Reader.cpp Wed Nov 10 14:00:39 2010 @@ -12,10 +12,7 @@ #include "types.h" -#include "Jnjvm.h" -#include "JavaArray.h" -#include "JavaThread.h" -#include "JavaUpcalls.h" +#include "JnjvmClassLoader.h" #include "Reader.h" #include "Zip.h" @@ -25,17 +22,15 @@ const int Reader::SeekCur = SEEK_CUR; const int Reader::SeekEnd = SEEK_END; -ArrayUInt8* Reader::openFile(JnjvmBootstrapLoader* loader, const char* path) { - ArrayUInt8* res = NULL; - llvm_gcroot(res, 0); +ClassBytes* Reader::openFile(JnjvmClassLoader* loader, const char* path) { + ClassBytes* res = NULL; FILE* fp = fopen(path, "r"); if (fp != 0) { fseek(fp, 0, SeekEnd); long nbb = ftell(fp); fseek(fp, 0, SeekSet); - UserClassArray* array = loader->upcalls->ArrayOfByte; - res = (ArrayUInt8*)array->doNew((sint32)nbb, JavaThread::get()->getJVM()); - if (fread(ArrayUInt8::getElements(res), nbb, 1, fp) == 0) { + res = new (loader->allocator, nbb) ClassBytes(nbb); + if (fread(res->elements, nbb, 1, fp) == 0) { fprintf(stderr, "fread error\n"); abort(); } @@ -44,14 +39,12 @@ return res; } -ArrayUInt8* Reader::openZip(JnjvmBootstrapLoader* loader, ZipArchive* archive, +ClassBytes* Reader::openZip(JnjvmClassLoader* loader, ZipArchive* archive, const char* filename) { - ArrayUInt8* res = 0; - llvm_gcroot(res, 0); + ClassBytes* res = 0; ZipFile* file = archive->getFile(filename); if (file != 0) { - UserClassArray* array = loader->upcalls->ArrayOfByte; - res = (ArrayUInt8*)array->doNew((sint32)file->ucsize, JavaThread::get()->getJVM()); + res = new (loader->allocator, file->ucsize) ClassBytes(file->ucsize); if (archive->readFile(res, file) != 0) { return res; } Modified: vmkit/branches/precise/lib/J3/VMCore/Reader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Reader.h?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Reader.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/Reader.h Wed Nov 10 14:00:39 2010 @@ -20,18 +20,35 @@ namespace j3 { class JnjvmBootstrapLoader; +class JnjvmClassLoader; class ZipArchive; + +class ClassBytes { + public: + ClassBytes(int l) { + size = l; + } + + void* operator new(size_t sz, mvm::BumpPtrAllocator& allocator, int n) { + return allocator.Allocate(sizeof(uint32_t) + n * sizeof(uint8_t), + "Class bytes"); + } + + uint32_t size; + uint8_t elements[1]; +}; + class Reader { public: // bytes - Pointer to a reference array. The array is not manipulated directly // in order to support copying GC. - ArrayUInt8** bytes; + ClassBytes* bytes; uint32 min; uint32 cursor; uint32 max; - Reader(Attribut* attr, ArrayUInt8** bytes) { + Reader(Attribut* attr, ClassBytes* bytes) { this->bytes = bytes; this->cursor = attr->start; this->min = attr->start; @@ -78,18 +95,18 @@ static const int SeekCur; static const int SeekEnd; - static ArrayUInt8* openFile(JnjvmBootstrapLoader* loader, const char* path); - static ArrayUInt8* openZip(JnjvmBootstrapLoader* loader, ZipArchive* archive, + static ClassBytes* openFile(JnjvmClassLoader* loader, const char* path); + static ClassBytes* openZip(JnjvmClassLoader* loader, ZipArchive* archive, const char* filename); uint8 readU1() { ++cursor; - return ArrayUInt8::getElement(*bytes, cursor - 1); + return bytes->elements[cursor - 1]; } sint8 readS1() { ++cursor; - return ArrayUInt8::getElement(*bytes, cursor - 1); + return bytes->elements[cursor - 1]; } uint16 readU2() { @@ -122,8 +139,8 @@ return tmp | ((sint64)(readU4())); } - Reader(ArrayUInt8** array, uint32 start = 0, uint32 end = 0) { - if (!end) end = ArrayUInt8::getSize(*array); + Reader(ClassBytes* array, uint32 start = 0, uint32 end = 0) { + if (!end) end = array->size; this->bytes = array; this->cursor = start; this->min = start; 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Wed Nov 10 14:00:39 2010 @@ -142,8 +142,7 @@ // (2) The delegatee object (java.lang.Class) if it exists. // // Additionaly, non-primitive and non-array classes must trace: -// (3) The bytes that represent the class file. -// (4) The static instance. +// (3) The static instance. //===----------------------------------------------------------------------===// void CommonClass::tracer(uintptr_t closure) { @@ -174,7 +173,6 @@ void Class::tracer(uintptr_t closure) { CommonClass::tracer(closure); - mvm::Collector::markAndTraceRoot(&bytes, closure); for (uint32 i = 0; i < NR_ISOLATES; ++i) { TaskClassMirror &M = IsolateInfo[i]; @@ -243,11 +241,6 @@ TRACE_DELEGATEE(upcalls->OfLong); TRACE_DELEGATEE(upcalls->OfDouble); #undef TRACE_DELEGATEE - - for (std::vector::iterator i = bootArchives.begin(), - e = bootArchives.end(); i != e; i++) { - mvm::Collector::markAndTraceRoot(&((*i)->bytes), closure); - } } //===----------------------------------------------------------------------===// Modified: vmkit/branches/precise/lib/J3/VMCore/Zip.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Zip.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Zip.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Zip.cpp Wed Nov 10 14:00:39 2010 @@ -17,8 +17,7 @@ using namespace j3; -ZipArchive::ZipArchive(ArrayUInt8* bytes, mvm::BumpPtrAllocator& A) : allocator(A) { - llvm_gcroot(bytes, 0); +ZipArchive::ZipArchive(ClassBytes* bytes, mvm::BumpPtrAllocator& A) : allocator(A) { this->bytes = bytes; findOfscd(); if (ofscd > -1) addFiles(); @@ -74,7 +73,7 @@ sint32 minOffs = 0; sint32 st = END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4; - Reader reader(&bytes); + Reader reader(bytes); curOffs = reader.max; if (curOffs >= (65535 + END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4)) { minOffs = curOffs - (65535 + END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4); @@ -104,8 +103,8 @@ if (searchPos >= st) { sint32 searchPtr = temp + (searchPos - st); while (searchPtr > temp) { - if (ArrayUInt8::getElement(bytes, searchPtr) == 'P' && - !(memcmp(ArrayUInt8::getElements(bytes) + searchPtr, HDR_ENDCENTRAL, 4))) { + if (bytes->elements[searchPtr] == 'P' && + !(memcmp(bytes->elements + searchPtr, HDR_ENDCENTRAL, 4))) { sint32 offset = searchPtr + 4 + E_OFFSET_START_CENTRAL_DIRECTORY; reader.cursor = offset; this->ofscd = readEndianDep4(reader); @@ -120,11 +119,11 @@ void ZipArchive::addFiles() { sint32 temp = ofscd; - Reader reader(&bytes); + Reader reader(bytes); reader.cursor = temp; while (true) { - if (memcmp(ArrayUInt8::getElements(bytes) + temp, HDR_CENTRAL, 4)) return; + if (memcmp(bytes->elements + temp, HDR_CENTRAL, 4)) return; ZipFile* ptr = new(allocator, "ZipFile") ZipFile(); reader.cursor = temp + 4 + C_COMPRESSION_METHOD; ptr->compressionMethod = readEndianDep2(reader); @@ -148,7 +147,7 @@ ptr->filename = (char*)allocator.Allocate(ptr->filenameLength + 1, "Zip file name"); - memcpy(ptr->filename, ArrayUInt8::getElements(bytes) + temp, + memcpy(ptr->filename, bytes->elements + temp, ptr->filenameLength); ptr->filename[ptr->filenameLength] = 0; @@ -161,17 +160,16 @@ } } -sint32 ZipArchive::readFile(ArrayUInt8* array, const ZipFile* file) { - llvm_gcroot(array, 0); +sint32 ZipArchive::readFile(ClassBytes* array, const ZipFile* file) { uint32 bytesLeft = 0; uint32 filenameLength = 0; uint32 extraFieldLength = 0; uint32 temp = 0; - Reader reader(&bytes); + Reader reader(bytes); reader.cursor = file->rolh; - if (!(memcmp(ArrayUInt8::getElements(bytes) + file->rolh, HDR_LOCAL, 4))) { + if (!(memcmp(bytes->elements + file->rolh, HDR_LOCAL, 4))) { reader.cursor += 4; temp = reader.cursor; reader.cursor += L_FILENAME_LENGTH; @@ -182,14 +180,14 @@ temp + extraFieldLength + filenameLength + LOCAL_FILE_HEADER_SIZE; if (file->compressionMethod == ZIP_STORE) { - memcpy(ArrayUInt8::getElements(array), ArrayUInt8::getElements(bytes) + reader.cursor, file->ucsize); + memcpy(array->elements, bytes->elements + reader.cursor, file->ucsize); return 1; } else if (file->compressionMethod == ZIP_DEFLATE) { z_stream stre; sint32 err = 0; bytesLeft = file->csize; - stre.next_out = (Bytef*)ArrayUInt8::getElements(array); + stre.next_out = (Bytef*)array->elements; stre.avail_out = file->ucsize; stre.zalloc = 0; stre.zfree = 0; @@ -202,7 +200,7 @@ while (bytesLeft) { uint32 size = 0; - stre.next_in = ArrayUInt8::getElements(bytes) + reader.cursor; + stre.next_in = bytes->elements + reader.cursor; if (bytesLeft > 1024) size = 1024; else size = bytesLeft; Modified: vmkit/branches/precise/lib/J3/VMCore/Zip.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/Zip.h?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Zip.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/Zip.h Wed Nov 10 14:00:39 2010 @@ -16,7 +16,7 @@ namespace j3 { -class ArrayUInt8; +class classBytes; class JnjvmBootstrapLoader; struct ZipFile : public mvm::PermanentObject { @@ -49,7 +49,7 @@ public: std::map filetable; typedef std::map::iterator table_iterator; - ArrayUInt8* bytes; + ClassBytes* bytes; private: @@ -70,9 +70,9 @@ } int getOfscd() { return ofscd; } - ZipArchive(ArrayUInt8* bytes, mvm::BumpPtrAllocator& allocator); + ZipArchive(ClassBytes* bytes, mvm::BumpPtrAllocator& allocator); ZipFile* getFile(const char* filename); - int readFile(ArrayUInt8* array, const ZipFile* file); + int readFile(ClassBytes* array, const ZipFile* file); }; Modified: vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp Wed Nov 10 14:00:39 2010 @@ -154,7 +154,7 @@ th->inRV = false; } -void CooperativeCollectionRV::joinAfterUncooperative() { +void CooperativeCollectionRV::joinAfterUncooperative(void* SP) { mvm::Thread* th = mvm::Thread::get(); assert((th->getLastSP() == NULL) && "SP set after entering uncooperative code"); @@ -163,7 +163,7 @@ lockRV(); if (th->doYield) { - th->setLastSP(FRAME_PTR()); + th->setLastSP(SP); if (!th->joinedRV) { th->joinedRV = true; another_mark(); @@ -213,7 +213,7 @@ initiator->inRV = false; } -void UncooperativeCollectionRV::joinAfterUncooperative() { +void UncooperativeCollectionRV::joinAfterUncooperative(void* SP) { UNREACHABLE(); } 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp Wed Nov 10 14:00:39 2010 @@ -56,8 +56,8 @@ MyVM->rendezvous.joinBeforeUncooperative(); } -void Thread::joinRVAfterLeave() { - MyVM->rendezvous.joinAfterUncooperative(); +void Thread::joinRVAfterLeave(void* savedSP) { + MyVM->rendezvous.joinAfterUncooperative(savedSP); } void Thread::startKnownFrame(KnownFrame& F) { @@ -67,10 +67,29 @@ cur = (void**)cur[0]; F.previousFrame = lastKnownFrame; F.currentFP = cur; + // This is used as a marker. + F.currentIP = NULL; lastKnownFrame = &F; } void Thread::endKnownFrame() { + assert(lastKnownFrame->currentIP == NULL); + lastKnownFrame = lastKnownFrame->previousFrame; +} + +void Thread::startUnknownFrame(KnownFrame& F) { + // Get the caller of this function + void** cur = (void**)FRAME_PTR(); + // Get the caller of the caller. + cur = (void**)cur[0]; + F.previousFrame = lastKnownFrame; + F.currentFP = cur; + F.currentIP = FRAME_IP(cur); + lastKnownFrame = &F; +} + +void Thread::endUnknownFrame() { + assert(lastKnownFrame->currentIP != NULL); lastKnownFrame = lastKnownFrame->previousFrame; } @@ -155,23 +174,40 @@ } void StackWalker::operator++() { - if (addr < thread->baseSP && addr < addr[0]) { - if (frame && addr == frame->currentFP) { + if (addr != thread->baseSP) { + assert((addr < thread->baseSP) && "Corrupted stack"); + assert((addr < addr[0]) && "Corrupted stack"); + if ((frame != NULL) && (addr == frame->currentFP)) { + assert(frame->currentIP == NULL); + frame = frame->previousFrame; + assert(frame != NULL); + assert(frame->currentIP != NULL); + addr = (void**)frame->currentFP; frame = frame->previousFrame; - if (frame) { - addr = (void**)frame->currentFP; - frame = frame->previousFrame; - } else { - addr = (void**)addr[0]; - } } else { addr = (void**)addr[0]; } - } else { - addr = (void**)thread->baseSP; } } +StackWalker::StackWalker(mvm::Thread* th) { + thread = th; + frame = th->lastKnownFrame; + if (mvm::Thread::get() == th) { + addr = (void**)FRAME_PTR(); + addr = (void**)addr[0]; + } else { + addr = (void**)th->waitOnSP(); + if (frame) { + assert(frame->currentFP >= addr); + } + if (frame && (addr == frame->currentFP)) { + frame = frame->previousFrame; + assert((frame == NULL) || (frame->currentIP == NULL)); + } + } + assert(addr && "No address to start with"); +} uintptr_t Thread::baseAddr = 0; @@ -286,7 +322,7 @@ /// given routine of th. /// void Thread::internalThreadStart(mvm::Thread* th) { - th->baseSP = (void*)&th; + th->baseSP = FRAME_PTR(); // Set the SIGSEGV handler to diagnose errors. struct sigaction sa; @@ -368,7 +404,6 @@ #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; @@ -390,3 +425,64 @@ } } #endif + +void Thread::enterUncooperativeCode(unsigned level) { + if (isMvmThread()) { + if (!inRV) { + assert(!lastSP && "SP already set when entering uncooperative code"); + // Get the caller. + void* temp = FRAME_PTR(); + // Make sure to at least get the caller of the caller. + ++level; + while (level--) temp = ((void**)temp)[0]; + // The cas is not necessary, but it does a memory barrier. + __sync_bool_compare_and_swap(&lastSP, 0, temp); + if (doYield) joinRVBeforeEnter(); + assert(lastSP && "No last SP when entering uncooperative code"); + } + } +} + +void Thread::enterUncooperativeCode(void* SP) { + if (isMvmThread()) { + if (!inRV) { + assert(!lastSP && "SP already set when entering uncooperative code"); + // The cas is not necessary, but it does a memory barrier. + __sync_bool_compare_and_swap(&lastSP, 0, SP); + if (doYield) joinRVBeforeEnter(); + assert(lastSP && "No last SP when entering uncooperative code"); + } + } +} + +void Thread::leaveUncooperativeCode() { + if (isMvmThread()) { + if (!inRV) { + assert(lastSP && "No last SP when leaving uncooperative code"); + void* savedSP = lastSP; + // The cas is not necessary, but it does a memory barrier. + __sync_bool_compare_and_swap(&lastSP, lastSP, 0); + // A rendezvous has just been initiated, join it. + if (doYield) joinRVAfterLeave(savedSP); + assert(!lastSP && "SP has a value after leaving uncooperative code"); + } + } +} + +void* Thread::waitOnSP() { + // First see if we can get lastSP directly. + void* sp = lastSP; + if (sp) return sp; + + // Then loop a fixed number of iterations to get lastSP. + for (uint32 count = 0; count < 1000; ++count) { + sp = lastSP; + if (sp) return sp; + } + + // Finally, yield until lastSP is not set. + while ((sp = lastSP) == NULL) mvm::Thread::yield(); + + assert(sp != NULL && "Still no sp"); + return sp; +} 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=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp Wed Nov 10 14:00:39 2010 @@ -85,7 +85,7 @@ } void MvmJITMethodInfo::print(void* ip, void* addr) { - fprintf(stderr, "; %p in %s LLVM method\n", ip, + fprintf(stderr, "; %p (%p) in %s LLVM method\n", ip, addr, ((llvm::Function*)MetaInfo)->getName().data()); } @@ -200,7 +200,8 @@ "ILorg_vmmagic_unboxed_ObjectReference_2"; if (dlsym(SELF_HANDLE, MMTkSymbol)) { // If we have found MMTk, read the gcmalloc function. - mvm::mmtk_runtime::makeLLVMFunction(module); + // TODO: re-enable this. + //mvm::mmtk_runtime::makeLLVMFunction(module); } #endif mvm::llvm_runtime::makeLLVMModuleContents(module); Modified: vmkit/branches/precise/lib/Mvm/Compiler/VmkitGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/Compiler/VmkitGC.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Compiler/VmkitGC.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Compiler/VmkitGC.cpp Wed Nov 10 14:00:39 2010 @@ -32,5 +32,4 @@ VmkitGC::VmkitGC() { NeededSafePoints = 1 << GC::PostCall; - mvm::MvmModule::TheGCStrategy = this; } Modified: vmkit/branches/precise/lib/Mvm/MMTk/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/MMTk/MutatorThread.h?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/MMTk/MutatorThread.h (original) +++ vmkit/branches/precise/lib/Mvm/MMTk/MutatorThread.h Wed Nov 10 14:00:39 2010 @@ -21,7 +21,7 @@ MutatorThread() : mvm::Thread() { MutatorContext = 0; } - mvm::BumpPtrAllocator Allocator; + mvm::ThreadAllocator Allocator; uintptr_t MutatorContext; /// realRoutine - The function to invoke when the thread starts. Modified: vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc (original) +++ vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc Wed Nov 10 14:00:39 2010 @@ -62,12 +62,12 @@ 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_gcRoot_fields; -StructTy_struct_gcRoot_fields.push_back(PointerTy_5); -StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); -mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); +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_gcRoot, 0); +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; @@ -102,60 +102,9 @@ 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; -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__CooperativeCollectionRV_fields; +std::vectorStructTy_struct_mvm__CollectionRV_fields; +StructTy_struct_mvm__CollectionRV_fields.push_back(PointerTy_5); std::vectorStructTy_struct_mvm__LockNormal_fields; std::vectorStructTy_struct_mvm__Lock_fields; StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5); @@ -183,26 +132,43 @@ 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__CollectionRV_fields; StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__LockNormal); +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_14 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1); + +StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_14); +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__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)); -StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 8)); -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__VirtualMachine_fields.push_back(StructTy_struct_mvm__CollectionRV); -std::vectorStructTy_struct_mvm__StartEndFunctionMap_fields; +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__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; @@ -216,11 +182,11 @@ 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); +PointerType* PointerTy_15 = 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); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); 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); @@ -245,12 +211,7 @@ 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); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__FunctionMap); 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); @@ -263,41 +224,41 @@ 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( +std::vectorFuncTy_17_args; +FuncTy_17_args.push_back(PointerTy_13); +FunctionType* FuncTy_17 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_19_args, + /*Params=*/FuncTy_17_args, /*isVarArg=*/false); -PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); +PointerType* PointerTy_16 = PointerType::get(FuncTy_17, 0); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_16); std::vectorStructTy_struct_mvm__KnownFrame_fields; -PATypeHolder PointerTy_20_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_20_fwd); +PATypeHolder PointerTy_18_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_18_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()); +PointerType* PointerTy_18 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0); +cast(PointerTy_18_fwd.get())->refineAbstractTypeTo(PointerTy_18); +PointerTy_18 = cast(PointerTy_18_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; -PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd); +PATypeHolder PointerTy_19_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_19_fwd); std::vectorStructTy_struct___jmp_buf_tag_fields; -ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); +ArrayType* ArrayTy_21 = 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(ArrayTy_21); 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); +ArrayType* ArrayTy_22 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); -StructTy_struct___sigset_t_fields.push_back(ArrayTy_24); +StructTy_struct___sigset_t_fields.push_back(ArrayTy_22); 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); @@ -305,18 +266,18 @@ 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); +ArrayType* ArrayTy_20 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_20); 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()); +PointerType* PointerTy_19 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); +cast(PointerTy_19_fwd.get())->refineAbstractTypeTo(PointerTy_19); +PointerTy_19 = cast(PointerTy_19_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_19); 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); @@ -324,55 +285,150 @@ StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread); -StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator); +std::vectorStructTy_struct_mvm__ThreadAllocator_fields; +StructTy_struct_mvm__ThreadAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator); +StructType* StructTy_struct_mvm__ThreadAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__ThreadAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ThreadAllocator", StructTy_struct_mvm__ThreadAllocator); + +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__ThreadAllocator); StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_16); 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); +PointerType* PointerTy_23 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); std::vectorStructTy_struct_j3__JavaObject_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); + StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_gc); -StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_mvm__SpinLock); 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); +PointerType* PointerTy_24 = 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_29 = PointerType::get(ArrayTy_VT, 0); +PointerType* PointerTy_27 = PointerType::get(ArrayTy_VT, 0); -StructTy_JavaObject_fields.push_back(PointerTy_29); +StructTy_JavaObject_fields.push_back(PointerTy_27); 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_28 = PointerType::get(StructTy_JavaObject, 0); +PointerType* PointerTy_26 = PointerType::get(StructTy_JavaObject, 0); + +PointerType* PointerTy_25 = PointerType::get(PointerTy_26, 0); + +std::vectorStructTy_struct__IO_FILE_fields; +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +std::vectorStructTy_struct__IO_marker_fields; +PATypeHolder PointerTy_29_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct__IO_marker_fields.push_back(PointerTy_29_fwd); +PATypeHolder PointerTy_28_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct__IO_marker_fields.push_back(PointerTy_28_fwd); +StructTy_struct__IO_marker_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructType* StructTy_struct__IO_marker = StructType::get(mod->getContext(), StructTy_struct__IO_marker_fields, /*isPacked=*/false); +mod->addTypeName("struct._IO_marker", StructTy_struct__IO_marker); + +PointerType* PointerTy_29 = PointerType::get(StructTy_struct__IO_marker, 0); +cast(PointerTy_29_fwd.get())->refineAbstractTypeTo(PointerTy_29); +PointerTy_29 = cast(PointerTy_29_fwd.get()); + + +StructTy_struct__IO_FILE_fields.push_back(PointerTy_29); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_28_fwd); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 16)); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 8)); +ArrayType* ArrayTy_30 = ArrayType::get(IntegerType::get(mod->getContext(), 8), 1); + +StructTy_struct__IO_FILE_fields.push_back(ArrayTy_30); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 64)); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); +ArrayType* ArrayTy_31 = ArrayType::get(IntegerType::get(mod->getContext(), 8), 40); + +StructTy_struct__IO_FILE_fields.push_back(ArrayTy_31); +StructType* StructTy_struct__IO_FILE = StructType::get(mod->getContext(), StructTy_struct__IO_FILE_fields, /*isPacked=*/false); +mod->addTypeName("struct._IO_FILE", StructTy_struct__IO_FILE); + +PointerType* PointerTy_28 = PointerType::get(StructTy_struct__IO_FILE, 0); +cast(PointerTy_28_fwd.get())->refineAbstractTypeTo(PointerTy_28); +PointerTy_28 = cast(PointerTy_28_fwd.get()); + + +PointerType* PointerTy_32 = PointerType::get(PointerTy_28, 0); + +ArrayType* ArrayTy_34 = ArrayType::get(IntegerType::get(mod->getContext(), 8), 7); + +PointerType* PointerTy_33 = PointerType::get(ArrayTy_34, 0); + +std::vectorFuncTy_36_args; +FuncTy_36_args.push_back(PointerTy_28); +FuncTy_36_args.push_back(PointerTy_0); +FunctionType* FuncTy_36 = FunctionType::get( + /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Params=*/FuncTy_36_args, + /*isVarArg=*/true); + +PointerType* PointerTy_35 = PointerType::get(FuncTy_36, 0); -PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); +std::vectorFuncTy_38_args; +FunctionType* FuncTy_38 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_38_args, + /*isVarArg=*/false); + +PointerType* PointerTy_37 = PointerType::get(FuncTy_38, 0); -PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); +PointerType* PointerTy_39 = PointerType::get(PointerTy_0, 0); -PointerType* PointerTy_31 = PointerType::get(PointerTy_29, 0); +PointerType* PointerTy_40 = PointerType::get(PointerTy_27, 0); -std::vectorFuncTy_33_args; -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_33 = FunctionType::get( - /*Result=*/PointerTy_28, - /*Params=*/FuncTy_33_args, +std::vectorFuncTy_42_args; +FuncTy_42_args.push_back(PointerTy_26); +FuncTy_42_args.push_back(PointerTy_26); +FuncTy_42_args.push_back(PointerTy_26); +FuncTy_42_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_42_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_42 = FunctionType::get( + /*Result=*/PointerTy_26, + /*Params=*/FuncTy_42_args, /*isVarArg=*/false); -PointerType* PointerTy_32 = PointerType::get(FuncTy_33, 0); +PointerType* PointerTy_41 = PointerType::get(FuncTy_42, 0); // Function Declarations @@ -393,11 +449,56 @@ } func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); +Function* func__ZN3mvm6Thread14printBacktraceEv = Function::Create( + /*Type=*/FuncTy_17, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"_ZN3mvm6Thread14printBacktraceEv", mod); // (external, no body) +func__ZN3mvm6Thread14printBacktraceEv->setCallingConv(CallingConv::C); +AttrListPtr func__ZN3mvm6Thread14printBacktraceEv_PAL; +func__ZN3mvm6Thread14printBacktraceEv->setAttributes(func__ZN3mvm6Thread14printBacktraceEv_PAL); + +Function* func_fprintf = Function::Create( + /*Type=*/FuncTy_36, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"fprintf", mod); // (external, no body) +func_fprintf->setCallingConv(CallingConv::C); +AttrListPtr func_fprintf_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoAlias | Attribute::NoCapture; + Attrs.push_back(PAWI); + PAWI.Index = 2U; PAWI.Attrs = 0 | Attribute::NoAlias | Attribute::NoCapture; + Attrs.push_back(PAWI); + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_fprintf_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_fprintf->setAttributes(func_fprintf_PAL); + +Function* func_abort = Function::Create( + /*Type=*/FuncTy_38, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"abort", mod); // (external, no body) +func_abort->setCallingConv(CallingConv::C); +AttrListPtr func_abort_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_abort->setAttributes(func_abort_PAL); + Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( - /*Type=*/FuncTy_33, + /*Type=*/FuncTy_42, /*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); +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; { SmallVector Attrs; @@ -411,14 +512,46 @@ // Global Variable Declarations +GlobalVariable* gvar_ptr_stderr = new GlobalVariable(/*Module=*/*mod, +/*Type=*/PointerTy_28, +/*isConstant=*/false, +/*Linkage=*/GlobalValue::ExternalLinkage, +/*Initializer=*/0, +/*Name=*/"stderr"); + +GlobalVariable* gvar_array__str14 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/ArrayTy_34, +/*isConstant=*/true, +/*Linkage=*/GlobalValue::PrivateLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/".str14"); +gvar_array__str14->setAlignment(1); + +GlobalVariable* gvar_array__str1246 = new GlobalVariable(/*Module=*/*mod, +/*Type=*/ArrayTy_34, +/*isConstant=*/true, +/*Linkage=*/GlobalValue::PrivateLinkage, +/*Initializer=*/0, // has initializer, specified below +/*Name=*/".str1246"); +gvar_array__str1246->setAlignment(1); + // Constant Definitions -ConstantInt* const_int32_34 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -ConstantInt* const_int32_35 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); -ConstantInt* const_int32_36 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); -ConstantInt* const_int32_37 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); -ConstantInt* const_int32_38 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); -ConstantInt* const_int32_39 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); -ConstantInt* const_int32_40 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantInt* const_int32_43 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_44 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_45 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_46 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_47 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantInt* const_int32_48 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +std::vector const_ptr_49_indices; +const_ptr_49_indices.push_back(const_int32_43); +const_ptr_49_indices.push_back(const_int32_43); +Constant* const_ptr_49 = ConstantExpr::getGetElementPtr(gvar_array__str14, &const_ptr_49_indices[0], const_ptr_49_indices.size()); +std::vector const_ptr_50_indices; +const_ptr_50_indices.push_back(const_int32_43); +const_ptr_50_indices.push_back(const_int32_43); +Constant* const_ptr_50 = ConstantExpr::getGetElementPtr(gvar_array__str1246, &const_ptr_50_indices[0], const_ptr_50_indices.size()); +ConstantInt* const_int32_51 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("41"), 10)); +ConstantInt* const_int32_52 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); // Global Variable Definitions @@ -427,6 +560,7 @@ /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"gcmalloc", mod); func_gcmalloc->setCallingConv(CallingConv::C); +func_gcmalloc->setGC("vmkit"); AttrListPtr func_gcmalloc_PAL; { SmallVector Attrs; @@ -443,100 +577,163 @@ Value* ptr_VT = args++; ptr_VT->setName("VT"); -BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",func_gcmalloc,0); +BasicBlock* label_Java_org_j3_runtime_VM__1assert__Z_exit_i = BasicBlock::Create(mod->getContext(), "Java_org_j3_runtime_VM__1assert__Z.exit.i",func_gcmalloc,0); +BasicBlock* label_bb_i1_i = BasicBlock::Create(mod->getContext(), "bb.i1.i",func_gcmalloc,0); +BasicBlock* label_Java_org_j3_runtime_VM__1assert__Z_exit2_i = BasicBlock::Create(mod->getContext(), "Java_org_j3_runtime_VM__1assert__Z.exit2.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 = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i",func_gcmalloc,0); BasicBlock* label_false_IFEQ_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.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_41 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_34, "", label_entry); -BinaryOperator* int32_42 = BinaryOperator::Create(Instruction::And, int32_41, const_int32_35, "", label_entry); -CallInst* ptr_43 = CallInst::Create(func_llvm_frameaddress, const_int32_36, "", label_entry); -ptr_43->setCallingConv(CallingConv::C); -ptr_43->setTailCall(true); -AttrListPtr ptr_43_PAL; +// Block Java_org_j3_runtime_VM__1assert__Z.exit.i (label_Java_org_j3_runtime_VM__1assert__Z_exit_i) +CallInst* ptr_53 = CallInst::Create(func_llvm_frameaddress, const_int32_43, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +ptr_53->setCallingConv(CallingConv::C); +ptr_53->setTailCall(true); +AttrListPtr ptr_53_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_53_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_53->setAttributes(ptr_53_PAL); + +CastInst* int32_54 = new PtrToIntInst(ptr_53, IntegerType::get(mod->getContext(), 32), "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +BinaryOperator* int32_55 = BinaryOperator::Create(Instruction::And, int32_54, const_int32_44, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +CastInst* ptr_56 = new IntToPtrInst(int32_55, PointerTy_4, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +std::vector ptr_57_indices; +ptr_57_indices.push_back(const_int32_43); +ptr_57_indices.push_back(const_int32_45); +Instruction* ptr_57 = GetElementPtrInst::Create(ptr_56, ptr_57_indices.begin(), ptr_57_indices.end(), "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +LoadInst* int32_58 = new LoadInst(ptr_57, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +CastInst* ptr_59 = new IntToPtrInst(int32_58, PointerTy_24, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +GetElementPtrInst* ptr_60 = GetElementPtrInst::Create(ptr_59, const_int32_46, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +CastInst* ptr_61 = new BitCastInst(ptr_60, PointerTy_25, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +LoadInst* ptr_62 = new LoadInst(ptr_61, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +GetElementPtrInst* ptr_63 = GetElementPtrInst::Create(ptr_62, const_int32_47, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +CastInst* ptr_64 = new BitCastInst(ptr_63, PointerTy_25, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +LoadInst* ptr_65 = new LoadInst(ptr_64, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +CastInst* int32_66 = new PtrToIntInst(ptr_65, IntegerType::get(mod->getContext(), 32), "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +BinaryOperator* int32_67 = BinaryOperator::Create(Instruction::And, int32_66, const_int32_48, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +ICmpInst* int1_68 = new ICmpInst(*label_Java_org_j3_runtime_VM__1assert__Z_exit_i, ICmpInst::ICMP_EQ, int32_67, const_int32_43, ""); +BranchInst::Create(label_Java_org_j3_runtime_VM__1assert__Z_exit2_i, label_bb_i1_i, int1_68, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); + +// Block bb.i1.i (label_bb_i1_i) +CastInst* ptr_70 = new IntToPtrInst(int32_55, PointerTy_13, "", label_bb_i1_i); +CallInst* void_71 = CallInst::Create(func__ZN3mvm6Thread14printBacktraceEv, ptr_70, "", label_bb_i1_i); +void_71->setCallingConv(CallingConv::C); +void_71->setTailCall(true); +AttrListPtr void_71_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_71_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_71->setAttributes(void_71_PAL); + +LoadInst* ptr_72 = new LoadInst(gvar_ptr_stderr, "", false, label_bb_i1_i); +std::vector int32_73_params; +int32_73_params.push_back(ptr_72); +int32_73_params.push_back(const_ptr_49); +int32_73_params.push_back(const_ptr_50); +int32_73_params.push_back(const_int32_51); +CallInst* int32_73 = CallInst::Create(func_fprintf, int32_73_params.begin(), int32_73_params.end(), "", label_bb_i1_i); +int32_73->setCallingConv(CallingConv::C); +int32_73->setTailCall(true); +AttrListPtr int32_73_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; + PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoAlias; + Attrs.push_back(PAWI); + PAWI.Index = 2U; PAWI.Attrs = 0 | Attribute::NoAlias; + Attrs.push_back(PAWI); PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_43_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + int32_73_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_43->setAttributes(ptr_43_PAL); +int32_73->setAttributes(int32_73_PAL); + +CallInst* void_74 = CallInst::Create(func_abort, "", label_bb_i1_i); +void_74->setCallingConv(CallingConv::C); +void_74->setTailCall(true); +AttrListPtr void_74_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_74_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_74->setAttributes(void_74_PAL); + +new UnreachableInst(mod->getContext(), label_bb_i1_i); -CastInst* int32_44 = new PtrToIntInst(ptr_43, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_45 = BinaryOperator::Create(Instruction::And, int32_44, const_int32_37, "", label_entry); -CastInst* ptr_46 = new IntToPtrInst(int32_45, PointerTy_4, "", label_entry); -std::vector ptr_47_indices; -ptr_47_indices.push_back(const_int32_36); -ptr_47_indices.push_back(const_int32_38); -Instruction* ptr_47 = GetElementPtrInst::Create(ptr_46, ptr_47_indices.begin(), ptr_47_indices.end(), "", label_entry); -LoadInst* int32_48 = new LoadInst(ptr_47, "", false, label_entry); -CastInst* ptr_49 = new IntToPtrInst(int32_48, PointerTy_26, "", label_entry); -GetElementPtrInst* ptr_50 = GetElementPtrInst::Create(ptr_49, const_int32_39, "", label_entry); -CastInst* ptr_51 = new BitCastInst(ptr_50, PointerTy_27, "", label_entry); -LoadInst* ptr_52 = new LoadInst(ptr_51, "", false, label_entry); -GetElementPtrInst* ptr_53 = GetElementPtrInst::Create(ptr_52, const_int32_40, "", label_entry); -CastInst* ptr_54 = new BitCastInst(ptr_53, PointerTy_27, "", label_entry); -LoadInst* ptr_55 = new LoadInst(ptr_54, "", false, label_entry); -CastInst* int32_56 = new PtrToIntInst(ptr_55, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_57 = BinaryOperator::Create(Instruction::Add, int32_56, int32_42, "", label_entry); -CastInst* ptr_58 = new IntToPtrInst(int32_57, PointerTy_28, "", label_entry); -std::vector ptr_59_indices; -ptr_59_indices.push_back(const_int32_40); -ptr_59_indices.push_back(const_int32_40); -Instruction* ptr_59 = GetElementPtrInst::Create(ptr_52, ptr_59_indices.begin(), ptr_59_indices.end(), "", label_entry); -LoadInst* ptr_60 = new LoadInst(ptr_59, "", false, label_entry); -CastInst* ptr_61 = new BitCastInst(ptr_60, PointerTy_28, "", label_entry); -ICmpInst* int1_62 = new ICmpInst(*label_entry, ICmpInst::ICMP_UGT, ptr_58, ptr_61, ""); -BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_62, label_entry); +// Block Java_org_j3_runtime_VM__1assert__Z.exit2.i (label_Java_org_j3_runtime_VM__1assert__Z_exit2_i) +BinaryOperator* int32_76 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_48, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +BinaryOperator* int32_77 = BinaryOperator::Create(Instruction::And, int32_76, const_int32_52, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +BinaryOperator* int32_78 = BinaryOperator::Create(Instruction::Add, int32_66, int32_77, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +CastInst* ptr_79 = new IntToPtrInst(int32_78, PointerTy_26, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +std::vector ptr_80_indices; +ptr_80_indices.push_back(const_int32_47); +ptr_80_indices.push_back(const_int32_47); +Instruction* ptr_80 = GetElementPtrInst::Create(ptr_62, ptr_80_indices.begin(), ptr_80_indices.end(), "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +LoadInst* ptr_81 = new LoadInst(ptr_80, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +CastInst* ptr_82 = new BitCastInst(ptr_81, PointerTy_26, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +ICmpInst* int1_83 = new ICmpInst(*label_Java_org_j3_runtime_VM__1assert__Z_exit2_i, ICmpInst::ICMP_UGT, ptr_79, ptr_82, ""); +BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_83, label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i) -std::vector ptr_64_indices; -ptr_64_indices.push_back(const_int32_40); -ptr_64_indices.push_back(const_int32_36); -Instruction* ptr_64 = GetElementPtrInst::Create(ptr_52, ptr_64_indices.begin(), ptr_64_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_57, PointerTy_29, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); - new StoreInst(ptr__c_i_i_i, ptr_64, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +std::vector ptr_85_indices; +ptr_85_indices.push_back(const_int32_47); +ptr_85_indices.push_back(const_int32_43); +Instruction* ptr_85 = GetElementPtrInst::Create(ptr_62, ptr_85_indices.begin(), ptr_85_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_78, PointerTy_27, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); + new StoreInst(ptr__c_i_i_i, ptr_85, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); // Block false IFEQ.i.i.i (label_false_IFEQ_i_i_i) -std::vector ptr_67_params; -ptr_67_params.push_back(ptr_52); -ptr_67_params.push_back(ptr_55); -ptr_67_params.push_back(ptr_58); -ptr_67_params.push_back(const_int32_36); -ptr_67_params.push_back(const_int32_36); -CallInst* ptr_67 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_67_params.begin(), ptr_67_params.end(), "", label_false_IFEQ_i_i_i); -ptr_67->setCallingConv(CallingConv::C); -ptr_67->setTailCall(true); -AttrListPtr ptr_67_PAL; +std::vector ptr_88_params; +ptr_88_params.push_back(ptr_62); +ptr_88_params.push_back(ptr_65); +ptr_88_params.push_back(ptr_79); +ptr_88_params.push_back(const_int32_43); +ptr_88_params.push_back(const_int32_43); +CallInst* ptr_88 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_88_params.begin(), ptr_88_params.end(), "", label_false_IFEQ_i_i_i); +ptr_88->setCallingConv(CallingConv::C); +ptr_88->setTailCall(true); +AttrListPtr ptr_88_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_67_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_88_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_67->setAttributes(ptr_67_PAL); +ptr_88->setAttributes(ptr_88_PAL); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFEQ_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_69 = PHINode::Create(PointerTy_28, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -ptr_69->reserveOperandSpace(2); -ptr_69->addIncoming(ptr_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -ptr_69->addIncoming(ptr_67, label_false_IFEQ_i_i_i); - -std::vector ptr_70_indices; -ptr_70_indices.push_back(const_int32_36); -ptr_70_indices.push_back(const_int32_36); -Instruction* ptr_70 = GetElementPtrInst::Create(ptr_69, ptr_70_indices.begin(), ptr_70_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_29, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); - new StoreInst(ptr__c_i, ptr_70, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr_tmp1 = new BitCastInst(ptr_69, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +PHINode* ptr_90 = PHINode::Create(PointerTy_26, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_90->reserveOperandSpace(2); +ptr_90->addIncoming(ptr_65, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +ptr_90->addIncoming(ptr_88, label_false_IFEQ_i_i_i); + +std::vector ptr_91_indices; +ptr_91_indices.push_back(const_int32_43); +ptr_91_indices.push_back(const_int32_43); +Instruction* ptr_91 = GetElementPtrInst::Create(ptr_90, ptr_91_indices.begin(), ptr_91_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_27, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); + new StoreInst(ptr__c_i, ptr_91, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr_tmp1 = new BitCastInst(ptr_90, 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); return func_gcmalloc; } Modified: vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp Wed Nov 10 14:00:39 2010 @@ -51,7 +51,10 @@ extern "C" void* gcmalloc(uint32_t sz, void* VT) { sz = llvm::RoundUpToAlignment(sz, sizeof(void*)); - return JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2(sz, VT); + gc* res = (gc*)JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2(sz, VT); + assert(VT != NULL); + assert(res->getVirtualTable() == VT); + return res; } extern "C" void addFinalizationCandidate(void* obj) __attribute__((always_inline)); @@ -84,14 +87,26 @@ } void Collector::scanObject(void** ptr, uintptr_t closure) { + if ((*ptr) != NULL) { + assert(((gc*)(*ptr))->getVirtualTable()); + } JnJVM_org_j3_bindings_Bindings_reportDelayedRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2(closure, ptr); } void Collector::markAndTrace(void* source, void* ptr, uintptr_t closure) { + void** ptr_ = (void**)ptr; + if ((*ptr_) != NULL) { + assert(((gc*)(*ptr_))->getVirtualTable()); + } + if ((*(void**)ptr) != NULL) assert(((gc*)(*(void**)ptr))->getVirtualTable()); JnJVM_org_j3_bindings_Bindings_processEdge__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2(closure, source, ptr); } void Collector::markAndTraceRoot(void* ptr, uintptr_t closure) { + void** ptr_ = (void**)ptr; + if ((*ptr_) != NULL) { + assert(((gc*)(*ptr_))->getVirtualTable()); + } JnJVM_org_j3_bindings_Bindings_processRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2Z(closure, ptr, true); } @@ -127,7 +142,7 @@ #else uint32 flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED; #endif - void* baseAddr = mmap((void*)0x30000000, 0x40000000, PROT_READ | PROT_WRITE, + void* baseAddr = mmap((void*)0x30000000, 0x30000000, PROT_READ | PROT_WRITE, flags, -1, 0); if (baseAddr == MAP_FAILED) { perror("mmap"); @@ -138,7 +153,7 @@ } extern "C" void* MMTkMutatorAllocate(uint32_t size, VirtualTable* VT) { - void* val = MutatorThread::get()->Allocator.Allocate(size, "MMTk"); + void* val = MutatorThread::get()->Allocator.Allocate(size); ((void**)val)[0] = VT; return val; } Modified: vmkit/branches/precise/mmtk/mmtk-j3/Memory.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/Memory.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/Memory.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/Memory.cpp Wed Nov 10 14:00:39 2010 @@ -22,7 +22,7 @@ } extern "C" uintptr_t Java_org_j3_mmtk_Memory_getHeapEndConstant__ (JavaObject* M) { - return (uintptr_t)0x70000000; + return (uintptr_t)0x60000000; } extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableStartConstant__ (JavaObject* M) { @@ -30,7 +30,7 @@ } extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableEndConstant__ (JavaObject* M) { - return (uintptr_t)0x70000000; + return (uintptr_t)0x60000000; } extern "C" sint32 @@ -41,14 +41,16 @@ return 0; } -extern "C" void +extern "C" uint8_t Java_org_j3_mmtk_Memory_mprotect__Lorg_vmmagic_unboxed_Address_2I (JavaObject* M, uintptr_t address, sint32 size) { - mprotect((void*)address, size, PROT_NONE); + int val = mprotect((void*)address, size, PROT_NONE); + return (val == 0); } -extern "C" void +extern "C" uint8_t Java_org_j3_mmtk_Memory_munprotect__Lorg_vmmagic_unboxed_Address_2I (JavaObject* M, uintptr_t address, sint32 size) { - mprotect((void*)address, size, PROT_READ | PROT_WRITE); + int val = mprotect((void*)address, size, PROT_READ | PROT_WRITE); + return (val == 0); } extern "C" void Modified: vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp?rev=118707&r1=118706&r2=118707&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Wed Nov 10 14:00:39 2010 @@ -58,7 +58,7 @@ } extern "C" bool Java_org_j3_runtime_VM_verifyAssertions__ () { -#ifdef DEBUG +#if 1//def DEBUG return true; #else return false; From nicolas.geoffray at lip6.fr Wed Nov 10 12:02:38 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 10 Nov 2010 20:02:38 -0000 Subject: [vmkit-commits] [vmkit] r118708 - /vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Message-ID: <20101110200238.464482A6C12C@llvm.org> Author: geoffray Date: Wed Nov 10 14:02:38 2010 New Revision: 118708 URL: http://llvm.org/viewvc/llvm-project?rev=118708&view=rev Log: Remove unintended change. Modified: vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Modified: vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp?rev=118708&r1=118707&r2=118708&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Wed Nov 10 14:02:38 2010 @@ -58,7 +58,7 @@ } extern "C" bool Java_org_j3_runtime_VM_verifyAssertions__ () { -#if 1//def DEBUG +#ifdef DEBUG return true; #else return false; From nicolas.geoffray at lip6.fr Wed Nov 10 23:29:23 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 11 Nov 2010 07:29:23 -0000 Subject: [vmkit-commits] [vmkit] r118780 - in /vmkit/branches/precise: include/j3/J3Intrinsics.h lib/J3/Compiler/J3Intrinsics.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h lib/J3/LLVMRuntime/runtime-default.ll lib/J3/VMCore/JavaRuntimeJIT.cpp Message-ID: <20101111072923.CE1522A6C12C@llvm.org> Author: geoffray Date: Thu Nov 11 01:29:23 2010 New Revision: 118780 URL: http://llvm.org/viewvc/llvm-project?rev=118780&view=rev Log: Fix interface calls, due to a bogus getTarget. Also add a debugging j3ResolveInterface runtime method. I should also test the performance of the runtime method compared to the inlined code. Modified: vmkit/branches/precise/include/j3/J3Intrinsics.h vmkit/branches/precise/lib/J3/Compiler/J3Intrinsics.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-default.ll vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp Modified: vmkit/branches/precise/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/j3/J3Intrinsics.h?rev=118780&r1=118779&r2=118780&view=diff ============================================================================== --- vmkit/branches/precise/include/j3/J3Intrinsics.h (original) +++ vmkit/branches/precise/include/j3/J3Intrinsics.h Thu Nov 11 01:29:23 2010 @@ -66,6 +66,7 @@ llvm::Function* ResolveVirtualStubFunction; llvm::Function* ResolveSpecialStubFunction; llvm::Function* ResolveStaticStubFunction; + llvm::Function* ResolveInterfaceFunction; #ifndef WITHOUT_VTABLE llvm::Function* VirtualLookupFunction; Modified: vmkit/branches/precise/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Compiler/J3Intrinsics.cpp?rev=118780&r1=118779&r2=118780&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/J3Intrinsics.cpp Thu Nov 11 01:29:23 2010 @@ -195,6 +195,7 @@ ResolveVirtualStubFunction = module->getFunction("j3ResolveVirtualStub"); ResolveStaticStubFunction = module->getFunction("j3ResolveStaticStub"); ResolveSpecialStubFunction = module->getFunction("j3ResolveSpecialStub"); + ResolveInterfaceFunction = module->getFunction("j3ResolveInterface"); NullPointerExceptionFunction = module->getFunction("j3NullPointerException"); 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=118780&r1=118779&r2=118780&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp Thu Nov 11 01:29:23 2010 @@ -202,8 +202,7 @@ Args.push_back(TheCompiler->getNativeClass(compilingClass)); Args.push_back(ConstantInt::get(Type::getInt32Ty(*llvmContext), index)); Args.push_back(GV); - Value* targetObject = getTarget(virtualType->param_end(), - signature->nbArguments + 1); + Value* targetObject = getTarget(signature); Args.push_back(new LoadInst( targetObject, "", TheCompiler->useCooperativeGC(), currentBlock)); load = invoke(intrinsics->VirtualLookupFunction, Args, "", currentBlock); @@ -1472,8 +1471,16 @@ } } -Value* JavaJIT::getTarget(FunctionType::param_iterator it, uint32 nb) { - return objectStack[currentStackIndex - nb]; +Value* JavaJIT::getTarget(Signdef* signature) { + int offset = 0; + Typedef* const* arguments = signature->getArgumentsType(); + for (uint32 i = 0; i < signature->nbArguments; i++) { + if (arguments[i]->isDouble() || arguments[i]->isLong()) { + offset++; + } + offset++; + } + return objectStack[currentStackIndex - 1 - offset]; } Instruction* JavaJIT::lowerMathOps(const UTF8* name, @@ -2193,8 +2200,6 @@ const llvm::PointerType* virtualPtrType = LSI->getVirtualPtrType(); const llvm::Type* retType = virtualType->getReturnType(); - BasicBlock* endBlock = createBasicBlock("end interface invoke"); - PHINode * node = PHINode::Create(virtualPtrType, "", endBlock); CommonClass* cl = 0; JavaMethod* meth = 0; @@ -2208,11 +2213,16 @@ intrinsics->JavaMethodType, 0, true); } - Value* targetObject = getTarget(virtualType->param_end(), - signature->nbArguments + 1); + uint32_t tableIndex = InterfaceMethodTable::getIndex(name, signature->keyName); + Constant* Index = ConstantInt::get(Type::getInt32Ty(*llvmContext), + tableIndex); + Value* targetObject = getTarget(signature); targetObject = new LoadInst( targetObject, "", TheCompiler->useCooperativeGC(), currentBlock); JITVerifyNull(targetObject); +#if 1 + BasicBlock* endBlock = createBasicBlock("end interface invoke"); + PHINode * node = PHINode::Create(virtualPtrType, "", endBlock); BasicBlock* label_bb = createBasicBlock("bb"); BasicBlock* label_bb4 = createBasicBlock("bb4"); @@ -2225,9 +2235,6 @@ Value* IMT = CallInst::Create(intrinsics->GetIMTFunction, VT, "", currentBlock); - uint32_t tableIndex = InterfaceMethodTable::getIndex(name, signature->keyName); - Constant* Index = ConstantInt::get(Type::getInt32Ty(*llvmContext), - tableIndex); Value* indices[2] = { intrinsics->constantZero, Index }; Instruction* ptr_18 = GetElementPtrInst::Create(IMT, indices, indices + 2, "", @@ -2308,10 +2315,17 @@ ptr_table_0_lcssa->addIncoming(ptr_37, currentBlock); currentBlock = endBlock; +#else + Value* Args[3] = { targetObject, Meth, Index }; + Value* node = CallInst::Create( + intrinsics->ResolveInterfaceFunction, Args, Args + 3, "", currentBlock); + node = new BitCastInst(node, virtualPtrType, "", currentBlock); +#endif std::vector args; // size = [signature->nbIn + 3]; FunctionType::param_iterator it = virtualType->param_end(); makeArgs(it, index, args, signature->nbArguments + 1); + JITVerifyNull(args[0]); Value* ret = invoke(node, args, "", currentBlock); if (retType != Type::getVoidTy(*llvmContext)) { if (ret->getType() == intrinsics->JavaObjectType) { 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=118780&r1=118779&r2=118780&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h Thu Nov 11 01:29:23 2010 @@ -443,7 +443,7 @@ uint32 index, std::vector& result, uint32 nb); /// getTarget - Get the target object for invocation. - llvm::Value* getTarget(llvm::FunctionType::param_iterator it, uint32 nb); + llvm::Value* getTarget(Signdef* signature); /// invokeVirtual - Invoke a Java virtual method. void invokeVirtual(uint16 index); Modified: vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-default.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-default.ll?rev=118780&r1=118779&r2=118780&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/branches/precise/lib/J3/LLVMRuntime/runtime-default.ll Thu Nov 11 01:29:23 2010 @@ -192,6 +192,7 @@ declare i8* @j3ResolveVirtualStub(%JavaObject*) declare i8* @j3ResolveSpecialStub() declare i8* @j3ResolveStaticStub() +declare i8* @j3ResolveInterface(%JavaObject*, %JavaMethod*, i32) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exception methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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=118780&r1=118779&r2=118780&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp Thu Nov 11 01:29:23 2010 @@ -648,8 +648,7 @@ uint32_t index = InterfaceMethodTable::getIndex(Virt->name, Virt->type); if ((IMT->contents[index] & 1) == 0) { IMT->contents[index] = (uintptr_t)result; - } else { - + } else { JavaMethod* Imeth = ctpCl->asClass()->lookupInterfaceMethodDontThrow(utf8, sign->keyName); assert(Imeth && "Method not in hierarchy?"); @@ -746,6 +745,23 @@ return result; } +// Does not throw an exception. +extern "C" void* j3ResolveInterface(JavaObject* obj, JavaMethod* meth, uint32_t index) { + uintptr_t result = NULL; + InterfaceMethodTable* IMT = JavaObject::getClass(obj)->virtualVT->IMT; + assert(JavaObject::instanceOf(obj, meth->classDef)); + if ((IMT->contents[index] & 1) == 0) { + result = IMT->contents[index]; + } else { + uintptr_t* table = (uintptr_t*)(IMT->contents[index] & ~1); + uint32 i = 0; + while (table[i] != (uintptr_t)meth) { i += 2; } + result = table[i + 1]; + } + assert((result != NULL) && "Bad IMT"); + return (void*)result; +} + extern "C" void j3PrintMethodStart(JavaMethod* meth) { fprintf(stderr, "[%p] executing %s.%s\n", (void*)mvm::Thread::get(), UTF8Buffer(meth->classDef->name).cString(), From nicolas.geoffray at lip6.fr Thu Nov 11 00:09:28 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 11 Nov 2010 08:09:28 -0000 Subject: [vmkit-commits] [vmkit] r118784 - /vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Message-ID: <20101111080928.D7E812A6C12C@llvm.org> Author: geoffray Date: Thu Nov 11 02:09:28 2010 New Revision: 118784 URL: http://llvm.org/viewvc/llvm-project?rev=118784&view=rev Log: Forgot to trace vmThread. Modified: vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp 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=118784&r1=118783&r2=118784&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Thu Nov 11 02:09:28 2010 @@ -325,6 +325,7 @@ mvm::Collector::markAndTraceRoot(&pendingException, closure); } mvm::Collector::markAndTraceRoot(&javaThread, closure); + mvm::Collector::markAndTraceRoot(&vmThread, closure); #ifdef SERVICE mvm::Collector::markAndTraceRoot(&ServiceException, closure); #endif From nicolas.geoffray at lip6.fr Thu Nov 11 12:43:26 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 11 Nov 2010 20:43:26 -0000 Subject: [vmkit-commits] [vmkit] r118833 - in /vmkit/branches/precise: include/mvm/Threads/CollectionRV.h include/mvm/Threads/Thread.h lib/J3/Classpath/ClasspathVMThread.inc lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/VMCore/JavaRuntimeJIT.cpp lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/ReferenceQueue.cpp lib/J3/VMCore/ReferenceQueue.h lib/J3/VMCore/VirtualTables.cpp lib/Mvm/CommonThread/CollectionRV.cpp lib/Mvm/CommonThread/ctthread.cpp Message-ID: <20101111204326.7D9612A6C12C@llvm.org> Author: geoffray Date: Thu Nov 11 14:43:26 2010 New Revision: 118833 URL: http://llvm.org/viewvc/llvm-project?rev=118833&view=rev Log: Some more GC fixes. Modified: vmkit/branches/precise/include/mvm/Threads/CollectionRV.h vmkit/branches/precise/include/mvm/Threads/Thread.h vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp 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/ReferenceQueue.cpp vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp Modified: vmkit/branches/precise/include/mvm/Threads/CollectionRV.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/Threads/CollectionRV.h?rev=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/CollectionRV.h (original) +++ vmkit/branches/precise/include/mvm/Threads/CollectionRV.h Thu Nov 11 14:43:26 2010 @@ -34,7 +34,7 @@ CollectionRV() { nbJoined = 0; } - + void lockRV() { _lockRV.lock(); } void unlockRV() { _lockRV.unlock(); } @@ -59,6 +59,8 @@ virtual void join() = 0; virtual void joinAfterUncooperative(void* SP) = 0; virtual void joinBeforeUncooperative() = 0; + + virtual void addThread(Thread* th) = 0; }; class CooperativeCollectionRV : public CollectionRV { @@ -69,6 +71,7 @@ void join(); void joinAfterUncooperative(void* SP); void joinBeforeUncooperative(); + void addThread(Thread* th); }; class UncooperativeCollectionRV : public CollectionRV { @@ -79,6 +82,7 @@ void join(); void joinAfterUncooperative(void* SP); void joinBeforeUncooperative(); + void addThread(Thread* th); }; 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/precise/include/mvm/Threads/Thread.h Thu Nov 11 14:43:26 2010 @@ -165,10 +165,6 @@ /// int kill(int signo); - /// killForRendezvous - Kill the given thread for a rendezvous. - /// - void killForRendezvous(); - /// exit - Exit the current thread. /// static void exit(int value); 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc Thu Nov 11 14:43:26 2010 @@ -45,6 +45,7 @@ // which is the JavaThread object. vmThread = (JavaObjectVMThread*)thread->vmThread; assert(vmThread && "Didn't fix the vmThread of a j3 thread"); + assert(vmThread->getVirtualTable()); JavaObjectVMThread::setVmdata(vmThread, thread); UserClass* vmthClass = (UserClass*)JavaObject::getClass(vmThread); @@ -58,7 +59,9 @@ if (!isDaemon) { vm->threadSystem.enter(); } - + + assert(vmThread->getVirtualTable()); + assert(javaThread->getVirtualTable()); // Run the VMThread::run function vm->upcalls->runVMThread->invokeIntSpecial(vm, vmthClass, vmThread); @@ -86,7 +89,8 @@ javaThread = vm->upcalls->assocThread->getInstanceObjectField(vmThread); assert(javaThread && "VMThread with no Java equivalent"); - JavaThread* th = new JavaThread(javaThread, vmThread, vm); + JavaThread* th = new JavaThread(vm); + th->initialise(javaThread, vmThread); if (!th) vm->outOfMemoryError(); th->start((void (*)(mvm::Thread*))start); 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp Thu Nov 11 14:43:26 2010 @@ -2132,7 +2132,7 @@ void JavaAOTCompiler::compileFile(Jnjvm* vm, const char* n) { name = n; - JavaThread* th = new JavaThread(0, 0, vm); + JavaThread* th = new JavaThread(vm); vm->setMainThread(th); th->start((void (*)(mvm::Thread*))mainCompilerStart); vm->waitForExit(); 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp Thu Nov 11 14:43:26 2010 @@ -1905,14 +1905,15 @@ intrinsics->AllocateUnresolvedFunction, Size, VT, "", currentBlock); + addHighLevelType(val, cl ? cl : upcalls->OfObject); + Instruction* res = new BitCastInst(val, intrinsics->JavaObjectType, "", currentBlock); + push(res, false, cl ? cl : upcalls->OfObject); + + // Make sure to add the object to the finalization list after it has been + // pushed. if (cl && cl->virtualVT->destructor) { CallInst::Create(intrinsics->AddFinalizationCandidate, val, "", currentBlock); } - - - addHighLevelType(val, cl ? cl : upcalls->OfObject); - val = new BitCastInst(val, intrinsics->JavaObjectType, "", currentBlock); - push(val, false, cl ? cl : upcalls->OfObject); } Value* JavaJIT::ldResolved(uint16 index, bool stat, Value* object, 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp Thu Nov 11 14:43:26 2010 @@ -758,7 +758,7 @@ while (table[i] != (uintptr_t)meth) { i += 2; } result = table[i + 1]; } - assert((result != NULL) && "Bad IMT"); + assert((result != 0) && "Bad IMT"); return (void*)result; } 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaThread.cpp Thu Nov 11 14:43:26 2010 @@ -19,18 +19,14 @@ using namespace j3; -JavaThread::JavaThread(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) - : MutatorThread() { - llvm_gcroot(thread, 0); - llvm_gcroot(vmth, 0); - - javaThread = thread; - vmThread = vmth; +JavaThread::JavaThread(Jnjvm* isolate) : MutatorThread() { MyVM = isolate; - pendingException = 0; + pendingException = NULL; jniEnv = isolate->jniEnv; localJNIRefs = new JNILocalReferences(); - currentAddedReferences = 0; + currentAddedReferences = NULL; + javaThread = NULL; + vmThread = NULL; #ifdef SERVICE eipIndex = 0; @@ -41,6 +37,13 @@ #endif } +void JavaThread::initialise(JavaObject* thread, JavaObject* vmth) { + llvm_gcroot(thread, 0); + llvm_gcroot(vmth, 0); + javaThread = thread; + vmThread = vmth; +} + JavaThread::~JavaThread() { delete localJNIRefs; #ifdef SERVICE 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaThread.h Thu Nov 11 14:43:26 2010 @@ -123,15 +123,17 @@ /// JavaThread - Creates a Java thread. /// - JavaThread(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); + JavaThread(Jnjvm* isolate); - /// get - Get the current thread as a JnJVM object. + void initialise(JavaObject* thread, JavaObject* vmth); + + /// get - Get the current thread as a J3 object. /// static JavaThread* get() { return (JavaThread*)mvm::Thread::get(); } - /// getJVM - Get the JnJVM in which this thread executes. + /// getJVM - Get the Java VM in which this thread executes. /// Jnjvm* getJVM() { return (Jnjvm*)MyVM; 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/Jnjvm.cpp Thu Nov 11 14:43:26 2010 @@ -1328,7 +1328,7 @@ void Jnjvm::runApplication(int argc, char** argv) { argumentsInfo.argc = argc; argumentsInfo.argv = argv; - mainThread = new JavaThread(0, 0, this); + mainThread = new JavaThread(this); mainThread->start((void (*)(mvm::Thread*))mainJavaStart); } Modified: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp?rev=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp Thu Nov 11 14:43:26 2010 @@ -15,7 +15,7 @@ using namespace j3; -ReferenceThread::ReferenceThread(Jnjvm* vm) : JavaThread(NULL, NULL, vm), +ReferenceThread::ReferenceThread(Jnjvm* vm) : JavaThread(vm), WeakReferencesQueue(ReferenceQueue::WEAK), SoftReferencesQueue(ReferenceQueue::SOFT), PhantomReferencesQueue(ReferenceQueue::PHANTOM) { @@ -155,7 +155,7 @@ } -FinalizerThread::FinalizerThread(Jnjvm* vm) : JavaThread(NULL, NULL, vm) { +FinalizerThread::FinalizerThread(Jnjvm* vm) : JavaThread(vm) { FinalizationQueue = new gc*[INITIAL_QUEUE_SIZE]; QueueLength = INITIAL_QUEUE_SIZE; CurrentIndex = 0; @@ -197,6 +197,7 @@ void FinalizerThread::addFinalizationCandidate(gc* obj) { + llvm_gcroot(obj, 0); FinalizationQueueLock.acquire(); if (CurrentIndex >= QueueLength) { Modified: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h?rev=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h Thu Nov 11 14:43:26 2010 @@ -51,6 +51,7 @@ } void addReference(gc* ref) { + llvm_gcroot(ref, 0); QueueLock.acquire(); if (CurrentIndex >= QueueLength) { uint32 newLength = QueueLength * GROW_FACTOR; @@ -110,18 +111,21 @@ /// addWeakReference - Add a weak reference to the queue. /// void addWeakReference(gc* ref) { + llvm_gcroot(ref, 0); WeakReferencesQueue.addReference(ref); } /// addSoftReference - Add a weak reference to the queue. /// void addSoftReference(gc* ref) { + llvm_gcroot(ref, 0); SoftReferencesQueue.addReference(ref); } /// addPhantomReference - Add a weak reference to the queue. /// void addPhantomReference(gc* ref) { + llvm_gcroot(ref, 0); PhantomReferencesQueue.addReference(ref); } 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Thu Nov 11 14:43:26 2010 @@ -321,9 +321,7 @@ } void JavaThread::tracer(uintptr_t closure) { - if (pendingException != NULL) { - mvm::Collector::markAndTraceRoot(&pendingException, closure); - } + mvm::Collector::markAndTraceRoot(&pendingException, closure); mvm::Collector::markAndTraceRoot(&javaThread, closure); mvm::Collector::markAndTraceRoot(&vmThread, closure); #ifdef SERVICE Modified: vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp?rev=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/CollectionRV.cpp Thu Nov 11 14:43:26 2010 @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include +#include #include "MvmGC.h" #include "mvm/VirtualMachine.h" #include "mvm/Threads/CollectionRV.h" @@ -80,6 +81,13 @@ unlockRV(); } + +#if defined(__MACH__) +# define SIGGC SIGXCPU +#else +# define SIGGC SIGPWR +#endif + void UncooperativeCollectionRV::synchronize() { assert(nbJoined == 0); mvm::Thread* self = mvm::Thread::get(); @@ -89,7 +97,8 @@ for (mvm::Thread* cur = (mvm::Thread*)self->next(); cur != self; cur = (mvm::Thread*)cur->next()) { - cur->killForRendezvous(); + int res = cur->kill(SIGGC); + assert(!res && "Error on kill"); } // And wait for other threads to finish. @@ -220,3 +229,29 @@ void UncooperativeCollectionRV::joinBeforeUncooperative() { UNREACHABLE(); } + +void CooperativeCollectionRV::addThread(Thread* th) { + // Nothing to do. +} + +static void siggcHandler(int) { + mvm::Thread* th = mvm::Thread::get(); + th->MyVM->rendezvous.join(); +} + +void UncooperativeCollectionRV::addThread(Thread* th) { + // Set the SIGGC handler for uncooperative rendezvous. + struct sigaction sa; + sigset_t mask; + sigaction(SIGGC, 0, &sa); + sigfillset(&mask); + sa.sa_mask = mask; + sa.sa_handler = siggcHandler; + sa.sa_flags |= SA_RESTART; + sigaction(SIGGC, &sa, NULL); + + if (nbJoined != 0) { + // In uncooperative mode, we may have missed a signal. + join(); + } +} 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=118833&r1=118832&r2=118833&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp Thu Nov 11 14:43:26 2010 @@ -305,18 +305,6 @@ extern void sigsegvHandler(int, siginfo_t*, void*); - -#if defined(__MACH__) -# define SIGGC SIGXCPU -#else -# define SIGGC SIGPWR -#endif - -static void siggcHandler(int) { - mvm::Thread* th = mvm::Thread::get(); - th->MyVM->rendezvous.join(); -} - /// internalThreadStart - The initial function called by a thread. Sets some /// thread specific data, registers the thread to the GC and calls the /// given routine of th. @@ -333,19 +321,12 @@ sa.sa_sigaction = sigsegvHandler; sigaction(SIGSEGV, &sa, NULL); - // Set the SIGGC handler for uncooperative rendezvous. - sigaction(SIGGC, 0, &sa); - sigfillset(&mask); - sa.sa_mask = mask; - sa.sa_handler = siggcHandler; - sa.sa_flags |= SA_RESTART; - sigaction(SIGGC, &sa, NULL); + th->MyVM->rendezvous.addThread(th); assert(th->MyVM && "VM not set in a thread"); #ifdef ISOLATE th->IsolateID = th->MyVM->IsolateID; #endif - th->MyVM->addThread(th); th->routine(th); th->MyVM->removeThread(th); delete th; @@ -361,6 +342,7 @@ pthread_attr_init(&attributs); pthread_attr_setstack(&attributs, this, STACK_SIZE); routine = fct; + MyVM->addThread(this); int res = pthread_create((pthread_t*)(void*)(&internalThreadID), &attributs, (void* (*)(void *))internalThreadStart, this); pthread_detach((pthread_t)internalThreadID); @@ -395,12 +377,6 @@ TheStackManager.used[index] = 0; } -void Thread::killForRendezvous() { - int res = kill(SIGGC); - assert(!res && "Error on kill"); -} - - #ifdef WITH_LLVM_GCC void Thread::scanStack(uintptr_t closure) { StackWalker Walker(this); From gael.thomas at lip6.fr Sat Nov 13 16:55:07 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sun, 14 Nov 2010 00:55:07 -0000 Subject: [vmkit-commits] [vmkit] r119018 - in /vmkit/trunk: Makefile.common.in include/j3/LLVMMaterializer.h lib/J3/Classpath/ClasspathReflect.h lib/J3/VMCore/Zip.cpp Message-ID: <20101114005507.7843E2A6C12C@llvm.org> Author: gthomas Date: Sat Nov 13 18:55:07 2010 New Revision: 119018 URL: http://llvm.org/viewvc/llvm-project?rev=119018&view=rev Log: Load dependency files. Don't know if I can define BYTECODE_LIBRARY, thus copy the llvm if. Fix some includes. Modified: vmkit/trunk/Makefile.common.in vmkit/trunk/include/j3/LLVMMaterializer.h vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h vmkit/trunk/lib/J3/VMCore/Zip.cpp Modified: vmkit/trunk/Makefile.common.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.common.in?rev=119018&r1=119017&r2=119018&view=diff ============================================================================== --- vmkit/trunk/Makefile.common.in (original) +++ vmkit/trunk/Makefile.common.in Sat Nov 13 18:55:07 2010 @@ -38,3 +38,9 @@ endif include $(PROJ_SRC_ROOT)/Makefile.rules + +ifndef DISABLE_AUTO_DEPENDENCIES +ifndef IS_CLEANING_TARGET +-include $(DependSourceFiles:%=$(PROJ_OBJ_DIR)/$(BuildMode)/%.bc.d) +endif +endif Modified: vmkit/trunk/include/j3/LLVMMaterializer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/LLVMMaterializer.h?rev=119018&r1=119017&r2=119018&view=diff ============================================================================== --- vmkit/trunk/include/j3/LLVMMaterializer.h (original) +++ vmkit/trunk/include/j3/LLVMMaterializer.h Sat Nov 13 18:55:07 2010 @@ -12,7 +12,7 @@ #include -#include +#include "j3/JavaJITCompiler.h" namespace j3 { Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h?rev=119018&r1=119017&r2=119018&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h Sat Nov 13 18:55:07 2010 @@ -12,8 +12,8 @@ #include "MvmGC.h" -#include -#include +#include "JavaClass.h" +#include "JavaObject.h" extern "C" j3::JavaObject* internalFillInStackTrace(j3::JavaObject*); Modified: vmkit/trunk/lib/J3/VMCore/Zip.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Zip.cpp?rev=119018&r1=119017&r2=119018&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Zip.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Zip.cpp Sat Nov 13 18:55:07 2010 @@ -9,7 +9,7 @@ #include -#include +#include "mvm/Allocator.h" #include "JavaArray.h" #include "Reader.h" From gael.thomas at lip6.fr Sat Nov 13 16:55:17 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sun, 14 Nov 2010 00:55:17 -0000 Subject: [vmkit-commits] [vmkit] r119019 - /vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Message-ID: <20101114005517.437152A6C12C@llvm.org> Author: gthomas Date: Sat Nov 13 18:55:17 2010 New Revision: 119019 URL: http://llvm.org/viewvc/llvm-project?rev=119019&view=rev Log: Rename thread fields. Modified: vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll 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=119019&r1=119018&r2=119019&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Sat Nov 13 18:55:17 2010 @@ -34,8 +34,8 @@ ;;; Field 2: MyVM ;;; Field 3: baseSP ;;; Field 4: doYield -;;; Field 5: inGC -;;; Field 6: stackScanned +;;; Field 5: inRV +;;; Field 6: joinedRV ;;; Field 7: lastSP ;;; Field 8: internalThreadID ;;; field 9: routine From gael.thomas at lip6.fr Sun Nov 14 04:33:47 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sun, 14 Nov 2010 12:33:47 -0000 Subject: [vmkit-commits] [vmkit] r119039 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/J3/Compiler/JavaJIT.cpp lib/J3/LLVMRuntime/runtime-default.ll Message-ID: <20101114123347.A3A512A6C12C@llvm.org> Author: gthomas Date: Sun Nov 14 06:33:47 2010 New Revision: 119039 URL: http://llvm.org/viewvc/llvm-project?rev=119039&view=rev Log: The C++ bool type is compiled to the i8 type, not i1! Modify the definition of mvm::Thread in Thread.h and runtime-default.ll to avoid any confusion. Add a new field in mvm::Thread to hold a pointer to the vm specific virtual machine data (to go from one vm to another in the same thread:)). Modified: vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=119039&r1=119038&r2=119039&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Sun Nov 14 06:33:47 2010 @@ -194,15 +194,19 @@ /// doYield - Flag to tell the thread to yield for GC reasons. /// - bool doYield; + char doYield; + + /// vmData - vm specific data + /// + void* vmData; /// inRV - Flag to tell that the thread is being part of a rendezvous. /// - bool inRV; + char inRV; /// joinedRV - Flag to tell that the thread has joined a rendezvous. /// - bool joinedRV; + char joinedRV; /// get - Get the thread specific data of the current thread. /// Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=119039&r1=119038&r2=119039&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sun Nov 14 06:33:47 2010 @@ -1208,6 +1208,7 @@ Value* YieldPtr = getDoYieldPtr(getMutatorThreadPtr()); Value* Yield = new LoadInst(YieldPtr, "", currentBlock); + Yield = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, Yield, intrinsics->constantInt8Zero, ""); BasicBlock* continueBlock = createBasicBlock("After safe point"); BasicBlock* yieldBlock = createBasicBlock("In safe point"); 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=119039&r1=119038&r2=119039&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Sun Nov 14 06:33:47 2010 @@ -29,19 +29,20 @@ %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: inRV -;;; Field 6: joinedRV -;;; 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*} +;;; Field 0: the parent (circular base) +;;; Field 1: size_t IsolateID +;;; Field 2: void* MyVM +;;; Field 3: void* baseSP +;;; Field 4: char doYield +;;; field 5: void* vmData +;;; Field 6: char inRV +;;; Field 7: char joinedRV +;;; Field 8: void* lastSP +;;; Field 9: void* internalThreadID +;;; field 10: void* routine +;;; field 11: void* lastKnownFrame +;;; field 12: void* lastExceptionBuffer +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8*, i8, i8, i8*, i8*, i8*, i8*, i8* } %JavaThread = type { %MutatorThread, i8*, %JavaObject* } From gael.thomas at lip6.fr Sun Nov 14 05:15:03 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sun, 14 Nov 2010 13:15:03 -0000 Subject: [vmkit-commits] [vmkit] r119042 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/J3/Compiler/JavaJIT.cpp lib/J3/LLVMRuntime/runtime-default.ll Message-ID: <20101114131503.269382A6C12C@llvm.org> Author: gthomas Date: Sun Nov 14 07:15:02 2010 New Revision: 119042 URL: http://llvm.org/viewvc/llvm-project?rev=119042&view=rev Log: Remove the field from mvm::Thread: I had a bug with mmtk. Modified: vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=119042&r1=119041&r2=119042&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Sun Nov 14 07:15:02 2010 @@ -198,7 +198,7 @@ /// vmData - vm specific data /// - void* vmData; + // void* vmData; /// inRV - Flag to tell that the thread is being part of a rendezvous. /// Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=119042&r1=119041&r2=119042&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sun Nov 14 07:15:02 2010 @@ -1208,7 +1208,7 @@ Value* YieldPtr = getDoYieldPtr(getMutatorThreadPtr()); Value* Yield = new LoadInst(YieldPtr, "", currentBlock); - Yield = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, Yield, intrinsics->constantInt8Zero, ""); + Yield = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, Yield, intrinsics->constantInt8Zero, ""); BasicBlock* continueBlock = createBasicBlock("After safe point"); BasicBlock* yieldBlock = createBasicBlock("In safe point"); 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=119042&r1=119041&r2=119042&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Sun Nov 14 07:15:02 2010 @@ -42,7 +42,7 @@ ;;; field 10: void* routine ;;; field 11: void* lastKnownFrame ;;; field 12: void* lastExceptionBuffer -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8*, i8, i8, i8*, i8*, i8*, i8*, i8* } +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8* } %JavaThread = type { %MutatorThread, i8*, %JavaObject* } From nicolas.geoffray at gmail.com Sun Nov 14 10:41:49 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Sun, 14 Nov 2010 19:41:49 +0100 Subject: [vmkit-commits] [vmkit] r119039 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/J3/Compiler/JavaJIT.cpp lib/J3/LLVMRuntime/runtime-default.ll In-Reply-To: <20101114123347.A3A512A6C12C@llvm.org> References: <20101114123347.A3A512A6C12C@llvm.org> Message-ID: Hi Gael! Inlined comments. On Sun, Nov 14, 2010 at 1:33 PM, Gael Thomas wrote: > > /// doYield - Flag to tell the thread to yield for GC reasons. > /// > - bool doYield; > + char doYield; > Please use uint8_t instead of char. + > + /// vmData - vm specific data > + /// > + void* vmData; > There is already a MyVM to hold the virtual machine, why another one? > > /// inRV - Flag to tell that the thread is being part of a rendezvous. > /// > - bool inRV; > + char inRV; > > char -> uint8_t > /// joinedRV - Flag to tell that the thread has joined a rendezvous. > /// > - bool joinedRV; > + char joinedRV; > char - >uint8_t -------------- next part -------------- An HTML attachment was scrubbed... URL: From gael.thomas at lip6.fr Sun Nov 14 10:51:26 2010 From: gael.thomas at lip6.fr (=?ISO-8859-1?Q?Ga=EBl_Thomas?=) Date: Sun, 14 Nov 2010 19:51:26 +0100 Subject: [vmkit-commits] [vmkit] r119039 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/J3/Compiler/JavaJIT.cpp lib/J3/LLVMRuntime/runtime-default.ll In-Reply-To: References: <20101114123347.A3A512A6C12C@llvm.org> Message-ID: Hi! 2010/11/14 nicolas geoffray : > Hi Gael! > Inlined comments. > > On Sun, Nov 14, 2010 at 1:33 PM, Gael Thomas wrote: >> >>   /// doYield - Flag to tell the thread to yield for GC reasons. >>   /// >> -  bool doYield; >> +  char doYield; > > Please use uint8_t instead of char. Ok :) >> >> + >> +  /// vmData - vm specific data >> +  /// >> +  void* vmData; > > There is already a MyVM to hold the virtual machine, why another one? I want a thread specific data! > >> >>   /// inRV - Flag to tell that the thread is being part of a rendezvous. >>   /// >> -  bool inRV; >> +  char inRV; >> > > char -> uint8_t Ok > >> >>   /// joinedRV - Flag to tell that the thread has joined a rendezvous. >>   /// >> -  bool joinedRV; >> +  char joinedRV; > > char - >uint8_t Ok Gaël > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -- ------------------------------------------------------------------------------------------------- Gaël Thomas, Associate Professor, University of Pierre and Marie Curie Boite courrier 169, 217 - 26-00, REGAL Team, INRIA/LIP6, 4, place Jussieu, Paris F-75005 Web: http://pagesperso-systeme.lip6.fr/Gael.Thomas/ Phone (mob): +33 6 10 39 31 17           Fax : +33 1 44 27 70 00 ------------------------------------------------------------------------------------------------- From gael.thomas at lip6.fr Mon Nov 15 08:29:42 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 15 Nov 2010 16:29:42 -0000 Subject: [vmkit-commits] [vmkit] r119150 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/J3/LLVMRuntime/runtime-default.ll Message-ID: <20101115162942.EA3AC2A6C12C@llvm.org> Author: gthomas Date: Mon Nov 15 10:29:42 2010 New Revision: 119150 URL: http://llvm.org/viewvc/llvm-project?rev=119150&view=rev Log: Prepare a test for Nico Modified: vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=119150&r1=119149&r2=119150&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Mon Nov 15 10:29:42 2010 @@ -196,10 +196,6 @@ /// char doYield; - /// vmData - vm specific data - /// - // void* vmData; - /// inRV - Flag to tell that the thread is being part of a rendezvous. /// char inRV; @@ -395,6 +391,11 @@ void startKnownFrame(KnownFrame& F) __attribute__ ((noinline)); void endKnownFrame(); + + + /// vmData - vm specific data + /// + // void* vmData; TEST ME }; #ifndef RUNTIME_DWARF_EXCEPTIONS 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=119150&r1=119149&r2=119150&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Mon Nov 15 10:29:42 2010 @@ -34,14 +34,15 @@ ;;; Field 2: void* MyVM ;;; Field 3: void* baseSP ;;; Field 4: char doYield -;;; field 5: void* vmData -;;; Field 6: char inRV -;;; Field 7: char joinedRV -;;; Field 8: void* lastSP -;;; Field 9: void* internalThreadID -;;; field 10: void* routine -;;; field 11: void* lastKnownFrame -;;; field 12: void* lastExceptionBuffer +;;; Field 5: char inRV +;;; Field 6: char joinedRV +;;; Field 7: void* lastSP +;;; Field 8: void* internalThreadID +;;; field 9: void* routine +;;; field 10: void* lastKnownFrame +;;; field 11: void* lastExceptionBuffer +;;; field 12: void* vmData +;;; %Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } TEST ME %Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8* } %JavaThread = type { %MutatorThread, i8*, %JavaObject* } From gael.thomas at lip6.fr Mon Nov 15 08:29:50 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 15 Nov 2010 16:29:50 -0000 Subject: [vmkit-commits] [vmkit] r119151 - /vmkit/trunk/Makefile.rules Message-ID: <20101115162950.702B02A6C12D@llvm.org> Author: gthomas Date: Mon Nov 15 10:29:50 2010 New Revision: 119151 URL: http://llvm.org/viewvc/llvm-project?rev=119151&view=rev Log: test my branch Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=119151&r1=119150&r2=119151&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Mon Nov 15 10:29:50 2010 @@ -1,3 +1,4 @@ + ifdef VMKIT_RUNTIME From gael.thomas at lip6.fr Mon Nov 15 08:53:09 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 15 Nov 2010 16:53:09 -0000 Subject: [vmkit-commits] [vmkit] r119157 - /vmkit/branches/multi-vm/ Message-ID: <20101115165309.52A1D2A6C12F@llvm.org> Author: gthomas Date: Mon Nov 15 10:53:09 2010 New Revision: 119157 URL: http://llvm.org/viewvc/llvm-project?rev=119157&view=rev Log: creating a branch for the multi-vm version of vmkit Added: vmkit/branches/multi-vm/ (props changed) - copied from r119156, vmkit/trunk/ Propchange: vmkit/branches/multi-vm/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Nov 15 10:53:09 2010 @@ -0,0 +1,13 @@ +do-find +Makefile.config +replace.sh +config.log +*.tmp +Release +do-conf +configure.out +config.status +Makefile.common +Release-Asserts +Debug + Propchange: vmkit/branches/multi-vm/ ------------------------------------------------------------------------------ svn:mergeinfo = /vmkit/branches/release_028:115466-116298 From gael.thomas at lip6.fr Tue Nov 16 10:15:01 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 16 Nov 2010 18:15:01 -0000 Subject: [vmkit-commits] [vmkit] r119356 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/J3/LLVMRuntime/runtime-default.ll mmtk/config/copyms/MMTkInline.inc mmtk/config/marksweep/MMTkInline.inc Message-ID: <20101116181501.29E672A6C12C@llvm.org> Author: gthomas Date: Tue Nov 16 12:15:00 2010 New Revision: 119356 URL: http://llvm.org/viewvc/llvm-project?rev=119356&view=rev Log: add a new field in Thread Modified: vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll vmkit/trunk/mmtk/config/copyms/MMTkInline.inc vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=119356&r1=119355&r2=119356&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Tue Nov 16 12:15:00 2010 @@ -395,7 +395,7 @@ /// vmData - vm specific data /// - // void* vmData; TEST ME + void* vmData; }; #ifndef RUNTIME_DWARF_EXCEPTIONS 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=119356&r1=119355&r2=119356&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Tue Nov 16 12:15:00 2010 @@ -42,8 +42,7 @@ ;;; field 10: void* lastKnownFrame ;;; field 11: void* lastExceptionBuffer ;;; field 12: void* vmData -;;; %Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } TEST ME -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8* } +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } %JavaThread = type { %MutatorThread, i8*, %JavaObject* } Modified: vmkit/trunk/mmtk/config/copyms/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/copyms/MMTkInline.inc?rev=119356&r1=119355&r2=119356&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/copyms/MMTkInline.inc (original) +++ vmkit/trunk/mmtk/config/copyms/MMTkInline.inc Tue Nov 16 12:15:00 2010 @@ -2,541 +2,5 @@ Function* makeLLVMFunction(Module *mod) { - -// Type Definitions -PointerType* PointerTy_0 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); - -std::vectorFuncTy_1_args; -FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_1_args.push_back(PointerTy_0); -FunctionType* FuncTy_1 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_1_args, - /*isVarArg=*/false); - -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_7_args, - /*isVarArg=*/true); - -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_gcRoot_fields; -StructTy_struct_gcRoot_fields.push_back(PointerTy_5); -StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); -mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); - -PointerType* PointerTy_11 = PointerType::get(StructTy_struct_gcRoot, 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; -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__CollectionRV_fields; -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)); -StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 8)); -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__VirtualMachine_fields.push_back(StructTy_struct_mvm__CollectionRV); -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()); - - -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); -StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_mvm__SpinLock); -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_29 = PointerType::get(ArrayTy_VT, 0); - -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_28 = PointerType::get(StructTy_JavaObject, 0); - -PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); - -PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); - -PointerType* PointerTy_31 = PointerType::get(PointerTy_29, 0); - -std::vectorFuncTy_33_args; -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_33 = FunctionType::get( - /*Result=*/PointerTy_28, - /*Params=*/FuncTy_33_args, - /*isVarArg=*/false); - -PointerType* PointerTy_32 = PointerType::get(FuncTy_33, 0); - - -// Function Declarations - -Function* func_llvm_frameaddress = Function::Create( - /*Type=*/FuncTy_3, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*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_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( - /*Type=*/FuncTy_33, - /*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_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); - -// Global Variable Declarations - -// Constant Definitions -ConstantInt* const_int32_34 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -ConstantInt* const_int32_35 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); -ConstantInt* const_int32_36 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); -ConstantInt* const_int32_37 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); -ConstantInt* const_int32_38 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); -ConstantInt* const_int32_39 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); -ConstantInt* const_int32_40 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); - -// Global Variable Definitions - -Function* func_gcmalloc = Function::Create( - /*Type=*/FuncTy_1, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"gcmalloc", mod); -func_gcmalloc->setCallingConv(CallingConv::C); -AttrListPtr func_gcmalloc_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_gcmalloc->setAttributes(func_gcmalloc_PAL); -Function::arg_iterator args = func_gcmalloc->arg_begin(); -Value* int32_sz = args++; -int32_sz->setName("sz"); -Value* ptr_VT = args++; -ptr_VT->setName("VT"); - -BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",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 = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IFEQ_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.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_41 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_34, "", label_entry); -BinaryOperator* int32_42 = BinaryOperator::Create(Instruction::And, int32_41, const_int32_35, "", label_entry); -CallInst* ptr_43 = CallInst::Create(func_llvm_frameaddress, const_int32_36, "", label_entry); -ptr_43->setCallingConv(CallingConv::C); -ptr_43->setTailCall(true); -AttrListPtr ptr_43_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_43_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_43->setAttributes(ptr_43_PAL); - -CastInst* int32_44 = new PtrToIntInst(ptr_43, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_45 = BinaryOperator::Create(Instruction::And, int32_44, const_int32_37, "", label_entry); -CastInst* ptr_46 = new IntToPtrInst(int32_45, PointerTy_4, "", label_entry); -std::vector ptr_47_indices; -ptr_47_indices.push_back(const_int32_36); -ptr_47_indices.push_back(const_int32_38); -Instruction* ptr_47 = GetElementPtrInst::Create(ptr_46, ptr_47_indices.begin(), ptr_47_indices.end(), "", label_entry); -LoadInst* int32_48 = new LoadInst(ptr_47, "", false, label_entry); -CastInst* ptr_49 = new IntToPtrInst(int32_48, PointerTy_26, "", label_entry); -GetElementPtrInst* ptr_50 = GetElementPtrInst::Create(ptr_49, const_int32_39, "", label_entry); -CastInst* ptr_51 = new BitCastInst(ptr_50, PointerTy_27, "", label_entry); -LoadInst* ptr_52 = new LoadInst(ptr_51, "", false, label_entry); -GetElementPtrInst* ptr_53 = GetElementPtrInst::Create(ptr_52, const_int32_40, "", label_entry); -CastInst* ptr_54 = new BitCastInst(ptr_53, PointerTy_27, "", label_entry); -LoadInst* ptr_55 = new LoadInst(ptr_54, "", false, label_entry); -CastInst* int32_56 = new PtrToIntInst(ptr_55, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_57 = BinaryOperator::Create(Instruction::Add, int32_56, int32_42, "", label_entry); -CastInst* ptr_58 = new IntToPtrInst(int32_57, PointerTy_28, "", label_entry); -std::vector ptr_59_indices; -ptr_59_indices.push_back(const_int32_40); -ptr_59_indices.push_back(const_int32_40); -Instruction* ptr_59 = GetElementPtrInst::Create(ptr_52, ptr_59_indices.begin(), ptr_59_indices.end(), "", label_entry); -LoadInst* ptr_60 = new LoadInst(ptr_59, "", false, label_entry); -CastInst* ptr_61 = new BitCastInst(ptr_60, PointerTy_28, "", label_entry); -ICmpInst* int1_62 = new ICmpInst(*label_entry, ICmpInst::ICMP_UGT, ptr_58, ptr_61, ""); -BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_62, label_entry); - -// Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i) -std::vector ptr_64_indices; -ptr_64_indices.push_back(const_int32_40); -ptr_64_indices.push_back(const_int32_36); -Instruction* ptr_64 = GetElementPtrInst::Create(ptr_52, ptr_64_indices.begin(), ptr_64_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_57, PointerTy_29, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); - new StoreInst(ptr__c_i_i_i, ptr_64, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); - -// Block false IFEQ.i.i.i (label_false_IFEQ_i_i_i) -std::vector ptr_67_params; -ptr_67_params.push_back(ptr_52); -ptr_67_params.push_back(ptr_55); -ptr_67_params.push_back(ptr_58); -ptr_67_params.push_back(const_int32_36); -ptr_67_params.push_back(const_int32_36); -CallInst* ptr_67 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_67_params.begin(), ptr_67_params.end(), "", label_false_IFEQ_i_i_i); -ptr_67->setCallingConv(CallingConv::C); -ptr_67->setTailCall(true); -AttrListPtr ptr_67_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_67_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_67->setAttributes(ptr_67_PAL); - -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFEQ_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_69 = PHINode::Create(PointerTy_28, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -ptr_69->reserveOperandSpace(2); -ptr_69->addIncoming(ptr_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -ptr_69->addIncoming(ptr_67, label_false_IFEQ_i_i_i); - -std::vector ptr_70_indices; -ptr_70_indices.push_back(const_int32_36); -ptr_70_indices.push_back(const_int32_36); -Instruction* ptr_70 = GetElementPtrInst::Create(ptr_69, ptr_70_indices.begin(), ptr_70_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_29, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); - new StoreInst(ptr__c_i, ptr_70, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr_tmp1 = new BitCastInst(ptr_69, 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); -return func_gcmalloc; +return 0; } Modified: vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc?rev=119356&r1=119355&r2=119356&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Tue Nov 16 12:15:00 2010 @@ -2,1914 +2,5 @@ Function* makeLLVMFunction(Module *mod) { - -// Type Definitions -PointerType* PointerTy_0 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); - -std::vectorFuncTy_1_args; -FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_1_args.push_back(PointerTy_0); -FunctionType* FuncTy_1 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_1_args, - /*isVarArg=*/false); - -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_7_args, - /*isVarArg=*/true); - -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()); - - -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_29 = PointerType::get(ArrayTy_VT, 0); - -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_28 = PointerType::get(StructTy_JavaObject, 0); - -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_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_llvm_frameaddress = Function::Create( - /*Type=*/FuncTy_3, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*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_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_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_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 - -Function* func_gcmalloc = Function::Create( - /*Type=*/FuncTy_1, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"gcmalloc", mod); -func_gcmalloc->setCallingConv(CallingConv::C); -AttrListPtr func_gcmalloc_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_gcmalloc->setAttributes(func_gcmalloc_PAL); -Function::arg_iterator args = func_gcmalloc->arg_begin(); -Value* int32_sz = args++; -int32_sz->setName("sz"); -Value* ptr_VT = args++; -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_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_173_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -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); - -// 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; + return 0; } From gael.thomas at lip6.fr Tue Nov 16 10:15:29 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 16 Nov 2010 18:15:29 -0000 Subject: [vmkit-commits] [vmkit] r119357 - in /vmkit/trunk: include/j3/J3Intrinsics.h include/mvm/JIT.h lib/J3/Compiler/J3Intrinsics.cpp lib/J3/LLVMRuntime/Makefile lib/J3/LLVMRuntime/runtime-default-thread.ll lib/J3/LLVMRuntime/runtime-default.ll lib/J3/LLVMRuntime/runtime-mmtk-thread.ll lib/Mvm/Compiler/JIT.cpp lib/Mvm/Compiler/LLVMRuntime.ll lib/Mvm/Compiler/Makefile lib/Mvm/Compiler/mvm-runtime.ll lib/Mvm/Compiler/runtime-default-thread.ll lib/Mvm/Compiler/runtime-mmtk-thread.ll Message-ID: <20101116181529.8B7DF2A6C12C@llvm.org> Author: gthomas Date: Tue Nov 16 12:15:29 2010 New Revision: 119357 URL: http://llvm.org/viewvc/llvm-project?rev=119357&view=rev Log: move mvm runtime types in mvm Added: vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll - copied, changed from r119356, vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll - copied, changed from r119356, vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll - copied, changed from r119356, vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll Modified: vmkit/trunk/include/j3/J3Intrinsics.h vmkit/trunk/include/mvm/JIT.h vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/J3/LLVMRuntime/Makefile vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll vmkit/trunk/lib/Mvm/Compiler/JIT.cpp vmkit/trunk/lib/Mvm/Compiler/Makefile Modified: vmkit/trunk/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=119357&r1=119356&r2=119357&view=diff ============================================================================== --- vmkit/trunk/include/j3/J3Intrinsics.h (original) +++ vmkit/trunk/include/j3/J3Intrinsics.h Tue Nov 16 12:15:29 2010 @@ -28,7 +28,6 @@ const llvm::Type* JavaArrayDoubleType; const llvm::Type* JavaArrayObjectType; - const llvm::Type* VTType; const llvm::Type* JavaObjectType; const llvm::Type* JavaArrayType; const llvm::Type* JavaCommonClassType; @@ -42,7 +41,6 @@ const llvm::Type* JavaFieldType; const llvm::Type* AttributType; const llvm::Type* JavaThreadType; - const llvm::Type* MutatorThreadType; #ifdef ISOLATE_SHARING const llvm::Type* JnjvmType; Modified: vmkit/trunk/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=119357&r1=119356&r2=119357&view=diff ============================================================================== --- vmkit/trunk/include/mvm/JIT.h (original) +++ vmkit/trunk/include/mvm/JIT.h Tue Nov 16 12:15:29 2010 @@ -172,6 +172,9 @@ const llvm::PointerType* ptrPtrType; const llvm::Type* arrayPtrType; const llvm::Type* pointerSizeType; + + const llvm::Type* MutatorThreadType; + const llvm::Type* VTType; }; Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=119357&r1=119356&r2=119357&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Tue Nov 16 12:15:29 2010 @@ -35,7 +35,6 @@ BaseIntrinsics(module) { j3::llvm_runtime::makeLLVMModuleContents(module); - VTType = PointerType::getUnqual(module->getTypeByName("VT")); LLVMContext& Context = module->getContext(); #ifdef ISOLATE_SHARING @@ -90,8 +89,6 @@ PointerType::getUnqual(module->getTypeByName("Attribut")); JavaThreadType = PointerType::getUnqual(module->getTypeByName("JavaThread")); - MutatorThreadType = - PointerType::getUnqual(module->getTypeByName("MutatorThread")); CodeLineInfoType = PointerType::getUnqual(module->getTypeByName("CodeLineInfo")); Modified: vmkit/trunk/lib/J3/LLVMRuntime/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/Makefile?rev=119357&r1=119356&r2=119357&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/Makefile (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/Makefile Tue Nov 16 12:15:29 2010 @@ -10,13 +10,8 @@ include $(LEVEL)/Makefile.config -VMKIT_RUNTIME = $(PROJ_SRC_DIR)/runtime-default.ll - -ifeq ($(GC_MMTK), 1) -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-mmtk-thread.ll -else -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-default-thread.ll -endif +VMKIT_RUNTIME = $(PROJ_SRC_DIR)/../../Mvm/Compiler/LLVMRuntime.gen.ll \ + $(PROJ_SRC_DIR)/runtime-default.ll ifeq ($(ISOLATE_BUILD), 1) VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-isolate.ll Removed: 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=119356&view=auto ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll (removed) @@ -1,2 +0,0 @@ -;;; 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=119357&r1=119356&r2=119357&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Tue Nov 16 12:15:29 2010 @@ -2,9 +2,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;; Type definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; A virtual table is an array of function pointers. -%VT = type [0 x i32 (...)*] - ;;; The root of all Java Objects: a VT and a lock. %JavaObject = type { %VT*, i8* } @@ -27,23 +24,6 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } -%CircularBase = type { %VT*, %CircularBase*, %CircularBase* } - -;;; Field 0: the parent (circular base) -;;; Field 1: size_t IsolateID -;;; Field 2: void* MyVM -;;; Field 3: void* baseSP -;;; Field 4: char doYield -;;; Field 5: char inRV -;;; Field 6: char joinedRV -;;; Field 7: void* lastSP -;;; Field 8: void* internalThreadID -;;; field 9: void* routine -;;; field 10: void* lastKnownFrame -;;; field 11: void* lastExceptionBuffer -;;; field 12: void* vmData -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } - %JavaThread = type { %MutatorThread, i8*, %JavaObject* } Removed: 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=119356&view=auto ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (removed) @@ -1,7 +0,0 @@ -%BumpPtrAllocator = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* } - -;;; Field 0: the thread -;;; field 1: allocator -;;; field 2: MutatorContext -;;; field 3: realRoutine -%MutatorThread = type { %Thread, %BumpPtrAllocator, i8*, i8* } Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=119357&r1=119356&r2=119357&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Tue Nov 16 12:15:29 2010 @@ -322,6 +322,9 @@ assert(AllocateUnresolvedFunction && "No allocateUnresolved function"); AddFinalizationCandidate = module->getFunction("addFinalizationCandidate"); assert(AddFinalizationCandidate && "No addFinalizationCandidate function"); + + VTType = PointerType::getUnqual(module->getTypeByName("VT")); + MutatorThreadType = PointerType::getUnqual(module->getTypeByName("MutatorThread")); } const llvm::TargetData* MvmModule::TheTargetData; Removed: vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll?rev=119356&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll (original) +++ vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll (removed) @@ -1,87 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Common types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; A virtual table is an array of function pointers. -%VT = type [0 x i32 (...)*] - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Printing functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @printFloat(float) -declare void @printDouble(double) -declare void @printLong(i64) -declare void @printInt(i32) -declare void @printObject(i8*) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exceptions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @_Unwind_Resume_or_Rethrow(i8*) -declare i8* @llvm.eh.exception() nounwind -declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind -declare i64 @llvm.eh.selector.i64(i8*, i8*, ...) nounwind -declare void @__gxx_personality_v0() -declare i8* @__cxa_begin_catch(i8*) -declare void @__cxa_end_catch() -declare i32 @setjmp(i8*) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Math ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare double @llvm.sqrt.f64(double) nounwind -declare double @llvm.sin.f64(double) nounwind -declare double @llvm.cos.f64(double) nounwind -declare double @tan(double) -declare double @asin(double) -declare double @acos(double) -declare double @atan(double) -declare double @exp(double) -declare double @log(double) -declare double @ceil(double) -declare double @floor(double) -declare double @cbrt(double) -declare double @cosh(double) -declare double @expm1(double) -declare double @log10(double) -declare double @log1p(double) -declare double @sinh(double) -declare double @tanh(double) -declare double @fabs(double) -declare double @rint(double) -declare double @hypot(double, double) -declare double @pow(double, double) -declare double @atan2(double, double) -declare float @fabsf(float) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Memory ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @llvm.memcpy.i32(i8 *, i8 *, i32, i32) nounwind -declare void @llvm.memset.i32(i8 *, i8, i32, i32) nounwind -declare i8* @llvm.frameaddress(i32) nounwind readnone - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Atomic ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8*, i8, i8) nounwind -declare i16 @llvm.atomic.cmp.swap.i16.p0i16(i16*, i16, i16) nounwind -declare i32 @llvm.atomic.cmp.swap.i32.p0i32(i32*, i32, i32) nounwind -declare i64 @llvm.atomic.cmp.swap.i64.p0i64(i64*, i64, i64) nounwind - -declare void @unconditionalSafePoint() nounwind -declare void @conditionalSafePoint() nounwind - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @llvm.gcroot(i8**, i8*) -declare i8* @gcmalloc(i32, i8*) -declare i8* @gcmallocUnresolved(i32, i8*) -declare void @addFinalizationCandidate(i8*) Modified: vmkit/trunk/lib/Mvm/Compiler/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/Makefile?rev=119357&r1=119356&r2=119357&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/Makefile (original) +++ vmkit/trunk/lib/Mvm/Compiler/Makefile Tue Nov 16 12:15:29 2010 @@ -16,7 +16,14 @@ LIBRARYNAME = MvmCompiler endif -VMKIT_RUNTIME = $(PROJ_SRC_DIR)/LLVMRuntime.ll +VMKIT_RUNTIME = $(PROJ_SRC_DIR)/mvm-runtime.ll + +ifeq ($(GC_MMTK), 1) +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-mmtk-thread.ll +else +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-default-thread.ll +endif + BUILT_SOURCES = LLVMRuntime.inc include $(LEVEL)/Makefile.common Copied: vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll (from r119356, vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll) URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll?p2=vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll&p1=vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll&r1=119356&r2=119357&rev=119357&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll (original) +++ vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll Tue Nov 16 12:15:29 2010 @@ -5,6 +5,23 @@ ;;; A virtual table is an array of function pointers. %VT = type [0 x i32 (...)*] +%CircularBase = type { %VT*, %CircularBase*, %CircularBase* } + +;;; Field 0: the parent (circular base) +;;; Field 1: size_t IsolateID +;;; Field 2: void* MyVM +;;; Field 3: void* baseSP +;;; Field 4: char doYield +;;; Field 5: char inRV +;;; Field 6: char joinedRV +;;; Field 7: void* lastSP +;;; Field 8: void* internalThreadID +;;; field 9: void* routine +;;; field 10: void* lastKnownFrame +;;; field 11: void* lastExceptionBuffer +;;; field 12: void* vmData +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Printing functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copied: vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll (from r119356, vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll) URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll?p2=vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll&p1=vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll&r1=119356&r2=119357&rev=119357&view=diff ============================================================================== (empty) Copied: vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll (from r119356, vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll) URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll?p2=vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll&p1=vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll&r1=119356&r2=119357&rev=119357&view=diff ============================================================================== (empty) From gael.thomas at lip6.fr Tue Nov 16 10:32:42 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 16 Nov 2010 18:32:42 -0000 Subject: [vmkit-commits] [vmkit] r119361 - in /vmkit/trunk: ./ include/j3/ include/mvm/ include/mvm/Threads/ lib/J3/Compiler/ lib/J3/LLVMRuntime/ lib/Mvm/Compiler/ mmtk/config/copyms/ mmtk/config/marksweep/ Message-ID: <20101116183242.D2C582A6C12C@llvm.org> Author: gthomas Date: Tue Nov 16 12:32:42 2010 New Revision: 119361 URL: http://llvm.org/viewvc/llvm-project?rev=119361&view=rev Log: Revert to the commit 119042, I thought that I was working in the branch multi-vm with git-svn. Added: vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll - copied unchanged from r119042, vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll - copied unchanged from r119042, vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll - copied unchanged from r119042, vmkit/trunk/lib/Mvm/Compiler/LLVMRuntime.ll Removed: vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll Modified: vmkit/trunk/Makefile.rules vmkit/trunk/include/j3/J3Intrinsics.h vmkit/trunk/include/mvm/JIT.h vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/J3/LLVMRuntime/Makefile vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll vmkit/trunk/lib/Mvm/Compiler/JIT.cpp vmkit/trunk/lib/Mvm/Compiler/Makefile vmkit/trunk/mmtk/config/copyms/MMTkInline.inc vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Nov 16 12:32:42 2010 @@ -1,4 +1,3 @@ - ifdef VMKIT_RUNTIME Modified: vmkit/trunk/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/include/j3/J3Intrinsics.h (original) +++ vmkit/trunk/include/j3/J3Intrinsics.h Tue Nov 16 12:32:42 2010 @@ -28,6 +28,7 @@ const llvm::Type* JavaArrayDoubleType; const llvm::Type* JavaArrayObjectType; + const llvm::Type* VTType; const llvm::Type* JavaObjectType; const llvm::Type* JavaArrayType; const llvm::Type* JavaCommonClassType; @@ -41,6 +42,7 @@ const llvm::Type* JavaFieldType; const llvm::Type* AttributType; const llvm::Type* JavaThreadType; + const llvm::Type* MutatorThreadType; #ifdef ISOLATE_SHARING const llvm::Type* JnjvmType; Modified: vmkit/trunk/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/include/mvm/JIT.h (original) +++ vmkit/trunk/include/mvm/JIT.h Tue Nov 16 12:32:42 2010 @@ -172,9 +172,6 @@ const llvm::PointerType* ptrPtrType; const llvm::Type* arrayPtrType; const llvm::Type* pointerSizeType; - - const llvm::Type* MutatorThreadType; - const llvm::Type* VTType; }; Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Tue Nov 16 12:32:42 2010 @@ -196,6 +196,10 @@ /// char doYield; + /// vmData - vm specific data + /// + // void* vmData; + /// inRV - Flag to tell that the thread is being part of a rendezvous. /// char inRV; @@ -391,11 +395,6 @@ void startKnownFrame(KnownFrame& F) __attribute__ ((noinline)); void endKnownFrame(); - - - /// vmData - vm specific data - /// - void* vmData; }; #ifndef RUNTIME_DWARF_EXCEPTIONS Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Tue Nov 16 12:32:42 2010 @@ -35,6 +35,7 @@ BaseIntrinsics(module) { j3::llvm_runtime::makeLLVMModuleContents(module); + VTType = PointerType::getUnqual(module->getTypeByName("VT")); LLVMContext& Context = module->getContext(); #ifdef ISOLATE_SHARING @@ -89,6 +90,8 @@ PointerType::getUnqual(module->getTypeByName("Attribut")); JavaThreadType = PointerType::getUnqual(module->getTypeByName("JavaThread")); + MutatorThreadType = + PointerType::getUnqual(module->getTypeByName("MutatorThread")); CodeLineInfoType = PointerType::getUnqual(module->getTypeByName("CodeLineInfo")); Modified: vmkit/trunk/lib/J3/LLVMRuntime/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/Makefile?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/Makefile (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/Makefile Tue Nov 16 12:32:42 2010 @@ -10,8 +10,13 @@ include $(LEVEL)/Makefile.config -VMKIT_RUNTIME = $(PROJ_SRC_DIR)/../../Mvm/Compiler/LLVMRuntime.gen.ll \ - $(PROJ_SRC_DIR)/runtime-default.ll +VMKIT_RUNTIME = $(PROJ_SRC_DIR)/runtime-default.ll + +ifeq ($(GC_MMTK), 1) +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-mmtk-thread.ll +else +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-default-thread.ll +endif ifeq ($(ISOLATE_BUILD), 1) VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-isolate.ll 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=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Tue Nov 16 12:32:42 2010 @@ -2,6 +2,9 @@ ;;;;;;;;;;;;;;;;;;;;;;;; Type definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; A virtual table is an array of function pointers. +%VT = type [0 x i32 (...)*] + ;;; The root of all Java Objects: a VT and a lock. %JavaObject = type { %VT*, i8* } @@ -24,6 +27,23 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } +%CircularBase = type { %VT*, %CircularBase*, %CircularBase* } + +;;; Field 0: the parent (circular base) +;;; Field 1: size_t IsolateID +;;; Field 2: void* MyVM +;;; Field 3: void* baseSP +;;; Field 4: char doYield +;;; field 5: void* vmData +;;; Field 6: char inRV +;;; Field 7: char joinedRV +;;; Field 8: void* lastSP +;;; Field 9: void* internalThreadID +;;; field 10: void* routine +;;; field 11: void* lastKnownFrame +;;; field 12: void* lastExceptionBuffer +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8* } + %JavaThread = type { %MutatorThread, i8*, %JavaObject* } Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Tue Nov 16 12:32:42 2010 @@ -322,9 +322,6 @@ assert(AllocateUnresolvedFunction && "No allocateUnresolved function"); AddFinalizationCandidate = module->getFunction("addFinalizationCandidate"); assert(AddFinalizationCandidate && "No addFinalizationCandidate function"); - - VTType = PointerType::getUnqual(module->getTypeByName("VT")); - MutatorThreadType = PointerType::getUnqual(module->getTypeByName("MutatorThread")); } const llvm::TargetData* MvmModule::TheTargetData; Modified: vmkit/trunk/lib/Mvm/Compiler/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/Makefile?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/Makefile (original) +++ vmkit/trunk/lib/Mvm/Compiler/Makefile Tue Nov 16 12:32:42 2010 @@ -16,14 +16,7 @@ LIBRARYNAME = MvmCompiler endif -VMKIT_RUNTIME = $(PROJ_SRC_DIR)/mvm-runtime.ll - -ifeq ($(GC_MMTK), 1) -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-mmtk-thread.ll -else -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-default-thread.ll -endif - +VMKIT_RUNTIME = $(PROJ_SRC_DIR)/LLVMRuntime.ll BUILT_SOURCES = LLVMRuntime.inc include $(LEVEL)/Makefile.common Removed: vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll?rev=119360&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll (original) +++ vmkit/trunk/lib/Mvm/Compiler/mvm-runtime.ll (removed) @@ -1,104 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Common types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; A virtual table is an array of function pointers. -%VT = type [0 x i32 (...)*] - -%CircularBase = type { %VT*, %CircularBase*, %CircularBase* } - -;;; Field 0: the parent (circular base) -;;; Field 1: size_t IsolateID -;;; Field 2: void* MyVM -;;; Field 3: void* baseSP -;;; Field 4: char doYield -;;; Field 5: char inRV -;;; Field 6: char joinedRV -;;; Field 7: void* lastSP -;;; Field 8: void* internalThreadID -;;; field 9: void* routine -;;; field 10: void* lastKnownFrame -;;; field 11: void* lastExceptionBuffer -;;; field 12: void* vmData -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Printing functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @printFloat(float) -declare void @printDouble(double) -declare void @printLong(i64) -declare void @printInt(i32) -declare void @printObject(i8*) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exceptions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @_Unwind_Resume_or_Rethrow(i8*) -declare i8* @llvm.eh.exception() nounwind -declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind -declare i64 @llvm.eh.selector.i64(i8*, i8*, ...) nounwind -declare void @__gxx_personality_v0() -declare i8* @__cxa_begin_catch(i8*) -declare void @__cxa_end_catch() -declare i32 @setjmp(i8*) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Math ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare double @llvm.sqrt.f64(double) nounwind -declare double @llvm.sin.f64(double) nounwind -declare double @llvm.cos.f64(double) nounwind -declare double @tan(double) -declare double @asin(double) -declare double @acos(double) -declare double @atan(double) -declare double @exp(double) -declare double @log(double) -declare double @ceil(double) -declare double @floor(double) -declare double @cbrt(double) -declare double @cosh(double) -declare double @expm1(double) -declare double @log10(double) -declare double @log1p(double) -declare double @sinh(double) -declare double @tanh(double) -declare double @fabs(double) -declare double @rint(double) -declare double @hypot(double, double) -declare double @pow(double, double) -declare double @atan2(double, double) -declare float @fabsf(float) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Memory ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @llvm.memcpy.i32(i8 *, i8 *, i32, i32) nounwind -declare void @llvm.memset.i32(i8 *, i8, i32, i32) nounwind -declare i8* @llvm.frameaddress(i32) nounwind readnone - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Atomic ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8*, i8, i8) nounwind -declare i16 @llvm.atomic.cmp.swap.i16.p0i16(i16*, i16, i16) nounwind -declare i32 @llvm.atomic.cmp.swap.i32.p0i32(i32*, i32, i32) nounwind -declare i64 @llvm.atomic.cmp.swap.i64.p0i64(i64*, i64, i64) nounwind - -declare void @unconditionalSafePoint() nounwind -declare void @conditionalSafePoint() nounwind - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @llvm.gcroot(i8**, i8*) -declare i8* @gcmalloc(i32, i8*) -declare i8* @gcmallocUnresolved(i32, i8*) -declare void @addFinalizationCandidate(i8*) Removed: vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll?rev=119360&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll (original) +++ vmkit/trunk/lib/Mvm/Compiler/runtime-default-thread.ll (removed) @@ -1,2 +0,0 @@ -;;; Field 0: the thread -%MutatorThread = type { %Thread } Removed: vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll?rev=119360&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll (original) +++ vmkit/trunk/lib/Mvm/Compiler/runtime-mmtk-thread.ll (removed) @@ -1,7 +0,0 @@ -%BumpPtrAllocator = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* } - -;;; Field 0: the thread -;;; field 1: allocator -;;; field 2: MutatorContext -;;; field 3: realRoutine -%MutatorThread = type { %Thread, %BumpPtrAllocator, i8*, i8* } Modified: vmkit/trunk/mmtk/config/copyms/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/copyms/MMTkInline.inc?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/copyms/MMTkInline.inc (original) +++ vmkit/trunk/mmtk/config/copyms/MMTkInline.inc Tue Nov 16 12:32:42 2010 @@ -2,5 +2,541 @@ Function* makeLLVMFunction(Module *mod) { -return 0; + +// Type Definitions +PointerType* PointerTy_0 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); + +std::vectorFuncTy_1_args; +FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_1_args.push_back(PointerTy_0); +FunctionType* FuncTy_1 = FunctionType::get( + /*Result=*/PointerTy_0, + /*Params=*/FuncTy_1_args, + /*isVarArg=*/false); + +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_7_args, + /*isVarArg=*/true); + +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_gcRoot_fields; +StructTy_struct_gcRoot_fields.push_back(PointerTy_5); +StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); +mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); + +PointerType* PointerTy_11 = PointerType::get(StructTy_struct_gcRoot, 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; +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__CollectionRV_fields; +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)); +StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 8)); +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__VirtualMachine_fields.push_back(StructTy_struct_mvm__CollectionRV); +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()); + + +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); +StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_mvm__SpinLock); +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_29 = PointerType::get(ArrayTy_VT, 0); + +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_28 = PointerType::get(StructTy_JavaObject, 0); + +PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); + +PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); + +PointerType* PointerTy_31 = PointerType::get(PointerTy_29, 0); + +std::vectorFuncTy_33_args; +FuncTy_33_args.push_back(PointerTy_28); +FuncTy_33_args.push_back(PointerTy_28); +FuncTy_33_args.push_back(PointerTy_28); +FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_33 = FunctionType::get( + /*Result=*/PointerTy_28, + /*Params=*/FuncTy_33_args, + /*isVarArg=*/false); + +PointerType* PointerTy_32 = PointerType::get(FuncTy_33, 0); + + +// Function Declarations + +Function* func_llvm_frameaddress = Function::Create( + /*Type=*/FuncTy_3, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*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_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( + /*Type=*/FuncTy_33, + /*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_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); + +// Global Variable Declarations + +// Constant Definitions +ConstantInt* const_int32_34 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_35 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_36 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_37 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_38 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_39 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_40 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); + +// Global Variable Definitions + +Function* func_gcmalloc = Function::Create( + /*Type=*/FuncTy_1, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"gcmalloc", mod); +func_gcmalloc->setCallingConv(CallingConv::C); +AttrListPtr func_gcmalloc_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_gcmalloc->setAttributes(func_gcmalloc_PAL); +Function::arg_iterator args = func_gcmalloc->arg_begin(); +Value* int32_sz = args++; +int32_sz->setName("sz"); +Value* ptr_VT = args++; +ptr_VT->setName("VT"); + +BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",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 = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i",func_gcmalloc,0); +BasicBlock* label_false_IFEQ_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.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_41 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_34, "", label_entry); +BinaryOperator* int32_42 = BinaryOperator::Create(Instruction::And, int32_41, const_int32_35, "", label_entry); +CallInst* ptr_43 = CallInst::Create(func_llvm_frameaddress, const_int32_36, "", label_entry); +ptr_43->setCallingConv(CallingConv::C); +ptr_43->setTailCall(true); +AttrListPtr ptr_43_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_43_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_43->setAttributes(ptr_43_PAL); + +CastInst* int32_44 = new PtrToIntInst(ptr_43, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_45 = BinaryOperator::Create(Instruction::And, int32_44, const_int32_37, "", label_entry); +CastInst* ptr_46 = new IntToPtrInst(int32_45, PointerTy_4, "", label_entry); +std::vector ptr_47_indices; +ptr_47_indices.push_back(const_int32_36); +ptr_47_indices.push_back(const_int32_38); +Instruction* ptr_47 = GetElementPtrInst::Create(ptr_46, ptr_47_indices.begin(), ptr_47_indices.end(), "", label_entry); +LoadInst* int32_48 = new LoadInst(ptr_47, "", false, label_entry); +CastInst* ptr_49 = new IntToPtrInst(int32_48, PointerTy_26, "", label_entry); +GetElementPtrInst* ptr_50 = GetElementPtrInst::Create(ptr_49, const_int32_39, "", label_entry); +CastInst* ptr_51 = new BitCastInst(ptr_50, PointerTy_27, "", label_entry); +LoadInst* ptr_52 = new LoadInst(ptr_51, "", false, label_entry); +GetElementPtrInst* ptr_53 = GetElementPtrInst::Create(ptr_52, const_int32_40, "", label_entry); +CastInst* ptr_54 = new BitCastInst(ptr_53, PointerTy_27, "", label_entry); +LoadInst* ptr_55 = new LoadInst(ptr_54, "", false, label_entry); +CastInst* int32_56 = new PtrToIntInst(ptr_55, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_57 = BinaryOperator::Create(Instruction::Add, int32_56, int32_42, "", label_entry); +CastInst* ptr_58 = new IntToPtrInst(int32_57, PointerTy_28, "", label_entry); +std::vector ptr_59_indices; +ptr_59_indices.push_back(const_int32_40); +ptr_59_indices.push_back(const_int32_40); +Instruction* ptr_59 = GetElementPtrInst::Create(ptr_52, ptr_59_indices.begin(), ptr_59_indices.end(), "", label_entry); +LoadInst* ptr_60 = new LoadInst(ptr_59, "", false, label_entry); +CastInst* ptr_61 = new BitCastInst(ptr_60, PointerTy_28, "", label_entry); +ICmpInst* int1_62 = new ICmpInst(*label_entry, ICmpInst::ICMP_UGT, ptr_58, ptr_61, ""); +BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_62, label_entry); + +// Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i) +std::vector ptr_64_indices; +ptr_64_indices.push_back(const_int32_40); +ptr_64_indices.push_back(const_int32_36); +Instruction* ptr_64 = GetElementPtrInst::Create(ptr_52, ptr_64_indices.begin(), ptr_64_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_57, PointerTy_29, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); + new StoreInst(ptr__c_i_i_i, ptr_64, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); + +// Block false IFEQ.i.i.i (label_false_IFEQ_i_i_i) +std::vector ptr_67_params; +ptr_67_params.push_back(ptr_52); +ptr_67_params.push_back(ptr_55); +ptr_67_params.push_back(ptr_58); +ptr_67_params.push_back(const_int32_36); +ptr_67_params.push_back(const_int32_36); +CallInst* ptr_67 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_67_params.begin(), ptr_67_params.end(), "", label_false_IFEQ_i_i_i); +ptr_67->setCallingConv(CallingConv::C); +ptr_67->setTailCall(true); +AttrListPtr ptr_67_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_67_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_67->setAttributes(ptr_67_PAL); + +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFEQ_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_69 = PHINode::Create(PointerTy_28, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_69->reserveOperandSpace(2); +ptr_69->addIncoming(ptr_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +ptr_69->addIncoming(ptr_67, label_false_IFEQ_i_i_i); + +std::vector ptr_70_indices; +ptr_70_indices.push_back(const_int32_36); +ptr_70_indices.push_back(const_int32_36); +Instruction* ptr_70 = GetElementPtrInst::Create(ptr_69, ptr_70_indices.begin(), ptr_70_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_29, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); + new StoreInst(ptr__c_i, ptr_70, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr_tmp1 = new BitCastInst(ptr_69, 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); +return func_gcmalloc; } Modified: vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc?rev=119361&r1=119360&r2=119361&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Tue Nov 16 12:32:42 2010 @@ -2,5 +2,1914 @@ Function* makeLLVMFunction(Module *mod) { - return 0; + +// Type Definitions +PointerType* PointerTy_0 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); + +std::vectorFuncTy_1_args; +FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_1_args.push_back(PointerTy_0); +FunctionType* FuncTy_1 = FunctionType::get( + /*Result=*/PointerTy_0, + /*Params=*/FuncTy_1_args, + /*isVarArg=*/false); + +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_7_args, + /*isVarArg=*/true); + +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()); + + +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_29 = PointerType::get(ArrayTy_VT, 0); + +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_28 = PointerType::get(StructTy_JavaObject, 0); + +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_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_llvm_frameaddress = Function::Create( + /*Type=*/FuncTy_3, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*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_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_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_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 + +Function* func_gcmalloc = Function::Create( + /*Type=*/FuncTy_1, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"gcmalloc", mod); +func_gcmalloc->setCallingConv(CallingConv::C); +AttrListPtr func_gcmalloc_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +func_gcmalloc->setAttributes(func_gcmalloc_PAL); +Function::arg_iterator args = func_gcmalloc->arg_begin(); +Value* int32_sz = args++; +int32_sz->setName("sz"); +Value* ptr_VT = args++; +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_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_173_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +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); + +// 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 Tue Nov 16 12:23:44 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 16 Nov 2010 20:23:44 -0000 Subject: [vmkit-commits] [vmkit] r119377 - in /vmkit/branches/precise: include/mvm/Threads/ObjectLocks.h lib/J3/Classpath/ClasspathVMSystem.inc lib/J3/Classpath/ClasspathVMThread.inc lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/JavaRuntimeJIT.cpp lib/J3/VMCore/ReferenceQueue.cpp lib/J3/VMCore/ReferenceQueue.h lib/Mvm/CommonThread/ObjectLocks.cpp lib/Mvm/CommonThread/Sigsegv.cpp lib/Mvm/CommonThread/ctthread.cpp Message-ID: <20101116202344.4A6162A6C12C@llvm.org> Author: geoffray Date: Tue Nov 16 14:23:43 2010 New Revision: 119377 URL: http://llvm.org/viewvc/llvm-project?rev=119377&view=rev Log: Fix interface calls, class resolution, thread initialisation, and object locking. Multi-threading with a copying collector now works! Modified: vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystem.inc vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.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/JavaJITCompiler.cpp vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp Modified: vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h?rev=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h (original) +++ vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h Tue Nov 16 14:23:43 2010 @@ -89,6 +89,7 @@ friend class LockSystem; friend class LockingThread; + friend class ThinLock; }; @@ -154,7 +155,7 @@ /// initialise - Initialise the value of the lock. /// - static void initialise(gc* object, LockSystem& table); + static void removeFatLock(FatLock* fatLock, LockSystem& table); /// overflowThinlock - Change the lock of this object to a fat lock because /// we have reached 0xFF locks. Modified: vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystem.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystem.inc?rev=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystem.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMSystem.inc Tue Nov 16 14:23:43 2010 @@ -35,6 +35,8 @@ llvm_gcroot(src, 0); llvm_gcroot(dst, 0); llvm_gcroot(cur, 0); + assert(src->getVirtualTable()); + assert(dst->getVirtualTable()); JavaThread* th = JavaThread::get(); Jnjvm *vm = th->getJVM(); 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathVMThread.inc Tue Nov 16 14:23:43 2010 @@ -40,6 +40,10 @@ llvm_gcroot(javaThread, 0); Jnjvm* vm = thread->getJVM(); + // Wait some time to let the creator initialise these fields. + while ((thread->javaThread == NULL) || (thread->vmThread == NULL)) { + mvm::Thread::yield(); + } // Ok, now that the thread is created we can set the the value of vmdata, // which is the JavaThread object. @@ -90,9 +94,10 @@ assert(javaThread && "VMThread with no Java equivalent"); JavaThread* th = new JavaThread(vm); - th->initialise(javaThread, vmThread); if (!th) vm->outOfMemoryError(); th->start((void (*)(mvm::Thread*))start); + // Now that the thread has been created, initialise its object fields. + th->initialise(javaThread, vmThread); END_NATIVE_EXCEPTION } 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Nov 16 14:23:43 2010 @@ -1484,6 +1484,7 @@ if (!VT->IMT) { Elemts.push_back(Constant::getNullValue(PTy)); } else { + // TODO: add a null element at the end to diagnose errors. Class* cl = classDef->asClass(); assert(cl && "Not a class"); std::set contents[InterfaceMethodTable::NumIndexes]; 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.cpp Tue Nov 16 14:23:43 2010 @@ -2189,7 +2189,7 @@ } -void JavaJIT::invokeInterface(uint16 index, bool buggyVirtual) { +void JavaJIT::invokeInterface(uint16 index) { // Do the usual JavaConstantPool* ctpInfo = compilingClass->ctpInfo; @@ -2221,7 +2221,8 @@ targetObject = new LoadInst( targetObject, "", TheCompiler->useCooperativeGC(), currentBlock); JITVerifyNull(targetObject); -#if 1 + // TODO: The following code needs more testing. +#if 0 BasicBlock* endBlock = createBasicBlock("end interface invoke"); PHINode * node = PHINode::Create(virtualPtrType, "", endBlock); @@ -2317,9 +2318,12 @@ currentBlock = endBlock; #else - Value* Args[3] = { targetObject, Meth, Index }; - Value* node = CallInst::Create( - intrinsics->ResolveInterfaceFunction, Args, Args + 3, "", currentBlock); + std::vector Args; + Args.push_back(targetObject); + Args.push_back(Meth); + Args.push_back(Index); + Value* node = + invoke(intrinsics->ResolveInterfaceFunction, Args, "", currentBlock); node = new BitCastInst(node, virtualPtrType, "", currentBlock); #endif 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJIT.h Tue Nov 16 14:23:43 2010 @@ -448,10 +448,8 @@ /// invokeVirtual - Invoke a Java virtual method. void invokeVirtual(uint16 index); - /// invokeInterface - Invoke a Java interface method. The buggyVirtual - /// argument is for buggy java to bytecode compilers which emit a virtual - /// call instead of an interface call in some occasions. - void invokeInterface(uint16 index, bool buggyVirtual = false); + /// invokeInterface - Invoke a Java interface method. + void invokeInterface(uint16 index); /// invokeSpecial - Invoke an instance Java method directly. void invokeSpecial(uint16 index); 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/precise/lib/J3/Compiler/JavaJITCompiler.cpp Tue Nov 16 14:23:43 2010 @@ -272,6 +272,7 @@ std::set contents[InterfaceMethodTable::NumIndexes]; cl->fillIMT(contents); + for (uint32_t i = 0; i < InterfaceMethodTable::NumIndexes; ++i) { std::set& atIndex = contents[i]; @@ -300,7 +301,7 @@ if (OldMethod && OldMethod != Cmeth) SameMethod = false; else OldMethod = Cmeth; - if (Cmeth) methods.push_back(Cmeth); + methods.push_back(Cmeth); } if (SameMethod) { @@ -312,7 +313,8 @@ } } else { - uint32_t length = 2 * size * sizeof(uintptr_t); + // Add one to have a NULL-terminated table. + uint32_t length = (2 * size + 1) * sizeof(uintptr_t); uintptr_t* table = (uintptr_t*) cl->classLoader->allocator.Allocate(length, "IMT"); @@ -325,14 +327,16 @@ et = methods.end(); it != et; ++it, j += 2, ++Interf) { JavaMethod* Imeth = *Interf; JavaMethod* Cmeth = *it; + assert(Imeth != NULL); assert(j < 2 * size - 1); table[j] = (uintptr_t)Imeth; if (Cmeth) { - table[j + 1] = getPointerOrStub(*Cmeth, JavaMethod::Interface); + table[j + 1] = getPointerOrStub(*Cmeth, JavaMethod::Interface); } else { table[j + 1] = (uintptr_t)ThrowUnfoundInterface; } } + assert(Interf == atIndex.end()); } } } 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaClass.cpp Tue Nov 16 14:23:43 2010 @@ -765,14 +765,16 @@ interfaces[i]->fillIMT(meths); } - if (super) super->fillIMT(meths); + if (super != NULL) { + super->fillIMT(meths); + } - if (isInterface()) { + // Specification says that an invokeinterface also looks at j.l.Object. + if (isInterface() || (super == NULL)) { for (uint32 i = 0; i < nbVirtualMethods; ++i) { JavaMethod& meth = virtualMethods[i]; uint32_t index = InterfaceMethodTable::getIndex(meth.name, meth.type); - if (meths[index].find(&meth) == meths[index].end()) - meths[index].insert(&meth); + meths[index].insert(&meth); } } } @@ -924,12 +926,21 @@ #ifndef ISOLATE_SHARING +#ifdef ISOLATE +void Class::resolveClass() { + UNIMPLEMENTED(); +} +#else void Class::resolveClass() { if (isResolved() || isErroneous()) return; resolveParents(); loadExceptions(); - setResolved(); + // Do a compare and swap in case another thread initialized the class. + __sync_val_compare_and_swap( + &(getCurrentTaskClassMirror().status), loaded, resolved); + assert(isResolved() || isErroneous()); } +#endif #else void Class::resolveClass() { assert(status >= resolved && 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaRuntimeJIT.cpp Tue Nov 16 14:23:43 2010 @@ -16,6 +16,7 @@ #include "JavaString.h" #include "JavaThread.h" #include "JavaTypes.h" +#include "JavaUpcalls.h" #include "Jnjvm.h" #include "j3/OpcodeNames.def" @@ -750,12 +751,16 @@ uintptr_t result = NULL; InterfaceMethodTable* IMT = JavaObject::getClass(obj)->virtualVT->IMT; assert(JavaObject::instanceOf(obj, meth->classDef)); + assert(meth->classDef->isInterface() || + (meth->classDef == meth->classDef->classLoader->bootstrapLoader->upcalls->OfObject)); + assert(index == InterfaceMethodTable::getIndex(meth->name, meth->type)); if ((IMT->contents[index] & 1) == 0) { result = IMT->contents[index]; - } else { + } else { uintptr_t* table = (uintptr_t*)(IMT->contents[index] & ~1); uint32 i = 0; - while (table[i] != (uintptr_t)meth) { i += 2; } + while (table[i] != (uintptr_t)meth && table[i] != 0) { i += 2; } + assert(table[i] != 0); result = table[i + 1]; } assert((result != 0) && "Bad IMT"); Modified: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp?rev=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp Tue Nov 16 14:23:43 2010 @@ -71,6 +71,7 @@ void ReferenceThread::addToEnqueue(gc* obj) { + llvm_gcroot(obj, 0); if (ToEnqueueIndex >= ToEnqueueLength) { uint32 newLength = ToEnqueueLength * GROW_FACTOR; gc** newQueue = new gc*[newLength]; Modified: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h?rev=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h Tue Nov 16 14:23:43 2010 @@ -41,6 +41,7 @@ ReferenceQueue(uint8_t s) { References = new gc*[INITIAL_QUEUE_SIZE]; + memset(References, 0, INITIAL_QUEUE_SIZE * sizeof(gc*)); QueueLength = INITIAL_QUEUE_SIZE; CurrentIndex = 0; semantics = s; @@ -56,6 +57,7 @@ if (CurrentIndex >= QueueLength) { uint32 newLength = QueueLength * GROW_FACTOR; gc** newQueue = new gc*[newLength]; + memset(newQueue, 0, newLength * sizeof(gc*)); if (!newQueue) { fprintf(stderr, "I don't know how to handle reference overflow yet!\n"); abort(); 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Tue Nov 16 14:23:43 2010 @@ -26,6 +26,7 @@ void ThinLock::overflowThinLock(gc* object, LockSystem& table) { llvm_gcroot(object, 0); FatLock* obj = table.allocate(object); + uintptr_t ID = obj->getID(); obj->acquireAll(object, (ThinCountMask >> ThinCountShift) + 1); uintptr_t oldValue = 0; uintptr_t newValue = 0; @@ -33,14 +34,18 @@ do { oldValue = object->header; newValue = obj->getID() | (oldValue & NonLockBitsMask); + assert(obj->associatedObject == object); yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (yieldedValue != oldValue); + } while (((object->header) & ~NonLockBitsMask) != ID); + assert(obj->associatedObject == object); } /// initialise - Initialise the value of the lock. /// -void ThinLock::initialise(gc* object, LockSystem& table) { +void ThinLock::removeFatLock(FatLock* fatLock, LockSystem& table) { + gc* object = fatLock->associatedObject; llvm_gcroot(object, 0); + uintptr_t ID = fatLock->getID(); uintptr_t oldValue = 0; uintptr_t newValue = 0; uintptr_t yieldedValue = 0; @@ -48,7 +53,9 @@ oldValue = object->header; newValue = oldValue & NonLockBitsMask; yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); - } while (yieldedValue != oldValue); + } while (oldValue != yieldedValue); + assert((oldValue & NonLockBitsMask) != ID); + fatLock->associatedObject = NULL; } FatLock* ThinLock::changeToFatlock(gc* object, LockSystem& table) { @@ -60,61 +67,91 @@ uintptr_t oldValue = 0; uintptr_t newValue = 0; uintptr_t yieldedValue = 0; + uintptr_t ID = obj->getID(); do { oldValue = object->header; - newValue = obj->getID() | (oldValue & NonLockBitsMask); + newValue = ID | (oldValue & NonLockBitsMask); + assert(obj->associatedObject == object); yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (yieldedValue != oldValue); + } while (((object->header) & ~NonLockBitsMask) != ID); return obj; } else { FatLock* res = table.getFatLockFromID(object->header); assert(res && "Lock deallocated while held."); + assert(res->associatedObject == object); return res; } } +void printDebugMessage(gc* object, LockSystem& table) { + llvm_gcroot(object, 0); + fprintf(stderr, + "WARNING: [%p] has been waiting really long for %p (header = %x)\n", + (void*)mvm::Thread::get(), + (void*)object, + object->header); + FatLock* obj = table.getFatLockFromID(object->header); + if (obj != NULL) { + fprintf(stderr, + "WARNING: [%p] is waiting on fatlock %p. " + "Its associated object is %p. The owner is %p\n", + (void*)mvm::Thread::get(), + (void*)obj, + (void*)obj->getAssociatedObject(), + (void*)obj->owner()); + } +} + 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) { + if ((object->header & Thread::IDMask) == id) { assert(owner(object, table) && "Inconsistent lock"); - if ((yieldedValue & ThinCountMask) != ThinCountMask) { + if ((object->header & ThinCountMask) != ThinCountMask) { + uint32 count = object->header & ThinCountMask; do { oldValue = object->header; newValue = oldValue + ThinCountAdd; yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (oldValue != yieldedValue); + } while ((object->header & ThinCountMask) == count); } else { overflowThinLock(object, table); } assert(owner(object, table) && "Not owner after quitting acquire!"); return; } - + + do { + oldValue = object->header & NonLockBitsMask; + newValue = oldValue | id; + yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); + } while ((object->header & ~NonLockBitsMask) == 0); + + if (((object->header) & ~NonLockBitsMask) == id) { + assert(owner(object, table) && "Not owner after quitting acquire!"); + return; + } + + // Simple counter to lively diagnose possible dead locks in this code. + int counter = 0; while (true) { if (object->header & FatMask) { FatLock* obj = table.getFatLockFromID(object->header); if (obj != NULL) { if (obj->acquire(object)) { + assert(owner(object, table) && "Not owner after acquring fat lock!"); break; } } } - + + counter++; + if (counter == 1000) printDebugMessage(object, table); + while (object->header & ~NonLockBitsMask) { if (object->header & FatMask) { break; @@ -125,19 +162,22 @@ if ((object->header & ~NonLockBitsMask) == 0) { FatLock* obj = table.allocate(object); + obj->acquire(object); do { oldValue = object->header & NonLockBitsMask; newValue = oldValue | obj->getID(); + assert(obj->associatedObject == object); 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"); + if ((getFatLock(object, table) != obj)) { + assert((object->header & ~NonLockBitsMask) != obj->getID()); + obj->internalLock.unlock(); table.deallocate(obj); } else { - assert((getFatLock(object, table) == obj) && "Inconsistent lock"); + assert(owner(object, table) && "Inconsistent lock"); + break; } - assert(!owner(object, table) && "Inconsistent lock"); } } @@ -157,18 +197,19 @@ oldValue = object->header; newValue = oldValue & NonLockBitsMask; yieldedValue = __sync_val_compare_and_swap(&object->header, oldValue, newValue); - } while (yieldedValue != oldValue); + } while ((object->header & ~NonLockBitsMask) == id); } 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"); + uint32 count = (object->header & ThinCountMask); do { oldValue = object->header; newValue = oldValue - ThinCountAdd; yieldedValue = __sync_val_compare_and_swap(&(object->header), oldValue, newValue); - } while (yieldedValue != oldValue); + } while ((object->header & ThinCountMask) == count); } } @@ -196,7 +237,9 @@ } } -void FatLock::acquireAll(gc* obj, uint32 nb) { +void FatLock::acquireAll(gc* object, uint32 nb) { + assert(associatedObject == object); + llvm_gcroot(object, 0); internalLock.lockAll(nb); } @@ -210,6 +253,7 @@ FatLock::FatLock(uint32_t i, gc* a) { llvm_gcroot(a, 0); + assert(a != NULL); firstThread = NULL; index = i; associatedObject = a; @@ -228,7 +272,7 @@ assert(associatedObject == obj && "Mismatch object in lock"); if (!waitingThreads && !lockingThreads && internalLock.recursionCount() == 1) { - mvm::ThinLock::initialise(associatedObject, table); + mvm::ThinLock::removeFatLock(this, table); table.deallocate(this); } internalLock.unlock(); @@ -312,6 +356,7 @@ tab[internalIndex] = res; } + assert(res->associatedObject == obj); // Return the lock. return res; } 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/Sigsegv.cpp Tue Nov 16 14:23:43 2010 @@ -55,7 +55,7 @@ "\nthe VM.\n"); } else { fprintf(stderr, "Thread %p received a SIGSEGV: either the VM code or an external\n" - "native method is bogus. Aborting...\n", th); + "native method is bogus. Aborting...\n", (void*)th); } th->printBacktrace(); abort(); 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=119377&r1=119376&r2=119377&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp Tue Nov 16 14:23:43 2010 @@ -209,6 +209,94 @@ assert(addr && "No address to start with"); } + +#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(; curMyVM->rendezvous.addThread(th); assert(th->MyVM && "VM not set in a thread"); #ifdef ISOLATE th->IsolateID = th->MyVM->IsolateID; #endif + th->MyVM->rendezvous.addThread(th); th->routine(th); th->MyVM->removeThread(th); delete th; @@ -342,6 +430,8 @@ pthread_attr_init(&attributs); pthread_attr_setstack(&attributs, this, STACK_SIZE); routine = fct; + // Make sure to add it in the list of threads before leaving this function: + // the garbage collector wants to trace this thread. MyVM->addThread(this); int res = pthread_create((pthread_t*)(void*)(&internalThreadID), &attributs, (void* (*)(void *))internalThreadStart, this); @@ -376,89 +466,3 @@ index = (index & ~TheStackManager.baseAddr) >> 20; TheStackManager.used[index] = 0; } - -#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(; cur Author: geoffray Date: Tue Nov 16 14:33:55 2010 New Revision: 119378 URL: http://llvm.org/viewvc/llvm-project?rev=119378&view=rev Log: More asserts. 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=119378&r1=119377&r2=119378&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Tue Nov 16 14:33:55 2010 @@ -143,6 +143,8 @@ FatLock* obj = table.getFatLockFromID(object->header); if (obj != NULL) { if (obj->acquire(object)) { + assert((object->header & FatMask) && "Inconsistent lock"); + assert((table.getFatLockFromID(object->header) == obj) && "Inconsistent lock"); assert(owner(object, table) && "Not owner after acquring fat lock!"); break; } From gael.thomas at lip6.fr Wed Nov 17 05:31:09 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 17 Nov 2010 13:31:09 -0000 Subject: [vmkit-commits] [vmkit] r119495 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/LLVMRuntime/runtime-default.ll mmtk/config/copyms/MMTkInline.inc mmtk/config/marksweep/MMTkInline.inc Message-ID: <20101117133109.EEFDF2A6C12C@llvm.org> Author: gthomas Date: Wed Nov 17 07:31:09 2010 New Revision: 119495 URL: http://llvm.org/viewvc/llvm-project?rev=119495&view=rev Log: add a new field in Thread Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll vmkit/branches/multi-vm/mmtk/config/copyms/MMTkInline.inc vmkit/branches/multi-vm/mmtk/config/marksweep/MMTkInline.inc Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=119495&r1=119494&r2=119495&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Wed Nov 17 07:31:09 2010 @@ -395,7 +395,7 @@ /// vmData - vm specific data /// - // void* vmData; TEST ME + void* vmData; }; #ifndef RUNTIME_DWARF_EXCEPTIONS Modified: vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll?rev=119495&r1=119494&r2=119495&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll Wed Nov 17 07:31:09 2010 @@ -42,8 +42,7 @@ ;;; field 10: void* lastKnownFrame ;;; field 11: void* lastExceptionBuffer ;;; field 12: void* vmData -;;; %Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } TEST ME -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8* } +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } %JavaThread = type { %MutatorThread, i8*, %JavaObject* } Modified: vmkit/branches/multi-vm/mmtk/config/copyms/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/mmtk/config/copyms/MMTkInline.inc?rev=119495&r1=119494&r2=119495&view=diff ============================================================================== --- vmkit/branches/multi-vm/mmtk/config/copyms/MMTkInline.inc (original) +++ vmkit/branches/multi-vm/mmtk/config/copyms/MMTkInline.inc Wed Nov 17 07:31:09 2010 @@ -2,541 +2,5 @@ Function* makeLLVMFunction(Module *mod) { - -// Type Definitions -PointerType* PointerTy_0 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); - -std::vectorFuncTy_1_args; -FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_1_args.push_back(PointerTy_0); -FunctionType* FuncTy_1 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_1_args, - /*isVarArg=*/false); - -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_7_args, - /*isVarArg=*/true); - -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_gcRoot_fields; -StructTy_struct_gcRoot_fields.push_back(PointerTy_5); -StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); -mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); - -PointerType* PointerTy_11 = PointerType::get(StructTy_struct_gcRoot, 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; -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__CollectionRV_fields; -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)); -StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 8)); -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__VirtualMachine_fields.push_back(StructTy_struct_mvm__CollectionRV); -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()); - - -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); -StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_mvm__SpinLock); -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_29 = PointerType::get(ArrayTy_VT, 0); - -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_28 = PointerType::get(StructTy_JavaObject, 0); - -PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); - -PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); - -PointerType* PointerTy_31 = PointerType::get(PointerTy_29, 0); - -std::vectorFuncTy_33_args; -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_33 = FunctionType::get( - /*Result=*/PointerTy_28, - /*Params=*/FuncTy_33_args, - /*isVarArg=*/false); - -PointerType* PointerTy_32 = PointerType::get(FuncTy_33, 0); - - -// Function Declarations - -Function* func_llvm_frameaddress = Function::Create( - /*Type=*/FuncTy_3, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*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_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( - /*Type=*/FuncTy_33, - /*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_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); - -// Global Variable Declarations - -// Constant Definitions -ConstantInt* const_int32_34 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -ConstantInt* const_int32_35 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); -ConstantInt* const_int32_36 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); -ConstantInt* const_int32_37 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); -ConstantInt* const_int32_38 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); -ConstantInt* const_int32_39 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); -ConstantInt* const_int32_40 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); - -// Global Variable Definitions - -Function* func_gcmalloc = Function::Create( - /*Type=*/FuncTy_1, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"gcmalloc", mod); -func_gcmalloc->setCallingConv(CallingConv::C); -AttrListPtr func_gcmalloc_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_gcmalloc->setAttributes(func_gcmalloc_PAL); -Function::arg_iterator args = func_gcmalloc->arg_begin(); -Value* int32_sz = args++; -int32_sz->setName("sz"); -Value* ptr_VT = args++; -ptr_VT->setName("VT"); - -BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",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 = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IFEQ_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.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_41 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_34, "", label_entry); -BinaryOperator* int32_42 = BinaryOperator::Create(Instruction::And, int32_41, const_int32_35, "", label_entry); -CallInst* ptr_43 = CallInst::Create(func_llvm_frameaddress, const_int32_36, "", label_entry); -ptr_43->setCallingConv(CallingConv::C); -ptr_43->setTailCall(true); -AttrListPtr ptr_43_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_43_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_43->setAttributes(ptr_43_PAL); - -CastInst* int32_44 = new PtrToIntInst(ptr_43, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_45 = BinaryOperator::Create(Instruction::And, int32_44, const_int32_37, "", label_entry); -CastInst* ptr_46 = new IntToPtrInst(int32_45, PointerTy_4, "", label_entry); -std::vector ptr_47_indices; -ptr_47_indices.push_back(const_int32_36); -ptr_47_indices.push_back(const_int32_38); -Instruction* ptr_47 = GetElementPtrInst::Create(ptr_46, ptr_47_indices.begin(), ptr_47_indices.end(), "", label_entry); -LoadInst* int32_48 = new LoadInst(ptr_47, "", false, label_entry); -CastInst* ptr_49 = new IntToPtrInst(int32_48, PointerTy_26, "", label_entry); -GetElementPtrInst* ptr_50 = GetElementPtrInst::Create(ptr_49, const_int32_39, "", label_entry); -CastInst* ptr_51 = new BitCastInst(ptr_50, PointerTy_27, "", label_entry); -LoadInst* ptr_52 = new LoadInst(ptr_51, "", false, label_entry); -GetElementPtrInst* ptr_53 = GetElementPtrInst::Create(ptr_52, const_int32_40, "", label_entry); -CastInst* ptr_54 = new BitCastInst(ptr_53, PointerTy_27, "", label_entry); -LoadInst* ptr_55 = new LoadInst(ptr_54, "", false, label_entry); -CastInst* int32_56 = new PtrToIntInst(ptr_55, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_57 = BinaryOperator::Create(Instruction::Add, int32_56, int32_42, "", label_entry); -CastInst* ptr_58 = new IntToPtrInst(int32_57, PointerTy_28, "", label_entry); -std::vector ptr_59_indices; -ptr_59_indices.push_back(const_int32_40); -ptr_59_indices.push_back(const_int32_40); -Instruction* ptr_59 = GetElementPtrInst::Create(ptr_52, ptr_59_indices.begin(), ptr_59_indices.end(), "", label_entry); -LoadInst* ptr_60 = new LoadInst(ptr_59, "", false, label_entry); -CastInst* ptr_61 = new BitCastInst(ptr_60, PointerTy_28, "", label_entry); -ICmpInst* int1_62 = new ICmpInst(*label_entry, ICmpInst::ICMP_UGT, ptr_58, ptr_61, ""); -BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_62, label_entry); - -// Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i) -std::vector ptr_64_indices; -ptr_64_indices.push_back(const_int32_40); -ptr_64_indices.push_back(const_int32_36); -Instruction* ptr_64 = GetElementPtrInst::Create(ptr_52, ptr_64_indices.begin(), ptr_64_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_57, PointerTy_29, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); - new StoreInst(ptr__c_i_i_i, ptr_64, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); - -// Block false IFEQ.i.i.i (label_false_IFEQ_i_i_i) -std::vector ptr_67_params; -ptr_67_params.push_back(ptr_52); -ptr_67_params.push_back(ptr_55); -ptr_67_params.push_back(ptr_58); -ptr_67_params.push_back(const_int32_36); -ptr_67_params.push_back(const_int32_36); -CallInst* ptr_67 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_67_params.begin(), ptr_67_params.end(), "", label_false_IFEQ_i_i_i); -ptr_67->setCallingConv(CallingConv::C); -ptr_67->setTailCall(true); -AttrListPtr ptr_67_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_67_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_67->setAttributes(ptr_67_PAL); - -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFEQ_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_69 = PHINode::Create(PointerTy_28, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -ptr_69->reserveOperandSpace(2); -ptr_69->addIncoming(ptr_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -ptr_69->addIncoming(ptr_67, label_false_IFEQ_i_i_i); - -std::vector ptr_70_indices; -ptr_70_indices.push_back(const_int32_36); -ptr_70_indices.push_back(const_int32_36); -Instruction* ptr_70 = GetElementPtrInst::Create(ptr_69, ptr_70_indices.begin(), ptr_70_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_29, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); - new StoreInst(ptr__c_i, ptr_70, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr_tmp1 = new BitCastInst(ptr_69, 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); -return func_gcmalloc; +return 0; } Modified: vmkit/branches/multi-vm/mmtk/config/marksweep/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/mmtk/config/marksweep/MMTkInline.inc?rev=119495&r1=119494&r2=119495&view=diff ============================================================================== --- vmkit/branches/multi-vm/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/branches/multi-vm/mmtk/config/marksweep/MMTkInline.inc Wed Nov 17 07:31:09 2010 @@ -2,1914 +2,5 @@ Function* makeLLVMFunction(Module *mod) { - -// Type Definitions -PointerType* PointerTy_0 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); - -std::vectorFuncTy_1_args; -FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_1_args.push_back(PointerTy_0); -FunctionType* FuncTy_1 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_1_args, - /*isVarArg=*/false); - -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_7_args, - /*isVarArg=*/true); - -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()); - - -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_29 = PointerType::get(ArrayTy_VT, 0); - -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_28 = PointerType::get(StructTy_JavaObject, 0); - -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_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_llvm_frameaddress = Function::Create( - /*Type=*/FuncTy_3, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*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_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_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_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 - -Function* func_gcmalloc = Function::Create( - /*Type=*/FuncTy_1, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"gcmalloc", mod); -func_gcmalloc->setCallingConv(CallingConv::C); -AttrListPtr func_gcmalloc_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_gcmalloc->setAttributes(func_gcmalloc_PAL); -Function::arg_iterator args = func_gcmalloc->arg_begin(); -Value* int32_sz = args++; -int32_sz->setName("sz"); -Value* ptr_VT = args++; -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_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_173_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -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); - -// 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; + return 0; } From gael.thomas at lip6.fr Wed Nov 17 05:36:30 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 17 Nov 2010 13:36:30 -0000 Subject: [vmkit-commits] [vmkit] r119496 - in /vmkit/branches/multi-vm: include/j3/J3Intrinsics.h include/mvm/JIT.h lib/J3/Compiler/J3Intrinsics.cpp lib/J3/LLVMRuntime/Makefile lib/J3/LLVMRuntime/runtime-default-thread.ll lib/J3/LLVMRuntime/runtime-default.ll lib/J3/LLVMRuntime/runtime-mmtk-thread.ll lib/Mvm/Compiler/JIT.cpp lib/Mvm/Compiler/LLVMRuntime.ll lib/Mvm/Compiler/Makefile lib/Mvm/Compiler/mvm-runtime.ll lib/Mvm/Compiler/runtime-default-thread.ll lib/Mvm/Compiler/runtime-mmtk-thread.ll Message-ID: <20101117133630.1C2472A6C12C@llvm.org> Author: gthomas Date: Wed Nov 17 07:36:29 2010 New Revision: 119496 URL: http://llvm.org/viewvc/llvm-project?rev=119496&view=rev Log: move mvm runtime types in mvm Added: vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll - copied, changed from r119494, vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll vmkit/branches/multi-vm/lib/Mvm/Compiler/runtime-default-thread.ll - copied unchanged from r119494, vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default-thread.ll vmkit/branches/multi-vm/lib/Mvm/Compiler/runtime-mmtk-thread.ll - copied unchanged from r119494, vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll Removed: vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default-thread.ll vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h vmkit/branches/multi-vm/include/mvm/JIT.h vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp vmkit/branches/multi-vm/lib/J3/LLVMRuntime/Makefile vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp vmkit/branches/multi-vm/lib/Mvm/Compiler/Makefile Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/j3/J3Intrinsics.h?rev=119496&r1=119495&r2=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/j3/J3Intrinsics.h (original) +++ vmkit/branches/multi-vm/include/j3/J3Intrinsics.h Wed Nov 17 07:36:29 2010 @@ -28,7 +28,6 @@ const llvm::Type* JavaArrayDoubleType; const llvm::Type* JavaArrayObjectType; - const llvm::Type* VTType; const llvm::Type* JavaObjectType; const llvm::Type* JavaArrayType; const llvm::Type* JavaCommonClassType; @@ -42,7 +41,6 @@ const llvm::Type* JavaFieldType; const llvm::Type* AttributType; const llvm::Type* JavaThreadType; - const llvm::Type* MutatorThreadType; #ifdef ISOLATE_SHARING const llvm::Type* JnjvmType; Modified: vmkit/branches/multi-vm/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/JIT.h?rev=119496&r1=119495&r2=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/JIT.h (original) +++ vmkit/branches/multi-vm/include/mvm/JIT.h Wed Nov 17 07:36:29 2010 @@ -172,6 +172,9 @@ const llvm::PointerType* ptrPtrType; const llvm::Type* arrayPtrType; const llvm::Type* pointerSizeType; + + const llvm::Type* MutatorThreadType; + const llvm::Type* VTType; }; Modified: vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp?rev=119496&r1=119495&r2=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp Wed Nov 17 07:36:29 2010 @@ -35,7 +35,6 @@ BaseIntrinsics(module) { j3::llvm_runtime::makeLLVMModuleContents(module); - VTType = PointerType::getUnqual(module->getTypeByName("VT")); LLVMContext& Context = module->getContext(); #ifdef ISOLATE_SHARING @@ -90,8 +89,6 @@ PointerType::getUnqual(module->getTypeByName("Attribut")); JavaThreadType = PointerType::getUnqual(module->getTypeByName("JavaThread")); - MutatorThreadType = - PointerType::getUnqual(module->getTypeByName("MutatorThread")); CodeLineInfoType = PointerType::getUnqual(module->getTypeByName("CodeLineInfo")); Modified: vmkit/branches/multi-vm/lib/J3/LLVMRuntime/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/LLVMRuntime/Makefile?rev=119496&r1=119495&r2=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/LLVMRuntime/Makefile (original) +++ vmkit/branches/multi-vm/lib/J3/LLVMRuntime/Makefile Wed Nov 17 07:36:29 2010 @@ -10,13 +10,8 @@ include $(LEVEL)/Makefile.config -VMKIT_RUNTIME = $(PROJ_SRC_DIR)/runtime-default.ll - -ifeq ($(GC_MMTK), 1) -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-mmtk-thread.ll -else -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-default-thread.ll -endif +VMKIT_RUNTIME = $(PROJ_SRC_DIR)/../../Mvm/Compiler/LLVMRuntime.gen.ll \ + $(PROJ_SRC_DIR)/runtime-default.ll ifeq ($(ISOLATE_BUILD), 1) VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-isolate.ll Removed: vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default-thread.ll?rev=119495&view=auto ============================================================================== --- vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default-thread.ll (original) +++ vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default-thread.ll (removed) @@ -1,2 +0,0 @@ -;;; Field 0: the thread -%MutatorThread = type { %Thread } Modified: vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll?rev=119496&r1=119495&r2=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll Wed Nov 17 07:36:29 2010 @@ -2,9 +2,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;; Type definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; A virtual table is an array of function pointers. -%VT = type [0 x i32 (...)*] - ;;; The root of all Java Objects: a VT and a lock. %JavaObject = type { %VT*, i8* } @@ -27,23 +24,6 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } -%CircularBase = type { %VT*, %CircularBase*, %CircularBase* } - -;;; Field 0: the parent (circular base) -;;; Field 1: size_t IsolateID -;;; Field 2: void* MyVM -;;; Field 3: void* baseSP -;;; Field 4: char doYield -;;; Field 5: char inRV -;;; Field 6: char joinedRV -;;; Field 7: void* lastSP -;;; Field 8: void* internalThreadID -;;; field 9: void* routine -;;; field 10: void* lastKnownFrame -;;; field 11: void* lastExceptionBuffer -;;; field 12: void* vmData -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } - %JavaThread = type { %MutatorThread, i8*, %JavaObject* } Removed: vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll?rev=119495&view=auto ============================================================================== --- vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (original) +++ vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (removed) @@ -1,7 +0,0 @@ -%BumpPtrAllocator = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* } - -;;; Field 0: the thread -;;; field 1: allocator -;;; field 2: MutatorContext -;;; field 3: realRoutine -%MutatorThread = type { %Thread, %BumpPtrAllocator, i8*, i8* } Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp?rev=119496&r1=119495&r2=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp Wed Nov 17 07:36:29 2010 @@ -322,6 +322,9 @@ assert(AllocateUnresolvedFunction && "No allocateUnresolved function"); AddFinalizationCandidate = module->getFunction("addFinalizationCandidate"); assert(AddFinalizationCandidate && "No addFinalizationCandidate function"); + + VTType = PointerType::getUnqual(module->getTypeByName("VT")); + MutatorThreadType = PointerType::getUnqual(module->getTypeByName("MutatorThread")); } const llvm::TargetData* MvmModule::TheTargetData; Removed: vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll?rev=119495&view=auto ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll (removed) @@ -1,87 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Common types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;; A virtual table is an array of function pointers. -%VT = type [0 x i32 (...)*] - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Printing functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @printFloat(float) -declare void @printDouble(double) -declare void @printLong(i64) -declare void @printInt(i32) -declare void @printObject(i8*) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exceptions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @_Unwind_Resume_or_Rethrow(i8*) -declare i8* @llvm.eh.exception() nounwind -declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind -declare i64 @llvm.eh.selector.i64(i8*, i8*, ...) nounwind -declare void @__gxx_personality_v0() -declare i8* @__cxa_begin_catch(i8*) -declare void @__cxa_end_catch() -declare i32 @setjmp(i8*) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Math ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare double @llvm.sqrt.f64(double) nounwind -declare double @llvm.sin.f64(double) nounwind -declare double @llvm.cos.f64(double) nounwind -declare double @tan(double) -declare double @asin(double) -declare double @acos(double) -declare double @atan(double) -declare double @exp(double) -declare double @log(double) -declare double @ceil(double) -declare double @floor(double) -declare double @cbrt(double) -declare double @cosh(double) -declare double @expm1(double) -declare double @log10(double) -declare double @log1p(double) -declare double @sinh(double) -declare double @tanh(double) -declare double @fabs(double) -declare double @rint(double) -declare double @hypot(double, double) -declare double @pow(double, double) -declare double @atan2(double, double) -declare float @fabsf(float) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Memory ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @llvm.memcpy.i32(i8 *, i8 *, i32, i32) nounwind -declare void @llvm.memset.i32(i8 *, i8, i32, i32) nounwind -declare i8* @llvm.frameaddress(i32) nounwind readnone - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Atomic ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare i8 @llvm.atomic.cmp.swap.i8.p0i8(i8*, i8, i8) nounwind -declare i16 @llvm.atomic.cmp.swap.i16.p0i16(i16*, i16, i16) nounwind -declare i32 @llvm.atomic.cmp.swap.i32.p0i32(i32*, i32, i32) nounwind -declare i64 @llvm.atomic.cmp.swap.i64.p0i64(i64*, i64, i64) nounwind - -declare void @unconditionalSafePoint() nounwind -declare void @conditionalSafePoint() nounwind - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @llvm.gcroot(i8**, i8*) -declare i8* @gcmalloc(i32, i8*) -declare i8* @gcmallocUnresolved(i32, i8*) -declare void @addFinalizationCandidate(i8*) Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/Makefile?rev=119496&r1=119495&r2=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/Makefile (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/Makefile Wed Nov 17 07:36:29 2010 @@ -16,7 +16,14 @@ LIBRARYNAME = MvmCompiler endif -VMKIT_RUNTIME = $(PROJ_SRC_DIR)/LLVMRuntime.ll +VMKIT_RUNTIME = $(PROJ_SRC_DIR)/mvm-runtime.ll + +ifeq ($(GC_MMTK), 1) +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-mmtk-thread.ll +else +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-default-thread.ll +endif + BUILT_SOURCES = LLVMRuntime.inc include $(LEVEL)/Makefile.common Copied: vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll (from r119494, vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll) URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll?p2=vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll&p1=vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll&r1=119494&r2=119496&rev=119496&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/LLVMRuntime.ll (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll Wed Nov 17 07:36:29 2010 @@ -5,6 +5,23 @@ ;;; A virtual table is an array of function pointers. %VT = type [0 x i32 (...)*] +%CircularBase = type { %VT*, %CircularBase*, %CircularBase* } + +;;; Field 0: the parent (circular base) +;;; Field 1: size_t IsolateID +;;; Field 2: void* MyVM +;;; Field 3: void* baseSP +;;; Field 4: char doYield +;;; Field 5: char inRV +;;; Field 6: char joinedRV +;;; Field 7: void* lastSP +;;; Field 8: void* internalThreadID +;;; field 9: void* routine +;;; field 10: void* lastKnownFrame +;;; field 11: void* lastExceptionBuffer +;;; field 12: void* vmData +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Printing functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From gael.thomas at lip6.fr Wed Nov 17 07:06:00 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 17 Nov 2010 15:06:00 -0000 Subject: [vmkit-commits] [vmkit] r119497 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/Classpath/ClasspathVMThread.inc lib/J3/Classpath/JavaUpcalls.cpp lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/Jnjvm.h Message-ID: <20101117150600.E6F672A6C12C@llvm.org> Author: gthomas Date: Wed Nov 17 09:06:00 2010 New Revision: 119497 URL: http://llvm.org/viewvc/llvm-project?rev=119497&view=rev Log: split JavaThread and mvm::MutatorThread Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Wed Nov 17 09:06:00 2010 @@ -138,6 +138,8 @@ class ExceptionBuffer; +class VMThreadData {}; + /// Thread - This class is the base of custom virtual machines' Thread classes. /// It provides static functions to manage threads. An instance of this class /// contains all thread-specific informations. @@ -395,7 +397,7 @@ /// vmData - vm specific data /// - void* vmData; + VMThreadData* vmData; }; #ifndef RUNTIME_DWARF_EXCEPTIONS Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc Wed Nov 17 09:06:00 2010 @@ -86,7 +86,7 @@ javaThread = vm->upcalls->assocThread->getInstanceObjectField(vmThread); assert(javaThread && "VMThread with no Java equivalent"); - JavaThread* th = new JavaThread(javaThread, vmThread, vm); + mvm::MutatorThread* th = JavaThread::create(javaThread, vmThread, vm); if (!th) vm->outOfMemoryError(); th->start((void (*)(mvm::Thread*))start); Modified: vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/JavaUpcalls.cpp Wed Nov 17 09:06:00 2010 @@ -279,7 +279,7 @@ RG = rootGroup->getStaticObjectField(); assert(RG && "No root group"); assert(vm->getMainThread() && "VM did not set its main thread"); - CreateJavaThread(vm, (JavaThread*)vm->getMainThread(), "main", RG); + CreateJavaThread(vm, JavaThread::j3Thread(vm->getMainThread()), "main", RG); // Create the "system" group. SystemGroup = threadGroup->doNew(vm); @@ -289,11 +289,11 @@ // Create the finalizer thread. assert(vm->getFinalizerThread() && "VM did not set its finalizer thread"); - CreateJavaThread(vm, vm->getFinalizerThread(), "Finalizer", SystemGroup); + CreateJavaThread(vm, JavaThread::j3Thread(vm->getFinalizerThread()), "Finalizer", SystemGroup); // Create the enqueue thread. assert(vm->getEnqueueThread() && "VM did not set its enqueue thread"); - CreateJavaThread(vm, vm->getEnqueueThread(), "Reference", SystemGroup); + CreateJavaThread(vm, JavaThread::j3Thread(vm->getEnqueueThread()), "Reference", SystemGroup); } extern "C" void nativeInitWeakReference(JavaObjectReference* reference, Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp Wed Nov 17 09:06:00 2010 @@ -2130,7 +2130,7 @@ void JavaAOTCompiler::compileFile(Jnjvm* vm, const char* n) { name = n; - JavaThread* th = new JavaThread(0, 0, vm); + mvm::MutatorThread* th = JavaThread::create(0, 0, vm); vm->setMainThread(th); th->start((void (*)(mvm::Thread*))mainCompilerStart); vm->waitForExit(); Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Wed Nov 17 09:06:00 2010 @@ -47,6 +47,16 @@ #endif } +JavaThread* JavaThread::j3Thread(mvm::Thread* mut) { + return (JavaThread*)mut->vmData; +} + +mvm::MutatorThread *JavaThread::create(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) { + mvm::MutatorThread *res = (mvm::MutatorThread*)new JavaThread(thread, vmth, isolate); + res->vmData = (mvm::VMThreadData*)res; + return res; +} + JavaThread::~JavaThread() { delete localJNIRefs; #ifdef SERVICE Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Wed Nov 17 09:06:00 2010 @@ -145,11 +145,16 @@ /// ~JavaThread - Delete any potential malloc'ed objects used by this thread. /// ~JavaThread(); - + +private: /// JavaThread - Creates a Java thread. /// JavaThread(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); +public: + static mvm::MutatorThread* create(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); + static JavaThread* j3Thread(mvm::Thread* mut); + /// get - Get the current thread as a JnJVM object. /// static JavaThread* get() { Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp Wed Nov 17 09:06:00 2010 @@ -1088,11 +1088,11 @@ JnjvmClassLoader* loader = bootstrapLoader; // First create system threads. - finalizerThread = new JavaThread(0, 0, this); - finalizerThread->start((void (*)(mvm::Thread*))finalizerStart); + finalizerThread = JavaThread::j3Thread(JavaThread::create(0, 0, this)); + finalizerThread->start(finalizerStart); - enqueueThread = new JavaThread(0, 0, this); - enqueueThread->start((void (*)(mvm::Thread*))enqueueStart); + enqueueThread = JavaThread::j3Thread(JavaThread::create(0, 0, this)); + enqueueThread->start(enqueueStart); // Initialise the bootstrap class loader if it's not // done already. @@ -1132,7 +1132,7 @@ #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); + upcalls->InitializeThreading(this); LOAD_CLASS(upcalls->newClass); LOAD_CLASS(upcalls->newConstructor); @@ -1282,7 +1282,7 @@ return; } -void Jnjvm::mainJavaStart(JavaThread* thread) { +void Jnjvm::mainJavaStart(mvm::Thread* thread) { JavaString* str = NULL; JavaObject* instrumenter = NULL; @@ -1294,7 +1294,7 @@ llvm_gcroot(args, 0); llvm_gcroot(exc, 0); - Jnjvm* vm = thread->getJVM(); + Jnjvm* vm = JavaThread::j3Thread(thread)->getJVM(); vm->bootstrapLoader->analyseClasspathEnv(vm->bootstrapLoader->bootClasspathEnv); vm->argumentsInfo.readArgs(vm); if (vm->argumentsInfo.className == NULL) { @@ -1306,7 +1306,7 @@ vm->argumentsInfo.argv = vm->argumentsInfo.argv + pos - 1; vm->argumentsInfo.argc = vm->argumentsInfo.argc - pos + 1; - vm->mainThread = thread; + // vm->mainThread = thread; TRY { vm->loadBootstrap(); @@ -1393,12 +1393,13 @@ sa.sa_flags |= SA_RESTART; sigaction(SIGUSR1, &sa, NULL); - mvm::Thread* th = new JavaThread(0, 0, this); + mvm::Thread* th = JavaThread::create(0, 0, this); th->start(serviceCPUMonitor); #endif - mainThread = new JavaThread(0, 0, this); - mainThread->start((void (*)(mvm::Thread*))mainJavaStart); + mainThread = JavaThread::create(0, 0, this); + mainJ3Thread = JavaThread::j3Thread(mainThread); + mainThread->start(mainJavaStart); } Jnjvm::Jnjvm(mvm::BumpPtrAllocator& Alloc, JnjvmBootstrapLoader* loader) : Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h?rev=119497&r1=119496&r2=119497&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h Wed Nov 17 09:06:00 2010 @@ -25,6 +25,10 @@ #include "JNIReferences.h" #include "LockedMap.h" +namespace mvm { + class MutatorThread; +} + namespace j3 { class ArrayObject; @@ -120,11 +124,11 @@ /// finalizerThread - The thread that finalizes Java objects. /// - JavaThread* finalizerThread; + JavaThread* finalizerThread; /// enqueueThread - The thread that enqueue Java references. /// - JavaThread* enqueueThread; + JavaThread* enqueueThread; /// CreateError - Creates a Java object of the specified exception class /// and calling its function. @@ -160,7 +164,7 @@ /// mainJavaStart - Starts the execution of the application in a Java thread. /// - static void mainJavaStart(JavaThread* thread); + static void mainJavaStart(mvm::Thread* thread); /// mainCompileStart - Starts the static compilation of classes in a Java /// thread. @@ -239,6 +243,12 @@ /// hashStr - Hash map of java/lang/String objects allocated by this JVM. /// StringMap hashStr; + + /// hashStr - Hash map of java/lang/String objects allocated by this JVM. + /// mainJ3Thread - the main j3 thread + JavaThread* mainJ3Thread; + + JavaThread *getMainJ3Thread() { return mainJ3Thread; } public: @@ -304,7 +314,7 @@ /// getFinalizerThread - Get the finalizer thread of this VM. /// - JavaThread* getFinalizerThread() const { return finalizerThread; } + JavaThread* getFinalizerThread() const { return finalizerThread; } /// setEnqueueThread - Set the enqueue thread of this VM. /// @@ -312,7 +322,7 @@ /// getEnqueueThread - Get the enqueue thread of this VM. /// - JavaThread* getEnqueueThread() const { return enqueueThread; } + JavaThread* getEnqueueThread() const { return enqueueThread; } /// ~Jnjvm - Destroy the JVM. /// From gael.thomas at lip6.fr Wed Nov 17 07:27:42 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 17 Nov 2010 15:27:42 -0000 Subject: [vmkit-commits] [vmkit] r119499 - in /vmkit/branches/multi-vm: include/j3/J3Intrinsics.h include/mvm/JIT.h lib/J3/Compiler/J3Intrinsics.cpp lib/J3/Compiler/JavaJIT.cpp lib/Mvm/Compiler/JIT.cpp Message-ID: <20101117152742.913392A6C12C@llvm.org> Author: gthomas Date: Wed Nov 17 09:27:42 2010 New Revision: 119499 URL: http://llvm.org/viewvc/llvm-project?rev=119499&view=rev Log: use JavaThread::create to create Java threads Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h vmkit/branches/multi-vm/include/mvm/JIT.h vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/j3/J3Intrinsics.h?rev=119499&r1=119498&r2=119499&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/j3/J3Intrinsics.h (original) +++ vmkit/branches/multi-vm/include/j3/J3Intrinsics.h Wed Nov 17 09:27:42 2010 @@ -129,11 +129,6 @@ llvm::Constant* OffsetInitializedInTaskClassMirrorConstant; llvm::Constant* OffsetStatusInTaskClassMirrorConstant; - llvm::Constant* OffsetDoYieldInThreadConstant; - llvm::Constant* OffsetIsolateIDInThreadConstant; - llvm::Constant* OffsetVMInThreadConstant; - llvm::Constant* OffsetCXXExceptionInThreadConstant; - llvm::Constant* OffsetThreadInMutatorThreadConstant; llvm::Constant* OffsetJNIInJavaThreadConstant; llvm::Constant* OffsetJavaExceptionInJavaThreadConstant; Modified: vmkit/branches/multi-vm/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/JIT.h?rev=119499&r1=119498&r2=119499&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/JIT.h (original) +++ vmkit/branches/multi-vm/include/mvm/JIT.h Wed Nov 17 09:27:42 2010 @@ -175,6 +175,13 @@ const llvm::Type* MutatorThreadType; const llvm::Type* VTType; + + llvm::Constant* OffsetDoYieldInThreadConstant; + llvm::Constant* OffsetIsolateIDInThreadConstant; + llvm::Constant* OffsetVMInThreadConstant; + llvm::Constant* OffsetCXXExceptionInThreadConstant; + llvm::Constant* OffsetVMDataInThreadConstant; + llvm::Constant* OffsetThreadInMutatorThreadConstant; }; Modified: vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp?rev=119499&r1=119498&r2=119499&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp Wed Nov 17 09:27:42 2010 @@ -139,11 +139,6 @@ OffsetStatusInTaskClassMirrorConstant = constantZero; OffsetInitializedInTaskClassMirrorConstant = constantOne; - 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); OffsetJNIInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); OffsetJavaExceptionInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp?rev=119499&r1=119498&r2=119499&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Wed Nov 17 09:27:42 2010 @@ -274,10 +274,6 @@ return threadId; } -llvm::Value* JavaJIT::getJavaThreadPtr(llvm::Value* mutatorThreadPtr) { - return new BitCastInst(mutatorThreadPtr, intrinsics->JavaThreadType, "", currentBlock); -} - llvm::Value* JavaJIT::getIsolateIDPtr(llvm::Value* mutatorThreadPtr) { Value* GEP[3] = { intrinsics->constantZero, intrinsics->OffsetThreadInMutatorThreadConstant, @@ -310,6 +306,17 @@ return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); } +llvm::Value* JavaJIT::getJavaThreadPtr(llvm::Value* mutatorThreadPtr) { + Value* GEP[3] = { intrinsics->constantZero, + intrinsics->OffsetThreadInMutatorThreadConstant, + intrinsics->OffsetVMDataInThreadConstant }; + + Value *res = GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); + + //return new BitCastInst(res, intrinsics->JavaThreadType, "", currentBlock); + return new BitCastInst(mutatorThreadPtr, intrinsics->JavaThreadType, "", currentBlock); +} + llvm::Value* JavaJIT::getJNIEnvPtr(llvm::Value* javaThreadPtr) { Value* GEP[2] = { intrinsics->constantZero, intrinsics->OffsetJNIInJavaThreadConstant }; Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp?rev=119499&r1=119498&r2=119499&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp Wed Nov 17 09:27:42 2010 @@ -325,6 +325,13 @@ VTType = PointerType::getUnqual(module->getTypeByName("VT")); MutatorThreadType = PointerType::getUnqual(module->getTypeByName("MutatorThread")); + + 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); + OffsetVMDataInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 12); + OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); } const llvm::TargetData* MvmModule::TheTargetData; From gael.thomas at lip6.fr Wed Nov 17 07:32:03 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 17 Nov 2010 15:32:03 -0000 Subject: [vmkit-commits] [vmkit] r119500 - /vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Message-ID: <20101117153203.33B8E2A6C12C@llvm.org> Author: gthomas Date: Wed Nov 17 09:32:03 2010 New Revision: 119500 URL: http://llvm.org/viewvc/llvm-project?rev=119500&view=rev Log: use vmData to find the JavaThread in the generated code Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp?rev=119500&r1=119499&r2=119500&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Wed Nov 17 09:32:03 2010 @@ -312,9 +312,8 @@ intrinsics->OffsetVMDataInThreadConstant }; Value *res = GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); - - //return new BitCastInst(res, intrinsics->JavaThreadType, "", currentBlock); - return new BitCastInst(mutatorThreadPtr, intrinsics->JavaThreadType, "", currentBlock); + res = new LoadInst(res, "", currentBlock); + return new BitCastInst(res, intrinsics->JavaThreadType, "", currentBlock); } llvm::Value* JavaJIT::getJNIEnvPtr(llvm::Value* javaThreadPtr) { From gael.thomas at lip6.fr Wed Nov 17 07:41:44 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 17 Nov 2010 15:41:44 -0000 Subject: [vmkit-commits] [vmkit] r119501 - in /vmkit/branches/multi-vm/lib/J3/VMCore: JavaThread.cpp JavaThread.h Message-ID: <20101117154144.AAD0F2A6C12C@llvm.org> Author: gthomas Date: Wed Nov 17 09:41:44 2010 New Revision: 119501 URL: http://llvm.org/viewvc/llvm-project?rev=119501&view=rev Log: JavaThread::get() uses vmData. Add a Jnjvm field in JavaThread. Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=119501&r1=119500&r2=119501&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Wed Nov 17 09:41:44 2010 @@ -37,6 +37,7 @@ jniEnv = isolate->jniEnv; localJNIRefs = new JNILocalReferences(); currentAddedReferences = 0; + jnjvm = isolate; #ifdef SERVICE eipIndex = 0; Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=119501&r1=119500&r2=119501&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Wed Nov 17 09:41:44 2010 @@ -120,6 +120,9 @@ /// JNILocalReferences* localJNIRefs; + /// jnjvm - my vm + /// + Jnjvm *jnjvm; JavaObject** pushJNIRef(JavaObject* obj) { llvm_gcroot(obj, 0); @@ -158,13 +161,13 @@ /// get - Get the current thread as a JnJVM object. /// static JavaThread* get() { - return (JavaThread*)mvm::Thread::get(); + return j3Thread(mvm::Thread::get()); } /// getJVM - Get the JnJVM in which this thread executes. /// Jnjvm* getJVM() { - return (Jnjvm*)MyVM; + return jnjvm; } /// currentThread - Return the current thread as a Java object. From gael.thomas at lip6.fr Wed Nov 17 08:31:30 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 17 Nov 2010 16:31:30 -0000 Subject: [vmkit-commits] [vmkit] r119513 - in /vmkit/branches/multi-vm: lib/Mvm/MMTk/ mmtk/java/ mmtk/mmtk-alloc/ Message-ID: <20101117163130.9D6942A6C12C@llvm.org> Author: gthomas Date: Wed Nov 17 10:31:30 2010 New Revision: 119513 URL: http://llvm.org/viewvc/llvm-project?rev=119513&view=rev Log: ignore some generated files Modified: vmkit/branches/multi-vm/lib/Mvm/MMTk/ (props changed) vmkit/branches/multi-vm/mmtk/java/ (props changed) vmkit/branches/multi-vm/mmtk/mmtk-alloc/ (props changed) Propchange: vmkit/branches/multi-vm/lib/Mvm/MMTk/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Nov 17 10:31:30 2010 @@ -0,0 +1 @@ +Release Propchange: vmkit/branches/multi-vm/mmtk/java/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Nov 17 10:31:30 2010 @@ -1 +1,5 @@ +mmtk-vmkit.bc +mmtk-vmkit-optimized.bc +mmtk-vmkit.jar build.xml +classes Propchange: vmkit/branches/multi-vm/mmtk/mmtk-alloc/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Nov 17 10:31:30 2010 @@ -0,0 +1 @@ +Release From gael.thomas at lip6.fr Tue Nov 23 03:28:22 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 23 Nov 2010 11:28:22 -0000 Subject: [vmkit-commits] [vmkit] r120018 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/Classpath/ClasspathVMThread.inc lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/LLVMInfo.cpp lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/Jnjvm.h lib/Mvm/Compiler/mvm-runtime.ll Message-ID: <20101123112822.CE2562A6C12C@llvm.org> Author: gthomas Date: Tue Nov 23 05:28:22 2010 New Revision: 120018 URL: http://llvm.org/viewvc/llvm-project?rev=120018&view=rev Log: store directly a mvm::Thread in Jnjvm Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Tue Nov 23 05:28:22 2010 @@ -137,8 +137,18 @@ class ExceptionBuffer; +class Thread; -class VMThreadData {}; +class VMThreadData { +public: + Thread* mut; + + VMThreadData(Thread* m) { + this->mut = m; + } + + ~VMThreadData() {} // force the construction of a VT +}; /// Thread - This class is the base of custom virtual machines' Thread classes. /// It provides static functions to manage threads. An instance of this class Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc Tue Nov 23 05:28:22 2010 @@ -86,7 +86,7 @@ javaThread = vm->upcalls->assocThread->getInstanceObjectField(vmThread); assert(javaThread && "VMThread with no Java equivalent"); - mvm::MutatorThread* th = JavaThread::create(javaThread, vmThread, vm); + mvm::Thread* th = JavaThread::create(javaThread, vmThread, vm); if (!th) vm->outOfMemoryError(); th->start((void (*)(mvm::Thread*))start); Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Nov 23 05:28:22 2010 @@ -2130,7 +2130,7 @@ void JavaAOTCompiler::compileFile(Jnjvm* vm, const char* n) { name = n; - mvm::MutatorThread* th = JavaThread::create(0, 0, vm); + mvm::Thread* th = JavaThread::create(0, 0, vm); vm->setMainThread(th); th->start((void (*)(mvm::Thread*))mainCompilerStart); vm->waitForExit(); Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Tue Nov 23 05:28:22 2010 @@ -320,7 +320,8 @@ Value* GEP[2] = { intrinsics->constantZero, intrinsics->OffsetJNIInJavaThreadConstant }; - return GetElementPtrInst::Create(javaThreadPtr, GEP, GEP + 2, "", currentBlock); + Value* res = GetElementPtrInst::Create(javaThreadPtr, GEP, GEP + 2, "", currentBlock); + return new BitCastInst(res, intrinsics->ptrType, "", currentBlock); } llvm::Value* JavaJIT::getJavaExceptionPtr(llvm::Value* javaThreadPtr) { @@ -410,8 +411,6 @@ Value* jniEnv = getJNIEnvPtr(getJavaThreadPtr(getMutatorThreadPtr())); - jniEnv = new BitCastInst(jniEnv, intrinsics->ptrType, "", currentBlock); - nativeArgs.push_back(jniEnv); uint32 index = 0; Modified: vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/LLVMInfo.cpp Tue Nov 23 05:28:22 2010 @@ -289,7 +289,7 @@ const llvm::Type* Ty = PointerType::getUnqual(Compiler->getIntrinsics()->JavaObjectType); - llvmArgs.push_back(Compiler->getIntrinsics()->ptrType); // JNIEnv + llvmArgs.push_back(Compiler->getIntrinsics()->ptrType); llvmArgs.push_back(Ty); // Class for (uint32 i = 0; i < size; ++i) { Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Tue Nov 23 05:28:22 2010 @@ -52,7 +52,7 @@ return (JavaThread*)mut->vmData; } -mvm::MutatorThread *JavaThread::create(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) { +mvm::Thread *JavaThread::create(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) { mvm::MutatorThread *res = (mvm::MutatorThread*)new JavaThread(thread, vmth, isolate); res->vmData = (mvm::VMThreadData*)res; return res; Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Nov 23 05:28:22 2010 @@ -155,8 +155,8 @@ JavaThread(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); public: - static mvm::MutatorThread* create(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); - static JavaThread* j3Thread(mvm::Thread* mut); + static mvm::Thread* create(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); + static JavaThread* j3Thread(mvm::Thread* mut); /// get - Get the current thread as a JnJVM object. /// Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp Tue Nov 23 05:28:22 2010 @@ -1398,7 +1398,6 @@ #endif mainThread = JavaThread::create(0, 0, this); - mainJ3Thread = JavaThread::j3Thread(mainThread); mainThread->start(mainJavaStart); } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h Tue Nov 23 05:28:22 2010 @@ -124,11 +124,11 @@ /// finalizerThread - The thread that finalizes Java objects. /// - JavaThread* finalizerThread; + mvm::Thread* finalizerThread; /// enqueueThread - The thread that enqueue Java references. /// - JavaThread* enqueueThread; + mvm::Thread* enqueueThread; /// CreateError - Creates a Java object of the specified exception class /// and calling its function. @@ -169,7 +169,7 @@ /// mainCompileStart - Starts the static compilation of classes in a Java /// thread. /// - static void mainCompilerStart(JavaThread* thread); + static void mainCompilerStart(mvm::Thread* thread); public: @@ -243,12 +243,6 @@ /// hashStr - Hash map of java/lang/String objects allocated by this JVM. /// StringMap hashStr; - - /// hashStr - Hash map of java/lang/String objects allocated by this JVM. - /// mainJ3Thread - the main j3 thread - JavaThread* mainJ3Thread; - - JavaThread *getMainJ3Thread() { return mainJ3Thread; } public: @@ -310,19 +304,19 @@ /// setFinalizerThread - Set the finalizer thread of this VM. /// - void setFinalizerThread(JavaThread* th) { finalizerThread = th; } + void setFinalizerThread(mvm::Thread* th) { finalizerThread = th; } /// getFinalizerThread - Get the finalizer thread of this VM. /// - JavaThread* getFinalizerThread() const { return finalizerThread; } + mvm::Thread* getFinalizerThread() const { return finalizerThread; } /// setEnqueueThread - Set the enqueue thread of this VM. /// - void setEnqueueThread(JavaThread* th) { enqueueThread = th; } + void setEnqueueThread(mvm::Thread* th) { enqueueThread = th; } /// getEnqueueThread - Get the enqueue thread of this VM. /// - JavaThread* getEnqueueThread() const { return enqueueThread; } + mvm::Thread* getEnqueueThread() const { return enqueueThread; } /// ~Jnjvm - Destroy the JVM. /// Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll?rev=120018&r1=120017&r2=120018&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll Tue Nov 23 05:28:22 2010 @@ -20,7 +20,8 @@ ;;; field 10: void* lastKnownFrame ;;; field 11: void* lastExceptionBuffer ;;; field 12: void* vmData -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } +%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8*, i8* } +%VMThreadData = type { %VT*, %Thread* } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Printing functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From gael.thomas at lip6.fr Tue Nov 23 03:44:37 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 23 Nov 2010 11:44:37 -0000 Subject: [vmkit-commits] [vmkit] r120019 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/VMCore/JavaRuntimeJIT.cpp lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jni.cpp lib/J3/VMCore/Jnjvm.cpp Message-ID: <20101123114437.C62B82A6C12C@llvm.org> Author: gthomas Date: Tue Nov 23 05:44:37 2010 New Revision: 120019 URL: http://llvm.org/viewvc/llvm-project?rev=120019&view=rev Log: split the JavaThread and the mvm::Thread (in progress) Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120019&r1=120018&r2=120019&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Tue Nov 23 05:44:37 2010 @@ -141,6 +141,7 @@ class VMThreadData { public: + /// mut - The associated thread mutator Thread* mut; VMThreadData(Thread* m) { Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=120019&r1=120018&r2=120019&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp Tue Nov 23 05:44:37 2010 @@ -355,12 +355,13 @@ extern "C" void* j3StartJNI(uint32* localReferencesNumber, uint32** oldLocalReferencesNumber, mvm::KnownFrame* Frame) { - - JavaThread* th = JavaThread::get(); + + mvm::Thread* mut = mvm::Thread::get(); + JavaThread* th = JavaThread::j3Thread(mut); *oldLocalReferencesNumber = th->currentAddedReferences; th->currentAddedReferences = localReferencesNumber; - th->startKnownFrame(*Frame); + mut->startKnownFrame(*Frame); th->startJNI(1); @@ -600,14 +601,14 @@ extern "C" void* j3ResolveVirtualStub(JavaObject* obj) { llvm_gcroot(obj, 0); - JavaThread *th = JavaThread::get(); + mvm::Thread *mut = mvm::Thread::get(); UserCommonClass* cl = JavaObject::getClass(obj); void* result = NULL; BEGIN_NATIVE_EXCEPTION(1) // Lookup the caller of this class. - mvm::StackWalker Walker(th); + mvm::StackWalker Walker(mut); while (Walker.get()->MethodType != 1) ++Walker; mvm::MethodInfo* MI = Walker.get(); JavaMethod* meth = (JavaMethod*)MI->getMetaInfo(); @@ -666,13 +667,13 @@ } extern "C" void* j3ResolveStaticStub() { - JavaThread *th = JavaThread::get(); + mvm::Thread *mut = mvm::Thread::get(); void* result = NULL; BEGIN_NATIVE_EXCEPTION(1) // Lookup the caller of this class. - mvm::StackWalker Walker(th); + mvm::StackWalker Walker(mut); while (Walker.get()->MethodType != 1) ++Walker; mvm::MethodInfo* MI = Walker.get(); assert(MI->MethodType == 1 && "Wrong call to stub"); @@ -704,13 +705,13 @@ } extern "C" void* j3ResolveSpecialStub() { - JavaThread *th = JavaThread::get(); + mvm::Thread *mut = mvm::Thread::get(); void* result = NULL; BEGIN_NATIVE_EXCEPTION(1) // Lookup the caller of this class. - mvm::StackWalker Walker(th); + mvm::StackWalker Walker(mut); while (Walker.get()->MethodType != 1) ++Walker; mvm::MethodInfo* MI = Walker.get(); assert(MI->MethodType == 1 && "Wrong call to stub"); @@ -732,7 +733,7 @@ lookup->lookupSpecialMethodDontThrow(utf8, sign->keyName, caller->classDef); if (!callee) { - th->getJVM()->noSuchMethodError(lookup, utf8); + JavaThread::j3Thread(mut)->getJVM()->noSuchMethodError(lookup, utf8); } // Compile the found method. Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120019&r1=120018&r2=120019&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Tue Nov 23 05:44:37 2010 @@ -53,8 +53,9 @@ } mvm::Thread *JavaThread::create(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) { - mvm::MutatorThread *res = (mvm::MutatorThread*)new JavaThread(thread, vmth, isolate); + JavaThread *res = new JavaThread(thread, vmth, isolate); res->vmData = (mvm::VMThreadData*)res; + res->mut = res; return res; } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120019&r1=120018&r2=120019&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Nov 23 05:44:37 2010 @@ -28,37 +28,37 @@ class Jnjvm; -#define BEGIN_NATIVE_EXCEPTION(level) \ - JavaThread* __th = JavaThread::get(); \ +#define BEGIN_NATIVE_EXCEPTION(level) \ + JavaThread* __th = JavaThread::get(); \ TRY { -#define END_NATIVE_EXCEPTION \ - } CATCH { \ - __th->throwFromNative(); \ +#define END_NATIVE_EXCEPTION \ + } CATCH { \ + __th->throwFromNative(); \ } END_CATCH; -#define BEGIN_JNI_EXCEPTION \ - JavaThread* th = JavaThread::get(); \ - void* SP = th->getLastSP(); \ - th->leaveUncooperativeCode(); \ - mvm::KnownFrame Frame; \ - th->startKnownFrame(Frame); \ +#define BEGIN_JNI_EXCEPTION \ + mvm::Thread* mut = mvm::Thread::get(); \ + void* SP = mut->getLastSP(); \ + mut->leaveUncooperativeCode(); \ + mvm::KnownFrame Frame; \ + mut->startKnownFrame(Frame); \ TRY { -#define END_JNI_EXCEPTION \ - } CATCH { \ - th->throwFromJNI(SP); \ +#define END_JNI_EXCEPTION \ + } CATCH { \ + JavaThread::j3Thread(mut)->throwFromJNI(SP); \ } END_CATCH; -#define RETURN_FROM_JNI(a) {\ - th->endKnownFrame(); \ - th->enterUncooperativeCode(SP); \ - return (a); } \ - -#define RETURN_VOID_FROM_JNI {\ - th->endKnownFrame(); \ - th->enterUncooperativeCode(SP); \ - return; } \ +#define RETURN_FROM_JNI(a) { \ + mut->endKnownFrame(); \ + mut->enterUncooperativeCode(SP); \ + return (a); } \ + +#define RETURN_VOID_FROM_JNI { \ + mut->endKnownFrame(); \ + mut->enterUncooperativeCode(SP); \ + return; } \ /// JavaThread - This class is the internal representation of a Java thread. @@ -80,6 +80,9 @@ /// JavaObject* javaThread; + /// mut - The associated mutator. Should be removed + mvm::Thread* mut; + /// vmThread - The VMThread object of this thread. /// JavaObject* vmThread; Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp?rev=120019&r1=120018&r2=120019&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp Tue Nov 23 05:44:37 2010 @@ -173,7 +173,7 @@ false, true, 0); str = vm->asciizToStr(msg); init->invokeIntSpecial(vm, realCl, res, &str); - th->pendingException = res; + JavaThread::j3Thread(mut)->pendingException = res; RETURN_FROM_JNI(1); @@ -190,7 +190,7 @@ JavaObject* obj = JavaThread::get()->pendingException; llvm_gcroot(obj, 0); if (obj == NULL) RETURN_FROM_JNI(NULL); - jthrowable res = (jthrowable)th->pushJNIRef(obj); + jthrowable res = (jthrowable)JavaThread::j3Thread(mut)->pushJNIRef(obj); RETURN_FROM_JNI(res); END_JNI_EXCEPTION Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp?rev=120019&r1=120018&r2=120019&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp Tue Nov 23 05:44:37 2010 @@ -79,14 +79,14 @@ // current thread can obtain the lock for that object // (Java specification §8.13). acquire(); - JavaThread* self = JavaThread::get(); + mvm::Thread* mut = mvm::Thread::get(); if (getInitializationState() == inClinit) { // 2. If initialization by some other thread is in progress for the // class or interface, then wait on this Class object (which // temporarily releases the lock). When the current thread awakens // from the wait, repeat this step. - if (getOwnerClass() != self) { + if (getOwnerClass() != mut) { while (getOwnerClass()) { waitClass(); } @@ -119,7 +119,7 @@ // 6. Otherwise, record the fact that initialization of the Class object is // now in progress by the current thread and release the lock on the // Class object. - setOwnerClass(self); + setOwnerClass(mut); bool vmjced = (getInitializationState() == vmjc); setInitializationState(inClinit); UserClass* cl = (UserClass*)this; @@ -155,8 +155,10 @@ broadcastClass(); release(); } END_CATCH; - if (self->pendingException != NULL) { - self->throwPendingException(); + + JavaThread* th = JavaThread::get(); + if (th->pendingException != NULL) { + th->throwPendingException(); return; } } @@ -195,9 +197,9 @@ TRY { meth->invokeIntStatic(vm, cl); } CATCH { - exc = self->getJavaException(); + exc = JavaThread::get()->getJavaException(); assert(exc && "no exception?"); - self->clearException(); + mvm::Thread::get()->clearException(); } END_CATCH; } #ifdef SERVICE @@ -224,10 +226,11 @@ // ExceptionInInitializerError cannot be created because an // OutOfMemoryError occurs, then instead use an OutOfMemoryError object // in place of E in the following step. + JavaThread* th = JavaThread::get(); if (JavaObject::getClass(exc)->isAssignableFrom(vm->upcalls->newException)) { Classpath* upcalls = classLoader->bootstrapLoader->upcalls; UserClass* clExcp = upcalls->ExceptionInInitializerError; - Jnjvm* vm = self->getJVM(); + Jnjvm* vm = th->getJVM(); obj = clExcp->doNew(vm); if (obj == NULL) { fprintf(stderr, "implement me"); @@ -246,7 +249,7 @@ setOwnerClass(0); broadcastClass(); release(); - self->throwException(exc); + th->throwException(exc); return; } } @@ -1088,10 +1091,10 @@ JnjvmClassLoader* loader = bootstrapLoader; // First create system threads. - finalizerThread = JavaThread::j3Thread(JavaThread::create(0, 0, this)); + finalizerThread = JavaThread::create(0, 0, this); finalizerThread->start(finalizerStart); - enqueueThread = JavaThread::j3Thread(JavaThread::create(0, 0, this)); + enqueueThread = JavaThread::create(0, 0, this); enqueueThread->start(enqueueStart); // Initialise the bootstrap class loader if it's not @@ -1236,8 +1239,9 @@ exc = JavaThread::get()->pendingException; if (exc != NULL) { - JavaThread* th = JavaThread::get(); - th->clearException(); + mvm::Thread* mut = mvm::Thread::get(); + mut->clearException(); + JavaThread* th = JavaThread::j3Thread(mut); obj = th->currentThread(); group = upcalls->group->getInstanceObjectField(obj); TRY { From gael.thomas at lip6.fr Tue Nov 23 05:13:30 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 23 Nov 2010 13:13:30 -0000 Subject: [vmkit-commits] [vmkit] r120020 - in /vmkit/branches/multi-vm/lib/J3: Classpath/ClasspathConstructor.inc Classpath/ClasspathMethod.inc Classpath/ClasspathVMStackWalker.inc Classpath/ClasspathVMThrowable.inc VMCore/JnjvmClassLoader.cpp Message-ID: <20101123131330.AC1E02A6C12C@llvm.org> Author: gthomas Date: Tue Nov 23 07:13:30 2010 New Revision: 120020 URL: http://llvm.org/viewvc/llvm-project?rev=120020&view=rev Log: split the JavaThread and the mvm::Thread (in progress) - 2 Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMStackWalker.inc vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThrowable.inc vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc?rev=120020&r1=120019&r2=120020&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc Tue Nov 23 07:13:30 2010 @@ -117,15 +117,16 @@ } } - JavaThread* th = JavaThread::get(); TRY { meth->invokeIntSpecialBuf(vm, cl, res, buf); } CATCH { - excp = th->getJavaException(); + excp = JavaThread::get()->getJavaException(); } END_CATCH; + mvm::Thread* mut = mvm::Thread::get(); + JavaThread* th = JavaThread::j3Thread(mut); if (excp) { if (JavaObject::getClass(excp)->isAssignableFrom(vm->upcalls->newException)) { - th->clearException(); + mut->clearException(); // If it's an exception, we encapsule it in an // invocationTargetException vm->invocationTargetException(excp); Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc?rev=120020&r1=120019&r2=120020&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc Tue Nov 23 07:13:30 2010 @@ -150,32 +150,33 @@ } } - JavaThread* th = JavaThread::get(); -#define RUN_METH(TYPE, VAR) \ - TRY { \ - if (isVirtual(meth->access)) { \ - if (isPublic(meth->access) && !isFinal(meth->access) && \ - !isFinal(meth->classDef->access)) { \ - VAR = meth->invoke##TYPE##VirtualBuf(vm, cl, obj, buf); \ - } else { \ - VAR = meth->invoke##TYPE##SpecialBuf(vm, cl, obj, buf); \ - } \ - } else { \ - VAR = meth->invoke##TYPE##StaticBuf(vm, cl, buf); \ - } \ - } CATCH { \ - exc = th->getJavaException(); \ - } END_CATCH; \ - if (exc) { \ - if (JavaObject::getClass(exc)->isAssignableFrom( \ - vm->upcalls->newException)) { \ - th->clearException(); \ - th->getJVM()->invocationTargetException(exc); \ - } else { \ - th->throwPendingException(); \ - } \ - return NULL; \ +#define RUN_METH(TYPE, VAR) \ + TRY { \ + if (isVirtual(meth->access)) { \ + if (isPublic(meth->access) && !isFinal(meth->access) && \ + !isFinal(meth->classDef->access)) { \ + VAR = meth->invoke##TYPE##VirtualBuf(vm, cl, obj, buf); \ + } else { \ + VAR = meth->invoke##TYPE##SpecialBuf(vm, cl, obj, buf); \ + } \ + } else { \ + VAR = meth->invoke##TYPE##StaticBuf(vm, cl, buf); \ + } \ + } CATCH { \ + exc = JavaThread::get()->getJavaException(); \ + } END_CATCH; \ + mvm::Thread* mut = mvm::Thread::get(); \ + JavaThread* th = JavaThread::j3Thread(mut); \ + if (exc) { \ + if (JavaObject::getClass(exc)->isAssignableFrom( \ + vm->upcalls->newException)) { \ + mut->clearException(); \ + th->getJVM()->invocationTargetException(exc); \ + } else { \ + th->throwPendingException(); \ + } \ + return NULL; \ } Typedef* retType = sign->getReturnType(); Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMStackWalker.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMStackWalker.inc?rev=120020&r1=120019&r2=120020&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMStackWalker.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMStackWalker.inc Tue Nov 23 07:13:30 2010 @@ -37,9 +37,10 @@ BEGIN_NATIVE_EXCEPTION(0) - JavaThread* th = JavaThread::get(); + mvm::Thread* mut = mvm::Thread::get(); + JavaThread* th = JavaThread::j3Thread(mut); Jnjvm* vm = th->getJVM(); - uint32 length = th->getFrameContextLength(); + uint32 length = mut->getFrameContextLength(); mvm::ThreadAllocator allocator; uintptr_t* buffer = (uintptr_t*)allocator.Allocate(length * sizeof(uintptr_t)); Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThrowable.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThrowable.inc?rev=120020&r1=120019&r2=120020&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThrowable.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThrowable.inc Tue Nov 23 07:13:30 2010 @@ -33,10 +33,12 @@ llvm_gcroot(vmThrowable, 0); llvm_gcroot(result, 0); - JavaThread* th = JavaThread::get(); + mvm::Thread* mut = mvm::Thread::get(); + uint32 length = mut->getFrameContextLength(); + + JavaThread* th = JavaThread::j3Thread(mut); Jnjvm* vm = th->getJVM(); - uint32 length = th->getFrameContextLength(); if (sizeof(void*) == 4) { ClassArray* cl = vm->upcalls->ArrayOfInt; @@ -47,7 +49,7 @@ } // Don't call th->getFrameContext because it is not GC-safe. - mvm::StackWalker Walker(th); + mvm::StackWalker Walker(mut); uint32_t i = 0; while (void* ip = *Walker) { Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=120020&r1=120019&r2=120020&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp Tue Nov 23 07:13:30 2010 @@ -693,7 +693,7 @@ assert(success && "Could not add class in map"); } CATCH { excp = JavaThread::get()->pendingException; - JavaThread::get()->clearException(); + mvm::Thread::get()->clearException(); } END_CATCH; } if (excp != NULL) { From gael.thomas at lip6.fr Tue Nov 23 05:27:42 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 23 Nov 2010 13:27:42 -0000 Subject: [vmkit-commits] [vmkit] r120021 - in /vmkit/branches/multi-vm/lib/J3: Classpath/ClasspathVMThread.inc Compiler/JavaAOTCompiler.cpp VMCore/JavaThread.h Message-ID: <20101123132742.8993F2A6C12C@llvm.org> Author: gthomas Date: Tue Nov 23 07:27:42 2010 New Revision: 120021 URL: http://llvm.org/viewvc/llvm-project?rev=120021&view=rev Log: split the JavaThread and the mvm::Thread (in progress) - 3 Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc?rev=120021&r1=120020&r2=120021&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMThread.inc Tue Nov 23 07:27:42 2010 @@ -111,7 +111,7 @@ while (field->getInstanceObjectField(vmthread) == 0) mvm::Thread::yield(); - JavaThread* th = (JavaThread*)field->getInstanceObjectField(vmthread); + JavaThread* th = (JavaThread*)field->getInstanceObjectField(vmthread); th->interruptFlag = 1; JavaLock* lock = th->waitsOn; @@ -124,7 +124,7 @@ uint32 locked = 0; while (true) { locked = (lock->tryAcquire() == 0); - if (locked || (lock->getOwner() != th && lock->getOwner() != 0)) + if (locked || (lock->getOwner() != th->mut && lock->getOwner() != 0)) break; else mvm::Thread::yield(); } Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=120021&r1=120020&r2=120021&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Nov 23 07:27:42 2010 @@ -1988,7 +1988,7 @@ e = classes.end(); i != e; ++i) { Class* cl = *i; cl->resolveClass(); - cl->setOwnerClass(JavaThread::get()); + cl->setOwnerClass(mvm::Thread::get()); for (uint32 i = 0; i < cl->nbVirtualMethods; ++i) { LLVMMethodInfo* LMI = M->getMethodInfo(&cl->virtualMethods[i]); @@ -2047,7 +2047,7 @@ for (std::vector::iterator i = classes.begin(), e = classes.end(); i != e; ++i) { Class* cl = *i; - cl->setOwnerClass(JavaThread::get()); + cl->setOwnerClass(mvm::Thread::get()); } for (std::vector::iterator i = classes.begin(), e = classes.end(); @@ -2075,10 +2075,10 @@ bootstrapLoader->setCompiler(M); } - cl->setOwnerClass(JavaThread::get()); + cl->setOwnerClass(mvm::Thread::get()); cl->resolveInnerOuterClasses(); for (uint32 i = 0; i < cl->nbInnerClasses; ++i) { - cl->innerClasses[i]->setOwnerClass(JavaThread::get()); + cl->innerClasses[i]->setOwnerClass(mvm::Thread::get()); M->compileClass(cl->innerClasses[i]); } M->compileClass(cl); Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120021&r1=120020&r2=120021&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Nov 23 07:27:42 2010 @@ -65,7 +65,7 @@ /// It maintains thread-specific information such as its state, the current /// exception if there is one, the layout of the stack, etc. /// -class JavaThread : public mvm::MutatorThread { +class JavaThread : private mvm::MutatorThread { public: /// jniEnv - The JNI environment of the thread. From gael.thomas at lip6.fr Tue Nov 23 05:46:15 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 23 Nov 2010 13:46:15 -0000 Subject: [vmkit-commits] [vmkit] r120023 - in /vmkit/branches/multi-vm/lib/J3/VMCore: JavaThread.cpp JavaThread.h Message-ID: <20101123134615.718DE2A6C12C@llvm.org> Author: gthomas Date: Tue Nov 23 07:46:15 2010 New Revision: 120023 URL: http://llvm.org/viewvc/llvm-project?rev=120023&view=rev Log: split the JavaThread and the mvm::Thread (in progress) - 4 Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120023&r1=120022&r2=120023&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Tue Nov 23 07:46:15 2010 @@ -24,13 +24,12 @@ const unsigned int JavaThread::StateInterrupted = 2; JavaThread::JavaThread(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) - : MutatorThread() { + : ZZZ() { llvm_gcroot(thread, 0); llvm_gcroot(vmth, 0); javaThread = thread; vmThread = vmth; - MyVM = isolate; interruptFlag = 0; state = StateRunning; pendingException = 0; @@ -53,10 +52,12 @@ } mvm::Thread *JavaThread::create(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) { - JavaThread *res = new JavaThread(thread, vmth, isolate); - res->vmData = (mvm::VMThreadData*)res; - res->mut = res; - return res; + JavaThread *th = new JavaThread(thread, vmth, isolate); + mvm::Thread *mut = (mvm::Thread*)th; + mut->MyVM = isolate; + mut->vmData = (mvm::VMThreadData*)th; + th->mut = mut; + return mut; } JavaThread::~JavaThread() { @@ -68,25 +69,24 @@ void JavaThread::throwException(JavaObject* obj) { llvm_gcroot(obj, 0); - JavaThread* th = JavaThread::get(); - assert(th->pendingException == 0 && "pending exception already there?"); - th->pendingException = obj; - th->internalThrowException(); + assert(JavaThread::get()->pendingException == 0 && "pending exception already there?"); + mvm::Thread* mut = mvm::Thread::get(); + j3Thread(mut)->pendingException = obj; + mut->internalThrowException(); } void JavaThread::throwPendingException() { - JavaThread* th = JavaThread::get(); - assert(th->pendingException); - th->internalThrowException(); + assert(JavaThread::get()->pendingException); + mvm::Thread::get()->internalThrowException(); } void JavaThread::startJNI(int level) { // Start uncooperative mode. - enterUncooperativeCode(level); + mut->enterUncooperativeCode(level); } uint32 JavaThread::getJavaFrameContext(void** buffer) { - mvm::StackWalker Walker(this); + mvm::StackWalker Walker(mut); uint32 i = 0; while (mvm::MethodInfo* MI = Walker.get()) { @@ -100,7 +100,7 @@ } JavaMethod* JavaThread::getCallingMethodLevel(uint32 level) { - mvm::StackWalker Walker(this); + mvm::StackWalker Walker(mut); uint32 index = 0; while (mvm::MethodInfo* MI = Walker.get()) { @@ -126,7 +126,7 @@ JavaObject* obj = 0; llvm_gcroot(obj, 0); - mvm::StackWalker Walker(this); + mvm::StackWalker Walker(mut); while (mvm::MethodInfo* MI = Walker.get()) { if (MI->MethodType == 1) { @@ -142,7 +142,7 @@ void JavaThread::printJavaBacktrace() { - mvm::StackWalker Walker(this); + mvm::StackWalker Walker(mut); while (mvm::MethodInfo* MI = Walker.get()) { if (MI->MethodType == 1) Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120023&r1=120022&r2=120023&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Nov 23 07:46:15 2010 @@ -61,11 +61,22 @@ return; } \ +class ZZZ : private mvm::MutatorThread { +public: + void* operator new(size_t sz) { + return mvm::MutatorThread::operator new(sz); + } + + void operator delete(void* th) { + mvm::MutatorThread::operator delete(th); + } +}; + /// JavaThread - This class is the internal representation of a Java thread. /// It maintains thread-specific information such as its state, the current /// exception if there is one, the layout of the stack, etc. /// -class JavaThread : private mvm::MutatorThread { +class JavaThread : public ZZZ { public: /// jniEnv - The JNI environment of the thread. @@ -196,8 +207,8 @@ /// throwFromJNI - Throw an exception after executing JNI code. /// void throwFromJNI(void* SP) { - endKnownFrame(); - enterUncooperativeCode(SP); + mut->endKnownFrame(); + mut->enterUncooperativeCode(SP); } /// throwFromNative - Throw an exception after executing Native code. @@ -228,9 +239,8 @@ localJNIRefs->removeJNIReferences(this, *currentAddedReferences); // Go back to cooperative mode. - leaveUncooperativeCode(); - - endKnownFrame(); + mut->leaveUncooperativeCode(); + mut->endKnownFrame(); } /// getCallingMethod - Get the Java method in the stack at the specified From gael.thomas at lip6.fr Tue Nov 23 15:12:30 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 23 Nov 2010 23:12:30 -0000 Subject: [vmkit-commits] [vmkit] r120067 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/LLVMRuntime/runtime-default.ll lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jnjvm.h mmtk/mmtk-j3/ActivePlan.cpp Message-ID: <20101123231230.8C6DA2A6C12C@llvm.org> Author: gthomas Date: Tue Nov 23 17:12:30 2010 New Revision: 120067 URL: http://llvm.org/viewvc/llvm-project?rev=120067&view=rev Log: The mutator thead is now independant from the vm. It contains a pointer to the specific thread local storage of a vm (JavaThread for J3). JavaThread inherits VMThreadData. Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120067&r1=120066&r2=120067&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Tue Nov 23 17:12:30 2010 @@ -148,7 +148,7 @@ this->mut = m; } - ~VMThreadData() {} // force the construction of a VT + virtual ~VMThreadData() {} // force the construction of a VT }; /// Thread - This class is the base of custom virtual machines' Thread classes. Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=120067&r1=120066&r2=120067&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Nov 23 17:12:30 2010 @@ -1941,8 +1941,8 @@ static const char* name; -void mainCompilerStart(JavaThread* th) { - +void mainCompilerStart(mvm::Thread* mut) { + JavaThread* th = JavaThread::j3Thread(mut); Jnjvm* vm = th->getJVM(); JnjvmBootstrapLoader* bootstrapLoader = vm->bootstrapLoader; JavaAOTCompiler* M = (JavaAOTCompiler*)bootstrapLoader->getCompiler(); @@ -2132,7 +2132,7 @@ name = n; mvm::Thread* th = JavaThread::create(0, 0, vm); vm->setMainThread(th); - th->start((void (*)(mvm::Thread*))mainCompilerStart); + th->start(mainCompilerStart); vm->waitForExit(); } Modified: vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll?rev=120067&r1=120066&r2=120067&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll Tue Nov 23 17:12:30 2010 @@ -24,7 +24,7 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } -%JavaThread = type { %MutatorThread, i8*, %JavaObject* } +%JavaThread = type { %VMThreadData, i8*, %JavaObject* } %Attribut = type { %UTF8*, i32, i32 } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120067&r1=120066&r2=120067&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Tue Nov 23 17:12:30 2010 @@ -23,8 +23,8 @@ const unsigned int JavaThread::StateWaiting = 1; const unsigned int JavaThread::StateInterrupted = 2; -JavaThread::JavaThread(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) - : ZZZ() { +JavaThread::JavaThread(mvm::Thread* mut, JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) + : mvm::VMThreadData(mut) { llvm_gcroot(thread, 0); llvm_gcroot(vmth, 0); @@ -52,11 +52,10 @@ } mvm::Thread *JavaThread::create(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) { - JavaThread *th = new JavaThread(thread, vmth, isolate); - mvm::Thread *mut = (mvm::Thread*)th; + mvm::Thread *mut = new mvm::MutatorThread(); + JavaThread *th = new JavaThread(mut, thread, vmth, isolate); mut->MyVM = isolate; - mut->vmData = (mvm::VMThreadData*)th; - th->mut = mut; + mut->vmData = th; return mut; } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120067&r1=120066&r2=120067&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Nov 23 17:12:30 2010 @@ -60,23 +60,11 @@ mut->enterUncooperativeCode(SP); \ return; } \ - -class ZZZ : private mvm::MutatorThread { -public: - void* operator new(size_t sz) { - return mvm::MutatorThread::operator new(sz); - } - - void operator delete(void* th) { - mvm::MutatorThread::operator delete(th); - } -}; - /// JavaThread - This class is the internal representation of a Java thread. /// It maintains thread-specific information such as its state, the current /// exception if there is one, the layout of the stack, etc. /// -class JavaThread : public ZZZ { +class JavaThread : public mvm::VMThreadData { public: /// jniEnv - The JNI environment of the thread. @@ -91,9 +79,6 @@ /// JavaObject* javaThread; - /// mut - The associated mutator. Should be removed - mvm::Thread* mut; - /// vmThread - The VMThread object of this thread. /// JavaObject* vmThread; @@ -153,7 +138,7 @@ /// JavaThread - Empty constructor, used to get the VT. /// - JavaThread() { + JavaThread() : mvm::VMThreadData(0) { #ifdef SERVICE replacedEIPs = 0; #endif @@ -163,13 +148,16 @@ /// ~JavaThread(); -private: - /// JavaThread - Creates a Java thread. + /// JavaThread - Creates a Java thread. Link the JavaThread to the mutator thread. /// - JavaThread(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); + JavaThread(mvm::Thread* mut, JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); -public: + /// create - Creates a Java thread and a mutator thread. + /// static mvm::Thread* create(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); + + /// j3Thread - gives the JavaThread associated with the mutator thread + /// static JavaThread* j3Thread(mvm::Thread* mut); /// get - Get the current thread as a JnJVM object. Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h?rev=120067&r1=120066&r2=120067&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.h Tue Nov 23 17:12:30 2010 @@ -166,11 +166,6 @@ /// static void mainJavaStart(mvm::Thread* thread); - /// mainCompileStart - Starts the static compilation of classes in a Java - /// thread. - /// - static void mainCompilerStart(mvm::Thread* thread); - public: /// tracer - Traces instances of this class. Modified: vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp?rev=120067&r1=120066&r2=120067&view=diff ============================================================================== --- vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp (original) +++ vmkit/branches/multi-vm/mmtk/mmtk-j3/ActivePlan.cpp Tue Nov 23 17:12:30 2010 @@ -26,8 +26,8 @@ assert(A && "No active plan"); if (A->current == NULL) { - A->current = (mvm::MutatorThread*)JavaThread::get()->MyVM->mainThread; - } else if (A->current->next() == JavaThread::get()->MyVM->mainThread) { + A->current = (mvm::MutatorThread*)mvm::Thread::get()->MyVM->mainThread; + } else if (A->current->next() == mvm::Thread::get()->MyVM->mainThread) { A->current = NULL; return NULL; } else { From nicolas.geoffray at lip6.fr Wed Nov 24 13:37:00 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 21:37:00 -0000 Subject: [vmkit-commits] [vmkit] r120114 - /vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Message-ID: <20101124213700.263D52A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 15:37:00 2010 New Revision: 120114 URL: http://llvm.org/viewvc/llvm-project?rev=120114&view=rev Log: Don't forget to trace the reference queue! Modified: vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp 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=120114&r1=120113&r2=120114&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/VirtualTables.cpp Wed Nov 24 15:37:00 2010 @@ -290,8 +290,13 @@ for (uint32 i = 0; i < finalizerThread->CurrentFinalizedIndex; ++i) { mvm::Collector::markAndTraceRoot(finalizerThread->ToBeFinalized + i, closure); } + + // (6) Trace the reference queue + for (uint32 i = 0; i < referenceThread->ToEnqueueIndex; ++i) { + mvm::Collector::markAndTraceRoot(referenceThread->ToEnqueue + i, closure); + } - // (6) Trace the locks and their associated object. + // (7) Trace the locks and their associated object. uint32 i = 0; for (; i < mvm::LockSystem::GlobalSize; i++) { mvm::FatLock** array = lockSystem.LockTable[i]; From nicolas.geoffray at lip6.fr Wed Nov 24 13:38:32 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 21:38:32 -0000 Subject: [vmkit-commits] [vmkit] r120115 - /vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc Message-ID: <20101124213832.845F22A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 15:38:32 2010 New Revision: 120115 URL: http://llvm.org/viewvc/llvm-project?rev=120115&view=rev Log: Re-generate MMTkInline.inc for MarkSweep. Modified: vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc 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=120115&r1=120114&r2=120115&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/branches/precise/mmtk/config/marksweep/MMTkInline.inc Wed Nov 24 15:38:32 2010 @@ -102,66 +102,9 @@ 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__CooperativeCollectionRV_fields; +std::vectorStructTy_struct_mvm__CollectionRV_fields; +StructTy_struct_mvm__CollectionRV_fields.push_back(PointerTy_5); std::vectorStructTy_struct_mvm__LockNormal_fields; std::vectorStructTy_struct_mvm__Lock_fields; StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5); @@ -189,18 +132,32 @@ 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); +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_14 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1); + +StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_14); +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__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)); @@ -212,7 +169,6 @@ 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; @@ -226,11 +182,11 @@ 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); +PointerType* PointerTy_15 = 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); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); 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); @@ -255,12 +211,7 @@ 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); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__FunctionMap); 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); @@ -273,41 +224,42 @@ 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( +std::vectorFuncTy_17_args; +FuncTy_17_args.push_back(PointerTy_13); +FunctionType* FuncTy_17 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_19_args, + /*Params=*/FuncTy_17_args, /*isVarArg=*/false); -PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); +PointerType* PointerTy_16 = PointerType::get(FuncTy_17, 0); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_16); 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); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); +PATypeHolder PointerTy_18_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_18_fwd); 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()); +PointerType* PointerTy_18 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0); +cast(PointerTy_18_fwd.get())->refineAbstractTypeTo(PointerTy_18); +PointerTy_18 = cast(PointerTy_18_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; -PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd); +PATypeHolder PointerTy_19_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_19_fwd); std::vectorStructTy_struct___jmp_buf_tag_fields; -ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); +ArrayType* ArrayTy_21 = 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(ArrayTy_21); 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); +ArrayType* ArrayTy_22 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); -StructTy_struct___sigset_t_fields.push_back(ArrayTy_24); +StructTy_struct___sigset_t_fields.push_back(ArrayTy_22); 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); @@ -315,18 +267,18 @@ 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); +ArrayType* ArrayTy_20 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_20); 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()); +PointerType* PointerTy_19 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); +cast(PointerTy_19_fwd.get())->refineAbstractTypeTo(PointerTy_19); +PointerTy_19 = cast(PointerTy_19_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_19); 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); @@ -334,166 +286,182 @@ StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread); -StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator); +std::vectorStructTy_struct_mvm__ThreadAllocator_fields; +StructTy_struct_mvm__ThreadAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator); +StructType* StructTy_struct_mvm__ThreadAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__ThreadAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ThreadAllocator", StructTy_struct_mvm__ThreadAllocator); + +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__ThreadAllocator); StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_16); 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); +PointerType* PointerTy_23 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); std::vectorStructTy_struct_j3__JavaObject_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); + 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); +PointerType* PointerTy_24 = 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_29 = PointerType::get(ArrayTy_VT, 0); +PointerType* PointerTy_27 = PointerType::get(ArrayTy_VT, 0); -StructTy_JavaObject_fields.push_back(PointerTy_29); +StructTy_JavaObject_fields.push_back(PointerTy_27); 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_28 = PointerType::get(StructTy_JavaObject, 0); +PointerType* PointerTy_26 = PointerType::get(StructTy_JavaObject, 0); -PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); +PointerType* PointerTy_25 = PointerType::get(PointerTy_26, 0); -PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); +PointerType* PointerTy_28 = 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, +std::vectorFuncTy_30_args; +FuncTy_30_args.push_back(PointerTy_26); +FuncTy_30_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_30_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_30_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_30 = FunctionType::get( + /*Result=*/PointerTy_26, + /*Params=*/FuncTy_30_args, /*isVarArg=*/false); -PointerType* PointerTy_31 = PointerType::get(FuncTy_32, 0); +PointerType* PointerTy_29 = PointerType::get(FuncTy_30, 0); -PointerType* PointerTy_33 = PointerType::get(PointerTy_29, 0); +PointerType* PointerTy_31 = PointerType::get(PointerTy_27, 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, +std::vectorFuncTy_33_args; +FuncTy_33_args.push_back(PointerTy_26); +FuncTy_33_args.push_back(PointerTy_26); +FuncTy_33_args.push_back(PointerTy_26); +FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_33 = FunctionType::get( + /*Result=*/PointerTy_26, + /*Params=*/FuncTy_33_args, /*isVarArg=*/false); -PointerType* PointerTy_34 = PointerType::get(FuncTy_35, 0); +PointerType* PointerTy_32 = PointerType::get(FuncTy_33, 0); +std::vectorStructTy_35_fields; +std::vectorStructTy_36_fields; std::vectorStructTy_37_fields; -std::vectorStructTy_38_fields; +StructTy_37_fields.push_back(StructTy_JavaObject); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_37_fields.push_back(PointerTy_26); +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(IntegerType::get(mod->getContext(), 8)); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_37 = StructType::get(mod->getContext(), StructTy_37_fields, /*isPacked=*/false); + +StructTy_36_fields.push_back(StructTy_37); +StructType* StructTy_36 = StructType::get(mod->getContext(), StructTy_36_fields, /*isPacked=*/false); + +StructTy_35_fields.push_back(StructTy_36); +StructTy_35_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_35_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_35_fields.push_back(PointerTy_26); +StructType* StructTy_35 = StructType::get(mod->getContext(), StructTy_35_fields, /*isPacked=*/false); + +PointerType* PointerTy_34 = PointerType::get(StructTy_35, 0); + 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); +std::vectorStructTy_40_fields; +StructTy_40_fields.push_back(StructTy_37); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructType* StructTy_40 = StructType::get(mod->getContext(), StructTy_40_fields, /*isPacked=*/false); + +StructTy_39_fields.push_back(StructTy_40); 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_38 = PointerType::get(StructTy_39, 0); -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); +StructTy_42_fields.push_back(StructTy_37); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8)); 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); +PointerType* PointerTy_41 = PointerType::get(StructTy_42, 0); -std::vectorFuncTy_46_args; -FunctionType* FuncTy_46 = FunctionType::get( +std::vectorFuncTy_44_args; +FunctionType* FuncTy_44 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_46_args, + /*Params=*/FuncTy_44_args, /*isVarArg=*/false); -PointerType* PointerTy_45 = PointerType::get(FuncTy_46, 0); +PointerType* PointerTy_43 = PointerType::get(FuncTy_44, 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); +std::vectorStructTy_46_fields; +StructTy_46_fields.push_back(PointerTy_26); +StructTy_46_fields.push_back(PointerTy_26); +StructTy_46_fields.push_back(PointerTy_26); +StructTy_46_fields.push_back(PointerTy_26); +StructType* StructTy_46 = StructType::get(mod->getContext(), StructTy_46_fields, /*isPacked=*/false); + +PointerType* PointerTy_45 = PointerType::get(StructTy_46, 0); + +std::vectorFuncTy_48_args; +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FunctionType* FuncTy_48 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_48_args, + /*isVarArg=*/false); -PointerType* PointerTy_47 = PointerType::get(StructTy_48, 0); +PointerType* PointerTy_47 = PointerType::get(FuncTy_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)); +FuncTy_50_args.push_back(PointerTy_23); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_50 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), + /*Result=*/IntegerType::get(mod->getContext(), 32), /*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 @@ -514,10 +482,11 @@ func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create( - /*Type=*/FuncTy_32, + /*Type=*/FuncTy_30, /*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); +func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL; { SmallVector Attrs; @@ -530,10 +499,11 @@ 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, + /*Type=*/FuncTy_33, /*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); +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; { SmallVector Attrs; @@ -546,10 +516,11 @@ 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, + /*Type=*/FuncTy_30, /*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); +func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL; { SmallVector Attrs; @@ -561,24 +532,24 @@ } 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, +Function* func_abort = Function::Create( + /*Type=*/FuncTy_44, /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"llvm.trap", mod); // (external, no body) -func_llvm_trap->setCallingConv(CallingConv::C); -AttrListPtr func_llvm_trap_PAL; + /*Name=*/"abort", mod); // (external, no body) +func_abort->setCallingConv(CallingConv::C); +AttrListPtr func_abort_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; Attrs.push_back(PAWI); - func_llvm_trap_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -func_llvm_trap->setAttributes(func_llvm_trap_PAL); +func_abort->setAttributes(func_abort_PAL); Function* func_llvm_memory_barrier = Function::Create( - /*Type=*/FuncTy_50, + /*Type=*/FuncTy_48, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.memory.barrier", mod); // (external, no body) func_llvm_memory_barrier->setCallingConv(CallingConv::C); @@ -594,7 +565,7 @@ func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL); Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create( - /*Type=*/FuncTy_52, + /*Type=*/FuncTy_50, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.atomic.cmp.swap.i32.p0i32", mod); // (external, no body) func_llvm_atomic_cmp_swap_i32_p0i32->setCallingConv(CallingConv::C); @@ -612,7 +583,7 @@ func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL); Function* func__ZN3mvm6Thread5yieldEv = Function::Create( - /*Type=*/FuncTy_46, + /*Type=*/FuncTy_44, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C); @@ -622,124 +593,124 @@ // Global Variable Declarations GlobalVariable* gvar_struct_finalObject32 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_37, +/*Type=*/StructTy_35, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject32"); GlobalVariable* gvar_struct_finalObject101 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_37, +/*Type=*/StructTy_35, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject101"); GlobalVariable* gvar_struct_finalObject122 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_41, +/*Type=*/StructTy_39, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject122"); GlobalVariable* gvar_struct_finalObject67 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_41, +/*Type=*/StructTy_39, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject67"); GlobalVariable* gvar_struct_finalObject2 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_44, +/*Type=*/StructTy_42, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject2"); GlobalVariable* gvar_struct_finalObject85 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_41, +/*Type=*/StructTy_39, /*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, +/*Type=*/StructTy_46, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"org_mmtk_utility_DoublyLinkedList_static"); // Constant Definitions -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)); +ConstantInt* const_int32_51 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_52 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_53 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_55 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_56 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8193"), 10)); +ConstantInt* const_int32_57 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("4"), 10)); +ConstantInt* const_int32_58 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("7"), 10)); +ConstantInt* const_int32_59 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8"), 10)); +ConstantInt* const_int32_60 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-1"), 10)); +ConstantInt* const_int32_61 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("63"), 10)); +ConstantInt* const_int32_62 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("127"), 10)); +ConstantInt* const_int32_63 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("255"), 10)); +ConstantInt* const_int32_64 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("511"), 10)); +ConstantInt* const_int32_65 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2047"), 10)); +ConstantInt* const_int32_66 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("10"), 10)); +ConstantInt* const_int32_67 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("32"), 10)); +ConstantInt* const_int32_68 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("12"), 10)); +ConstantInt* const_int32_69 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_70 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("16"), 10)); +ConstantInt* const_int32_71 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("6"), 10)); +ConstantInt* const_int32_72 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("20"), 10)); +ConstantInt* const_int32_73 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10)); +ConstantInt* const_int32_74 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantPointerNull* const_ptr_75 = ConstantPointerNull::get(PointerTy_27); +ConstantInt* const_int8_76 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("-4"), 10)); +std::vector const_ptr_77_indices; +const_ptr_77_indices.push_back(const_int32_53); +const_ptr_77_indices.push_back(const_int32_74); +Constant* const_ptr_77 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_77_indices[0], const_ptr_77_indices.size()); +ConstantInt* const_int8_78 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("2"), 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); +const_ptr_79_indices.push_back(const_int32_53); +const_ptr_79_indices.push_back(const_int32_51); 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); +ConstantInt* const_int32_80 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); +ConstantPointerNull* const_ptr_81 = ConstantPointerNull::get(PointerTy_0); +std::vector const_ptr_82_indices; +const_ptr_82_indices.push_back(const_int32_53); +const_ptr_82_indices.push_back(const_int32_74); +Constant* const_ptr_82 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_82_indices[0], const_ptr_82_indices.size()); +std::vector const_ptr_83_indices; +const_ptr_83_indices.push_back(const_int32_53); +const_ptr_83_indices.push_back(const_int32_51); +Constant* const_ptr_83 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_83_indices[0], const_ptr_83_indices.size()); std::vector const_ptr_84_indices; +const_ptr_84_indices.push_back(const_int32_53); 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()); +Constant* const_ptr_84 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject122, &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()); +const_ptr_85_indices.push_back(const_int32_55); +Constant* const_ptr_85 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject67, &const_ptr_85_indices[0], const_ptr_85_indices.size()); +ConstantInt* const_int8_86 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("1"), 10)); 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)); +const_ptr_87_indices.push_back(const_int32_53); +const_ptr_87_indices.push_back(const_int32_74); +Constant* const_ptr_87 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject2, &const_ptr_87_indices[0], const_ptr_87_indices.size()); +std::vector const_ptr_88_indices; +const_ptr_88_indices.push_back(const_int32_53); +const_ptr_88_indices.push_back(const_int32_55); +Constant* const_ptr_88 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject85, &const_ptr_88_indices[0], const_ptr_88_indices.size()); std::vector const_ptr_89_indices; +const_ptr_89_indices.push_back(const_int32_53); 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)); +Constant* const_ptr_89 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_89_indices[0], const_ptr_89_indices.size()); +ConstantPointerNull* const_ptr_90 = ConstantPointerNull::get(PointerTy_26); +ConstantInt* const_int32_91 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); +ConstantInt* const_int1_92 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10)); // Global Variable Definitions @@ -748,6 +719,7 @@ /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"gcmalloc", mod); func_gcmalloc->setCallingConv(CallingConv::C); +func_gcmalloc->setGC("vmkit"); AttrListPtr func_gcmalloc_PAL; { SmallVector Attrs; @@ -840,1076 +812,1076 @@ 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_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; +BinaryOperator* int32_93 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_51, "", label_entry); +BinaryOperator* int32_94 = BinaryOperator::Create(Instruction::And, int32_93, const_int32_52, "", label_entry); +CallInst* ptr_95 = CallInst::Create(func_llvm_frameaddress, const_int32_53, "", label_entry); +ptr_95->setCallingConv(CallingConv::C); +ptr_95->setTailCall(true); +AttrListPtr ptr_95_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); + ptr_95_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_95->setAttributes(ptr_95_PAL); + +CastInst* int32_96 = new PtrToIntInst(ptr_95, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_97 = BinaryOperator::Create(Instruction::And, int32_96, const_int32_54, "", label_entry); +CastInst* ptr_98 = new IntToPtrInst(int32_97, PointerTy_4, "", label_entry); +std::vector ptr_99_indices; +ptr_99_indices.push_back(const_int32_53); +ptr_99_indices.push_back(const_int32_55); +Instruction* ptr_99 = GetElementPtrInst::Create(ptr_98, ptr_99_indices.begin(), ptr_99_indices.end(), "", label_entry); +LoadInst* int32_100 = new LoadInst(ptr_99, "", false, label_entry); +CastInst* ptr_101 = new IntToPtrInst(int32_100, PointerTy_24, "", label_entry); +ICmpInst* int1_102 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_94, const_int32_56, ""); +SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_102, const_int32_53, const_int32_57, "storemerge.i.i", label_entry); +SwitchInst* void_103 = SwitchInst::Create(int32_storemerge_i_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, 7, label_entry); +void_103->addCase(const_int32_53, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +void_103->addCase(const_int32_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +void_103->addCase(const_int32_51, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +void_103->addCase(const_int32_57, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +void_103->addCase(const_int32_58, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +void_103->addCase(const_int32_59, 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); +GetElementPtrInst* ptr_104 = GetElementPtrInst::Create(ptr_101, const_int32_57, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +CastInst* ptr_105 = new BitCastInst(ptr_104, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +LoadInst* ptr_106 = new LoadInst(ptr_105, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +BinaryOperator* int32_107 = BinaryOperator::Create(Instruction::Add, int32_94, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +ICmpInst* int1_108 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_107, const_int32_61, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_108, 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); +ICmpInst* int1_110 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_107, const_int32_62, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_110, 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); +ICmpInst* int1_112 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_107, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_112, 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); +ICmpInst* int1_114 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_107, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_114, 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); +ICmpInst* int1_116 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_107, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_116, 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); +BinaryOperator* int32_118 = BinaryOperator::Create(Instruction::AShr, int32_107, const_int32_66, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BinaryOperator* int32_119 = BinaryOperator::Create(Instruction::Add, int32_118, const_int32_67, "", 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); +BinaryOperator* int32_121 = BinaryOperator::Create(Instruction::AShr, int32_107, const_int32_55, "", 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); +BinaryOperator* int32_123 = BinaryOperator::Create(Instruction::AShr, int32_107, const_int32_57, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BinaryOperator* int32_124 = BinaryOperator::Create(Instruction::Add, int32_123, const_int32_68, "", 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); +BinaryOperator* int32_126 = BinaryOperator::Create(Instruction::AShr, int32_107, const_int32_69, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BinaryOperator* int32_127 = BinaryOperator::Create(Instruction::Add, int32_126, const_int32_70, "", 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); +BinaryOperator* int32_129 = BinaryOperator::Create(Instruction::AShr, int32_107, const_int32_71, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BinaryOperator* int32_130 = BinaryOperator::Create(Instruction::Add, int32_129, const_int32_72, "", 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); +BinaryOperator* int32_132 = BinaryOperator::Create(Instruction::AShr, int32_107, const_int32_59, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BinaryOperator* int32_133 = BinaryOperator::Create(Instruction::Add, int32_132, const_int32_73, "", 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); +PHINode* int32_135 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +int32_135->reserveOperandSpace(6); +int32_135->addIncoming(int32_121, label_false_IF_ICMPGT16_i_i_i_i_i_i); +int32_135->addIncoming(int32_124, label_false_IF_ICMPGT17_i_i_i_i_i_i); +int32_135->addIncoming(int32_127, label_false_IF_ICMPGT18_i_i_i_i_i_i); +int32_135->addIncoming(int32_130, label_false_IF_ICMPGT19_i_i_i_i_i_i); +int32_135->addIncoming(int32_133, label_false_IF_ICMPGT20_i_i_i_i_i_i); +int32_135->addIncoming(int32_119, label_GOTO_or_IF_9_i_i_i_i_i_i); + +std::vector ptr_136_indices; +ptr_136_indices.push_back(const_int32_74); +ptr_136_indices.push_back(const_int32_74); +Instruction* ptr_136 = GetElementPtrInst::Create(ptr_106, ptr_136_indices.begin(), ptr_136_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* ptr_137 = new LoadInst(ptr_136, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +BinaryOperator* int32_138 = BinaryOperator::Create(Instruction::Add, int32_135, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_139 = new BitCastInst(ptr_137, PointerTy_23, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +GetElementPtrInst* ptr_140 = GetElementPtrInst::Create(ptr_139, int32_138, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* int32_141 = new LoadInst(ptr_140, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_142 = new IntToPtrInst(int32_141, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +ICmpInst* int1_143 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_141, const_int32_53, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_143, 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; +std::vector ptr_145_params; +ptr_145_params.push_back(ptr_106); +ptr_145_params.push_back(int32_94); +ptr_145_params.push_back(const_int32_53); +ptr_145_params.push_back(const_int32_53); +CallInst* ptr_145 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_145_params.begin(), ptr_145_params.end(), "", label_GOTO_or_IF__i_i_i_i); +ptr_145->setCallingConv(CallingConv::C); +ptr_145->setTailCall(true); +AttrListPtr ptr_145_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_145_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_147->setAttributes(ptr_147_PAL); +ptr_145->setAttributes(ptr_145_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); +CastInst* ptr_147 = new IntToPtrInst(int32_141, PointerTy_25, "", label_false_IFNE_i_i_i_i); +LoadInst* ptr_148 = new LoadInst(ptr_147, "", false, label_false_IFNE_i_i_i_i); +CastInst* int32_149 = new PtrToIntInst(ptr_148, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i); + new StoreInst(int32_149, ptr_140, false, label_false_IFNE_i_i_i_i); +std::vector ptr_151_indices; +ptr_151_indices.push_back(const_int32_53); +ptr_151_indices.push_back(const_int32_53); +Instruction* ptr_151 = GetElementPtrInst::Create(ptr_142, ptr_151_indices.begin(), ptr_151_indices.end(), "", label_false_IFNE_i_i_i_i); + new StoreInst(const_ptr_75, ptr_151, 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); +GetElementPtrInst* ptr_154 = GetElementPtrInst::Create(ptr_101, const_int32_55, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_155 = new BitCastInst(ptr_154, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_156 = new LoadInst(ptr_155, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +GetElementPtrInst* ptr_157 = GetElementPtrInst::Create(ptr_156, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_158 = new BitCastInst(ptr_157, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_159 = new LoadInst(ptr_158, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* int32_160 = new PtrToIntInst(ptr_159, 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_161 = BinaryOperator::Create(Instruction::Add, int32_160, int32_94, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_162 = new IntToPtrInst(int32_161, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +std::vector ptr_163_indices; +ptr_163_indices.push_back(const_int32_74); +ptr_163_indices.push_back(const_int32_74); +Instruction* ptr_163 = GetElementPtrInst::Create(ptr_156, ptr_163_indices.begin(), ptr_163_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_164 = new LoadInst(ptr_163, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_165 = new BitCastInst(ptr_164, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +ICmpInst* int1_166 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_162, ptr_165, ""); +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_166, 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); +std::vector ptr_168_indices; +ptr_168_indices.push_back(const_int32_74); +ptr_168_indices.push_back(const_int32_53); +Instruction* ptr_168 = GetElementPtrInst::Create(ptr_156, ptr_168_indices.begin(), ptr_168_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_161, PointerTy_27, ".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_168, 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; +std::vector ptr_171_params; +ptr_171_params.push_back(ptr_156); +ptr_171_params.push_back(ptr_159); +ptr_171_params.push_back(ptr_162); +ptr_171_params.push_back(const_int32_53); +ptr_171_params.push_back(const_int32_53); +CallInst* ptr_171 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_171_params.begin(), ptr_171_params.end(), "", label_false_IFEQ_i_i_i_i); +ptr_171->setCallingConv(CallingConv::C); +ptr_171->setTailCall(true); +AttrListPtr ptr_171_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_173_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_171_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_173->setAttributes(ptr_173_PAL); +ptr_171->setAttributes(ptr_171_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; +std::vector ptr_173_indices; +ptr_173_indices.push_back(const_int32_55); +ptr_173_indices.push_back(const_int32_53); +ptr_173_indices.push_back(const_int32_53); +ptr_173_indices.push_back(const_int32_74); +Instruction* ptr_173 = GetElementPtrInst::Create(ptr_101, ptr_173_indices.begin(), ptr_173_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_174 = new BitCastInst(ptr_173, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_175 = new LoadInst(ptr_174, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_176 = new BitCastInst(ptr_175, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_177_params; +ptr_177_params.push_back(ptr_176); +ptr_177_params.push_back(int32_94); +ptr_177_params.push_back(const_int32_53); +ptr_177_params.push_back(const_int32_53); +CallInst* ptr_177 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_177_params.begin(), ptr_177_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ptr_177->setCallingConv(CallingConv::C); +ptr_177->setTailCall(true); +AttrListPtr ptr_177_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); - + ptr_177_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_177->setAttributes(ptr_177_PAL); + +std::vector ptr_178_indices; +ptr_178_indices.push_back(const_int32_53); +ptr_178_indices.push_back(const_int32_53); +Instruction* ptr_178 = GetElementPtrInst::Create(ptr_177, ptr_178_indices.begin(), ptr_178_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr__c20_i = new BitCastInst(ptr_VT, PointerTy_27, ".c20.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(ptr__c20_i, ptr_178, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); 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); +ptr_180_indices.push_back(const_int32_53); +ptr_180_indices.push_back(const_int32_74); +Instruction* ptr_180 = GetElementPtrInst::Create(ptr_177, ptr_180_indices.begin(), ptr_180_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_181 = new BitCastInst(ptr_180, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_182 = new LoadInst(ptr_181, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_183 = BinaryOperator::Create(Instruction::And, int8_182, const_int8_76, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_184 = new LoadInst(const_ptr_77, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_185 = BinaryOperator::Create(Instruction::Or, int8_183, int8_184, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_186 = BinaryOperator::Create(Instruction::Or, int8_185, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(int8_186, ptr_181, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_188 = new LoadInst(const_ptr_79, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* int32_189 = new PtrToIntInst(ptr_177, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int32_190 = BinaryOperator::Create(Instruction::And, int32_189, const_int32_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_191 = new IntToPtrInst(int32_190, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_192_indices; +ptr_192_indices.push_back(const_int32_55); +ptr_192_indices.push_back(const_int32_74); +Instruction* ptr_192 = GetElementPtrInst::Create(ptr_188, ptr_192_indices.begin(), ptr_192_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_193 = new LoadInst(ptr_192, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +GetElementPtrInst* ptr_194 = GetElementPtrInst::Create(ptr_193, const_int32_68, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_195 = new BitCastInst(ptr_194, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_196 = new LoadInst(ptr_195, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ICmpInst* int1_197 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i, ICmpInst::ICMP_EQ, ptr_196, const_ptr_81, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i5_i_i_i_i_i, int1_197, 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); +GetElementPtrInst* ptr_199 = GetElementPtrInst::Create(ptr_101, const_int32_51, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +CastInst* ptr_200 = new BitCastInst(ptr_199, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +LoadInst* ptr_201 = new LoadInst(ptr_200, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +BinaryOperator* int32_202 = BinaryOperator::Create(Instruction::Add, int32_94, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +ICmpInst* int1_203 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_202, const_int32_61, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_203, 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); +ICmpInst* int1_205 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_202, const_int32_62, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_205, 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); +ICmpInst* int1_207 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_202, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_207, 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); +ICmpInst* int1_209 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_202, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_209, 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); +ICmpInst* int1_211 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_202, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_211, 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); +BinaryOperator* int32_213 = BinaryOperator::Create(Instruction::AShr, int32_202, const_int32_66, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BinaryOperator* int32_214 = BinaryOperator::Create(Instruction::Add, int32_213, const_int32_67, "", 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); +BinaryOperator* int32_216 = BinaryOperator::Create(Instruction::AShr, int32_202, const_int32_55, "", 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); +BinaryOperator* int32_218 = BinaryOperator::Create(Instruction::AShr, int32_202, const_int32_57, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BinaryOperator* int32_219 = BinaryOperator::Create(Instruction::Add, int32_218, const_int32_68, "", 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); +BinaryOperator* int32_221 = BinaryOperator::Create(Instruction::AShr, int32_202, const_int32_69, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BinaryOperator* int32_222 = BinaryOperator::Create(Instruction::Add, int32_221, const_int32_70, "", 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); +BinaryOperator* int32_224 = BinaryOperator::Create(Instruction::AShr, int32_202, const_int32_71, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BinaryOperator* int32_225 = BinaryOperator::Create(Instruction::Add, int32_224, const_int32_72, "", 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); +BinaryOperator* int32_227 = BinaryOperator::Create(Instruction::AShr, int32_202, const_int32_59, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BinaryOperator* int32_228 = BinaryOperator::Create(Instruction::Add, int32_227, const_int32_73, "", 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); +PHINode* int32_230 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +int32_230->reserveOperandSpace(6); +int32_230->addIncoming(int32_216, label_false_IF_ICMPGT16_i_i_i11_i_i_i); +int32_230->addIncoming(int32_219, label_false_IF_ICMPGT17_i_i_i12_i_i_i); +int32_230->addIncoming(int32_222, label_false_IF_ICMPGT18_i_i_i13_i_i_i); +int32_230->addIncoming(int32_225, label_false_IF_ICMPGT19_i_i_i14_i_i_i); +int32_230->addIncoming(int32_228, label_false_IF_ICMPGT20_i_i_i15_i_i_i); +int32_230->addIncoming(int32_214, label_GOTO_or_IF_9_i_i_i10_i_i_i); + +std::vector ptr_231_indices; +ptr_231_indices.push_back(const_int32_74); +ptr_231_indices.push_back(const_int32_74); +Instruction* ptr_231 = GetElementPtrInst::Create(ptr_201, ptr_231_indices.begin(), ptr_231_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* ptr_232 = new LoadInst(ptr_231, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +BinaryOperator* int32_233 = BinaryOperator::Create(Instruction::Add, int32_230, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_234 = new BitCastInst(ptr_232, PointerTy_23, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +GetElementPtrInst* ptr_235 = GetElementPtrInst::Create(ptr_234, int32_233, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* int32_236 = new LoadInst(ptr_235, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_237 = new IntToPtrInst(int32_236, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +ICmpInst* int1_238 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_236, const_int32_53, ""); +BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_238, 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; +std::vector ptr_240_params; +ptr_240_params.push_back(ptr_201); +ptr_240_params.push_back(int32_94); +ptr_240_params.push_back(const_int32_53); +ptr_240_params.push_back(const_int32_53); +CallInst* ptr_240 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_240_params.begin(), ptr_240_params.end(), "", label_GOTO_or_IF__i17_i_i_i); +ptr_240->setCallingConv(CallingConv::C); +ptr_240->setTailCall(true); +AttrListPtr ptr_240_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_240_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_242->setAttributes(ptr_242_PAL); +ptr_240->setAttributes(ptr_240_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); +CastInst* ptr_242 = new IntToPtrInst(int32_236, PointerTy_25, "", label_false_IFNE_i21_i_i_i); +LoadInst* ptr_243 = new LoadInst(ptr_242, "", false, label_false_IFNE_i21_i_i_i); +CastInst* int32_244 = new PtrToIntInst(ptr_243, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i); + new StoreInst(int32_244, ptr_235, false, label_false_IFNE_i21_i_i_i); +std::vector ptr_246_indices; +ptr_246_indices.push_back(const_int32_53); +ptr_246_indices.push_back(const_int32_53); +Instruction* ptr_246 = GetElementPtrInst::Create(ptr_237, ptr_246_indices.begin(), ptr_246_indices.end(), "", label_false_IFNE_i21_i_i_i); + new StoreInst(const_ptr_75, ptr_246, 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; +std::vector ptr_249_indices; +ptr_249_indices.push_back(const_int32_51); +ptr_249_indices.push_back(const_int32_53); +ptr_249_indices.push_back(const_int32_53); +ptr_249_indices.push_back(const_int32_74); +Instruction* ptr_249 = GetElementPtrInst::Create(ptr_101, ptr_249_indices.begin(), ptr_249_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_250 = new BitCastInst(ptr_249, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_251 = new LoadInst(ptr_250, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_252 = new BitCastInst(ptr_251, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_253_params; +ptr_253_params.push_back(ptr_252); +ptr_253_params.push_back(int32_94); +ptr_253_params.push_back(const_int32_53); +ptr_253_params.push_back(const_int32_53); +CallInst* ptr_253 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_253_params.begin(), ptr_253_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ptr_253->setCallingConv(CallingConv::C); +ptr_253->setTailCall(true); +AttrListPtr ptr_253_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); - + ptr_253_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_253->setAttributes(ptr_253_PAL); + +std::vector ptr_254_indices; +ptr_254_indices.push_back(const_int32_53); +ptr_254_indices.push_back(const_int32_53); +Instruction* ptr_254 = GetElementPtrInst::Create(ptr_253, ptr_254_indices.begin(), ptr_254_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr__c22_i = new BitCastInst(ptr_VT, PointerTy_27, ".c22.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(ptr__c22_i, ptr_254, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); 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); +ptr_256_indices.push_back(const_int32_53); +ptr_256_indices.push_back(const_int32_74); +Instruction* ptr_256 = GetElementPtrInst::Create(ptr_253, ptr_256_indices.begin(), ptr_256_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_257 = new BitCastInst(ptr_256, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_258 = new LoadInst(ptr_257, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_259 = BinaryOperator::Create(Instruction::And, int8_258, const_int8_76, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_260 = new LoadInst(const_ptr_82, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_261 = BinaryOperator::Create(Instruction::Or, int8_259, int8_260, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_262 = BinaryOperator::Create(Instruction::Or, int8_261, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(int8_262, ptr_257, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_264 = new LoadInst(const_ptr_83, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* int32_265 = new PtrToIntInst(ptr_253, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int32_266 = BinaryOperator::Create(Instruction::And, int32_265, const_int32_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_267 = new IntToPtrInst(int32_266, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_268_indices; +ptr_268_indices.push_back(const_int32_55); +ptr_268_indices.push_back(const_int32_74); +Instruction* ptr_268 = GetElementPtrInst::Create(ptr_264, ptr_268_indices.begin(), ptr_268_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_269 = new LoadInst(ptr_268, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +GetElementPtrInst* ptr_270 = GetElementPtrInst::Create(ptr_269, const_int32_68, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_271 = new BitCastInst(ptr_270, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_272 = new LoadInst(ptr_271, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ICmpInst* int1_273 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i, ICmpInst::ICMP_EQ, ptr_272, const_ptr_81, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_true_IFNULL_i5_i_i9_i_i_i, int1_273, 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); +std::vector ptr_275_indices; +ptr_275_indices.push_back(const_int32_57); +ptr_275_indices.push_back(const_int32_53); +ptr_275_indices.push_back(const_int32_53); +ptr_275_indices.push_back(const_int32_74); +Instruction* ptr_275 = GetElementPtrInst::Create(ptr_101, ptr_275_indices.begin(), ptr_275_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_276 = new BitCastInst(ptr_275, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +LoadInst* ptr_277 = new LoadInst(ptr_276, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_278 = new BitCastInst(ptr_277, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +BinaryOperator* int32_279 = BinaryOperator::Create(Instruction::Add, int32_94, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +ICmpInst* int1_280 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_279, const_int32_61, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_280, 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); +ICmpInst* int1_282 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_279, const_int32_62, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_282, 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); +ICmpInst* int1_284 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_279, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_284, 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); +ICmpInst* int1_286 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_279, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_286, 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); +ICmpInst* int1_288 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_279, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_288, 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); +BinaryOperator* int32_290 = BinaryOperator::Create(Instruction::AShr, int32_279, const_int32_66, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_291 = BinaryOperator::Create(Instruction::Add, int32_290, const_int32_67, "", 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); +BinaryOperator* int32_293 = BinaryOperator::Create(Instruction::AShr, int32_279, const_int32_55, "", 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); +BinaryOperator* int32_295 = BinaryOperator::Create(Instruction::AShr, int32_279, const_int32_57, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_296 = BinaryOperator::Create(Instruction::Add, int32_295, const_int32_68, "", 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); +BinaryOperator* int32_298 = BinaryOperator::Create(Instruction::AShr, int32_279, const_int32_69, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_299 = BinaryOperator::Create(Instruction::Add, int32_298, const_int32_70, "", 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); +BinaryOperator* int32_301 = BinaryOperator::Create(Instruction::AShr, int32_279, const_int32_71, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_302 = BinaryOperator::Create(Instruction::Add, int32_301, const_int32_72, "", 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); +BinaryOperator* int32_304 = BinaryOperator::Create(Instruction::AShr, int32_279, const_int32_59, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_305 = BinaryOperator::Create(Instruction::Add, int32_304, const_int32_73, "", 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); +PHINode* int32_307 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +int32_307->reserveOperandSpace(6); +int32_307->addIncoming(int32_293, label_false_IF_ICMPGT16_i_i_i_i_i); +int32_307->addIncoming(int32_296, label_false_IF_ICMPGT17_i_i_i_i_i); +int32_307->addIncoming(int32_299, label_false_IF_ICMPGT18_i_i_i_i_i); +int32_307->addIncoming(int32_302, label_false_IF_ICMPGT19_i_i_i_i_i); +int32_307->addIncoming(int32_305, label_false_IF_ICMPGT20_i_i_i_i_i); +int32_307->addIncoming(int32_291, label_GOTO_or_IF_9_i_i_i_i_i); + +GetElementPtrInst* ptr_308 = GetElementPtrInst::Create(ptr_277, const_int32_68, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_309 = new BitCastInst(ptr_308, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* ptr_310 = new LoadInst(ptr_309, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +BinaryOperator* int32_311 = BinaryOperator::Create(Instruction::Add, int32_307, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_312 = new BitCastInst(ptr_310, PointerTy_23, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +GetElementPtrInst* ptr_313 = GetElementPtrInst::Create(ptr_312, int32_311, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* int32_314 = new LoadInst(ptr_313, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_315 = new IntToPtrInst(int32_314, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +ICmpInst* int1_316 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_314, const_int32_53, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_316, 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; +std::vector ptr_318_params; +ptr_318_params.push_back(ptr_278); +ptr_318_params.push_back(int32_94); +ptr_318_params.push_back(const_int32_53); +ptr_318_params.push_back(const_int32_53); +CallInst* ptr_318 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_318_params.begin(), ptr_318_params.end(), "", label_GOTO_or_IF__i_i_i); +ptr_318->setCallingConv(CallingConv::C); +ptr_318->setTailCall(true); +AttrListPtr ptr_318_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_318_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_320->setAttributes(ptr_320_PAL); +ptr_318->setAttributes(ptr_318_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); +CastInst* ptr_320 = new IntToPtrInst(int32_314, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +LoadInst* ptr_321 = new LoadInst(ptr_320, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +CastInst* int32_322 = new PtrToIntInst(ptr_321, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(int32_322, ptr_313, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +std::vector ptr_324_indices; +ptr_324_indices.push_back(const_int32_53); +ptr_324_indices.push_back(const_int32_53); +Instruction* ptr_324 = GetElementPtrInst::Create(ptr_315, ptr_324_indices.begin(), ptr_324_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(const_ptr_75, ptr_324, 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); +PHINode* ptr__ph_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph_i->addIncoming(ptr_318, label_GOTO_or_IF__i_i_i); +ptr__ph_i->addIncoming(ptr_315, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +std::vector ptr_327_indices; +ptr_327_indices.push_back(const_int32_53); +ptr_327_indices.push_back(const_int32_53); +Instruction* ptr_327 = GetElementPtrInst::Create(ptr__ph_i, ptr_327_indices.begin(), ptr_327_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +CastInst* ptr__c6_i = new BitCastInst(ptr_VT, PointerTy_27, ".c6.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(ptr__c6_i, ptr_327, 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_84, "storemerge.in.i.i1.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); std::vector ptr_329_indices; -ptr_329_indices.push_back(const_int32_55); -ptr_329_indices.push_back(const_int32_55); +ptr_329_indices.push_back(const_int32_53); +ptr_329_indices.push_back(const_int32_74); 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); +CastInst* ptr_330 = new BitCastInst(ptr_329, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(int8_storemerge_in_i_i1_i_i, ptr_330, 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); +PHINode* ptr__ph8_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph8_i->addIncoming(ptr_142, label_false_IFNE_i_i_i_i); +ptr__ph8_i->addIncoming(ptr_145, label_GOTO_or_IF__i_i_i_i); +std::vector ptr_333_indices; +ptr_333_indices.push_back(const_int32_53); +ptr_333_indices.push_back(const_int32_53); +Instruction* ptr_333 = GetElementPtrInst::Create(ptr__ph8_i, ptr_333_indices.begin(), ptr_333_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +CastInst* ptr__c10_i = new BitCastInst(ptr_VT, PointerTy_27, ".c10.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(ptr__c10_i, ptr_333, 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_85, "storemerge.in.i.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); std::vector ptr_335_indices; -ptr_335_indices.push_back(const_int32_55); -ptr_335_indices.push_back(const_int32_55); +ptr_335_indices.push_back(const_int32_53); +ptr_335_indices.push_back(const_int32_74); 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); +CastInst* ptr_336 = new BitCastInst(ptr_335, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(int8_storemerge_in_i_i_i_i, ptr_336, 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); +PHINode* ptr__ph12_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph12_i->addIncoming(ptr_171, label_false_IFEQ_i_i_i_i); +ptr__ph12_i->addIncoming(ptr_159, 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_339_indices; +ptr_339_indices.push_back(const_int32_53); +ptr_339_indices.push_back(const_int32_53); +Instruction* ptr_339 = GetElementPtrInst::Create(ptr__ph12_i, ptr_339_indices.begin(), ptr_339_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +CastInst* ptr__c14_i = new BitCastInst(ptr_VT, PointerTy_27, ".c14.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(ptr__c14_i, ptr_339, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); std::vector ptr_341_indices; -ptr_341_indices.push_back(const_int32_55); -ptr_341_indices.push_back(const_int32_55); +ptr_341_indices.push_back(const_int32_53); +ptr_341_indices.push_back(const_int32_74); 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); +CastInst* ptr_342 = new BitCastInst(ptr_341, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_343 = new LoadInst(ptr_342, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_344 = BinaryOperator::Create(Instruction::And, int8_343, const_int8_86, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_345 = new LoadInst(const_ptr_87, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_346 = BinaryOperator::Create(Instruction::Or, int8_344, int8_345, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(int8_346, ptr_342, 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); +PHINode* ptr__ph16_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph16_i->addIncoming(ptr_237, label_false_IFNE_i21_i_i_i); +ptr__ph16_i->addIncoming(ptr_240, label_GOTO_or_IF__i17_i_i_i); +std::vector ptr_349_indices; +ptr_349_indices.push_back(const_int32_53); +ptr_349_indices.push_back(const_int32_53); +Instruction* ptr_349 = GetElementPtrInst::Create(ptr__ph16_i, ptr_349_indices.begin(), ptr_349_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +CastInst* ptr__c18_i = new BitCastInst(ptr_VT, PointerTy_27, ".c18.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(ptr__c18_i, ptr_349, 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_88, "storemerge.in.i2.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); std::vector ptr_351_indices; -ptr_351_indices.push_back(const_int32_55); -ptr_351_indices.push_back(const_int32_55); +ptr_351_indices.push_back(const_int32_53); +ptr_351_indices.push_back(const_int32_74); 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); +CastInst* ptr_352 = new BitCastInst(ptr_351, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(int8_storemerge_in_i2_i_i_i, ptr_352, 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; +CallInst* void_355 = CallInst::Create(func_abort, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +void_355->setCallingConv(CallingConv::C); +void_355->setTailCall(true); +AttrListPtr void_355_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; Attrs.push_back(PAWI); - void_357_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_355_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_357->setAttributes(void_357_PAL); +void_355->setAttributes(void_355_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); +std::vector ptr_357_indices; +ptr_357_indices.push_back(const_int32_53); +ptr_357_indices.push_back(const_int32_53); +Instruction* ptr_357 = GetElementPtrInst::Create(ptr_191, ptr_357_indices.begin(), ptr_357_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(const_ptr_75, ptr_357, false, label_true_IF_NULL_i1_i_i_i_i_i); +GetElementPtrInst* ptr_359 = GetElementPtrInst::Create(ptr_193, const_int32_59, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_360 = new BitCastInst(ptr_359, PointerTy_25, "", label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_361 = new LoadInst(ptr_360, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_362 = new LoadInst(const_ptr_89, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* int32_363 = new PtrToIntInst(ptr_362, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i); +BinaryOperator* int32_364 = BinaryOperator::Create(Instruction::Add, int32_363, int32_190, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_365 = new IntToPtrInst(int32_364, PointerTy_25, "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(ptr_361, ptr_365, false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_367 = new LoadInst(ptr_360, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +ICmpInst* int1_368 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_367, const_ptr_90, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i, int1_368, 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); +CastInst* ptr_370 = new BitCastInst(ptr_359, PointerTy_31, "", label_GOTO_or_IF_1_i3_i_i_i_i_i); +CastInst* ptr__c1_i2_i_i_i_i_i = new IntToPtrInst(int32_190, PointerTy_27, ".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_370, false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +LoadInst* ptr_372 = new LoadInst(ptr_195, "", false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +ICmpInst* int1_373 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_372, const_ptr_81, ""); +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_373, 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); +GetElementPtrInst* ptr_375 = GetElementPtrInst::Create(ptr_196, const_int32_59, "", label_true_IFNULL_i5_i_i_i_i_i); +CastInst* ptr_376 = new BitCastInst(ptr_375, PointerTy_23, "", 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); +Argument* fwdref_379 = 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_379, 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); +Argument* fwdref_381 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_380 = BinaryOperator::Create(Instruction::Add, fwdref_381, const_int32_74, "", 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); +PHINode* int32_383 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i22_i); +int32_383->reserveOperandSpace(2); +int32_383->addIncoming(const_int32_53, label_true_IFNULL_i5_i_i_i_i_i); +int32_383->addIncoming(int32_380, 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; +ICmpInst* int1_384 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_ULT, int32_383, const_int32_91, ""); +std::vector void_385_params; +void_385_params.push_back(const_int1_92); +void_385_params.push_back(const_int1_92); +void_385_params.push_back(const_int1_92); +void_385_params.push_back(const_int1_92); +void_385_params.push_back(const_int1_92); +CallInst* void_385 = CallInst::Create(func_llvm_memory_barrier, void_385_params.begin(), void_385_params.end(), "", label_bb2_i_i22_i); +void_385->setCallingConv(CallingConv::C); +void_385->setTailCall(true); +AttrListPtr void_385_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_385_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_387->setAttributes(void_387_PAL); +void_385->setAttributes(void_385_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; +std::vector int32_386_params; +int32_386_params.push_back(ptr_376); +int32_386_params.push_back(const_int32_53); +int32_386_params.push_back(const_int32_74); +CallInst* int32_386 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_386_params.begin(), int32_386_params.end(), "", label_bb2_i_i22_i); +int32_386->setCallingConv(CallingConv::C); +int32_386->setTailCall(true); +AttrListPtr int32_386_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_386_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_388->setAttributes(int32_388_PAL); +int32_386->setAttributes(int32_386_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; +std::vector void_387_params; +void_387_params.push_back(const_int1_92); +void_387_params.push_back(const_int1_92); +void_387_params.push_back(const_int1_92); +void_387_params.push_back(const_int1_92); +void_387_params.push_back(const_int1_92); +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_389_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_387_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_389->setAttributes(void_389_PAL); +void_387->setAttributes(void_387_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); +ICmpInst* int1_388 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_EQ, int32_386, const_int32_53, ""); +BranchInst::Create(label_bb_i_i20_i, label_bb4_preheader_i_i23_i, int1_384, 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); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i24_i, int1_388, 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; +CallInst* void_391 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i24_i); +void_391->setCallingConv(CallingConv::C); +void_391->setTailCall(true); +AttrListPtr void_391_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_391_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_393->setAttributes(void_393_PAL); +void_391->setAttributes(void_391_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; +std::vector void_392_params; +void_392_params.push_back(const_int1_92); +void_392_params.push_back(const_int1_92); +void_392_params.push_back(const_int1_92); +void_392_params.push_back(const_int1_92); +void_392_params.push_back(const_int1_92); +CallInst* void_392 = CallInst::Create(func_llvm_memory_barrier, void_392_params.begin(), void_392_params.end(), "", label_bb3_i_i24_i); +void_392->setCallingConv(CallingConv::C); +void_392->setTailCall(true); +AttrListPtr void_392_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_392_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_394->setAttributes(void_394_PAL); +void_392->setAttributes(void_392_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; +std::vector int32_393_params; +int32_393_params.push_back(ptr_376); +int32_393_params.push_back(const_int32_53); +int32_393_params.push_back(const_int32_74); +CallInst* int32_393 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_393_params.begin(), int32_393_params.end(), "", label_bb3_i_i24_i); +int32_393->setCallingConv(CallingConv::C); +int32_393->setTailCall(true); +AttrListPtr int32_393_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_393_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_395->setAttributes(int32_395_PAL); +int32_393->setAttributes(int32_393_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; +std::vector void_394_params; +void_394_params.push_back(const_int1_92); +void_394_params.push_back(const_int1_92); +void_394_params.push_back(const_int1_92); +void_394_params.push_back(const_int1_92); +void_394_params.push_back(const_int1_92); +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_396_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_394_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_396->setAttributes(void_396_PAL); +void_394->setAttributes(void_394_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); +ICmpInst* int1_395 = new ICmpInst(*label_bb3_i_i24_i, ICmpInst::ICMP_EQ, int32_393, const_int32_53, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i24_i, int1_395, 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); +std::vector ptr_397_indices; +ptr_397_indices.push_back(const_int32_53); +ptr_397_indices.push_back(const_int32_53); +Instruction* ptr_397 = GetElementPtrInst::Create(ptr_367, ptr_397_indices.begin(), ptr_397_indices.end(), "", label_false_IFNE_i7_i_i_i_i_i); +CastInst* ptr__c_i6_i_i_i_i_i = new IntToPtrInst(int32_190, PointerTy_27, ".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_397, 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); +GetElementPtrInst* ptr_400 = GetElementPtrInst::Create(ptr_372, const_int32_59, "", label_true_IFNULL3_i8_i_i_i_i_i); +CastInst* ptr_401 = new BitCastInst(ptr_400, PointerTy_23, "", label_true_IFNULL3_i8_i_i_i_i_i); + new StoreInst(const_int32_53, ptr_401, 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); +std::vector ptr_404_indices; +ptr_404_indices.push_back(const_int32_53); +ptr_404_indices.push_back(const_int32_53); +Instruction* ptr_404 = GetElementPtrInst::Create(ptr_267, ptr_404_indices.begin(), ptr_404_indices.end(), "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(const_ptr_75, ptr_404, false, label_true_IF_NULL_i1_i_i6_i_i_i); +GetElementPtrInst* ptr_406 = GetElementPtrInst::Create(ptr_269, const_int32_59, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_407 = new BitCastInst(ptr_406, PointerTy_25, "", label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_408 = new LoadInst(ptr_407, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_409 = new LoadInst(const_ptr_89, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* int32_410 = new PtrToIntInst(ptr_409, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i6_i_i_i); +BinaryOperator* int32_411 = BinaryOperator::Create(Instruction::Add, int32_410, int32_266, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_412 = new IntToPtrInst(int32_411, PointerTy_25, "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(ptr_408, ptr_412, false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_414 = new LoadInst(ptr_407, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +ICmpInst* int1_415 = new ICmpInst(*label_true_IF_NULL_i1_i_i6_i_i_i, ICmpInst::ICMP_EQ, ptr_414, const_ptr_90, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i8_i_i_i, label_false_IFNE_i7_i_i11_i_i_i, int1_415, 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); +CastInst* ptr_417 = new BitCastInst(ptr_406, PointerTy_31, "", label_GOTO_or_IF_1_i3_i_i8_i_i_i); +CastInst* ptr__c1_i2_i_i7_i_i_i = new IntToPtrInst(int32_266, PointerTy_27, ".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_417, false, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +LoadInst* ptr_419 = new LoadInst(ptr_271, "", false, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +ICmpInst* int1_420 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i8_i_i_i, ICmpInst::ICMP_EQ, ptr_419, const_ptr_81, ""); +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_420, 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); +GetElementPtrInst* ptr_422 = GetElementPtrInst::Create(ptr_272, const_int32_59, "", label_true_IFNULL_i5_i_i9_i_i_i); +CastInst* ptr_423 = new BitCastInst(ptr_422, PointerTy_23, "", 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); +Argument* fwdref_426 = 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_426, 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); +Argument* fwdref_428 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_427 = BinaryOperator::Create(Instruction::Add, fwdref_428, const_int32_74, "", 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); +PHINode* int32_430 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); +int32_430->reserveOperandSpace(2); +int32_430->addIncoming(const_int32_53, label_true_IFNULL_i5_i_i9_i_i_i); +int32_430->addIncoming(int32_427, 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; +ICmpInst* int1_431 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_430, const_int32_91, ""); +std::vector void_432_params; +void_432_params.push_back(const_int1_92); +void_432_params.push_back(const_int1_92); +void_432_params.push_back(const_int1_92); +void_432_params.push_back(const_int1_92); +void_432_params.push_back(const_int1_92); +CallInst* void_432 = CallInst::Create(func_llvm_memory_barrier, void_432_params.begin(), void_432_params.end(), "", label_bb2_i_i_i); +void_432->setCallingConv(CallingConv::C); +void_432->setTailCall(true); +AttrListPtr void_432_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_432_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_434->setAttributes(void_434_PAL); +void_432->setAttributes(void_432_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; +std::vector int32_433_params; +int32_433_params.push_back(ptr_423); +int32_433_params.push_back(const_int32_53); +int32_433_params.push_back(const_int32_74); +CallInst* int32_433 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_433_params.begin(), int32_433_params.end(), "", label_bb2_i_i_i); +int32_433->setCallingConv(CallingConv::C); +int32_433->setTailCall(true); +AttrListPtr int32_433_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_433_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_435->setAttributes(int32_435_PAL); +int32_433->setAttributes(int32_433_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; +std::vector void_434_params; +void_434_params.push_back(const_int1_92); +void_434_params.push_back(const_int1_92); +void_434_params.push_back(const_int1_92); +void_434_params.push_back(const_int1_92); +void_434_params.push_back(const_int1_92); +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_436_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_434_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_436->setAttributes(void_436_PAL); +void_434->setAttributes(void_434_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); +ICmpInst* int1_435 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_433, const_int32_53, ""); +BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_431, 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); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb3_i_i_i, int1_435, 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; +CallInst* void_438 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); +void_438->setCallingConv(CallingConv::C); +void_438->setTailCall(true); +AttrListPtr void_438_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_438_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_440->setAttributes(void_440_PAL); +void_438->setAttributes(void_438_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; +std::vector void_439_params; +void_439_params.push_back(const_int1_92); +void_439_params.push_back(const_int1_92); +void_439_params.push_back(const_int1_92); +void_439_params.push_back(const_int1_92); +void_439_params.push_back(const_int1_92); +CallInst* void_439 = CallInst::Create(func_llvm_memory_barrier, void_439_params.begin(), void_439_params.end(), "", label_bb3_i_i_i); +void_439->setCallingConv(CallingConv::C); +void_439->setTailCall(true); +AttrListPtr void_439_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_439_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_441->setAttributes(void_441_PAL); +void_439->setAttributes(void_439_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; +std::vector int32_440_params; +int32_440_params.push_back(ptr_423); +int32_440_params.push_back(const_int32_53); +int32_440_params.push_back(const_int32_74); +CallInst* int32_440 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_440_params.begin(), int32_440_params.end(), "", label_bb3_i_i_i); +int32_440->setCallingConv(CallingConv::C); +int32_440->setTailCall(true); +AttrListPtr int32_440_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_440_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_442->setAttributes(int32_442_PAL); +int32_440->setAttributes(int32_440_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; +std::vector void_441_params; +void_441_params.push_back(const_int1_92); +void_441_params.push_back(const_int1_92); +void_441_params.push_back(const_int1_92); +void_441_params.push_back(const_int1_92); +void_441_params.push_back(const_int1_92); +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_443_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_441_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_443->setAttributes(void_443_PAL); +void_441->setAttributes(void_441_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); +ICmpInst* int1_442 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_440, const_int32_53, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_bb3_i_i_i, int1_442, 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); +std::vector ptr_444_indices; +ptr_444_indices.push_back(const_int32_53); +ptr_444_indices.push_back(const_int32_53); +Instruction* ptr_444 = GetElementPtrInst::Create(ptr_414, ptr_444_indices.begin(), ptr_444_indices.end(), "", label_false_IFNE_i7_i_i11_i_i_i); +CastInst* ptr__c_i6_i_i10_i_i_i = new IntToPtrInst(int32_266, PointerTy_27, ".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_444, 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); +GetElementPtrInst* ptr_447 = GetElementPtrInst::Create(ptr_419, const_int32_59, "", label_true_IFNULL3_i8_i_i12_i_i_i); +CastInst* ptr_448 = new BitCastInst(ptr_447, PointerTy_23, "", label_true_IFNULL3_i8_i_i12_i_i_i); + new StoreInst(const_int32_53, ptr_448, 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); +PHINode* ptr_451 = PHINode::Create(PointerTy_26, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_451->reserveOperandSpace(8); +ptr_451->addIncoming(ptr_253, label_true_IFNULL3_i8_i_i12_i_i_i); +ptr_451->addIncoming(ptr__ph16_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +ptr_451->addIncoming(ptr_177, label_true_IFNULL3_i8_i_i_i_i_i); +ptr_451->addIncoming(ptr__ph12_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +ptr_451->addIncoming(ptr__ph8_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +ptr_451->addIncoming(ptr__ph_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +ptr_451->addIncoming(ptr_253, label_GOTO_or_IF_1_i3_i_i8_i_i_i); +ptr_451->addIncoming(ptr_177, 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); +CastInst* ptr_tmp1 = new BitCastInst(ptr_451, 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); // 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; +fwdref_381->replaceAllUsesWith(int32_383); delete fwdref_381; +fwdref_379->replaceAllUsesWith(int1_388); delete fwdref_379; +fwdref_428->replaceAllUsesWith(int32_430); delete fwdref_428; +fwdref_426->replaceAllUsesWith(int1_435); delete fwdref_426; return func_gcmalloc; } From nicolas.geoffray at lip6.fr Wed Nov 24 13:39:05 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 21:39:05 -0000 Subject: [vmkit-commits] [vmkit] r120116 - /vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp Message-ID: <20101124213905.F34D62A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 15:39:05 2010 New Revision: 120116 URL: http://llvm.org/viewvc/llvm-project?rev=120116&view=rev Log: Re-enable gcmalloc inlining. Modified: vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp 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=120116&r1=120115&r2=120116&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/branches/precise/lib/Mvm/Compiler/JIT.cpp Wed Nov 24 15:39:05 2010 @@ -200,8 +200,7 @@ "ILorg_vmmagic_unboxed_ObjectReference_2"; if (dlsym(SELF_HANDLE, MMTkSymbol)) { // If we have found MMTk, read the gcmalloc function. - // TODO: re-enable this. - //mvm::mmtk_runtime::makeLLVMFunction(module); + mvm::mmtk_runtime::makeLLVMFunction(module); } #endif mvm::llvm_runtime::makeLLVMModuleContents(module); From nicolas.geoffray at lip6.fr Wed Nov 24 13:42:02 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 21:42:02 -0000 Subject: [vmkit-commits] [vmkit] r120117 - in /vmkit/branches/precise/lib/J3/VMCore: JavaArray.h JavaString.h Message-ID: <20101124214202.9D0842A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 15:42:02 2010 New Revision: 120117 URL: http://llvm.org/viewvc/llvm-project?rev=120117&view=rev Log: Remove private restrictions in order to use the fields in MMTk code (which does not manipulate GC-allocated objects). Modified: vmkit/branches/precise/lib/J3/VMCore/JavaArray.h vmkit/branches/precise/lib/J3/VMCore/JavaString.h Modified: vmkit/branches/precise/lib/J3/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaArray.h?rev=120117&r1=120116&r2=120117&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaArray.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaArray.h Wed Nov 24 15:42:02 2010 @@ -36,7 +36,7 @@ /// {JavaObject, size, [0 * T]}. template class TJavaArray : public JavaObject { -private: +public: /// size - The (constant) size of the array. ssize_t size; @@ -75,7 +75,7 @@ }; class ArrayObject : public JavaObject { -private: +public: /// size - The (constant) size of the array. ssize_t size; Modified: vmkit/branches/precise/lib/J3/VMCore/JavaString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/JavaString.h?rev=120117&r1=120116&r2=120117&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/JavaString.h (original) +++ vmkit/branches/precise/lib/J3/VMCore/JavaString.h Wed Nov 24 15:42:02 2010 @@ -21,10 +21,9 @@ class Jnjvm; class JavaString : public JavaObject { -private: +public: // CLASSPATH FIELDS!! const ArrayUInt16* value; -public: sint32 count; sint32 cachedHashCode; sint32 offset; From nicolas.geoffray at lip6.fr Wed Nov 24 13:54:01 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 21:54:01 -0000 Subject: [vmkit-commits] [vmkit] r120119 - /vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Message-ID: <20101124215401.F2A372A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 15:54:01 2010 New Revision: 120119 URL: http://llvm.org/viewvc/llvm-project?rev=120119&view=rev Log: Add some assertions. 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=120119&r1=120118&r2=120119&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Wed Nov 24 15:54:01 2010 @@ -164,7 +164,7 @@ if ((object->header & ~NonLockBitsMask) == 0) { FatLock* obj = table.allocate(object); - obj->acquire(object); + obj->internalLock.lock(); do { oldValue = object->header & NonLockBitsMask; newValue = oldValue | obj->getID(); @@ -177,6 +177,7 @@ obj->internalLock.unlock(); table.deallocate(obj); } else { + assert((object->header & ~NonLockBitsMask) == obj->getID()); assert(owner(object, table) && "Inconsistent lock"); break; } @@ -299,6 +300,8 @@ internalLock.unlock(); return false; } + assert(obj->header & FatMask); + assert((obj->header & ~NonLockBitsMask) == getID()); return true; } From nicolas.geoffray at lip6.fr Wed Nov 24 13:55:05 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 21:55:05 -0000 Subject: [vmkit-commits] [vmkit] r120120 - /vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp Message-ID: <20101124215505.EC33A2A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 15:55:05 2010 New Revision: 120120 URL: http://llvm.org/viewvc/llvm-project?rev=120120&view=rev Log: Remove asserts in gcmalloc in order to have self-contained LLVM code in MMTkInline.inc. Modified: vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp Modified: vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp?rev=120120&r1=120119&r2=120120&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-alloc/Selected.cpp Wed Nov 24 15:55:05 2010 @@ -51,10 +51,7 @@ extern "C" void* gcmalloc(uint32_t sz, void* VT) { sz = llvm::RoundUpToAlignment(sz, sizeof(void*)); - gc* res = (gc*)JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2(sz, VT); - assert(VT != NULL); - assert(res->getVirtualTable() == VT); - return res; + return (gc*)JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2(sz, VT); } extern "C" void addFinalizationCandidate(void* obj) __attribute__((always_inline)); From nicolas.geoffray at lip6.fr Wed Nov 24 13:58:45 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 21:58:45 -0000 Subject: [vmkit-commits] [vmkit] r120122 - /vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp Message-ID: <20101124215845.282512A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 15:58:44 2010 New Revision: 120122 URL: http://llvm.org/viewvc/llvm-project?rev=120122&view=rev Log: Remove whitespace. Modified: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp Modified: vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp?rev=120122&r1=120121&r2=120122&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp (original) +++ vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp Wed Nov 24 15:58:44 2010 @@ -85,7 +85,7 @@ delete[] ToEnqueue; ToEnqueue = newQueue; ToEnqueueLength = newLength; - } + } ToEnqueue[ToEnqueueIndex++] = obj; } From nicolas.geoffray at lip6.fr Wed Nov 24 14:01:26 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 22:01:26 -0000 Subject: [vmkit-commits] [vmkit] r120123 - /vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Message-ID: <20101124220126.B82752A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 16:01:26 2010 New Revision: 120123 URL: http://llvm.org/viewvc/llvm-project?rev=120123&view=rev Log: Add comment on how to generate MMTkInline.inc. Modified: vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Modified: vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp?rev=120123&r1=120122&r2=120123&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/VM.cpp Wed Nov 24 16:01:26 2010 @@ -58,6 +58,10 @@ } extern "C" bool Java_org_j3_runtime_VM_verifyAssertions__ () { + // Note that DEBUG is defined in make ENABLE_OPTIMIZED=1. + // You must provide DISABLE_ASSERTIONS=1 to not have DEBUG defined. + // To generate MMTkInline.inc, you need to have this function return + // false. #ifdef DEBUG return true; #else From nicolas.geoffray at lip6.fr Wed Nov 24 14:03:02 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 22:03:02 -0000 Subject: [vmkit-commits] [vmkit] r120124 - in /vmkit/branches/precise/mmtk/mmtk-j3: RuntimeHelpers.cpp Strings.cpp Message-ID: <20101124220302.2EE042A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 16:03:02 2010 New Revision: 120124 URL: http://llvm.org/viewvc/llvm-project?rev=120124&view=rev Log: Don't use functions from J3 that assume GC-allocated objects. Modified: vmkit/branches/precise/mmtk/mmtk-j3/RuntimeHelpers.cpp vmkit/branches/precise/mmtk/mmtk-j3/Strings.cpp Modified: vmkit/branches/precise/mmtk/mmtk-j3/RuntimeHelpers.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/RuntimeHelpers.cpp?rev=120124&r1=120123&r2=120124&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/RuntimeHelpers.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/RuntimeHelpers.cpp Wed Nov 24 16:03:02 2010 @@ -14,11 +14,9 @@ using namespace j3; extern "C" uint16_t MMTkCharAt(JavaString* str, uint32_t index) { - llvm_gcroot(str, 0); - return ArrayUInt16::getElement(JavaString::getValue(str), index); + return str->value->elements[index]; } extern "C" JavaObject* MMTkGetClass(JavaObject* obj) { - llvm_gcroot(obj, 0); - return JavaObject::getClass(obj)->delegatee[0]; + return ((JavaVirtualTable*)obj->getVirtualTable())->cl->delegatee[0]; } Modified: vmkit/branches/precise/mmtk/mmtk-j3/Strings.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/Strings.cpp?rev=120124&r1=120123&r2=120124&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/Strings.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/Strings.cpp Wed Nov 24 16:03:02 2010 @@ -17,23 +17,18 @@ extern "C" void Java_org_j3_mmtk_Strings_write___3CI(JavaObject* str, ArrayUInt16* msg, sint32 len) { - llvm_gcroot(str, 0); - llvm_gcroot(msg, 0); for (sint32 i = 0; i < len; ++i) { - fprintf(stderr, "%c", ArrayUInt16::getElement(msg, i)); + fprintf(stderr, "%c", msg->elements[i]); } } extern "C" void Java_org_j3_mmtk_Strings_writeThreadId___3CI(JavaObject* str, ArrayUInt16* msg, sint32 len) { - llvm_gcroot(str, 0); - llvm_gcroot(msg, 0); - fprintf(stderr, "[%p] ", (void*)JavaThread::get()); for (sint32 i = 0; i < len; ++i) { - fprintf(stderr, "%c", ArrayUInt16::getElement(msg, i)); + fprintf(stderr, "%c", msg->elements[i]); } } @@ -42,16 +37,12 @@ Java_org_j3_mmtk_Strings_copyStringToChars__Ljava_lang_String_2_3CII( JavaObject* obj, JavaString* str, ArrayUInt16* dst, uint32 dstBegin, uint32 dstEnd) { - llvm_gcroot(str, 0); - llvm_gcroot(obj, 0); - llvm_gcroot(dst, 0); sint32 len = str->count; sint32 n = (dstBegin + len <= dstEnd) ? len : (dstEnd - dstBegin); for (sint32 i = 0; i < n; i++) { - ArrayUInt16::setElement(dst, - ArrayUInt16::getElement(JavaString::getValue(str), str->offset + i), dstBegin + i); + dst->elements[dstBegin + i] = str->value->elements[str->offset + i]; } return n; From nicolas.geoffray at lip6.fr Wed Nov 24 14:04:05 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 22:04:05 -0000 Subject: [vmkit-commits] [vmkit] r120125 - /vmkit/branches/precise/mmtk/mmtk-j3/Lock.cpp Message-ID: <20101124220405.96E872A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 16:04:05 2010 New Revision: 120125 URL: http://llvm.org/viewvc/llvm-project?rev=120125&view=rev Log: Do not go into GC when using a GC lock! Fixes memory errors with marksweep GC. Modified: vmkit/branches/precise/mmtk/mmtk-j3/Lock.cpp Modified: vmkit/branches/precise/mmtk/mmtk-j3/Lock.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/Lock.cpp?rev=120125&r1=120124&r2=120125&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/Lock.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/Lock.cpp Wed Nov 24 16:04:05 2010 @@ -25,10 +25,16 @@ extern "C" void Java_org_j3_mmtk_Lock_acquire__(Lock* l) { + bool saved = mvm::Thread::get()->inRV; + mvm::Thread::get()->inRV = true; l->spin.acquire(); + mvm::Thread::get()->inRV = saved; } extern "C" void Java_org_j3_mmtk_Lock_check__I (Lock* l, int i) { UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Lock_release__(Lock* l) { + bool saved = mvm::Thread::get()->inRV; + mvm::Thread::get()->inRV = true; l->spin.release(); + mvm::Thread::get()->inRV = saved; } From nicolas.geoffray at lip6.fr Wed Nov 24 14:05:22 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 22:05:22 -0000 Subject: [vmkit-commits] [vmkit] r120127 - /vmkit/branches/precise/mmtk/mmtk-j3/MMTk_Events.cpp Message-ID: <20101124220522.B94722A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 16:05:22 2010 New Revision: 120127 URL: http://llvm.org/viewvc/llvm-project?rev=120127&view=rev Log: DEBUG is defined debug.h with ENABLE_OPTIMIZED=1. Change to if 0. Modified: vmkit/branches/precise/mmtk/mmtk-j3/MMTk_Events.cpp Modified: vmkit/branches/precise/mmtk/mmtk-j3/MMTk_Events.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/mmtk-j3/MMTk_Events.cpp?rev=120127&r1=120126&r2=120127&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/mmtk-j3/MMTk_Events.cpp (original) +++ vmkit/branches/precise/mmtk/mmtk-j3/MMTk_Events.cpp Wed Nov 24 16:05:22 2010 @@ -17,21 +17,21 @@ extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageAcquired__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( JavaObject* event, JavaObject* space, uintptr_t address, int numPages) { -#ifdef DEBUG +#if 0 fprintf(stderr, "Pages acquired by thread %p from space %p at %x (%d)\n", (void*)mvm::Thread::get(), (void*)space, address, numPages); #endif } extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageReleased__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( JavaObject* event, JavaObject* space, uintptr_t address, int numPages) { -#ifdef DEBUG +#if 0 fprintf(stderr, "Pages released by thread %p from space %p at %x (%d)\n", (void*)mvm::Thread::get(), (void*)space, address, numPages); #endif } extern "C" void Java_org_j3_mmtk_MMTk_1Events_heapSizeChanged__Lorg_vmmagic_unboxed_Extent_2( JavaObject* event, uintptr_t heapSize) { -#ifdef DEBUG +#if 0 fprintf(stderr, "New heap size : %d\n", (int)heapSize); #endif } From nicolas.geoffray at lip6.fr Wed Nov 24 14:06:34 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 24 Nov 2010 22:06:34 -0000 Subject: [vmkit-commits] [vmkit] r120128 - /vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc Message-ID: <20101124220634.9820C2A6C12C@llvm.org> Author: geoffray Date: Wed Nov 24 16:06:34 2010 New Revision: 120128 URL: http://llvm.org/viewvc/llvm-project?rev=120128&view=rev Log: Re-generate. Modified: vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc Modified: vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc?rev=120128&r1=120127&r2=120128&view=diff ============================================================================== --- vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc (original) +++ vmkit/branches/precise/mmtk/config/copyms/MMTkInline.inc Wed Nov 24 16:06:34 2010 @@ -235,9 +235,10 @@ StructTy_struct_mvm__Thread_fields.push_back(PointerTy_16); std::vectorStructTy_struct_mvm__KnownFrame_fields; +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); PATypeHolder PointerTy_18_fwd = OpaqueType::get(mod->getContext()); StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_18_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); @@ -333,102 +334,22 @@ PointerType* PointerTy_25 = PointerType::get(PointerTy_26, 0); -std::vectorStructTy_struct__IO_FILE_fields; -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -std::vectorStructTy_struct__IO_marker_fields; -PATypeHolder PointerTy_29_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct__IO_marker_fields.push_back(PointerTy_29_fwd); -PATypeHolder PointerTy_28_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct__IO_marker_fields.push_back(PointerTy_28_fwd); -StructTy_struct__IO_marker_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructType* StructTy_struct__IO_marker = StructType::get(mod->getContext(), StructTy_struct__IO_marker_fields, /*isPacked=*/false); -mod->addTypeName("struct._IO_marker", StructTy_struct__IO_marker); - -PointerType* PointerTy_29 = PointerType::get(StructTy_struct__IO_marker, 0); -cast(PointerTy_29_fwd.get())->refineAbstractTypeTo(PointerTy_29); -PointerTy_29 = cast(PointerTy_29_fwd.get()); - - -StructTy_struct__IO_FILE_fields.push_back(PointerTy_29); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_28_fwd); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 16)); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 8)); -ArrayType* ArrayTy_30 = ArrayType::get(IntegerType::get(mod->getContext(), 8), 1); - -StructTy_struct__IO_FILE_fields.push_back(ArrayTy_30); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 64)); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(PointerTy_0); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__IO_FILE_fields.push_back(IntegerType::get(mod->getContext(), 32)); -ArrayType* ArrayTy_31 = ArrayType::get(IntegerType::get(mod->getContext(), 8), 40); - -StructTy_struct__IO_FILE_fields.push_back(ArrayTy_31); -StructType* StructTy_struct__IO_FILE = StructType::get(mod->getContext(), StructTy_struct__IO_FILE_fields, /*isPacked=*/false); -mod->addTypeName("struct._IO_FILE", StructTy_struct__IO_FILE); - -PointerType* PointerTy_28 = PointerType::get(StructTy_struct__IO_FILE, 0); -cast(PointerTy_28_fwd.get())->refineAbstractTypeTo(PointerTy_28); -PointerTy_28 = cast(PointerTy_28_fwd.get()); - - -PointerType* PointerTy_32 = PointerType::get(PointerTy_28, 0); - -ArrayType* ArrayTy_34 = ArrayType::get(IntegerType::get(mod->getContext(), 8), 7); - -PointerType* PointerTy_33 = PointerType::get(ArrayTy_34, 0); - -std::vectorFuncTy_36_args; -FuncTy_36_args.push_back(PointerTy_28); -FuncTy_36_args.push_back(PointerTy_0); -FunctionType* FuncTy_36 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), - /*Params=*/FuncTy_36_args, - /*isVarArg=*/true); - -PointerType* PointerTy_35 = PointerType::get(FuncTy_36, 0); - -std::vectorFuncTy_38_args; -FunctionType* FuncTy_38 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_38_args, - /*isVarArg=*/false); +PointerType* PointerTy_28 = PointerType::get(PointerTy_0, 0); -PointerType* PointerTy_37 = PointerType::get(FuncTy_38, 0); +PointerType* PointerTy_29 = PointerType::get(PointerTy_27, 0); -PointerType* PointerTy_39 = PointerType::get(PointerTy_0, 0); - -PointerType* PointerTy_40 = PointerType::get(PointerTy_27, 0); - -std::vectorFuncTy_42_args; -FuncTy_42_args.push_back(PointerTy_26); -FuncTy_42_args.push_back(PointerTy_26); -FuncTy_42_args.push_back(PointerTy_26); -FuncTy_42_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_42_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_42 = FunctionType::get( +std::vectorFuncTy_31_args; +FuncTy_31_args.push_back(PointerTy_26); +FuncTy_31_args.push_back(PointerTy_26); +FuncTy_31_args.push_back(PointerTy_26); +FuncTy_31_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_31_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_31 = FunctionType::get( /*Result=*/PointerTy_26, - /*Params=*/FuncTy_42_args, + /*Params=*/FuncTy_31_args, /*isVarArg=*/false); -PointerType* PointerTy_41 = PointerType::get(FuncTy_42, 0); +PointerType* PointerTy_30 = PointerType::get(FuncTy_31, 0); // Function Declarations @@ -449,52 +370,8 @@ } func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); -Function* func__ZN3mvm6Thread14printBacktraceEv = Function::Create( - /*Type=*/FuncTy_17, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"_ZN3mvm6Thread14printBacktraceEv", mod); // (external, no body) -func__ZN3mvm6Thread14printBacktraceEv->setCallingConv(CallingConv::C); -AttrListPtr func__ZN3mvm6Thread14printBacktraceEv_PAL; -func__ZN3mvm6Thread14printBacktraceEv->setAttributes(func__ZN3mvm6Thread14printBacktraceEv_PAL); - -Function* func_fprintf = Function::Create( - /*Type=*/FuncTy_36, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"fprintf", mod); // (external, no body) -func_fprintf->setCallingConv(CallingConv::C); -AttrListPtr func_fprintf_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoAlias | Attribute::NoCapture; - Attrs.push_back(PAWI); - PAWI.Index = 2U; PAWI.Attrs = 0 | Attribute::NoAlias | Attribute::NoCapture; - Attrs.push_back(PAWI); - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_fprintf_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_fprintf->setAttributes(func_fprintf_PAL); - -Function* func_abort = Function::Create( - /*Type=*/FuncTy_38, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"abort", mod); // (external, no body) -func_abort->setCallingConv(CallingConv::C); -AttrListPtr func_abort_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_abort->setAttributes(func_abort_PAL); - Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( - /*Type=*/FuncTy_42, + /*Type=*/FuncTy_31, /*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); @@ -512,46 +389,14 @@ // Global Variable Declarations -GlobalVariable* gvar_ptr_stderr = new GlobalVariable(/*Module=*/*mod, -/*Type=*/PointerTy_28, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, -/*Name=*/"stderr"); - -GlobalVariable* gvar_array__str14 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/ArrayTy_34, -/*isConstant=*/true, -/*Linkage=*/GlobalValue::PrivateLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/".str14"); -gvar_array__str14->setAlignment(1); - -GlobalVariable* gvar_array__str1246 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/ArrayTy_34, -/*isConstant=*/true, -/*Linkage=*/GlobalValue::PrivateLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/".str1246"); -gvar_array__str1246->setAlignment(1); - // Constant Definitions -ConstantInt* const_int32_43 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); -ConstantInt* const_int32_44 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); -ConstantInt* const_int32_45 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); -ConstantInt* const_int32_46 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); -ConstantInt* const_int32_47 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); -ConstantInt* const_int32_48 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -std::vector const_ptr_49_indices; -const_ptr_49_indices.push_back(const_int32_43); -const_ptr_49_indices.push_back(const_int32_43); -Constant* const_ptr_49 = ConstantExpr::getGetElementPtr(gvar_array__str14, &const_ptr_49_indices[0], const_ptr_49_indices.size()); -std::vector const_ptr_50_indices; -const_ptr_50_indices.push_back(const_int32_43); -const_ptr_50_indices.push_back(const_int32_43); -Constant* const_ptr_50 = ConstantExpr::getGetElementPtr(gvar_array__str1246, &const_ptr_50_indices[0], const_ptr_50_indices.size()); -ConstantInt* const_int32_51 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("41"), 10)); -ConstantInt* const_int32_52 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_32 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_33 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_34 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_35 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_36 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_37 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_38 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); // Global Variable Definitions @@ -577,163 +422,100 @@ Value* ptr_VT = args++; ptr_VT->setName("VT"); -BasicBlock* label_Java_org_j3_runtime_VM__1assert__Z_exit_i = BasicBlock::Create(mod->getContext(), "Java_org_j3_runtime_VM__1assert__Z.exit.i",func_gcmalloc,0); -BasicBlock* label_bb_i1_i = BasicBlock::Create(mod->getContext(), "bb.i1.i",func_gcmalloc,0); -BasicBlock* label_Java_org_j3_runtime_VM__1assert__Z_exit2_i = BasicBlock::Create(mod->getContext(), "Java_org_j3_runtime_VM__1assert__Z.exit2.i",func_gcmalloc,0); +BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",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 = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i",func_gcmalloc,0); BasicBlock* label_false_IFEQ_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.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 Java_org_j3_runtime_VM__1assert__Z.exit.i (label_Java_org_j3_runtime_VM__1assert__Z_exit_i) -CallInst* ptr_53 = CallInst::Create(func_llvm_frameaddress, const_int32_43, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -ptr_53->setCallingConv(CallingConv::C); -ptr_53->setTailCall(true); -AttrListPtr ptr_53_PAL; +// Block entry (label_entry) +BinaryOperator* int32_39 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_32, "", label_entry); +BinaryOperator* int32_40 = BinaryOperator::Create(Instruction::And, int32_39, const_int32_33, "", label_entry); +CallInst* ptr_41 = CallInst::Create(func_llvm_frameaddress, const_int32_34, "", label_entry); +ptr_41->setCallingConv(CallingConv::C); +ptr_41->setTailCall(true); +AttrListPtr ptr_41_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_53_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_41_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_53->setAttributes(ptr_53_PAL); +ptr_41->setAttributes(ptr_41_PAL); -CastInst* int32_54 = new PtrToIntInst(ptr_53, IntegerType::get(mod->getContext(), 32), "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -BinaryOperator* int32_55 = BinaryOperator::Create(Instruction::And, int32_54, const_int32_44, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -CastInst* ptr_56 = new IntToPtrInst(int32_55, PointerTy_4, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); +CastInst* int32_42 = new PtrToIntInst(ptr_41, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_43 = BinaryOperator::Create(Instruction::And, int32_42, const_int32_35, "", label_entry); +CastInst* ptr_44 = new IntToPtrInst(int32_43, PointerTy_4, "", label_entry); +std::vector ptr_45_indices; +ptr_45_indices.push_back(const_int32_34); +ptr_45_indices.push_back(const_int32_36); +Instruction* ptr_45 = GetElementPtrInst::Create(ptr_44, ptr_45_indices.begin(), ptr_45_indices.end(), "", label_entry); +LoadInst* int32_46 = new LoadInst(ptr_45, "", false, label_entry); +CastInst* ptr_47 = new IntToPtrInst(int32_46, PointerTy_24, "", label_entry); +GetElementPtrInst* ptr_48 = GetElementPtrInst::Create(ptr_47, const_int32_37, "", label_entry); +CastInst* ptr_49 = new BitCastInst(ptr_48, PointerTy_25, "", label_entry); +LoadInst* ptr_50 = new LoadInst(ptr_49, "", false, label_entry); +GetElementPtrInst* ptr_51 = GetElementPtrInst::Create(ptr_50, const_int32_38, "", label_entry); +CastInst* ptr_52 = new BitCastInst(ptr_51, PointerTy_25, "", label_entry); +LoadInst* ptr_53 = new LoadInst(ptr_52, "", false, label_entry); +CastInst* int32_54 = new PtrToIntInst(ptr_53, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_55 = BinaryOperator::Create(Instruction::Add, int32_54, int32_40, "", label_entry); +CastInst* ptr_56 = new IntToPtrInst(int32_55, PointerTy_26, "", label_entry); std::vector ptr_57_indices; -ptr_57_indices.push_back(const_int32_43); -ptr_57_indices.push_back(const_int32_45); -Instruction* ptr_57 = GetElementPtrInst::Create(ptr_56, ptr_57_indices.begin(), ptr_57_indices.end(), "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -LoadInst* int32_58 = new LoadInst(ptr_57, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -CastInst* ptr_59 = new IntToPtrInst(int32_58, PointerTy_24, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -GetElementPtrInst* ptr_60 = GetElementPtrInst::Create(ptr_59, const_int32_46, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -CastInst* ptr_61 = new BitCastInst(ptr_60, PointerTy_25, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -LoadInst* ptr_62 = new LoadInst(ptr_61, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -GetElementPtrInst* ptr_63 = GetElementPtrInst::Create(ptr_62, const_int32_47, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -CastInst* ptr_64 = new BitCastInst(ptr_63, PointerTy_25, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -LoadInst* ptr_65 = new LoadInst(ptr_64, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -CastInst* int32_66 = new PtrToIntInst(ptr_65, IntegerType::get(mod->getContext(), 32), "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -BinaryOperator* int32_67 = BinaryOperator::Create(Instruction::And, int32_66, const_int32_48, "", label_Java_org_j3_runtime_VM__1assert__Z_exit_i); -ICmpInst* int1_68 = new ICmpInst(*label_Java_org_j3_runtime_VM__1assert__Z_exit_i, ICmpInst::ICMP_EQ, int32_67, const_int32_43, ""); -BranchInst::Create(label_Java_org_j3_runtime_VM__1assert__Z_exit2_i, label_bb_i1_i, int1_68, label_Java_org_j3_runtime_VM__1assert__Z_exit_i); - -// Block bb.i1.i (label_bb_i1_i) -CastInst* ptr_70 = new IntToPtrInst(int32_55, PointerTy_13, "", label_bb_i1_i); -CallInst* void_71 = CallInst::Create(func__ZN3mvm6Thread14printBacktraceEv, ptr_70, "", label_bb_i1_i); -void_71->setCallingConv(CallingConv::C); -void_71->setTailCall(true); -AttrListPtr void_71_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_71_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_71->setAttributes(void_71_PAL); - -LoadInst* ptr_72 = new LoadInst(gvar_ptr_stderr, "", false, label_bb_i1_i); -std::vector int32_73_params; -int32_73_params.push_back(ptr_72); -int32_73_params.push_back(const_ptr_49); -int32_73_params.push_back(const_ptr_50); -int32_73_params.push_back(const_int32_51); -CallInst* int32_73 = CallInst::Create(func_fprintf, int32_73_params.begin(), int32_73_params.end(), "", label_bb_i1_i); -int32_73->setCallingConv(CallingConv::C); -int32_73->setTailCall(true); -AttrListPtr int32_73_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoAlias; - Attrs.push_back(PAWI); - PAWI.Index = 2U; PAWI.Attrs = 0 | Attribute::NoAlias; - Attrs.push_back(PAWI); - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_73_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -int32_73->setAttributes(int32_73_PAL); - -CallInst* void_74 = CallInst::Create(func_abort, "", label_bb_i1_i); -void_74->setCallingConv(CallingConv::C); -void_74->setTailCall(true); -AttrListPtr void_74_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_74_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_74->setAttributes(void_74_PAL); - -new UnreachableInst(mod->getContext(), label_bb_i1_i); - -// Block Java_org_j3_runtime_VM__1assert__Z.exit2.i (label_Java_org_j3_runtime_VM__1assert__Z_exit2_i) -BinaryOperator* int32_76 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_48, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); -BinaryOperator* int32_77 = BinaryOperator::Create(Instruction::And, int32_76, const_int32_52, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); -BinaryOperator* int32_78 = BinaryOperator::Create(Instruction::Add, int32_66, int32_77, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); -CastInst* ptr_79 = new IntToPtrInst(int32_78, PointerTy_26, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); -std::vector ptr_80_indices; -ptr_80_indices.push_back(const_int32_47); -ptr_80_indices.push_back(const_int32_47); -Instruction* ptr_80 = GetElementPtrInst::Create(ptr_62, ptr_80_indices.begin(), ptr_80_indices.end(), "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); -LoadInst* ptr_81 = new LoadInst(ptr_80, "", false, label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); -CastInst* ptr_82 = new BitCastInst(ptr_81, PointerTy_26, "", label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); -ICmpInst* int1_83 = new ICmpInst(*label_Java_org_j3_runtime_VM__1assert__Z_exit2_i, ICmpInst::ICMP_UGT, ptr_79, ptr_82, ""); -BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_83, label_Java_org_j3_runtime_VM__1assert__Z_exit2_i); +ptr_57_indices.push_back(const_int32_38); +ptr_57_indices.push_back(const_int32_38); +Instruction* ptr_57 = GetElementPtrInst::Create(ptr_50, ptr_57_indices.begin(), ptr_57_indices.end(), "", label_entry); +LoadInst* ptr_58 = new LoadInst(ptr_57, "", false, label_entry); +CastInst* ptr_59 = new BitCastInst(ptr_58, PointerTy_26, "", label_entry); +ICmpInst* int1_60 = new ICmpInst(*label_entry, ICmpInst::ICMP_UGT, ptr_56, ptr_59, ""); +BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_60, label_entry); // Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i) -std::vector ptr_85_indices; -ptr_85_indices.push_back(const_int32_47); -ptr_85_indices.push_back(const_int32_43); -Instruction* ptr_85 = GetElementPtrInst::Create(ptr_62, ptr_85_indices.begin(), ptr_85_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_78, PointerTy_27, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); - new StoreInst(ptr__c_i_i_i, ptr_85, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +std::vector ptr_62_indices; +ptr_62_indices.push_back(const_int32_38); +ptr_62_indices.push_back(const_int32_34); +Instruction* ptr_62 = GetElementPtrInst::Create(ptr_50, ptr_62_indices.begin(), ptr_62_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_55, PointerTy_27, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); + new StoreInst(ptr__c_i_i_i, ptr_62, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); // Block false IFEQ.i.i.i (label_false_IFEQ_i_i_i) -std::vector ptr_88_params; -ptr_88_params.push_back(ptr_62); -ptr_88_params.push_back(ptr_65); -ptr_88_params.push_back(ptr_79); -ptr_88_params.push_back(const_int32_43); -ptr_88_params.push_back(const_int32_43); -CallInst* ptr_88 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_88_params.begin(), ptr_88_params.end(), "", label_false_IFEQ_i_i_i); -ptr_88->setCallingConv(CallingConv::C); -ptr_88->setTailCall(true); -AttrListPtr ptr_88_PAL; +std::vector ptr_65_params; +ptr_65_params.push_back(ptr_50); +ptr_65_params.push_back(ptr_53); +ptr_65_params.push_back(ptr_56); +ptr_65_params.push_back(const_int32_34); +ptr_65_params.push_back(const_int32_34); +CallInst* ptr_65 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_65_params.begin(), ptr_65_params.end(), "", label_false_IFEQ_i_i_i); +ptr_65->setCallingConv(CallingConv::C); +ptr_65->setTailCall(true); +AttrListPtr ptr_65_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_88_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_65_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_88->setAttributes(ptr_88_PAL); +ptr_65->setAttributes(ptr_65_PAL); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFEQ_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_90 = PHINode::Create(PointerTy_26, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -ptr_90->reserveOperandSpace(2); -ptr_90->addIncoming(ptr_65, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -ptr_90->addIncoming(ptr_88, label_false_IFEQ_i_i_i); - -std::vector ptr_91_indices; -ptr_91_indices.push_back(const_int32_43); -ptr_91_indices.push_back(const_int32_43); -Instruction* ptr_91 = GetElementPtrInst::Create(ptr_90, ptr_91_indices.begin(), ptr_91_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +PHINode* ptr_67 = PHINode::Create(PointerTy_26, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_67->reserveOperandSpace(2); +ptr_67->addIncoming(ptr_53, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +ptr_67->addIncoming(ptr_65, label_false_IFEQ_i_i_i); + +std::vector ptr_68_indices; +ptr_68_indices.push_back(const_int32_34); +ptr_68_indices.push_back(const_int32_34); +Instruction* ptr_68 = GetElementPtrInst::Create(ptr_67, ptr_68_indices.begin(), ptr_68_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_27, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); - new StoreInst(ptr__c_i, ptr_91, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr_tmp1 = new BitCastInst(ptr_90, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); + new StoreInst(ptr__c_i, ptr_68, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr_tmp1 = new BitCastInst(ptr_67, 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); return func_gcmalloc; } From nicolas.geoffray at lip6.fr Thu Nov 25 22:45:48 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 26 Nov 2010 06:45:48 -0000 Subject: [vmkit-commits] [vmkit] r120169 - in /vmkit/branches/precise: include/mvm/Threads/Thread.h lib/J3/Classpath/ClasspathReflect.h lib/Mvm/CommonThread/ctthread.cpp Message-ID: <20101126064548.C20D02A6C12C@llvm.org> Author: geoffray Date: Fri Nov 26 00:45:48 2010 New Revision: 120169 URL: http://llvm.org/viewvc/llvm-project?rev=120169&view=rev Log: Make sure the thread is dead before re-using its stack! Modified: vmkit/branches/precise/include/mvm/Threads/Thread.h vmkit/branches/precise/lib/J3/Classpath/ClasspathReflect.h vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp 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=120169&r1=120168&r2=120169&view=diff ============================================================================== --- vmkit/branches/precise/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/precise/include/mvm/Threads/Thread.h Fri Nov 26 00:45:48 2010 @@ -14,6 +14,7 @@ #include #include +#include "debug.h" #include "types.h" #ifdef RUNTIME_DWARF_EXCEPTIONS @@ -292,11 +293,11 @@ /// Thread. The thread object is inlined in the stack. /// void* operator new(size_t sz); - void operator delete(void* th) {} + void operator delete(void* th) { UNREACHABLE(); } /// releaseThread - Free the stack so that another thread can use it. /// - static void releaseThread(void* th); + static void releaseThread(mvm::Thread* th); /// routine - The function to invoke when the thread starts. /// Modified: vmkit/branches/precise/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/precise/lib/J3/Classpath/ClasspathReflect.h?rev=120169&r1=120168&r2=120169&view=diff ============================================================================== --- vmkit/branches/precise/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/branches/precise/lib/J3/Classpath/ClasspathReflect.h Fri Nov 26 00:45:48 2010 @@ -14,6 +14,7 @@ #include #include +#include extern "C" j3::JavaObject* internalFillInStackTrace(j3::JavaObject*); 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=120169&r1=120168&r2=120169&view=diff ============================================================================== --- vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/branches/precise/lib/Mvm/CommonThread/ctthread.cpp Fri Nov 26 00:45:48 2010 @@ -417,7 +417,6 @@ th->MyVM->rendezvous.addThread(th); th->routine(th); th->MyVM->removeThread(th); - delete th; } @@ -456,12 +455,22 @@ res = (void*)TheStackManager.allocate(); } } + // Make sure the thread information is cleared. + memset(res, 0, sz); return res; } /// releaseThread - Remove the stack of the thread from the list of stacks /// in use. -void Thread::releaseThread(void* th) { +void Thread::releaseThread(mvm::Thread* th) { + // It seems like the pthread implementation in Linux is clearing with NULL + // the stack of the thread. So we have to get the thread id before + // calling pthread_join. + void* thread_id = th->internalThreadID; + if (thread_id != NULL) { + // Wait for the thread to die. + pthread_join((pthread_t)thread_id, NULL); + } uintptr_t index = ((uintptr_t)th & Thread::IDMask); index = (index & ~TheStackManager.baseAddr) >> 20; TheStackManager.used[index] = 0; From nicolas.geoffray at lip6.fr Sat Nov 27 02:07:19 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 27 Nov 2010 10:07:19 -0000 Subject: [vmkit-commits] [vmkit] r120206 - in /vmkit/trunk: ./ include/j3/ include/mvm/ include/mvm/GC/ include/mvm/Threads/ lib/J3/Classpath/ lib/J3/Compiler/ lib/J3/LLVMRuntime/ lib/J3/VMCore/ lib/Mvm/CommonThread/ lib/Mvm/Compiler/ lib/Mvm/GCMmap2/ lib/Mvm/MMTk/ lib/Mvm/Runtime/ mmtk/config/copyms/ mmtk/config/marksweep/ mmtk/java/src/org/j3/mmtk/ mmtk/mmtk-alloc/ mmtk/mmtk-j3/ tools/vmjc/ tools/vmkit/ www/ Message-ID: <20101127100720.437082A6C12C@llvm.org> Author: geoffray Date: Sat Nov 27 04:07:18 2010 New Revision: 120206 URL: http://llvm.org/viewvc/llvm-project?rev=120206&view=rev Log: Merge with the precise branch. Collectors CopyMS and MarkSweep are now fully supported. Added: vmkit/trunk/include/mvm/Threads/ObjectLocks.h - copied unchanged from r120199, vmkit/branches/precise/include/mvm/Threads/ObjectLocks.h vmkit/trunk/lib/J3/VMCore/ReferenceQueue.cpp - copied unchanged from r120199, vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.cpp vmkit/trunk/lib/J3/VMCore/ReferenceQueue.h - copied unchanged from r120199, vmkit/branches/precise/lib/J3/VMCore/ReferenceQueue.h vmkit/trunk/lib/Mvm/CommonThread/ObjectLocks.cpp - copied unchanged from r120199, vmkit/branches/precise/lib/Mvm/CommonThread/ObjectLocks.cpp Removed: vmkit/trunk/include/mvm/CompilationUnit.h vmkit/trunk/lib/J3/VMCore/JavaInitialise.cpp vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp vmkit/trunk/lib/J3/VMCore/JavaLocks.h Modified: vmkit/trunk/ (props changed) vmkit/trunk/Makefile.rules vmkit/trunk/include/j3/J3Intrinsics.h vmkit/trunk/include/j3/JavaAOTCompiler.h vmkit/trunk/include/j3/JavaCompiler.h vmkit/trunk/include/j3/JavaJITCompiler.h vmkit/trunk/include/j3/JavaLLVMCompiler.h vmkit/trunk/include/j3/LLVMMaterializer.h vmkit/trunk/include/mvm/GC/GC.h vmkit/trunk/include/mvm/JIT.h vmkit/trunk/include/mvm/MethodInfo.h vmkit/trunk/include/mvm/Threads/CollectionRV.h vmkit/trunk/include/mvm/Threads/Locks.h vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/include/mvm/VirtualMachine.h vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp 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/JavaJITCompiler.cpp vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll vmkit/trunk/lib/J3/VMCore/JavaArray.h vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.h vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaObject.cpp vmkit/trunk/lib/J3/VMCore/JavaObject.h vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaString.h vmkit/trunk/lib/J3/VMCore/JavaThread.cpp vmkit/trunk/lib/J3/VMCore/JavaThread.h vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.h vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h vmkit/trunk/lib/J3/VMCore/LockedMap.h vmkit/trunk/lib/J3/VMCore/Reader.cpp vmkit/trunk/lib/J3/VMCore/Reader.h vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp vmkit/trunk/lib/J3/VMCore/Zip.cpp vmkit/trunk/lib/J3/VMCore/Zip.h vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp vmkit/trunk/lib/Mvm/CommonThread/Sigsegv.cpp vmkit/trunk/lib/Mvm/CommonThread/ctlock.cpp vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp vmkit/trunk/lib/Mvm/Compiler/JIT.cpp vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp vmkit/trunk/lib/Mvm/Runtime/Object.cpp vmkit/trunk/mmtk/config/copyms/MMTkInline.inc vmkit/trunk/mmtk/config/copyms/ObjectHeader.h vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp vmkit/trunk/mmtk/mmtk-j3/Assert.cpp vmkit/trunk/mmtk/mmtk-j3/Collection.cpp vmkit/trunk/mmtk/mmtk-j3/Lock.cpp vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp vmkit/trunk/mmtk/mmtk-j3/Memory.cpp vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp vmkit/trunk/mmtk/mmtk-j3/RuntimeHelpers.cpp vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp vmkit/trunk/mmtk/mmtk-j3/Strings.cpp vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp vmkit/trunk/mmtk/mmtk-j3/VM.cpp vmkit/trunk/tools/vmjc/vmjc.cpp vmkit/trunk/tools/vmkit/Launcher.cpp vmkit/trunk/www/get_started.html vmkit/trunk/www/index.html vmkit/trunk/www/use_aot.html Propchange: vmkit/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Nov 27 04:07:18 2010 @@ -1 +1,2 @@ +/vmkit/branches/precise:112509-120199 /vmkit/branches/release_028:115466-116298 Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Sat Nov 27 04:07:18 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/trunk/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/j3/J3Intrinsics.h (original) +++ vmkit/trunk/include/j3/J3Intrinsics.h Sat Nov 27 04:07:18 2010 @@ -66,6 +66,7 @@ llvm::Function* ResolveVirtualStubFunction; llvm::Function* ResolveSpecialStubFunction; llvm::Function* ResolveStaticStubFunction; + llvm::Function* ResolveInterfaceFunction; #ifndef WITHOUT_VTABLE llvm::Function* VirtualLookupFunction; Modified: vmkit/trunk/include/j3/JavaAOTCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaAOTCompiler.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaAOTCompiler.h (original) +++ vmkit/trunk/include/j3/JavaAOTCompiler.h Sat Nov 27 04:07:18 2010 @@ -67,7 +67,7 @@ virtual llvm::Constant* getConstantPool(JavaConstantPool* ctp); virtual llvm::Constant* getNativeFunction(JavaMethod* meth, void* natPtr); - virtual void setMethod(JavaMethod* meth, void* ptr, const char* name); + virtual void setMethod(llvm::Function* func, void* ptr, const char* name); #ifdef SERVICE Modified: vmkit/trunk/include/j3/JavaCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaCompiler.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaCompiler.h (original) +++ vmkit/trunk/include/j3/JavaCompiler.h Sat Nov 27 04:07:18 2010 @@ -46,9 +46,6 @@ return 0; } - virtual void setMethod(JavaMethod* meth, void* ptr, const char* name) { - } - virtual bool isStaticCompiling() { return false; } @@ -105,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/trunk/include/j3/JavaJITCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaJITCompiler.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaJITCompiler.h (original) +++ vmkit/trunk/include/j3/JavaJITCompiler.h Sat Nov 27 04:07:18 2010 @@ -10,6 +10,7 @@ #ifndef J3_JIT_COMPILER_H #define J3_JIT_COMPILER_H +#include "llvm/CodeGen/GCMetadata.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JITEventListener.h" #include "j3/JavaLLVMCompiler.h" @@ -38,9 +39,9 @@ bool EmitFunctionName; JavaJITListener listener; llvm::ExecutionEngine* executionEngine; - llvm::GCStrategy* TheGCStrategy; + llvm::GCModuleInfo* GCInfo; - JavaJITCompiler(const std::string &ModuleID, bool trusted = false); + JavaJITCompiler(const std::string &ModuleID); ~JavaJITCompiler(); virtual bool isStaticCompiling() { @@ -72,28 +73,13 @@ virtual llvm::Constant* getConstantPool(JavaConstantPool* ctp); virtual llvm::Constant* getNativeFunction(JavaMethod* meth, void* natPtr); - virtual void setMethod(JavaMethod* meth, void* ptr, const char* name); + 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 { @@ -104,10 +90,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/trunk/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaLLVMCompiler.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/trunk/include/j3/JavaLLVMCompiler.h Sat Nov 27 04:07:18 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; @@ -195,7 +195,7 @@ virtual llvm::Constant* getConstantPool(JavaConstantPool* ctp) = 0; virtual llvm::Constant* getNativeFunction(JavaMethod* meth, void* natPtr) = 0; - virtual void setMethod(JavaMethod* meth, void* ptr, const char* name) = 0; + virtual void setMethod(llvm::Function* func, void* ptr, const char* name) = 0; #ifdef SERVICE virtual llvm::Value* getIsolate(Jnjvm* vm, llvm::Value* Where) = 0; Modified: vmkit/trunk/include/j3/LLVMMaterializer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/LLVMMaterializer.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/j3/LLVMMaterializer.h (original) +++ vmkit/trunk/include/j3/LLVMMaterializer.h Sat Nov 27 04:07:18 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(); Removed: vmkit/trunk/include/mvm/CompilationUnit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/CompilationUnit.h?rev=120205&view=auto ============================================================================== --- vmkit/trunk/include/mvm/CompilationUnit.h (original) +++ vmkit/trunk/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/trunk/include/mvm/GC/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/GC/GC.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/mvm/GC/GC.h (original) +++ vmkit/trunk/include/mvm/GC/GC.h Sat Nov 27 04:07:18 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/trunk/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/mvm/JIT.h (original) +++ vmkit/trunk/include/mvm/JIT.h Sat Nov 27 04:07:18 2010 @@ -30,6 +30,7 @@ class FunctionPassManager; class GCFunctionInfo; class GCStrategy; + class JIT; class Module; class PointerType; class TargetData; @@ -176,15 +177,13 @@ class MvmModule { -private: - static llvm::ExecutionEngine* executionEngine; - public: static llvm::GCStrategy* TheGCStrategy; static mvm::LockRecursive protectEngine; static llvm::Module *globalModule; static const llvm::TargetData* TheTargetData; static mvm::BumpPtrAllocator* Allocator; + static llvm::ExecutionEngine* executionEngine; //static unsigned MetadataTypeKind; static uint64 getTypeSize(const llvm::Type* type); @@ -209,15 +208,18 @@ public: virtual void scan(uintptr_t closure, void* ip, void* addr); JITMethodInfo(llvm::GCFunctionInfo* GFI) : GCInfo(GFI) {} + void addToVM(VirtualMachine* vm, llvm::JIT* jit); }; 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/trunk/include/mvm/MethodInfo.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/MethodInfo.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/mvm/MethodInfo.h (original) +++ vmkit/trunk/include/mvm/MethodInfo.h Sat Nov 27 04:07:18 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,11 +29,8 @@ return ip; } - void* getMetaInfo() const { return MetaInfo; } - - unsigned MethodType; - void* InstructionPointer; void* MetaInfo; + void* Owner; }; class CamlFrame { @@ -45,17 +45,21 @@ public: CamlFrame* CF; virtual void scan(uintptr_t closure, void* ip, void* addr); - CamlMethodInfo(CamlFrame* C, void* ip); + CamlMethodInfo(CamlFrame* C) : CF(C) { + Owner = NULL; + MetaInfo = NULL; + } }; class StaticCamlMethodInfo : public CamlMethodInfo { const char* name; public: virtual void print(void* ip, void* addr); - StaticCamlMethodInfo(CamlFrame* CF, void* ip, const char* n) : - CamlMethodInfo(CF, ip) { + StaticCamlMethodInfo(CamlFrame* CF, const char* n) : + CamlMethodInfo(CF) { + Owner = NULL; + MetaInfo = NULL; name = n; - MethodType = 0; } }; @@ -66,7 +70,8 @@ static DefaultMethodInfo DM; DefaultMethodInfo() { - MethodType = -1; + Owner = NULL; + MetaInfo = NULL; } }; Modified: vmkit/trunk/include/mvm/Threads/CollectionRV.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/CollectionRV.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/CollectionRV.h (original) +++ vmkit/trunk/include/mvm/Threads/CollectionRV.h Sat Nov 27 04:07:18 2010 @@ -34,7 +34,7 @@ CollectionRV() { nbJoined = 0; } - + void lockRV() { _lockRV.lock(); } void unlockRV() { _lockRV.unlock(); } @@ -57,8 +57,10 @@ virtual void synchronize() = 0; virtual void join() = 0; - virtual void joinAfterUncooperative() = 0; + virtual void joinAfterUncooperative(void* SP) = 0; virtual void joinBeforeUncooperative() = 0; + + virtual void addThread(Thread* th) = 0; }; class CooperativeCollectionRV : public CollectionRV { @@ -67,8 +69,9 @@ void synchronize(); void join(); - void joinAfterUncooperative(); + void joinAfterUncooperative(void* SP); void joinBeforeUncooperative(); + void addThread(Thread* th); }; class UncooperativeCollectionRV : public CollectionRV { @@ -77,8 +80,9 @@ void synchronize(); void join(); - void joinAfterUncooperative(); + void joinAfterUncooperative(void* SP); void joinBeforeUncooperative(); + void addThread(Thread* th); }; Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Sat Nov 27 04:07:18 2010 @@ -110,7 +110,7 @@ /// lock - Acquire the lock. /// - virtual void lock() = 0; + virtual void lock() __attribute__ ((noinline)) = 0; /// unlock - Release the lock. /// @@ -141,7 +141,7 @@ public: LockNormal() : Lock() {} - virtual void lock(); + virtual void lock() __attribute__ ((noinline)); virtual void unlock(); }; @@ -170,7 +170,7 @@ public: LockRecursive() : Lock() { n = 0; } - virtual void lock(); + virtual void lock() __attribute__ ((noinline)); virtual void unlock(); virtual int tryLock(); @@ -185,39 +185,9 @@ /// lockAll - Acquire the lock count times. /// - void lockAll(int count); + void lockAll(int count) __attribute__ ((noinline)); }; -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. Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Sat Nov 27 04:07:18 2010 @@ -14,6 +14,7 @@ #include #include +#include "debug.h" #include "types.h" #ifdef RUNTIME_DWARF_EXCEPTIONS @@ -131,8 +132,9 @@ class KnownFrame { public: - KnownFrame* previousFrame; void* currentFP; + void* currentIP; + KnownFrame* previousFrame; }; @@ -164,10 +166,6 @@ /// int kill(int signo); - /// killForRendezvous - Kill the given thread for a rendezvous. - /// - void killForRendezvous(); - /// exit - Exit the current thread. /// static void exit(int value); @@ -241,70 +239,18 @@ /// a tracer. /// virtual void tracer(uintptr_t closure) {} + void scanStack(uintptr_t closure); void* getLastSP() { return lastSP; } void setLastSP(void* V) { lastSP = V; } void joinRVBeforeEnter(); - void joinRVAfterLeave(); + void joinRVAfterLeave(void* savedSP); - void enterUncooperativeCode(unsigned level = 0) __attribute__ ((noinline)) { - if (isMvmThread()) { - if (!inRV) { - assert(!lastSP && "SP already set when entering uncooperative code"); - ++level; - void* temp = __builtin_frame_address(0); - while (level--) temp = ((void**)temp)[0]; - // The cas is not necessary, but it does a memory barrier. - __sync_bool_compare_and_swap(&lastSP, 0, temp); - if (doYield) joinRVBeforeEnter(); - assert(lastSP && "No last SP when entering uncooperative code"); - } - } - } - - void enterUncooperativeCode(void* SP) { - if (isMvmThread()) { - if (!inRV) { - assert(!lastSP && "SP already set when entering uncooperative code"); - // The cas is not necessary, but it does a memory barrier. - __sync_bool_compare_and_swap(&lastSP, 0, SP); - if (doYield) joinRVBeforeEnter(); - assert(lastSP && "No last SP when entering uncooperative code"); - } - } - } - - void leaveUncooperativeCode() { - if (isMvmThread()) { - if (!inRV) { - assert(lastSP && "No last SP when leaving uncooperative code"); - // The cas is not necessary, but it does a memory barrier. - __sync_bool_compare_and_swap(&lastSP, lastSP, 0); - // A rendezvous has just been initiated, join it. - if (doYield) joinRVAfterLeave(); - assert(!lastSP && "SP has a value after leaving uncooperative code"); - } - } - } - - void* waitOnSP() { - // First see if we can get lastSP directly. - void* sp = lastSP; - if (sp) return sp; - - // Then loop a fixed number of iterations to get lastSP. - for (uint32 count = 0; count < 1000; ++count) { - sp = lastSP; - if (sp) return sp; - } - - // Finally, yield until lastSP is not set. - while ((sp = lastSP) == NULL) mvm::Thread::yield(); - - assert(sp != NULL && "Still no sp"); - return sp; - } + void enterUncooperativeCode(unsigned level = 0) __attribute__ ((noinline)); + void enterUncooperativeCode(void* SP); + void leaveUncooperativeCode(); + void* waitOnSP(); /// clearException - Clear any pending exception of the current thread. @@ -351,11 +297,11 @@ /// Thread. The thread object is inlined in the stack. /// void* operator new(size_t sz); - void operator delete(void* th) {} + void operator delete(void* th) { UNREACHABLE(); } /// releaseThread - Free the stack so that another thread can use it. /// - static void releaseThread(void* th); + static void releaseThread(mvm::Thread* th); /// routine - The function to invoke when the thread starts. /// @@ -395,6 +341,8 @@ void startKnownFrame(KnownFrame& F) __attribute__ ((noinline)); void endKnownFrame(); + void startUnknownFrame(KnownFrame& F) __attribute__ ((noinline)); + void endUnknownFrame(); }; #ifndef RUNTIME_DWARF_EXCEPTIONS @@ -426,17 +374,9 @@ KnownFrame* frame; mvm::Thread* thread; - StackWalker(mvm::Thread* th) { - thread = th; - addr = mvm::Thread::get() == th ? (void**)FRAME_PTR() : - (void**)th->waitOnSP(); - frame = th->lastKnownFrame; - assert(addr && "No address to start with"); - } - + StackWalker(mvm::Thread* th) __attribute__ ((noinline)); void operator++(); void* operator*(); - MethodInfo* get(); }; Modified: vmkit/trunk/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/VirtualMachine.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/include/mvm/VirtualMachine.h (original) +++ vmkit/trunk/include/mvm/VirtualMachine.h Sat Nov 27 04:07:18 2010 @@ -6,34 +6,22 @@ // 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 #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; -} - -class gc; - namespace mvm { +class MethodInfo; + class FunctionMap { public: /// Functions - Map of applicative methods to function pointers. This map is @@ -48,192 +36,32 @@ /// IPToMethodInfo - Map a code start instruction instruction to the MethodInfo. /// - MethodInfo* CodeStartToMethodInfo(void* ip) { - FunctionMapLock.acquire(); - std::map::iterator I = Functions.find(ip); - MethodInfo* res = NULL; - if (I != Functions.end()) { - res = I->second; - } - FunctionMapLock.release(); - return res; - } -}; - -/// StartEndFunctionMap - This map is for functions for which we have -/// a start and end address. -/// -class StartEndFunctionMap : public FunctionMap { -public: - /// addMethodInFunctionMap - A new method pointer in the function map. - /// - void addMethodInfo(MethodInfo* meth, void* start, void* end) { - FunctionMapLock.acquire(); - Functions.insert(std::make_pair(start, meth)); - Functions.insert(std::make_pair(end, meth)); - FunctionMapLock.release(); - } - - /// IPToMethodInfo - Map an instruction pointer to the MethodInfo. - /// - MethodInfo* IPToMethodInfo(void* ip) { - FunctionMapLock.acquire(); - std::map::iterator I = Functions.upper_bound(ip); - MethodInfo* res = 0; - if (I != Functions.end() && I != Functions.begin()) { - res = I->second; - if ((--I)->second != res) res = 0; - } - FunctionMapLock.release(); - return res; - } -}; - -/// StartFunctionMap - This map is for static functions where getting an end -/// address is cumbersome. -/// -class StartFunctionMap : public FunctionMap { -public: - /// addMethodInFunctionMap - A new method pointer in the function map. - /// - void addMethodInfo(MethodInfo* meth, void* addr) { - FunctionMapLock.acquire(); - Functions.insert(std::make_pair((void*)addr, meth)); - FunctionMapLock.release(); - } - - /// IPToMethodInfo - Map an instruction pointer to the MethodInfo. - /// MethodInfo* IPToMethodInfo(void* ip); - -}; - -class SharedStartFunctionMap : public StartFunctionMap { -public: - BumpPtrAllocator* StaticAllocator; - bool initialized; - SharedStartFunctionMap() { - initialized = false; - } - - void initialize(); -}; - - - -// 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(); - } + /// addMethodInfo - A new instruction pointer in the function map. + /// + void addMethodInfo(MethodInfo* meth, void* ip); - void scan(VirtualMachine* vm, uintptr_t closure); -}; + /// removeMethodInfos - Remove all MethodInfo owned by the given owner. + void removeMethodInfos(void* owner); -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; + FunctionMap(); }; /// 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) { -#ifdef SERVICE - memoryLimit = ~0; - executionLimit = ~0; - GCLimit = ~0; - threadLimit = ~0; - parent = this; - 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; - + allocator(Alloc) { mainThread = 0; NumberOfThreads = 0; - if (!SharedStaticFunctions.initialized) SharedStaticFunctions.initialize(); } + + virtual ~VirtualMachine() { + } + public: /// allocator - Bump pointer allocator to allocate permanent memory @@ -241,6 +69,10 @@ /// mvm::BumpPtrAllocator& allocator; +//===----------------------------------------------------------------------===// +// (1) Thread-related methods. +//===----------------------------------------------------------------------===// + /// mainThread - The main thread of this VM. /// mvm::Thread* mainThread; @@ -284,239 +116,46 @@ ThreadLock.unlock(); } +//===----------------------------------------------------------------------===// +// (2) GC-related methods. +//===----------------------------------------------------------------------===// - 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; - - 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); - - 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); - - /// 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); - } - - /// clearReferent - Clear the referent in a reference. Should be overriden - /// by the VM. - /// - virtual void clearReferent(gc*) {} - - /// 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) { } + virtual void scanPhantomReferencesQueue(uintptr_t closure) {} -public: + /// scanFinalizationQueue - Scan objets with a finalized method and schedule + /// them for finalization if they are not live. + /// + virtual void scanFinalizationQueue(uintptr_t closure) {} - /// scanner - Scanner of threads' stacks. + /// addFinalizationCandidate - Add an object to the queue of objects with + /// a finalization method. /// - mvm::StackScanner* scanner; + virtual void addFinalizationCandidate(gc* object) {} - mvm::StackScanner* getScanner() { - return scanner; - } + /// tracer - Trace this virtual machine's GC-objects. + /// + virtual void tracer(uintptr_t closure) {} /// rendezvous - The rendezvous implementation for garbage collection. /// @@ -526,38 +165,29 @@ UncooperativeCollectionRV rendezvous; #endif +//===----------------------------------------------------------------------===// +// (3) Backtrace-related methods. +//===----------------------------------------------------------------------===// - StartEndFunctionMap RuntimeFunctions; - static StartEndFunctionMap SharedRuntimeFunctions; - StartFunctionMap StaticFunctions; - static SharedStartFunctionMap SharedStaticFunctions; - - MethodInfo* IPToMethodInfo(void* ip); - -#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 + FunctionMap FunctionsCache; + MethodInfo* IPToMethodInfo(void* ip) { + return FunctionsCache.IPToMethodInfo(ip); + } + void removeMethodInfos(void* owner) { + FunctionsCache.removeMethodInfos(owner); + } + +//===----------------------------------------------------------------------===// +// (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; }; - } // end namespace mvm #endif // MVM_VIRTUALMACHINE_H Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h Sat Nov 27 04:07:18 2010 @@ -14,6 +14,7 @@ #include "JavaClass.h" #include "JavaObject.h" +#include extern "C" j3::JavaObject* internalFillInStackTrace(j3::JavaObject*); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc Sat Nov 27 04:07:18 2010 @@ -131,22 +131,27 @@ BEGIN_NATIVE_EXCEPTION(0) Jnjvm* vm = JavaThread::get()->getJVM(); + + JnjvmClassLoader* JCL = + JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loader, vm); + int32_t size = JavaArray::getSize(bytes); + ClassBytes* classBytes = new (JCL->allocator, size) ClassBytes(size); + memcpy(classBytes->elements, JavaArray::getElements(bytes), size); + // Before creating a class, do a check on the bytes. - Reader reader(&bytes); + Reader reader(classBytes); uint32 magic = reader.readU4(); if (magic != Jnjvm::Magic) { JavaThread::get()->getJVM()->classFormatError("bad magic number"); } - JnjvmClassLoader* JCL = - JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loader, vm); const UTF8* name = JavaString::javaToInternal(str, JCL->hashUTF8); UserCommonClass* cl = JCL->lookupClass(name); if (!cl) { - UserClass* cl = JCL->constructClass(name, bytes); + UserClass* cl = JCL->constructClass(name, classBytes); cl->resolveClass(); res = cl->getClassDelegatee(vm, pd); @@ -351,7 +356,7 @@ "org.xml.sax.helpers" }; -extern "C" ArrayObject* nativeGetBootPackages() { +extern "C" ArrayObject* Java_java_lang_VMClassLoader_getBootPackages__() { ArrayObject* obj = 0; llvm_gcroot(obj, 0); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc Sat Nov 27 04:07:18 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/trunk/lib/J3/Classpath/ClasspathVMSystem.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc Sat Nov 27 04:07:18 2010 @@ -35,6 +35,8 @@ llvm_gcroot(src, 0); llvm_gcroot(dst, 0); llvm_gcroot(cur, 0); + assert(src->getVirtualTable()); + assert(dst->getVirtualTable()); JavaThread* th = JavaThread::get(); Jnjvm *vm = th->getJVM(); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMSystemProperties.inc Sat Nov 27 04:07:18 2010 @@ -136,7 +136,7 @@ END_NATIVE_EXCEPTION } -extern "C" void nativePropertiesPostInit(JavaObject* prop) { +extern "C" void Java_gnu_classpath_VMSystemProperties_postInit__Ljava_util_Properties_2(JavaObject* prop) { llvm_gcroot(prop, 0); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc Sat Nov 27 04:07:18 2010 @@ -40,11 +40,16 @@ llvm_gcroot(javaThread, 0); Jnjvm* vm = thread->getJVM(); + // Wait some time to let the creator initialise these fields. + while ((thread->javaThread == NULL) || (thread->vmThread == NULL)) { + mvm::Thread::yield(); + } // Ok, now that the thread is created we can set the the value of vmdata, // which is the JavaThread object. vmThread = (JavaObjectVMThread*)thread->vmThread; assert(vmThread && "Didn't fix the vmThread of a j3 thread"); + assert(vmThread->getVirtualTable()); JavaObjectVMThread::setVmdata(vmThread, thread); UserClass* vmthClass = (UserClass*)JavaObject::getClass(vmThread); @@ -58,7 +63,9 @@ if (!isDaemon) { vm->threadSystem.enter(); } - + + assert(vmThread->getVirtualTable()); + assert(javaThread->getVirtualTable()); // Run the VMThread::run function vm->upcalls->runVMThread->invokeIntSpecial(vm, vmthClass, vmThread); @@ -86,9 +93,11 @@ javaThread = vm->upcalls->assocThread->getInstanceObjectField(vmThread); assert(javaThread && "VMThread with no Java equivalent"); - JavaThread* th = new JavaThread(javaThread, vmThread, vm); + JavaThread* th = new JavaThread(vm); if (!th) vm->outOfMemoryError(); th->start((void (*)(mvm::Thread*))start); + // Now that the thread has been created, initialise its object fields. + th->initialise(javaThread, vmThread); END_NATIVE_EXCEPTION } @@ -112,13 +121,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 +139,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 +159,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 +177,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/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc Sat Nov 27 04:07:18 2010 @@ -103,7 +103,7 @@ // We don't have the bytes if the class was vmjc'ed. if (sourceAtt && cl->getBytes()) { - Reader reader(sourceAtt, cl->getBytesPtr()); + Reader reader(sourceAtt, cl->bytes); uint16 index = reader.readU2(); sourceName = vm->internalUTF8ToStr(cl->getConstantPool()->UTF8At(index)); } @@ -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/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Sat Nov 27 04:07:18 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,28 +293,28 @@ 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 nativeInitWeakReference(JavaObjectReference* reference, - JavaObject* referent) { - +extern "C" void Java_java_lang_ref_WeakReference__0003Cinit_0003E__Ljava_lang_Object_2( + JavaObjectReference* reference, JavaObject* referent) { llvm_gcroot(reference, 0); llvm_gcroot(referent, 0); BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, 0); - JavaThread::get()->getJVM()->addWeakReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addWeakReference(reference); END_NATIVE_EXCEPTION } -extern "C" void nativeInitWeakReferenceQ(JavaObjectReference* reference, - JavaObject* referent, - JavaObject* queue) { +extern "C" void Java_java_lang_ref_WeakReference__0003Cinit_0003E__Ljava_lang_Object_2Ljava_lang_ref_ReferenceQueue_2( + JavaObjectReference* reference, + JavaObject* referent, + JavaObject* queue) { llvm_gcroot(reference, 0); llvm_gcroot(referent, 0); llvm_gcroot(queue, 0); @@ -321,29 +322,30 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, queue); - JavaThread::get()->getJVM()->addWeakReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addWeakReference(reference); END_NATIVE_EXCEPTION } -extern "C" void nativeInitSoftReference(JavaObjectReference* reference, - JavaObject* referent) { +extern "C" void Java_java_lang_ref_SoftReference__0003Cinit_0003E__Ljava_lang_Object_2( + JavaObjectReference* reference, JavaObject* referent) { llvm_gcroot(reference, 0); llvm_gcroot(referent, 0); BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, 0); - JavaThread::get()->getJVM()->addSoftReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addSoftReference(reference); END_NATIVE_EXCEPTION } -extern "C" void nativeInitSoftReferenceQ(JavaObjectReference* reference, - JavaObject* referent, - JavaObject* queue) { +extern "C" void Java_java_lang_ref_SoftReference__0003Cinit_0003E__Ljava_lang_Object_2Ljava_lang_ref_ReferenceQueue_2( + JavaObjectReference* reference, + JavaObject* referent, + JavaObject* queue) { llvm_gcroot(reference, 0); llvm_gcroot(referent, 0); llvm_gcroot(queue, 0); @@ -351,15 +353,16 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, queue); - JavaThread::get()->getJVM()->addSoftReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addSoftReference(reference); END_NATIVE_EXCEPTION } -extern "C" void nativeInitPhantomReferenceQ(JavaObjectReference* reference, - JavaObject* referent, - JavaObject* queue) { +extern "C" void Java_java_lang_ref_PhantomReference__0003Cinit_0003E__Ljava_lang_Object_2Ljava_lang_ref_ReferenceQueue_2( + JavaObjectReference* reference, + JavaObject* referent, + JavaObject* queue) { llvm_gcroot(reference, 0); llvm_gcroot(referent, 0); llvm_gcroot(queue, 0); @@ -367,12 +370,13 @@ BEGIN_NATIVE_EXCEPTION(0) JavaObjectReference::init(reference, referent, queue); - JavaThread::get()->getJVM()->addPhantomReference(reference); + JavaThread::get()->getJVM()->getReferenceThread()->addPhantomReference(reference); END_NATIVE_EXCEPTION } -extern "C" JavaString* nativeInternString(JavaString* obj) { +extern "C" JavaString* Java_java_lang_VMString_intern__Ljava_lang_String_2( + JavaString* obj) { const ArrayUInt16* array = 0; JavaString* res = 0; llvm_gcroot(obj, 0); @@ -392,7 +396,7 @@ return res; } -extern "C" uint8 nativeIsArray(JavaObjectClass* klass) { +extern "C" uint8 Java_java_lang_Class_isArray__(JavaObjectClass* klass) { llvm_gcroot(klass, 0); UserCommonClass* cl = 0; @@ -405,7 +409,7 @@ return (uint8)cl->isArray(); } -extern "C" JavaObject* nativeGetCallingClass() { +extern "C" JavaObject* Java_gnu_classpath_VMStackWalker_getCallingClass__() { JavaObject* res = 0; llvm_gcroot(res, 0); @@ -421,7 +425,7 @@ return res; } -extern "C" JavaObject* nativeGetCallingClassLoader() { +extern "C" JavaObject* Java_gnu_classpath_VMStackWalker_getCallingClassLoader__() { JavaObject* res = 0; llvm_gcroot(res, 0); @@ -437,7 +441,7 @@ return res; } -extern "C" JavaObject* nativeFirstNonNullClassLoader() { +extern "C" JavaObject* Java_gnu_classpath_VMStackWalker_firstNonNullClassLoader__() { JavaObject* res = 0; llvm_gcroot(res, 0); @@ -451,7 +455,7 @@ return res; } -extern "C" JavaObject* nativeGetCallerClass(uint32 index) { +extern "C" JavaObject* Java_sun_reflect_Reflection_getCallerClass__I(uint32 index) { JavaObject* res = 0; llvm_gcroot(res, 0); @@ -468,12 +472,13 @@ return res; } -extern "C" JavaObject* nativeGetAnnotation(JavaObject* obj) { +extern "C" JavaObject* Java_java_lang_reflect_AccessibleObject_getAnnotation__Ljava_lang_Class_2( + JavaObject* obj) { llvm_gcroot(obj, 0); return 0; } -extern "C" JavaObject* nativeGetDeclaredAnnotations() { +extern "C" JavaObject* Java_java_lang_reflect_AccessibleObject_getDeclaredAnnotations__() { JavaObject* res = 0; llvm_gcroot(res, 0); @@ -488,8 +493,6 @@ return res; } -extern "C" void nativePropertiesPostInit(JavaObject* prop); - extern "C" void nativeJavaObjectClassTracer( JavaObjectClass* obj, uintptr_t closure) { JavaObjectClass::staticTracer(obj, closure); @@ -520,10 +523,7 @@ JavaObjectVMThread::staticDestructor(obj); } -// Defined in Classpath/ClasspathVMClassLoader.cpp -extern "C" ArrayObject* nativeGetBootPackages(); - -extern "C" JavaString* nativeGetenv(JavaString* str) { +extern "C" JavaString* Java_java_lang_VMSystem_getenv__Ljava_lang_String_2(JavaString* str) { JavaString* ret = 0; llvm_gcroot(str, 0); llvm_gcroot(ret, 0); @@ -748,12 +748,11 @@ JavaMethod* internString = UPCALL_METHOD(loader, "java/lang/VMString", "intern", "(Ljava/lang/String;)Ljava/lang/String;", ACC_STATIC); - internString->setCompiledPtr((void*)(intptr_t)nativeInternString, - "nativeInternString"); + internString->setNative(); JavaMethod* isArray = UPCALL_METHOD(loader, "java/lang/Class", "isArray", "()Z", ACC_VIRTUAL); - isArray->setCompiledPtr((void*)(intptr_t)nativeIsArray, "nativeIsArray"); + isArray->setNative(); UPCALL_REFLECT_CLASS_EXCEPTION(loader, InvocationTargetException); @@ -944,61 +943,51 @@ JavaMethod* getEnv = UPCALL_METHOD(loader, "java/lang/VMSystem", "getenv", "(Ljava/lang/String;)Ljava/lang/String;", ACC_STATIC); - getEnv->setCompiledPtr((void*)(intptr_t)nativeGetenv, "nativeGetenv"); + getEnv->setNative(); JavaMethod* getCallingClass = UPCALL_METHOD(loader, "gnu/classpath/VMStackWalker", "getCallingClass", "()Ljava/lang/Class;", ACC_STATIC); - getCallingClass->setCompiledPtr((void*)(intptr_t)nativeGetCallingClass, - "nativeGetCallingClass"); + getCallingClass->setNative(); JavaMethod* getCallingClassLoader = UPCALL_METHOD(loader, "gnu/classpath/VMStackWalker", "getCallingClassLoader", "()Ljava/lang/ClassLoader;", ACC_STATIC); - getCallingClassLoader->setCompiledPtr((void*)(intptr_t) - nativeGetCallingClassLoader, - "nativeGetCallingClassLoader"); + getCallingClassLoader->setNative(); JavaMethod* firstNonNullClassLoader = UPCALL_METHOD(loader, "gnu/classpath/VMStackWalker", "firstNonNullClassLoader", "()Ljava/lang/ClassLoader;", ACC_STATIC); - firstNonNullClassLoader->setCompiledPtr((void*)(intptr_t) - nativeFirstNonNullClassLoader, - "nativeFirstNonNullClassLoader"); + firstNonNullClassLoader->setNative(); JavaMethod* getCallerClass = UPCALL_METHOD(loader, "sun/reflect/Reflection", "getCallerClass", "(I)Ljava/lang/Class;", ACC_STATIC); - getCallerClass->setCompiledPtr((void*)(intptr_t)nativeGetCallerClass, - "nativeGetCallerClass"); + getCallerClass->setNative(); JavaMethod* postProperties = UPCALL_METHOD(loader, "gnu/classpath/VMSystemProperties", "postInit", "(Ljava/util/Properties;)V", ACC_STATIC); - postProperties->setCompiledPtr((void*)(intptr_t)nativePropertiesPostInit, - "nativePropertiesPostInit"); + postProperties->setNative(); // Also implement these twos, implementation in GNU Classpath 0.97.2 is buggy. JavaMethod* getAnnotation = UPCALL_METHOD(loader, "java/lang/reflect/AccessibleObject", "getAnnotation", "(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;", ACC_VIRTUAL); - getAnnotation->setCompiledPtr((void*)(intptr_t)nativeGetAnnotation, - "nativeGetAnnotation"); + getAnnotation->setNative(); JavaMethod* getAnnotations = UPCALL_METHOD(loader, "java/lang/reflect/AccessibleObject", "getDeclaredAnnotations", "()[Ljava/lang/annotation/Annotation;", ACC_VIRTUAL); - getAnnotations->setCompiledPtr((void*)(intptr_t)nativeGetDeclaredAnnotations, - "nativeGetDeclaredAnnotations"); + getAnnotations->setNative(); JavaMethod* getBootPackages = UPCALL_METHOD(loader, "java/lang/VMClassLoader", "getBootPackages", "()[Ljava/lang/String;", ACC_STATIC); - getBootPackages->setCompiledPtr((void*)(intptr_t)nativeGetBootPackages, - "nativeGetBootPackages"); + getBootPackages->setNative(); //===----------------------------------------------------------------------===// // @@ -1044,58 +1033,31 @@ UPCALL_METHOD(loader, "java/lang/ref/WeakReference", "", "(Ljava/lang/Object;)V", ACC_VIRTUAL); - initWeakReference->setCompiledPtr((void*)(intptr_t)nativeInitWeakReference, - "nativeInitWeakReference"); + initWeakReference->setNative(); initWeakReference = UPCALL_METHOD(loader, "java/lang/ref/WeakReference", "", "(Ljava/lang/Object;Ljava/lang/ref/ReferenceQueue;)V", ACC_VIRTUAL); - initWeakReference->setCompiledPtr((void*)(intptr_t)nativeInitWeakReferenceQ, - "nativeInitWeakReferenceQ"); + initWeakReference->setNative(); JavaMethod* initSoftReference = UPCALL_METHOD(loader, "java/lang/ref/SoftReference", "", "(Ljava/lang/Object;)V", ACC_VIRTUAL); - initSoftReference->setCompiledPtr((void*)(intptr_t)nativeInitSoftReference, - "nativeInitSoftReference"); + initSoftReference->setNative(); initSoftReference = - UPCALL_METHOD(loader, "java/lang/ref/WeakReference", "", + UPCALL_METHOD(loader, "java/lang/ref/SoftReference", "", "(Ljava/lang/Object;Ljava/lang/ref/ReferenceQueue;)V", ACC_VIRTUAL); - initSoftReference->setCompiledPtr((void*)(intptr_t)nativeInitSoftReferenceQ, - "nativeInitSoftReferenceQ"); + initSoftReference->setNative(); JavaMethod* initPhantomReference = UPCALL_METHOD(loader, "java/lang/ref/PhantomReference", "", "(Ljava/lang/Object;Ljava/lang/ref/ReferenceQueue;)V", ACC_VIRTUAL); - initPhantomReference->setCompiledPtr( - (void*)(intptr_t)nativeInitPhantomReferenceQ, - "nativeInitPhantomReferenceQ"); - - -} - -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); + initPhantomReference->setNative(); } #include "ClasspathConstructor.inc" Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc Sat Nov 27 04:07:18 2010 @@ -501,7 +501,6 @@ // Restore currentBlock. currentBlock = temp; return nbe; - } void JavaJIT::finishExceptions() { Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Sat Nov 27 04:07:18 2010 @@ -193,6 +193,7 @@ ResolveVirtualStubFunction = module->getFunction("j3ResolveVirtualStub"); ResolveStaticStubFunction = module->getFunction("j3ResolveStaticStub"); ResolveSpecialStubFunction = module->getFunction("j3ResolveSpecialStub"); + ResolveInterfaceFunction = module->getFunction("j3ResolveInterface"); NullPointerExceptionFunction = module->getFunction("j3NullPointerException"); Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sat Nov 27 04:07:18 2010 @@ -167,6 +167,7 @@ } Constant* JavaAOTCompiler::getString(JavaString* str) { + assert(!useCooperativeGC()); string_iterator SI = strings.find(str); if (SI != strings.end()) { return SI->second; @@ -306,6 +307,7 @@ Constant* JavaAOTCompiler::getFinalObject(JavaObject* obj, CommonClass* objCl) { + assert(!useCooperativeGC()); llvm::GlobalVariable* varGV = 0; final_object_iterator End = finalObjects.end(); final_object_iterator I = finalObjects.find(obj); @@ -444,7 +446,7 @@ Elts.push_back(Constant::getNullValue(Ty)); } } else { - Reader reader(attribut, &(cl->bytes)); + Reader reader(attribut, cl->bytes); JavaConstantPool * ctpInfo = cl->ctpInfo; uint16 idx = reader.readU2(); if (type->isPrimitive()) { @@ -1482,6 +1484,7 @@ if (!VT->IMT) { Elemts.push_back(Constant::getNullValue(PTy)); } else { + // TODO: add a null element at the end to diagnose errors. Class* cl = classDef->asClass(); assert(cl && "Not a class"); std::set contents[InterfaceMethodTable::NumIndexes]; @@ -1851,8 +1854,7 @@ void JavaAOTCompiler::makeIMT(Class* cl) { } -void JavaAOTCompiler::setMethod(JavaMethod* meth, void* ptr, const char* name) { - Function* func = getMethodInfo(meth)->getMethod(); +void JavaAOTCompiler::setMethod(Function* func, void* ptr, const char* name) { func->setName(name); func->setLinkage(GlobalValue::ExternalLinkage); } @@ -1903,14 +1905,14 @@ -void extractFiles(ArrayUInt8* bytes, +void extractFiles(ClassBytes* bytes, JavaAOTCompiler* M, JnjvmBootstrapLoader* bootstrapLoader, std::vector& classes) { ZipArchive archive(bytes, bootstrapLoader->allocator); - mvm::ThreadAllocator allocator; - char* realName = (char*)allocator.Allocate(4096); + mvm::BumpPtrAllocator allocator; + char* realName = (char*)allocator.Allocate(4096, "temp"); for (ZipArchive::table_iterator i = archive.filetable.begin(), e = archive.filetable.end(); i != e; ++i) { ZipFile* file = i->second; @@ -1927,9 +1929,7 @@ classes.push_back(cl); } else if (size > 4 && (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { - UserClassArray* array = bootstrapLoader->upcalls->ArrayOfByte; - ArrayUInt8* res = - (ArrayUInt8*)array->doNew(file->ucsize, JavaThread::get()->getJVM()); + ClassBytes* res = new (allocator, file->ucsize) ClassBytes(file->ucsize); int ok = archive.readFile(res, file); if (!ok) return; @@ -1958,6 +1958,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 { @@ -1970,7 +1973,7 @@ (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { std::vector classes; - ArrayUInt8* bytes = Reader::openFile(bootstrapLoader, name); + ClassBytes* bytes = Reader::openFile(bootstrapLoader, name); if (!bytes) { fprintf(stderr, "Can't find zip file.\n"); @@ -1979,7 +1982,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 @@ -2057,7 +2060,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); @@ -2130,7 +2133,7 @@ void JavaAOTCompiler::compileFile(Jnjvm* vm, const char* n) { name = n; - JavaThread* th = new JavaThread(0, 0, vm); + JavaThread* th = new JavaThread(vm); vm->setMainThread(th); th->start((void (*)(mvm::Thread*))mainCompilerStart); vm->waitForExit(); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sat Nov 27 04:07:18 2010 @@ -202,8 +202,7 @@ Args.push_back(TheCompiler->getNativeClass(compilingClass)); Args.push_back(ConstantInt::get(Type::getInt32Ty(*llvmContext), index)); Args.push_back(GV); - Value* targetObject = getTarget(virtualType->param_end(), - signature->nbArguments + 1); + Value* targetObject = getTarget(signature); Args.push_back(new LoadInst( targetObject, "", TheCompiler->useCooperativeGC(), currentBlock)); load = invoke(intrinsics->VirtualLookupFunction, Args, "", currentBlock); @@ -347,20 +346,23 @@ sint32 mnlen = jniConsName->size; sint32 mtlen = jniConsType->size; - char* functionName = (char*)alloca(3 + JNI_NAME_PRE_LEN + - ((mnlen + clen + mtlen) << 3)); + mvm::ThreadAllocator allocator; + char* functionName = (char*)allocator.Allocate( + 3 + JNI_NAME_PRE_LEN + ((mnlen + clen + mtlen) << 3)); - if (!natPtr) + if (!natPtr) { natPtr = compilingClass->classLoader->nativeLookup(compilingMethod, j3, functionName); + } if (!natPtr && !TheCompiler->isStaticCompiling()) { currentBlock = createBasicBlock("start"); CallInst::Create(intrinsics->ThrowExceptionFromJITFunction, "", currentBlock); - if (returnType != Type::getVoidTy(*llvmContext)) + if (returnType != Type::getVoidTy(*llvmContext)) { ReturnInst::Create(*llvmContext, Constant::getNullValue(returnType), currentBlock); - else + } else { ReturnInst::Create(*llvmContext, currentBlock); + } PRINT_DEBUG(JNJVM_COMPILE, 1, COLOR_NORMAL, "end native compile %s.%s\n", UTF8Buffer(compilingClass->name).cString(), @@ -372,8 +374,25 @@ Function* func = llvmFunction; if (j3) { - compilingMethod->setCompiledPtr((void*)natPtr, functionName); - llvmFunction->clearGC(); + Function* callee = Function::Create(llvmFunction->getFunctionType(), + GlobalValue::ExternalLinkage, + functionName, + llvmFunction->getParent()); + TheCompiler->setMethod(callee, (void*)natPtr, functionName); + currentBlock = createBasicBlock("start"); + std::vector args; + for (Function::arg_iterator i = func->arg_begin(), e = func->arg_end(); + i != e; + i++) { + args.push_back(i); + } + Value* res = CallInst::Create( + callee, args.begin(), args.end(), "", currentBlock); + if (returnType != Type::getVoidTy(*llvmContext)) { + ReturnInst::Create(*llvmContext, res, currentBlock); + } else { + ReturnInst::Create(*llvmContext, currentBlock); + } return llvmFunction; } @@ -395,7 +414,7 @@ Value* oldCLIN = new AllocaInst(PointerType::getUnqual(Type::getInt32Ty(*llvmContext)), "", currentBlock); - Constant* sizeF = ConstantInt::get(Type::getInt32Ty(*llvmContext), 2 * sizeof(void*)); + Constant* sizeF = ConstantInt::get(Type::getInt32Ty(*llvmContext), sizeof(mvm::KnownFrame)); Value* Frame = new AllocaInst(Type::getInt8Ty(*llvmContext), sizeF, "", currentBlock); uint32 nargs = func->arg_size() + 1 + (stat ? 1 : 0); @@ -571,18 +590,6 @@ UTF8Buffer(compilingClass->name).cString(), UTF8Buffer(compilingMethod->name).cString()); - if (codeInfo.size()) { - compilingMethod->codeInfo = new CodeLineInfo[codeInfo.size()]; - for (uint32 i = 0; i < codeInfo.size(); i++) { - compilingMethod->codeInfo[i].lineNumber = codeInfo[i].lineNumber; - compilingMethod->codeInfo[i].ctpIndex = codeInfo[i].ctpIndex; - compilingMethod->codeInfo[i].bytecodeIndex = codeInfo[i].bytecodeIndex; - compilingMethod->codeInfo[i].bytecode = codeInfo[i].bytecode; - } - } else { - compilingMethod->codeInfo = NULL; - } - return llvmFunction; } @@ -789,7 +796,7 @@ abort(); } - Reader reader(codeAtt, &(compilingClass->bytes)); + Reader reader(codeAtt, compilingClass->bytes); uint16 maxStack = reader.readU2(); uint16 maxLocals = reader.readU2(); uint32 codeLen = reader.readU4(); @@ -926,23 +933,6 @@ readExceptionTable(reader, codeLen); - // Lookup line number table attribute. - uint16 nba = reader.readU2(); - for (uint16 i = 0; i < nba; ++i) { - const UTF8* attName = compilingClass->ctpInfo->UTF8At(reader.readU2()); - uint32 attLen = reader.readU4(); - if (attName->equals(Attribut::lineNumberTableAttribut)) { - uint16 lineLength = reader.readU2(); - for (uint16 i = 0; i < lineLength; ++i) { - uint16 pc = reader.readU2(); - uint16 ln = reader.readU2(); - opcodeInfos[pc].lineNumber = ln; - } - } else { - reader.seek(attLen, Reader::SeekCur); - } - } - reader.cursor = start; exploreOpcodes(reader, codeLen); @@ -996,7 +986,7 @@ abort(); } - Reader reader(codeAtt, &(compilingClass->bytes)); + Reader reader(codeAtt, compilingClass->bytes); uint16 maxStack = reader.readU2(); uint16 maxLocals = reader.readU2(); uint32 codeLen = reader.readU4(); @@ -1174,23 +1164,6 @@ readExceptionTable(reader, codeLen); - // Lookup line number table attribute. - uint16 nba = reader.readU2(); - for (uint16 i = 0; i < nba; ++i) { - const UTF8* attName = compilingClass->ctpInfo->UTF8At(reader.readU2()); - uint32 attLen = reader.readU4(); - if (attName->equals(Attribut::lineNumberTableAttribut)) { - uint16 lineLength = reader.readU2(); - for (uint16 i = 0; i < lineLength; ++i) { - uint16 pc = reader.readU2(); - uint16 ln = reader.readU2(); - opcodeInfos[pc].lineNumber = ln; - } - } else { - reader.seek(attLen, Reader::SeekCur); - } - } - reader.cursor = start; exploreOpcodes(reader, codeLen); @@ -1355,7 +1328,7 @@ compilingMethod->lookupAttribut(Attribut::annotationsAttribut); if (annotationsAtt) { - Reader reader(annotationsAtt, &(compilingClass->bytes)); + Reader reader(annotationsAtt, compilingClass->bytes); AnnotationReader AR(reader, compilingClass); uint16 numAnnotations = reader.readU2(); for (uint16 i = 0; i < numAnnotations; ++i) { @@ -1370,18 +1343,6 @@ } } - if (codeInfo.size()) { - compilingMethod->codeInfo = new CodeLineInfo[codeInfo.size()]; - for (uint32 i = 0; i < codeInfo.size(); i++) { - compilingMethod->codeInfo[i].lineNumber = codeInfo[i].lineNumber; - compilingMethod->codeInfo[i].ctpIndex = codeInfo[i].ctpIndex; - compilingMethod->codeInfo[i].bytecodeIndex = codeInfo[i].bytecodeIndex; - compilingMethod->codeInfo[i].bytecode = codeInfo[i].bytecode; - } - } else { - compilingMethod->codeInfo = NULL; - } - return llvmFunction; } @@ -1548,26 +1509,16 @@ } } -Value* JavaJIT::getTarget(FunctionType::param_iterator it, uint32 nb) { -#if defined(ISOLATE_SHARING) - nb += 1; -#endif -#if defined(ISOLATE_SHARING) - sint32 start = nb - 2; - it--; - it--; -#else - sint32 start = nb - 1; -#endif - uint32 nbObjects = 0; - for (sint32 i = start; i >= 0; --i) { - it--; - if (it->get() == intrinsics->JavaObjectType) { - nbObjects++; +Value* JavaJIT::getTarget(Signdef* signature) { + int offset = 0; + Typedef* const* arguments = signature->getArgumentsType(); + for (uint32 i = 0; i < signature->nbArguments; i++) { + if (arguments[i]->isDouble() || arguments[i]->isLong()) { + offset++; } + offset++; } - assert(nbObjects > 0 && "No this"); - return objectStack[currentStackIndex - nbObjects]; + return objectStack[currentStackIndex - 1 - offset]; } Instruction* JavaJIT::lowerMathOps(const UTF8* name, @@ -1992,14 +1943,15 @@ intrinsics->AllocateUnresolvedFunction, Size, VT, "", currentBlock); + addHighLevelType(val, cl ? cl : upcalls->OfObject); + Instruction* res = new BitCastInst(val, intrinsics->JavaObjectType, "", currentBlock); + push(res, false, cl ? cl : upcalls->OfObject); + + // Make sure to add the object to the finalization list after it has been + // pushed. if (cl && cl->virtualVT->destructor) { CallInst::Create(intrinsics->AddFinalizationCandidate, val, "", currentBlock); } - - - addHighLevelType(val, cl ? cl : upcalls->OfObject); - val = new BitCastInst(val, intrinsics->JavaObjectType, "", currentBlock); - push(val, false, cl ? cl : upcalls->OfObject); } Value* JavaJIT::ldResolved(uint16 index, bool stat, Value* object, @@ -2163,7 +2115,7 @@ abort(); } } else { - if (TheCompiler->isStaticCompiling()) { + if (TheCompiler->isStaticCompiling() && !TheCompiler->useCooperativeGC()) { JavaObject* val = field->getStaticObjectField(); JnjvmClassLoader* JCL = field->classDef->classLoader; Value* V = TheCompiler->getFinalObject(val, sign->assocClass(JCL)); @@ -2275,7 +2227,7 @@ } -void JavaJIT::invokeInterface(uint16 index, bool buggyVirtual) { +void JavaJIT::invokeInterface(uint16 index) { // Do the usual JavaConstantPool* ctpInfo = compilingClass->ctpInfo; @@ -2287,13 +2239,7 @@ const llvm::PointerType* virtualPtrType = LSI->getVirtualPtrType(); const llvm::Type* retType = virtualType->getReturnType(); - BasicBlock* endBlock = createBasicBlock("end interface invoke"); - PHINode * node = 0; - if (retType != Type::getVoidTy(*llvmContext)) { - node = PHINode::Create(retType, "", endBlock); - } - - + CommonClass* cl = 0; JavaMethod* meth = 0; ctpInfo->infoOfMethod(index, ACC_VIRTUAL, cl, meth); @@ -2306,13 +2252,17 @@ intrinsics->JavaMethodType, 0, true); } - // Compute the arguments after calling getConstantPoolAt because the - // arguments will be loaded and the runtime may trigger GC. - std::vector args; // size = [signature->nbIn + 3]; - - FunctionType::param_iterator it = virtualType->param_end(); - makeArgs(it, index, args, signature->nbArguments + 1); - JITVerifyNull(args[0]); + uint32_t tableIndex = InterfaceMethodTable::getIndex(name, signature->keyName); + Constant* Index = ConstantInt::get(Type::getInt32Ty(*llvmContext), + tableIndex); + Value* targetObject = getTarget(signature); + targetObject = new LoadInst( + targetObject, "", TheCompiler->useCooperativeGC(), currentBlock); + JITVerifyNull(targetObject); + // TODO: The following code needs more testing. +#if 0 + BasicBlock* endBlock = createBasicBlock("end interface invoke"); + PHINode * node = PHINode::Create(virtualPtrType, "", endBlock); BasicBlock* label_bb = createBasicBlock("bb"); BasicBlock* label_bb4 = createBasicBlock("bb4"); @@ -2320,14 +2270,11 @@ BasicBlock* label_bb7 = createBasicBlock("bb7"); // Block entry (label_entry) - Value* VT = CallInst::Create(intrinsics->GetVTFunction, args[0], "", + Value* VT = CallInst::Create(intrinsics->GetVTFunction, targetObject, "", currentBlock); Value* IMT = CallInst::Create(intrinsics->GetIMTFunction, VT, "", currentBlock); - uint32_t tableIndex = InterfaceMethodTable::getIndex(name, signature->keyName); - Constant* Index = ConstantInt::get(Type::getInt32Ty(*llvmContext), - tableIndex); Value* indices[2] = { intrinsics->constantZero, Index }; Instruction* ptr_18 = GetElementPtrInst::Create(IMT, indices, indices + 2, "", @@ -2346,8 +2293,8 @@ // Block bb (label_bb) currentBlock = label_bb; CastInst* ptr_22 = new IntToPtrInst(int32_19, virtualPtrType, "", currentBlock); - Value* ret = invoke(ptr_22, args, "", currentBlock); - if (node) node->addIncoming(ret, currentBlock); + + node->addIncoming(ptr_22, currentBlock); BranchInst::Create(endBlock, currentBlock); // Block bb4 (label_bb4) @@ -2376,8 +2323,8 @@ LoadInst* int32_32 = new LoadInst(ptr_31, "", false, currentBlock); CastInst* ptr_33 = new BitCastInst(int32_32, virtualPtrType, "", currentBlock); - ret = invoke(ptr_33, args, "", currentBlock); - if (node) node->addIncoming(ret, currentBlock); + node->addIncoming(ptr_33, currentBlock); + BranchInst::Create(endBlock, currentBlock); // Block bb7 (label_bb7) @@ -2408,12 +2355,27 @@ ptr_table_0_lcssa->addIncoming(ptr_37, currentBlock); currentBlock = endBlock; - if (node) { - if (node->getType() == intrinsics->JavaObjectType) { +#else + std::vector Args; + Args.push_back(targetObject); + Args.push_back(Meth); + Args.push_back(Index); + Value* node = + invoke(intrinsics->ResolveInterfaceFunction, Args, "", currentBlock); + node = new BitCastInst(node, virtualPtrType, "", currentBlock); +#endif + + std::vector args; // size = [signature->nbIn + 3]; + FunctionType::param_iterator it = virtualType->param_end(); + makeArgs(it, index, args, signature->nbArguments + 1); + JITVerifyNull(args[0]); + Value* ret = invoke(node, args, "", currentBlock); + if (retType != Type::getVoidTy(*llvmContext)) { + if (ret->getType() == intrinsics->JavaObjectType) { JnjvmClassLoader* JCL = compilingClass->classLoader; - push(node, false, signature->getReturnType()->findAssocClass(JCL)); + push(ret, false, signature->getReturnType()->findAssocClass(JCL)); } else { - push(node, signature->getReturnType()->isUnsigned()); + push(ret, signature->getReturnType()->isUnsigned()); if (retType == Type::getDoubleTy(*llvmContext) || retType == Type::getInt64Ty(*llvmContext)) { push(intrinsics->constantZero, false); @@ -2656,10 +2618,7 @@ } DebugLoc JavaJIT::CreateLocation() { - LineInfo LI = { currentLineNumber, currentCtpIndex, currentBytecodeIndex, - currentBytecode }; - codeInfo.push_back(LI); - DebugLoc DL = DebugLoc::get(callNumber++, 0, DbgSubprogram); + DebugLoc DL = DebugLoc::get(currentBytecodeIndex, 0, DbgSubprogram); return DL; } Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Sat Nov 27 04:07:18 2010 @@ -58,19 +58,9 @@ /// stack - The stack at this location if there is a new block /// std::vector stack; - - /// lineNumber - The line number of this bytecode. - uint16 lineNumber; }; -struct LineInfo { - uint16 lineNumber; - uint16 ctpIndex; - uint16 bytecodeIndex; - uint16 bytecode; -}; - /// JavaJIT - The compilation engine of J3. Parses the bycode and returns /// its LLVM representation. /// @@ -90,11 +80,7 @@ callsStackWalker = false; endNode = 0; currentStackIndex = 0; - currentLineNumber = 0; currentBytecodeIndex = 0; - currentCtpIndex = -1; - currentBytecode = -1; - callNumber = 0; thisObject = NULL; } @@ -180,27 +166,12 @@ llvm::MDNode* DbgSubprogram; - /// currentLineIndex - The current line being processed. - uint16 currentLineNumber; - /// currentBytecodeIndex - The current bytecode being processed. uint16 currentBytecodeIndex; - /// currentCtpIndex - The constant pool index being processed. - uint16 currentCtpIndex; - - /// currentBytecode - The bytecode being processed. - uint16 currentBytecode; - - /// callNumber - The number of a call for a single opcode. - uint16 callNumber; - /// CreateLocation - Create debug information for a call. llvm::DebugLoc CreateLocation(); - // codeInfo - List of LineInfo for this method. - std::vector codeInfo; - //===--------------------------- Inline support ---------------------------===// /// inlineCompile - Parse the method and start its LLVM representation @@ -494,15 +465,13 @@ uint32 index, std::vector& result, uint32 nb); /// getTarget - Get the target object for invocation. - llvm::Value* getTarget(llvm::FunctionType::param_iterator it, uint32 nb); + llvm::Value* getTarget(Signdef* signature); /// invokeVirtual - Invoke a Java virtual method. void invokeVirtual(uint16 index); - /// invokeInterface - Invoke a Java interface method. The buggyVirtual - /// argument is for buggy java to bytecode compilers which emit a virtual - /// call instead of an interface call in some occasions. - void invokeInterface(uint16 index, bool buggyVirtual = false); + /// invokeInterface - Invoke a Java interface method. + void invokeInterface(uint16 index); /// invokeSpecial - Invoke an instance Java method directly. void invokeSpecial(uint16 index); Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sat Nov 27 04:07:18 2010 @@ -15,12 +15,14 @@ #include "llvm/Module.h" #include "llvm/Analysis/DebugInfo.h" #include "llvm/CodeGen/GCStrategy.h" +#include #include "llvm/CodeGen/MachineFunction.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" +#include <../lib/ExecutionEngine/JIT/JIT.h> #include "MvmGC.h" #include "mvm/VirtualMachine.h" @@ -38,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(); } }; @@ -55,10 +60,17 @@ if (ip) new_ip = isStub(ip, addr); JavaMethod* meth = (JavaMethod*)MetaInfo; CodeLineInfo* info = meth->lookupCodeLineInfo((uintptr_t)ip); - fprintf(stderr, "; %p in %s.%s (line %d, bytecode %d, code start %p)", new_ip, - UTF8Buffer(meth->classDef->name).cString(), - UTF8Buffer(meth->name).cString(), info->lineNumber, - info->bytecodeIndex, meth->code); + if (info != NULL) { + fprintf(stderr, "; %p (%p) in %s.%s (line %d, bytecode %d, code start %p)", new_ip, addr, + UTF8Buffer(meth->classDef->name).cString(), + UTF8Buffer(meth->name).cString(), + meth->lookupLineNumber((uintptr_t)ip), + info->bytecodeIndex, meth->code); + } else { + fprintf(stderr, "; %p (%p) in %s.%s (native method, code start %p)", new_ip, addr, + UTF8Buffer(meth->classDef->name).cString(), + UTF8Buffer(meth->name).cString(), meth->code); + } if (ip != new_ip) fprintf(stderr, " (from stub)"); fprintf(stderr, "\n"); } @@ -68,72 +80,17 @@ void *Code, size_t Size, const EmittedFunctionDetails &Details) { - // The following could be changed to an assert when -load-bc supports - // the verifier. + // The following is necessary for -load-bc. if (F.getParent() != TheCompiler->getLLVMModule()) return; - - Jnjvm* vm = JavaThread::get()->getJVM(); - mvm::BumpPtrAllocator& Alloc = TheCompiler->allocator; - llvm::GCFunctionInfo* GFI = 0; - - if (F.hasGC()) { - if (TheCompiler->TheGCStrategy == NULL) { - assert(mvm::MvmModule::TheGCStrategy != NULL && "No GC strategy"); - TheCompiler->TheGCStrategy = mvm::MvmModule::TheGCStrategy; - mvm::MvmModule::TheGCStrategy = NULL; - } - GCStrategy::iterator I = TheCompiler->TheGCStrategy->end(); - I--; - while (&(*I)->getFunction() != &F) { - // This happens when the compilation of a function was post-poned. - assert(I != TheCompiler->TheGCStrategy->begin() && "No GC info"); - I--; - } - assert(&(*I)->getFunction() == &F && - "GC Info and method do not correspond"); - GFI = *I; - } - - JavaMethod* meth = TheCompiler->getJavaMethod(F); - if (meth == NULL) { - // This is a stub. - mvm::MvmJITMethodInfo* MI = new(Alloc, "JITMethodInfo") - mvm::MvmJITMethodInfo(GFI, &F); - vm->RuntimeFunctions.addMethodInfo(MI, Code, - (void*)((uintptr_t)Code + Size)); - } else { - JavaJITMethodInfo* MI = new(Alloc, "JavaJITMethodInfo") - JavaJITMethodInfo(GFI, meth); - vm->RuntimeFunctions.addMethodInfo(MI, Code, - (void*)((uintptr_t)Code + Size)); - uint32 infoLength = Details.LineStarts.size(); - meth->codeInfoLength = infoLength; - if (infoLength > 0) { - mvm::BumpPtrAllocator& JavaAlloc = meth->classDef->classLoader->allocator; - CodeLineInfo* infoTable = - new(JavaAlloc, "CodeLineInfo") CodeLineInfo[infoLength]; - for (uint32 i = 0; i < infoLength; ++i) { - DebugLoc DL = Details.LineStarts[i].Loc; - uint32_t first = DL.getLine(); - uint32_t second = DL.getCol(); - assert(second == 0 && "Wrong column number"); - infoTable[i].address = Details.LineStarts[i].Address; - infoTable[i].lineNumber = meth->codeInfo[first].lineNumber; - infoTable[i].bytecodeIndex = meth->codeInfo[first].bytecodeIndex; - infoTable[i].ctpIndex = meth->codeInfo[first].ctpIndex; - infoTable[i].bytecode = meth->codeInfo[first].bytecode; - } - delete[] meth->codeInfo; - meth->codeInfo = infoTable; - } else { - if (meth->codeInfo != NULL) { - delete[] meth->codeInfo; - meth->codeInfo = NULL; - } - } + assert(F.hasGC()); + if (TheCompiler->GCInfo != NULL) { + assert(TheCompiler->GCInfo == Details.MF->getGMI()); + return; } + TheCompiler->GCInfo = Details.MF->getGMI(); } + Constant* JavaJITCompiler::getNativeClass(CommonClass* classDef) { const llvm::Type* Ty = classDef->isClass() ? JavaIntrinsics.JavaClassType : JavaIntrinsics.JavaCommonClassType; @@ -238,22 +195,17 @@ 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; + GCInfo = NULL; - // Protect IR for the GC. - mvm::MvmModule::protectIR(); executionEngine = ExecutionEngine::createJIT(TheModule, 0, 0, llvm::CodeGenOpt::Default, false); - TheGCStrategy = mvm::MvmModule::TheGCStrategy; - mvm::MvmModule::TheGCStrategy = NULL; - mvm::MvmModule::unprotectIR(); - executionEngine->RegisterJITEventListener(&listener); - addJavaPasses(trusted); + addJavaPasses(); } JavaJITCompiler::~JavaJITCompiler() { @@ -320,6 +272,7 @@ std::set contents[InterfaceMethodTable::NumIndexes]; cl->fillIMT(contents); + for (uint32_t i = 0; i < InterfaceMethodTable::NumIndexes; ++i) { std::set& atIndex = contents[i]; @@ -348,7 +301,7 @@ if (OldMethod && OldMethod != Cmeth) SameMethod = false; else OldMethod = Cmeth; - if (Cmeth) methods.push_back(Cmeth); + methods.push_back(Cmeth); } if (SameMethod) { @@ -360,45 +313,81 @@ } } else { - uint32_t length = 2 * size * sizeof(uintptr_t); + // Add one to have a NULL-terminated table. + uint32_t length = (2 * size + 1) * sizeof(uintptr_t); uintptr_t* table = (uintptr_t*) cl->classLoader->allocator.Allocate(length, "IMT"); IMT->contents[i] = (uintptr_t)table | 1; - int j = 0; + uint32_t j = 0; std::set::iterator Interf = atIndex.begin(); for (std::vector::iterator it = methods.begin(), et = methods.end(); it != et; ++it, j += 2, ++Interf) { JavaMethod* Imeth = *Interf; JavaMethod* Cmeth = *it; - + assert(Imeth != NULL); + assert(j < 2 * size - 1); table[j] = (uintptr_t)Imeth; if (Cmeth) { - table[j + 1] = getPointerOrStub(*Cmeth, JavaMethod::Interface); + table[j + 1] = getPointerOrStub(*Cmeth, JavaMethod::Interface); } else { table[j + 1] = (uintptr_t)ThrowUnfoundInterface; } } + assert(Interf == atIndex.end()); } } } } -void JavaJITCompiler::setMethod(JavaMethod* meth, void* ptr, const char* name) { - Function* func = getMethodInfo(meth)->getMethod(); +void JavaJITCompiler::setMethod(Function* func, void* ptr, const char* name) { + func->setLinkage(GlobalValue::ExternalLinkage); func->setName(name); assert(ptr && "No value given"); executionEngine->updateGlobalMapping(func, ptr); - func->setLinkage(GlobalValue::ExternalLinkage); } void* JavaJITCompiler::materializeFunction(JavaMethod* meth) { mvm::MvmModule::protectIR(); Function* func = parseFunction(meth); void* res = executionEngine->getPointerToGlobal(func); - // Now that it's compiled, we don't need the IR anymore + + if (!func->isDeclaration()) { + llvm::GCFunctionInfo* GFI = &(GCInfo->getFunctionInfo(*func)); + assert((GFI != NULL) && "No GC information"); + + Jnjvm* vm = JavaThread::get()->getJVM(); + mvm::JITMethodInfo* MI = + new(allocator, "JavaJITMethodInfo") JavaJITMethodInfo(GFI, meth); + MI->addToVM(vm, (JIT*)executionEngine); + + uint32_t infoLength = GFI->size(); + meth->codeInfoLength = infoLength; + if (infoLength == 0) { + meth->codeInfo = NULL; + } else { + mvm::BumpPtrAllocator& JavaAlloc = meth->classDef->classLoader->allocator; + CodeLineInfo* infoTable = + new(JavaAlloc, "CodeLineInfo") CodeLineInfo[infoLength]; + uint32_t index = 0; + for (GCFunctionInfo::iterator I = GFI->begin(), E = GFI->end(); + I != E; + I++, index++) { + DebugLoc DL = I->Loc; + uint32_t bytecodeIndex = DL.getLine(); + uint32_t second = DL.getCol(); + assert(second == 0 && "Wrong column number"); + uintptr_t address = + ((JIT*)executionEngine)->getCodeEmitter()->getLabelAddress(I->Label); + infoTable[index].address = address; + infoTable[index].bytecodeIndex = bytecodeIndex; + } + meth->codeInfo = infoTable; + } + } + // Now that it's compiled, we don't need the IR anymore func->deleteBody(); mvm::MvmModule::unprotectIR(); return res; @@ -407,6 +396,15 @@ void* JavaJITCompiler::GenerateStub(llvm::Function* F) { mvm::MvmModule::protectIR(); void* res = executionEngine->getPointerToGlobal(F); + + llvm::GCFunctionInfo* GFI = &(GCInfo->getFunctionInfo(*F)); + assert((GFI != NULL) && "No GC information"); + + Jnjvm* vm = JavaThread::get()->getJVM(); + mvm::JITMethodInfo* MI = + new(allocator, "JITMethodInfo") mvm::MvmJITMethodInfo(GFI, F, this); + MI->addToVM(vm, (JIT*)executionEngine); + // Now that it's compiled, we don't need the IR anymore F->deleteBody(); mvm::MvmModule::unprotectIR(); @@ -426,9 +424,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(); @@ -478,9 +478,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", @@ -490,7 +489,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/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sat Nov 27 04:07:18 2010 @@ -148,13 +148,7 @@ currentExceptionBlock = opinfo->exceptionBlock; - // Update the line number information. - if (opinfo->lineNumber) - currentLineNumber = opinfo->lineNumber; - - currentCtpIndex = -1; currentBytecodeIndex = i; - currentBytecode = bytecode; // To prevent a gcj bug with useless goto if (currentBlock->getTerminator() != 0) { @@ -2016,7 +2010,6 @@ case INVOKEVIRTUAL : { uint16 index = reader.readU2(); i += 2; - currentCtpIndex = index; invokeVirtual(index); break; } @@ -2024,7 +2017,6 @@ case INVOKESPECIAL : { uint16 index = reader.readU2(); i += 2; - currentCtpIndex = index; invokeSpecial(index); break; } @@ -2032,7 +2024,6 @@ case INVOKESTATIC : { uint16 index = reader.readU2(); i += 2; - currentCtpIndex = index; invokeStatic(index); break; } @@ -2040,7 +2031,6 @@ case INVOKEINTERFACE : { uint16 index = reader.readU2(); i += 2; - currentCtpIndex = index; invokeInterface(index); i += 2; break; Modified: vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp Sat Nov 27 04:07:18 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/trunk/lib/J3/Compiler/LLVMInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp Sat Nov 27 04:07:18 2010 @@ -157,10 +157,8 @@ JCL->nativeLookup(methodDef, j3, buf); } - if (!j3) { - methodDef->jniConsFromMethOverloaded(buf + 1); - memcpy(buf, "JnJVM", 5); - } + methodDef->jniConsFromMethOverloaded(buf + 1); + memcpy(buf, "JnJVM", 5); methodFunction = Function::Create(getFunctionType(), GlobalValue::ExternalWeakLinkage, buf, @@ -171,13 +169,11 @@ "", Compiler->getLLVMModule()); } - if (Compiler->useCooperativeGC()) { - methodFunction->setGC("vmkit"); - } + methodFunction->setGC("vmkit"); Compiler->functions.insert(std::make_pair(methodFunction, methodDef)); if (Compiler != JCL->getCompiler() && methodDef->code) { - Compiler->setMethod(methodDef, methodDef->code, methodFunction->getName().data()); + Compiler->setMethod(methodFunction, methodDef->code, methodFunction->getName().data()); } } return methodFunction; @@ -406,10 +402,13 @@ Value* val = CallInst::Create(func, Args.begin(), Args.end(), "", currentBlock); - if (!signature->getReturnType()->isVoid()) + if (!signature->getReturnType()->isVoid()) { ReturnInst::Create(context, val, currentBlock); - else + } else { ReturnInst::Create(context, currentBlock); + } + + res->setGC("vmkit"); return res; } @@ -483,15 +482,14 @@ Value* val = CallInst::Create(func, Args.begin(), Args.end(), "", currentBlock); - if (!signature->getReturnType()->isVoid()) + if (!signature->getReturnType()->isVoid()) { ReturnInst::Create(context, val, currentBlock); - else + } else { ReturnInst::Create(context, currentBlock); - - if (Compiler->useCooperativeGC()) { - res->setGC("vmkit"); } + res->setGC("vmkit"); + return res; } @@ -547,7 +545,7 @@ if (virt) { if (Compiler->useCooperativeGC()) { Args.push_back(new LoadInst(TempArgs[0], "", false, currentBlock)); - }else { + } else { Args.push_back(TempArgs[0]); } } @@ -589,9 +587,7 @@ ReturnInst::Create(context, currentBlock); } - if (Compiler->useCooperativeGC()) { - stub->setGC("vmkit"); - } + stub->setGC("vmkit"); return stub; } Modified: vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp Sat Nov 27 04:07:18 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/trunk/lib/J3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp Sat Nov 27 04:07:18 2010 @@ -388,8 +388,9 @@ PHINode* phi = PHINode::Create(intrinsics->JavaObjectType, "", DelegateeOK); phi->addIncoming(Del, CI->getParent()); - Value* Res = CallInst::Create(intrinsics->RuntimeDelegateeFunction, - Call.getArgument(0), "", NoDelegatee); + Instruction* Res = CallInst::Create(intrinsics->RuntimeDelegateeFunction, + Call.getArgument(0), "", NoDelegatee); + Res->setDebugLoc(CI->getDebugLoc()); BranchInst::Create(DelegateeOK, NoDelegatee); phi->addIncoming(Res, NoDelegatee); @@ -428,7 +429,7 @@ BranchInst::Create(trueCl, falseCl, test, CI); - Value* res = 0; + Instruction* res = 0; if (InvokeInst* Invoke = dyn_cast(CI)) { Value* Args[1] = { Cl }; BasicBlock* UI = Invoke->getUnwindDest(); @@ -462,6 +463,7 @@ Cl, "", falseCl); BranchInst::Create(trueCl, falseCl); } + res->setDebugLoc(CI->getDebugLoc()); node->addIncoming(res, falseCl); @@ -512,7 +514,7 @@ Args.push_back(Call.getArgument(i)); } - Value* res = 0; + Instruction* res = 0; if (InvokeInst* Invoke = dyn_cast(CI)) { BasicBlock* UI = Invoke->getUnwindDest(); res = InvokeInst::Create(resolver, trueCl, UI, Args.begin(), @@ -544,9 +546,9 @@ BranchInst::Create(trueCl, falseCl); } + res->setDebugLoc(CI->getDebugLoc()); node->addIncoming(res, falseCl); - CI->replaceAllUsesWith(node); CI->eraseFromParent(); BranchInst::Create(NBB, trueCl); @@ -578,8 +580,9 @@ BranchInst::Create(NotOKBlock, OKBlock, cmp, CI); Value* args[3] = { Call.getArgument(0), Call.getArgument(1), GV }; - Value* res = CallInst::Create(intrinsics->GetArrayClassFunction, args, - args + 3, "", NotOKBlock); + Instruction* res = CallInst::Create(intrinsics->GetArrayClassFunction, args, + args + 3, "", NotOKBlock); + res->setDebugLoc(CI->getDebugLoc()); BranchInst::Create(OKBlock, NotOKBlock); node->addIncoming(res, NotOKBlock); @@ -629,7 +632,8 @@ CurVT = new LoadInst(CurVT, "", false, CI); CurVT = new BitCastInst(CurVT, intrinsics->VTType, "", CI); - Value* res = new ICmpInst(CI, ICmpInst::ICMP_EQ, CurVT, VT2, ""); + Instruction* res = + new ICmpInst(CI, ICmpInst::ICMP_EQ, CurVT, VT2, ""); node->addIncoming(ConstantInt::getTrue(*Context), CI->getParent()); BranchInst::Create(CurEndBlock, FailedBlock, res, CI); @@ -637,6 +641,7 @@ Value* Args[2] = { VT1, VT2 }; res = CallInst::Create(intrinsics->IsSecondaryClassFunction, Args, Args + 2, "", FailedBlock); + res->setDebugLoc(CI->getDebugLoc()); node->addIncoming(res, FailedBlock); BranchInst::Create(CurEndBlock, FailedBlock); 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=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Sat Nov 27 04:07:18 2010 @@ -34,18 +34,18 @@ ;;; Field 2: void* MyVM ;;; Field 3: void* baseSP ;;; Field 4: char doYield -;;; field 5: void* vmData -;;; Field 6: char inRV -;;; Field 7: char joinedRV -;;; Field 8: void* lastSP -;;; Field 9: void* internalThreadID -;;; field 10: void* routine -;;; field 11: void* lastKnownFrame -;;; field 12: void* lastExceptionBuffer -%Thread = type { %CircularBase, i32, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8* } +;;; Field 5: char inRV +;;; Field 6: char joinedRV +;;; Field 7: void* lastSP +;;; Field 8: void* internalThreadID +;;; field 9: void* routine +;;; field 10: void* lastKnownFrame +;;; field 11: void* lastExceptionBuffer +%Thread = type { %CircularBase, i8*, i8*, i8*, i8, i8, i8, i8*, i8*, i8*, i8*, i8* } %JavaThread = type { %MutatorThread, i8*, %JavaObject* } +%JavaConstantPool = type { %JavaClass*, i32, i8*, i32*, i8** } %Attribut = type { %UTF8*, i32, i32 } @@ -55,7 +55,7 @@ %JavaField = type { i8*, i16, %UTF8*, %UTF8*, %Attribut*, i16, %JavaClass*, i32, i16 } -%CodeLineInfo = type { i8*, i16, i16, %JavaMethod*, %CodeLineInfo* } +%CodeLineInfo = type { i8*, %JavaMethod*, %CodeLineInfo* } %JavaMethod = type { i8*, i16, %Attribut*, i16, %JavaClass*, %UTF8*, %UTF8*, i8, i8*, %CodeLineInfo*, i16, i32 } @@ -208,6 +208,7 @@ declare i8* @j3ResolveVirtualStub(%JavaObject*) declare i8* @j3ResolveSpecialStub() declare i8* @j3ResolveStaticStub() +declare i8* @j3ResolveInterface(%JavaObject*, %JavaMethod*, i32) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Exception methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll Sat Nov 27 04:07:18 2010 @@ -1,7 +1,7 @@ -%BumpPtrAllocator = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* } +%ThreadAllocator = type { i8*, i8*, i8*, i8*, i8*, i8*, i8* } ;;; Field 0: the thread ;;; field 1: allocator ;;; field 2: MutatorContext ;;; field 3: realRoutine -%MutatorThread = type { %Thread, %BumpPtrAllocator, i8*, i8* } +%MutatorThread = type { %Thread, %ThreadAllocator, i8*, i8* } Modified: vmkit/trunk/lib/J3/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaArray.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaArray.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaArray.h Sat Nov 27 04:07:18 2010 @@ -36,7 +36,7 @@ /// {JavaObject, size, [0 * T]}. template class TJavaArray : public JavaObject { -private: +public: /// size - The (constant) size of the array. ssize_t size; @@ -75,7 +75,7 @@ }; class ArrayObject : public JavaObject { -private: +public: /// size - The (constant) size of the array. ssize_t size; @@ -98,6 +98,7 @@ static void setElement(ArrayObject* self, JavaObject* value, uint32_t i) { llvm_gcroot(self, 0); llvm_gcroot(value, 0); + if (value != NULL) assert(value->getVirtualTable()); self->elements[i] = value; } Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sat Nov 27 04:07:18 2010 @@ -216,9 +216,8 @@ logSize = nb; } -Class::Class(JnjvmClassLoader* loader, const UTF8* n, ArrayUInt8* B) : +Class::Class(JnjvmClassLoader* loader, const UTF8* n, ClassBytes* B) : CommonClass(loader, n) { - llvm_gcroot(B, 0); virtualVT = 0; bytes = B; super = 0; @@ -287,31 +286,8 @@ 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::setCompiledPtr(void* ptr, const char* name) { - classDef->acquire(); - if (code == 0) { - code = ptr; - Jnjvm* vm = JavaThread::get()->getJVM(); - mvm::MethodInfo* MI = vm->SharedStaticFunctions.CodeStartToMethodInfo(ptr); - JavaStaticMethodInfo* JMI = - new (classDef->classLoader->allocator, "JavaStaticMethodInfo") - JavaStaticMethodInfo((mvm::CamlMethodInfo*)MI, code, this); - vm->StaticFunctions.addMethodInfo(JMI, code); - classDef->classLoader->getCompiler()->setMethod(this, ptr, name); - } +void JavaMethod::setNative() { access |= ACC_NATIVE; - classDef->release(); } void JavaVirtualTable::setNativeTracer(uintptr_t ptr, const char* name) { @@ -624,7 +600,7 @@ if (!attribut) { InitNullStaticField(); } else { - Reader reader(attribut, &(classDef->bytes)); + Reader reader(attribut, classDef->bytes); JavaConstantPool * ctpInfo = classDef->ctpInfo; uint16 idx = reader.readU2(); if (type->isPrimitive()) { @@ -710,7 +686,7 @@ Attribut* codeAtt = meth.lookupAttribut(Attribut::codeAttribut); if (codeAtt) { - Reader reader(codeAtt, &(meth.classDef->bytes)); + Reader reader(codeAtt, meth.classDef->bytes); //uint16 maxStack = reader.readU2(); //uint16 maxLocals = @@ -789,14 +765,16 @@ interfaces[i]->fillIMT(meths); } - if (super) super->fillIMT(meths); + if (super != NULL) { + super->fillIMT(meths); + } - if (isInterface()) { + // Specification says that an invokeinterface also looks at j.l.Object. + if (isInterface() || (super == NULL)) { for (uint32 i = 0; i < nbVirtualMethods; ++i) { JavaMethod& meth = virtualMethods[i]; uint32_t index = InterfaceMethodTable::getIndex(meth.name, meth.type); - if (meths[index].find(&meth) == meths[index].end()) - meths[index].insert(&meth); + meths[index].insert(&meth); } } } @@ -911,7 +889,7 @@ PRINT_DEBUG(JNJVM_LOAD, 0, LIGHT_GREEN, "reading ", 0); PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "%s\n", mvm::PrintBuffer(this).cString()); - Reader reader(&bytes); + Reader reader(bytes); uint32 magic = reader.readU4(); assert(magic == Jnjvm::Magic && "I've created a class but magic is no good!"); @@ -946,14 +924,22 @@ interfaces[i]->resolveClass(); } - #ifndef ISOLATE_SHARING +#ifdef ISOLATE +void Class::resolveClass() { + UNIMPLEMENTED(); +} +#else void Class::resolveClass() { if (isResolved() || isErroneous()) return; resolveParents(); loadExceptions(); - setResolved(); + // Do a compare and swap in case another thread initialized the class. + __sync_val_compare_and_swap( + &(getCurrentTaskClassMirror().status), loaded, resolved); + assert(isResolved() || isErroneous()); } +#endif #else void Class::resolveClass() { assert(status >= resolved && @@ -965,7 +951,7 @@ if (!innerOuterResolved) { Attribut* attribut = lookupAttribut(Attribut::innerClassesAttribut); if (attribut != 0) { - Reader reader(attribut, getBytesPtr()); + Reader reader(attribut, bytes); uint16 nbi = reader.readU2(); for (uint16 i = 0; i < nbi; ++i) { uint16 inner = reader.readU2(); @@ -1042,7 +1028,7 @@ return (ArrayObject*)vm->upcalls->classArrayClass->doNew(0, vm); } else { UserConstantPool* ctp = classDef->getConstantPool(); - Reader reader(exceptionAtt, classDef->getBytesPtr()); + Reader reader(exceptionAtt, classDef->bytes); uint16 nbe = reader.readU2(); res = (ArrayObject*)vm->upcalls->classArrayClass->doNew(nbe, vm); @@ -1144,19 +1130,35 @@ for (sint32 i =0; i < mnlen; ++i) { cur = jniConsName->elements[i]; - if (cur == '/') ptr[0] = '_'; - else if (cur == '_') { + if (cur == '/') { + ptr[0] = '_'; + ++ptr; + } else if (cur == '_') { ptr[0] = '_'; ptr[1] = '1'; + ptr += 2; + } else if (cur == '<') { + ptr[0] = '_'; + ptr[1] = '0'; + ptr[2] = '0'; + ptr[3] = '0'; + ptr[4] = '3'; + ptr[5] = 'C'; + ptr += 6; + } else if (cur == '>') { + ptr[0] = '_'; + ptr[1] = '0'; + ptr[2] = '0'; + ptr[3] = '0'; + ptr[4] = '3'; + ptr[5] = 'E'; + ptr += 6; + } else { + ptr[0] = (uint8)cur; ++ptr; } - else ptr[0] = (uint8)cur; - ++ptr; - } - + } ptr[0] = 0; - - } void JavaMethod::jniConsFromMethOverloaded(char* buf, const UTF8* jniConsClName, @@ -1752,32 +1754,56 @@ CodeLineInfo* JavaMethod::lookupCodeLineInfo(uintptr_t ip) { for(uint16 i = 0; i < codeInfoLength; ++i) { - if (codeInfo[i].address > ip) { - assert(i > 0 && "Wrong ip address for method"); - return &(codeInfo[i - 1]); + if (codeInfo[i].address == ip) { + return &(codeInfo[i]); } } - if (codeInfoLength) return &(codeInfo[codeInfoLength - 1]); return NULL; } uint16 JavaMethod::lookupLineNumber(uintptr_t ip) { - for(uint16 i = 1; i < codeInfoLength; ++i) { - if (codeInfo[i].address > ip) { - return codeInfo[i - 1].lineNumber; + 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; + uint32_t codeLength = reader.readU4(); + reader.seek(codeLength, Reader::SeekCur); + uint16_t exceptionTableLength = reader.readU2(); + reader.seek(8 * exceptionTableLength, Reader::SeekCur); + uint16_t nba = reader.readU2(); + for (uint16 att = 0; att < nba; ++att) { + const UTF8* attName = classDef->ctpInfo->UTF8At(reader.readU2()); + uint32 attLen = reader.readU4(); + if (attName->equals(Attribut::lineNumberTableAttribut)) { + uint16_t lineLength = reader.readU2(); + uint16_t currentLine = 0; + for (uint16 j = 0; j < lineLength; ++j) { + uint16 pc = reader.readU2(); + if (pc > codeInfo[i].bytecodeIndex + 1) return currentLine; + currentLine = reader.readU2(); + } + return currentLine; + } else { + reader.seek(attLen, Reader::SeekCur); + } + } } } - if (codeInfoLength) return codeInfo[codeInfoLength - 1].lineNumber; return 0; } uint16 JavaMethod::lookupCtpIndex(uintptr_t ip) { - for(uint16 i = 1; i < codeInfoLength; ++i) { - if (codeInfo[i].address > ip) { - return codeInfo[i - 1].ctpIndex; + for(uint16 i = 0; i < codeInfoLength; ++i) { + if (codeInfo[i].address == ip) { + Attribut* codeAtt = lookupAttribut(Attribut::codeAttribut); + Reader reader(codeAtt, classDef->bytes); + reader.cursor = reader.cursor + 2 + 2 + 4 + codeInfo[i].bytecodeIndex + 1; + return reader.readU2(); } } - if (codeInfoLength) return codeInfo[codeInfoLength - 1].ctpIndex; return 0; } Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.h Sat Nov 27 04:07:18 2010 @@ -34,6 +34,7 @@ class ArrayUInt16; class Class; class ClassArray; +class ClassBytes; class JavaArray; class JavaConstantPool; class JavaField; @@ -457,7 +458,7 @@ /// bytes - The .class file of this class. /// - ArrayUInt8* bytes; + ClassBytes* bytes; /// ctpInfo - The constant pool info of this class. /// @@ -621,7 +622,7 @@ /// Class - Create a class in the given virtual machine and with the given /// name. - Class(JnjvmClassLoader* loader, const UTF8* name, ArrayUInt8* bytes); + Class(JnjvmClassLoader* loader, const UTF8* name, ClassBytes* bytes); /// readParents - Reads the parents, i.e. super and interfaces, of the class. /// @@ -656,14 +657,10 @@ /// getBytes - Get the bytes of the class file. /// - ArrayUInt8* getBytes() const { + ClassBytes* getBytes() const { return bytes; } - ArrayUInt8** getBytesPtr() { - return &bytes; - } - /// resolveInnerOuterClasses - Resolve the inner/outer information. /// void resolveInnerOuterClasses(); @@ -873,25 +870,10 @@ }; -class JavaStaticMethodInfo : public mvm::CamlMethodInfo { -public: - virtual void print(void* ip, void* addr); - - JavaStaticMethodInfo(mvm::CamlMethodInfo* super, void* ip, JavaMethod* M) : - mvm::CamlMethodInfo(super != NULL ? super->CF : NULL, ip) { - MetaInfo = M; - MethodType = 1; - } - -}; - class CodeLineInfo : public mvm::PermanentObject { public: uintptr_t address; - uint16 lineNumber; - uint16 ctpIndex; uint16 bytecodeIndex; - uint16 bytecode; // TODO: Use these fields when inlining. JavaMethod* executingMethod; // The code where the inlined method starts. @@ -925,9 +907,9 @@ /// void* compiledPtr(); - /// setCompiledPtr - Set the pointer function to the method. + /// setNative - Set the method as native. /// - void setCompiledPtr(void*, const char*); + void setNative(); /// JavaMethod - Delete the method as well as the cache enveloppes and /// attributes of the method. @@ -1315,6 +1297,7 @@ void setStaticObjectField(JavaObject* val) { llvm_gcroot(val, 0); + if (val != NULL) assert(val->getVirtualTable()); assert(classDef->isResolved()); void* ptr = (void*)((uint64)classDef->getStaticInstance() + ptrOffset); ((JavaObject**)ptr)[0] = val; @@ -1330,6 +1313,7 @@ void setInstanceObjectField(JavaObject* obj, JavaObject* val) { llvm_gcroot(obj, 0); llvm_gcroot(val, 0); + if (val != NULL) assert(val->getVirtualTable()); assert(classDef->isResolved()); void* ptr = (void*)((uint64)obj + ptrOffset); ((JavaObject**)ptr)[0] = val; Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Sat Nov 27 04:07:18 2010 @@ -190,7 +190,7 @@ if (!ctpRes[entry]) { mvm::ThreadAllocator allocator; - Reader reader(&(classDef->bytes), ctpDef[entry]); + Reader reader(classDef->bytes, ctpDef[entry]); uint32 len = reader.readU2(); uint16* buf = (uint16*)allocator.Allocate(len * sizeof(uint16)); uint32 n = 0; Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h Sat Nov 27 04:07:18 2010 @@ -52,7 +52,7 @@ /// ctpRes - Objects resolved dynamically, e.g. UTF8s, classes, methods, /// fields, string pointers. /// - void** ctpRes; + void** ctpRes; /// operator new - Redefine the operator to allocate the arrays of a /// constant pool inline. Removed: vmkit/trunk/lib/J3/VMCore/JavaInitialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaInitialise.cpp?rev=120205&view=auto ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaInitialise.cpp (original) +++ vmkit/trunk/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 Removed: vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp?rev=120205&view=auto ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp (removed) @@ -1,133 +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; - -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; -} Removed: vmkit/trunk/lib/J3/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaLocks.h?rev=120205&view=auto ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaLocks.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaLocks.h (removed) @@ -1,159 +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 { - -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/trunk/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Sat Nov 27 04:07:18 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/trunk/lib/J3/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.cpp Sat Nov 27 04:07:18 2010 @@ -17,6 +17,7 @@ #include "Jnjvm.h" #include +#include "debug.h" using namespace j3; @@ -45,7 +46,6 @@ } assert(val > mvm::GCBitMask); assert(val <= mvm::HashMask); - assert(val != hashCodeGenerator); do { header = self->header; @@ -64,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) { @@ -175,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/trunk/lib/J3/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.h Sat Nov 27 04:07:18 2010 @@ -18,7 +18,6 @@ #include "types.h" -#include "JavaLocks.h" #include "JnjvmConfig.h" union jvalue; @@ -244,6 +243,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 +267,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 +288,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/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Sat Nov 27 04:07:18 2010 @@ -16,6 +16,7 @@ #include "JavaString.h" #include "JavaThread.h" #include "JavaTypes.h" +#include "JavaUpcalls.h" #include "Jnjvm.h" #include "j3/OpcodeNames.def" @@ -360,9 +361,10 @@ *oldLocalReferencesNumber = th->currentAddedReferences; th->currentAddedReferences = localReferencesNumber; - th->startKnownFrame(*Frame); - - th->startJNI(1); + th->startJNI(); + th->startUnknownFrame(*Frame); + th->enterUncooperativeCode(); + assert(th->getLastSP() == th->lastKnownFrame->currentFP); return Frame->currentFP; } @@ -608,15 +610,14 @@ // 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. - CodeLineInfo* CLInfo = - meth->lookupCodeLineInfo(reinterpret_cast(ip)); - uint16 ctpIndex = CLInfo->ctpIndex; + uint16 ctpIndex = meth->lookupCtpIndex(reinterpret_cast(ip)); assert(ctpIndex && "No constant pool index"); JavaConstantPool* ctpInfo = meth->classDef->getConstantPool(); CommonClass* ctpCl = 0; @@ -648,8 +649,7 @@ uint32_t index = InterfaceMethodTable::getIndex(Virt->name, Virt->type); if ((IMT->contents[index] & 1) == 0) { IMT->contents[index] = (uintptr_t)result; - } else { - + } else { JavaMethod* Imeth = ctpCl->asClass()->lookupInterfaceMethodDontThrow(utf8, sign->keyName); assert(Imeth && "Method not in hierarchy?"); @@ -673,10 +673,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. @@ -711,10 +711,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. @@ -746,6 +746,27 @@ return result; } +// Does not throw an exception. +extern "C" void* j3ResolveInterface(JavaObject* obj, JavaMethod* meth, uint32_t index) { + uintptr_t result = NULL; + InterfaceMethodTable* IMT = JavaObject::getClass(obj)->virtualVT->IMT; + assert(JavaObject::instanceOf(obj, meth->classDef)); + assert(meth->classDef->isInterface() || + (meth->classDef == meth->classDef->classLoader->bootstrapLoader->upcalls->OfObject)); + assert(index == InterfaceMethodTable::getIndex(meth->name, meth->type)); + if ((IMT->contents[index] & 1) == 0) { + result = IMT->contents[index]; + } else { + uintptr_t* table = (uintptr_t*)(IMT->contents[index] & ~1); + uint32 i = 0; + while (table[i] != (uintptr_t)meth && table[i] != 0) { i += 2; } + assert(table[i] != 0); + result = table[i + 1]; + } + assert((result != 0) && "Bad IMT"); + return (void*)result; +} + extern "C" void j3PrintMethodStart(JavaMethod* meth) { fprintf(stderr, "[%p] executing %s.%s\n", (void*)mvm::Thread::get(), UTF8Buffer(meth->classDef->name).cString(), Modified: vmkit/trunk/lib/J3/VMCore/JavaString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaString.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaString.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaString.h Sat Nov 27 04:07:18 2010 @@ -21,10 +21,9 @@ class Jnjvm; class JavaString : public JavaObject { -private: +public: // CLASSPATH FIELDS!! const ArrayUInt16* value; -public: sint32 count; sint32 cachedHashCode; sint32 offset; Modified: vmkit/trunk/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaThread.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaThread.cpp Sat Nov 27 04:07:18 2010 @@ -19,24 +19,14 @@ 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); - llvm_gcroot(vmth, 0); - - javaThread = thread; - vmThread = vmth; +JavaThread::JavaThread(Jnjvm* isolate) : MutatorThread() { MyVM = isolate; - interruptFlag = 0; - state = StateRunning; - pendingException = 0; + pendingException = NULL; jniEnv = isolate->jniEnv; localJNIRefs = new JNILocalReferences(); - currentAddedReferences = 0; + currentAddedReferences = NULL; + javaThread = NULL; + vmThread = NULL; #ifdef SERVICE eipIndex = 0; @@ -47,6 +37,13 @@ #endif } +void JavaThread::initialise(JavaObject* thread, JavaObject* vmth) { + llvm_gcroot(thread, 0); + llvm_gcroot(vmth, 0); + javaThread = thread; + vmThread = vmth; +} + JavaThread::~JavaThread() { delete localJNIRefs; #ifdef SERVICE @@ -68,9 +65,16 @@ th->internalThrowException(); } -void JavaThread::startJNI(int level) { - // Start uncooperative mode. - enterUncooperativeCode(level); +void JavaThread::startJNI() { + // Interesting, but no need to do anything. +} + +void JavaThread::endJNI() { + localJNIRefs->removeJNIReferences(this, *currentAddedReferences); + endUnknownFrame(); + + // Go back to cooperative mode. + leaveUncooperativeCode(); } uint32 JavaThread::getJavaFrameContext(void** buffer) { @@ -78,8 +82,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; @@ -92,9 +96,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; } @@ -117,8 +121,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; @@ -133,7 +137,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/trunk/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaThread.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaThread.h Sat Nov 27 04:07:18 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. /// @@ -148,15 +123,17 @@ /// JavaThread - Creates a Java thread. /// - JavaThread(JavaObject* thread, JavaObject* vmThread, Jnjvm* isolate); + JavaThread(Jnjvm* isolate); - /// get - Get the current thread as a JnJVM object. + void initialise(JavaObject* thread, JavaObject* vmth); + + /// get - Get the current thread as a J3 object. /// static JavaThread* get() { return (JavaThread*)mvm::Thread::get(); } - /// getJVM - Get the JnJVM in which this thread executes. + /// getJVM - Get the Java VM in which this thread executes. /// Jnjvm* getJVM() { return (Jnjvm*)MyVM; @@ -211,16 +188,9 @@ /// startJNI - Record that we are entering native code. /// - void startJNI(int level) __attribute__ ((noinline)); + void startJNI(); - void endJNI() { - localJNIRefs->removeJNIReferences(this, *currentAddedReferences); - - // Go back to cooperative mode. - leaveUncooperativeCode(); - - endKnownFrame(); - } + void endJNI(); /// getCallingMethod - Get the Java method in the stack at the specified /// level. Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sat Nov 27 04:07:18 2010 @@ -34,6 +34,7 @@ #include "LinkJavaRuntime.h" #include "LockedMap.h" #include "Reader.h" +#include "ReferenceQueue.h" #include "Zip.h" using namespace j3; @@ -42,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) { @@ -123,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(); @@ -161,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 @@ -200,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 @@ -828,19 +811,18 @@ } -char* findInformation(Jnjvm* vm, ArrayUInt8* manifest, const char* entry, - uint32 len) { - llvm_gcroot(manifest, 0); - sint32 index = sys_strnstr((char*)ArrayUInt8::getElements(manifest), entry); +static char* findInformation(Jnjvm* vm, ClassBytes* manifest, const char* entry, + uint32 len) { + sint32 index = sys_strnstr((char*)manifest->elements, entry); if (index != -1) { index += len; - sint32 end = sys_strnstr((char*)ArrayUInt8::getElements(manifest) + index, "\n"); - if (end == -1) end = ArrayUInt8::getSize(manifest); + sint32 end = sys_strnstr((char*)manifest->elements + index, "\n"); + if (end == -1) end = manifest->size; else end += index; sint32 length = end - index - 1; char* name = (char*)vm->allocator.Allocate(length + 1, "class name"); - memcpy(name, ArrayUInt8::getElements(manifest) + index, length); + memcpy(name, manifest->elements + index, length); name[length] = 0; return name; } else { @@ -850,10 +832,8 @@ void ClArgumentsInfo::extractClassFromJar(Jnjvm* vm, int argc, char** argv, int i) { - ArrayUInt8* bytes = NULL; - ArrayUInt8* res = NULL; - llvm_gcroot(bytes, 0); - llvm_gcroot(res, 0); + ClassBytes* bytes = NULL; + ClassBytes* res = NULL; jarFile = argv[i]; vm->setClasspath(jarFile); @@ -868,13 +848,10 @@ mvm::BumpPtrAllocator allocator; ZipArchive* archive = new(allocator, "TempZipArchive") ZipArchive(bytes, allocator); - // Make sure it gets GC'd. - vm->bootstrapLoader->bootArchives.push_back(archive); if (archive->getOfscd() != -1) { ZipFile* file = archive->getFile(PATH_MANIFEST); if (file != NULL) { - UserClassArray* array = vm->bootstrapLoader->upcalls->ArrayOfByte; - res = (ArrayUInt8*)array->doNew(file->ucsize, vm); + res = new (allocator, file->ucsize) ClassBytes(file->ucsize); int ok = archive->readFile(res, file); if (ok) { char* mainClass = findInformation(vm, res, MAIN_CLASS, @@ -897,8 +874,6 @@ } else { printf("Can't find archive %s\n", jarFile); } - // We don't need this archive anymore. - vm->bootstrapLoader->bootArchives.pop_back(); } void ClArgumentsInfo::nyi() { @@ -1088,11 +1063,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. @@ -1127,9 +1104,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); @@ -1188,9 +1162,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 @@ -1318,10 +1289,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()) { @@ -1358,51 +1325,15 @@ 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 = new JavaThread(this); mainThread->start((void (*)(mvm::Thread*))mainJavaStart); } Jnjvm::Jnjvm(mvm::BumpPtrAllocator& Alloc, JnjvmBootstrapLoader* loader) : - VirtualMachine(Alloc), lockSystem(this) { + VirtualMachine(Alloc), lockSystem(Alloc) { classpath = getenv("CLASSPATH"); if (!classpath) classpath = "."; @@ -1411,7 +1342,6 @@ jniEnv = &JNI_JNIEnvTable; javavmEnv = &JNI_JavaVMTable; - bootstrapLoader = loader; upcalls = bootstrapLoader->upcalls; @@ -1427,26 +1357,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) { @@ -1462,49 +1375,46 @@ 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::startCollection() { + finalizerThread->FinalizationQueueLock.acquire(); + referenceThread->ToEnqueueLock.acquire(); + referenceThread->SoftReferencesQueue.acquire(); + referenceThread->WeakReferencesQueue.acquire(); + referenceThread->PhantomReferencesQueue.acquire(); } - -void Jnjvm::removeMethodsInFunctionMaps(JnjvmClassLoader* loader) { - internalRemoveMethods(loader, RuntimeFunctions); - internalRemoveMethods(loader, StaticFunctions); + +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); +} -/// 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 -}; - +void Jnjvm::addFinalizationCandidate(gc* object) { + llvm_gcroot(object, 0); + finalizerThread->addFinalizationCandidate(object); +} -// 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(); @@ -1514,9 +1424,12 @@ newArgv[0] = newArgv[1]; newArgv[1] = mainClass; - JavaCompiler* Comp = new JavaStaticCompiler(); - JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp); - mvm::VirtualMachine* vm = mvm::VirtualMachine::createJVM(JCL); + mvm::BumpPtrAllocator Allocator; + JavaCompiler* Comp = new JavaCompiler(); + 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/trunk/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.h Sat Nov 27 04:07:18 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" @@ -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. @@ -202,7 +212,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 /// @@ -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. /// @@ -341,44 +351,11 @@ /// 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. - /// - 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 + /// 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 - - 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 Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Nov 27 04:07:18 2010 @@ -308,9 +308,8 @@ TheCompiler = Comp; } -ArrayUInt8* JnjvmBootstrapLoader::openName(const UTF8* utf8) { - ArrayUInt8* res = 0; - llvm_gcroot(res, 0); +ClassBytes* JnjvmBootstrapLoader::openName(const UTF8* utf8) { + ClassBytes* res = 0; mvm::ThreadAllocator threadAllocator; char* asciiz = (char*)threadAllocator.Allocate(utf8->size + 1); @@ -348,8 +347,7 @@ UserClass* JnjvmBootstrapLoader::internalLoad(const UTF8* name, bool doResolve, JavaString* strName) { - ArrayUInt8* bytes = NULL; - llvm_gcroot(bytes, 0); + ClassBytes* bytes = NULL; llvm_gcroot(strName, 0); UserCommonClass* cl = lookupClass(name); @@ -667,9 +665,8 @@ } UserClass* JnjvmClassLoader::constructClass(const UTF8* name, - ArrayUInt8* bytes) { + ClassBytes* bytes) { JavaObject* excp = NULL; - llvm_gcroot(bytes, 0); llvm_gcroot(excp, 0); UserClass* res = NULL; lock.lock(); @@ -688,6 +685,8 @@ getCompiler()->resolveVirtualClass(res); getCompiler()->resolveStaticClass(res); classes->lock.lock(); + assert(res->getDelegatee() == NULL); + assert(res->getStaticInstance() == NULL); bool success = classes->map.insert(std::make_pair(internalName, res)).second; classes->lock.unlock(); assert(success && "Could not add class in map"); @@ -912,8 +911,9 @@ JnjvmClassLoader::~JnjvmClassLoader() { - if (isolate) - isolate->removeMethodsInFunctionMaps(this); + if (isolate) { + isolate->removeMethodInfos(TheCompiler); + } if (classes) { classes->~ClassMap(); @@ -966,8 +966,7 @@ } void JnjvmBootstrapLoader::analyseClasspathEnv(const char* str) { - ArrayUInt8* bytes = NULL; - llvm_gcroot(bytes, 0); + ClassBytes* bytes = NULL; mvm::ThreadAllocator threadAllocator; if (str != 0) { unsigned int len = strlen(str); @@ -1087,8 +1086,32 @@ 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) { - JavaCompiler* M = getCompiler(); for (ClassMap::iterator i = classes->map.begin(), e = classes->map.end(); i != e; ++i) { CommonClass* cl = i->second; @@ -1100,8 +1123,7 @@ if (!isAbstract(meth.access) && meth.code) { JavaStaticMethodInfo* MI = new (allocator, "JavaStaticMethodInfo") JavaStaticMethodInfo(0, meth.code, &meth); - vm->StaticFunctions.addMethodInfo(MI, meth.code); - M->setMethod(&meth, meth.code, ""); + vm->FunctionsCache.addMethodInfo(MI, meth.code); } } @@ -1110,8 +1132,7 @@ if (!isAbstract(meth.access) && meth.code) { JavaStaticMethodInfo* MI = new (allocator, "JavaStaticMethodInfo") JavaStaticMethodInfo(0, meth.code, &meth); - vm->StaticFunctions.addMethodInfo(MI, meth.code); - M->setMethod(&meth, meth.code, ""); + vm->FunctionsCache.addMethodInfo(MI, meth.code); } } } Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Sat Nov 27 04:07:18 2010 @@ -26,9 +26,9 @@ namespace j3 { -class ArrayUInt8; class UserClass; class UserClassArray; +class ClassBytes; class ClassMap; class Classpath; class UserCommonClass; @@ -209,7 +209,7 @@ /// constructClass - Hashes a runtime representation of a class with /// the given name. /// - UserClass* constructClass(const UTF8* name, ArrayUInt8* bytes); + UserClass* constructClass(const UTF8* name, ClassBytes* bytes); /// constructType - Hashes a Typedef, an internal representation of a class /// still not loaded. @@ -326,7 +326,7 @@ /// openName - Opens a file of the given name and returns it as an array /// of byte. /// - ArrayUInt8* openName(const UTF8* utf8); + ClassBytes* openName(const UTF8* utf8); public: Modified: vmkit/trunk/lib/J3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/LockedMap.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/J3/VMCore/LockedMap.h Sat Nov 27 04:07:18 2010 @@ -31,6 +31,7 @@ namespace j3 { class JavaString; +class JnjvmClassLoader; class Signdef; class Typedef; class UserCommonClass; Modified: vmkit/trunk/lib/J3/VMCore/Reader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Reader.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Reader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Reader.cpp Sat Nov 27 04:07:18 2010 @@ -12,10 +12,7 @@ #include "types.h" -#include "Jnjvm.h" -#include "JavaArray.h" -#include "JavaThread.h" -#include "JavaUpcalls.h" +#include "JnjvmClassLoader.h" #include "Reader.h" #include "Zip.h" @@ -25,17 +22,15 @@ const int Reader::SeekCur = SEEK_CUR; const int Reader::SeekEnd = SEEK_END; -ArrayUInt8* Reader::openFile(JnjvmBootstrapLoader* loader, const char* path) { - ArrayUInt8* res = NULL; - llvm_gcroot(res, 0); +ClassBytes* Reader::openFile(JnjvmClassLoader* loader, const char* path) { + ClassBytes* res = NULL; FILE* fp = fopen(path, "r"); if (fp != 0) { fseek(fp, 0, SeekEnd); long nbb = ftell(fp); fseek(fp, 0, SeekSet); - UserClassArray* array = loader->upcalls->ArrayOfByte; - res = (ArrayUInt8*)array->doNew((sint32)nbb, JavaThread::get()->getJVM()); - if (fread(ArrayUInt8::getElements(res), nbb, 1, fp) == 0) { + res = new (loader->allocator, nbb) ClassBytes(nbb); + if (fread(res->elements, nbb, 1, fp) == 0) { fprintf(stderr, "fread error\n"); abort(); } @@ -44,14 +39,12 @@ return res; } -ArrayUInt8* Reader::openZip(JnjvmBootstrapLoader* loader, ZipArchive* archive, +ClassBytes* Reader::openZip(JnjvmClassLoader* loader, ZipArchive* archive, const char* filename) { - ArrayUInt8* res = 0; - llvm_gcroot(res, 0); + ClassBytes* res = 0; ZipFile* file = archive->getFile(filename); if (file != 0) { - UserClassArray* array = loader->upcalls->ArrayOfByte; - res = (ArrayUInt8*)array->doNew((sint32)file->ucsize, JavaThread::get()->getJVM()); + res = new (loader->allocator, file->ucsize) ClassBytes(file->ucsize); if (archive->readFile(res, file) != 0) { return res; } Modified: vmkit/trunk/lib/J3/VMCore/Reader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Reader.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Reader.h (original) +++ vmkit/trunk/lib/J3/VMCore/Reader.h Sat Nov 27 04:07:18 2010 @@ -20,18 +20,35 @@ namespace j3 { class JnjvmBootstrapLoader; +class JnjvmClassLoader; class ZipArchive; + +class ClassBytes { + public: + ClassBytes(int l) { + size = l; + } + + void* operator new(size_t sz, mvm::BumpPtrAllocator& allocator, int n) { + return allocator.Allocate(sizeof(uint32_t) + n * sizeof(uint8_t), + "Class bytes"); + } + + uint32_t size; + uint8_t elements[1]; +}; + class Reader { public: // bytes - Pointer to a reference array. The array is not manipulated directly // in order to support copying GC. - ArrayUInt8** bytes; + ClassBytes* bytes; uint32 min; uint32 cursor; uint32 max; - Reader(Attribut* attr, ArrayUInt8** bytes) { + Reader(Attribut* attr, ClassBytes* bytes) { this->bytes = bytes; this->cursor = attr->start; this->min = attr->start; @@ -78,18 +95,18 @@ static const int SeekCur; static const int SeekEnd; - static ArrayUInt8* openFile(JnjvmBootstrapLoader* loader, const char* path); - static ArrayUInt8* openZip(JnjvmBootstrapLoader* loader, ZipArchive* archive, + static ClassBytes* openFile(JnjvmClassLoader* loader, const char* path); + static ClassBytes* openZip(JnjvmClassLoader* loader, ZipArchive* archive, const char* filename); uint8 readU1() { ++cursor; - return ArrayUInt8::getElement(*bytes, cursor - 1); + return bytes->elements[cursor - 1]; } sint8 readS1() { ++cursor; - return ArrayUInt8::getElement(*bytes, cursor - 1); + return bytes->elements[cursor - 1]; } uint16 readU2() { @@ -122,8 +139,8 @@ return tmp | ((sint64)(readU4())); } - Reader(ArrayUInt8** array, uint32 start = 0, uint32 end = 0) { - if (!end) end = ArrayUInt8::getSize(*array); + Reader(ClassBytes* array, uint32 start = 0, uint32 end = 0) { + if (!end) end = array->size; this->bytes = array; this->cursor = start; this->min = start; Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Sat Nov 27 04:07:18 2010 @@ -30,6 +30,7 @@ #include "Jnjvm.h" #include "JnjvmClassLoader.h" #include "LockedMap.h" +#include "ReferenceQueue.h" #include "Zip.h" using namespace j3; @@ -141,8 +142,7 @@ // (2) The delegatee object (java.lang.Class) if it exists. // // Additionaly, non-primitive and non-array classes must trace: -// (3) The bytes that represent the class file. -// (4) The static instance. +// (3) The static instance. //===----------------------------------------------------------------------===// void CommonClass::tracer(uintptr_t closure) { @@ -173,7 +173,6 @@ void Class::tracer(uintptr_t closure) { CommonClass::tracer(closure); - mvm::Collector::markAndTraceRoot(&bytes, closure); for (uint32 i = 0; i < NR_ISOLATES; ++i) { TaskClassMirror &M = IsolateInfo[i]; @@ -242,11 +241,6 @@ TRACE_DELEGATEE(upcalls->OfLong); TRACE_DELEGATEE(upcalls->OfDouble); #undef TRACE_DELEGATEE - - for (std::vector::iterator i = bootArchives.begin(), - e = bootArchives.end(); i != e; i++) { - mvm::Collector::markAndTraceRoot(&((*i)->bytes), closure); - } } //===----------------------------------------------------------------------===// @@ -264,15 +258,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 +277,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,24 +285,37 @@ 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 reference queue + for (uint32 i = 0; i < referenceThread->ToEnqueueIndex; ++i) { + mvm::Collector::markAndTraceRoot(referenceThread->ToEnqueue + i, closure); + } + // (7) Trace the locks and their associated object. 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) mvm::Collector::markAndTraceRoot(&JnjvmSharedLoader::sharedLoader, closure); #endif @@ -317,10 +326,9 @@ } void JavaThread::tracer(uintptr_t closure) { - if (pendingException != NULL) { - mvm::Collector::markAndTraceRoot(&pendingException, closure); - } + mvm::Collector::markAndTraceRoot(&pendingException, closure); mvm::Collector::markAndTraceRoot(&javaThread, closure); + mvm::Collector::markAndTraceRoot(&vmThread, closure); #ifdef SERVICE mvm::Collector::markAndTraceRoot(&ServiceException, closure); #endif Modified: vmkit/trunk/lib/J3/VMCore/Zip.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Zip.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Zip.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Zip.cpp Sat Nov 27 04:07:18 2010 @@ -17,8 +17,7 @@ using namespace j3; -ZipArchive::ZipArchive(ArrayUInt8* bytes, mvm::BumpPtrAllocator& A) : allocator(A) { - llvm_gcroot(bytes, 0); +ZipArchive::ZipArchive(ClassBytes* bytes, mvm::BumpPtrAllocator& A) : allocator(A) { this->bytes = bytes; findOfscd(); if (ofscd > -1) addFiles(); @@ -74,7 +73,7 @@ sint32 minOffs = 0; sint32 st = END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4; - Reader reader(&bytes); + Reader reader(bytes); curOffs = reader.max; if (curOffs >= (65535 + END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4)) { minOffs = curOffs - (65535 + END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4); @@ -104,8 +103,8 @@ if (searchPos >= st) { sint32 searchPtr = temp + (searchPos - st); while (searchPtr > temp) { - if (ArrayUInt8::getElement(bytes, searchPtr) == 'P' && - !(memcmp(ArrayUInt8::getElements(bytes) + searchPtr, HDR_ENDCENTRAL, 4))) { + if (bytes->elements[searchPtr] == 'P' && + !(memcmp(bytes->elements + searchPtr, HDR_ENDCENTRAL, 4))) { sint32 offset = searchPtr + 4 + E_OFFSET_START_CENTRAL_DIRECTORY; reader.cursor = offset; this->ofscd = readEndianDep4(reader); @@ -120,11 +119,11 @@ void ZipArchive::addFiles() { sint32 temp = ofscd; - Reader reader(&bytes); + Reader reader(bytes); reader.cursor = temp; while (true) { - if (memcmp(ArrayUInt8::getElements(bytes) + temp, HDR_CENTRAL, 4)) return; + if (memcmp(bytes->elements + temp, HDR_CENTRAL, 4)) return; ZipFile* ptr = new(allocator, "ZipFile") ZipFile(); reader.cursor = temp + 4 + C_COMPRESSION_METHOD; ptr->compressionMethod = readEndianDep2(reader); @@ -148,7 +147,7 @@ ptr->filename = (char*)allocator.Allocate(ptr->filenameLength + 1, "Zip file name"); - memcpy(ptr->filename, ArrayUInt8::getElements(bytes) + temp, + memcpy(ptr->filename, bytes->elements + temp, ptr->filenameLength); ptr->filename[ptr->filenameLength] = 0; @@ -161,17 +160,16 @@ } } -sint32 ZipArchive::readFile(ArrayUInt8* array, const ZipFile* file) { - llvm_gcroot(array, 0); +sint32 ZipArchive::readFile(ClassBytes* array, const ZipFile* file) { uint32 bytesLeft = 0; uint32 filenameLength = 0; uint32 extraFieldLength = 0; uint32 temp = 0; - Reader reader(&bytes); + Reader reader(bytes); reader.cursor = file->rolh; - if (!(memcmp(ArrayUInt8::getElements(bytes) + file->rolh, HDR_LOCAL, 4))) { + if (!(memcmp(bytes->elements + file->rolh, HDR_LOCAL, 4))) { reader.cursor += 4; temp = reader.cursor; reader.cursor += L_FILENAME_LENGTH; @@ -182,14 +180,14 @@ temp + extraFieldLength + filenameLength + LOCAL_FILE_HEADER_SIZE; if (file->compressionMethod == ZIP_STORE) { - memcpy(ArrayUInt8::getElements(array), ArrayUInt8::getElements(bytes) + reader.cursor, file->ucsize); + memcpy(array->elements, bytes->elements + reader.cursor, file->ucsize); return 1; } else if (file->compressionMethod == ZIP_DEFLATE) { z_stream stre; sint32 err = 0; bytesLeft = file->csize; - stre.next_out = (Bytef*)ArrayUInt8::getElements(array); + stre.next_out = (Bytef*)array->elements; stre.avail_out = file->ucsize; stre.zalloc = 0; stre.zfree = 0; @@ -202,7 +200,7 @@ while (bytesLeft) { uint32 size = 0; - stre.next_in = ArrayUInt8::getElements(bytes) + reader.cursor; + stre.next_in = bytes->elements + reader.cursor; if (bytesLeft > 1024) size = 1024; else size = bytesLeft; Modified: vmkit/trunk/lib/J3/VMCore/Zip.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Zip.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Zip.h (original) +++ vmkit/trunk/lib/J3/VMCore/Zip.h Sat Nov 27 04:07:18 2010 @@ -16,7 +16,7 @@ namespace j3 { -class ArrayUInt8; +class classBytes; class JnjvmBootstrapLoader; struct ZipFile : public mvm::PermanentObject { @@ -49,7 +49,7 @@ public: std::map filetable; typedef std::map::iterator table_iterator; - ArrayUInt8* bytes; + ClassBytes* bytes; private: @@ -70,9 +70,9 @@ } int getOfscd() { return ofscd; } - ZipArchive(ArrayUInt8* bytes, mvm::BumpPtrAllocator& allocator); + ZipArchive(ClassBytes* bytes, mvm::BumpPtrAllocator& allocator); ZipFile* getFile(const char* filename); - int readFile(ArrayUInt8* array, const ZipFile* file); + int readFile(ClassBytes* array, const ZipFile* file); }; Modified: vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp Sat Nov 27 04:07:18 2010 @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include +#include #include "MvmGC.h" #include "mvm/VirtualMachine.h" #include "mvm/Threads/CollectionRV.h" @@ -80,6 +81,13 @@ unlockRV(); } + +#if defined(__MACH__) +# define SIGGC SIGXCPU +#else +# define SIGGC SIGPWR +#endif + void UncooperativeCollectionRV::synchronize() { assert(nbJoined == 0); mvm::Thread* self = mvm::Thread::get(); @@ -89,7 +97,8 @@ for (mvm::Thread* cur = (mvm::Thread*)self->next(); cur != self; cur = (mvm::Thread*)cur->next()) { - cur->killForRendezvous(); + int res = cur->kill(SIGGC); + assert(!res && "Error on kill"); } // And wait for other threads to finish. @@ -154,7 +163,7 @@ th->inRV = false; } -void CooperativeCollectionRV::joinAfterUncooperative() { +void CooperativeCollectionRV::joinAfterUncooperative(void* SP) { mvm::Thread* th = mvm::Thread::get(); assert((th->getLastSP() == NULL) && "SP set after entering uncooperative code"); @@ -163,7 +172,7 @@ lockRV(); if (th->doYield) { - th->setLastSP(FRAME_PTR()); + th->setLastSP(SP); if (!th->joinedRV) { th->joinedRV = true; another_mark(); @@ -213,10 +222,36 @@ initiator->inRV = false; } -void UncooperativeCollectionRV::joinAfterUncooperative() { +void UncooperativeCollectionRV::joinAfterUncooperative(void* SP) { UNREACHABLE(); } void UncooperativeCollectionRV::joinBeforeUncooperative() { UNREACHABLE(); } + +void CooperativeCollectionRV::addThread(Thread* th) { + // Nothing to do. +} + +static void siggcHandler(int) { + mvm::Thread* th = mvm::Thread::get(); + th->MyVM->rendezvous.join(); +} + +void UncooperativeCollectionRV::addThread(Thread* th) { + // Set the SIGGC handler for uncooperative rendezvous. + struct sigaction sa; + sigset_t mask; + sigaction(SIGGC, 0, &sa); + sigfillset(&mask); + sa.sa_mask = mask; + sa.sa_handler = siggcHandler; + sa.sa_flags |= SA_RESTART; + sigaction(SIGGC, &sa, NULL); + + if (nbJoined != 0) { + // In uncooperative mode, we may have missed a signal. + join(); + } +} Modified: vmkit/trunk/lib/Mvm/CommonThread/Sigsegv.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/Sigsegv.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/Sigsegv.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/Sigsegv.cpp Sat Nov 27 04:07:18 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", (void*)th); } th->printBacktrace(); abort(); Modified: vmkit/trunk/lib/Mvm/CommonThread/ctlock.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctlock.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/ctlock.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/ctlock.cpp Sat Nov 27 04:07:18 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; - } -} Modified: vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Sat Nov 27 04:07:18 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; @@ -54,8 +56,8 @@ MyVM->rendezvous.joinBeforeUncooperative(); } -void Thread::joinRVAfterLeave() { - MyVM->rendezvous.joinAfterUncooperative(); +void Thread::joinRVAfterLeave(void* savedSP) { + MyVM->rendezvous.joinAfterUncooperative(savedSP); } void Thread::startKnownFrame(KnownFrame& F) { @@ -65,10 +67,29 @@ cur = (void**)cur[0]; F.previousFrame = lastKnownFrame; F.currentFP = cur; + // This is used as a marker. + F.currentIP = NULL; lastKnownFrame = &F; } void Thread::endKnownFrame() { + assert(lastKnownFrame->currentIP == NULL); + lastKnownFrame = lastKnownFrame->previousFrame; +} + +void Thread::startUnknownFrame(KnownFrame& F) { + // Get the caller of this function + void** cur = (void**)FRAME_PTR(); + // Get the caller of the caller. + cur = (void**)cur[0]; + F.previousFrame = lastKnownFrame; + F.currentFP = cur; + F.currentIP = FRAME_IP(cur); + lastKnownFrame = &F; +} + +void Thread::endUnknownFrame() { + assert(lastKnownFrame->currentIP != NULL); lastKnownFrame = lastKnownFrame->previousFrame; } @@ -153,22 +174,127 @@ } void StackWalker::operator++() { - if (addr < thread->baseSP && addr < addr[0]) { - if (frame && addr == frame->currentFP) { + if (addr != thread->baseSP) { + assert((addr < thread->baseSP) && "Corrupted stack"); + assert((addr < addr[0]) && "Corrupted stack"); + if ((frame != NULL) && (addr == frame->currentFP)) { + assert(frame->currentIP == NULL); + frame = frame->previousFrame; + assert(frame != NULL); + assert(frame->currentIP != NULL); + addr = (void**)frame->currentFP; frame = frame->previousFrame; - if (frame) { - addr = (void**)frame->currentFP; - frame = frame->previousFrame; - } else { - addr = (void**)addr[0]; - } } else { addr = (void**)addr[0]; } + } +} + +StackWalker::StackWalker(mvm::Thread* th) { + thread = th; + frame = th->lastKnownFrame; + if (mvm::Thread::get() == th) { + addr = (void**)FRAME_PTR(); + addr = (void**)addr[0]; + } else { + addr = (void**)th->waitOnSP(); + if (frame) { + assert(frame->currentFP >= addr); + } + if (frame && (addr == frame->currentFP)) { + frame = frame->previousFrame; + assert((frame == NULL) || (frame->currentIP == NULL)); + } + } + assert(addr && "No address to start with"); +} + + +#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(; curbaseSP; + jmp_buf buf; + setjmp(buf); + register unsigned int **cur = (unsigned int**)&buf; + for(; curMyVM->rendezvous.join(); -} - /// internalThreadStart - The initial function called by a thread. Sets some /// thread specific data, registers the thread to the GC and calls the /// given routine of th. /// void Thread::internalThreadStart(mvm::Thread* th) { - th->baseSP = (void*)&th; + th->baseSP = FRAME_PTR(); // Set the SIGSEGV handler to diagnose errors. struct sigaction sa; @@ -295,22 +409,14 @@ sa.sa_sigaction = sigsegvHandler; sigaction(SIGSEGV, &sa, NULL); - // Set the SIGGC handler for uncooperative rendezvous. - sigaction(SIGGC, 0, &sa); - sigfillset(&mask); - sa.sa_mask = mask; - sa.sa_handler = siggcHandler; - sa.sa_flags |= SA_RESTART; - sigaction(SIGGC, &sa, NULL); assert(th->MyVM && "VM not set in a thread"); #ifdef ISOLATE th->IsolateID = th->MyVM->IsolateID; #endif - th->MyVM->addThread(th); + th->MyVM->rendezvous.addThread(th); th->routine(th); th->MyVM->removeThread(th); - delete th; } @@ -323,6 +429,9 @@ pthread_attr_init(&attributs); pthread_attr_setstack(&attributs, this, STACK_SIZE); routine = fct; + // Make sure to add it in the list of threads before leaving this function: + // the garbage collector wants to trace this thread. + MyVM->addThread(this); int res = pthread_create((pthread_t*)(void*)(&internalThreadID), &attributs, (void* (*)(void *))internalThreadStart, this); pthread_detach((pthread_t)internalThreadID); @@ -346,18 +455,23 @@ res = (void*)TheStackManager.allocate(); } } + // Make sure the thread information is cleared. + memset(res, 0, sz); return res; } /// releaseThread - Remove the stack of the thread from the list of stacks /// in use. -void Thread::releaseThread(void* th) { +void Thread::releaseThread(mvm::Thread* th) { + // It seems like the pthread implementation in Linux is clearing with NULL + // the stack of the thread. So we have to get the thread id before + // calling pthread_join. + void* thread_id = th->internalThreadID; + if (thread_id != NULL) { + // Wait for the thread to die. + pthread_join((pthread_t)thread_id, NULL); + } uintptr_t index = ((uintptr_t)th & Thread::IDMask); index = (index & ~TheStackManager.baseAddr) >> 20; TheStackManager.used[index] = 0; } - -void Thread::killForRendezvous() { - int res = kill(SIGGC); - assert(!res && "Error on kill"); -} Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Sat Nov 27 04:07:18 2010 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "llvm/ExecutionEngine/JITEventListener.h" @@ -35,6 +36,7 @@ #include #include #include +#include <../lib/ExecutionEngine/JIT/JIT.h> #include "mvm/JIT.h" #include "mvm/Threads/Locks.h" @@ -83,7 +85,7 @@ } void MvmJITMethodInfo::print(void* ip, void* addr) { - fprintf(stderr, "; %p in %s LLVM method\n", ip, + fprintf(stderr, "; %p (%p) in %s LLVM method\n", ip, addr, ((llvm::Function*)MetaInfo)->getName().data()); } @@ -93,24 +95,33 @@ void *Code, size_t Size, const EmittedFunctionDetails &Details) { assert(F.getParent() == MvmModule::globalModule); - llvm::GCFunctionInfo* GFI = 0; + assert(F.hasGC()); // We know the last GC info is for this method. - if (F.hasGC()) { - GCStrategy::iterator I = mvm::MvmModule::TheGCStrategy->end(); - I--; - DEBUG(errs() << (*I)->getFunction().getName() << '\n'); - DEBUG(errs() << F.getName() << '\n'); - assert(&(*I)->getFunction() == &F && + GCStrategy::iterator I = mvm::MvmModule::TheGCStrategy->end(); + I--; + DEBUG(errs() << (*I)->getFunction().getName() << '\n'); + DEBUG(errs() << F.getName() << '\n'); + assert(&(*I)->getFunction() == &F && "GC Info and method do not correspond"); - GFI = *I; - } - MethodInfo* MI = - new(*MvmModule::Allocator, "MvmJITMethodInfo") MvmJITMethodInfo(GFI, &F); - VirtualMachine::SharedRuntimeFunctions.addMethodInfo(MI, Code, - (void*)((uintptr_t)Code + Size)); + llvm::GCFunctionInfo* GFI = *I; + JITMethodInfo* MI = new(*MvmModule::Allocator, "MvmJITMethodInfo") + MvmJITMethodInfo(GFI, &F, MvmModule::executionEngine); + MI->addToVM(mvm::Thread::get()->MyVM, (JIT*)MvmModule::executionEngine); } }; +void JITMethodInfo::addToVM(VirtualMachine* VM, JIT* jit) { + JITCodeEmitter* JCE = jit->getCodeEmitter(); + assert(GCInfo != NULL); + for (GCFunctionInfo::iterator I = GCInfo->begin(), E = GCInfo->end(); + I != E; + I++) { + uintptr_t address = JCE->getLabelAddress(I->Label); + assert(address != 0); + VM->FunctionsCache.addMethodInfo(this, (void*)address); + } +} + static MvmJITListener JITListener; void MvmModule::loadBytecodeFile(const std::string& str) { @@ -317,6 +328,7 @@ unconditionalSafePoint = module->getFunction("unconditionalSafePoint"); conditionalSafePoint = module->getFunction("conditionalSafePoint"); AllocateFunction = module->getFunction("gcmalloc"); + AllocateFunction->setGC("vmkit"); assert(AllocateFunction && "No allocate function"); AllocateUnresolvedFunction = module->getFunction("gcmallocUnresolved"); assert(AllocateUnresolvedFunction && "No allocateUnresolved function"); Modified: vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/VmkitGC.cpp Sat Nov 27 04:07:18 2010 @@ -32,5 +32,4 @@ VmkitGC::VmkitGC() { NeededSafePoints = 1 << GC::PostCall; - mvm::MvmModule::TheGCStrategy = this; } Modified: vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp Sat Nov 27 04:07:18 2010 @@ -33,18 +33,13 @@ 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(); th->MyVM->rendezvous.startRV(); th->MyVM->startCollection(); @@ -57,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); @@ -94,10 +89,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/trunk/lib/Mvm/MMTk/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h Sat Nov 27 04:07:18 2010 @@ -21,7 +21,7 @@ MutatorThread() : mvm::Thread() { MutatorContext = 0; } - mvm::BumpPtrAllocator Allocator; + mvm::ThreadAllocator Allocator; uintptr_t MutatorContext; /// realRoutine - The function to invoke when the thread starts. Modified: vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Sat Nov 27 04:07:18 2010 @@ -24,19 +24,11 @@ using namespace mvm; void CamlMethodInfo::scan(uintptr_t closure, void* ip, void* addr) { - if (!CF && InstructionPointer) { - MethodInfo* MI = VirtualMachine::SharedStaticFunctions.IPToMethodInfo(ip); - if (MI != &DefaultMethodInfo::DM) { - CF = ((CamlMethodInfo*)MI)->CF; - } - } - - if (CF) { - //uintptr_t spaddr = (uintptr_t)addr + CF->FrameSize + sizeof(void*); - uintptr_t spaddr = ((uintptr_t*)addr)[0]; - for (uint16 i = 0; i < CF->NumLiveOffsets; ++i) { - Collector::scanObject((void**)(spaddr + CF->LiveOffsets[i]), closure); - } + assert(CF != NULL); + //uintptr_t spaddr = (uintptr_t)addr + CF->FrameSize + sizeof(void*); + uintptr_t spaddr = ((uintptr_t*)addr)[0]; + for (uint16 i = 0; i < CF->NumLiveOffsets; ++i) { + Collector::scanObject((void**)(spaddr + CF->LiveOffsets[i]), closure); } } @@ -59,52 +51,6 @@ void DefaultMethodInfo::scan(uintptr_t closure, void* ip, void* addr) { } - -MethodInfo* StartFunctionMap::IPToMethodInfo(void* ip) { - FunctionMapLock.acquire(); - std::map::iterator E = Functions.end(); - std::map::iterator I = Functions.find(ip); - MethodInfo* MI = 0; - if (I == E) { - Dl_info info; - int res = dladdr(ip, &info); - if (res != 0) { - I = Functions.find(info.dli_saddr); - if (I == E) { - // The method is static, and we have no information for it. - // Just return the Default MethodInfo object. - MI = &DefaultMethodInfo::DM; - } else { - MI = I->second; - } - } else { - // The method is jitted, and no-one has intercepted its compilation. - // Just return the Default MethodInfo object. - MI = &DefaultMethodInfo::DM; - } - // Add it to the map, so that we don't need to call dladdr again. - Functions.insert(std::make_pair(ip, MI)); - } else { - MI = I->second; - } - FunctionMapLock.release(); - return MI; -} - -MethodInfo* VirtualMachine::IPToMethodInfo(void* ip) { - MethodInfo* MI = RuntimeFunctions.IPToMethodInfo(ip); - if (MI) return MI; - - MI = SharedRuntimeFunctions.IPToMethodInfo(ip); - if (MI) return MI; - - MI = StaticFunctions.IPToMethodInfo(ip); - if (MI != &DefaultMethodInfo::DM) return MI; - - MI = SharedStaticFunctions.IPToMethodInfo(ip); - return MI; -} - struct CamlFrames { uint16_t NumDescriptors; CamlFrame frames[1]; @@ -114,14 +60,11 @@ CamlFrames* frames ; uint32 currentDescriptor; CamlFrame* currentFrame; - Dl_info info; CamlFrameDecoder(CamlFrames* frames) { this->frames = frames; currentDescriptor = 0; currentFrame = &(frames->frames[0]); - int res = dladdr(currentFrame->ReturnAddress, &info); - assert(res != 0 && "No frame"); } bool hasNext() { @@ -135,55 +78,67 @@ (currentFrame->NumLiveOffsets % 2) * sizeof(uint16_t) + currentFrame->NumLiveOffsets * sizeof(uint16_t) + sizeof(void*) + sizeof(uint16_t) + sizeof(uint16_t)); - int res = dladdr(currentFrame->ReturnAddress, &info); - assert(res != 0 && "No frame"); } - CamlFrame* next(void** funcAddress, const char** funcName) { + CamlFrame* next() { assert(hasNext()); CamlFrame* result = currentFrame; - *funcAddress = info.dli_saddr; - *funcName = info.dli_sname; - - // Skip the remaining ones. - do { - advance(); - } while (hasNext() && (info.dli_saddr == *funcAddress)); - - // Skip the entries that start at another method. - while (hasNext() && (info.dli_saddr == currentFrame->ReturnAddress)) { - advance(); - } - - while (hasNext() && (info.dli_saddr == NULL)) { - advance(); - } + advance(); return result; } }; -void SharedStartFunctionMap::initialize() { +static BumpPtrAllocator* StaticAllocator = NULL; + +FunctionMap::FunctionMap() { CamlFrames* frames = (CamlFrames*)dlsym(SELF_HANDLE, "camlVmkitoptimized__frametable"); + if (frames == NULL) return; + StaticAllocator = new BumpPtrAllocator(); - const char* name = NULL; - void* address = NULL; + CamlFrameDecoder decoder(frames); + Dl_info info; + while (decoder.hasNext()) { + CamlFrame* frame = decoder.next(); + int res = dladdr(frame->ReturnAddress, &info); + assert(res != 0 && "No frame"); + StaticCamlMethodInfo* MI = new(*StaticAllocator, "StaticCamlMethodInfo") + StaticCamlMethodInfo(frame, info.dli_sname); + addMethodInfo(MI, frame->ReturnAddress); + } +} - if (frames != NULL) { - CamlFrameDecoder decoder(frames); - while (decoder.hasNext()) { - CamlFrame* frame = decoder.next(&address, &name); - StaticCamlMethodInfo* MI = new(*StaticAllocator, "StaticCamlMethodInfo") - StaticCamlMethodInfo(frame, address, name); - addMethodInfo(MI, address); - } +MethodInfo* FunctionMap::IPToMethodInfo(void* ip) { + FunctionMapLock.acquire(); + std::map::iterator I = Functions.find(ip); + MethodInfo* res = NULL; + if (I != Functions.end()) { + res = I->second; + } else { + res = &DefaultMethodInfo::DM; } + FunctionMapLock.release(); + return res; } -CamlMethodInfo::CamlMethodInfo(CamlFrame* C, void* ip) { - InstructionPointer = ip; - CF = C; +void FunctionMap::addMethodInfo(MethodInfo* meth, void* ip) { + FunctionMapLock.acquire(); + Functions.insert(std::make_pair(ip, meth)); + FunctionMapLock.release(); } -StartEndFunctionMap VirtualMachine::SharedRuntimeFunctions; -SharedStartFunctionMap VirtualMachine::SharedStaticFunctions; + +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; + temp = i; + i++; + if (MI->Owner == owner) { + Functions.erase(temp); + } + } + FunctionMapLock.release(); +} Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Sat Nov 27 04:07:18 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,222 +54,3 @@ buf->writePtr((void*)o); 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); - - 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(; curStructTy_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_gcRoot_fields; -StructTy_struct_gcRoot_fields.push_back(PointerTy_5); -StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); -mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); +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_gcRoot, 0); +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; @@ -102,60 +102,9 @@ 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; -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__CooperativeCollectionRV_fields; +std::vectorStructTy_struct_mvm__CollectionRV_fields; +StructTy_struct_mvm__CollectionRV_fields.push_back(PointerTy_5); std::vectorStructTy_struct_mvm__LockNormal_fields; std::vectorStructTy_struct_mvm__Lock_fields; StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5); @@ -183,26 +132,43 @@ 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__CollectionRV_fields; StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__LockNormal); +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_14 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1); + +StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_14); +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__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)); -StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 8)); -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__VirtualMachine_fields.push_back(StructTy_struct_mvm__CollectionRV); -std::vectorStructTy_struct_mvm__StartEndFunctionMap_fields; +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__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; @@ -216,11 +182,11 @@ 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); +PointerType* PointerTy_15 = 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); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); 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); @@ -245,12 +211,7 @@ 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); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__FunctionMap); 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); @@ -263,41 +224,42 @@ 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( +std::vectorFuncTy_17_args; +FuncTy_17_args.push_back(PointerTy_13); +FunctionType* FuncTy_17 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_19_args, + /*Params=*/FuncTy_17_args, /*isVarArg=*/false); -PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); +PointerType* PointerTy_16 = PointerType::get(FuncTy_17, 0); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_16); 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); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); +PATypeHolder PointerTy_18_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_18_fwd); 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()); +PointerType* PointerTy_18 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0); +cast(PointerTy_18_fwd.get())->refineAbstractTypeTo(PointerTy_18); +PointerTy_18 = cast(PointerTy_18_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; -PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd); +PATypeHolder PointerTy_19_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_19_fwd); std::vectorStructTy_struct___jmp_buf_tag_fields; -ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); +ArrayType* ArrayTy_21 = 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(ArrayTy_21); 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); +ArrayType* ArrayTy_22 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); -StructTy_struct___sigset_t_fields.push_back(ArrayTy_24); +StructTy_struct___sigset_t_fields.push_back(ArrayTy_22); 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); @@ -305,18 +267,18 @@ 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); +ArrayType* ArrayTy_20 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_20); 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()); +PointerType* PointerTy_19 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); +cast(PointerTy_19_fwd.get())->refineAbstractTypeTo(PointerTy_19); +PointerTy_19 = cast(PointerTy_19_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_19); 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); @@ -324,55 +286,70 @@ StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread); -StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator); +std::vectorStructTy_struct_mvm__ThreadAllocator_fields; +StructTy_struct_mvm__ThreadAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator); +StructType* StructTy_struct_mvm__ThreadAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__ThreadAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ThreadAllocator", StructTy_struct_mvm__ThreadAllocator); + +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__ThreadAllocator); StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_16); 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); +PointerType* PointerTy_23 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); std::vectorStructTy_struct_j3__JavaObject_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); + StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_gc); -StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_mvm__SpinLock); 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); +PointerType* PointerTy_24 = 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_29 = PointerType::get(ArrayTy_VT, 0); +PointerType* PointerTy_27 = PointerType::get(ArrayTy_VT, 0); -StructTy_JavaObject_fields.push_back(PointerTy_29); +StructTy_JavaObject_fields.push_back(PointerTy_27); 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_28 = PointerType::get(StructTy_JavaObject, 0); +PointerType* PointerTy_26 = PointerType::get(StructTy_JavaObject, 0); -PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); +PointerType* PointerTy_25 = PointerType::get(PointerTy_26, 0); -PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); +PointerType* PointerTy_28 = PointerType::get(PointerTy_0, 0); -PointerType* PointerTy_31 = PointerType::get(PointerTy_29, 0); +PointerType* PointerTy_29 = PointerType::get(PointerTy_27, 0); -std::vectorFuncTy_33_args; -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(PointerTy_28); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_33 = FunctionType::get( - /*Result=*/PointerTy_28, - /*Params=*/FuncTy_33_args, +std::vectorFuncTy_31_args; +FuncTy_31_args.push_back(PointerTy_26); +FuncTy_31_args.push_back(PointerTy_26); +FuncTy_31_args.push_back(PointerTy_26); +FuncTy_31_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_31_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_31 = FunctionType::get( + /*Result=*/PointerTy_26, + /*Params=*/FuncTy_31_args, /*isVarArg=*/false); -PointerType* PointerTy_32 = PointerType::get(FuncTy_33, 0); +PointerType* PointerTy_30 = PointerType::get(FuncTy_31, 0); // Function Declarations @@ -394,10 +371,11 @@ func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( - /*Type=*/FuncTy_33, + /*Type=*/FuncTy_31, /*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); +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; { SmallVector Attrs; @@ -412,13 +390,13 @@ // Global Variable Declarations // Constant Definitions -ConstantInt* const_int32_34 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -ConstantInt* const_int32_35 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); -ConstantInt* const_int32_36 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); -ConstantInt* const_int32_37 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); -ConstantInt* const_int32_38 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); -ConstantInt* const_int32_39 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); -ConstantInt* const_int32_40 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantInt* const_int32_32 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_33 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_34 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_35 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_36 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_37 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_38 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); // Global Variable Definitions @@ -427,6 +405,7 @@ /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"gcmalloc", mod); func_gcmalloc->setCallingConv(CallingConv::C); +func_gcmalloc->setGC("vmkit"); AttrListPtr func_gcmalloc_PAL; { SmallVector Attrs; @@ -449,94 +428,94 @@ 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_41 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_34, "", label_entry); -BinaryOperator* int32_42 = BinaryOperator::Create(Instruction::And, int32_41, const_int32_35, "", label_entry); -CallInst* ptr_43 = CallInst::Create(func_llvm_frameaddress, const_int32_36, "", label_entry); -ptr_43->setCallingConv(CallingConv::C); -ptr_43->setTailCall(true); -AttrListPtr ptr_43_PAL; +BinaryOperator* int32_39 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_32, "", label_entry); +BinaryOperator* int32_40 = BinaryOperator::Create(Instruction::And, int32_39, const_int32_33, "", label_entry); +CallInst* ptr_41 = CallInst::Create(func_llvm_frameaddress, const_int32_34, "", label_entry); +ptr_41->setCallingConv(CallingConv::C); +ptr_41->setTailCall(true); +AttrListPtr ptr_41_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_43_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_41_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_43->setAttributes(ptr_43_PAL); +ptr_41->setAttributes(ptr_41_PAL); -CastInst* int32_44 = new PtrToIntInst(ptr_43, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_45 = BinaryOperator::Create(Instruction::And, int32_44, const_int32_37, "", label_entry); -CastInst* ptr_46 = new IntToPtrInst(int32_45, PointerTy_4, "", label_entry); -std::vector ptr_47_indices; -ptr_47_indices.push_back(const_int32_36); -ptr_47_indices.push_back(const_int32_38); -Instruction* ptr_47 = GetElementPtrInst::Create(ptr_46, ptr_47_indices.begin(), ptr_47_indices.end(), "", label_entry); -LoadInst* int32_48 = new LoadInst(ptr_47, "", false, label_entry); -CastInst* ptr_49 = new IntToPtrInst(int32_48, PointerTy_26, "", label_entry); -GetElementPtrInst* ptr_50 = GetElementPtrInst::Create(ptr_49, const_int32_39, "", label_entry); -CastInst* ptr_51 = new BitCastInst(ptr_50, PointerTy_27, "", label_entry); -LoadInst* ptr_52 = new LoadInst(ptr_51, "", false, label_entry); -GetElementPtrInst* ptr_53 = GetElementPtrInst::Create(ptr_52, const_int32_40, "", label_entry); -CastInst* ptr_54 = new BitCastInst(ptr_53, PointerTy_27, "", label_entry); -LoadInst* ptr_55 = new LoadInst(ptr_54, "", false, label_entry); -CastInst* int32_56 = new PtrToIntInst(ptr_55, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_57 = BinaryOperator::Create(Instruction::Add, int32_56, int32_42, "", label_entry); -CastInst* ptr_58 = new IntToPtrInst(int32_57, PointerTy_28, "", label_entry); -std::vector ptr_59_indices; -ptr_59_indices.push_back(const_int32_40); -ptr_59_indices.push_back(const_int32_40); -Instruction* ptr_59 = GetElementPtrInst::Create(ptr_52, ptr_59_indices.begin(), ptr_59_indices.end(), "", label_entry); -LoadInst* ptr_60 = new LoadInst(ptr_59, "", false, label_entry); -CastInst* ptr_61 = new BitCastInst(ptr_60, PointerTy_28, "", label_entry); -ICmpInst* int1_62 = new ICmpInst(*label_entry, ICmpInst::ICMP_UGT, ptr_58, ptr_61, ""); -BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_62, label_entry); +CastInst* int32_42 = new PtrToIntInst(ptr_41, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_43 = BinaryOperator::Create(Instruction::And, int32_42, const_int32_35, "", label_entry); +CastInst* ptr_44 = new IntToPtrInst(int32_43, PointerTy_4, "", label_entry); +std::vector ptr_45_indices; +ptr_45_indices.push_back(const_int32_34); +ptr_45_indices.push_back(const_int32_36); +Instruction* ptr_45 = GetElementPtrInst::Create(ptr_44, ptr_45_indices.begin(), ptr_45_indices.end(), "", label_entry); +LoadInst* int32_46 = new LoadInst(ptr_45, "", false, label_entry); +CastInst* ptr_47 = new IntToPtrInst(int32_46, PointerTy_24, "", label_entry); +GetElementPtrInst* ptr_48 = GetElementPtrInst::Create(ptr_47, const_int32_37, "", label_entry); +CastInst* ptr_49 = new BitCastInst(ptr_48, PointerTy_25, "", label_entry); +LoadInst* ptr_50 = new LoadInst(ptr_49, "", false, label_entry); +GetElementPtrInst* ptr_51 = GetElementPtrInst::Create(ptr_50, const_int32_38, "", label_entry); +CastInst* ptr_52 = new BitCastInst(ptr_51, PointerTy_25, "", label_entry); +LoadInst* ptr_53 = new LoadInst(ptr_52, "", false, label_entry); +CastInst* int32_54 = new PtrToIntInst(ptr_53, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_55 = BinaryOperator::Create(Instruction::Add, int32_54, int32_40, "", label_entry); +CastInst* ptr_56 = new IntToPtrInst(int32_55, PointerTy_26, "", label_entry); +std::vector ptr_57_indices; +ptr_57_indices.push_back(const_int32_38); +ptr_57_indices.push_back(const_int32_38); +Instruction* ptr_57 = GetElementPtrInst::Create(ptr_50, ptr_57_indices.begin(), ptr_57_indices.end(), "", label_entry); +LoadInst* ptr_58 = new LoadInst(ptr_57, "", false, label_entry); +CastInst* ptr_59 = new BitCastInst(ptr_58, PointerTy_26, "", label_entry); +ICmpInst* int1_60 = new ICmpInst(*label_entry, ICmpInst::ICMP_UGT, ptr_56, ptr_59, ""); +BranchInst::Create(label_false_IFEQ_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i, int1_60, label_entry); // Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i) -std::vector ptr_64_indices; -ptr_64_indices.push_back(const_int32_40); -ptr_64_indices.push_back(const_int32_36); -Instruction* ptr_64 = GetElementPtrInst::Create(ptr_52, ptr_64_indices.begin(), ptr_64_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_57, PointerTy_29, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); - new StoreInst(ptr__c_i_i_i, ptr_64, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +std::vector ptr_62_indices; +ptr_62_indices.push_back(const_int32_38); +ptr_62_indices.push_back(const_int32_34); +Instruction* ptr_62 = GetElementPtrInst::Create(ptr_50, ptr_62_indices.begin(), ptr_62_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_55, PointerTy_27, ".c.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); + new StoreInst(ptr__c_i_i_i, ptr_62, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); // Block false IFEQ.i.i.i (label_false_IFEQ_i_i_i) -std::vector ptr_67_params; -ptr_67_params.push_back(ptr_52); -ptr_67_params.push_back(ptr_55); -ptr_67_params.push_back(ptr_58); -ptr_67_params.push_back(const_int32_36); -ptr_67_params.push_back(const_int32_36); -CallInst* ptr_67 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_67_params.begin(), ptr_67_params.end(), "", label_false_IFEQ_i_i_i); -ptr_67->setCallingConv(CallingConv::C); -ptr_67->setTailCall(true); -AttrListPtr ptr_67_PAL; +std::vector ptr_65_params; +ptr_65_params.push_back(ptr_50); +ptr_65_params.push_back(ptr_53); +ptr_65_params.push_back(ptr_56); +ptr_65_params.push_back(const_int32_34); +ptr_65_params.push_back(const_int32_34); +CallInst* ptr_65 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_65_params.begin(), ptr_65_params.end(), "", label_false_IFEQ_i_i_i); +ptr_65->setCallingConv(CallingConv::C); +ptr_65->setTailCall(true); +AttrListPtr ptr_65_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_67_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_65_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_67->setAttributes(ptr_67_PAL); +ptr_65->setAttributes(ptr_65_PAL); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFEQ_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_69 = PHINode::Create(PointerTy_28, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -ptr_69->reserveOperandSpace(2); -ptr_69->addIncoming(ptr_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -ptr_69->addIncoming(ptr_67, label_false_IFEQ_i_i_i); - -std::vector ptr_70_indices; -ptr_70_indices.push_back(const_int32_36); -ptr_70_indices.push_back(const_int32_36); -Instruction* ptr_70 = GetElementPtrInst::Create(ptr_69, ptr_70_indices.begin(), ptr_70_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_29, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); - new StoreInst(ptr__c_i, ptr_70, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -CastInst* ptr_tmp1 = new BitCastInst(ptr_69, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +PHINode* ptr_67 = PHINode::Create(PointerTy_26, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_67->reserveOperandSpace(2); +ptr_67->addIncoming(ptr_53, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +ptr_67->addIncoming(ptr_65, label_false_IFEQ_i_i_i); + +std::vector ptr_68_indices; +ptr_68_indices.push_back(const_int32_34); +ptr_68_indices.push_back(const_int32_34); +Instruction* ptr_68 = GetElementPtrInst::Create(ptr_67, ptr_68_indices.begin(), ptr_68_indices.end(), "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_27, ".c.i", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); + new StoreInst(ptr__c_i, ptr_68, false, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr_tmp1 = new BitCastInst(ptr_67, 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); return func_gcmalloc; } Modified: vmkit/trunk/mmtk/config/copyms/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/copyms/ObjectHeader.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/copyms/ObjectHeader.h (original) +++ vmkit/trunk/mmtk/config/copyms/ObjectHeader.h Sat Nov 27 04:07:18 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/trunk/mmtk/config/marksweep/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Sat Nov 27 04:07:18 2010 @@ -102,66 +102,9 @@ 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__CooperativeCollectionRV_fields; +std::vectorStructTy_struct_mvm__CollectionRV_fields; +StructTy_struct_mvm__CollectionRV_fields.push_back(PointerTy_5); std::vectorStructTy_struct_mvm__LockNormal_fields; std::vectorStructTy_struct_mvm__Lock_fields; StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5); @@ -189,18 +132,32 @@ 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); +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_14 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1); + +StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_14); +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__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)); @@ -212,7 +169,6 @@ 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; @@ -226,11 +182,11 @@ 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); +PointerType* PointerTy_15 = 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); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); +StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_15); 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); @@ -255,12 +211,7 @@ 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); +StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__FunctionMap); 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); @@ -273,41 +224,42 @@ 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( +std::vectorFuncTy_17_args; +FuncTy_17_args.push_back(PointerTy_13); +FunctionType* FuncTy_17 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_19_args, + /*Params=*/FuncTy_17_args, /*isVarArg=*/false); -PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); +PointerType* PointerTy_16 = PointerType::get(FuncTy_17, 0); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_16); 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); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); +PATypeHolder PointerTy_18_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_18_fwd); 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()); +PointerType* PointerTy_18 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0); +cast(PointerTy_18_fwd.get())->refineAbstractTypeTo(PointerTy_18); +PointerTy_18 = cast(PointerTy_18_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; -PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd); +PATypeHolder PointerTy_19_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_19_fwd); std::vectorStructTy_struct___jmp_buf_tag_fields; -ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); +ArrayType* ArrayTy_21 = 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(ArrayTy_21); 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); +ArrayType* ArrayTy_22 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); -StructTy_struct___sigset_t_fields.push_back(ArrayTy_24); +StructTy_struct___sigset_t_fields.push_back(ArrayTy_22); 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); @@ -315,18 +267,18 @@ 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); +ArrayType* ArrayTy_20 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_20); 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()); +PointerType* PointerTy_19 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); +cast(PointerTy_19_fwd.get())->refineAbstractTypeTo(PointerTy_19); +PointerTy_19 = cast(PointerTy_19_fwd.get()); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21); +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_19); 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); @@ -334,166 +286,182 @@ StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread); -StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator); +std::vectorStructTy_struct_mvm__ThreadAllocator_fields; +StructTy_struct_mvm__ThreadAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator); +StructType* StructTy_struct_mvm__ThreadAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__ThreadAllocator_fields, /*isPacked=*/false); +mod->addTypeName("struct.mvm::ThreadAllocator", StructTy_struct_mvm__ThreadAllocator); + +StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__ThreadAllocator); StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18); +StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_16); 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); +PointerType* PointerTy_23 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); std::vectorStructTy_struct_j3__JavaObject_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); + 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); +PointerType* PointerTy_24 = 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_29 = PointerType::get(ArrayTy_VT, 0); +PointerType* PointerTy_27 = PointerType::get(ArrayTy_VT, 0); -StructTy_JavaObject_fields.push_back(PointerTy_29); +StructTy_JavaObject_fields.push_back(PointerTy_27); 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_28 = PointerType::get(StructTy_JavaObject, 0); +PointerType* PointerTy_26 = PointerType::get(StructTy_JavaObject, 0); -PointerType* PointerTy_27 = PointerType::get(PointerTy_28, 0); +PointerType* PointerTy_25 = PointerType::get(PointerTy_26, 0); -PointerType* PointerTy_30 = PointerType::get(PointerTy_0, 0); +PointerType* PointerTy_28 = 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, +std::vectorFuncTy_30_args; +FuncTy_30_args.push_back(PointerTy_26); +FuncTy_30_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_30_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_30_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_30 = FunctionType::get( + /*Result=*/PointerTy_26, + /*Params=*/FuncTy_30_args, /*isVarArg=*/false); -PointerType* PointerTy_31 = PointerType::get(FuncTy_32, 0); +PointerType* PointerTy_29 = PointerType::get(FuncTy_30, 0); -PointerType* PointerTy_33 = PointerType::get(PointerTy_29, 0); +PointerType* PointerTy_31 = PointerType::get(PointerTy_27, 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, +std::vectorFuncTy_33_args; +FuncTy_33_args.push_back(PointerTy_26); +FuncTy_33_args.push_back(PointerTy_26); +FuncTy_33_args.push_back(PointerTy_26); +FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_33_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_33 = FunctionType::get( + /*Result=*/PointerTy_26, + /*Params=*/FuncTy_33_args, /*isVarArg=*/false); -PointerType* PointerTy_34 = PointerType::get(FuncTy_35, 0); +PointerType* PointerTy_32 = PointerType::get(FuncTy_33, 0); +std::vectorStructTy_35_fields; +std::vectorStructTy_36_fields; std::vectorStructTy_37_fields; -std::vectorStructTy_38_fields; +StructTy_37_fields.push_back(StructTy_JavaObject); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_37_fields.push_back(PointerTy_26); +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(IntegerType::get(mod->getContext(), 8)); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(PointerTy_26); +StructTy_37_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_37 = StructType::get(mod->getContext(), StructTy_37_fields, /*isPacked=*/false); + +StructTy_36_fields.push_back(StructTy_37); +StructType* StructTy_36 = StructType::get(mod->getContext(), StructTy_36_fields, /*isPacked=*/false); + +StructTy_35_fields.push_back(StructTy_36); +StructTy_35_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_35_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_35_fields.push_back(PointerTy_26); +StructType* StructTy_35 = StructType::get(mod->getContext(), StructTy_35_fields, /*isPacked=*/false); + +PointerType* PointerTy_34 = PointerType::get(StructTy_35, 0); + 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); +std::vectorStructTy_40_fields; +StructTy_40_fields.push_back(StructTy_37); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructTy_40_fields.push_back(PointerTy_26); +StructType* StructTy_40 = StructType::get(mod->getContext(), StructTy_40_fields, /*isPacked=*/false); + +StructTy_39_fields.push_back(StructTy_40); 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); +PointerType* PointerTy_38 = PointerType::get(StructTy_39, 0); -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); +StructTy_42_fields.push_back(StructTy_37); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8)); 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_41 = PointerType::get(StructTy_42, 0); -PointerType* PointerTy_43 = PointerType::get(StructTy_44, 0); - -std::vectorFuncTy_46_args; -FunctionType* FuncTy_46 = FunctionType::get( +std::vectorFuncTy_44_args; +FunctionType* FuncTy_44 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_46_args, + /*Params=*/FuncTy_44_args, /*isVarArg=*/false); -PointerType* PointerTy_45 = PointerType::get(FuncTy_46, 0); +PointerType* PointerTy_43 = PointerType::get(FuncTy_44, 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); +std::vectorStructTy_46_fields; +StructTy_46_fields.push_back(PointerTy_26); +StructTy_46_fields.push_back(PointerTy_26); +StructTy_46_fields.push_back(PointerTy_26); +StructTy_46_fields.push_back(PointerTy_26); +StructType* StructTy_46 = StructType::get(mod->getContext(), StructTy_46_fields, /*isPacked=*/false); + +PointerType* PointerTy_45 = PointerType::get(StructTy_46, 0); + +std::vectorFuncTy_48_args; +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_48_args.push_back(IntegerType::get(mod->getContext(), 1)); +FunctionType* FuncTy_48 = FunctionType::get( + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_48_args, + /*isVarArg=*/false); -PointerType* PointerTy_47 = PointerType::get(StructTy_48, 0); +PointerType* PointerTy_47 = PointerType::get(FuncTy_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)); +FuncTy_50_args.push_back(PointerTy_23); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_50_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_50 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), + /*Result=*/IntegerType::get(mod->getContext(), 32), /*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 @@ -514,10 +482,11 @@ func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create( - /*Type=*/FuncTy_32, + /*Type=*/FuncTy_30, /*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); +func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL; { SmallVector Attrs; @@ -530,10 +499,11 @@ 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, + /*Type=*/FuncTy_33, /*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); +func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; { SmallVector Attrs; @@ -546,10 +516,11 @@ 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, + /*Type=*/FuncTy_30, /*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); +func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setGC("vmkit"); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL; { SmallVector Attrs; @@ -561,24 +532,24 @@ } 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, +Function* func_abort = Function::Create( + /*Type=*/FuncTy_44, /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"llvm.trap", mod); // (external, no body) -func_llvm_trap->setCallingConv(CallingConv::C); -AttrListPtr func_llvm_trap_PAL; + /*Name=*/"abort", mod); // (external, no body) +func_abort->setCallingConv(CallingConv::C); +AttrListPtr func_abort_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; Attrs.push_back(PAWI); - func_llvm_trap_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -func_llvm_trap->setAttributes(func_llvm_trap_PAL); +func_abort->setAttributes(func_abort_PAL); Function* func_llvm_memory_barrier = Function::Create( - /*Type=*/FuncTy_50, + /*Type=*/FuncTy_48, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.memory.barrier", mod); // (external, no body) func_llvm_memory_barrier->setCallingConv(CallingConv::C); @@ -594,7 +565,7 @@ func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL); Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create( - /*Type=*/FuncTy_52, + /*Type=*/FuncTy_50, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.atomic.cmp.swap.i32.p0i32", mod); // (external, no body) func_llvm_atomic_cmp_swap_i32_p0i32->setCallingConv(CallingConv::C); @@ -612,7 +583,7 @@ func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL); Function* func__ZN3mvm6Thread5yieldEv = Function::Create( - /*Type=*/FuncTy_46, + /*Type=*/FuncTy_44, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C); @@ -622,124 +593,125 @@ // Global Variable Declarations GlobalVariable* gvar_struct_finalObject32 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_37, +/*Type=*/StructTy_35, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject32"); GlobalVariable* gvar_struct_finalObject101 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_37, +/*Type=*/StructTy_35, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject101"); GlobalVariable* gvar_struct_finalObject122 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_41, +/*Type=*/StructTy_39, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject122"); GlobalVariable* gvar_struct_finalObject67 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_41, +/*Type=*/StructTy_39, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject67"); GlobalVariable* gvar_struct_finalObject2 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_44, +/*Type=*/StructTy_42, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject2"); GlobalVariable* gvar_struct_finalObject85 = new GlobalVariable(/*Module=*/*mod, -/*Type=*/StructTy_41, +/*Type=*/StructTy_39, /*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, +/*Type=*/StructTy_46, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"org_mmtk_utility_DoublyLinkedList_static"); // Constant Definitions -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)); +ConstantInt* const_int32_51 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_52 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_53 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_55 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_56 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8193"), 10)); +ConstantInt* const_int32_57 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("4"), 10)); +ConstantInt* const_int32_58 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("7"), 10)); +ConstantInt* const_int32_59 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8"), 10)); +ConstantInt* const_int32_60 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-1"), 10)); +ConstantInt* const_int32_61 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("63"), 10)); +ConstantInt* const_int32_62 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("127"), 10)); +ConstantInt* const_int32_63 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("255"), 10)); +ConstantInt* const_int32_64 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("511"), 10)); +ConstantInt* const_int32_65 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2047"), 10)); +ConstantInt* const_int32_66 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("10"), 10)); +ConstantInt* const_int32_67 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("32"), 10)); +ConstantInt* const_int32_68 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("12"), 10)); +ConstantInt* const_int32_69 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_70 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("16"), 10)); +ConstantInt* const_int32_71 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("6"), 10)); +ConstantInt* const_int32_72 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("20"), 10)); +ConstantInt* const_int32_73 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10)); +ConstantInt* const_int32_74 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantPointerNull* const_ptr_75 = ConstantPointerNull::get(PointerTy_27); +ConstantInt* const_int8_76 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("-4"), 10)); +std::vector const_ptr_77_indices; +const_ptr_77_indices.push_back(const_int32_53); +const_ptr_77_indices.push_back(const_int32_74); +Constant* const_ptr_77 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_77_indices[0], const_ptr_77_indices.size()); +ConstantInt* const_int8_78 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("2"), 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); +const_ptr_79_indices.push_back(const_int32_53); +const_ptr_79_indices.push_back(const_int32_51); 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); +ConstantInt* const_int32_80 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); +ConstantPointerNull* const_ptr_81 = ConstantPointerNull::get(PointerTy_0); +std::vector const_ptr_82_indices; +const_ptr_82_indices.push_back(const_int32_53); +const_ptr_82_indices.push_back(const_int32_74); +Constant* const_ptr_82 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_82_indices[0], const_ptr_82_indices.size()); +std::vector const_ptr_83_indices; +const_ptr_83_indices.push_back(const_int32_53); +const_ptr_83_indices.push_back(const_int32_51); +Constant* const_ptr_83 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_83_indices[0], const_ptr_83_indices.size()); std::vector const_ptr_84_indices; +const_ptr_84_indices.push_back(const_int32_53); 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()); +Constant* const_ptr_84 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject122, &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()); +const_ptr_85_indices.push_back(const_int32_55); +Constant* const_ptr_85 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject67, &const_ptr_85_indices[0], const_ptr_85_indices.size()); +ConstantInt* const_int8_86 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("1"), 10)); 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)); +const_ptr_87_indices.push_back(const_int32_53); +const_ptr_87_indices.push_back(const_int32_74); +Constant* const_ptr_87 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject2, &const_ptr_87_indices[0], const_ptr_87_indices.size()); +std::vector const_ptr_88_indices; +const_ptr_88_indices.push_back(const_int32_53); +const_ptr_88_indices.push_back(const_int32_55); +Constant* const_ptr_88 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject85, &const_ptr_88_indices[0], const_ptr_88_indices.size()); std::vector const_ptr_89_indices; +const_ptr_89_indices.push_back(const_int32_53); 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)); +Constant* const_ptr_89 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_89_indices[0], const_ptr_89_indices.size()); +ConstantPointerNull* const_ptr_90 = ConstantPointerNull::get(PointerTy_26); +ConstantInt* const_int8_91 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("0"), 10)); +ConstantInt* const_int32_92 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); +ConstantInt* const_int1_93 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10)); // Global Variable Definitions @@ -748,6 +720,7 @@ /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"gcmalloc", mod); func_gcmalloc->setCallingConv(CallingConv::C); +func_gcmalloc->setGC("vmkit"); AttrListPtr func_gcmalloc_PAL; { SmallVector Attrs; @@ -818,1098 +791,1168 @@ 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_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.GOTO or IF*1_crit_edge.i3.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_1_i5_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i5.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL_i7_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i7.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_Java_org_j3_mmtk_Lock_acquire___exit25_i = BasicBlock::Create(mod->getContext(), "Java_org_j3_mmtk_Lock_acquire__.exit25.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i9_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i9.i.i.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL3_i10_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i10.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_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i8_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.GOTO or IF*1_crit_edge.i3.i.i8.i.i.i",func_gcmalloc,0); +BasicBlock* label_GOTO_or_IF_1_i5_i_i10_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i5.i.i10.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL_i7_i_i11_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i7.i.i11.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_Java_org_j3_mmtk_Lock_acquire___exit_i = BasicBlock::Create(mod->getContext(), "Java_org_j3_mmtk_Lock_acquire__.exit.i",func_gcmalloc,0); +BasicBlock* label_false_IFNE_i9_i_i13_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i9.i.i13.i.i.i",func_gcmalloc,0); +BasicBlock* label_true_IFNULL3_i10_i_i14_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i10.i.i14.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_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; +BinaryOperator* int32_94 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_51, "", label_entry); +BinaryOperator* int32_95 = BinaryOperator::Create(Instruction::And, int32_94, const_int32_52, "", label_entry); +CallInst* ptr_96 = CallInst::Create(func_llvm_frameaddress, const_int32_53, "", label_entry); +ptr_96->setCallingConv(CallingConv::C); +ptr_96->setTailCall(true); +AttrListPtr ptr_96_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); + ptr_96_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_96->setAttributes(ptr_96_PAL); + +CastInst* int32_97 = new PtrToIntInst(ptr_96, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_98 = BinaryOperator::Create(Instruction::And, int32_97, const_int32_54, "", label_entry); +CastInst* ptr_99 = new IntToPtrInst(int32_98, PointerTy_4, "", label_entry); +std::vector ptr_100_indices; +ptr_100_indices.push_back(const_int32_53); +ptr_100_indices.push_back(const_int32_55); +Instruction* ptr_100 = GetElementPtrInst::Create(ptr_99, ptr_100_indices.begin(), ptr_100_indices.end(), "", label_entry); +LoadInst* int32_101 = new LoadInst(ptr_100, "", false, label_entry); +CastInst* ptr_102 = new IntToPtrInst(int32_101, PointerTy_24, "", label_entry); +ICmpInst* int1_103 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_95, const_int32_56, ""); +SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_103, const_int32_53, const_int32_57, "storemerge.i.i", label_entry); +SwitchInst* void_104 = SwitchInst::Create(int32_storemerge_i_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, 7, label_entry); +void_104->addCase(const_int32_53, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +void_104->addCase(const_int32_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +void_104->addCase(const_int32_51, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +void_104->addCase(const_int32_57, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +void_104->addCase(const_int32_58, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +void_104->addCase(const_int32_59, 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); +GetElementPtrInst* ptr_105 = GetElementPtrInst::Create(ptr_102, const_int32_57, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +CastInst* ptr_106 = new BitCastInst(ptr_105, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +LoadInst* ptr_107 = new LoadInst(ptr_106, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +BinaryOperator* int32_108 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +ICmpInst* int1_109 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, const_int32_61, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_109, 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); +ICmpInst* int1_111 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, const_int32_62, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_111, 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); +ICmpInst* int1_113 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_113, 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); +ICmpInst* int1_115 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_115, 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); +ICmpInst* int1_117 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_117, 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); +BinaryOperator* int32_119 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_66, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BinaryOperator* int32_120 = BinaryOperator::Create(Instruction::Add, int32_119, const_int32_67, "", 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); +BinaryOperator* int32_122 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_55, "", 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); +BinaryOperator* int32_124 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_57, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BinaryOperator* int32_125 = BinaryOperator::Create(Instruction::Add, int32_124, const_int32_68, "", 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); +BinaryOperator* int32_127 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_69, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BinaryOperator* int32_128 = BinaryOperator::Create(Instruction::Add, int32_127, const_int32_70, "", 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); +BinaryOperator* int32_130 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_71, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BinaryOperator* int32_131 = BinaryOperator::Create(Instruction::Add, int32_130, const_int32_72, "", 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); +BinaryOperator* int32_133 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_59, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BinaryOperator* int32_134 = BinaryOperator::Create(Instruction::Add, int32_133, const_int32_73, "", 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); +PHINode* int32_136 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +int32_136->reserveOperandSpace(6); +int32_136->addIncoming(int32_122, label_false_IF_ICMPGT16_i_i_i_i_i_i); +int32_136->addIncoming(int32_125, label_false_IF_ICMPGT17_i_i_i_i_i_i); +int32_136->addIncoming(int32_128, label_false_IF_ICMPGT18_i_i_i_i_i_i); +int32_136->addIncoming(int32_131, label_false_IF_ICMPGT19_i_i_i_i_i_i); +int32_136->addIncoming(int32_134, label_false_IF_ICMPGT20_i_i_i_i_i_i); +int32_136->addIncoming(int32_120, label_GOTO_or_IF_9_i_i_i_i_i_i); + +std::vector ptr_137_indices; +ptr_137_indices.push_back(const_int32_74); +ptr_137_indices.push_back(const_int32_74); +Instruction* ptr_137 = GetElementPtrInst::Create(ptr_107, ptr_137_indices.begin(), ptr_137_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* ptr_138 = new LoadInst(ptr_137, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +BinaryOperator* int32_139 = BinaryOperator::Create(Instruction::Add, int32_136, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_140 = new BitCastInst(ptr_138, PointerTy_23, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +GetElementPtrInst* ptr_141 = GetElementPtrInst::Create(ptr_140, int32_139, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* int32_142 = new LoadInst(ptr_141, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_143 = new IntToPtrInst(int32_142, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +ICmpInst* int1_144 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_142, const_int32_53, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_144, 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; +std::vector ptr_146_params; +ptr_146_params.push_back(ptr_107); +ptr_146_params.push_back(int32_95); +ptr_146_params.push_back(const_int32_53); +ptr_146_params.push_back(const_int32_53); +CallInst* ptr_146 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_146_params.begin(), ptr_146_params.end(), "", label_GOTO_or_IF__i_i_i_i); +ptr_146->setCallingConv(CallingConv::C); +ptr_146->setTailCall(true); +AttrListPtr ptr_146_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_146_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_147->setAttributes(ptr_147_PAL); +ptr_146->setAttributes(ptr_146_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); +CastInst* ptr_148 = new IntToPtrInst(int32_142, PointerTy_25, "", label_false_IFNE_i_i_i_i); +LoadInst* ptr_149 = new LoadInst(ptr_148, "", false, label_false_IFNE_i_i_i_i); +CastInst* int32_150 = new PtrToIntInst(ptr_149, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i); + new StoreInst(int32_150, ptr_141, false, label_false_IFNE_i_i_i_i); +std::vector ptr_152_indices; +ptr_152_indices.push_back(const_int32_53); +ptr_152_indices.push_back(const_int32_53); +Instruction* ptr_152 = GetElementPtrInst::Create(ptr_143, ptr_152_indices.begin(), ptr_152_indices.end(), "", label_false_IFNE_i_i_i_i); + new StoreInst(const_ptr_75, ptr_152, 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); +GetElementPtrInst* ptr_155 = GetElementPtrInst::Create(ptr_102, const_int32_55, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_156 = new BitCastInst(ptr_155, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_157 = new LoadInst(ptr_156, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +GetElementPtrInst* ptr_158 = GetElementPtrInst::Create(ptr_157, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_159 = new BitCastInst(ptr_158, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_160 = new LoadInst(ptr_159, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* int32_161 = new PtrToIntInst(ptr_160, 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_162 = BinaryOperator::Create(Instruction::Add, int32_161, int32_95, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_163 = new IntToPtrInst(int32_162, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +std::vector ptr_164_indices; +ptr_164_indices.push_back(const_int32_74); +ptr_164_indices.push_back(const_int32_74); +Instruction* ptr_164 = GetElementPtrInst::Create(ptr_157, ptr_164_indices.begin(), ptr_164_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_165 = new LoadInst(ptr_164, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_166 = new BitCastInst(ptr_165, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +ICmpInst* int1_167 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_163, ptr_166, ""); +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_167, 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); +std::vector ptr_169_indices; +ptr_169_indices.push_back(const_int32_74); +ptr_169_indices.push_back(const_int32_53); +Instruction* ptr_169 = GetElementPtrInst::Create(ptr_157, ptr_169_indices.begin(), ptr_169_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_162, PointerTy_27, ".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_169, 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; +std::vector ptr_172_params; +ptr_172_params.push_back(ptr_157); +ptr_172_params.push_back(ptr_160); +ptr_172_params.push_back(ptr_163); +ptr_172_params.push_back(const_int32_53); +ptr_172_params.push_back(const_int32_53); +CallInst* ptr_172 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_172_params.begin(), ptr_172_params.end(), "", label_false_IFEQ_i_i_i_i); +ptr_172->setCallingConv(CallingConv::C); +ptr_172->setTailCall(true); +AttrListPtr ptr_172_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_173_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_172_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_173->setAttributes(ptr_173_PAL); +ptr_172->setAttributes(ptr_172_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; +std::vector ptr_174_indices; +ptr_174_indices.push_back(const_int32_55); +ptr_174_indices.push_back(const_int32_53); +ptr_174_indices.push_back(const_int32_53); +ptr_174_indices.push_back(const_int32_74); +Instruction* ptr_174 = GetElementPtrInst::Create(ptr_102, ptr_174_indices.begin(), ptr_174_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_175 = new BitCastInst(ptr_174, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_176 = new LoadInst(ptr_175, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_177 = new BitCastInst(ptr_176, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_178_params; +ptr_178_params.push_back(ptr_177); +ptr_178_params.push_back(int32_95); +ptr_178_params.push_back(const_int32_53); +ptr_178_params.push_back(const_int32_53); +CallInst* ptr_178 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_178_params.begin(), ptr_178_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ptr_178->setCallingConv(CallingConv::C); +ptr_178->setTailCall(true); +AttrListPtr ptr_178_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); + ptr_178_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_178->setAttributes(ptr_178_PAL); + +std::vector ptr_179_indices; +ptr_179_indices.push_back(const_int32_53); +ptr_179_indices.push_back(const_int32_53); +Instruction* ptr_179 = GetElementPtrInst::Create(ptr_178, ptr_179_indices.begin(), ptr_179_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr__c20_i = new BitCastInst(ptr_VT, PointerTy_27, ".c20.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(ptr__c20_i, ptr_179, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_181_indices; +ptr_181_indices.push_back(const_int32_53); +ptr_181_indices.push_back(const_int32_74); +Instruction* ptr_181 = GetElementPtrInst::Create(ptr_178, ptr_181_indices.begin(), ptr_181_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_182 = new BitCastInst(ptr_181, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_183 = new LoadInst(ptr_182, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_184 = BinaryOperator::Create(Instruction::And, int8_183, const_int8_76, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* int8_185 = new LoadInst(const_ptr_77, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_186 = BinaryOperator::Create(Instruction::Or, int8_184, int8_185, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int8_187 = BinaryOperator::Create(Instruction::Or, int8_186, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); + new StoreInst(int8_187, ptr_182, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_189 = new LoadInst(const_ptr_79, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* int32_190 = new PtrToIntInst(ptr_178, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +BinaryOperator* int32_191 = BinaryOperator::Create(Instruction::And, int32_190, const_int32_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_192 = new IntToPtrInst(int32_191, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +std::vector ptr_193_indices; +ptr_193_indices.push_back(const_int32_55); +ptr_193_indices.push_back(const_int32_74); +Instruction* ptr_193 = GetElementPtrInst::Create(ptr_189, ptr_193_indices.begin(), ptr_193_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_194 = new LoadInst(ptr_193, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +GetElementPtrInst* ptr_195 = GetElementPtrInst::Create(ptr_194, const_int32_68, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +CastInst* ptr_196 = new BitCastInst(ptr_195, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +LoadInst* ptr_197 = new LoadInst(ptr_196, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i); +ICmpInst* int1_198 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread19_i, ICmpInst::ICMP_EQ, ptr_197, const_ptr_81, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i7_i_i_i_i_i, int1_198, 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); +GetElementPtrInst* ptr_200 = GetElementPtrInst::Create(ptr_102, const_int32_51, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +CastInst* ptr_201 = new BitCastInst(ptr_200, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +LoadInst* ptr_202 = new LoadInst(ptr_201, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +BinaryOperator* int32_203 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +ICmpInst* int1_204 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_203, const_int32_61, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_204, 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); +ICmpInst* int1_206 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_203, const_int32_62, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_206, 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); +ICmpInst* int1_208 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_203, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_208, 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); +ICmpInst* int1_210 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_203, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_210, 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); +ICmpInst* int1_212 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_203, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_212, 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); +BinaryOperator* int32_214 = BinaryOperator::Create(Instruction::AShr, int32_203, const_int32_66, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BinaryOperator* int32_215 = BinaryOperator::Create(Instruction::Add, int32_214, const_int32_67, "", 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); +BinaryOperator* int32_217 = BinaryOperator::Create(Instruction::AShr, int32_203, const_int32_55, "", 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); +BinaryOperator* int32_219 = BinaryOperator::Create(Instruction::AShr, int32_203, const_int32_57, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BinaryOperator* int32_220 = BinaryOperator::Create(Instruction::Add, int32_219, const_int32_68, "", 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); +BinaryOperator* int32_222 = BinaryOperator::Create(Instruction::AShr, int32_203, const_int32_69, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BinaryOperator* int32_223 = BinaryOperator::Create(Instruction::Add, int32_222, const_int32_70, "", 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); +BinaryOperator* int32_225 = BinaryOperator::Create(Instruction::AShr, int32_203, const_int32_71, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BinaryOperator* int32_226 = BinaryOperator::Create(Instruction::Add, int32_225, const_int32_72, "", 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); +BinaryOperator* int32_228 = BinaryOperator::Create(Instruction::AShr, int32_203, const_int32_59, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BinaryOperator* int32_229 = BinaryOperator::Create(Instruction::Add, int32_228, const_int32_73, "", 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); +PHINode* int32_231 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +int32_231->reserveOperandSpace(6); +int32_231->addIncoming(int32_217, label_false_IF_ICMPGT16_i_i_i11_i_i_i); +int32_231->addIncoming(int32_220, label_false_IF_ICMPGT17_i_i_i12_i_i_i); +int32_231->addIncoming(int32_223, label_false_IF_ICMPGT18_i_i_i13_i_i_i); +int32_231->addIncoming(int32_226, label_false_IF_ICMPGT19_i_i_i14_i_i_i); +int32_231->addIncoming(int32_229, label_false_IF_ICMPGT20_i_i_i15_i_i_i); +int32_231->addIncoming(int32_215, label_GOTO_or_IF_9_i_i_i10_i_i_i); + +std::vector ptr_232_indices; +ptr_232_indices.push_back(const_int32_74); +ptr_232_indices.push_back(const_int32_74); +Instruction* ptr_232 = GetElementPtrInst::Create(ptr_202, ptr_232_indices.begin(), ptr_232_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* ptr_233 = new LoadInst(ptr_232, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +BinaryOperator* int32_234 = BinaryOperator::Create(Instruction::Add, int32_231, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_235 = new BitCastInst(ptr_233, PointerTy_23, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +GetElementPtrInst* ptr_236 = GetElementPtrInst::Create(ptr_235, int32_234, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* int32_237 = new LoadInst(ptr_236, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_238 = new IntToPtrInst(int32_237, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +ICmpInst* int1_239 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_237, const_int32_53, ""); +BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_239, 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; +std::vector ptr_241_params; +ptr_241_params.push_back(ptr_202); +ptr_241_params.push_back(int32_95); +ptr_241_params.push_back(const_int32_53); +ptr_241_params.push_back(const_int32_53); +CallInst* ptr_241 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_241_params.begin(), ptr_241_params.end(), "", label_GOTO_or_IF__i17_i_i_i); +ptr_241->setCallingConv(CallingConv::C); +ptr_241->setTailCall(true); +AttrListPtr ptr_241_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_241_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_242->setAttributes(ptr_242_PAL); +ptr_241->setAttributes(ptr_241_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); +CastInst* ptr_243 = new IntToPtrInst(int32_237, PointerTy_25, "", label_false_IFNE_i21_i_i_i); +LoadInst* ptr_244 = new LoadInst(ptr_243, "", false, label_false_IFNE_i21_i_i_i); +CastInst* int32_245 = new PtrToIntInst(ptr_244, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i); + new StoreInst(int32_245, ptr_236, false, label_false_IFNE_i21_i_i_i); +std::vector ptr_247_indices; +ptr_247_indices.push_back(const_int32_53); +ptr_247_indices.push_back(const_int32_53); +Instruction* ptr_247 = GetElementPtrInst::Create(ptr_238, ptr_247_indices.begin(), ptr_247_indices.end(), "", label_false_IFNE_i21_i_i_i); + new StoreInst(const_ptr_75, ptr_247, 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; +std::vector ptr_250_indices; +ptr_250_indices.push_back(const_int32_51); +ptr_250_indices.push_back(const_int32_53); +ptr_250_indices.push_back(const_int32_53); +ptr_250_indices.push_back(const_int32_74); +Instruction* ptr_250 = GetElementPtrInst::Create(ptr_102, ptr_250_indices.begin(), ptr_250_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_251 = new BitCastInst(ptr_250, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_252 = new LoadInst(ptr_251, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_253 = new BitCastInst(ptr_252, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_254_params; +ptr_254_params.push_back(ptr_253); +ptr_254_params.push_back(int32_95); +ptr_254_params.push_back(const_int32_53); +ptr_254_params.push_back(const_int32_53); +CallInst* ptr_254 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_254_params.begin(), ptr_254_params.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ptr_254->setCallingConv(CallingConv::C); +ptr_254->setTailCall(true); +AttrListPtr ptr_254_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); + ptr_254_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_254->setAttributes(ptr_254_PAL); + +std::vector ptr_255_indices; +ptr_255_indices.push_back(const_int32_53); +ptr_255_indices.push_back(const_int32_53); +Instruction* ptr_255 = GetElementPtrInst::Create(ptr_254, ptr_255_indices.begin(), ptr_255_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr__c22_i = new BitCastInst(ptr_VT, PointerTy_27, ".c22.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(ptr__c22_i, ptr_255, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_257_indices; +ptr_257_indices.push_back(const_int32_53); +ptr_257_indices.push_back(const_int32_74); +Instruction* ptr_257 = GetElementPtrInst::Create(ptr_254, ptr_257_indices.begin(), ptr_257_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_258 = new BitCastInst(ptr_257, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_259 = new LoadInst(ptr_258, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_260 = BinaryOperator::Create(Instruction::And, int8_259, const_int8_76, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* int8_261 = new LoadInst(const_ptr_82, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_262 = BinaryOperator::Create(Instruction::Or, int8_260, int8_261, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int8_263 = BinaryOperator::Create(Instruction::Or, int8_262, const_int8_78, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); + new StoreInst(int8_263, ptr_258, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_265 = new LoadInst(const_ptr_83, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* int32_266 = new PtrToIntInst(ptr_254, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +BinaryOperator* int32_267 = BinaryOperator::Create(Instruction::And, int32_266, const_int32_80, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_268 = new IntToPtrInst(int32_267, PointerTy_26, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +std::vector ptr_269_indices; +ptr_269_indices.push_back(const_int32_55); +ptr_269_indices.push_back(const_int32_74); +Instruction* ptr_269 = GetElementPtrInst::Create(ptr_265, ptr_269_indices.begin(), ptr_269_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_270 = new LoadInst(ptr_269, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +GetElementPtrInst* ptr_271 = GetElementPtrInst::Create(ptr_270, const_int32_68, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +CastInst* ptr_272 = new BitCastInst(ptr_271, PointerTy_28, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +LoadInst* ptr_273 = new LoadInst(ptr_272, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i); +ICmpInst* int1_274 = new ICmpInst(*label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread21_i, ICmpInst::ICMP_EQ, ptr_273, const_ptr_81, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_true_IFNULL_i7_i_i11_i_i_i, int1_274, 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); +std::vector ptr_276_indices; +ptr_276_indices.push_back(const_int32_57); +ptr_276_indices.push_back(const_int32_53); +ptr_276_indices.push_back(const_int32_53); +ptr_276_indices.push_back(const_int32_74); +Instruction* ptr_276 = GetElementPtrInst::Create(ptr_102, ptr_276_indices.begin(), ptr_276_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_277 = new BitCastInst(ptr_276, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +LoadInst* ptr_278 = new LoadInst(ptr_277, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_279 = new BitCastInst(ptr_278, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +BinaryOperator* int32_280 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +ICmpInst* int1_281 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_280, const_int32_61, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_281, 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); +ICmpInst* int1_283 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_280, const_int32_62, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_283, 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); +ICmpInst* int1_285 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_280, const_int32_63, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_285, 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); +ICmpInst* int1_287 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_280, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_287, 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); +ICmpInst* int1_289 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_280, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_289, 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); +BinaryOperator* int32_291 = BinaryOperator::Create(Instruction::AShr, int32_280, const_int32_66, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_292 = BinaryOperator::Create(Instruction::Add, int32_291, const_int32_67, "", 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); +BinaryOperator* int32_294 = BinaryOperator::Create(Instruction::AShr, int32_280, const_int32_55, "", 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); +BinaryOperator* int32_296 = BinaryOperator::Create(Instruction::AShr, int32_280, const_int32_57, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_297 = BinaryOperator::Create(Instruction::Add, int32_296, const_int32_68, "", 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); +BinaryOperator* int32_299 = BinaryOperator::Create(Instruction::AShr, int32_280, const_int32_69, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_300 = BinaryOperator::Create(Instruction::Add, int32_299, const_int32_70, "", 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); +BinaryOperator* int32_302 = BinaryOperator::Create(Instruction::AShr, int32_280, const_int32_71, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_303 = BinaryOperator::Create(Instruction::Add, int32_302, const_int32_72, "", 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); +BinaryOperator* int32_305 = BinaryOperator::Create(Instruction::AShr, int32_280, const_int32_59, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_306 = BinaryOperator::Create(Instruction::Add, int32_305, const_int32_73, "", 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); +PHINode* int32_308 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +int32_308->reserveOperandSpace(6); +int32_308->addIncoming(int32_294, label_false_IF_ICMPGT16_i_i_i_i_i); +int32_308->addIncoming(int32_297, label_false_IF_ICMPGT17_i_i_i_i_i); +int32_308->addIncoming(int32_300, label_false_IF_ICMPGT18_i_i_i_i_i); +int32_308->addIncoming(int32_303, label_false_IF_ICMPGT19_i_i_i_i_i); +int32_308->addIncoming(int32_306, label_false_IF_ICMPGT20_i_i_i_i_i); +int32_308->addIncoming(int32_292, label_GOTO_or_IF_9_i_i_i_i_i); + +GetElementPtrInst* ptr_309 = GetElementPtrInst::Create(ptr_278, const_int32_68, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_310 = new BitCastInst(ptr_309, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* ptr_311 = new LoadInst(ptr_310, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +BinaryOperator* int32_312 = BinaryOperator::Create(Instruction::Add, int32_308, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_313 = new BitCastInst(ptr_311, PointerTy_23, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +GetElementPtrInst* ptr_314 = GetElementPtrInst::Create(ptr_313, int32_312, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* int32_315 = new LoadInst(ptr_314, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_316 = new IntToPtrInst(int32_315, PointerTy_26, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +ICmpInst* int1_317 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_315, const_int32_53, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_317, 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; +std::vector ptr_319_params; +ptr_319_params.push_back(ptr_279); +ptr_319_params.push_back(int32_95); +ptr_319_params.push_back(const_int32_53); +ptr_319_params.push_back(const_int32_53); +CallInst* ptr_319 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_319_params.begin(), ptr_319_params.end(), "", label_GOTO_or_IF__i_i_i); +ptr_319->setCallingConv(CallingConv::C); +ptr_319->setTailCall(true); +AttrListPtr ptr_319_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_319_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_320->setAttributes(ptr_320_PAL); +ptr_319->setAttributes(ptr_319_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); +CastInst* ptr_321 = new IntToPtrInst(int32_315, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +LoadInst* ptr_322 = new LoadInst(ptr_321, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +CastInst* int32_323 = new PtrToIntInst(ptr_322, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(int32_323, ptr_314, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +std::vector ptr_325_indices; +ptr_325_indices.push_back(const_int32_53); +ptr_325_indices.push_back(const_int32_53); +Instruction* ptr_325 = GetElementPtrInst::Create(ptr_316, ptr_325_indices.begin(), ptr_325_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(const_ptr_75, ptr_325, 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); +PHINode* ptr__ph_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph_i->addIncoming(ptr_319, label_GOTO_or_IF__i_i_i); +ptr__ph_i->addIncoming(ptr_316, 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); +std::vector ptr_328_indices; +ptr_328_indices.push_back(const_int32_53); +ptr_328_indices.push_back(const_int32_53); +Instruction* ptr_328 = GetElementPtrInst::Create(ptr__ph_i, ptr_328_indices.begin(), ptr_328_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +CastInst* ptr__c6_i = new BitCastInst(ptr_VT, PointerTy_27, ".c6.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(ptr__c6_i, ptr_328, 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_84, "storemerge.in.i.i1.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +std::vector ptr_330_indices; +ptr_330_indices.push_back(const_int32_53); +ptr_330_indices.push_back(const_int32_74); +Instruction* ptr_330 = GetElementPtrInst::Create(ptr__ph_i, ptr_330_indices.begin(), ptr_330_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +CastInst* ptr_331 = new BitCastInst(ptr_330, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); + new StoreInst(int8_storemerge_in_i_i1_i_i, ptr_331, 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); +PHINode* ptr__ph8_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph8_i->addIncoming(ptr_143, label_false_IFNE_i_i_i_i); +ptr__ph8_i->addIncoming(ptr_146, 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); +std::vector ptr_334_indices; +ptr_334_indices.push_back(const_int32_53); +ptr_334_indices.push_back(const_int32_53); +Instruction* ptr_334 = GetElementPtrInst::Create(ptr__ph8_i, ptr_334_indices.begin(), ptr_334_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +CastInst* ptr__c10_i = new BitCastInst(ptr_VT, PointerTy_27, ".c10.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(ptr__c10_i, ptr_334, 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_85, "storemerge.in.i.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +std::vector ptr_336_indices; +ptr_336_indices.push_back(const_int32_53); +ptr_336_indices.push_back(const_int32_74); +Instruction* ptr_336 = GetElementPtrInst::Create(ptr__ph8_i, ptr_336_indices.begin(), ptr_336_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +CastInst* ptr_337 = new BitCastInst(ptr_336, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); + new StoreInst(int8_storemerge_in_i_i_i_i, ptr_337, 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); +PHINode* ptr__ph12_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph12_i->addIncoming(ptr_172, label_false_IFEQ_i_i_i_i); +ptr__ph12_i->addIncoming(ptr_160, 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); +std::vector ptr_340_indices; +ptr_340_indices.push_back(const_int32_53); +ptr_340_indices.push_back(const_int32_53); +Instruction* ptr_340 = GetElementPtrInst::Create(ptr__ph12_i, ptr_340_indices.begin(), ptr_340_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +CastInst* ptr__c14_i = new BitCastInst(ptr_VT, PointerTy_27, ".c14.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(ptr__c14_i, ptr_340, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +std::vector ptr_342_indices; +ptr_342_indices.push_back(const_int32_53); +ptr_342_indices.push_back(const_int32_74); +Instruction* ptr_342 = GetElementPtrInst::Create(ptr__ph12_i, ptr_342_indices.begin(), ptr_342_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +CastInst* ptr_343 = new BitCastInst(ptr_342, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_344 = new LoadInst(ptr_343, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_345 = BinaryOperator::Create(Instruction::And, int8_344, const_int8_86, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +LoadInst* int8_346 = new LoadInst(const_ptr_87, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +BinaryOperator* int8_347 = BinaryOperator::Create(Instruction::Or, int8_345, int8_346, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); + new StoreInst(int8_347, ptr_343, 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); +PHINode* ptr__ph16_i = PHINode::Create(PointerTy_26, ".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); +ptr__ph16_i->addIncoming(ptr_238, label_false_IFNE_i21_i_i_i); +ptr__ph16_i->addIncoming(ptr_241, 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); +std::vector ptr_350_indices; +ptr_350_indices.push_back(const_int32_53); +ptr_350_indices.push_back(const_int32_53); +Instruction* ptr_350 = GetElementPtrInst::Create(ptr__ph16_i, ptr_350_indices.begin(), ptr_350_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +CastInst* ptr__c18_i = new BitCastInst(ptr_VT, PointerTy_27, ".c18.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(ptr__c18_i, ptr_350, 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_88, "storemerge.in.i2.i.i.i", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +std::vector ptr_352_indices; +ptr_352_indices.push_back(const_int32_53); +ptr_352_indices.push_back(const_int32_74); +Instruction* ptr_352 = GetElementPtrInst::Create(ptr__ph16_i, ptr_352_indices.begin(), ptr_352_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +CastInst* ptr_353 = new BitCastInst(ptr_352, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); + new StoreInst(int8_storemerge_in_i2_i_i_i, ptr_353, 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; +CallInst* void_356 = CallInst::Create(func_abort, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +void_356->setCallingConv(CallingConv::C); +void_356->setTailCall(true); +AttrListPtr void_356_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; Attrs.push_back(PAWI); - void_357_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_356_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_357->setAttributes(void_357_PAL); +void_356->setAttributes(void_356_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); +std::vector ptr_358_indices; +ptr_358_indices.push_back(const_int32_53); +ptr_358_indices.push_back(const_int32_53); +Instruction* ptr_358 = GetElementPtrInst::Create(ptr_192, ptr_358_indices.begin(), ptr_358_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(const_ptr_75, ptr_358, false, label_true_IF_NULL_i1_i_i_i_i_i); +GetElementPtrInst* ptr_360 = GetElementPtrInst::Create(ptr_194, const_int32_59, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_361 = new BitCastInst(ptr_360, PointerTy_25, "", label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_362 = new LoadInst(ptr_361, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_363 = new LoadInst(const_ptr_89, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* int32_364 = new PtrToIntInst(ptr_363, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i); +BinaryOperator* int32_365 = BinaryOperator::Create(Instruction::Add, int32_364, int32_191, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_366 = new IntToPtrInst(int32_365, PointerTy_25, "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(ptr_362, ptr_366, false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_368 = new LoadInst(ptr_361, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +ICmpInst* int1_369 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_368, const_ptr_90, ""); +BranchInst::Create(label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i_i_i_i, label_false_IFNE_i9_i_i_i_i_i, int1_369, label_true_IF_NULL_i1_i_i_i_i_i); + +// Block true IF*NULL.GOTO or IF*1_crit_edge.i3.i.i.i.i.i (label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i_i_i_i) +CastInst* ptr__c1_pre_i2_i_i_i_i_i = new IntToPtrInst(int32_191, PointerTy_27, ".c1.pre.i2.i.i.i.i.i", label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i5_i_i_i_i_i, label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i_i_i_i); + +// Block GOTO or IF*1.i5.i.i.i.i.i (label_GOTO_or_IF_1_i5_i_i_i_i_i) +Argument* fwdref_372 = new Argument(PointerTy_27); +PHINode* ptr__c1_pre_phi_i4_i_i_i_i_i = PHINode::Create(PointerTy_27, ".c1.pre-phi.i4.i.i.i.i.i", label_GOTO_or_IF_1_i5_i_i_i_i_i); +ptr__c1_pre_phi_i4_i_i_i_i_i->reserveOperandSpace(2); +ptr__c1_pre_phi_i4_i_i_i_i_i->addIncoming(ptr__c1_pre_i2_i_i_i_i_i, label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i_i_i_i); +ptr__c1_pre_phi_i4_i_i_i_i_i->addIncoming(fwdref_372, label_false_IFNE_i9_i_i_i_i_i); + +CastInst* ptr_373 = new BitCastInst(ptr_360, PointerTy_31, "", label_GOTO_or_IF_1_i5_i_i_i_i_i); + new StoreInst(ptr__c1_pre_phi_i4_i_i_i_i_i, ptr_373, false, label_GOTO_or_IF_1_i5_i_i_i_i_i); +LoadInst* ptr_375 = new LoadInst(ptr_196, "", false, label_GOTO_or_IF_1_i5_i_i_i_i_i); +ICmpInst* int1_376 = new ICmpInst(*label_GOTO_or_IF_1_i5_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_375, const_ptr_81, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i10_i_i_i_i_i, int1_376, label_GOTO_or_IF_1_i5_i_i_i_i_i); + +// Block true IFNULL.i7.i.i.i.i.i (label_true_IFNULL_i7_i_i_i_i_i) +CastInst* ptr_378 = new IntToPtrInst(int32_98, PointerTy_13, "", label_true_IFNULL_i7_i_i_i_i_i); +std::vector ptr_379_indices; +ptr_379_indices.push_back(const_int32_53); +ptr_379_indices.push_back(const_int32_69); +Instruction* ptr_379 = GetElementPtrInst::Create(ptr_378, ptr_379_indices.begin(), ptr_379_indices.end(), "", label_true_IFNULL_i7_i_i_i_i_i); +LoadInst* int8_380 = new LoadInst(ptr_379, "", false, label_true_IFNULL_i7_i_i_i_i_i); +ICmpInst* int1_381 = new ICmpInst(*label_true_IFNULL_i7_i_i_i_i_i, ICmpInst::ICMP_NE, int8_380, const_int8_91, ""); +CastInst* int8_382 = new ZExtInst(int1_381, IntegerType::get(mod->getContext(), 8), "", label_true_IFNULL_i7_i_i_i_i_i); + new StoreInst(const_int8_86, ptr_379, false, label_true_IFNULL_i7_i_i_i_i_i); +GetElementPtrInst* ptr_384 = GetElementPtrInst::Create(ptr_197, const_int32_59, "", label_true_IFNULL_i7_i_i_i_i_i); +CastInst* ptr_385 = new BitCastInst(ptr_384, PointerTy_23, "", label_true_IFNULL_i7_i_i_i_i_i); +BranchInst::Create(label_bb2_i_i22_i, label_true_IFNULL_i7_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); +Argument* fwdref_388 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_Java_org_j3_mmtk_Lock_acquire___exit25_i, label_bb1_i_i21_i, fwdref_388, 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); +Argument* fwdref_390 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_389 = BinaryOperator::Create(Instruction::Add, fwdref_390, const_int32_74, "", 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); +PHINode* int32_392 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i22_i); +int32_392->reserveOperandSpace(2); +int32_392->addIncoming(const_int32_53, label_true_IFNULL_i7_i_i_i_i_i); +int32_392->addIncoming(int32_389, 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; +ICmpInst* int1_393 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_ULT, int32_392, const_int32_92, ""); +std::vector void_394_params; +void_394_params.push_back(const_int1_93); +void_394_params.push_back(const_int1_93); +void_394_params.push_back(const_int1_93); +void_394_params.push_back(const_int1_93); +void_394_params.push_back(const_int1_93); +CallInst* void_394 = CallInst::Create(func_llvm_memory_barrier, void_394_params.begin(), void_394_params.end(), "", label_bb2_i_i22_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_387_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_394_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_387->setAttributes(void_387_PAL); +void_394->setAttributes(void_394_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; +std::vector int32_395_params; +int32_395_params.push_back(ptr_385); +int32_395_params.push_back(const_int32_53); +int32_395_params.push_back(const_int32_74); +CallInst* int32_395 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_395_params.begin(), int32_395_params.end(), "", label_bb2_i_i22_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_388_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + int32_395_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_388->setAttributes(int32_388_PAL); +int32_395->setAttributes(int32_395_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; +std::vector void_396_params; +void_396_params.push_back(const_int1_93); +void_396_params.push_back(const_int1_93); +void_396_params.push_back(const_int1_93); +void_396_params.push_back(const_int1_93); +void_396_params.push_back(const_int1_93); +CallInst* void_396 = CallInst::Create(func_llvm_memory_barrier, void_396_params.begin(), void_396_params.end(), "", label_bb2_i_i22_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_389_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_396_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_389->setAttributes(void_389_PAL); +void_396->setAttributes(void_396_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); +ICmpInst* int1_397 = new ICmpInst(*label_bb2_i_i22_i, ICmpInst::ICMP_EQ, int32_395, const_int32_53, ""); +BranchInst::Create(label_bb_i_i20_i, label_bb4_preheader_i_i23_i, int1_393, 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); +BranchInst::Create(label_Java_org_j3_mmtk_Lock_acquire___exit25_i, label_bb3_i_i24_i, int1_397, 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; +CallInst* void_400 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i24_i); +void_400->setCallingConv(CallingConv::C); +void_400->setTailCall(true); +AttrListPtr void_400_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_400_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_393->setAttributes(void_393_PAL); +void_400->setAttributes(void_400_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; +std::vector void_401_params; +void_401_params.push_back(const_int1_93); +void_401_params.push_back(const_int1_93); +void_401_params.push_back(const_int1_93); +void_401_params.push_back(const_int1_93); +void_401_params.push_back(const_int1_93); +CallInst* void_401 = CallInst::Create(func_llvm_memory_barrier, void_401_params.begin(), void_401_params.end(), "", label_bb3_i_i24_i); +void_401->setCallingConv(CallingConv::C); +void_401->setTailCall(true); +AttrListPtr void_401_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_401_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_394->setAttributes(void_394_PAL); +void_401->setAttributes(void_401_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; +std::vector int32_402_params; +int32_402_params.push_back(ptr_385); +int32_402_params.push_back(const_int32_53); +int32_402_params.push_back(const_int32_74); +CallInst* int32_402 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_402_params.begin(), int32_402_params.end(), "", label_bb3_i_i24_i); +int32_402->setCallingConv(CallingConv::C); +int32_402->setTailCall(true); +AttrListPtr int32_402_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_402_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_395->setAttributes(int32_395_PAL); +int32_402->setAttributes(int32_402_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; +std::vector void_403_params; +void_403_params.push_back(const_int1_93); +void_403_params.push_back(const_int1_93); +void_403_params.push_back(const_int1_93); +void_403_params.push_back(const_int1_93); +void_403_params.push_back(const_int1_93); +CallInst* void_403 = CallInst::Create(func_llvm_memory_barrier, void_403_params.begin(), void_403_params.end(), "", label_bb3_i_i24_i); +void_403->setCallingConv(CallingConv::C); +void_403->setTailCall(true); +AttrListPtr void_403_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_403_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_396->setAttributes(void_396_PAL); +void_403->setAttributes(void_403_PAL); + +ICmpInst* int1_404 = new ICmpInst(*label_bb3_i_i24_i, ICmpInst::ICMP_EQ, int32_402, const_int32_53, ""); +BranchInst::Create(label_Java_org_j3_mmtk_Lock_acquire___exit25_i, label_bb3_i_i24_i, int1_404, label_bb3_i_i24_i); -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 Java_org_j3_mmtk_Lock_acquire__.exit25.i (label_Java_org_j3_mmtk_Lock_acquire___exit25_i) + new StoreInst(int8_382, ptr_379, false, label_Java_org_j3_mmtk_Lock_acquire___exit25_i); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_Java_org_j3_mmtk_Lock_acquire___exit25_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 false IFNE.i9.i.i.i.i.i (label_false_IFNE_i9_i_i_i_i_i) +std::vector ptr_408_indices; +ptr_408_indices.push_back(const_int32_53); +ptr_408_indices.push_back(const_int32_53); +Instruction* ptr_408 = GetElementPtrInst::Create(ptr_368, ptr_408_indices.begin(), ptr_408_indices.end(), "", label_false_IFNE_i9_i_i_i_i_i); +CastInst* ptr__c_i8_i_i_i_i_i = new IntToPtrInst(int32_191, PointerTy_27, ".c.i8.i.i.i.i.i", label_false_IFNE_i9_i_i_i_i_i); + new StoreInst(ptr__c_i8_i_i_i_i_i, ptr_408, false, label_false_IFNE_i9_i_i_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i5_i_i_i_i_i, label_false_IFNE_i9_i_i_i_i_i); + +// Block true IFNULL3.i10.i.i.i.i.i (label_true_IFNULL3_i10_i_i_i_i_i) +CastInst* ptr_411 = new IntToPtrInst(int32_98, PointerTy_13, "", label_true_IFNULL3_i10_i_i_i_i_i); +std::vector ptr_412_indices; +ptr_412_indices.push_back(const_int32_53); +ptr_412_indices.push_back(const_int32_69); +Instruction* ptr_412 = GetElementPtrInst::Create(ptr_411, ptr_412_indices.begin(), ptr_412_indices.end(), "", label_true_IFNULL3_i10_i_i_i_i_i); +LoadInst* int8_413 = new LoadInst(ptr_412, "", false, label_true_IFNULL3_i10_i_i_i_i_i); +ICmpInst* int1_414 = new ICmpInst(*label_true_IFNULL3_i10_i_i_i_i_i, ICmpInst::ICMP_NE, int8_413, const_int8_91, ""); +CastInst* int8_415 = new ZExtInst(int1_414, IntegerType::get(mod->getContext(), 8), "", label_true_IFNULL3_i10_i_i_i_i_i); + new StoreInst(const_int8_86, ptr_412, false, label_true_IFNULL3_i10_i_i_i_i_i); +GetElementPtrInst* ptr_417 = GetElementPtrInst::Create(ptr_375, const_int32_59, "", label_true_IFNULL3_i10_i_i_i_i_i); +CastInst* ptr_418 = new BitCastInst(ptr_417, PointerTy_23, "", label_true_IFNULL3_i10_i_i_i_i_i); + new StoreInst(const_int32_53, ptr_418, false, label_true_IFNULL3_i10_i_i_i_i_i); + new StoreInst(int8_415, ptr_412, false, label_true_IFNULL3_i10_i_i_i_i_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i10_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); +std::vector ptr_422_indices; +ptr_422_indices.push_back(const_int32_53); +ptr_422_indices.push_back(const_int32_53); +Instruction* ptr_422 = GetElementPtrInst::Create(ptr_268, ptr_422_indices.begin(), ptr_422_indices.end(), "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(const_ptr_75, ptr_422, false, label_true_IF_NULL_i1_i_i6_i_i_i); +GetElementPtrInst* ptr_424 = GetElementPtrInst::Create(ptr_270, const_int32_59, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_425 = new BitCastInst(ptr_424, PointerTy_25, "", label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_426 = new LoadInst(ptr_425, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_427 = new LoadInst(const_ptr_89, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* int32_428 = new PtrToIntInst(ptr_427, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i6_i_i_i); +BinaryOperator* int32_429 = BinaryOperator::Create(Instruction::Add, int32_428, int32_267, "", label_true_IF_NULL_i1_i_i6_i_i_i); +CastInst* ptr_430 = new IntToPtrInst(int32_429, PointerTy_25, "", label_true_IF_NULL_i1_i_i6_i_i_i); + new StoreInst(ptr_426, ptr_430, false, label_true_IF_NULL_i1_i_i6_i_i_i); +LoadInst* ptr_432 = new LoadInst(ptr_425, "", false, label_true_IF_NULL_i1_i_i6_i_i_i); +ICmpInst* int1_433 = new ICmpInst(*label_true_IF_NULL_i1_i_i6_i_i_i, ICmpInst::ICMP_EQ, ptr_432, const_ptr_90, ""); +BranchInst::Create(label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i8_i_i_i, label_false_IFNE_i9_i_i13_i_i_i, int1_433, label_true_IF_NULL_i1_i_i6_i_i_i); + +// Block true IF*NULL.GOTO or IF*1_crit_edge.i3.i.i8.i.i.i (label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i8_i_i_i) +CastInst* ptr__c1_pre_i2_i_i7_i_i_i = new IntToPtrInst(int32_267, PointerTy_27, ".c1.pre.i2.i.i7.i.i.i", label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i8_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i5_i_i10_i_i_i, label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i8_i_i_i); + +// Block GOTO or IF*1.i5.i.i10.i.i.i (label_GOTO_or_IF_1_i5_i_i10_i_i_i) +Argument* fwdref_436 = new Argument(PointerTy_27); +PHINode* ptr__c1_pre_phi_i4_i_i9_i_i_i = PHINode::Create(PointerTy_27, ".c1.pre-phi.i4.i.i9.i.i.i", label_GOTO_or_IF_1_i5_i_i10_i_i_i); +ptr__c1_pre_phi_i4_i_i9_i_i_i->reserveOperandSpace(2); +ptr__c1_pre_phi_i4_i_i9_i_i_i->addIncoming(ptr__c1_pre_i2_i_i7_i_i_i, label_true_IF_NULL_GOTO_or_IF_1_crit_edge_i3_i_i8_i_i_i); +ptr__c1_pre_phi_i4_i_i9_i_i_i->addIncoming(fwdref_436, label_false_IFNE_i9_i_i13_i_i_i); + +CastInst* ptr_437 = new BitCastInst(ptr_424, PointerTy_31, "", label_GOTO_or_IF_1_i5_i_i10_i_i_i); + new StoreInst(ptr__c1_pre_phi_i4_i_i9_i_i_i, ptr_437, false, label_GOTO_or_IF_1_i5_i_i10_i_i_i); +LoadInst* ptr_439 = new LoadInst(ptr_272, "", false, label_GOTO_or_IF_1_i5_i_i10_i_i_i); +ICmpInst* int1_440 = new ICmpInst(*label_GOTO_or_IF_1_i5_i_i10_i_i_i, ICmpInst::ICMP_EQ, ptr_439, const_ptr_81, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i10_i_i14_i_i_i, int1_440, label_GOTO_or_IF_1_i5_i_i10_i_i_i); + +// Block true IFNULL.i7.i.i11.i.i.i (label_true_IFNULL_i7_i_i11_i_i_i) +CastInst* ptr_442 = new IntToPtrInst(int32_98, PointerTy_13, "", label_true_IFNULL_i7_i_i11_i_i_i); +std::vector ptr_443_indices; +ptr_443_indices.push_back(const_int32_53); +ptr_443_indices.push_back(const_int32_69); +Instruction* ptr_443 = GetElementPtrInst::Create(ptr_442, ptr_443_indices.begin(), ptr_443_indices.end(), "", label_true_IFNULL_i7_i_i11_i_i_i); +LoadInst* int8_444 = new LoadInst(ptr_443, "", false, label_true_IFNULL_i7_i_i11_i_i_i); +ICmpInst* int1_445 = new ICmpInst(*label_true_IFNULL_i7_i_i11_i_i_i, ICmpInst::ICMP_NE, int8_444, const_int8_91, ""); +CastInst* int8_446 = new ZExtInst(int1_445, IntegerType::get(mod->getContext(), 8), "", label_true_IFNULL_i7_i_i11_i_i_i); + new StoreInst(const_int8_86, ptr_443, false, label_true_IFNULL_i7_i_i11_i_i_i); +GetElementPtrInst* ptr_448 = GetElementPtrInst::Create(ptr_273, const_int32_59, "", label_true_IFNULL_i7_i_i11_i_i_i); +CastInst* ptr_449 = new BitCastInst(ptr_448, PointerTy_23, "", label_true_IFNULL_i7_i_i11_i_i_i); +BranchInst::Create(label_bb2_i_i_i, label_true_IFNULL_i7_i_i11_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); +Argument* fwdref_452 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_Java_org_j3_mmtk_Lock_acquire___exit_i, label_bb1_i_i_i, fwdref_452, 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); +Argument* fwdref_454 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_453 = BinaryOperator::Create(Instruction::Add, fwdref_454, const_int32_74, "", 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); +PHINode* int32_456 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); +int32_456->reserveOperandSpace(2); +int32_456->addIncoming(const_int32_53, label_true_IFNULL_i7_i_i11_i_i_i); +int32_456->addIncoming(int32_453, 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; +ICmpInst* int1_457 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_456, const_int32_92, ""); +std::vector void_458_params; +void_458_params.push_back(const_int1_93); +void_458_params.push_back(const_int1_93); +void_458_params.push_back(const_int1_93); +void_458_params.push_back(const_int1_93); +void_458_params.push_back(const_int1_93); +CallInst* void_458 = CallInst::Create(func_llvm_memory_barrier, void_458_params.begin(), void_458_params.end(), "", label_bb2_i_i_i); +void_458->setCallingConv(CallingConv::C); +void_458->setTailCall(true); +AttrListPtr void_458_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_458_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_434->setAttributes(void_434_PAL); +void_458->setAttributes(void_458_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; +std::vector int32_459_params; +int32_459_params.push_back(ptr_449); +int32_459_params.push_back(const_int32_53); +int32_459_params.push_back(const_int32_74); +CallInst* int32_459 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_459_params.begin(), int32_459_params.end(), "", label_bb2_i_i_i); +int32_459->setCallingConv(CallingConv::C); +int32_459->setTailCall(true); +AttrListPtr int32_459_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_459_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_435->setAttributes(int32_435_PAL); +int32_459->setAttributes(int32_459_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; +std::vector void_460_params; +void_460_params.push_back(const_int1_93); +void_460_params.push_back(const_int1_93); +void_460_params.push_back(const_int1_93); +void_460_params.push_back(const_int1_93); +void_460_params.push_back(const_int1_93); +CallInst* void_460 = CallInst::Create(func_llvm_memory_barrier, void_460_params.begin(), void_460_params.end(), "", label_bb2_i_i_i); +void_460->setCallingConv(CallingConv::C); +void_460->setTailCall(true); +AttrListPtr void_460_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_460_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_436->setAttributes(void_436_PAL); +void_460->setAttributes(void_460_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); +ICmpInst* int1_461 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_459, const_int32_53, ""); +BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_457, 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); +BranchInst::Create(label_Java_org_j3_mmtk_Lock_acquire___exit_i, label_bb3_i_i_i, int1_461, 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; +CallInst* void_464 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); +void_464->setCallingConv(CallingConv::C); +void_464->setTailCall(true); +AttrListPtr void_464_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_464_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_440->setAttributes(void_440_PAL); +void_464->setAttributes(void_464_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; +std::vector void_465_params; +void_465_params.push_back(const_int1_93); +void_465_params.push_back(const_int1_93); +void_465_params.push_back(const_int1_93); +void_465_params.push_back(const_int1_93); +void_465_params.push_back(const_int1_93); +CallInst* void_465 = CallInst::Create(func_llvm_memory_barrier, void_465_params.begin(), void_465_params.end(), "", label_bb3_i_i_i); +void_465->setCallingConv(CallingConv::C); +void_465->setTailCall(true); +AttrListPtr void_465_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_465_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_441->setAttributes(void_441_PAL); +void_465->setAttributes(void_465_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; +std::vector int32_466_params; +int32_466_params.push_back(ptr_449); +int32_466_params.push_back(const_int32_53); +int32_466_params.push_back(const_int32_74); +CallInst* int32_466 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_466_params.begin(), int32_466_params.end(), "", label_bb3_i_i_i); +int32_466->setCallingConv(CallingConv::C); +int32_466->setTailCall(true); +AttrListPtr int32_466_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_466_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -int32_442->setAttributes(int32_442_PAL); +int32_466->setAttributes(int32_466_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; +std::vector void_467_params; +void_467_params.push_back(const_int1_93); +void_467_params.push_back(const_int1_93); +void_467_params.push_back(const_int1_93); +void_467_params.push_back(const_int1_93); +void_467_params.push_back(const_int1_93); +CallInst* void_467 = CallInst::Create(func_llvm_memory_barrier, void_467_params.begin(), void_467_params.end(), "", label_bb3_i_i_i); +void_467->setCallingConv(CallingConv::C); +void_467->setTailCall(true); +AttrListPtr void_467_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_467_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_443->setAttributes(void_443_PAL); +void_467->setAttributes(void_467_PAL); + +ICmpInst* int1_468 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_466, const_int32_53, ""); +BranchInst::Create(label_Java_org_j3_mmtk_Lock_acquire___exit_i, label_bb3_i_i_i, int1_468, label_bb3_i_i_i); -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 Java_org_j3_mmtk_Lock_acquire__.exit.i (label_Java_org_j3_mmtk_Lock_acquire___exit_i) + new StoreInst(int8_446, ptr_443, false, label_Java_org_j3_mmtk_Lock_acquire___exit_i); +BranchInst::Create(label_true_IF_NULL_i1_i_i6_i_i_i, label_Java_org_j3_mmtk_Lock_acquire___exit_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 false IFNE.i9.i.i13.i.i.i (label_false_IFNE_i9_i_i13_i_i_i) +std::vector ptr_472_indices; +ptr_472_indices.push_back(const_int32_53); +ptr_472_indices.push_back(const_int32_53); +Instruction* ptr_472 = GetElementPtrInst::Create(ptr_432, ptr_472_indices.begin(), ptr_472_indices.end(), "", label_false_IFNE_i9_i_i13_i_i_i); +CastInst* ptr__c_i8_i_i12_i_i_i = new IntToPtrInst(int32_267, PointerTy_27, ".c.i8.i.i12.i.i.i", label_false_IFNE_i9_i_i13_i_i_i); + new StoreInst(ptr__c_i8_i_i12_i_i_i, ptr_472, false, label_false_IFNE_i9_i_i13_i_i_i); +BranchInst::Create(label_GOTO_or_IF_1_i5_i_i10_i_i_i, label_false_IFNE_i9_i_i13_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 true IFNULL3.i10.i.i14.i.i.i (label_true_IFNULL3_i10_i_i14_i_i_i) +CastInst* ptr_475 = new IntToPtrInst(int32_98, PointerTy_13, "", label_true_IFNULL3_i10_i_i14_i_i_i); +std::vector ptr_476_indices; +ptr_476_indices.push_back(const_int32_53); +ptr_476_indices.push_back(const_int32_69); +Instruction* ptr_476 = GetElementPtrInst::Create(ptr_475, ptr_476_indices.begin(), ptr_476_indices.end(), "", label_true_IFNULL3_i10_i_i14_i_i_i); +LoadInst* int8_477 = new LoadInst(ptr_476, "", false, label_true_IFNULL3_i10_i_i14_i_i_i); +ICmpInst* int1_478 = new ICmpInst(*label_true_IFNULL3_i10_i_i14_i_i_i, ICmpInst::ICMP_NE, int8_477, const_int8_91, ""); +CastInst* int8_479 = new ZExtInst(int1_478, IntegerType::get(mod->getContext(), 8), "", label_true_IFNULL3_i10_i_i14_i_i_i); + new StoreInst(const_int8_86, ptr_476, false, label_true_IFNULL3_i10_i_i14_i_i_i); +GetElementPtrInst* ptr_481 = GetElementPtrInst::Create(ptr_439, const_int32_59, "", label_true_IFNULL3_i10_i_i14_i_i_i); +CastInst* ptr_482 = new BitCastInst(ptr_481, PointerTy_23, "", label_true_IFNULL3_i10_i_i14_i_i_i); + new StoreInst(const_int32_53, ptr_482, false, label_true_IFNULL3_i10_i_i14_i_i_i); + new StoreInst(int8_479, ptr_476, false, label_true_IFNULL3_i10_i_i14_i_i_i); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i10_i_i14_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); +PHINode* ptr_486 = PHINode::Create(PointerTy_26, "", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +ptr_486->reserveOperandSpace(8); +ptr_486->addIncoming(ptr_254, label_true_IFNULL3_i10_i_i14_i_i_i); +ptr_486->addIncoming(ptr__ph16_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread17_i); +ptr_486->addIncoming(ptr_178, label_true_IFNULL3_i10_i_i_i_i_i); +ptr_486->addIncoming(ptr__ph12_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread13_i); +ptr_486->addIncoming(ptr__ph8_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread9_i); +ptr_486->addIncoming(ptr__ph_i, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_thread_i); +ptr_486->addIncoming(ptr_254, label_GOTO_or_IF_1_i5_i_i10_i_i_i); +ptr_486->addIncoming(ptr_178, label_GOTO_or_IF_1_i5_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); +CastInst* ptr_tmp1 = new BitCastInst(ptr_486, 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); // 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; +fwdref_390->replaceAllUsesWith(int32_392); delete fwdref_390; +fwdref_388->replaceAllUsesWith(int1_397); delete fwdref_388; +fwdref_372->replaceAllUsesWith(ptr__c_i8_i_i_i_i_i); delete fwdref_372; +fwdref_454->replaceAllUsesWith(int32_456); delete fwdref_454; +fwdref_452->replaceAllUsesWith(int1_461); delete fwdref_452; +fwdref_436->replaceAllUsesWith(ptr__c_i8_i_i12_i_i_i); delete fwdref_436; return func_gcmalloc; } Modified: vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h (original) +++ vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h Sat Nov 27 04:07:18 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; } Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java (original) +++ vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java Sat Nov 27 04:07:18 2010 @@ -600,7 +600,8 @@ @Override public final void objectArrayStoreNoGCBarrier(Object[] dst, int index, Object value) { Address base = ObjectReference.fromObject(dst).toAddress(); - Address slot = base.plus(Offset.fromIntZeroExtend(index << LOG_BYTES_IN_ADDRESS)); + // Add 3 for the header, the class, and the length. + Address slot = base.plus(Offset.fromIntZeroExtend((index + 3) << LOG_BYTES_IN_ADDRESS)); VM.activePlan.global().storeObjectReference(slot, ObjectReference.fromObject(value)); } } Modified: vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp Sat Nov 27 04:07:18 2010 @@ -51,7 +51,7 @@ extern "C" void* gcmalloc(uint32_t sz, void* VT) { sz = llvm::RoundUpToAlignment(sz, sizeof(void*)); - return JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2(sz, VT); + return (gc*)JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2(sz, VT); } extern "C" void addFinalizationCandidate(void* obj) __attribute__((always_inline)); @@ -84,14 +84,26 @@ } void Collector::scanObject(void** ptr, uintptr_t closure) { + if ((*ptr) != NULL) { + assert(((gc*)(*ptr))->getVirtualTable()); + } JnJVM_org_j3_bindings_Bindings_reportDelayedRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2(closure, ptr); } void Collector::markAndTrace(void* source, void* ptr, uintptr_t closure) { + void** ptr_ = (void**)ptr; + if ((*ptr_) != NULL) { + assert(((gc*)(*ptr_))->getVirtualTable()); + } + if ((*(void**)ptr) != NULL) assert(((gc*)(*(void**)ptr))->getVirtualTable()); JnJVM_org_j3_bindings_Bindings_processEdge__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2(closure, source, ptr); } void Collector::markAndTraceRoot(void* ptr, uintptr_t closure) { + void** ptr_ = (void**)ptr; + if ((*ptr_) != NULL) { + assert(((gc*)(*ptr_))->getVirtualTable()); + } JnJVM_org_j3_bindings_Bindings_processRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2Z(closure, ptr, true); } @@ -127,7 +139,7 @@ #else uint32 flags = MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED; #endif - void* baseAddr = mmap((void*)0x30000000, 0x40000000, PROT_READ | PROT_WRITE, + void* baseAddr = mmap((void*)0x30000000, 0x30000000, PROT_READ | PROT_WRITE, flags, -1, 0); if (baseAddr == MAP_FAILED) { perror("mmap"); @@ -138,7 +150,7 @@ } extern "C" void* MMTkMutatorAllocate(uint32_t size, VirtualTable* VT) { - void* val = MutatorThread::get()->Allocator.Allocate(size, "MMTk"); + void* val = MutatorThread::get()->Allocator.Allocate(size); ((void**)val)[0] = VT; return val; } Modified: vmkit/trunk/mmtk/mmtk-j3/Assert.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Assert.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Assert.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Assert.cpp Sat Nov 27 04:07:18 2010 @@ -15,4 +15,4 @@ using namespace j3; -extern "C" void Java_org_j3_mmtk_Assert_dumpStack__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Assert_dumpStack__ (JavaObject* self) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Sat Nov 27 04:07:18 2010 @@ -81,10 +81,6 @@ } th->MyVM->rendezvous.finishRV(); - - th->MyVM->wakeUpFinalizers(); - th->MyVM->wakeUpEnqueue(); - th->MyVM->endCollection(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Lock.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Lock.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Lock.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Lock.cpp Sat Nov 27 04:07:18 2010 @@ -25,10 +25,16 @@ extern "C" void Java_org_j3_mmtk_Lock_acquire__(Lock* l) { + bool saved = mvm::Thread::get()->inRV; + mvm::Thread::get()->inRV = true; l->spin.acquire(); + mvm::Thread::get()->inRV = saved; } -extern "C" void Java_org_j3_mmtk_Lock_check__I () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Lock_check__I (Lock* l, int i) { UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Lock_release__(Lock* l) { + bool saved = mvm::Thread::get()->inRV; + mvm::Thread::get()->inRV = true; l->spin.release(); + mvm::Thread::get()->inRV = saved; } Modified: vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp Sat Nov 27 04:07:18 2010 @@ -17,21 +17,21 @@ extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageAcquired__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( JavaObject* event, JavaObject* space, uintptr_t address, int numPages) { -#ifdef DEBUG +#if 0 fprintf(stderr, "Pages acquired by thread %p from space %p at %x (%d)\n", (void*)mvm::Thread::get(), (void*)space, address, numPages); #endif } extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageReleased__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( JavaObject* event, JavaObject* space, uintptr_t address, int numPages) { -#ifdef DEBUG +#if 0 fprintf(stderr, "Pages released by thread %p from space %p at %x (%d)\n", (void*)mvm::Thread::get(), (void*)space, address, numPages); #endif } extern "C" void Java_org_j3_mmtk_MMTk_1Events_heapSizeChanged__Lorg_vmmagic_unboxed_Extent_2( JavaObject* event, uintptr_t heapSize) { -#ifdef DEBUG +#if 0 fprintf(stderr, "New heap size : %d\n", (int)heapSize); #endif } Modified: vmkit/trunk/mmtk/mmtk-j3/Memory.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Memory.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Memory.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Memory.cpp Sat Nov 27 04:07:18 2010 @@ -22,7 +22,7 @@ } extern "C" uintptr_t Java_org_j3_mmtk_Memory_getHeapEndConstant__ (JavaObject* M) { - return (uintptr_t)0x70000000; + return (uintptr_t)0x60000000; } extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableStartConstant__ (JavaObject* M) { @@ -30,7 +30,7 @@ } extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableEndConstant__ (JavaObject* M) { - return (uintptr_t)0x70000000; + return (uintptr_t)0x60000000; } extern "C" sint32 @@ -41,14 +41,16 @@ return 0; } -extern "C" void +extern "C" uint8_t Java_org_j3_mmtk_Memory_mprotect__Lorg_vmmagic_unboxed_Address_2I (JavaObject* M, uintptr_t address, sint32 size) { - mprotect((void*)address, size, PROT_NONE); + int val = mprotect((void*)address, size, PROT_NONE); + return (val == 0); } -extern "C" void +extern "C" uint8_t Java_org_j3_mmtk_Memory_munprotect__Lorg_vmmagic_unboxed_Address_2I (JavaObject* M, uintptr_t address, sint32 size) { - mprotect((void*)address, size, PROT_READ | PROT_WRITE); + int val = mprotect((void*)address, size, PROT_READ | PROT_WRITE); + return (val == 0); } extern "C" void Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Sat Nov 27 04:07:18 2010 @@ -10,6 +10,7 @@ #include "JavaArray.h" #include "JavaClass.h" #include "JavaObject.h" +#include "JavaString.h" #include "JavaThread.h" #include "debug.h" @@ -137,8 +138,42 @@ extern "C" void Java_org_j3_mmtk_ObjectModel_getNextObject__Lorg_vmmagic_unboxed_ObjectReference_2 ( JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 ( - JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +class FakeByteArray { + public: + void* operator new(size_t size, int length) { + return new char[size + length]; + } + + FakeByteArray(const char* name) { + length = strlen(name); + for (uint32 i = 0; i < length; i++) { + elements[i] = name[i]; + } + } + + FakeByteArray(const UTF8* name) { + length = name->size; + for (uint32 i = 0; i < length; i++) { + elements[i] = name->elements[i]; + } + } + private: + JavaObject header; + size_t length; + uint8_t elements[1]; +}; + +extern "C" FakeByteArray* Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, JavaObject* src) { + if (VMClassLoader::isVMClassLoader(src)) { + return new (14) FakeByteArray("VMClassLoader"); + } else { + CommonClass* cl = JavaObject::getClass(src); + return new (cl->name->size) FakeByteArray(cl->name); + } +} + extern "C" void Java_org_j3_mmtk_ObjectModel_getArrayLength__Lorg_vmmagic_unboxed_ObjectReference_2 ( JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/RuntimeHelpers.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/RuntimeHelpers.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/RuntimeHelpers.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/RuntimeHelpers.cpp Sat Nov 27 04:07:18 2010 @@ -14,11 +14,9 @@ using namespace j3; extern "C" uint16_t MMTkCharAt(JavaString* str, uint32_t index) { - llvm_gcroot(str, 0); - return ArrayUInt16::getElement(JavaString::getValue(str), index); + return str->value->elements[index]; } extern "C" JavaObject* MMTkGetClass(JavaObject* obj) { - llvm_gcroot(obj, 0); - return JavaObject::getClass(obj)->delegatee[0]; + return ((JavaVirtualTable*)obj->getVirtualTable())->cl->delegatee[0]; } Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Sat Nov 27 04:07:18 2010 @@ -20,11 +20,10 @@ // 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::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) { Modified: vmkit/trunk/mmtk/mmtk-j3/Strings.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Strings.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Strings.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Strings.cpp Sat Nov 27 04:07:18 2010 @@ -17,23 +17,18 @@ extern "C" void Java_org_j3_mmtk_Strings_write___3CI(JavaObject* str, ArrayUInt16* msg, sint32 len) { - llvm_gcroot(str, 0); - llvm_gcroot(msg, 0); for (sint32 i = 0; i < len; ++i) { - fprintf(stderr, "%c", ArrayUInt16::getElement(msg, i)); + fprintf(stderr, "%c", msg->elements[i]); } } extern "C" void Java_org_j3_mmtk_Strings_writeThreadId___3CI(JavaObject* str, ArrayUInt16* msg, sint32 len) { - llvm_gcroot(str, 0); - llvm_gcroot(msg, 0); - fprintf(stderr, "[%p] ", (void*)JavaThread::get()); for (sint32 i = 0; i < len; ++i) { - fprintf(stderr, "%c", ArrayUInt16::getElement(msg, i)); + fprintf(stderr, "%c", msg->elements[i]); } } @@ -42,16 +37,12 @@ Java_org_j3_mmtk_Strings_copyStringToChars__Ljava_lang_String_2_3CII( JavaObject* obj, JavaString* str, ArrayUInt16* dst, uint32 dstBegin, uint32 dstEnd) { - llvm_gcroot(str, 0); - llvm_gcroot(obj, 0); - llvm_gcroot(dst, 0); sint32 len = str->count; sint32 n = (dstBegin + len <= dstEnd) ? len : (dstEnd - dstBegin); for (sint32 i = 0; i < n; i++) { - ArrayUInt16::setElement(dst, - ArrayUInt16::getElement(JavaString::getValue(str), str->offset + i), dstBegin + i); + dst->elements[dstBegin + i] = str->value->elements[str->offset + i]; } return n; Modified: vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp Sat Nov 27 04:07:18 2010 @@ -15,6 +15,6 @@ using namespace j3; -extern "C" void Java_org_j3_mmtk_SynchronizedCounter_reset__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_SynchronizedCounter_increment__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_SynchronizedCounter_reset__ (JavaObject* self) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_SynchronizedCounter_increment__ (JavaObject* self) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/VM.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/VM.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/VM.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/VM.cpp Sat Nov 27 04:07:18 2010 @@ -58,6 +58,10 @@ } extern "C" bool Java_org_j3_runtime_VM_verifyAssertions__ () { + // Note that DEBUG is defined in make ENABLE_OPTIMIZED=1. + // You must provide DISABLE_ASSERTIONS=1 to not have DEBUG defined. + // To generate MMTkInline.inc, you need to have this function return + // false. #ifdef DEBUG return true; #else Modified: vmkit/trunk/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/vmjc.cpp (original) +++ vmkit/trunk/tools/vmjc/vmjc.cpp Sat Nov 27 04:07:18 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/trunk/tools/vmkit/Launcher.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmkit/Launcher.cpp?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/tools/vmkit/Launcher.cpp (original) +++ vmkit/trunk/tools/vmkit/Launcher.cpp Sat Nov 27 04:07:18 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; Modified: vmkit/trunk/www/get_started.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/get_started.html?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/www/get_started.html (original) +++ vmkit/trunk/www/get_started.html Sat Nov 27 04:07:18 2010 @@ -24,27 +24,19 @@

A word of warning

-

While this work aims to provide a fully functional JVM and CLI runtime, it +

While this work aims to provide a fully functional JVM, it is still early work and is under heavy development. -

Some of the more notable missing pieces in the CLI runtime are:

- -
    -
  1. Support for arithmetic overflow.
  2. -
  3. Support for CLI object finalization semantics.
  4. -
  5. Thread support.
  6. -
-

Some of the common missing pieces in vmkit/llvm are:

    -
  1. Hotspot-like virtual machine (e.g mixed interpretation/compilation).
  2. +
  3. Mixed interpretation/compilation.
  4. +
  5. Adaptive optimization.

Building vmkit / working with the code

If you would like to check out and build the project, the current scheme -is (if you only want the JVM, you can skip the Pnet part. If you only want the CLI -VM, you can skip the GNU Classpath part):

+is:

  1. Checkout @@ -89,22 +81,6 @@ -
  2. Download - PNet 0.8.0:
  3. -
      -
    • tar zxvf pnet-0.8.0.tar.gz
    • -
    • cd pnet-0.8.0
    • -
    • ./configure; make
    • -
    - -
  4. Download - PNetlib 0.8.0:
  5. -
      -
    • tar zxvf pnetlib-0.8.0.tar.gz
    • -
    • cd pnetlib-0.8.0
    • -
    • ./configure; make
    • -
    -
  6. Checkout vmkit:
    • svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit
    • @@ -122,10 +98,6 @@
      Tell vmkit where GNU Classpath glibj.zip is located.

      --with-gnu-classpath-libs=<directory>
      Tell vmkit where GNU Classpath libs are located.
      -

      --with-pnet-local-prefix=<directory>
      -
      Tell vmkit where PNet is located.
      -

      --with-pnetlib=<directory>
      -
      Tell vmkit where pnetlib's mscorlib.dll is located.
    @@ -140,8 +112,6 @@
    • j3 --help
    • j3 HelloWorld
    • -
    • n3-pnetlib --help
    • -
    • n3-pnetlib HelloWorld.exe
Modified: vmkit/trunk/www/index.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/index.html?rev=120206&r1=120205&r2=120206&view=diff ============================================================================== --- vmkit/trunk/www/index.html (original) +++ vmkit/trunk/www/index.html Sat Nov 27 04:07:18 2010 @@ -4,7 +4,7 @@ - "VMKit" JVM and .Net runtimes for LLVM + VMKit: a substrate for virtual machines @@ -12,16 +12,15 @@
-

VMKit: JVM and .Net runtimes for LLVM

+

VMKit: a substrate for virtual machines

-

The VMKit project is an implementation of a JVM and CLI virtual machine - (.Net is an implementation of the CLI). It translates Java bytecode and - MSIL in the LLVM IR and uses the LLVM framework - for optimizations and compilation. For garbage collection, it uses - MMTk. - You can get and build the - source today.

+

The VMKit project is a framework for building virtual machines. It uses + LLVM for compiling and optimizing high-level + languages to machine code, and MMTk + to manage memory. J3 is an implementation of a JVM with VMKit. + You can get and build the source of J3 + today.

Features

@@ -32,7 +31,6 @@

End-User Features:

-
  • Download - PNet 0.8.0:
  • -
      -
    • tar zxvf pnet-0.8.0.tar.gz
    • -
    • cd pnet-0.8.0
    • -
    • ./configure; make
    • -
    - -
  • Download - PNetlib 0.8.0:
  • -
      -
    • tar zxvf pnetlib-0.8.0.tar.gz
    • -
    • cd pnetlib-0.8.0
    • -
    • ./configure; make
    • -
    -
  • Checkout vmkit:
    • svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit
    • @@ -122,10 +98,6 @@
      Tell vmkit where GNU Classpath glibj.zip is located.

      --with-gnu-classpath-libs=<directory>
      Tell vmkit where GNU Classpath libs are located.
      -

      --with-pnet-local-prefix=<directory>
      -
      Tell vmkit where PNet is located.
      -

      --with-pnetlib=<directory>
      -
      Tell vmkit where pnetlib's mscorlib.dll is located.
    @@ -140,8 +112,6 @@
    • j3 --help
    • j3 HelloWorld
    • -
    • n3-pnetlib --help
    • -
    • n3-pnetlib HelloWorld.exe
    Modified: vmkit/branches/multi-vm/www/index.html URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/www/index.html?rev=120424&r1=120423&r2=120424&view=diff ============================================================================== --- vmkit/branches/multi-vm/www/index.html (original) +++ vmkit/branches/multi-vm/www/index.html Tue Nov 30 06:21:29 2010 @@ -4,7 +4,7 @@ - "VMKit" JVM and .Net runtimes for LLVM + VMKit: a substrate for virtual machines @@ -12,16 +12,15 @@
    -

    VMKit: JVM and .Net runtimes for LLVM

    +

    VMKit: a substrate for virtual machines

    -

    The VMKit project is an implementation of a JVM and CLI virtual machine - (.Net is an implementation of the CLI). It translates Java bytecode and - MSIL in the LLVM IR and uses the LLVM framework - for optimizations and compilation. For garbage collection, it uses - MMTk. - You can get and build the - source today.

    +

    The VMKit project is a framework for building virtual machines. It uses + LLVM for compiling and optimizing high-level + languages to machine code, and MMTk + to manage memory. J3 is an implementation of a JVM with VMKit. + You can get and build the source of J3 + today.

    Features

    @@ -32,7 +31,6 @@

    End-User Features:

      -
    • Runs any Java and .Net applications on MacOSX and Unix-based systems.
    • Precise garbage collection.
    • Just-in-Time and Ahead-of-Time compilation.
    • Portable on many architectures (x86, x64, ppc32, ppc64, arm).
    • @@ -85,20 +83,14 @@

      Current Status

      -

      VMKit is still in its early development stages. If you are looking to - experiment virtual machine technologies, VMKit is probably a great solution - for you. If you want to use it as a drop in JVM or .Net, it is not yet - ready.

      - -

      VMKit currently has a decent implementation of the JVM. It executes +

      VMKit currently has a decent implementation of a JVM. It executes large projects (e.g. OSGi Felix, Tomcat, Eclipse) and the DaCapo benchmarks. - The CLI implementation is still in its early stages, but can execute - simple applications.

      +

      The JVM has been tested on Linux/x64, Linux/x86, Linux/ppc32, MacOSX/x64, MacOSX/x86, MacOSX/ppc32. The JVM may work on ppc64. Support for - Windows has not been investigated + Windows has not been investigated.

      Modified: vmkit/branches/multi-vm/www/releases/index.html URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/www/releases/index.html?rev=120424&r1=120423&r2=120424&view=diff ============================================================================== --- vmkit/branches/multi-vm/www/releases/index.html (original) +++ vmkit/branches/multi-vm/www/releases/index.html Tue Nov 30 06:21:29 2010 @@ -27,6 +27,11 @@
        +
      • + VMKit release 0.28 ( + + Release notes ) +
      • VMKit release 0.27 ( Modified: vmkit/branches/multi-vm/www/use_aot.html URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/www/use_aot.html?rev=120424&r1=120423&r2=120424&view=diff ============================================================================== --- vmkit/branches/multi-vm/www/use_aot.html (original) +++ vmkit/branches/multi-vm/www/use_aot.html Tue Nov 30 06:21:29 2010 @@ -29,8 +29,7 @@
        • cd tools/vmjc/libvmjc
        • -
        • make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 - (go get coffee)
        • +
        • make ENABLE_OPTIMIZED=1 (go get coffee)
      • Update PATH to include LLVM and VMKit binaries (replace *_OBJ with your Modified: vmkit/branches/multi-vm/www/use_mmtk.html URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/www/use_mmtk.html?rev=120424&r1=120423&r2=120424&view=diff ============================================================================== --- vmkit/branches/multi-vm/www/use_mmtk.html (original) +++ vmkit/branches/multi-vm/www/use_mmtk.html Tue Nov 30 06:21:29 2010 @@ -16,8 +16,7 @@

        Getting Started: VMKit and MMTk

        -

        This page gives you the instructions on how to build VMKit with MMTk's Mark and -Sweep Garbage Collector.

        +

        This page gives you the instructions on how to build VMKit with a MMTk garbage collector.

          @@ -25,15 +24,12 @@ and build LLVM-GCC from SVN head.
        1. Update PATH to include the llvm-gcc binary.
        2. Re-configure LLVM.
        3. -
        4. Configure VMKit with two additional options: --with-gc=mmtk and --with-llvmgcc.
        5. -
        6. Clean and make VMKit (do that each time you change the source code of VMKit):
        7. - +
        8. Configure VMKit with three additional options: --with-gc=mmtk, --with-llvmgcc, and --with-mmtk-plan={marksweep|copyms}
        9. +
        10. Build VMKit:
          • -
          • make ENABLE_OPTIMIZED=1 clean
          • make ENABLE_OPTIMIZED=1
          - -
        11. Run VMKit with MMTk:
        12. +
        13. Run VMKit:
          • Release/bin/j3 Foo
          From gael.thomas at lip6.fr Tue Nov 30 04:23:26 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 30 Nov 2010 12:23:26 -0000 Subject: [vmkit-commits] [vmkit] r120425 - in /vmkit/branches/multi-vm: ./ mmtk/java/src/org/j3/config/ Message-ID: <20101130122326.CE6F22A6C12D@llvm.org> Author: gthomas Date: Tue Nov 30 06:23:26 2010 New Revision: 120425 URL: http://llvm.org/viewvc/llvm-project?rev=120425&view=rev Log: fix svn:ignore Modified: vmkit/branches/multi-vm/ (props changed) vmkit/branches/multi-vm/mmtk/java/src/org/j3/config/ (props changed) Propchange: vmkit/branches/multi-vm/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Nov 30 06:23:26 2010 @@ -10,4 +10,5 @@ Makefile.common Release-Asserts Debug +scratch Propchange: vmkit/branches/multi-vm/mmtk/java/src/org/j3/config/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Nov 30 06:23:26 2010 @@ -1 +1,2 @@ -Selected.cpp +Selected.java + From nicolas.geoffray at lip6.fr Tue Nov 30 04:50:56 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 30 Nov 2010 12:50:56 -0000 Subject: [vmkit-commits] [vmkit] r120426 - /vmkit/trunk/mmtk/java/build.xml Message-ID: <20101130125056.BC2D32A6C12D@llvm.org> Author: geoffray Date: Tue Nov 30 06:50:56 2010 New Revision: 120426 URL: http://llvm.org/viewvc/llvm-project?rev=120426&view=rev Log: Missed file from last commit. Added: vmkit/trunk/mmtk/java/build.xml Added: vmkit/trunk/mmtk/java/build.xml URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/build.xml?rev=120426&view=auto ============================================================================== --- vmkit/trunk/mmtk/java/build.xml (added) +++ vmkit/trunk/mmtk/java/build.xml Tue Nov 30 06:50:56 2010 @@ -0,0 +1,9 @@ + + + + + + + + + From gael.thomas at lip6.fr Tue Nov 30 08:49:54 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 30 Nov 2010 16:49:54 -0000 Subject: [vmkit-commits] [vmkit] r120428 - in /vmkit/trunk/tools: llcj/llcj.cpp vmjc/vmjc.cpp Message-ID: <20101130164954.82B832A6C12D@llvm.org> Author: gthomas Date: Tue Nov 30 10:49:54 2010 New Revision: 120428 URL: http://llvm.org/viewvc/llvm-project?rev=120428&view=rev Log: llvm/System does not contain anymore Path.h, Signals.h and Program.h Modified: vmkit/trunk/tools/llcj/llcj.cpp vmkit/trunk/tools/vmjc/vmjc.cpp Modified: vmkit/trunk/tools/llcj/llcj.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/llcj/llcj.cpp?rev=120428&r1=120427&r2=120428&view=diff ============================================================================== --- vmkit/trunk/tools/llcj/llcj.cpp (original) +++ vmkit/trunk/tools/llcj/llcj.cpp Tue Nov 30 10:49:54 2010 @@ -8,9 +8,9 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/ManagedStatic.h" -#include "llvm/System/Path.h" -#include "llvm/System/Program.h" -#include "llvm/System/Signals.h" +#include "llvm/Support/Path.h" +#include "llvm/Support/Program.h" +#include "llvm/Support/Signals.h" #include "LinkPaths.h" Modified: vmkit/trunk/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=120428&r1=120427&r2=120428&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/vmjc.cpp (original) +++ vmkit/trunk/tools/vmjc/vmjc.cpp Tue Nov 30 10:49:54 2010 @@ -31,7 +31,7 @@ #include "llvm/Support/RegistryParser.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/System/Signals.h" +#include "llvm/Support/Signals.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" From nicolas.geoffray at lip6.fr Tue Nov 30 12:22:31 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 30 Nov 2010 20:22:31 -0000 Subject: [vmkit-commits] [vmkit] r120456 - in /vmkit/trunk/lib/J3/VMCore: JnjvmClassLoader.cpp JnjvmClassLoader.h VirtualTables.cpp Message-ID: <20101130202231.1BBC62A6C12D@llvm.org> Author: geoffray Date: Tue Nov 30 14:22:30 2010 New Revision: 120456 URL: http://llvm.org/viewvc/llvm-project?rev=120456&view=rev Log: Make sure that the javaLoad of a j3 class loader will be visited by the GC. Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=120456&r1=120455&r2=120456&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Tue Nov 30 14:22:30 2010 @@ -260,8 +260,10 @@ JnjvmClassLoader::JnjvmClassLoader(mvm::BumpPtrAllocator& Alloc, JnjvmClassLoader& JCL, JavaObject* loader, + VMClassLoader* vmdata, Jnjvm* I) : allocator(Alloc) { llvm_gcroot(loader, 0); + llvm_gcroot(vmdata, 0); bootstrapLoader = JCL.bootstrapLoader; TheCompiler = bootstrapLoader->getCompiler()->Create("Applicative loader"); @@ -271,6 +273,7 @@ javaSignatures = new(allocator, "SignMap") SignMap(); strings = new(allocator, "StringList") StringList(); + vmdata->JCL = this; javaLoader = loader; isolate = I; @@ -886,15 +889,16 @@ vmdata = (VMClassLoader*)(upcalls->vmdataClassLoader->getInstanceObjectField(loader)); if (!vmdata) { - mvm::BumpPtrAllocator* A = new mvm::BumpPtrAllocator(); + vmdata = VMClassLoader::allocate(); + mvm::BumpPtrAllocator* A = new mvm::BumpPtrAllocator(); JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader, - loader, vm); - vmdata = VMClassLoader::allocate(JCL); + loader, vmdata, vm); upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata); } JavaObject::release(loader); } else { JCL = vmdata->getClassLoader(); + assert(JCL->javaLoader == loader); } return JCL; Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=120456&r1=120455&r2=120456&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Tue Nov 30 14:22:30 2010 @@ -44,6 +44,7 @@ class StringList; class Typedef; class TypeMap; +class VMClassLoader; class ZipArchive; @@ -77,7 +78,7 @@ /// first use of a Java class loader. /// JnjvmClassLoader(mvm::BumpPtrAllocator& Alloc, JnjvmClassLoader& JCL, - JavaObject* loader, Jnjvm* isolate); + JavaObject* loader, VMClassLoader* vmdata, Jnjvm* isolate); /// lookupComponentName - Try to find the component name of the given array /// name. If the component name is not in the table of UTF8s and holder @@ -443,11 +444,10 @@ public: - static VMClassLoader* allocate(JnjvmClassLoader* J) { + static VMClassLoader* allocate() { VMClassLoader* res = 0; llvm_gcroot(res, 0); res = (VMClassLoader*)gc::operator new(sizeof(VMClassLoader), &VT); - res->JCL = J; return res; } @@ -479,16 +479,13 @@ } } - /// VMClassLoader - Default constructors. - /// - VMClassLoader(JnjvmClassLoader* J) : JCL(J) {} - /// getClassLoader - Get the internal class loader. /// JnjvmClassLoader* getClassLoader() { return JCL; } + friend class JnjvmClassLoader; }; #define MAXIMUM_STRINGS 100 Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=120456&r1=120455&r2=120456&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Tue Nov 30 14:22:30 2010 @@ -222,6 +222,8 @@ } end = end->prev; } + + mvm::Collector::markAndTraceRoot(&javaLoader, closure); } void JnjvmBootstrapLoader::tracer(uintptr_t closure) { From gael.thomas at lip6.fr Tue Nov 30 13:31:15 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 30 Nov 2010 21:31:15 -0000 Subject: [vmkit-commits] [vmkit] r120464 - in /vmkit/branches/multi-vm: ./ lib/J3/VMCore/JnjvmClassLoader.cpp lib/J3/VMCore/JnjvmClassLoader.h lib/J3/VMCore/VirtualTables.cpp mmtk/java/ mmtk/java/build.xml Message-ID: <20101130213115.89C842A6C12D@llvm.org> Author: gthomas Date: Tue Nov 30 15:31:15 2010 New Revision: 120464 URL: http://llvm.org/viewvc/llvm-project?rev=120464&view=rev Log: merge trunk inside multi-vm Added: vmkit/branches/multi-vm/mmtk/java/build.xml - copied unchanged from r120456, vmkit/trunk/mmtk/java/build.xml Modified: vmkit/branches/multi-vm/ (props changed) vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.h vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp vmkit/branches/multi-vm/mmtk/java/ (props changed) Propchange: vmkit/branches/multi-vm/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Nov 30 15:31:15 2010 @@ -1,3 +1,3 @@ /vmkit/branches/precise:112509-120199 /vmkit/branches/release_028:115466-116298 -/vmkit/trunk:120068-120292 +/vmkit/trunk:120068-120292,120425-120456 Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=120464&r1=120463&r2=120464&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp Tue Nov 30 15:31:15 2010 @@ -260,8 +260,10 @@ JnjvmClassLoader::JnjvmClassLoader(mvm::BumpPtrAllocator& Alloc, JnjvmClassLoader& JCL, JavaObject* loader, + VMClassLoader* vmdata, Jnjvm* I) : allocator(Alloc) { llvm_gcroot(loader, 0); + llvm_gcroot(vmdata, 0); bootstrapLoader = JCL.bootstrapLoader; TheCompiler = bootstrapLoader->getCompiler()->Create("Applicative loader"); @@ -271,6 +273,7 @@ javaSignatures = new(allocator, "SignMap") SignMap(); strings = new(allocator, "StringList") StringList(); + vmdata->JCL = this; javaLoader = loader; isolate = I; @@ -886,15 +889,16 @@ vmdata = (VMClassLoader*)(upcalls->vmdataClassLoader->getInstanceObjectField(loader)); if (!vmdata) { - mvm::BumpPtrAllocator* A = new mvm::BumpPtrAllocator(); + vmdata = VMClassLoader::allocate(); + mvm::BumpPtrAllocator* A = new mvm::BumpPtrAllocator(); JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader, - loader, vm); - vmdata = VMClassLoader::allocate(JCL); + loader, vmdata, vm); upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata); } JavaObject::release(loader); } else { JCL = vmdata->getClassLoader(); + assert(JCL->javaLoader == loader); } return JCL; Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.h?rev=120464&r1=120463&r2=120464&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.h Tue Nov 30 15:31:15 2010 @@ -44,6 +44,7 @@ class StringList; class Typedef; class TypeMap; +class VMClassLoader; class ZipArchive; @@ -77,7 +78,7 @@ /// first use of a Java class loader. /// JnjvmClassLoader(mvm::BumpPtrAllocator& Alloc, JnjvmClassLoader& JCL, - JavaObject* loader, Jnjvm* isolate); + JavaObject* loader, VMClassLoader* vmdata, Jnjvm* isolate); /// lookupComponentName - Try to find the component name of the given array /// name. If the component name is not in the table of UTF8s and holder @@ -443,11 +444,10 @@ public: - static VMClassLoader* allocate(JnjvmClassLoader* J) { + static VMClassLoader* allocate() { VMClassLoader* res = 0; llvm_gcroot(res, 0); res = (VMClassLoader*)gc::operator new(sizeof(VMClassLoader), &VT); - res->JCL = J; return res; } @@ -479,16 +479,13 @@ } } - /// VMClassLoader - Default constructors. - /// - VMClassLoader(JnjvmClassLoader* J) : JCL(J) {} - /// getClassLoader - Get the internal class loader. /// JnjvmClassLoader* getClassLoader() { return JCL; } + friend class JnjvmClassLoader; }; #define MAXIMUM_STRINGS 100 Modified: vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp?rev=120464&r1=120463&r2=120464&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp Tue Nov 30 15:31:15 2010 @@ -222,6 +222,8 @@ } end = end->prev; } + + mvm::Collector::markAndTraceRoot(&javaLoader, closure); } void JnjvmBootstrapLoader::tracer(uintptr_t closure) { Propchange: vmkit/branches/multi-vm/mmtk/java/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Nov 30 15:31:15 2010 @@ -1,5 +1,4 @@ mmtk-vmkit.bc mmtk-vmkit-optimized.bc mmtk-vmkit.jar -build.xml classes From gael.thomas at lip6.fr Tue Nov 30 13:38:56 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 30 Nov 2010 21:38:56 -0000 Subject: [vmkit-commits] [vmkit] r120468 - /vmkit/trunk/mmtk/java/build.xml Message-ID: <20101130213856.907F82A6C12D@llvm.org> Author: gthomas Date: Tue Nov 30 15:38:56 2010 New Revision: 120468 URL: http://llvm.org/viewvc/llvm-project?rev=120468&view=rev Log: use a relative path for src Modified: vmkit/trunk/mmtk/java/build.xml Modified: vmkit/trunk/mmtk/java/build.xml URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/build.xml?rev=120468&r1=120467&r2=120468&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/build.xml (original) +++ vmkit/trunk/mmtk/java/build.xml Tue Nov 30 15:38:56 2010 @@ -1,7 +1,7 @@ - + From gael.thomas at lip6.fr Tue Nov 30 14:08:42 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 30 Nov 2010 22:08:42 -0000 Subject: [vmkit-commits] [vmkit] r120473 - in /vmkit/branches/multi-vm: include/mvm/Threads/Thread.h lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/ReferenceQueue.cpp lib/J3/VMCore/ReferenceQueue.h mmtk/java/build.xml Message-ID: <20101130220842.829762A6C12D@llvm.org> Author: gthomas Date: Tue Nov 30 16:08:42 2010 New Revision: 120473 URL: http://llvm.org/viewvc/llvm-project?rev=120473&view=rev Log: fix also build.xml. FinalizerThread and ReferenceThread must inherits mvm::MutatorThread, not mvm::Thread Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.h vmkit/branches/multi-vm/mmtk/java/build.xml Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120473&r1=120472&r2=120473&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Tue Nov 30 16:08:42 2010 @@ -139,14 +139,14 @@ class ExceptionBuffer; -class Thread; +class MutatorThread; class VMThreadData { public: /// mut - The associated thread mutator - Thread* mut; + MutatorThread* mut; - VMThreadData(Thread* m) { + VMThreadData(MutatorThread* m) { this->mut = m; } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120473&r1=120472&r2=120473&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Tue Nov 30 16:08:42 2010 @@ -19,7 +19,7 @@ using namespace j3; -JavaThread::JavaThread(mvm::Thread* mut, Jnjvm* isolate) +JavaThread::JavaThread(mvm::MutatorThread* mut, Jnjvm* isolate) : mvm::VMThreadData(mut) { pendingException = NULL; jniEnv = isolate->jniEnv; @@ -43,7 +43,7 @@ } mvm::Thread *JavaThread::create(Jnjvm* isolate) { - mvm::Thread *mut = new mvm::MutatorThread(); + mvm::MutatorThread *mut = new mvm::MutatorThread(); JavaThread *th = new JavaThread(mut, isolate); mut->MyVM = isolate; mut->vmData = th; Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120473&r1=120472&r2=120473&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Nov 30 16:08:42 2010 @@ -125,7 +125,7 @@ /// JavaThread - Creates a Java thread. /// - JavaThread(mvm::Thread*, Jnjvm* isolate); + JavaThread(mvm::MutatorThread*, Jnjvm* isolate); /// create - Creates a Java thread and a mutator thread. /// Modified: vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp?rev=120473&r1=120472&r2=120473&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.cpp Tue Nov 30 16:08:42 2010 @@ -15,7 +15,7 @@ using namespace j3; -ReferenceThread::ReferenceThread(Jnjvm* vm) : Thread(), +ReferenceThread::ReferenceThread(Jnjvm* vm) : WeakReferencesQueue(ReferenceQueue::WEAK), SoftReferencesQueue(ReferenceQueue::SOFT), PhantomReferencesQueue(ReferenceQueue::PHANTOM) { @@ -159,7 +159,7 @@ } -FinalizerThread::FinalizerThread(Jnjvm* vm) : Thread() { +FinalizerThread::FinalizerThread(Jnjvm* vm) { FinalizationQueue = new gc*[INITIAL_QUEUE_SIZE]; QueueLength = INITIAL_QUEUE_SIZE; CurrentIndex = 0; Modified: vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.h?rev=120473&r1=120472&r2=120473&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/ReferenceQueue.h Tue Nov 30 16:08:42 2010 @@ -82,7 +82,7 @@ void scan(ReferenceThread* thread, uintptr_t closure); }; -class ReferenceThread : public mvm::Thread { +class ReferenceThread : public mvm::MutatorThread { public: /// WeakReferencesQueue - The queue of weak references. /// @@ -138,7 +138,7 @@ } }; -class FinalizerThread : public mvm::Thread { +class FinalizerThread : public mvm::MutatorThread { public: /// FinalizationQueueLock - A lock to protect access to the queue. /// Modified: vmkit/branches/multi-vm/mmtk/java/build.xml URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/mmtk/java/build.xml?rev=120473&r1=120472&r2=120473&view=diff ============================================================================== --- vmkit/branches/multi-vm/mmtk/java/build.xml (original) +++ vmkit/branches/multi-vm/mmtk/java/build.xml Tue Nov 30 16:08:42 2010 @@ -1,7 +1,7 @@ - + From nicolas.geoffray at lip6.fr Tue Nov 30 14:22:46 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 30 Nov 2010 22:22:46 -0000 Subject: [vmkit-commits] [vmkit] r120475 - in /vmkit/trunk/mmtk: java/src/org/j3/mmtk/Barriers.java java/src/org/mmtk/policy/immix/ImmixConstants.java mmtk-j3/Collection.cpp mmtk-j3/ObjectModel.cpp Message-ID: <20101130222246.D3CB82A6C12D@llvm.org> Author: geoffray Date: Tue Nov 30 16:22:46 2010 New Revision: 120475 URL: http://llvm.org/viewvc/llvm-project?rev=120475&view=rev Log: Add support for the non-generational version of the Immix collector. Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixConstants.java vmkit/trunk/mmtk/mmtk-j3/Collection.cpp vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java?rev=120475&r1=120474&r2=120475&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java (original) +++ vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java Tue Nov 30 16:22:46 2010 @@ -599,9 +599,13 @@ @UninterruptibleNoWarn @Override public final void objectArrayStoreNoGCBarrier(Object[] dst, int index, Object value) { - Address base = ObjectReference.fromObject(dst).toAddress(); + dst[index] = value; + // TODO(ngeoffray): I don't think this is needed, the previous statement should not have + // had a GC barrier. + // + // Address base = ObjectReference.fromObject(dst).toAddress(); // Add 3 for the header, the class, and the length. - Address slot = base.plus(Offset.fromIntZeroExtend((index + 3) << LOG_BYTES_IN_ADDRESS)); - VM.activePlan.global().storeObjectReference(slot, ObjectReference.fromObject(value)); + // Address slot = base.plus(Offset.fromIntZeroExtend((index + 3) << LOG_BYTES_IN_ADDRESS)); + // VM.activePlan.global().storeObjectReference(slot, ObjectReference.fromObject(value)); } } Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixConstants.java URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixConstants.java?rev=120475&r1=120474&r2=120475&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixConstants.java (original) +++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixConstants.java Tue Nov 30 16:22:46 2010 @@ -21,7 +21,10 @@ import org.vmmagic.unboxed.Word; public class ImmixConstants { - public static final boolean BUILD_FOR_STICKYIMMIX = Plan.NEEDS_LOG_BIT_IN_HEADER; + // TODO(ngeoffray): Inform MMTk developers that using Plan here is not wise + // due to clinit order. + // public static final boolean BUILD_FOR_STICKYIMMIX = Plan.NEEDS_LOG_BIT_IN_HEADER; + public static final boolean BUILD_FOR_STICKYIMMIX = VM.activePlan.constraints().needsLogBitInHeader(); /* start temporary experimental constants --- should not be allowed to lurk longer than necessary */ public static final int TMP_MIN_SPILL_THRESHOLD = 2; Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=120475&r1=120474&r2=120475&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Tue Nov 30 16:22:46 2010 @@ -99,12 +99,13 @@ extern "C" void Java_org_j3_mmtk_Collection_prepareMutator__Lorg_mmtk_plan_MutatorContext_2 (MMTkObject* C, MMTkObject* MC) { } +extern "C" int32_t Java_org_j3_mmtk_Collection_activeGCThreads__ (MMTkObject* C) { return 1; } +extern "C" int32_t Java_org_j3_mmtk_Collection_activeGCThreadOrdinal__ (MMTkObject* C) { return 1; } + extern "C" void Java_org_j3_mmtk_Collection_reportPhysicalAllocationFailed__ (MMTkObject* C) { UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Collection_triggerAsyncCollection__I (MMTkObject* C, sint32 val) { UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Collection_noThreadsInGC__ (MMTkObject* C) { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Collection_activeGCThreads__ (MMTkObject* C) { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Collection_activeGCThreadOrdinal__ (MMTkObject* C) { UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Collection_requestMutatorFlush__ (MMTkObject* C) { UNIMPLEMENTED(); } } // namespace mmtk Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=120475&r1=120474&r2=120475&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Tue Nov 30 16:22:46 2010 @@ -99,8 +99,12 @@ extern "C" void Java_org_j3_mmtk_ObjectModel_getReferenceWhenCopiedTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 ( MMTkObject* OM, uintptr_t from, uintptr_t to) { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getObjectEndAddress__Lorg_vmmagic_unboxed_ObjectReference_2 ( - MMTkObject* OM, uintptr_t object) { UNIMPLEMENTED(); } +extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_getObjectEndAddress__Lorg_vmmagic_unboxed_ObjectReference_2 ( + MMTkObject* OM, gc* object) { + size_t size = mvm::Thread::get()->MyVM->getObjectSize(object); + size = llvm::RoundUpToAlignment(size, sizeof(void*)); + return reinterpret_cast(object) + size; +} extern "C" void Java_org_j3_mmtk_ObjectModel_getSizeWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 ( MMTkObject* OM, uintptr_t object) { UNIMPLEMENTED(); } From nicolas.geoffray at lip6.fr Tue Nov 30 14:30:57 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 30 Nov 2010 22:30:57 -0000 Subject: [vmkit-commits] [vmkit] r120477 - in /vmkit/trunk: Makefile.rules autoconf/configure.ac configure include/mvm/GC/GC.h include/mvm/Threads/Locks.h include/mvm/Threads/ObjectLocks.h Message-ID: <20101130223057.6B48E2A6C12D@llvm.org> Author: geoffray Date: Tue Nov 30 16:30:57 2010 New Revision: 120477 URL: http://llvm.org/viewvc/llvm-project?rev=120477&view=rev Log: Refactor the code so that we don't need to create a ObjectHeader.h. This has the disadvantage that the same object layout is used for all the GCs we support, and the GC.h file needs to be edited by hand to tweak it. Modified: vmkit/trunk/Makefile.rules vmkit/trunk/autoconf/configure.ac vmkit/trunk/configure vmkit/trunk/include/mvm/GC/GC.h vmkit/trunk/include/mvm/Threads/Locks.h vmkit/trunk/include/mvm/Threads/ObjectLocks.h Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=120477&r1=120476&r2=120477&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Nov 30 16:30:57 2010 @@ -1,3 +1,5 @@ +LTO_OPTS = -std-compile-opts + ifdef VMKIT_RUNTIME Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=120477&r1=120476&r2=120477&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Nov 30 16:30:57 2010 @@ -222,9 +222,9 @@ AC_ARG_WITH(mmtk-plan, [AS_HELP_STRING(--with-mmtk-plan=something, - [MMTk plan type ('marksweep')])], - [[MMTK_PLAN_HEADER=$withval]], - [[MMTK_PLAN_HEADER=marksweep]] + [MMTk plan type ('org.mmtk.plan.marksweep.MS')])], + [[MMTK_PLAN=$withval]], + [[MMTK_PLAN=org.mmtk.plan.marksweep.MS]] ) if test "x$gc" = "xboehm"; then @@ -247,7 +247,7 @@ AC_SUBST(GC_BOEHM, [0]) AC_SUBST(GC_MMTK, [1]) GC_LIBS=MMTk - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK -I\$(PROJ_SRC_ROOT)/mmtk/config/\$(MMTK_PLAN_HEADER)" + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK" else GC_LIBS=GCMmap2 if test "x$gc" = "xmulti-mmap"; then @@ -266,23 +266,9 @@ fi fi - -if test "x$MMTK_PLAN_HEADER" = "xmarksweep"; then - MMTK_PLAN=org.mmtk.plan.marksweep.MS -else - if test "x$MMTK_PLAN_HEADER" = "xcopyms"; then - MMTK_PLAN=org.mmtk.plan.copyms.CopyMS - else - if test "x$MMTK_PLAN_HEADER" != "x"; then - error Unknown or unsupported MMTK plan - fi - fi -fi - AC_SUBST([GC_FLAGS]) AC_SUBST([GC_LIBS]) AC_SUBST([MMTK_PLAN]) -AC_SUBST([MMTK_PLAN_HEADER]) dnl ************************************************************************** dnl Virtual Machine type Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=120477&r1=120476&r2=120477&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Tue Nov 30 16:30:57 2010 @@ -641,7 +641,6 @@ ISOLATE_BUILD SERVICE_BUILD SINGLE_BUILD -MMTK_PLAN_HEADER MMTK_PLAN GC_LIBS GC_FLAGS @@ -1371,7 +1370,7 @@ --with-gc=something GC type ('mmtk' (requires llvm-gcc) 'single-mmap' 'multi-mmap' or 'boehm') --with-mmtk-plan=something - MMTk plan type ('marksweep') + MMTk plan type ('org.mmtk.plan.marksweep.MS') --with-vm-type=something VM type ('single' 'isolate' 'isolate-sharing' or 'service') @@ -3861,9 +3860,9 @@ # Check whether --with-mmtk-plan was given. if test "${with_mmtk_plan+set}" = set; then : - withval=$with_mmtk_plan; MMTK_PLAN_HEADER=$withval + withval=$with_mmtk_plan; MMTK_PLAN=$withval else - MMTK_PLAN_HEADER=marksweep + MMTK_PLAN=org.mmtk.plan.marksweep.MS fi @@ -3898,7 +3897,7 @@ GC_MMTK=1 GC_LIBS=MMTk - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK -I\$(PROJ_SRC_ROOT)/mmtk/config/\$(MMTK_PLAN_HEADER)" + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK" else GC_LIBS=GCMmap2 if test "x$gc" = "xmulti-mmap"; then @@ -3927,20 +3926,6 @@ fi -if test "x$MMTK_PLAN_HEADER" = "xmarksweep"; then - MMTK_PLAN=org.mmtk.plan.marksweep.MS -else - if test "x$MMTK_PLAN_HEADER" = "xcopyms"; then - MMTK_PLAN=org.mmtk.plan.copyms.CopyMS - else - if test "x$MMTK_PLAN_HEADER" != "x"; then - error Unknown or unsupported MMTK plan - fi - fi -fi - - - Modified: vmkit/trunk/include/mvm/GC/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/GC/GC.h?rev=120477&r1=120476&r2=120477&view=diff ============================================================================== --- vmkit/trunk/include/mvm/GC/GC.h (original) +++ vmkit/trunk/include/mvm/GC/GC.h Tue Nov 30 16:30:57 2010 @@ -12,7 +12,6 @@ #define MVM_GC_H #include -#include "ObjectHeader.h" struct VirtualTable; @@ -36,6 +35,11 @@ }; namespace mvm { + // TODO(ngeoffray): Make these two constants easily configurable. For now they + // work for all our supported GCs. + static const uint32_t GCBits = 8; + static const bool MovesObject = true; + static const uint32_t HashBits = 8; static const uint64_t GCBitMask = ((1 << GCBits) - 1); } Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=120477&r1=120476&r2=120477&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Tue Nov 30 16:30:57 2010 @@ -14,7 +14,6 @@ #include #include -#include "ObjectHeader.h" #include "mvm/Threads/Thread.h" #ifdef WITH_LLVM_GCC Modified: vmkit/trunk/include/mvm/Threads/ObjectLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/ObjectLocks.h?rev=120477&r1=120476&r2=120477&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/ObjectLocks.h (original) +++ vmkit/trunk/include/mvm/Threads/ObjectLocks.h Tue Nov 30 16:30:57 2010 @@ -10,7 +10,6 @@ #ifndef MVM_OBJECT_LOCKS_H #define MVM_OBJECT_LOCKS_H -#include "ObjectHeader.h" #include "mvm/Allocator.h" #include "mvm/GC/GC.h" #include "mvm/Threads/Cond.h" From nicolas.geoffray at lip6.fr Tue Nov 30 14:32:56 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 30 Nov 2010 22:32:56 -0000 Subject: [vmkit-commits] [vmkit] r120478 - /vmkit/trunk/mmtk/config/ Message-ID: <20101130223256.C6A362A6C12D@llvm.org> Author: geoffray Date: Tue Nov 30 16:32:56 2010 New Revision: 120478 URL: http://llvm.org/viewvc/llvm-project?rev=120478&view=rev Log: Remove unneeded directory. Removed: vmkit/trunk/mmtk/config/ From gael.thomas at lip6.fr Tue Nov 30 15:56:44 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 30 Nov 2010 23:56:44 -0000 Subject: [vmkit-commits] [vmkit] r120502 - in /vmkit/branches/multi-vm/lib/J3: Classpath/ClasspathConstructor.inc Classpath/ClasspathMethod.inc Classpath/ClasspathVMClass.inc Classpath/ClasspathVMSystem.inc VMCore/JavaMetaJIT.cpp VMCore/JavaRuntimeJIT.cpp VMCore/JavaThread.cpp VMCore/JavaThread.h VMCore/Jni.cpp VMCore/Jnjvm.cpp VMCore/JnjvmClassLoader.cpp Message-ID: <20101130235644.7A7222A6C12D@llvm.org> Author: gthomas Date: Tue Nov 30 17:56:44 2010 New Revision: 120502 URL: http://llvm.org/viewvc/llvm-project?rev=120502&view=rev Log: don't access directly to pendingException anymore (except in JavaThread.* and VirtualTable.cpp) Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMClass.inc vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMSystem.inc vmkit/branches/multi-vm/lib/J3/VMCore/JavaMetaJIT.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathConstructor.inc Tue Nov 30 17:56:44 2010 @@ -132,7 +132,7 @@ vm->invocationTargetException(excp); } else { // If it's an error, throw it again. - th->throwPendingException(); + th->throwIt(); } return NULL; } Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathMethod.inc Tue Nov 30 17:56:44 2010 @@ -174,7 +174,7 @@ mut->clearPendingException(); \ th->getJVM()->invocationTargetException(exc); \ } else { \ - th->throwPendingException(); \ + th->throwIt(); \ } \ return NULL; \ } Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMClass.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMClass.inc?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMClass.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMClass.inc Tue Nov 30 17:56:44 2010 @@ -584,7 +584,7 @@ llvm_gcroot(throwable, 0); assert(throwable && "Using internal VM throw exception without exception"); - JavaThread::get()->pendingException = (JavaObject*)throwable; + JavaThread::get()->setPendingException(throwable); } JNIEXPORT ArrayObject* Java_java_lang_VMClass_getDeclaredAnnotations( Modified: vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMSystem.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMSystem.inc?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMSystem.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Classpath/ClasspathVMSystem.inc Tue Nov 30 17:56:44 2010 @@ -42,14 +42,13 @@ Jnjvm *vm = th->getJVM(); if (src == NULL || dst == NULL) { - th->pendingException = vm->CreateNullPointerException(); + th->setPendingException(vm->CreateNullPointerException()); return; } if (!(JavaObject::getClass(src)->isArray() && JavaObject::getClass(dst)->isArray())) { - th->pendingException = vm->CreateArrayStoreException( - (JavaVirtualTable*)dst->getVirtualTable()); + th->setPendingException(vm->CreateArrayStoreException((JavaVirtualTable*)dst->getVirtualTable())); return; } @@ -62,25 +61,24 @@ sint32 dstSize = JavaArray::getSize(dst); if (len > srcSize) { - th->pendingException = vm->CreateIndexOutOfBoundsException(len); + th->setPendingException(vm->CreateIndexOutOfBoundsException(len)); } else if (len > dstSize) { - th->pendingException = vm->CreateIndexOutOfBoundsException(len); + th->setPendingException(vm->CreateIndexOutOfBoundsException(len)); } else if (len + sstart > srcSize) { - th->pendingException = vm->CreateIndexOutOfBoundsException(len + sstart); + th->setPendingException(vm->CreateIndexOutOfBoundsException(len + sstart)); } else if (len + dstart > dstSize) { - th->pendingException = vm->CreateIndexOutOfBoundsException(len + dstart); + th->setPendingException(vm->CreateIndexOutOfBoundsException(len + dstart)); } else if (dstart < 0) { - th->pendingException = vm->CreateIndexOutOfBoundsException(dstart); + th->setPendingException(vm->CreateIndexOutOfBoundsException(dstart)); } else if (sstart < 0) { - th->pendingException = vm->CreateIndexOutOfBoundsException(sstart); + th->setPendingException(vm->CreateIndexOutOfBoundsException(sstart)); } else if (len < 0) { - th->pendingException = vm->CreateIndexOutOfBoundsException(len); + th->setPendingException(vm->CreateIndexOutOfBoundsException(len)); } else if ((dstType->isPrimitive() || srcType->isPrimitive()) && srcType != dstType) { - th->pendingException = vm->CreateArrayStoreException( - (JavaVirtualTable*)dst->getVirtualTable()); + th->setPendingException(vm->CreateArrayStoreException((JavaVirtualTable*)dst->getVirtualTable())); } - if (th->pendingException != NULL) return; + if (th->getPendingException() != NULL) return; jint i = sstart; jint length = len; @@ -106,8 +104,7 @@ memmove(ptrDst, ptrSrc, length << logSize); if (doThrow) { - th->pendingException = vm->CreateArrayStoreException( - (JavaVirtualTable*)dst->getVirtualTable()); + th->setPendingException(vm->CreateArrayStoreException((JavaVirtualTable*)dst->getVirtualTable())); } } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaMetaJIT.cpp?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaMetaJIT.cpp Tue Nov 30 17:56:44 2010 @@ -64,7 +64,7 @@ #else #define DO_TRY -#define DO_CATCH if (th->pendingException) { th->throwFromJava(); } +#define DO_CATCH if (th->getPendingException()) { th->throwFromJava(); } #endif Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaRuntimeJIT.cpp Tue Nov 30 17:56:44 2010 @@ -52,8 +52,12 @@ // Since the function is marked readnone, LLVM may move it after the // exception check. Therefore, we trick LLVM to check the return value of the // function. - JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return (JavaMethod*)obj; +#define hack_check(type) \ + JavaObject* obj = JavaThread::get()->getPendingException(); \ + if (obj) return (type)obj; + + hack_check(void*); + return res; } @@ -85,11 +89,8 @@ END_NATIVE_EXCEPTION - // Since the function is marked readnone, LLVM may move it after the - // exception check. Therefore, we trick LLVM to check the return value of the - // function. - JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return (void*)obj; + hack_check(void*); + return res; } @@ -130,11 +131,8 @@ END_NATIVE_EXCEPTION - // Since the function is marked readnone, LLVM may move it after the - // exception check. Therefore, we trick LLVM to check the return value of the - // function. - JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return (void*)obj; + hack_check(void*); + return res; } @@ -208,11 +206,9 @@ END_NATIVE_EXCEPTION - // Since the function is marked readnone, LLVM may move it after the - // exception check. Therefore, we trick LLVM to check the return value of the - // function. - JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return (void*)obj; + + hack_check(void*); + return res; } @@ -226,11 +222,8 @@ END_NATIVE_EXCEPTION - // Since the function is marked readnone, LLVM may move it after the - // exception check. Therefore, we trick LLVM to check the return value of the - // function. - JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return (UserCommonClass*)obj; + hack_check(UserCommonClass*); + return cl; } @@ -244,11 +237,8 @@ res = cl->getClassDelegatee(vm); END_NATIVE_EXCEPTION - // Since the function is marked readnone, LLVM may move it after the - // exception check. Therefore, we trick LLVM to check the return value of the - // function. - JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return obj; + hack_check(JavaObject*); + return res; } @@ -328,11 +318,8 @@ END_NATIVE_EXCEPTION - // Since the function is marked readnone, LLVM may move it after the - // exception check. Therefore, we trick LLVM to check the return value of the - // function. - JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return (JavaVirtualTable*)obj; + hack_check(JavaVirtualTable*); + return res; } @@ -400,11 +387,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -421,11 +404,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -442,11 +421,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -463,11 +438,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -484,11 +455,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -508,11 +475,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -532,11 +495,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -553,11 +512,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); return exc; } @@ -575,11 +530,7 @@ END_NATIVE_EXCEPTION -#ifdef DWARF_EXCEPTIONS - th->throwException(exc); -#else - th->pendingException = exc; -#endif + th->setPendingException(exc)->throwFromNative(); } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Tue Nov 30 17:56:44 2010 @@ -64,29 +64,24 @@ #endif } -void JavaThread::preparePendingException(JavaObject *obj) { +JavaThread* JavaThread::setPendingException(JavaObject *obj) { llvm_gcroot(obj, 0); assert(JavaThread::get()->pendingException == 0 && "pending exception already there?"); mvm::Thread* mut = mvm::Thread::get(); j3Thread(mut)->pendingException = obj; -#ifdef DWARF_EXCEPTIONS - throwPendingException(); -#endif } -void JavaThread::throwException(JavaObject* obj) { - llvm_gcroot(obj, 0); - assert(JavaThread::get()->pendingException == 0 && "pending exception already there?"); - mvm::Thread* mut = mvm::Thread::get(); - j3Thread(mut)->pendingException = obj; - throwPendingException(); -} - -void JavaThread::throwPendingException() { +void JavaThread::throwIt() { assert(JavaThread::get()->pendingException); mvm::Thread::get()->internalThrowException(); } +void JavaThread::throwException(JavaObject* obj) { + llvm_gcroot(obj, 0); + setPendingException(obj); + throwIt(); +} + void JavaThread::startJNI() { // Interesting, but no need to do anything. } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Tue Nov 30 17:56:44 2010 @@ -157,17 +157,17 @@ return javaThread; } - /// preparePendingException - set the pending exception and throw it if in dwarf + /// setException - only set the pending exception /// - void preparePendingException(JavaObject *obj); + JavaThread* setPendingException(JavaObject *obj); /// throwException - Throw the given exception in the current thread. /// void throwException(JavaObject* obj); - /// throwPendingException - Throw a pending exception. + /// throwIt - Throw a pending exception. /// - void throwPendingException(); + void throwIt(); /// clearPendingException - Clear the pending exception. // @@ -190,14 +190,14 @@ /// void throwFromNative() { #ifdef DWARF_EXCEPTIONS - throwPendingException(); + throwIt(); #endif } /// throwFromJava - Throw an exception after executing Java code. /// void throwFromJava() { - throwPendingException(); + throwIt(); } /// startJava - Interesting, but actually does nothing :) Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jni.cpp Tue Nov 30 17:56:44 2010 @@ -173,7 +173,7 @@ false, true, 0); str = vm->asciizToStr(msg); init->invokeIntSpecial(vm, realCl, res, &str); - JavaThread::j3Thread(mut)->pendingException = res; + JavaThread::j3Thread(mut)->setPendingException(res); RETURN_FROM_JNI(1); @@ -187,7 +187,7 @@ BEGIN_JNI_EXCEPTION - JavaObject* obj = JavaThread::get()->pendingException; + JavaObject* obj = JavaThread::get()->getPendingException(); llvm_gcroot(obj, 0); if (obj == NULL) RETURN_FROM_JNI(NULL); jthrowable res = (jthrowable)JavaThread::j3Thread(mut)->pushJNIRef(obj); @@ -3584,7 +3584,7 @@ jboolean ExceptionCheck(JNIEnv *env) { BEGIN_JNI_EXCEPTION - if (JavaThread::get()->pendingException) { + if (JavaThread::get()->getPendingException()) { RETURN_FROM_JNI(JNI_TRUE); } else { RETURN_FROM_JNI(JNI_FALSE); Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp Tue Nov 30 17:56:44 2010 @@ -149,7 +149,7 @@ JavaThread* th = JavaThread::get(); if (th->getPendingException() != NULL) { - th->throwPendingException(); + th->throwIt(); return; } } @@ -1208,11 +1208,11 @@ } CATCH { } END_CATCH; - exc = JavaThread::get()->pendingException; + exc = JavaThread::get()->getPendingException(); + printf("Exception: %p\n", exc); if (exc != NULL) { - mvm::Thread* mut = mvm::Thread::get(); - mut->clearPendingException(); - JavaThread* th = JavaThread::j3Thread(mut); + JavaThread* th = JavaThread::get(); + th->clearPendingException(); obj = th->currentThread(); group = upcalls->group->getInstanceObjectField(obj); TRY { @@ -1286,7 +1286,7 @@ TRY { vm->loadBootstrap(); } CATCH { - exc = JavaThread::get()->pendingException; + exc = JavaThread::get()->getPendingException(); } END_CATCH; if (exc != NULL) { Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=120502&r1=120501&r2=120502&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JnjvmClassLoader.cpp Tue Nov 30 17:56:44 2010 @@ -694,7 +694,7 @@ classes->lock.unlock(); assert(success && "Could not add class in map"); } CATCH { - excp = JavaThread::get()->pendingException; + excp = JavaThread::get()->getPendingException(); mvm::Thread::get()->clearPendingException(); } END_CATCH; } From gael.thomas at lip6.fr Tue Nov 30 23:22:08 2010 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 01 Dec 2010 07:22:08 -0000 Subject: [vmkit-commits] [vmkit] r120561 - in /vmkit/branches/multi-vm: include/j3/J3Intrinsics.h include/mvm/JIT.h include/mvm/Threads/Thread.h lib/J3/Compiler/ExceptionsCheck.inc lib/J3/Compiler/J3Intrinsics.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h lib/J3/LLVMRuntime/runtime-default.ll lib/J3/VMCore/JavaThread.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/VirtualTables.cpp lib/Mvm/CommonThread/ctthread.cpp lib/Mvm/Compiler/JIT.cpp lib/Mvm/Compiler/mvm-runtime.ll Message-ID: <20101201072208.EE2A42A6C12D@llvm.org> Author: gthomas Date: Wed Dec 1 01:22:08 2010 New Revision: 120561 URL: http://llvm.org/viewvc/llvm-project?rev=120561&view=rev Log: Move pendingException in mvm::Thread. Don't forget to trace the JavaThread. Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h vmkit/branches/multi-vm/include/mvm/JIT.h vmkit/branches/multi-vm/include/mvm/Threads/Thread.h vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll Modified: vmkit/branches/multi-vm/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/j3/J3Intrinsics.h?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/j3/J3Intrinsics.h (original) +++ vmkit/branches/multi-vm/include/j3/J3Intrinsics.h Wed Dec 1 01:22:08 2010 @@ -29,6 +29,7 @@ const llvm::Type* JavaArrayObjectType; const llvm::Type* JavaObjectType; + const llvm::Type* JavaObjectPtrType; const llvm::Type* JavaArrayType; const llvm::Type* JavaCommonClassType; const llvm::Type* JavaClassType; Modified: vmkit/branches/multi-vm/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/JIT.h?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/JIT.h (original) +++ vmkit/branches/multi-vm/include/mvm/JIT.h Wed Dec 1 01:22:08 2010 @@ -182,6 +182,8 @@ llvm::Constant* OffsetVMInThreadConstant; llvm::Constant* OffsetCXXExceptionInThreadConstant; llvm::Constant* OffsetVMDataInThreadConstant; + llvm::Constant* OffsetPendingExceptionInThreadConstant; + llvm::Constant* OffsetThreadInMutatorThreadConstant; }; Modified: vmkit/branches/multi-vm/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/include/mvm/Threads/Thread.h?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/include/mvm/Threads/Thread.h (original) +++ vmkit/branches/multi-vm/include/mvm/Threads/Thread.h Wed Dec 1 01:22:08 2010 @@ -34,6 +34,8 @@ #define END_CATCH } #endif +class gc; + namespace mvm { class MethodInfo; @@ -150,6 +152,8 @@ this->mut = m; } + virtual void tracer(uintptr_t closure) = 0; + virtual ~VMThreadData() {} // force the construction of a VT }; @@ -160,11 +164,12 @@ public: Thread() { #ifdef RUNTIME_DWARF_EXCEPTIONS - internalPendingException = 0; + internalPendingException = 0; #else - lastExceptionBuffer = 0; + lastExceptionBuffer = 0; #endif - lastKnownFrame = 0; + lastKnownFrame = 0; + pendingException = 0; } /// yield - Yield the processor to another thread. @@ -240,10 +245,10 @@ public: - /// tracer - Does nothing. Used for child classes which may defined - /// a tracer. + /// tracer - trace the pendingException and the vmData /// - virtual void tracer(uintptr_t closure) {} + virtual void tracer(uintptr_t closure); + void scanStack(uintptr_t closure); void* getLastSP() { return lastSP; } @@ -351,6 +356,10 @@ /// vmData - vm specific data /// VMThreadData* vmData; + + /// pendingException - the pending exception + /// + gc* pendingException; }; #ifndef RUNTIME_DWARF_EXCEPTIONS Modified: vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/ExceptionsCheck.inc Wed Dec 1 01:22:08 2010 @@ -8,7 +8,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); + Value* exceptionPtr = getPendingExceptionPtr(getMutatorThreadPtr()); // Get the Java exception. Value* obj = 0; @@ -28,13 +28,13 @@ // 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, "", TheCompiler->useCooperativeGC(), currentBlock); + obj = new LoadInst(exceptionPtr, "", 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, ""); test = BinaryOperator::CreateAnd(test, T, "", currentBlock); } else { - obj = new LoadInst(javaExceptionPtr, "", currentBlock); + obj = new LoadInst(exceptionPtr, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); } @@ -61,7 +61,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); + Value* exceptionPtr = getPendingExceptionPtr(getMutatorThreadPtr()); // Get the Java exception. Value* obj = 0; @@ -74,13 +74,13 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); + obj = new LoadInst(exceptionPtr, "", 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, ""); test = BinaryOperator::CreateAnd(test, T, "", currentBlock); } else { - obj = new LoadInst(javaExceptionPtr, "", currentBlock); + obj = new LoadInst(exceptionPtr, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); } @@ -108,7 +108,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); + Value* exceptionPtr = getPendingExceptionPtr(getMutatorThreadPtr()); // Get the Java exception. Value* obj = 0; @@ -121,13 +121,13 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); + obj = new LoadInst(exceptionPtr, "", 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, ""); test = BinaryOperator::CreateAnd(test, T, "", currentBlock); } else { - obj = new LoadInst(javaExceptionPtr, "", currentBlock); + obj = new LoadInst(exceptionPtr, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); } @@ -152,7 +152,7 @@ res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { - Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); + Value* exceptionPtr = getPendingExceptionPtr(getMutatorThreadPtr()); // Get the Java exception. Value* obj = 0; @@ -165,13 +165,13 @@ F == intrinsics->GetConstantPoolAtFunction || F == intrinsics->GetArrayClassFunction || F == intrinsics->GetClassDelegateeFunction) { - obj = new LoadInst(javaExceptionPtr, "", TheCompiler->useCooperativeGC(), currentBlock); + obj = new LoadInst(exceptionPtr, "", 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, ""); test = BinaryOperator::CreateAnd(test, T, "", currentBlock); } else { - obj = new LoadInst(javaExceptionPtr, "", currentBlock); + obj = new LoadInst(exceptionPtr, "", currentBlock); test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, obj, zero, ""); } @@ -210,9 +210,9 @@ void JavaJIT::throwException(Value* obj) { JITVerifyNull(obj); - Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); + Value* exceptionPtr = getPendingExceptionPtr(getMutatorThreadPtr()); - new StoreInst(obj, javaExceptionPtr, currentBlock); + new StoreInst(obj, exceptionPtr, currentBlock); if (currentExceptionBlock != endExceptionBlock) { Instruction* insn = currentExceptionBlock->begin(); PHINode* node = dyn_cast(insn); @@ -458,10 +458,10 @@ currentBlock = cur->javaHandler; // First thing in the handler: clear the exception. - Value* javaExceptionPtr = getJavaExceptionPtr(getJavaThreadPtr(getMutatorThreadPtr())); + Value* exceptionPtr = getPendingExceptionPtr(getMutatorThreadPtr()); // Clear exceptions. - new StoreInst(intrinsics->JavaObjectNullConstant, javaExceptionPtr, + new StoreInst(intrinsics->JavaObjectNullConstant, exceptionPtr, currentBlock); #if defined(SERVICE) Modified: vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/J3Intrinsics.cpp Wed Dec 1 01:22:08 2010 @@ -46,6 +46,8 @@ JavaObjectType = PointerType::getUnqual(module->getTypeByName("JavaObject")); + JavaObjectPtrType = PointerType::getUnqual(JavaObjectType); + JavaArrayType = PointerType::getUnqual(module->getTypeByName("JavaArray")); @@ -140,7 +142,6 @@ OffsetInitializedInTaskClassMirrorConstant = constantOne; OffsetJNIInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); - OffsetJavaExceptionInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); ClassReadyConstant = ConstantInt::get(Type::getInt8Ty(Context), ready); Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.cpp Wed Dec 1 01:22:08 2010 @@ -305,6 +305,15 @@ return GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); } +llvm::Value* JavaJIT::getPendingExceptionPtr(llvm::Value* mutatorThreadPtr) { + Value* GEP[3] = { intrinsics->constantZero, + intrinsics->OffsetThreadInMutatorThreadConstant, + intrinsics->OffsetPendingExceptionInThreadConstant }; + + Value* res = GetElementPtrInst::Create(mutatorThreadPtr, GEP, GEP + 3, "", currentBlock); + return new BitCastInst(res, intrinsics->JavaObjectPtrType, "", currentBlock); +} + llvm::Value* JavaJIT::getJavaThreadPtr(llvm::Value* mutatorThreadPtr) { Value* GEP[3] = { intrinsics->constantZero, intrinsics->OffsetThreadInMutatorThreadConstant, @@ -323,13 +332,6 @@ return new BitCastInst(res, intrinsics->ptrType, "", currentBlock); } -llvm::Value* JavaJIT::getJavaExceptionPtr(llvm::Value* javaThreadPtr) { - Value* GEP[2] = { intrinsics->constantZero, - intrinsics->OffsetJavaExceptionInJavaThreadConstant }; - - return GetElementPtrInst::Create(javaThreadPtr, GEP, GEP + 2, "", currentBlock); -} - extern "C" void j3ThrowExceptionFromJIT(); Modified: vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/branches/multi-vm/lib/J3/Compiler/JavaJIT.h Wed Dec 1 01:22:08 2010 @@ -152,14 +152,14 @@ /// getCXXExceptionPtr - Emit code to get a pointer to internalPendingException. llvm::Value* getCXXExceptionPtr(llvm::Value* mutatorThreadPtr); + /// getPendingExceptionPtr - Emit code to get a pointer to the Java pending exception + llvm::Value* getPendingExceptionPtr(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/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/branches/multi-vm/lib/J3/LLVMRuntime/runtime-default.ll Wed Dec 1 01:22:08 2010 @@ -24,7 +24,10 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } -%JavaThread = type { %VMThreadData, i8*, %JavaObject* } +;;; The Java Thread +;;; Field 1: VMThreadData parent +;;; Field 2: void* jniEnv +%JavaThread = type { %VMThreadData, i8* } %JavaConstantPool = type { %JavaClass*, i32, i8*, i32*, i8** } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.cpp Wed Dec 1 01:22:08 2010 @@ -21,7 +21,6 @@ JavaThread::JavaThread(mvm::MutatorThread* mut, Jnjvm* isolate) : mvm::VMThreadData(mut) { - pendingException = NULL; jniEnv = isolate->jniEnv; localJNIRefs = new JNILocalReferences(); currentAddedReferences = NULL; @@ -66,13 +65,12 @@ JavaThread* JavaThread::setPendingException(JavaObject *obj) { llvm_gcroot(obj, 0); - assert(JavaThread::get()->pendingException == 0 && "pending exception already there?"); - mvm::Thread* mut = mvm::Thread::get(); - j3Thread(mut)->pendingException = obj; + assert(mvm::Thread::get()->pendingException == 0 && "pending exception already there?"); + mvm::Thread::get()->pendingException = obj; } void JavaThread::throwIt() { - assert(JavaThread::get()->pendingException); + assert(mvm::Thread::get()->pendingException); mvm::Thread::get()->internalThrowException(); } Modified: vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/JavaThread.h Wed Dec 1 01:22:08 2010 @@ -71,10 +71,6 @@ /// jniEnv - The JNI environment of the thread. /// void* jniEnv; - - /// pendingException - The Java exception currently pending. - /// - JavaObject* pendingException; /// javaThread - The Java representation of this thread. /// @@ -171,12 +167,12 @@ /// clearPendingException - Clear the pending exception. // - void clearPendingException() { pendingException = 0; } + void clearPendingException() { mut->pendingException = 0; } /// getPendingException - Return the pending exception. /// JavaObject* getPendingException() { - return pendingException; + return (JavaObject*)mut->pendingException; } /// throwFromJNI - Throw an exception after executing JNI code. Modified: vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/Jnjvm.cpp Wed Dec 1 01:22:08 2010 @@ -1209,7 +1209,7 @@ } END_CATCH; exc = JavaThread::get()->getPendingException(); - printf("Exception: %p\n", exc); + if (exc != NULL) { JavaThread* th = JavaThread::get(); th->clearPendingException(); Modified: vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/branches/multi-vm/lib/J3/VMCore/VirtualTables.cpp Wed Dec 1 01:22:08 2010 @@ -254,8 +254,7 @@ // // The threads must trace: // (1) Their stack (already done by the GC in the case of GCMmap2 or Boehm) -// (2) Their pending exception if there is one. -// (3) The java.lang.Thread delegate. +// (2) The java.lang.Thread delegate. //===----------------------------------------------------------------------===// @@ -328,7 +327,6 @@ } void JavaThread::tracer(uintptr_t closure) { - mvm::Collector::markAndTraceRoot(&pendingException, closure); mvm::Collector::markAndTraceRoot(&javaThread, closure); mvm::Collector::markAndTraceRoot(&vmThread, closure); #ifdef SERVICE Modified: vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/branches/multi-vm/lib/Mvm/CommonThread/ctthread.cpp Wed Dec 1 01:22:08 2010 @@ -30,6 +30,11 @@ using namespace mvm; +void Thread::tracer(uintptr_t closure) { + mvm::Collector::markAndTraceRoot(&pendingException, closure); + vmData->tracer(closure); +} + int Thread::kill(void* tid, int signo) { return pthread_kill((pthread_t)tid, signo); } Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/JIT.cpp Wed Dec 1 01:22:08 2010 @@ -331,6 +331,8 @@ OffsetDoYieldInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 4); OffsetCXXExceptionInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 11); OffsetVMDataInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 12); + OffsetPendingExceptionInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 13); + OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); } Modified: vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll?rev=120561&r1=120560&r2=120561&view=diff ============================================================================== --- vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll (original) +++ vmkit/branches/multi-vm/lib/Mvm/Compiler/mvm-runtime.ll Wed Dec 1 01:22:08 2010 @@ -20,7 +20,8 @@ ;;; field 10: void* lastKnownFrame ;;; field 11: void* lastExceptionBuffer ;;; field 12: void* vmData -%Thread = type { %CircularBase, i32, i8*, i8*, i1, i1, i1, i8*, i8*, i8*, i8*, i8*, i8* } +;;; field 13: gc* pendingException +%Thread = type { %CircularBase, i32, i8*, i8*, i1, i1, i1, i8*, i8*, i8*, i8*, i8*, i8*, i8* } %VMThreadData = type { %VT*, %Thread* } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;