From nicolas.geoffray at lip6.fr Thu Apr 1 07:43:51 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 01 Apr 2010 14:43:51 -0000 Subject: [vmkit-commits] [vmkit] r100108 - in /vmkit/branches/release_027/lib/Mvm/MMTk: MvmGC.cpp MvmGC.h Message-ID: <20100401144352.027142A6C12C@llvm.org> Author: geoffray Date: Thu Apr 1 09:43:51 2010 New Revision: 100108 URL: http://llvm.org/viewvc/llvm-project?rev=100108&view=rev Log: Fix build error on MAcosX Modified: vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.cpp vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.h Modified: vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.cpp?rev=100108&r1=100107&r2=100108&view=diff ============================================================================== --- vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.cpp (original) +++ vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.cpp Thu Apr 1 09:43:51 2010 @@ -31,7 +31,7 @@ return res; } -extern "C" void* gcmallocUnresolved(size_t sz, VirtualTable* VT) { +extern "C" void* gcmallocUnresolved(uint32_t sz, VirtualTable* VT) { gc* res = (gc*)gcmalloc(sz, VT); if (VT->destructor) mvm::Thread::get()->MyVM->addFinalizationCandidate(res); Modified: vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.h?rev=100108&r1=100107&r2=100108&view=diff ============================================================================== --- vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.h (original) +++ vmkit/branches/release_027/lib/Mvm/MMTk/MvmGC.h Thu Apr 1 09:43:51 2010 @@ -28,7 +28,7 @@ #define CALL_TRACER tracer() -extern "C" void* gcmallocUnresolved(size_t sz, VirtualTable* VT); +extern "C" void* gcmallocUnresolved(uint32_t sz, VirtualTable* VT); class gc : public gcRoot { public: From nicolas.geoffray at lip6.fr Sun Apr 4 06:04:19 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 04 Apr 2010 13:04:19 -0000 Subject: [vmkit-commits] [vmkit] r100329 - in /vmkit/trunk: include/mvm/Allocator.h lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/Compiler/JavaJITOpcodes.cpp Message-ID: <20100404130419.33C932A6C12C@llvm.org> Author: geoffray Date: Sun Apr 4 08:04:18 2010 New Revision: 100329 URL: http://llvm.org/viewvc/llvm-project?rev=100329&view=rev Log: LLVM API change on debug locations. Modified: vmkit/trunk/include/mvm/Allocator.h 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 Modified: vmkit/trunk/include/mvm/Allocator.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Allocator.h?rev=100329&r1=100328&r2=100329&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Allocator.h (original) +++ vmkit/trunk/include/mvm/Allocator.h Sun Apr 4 08:04:18 2010 @@ -58,7 +58,7 @@ const char* name) { return allocator.Allocate(sz, name); } - + void operator delete(void* ptr) { free(ptr); } @@ -67,6 +67,14 @@ const char* name) { return allocator.Allocate(sz, name); } + + void* operator new[](size_t sz) { + return malloc(sz); + } + + void operator delete[](void* ptr) { + return free(ptr); + } }; /// JITInfo - This class can be derived from to hold private JIT-specific Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=100329&r1=100328&r2=100329&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sun Apr 4 08:04:18 2010 @@ -523,6 +523,16 @@ UTF8Buffer(compilingClass->name).cString(), UTF8Buffer(compilingMethod->name).cString()); + if (codeInfo.size()) { + mvm::BumpPtrAllocator& Alloc = compilingClass->classLoader->allocator; + compilingMethod->codeInfo = + new(Alloc, "CodeLineInfo") 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; + } + } return llvmFunction; } @@ -1324,7 +1334,7 @@ #ifndef DWARF_EXCEPTIONS if (codeLen < 5 && !callsStackWalker && !TheCompiler->isStaticCompiling()) - compilingMethod->canBeInlined = true; + compilingMethod->canBeInlined = false; #endif Attribut* annotationsAtt = @@ -1345,6 +1355,15 @@ } } } + + 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; + } + } return llvmFunction; } @@ -2590,10 +2609,10 @@ } MDNode* JavaJIT::CreateLocation() { - uint32_t first = currentLineNumber | (currentBytecodeIndex << 16); - uint32_t second = currentCtpIndex | (callNumber << 16); + LineInfo LI = { currentLineNumber, currentCtpIndex, currentBytecodeIndex }; + codeInfo.push_back(LI); DILocation Location = TheCompiler->getDebugFactory()->CreateLocation( - first, second, DIScope(DbgSubprogram)); + callNumber, 0, DIScope(DbgSubprogram)); callNumber++; return Location.getNode(); } Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=100329&r1=100328&r2=100329&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Sun Apr 4 08:04:18 2010 @@ -63,6 +63,12 @@ }; +struct LineInfo { + uint16 lineNumber; + uint16 ctpIndex; + uint16 bytecodeIndex; +}; + /// JavaJIT - The compilation engine of J3. Parses the bycode and returns /// its LLVM representation. /// @@ -163,6 +169,9 @@ /// CreateLocation - Create debug information for a call. llvm::MDNode* CreateLocation(); + // codeInfo - List of LineInfo for this method. + std::vector codeInfo; + //===--------------------------- Inline support ---------------------------===// /// inlineCompile - Parse the method and start its LLVM representation Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=100329&r1=100328&r2=100329&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sun Apr 4 08:04:18 2010 @@ -101,17 +101,26 @@ uint32 infoLength = Details.LineStarts.size(); currentCompiledMethod->codeInfoLength = infoLength; if (infoLength) { - currentCompiledMethod->codeInfo = + CodeLineInfo* infoTable = new(Alloc, "CodeLineInfo") CodeLineInfo[infoLength]; for (uint32 i = 0; i < infoLength; ++i) { - DILocation DLT = Details.MF->getDILocation(Details.LineStarts[i].Loc); - uint32_t first = DLT.getLineNumber(); - uint32_t second = DLT.getColumnNumber(); - currentCompiledMethod->codeInfo[i].address = - Details.LineStarts[i].Address; - currentCompiledMethod->codeInfo[i].lineNumber = first & 0xFFFF; - currentCompiledMethod->codeInfo[i].bytecodeIndex = first >> 16; - currentCompiledMethod->codeInfo[i].ctpIndex = second & 0xFFFF; + 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 = + currentCompiledMethod->codeInfo[first].lineNumber; + infoTable[i].bytecodeIndex = + currentCompiledMethod->codeInfo[first].bytecodeIndex; + infoTable[i].ctpIndex = + currentCompiledMethod->codeInfo[first].ctpIndex; + } + delete[] currentCompiledMethod->codeInfo; + currentCompiledMethod->codeInfo = infoTable; + } else { + if (currentCompiledMethod->codeInfo) { + delete[] currentCompiledMethod->codeInfo; } } } Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=100329&r1=100328&r2=100329&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sun Apr 4 08:04:18 2010 @@ -173,7 +173,6 @@ currentCtpIndex = -1; currentBytecodeIndex = i; - callNumber = 0; // To prevent a gcj bug with useless goto if (currentBlock->getTerminator() != 0) { From nicolas.geoffray at lip6.fr Sat Apr 10 09:15:40 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Apr 2010 16:15:40 -0000 Subject: [vmkit-commits] [vmkit] r100929 - /vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Message-ID: <20100410161540.5D5292A6C12C@llvm.org> Author: geoffray Date: Sat Apr 10 11:15:40 2010 New Revision: 100929 URL: http://llvm.org/viewvc/llvm-project?rev=100929&view=rev Log: Do a try catch on loadBootstrap so that we can debug if something went wrong. Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=100929&r1=100928&r2=100929&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sat Apr 10 11:15:40 2010 @@ -1235,41 +1235,51 @@ JavaString* str = 0; JavaObject* instrumenter = 0; ArrayObject* args = 0; + JavaObject* exc = 0; llvm_gcroot(str, 0); llvm_gcroot(instrumenter, 0); llvm_gcroot(args, 0); + llvm_gcroot(exc, 0); Jnjvm* vm = thread->getJVM(); vm->mainThread = thread; - vm->loadBootstrap(); + try { + vm->loadBootstrap(); + } catch (...) { + exc = JavaThread::get()->pendingException; + } + if (exc != NULL) { + assert(exc && "No Java exception"); + fprintf(stderr, "Exception %s while bootstraping VM", + UTF8Buffer(exc->getClass()->name).cString()); + } else { #ifdef SERVICE - thread->ServiceException = vm->upcalls->newThrowable->doNew(vm); + thread->ServiceException = vm->upcalls->newThrowable->doNew(vm); #endif - ClArgumentsInfo& info = vm->argumentsInfo; + ClArgumentsInfo& info = vm->argumentsInfo; - if (info.agents.size()) { - assert(0 && "implement me"); - instrumenter = 0;//createInstrumenter(); - for (std::vector< std::pair >::iterator i = - info.agents.begin(), - e = info.agents.end(); i!= e; ++i) { - str = vm->asciizToStr(i->second); - vm->executePremain(i->first, str, instrumenter); + if (info.agents.size()) { + assert(0 && "implement me"); + instrumenter = 0;//createInstrumenter(); + for (std::vector< std::pair >::iterator i = + info.agents.begin(), e = info.agents.end(); i!= e; ++i) { + str = vm->asciizToStr(i->second); + vm->executePremain(i->first, str, instrumenter); + } } - } - UserClassArray* array = vm->bootstrapLoader->upcalls->ArrayOfString; - args = (ArrayObject*)array->doNew(info.argc - 2, vm); - for (int i = 2; i < info.argc; ++i) { - args->elements[i - 2] = (JavaObject*)vm->asciizToStr(info.argv[i]); - } + UserClassArray* array = vm->bootstrapLoader->upcalls->ArrayOfString; + args = (ArrayObject*)array->doNew(info.argc - 2, vm); + for (int i = 2; i < info.argc; ++i) { + args->elements[i - 2] = (JavaObject*)vm->asciizToStr(info.argv[i]); + } - vm->executeClass(info.className, args); - + vm->executeClass(info.className, args); + } vm->threadSystem.nonDaemonLock.lock(); --(vm->threadSystem.nonDaemonThreads); if (vm->threadSystem.nonDaemonThreads == 0) From nicolas.geoffray at lip6.fr Sat Apr 10 13:22:57 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Apr 2010 20:22:57 -0000 Subject: [vmkit-commits] [vmkit] r100947 - /vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Message-ID: <20100410202257.B7FD92A6C12C@llvm.org> Author: geoffray Date: Sat Apr 10 15:22:57 2010 New Revision: 100947 URL: http://llvm.org/viewvc/llvm-project?rev=100947&view=rev Log: Typo. Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=100947&r1=100946&r2=100947&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sat Apr 10 15:22:57 2010 @@ -1252,8 +1252,7 @@ } if (exc != NULL) { - assert(exc && "No Java exception"); - fprintf(stderr, "Exception %s while bootstraping VM", + fprintf(stderr, "Exception %s while bootstrapping VM.", UTF8Buffer(exc->getClass()->name).cString()); } else { #ifdef SERVICE From nicolas.geoffray at lip6.fr Sat Apr 10 13:38:21 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Apr 2010 20:38:21 -0000 Subject: [vmkit-commits] [vmkit] r100948 - /vmkit/trunk/www/get_started.html Message-ID: <20100410203821.207582A6C12C@llvm.org> Author: geoffray Date: Sat Apr 10 15:38:20 2010 New Revision: 100948 URL: http://llvm.org/viewvc/llvm-project?rev=100948&view=rev Log: Update get started. Modified: vmkit/trunk/www/get_started.html Modified: vmkit/trunk/www/get_started.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/get_started.html?rev=100948&r1=100947&r2=100948&view=diff ============================================================================== --- vmkit/trunk/www/get_started.html (original) +++ vmkit/trunk/www/get_started.html Sat Apr 10 15:38:20 2010 @@ -65,14 +65,28 @@
  • cd classpath-0.97.2
  • ./configure --disable-plugin --disable-examples --disable-Werror; make
  • cd lib
  • -
  • ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.so;
  • -
  • ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.so;
  • -
  • ln -s ../native/jni/java-io/.libs/libjavaio.so;
  • -
  • ln -s ../native/jni/java-lang/.libs/libjavalangreflect.so;
  • -
  • ln -s ../native/jni/java-lang/.libs/libjavalang.so;
  • -
  • ln -s ../native/jni/java-net/.libs/libjavanet.so;
  • -
  • ln -s ../native/jni/java-nio/.libs/libjavanio.so;
  • -
  • ln -s ../native/jni/java-util/.libs/libjavautil.so;
  • +
  • If you are running on Linux:
  • +
      +
    • ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.so;
    • +
    • ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.so;
    • +
    • ln -s ../native/jni/java-io/.libs/libjavaio.so;
    • +
    • ln -s ../native/jni/java-lang/.libs/libjavalangreflect.so;
    • +
    • ln -s ../native/jni/java-lang/.libs/libjavalang.so;
    • +
    • ln -s ../native/jni/java-net/.libs/libjavanet.so;
    • +
    • ln -s ../native/jni/java-nio/.libs/libjavanio.so;
    • +
    • ln -s ../native/jni/java-util/.libs/libjavautil.so;
    • +
    +
  • If you are running on MacOS:
  • +
      +
    • ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.dylib;
    • +
    • ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.dylib;
    • +
    • ln -s ../native/jni/java-io/.libs/libjavaio.dylib;
    • +
    • ln -s ../native/jni/java-lang/.libs/libjavalangreflect.dylib;
    • +
    • ln -s ../native/jni/java-lang/.libs/libjavalang.dylib;
    • +
    • ln -s ../native/jni/java-net/.libs/libjavanet.dylib;
    • +
    • ln -s ../native/jni/java-nio/.libs/libjavanio.dylib;
    • +
    • ln -s ../native/jni/java-util/.libs/libjavautil.dylib;
    • +
  • Download From nicolas.geoffray at lip6.fr Sun Apr 11 09:26:48 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 11 Apr 2010 16:26:48 -0000 Subject: [vmkit-commits] [vmkit] r100963 - in /vmkit/trunk: include/j3/ include/mvm/GC/ lib/J3/Compiler/ lib/J3/VMCore/ lib/Mvm/CommonThread/ lib/Mvm/GCMmap2/ lib/Mvm/MMTk/ lib/Mvm/Runtime/ lib/N3/VMCore/ mmtk/mmtk-alloc/ mmtk/mmtk-j3/ Message-ID: <20100411162648.D72712A6C12C@llvm.org> Author: geoffray Date: Sun Apr 11 11:26:48 2010 New Revision: 100963 URL: http://llvm.org/viewvc/llvm-project?rev=100963&view=rev Log: Code cleanup and start working on specialized tracing for MMTk. Modified: vmkit/trunk/include/j3/JavaLLVMCompiler.h vmkit/trunk/include/mvm/GC/GC.h vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/JavaObject.h vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp vmkit/trunk/lib/Mvm/MMTk/MvmGC.h vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp vmkit/trunk/lib/N3/VMCore/LockedMap.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp vmkit/trunk/mmtk/mmtk-j3/Collection.cpp vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/trunk/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaLLVMCompiler.h?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/trunk/include/j3/JavaLLVMCompiler.h Sun Apr 11 11:26:48 2010 @@ -17,6 +17,8 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" +#include + namespace llvm { class BasicBlock; class DIFactory; Modified: vmkit/trunk/include/mvm/GC/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/GC/GC.h?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/include/mvm/GC/GC.h (original) +++ vmkit/trunk/include/mvm/GC/GC.h Sun Apr 11 11:26:48 2010 @@ -12,27 +12,8 @@ #define MVM_GC_H #include -#include -struct VirtualTable { - uintptr_t destructor; - uintptr_t operatorDelete; - uintptr_t tracer; - - uintptr_t* getFunctions() { - return &destructor; - } - - VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t) { - destructor = d; - operatorDelete = o; - tracer = t; - } - - VirtualTable() {} - - static void emptyTracer(void*) {} -}; +struct VirtualTable; class gcRoot { public: Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Sun Apr 11 11:26:48 2010 @@ -108,12 +108,22 @@ JavaArraySizeOffsetConstant = constantOne; JavaObjectLockOffsetConstant = constantOne; JavaObjectVTOffsetConstant = constantZero; - OffsetClassInVTConstant = constantThree; - OffsetDepthInVTConstant = constantFour; - OffsetDisplayInVTConstant = constantSeven; + + OffsetClassInVTConstant = + ConstantInt::get(Type::getInt32Ty(Context), + JavaVirtualTable::getClassIndex()); + OffsetDepthInVTConstant = + ConstantInt::get(Type::getInt32Ty(Context), + JavaVirtualTable::getDepthIndex()); + OffsetDisplayInVTConstant = + ConstantInt::get(Type::getInt32Ty(Context), + JavaVirtualTable::getDisplayIndex()); OffsetBaseClassVTInVTConstant = - ConstantInt::get(Type::getInt32Ty(Context), 17); - OffsetIMTInVTConstant = ConstantInt::get(Type::getInt32Ty(Context), 18); + ConstantInt::get(Type::getInt32Ty(Context), + JavaVirtualTable::getBaseClassIndex()); + OffsetIMTInVTConstant = + ConstantInt::get(Type::getInt32Ty(Context), + JavaVirtualTable::getIMTIndex()); OffsetAccessInCommonClassConstant = constantOne; IsArrayConstant = ConstantInt::get(Type::getInt16Ty(Context), Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sun Apr 11 11:26:48 2010 @@ -1399,6 +1399,11 @@ Elemts.push_back(Tracer ? ConstantExpr::getCast(Instruction::BitCast, Tracer, PTy) : N); + + for (uint32_t i = 0; i < VirtualTable::numberOfSpecializedTracers(); i++) { + // Push null for now. + Elemts.push_back(N); + } // Class Elemts.push_back(ConstantExpr::getCast(Instruction::BitCast, Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.h?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.h Sun Apr 11 11:26:48 2010 @@ -131,13 +131,13 @@ /// getFirstJavaMethodIndex - Get the word offset of the first Java method. /// static uint32_t getFirstJavaMethodIndex() { - return 19; + return numberOfBaseFunctions() + 16; } /// getBaseSize - Get the size of the java.lang.Object virtual table. /// static uint32_t getBaseSize() { - return 30; + return numberOfBaseFunctions() + 27; } /// getNumJavaMethods - Get the number of methods of the java.lang.Object @@ -153,32 +153,62 @@ return 8; } - /// getCacheIndex - Get the word offset of the type cache. + /// getClassIndex - Get the word offset of the class. /// - static uint32_t getCacheIndex() { - return 6; + static uint32_t getClassIndex() { + return numberOfBaseFunctions(); + } + + /// getDepthIndex - Get the word offset of the depth. + /// + static uint32_t getDepthIndex() { + return numberOfBaseFunctions() + 1; } /// getOffsetIndex - Get the word offset of the type cache. /// static uint32_t getOffsetIndex() { - return 5; + return numberOfBaseFunctions() + 2; } - /// getSecondaryTypesIndex - Get the word offset of the secondary types - /// list. + /// getCacheIndex - Get the word offset of the type cache. /// - static uint32_t getSecondaryTypesIndex() { - return 16; + static uint32_t getCacheIndex() { + return numberOfBaseFunctions() + 3; + } + + /// getDisplayIndex - Get the word offset of the display. + /// + static uint32_t getDisplayIndex() { + return numberOfBaseFunctions() + 4; } /// getNumSecondaryTypesIndex - Get the word offset of the number of /// secondary types. /// static uint32_t getNumSecondaryTypesIndex() { - return 15; + return numberOfBaseFunctions() + 12; } - + + /// getSecondaryTypesIndex - Get the word offset of the secondary types + /// list. + /// + static uint32_t getSecondaryTypesIndex() { + return numberOfBaseFunctions() + 13; + } + + /// getBaseClassIndex - Get the word offset of the base class. + /// + static uint32_t getBaseClassIndex() { + return numberOfBaseFunctions() + 14; + } + + /// getIMTIndex - Get the word offset of the IMT. + /// + static uint32_t getIMTIndex() { + return numberOfBaseFunctions() + 15; + } + /// isSubtypeOf - Returns true if the given VT is a subtype of the this /// VT. /// Modified: vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp Sun Apr 11 11:26:48 2010 @@ -9,6 +9,8 @@ #include #include "MvmGC.h" +#include "mvm/VirtualMachine.h" +#include "mvm/Threads/CollectionRV.h" using namespace mvm; Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Sun Apr 11 11:26:48 2010 @@ -16,12 +16,34 @@ #include "gcalloc.h" #define gc_allocator std::allocator -#define gc_new(Class) __gc_new(Class::VT) Class -#define __gc_new new +struct VirtualTable { + uintptr_t destructor; + uintptr_t operatorDelete; + uintptr_t tracer; + + static uint32_t numberOfBaseFunctions() { + return 3; + } + + static uint32_t numberOfSpecializedTracers() { + return 0; + } -#define TRACER tracer() -#define CALL_TRACER tracer() + uintptr_t* getFunctions() { + return &destructor; + } + + VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t) { + destructor = d; + operatorDelete = o; + tracer = t; + } + + VirtualTable() {} + + static void emptyTracer(void*) {} +}; namespace mvm { Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp Sun Apr 11 11:26:48 2010 @@ -8,6 +8,8 @@ //===----------------------------------------------------------------------===// #include "MvmGC.h" +#include "MutatorThread.h" +#include "mvm/VirtualMachine.h" #include Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.h?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Sun Apr 11 11:26:48 2010 @@ -11,22 +11,39 @@ #ifndef MVM_MMTK_GC_H #define MVM_MMTK_GC_H -#include "MutatorThread.h" -#include "mvm/VirtualMachine.h" #include "mvm/GC/GC.h" +#include -#include "llvm/Support/MathExtras.h" +#define gc_allocator std::allocator +struct VirtualTable { + uintptr_t destructor; + uintptr_t operatorDelete; + uintptr_t tracer; + uintptr_t specializedTracers[1]; + + static uint32_t numberOfBaseFunctions() { + return 4; + } -#define gc_allocator std::allocator -#define gc_new(Class) __gc_new(Class::VT) Class -#define __gc_new new + static uint32_t numberOfSpecializedTracers() { + return 1; + } + uintptr_t* getFunctions() { + return &destructor; + } + + VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t) { + destructor = d; + operatorDelete = o; + tracer = t; + } -#define TRACER tracer() -#define MARK_AND_TRACE markAndTrace() -#define CALL_TRACER tracer() + VirtualTable() {} + static void emptyTracer(void*) {} +}; extern "C" void* gcmallocUnresolved(uint32_t sz, VirtualTable* VT); @@ -34,7 +51,6 @@ public: size_t objectSize() const { - fprintf(stderr, "Implement object size\n"); abort(); return 0; } Modified: vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Sun Apr 11 11:26:48 2010 @@ -9,9 +9,11 @@ #include "mvm/Allocator.h" #include "mvm/MethodInfo.h" +#include "mvm/VirtualMachine.h" #include "MvmGC.h" #include +#include #if defined(__MACH__) #define SELF_HANDLE RTLD_DEFAULT Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.h?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.h Sun Apr 11 11:26:48 2010 @@ -95,10 +95,10 @@ lock->unlock(); } - virtual void TRACER { + virtual void tracer() { //lock->MARK_AND_TRACE; for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->CALL_TRACER; + i->second->tracer(); } } Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sun Apr 11 11:26:48 2010 @@ -40,69 +40,69 @@ #define CALL_TRACER_VECTOR(type, name, alloc) { \ for (std::vector >::iterator i = name.begin(), e = name.end(); \ i!= e; ++i) { \ - (*i)->CALL_TRACER; }} + (*i)->tracer(); }} // internal objects -void VMThread::TRACER { +void VMThread::tracer() { mvm::Collector::markAndTraceRoot(&ooo_appThread); mvm::Collector::markAndTraceRoot(&ooo_pendingException); // I suppose that the vm is already traced by the gc - // vm->CALL_TRACER; + // vm->tracer(); } -void N3::TRACER { +void N3::tracer() { // If I understand, the gc already call trace for all VMThread // if (bootstrapThread) { -// bootstrapThread->CALL_TRACER; +// bootstrapThread->tracer(); // for (VMThread* th = (VMThread*)bootstrapThread->next(); // th != bootstrapThread; th = (VMThread*)th->next()) -// th->CALL_TRACER; +// th->tracer(); // } - loadedAssemblies->CALL_TRACER; + loadedAssemblies->tracer(); } -void Assembly::TRACER { - loadedNameClasses->CALL_TRACER; +void Assembly::tracer() { + loadedNameClasses->tracer(); mvm::Collector::markAndTraceRoot(&ooo_delegatee); } -void VMCommonClass::TRACER { +void VMCommonClass::tracer() { mvm::Collector::markAndTraceRoot(&ooo_delegatee); CALL_TRACER_VECTOR(VMMethod*, virtualMethods, std::allocator); CALL_TRACER_VECTOR(VMMethod*, staticMethods, std::allocator); CALL_TRACER_VECTOR(Property*, properties, gc_allocator); } -void VMClass::TRACER { - VMCommonClass::CALL_TRACER; +void VMClass::tracer() { + VMCommonClass::tracer(); mvm::Collector::markAndTraceRoot(&staticInstance); mvm::Collector::markAndTraceRoot(&virtualInstance); } -void VMGenericClass::TRACER { - VMClass::CALL_TRACER; +void VMGenericClass::tracer() { + VMClass::tracer(); } -void VMClassArray::TRACER { - VMCommonClass::CALL_TRACER; +void VMClassArray::tracer() { + VMCommonClass::tracer(); } -void VMClassPointer::TRACER { - VMCommonClass::CALL_TRACER; +void VMClassPointer::tracer() { + VMCommonClass::tracer(); } -void VMMethod::TRACER { +void VMMethod::tracer() { mvm::Collector::markAndTraceRoot(&ooo_delegatee); } -void VMGenericMethod::TRACER { - VMMethod::CALL_TRACER; +void VMGenericMethod::tracer() { + VMMethod::tracer(); } -void Property::TRACER { +void Property::tracer() { mvm::Collector::markAndTraceRoot(&ooo_delegatee); } // useless (never called or used) but it simplifies the definition of LockedMap -void VMField::TRACER { +void VMField::tracer() { } Modified: vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp Sun Apr 11 11:26:48 2010 @@ -10,6 +10,8 @@ #include "MutatorThread.h" #include "MvmGC.h" +#include "mvm/VirtualMachine.h" + #include #include Modified: vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp Sun Apr 11 11:26:48 2010 @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include "mvm/VirtualMachine.h" + #include "JavaClass.h" #include "JavaObject.h" #include "JavaThread.h" Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Sun Apr 11 11:26:48 2010 @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include "mvm/VirtualMachine.h" + #include "JavaObject.h" #include "JavaThread.h" Modified: vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp Sun Apr 11 11:26:48 2010 @@ -8,6 +8,8 @@ // //===----------------------------------------------------------------------===// +#include "mvm/VirtualMachine.h" + #include "JavaObject.h" #include "JavaThread.h" Modified: vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp Sun Apr 11 11:26:48 2010 @@ -8,6 +8,8 @@ // //===----------------------------------------------------------------------===// +#include "mvm/VirtualMachine.h" + #include "JavaObject.h" #include "JavaThread.h" Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=100963&r1=100962&r2=100963&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Sun Apr 11 11:26:48 2010 @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +#include "mvm/VirtualMachine.h" + #include "JavaObject.h" #include "JavaThread.h" From nicolas.geoffray at lip6.fr Sun Apr 11 10:06:54 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 11 Apr 2010 17:06:54 -0000 Subject: [vmkit-commits] [vmkit] r100969 - in /vmkit/trunk: lib/J3/VMCore/Jnjvm.cpp lib/Mvm/GCMmap2/MvmGC.h lib/Mvm/GCMmap2/gccollector.cpp lib/Mvm/MMTk/MvmGC.cpp lib/Mvm/MMTk/MvmGC.h mmtk/mmtk-alloc/Selected.cpp mmtk/mmtk-j3/Collection.cpp Message-ID: <20100411170654.6B9DF2A6C12C@llvm.org> Author: geoffray Date: Sun Apr 11 12:06:54 2010 New Revision: 100969 URL: http://llvm.org/viewvc/llvm-project?rev=100969&view=rev Log: Print runtime information on GC when -verbose:gc is set. Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp vmkit/trunk/lib/Mvm/MMTk/MvmGC.h vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=100969&r1=100968&r2=100969&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sun Apr 11 12:06:54 2010 @@ -851,19 +851,14 @@ } void ClArgumentsInfo::printVersion() { - fprintf(stdout, "JnJVM for Java 1.1 -- 1.5\n"); + fprintf(stdout, "J3 for Java 1.1 -- 1.5\n"); } void ClArgumentsInfo::printInformation() { fprintf(stdout, - "Usage: java [-options] class [args...] (to execute a class)\n" - "or java [-options] -jar jarfile [args...]\n" + "Usage: j3 [-options] class [args...] (to execute a class)\n" + "or j3 [-options] -jar jarfile [args...]\n" "(to execute a jar file) where options include:\n" - "-client to select the \"client\" VM\n" - "-server to select the \"server\" VM\n" - "-hotspot is a synonym for the \"client\" VM [deprecated]\n" - " The default VM is client.\n" - "\n" "-cp \n" "-classpath \n" " A : separated list of directories, JAR archives,\n" @@ -906,11 +901,7 @@ if (i == argc) printInformation(); while (i < argc) { char* cur = argv[i]; - if (!(strcmp(cur, "-client"))) { - nyi(); - } else if (!(strcmp(cur, "-server"))) { - nyi(); - } else if (!(strcmp(cur, "-classpath"))) { + if (!(strcmp(cur, "-classpath"))) { ++i; if (i == argc) printInformation(); else vm->setClasspath(argv[i]); @@ -918,8 +909,6 @@ ++i; if (i == argc) printInformation(); else vm->setClasspath(argv[i]); - } else if (!(strcmp(cur, "-debug"))) { - nyi(); } else if (!(strncmp(cur, "-D", 2))) { uint32 len = strlen(cur); if (len == 2) { @@ -987,7 +976,7 @@ } else if (!(strcmp(cur, "-verbosegc"))) { nyi(); } else if (!(strcmp(cur, "-verbose:gc"))) { - nyi(); + mvm::Collector::verbose = 1; } else if (!(strcmp(cur, "-verbose:jni"))) { nyi(); } else if (!(strcmp(cur, "-version"))) { Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=100969&r1=100968&r2=100969&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Sun Apr 11 12:06:54 2010 @@ -66,7 +66,7 @@ static bool _enable_maybe; /* Collection in maybeCollect()? */ static bool _enable_collection; /* collection authorized? */ static int status; - + enum { stat_collect, stat_alloc, stat_broken }; @@ -90,6 +90,8 @@ public: static void (*internMemoryError)(unsigned int); + + static int verbose; static bool isLive(void* ptr) { GCChunkNode *node = o2node(ptr); Modified: vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp?rev=100969&r1=100968&r2=100969&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gccollector.cpp Sun Apr 11 12:06:54 2010 @@ -29,6 +29,8 @@ bool Collector::_enable_maybe; bool Collector::_enable_collection; +int Collector::verbose = 0; + void Collector::do_collect() { GCChunkNode *cur; #ifdef SERVICE Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp?rev=100969&r1=100968&r2=100969&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp Sun Apr 11 12:06:54 2010 @@ -17,6 +17,7 @@ static mvm::SpinLock lock; std::set __InternalSet__; +int Collector::verbose = 0; extern "C" void* gcmalloc(uint32_t sz, void* _VT) { gc* res = 0; Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.h?rev=100969&r1=100968&r2=100969&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Sun Apr 11 12:06:54 2010 @@ -65,6 +65,7 @@ class Collector { public: + static int verbose; static uintptr_t TraceLocal; Modified: vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp?rev=100969&r1=100968&r2=100969&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp Sun Apr 11 12:06:54 2010 @@ -18,6 +18,7 @@ using namespace mvm; uintptr_t Collector::TraceLocal = 0; +int Collector::verbose = 0; extern "C" void* JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII(uintptr_t Mutator, int32_t sz, int32_t align, int32_t offset, int32_t allocator, int32_t site) __attribute__((always_inline)); extern "C" int32_t JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III(uintptr_t Mutator, int32_t bytes, int32_t align, int32_t allocator) __attribute__((always_inline)); Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=100969&r1=100968&r2=100969&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Sun Apr 11 12:06:54 2010 @@ -60,6 +60,7 @@ // Record the time to GC. int64_t elapsedTime = Java_org_j3_mmtk_Statistics_nanoTime__() - startTime; + JnJVM_org_mmtk_utility_heap_HeapGrowthManager_recordGCTime__D(((double)elapsedTime) / 1000000); // 2 means called by System.gc(); @@ -69,6 +70,13 @@ JnJVM_org_mmtk_utility_heap_HeapGrowthManager_reset__(); JnJVM_org_mmtk_plan_Plan_collectionComplete__(); + + if (mvm::Collector::verbose > 0) { + static int collectionNum = 1; + if (why == 2) fprintf(stderr, "[Forced] "); + fprintf(stderr, "Collection %d finished in %lld ms.\n", collectionNum++, + elapsedTime / 1000000); + } th->MyVM->rendezvous.finishRV(); From nicolas.geoffray at lip6.fr Sun Apr 11 10:27:31 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 11 Apr 2010 17:27:31 -0000 Subject: [vmkit-commits] [vmkit] r100970 - in /vmkit/trunk: lib/Mvm/MMTk/MvmGC.h mmtk/mmtk-j3/Scanning.cpp Message-ID: <20100411172731.D58E42A6C12C@llvm.org> Author: geoffray Date: Sun Apr 11 12:27:31 2010 New Revision: 100970 URL: http://llvm.org/viewvc/llvm-project?rev=100970&view=rev Log: Inline some functions. Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.h?rev=100970&r1=100969&r2=100970&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Sun Apr 11 12:27:31 2010 @@ -69,23 +69,23 @@ static uintptr_t TraceLocal; - static bool isLive(gc* ptr); + static bool isLive(gc* ptr) __attribute__ ((always_inline)); - static void scanObject(void** ptr); + static void scanObject(void** ptr) __attribute__ ((always_inline)); - static void markAndTrace(void* source, void* ptr); + static void markAndTrace(void* source, void* ptr) __attribute__ ((always_inline)); - static void markAndTraceRoot(void* ptr); + static void markAndTraceRoot(void* ptr) __attribute__ ((always_inline)); - static gc* retainForFinalize(gc* val); + static gc* retainForFinalize(gc* val) __attribute__ ((always_inline)); - static gc* retainReferent(gc* val); + static gc* retainReferent(gc* val) __attribute__ ((always_inline)); - static gc* getForwardedFinalizable(gc* val); + static gc* getForwardedFinalizable(gc* val) __attribute__ ((always_inline)); - static gc* getForwardedReference(gc* val); + static gc* getForwardedReference(gc* val) __attribute__ ((always_inline)); - static gc* getForwardedReferent(gc* val); + static gc* getForwardedReferent(gc* val) __attribute__ ((always_inline)); static void collect(); Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=100970&r1=100969&r2=100970&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Sun Apr 11 12:27:31 2010 @@ -50,6 +50,8 @@ // Nothing to do. } +extern "C" void Java_org_j3_mmtk_Scanning_specializedScanObject__ILorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* Scanning, uint32_t id, JavaObject* TC, JavaObject* obj) __attribute__ ((always_inline)); + extern "C" void Java_org_j3_mmtk_Scanning_specializedScanObject__ILorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* Scanning, uint32_t id, JavaObject* TC, JavaObject* obj) { assert(mvm::Collector::TraceLocal == (uintptr_t)TC && "Mismatch in trace local"); assert(obj && "No object to trace"); From nicolas.geoffray at lip6.fr Sun Apr 11 12:13:38 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 11 Apr 2010 19:13:38 -0000 Subject: [vmkit-commits] [vmkit] r100978 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/J3/Classpath/ClasspathConstructor.inc lib/J3/Classpath/ClasspathMethod.inc lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/JavaThread.h lib/J3/VMCore/Jnjvm.cpp lib/Mvm/Runtime/Object.cpp Message-ID: <20100411191338.CB2152A6C12C@llvm.org> Author: geoffray Date: Sun Apr 11 14:13:38 2010 New Revision: 100978 URL: http://llvm.org/viewvc/llvm-project?rev=100978&view=rev Log: Put macros for exception handling in the runtime. Modified: vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaThread.h vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/Mvm/Runtime/Object.cpp Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=100978&r1=100977&r2=100978&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Sun Apr 11 14:13:38 2010 @@ -16,6 +16,10 @@ #include "types.h" +#define TRY try +#define CATCH catch(...) +#define IGNORE catch(...) { mvm::Thread::get()->clearException(); } + namespace mvm { class MethodInfo; Modified: vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc?rev=100978&r1=100977&r2=100978&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc Sun Apr 11 14:13:38 2010 @@ -117,9 +117,9 @@ } JavaThread* th = JavaThread::get(); - try { + TRY { meth->invokeIntSpecialBuf(vm, cl, res, buf); - } catch(...) { + } CATCH { excp = th->getJavaException(); if (excp->getClass()->isAssignableFrom(vm->upcalls->newException)) { th->clearException(); @@ -130,6 +130,7 @@ // If it's an error, throw it again. th->throwPendingException(); } + return NULL; } } else { Modified: vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc?rev=100978&r1=100977&r2=100978&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc Sun Apr 11 14:13:38 2010 @@ -152,7 +152,7 @@ JavaThread* th = JavaThread::get(); #define RUN_METH(TYPE, VAR) \ - try{ \ + TRY { \ if (isVirtual(meth->access)) { \ if (isPublic(meth->access) && !isFinal(meth->access) && \ !isFinal(meth->classDef->access)) { \ @@ -163,7 +163,7 @@ } else { \ VAR = meth->invoke##TYPE##StaticBuf(vm, cl, buf); \ } \ - } catch(...) { \ + } CATCH { \ exc = th->getJavaException(); \ if (exc->getClass()->isAssignableFrom(vm->upcalls->newException)) { \ th->clearException(); \ @@ -171,6 +171,7 @@ } else { \ th->throwPendingException(); \ } \ + return NULL; \ } \ Typedef* retType = sign->getReturnType(); @@ -225,7 +226,8 @@ RUN_METH(JavaObject, res); } } else { - vm->illegalArgumentException("wrong number of arguments"); + vm->illegalArgumentException("wrong number of arguments"); + return NULL; } return res; Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=100978&r1=100977&r2=100978&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sun Apr 11 14:13:38 2010 @@ -893,9 +893,9 @@ setOwnerClass(JavaThread::get()); JavaObject* exc = 0; - try { + TRY { readClass(); - } catch (...) { + } CATCH { exc = JavaThread::get()->pendingException; JavaThread::get()->clearException(); } @@ -910,9 +910,9 @@ release(); - try { + TRY { loadParents(); - } catch (...) { + } CATCH { setInitializationState(loaded); exc = JavaThread::get()->pendingException; JavaThread::get()->clearException(); Modified: vmkit/trunk/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaThread.h?rev=100978&r1=100977&r2=100978&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaThread.h Sun Apr 11 14:13:38 2010 @@ -30,10 +30,10 @@ #define BEGIN_NATIVE_EXCEPTION(level) \ JavaThread* __th = JavaThread::get(); \ - try { + TRY { #define END_NATIVE_EXCEPTION \ - } catch(...) { \ + } CATCH { \ __th->throwFromNative(); \ } \ @@ -43,10 +43,10 @@ th->leaveUncooperativeCode(); \ mvm::KnownFrame Frame; \ th->startKnownFrame(Frame); \ - try { + TRY { #define END_JNI_EXCEPTION \ - } catch(...) { \ + } CATCH { \ th->throwFromJNI(SP); \ } Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=100978&r1=100977&r2=100978&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sun Apr 11 14:13:38 2010 @@ -145,15 +145,16 @@ // the initializing the superclass. UserClass* super = getSuper(); if (super) { - try { + TRY { super->initialiseClass(vm); - } catch(...) { + } CATCH { acquire(); setErroneous(); setOwnerClass(0); broadcastClass(); release(); self->throwPendingException(); + return; } } @@ -192,9 +193,9 @@ true, false, 0); if (meth) { - try{ + TRY { meth->invokeIntStatic(vm, cl); - } catch(...) { + } CATCH { exc = self->getJavaException(); assert(exc && "no exception?"); self->clearException(); @@ -247,6 +248,7 @@ broadcastClass(); release(); self->throwException(exc); + return; } } @@ -1149,8 +1151,7 @@ llvm_gcroot(obj, 0); llvm_gcroot(group, 0); - try { - + TRY { // First try to see if we are a self-contained executable. UserClass* cl = appClassLoader->loadClassFromSelf(this, className); @@ -1168,7 +1169,7 @@ JavaMethod* method = cl->lookupMethod(funcName, funcSign, true, true, 0); method->invokeIntStatic(this, method->classDef, &args); - }catch(...) { + } CATCH { } exc = JavaThread::get()->pendingException; @@ -1177,10 +1178,10 @@ th->clearException(); obj = th->currentThread(); group = upcalls->group->getObjectField(obj); - try{ + TRY { upcalls->uncaughtException->invokeIntSpecial(this, upcalls->threadGroup, group, &obj, &exc); - }catch(...) { + } CATCH { fprintf(stderr, "Exception in thread \"main\": " "Can not print stack trace.\n"); } @@ -1190,7 +1191,7 @@ void Jnjvm::executePremain(const char* className, JavaString* args, JavaObject* instrumenter) { llvm_gcroot(instrumenter, 0); - try { + TRY { const UTF8* name = appClassLoader->asciizConstructUTF8(className); UserClass* cl = (UserClass*)appClassLoader->loadName(name, true, true); cl->initialiseClass(this); @@ -1201,9 +1202,7 @@ JavaMethod* method = cl->lookupMethod(funcName, funcSign, true, true, 0); method->invokeIntStatic(this, method->classDef, &args, &instrumenter); - } catch(...) { - JavaThread::get()->clearException(); - } + } IGNORE; } void Jnjvm::waitForExit() { @@ -1234,9 +1233,9 @@ Jnjvm* vm = thread->getJVM(); vm->mainThread = thread; - try { + TRY { vm->loadBootstrap(); - } catch (...) { + } CATCH { exc = JavaThread::get()->pendingException; } Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=100978&r1=100977&r2=100978&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Sun Apr 11 14:13:38 2010 @@ -82,7 +82,7 @@ vm->FinalizationQueueLock.release(); if (!res) break; - try { + TRY { VirtualTable* VT = res->getVirtualTable(); if (VT->operatorDelete) { destructor_t dest = (destructor_t)VT->destructor; @@ -90,8 +90,7 @@ } else { vm->invokeFinalizer(res); } - } catch(...) { - } + } IGNORE; res = 0; th->clearException(); } @@ -118,10 +117,9 @@ vm->ToEnqueueLock.release(); if (!res) break; - try { + TRY { vm->enqueueReference(res); - } catch(...) { - } + } IGNORE; res = 0; th->clearException(); } From nicolas.geoffray at lip6.fr Tue Apr 13 09:24:13 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Apr 2010 16:24:13 -0000 Subject: [vmkit-commits] [vmkit] r101135 - in /vmkit/trunk: ./ autoconf/ 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/ mmtk/mmtk-j3/ tools/vmjc/ tools/vmkit/ Message-ID: <20100413162413.9ACFA2A6C12C@llvm.org> Author: geoffray Date: Tue Apr 13 11:24:13 2010 New Revision: 101135 URL: http://llvm.org/viewvc/llvm-project?rev=101135&view=rev Log: Add a new exception model in the runtime: the default is now setjmp/longjmp, but dwarf is still supported. Modified: vmkit/trunk/Makefile.common.in vmkit/trunk/autoconf/configure.ac vmkit/trunk/configure vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaThread.cpp vmkit/trunk/lib/J3/VMCore/JavaThread.h vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp vmkit/trunk/tools/vmjc/vmjc.cpp vmkit/trunk/tools/vmkit/CommandLine.cpp Modified: vmkit/trunk/Makefile.common.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.common.in?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/Makefile.common.in (original) +++ vmkit/trunk/Makefile.common.in Tue Apr 13 11:24:13 2010 @@ -18,8 +18,6 @@ # Set the root directory of this project's install prefix PROJ_INSTALL_ROOT := @prefix@ -REQUIRES_EH := 1 - # Include LLVM's Master Makefile. include $(LLVM_OBJ_ROOT)/Makefile.common Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Apr 13 11:24:13 2010 @@ -303,15 +303,34 @@ dnl ************************************************************************** AC_ARG_WITH(exception-type, [AS_HELP_STRING(--with-exception-type=something, - [VM type ('check' or 'dwarf')])], + [Exception type ('check' or 'dwarf')])], [[exceptiontype=$withval]], [[ echo Using check as exception type. exceptiontype=check ]] ) +AC_ARG_WITH(runtime-exception-type, + [AS_HELP_STRING(--with-runtime-exception-type=something, + [Runtime exception type ('setjmp' or 'dwarf')])], + [[runtimeexceptiontype=$withval]], + [[ echo Using setjmp as exception type. + exceptiontype=setjmp + ]] +) + if test "x$exceptiontype" = "xdwarf"; then - EXCEPTION_FLAGS="-DDWARF_EXCEPTIONS" + EXCEPTION_FLAGS="-DDWARF_EXCEPTIONS -fexceptions" +fi + +if test "x$runtimeexceptiontype" = "xdwarf"; then + EXCEPTION_FLAGS+="-DRUNTIME_DWARF_EXCEPTIONS -fexceptions" +fi + +if test "x$runtimeexceptiontype" != "xdwarf"; then + if test "x$exceptiontype" != "xdwarf"; then + EXCEPTION_FLAGS="-fno-exceptions" + fi fi AC_SUBST([EXCEPTION_FLAGS]) Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Tue Apr 13 11:24:13 2010 @@ -723,6 +723,7 @@ with_gc with_vm_type with_exception_type +with_runtime_exception_type with_gnu_classpath_libs with_gnu_classpath_glibj with_j3 @@ -1367,7 +1368,9 @@ VM type ('single' 'isolate' 'isolate-sharing' or 'service') --with-exception-type=something - VM type ('check' or 'dwarf') + Exception type ('check' or 'dwarf') + --with-runtime-exception-type=something + Runtime exception type ('setjmp' or 'dwarf') --with-gnu-classpath-libs=something GNU CLASSPATH libraries (default is /usr/lib/classpath) @@ -3932,8 +3935,30 @@ fi + +# Check whether --with-runtime-exception-type was given. +if test "${with_runtime_exception_type+set}" = set; then : + withval=$with_runtime_exception_type; runtimeexceptiontype=$withval +else + echo Using setjmp as exception type. + exceptiontype=setjmp + + +fi + + if test "x$exceptiontype" = "xdwarf"; then - EXCEPTION_FLAGS="-DDWARF_EXCEPTIONS" + EXCEPTION_FLAGS="-DDWARF_EXCEPTIONS -fexceptions" +fi + +if test "x$runtimeexceptiontype" = "xdwarf"; then + EXCEPTION_FLAGS+="-DRUNTIME_DWARF_EXCEPTIONS -fexceptions" +fi + +if test "x$runtimeexceptiontype" != "xdwarf"; then + if test "x$exceptiontype" != "xdwarf"; then + EXCEPTION_FLAGS="-fno-exceptions -Wno-uninitialized" + fi fi Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Tue Apr 13 11:24:13 2010 @@ -1,6 +1,6 @@ //===---------------- Threads.h - Micro-vm threads ------------------------===// // -// The Micro Virtual Machine +// The VMKit project // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. @@ -16,9 +16,18 @@ #include "types.h" +#ifdef RUNTIME_DWARF_EXCEPTIONS #define TRY try #define CATCH catch(...) #define IGNORE catch(...) { mvm::Thread::get()->clearException(); } +#define END_CATCH +#else +#include +#define TRY { mvm::ExceptionBuffer __buffer__; if (!setjmp(__buffer__.buffer)) +#define CATCH else +#define IGNORE else { mvm::Thread::get()->clearException(); }} +#define END_CATCH } +#endif namespace mvm { @@ -122,12 +131,23 @@ void* currentFP; }; + +class ExceptionBuffer; + /// 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. class Thread : public CircularBase { public: - + Thread() { +#ifdef RUNTIME_DWARF_EXCEPTIONS + internalPendingException = 0; +#else + lastExceptionBuffer = 0; +#endif + lastKnownFrame = 0; + } + /// yield - Yield the processor to another thread. /// static void yield(void); @@ -283,6 +303,9 @@ /// clearException - Clear any pending exception of the current thread. void clearException() { +#ifdef RUNTIME_DWARF_EXCEPTIONS + internalPendingException = 0; +#endif internalClearException(); } @@ -346,11 +369,40 @@ /// lastKnownFrame - The last frame that we know of, before resuming to JNI. /// KnownFrame* lastKnownFrame; + +#ifdef RUNTIME_DWARF_EXCEPTIONS + void* internalPendingException; +#else + /// lastExceptionBuffer - The last exception buffer on this thread's stack. + /// + ExceptionBuffer* lastExceptionBuffer; +#endif + + void internalThrowException(); void startKnownFrame(KnownFrame& F) __attribute__ ((noinline)); void endKnownFrame(); }; +#ifndef RUNTIME_DWARF_EXCEPTIONS +class ExceptionBuffer { +public: + ExceptionBuffer() { + Thread* th = Thread::get(); + previousBuffer = th->lastExceptionBuffer; + th->lastExceptionBuffer = this; + } + + ~ExceptionBuffer() { + Thread* th = Thread::get(); + assert(th->lastExceptionBuffer == this && "Wrong exception buffer"); + th->lastExceptionBuffer = previousBuffer; + } + ExceptionBuffer* previousBuffer; + jmp_buf buffer; +}; +#endif + /// StackWalker - This class walks the stack of threads, returning a MethodInfo /// object at each iteration. /// Modified: vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc Tue Apr 13 11:24:13 2010 @@ -131,7 +131,7 @@ th->throwPendingException(); } return NULL; - } + } END_CATCH; } else { vm->illegalArgumentException("class is not a regular class"); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc Tue Apr 13 11:24:13 2010 @@ -172,7 +172,7 @@ th->throwPendingException(); \ } \ return NULL; \ - } \ + } END_CATCH; \ Typedef* retType = sign->getReturnType(); if (retType->isPrimitive()) { Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc Tue Apr 13 11:24:13 2010 @@ -72,6 +72,7 @@ } jint i = sstart; + jint length = len; bool doThrow = false; if (!(dstType->isPrimitive())) { while (i < sstart + len && !doThrow) { @@ -79,7 +80,7 @@ if (cur) { if (!(cur->getClass()->isAssignableFrom(dstType))) { doThrow = true; - len = i; + length = i; } } ++i; @@ -91,14 +92,12 @@ void* ptrDst = (void*)((int64_t)(dst->elements) + (dstart << logSize)); void* ptrSrc = (void*)((int64_t)(src->elements) + (sstart << logSize)); - memmove(ptrDst, ptrSrc, len << logSize); + memmove(ptrDst, ptrSrc, length << logSize); if (doThrow) vm->arrayStoreException(); - - - END_NATIVE_EXCEPTION + END_NATIVE_EXCEPTION } JNIEXPORT jint JNICALL Java_java_lang_VMSystem_identityHashCode( Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc Tue Apr 13 11:24:13 2010 @@ -472,11 +472,12 @@ // Get the Java exception. Value* exc = new LoadInst(javaExceptionPtr, "", currentBlock); - Value* geps2[2] = { module->constantZero, + Value* geps2[3] = { module->constantZero, + module->constantZero, module->OffsetCXXExceptionInThreadConstant }; Value* cxxExceptionPtr = GetElementPtrInst::Create(threadId, geps2, - geps2 + 2, "", + geps2 + 3, "", currentBlock); // Clear exceptions. @@ -559,11 +560,12 @@ endExceptionBlock->eraseFromParent(); } else { Value* threadId = getCurrentThread(module->JavaThreadType); - Value* geps2[2] = { module->constantZero, + Value* geps2[3] = { module->constantZero, + module->constantZero, module->OffsetCXXExceptionInThreadConstant }; Value* cxxExceptionPtr = GetElementPtrInst::Create(threadId, geps2, - geps2 + 2, "", + geps2 + 3, "", currentBlock); cxxExceptionPtr = new LoadInst(cxxExceptionPtr, "", currentBlock); llvm::CallInst::Create(module->unwindResume, cxxExceptionPtr, "", Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Tue Apr 13 11:24:13 2010 @@ -152,7 +152,7 @@ OffsetJavaExceptionInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); OffsetCXXExceptionInThreadConstant = - ConstantInt::get(Type::getInt32Ty(Context), 3); + ConstantInt::get(Type::getInt32Ty(Context), 13); ClassReadyConstant = ConstantInt::get(Type::getInt8Ty(Context), ready); Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Apr 13 11:24:13 2010 @@ -1922,8 +1922,6 @@ JnjvmBootstrapLoader* bootstrapLoader = vm->bootstrapLoader; JavaAOTCompiler* M = (JavaAOTCompiler*)bootstrapLoader->getCompiler(); JavaJITCompiler* Comp = 0; - try { - if (!M->clinits->empty()) { Comp = JavaJITCompiler::CreateCompiler("JIT"); Comp->EmitFunctionName = true; @@ -1982,13 +1980,13 @@ Class* cl = *ii; if (!strncmp(UTF8Buffer(cl->name).cString(), i->c_str(), i->length() - 1)) { - try { + TRY { cl->asClass()->initialiseClass(vm); - } catch (...) { + } CATCH { fprintf(stderr, "Error when initializing %s\n", UTF8Buffer(cl->name).cString()); abort(); - } + } END_CATCH; } } } else { @@ -1996,13 +1994,13 @@ const UTF8* name = bootstrapLoader->asciizConstructUTF8(i->c_str()); CommonClass* cl = bootstrapLoader->lookupClass(name); if (cl && cl->isClass()) { - try { + TRY { cl->asClass()->initialiseClass(vm); - } catch (...) { + } CATCH { fprintf(stderr, "Error when initializing %s\n", UTF8Buffer(cl->name).cString()); abort(); - } + } END_CATCH; } else { fprintf(stderr, "Class %s does not exist or is an array class.\n", i->c_str()); @@ -2085,10 +2083,6 @@ M->CreateStaticInitializer(); - } catch(std::string str) { - fprintf(stderr, "Error : %s\n", str.c_str()); - } - end: vm->threadSystem.nonDaemonLock.lock(); Modified: vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default-thread.ll Tue Apr 13 11:24:13 2010 @@ -11,5 +11,6 @@ ;;; Field 10: internalThreadID ;;; field 11: routine ;;; field 12: lastKnownFrame +;;; field 13: lastExceptionBuffer %MutatorThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, - i1, i8*, i8*, i8*, i8*} + i1, i8*, i8*, i8*, i8*, i8*} 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=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Tue Apr 13 11:24:13 2010 @@ -27,7 +27,7 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } -%JavaThread = type { %MutatorThread, i8*, %JavaObject*, i8* } +%JavaThread = type { %MutatorThread, i8*, %JavaObject* } %Attribut = type { %UTF8*, i32, i32 } 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=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-mmtk-thread.ll Tue Apr 13 11:24:13 2010 @@ -13,8 +13,9 @@ ;;; Field 10: internalThreadID ;;; field 11: routine ;;; field 12: lastKnownFrame -;;; field 13: allocator -;;; field 14: MutatorContext -;;; field 15: realRoutine +;;; field 13: lastKnownBufer +;;; field 14: allocator +;;; field 15: MutatorContext +;;; field 16: realRoutine %MutatorThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, - i1, i8*, i8*, i8*, i8*, %BumpPtrAllocator, i8*, i8* } + i1, i8*, i8*, i8*, i8*, i8*, %BumpPtrAllocator, i8*, i8* } Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Tue Apr 13 11:24:13 2010 @@ -892,36 +892,43 @@ } else if (!isResolving()) { setOwnerClass(JavaThread::get()); - JavaObject* exc = 0; - TRY { - readClass(); - } CATCH { - exc = JavaThread::get()->pendingException; - JavaThread::get()->clearException(); - } - - if (exc) { - setErroneous(); - setOwnerClass(0); - broadcastClass(); - release(); - JavaThread::get()->throwException(exc); + { + JavaObject* exc = 0; + llvm_gcroot(exc, 0); + TRY { + readClass(); + } CATCH { + exc = JavaThread::get()->pendingException; + JavaThread::get()->clearException(); + } END_CATCH; + + if (exc) { + setErroneous(); + setOwnerClass(0); + broadcastClass(); + release(); + JavaThread::get()->throwException(exc); + } } release(); - - TRY { - loadParents(); - } CATCH { - setInitializationState(loaded); - exc = JavaThread::get()->pendingException; - JavaThread::get()->clearException(); - } - if (exc) { - setErroneous(); - setOwnerClass(0); - JavaThread::get()->throwException(exc); + { + JavaObject* exc = 0; + llvm_gcroot(exc, 0); + TRY { + loadParents(); + } CATCH { + setInitializationState(loaded); + exc = JavaThread::get()->pendingException; + JavaThread::get()->clearException(); + } END_CATCH; + + if (exc) { + setErroneous(); + setOwnerClass(0); + JavaThread::get()->throwException(exc); + } } makeVT(); Modified: vmkit/trunk/lib/J3/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaThread.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaThread.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaThread.cpp Tue Apr 13 11:24:13 2010 @@ -23,7 +23,8 @@ const unsigned int JavaThread::StateWaiting = 1; const unsigned int JavaThread::StateInterrupted = 2; -JavaThread::JavaThread(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) { +JavaThread::JavaThread(JavaObject* thread, JavaObject* vmth, Jnjvm* isolate) + : MutatorThread() { llvm_gcroot(thread, 0); llvm_gcroot(vmth, 0); @@ -33,8 +34,6 @@ interruptFlag = 0; state = StateRunning; pendingException = 0; - internalPendingException = 0; - lastKnownFrame = 0; jniEnv = isolate->jniEnv; localJNIRefs = new JNILocalReferences(); currentAddedReferences = 0; @@ -55,30 +54,18 @@ #endif } -// We define these here because gcc compiles the 'throw' keyword -// differently, whether these are defined in a file or not. Since many -// cpp files import JavaThread.h, they couldn't use the keyword. - -extern "C" void* __cxa_allocate_exception(unsigned); -extern "C" void __cxa_throw(void*, void*, void*); - void JavaThread::throwException(JavaObject* obj) { llvm_gcroot(obj, 0); JavaThread* th = JavaThread::get(); assert(th->pendingException == 0 && "pending exception already there?"); th->pendingException = obj; - void* exc = __cxa_allocate_exception(0); - // 32 = sizeof(_Unwind_Exception) in libgcc... - th->internalPendingException = (void*)((uintptr_t)exc - 32); - __cxa_throw(exc, 0, 0); + th->internalThrowException(); } void JavaThread::throwPendingException() { JavaThread* th = JavaThread::get(); assert(th->pendingException); - void* exc = __cxa_allocate_exception(0); - th->internalPendingException = (void*)((uintptr_t)exc - 32); - __cxa_throw(exc, 0, 0); + th->internalThrowException(); } void JavaThread::startJNI(int level) { Modified: vmkit/trunk/lib/J3/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaThread.h?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaThread.h Tue Apr 13 11:24:13 2010 @@ -35,7 +35,7 @@ #define END_NATIVE_EXCEPTION \ } CATCH { \ __th->throwFromNative(); \ - } \ + } END_CATCH; #define BEGIN_JNI_EXCEPTION \ JavaThread* th = JavaThread::get(); \ @@ -48,7 +48,7 @@ #define END_JNI_EXCEPTION \ } CATCH { \ th->throwFromJNI(SP); \ - } + } END_CATCH; #define RETURN_FROM_JNI(a) {\ th->endKnownFrame(); \ @@ -76,10 +76,6 @@ /// JavaObject* pendingException; - /// internalPendingException - The C++ exception currencty pending. - /// - void* internalPendingException; - /// javaThread - The Java representation of this thread. /// JavaObject* javaThread; @@ -256,7 +252,6 @@ /// virtual void internalClearException() { pendingException = 0; - internalPendingException = 0; } public: Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Tue Apr 13 11:24:13 2010 @@ -122,15 +122,12 @@ #if defined(ISOLATE) || defined(ISOLATE_SHARING) // Isolate environments allocate the static instance on their own, not when // the class is being resolved. - void* val = cl->allocateStaticInstance(vm); + 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) - void* val = cl->getStaticInstance(); - if (!val) { - val = cl->allocateStaticInstance(vm); - } + if (!cl->getStaticInstance()) cl->allocateStaticInstance(vm); #endif release(); @@ -155,7 +152,7 @@ release(); self->throwPendingException(); return; - } + } END_CATCH; } JavaObject* exc = 0; @@ -181,6 +178,7 @@ if (!vmjced) { JavaField* fields = cl->getStaticFields(); + void* val = cl->getStaticInstance(); for (uint32 i = 0; i < cl->nbStaticFields; ++i) { fields[i].initField(val, vm); } @@ -199,7 +197,7 @@ exc = self->getJavaException(); assert(exc && "no exception?"); self->clearException(); - } + } END_CATCH; } #ifdef SERVICE } @@ -1170,7 +1168,7 @@ method->invokeIntStatic(this, method->classDef, &args); } CATCH { - } + } END_CATCH; exc = JavaThread::get()->pendingException; if (exc) { @@ -1184,7 +1182,7 @@ } CATCH { fprintf(stderr, "Exception in thread \"main\": " "Can not print stack trace.\n"); - } + } END_CATCH; } } @@ -1237,7 +1235,7 @@ vm->loadBootstrap(); } CATCH { exc = JavaThread::get()->pendingException; - } + } END_CATCH; if (exc != NULL) { fprintf(stderr, "Exception %s while bootstrapping VM.", Modified: vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Tue Apr 13 11:24:13 2010 @@ -1,6 +1,6 @@ -//===-------------- ctthread.cc - Mvm common threads ----------------------===// +//===---------- ctthread.cc - Thread implementation for VMKit -------------===// // -// Mvm +// The VMKit project // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +64,36 @@ lastKnownFrame = lastKnownFrame->previousFrame; } +#if defined(__MACH__) +#define SELF_HANDLE RTLD_DEFAULT +#else +#define SELF_HANDLE 0 +#endif + +void Thread::internalThrowException() { +#ifdef RUNTIME_DWARF_EXCEPTIONS + // Use dlsym instead of getting the functions statically with extern "C" + // because gcc compiles exceptions differently. + typedef void* (*cxa_allocate_exception_type)(unsigned); + typedef void (*cxa_throw_type)(void*, void*, void*); + + static cxa_allocate_exception_type cxa_allocate_exception = + (cxa_allocate_exception_type)(uintptr_t) + dlsym(SELF_HANDLE, "__cxa_allocate_exception"); + + static cxa_throw_type cxa_throw = + (cxa_throw_type)(uintptr_t) + dlsym(SELF_HANDLE, "__cxa_throw"); + + void* exc = cxa_allocate_exception(0); + // 32 = sizeof(_Unwind_Exception) in libgcc... + internalPendingException = (void*)((uintptr_t)exc - 32); + cxa_throw(exc, 0, 0); +#else + longjmp(lastExceptionBuffer->buffer, 1); +#endif +} + void Thread::printBacktrace() { StackWalker Walker(this); Modified: vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc (original) +++ vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc Tue Apr 13 11:24:13 2010 @@ -48,6 +48,7 @@ /*Params=*/FuncTy_9_args, /*isVarArg=*/false); + std::vectorFuncTy_11_args; FuncTy_11_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_11 = FunctionType::get( @@ -55,6 +56,7 @@ /*Params=*/FuncTy_11_args, /*isVarArg=*/false); + std::vectorStructTy_struct_mvm__MutatorThread_fields; std::vectorStructTy_struct_mvm__Thread_fields; std::vectorStructTy_struct_mvm__CircularBase_fields; @@ -215,12 +217,12 @@ 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_std__less_const_char__fields; -StructTy_struct_std__less_const_char__fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructType* StructTy_struct_std__less_const_char_ = StructType::get(mod->getContext(), StructTy_struct_std__less_const_char__fields, /*isPacked=*/true); -mod->addTypeName("struct.std::less", StructTy_struct_std__less_const_char_); +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_std__less_const_char_); +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()); @@ -294,6 +296,37 @@ StructTy_struct_mvm__Thread_fields.push_back(PointerTy_23); +std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; +PATypeHolder PointerTy_24_fwd = OpaqueType::get(mod->getContext()); +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_24_fwd); +std::vectorStructTy_struct___jmp_buf_tag_fields; +ArrayType* ArrayTy_26 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); + +StructTy_struct___jmp_buf_tag_fields.push_back(ArrayTy_26); +StructTy_struct___jmp_buf_tag_fields.push_back(IntegerType::get(mod->getContext(), 32)); +std::vectorStructTy_struct___sigset_t_fields; +ArrayType* ArrayTy_27 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); + +StructTy_struct___sigset_t_fields.push_back(ArrayTy_27); +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_25 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); + +StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_25); +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_24 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); +cast(PointerTy_24_fwd.get())->refineAbstractTypeTo(PointerTy_24); +PointerTy_24 = cast(PointerTy_24_fwd.get()); + + +StructTy_struct_mvm__Thread_fields.push_back(PointerTy_24); 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); @@ -309,132 +342,141 @@ PointerType* PointerTy_12 = PointerType::get(StructTy_struct_mvm__MutatorThread, 0); -PointerType* PointerTy_24 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); +PointerType* PointerTy_28 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); std::vectorStructTy_JavaObject_fields; ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_5, 0); mod->addTypeName("VT", ArrayTy_VT); -PointerType* PointerTy_26 = PointerType::get(ArrayTy_VT, 0); +PointerType* PointerTy_30 = PointerType::get(ArrayTy_VT, 0); -StructTy_JavaObject_fields.push_back(PointerTy_26); +StructTy_JavaObject_fields.push_back(PointerTy_30); 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_25 = PointerType::get(StructTy_JavaObject, 0); +PointerType* PointerTy_29 = PointerType::get(StructTy_JavaObject, 0); -std::vectorFuncTy_28_args; -FunctionType* FuncTy_28 = FunctionType::get( +std::vectorFuncTy_32_args; +FunctionType* FuncTy_32 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_28_args, + /*Params=*/FuncTy_32_args, /*isVarArg=*/false); -PointerType* PointerTy_29 = PointerType::get(PointerTy_25, 0); -std::vectorFuncTy_31_args; -FuncTy_31_args.push_back(PointerTy_25); -FuncTy_31_args.push_back(IntegerType::get(mod->getContext(), 32)); -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_25, - /*Params=*/FuncTy_31_args, +PointerType* PointerTy_33 = PointerType::get(PointerTy_29, 0); + +std::vectorFuncTy_35_args; +FuncTy_35_args.push_back(PointerTy_29); +FuncTy_35_args.push_back(IntegerType::get(mod->getContext(), 32)); +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_29, + /*Params=*/FuncTy_35_args, /*isVarArg=*/false); -PointerType* PointerTy_32 = PointerType::get(PointerTy_26, 0); -std::vectorFuncTy_34_args; -FuncTy_34_args.push_back(PointerTy_25); -FuncTy_34_args.push_back(PointerTy_25); -FuncTy_34_args.push_back(PointerTy_25); -FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_34 = FunctionType::get( - /*Result=*/PointerTy_25, - /*Params=*/FuncTy_34_args, +PointerType* PointerTy_36 = PointerType::get(PointerTy_30, 0); + +std::vectorFuncTy_38_args; +FuncTy_38_args.push_back(PointerTy_29); +FuncTy_38_args.push_back(PointerTy_29); +FuncTy_38_args.push_back(PointerTy_29); +FuncTy_38_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_38_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_38 = FunctionType::get( + /*Result=*/PointerTy_29, + /*Params=*/FuncTy_38_args, /*isVarArg=*/false); -std::vectorStructTy_36_fields; -std::vectorStructTy_37_fields; -std::vectorStructTy_38_fields; -StructTy_38_fields.push_back(StructTy_JavaObject); -StructTy_38_fields.push_back(PointerTy_25); -StructTy_38_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_38_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_38_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_38_fields.push_back(PointerTy_25); -StructTy_38_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_38_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_38_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_38_fields.push_back(PointerTy_25); -StructTy_38_fields.push_back(PointerTy_25); -StructTy_38_fields.push_back(PointerTy_25); -StructTy_38_fields.push_back(PointerTy_25); -StructTy_38_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructType* StructTy_38 = StructType::get(mod->getContext(), StructTy_38_fields, /*isPacked=*/false); - -StructTy_37_fields.push_back(StructTy_38); -StructTy_37_fields.push_back(PointerTy_25); -StructTy_37_fields.push_back(PointerTy_25); -StructTy_37_fields.push_back(PointerTy_25); -StructTy_37_fields.push_back(PointerTy_25); -StructTy_37_fields.push_back(PointerTy_25); -StructTy_37_fields.push_back(PointerTy_25); -StructTy_37_fields.push_back(PointerTy_25); -StructType* StructTy_37 = StructType::get(mod->getContext(), StructTy_37_fields, /*isPacked=*/false); - -StructTy_36_fields.push_back(StructTy_37); -StructTy_36_fields.push_back(PointerTy_25); -StructTy_36_fields.push_back(PointerTy_25); -StructTy_36_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_36_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructType* StructTy_36 = StructType::get(mod->getContext(), StructTy_36_fields, /*isPacked=*/false); std::vectorStructTy_40_fields; -StructTy_40_fields.push_back(StructTy_38); -StructTy_40_fields.push_back(PointerTy_25); -StructType* StructTy_40 = StructType::get(mod->getContext(), StructTy_40_fields, /*isPacked=*/false); - +std::vectorStructTy_41_fields; std::vectorStructTy_42_fields; -std::vectorStructTy_43_fields; -StructTy_43_fields.push_back(StructTy_38); -StructType* StructTy_43 = StructType::get(mod->getContext(), StructTy_43_fields, /*isPacked=*/false); - -StructTy_42_fields.push_back(StructTy_43); -StructTy_42_fields.push_back(PointerTy_25); +StructTy_42_fields.push_back(StructTy_JavaObject); +StructTy_42_fields.push_back(PointerTy_29); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 32)); +StructTy_42_fields.push_back(PointerTy_29); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_42_fields.push_back(PointerTy_29); +StructTy_42_fields.push_back(PointerTy_29); +StructTy_42_fields.push_back(PointerTy_29); +StructTy_42_fields.push_back(PointerTy_29); StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_42_fields.push_back(PointerTy_25); StructType* StructTy_42 = StructType::get(mod->getContext(), StructTy_42_fields, /*isPacked=*/false); -std::vectorStructTy_45_fields; -StructTy_45_fields.push_back(PointerTy_25); -StructTy_45_fields.push_back(PointerTy_25); -StructTy_45_fields.push_back(PointerTy_25); -StructTy_45_fields.push_back(PointerTy_25); -StructType* StructTy_45 = StructType::get(mod->getContext(), StructTy_45_fields, /*isPacked=*/false); - -std::vectorFuncTy_47_args; -FuncTy_47_args.push_back(IntegerType::get(mod->getContext(), 1)); -FuncTy_47_args.push_back(IntegerType::get(mod->getContext(), 1)); -FuncTy_47_args.push_back(IntegerType::get(mod->getContext(), 1)); -FuncTy_47_args.push_back(IntegerType::get(mod->getContext(), 1)); -FuncTy_47_args.push_back(IntegerType::get(mod->getContext(), 1)); -FunctionType* FuncTy_47 = FunctionType::get( +StructTy_41_fields.push_back(StructTy_42); +StructTy_41_fields.push_back(PointerTy_29); +StructTy_41_fields.push_back(PointerTy_29); +StructTy_41_fields.push_back(PointerTy_29); +StructTy_41_fields.push_back(PointerTy_29); +StructTy_41_fields.push_back(PointerTy_29); +StructTy_41_fields.push_back(PointerTy_29); +StructTy_41_fields.push_back(PointerTy_29); +StructType* StructTy_41 = StructType::get(mod->getContext(), StructTy_41_fields, /*isPacked=*/false); + +StructTy_40_fields.push_back(StructTy_41); +StructTy_40_fields.push_back(PointerTy_29); +StructTy_40_fields.push_back(PointerTy_29); +StructTy_40_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_40_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructType* StructTy_40 = StructType::get(mod->getContext(), StructTy_40_fields, /*isPacked=*/false); + + +std::vectorStructTy_44_fields; +StructTy_44_fields.push_back(StructTy_42); +StructTy_44_fields.push_back(PointerTy_29); +StructType* StructTy_44 = StructType::get(mod->getContext(), StructTy_44_fields, /*isPacked=*/false); + + +std::vectorStructTy_46_fields; +std::vectorStructTy_47_fields; +StructTy_47_fields.push_back(StructTy_42); +StructType* StructTy_47 = StructType::get(mod->getContext(), StructTy_47_fields, /*isPacked=*/false); + +StructTy_46_fields.push_back(StructTy_47); +StructTy_46_fields.push_back(PointerTy_29); +StructTy_46_fields.push_back(IntegerType::get(mod->getContext(), 8)); +StructTy_46_fields.push_back(PointerTy_29); +StructType* StructTy_46 = StructType::get(mod->getContext(), StructTy_46_fields, /*isPacked=*/false); + + +std::vectorStructTy_49_fields; +StructTy_49_fields.push_back(PointerTy_29); +StructTy_49_fields.push_back(PointerTy_29); +StructTy_49_fields.push_back(PointerTy_29); +StructTy_49_fields.push_back(PointerTy_29); +StructType* StructTy_49 = StructType::get(mod->getContext(), StructTy_49_fields, /*isPacked=*/false); + + +std::vectorFuncTy_51_args; +FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1)); +FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1)); +FunctionType* FuncTy_51 = FunctionType::get( /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_47_args, + /*Params=*/FuncTy_51_args, /*isVarArg=*/false); -std::vectorFuncTy_49_args; -FuncTy_49_args.push_back(PointerTy_24); -FuncTy_49_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_49_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_49 = FunctionType::get( + +std::vectorFuncTy_53_args; +FuncTy_53_args.push_back(PointerTy_28); +FuncTy_53_args.push_back(IntegerType::get(mod->getContext(), 32)); +FuncTy_53_args.push_back(IntegerType::get(mod->getContext(), 32)); +FunctionType* FuncTy_53 = FunctionType::get( /*Result=*/IntegerType::get(mod->getContext(), 32), - /*Params=*/FuncTy_49_args, + /*Params=*/FuncTy_53_args, /*isVarArg=*/false); + // Function Declarations Function* func_llvm_gcroot = Function::Create( @@ -470,7 +512,7 @@ func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); Function* func_abort = Function::Create( - /*Type=*/FuncTy_28, + /*Type=*/FuncTy_32, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"abort", mod); // (external, no body) func_abort->setCallingConv(CallingConv::C); @@ -486,7 +528,7 @@ func_abort->setAttributes(func_abort_PAL); Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create( - /*Type=*/FuncTy_31, + /*Type=*/FuncTy_35, /*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); @@ -502,7 +544,7 @@ 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_34, + /*Type=*/FuncTy_38, /*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); @@ -518,7 +560,7 @@ 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_31, + /*Type=*/FuncTy_35, /*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); @@ -534,7 +576,7 @@ func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL); Function* func_llvm_memory_barrier = Function::Create( - /*Type=*/FuncTy_47, + /*Type=*/FuncTy_51, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.memory.barrier", mod); // (external, no body) func_llvm_memory_barrier->setCallingConv(CallingConv::C); @@ -550,7 +592,7 @@ func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL); Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create( - /*Type=*/FuncTy_49, + /*Type=*/FuncTy_53, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"llvm.atomic.cmp.swap.i32.p0i32", mod); // (external, no body) func_llvm_atomic_cmp_swap_i32_p0i32->setCallingConv(CallingConv::C); @@ -568,7 +610,7 @@ func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL); Function* func__ZN3mvm6Thread5yieldEv = Function::Create( - /*Type=*/FuncTy_28, + /*Type=*/FuncTy_32, /*Linkage=*/GlobalValue::ExternalLinkage, /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C); @@ -577,124 +619,124 @@ // Global Variable Declarations -GlobalVariable* gvar_struct_final_object67 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_36, +GlobalVariable* gvar_struct_finalObject67 = new GlobalVariable(/*Module=*/ *mod, +/*Type=*/StructTy_40, /*isConstant=*/false, -/*Linkage=*/GlobalValue::InternalLinkage, +/*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject67"); -GlobalVariable* gvar_struct_final_object2 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_40, +GlobalVariable* gvar_struct_finalObject2 = new GlobalVariable(/*Module=*/ *mod, +/*Type=*/StructTy_44, /*isConstant=*/false, -/*Linkage=*/GlobalValue::InternalLinkage, +/*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject2"); -GlobalVariable* gvar_struct_final_object32 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_42, +GlobalVariable* gvar_struct_finalObject32 = new GlobalVariable(/*Module=*/ *mod, +/*Type=*/StructTy_46, /*isConstant=*/false, -/*Linkage=*/GlobalValue::InternalLinkage, +/*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject32"); GlobalVariable* gvar_struct_org_mmtk_utility_DoublyLinkedList_static = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_45, +/*Type=*/StructTy_49, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"org_mmtk_utility_DoublyLinkedList_static"); -GlobalVariable* gvar_struct_final_object85 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_36, +GlobalVariable* gvar_struct_finalObject85 = new GlobalVariable(/*Module=*/ *mod, +/*Type=*/StructTy_40, /*isConstant=*/false, -/*Linkage=*/GlobalValue::InternalLinkage, +/*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject85"); -GlobalVariable* gvar_struct_final_object101 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_42, +GlobalVariable* gvar_struct_finalObject101 = new GlobalVariable(/*Module=*/ *mod, +/*Type=*/StructTy_46, /*isConstant=*/false, -/*Linkage=*/GlobalValue::InternalLinkage, +/*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject101"); -GlobalVariable* gvar_struct_final_object122 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_36, +GlobalVariable* gvar_struct_finalObject122 = new GlobalVariable(/*Module=*/ *mod, +/*Type=*/StructTy_40, /*isConstant=*/false, -/*Linkage=*/GlobalValue::InternalLinkage, +/*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"finalObject122"); // Constant Definitions -ConstantInt* const_int32_50 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); -ConstantPointerNull* const_ptr_51 = ConstantPointerNull::get(PointerTy_3); -ConstantPointerNull* const_ptr_52 = ConstantPointerNull::get(PointerTy_0); -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)); -ConstantPointerNull* const_ptr_76 = ConstantPointerNull::get(PointerTy_25); -std::vector const_ptr_77_indices; -const_ptr_77_indices.push_back(const_int32_55); -const_ptr_77_indices.push_back(const_int32_57); -Constant* const_ptr_77 = ConstantExpr::getGetElementPtr(gvar_struct_final_object67, &const_ptr_77_indices[0], const_ptr_77_indices.size()); -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_50); -Constant* const_ptr_79 = ConstantExpr::getGetElementPtr(gvar_struct_final_object2, &const_ptr_79_indices[0], const_ptr_79_indices.size()); -std::vector const_ptr_80_indices; -const_ptr_80_indices.push_back(const_int32_55); -const_ptr_80_indices.push_back(const_int32_50); -Constant* const_ptr_80 = ConstantExpr::getGetElementPtr(gvar_struct_final_object32, &const_ptr_80_indices[0], const_ptr_80_indices.size()); +ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); +ConstantPointerNull* const_ptr_55 = ConstantPointerNull::get(PointerTy_3); +ConstantPointerNull* const_ptr_56 = ConstantPointerNull::get(PointerTy_0); +ConstantInt* const_int32_57 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); +ConstantInt* const_int32_58 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); +ConstantInt* const_int32_59 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); +ConstantInt* const_int32_60 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); +ConstantInt* const_int32_61 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); +ConstantInt* const_int32_62 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8193"), 10)); +ConstantInt* const_int32_63 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("4"), 10)); +ConstantInt* const_int32_64 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("7"), 10)); +ConstantInt* const_int32_65 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8"), 10)); +ConstantInt* const_int32_66 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-1"), 10)); +ConstantInt* const_int32_67 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("63"), 10)); +ConstantInt* const_int32_68 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("127"), 10)); +ConstantInt* const_int32_69 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("255"), 10)); +ConstantInt* const_int32_70 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("511"), 10)); +ConstantInt* const_int32_71 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2047"), 10)); +ConstantInt* const_int32_72 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("10"), 10)); +ConstantInt* const_int32_73 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("32"), 10)); +ConstantInt* const_int32_74 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("12"), 10)); +ConstantInt* const_int32_75 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); +ConstantInt* const_int32_76 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("16"), 10)); +ConstantInt* const_int32_77 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("6"), 10)); +ConstantInt* const_int32_78 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("20"), 10)); +ConstantInt* const_int32_79 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10)); +ConstantPointerNull* const_ptr_80 = ConstantPointerNull::get(PointerTy_29); 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_final_object32, &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_26); +const_ptr_81_indices.push_back(const_int32_59); +const_ptr_81_indices.push_back(const_int32_61); +Constant* const_ptr_81 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject67, &const_ptr_81_indices[0], const_ptr_81_indices.size()); +ConstantInt* const_int8_82 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("-4"), 10)); +std::vector const_ptr_83_indices; +const_ptr_83_indices.push_back(const_int32_59); +const_ptr_83_indices.push_back(const_int32_54); +Constant* const_ptr_83 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject2, &const_ptr_83_indices[0], const_ptr_83_indices.size()); std::vector const_ptr_84_indices; -const_ptr_84_indices.push_back(const_int32_55); -const_ptr_84_indices.push_back(const_int32_57); -Constant* const_ptr_84 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_84_indices[0], const_ptr_84_indices.size()); -ConstantInt* const_int32_85 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); -ConstantInt* const_int1_86 = ConstantInt::get(mod->getContext(), APInt(1, 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_final_object85, &const_ptr_87_indices[0], const_ptr_87_indices.size()); +const_ptr_84_indices.push_back(const_int32_59); +const_ptr_84_indices.push_back(const_int32_54); +Constant* const_ptr_84 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_84_indices[0], const_ptr_84_indices.size()); +std::vector const_ptr_85_indices; +const_ptr_85_indices.push_back(const_int32_59); +const_ptr_85_indices.push_back(const_int32_57); +Constant* const_ptr_85 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_85_indices[0], const_ptr_85_indices.size()); +ConstantInt* const_int32_86 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); +ConstantPointerNull* const_ptr_87 = ConstantPointerNull::get(PointerTy_30); std::vector const_ptr_88_indices; -const_ptr_88_indices.push_back(const_int32_55); -const_ptr_88_indices.push_back(const_int32_50); -Constant* const_ptr_88 = ConstantExpr::getGetElementPtr(gvar_struct_final_object101, &const_ptr_88_indices[0], const_ptr_88_indices.size()); -std::vector const_ptr_89_indices; -const_ptr_89_indices.push_back(const_int32_55); -const_ptr_89_indices.push_back(const_int32_53); -Constant* const_ptr_89 = ConstantExpr::getGetElementPtr(gvar_struct_final_object101, &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_final_object122, &const_ptr_90_indices[0], const_ptr_90_indices.size()); +const_ptr_88_indices.push_back(const_int32_59); +const_ptr_88_indices.push_back(const_int32_61); +Constant* const_ptr_88 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_88_indices[0], const_ptr_88_indices.size()); +ConstantInt* const_int32_89 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); +ConstantInt* const_int1_90 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10)); +std::vector const_ptr_91_indices; +const_ptr_91_indices.push_back(const_int32_59); +const_ptr_91_indices.push_back(const_int32_61); +Constant* const_ptr_91 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject85, &const_ptr_91_indices[0], const_ptr_91_indices.size()); +std::vector const_ptr_92_indices; +const_ptr_92_indices.push_back(const_int32_59); +const_ptr_92_indices.push_back(const_int32_54); +Constant* const_ptr_92 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_92_indices[0], const_ptr_92_indices.size()); +std::vector const_ptr_93_indices; +const_ptr_93_indices.push_back(const_int32_59); +const_ptr_93_indices.push_back(const_int32_57); +Constant* const_ptr_93 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_93_indices[0], const_ptr_93_indices.size()); +std::vector const_ptr_94_indices; +const_ptr_94_indices.push_back(const_int32_59); +const_ptr_94_indices.push_back(const_int32_61); +Constant* const_ptr_94 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject122, &const_ptr_94_indices[0], const_ptr_94_indices.size()); // Global Variable Definitions @@ -795,888 +837,888 @@ // Block JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III.exit (label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit) AllocaInst* ptr_res = new AllocaInst(PointerTy_3, "res", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); ptr_res->setAlignment(4); - new StoreInst(const_ptr_51, ptr_res, false, label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); + new StoreInst(const_ptr_55, ptr_res, false, label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); CastInst* ptr_res1 = new BitCastInst(ptr_res, PointerTy_7, "res1", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -std::vector void_92_params; -void_92_params.push_back(ptr_res1); -void_92_params.push_back(const_ptr_52); -CallInst* void_92 = CallInst::Create(func_llvm_gcroot, void_92_params.begin(), void_92_params.end(), "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -void_92->setCallingConv(CallingConv::C); -void_92->setTailCall(false);AttrListPtr void_92_PAL; +std::vector void_96_params; +void_96_params.push_back(ptr_res1); +void_96_params.push_back(const_ptr_56); +CallInst* void_96 = CallInst::Create(func_llvm_gcroot, void_96_params.begin(), void_96_params.end(), "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +void_96->setCallingConv(CallingConv::C); +void_96->setTailCall(false);AttrListPtr void_96_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - void_92_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_96_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_92->setAttributes(void_92_PAL); +void_96->setAttributes(void_96_PAL); -BinaryOperator* int32_93 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_53, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -BinaryOperator* int32_94 = BinaryOperator::Create(Instruction::And, int32_93, const_int32_54, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -CallInst* ptr_95 = CallInst::Create(func_llvm_frameaddress, const_int32_55, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -ptr_95->setCallingConv(CallingConv::C); -ptr_95->setTailCall(false);AttrListPtr ptr_95_PAL; +BinaryOperator* int32_97 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_57, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +BinaryOperator* int32_98 = BinaryOperator::Create(Instruction::And, int32_97, const_int32_58, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +CallInst* ptr_99 = CallInst::Create(func_llvm_frameaddress, const_int32_59, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +ptr_99->setCallingConv(CallingConv::C); +ptr_99->setTailCall(false);AttrListPtr ptr_99_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; Attrs.push_back(PAWI); - ptr_95_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + ptr_99_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -ptr_95->setAttributes(ptr_95_PAL); +ptr_99->setAttributes(ptr_99_PAL); -CastInst* int32_96 = new PtrToIntInst(ptr_95, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -BinaryOperator* int32_97 = BinaryOperator::Create(Instruction::And, int32_96, const_int32_56, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -CastInst* ptr_98 = new IntToPtrInst(int32_97, PointerTy_12, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -std::vector ptr_99_indices; -ptr_99_indices.push_back(const_int32_55); -ptr_99_indices.push_back(const_int32_57); -Instruction* ptr_99 = GetElementPtrInst::Create(ptr_98, ptr_99_indices.begin(), ptr_99_indices.end(), "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -LoadInst* int32_100 = new LoadInst(ptr_99, "", false, label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -ICmpInst* int1_101 = new ICmpInst(*label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit, ICmpInst::ICMP_SLT, int32_94, const_int32_58, ""); -SelectInst* int32_retval_i = SelectInst::Create(int1_101, const_int32_55, const_int32_59, "retval.i", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -CastInst* ptr_tmp1 = new IntToPtrInst(int32_100, PointerTy_25, "tmp1", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -SwitchInst* void_102 = SwitchInst::Create(int32_retval_i, label_tableswitch_i_i6, 7, label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); -void_102->addCase(const_int32_55, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); -void_102->addCase(const_int32_57, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -void_102->addCase(const_int32_53, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -void_102->addCase(const_int32_59, label_tableswitch3_i_i9); -void_102->addCase(const_int32_60, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); -void_102->addCase(const_int32_61, label_tableswitch5_i_i11); +CastInst* int32_100 = new PtrToIntInst(ptr_99, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +BinaryOperator* int32_101 = BinaryOperator::Create(Instruction::And, int32_100, const_int32_60, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +CastInst* ptr_102 = new IntToPtrInst(int32_101, PointerTy_12, "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +std::vector ptr_103_indices; +ptr_103_indices.push_back(const_int32_59); +ptr_103_indices.push_back(const_int32_61); +Instruction* ptr_103 = GetElementPtrInst::Create(ptr_102, ptr_103_indices.begin(), ptr_103_indices.end(), "", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +LoadInst* int32_104 = new LoadInst(ptr_103, "", false, label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +ICmpInst* int1_105 = new ICmpInst(*label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit, ICmpInst::ICMP_SLT, int32_98, const_int32_62, ""); +SelectInst* int32_retval_i = SelectInst::Create(int1_105, const_int32_59, const_int32_63, "retval.i", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +CastInst* ptr_tmp1 = new IntToPtrInst(int32_104, PointerTy_29, "tmp1", label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +SwitchInst* void_106 = SwitchInst::Create(int32_retval_i, label_tableswitch_i_i6, 7, label_JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III_exit); +void_106->addCase(const_int32_59, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); +void_106->addCase(const_int32_61, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +void_106->addCase(const_int32_57, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); +void_106->addCase(const_int32_63, label_tableswitch3_i_i9); +void_106->addCase(const_int32_64, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); +void_106->addCase(const_int32_65, label_tableswitch5_i_i11); // Block tableswitch.i.i6 (label_tableswitch_i_i6) -CallInst* void_103 = CallInst::Create(func_abort, "", label_tableswitch_i_i6); -void_103->setCallingConv(CallingConv::C); -void_103->setTailCall(false);AttrListPtr void_103_PAL; +CallInst* void_107 = CallInst::Create(func_abort, "", label_tableswitch_i_i6); +void_107->setCallingConv(CallingConv::C); +void_107->setTailCall(false);AttrListPtr void_107_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; Attrs.push_back(PAWI); - void_103_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_107_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_103->setAttributes(void_103_PAL); +void_107->setAttributes(void_107_PAL); new UnreachableInst(mod->getContext(), label_tableswitch_i_i6); // 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) -GetElementPtrInst* ptr_105 = GetElementPtrInst::Create(ptr_tmp1, const_int32_59, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -CastInst* ptr_106 = new BitCastInst(ptr_105, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -LoadInst* ptr_107 = new LoadInst(ptr_106, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -BinaryOperator* int32_108 = BinaryOperator::Create(Instruction::Add, int32_94, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -ICmpInst* int1_109 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_108, 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_109, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +GetElementPtrInst* ptr_109 = GetElementPtrInst::Create(ptr_tmp1, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_110 = new BitCastInst(ptr_109, PointerTy_33, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +LoadInst* ptr_111 = new LoadInst(ptr_110, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +BinaryOperator* int32_112 = BinaryOperator::Create(Instruction::Add, int32_98, const_int32_66, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +ICmpInst* int1_113 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_112, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_113, 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_111 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, 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_111, label_GOTO_or_IF_4_i_i_i_i_i); +ICmpInst* int1_115 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_112, const_int32_68, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_115, 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_113 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, 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_113, label_GOTO_or_IF_6_i_i_i_i_i); +ICmpInst* int1_117 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_112, const_int32_69, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_117, 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_115 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_108, 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_115, label_GOTO_or_IF_7_i_i1_i_i_i); +ICmpInst* int1_119 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_112, const_int32_70, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_119, 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_117 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_108, 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_117, label_GOTO_or_IF_8_i_i_i_i_i); +ICmpInst* int1_121 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_112, const_int32_71, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_121, 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_119 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_68, "", label_GOTO_or_IF_9_i_i_i_i_i); -BinaryOperator* int32_120 = BinaryOperator::Create(Instruction::Add, int32_119, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_123 = BinaryOperator::Create(Instruction::AShr, int32_112, const_int32_72, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_124 = BinaryOperator::Create(Instruction::Add, int32_123, const_int32_73, "", 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_122 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i_i_i); +BinaryOperator* int32_126 = BinaryOperator::Create(Instruction::AShr, int32_112, const_int32_61, "", 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_124 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i_i_i); -BinaryOperator* int32_125 = BinaryOperator::Create(Instruction::Add, int32_124, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_128 = BinaryOperator::Create(Instruction::AShr, int32_112, const_int32_63, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_129 = BinaryOperator::Create(Instruction::Add, int32_128, const_int32_74, "", 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_127 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i_i_i); -BinaryOperator* int32_128 = BinaryOperator::Create(Instruction::Add, int32_127, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_131 = BinaryOperator::Create(Instruction::AShr, int32_112, const_int32_75, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_132 = BinaryOperator::Create(Instruction::Add, int32_131, const_int32_76, "", 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_130 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i_i_i); -BinaryOperator* int32_131 = BinaryOperator::Create(Instruction::Add, int32_130, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_134 = BinaryOperator::Create(Instruction::AShr, int32_112, const_int32_77, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_135 = BinaryOperator::Create(Instruction::Add, int32_134, const_int32_78, "", 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_133 = BinaryOperator::Create(Instruction::AShr, int32_108, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i_i_i); -BinaryOperator* int32_134 = BinaryOperator::Create(Instruction::Add, int32_133, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_137 = BinaryOperator::Create(Instruction::AShr, int32_112, const_int32_65, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_138 = BinaryOperator::Create(Instruction::Add, int32_137, const_int32_79, "", 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_136 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -int32_136->reserveOperandSpace(6); -int32_136->addIncoming(int32_122, label_false_IF_ICMPGT16_i_i_i_i_i); -int32_136->addIncoming(int32_125, label_false_IF_ICMPGT17_i_i_i_i_i); -int32_136->addIncoming(int32_128, label_false_IF_ICMPGT18_i_i_i_i_i); -int32_136->addIncoming(int32_131, label_false_IF_ICMPGT19_i_i_i_i_i); -int32_136->addIncoming(int32_134, label_false_IF_ICMPGT20_i_i_i_i_i); -int32_136->addIncoming(int32_120, label_GOTO_or_IF_9_i_i_i_i_i); - -std::vector ptr_137_indices; -ptr_137_indices.push_back(const_int32_50); -ptr_137_indices.push_back(const_int32_50); -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); -LoadInst* ptr_138 = new LoadInst(ptr_137, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -BinaryOperator* int32_139 = BinaryOperator::Create(Instruction::Add, int32_136, const_int32_50, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -CastInst* ptr_140 = new BitCastInst(ptr_138, PointerTy_24, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_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); -LoadInst* int32_142 = new LoadInst(ptr_141, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -ICmpInst* int1_143 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_142, const_int32_55, ""); -BranchInst::Create(label_GOTO_or_IF__i_i_i, label_false_IFNE_i_i_i, int1_143, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +PHINode* int32_140 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +int32_140->reserveOperandSpace(6); +int32_140->addIncoming(int32_126, label_false_IF_ICMPGT16_i_i_i_i_i); +int32_140->addIncoming(int32_129, label_false_IF_ICMPGT17_i_i_i_i_i); +int32_140->addIncoming(int32_132, label_false_IF_ICMPGT18_i_i_i_i_i); +int32_140->addIncoming(int32_135, label_false_IF_ICMPGT19_i_i_i_i_i); +int32_140->addIncoming(int32_138, label_false_IF_ICMPGT20_i_i_i_i_i); +int32_140->addIncoming(int32_124, label_GOTO_or_IF_9_i_i_i_i_i); + +std::vector ptr_141_indices; +ptr_141_indices.push_back(const_int32_54); +ptr_141_indices.push_back(const_int32_54); +Instruction* ptr_141 = GetElementPtrInst::Create(ptr_111, ptr_141_indices.begin(), ptr_141_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* ptr_142 = new LoadInst(ptr_141, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +BinaryOperator* int32_143 = BinaryOperator::Create(Instruction::Add, int32_140, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_144 = new BitCastInst(ptr_142, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +GetElementPtrInst* ptr_145 = GetElementPtrInst::Create(ptr_144, int32_143, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* int32_146 = new LoadInst(ptr_145, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +ICmpInst* int1_147 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_146, const_int32_59, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i, label_false_IFNE_i_i_i, int1_147, 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_145_params; -ptr_145_params.push_back(ptr_107); -ptr_145_params.push_back(int32_94); -ptr_145_params.push_back(const_int32_55); -ptr_145_params.push_back(const_int32_55); -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); -ptr_145->setCallingConv(CallingConv::C); -ptr_145->setTailCall(false);AttrListPtr ptr_145_PAL; -ptr_145->setAttributes(ptr_145_PAL); +std::vector ptr_149_params; +ptr_149_params.push_back(ptr_111); +ptr_149_params.push_back(int32_98); +ptr_149_params.push_back(const_int32_59); +ptr_149_params.push_back(const_int32_59); +CallInst* ptr_149 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_149_params.begin(), ptr_149_params.end(), "", label_GOTO_or_IF__i_i_i); +ptr_149->setCallingConv(CallingConv::C); +ptr_149->setTailCall(false);AttrListPtr ptr_149_PAL; +ptr_149->setAttributes(ptr_149_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_GOTO_or_IF__i_i_i); // Block false IFNE.i.i.i (label_false_IFNE_i_i_i) -CastInst* ptr_147 = new IntToPtrInst(int32_142, PointerTy_29, "", label_false_IFNE_i_i_i); -LoadInst* ptr_148 = new LoadInst(ptr_147, "", false, label_false_IFNE_i_i_i); -CastInst* int32_149 = new PtrToIntInst(ptr_148, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i); - new StoreInst(int32_149, ptr_141, false, label_false_IFNE_i_i_i); - new StoreInst(const_ptr_76, ptr_147, false, label_false_IFNE_i_i_i); +CastInst* ptr_151 = new IntToPtrInst(int32_146, PointerTy_33, "", label_false_IFNE_i_i_i); +LoadInst* ptr_152 = new LoadInst(ptr_151, "", false, label_false_IFNE_i_i_i); +CastInst* int32_153 = new PtrToIntInst(ptr_152, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i); + new StoreInst(int32_153, ptr_145, false, label_false_IFNE_i_i_i); + new StoreInst(const_ptr_80, ptr_151, false, label_false_IFNE_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i, label_false_IFNE_i_i_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i) -GetElementPtrInst* ptr_153 = GetElementPtrInst::Create(ptr_tmp1, const_int32_57, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -CastInst* ptr_154 = new BitCastInst(ptr_153, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -LoadInst* ptr_155 = new LoadInst(ptr_154, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -GetElementPtrInst* ptr_156 = GetElementPtrInst::Create(ptr_155, const_int32_50, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -CastInst* ptr_157 = new BitCastInst(ptr_156, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_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); -CastInst* int32_159 = new PtrToIntInst(ptr_158, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -BinaryOperator* int32_160 = BinaryOperator::Create(Instruction::Add, int32_159, int32_94, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -std::vector ptr_161_indices; -ptr_161_indices.push_back(const_int32_50); -ptr_161_indices.push_back(const_int32_50); -Instruction* ptr_161 = GetElementPtrInst::Create(ptr_155, ptr_161_indices.begin(), ptr_161_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); +GetElementPtrInst* ptr_157 = GetElementPtrInst::Create(ptr_tmp1, const_int32_61, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); +CastInst* ptr_158 = new BitCastInst(ptr_157, PointerTy_33, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_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); +GetElementPtrInst* ptr_160 = GetElementPtrInst::Create(ptr_159, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); +CastInst* ptr_161 = new BitCastInst(ptr_160, PointerTy_33, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); LoadInst* ptr_162 = new LoadInst(ptr_161, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); CastInst* int32_163 = new PtrToIntInst(ptr_162, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); -ICmpInst* int1_164 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i, ICmpInst::ICMP_UGT, int32_160, int32_163, ""); -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_164, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); +BinaryOperator* int32_164 = BinaryOperator::Create(Instruction::Add, int32_163, int32_98, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i); +std::vector ptr_165_indices; +ptr_165_indices.push_back(const_int32_54); +ptr_165_indices.push_back(const_int32_54); +Instruction* ptr_165 = GetElementPtrInst::Create(ptr_159, 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); +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); +CastInst* int32_167 = new PtrToIntInst(ptr_166, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_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, ICmpInst::ICMP_UGT, int32_164, int32_167, ""); +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_168, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_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_166_indices; -ptr_166_indices.push_back(const_int32_50); -ptr_166_indices.push_back(const_int32_55); -Instruction* ptr_166 = GetElementPtrInst::Create(ptr_155, ptr_166_indices.begin(), ptr_166_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_160, PointerTy_26, ".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_166, 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_170_indices; +ptr_170_indices.push_back(const_int32_54); +ptr_170_indices.push_back(const_int32_59); +Instruction* ptr_170 = GetElementPtrInst::Create(ptr_159, 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); +CastInst* ptr__c_i_i_i = new IntToPtrInst(int32_164, PointerTy_30, ".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_170, 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_mmtk_plan_marksweep_MSMutator_alloc__IIIII_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) -CastInst* ptr_169 = new IntToPtrInst(int32_160, PointerTy_25, "", label_false_IFEQ_i_i_i); -std::vector ptr_170_params; -ptr_170_params.push_back(ptr_155); -ptr_170_params.push_back(ptr_158); -ptr_170_params.push_back(ptr_169); -ptr_170_params.push_back(const_int32_55); -ptr_170_params.push_back(const_int32_55); -CallInst* ptr_170 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_170_params.begin(), ptr_170_params.end(), "", label_false_IFEQ_i_i_i); -ptr_170->setCallingConv(CallingConv::C); -ptr_170->setTailCall(false);AttrListPtr ptr_170_PAL; -ptr_170->setAttributes(ptr_170_PAL); +CastInst* ptr_173 = new IntToPtrInst(int32_164, PointerTy_29, "", label_false_IFEQ_i_i_i); +std::vector ptr_174_params; +ptr_174_params.push_back(ptr_159); +ptr_174_params.push_back(ptr_162); +ptr_174_params.push_back(ptr_173); +ptr_174_params.push_back(const_int32_59); +ptr_174_params.push_back(const_int32_59); +CallInst* ptr_174 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_174_params.begin(), ptr_174_params.end(), "", label_false_IFEQ_i_i_i); +ptr_174->setCallingConv(CallingConv::C); +ptr_174->setTailCall(false);AttrListPtr ptr_174_PAL; +ptr_174->setAttributes(ptr_174_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_false_IFEQ_i_i_i); // Block tableswitch3.i.i9 (label_tableswitch3_i_i9) -std::vector ptr_172_indices; -ptr_172_indices.push_back(const_int32_57); -ptr_172_indices.push_back(const_int32_50); -Instruction* ptr_172 = GetElementPtrInst::Create(ptr_tmp1, ptr_172_indices.begin(), ptr_172_indices.end(), "", label_tableswitch3_i_i9); -LoadInst* ptr_173 = new LoadInst(ptr_172, "", false, label_tableswitch3_i_i9); -CastInst* ptr_174 = new BitCastInst(ptr_173, PointerTy_25, "", label_tableswitch3_i_i9); -std::vector ptr_175_params; -ptr_175_params.push_back(ptr_174); -ptr_175_params.push_back(int32_94); -ptr_175_params.push_back(const_int32_55); -ptr_175_params.push_back(const_int32_55); -CallInst* ptr_175 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_175_params.begin(), ptr_175_params.end(), "", label_tableswitch3_i_i9); -ptr_175->setCallingConv(CallingConv::C); -ptr_175->setTailCall(false);AttrListPtr ptr_175_PAL; -ptr_175->setAttributes(ptr_175_PAL); +std::vector ptr_176_indices; +ptr_176_indices.push_back(const_int32_61); +ptr_176_indices.push_back(const_int32_54); +Instruction* ptr_176 = GetElementPtrInst::Create(ptr_tmp1, ptr_176_indices.begin(), ptr_176_indices.end(), "", label_tableswitch3_i_i9); +LoadInst* ptr_177 = new LoadInst(ptr_176, "", false, label_tableswitch3_i_i9); +CastInst* ptr_178 = new BitCastInst(ptr_177, PointerTy_29, "", label_tableswitch3_i_i9); +std::vector ptr_179_params; +ptr_179_params.push_back(ptr_178); +ptr_179_params.push_back(int32_98); +ptr_179_params.push_back(const_int32_59); +ptr_179_params.push_back(const_int32_59); +CallInst* ptr_179 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_179_params.begin(), ptr_179_params.end(), "", label_tableswitch3_i_i9); +ptr_179->setCallingConv(CallingConv::C); +ptr_179->setTailCall(false);AttrListPtr ptr_179_PAL; +ptr_179->setAttributes(ptr_179_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_tableswitch3_i_i9); // Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i2.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i) -GetElementPtrInst* ptr_177 = GetElementPtrInst::Create(ptr_tmp1, const_int32_53, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); -CastInst* ptr_178 = new BitCastInst(ptr_177, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); -LoadInst* ptr_179 = new LoadInst(ptr_178, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); -BinaryOperator* int32_180 = BinaryOperator::Create(Instruction::Add, int32_94, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); -ICmpInst* int1_181 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i, ICmpInst::ICMP_SGT, int32_180, const_int32_63, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i3_i_i, label_false_IF_ICMPGT16_i_i_i8_i_i, int1_181, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); +GetElementPtrInst* ptr_181 = GetElementPtrInst::Create(ptr_tmp1, const_int32_57, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); +CastInst* ptr_182 = new BitCastInst(ptr_181, PointerTy_33, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); +LoadInst* ptr_183 = new LoadInst(ptr_182, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); +BinaryOperator* int32_184 = BinaryOperator::Create(Instruction::Add, int32_98, const_int32_66, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); +ICmpInst* int1_185 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i, ICmpInst::ICMP_SGT, int32_184, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i3_i_i, label_false_IF_ICMPGT16_i_i_i8_i_i, int1_185, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i2_i_i); // Block GOTO or IF*4.i.i.i3.i.i (label_GOTO_or_IF_4_i_i_i3_i_i) -ICmpInst* int1_183 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i3_i_i, ICmpInst::ICMP_SGT, int32_180, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i4_i_i, label_false_IF_ICMPGT17_i_i_i9_i_i, int1_183, label_GOTO_or_IF_4_i_i_i3_i_i); +ICmpInst* int1_187 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i3_i_i, ICmpInst::ICMP_SGT, int32_184, const_int32_68, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i4_i_i, label_false_IF_ICMPGT17_i_i_i9_i_i, int1_187, label_GOTO_or_IF_4_i_i_i3_i_i); // Block GOTO or IF*6.i.i.i4.i.i (label_GOTO_or_IF_6_i_i_i4_i_i) -ICmpInst* int1_185 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i4_i_i, ICmpInst::ICMP_SGT, int32_180, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i5_i_i, label_false_IF_ICMPGT18_i_i_i10_i_i, int1_185, label_GOTO_or_IF_6_i_i_i4_i_i); +ICmpInst* int1_189 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i4_i_i, ICmpInst::ICMP_SGT, int32_184, const_int32_69, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i5_i_i, label_false_IF_ICMPGT18_i_i_i10_i_i, int1_189, label_GOTO_or_IF_6_i_i_i4_i_i); // Block GOTO or IF*7.i.i1.i5.i.i (label_GOTO_or_IF_7_i_i1_i5_i_i) -ICmpInst* int1_187 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i5_i_i, ICmpInst::ICMP_SGT, int32_180, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i6_i_i, label_false_IF_ICMPGT19_i_i_i11_i_i, int1_187, label_GOTO_or_IF_7_i_i1_i5_i_i); +ICmpInst* int1_191 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i5_i_i, ICmpInst::ICMP_SGT, int32_184, const_int32_70, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i6_i_i, label_false_IF_ICMPGT19_i_i_i11_i_i, int1_191, label_GOTO_or_IF_7_i_i1_i5_i_i); // Block GOTO or IF*8.i.i.i6.i.i (label_GOTO_or_IF_8_i_i_i6_i_i) -ICmpInst* int1_189 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i6_i_i, ICmpInst::ICMP_SGT, int32_180, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i7_i_i, label_false_IF_ICMPGT20_i_i_i12_i_i, int1_189, label_GOTO_or_IF_8_i_i_i6_i_i); +ICmpInst* int1_193 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i6_i_i, ICmpInst::ICMP_SGT, int32_184, const_int32_71, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i7_i_i, label_false_IF_ICMPGT20_i_i_i12_i_i, int1_193, label_GOTO_or_IF_8_i_i_i6_i_i); // Block GOTO or IF*9.i.i.i7.i.i (label_GOTO_or_IF_9_i_i_i7_i_i) -BinaryOperator* int32_191 = BinaryOperator::Create(Instruction::AShr, int32_180, const_int32_68, "", label_GOTO_or_IF_9_i_i_i7_i_i); -BinaryOperator* int32_192 = BinaryOperator::Create(Instruction::Add, int32_191, const_int32_69, "", label_GOTO_or_IF_9_i_i_i7_i_i); +BinaryOperator* int32_195 = BinaryOperator::Create(Instruction::AShr, int32_184, const_int32_72, "", label_GOTO_or_IF_9_i_i_i7_i_i); +BinaryOperator* int32_196 = BinaryOperator::Create(Instruction::Add, int32_195, const_int32_73, "", label_GOTO_or_IF_9_i_i_i7_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, label_GOTO_or_IF_9_i_i_i7_i_i); // Block false IF_ICMPGT16.i.i.i8.i.i (label_false_IF_ICMPGT16_i_i_i8_i_i) -BinaryOperator* int32_194 = BinaryOperator::Create(Instruction::AShr, int32_180, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i8_i_i); +BinaryOperator* int32_198 = BinaryOperator::Create(Instruction::AShr, int32_184, const_int32_61, "", label_false_IF_ICMPGT16_i_i_i8_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, label_false_IF_ICMPGT16_i_i_i8_i_i); // Block false IF_ICMPGT17.i.i.i9.i.i (label_false_IF_ICMPGT17_i_i_i9_i_i) -BinaryOperator* int32_196 = BinaryOperator::Create(Instruction::AShr, int32_180, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i9_i_i); -BinaryOperator* int32_197 = BinaryOperator::Create(Instruction::Add, int32_196, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i9_i_i); +BinaryOperator* int32_200 = BinaryOperator::Create(Instruction::AShr, int32_184, const_int32_63, "", label_false_IF_ICMPGT17_i_i_i9_i_i); +BinaryOperator* int32_201 = BinaryOperator::Create(Instruction::Add, int32_200, const_int32_74, "", label_false_IF_ICMPGT17_i_i_i9_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, label_false_IF_ICMPGT17_i_i_i9_i_i); // Block false IF_ICMPGT18.i.i.i10.i.i (label_false_IF_ICMPGT18_i_i_i10_i_i) -BinaryOperator* int32_199 = BinaryOperator::Create(Instruction::AShr, int32_180, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i10_i_i); -BinaryOperator* int32_200 = BinaryOperator::Create(Instruction::Add, int32_199, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i10_i_i); +BinaryOperator* int32_203 = BinaryOperator::Create(Instruction::AShr, int32_184, const_int32_75, "", label_false_IF_ICMPGT18_i_i_i10_i_i); +BinaryOperator* int32_204 = BinaryOperator::Create(Instruction::Add, int32_203, const_int32_76, "", label_false_IF_ICMPGT18_i_i_i10_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, label_false_IF_ICMPGT18_i_i_i10_i_i); // Block false IF_ICMPGT19.i.i.i11.i.i (label_false_IF_ICMPGT19_i_i_i11_i_i) -BinaryOperator* int32_202 = BinaryOperator::Create(Instruction::AShr, int32_180, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i11_i_i); -BinaryOperator* int32_203 = BinaryOperator::Create(Instruction::Add, int32_202, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i11_i_i); +BinaryOperator* int32_206 = BinaryOperator::Create(Instruction::AShr, int32_184, const_int32_77, "", label_false_IF_ICMPGT19_i_i_i11_i_i); +BinaryOperator* int32_207 = BinaryOperator::Create(Instruction::Add, int32_206, const_int32_78, "", label_false_IF_ICMPGT19_i_i_i11_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, label_false_IF_ICMPGT19_i_i_i11_i_i); // Block false IF_ICMPGT20.i.i.i12.i.i (label_false_IF_ICMPGT20_i_i_i12_i_i) -BinaryOperator* int32_205 = BinaryOperator::Create(Instruction::AShr, int32_180, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i12_i_i); -BinaryOperator* int32_206 = BinaryOperator::Create(Instruction::Add, int32_205, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i12_i_i); +BinaryOperator* int32_209 = BinaryOperator::Create(Instruction::AShr, int32_184, const_int32_65, "", label_false_IF_ICMPGT20_i_i_i12_i_i); +BinaryOperator* int32_210 = BinaryOperator::Create(Instruction::Add, int32_209, const_int32_79, "", label_false_IF_ICMPGT20_i_i_i12_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, label_false_IF_ICMPGT20_i_i_i12_i_i); // Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i13.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i) -PHINode* int32_208 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); -int32_208->reserveOperandSpace(6); -int32_208->addIncoming(int32_194, label_false_IF_ICMPGT16_i_i_i8_i_i); -int32_208->addIncoming(int32_197, label_false_IF_ICMPGT17_i_i_i9_i_i); -int32_208->addIncoming(int32_200, label_false_IF_ICMPGT18_i_i_i10_i_i); -int32_208->addIncoming(int32_203, label_false_IF_ICMPGT19_i_i_i11_i_i); -int32_208->addIncoming(int32_206, label_false_IF_ICMPGT20_i_i_i12_i_i); -int32_208->addIncoming(int32_192, label_GOTO_or_IF_9_i_i_i7_i_i); - -std::vector ptr_209_indices; -ptr_209_indices.push_back(const_int32_50); -ptr_209_indices.push_back(const_int32_50); -Instruction* ptr_209 = GetElementPtrInst::Create(ptr_179, ptr_209_indices.begin(), ptr_209_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); -LoadInst* ptr_210 = new LoadInst(ptr_209, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); -BinaryOperator* int32_211 = BinaryOperator::Create(Instruction::Add, int32_208, const_int32_50, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); -CastInst* ptr_212 = new BitCastInst(ptr_210, PointerTy_24, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); -GetElementPtrInst* ptr_213 = GetElementPtrInst::Create(ptr_212, int32_211, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); -LoadInst* int32_214 = new LoadInst(ptr_213, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); -ICmpInst* int1_215 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, ICmpInst::ICMP_EQ, int32_214, const_int32_55, ""); -BranchInst::Create(label_GOTO_or_IF__i14_i_i, label_false_IFNE_i18_i_i, int1_215, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +PHINode* int32_212 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +int32_212->reserveOperandSpace(6); +int32_212->addIncoming(int32_198, label_false_IF_ICMPGT16_i_i_i8_i_i); +int32_212->addIncoming(int32_201, label_false_IF_ICMPGT17_i_i_i9_i_i); +int32_212->addIncoming(int32_204, label_false_IF_ICMPGT18_i_i_i10_i_i); +int32_212->addIncoming(int32_207, label_false_IF_ICMPGT19_i_i_i11_i_i); +int32_212->addIncoming(int32_210, label_false_IF_ICMPGT20_i_i_i12_i_i); +int32_212->addIncoming(int32_196, label_GOTO_or_IF_9_i_i_i7_i_i); + +std::vector ptr_213_indices; +ptr_213_indices.push_back(const_int32_54); +ptr_213_indices.push_back(const_int32_54); +Instruction* ptr_213 = GetElementPtrInst::Create(ptr_183, ptr_213_indices.begin(), ptr_213_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +LoadInst* ptr_214 = new LoadInst(ptr_213, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +BinaryOperator* int32_215 = BinaryOperator::Create(Instruction::Add, int32_212, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +CastInst* ptr_216 = new BitCastInst(ptr_214, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +GetElementPtrInst* ptr_217 = GetElementPtrInst::Create(ptr_216, int32_215, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +LoadInst* int32_218 = new LoadInst(ptr_217, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); +ICmpInst* int1_219 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i, ICmpInst::ICMP_EQ, int32_218, const_int32_59, ""); +BranchInst::Create(label_GOTO_or_IF__i14_i_i, label_false_IFNE_i18_i_i, int1_219, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i13_i_i); // Block GOTO or IF*.i14.i.i (label_GOTO_or_IF__i14_i_i) -std::vector ptr_217_params; -ptr_217_params.push_back(ptr_179); -ptr_217_params.push_back(int32_94); -ptr_217_params.push_back(const_int32_55); -ptr_217_params.push_back(const_int32_55); -CallInst* ptr_217 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_217_params.begin(), ptr_217_params.end(), "", label_GOTO_or_IF__i14_i_i); -ptr_217->setCallingConv(CallingConv::C); -ptr_217->setTailCall(false);AttrListPtr ptr_217_PAL; -ptr_217->setAttributes(ptr_217_PAL); +std::vector ptr_221_params; +ptr_221_params.push_back(ptr_183); +ptr_221_params.push_back(int32_98); +ptr_221_params.push_back(const_int32_59); +ptr_221_params.push_back(const_int32_59); +CallInst* ptr_221 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_221_params.begin(), ptr_221_params.end(), "", label_GOTO_or_IF__i14_i_i); +ptr_221->setCallingConv(CallingConv::C); +ptr_221->setTailCall(false);AttrListPtr ptr_221_PAL; +ptr_221->setAttributes(ptr_221_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_GOTO_or_IF__i14_i_i); // Block false IFNE.i18.i.i (label_false_IFNE_i18_i_i) -CastInst* ptr_219 = new IntToPtrInst(int32_214, PointerTy_29, "", label_false_IFNE_i18_i_i); -LoadInst* ptr_220 = new LoadInst(ptr_219, "", false, label_false_IFNE_i18_i_i); -CastInst* int32_221 = new PtrToIntInst(ptr_220, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i18_i_i); - new StoreInst(int32_221, ptr_213, false, label_false_IFNE_i18_i_i); - new StoreInst(const_ptr_76, ptr_219, false, label_false_IFNE_i18_i_i); +CastInst* ptr_223 = new IntToPtrInst(int32_218, PointerTy_33, "", label_false_IFNE_i18_i_i); +LoadInst* ptr_224 = new LoadInst(ptr_223, "", false, label_false_IFNE_i18_i_i); +CastInst* int32_225 = new PtrToIntInst(ptr_224, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i18_i_i); + new StoreInst(int32_225, ptr_217, false, label_false_IFNE_i18_i_i); + new StoreInst(const_ptr_80, ptr_223, false, label_false_IFNE_i18_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i, label_false_IFNE_i18_i_i); // Block tableswitch5.i.i11 (label_tableswitch5_i_i11) -std::vector ptr_225_indices; -ptr_225_indices.push_back(const_int32_53); -ptr_225_indices.push_back(const_int32_50); -Instruction* ptr_225 = GetElementPtrInst::Create(ptr_tmp1, ptr_225_indices.begin(), ptr_225_indices.end(), "", label_tableswitch5_i_i11); -LoadInst* ptr_226 = new LoadInst(ptr_225, "", false, label_tableswitch5_i_i11); -CastInst* ptr_227 = new BitCastInst(ptr_226, PointerTy_25, "", label_tableswitch5_i_i11); -std::vector ptr_228_params; -ptr_228_params.push_back(ptr_227); -ptr_228_params.push_back(int32_94); -ptr_228_params.push_back(const_int32_55); -ptr_228_params.push_back(const_int32_55); -CallInst* ptr_228 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_228_params.begin(), ptr_228_params.end(), "", label_tableswitch5_i_i11); -ptr_228->setCallingConv(CallingConv::C); -ptr_228->setTailCall(false);AttrListPtr ptr_228_PAL; -ptr_228->setAttributes(ptr_228_PAL); +std::vector ptr_229_indices; +ptr_229_indices.push_back(const_int32_57); +ptr_229_indices.push_back(const_int32_54); +Instruction* ptr_229 = GetElementPtrInst::Create(ptr_tmp1, ptr_229_indices.begin(), ptr_229_indices.end(), "", label_tableswitch5_i_i11); +LoadInst* ptr_230 = new LoadInst(ptr_229, "", false, label_tableswitch5_i_i11); +CastInst* ptr_231 = new BitCastInst(ptr_230, PointerTy_29, "", label_tableswitch5_i_i11); +std::vector ptr_232_params; +ptr_232_params.push_back(ptr_231); +ptr_232_params.push_back(int32_98); +ptr_232_params.push_back(const_int32_59); +ptr_232_params.push_back(const_int32_59); +CallInst* ptr_232 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_232_params.begin(), ptr_232_params.end(), "", label_tableswitch5_i_i11); +ptr_232->setCallingConv(CallingConv::C); +ptr_232->setTailCall(false);AttrListPtr ptr_232_PAL; +ptr_232->setAttributes(ptr_232_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_tableswitch5_i_i11); // Block JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII.exit.i (label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i) PHINode* int32__in = PHINode::Create(IntegerType::get(mod->getContext(), 32), ".in", label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i); int32__in->reserveOperandSpace(2); -int32__in->addIncoming(int32_142, label_false_IFNE_i_i_i); -int32__in->addIncoming(int32_214, label_false_IFNE_i18_i_i); +int32__in->addIncoming(int32_146, label_false_IFNE_i_i_i); +int32__in->addIncoming(int32_218, label_false_IFNE_i18_i_i); -CastInst* ptr_230 = new IntToPtrInst(int32__in, PointerTy_25, "", label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i); +CastInst* ptr_234 = new IntToPtrInst(int32__in, PointerTy_29, "", label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i) -std::vector ptr_232_indices; -ptr_232_indices.push_back(const_int32_59); -ptr_232_indices.push_back(const_int32_50); -Instruction* ptr_232 = GetElementPtrInst::Create(ptr_tmp1, ptr_232_indices.begin(), ptr_232_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); -LoadInst* ptr_233 = new LoadInst(ptr_232, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); -CastInst* ptr_234 = new BitCastInst(ptr_233, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); -BinaryOperator* int32_235 = BinaryOperator::Create(Instruction::Add, int32_94, const_int32_62, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); -ICmpInst* int1_236 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i, ICmpInst::ICMP_SGT, int32_235, const_int32_63, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i, int1_236, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); +std::vector ptr_236_indices; +ptr_236_indices.push_back(const_int32_63); +ptr_236_indices.push_back(const_int32_54); +Instruction* ptr_236 = GetElementPtrInst::Create(ptr_tmp1, ptr_236_indices.begin(), ptr_236_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); +LoadInst* ptr_237 = new LoadInst(ptr_236, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); +CastInst* ptr_238 = new BitCastInst(ptr_237, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); +BinaryOperator* int32_239 = BinaryOperator::Create(Instruction::Add, int32_98, const_int32_66, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); +ICmpInst* int1_240 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i, ICmpInst::ICMP_SGT, int32_239, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i, int1_240, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i); // Block GOTO or IF*4.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i) -ICmpInst* int1_238 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i, ICmpInst::ICMP_SGT, int32_235, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i, int1_238, label_GOTO_or_IF_4_i_i_i_i); +ICmpInst* int1_242 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i, ICmpInst::ICMP_SGT, int32_239, const_int32_68, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i, int1_242, label_GOTO_or_IF_4_i_i_i_i); // Block GOTO or IF*6.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i) -ICmpInst* int1_240 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i, ICmpInst::ICMP_SGT, int32_235, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i, label_false_IF_ICMPGT18_i_i_i_i, int1_240, label_GOTO_or_IF_6_i_i_i_i); +ICmpInst* int1_244 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i, ICmpInst::ICMP_SGT, int32_239, const_int32_69, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i, label_false_IF_ICMPGT18_i_i_i_i, int1_244, label_GOTO_or_IF_6_i_i_i_i); // Block GOTO or IF*7.i.i1.i.i (label_GOTO_or_IF_7_i_i1_i_i) -ICmpInst* int1_242 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i, ICmpInst::ICMP_SGT, int32_235, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i, int1_242, label_GOTO_or_IF_7_i_i1_i_i); +ICmpInst* int1_246 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i, ICmpInst::ICMP_SGT, int32_239, const_int32_70, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i, int1_246, label_GOTO_or_IF_7_i_i1_i_i); // Block GOTO or IF*8.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i) -ICmpInst* int1_244 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i, ICmpInst::ICMP_SGT, int32_235, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i, int1_244, label_GOTO_or_IF_8_i_i_i_i); +ICmpInst* int1_248 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i, ICmpInst::ICMP_SGT, int32_239, const_int32_71, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i, int1_248, label_GOTO_or_IF_8_i_i_i_i); // Block GOTO or IF*9.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i) -BinaryOperator* int32_246 = BinaryOperator::Create(Instruction::AShr, int32_235, const_int32_68, "", label_GOTO_or_IF_9_i_i_i_i); -BinaryOperator* int32_247 = BinaryOperator::Create(Instruction::Add, int32_246, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i); +BinaryOperator* int32_250 = BinaryOperator::Create(Instruction::AShr, int32_239, const_int32_72, "", label_GOTO_or_IF_9_i_i_i_i); +BinaryOperator* int32_251 = BinaryOperator::Create(Instruction::Add, int32_250, const_int32_73, "", label_GOTO_or_IF_9_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, label_GOTO_or_IF_9_i_i_i_i); // Block false IF_ICMPGT16.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i) -BinaryOperator* int32_249 = BinaryOperator::Create(Instruction::AShr, int32_235, const_int32_57, "", label_false_IF_ICMPGT16_i_i_i_i); +BinaryOperator* int32_253 = BinaryOperator::Create(Instruction::AShr, int32_239, const_int32_61, "", label_false_IF_ICMPGT16_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, label_false_IF_ICMPGT16_i_i_i_i); // Block false IF_ICMPGT17.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i) -BinaryOperator* int32_251 = BinaryOperator::Create(Instruction::AShr, int32_235, const_int32_59, "", label_false_IF_ICMPGT17_i_i_i_i); -BinaryOperator* int32_252 = BinaryOperator::Create(Instruction::Add, int32_251, const_int32_70, "", label_false_IF_ICMPGT17_i_i_i_i); +BinaryOperator* int32_255 = BinaryOperator::Create(Instruction::AShr, int32_239, const_int32_63, "", label_false_IF_ICMPGT17_i_i_i_i); +BinaryOperator* int32_256 = BinaryOperator::Create(Instruction::Add, int32_255, const_int32_74, "", label_false_IF_ICMPGT17_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, label_false_IF_ICMPGT17_i_i_i_i); // Block false IF_ICMPGT18.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i) -BinaryOperator* int32_254 = BinaryOperator::Create(Instruction::AShr, int32_235, const_int32_71, "", label_false_IF_ICMPGT18_i_i_i_i); -BinaryOperator* int32_255 = BinaryOperator::Create(Instruction::Add, int32_254, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i); +BinaryOperator* int32_258 = BinaryOperator::Create(Instruction::AShr, int32_239, const_int32_75, "", label_false_IF_ICMPGT18_i_i_i_i); +BinaryOperator* int32_259 = BinaryOperator::Create(Instruction::Add, int32_258, const_int32_76, "", label_false_IF_ICMPGT18_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, label_false_IF_ICMPGT18_i_i_i_i); // Block false IF_ICMPGT19.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i) -BinaryOperator* int32_257 = BinaryOperator::Create(Instruction::AShr, int32_235, const_int32_73, "", label_false_IF_ICMPGT19_i_i_i_i); -BinaryOperator* int32_258 = BinaryOperator::Create(Instruction::Add, int32_257, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i); +BinaryOperator* int32_261 = BinaryOperator::Create(Instruction::AShr, int32_239, const_int32_77, "", label_false_IF_ICMPGT19_i_i_i_i); +BinaryOperator* int32_262 = BinaryOperator::Create(Instruction::Add, int32_261, const_int32_78, "", label_false_IF_ICMPGT19_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, label_false_IF_ICMPGT19_i_i_i_i); // Block false IF_ICMPGT20.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i) -BinaryOperator* int32_260 = BinaryOperator::Create(Instruction::AShr, int32_235, const_int32_61, "", label_false_IF_ICMPGT20_i_i_i_i); -BinaryOperator* int32_261 = BinaryOperator::Create(Instruction::Add, int32_260, const_int32_75, "", label_false_IF_ICMPGT20_i_i_i_i); +BinaryOperator* int32_264 = BinaryOperator::Create(Instruction::AShr, int32_239, const_int32_65, "", label_false_IF_ICMPGT20_i_i_i_i); +BinaryOperator* int32_265 = BinaryOperator::Create(Instruction::Add, int32_264, const_int32_79, "", label_false_IF_ICMPGT20_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, label_false_IF_ICMPGT20_i_i_i_i); // Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i) -PHINode* int32_263 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -int32_263->reserveOperandSpace(6); -int32_263->addIncoming(int32_249, label_false_IF_ICMPGT16_i_i_i_i); -int32_263->addIncoming(int32_252, label_false_IF_ICMPGT17_i_i_i_i); -int32_263->addIncoming(int32_255, label_false_IF_ICMPGT18_i_i_i_i); -int32_263->addIncoming(int32_258, label_false_IF_ICMPGT19_i_i_i_i); -int32_263->addIncoming(int32_261, label_false_IF_ICMPGT20_i_i_i_i); -int32_263->addIncoming(int32_247, label_GOTO_or_IF_9_i_i_i_i); - -GetElementPtrInst* ptr_264 = GetElementPtrInst::Create(ptr_233, const_int32_70, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -CastInst* ptr_265 = new BitCastInst(ptr_264, PointerTy_7, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -LoadInst* ptr_266 = new LoadInst(ptr_265, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -BinaryOperator* int32_267 = BinaryOperator::Create(Instruction::Add, int32_263, const_int32_50, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -CastInst* ptr_268 = new BitCastInst(ptr_266, PointerTy_24, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -GetElementPtrInst* ptr_269 = GetElementPtrInst::Create(ptr_268, int32_267, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -LoadInst* int32_270 = new LoadInst(ptr_269, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); -ICmpInst* int1_271 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, ICmpInst::ICMP_EQ, int32_270, const_int32_55, ""); -BranchInst::Create(label_GOTO_or_IF__i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i, int1_271, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +PHINode* int32_267 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +int32_267->reserveOperandSpace(6); +int32_267->addIncoming(int32_253, label_false_IF_ICMPGT16_i_i_i_i); +int32_267->addIncoming(int32_256, label_false_IF_ICMPGT17_i_i_i_i); +int32_267->addIncoming(int32_259, label_false_IF_ICMPGT18_i_i_i_i); +int32_267->addIncoming(int32_262, label_false_IF_ICMPGT19_i_i_i_i); +int32_267->addIncoming(int32_265, label_false_IF_ICMPGT20_i_i_i_i); +int32_267->addIncoming(int32_251, label_GOTO_or_IF_9_i_i_i_i); + +GetElementPtrInst* ptr_268 = GetElementPtrInst::Create(ptr_237, const_int32_74, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +CastInst* ptr_269 = new BitCastInst(ptr_268, PointerTy_7, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +LoadInst* ptr_270 = new LoadInst(ptr_269, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +BinaryOperator* int32_271 = BinaryOperator::Create(Instruction::Add, int32_267, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +CastInst* ptr_272 = new BitCastInst(ptr_270, PointerTy_28, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +GetElementPtrInst* ptr_273 = GetElementPtrInst::Create(ptr_272, int32_271, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +LoadInst* int32_274 = new LoadInst(ptr_273, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); +ICmpInst* int1_275 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i, ICmpInst::ICMP_EQ, int32_274, const_int32_59, ""); +BranchInst::Create(label_GOTO_or_IF__i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i, int1_275, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i); // Block GOTO or IF*.i.i (label_GOTO_or_IF__i_i) -std::vector ptr_273_params; -ptr_273_params.push_back(ptr_234); -ptr_273_params.push_back(int32_94); -ptr_273_params.push_back(const_int32_55); -ptr_273_params.push_back(const_int32_55); -CallInst* ptr_273 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_273_params.begin(), ptr_273_params.end(), "", label_GOTO_or_IF__i_i); -ptr_273->setCallingConv(CallingConv::C); -ptr_273->setTailCall(false);AttrListPtr ptr_273_PAL; -ptr_273->setAttributes(ptr_273_PAL); +std::vector ptr_277_params; +ptr_277_params.push_back(ptr_238); +ptr_277_params.push_back(int32_98); +ptr_277_params.push_back(const_int32_59); +ptr_277_params.push_back(const_int32_59); +CallInst* ptr_277 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_277_params.begin(), ptr_277_params.end(), "", label_GOTO_or_IF__i_i); +ptr_277->setCallingConv(CallingConv::C); +ptr_277->setTailCall(false);AttrListPtr ptr_277_PAL; +ptr_277->setAttributes(ptr_277_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_GOTO_or_IF__i_i); // Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i) -CastInst* ptr_275 = new IntToPtrInst(int32_270, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); -CastInst* ptr_276 = new IntToPtrInst(int32_270, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); -LoadInst* ptr_277 = new LoadInst(ptr_276, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); -CastInst* int32_278 = new PtrToIntInst(ptr_277, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); - new StoreInst(int32_278, ptr_269, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); - new StoreInst(const_ptr_76, ptr_276, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); +CastInst* ptr_279 = new IntToPtrInst(int32_274, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); +CastInst* ptr_280 = new IntToPtrInst(int32_274, PointerTy_33, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); +LoadInst* ptr_281 = new LoadInst(ptr_280, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); +CastInst* int32_282 = new PtrToIntInst(ptr_281, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); + new StoreInst(int32_282, ptr_273, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); + new StoreInst(const_ptr_80, ptr_280, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); // Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit) -PHINode* ptr_282 = PHINode::Create(PointerTy_25, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); -ptr_282->reserveOperandSpace(9); -ptr_282->addIncoming(ptr_228, label_tableswitch5_i_i11); -ptr_282->addIncoming(ptr_230, label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i); -ptr_282->addIncoming(ptr_217, label_GOTO_or_IF__i14_i_i); -ptr_282->addIncoming(ptr_175, label_tableswitch3_i_i9); -ptr_282->addIncoming(ptr_158, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); -ptr_282->addIncoming(ptr_170, label_false_IFEQ_i_i_i); -ptr_282->addIncoming(ptr_145, label_GOTO_or_IF__i_i_i); -ptr_282->addIncoming(ptr_275, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); -ptr_282->addIncoming(ptr_273, label_GOTO_or_IF__i_i); - -CastInst* ptr_283 = new BitCastInst(ptr_282, PointerTy_3, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); - new StoreInst(ptr_283, ptr_res, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); -std::vector ptr_285_indices; -ptr_285_indices.push_back(const_int32_55); -ptr_285_indices.push_back(const_int32_55); -Instruction* ptr_285 = GetElementPtrInst::Create(ptr_282, ptr_285_indices.begin(), ptr_285_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); -CastInst* ptr_VT_c_i_c = new BitCastInst(ptr__VT, PointerTy_26, "VT.c.i.c", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); - new StoreInst(ptr_VT_c_i_c, ptr_285, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); -LoadInst* ptr_287 = new LoadInst(ptr_res, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); -SwitchInst* void_288 = SwitchInst::Create(int32_retval_i, label_tableswitch_i_i, 7, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); -void_288->addCase(const_int32_55, label_false_IFNE_i); -void_288->addCase(const_int32_57, label_tableswitch1_i_i); -void_288->addCase(const_int32_53, label_tableswitch2_i_i); -void_288->addCase(const_int32_59, label_tableswitch3_i_i); -void_288->addCase(const_int32_60, label_tableswitch4_i_i); -void_288->addCase(const_int32_61, label_tableswitch5_i_i); +PHINode* ptr_286 = PHINode::Create(PointerTy_29, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); +ptr_286->reserveOperandSpace(9); +ptr_286->addIncoming(ptr_232, label_tableswitch5_i_i11); +ptr_286->addIncoming(ptr_234, label_JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII_exit_i); +ptr_286->addIncoming(ptr_221, label_GOTO_or_IF__i14_i_i); +ptr_286->addIncoming(ptr_179, label_tableswitch3_i_i9); +ptr_286->addIncoming(ptr_162, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i); +ptr_286->addIncoming(ptr_174, label_false_IFEQ_i_i_i); +ptr_286->addIncoming(ptr_149, label_GOTO_or_IF__i_i_i); +ptr_286->addIncoming(ptr_279, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i); +ptr_286->addIncoming(ptr_277, label_GOTO_or_IF__i_i); + +CastInst* ptr_287 = new BitCastInst(ptr_286, PointerTy_3, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); + new StoreInst(ptr_287, ptr_res, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); +std::vector ptr_289_indices; +ptr_289_indices.push_back(const_int32_59); +ptr_289_indices.push_back(const_int32_59); +Instruction* ptr_289 = GetElementPtrInst::Create(ptr_286, ptr_289_indices.begin(), ptr_289_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); +CastInst* ptr_VT_c_i_c = new BitCastInst(ptr__VT, PointerTy_30, "VT.c.i.c", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); + new StoreInst(ptr_VT_c_i_c, ptr_289, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); +LoadInst* ptr_291 = new LoadInst(ptr_res, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); +SwitchInst* void_292 = SwitchInst::Create(int32_retval_i, label_tableswitch_i_i, 7, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit); +void_292->addCase(const_int32_59, label_false_IFNE_i); +void_292->addCase(const_int32_61, label_tableswitch1_i_i); +void_292->addCase(const_int32_57, label_tableswitch2_i_i); +void_292->addCase(const_int32_63, label_tableswitch3_i_i); +void_292->addCase(const_int32_64, label_tableswitch4_i_i); +void_292->addCase(const_int32_65, label_tableswitch5_i_i); // Block tableswitch.i.i (label_tableswitch_i_i) -CallInst* void_289 = CallInst::Create(func_abort, "", label_tableswitch_i_i); -void_289->setCallingConv(CallingConv::C); -void_289->setTailCall(false);AttrListPtr void_289_PAL; +CallInst* void_293 = CallInst::Create(func_abort, "", label_tableswitch_i_i); +void_293->setCallingConv(CallingConv::C); +void_293->setTailCall(false);AttrListPtr void_293_PAL; { SmallVector Attrs; AttributeWithIndex PAWI; PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; Attrs.push_back(PAWI); - void_289_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + void_293_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); } -void_289->setAttributes(void_289_PAL); +void_293->setAttributes(void_293_PAL); new UnreachableInst(mod->getContext(), label_tableswitch_i_i); // Block tableswitch1.i.i (label_tableswitch1_i_i) -LoadInst* ptr_291 = new LoadInst(const_ptr_77, "", false, label_tableswitch1_i_i); -CastInst* int32_292 = new PtrToIntInst(ptr_291, IntegerType::get(mod->getContext(), 32), "", label_tableswitch1_i_i); -GetElementPtrInst* ptr_293 = GetElementPtrInst::Create(ptr_287, const_int32_50, "", label_tableswitch1_i_i); -CastInst* ptr_294 = new BitCastInst(ptr_293, PointerTy_0, "", label_tableswitch1_i_i); -LoadInst* int8_295 = new LoadInst(ptr_294, "", false, label_tableswitch1_i_i); -BinaryOperator* int8_296 = BinaryOperator::Create(Instruction::And, int8_295, const_int8_78, "", label_tableswitch1_i_i); -CastInst* int8_297 = new TruncInst(int32_292, IntegerType::get(mod->getContext(), 8), "", label_tableswitch1_i_i); -BinaryOperator* int8_298 = BinaryOperator::Create(Instruction::Or, int8_296, int8_297, "", label_tableswitch1_i_i); - new StoreInst(int8_298, ptr_294, false, label_tableswitch1_i_i); +LoadInst* ptr_295 = new LoadInst(const_ptr_81, "", false, label_tableswitch1_i_i); +CastInst* int32_296 = new PtrToIntInst(ptr_295, IntegerType::get(mod->getContext(), 32), "", label_tableswitch1_i_i); +GetElementPtrInst* ptr_297 = GetElementPtrInst::Create(ptr_291, const_int32_54, "", label_tableswitch1_i_i); +CastInst* ptr_298 = new BitCastInst(ptr_297, PointerTy_0, "", label_tableswitch1_i_i); +LoadInst* int8_299 = new LoadInst(ptr_298, "", false, label_tableswitch1_i_i); +BinaryOperator* int8_300 = BinaryOperator::Create(Instruction::And, int8_299, const_int8_82, "", label_tableswitch1_i_i); +CastInst* int8_301 = new TruncInst(int32_296, IntegerType::get(mod->getContext(), 8), "", label_tableswitch1_i_i); +BinaryOperator* int8_302 = BinaryOperator::Create(Instruction::Or, int8_300, int8_301, "", label_tableswitch1_i_i); + new StoreInst(int8_302, ptr_298, false, label_tableswitch1_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_tableswitch1_i_i); // Block tableswitch2.i.i (label_tableswitch2_i_i) -GetElementPtrInst* ptr_301 = GetElementPtrInst::Create(ptr_287, const_int32_50, "", label_tableswitch2_i_i); -CastInst* ptr_302 = new BitCastInst(ptr_301, PointerTy_24, "", label_tableswitch2_i_i); -LoadInst* int32_303 = new LoadInst(ptr_302, "", false, label_tableswitch2_i_i); -BinaryOperator* int32_304 = BinaryOperator::Create(Instruction::And, int32_303, const_int32_57, "", label_tableswitch2_i_i); -LoadInst* ptr_305 = new LoadInst(const_ptr_79, "", false, label_tableswitch2_i_i); -CastInst* int32_306 = new PtrToIntInst(ptr_305, IntegerType::get(mod->getContext(), 32), "", label_tableswitch2_i_i); -BinaryOperator* int32_307 = BinaryOperator::Create(Instruction::Or, int32_306, int32_304, "", label_tableswitch2_i_i); -CastInst* ptr_308 = new BitCastInst(ptr_301, PointerTy_0, "", label_tableswitch2_i_i); -CastInst* int8_trunc = new TruncInst(int32_303, IntegerType::get(mod->getContext(), 8), "trunc", label_tableswitch2_i_i); -BinaryOperator* int8_309 = BinaryOperator::Create(Instruction::And, int8_trunc, const_int8_78, "", label_tableswitch2_i_i); -CastInst* int8_310 = new TruncInst(int32_307, IntegerType::get(mod->getContext(), 8), "", label_tableswitch2_i_i); -BinaryOperator* int8_311 = BinaryOperator::Create(Instruction::Or, int8_310, int8_309, "", label_tableswitch2_i_i); - new StoreInst(int8_311, ptr_308, false, label_tableswitch2_i_i); +GetElementPtrInst* ptr_305 = GetElementPtrInst::Create(ptr_291, const_int32_54, "", label_tableswitch2_i_i); +CastInst* ptr_306 = new BitCastInst(ptr_305, PointerTy_28, "", label_tableswitch2_i_i); +LoadInst* int32_307 = new LoadInst(ptr_306, "", false, label_tableswitch2_i_i); +BinaryOperator* int32_308 = BinaryOperator::Create(Instruction::And, int32_307, const_int32_61, "", label_tableswitch2_i_i); +LoadInst* ptr_309 = new LoadInst(const_ptr_83, "", false, label_tableswitch2_i_i); +CastInst* int32_310 = new PtrToIntInst(ptr_309, IntegerType::get(mod->getContext(), 32), "", label_tableswitch2_i_i); +BinaryOperator* int32_311 = BinaryOperator::Create(Instruction::Or, int32_310, int32_308, "", label_tableswitch2_i_i); +CastInst* ptr_312 = new BitCastInst(ptr_305, PointerTy_0, "", label_tableswitch2_i_i); +CastInst* int8_trunc = new TruncInst(int32_307, IntegerType::get(mod->getContext(), 8), "trunc", label_tableswitch2_i_i); +BinaryOperator* int8_313 = BinaryOperator::Create(Instruction::And, int8_trunc, const_int8_82, "", label_tableswitch2_i_i); +CastInst* int8_314 = new TruncInst(int32_311, IntegerType::get(mod->getContext(), 8), "", label_tableswitch2_i_i); +BinaryOperator* int8_315 = BinaryOperator::Create(Instruction::Or, int8_314, int8_313, "", label_tableswitch2_i_i); + new StoreInst(int8_315, ptr_312, false, label_tableswitch2_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_tableswitch2_i_i); // Block tableswitch3.i.i (label_tableswitch3_i_i) -LoadInst* ptr_314 = new LoadInst(const_ptr_80, "", false, label_tableswitch3_i_i); -CastInst* int32_315 = new PtrToIntInst(ptr_314, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i); -BinaryOperator* int32_316 = BinaryOperator::Create(Instruction::Or, int32_315, const_int32_57, "", label_tableswitch3_i_i); -GetElementPtrInst* ptr_317 = GetElementPtrInst::Create(ptr_287, const_int32_50, "", label_tableswitch3_i_i); -CastInst* ptr_318 = new BitCastInst(ptr_317, PointerTy_0, "", label_tableswitch3_i_i); -LoadInst* int8_319 = new LoadInst(ptr_318, "", false, label_tableswitch3_i_i); -BinaryOperator* int8_320 = BinaryOperator::Create(Instruction::And, int8_319, const_int8_78, "", label_tableswitch3_i_i); -CastInst* int8_321 = new TruncInst(int32_316, IntegerType::get(mod->getContext(), 8), "", label_tableswitch3_i_i); -BinaryOperator* int8_322 = BinaryOperator::Create(Instruction::Or, int8_321, int8_320, "", label_tableswitch3_i_i); - new StoreInst(int8_322, ptr_318, false, label_tableswitch3_i_i); -LoadInst* ptr_324 = new LoadInst(const_ptr_81, "", false, label_tableswitch3_i_i); -CastInst* int32_325 = new PtrToIntInst(ptr_287, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i); -BinaryOperator* int32_326 = BinaryOperator::Create(Instruction::And, int32_325, const_int32_82, "", label_tableswitch3_i_i); -CastInst* ptr_327 = new IntToPtrInst(int32_326, PointerTy_25, "", label_tableswitch3_i_i); -std::vector ptr_328_indices; -ptr_328_indices.push_back(const_int32_57); -ptr_328_indices.push_back(const_int32_50); -Instruction* ptr_328 = GetElementPtrInst::Create(ptr_324, ptr_328_indices.begin(), ptr_328_indices.end(), "", label_tableswitch3_i_i); -LoadInst* ptr_329 = new LoadInst(ptr_328, "", false, label_tableswitch3_i_i); -GetElementPtrInst* ptr_330 = GetElementPtrInst::Create(ptr_329, const_int32_70, "", label_tableswitch3_i_i); -CastInst* ptr_331 = new BitCastInst(ptr_330, PointerTy_7, "", label_tableswitch3_i_i); -LoadInst* ptr_332 = new LoadInst(ptr_331, "", false, label_tableswitch3_i_i); -ICmpInst* int1_333 = new ICmpInst(*label_tableswitch3_i_i, ICmpInst::ICMP_EQ, ptr_332, const_ptr_52, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_true_IFNULL_i5_i_i6_i_i, int1_333, label_tableswitch3_i_i); +LoadInst* ptr_318 = new LoadInst(const_ptr_84, "", false, label_tableswitch3_i_i); +CastInst* int32_319 = new PtrToIntInst(ptr_318, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i); +BinaryOperator* int32_320 = BinaryOperator::Create(Instruction::Or, int32_319, const_int32_61, "", label_tableswitch3_i_i); +GetElementPtrInst* ptr_321 = GetElementPtrInst::Create(ptr_291, const_int32_54, "", label_tableswitch3_i_i); +CastInst* ptr_322 = new BitCastInst(ptr_321, PointerTy_0, "", label_tableswitch3_i_i); +LoadInst* int8_323 = new LoadInst(ptr_322, "", false, label_tableswitch3_i_i); +BinaryOperator* int8_324 = BinaryOperator::Create(Instruction::And, int8_323, const_int8_82, "", label_tableswitch3_i_i); +CastInst* int8_325 = new TruncInst(int32_320, IntegerType::get(mod->getContext(), 8), "", label_tableswitch3_i_i); +BinaryOperator* int8_326 = BinaryOperator::Create(Instruction::Or, int8_325, int8_324, "", label_tableswitch3_i_i); + new StoreInst(int8_326, ptr_322, false, label_tableswitch3_i_i); +LoadInst* ptr_328 = new LoadInst(const_ptr_85, "", false, label_tableswitch3_i_i); +CastInst* int32_329 = new PtrToIntInst(ptr_291, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i); +BinaryOperator* int32_330 = BinaryOperator::Create(Instruction::And, int32_329, const_int32_86, "", label_tableswitch3_i_i); +CastInst* ptr_331 = new IntToPtrInst(int32_330, PointerTy_29, "", label_tableswitch3_i_i); +std::vector ptr_332_indices; +ptr_332_indices.push_back(const_int32_61); +ptr_332_indices.push_back(const_int32_54); +Instruction* ptr_332 = GetElementPtrInst::Create(ptr_328, ptr_332_indices.begin(), ptr_332_indices.end(), "", label_tableswitch3_i_i); +LoadInst* ptr_333 = new LoadInst(ptr_332, "", false, label_tableswitch3_i_i); +GetElementPtrInst* ptr_334 = GetElementPtrInst::Create(ptr_333, const_int32_74, "", label_tableswitch3_i_i); +CastInst* ptr_335 = new BitCastInst(ptr_334, PointerTy_7, "", label_tableswitch3_i_i); +LoadInst* ptr_336 = new LoadInst(ptr_335, "", false, label_tableswitch3_i_i); +ICmpInst* int1_337 = new ICmpInst(*label_tableswitch3_i_i, ICmpInst::ICMP_EQ, ptr_336, const_ptr_56, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_true_IFNULL_i5_i_i6_i_i, int1_337, label_tableswitch3_i_i); // Block true IF*NULL.i1.i.i3.i.i (label_true_IF_NULL_i1_i_i3_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_327, ptr_335_indices.begin(), ptr_335_indices.end(), "", label_true_IF_NULL_i1_i_i3_i_i); - new StoreInst(const_ptr_83, ptr_335, false, label_true_IF_NULL_i1_i_i3_i_i); -GetElementPtrInst* ptr_337 = GetElementPtrInst::Create(ptr_329, const_int32_61, "", label_true_IF_NULL_i1_i_i3_i_i); -CastInst* ptr_338 = new BitCastInst(ptr_337, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i); -LoadInst* ptr_339 = new LoadInst(ptr_338, "", false, label_true_IF_NULL_i1_i_i3_i_i); -LoadInst* ptr_340 = new LoadInst(const_ptr_84, "", false, label_true_IF_NULL_i1_i_i3_i_i); -CastInst* int32_341 = new PtrToIntInst(ptr_340, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i3_i_i); -BinaryOperator* int32_342 = BinaryOperator::Create(Instruction::Add, int32_341, int32_326, "", label_true_IF_NULL_i1_i_i3_i_i); -CastInst* ptr_343 = new IntToPtrInst(int32_342, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i); - new StoreInst(ptr_339, ptr_343, false, label_true_IF_NULL_i1_i_i3_i_i); -LoadInst* ptr_345 = new LoadInst(ptr_338, "", false, label_true_IF_NULL_i1_i_i3_i_i); -ICmpInst* int1_346 = new ICmpInst(*label_true_IF_NULL_i1_i_i3_i_i, ICmpInst::ICMP_EQ, ptr_345, const_ptr_76, ""); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i, label_false_IFNE_i7_i_i8_i_i, int1_346, label_true_IF_NULL_i1_i_i3_i_i); +std::vector ptr_339_indices; +ptr_339_indices.push_back(const_int32_59); +ptr_339_indices.push_back(const_int32_59); +Instruction* ptr_339 = GetElementPtrInst::Create(ptr_331, ptr_339_indices.begin(), ptr_339_indices.end(), "", label_true_IF_NULL_i1_i_i3_i_i); + new StoreInst(const_ptr_87, ptr_339, false, label_true_IF_NULL_i1_i_i3_i_i); +GetElementPtrInst* ptr_341 = GetElementPtrInst::Create(ptr_333, const_int32_65, "", label_true_IF_NULL_i1_i_i3_i_i); +CastInst* ptr_342 = new BitCastInst(ptr_341, PointerTy_33, "", label_true_IF_NULL_i1_i_i3_i_i); +LoadInst* ptr_343 = new LoadInst(ptr_342, "", false, label_true_IF_NULL_i1_i_i3_i_i); +LoadInst* ptr_344 = new LoadInst(const_ptr_88, "", false, label_true_IF_NULL_i1_i_i3_i_i); +CastInst* int32_345 = new PtrToIntInst(ptr_344, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i3_i_i); +BinaryOperator* int32_346 = BinaryOperator::Create(Instruction::Add, int32_345, int32_330, "", label_true_IF_NULL_i1_i_i3_i_i); +CastInst* ptr_347 = new IntToPtrInst(int32_346, PointerTy_33, "", label_true_IF_NULL_i1_i_i3_i_i); + new StoreInst(ptr_343, ptr_347, false, label_true_IF_NULL_i1_i_i3_i_i); +LoadInst* ptr_349 = new LoadInst(ptr_342, "", false, label_true_IF_NULL_i1_i_i3_i_i); +ICmpInst* int1_350 = new ICmpInst(*label_true_IF_NULL_i1_i_i3_i_i, ICmpInst::ICMP_EQ, ptr_349, const_ptr_80, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i, label_false_IFNE_i7_i_i8_i_i, int1_350, label_true_IF_NULL_i1_i_i3_i_i); // Block GOTO or IF*1.i3.i.i5.i.i (label_GOTO_or_IF_1_i3_i_i5_i_i) -CastInst* ptr_348 = new BitCastInst(ptr_337, PointerTy_32, "", label_GOTO_or_IF_1_i3_i_i5_i_i); -CastInst* ptr__c_i2_i_i4_i_i = new IntToPtrInst(int32_326, PointerTy_26, ".c.i2.i.i4.i.i", label_GOTO_or_IF_1_i3_i_i5_i_i); - new StoreInst(ptr__c_i2_i_i4_i_i, ptr_348, false, label_GOTO_or_IF_1_i3_i_i5_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_true_IFNULL3_i8_i_i9_i_i, int1_333, label_GOTO_or_IF_1_i3_i_i5_i_i); +CastInst* ptr_352 = new BitCastInst(ptr_341, PointerTy_36, "", label_GOTO_or_IF_1_i3_i_i5_i_i); +CastInst* ptr__c_i2_i_i4_i_i = new IntToPtrInst(int32_330, PointerTy_30, ".c.i2.i.i4.i.i", label_GOTO_or_IF_1_i3_i_i5_i_i); + new StoreInst(ptr__c_i2_i_i4_i_i, ptr_352, false, label_GOTO_or_IF_1_i3_i_i5_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_true_IFNULL3_i8_i_i9_i_i, int1_337, label_GOTO_or_IF_1_i3_i_i5_i_i); // Block true IFNULL.i5.i.i6.i.i (label_true_IFNULL_i5_i_i6_i_i) -GetElementPtrInst* ptr_351 = GetElementPtrInst::Create(ptr_332, const_int32_61, "", label_true_IFNULL_i5_i_i6_i_i); -CastInst* ptr_352 = new BitCastInst(ptr_351, PointerTy_24, "", label_true_IFNULL_i5_i_i6_i_i); +GetElementPtrInst* ptr_355 = GetElementPtrInst::Create(ptr_336, const_int32_65, "", label_true_IFNULL_i5_i_i6_i_i); +CastInst* ptr_356 = new BitCastInst(ptr_355, PointerTy_28, "", label_true_IFNULL_i5_i_i6_i_i); BranchInst::Create(label_bb2_i_i34_i, label_true_IFNULL_i5_i_i6_i_i); // Block bb.i.i32.i (label_bb_i_i32_i) -Argument* fwdref_355 = new Argument(IntegerType::get(mod->getContext(), 1)); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_bb1_i_i33_i, fwdref_355, label_bb_i_i32_i); +Argument* fwdref_359 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_bb1_i_i33_i, fwdref_359, label_bb_i_i32_i); // Block bb1.i.i33.i (label_bb1_i_i33_i) -Argument* fwdref_357 = new Argument(IntegerType::get(mod->getContext(), 32)); -BinaryOperator* int32_356 = BinaryOperator::Create(Instruction::Add, fwdref_357, const_int32_50, "", label_bb1_i_i33_i); +Argument* fwdref_361 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_360 = BinaryOperator::Create(Instruction::Add, fwdref_361, const_int32_54, "", label_bb1_i_i33_i); BranchInst::Create(label_bb2_i_i34_i, label_bb1_i_i33_i); // Block bb2.i.i34.i (label_bb2_i_i34_i) -PHINode* int32_359 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i34_i); -int32_359->reserveOperandSpace(2); -int32_359->addIncoming(const_int32_55, label_true_IFNULL_i5_i_i6_i_i); -int32_359->addIncoming(int32_356, label_bb1_i_i33_i); - -ICmpInst* int1_360 = new ICmpInst(*label_bb2_i_i34_i, ICmpInst::ICMP_ULT, int32_359, const_int32_85, ""); -std::vector void_361_params; -void_361_params.push_back(const_int1_86); -void_361_params.push_back(const_int1_86); -void_361_params.push_back(const_int1_86); -void_361_params.push_back(const_int1_86); -void_361_params.push_back(const_int1_86); -CallInst* void_361 = CallInst::Create(func_llvm_memory_barrier, void_361_params.begin(), void_361_params.end(), "", label_bb2_i_i34_i); -void_361->setCallingConv(CallingConv::C); -void_361->setTailCall(false);AttrListPtr void_361_PAL; -void_361->setAttributes(void_361_PAL); - -std::vector int32_362_params; -int32_362_params.push_back(ptr_352); -int32_362_params.push_back(const_int32_55); -int32_362_params.push_back(const_int32_50); -CallInst* int32_362 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_362_params.begin(), int32_362_params.end(), "", label_bb2_i_i34_i); -int32_362->setCallingConv(CallingConv::C); -int32_362->setTailCall(false);AttrListPtr int32_362_PAL; -int32_362->setAttributes(int32_362_PAL); - -std::vector void_363_params; -void_363_params.push_back(const_int1_86); -void_363_params.push_back(const_int1_86); -void_363_params.push_back(const_int1_86); -void_363_params.push_back(const_int1_86); -void_363_params.push_back(const_int1_86); -CallInst* void_363 = CallInst::Create(func_llvm_memory_barrier, void_363_params.begin(), void_363_params.end(), "", label_bb2_i_i34_i); -void_363->setCallingConv(CallingConv::C); -void_363->setTailCall(false);AttrListPtr void_363_PAL; -void_363->setAttributes(void_363_PAL); +PHINode* int32_363 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i34_i); +int32_363->reserveOperandSpace(2); +int32_363->addIncoming(const_int32_59, label_true_IFNULL_i5_i_i6_i_i); +int32_363->addIncoming(int32_360, label_bb1_i_i33_i); + +ICmpInst* int1_364 = new ICmpInst(*label_bb2_i_i34_i, ICmpInst::ICMP_ULT, int32_363, const_int32_89, ""); +std::vector void_365_params; +void_365_params.push_back(const_int1_90); +void_365_params.push_back(const_int1_90); +void_365_params.push_back(const_int1_90); +void_365_params.push_back(const_int1_90); +void_365_params.push_back(const_int1_90); +CallInst* void_365 = CallInst::Create(func_llvm_memory_barrier, void_365_params.begin(), void_365_params.end(), "", label_bb2_i_i34_i); +void_365->setCallingConv(CallingConv::C); +void_365->setTailCall(false);AttrListPtr void_365_PAL; +void_365->setAttributes(void_365_PAL); + +std::vector int32_366_params; +int32_366_params.push_back(ptr_356); +int32_366_params.push_back(const_int32_59); +int32_366_params.push_back(const_int32_54); +CallInst* int32_366 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_366_params.begin(), int32_366_params.end(), "", label_bb2_i_i34_i); +int32_366->setCallingConv(CallingConv::C); +int32_366->setTailCall(false);AttrListPtr int32_366_PAL; +int32_366->setAttributes(int32_366_PAL); + +std::vector void_367_params; +void_367_params.push_back(const_int1_90); +void_367_params.push_back(const_int1_90); +void_367_params.push_back(const_int1_90); +void_367_params.push_back(const_int1_90); +void_367_params.push_back(const_int1_90); +CallInst* void_367 = CallInst::Create(func_llvm_memory_barrier, void_367_params.begin(), void_367_params.end(), "", label_bb2_i_i34_i); +void_367->setCallingConv(CallingConv::C); +void_367->setTailCall(false);AttrListPtr void_367_PAL; +void_367->setAttributes(void_367_PAL); -ICmpInst* int1_364 = new ICmpInst(*label_bb2_i_i34_i, ICmpInst::ICMP_EQ, int32_362, const_int32_55, ""); -BranchInst::Create(label_bb_i_i32_i, label_bb4_preheader_i_i35_i, int1_360, label_bb2_i_i34_i); +ICmpInst* int1_368 = new ICmpInst(*label_bb2_i_i34_i, ICmpInst::ICMP_EQ, int32_366, const_int32_59, ""); +BranchInst::Create(label_bb_i_i32_i, label_bb4_preheader_i_i35_i, int1_364, label_bb2_i_i34_i); // Block bb4.preheader.i.i35.i (label_bb4_preheader_i_i35_i) -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_bb3_i_i36_i, int1_364, label_bb4_preheader_i_i35_i); +BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_bb3_i_i36_i, int1_368, label_bb4_preheader_i_i35_i); // Block bb3.i.i36.i (label_bb3_i_i36_i) -CallInst* void_367 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i36_i); -void_367->setCallingConv(CallingConv::C); -void_367->setTailCall(false);AttrListPtr void_367_PAL; -void_367->setAttributes(void_367_PAL); +CallInst* void_371 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i36_i); +void_371->setCallingConv(CallingConv::C); +void_371->setTailCall(false);AttrListPtr void_371_PAL; +void_371->setAttributes(void_371_PAL); + +std::vector void_372_params; +void_372_params.push_back(const_int1_90); +void_372_params.push_back(const_int1_90); +void_372_params.push_back(const_int1_90); +void_372_params.push_back(const_int1_90); +void_372_params.push_back(const_int1_90); +CallInst* void_372 = CallInst::Create(func_llvm_memory_barrier, void_372_params.begin(), void_372_params.end(), "", label_bb3_i_i36_i); +void_372->setCallingConv(CallingConv::C); +void_372->setTailCall(false);AttrListPtr void_372_PAL; +void_372->setAttributes(void_372_PAL); + +std::vector int32_373_params; +int32_373_params.push_back(ptr_356); +int32_373_params.push_back(const_int32_59); +int32_373_params.push_back(const_int32_54); +CallInst* int32_373 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_373_params.begin(), int32_373_params.end(), "", label_bb3_i_i36_i); +int32_373->setCallingConv(CallingConv::C); +int32_373->setTailCall(false);AttrListPtr int32_373_PAL; +int32_373->setAttributes(int32_373_PAL); + +std::vector void_374_params; +void_374_params.push_back(const_int1_90); +void_374_params.push_back(const_int1_90); +void_374_params.push_back(const_int1_90); +void_374_params.push_back(const_int1_90); +void_374_params.push_back(const_int1_90); +CallInst* void_374 = CallInst::Create(func_llvm_memory_barrier, void_374_params.begin(), void_374_params.end(), "", label_bb3_i_i36_i); +void_374->setCallingConv(CallingConv::C); +void_374->setTailCall(false);AttrListPtr void_374_PAL; +void_374->setAttributes(void_374_PAL); -std::vector void_368_params; -void_368_params.push_back(const_int1_86); -void_368_params.push_back(const_int1_86); -void_368_params.push_back(const_int1_86); -void_368_params.push_back(const_int1_86); -void_368_params.push_back(const_int1_86); -CallInst* void_368 = CallInst::Create(func_llvm_memory_barrier, void_368_params.begin(), void_368_params.end(), "", label_bb3_i_i36_i); -void_368->setCallingConv(CallingConv::C); -void_368->setTailCall(false);AttrListPtr void_368_PAL; -void_368->setAttributes(void_368_PAL); - -std::vector int32_369_params; -int32_369_params.push_back(ptr_352); -int32_369_params.push_back(const_int32_55); -int32_369_params.push_back(const_int32_50); -CallInst* int32_369 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_369_params.begin(), int32_369_params.end(), "", label_bb3_i_i36_i); -int32_369->setCallingConv(CallingConv::C); -int32_369->setTailCall(false);AttrListPtr int32_369_PAL; -int32_369->setAttributes(int32_369_PAL); - -std::vector void_370_params; -void_370_params.push_back(const_int1_86); -void_370_params.push_back(const_int1_86); -void_370_params.push_back(const_int1_86); -void_370_params.push_back(const_int1_86); -void_370_params.push_back(const_int1_86); -CallInst* void_370 = CallInst::Create(func_llvm_memory_barrier, void_370_params.begin(), void_370_params.end(), "", label_bb3_i_i36_i); -void_370->setCallingConv(CallingConv::C); -void_370->setTailCall(false);AttrListPtr void_370_PAL; -void_370->setAttributes(void_370_PAL); - -ICmpInst* int1_371 = new ICmpInst(*label_bb3_i_i36_i, ICmpInst::ICMP_EQ, int32_369, const_int32_55, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_bb3_i_i36_i, int1_371, label_bb3_i_i36_i); +ICmpInst* int1_375 = new ICmpInst(*label_bb3_i_i36_i, ICmpInst::ICMP_EQ, int32_373, const_int32_59, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i, label_bb3_i_i36_i, int1_375, label_bb3_i_i36_i); // Block false IFNE.i7.i.i8.i.i (label_false_IFNE_i7_i_i8_i_i) -std::vector ptr_373_indices; -ptr_373_indices.push_back(const_int32_55); -ptr_373_indices.push_back(const_int32_55); -Instruction* ptr_373 = GetElementPtrInst::Create(ptr_345, ptr_373_indices.begin(), ptr_373_indices.end(), "", label_false_IFNE_i7_i_i8_i_i); -CastInst* ptr__c1_i6_i_i7_i_i = new IntToPtrInst(int32_326, PointerTy_26, ".c1.i6.i.i7.i.i", label_false_IFNE_i7_i_i8_i_i); - new StoreInst(ptr__c1_i6_i_i7_i_i, ptr_373, false, label_false_IFNE_i7_i_i8_i_i); +std::vector ptr_377_indices; +ptr_377_indices.push_back(const_int32_59); +ptr_377_indices.push_back(const_int32_59); +Instruction* ptr_377 = GetElementPtrInst::Create(ptr_349, ptr_377_indices.begin(), ptr_377_indices.end(), "", label_false_IFNE_i7_i_i8_i_i); +CastInst* ptr__c1_i6_i_i7_i_i = new IntToPtrInst(int32_330, PointerTy_30, ".c1.i6.i.i7.i.i", label_false_IFNE_i7_i_i8_i_i); + new StoreInst(ptr__c1_i6_i_i7_i_i, ptr_377, false, label_false_IFNE_i7_i_i8_i_i); BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i, label_false_IFNE_i7_i_i8_i_i); // Block true IFNULL3.i8.i.i9.i.i (label_true_IFNULL3_i8_i_i9_i_i) -GetElementPtrInst* ptr_376 = GetElementPtrInst::Create(ptr_332, const_int32_61, "", label_true_IFNULL3_i8_i_i9_i_i); -CastInst* ptr_377 = new BitCastInst(ptr_376, PointerTy_24, "", label_true_IFNULL3_i8_i_i9_i_i); - new StoreInst(const_int32_55, ptr_377, false, label_true_IFNULL3_i8_i_i9_i_i); +GetElementPtrInst* ptr_380 = GetElementPtrInst::Create(ptr_336, const_int32_65, "", label_true_IFNULL3_i8_i_i9_i_i); +CastInst* ptr_381 = new BitCastInst(ptr_380, PointerTy_28, "", label_true_IFNULL3_i8_i_i9_i_i); + new StoreInst(const_int32_59, ptr_381, false, label_true_IFNULL3_i8_i_i9_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_true_IFNULL3_i8_i_i9_i_i); // Block tableswitch4.i.i (label_tableswitch4_i_i) -LoadInst* ptr_380 = new LoadInst(const_ptr_87, "", false, label_tableswitch4_i_i); -CastInst* int32_381 = new PtrToIntInst(ptr_380, IntegerType::get(mod->getContext(), 32), "", label_tableswitch4_i_i); -GetElementPtrInst* ptr_382 = GetElementPtrInst::Create(ptr_287, const_int32_50, "", label_tableswitch4_i_i); -CastInst* ptr_383 = new BitCastInst(ptr_382, PointerTy_0, "", label_tableswitch4_i_i); -LoadInst* int8_384 = new LoadInst(ptr_383, "", false, label_tableswitch4_i_i); -BinaryOperator* int8_385 = BinaryOperator::Create(Instruction::And, int8_384, const_int8_78, "", label_tableswitch4_i_i); -CastInst* int8_386 = new TruncInst(int32_381, IntegerType::get(mod->getContext(), 8), "", label_tableswitch4_i_i); -BinaryOperator* int8_387 = BinaryOperator::Create(Instruction::Or, int8_385, int8_386, "", label_tableswitch4_i_i); - new StoreInst(int8_387, ptr_383, false, label_tableswitch4_i_i); +LoadInst* ptr_384 = new LoadInst(const_ptr_91, "", false, label_tableswitch4_i_i); +CastInst* int32_385 = new PtrToIntInst(ptr_384, IntegerType::get(mod->getContext(), 32), "", label_tableswitch4_i_i); +GetElementPtrInst* ptr_386 = GetElementPtrInst::Create(ptr_291, const_int32_54, "", label_tableswitch4_i_i); +CastInst* ptr_387 = new BitCastInst(ptr_386, PointerTy_0, "", label_tableswitch4_i_i); +LoadInst* int8_388 = new LoadInst(ptr_387, "", false, label_tableswitch4_i_i); +BinaryOperator* int8_389 = BinaryOperator::Create(Instruction::And, int8_388, const_int8_82, "", label_tableswitch4_i_i); +CastInst* int8_390 = new TruncInst(int32_385, IntegerType::get(mod->getContext(), 8), "", label_tableswitch4_i_i); +BinaryOperator* int8_391 = BinaryOperator::Create(Instruction::Or, int8_389, int8_390, "", label_tableswitch4_i_i); + new StoreInst(int8_391, ptr_387, false, label_tableswitch4_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_tableswitch4_i_i); // Block tableswitch5.i.i (label_tableswitch5_i_i) -LoadInst* ptr_390 = new LoadInst(const_ptr_88, "", false, label_tableswitch5_i_i); -CastInst* int32_391 = new PtrToIntInst(ptr_390, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i); -BinaryOperator* int32_392 = BinaryOperator::Create(Instruction::Or, int32_391, const_int32_57, "", label_tableswitch5_i_i); -GetElementPtrInst* ptr_393 = GetElementPtrInst::Create(ptr_287, const_int32_50, "", label_tableswitch5_i_i); -CastInst* ptr_394 = new BitCastInst(ptr_393, PointerTy_0, "", label_tableswitch5_i_i); -LoadInst* int8_395 = new LoadInst(ptr_394, "", false, label_tableswitch5_i_i); -BinaryOperator* int8_396 = BinaryOperator::Create(Instruction::And, int8_395, const_int8_78, "", label_tableswitch5_i_i); -CastInst* int8_397 = new TruncInst(int32_392, IntegerType::get(mod->getContext(), 8), "", label_tableswitch5_i_i); -BinaryOperator* int8_398 = BinaryOperator::Create(Instruction::Or, int8_397, int8_396, "", label_tableswitch5_i_i); - new StoreInst(int8_398, ptr_394, false, label_tableswitch5_i_i); -LoadInst* ptr_400 = new LoadInst(const_ptr_89, "", false, label_tableswitch5_i_i); -CastInst* int32_401 = new PtrToIntInst(ptr_287, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i); -BinaryOperator* int32_402 = BinaryOperator::Create(Instruction::And, int32_401, const_int32_82, "", label_tableswitch5_i_i); -CastInst* ptr_403 = new IntToPtrInst(int32_402, PointerTy_25, "", label_tableswitch5_i_i); -std::vector ptr_404_indices; -ptr_404_indices.push_back(const_int32_57); -ptr_404_indices.push_back(const_int32_50); -Instruction* ptr_404 = GetElementPtrInst::Create(ptr_400, ptr_404_indices.begin(), ptr_404_indices.end(), "", label_tableswitch5_i_i); -LoadInst* ptr_405 = new LoadInst(ptr_404, "", false, label_tableswitch5_i_i); -GetElementPtrInst* ptr_406 = GetElementPtrInst::Create(ptr_405, const_int32_70, "", label_tableswitch5_i_i); -CastInst* ptr_407 = new BitCastInst(ptr_406, PointerTy_7, "", label_tableswitch5_i_i); -LoadInst* ptr_408 = new LoadInst(ptr_407, "", false, label_tableswitch5_i_i); -ICmpInst* int1_409 = new ICmpInst(*label_tableswitch5_i_i, ICmpInst::ICMP_EQ, ptr_408, const_ptr_52, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i, label_true_IFNULL_i5_i_i_i_i, int1_409, label_tableswitch5_i_i); +LoadInst* ptr_394 = new LoadInst(const_ptr_92, "", false, label_tableswitch5_i_i); +CastInst* int32_395 = new PtrToIntInst(ptr_394, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i); +BinaryOperator* int32_396 = BinaryOperator::Create(Instruction::Or, int32_395, const_int32_61, "", label_tableswitch5_i_i); +GetElementPtrInst* ptr_397 = GetElementPtrInst::Create(ptr_291, const_int32_54, "", label_tableswitch5_i_i); +CastInst* ptr_398 = new BitCastInst(ptr_397, PointerTy_0, "", label_tableswitch5_i_i); +LoadInst* int8_399 = new LoadInst(ptr_398, "", false, label_tableswitch5_i_i); +BinaryOperator* int8_400 = BinaryOperator::Create(Instruction::And, int8_399, const_int8_82, "", label_tableswitch5_i_i); +CastInst* int8_401 = new TruncInst(int32_396, IntegerType::get(mod->getContext(), 8), "", label_tableswitch5_i_i); +BinaryOperator* int8_402 = BinaryOperator::Create(Instruction::Or, int8_401, int8_400, "", label_tableswitch5_i_i); + new StoreInst(int8_402, ptr_398, false, label_tableswitch5_i_i); +LoadInst* ptr_404 = new LoadInst(const_ptr_93, "", false, label_tableswitch5_i_i); +CastInst* int32_405 = new PtrToIntInst(ptr_291, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i); +BinaryOperator* int32_406 = BinaryOperator::Create(Instruction::And, int32_405, const_int32_86, "", label_tableswitch5_i_i); +CastInst* ptr_407 = new IntToPtrInst(int32_406, PointerTy_29, "", label_tableswitch5_i_i); +std::vector ptr_408_indices; +ptr_408_indices.push_back(const_int32_61); +ptr_408_indices.push_back(const_int32_54); +Instruction* ptr_408 = GetElementPtrInst::Create(ptr_404, ptr_408_indices.begin(), ptr_408_indices.end(), "", label_tableswitch5_i_i); +LoadInst* ptr_409 = new LoadInst(ptr_408, "", false, label_tableswitch5_i_i); +GetElementPtrInst* ptr_410 = GetElementPtrInst::Create(ptr_409, const_int32_74, "", label_tableswitch5_i_i); +CastInst* ptr_411 = new BitCastInst(ptr_410, PointerTy_7, "", label_tableswitch5_i_i); +LoadInst* ptr_412 = new LoadInst(ptr_411, "", false, label_tableswitch5_i_i); +ICmpInst* int1_413 = new ICmpInst(*label_tableswitch5_i_i, ICmpInst::ICMP_EQ, ptr_412, const_ptr_56, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i, label_true_IFNULL_i5_i_i_i_i, int1_413, label_tableswitch5_i_i); // Block true IF*NULL.i1.i.i.i.i (label_true_IF_NULL_i1_i_i_i_i) -std::vector ptr_411_indices; -ptr_411_indices.push_back(const_int32_55); -ptr_411_indices.push_back(const_int32_55); -Instruction* ptr_411 = GetElementPtrInst::Create(ptr_403, ptr_411_indices.begin(), ptr_411_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i); - new StoreInst(const_ptr_83, ptr_411, false, label_true_IF_NULL_i1_i_i_i_i); -GetElementPtrInst* ptr_413 = GetElementPtrInst::Create(ptr_405, const_int32_61, "", label_true_IF_NULL_i1_i_i_i_i); -CastInst* ptr_414 = new BitCastInst(ptr_413, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i); -LoadInst* ptr_415 = new LoadInst(ptr_414, "", false, label_true_IF_NULL_i1_i_i_i_i); -LoadInst* ptr_416 = new LoadInst(const_ptr_84, "", false, label_true_IF_NULL_i1_i_i_i_i); -CastInst* int32_417 = new PtrToIntInst(ptr_416, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i); -BinaryOperator* int32_418 = BinaryOperator::Create(Instruction::Add, int32_417, int32_402, "", label_true_IF_NULL_i1_i_i_i_i); -CastInst* ptr_419 = new IntToPtrInst(int32_418, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i); - new StoreInst(ptr_415, ptr_419, false, label_true_IF_NULL_i1_i_i_i_i); -LoadInst* ptr_421 = new LoadInst(ptr_414, "", false, label_true_IF_NULL_i1_i_i_i_i); -ICmpInst* int1_422 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i, ICmpInst::ICMP_EQ, ptr_421, const_ptr_76, ""); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i, label_false_IFNE_i7_i_i_i_i, int1_422, label_true_IF_NULL_i1_i_i_i_i); +std::vector ptr_415_indices; +ptr_415_indices.push_back(const_int32_59); +ptr_415_indices.push_back(const_int32_59); +Instruction* ptr_415 = GetElementPtrInst::Create(ptr_407, ptr_415_indices.begin(), ptr_415_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i); + new StoreInst(const_ptr_87, ptr_415, false, label_true_IF_NULL_i1_i_i_i_i); +GetElementPtrInst* ptr_417 = GetElementPtrInst::Create(ptr_409, const_int32_65, "", label_true_IF_NULL_i1_i_i_i_i); +CastInst* ptr_418 = new BitCastInst(ptr_417, PointerTy_33, "", label_true_IF_NULL_i1_i_i_i_i); +LoadInst* ptr_419 = new LoadInst(ptr_418, "", false, label_true_IF_NULL_i1_i_i_i_i); +LoadInst* ptr_420 = new LoadInst(const_ptr_88, "", false, label_true_IF_NULL_i1_i_i_i_i); +CastInst* int32_421 = new PtrToIntInst(ptr_420, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i); +BinaryOperator* int32_422 = BinaryOperator::Create(Instruction::Add, int32_421, int32_406, "", label_true_IF_NULL_i1_i_i_i_i); +CastInst* ptr_423 = new IntToPtrInst(int32_422, PointerTy_33, "", label_true_IF_NULL_i1_i_i_i_i); + new StoreInst(ptr_419, ptr_423, false, label_true_IF_NULL_i1_i_i_i_i); +LoadInst* ptr_425 = new LoadInst(ptr_418, "", false, label_true_IF_NULL_i1_i_i_i_i); +ICmpInst* int1_426 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i, ICmpInst::ICMP_EQ, ptr_425, const_ptr_80, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i, label_false_IFNE_i7_i_i_i_i, int1_426, label_true_IF_NULL_i1_i_i_i_i); // Block GOTO or IF*1.i3.i.i.i.i (label_GOTO_or_IF_1_i3_i_i_i_i) -CastInst* ptr_424 = new BitCastInst(ptr_413, PointerTy_32, "", label_GOTO_or_IF_1_i3_i_i_i_i); -CastInst* ptr__c_i2_i_i_i_i = new IntToPtrInst(int32_402, PointerTy_26, ".c.i2.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i); - new StoreInst(ptr__c_i2_i_i_i_i, ptr_424, false, label_GOTO_or_IF_1_i3_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_true_IFNULL3_i8_i_i_i_i, int1_409, label_GOTO_or_IF_1_i3_i_i_i_i); +CastInst* ptr_428 = new BitCastInst(ptr_417, PointerTy_36, "", label_GOTO_or_IF_1_i3_i_i_i_i); +CastInst* ptr__c_i2_i_i_i_i = new IntToPtrInst(int32_406, PointerTy_30, ".c.i2.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i); + new StoreInst(ptr__c_i2_i_i_i_i, ptr_428, false, label_GOTO_or_IF_1_i3_i_i_i_i); +BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_true_IFNULL3_i8_i_i_i_i, int1_413, label_GOTO_or_IF_1_i3_i_i_i_i); // Block true IFNULL.i5.i.i.i.i (label_true_IFNULL_i5_i_i_i_i) -GetElementPtrInst* ptr_427 = GetElementPtrInst::Create(ptr_408, const_int32_61, "", label_true_IFNULL_i5_i_i_i_i); -CastInst* ptr_428 = new BitCastInst(ptr_427, PointerTy_24, "", label_true_IFNULL_i5_i_i_i_i); +GetElementPtrInst* ptr_431 = GetElementPtrInst::Create(ptr_412, const_int32_65, "", label_true_IFNULL_i5_i_i_i_i); +CastInst* ptr_432 = new BitCastInst(ptr_431, PointerTy_28, "", label_true_IFNULL_i5_i_i_i_i); BranchInst::Create(label_bb2_i_i_i, label_true_IFNULL_i5_i_i_i_i); // Block bb.i.i.i (label_bb_i_i_i) -Argument* fwdref_431 = new Argument(IntegerType::get(mod->getContext(), 1)); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i, label_bb1_i_i_i, fwdref_431, label_bb_i_i_i); +Argument* fwdref_435 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i, label_bb1_i_i_i, fwdref_435, label_bb_i_i_i); // Block bb1.i.i.i (label_bb1_i_i_i) -Argument* fwdref_433 = new Argument(IntegerType::get(mod->getContext(), 32)); -BinaryOperator* int32_432 = BinaryOperator::Create(Instruction::Add, fwdref_433, const_int32_50, "", label_bb1_i_i_i); +Argument* fwdref_437 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_436 = BinaryOperator::Create(Instruction::Add, fwdref_437, const_int32_54, "", 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_435 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); -int32_435->reserveOperandSpace(2); -int32_435->addIncoming(const_int32_55, label_true_IFNULL_i5_i_i_i_i); -int32_435->addIncoming(int32_432, label_bb1_i_i_i); - -ICmpInst* int1_436 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_435, const_int32_85, ""); -std::vector void_437_params; -void_437_params.push_back(const_int1_86); -void_437_params.push_back(const_int1_86); -void_437_params.push_back(const_int1_86); -void_437_params.push_back(const_int1_86); -void_437_params.push_back(const_int1_86); -CallInst* void_437 = CallInst::Create(func_llvm_memory_barrier, void_437_params.begin(), void_437_params.end(), "", label_bb2_i_i_i); -void_437->setCallingConv(CallingConv::C); -void_437->setTailCall(false);AttrListPtr void_437_PAL; -void_437->setAttributes(void_437_PAL); - -std::vector int32_438_params; -int32_438_params.push_back(ptr_428); -int32_438_params.push_back(const_int32_55); -int32_438_params.push_back(const_int32_50); -CallInst* int32_438 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_438_params.begin(), int32_438_params.end(), "", label_bb2_i_i_i); -int32_438->setCallingConv(CallingConv::C); -int32_438->setTailCall(false);AttrListPtr int32_438_PAL; -int32_438->setAttributes(int32_438_PAL); - -std::vector void_439_params; -void_439_params.push_back(const_int1_86); -void_439_params.push_back(const_int1_86); -void_439_params.push_back(const_int1_86); -void_439_params.push_back(const_int1_86); -void_439_params.push_back(const_int1_86); -CallInst* void_439 = CallInst::Create(func_llvm_memory_barrier, void_439_params.begin(), void_439_params.end(), "", label_bb2_i_i_i); -void_439->setCallingConv(CallingConv::C); -void_439->setTailCall(false);AttrListPtr void_439_PAL; -void_439->setAttributes(void_439_PAL); +PHINode* int32_439 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); +int32_439->reserveOperandSpace(2); +int32_439->addIncoming(const_int32_59, label_true_IFNULL_i5_i_i_i_i); +int32_439->addIncoming(int32_436, label_bb1_i_i_i); + +ICmpInst* int1_440 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_439, const_int32_89, ""); +std::vector void_441_params; +void_441_params.push_back(const_int1_90); +void_441_params.push_back(const_int1_90); +void_441_params.push_back(const_int1_90); +void_441_params.push_back(const_int1_90); +void_441_params.push_back(const_int1_90); +CallInst* void_441 = CallInst::Create(func_llvm_memory_barrier, void_441_params.begin(), void_441_params.end(), "", label_bb2_i_i_i); +void_441->setCallingConv(CallingConv::C); +void_441->setTailCall(false);AttrListPtr void_441_PAL; +void_441->setAttributes(void_441_PAL); + +std::vector int32_442_params; +int32_442_params.push_back(ptr_432); +int32_442_params.push_back(const_int32_59); +int32_442_params.push_back(const_int32_54); +CallInst* int32_442 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_442_params.begin(), int32_442_params.end(), "", label_bb2_i_i_i); +int32_442->setCallingConv(CallingConv::C); +int32_442->setTailCall(false);AttrListPtr int32_442_PAL; +int32_442->setAttributes(int32_442_PAL); + +std::vector void_443_params; +void_443_params.push_back(const_int1_90); +void_443_params.push_back(const_int1_90); +void_443_params.push_back(const_int1_90); +void_443_params.push_back(const_int1_90); +void_443_params.push_back(const_int1_90); +CallInst* void_443 = CallInst::Create(func_llvm_memory_barrier, void_443_params.begin(), void_443_params.end(), "", label_bb2_i_i_i); +void_443->setCallingConv(CallingConv::C); +void_443->setTailCall(false);AttrListPtr void_443_PAL; +void_443->setAttributes(void_443_PAL); -ICmpInst* int1_440 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_438, const_int32_55, ""); -BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_436, label_bb2_i_i_i); +ICmpInst* int1_444 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_442, const_int32_59, ""); +BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_440, 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_i_i_i, label_bb3_i_i_i, int1_440, label_bb4_preheader_i_i_i); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i, label_bb3_i_i_i, int1_444, label_bb4_preheader_i_i_i); // Block bb3.i.i.i (label_bb3_i_i_i) -CallInst* void_443 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); -void_443->setCallingConv(CallingConv::C); -void_443->setTailCall(false);AttrListPtr void_443_PAL; -void_443->setAttributes(void_443_PAL); - -std::vector void_444_params; -void_444_params.push_back(const_int1_86); -void_444_params.push_back(const_int1_86); -void_444_params.push_back(const_int1_86); -void_444_params.push_back(const_int1_86); -void_444_params.push_back(const_int1_86); -CallInst* void_444 = CallInst::Create(func_llvm_memory_barrier, void_444_params.begin(), void_444_params.end(), "", label_bb3_i_i_i); -void_444->setCallingConv(CallingConv::C); -void_444->setTailCall(false);AttrListPtr void_444_PAL; -void_444->setAttributes(void_444_PAL); - -std::vector int32_445_params; -int32_445_params.push_back(ptr_428); -int32_445_params.push_back(const_int32_55); -int32_445_params.push_back(const_int32_50); -CallInst* int32_445 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_445_params.begin(), int32_445_params.end(), "", label_bb3_i_i_i); -int32_445->setCallingConv(CallingConv::C); -int32_445->setTailCall(false);AttrListPtr int32_445_PAL; -int32_445->setAttributes(int32_445_PAL); - -std::vector void_446_params; -void_446_params.push_back(const_int1_86); -void_446_params.push_back(const_int1_86); -void_446_params.push_back(const_int1_86); -void_446_params.push_back(const_int1_86); -void_446_params.push_back(const_int1_86); -CallInst* void_446 = CallInst::Create(func_llvm_memory_barrier, void_446_params.begin(), void_446_params.end(), "", label_bb3_i_i_i); -void_446->setCallingConv(CallingConv::C); -void_446->setTailCall(false);AttrListPtr void_446_PAL; -void_446->setAttributes(void_446_PAL); +CallInst* void_447 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); +void_447->setCallingConv(CallingConv::C); +void_447->setTailCall(false);AttrListPtr void_447_PAL; +void_447->setAttributes(void_447_PAL); + +std::vector void_448_params; +void_448_params.push_back(const_int1_90); +void_448_params.push_back(const_int1_90); +void_448_params.push_back(const_int1_90); +void_448_params.push_back(const_int1_90); +void_448_params.push_back(const_int1_90); +CallInst* void_448 = CallInst::Create(func_llvm_memory_barrier, void_448_params.begin(), void_448_params.end(), "", label_bb3_i_i_i); +void_448->setCallingConv(CallingConv::C); +void_448->setTailCall(false);AttrListPtr void_448_PAL; +void_448->setAttributes(void_448_PAL); + +std::vector int32_449_params; +int32_449_params.push_back(ptr_432); +int32_449_params.push_back(const_int32_59); +int32_449_params.push_back(const_int32_54); +CallInst* int32_449 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_449_params.begin(), int32_449_params.end(), "", label_bb3_i_i_i); +int32_449->setCallingConv(CallingConv::C); +int32_449->setTailCall(false);AttrListPtr int32_449_PAL; +int32_449->setAttributes(int32_449_PAL); + +std::vector void_450_params; +void_450_params.push_back(const_int1_90); +void_450_params.push_back(const_int1_90); +void_450_params.push_back(const_int1_90); +void_450_params.push_back(const_int1_90); +void_450_params.push_back(const_int1_90); +CallInst* void_450 = CallInst::Create(func_llvm_memory_barrier, void_450_params.begin(), void_450_params.end(), "", label_bb3_i_i_i); +void_450->setCallingConv(CallingConv::C); +void_450->setTailCall(false);AttrListPtr void_450_PAL; +void_450->setAttributes(void_450_PAL); -ICmpInst* int1_447 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_445, const_int32_55, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i, label_bb3_i_i_i, int1_447, label_bb3_i_i_i); +ICmpInst* int1_451 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_449, const_int32_59, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i, label_bb3_i_i_i, int1_451, label_bb3_i_i_i); // Block false IFNE.i7.i.i.i.i (label_false_IFNE_i7_i_i_i_i) -std::vector ptr_449_indices; -ptr_449_indices.push_back(const_int32_55); -ptr_449_indices.push_back(const_int32_55); -Instruction* ptr_449 = GetElementPtrInst::Create(ptr_421, ptr_449_indices.begin(), ptr_449_indices.end(), "", label_false_IFNE_i7_i_i_i_i); -CastInst* ptr__c1_i6_i_i_i_i = new IntToPtrInst(int32_402, PointerTy_26, ".c1.i6.i.i.i.i", label_false_IFNE_i7_i_i_i_i); - new StoreInst(ptr__c1_i6_i_i_i_i, ptr_449, false, label_false_IFNE_i7_i_i_i_i); +std::vector ptr_453_indices; +ptr_453_indices.push_back(const_int32_59); +ptr_453_indices.push_back(const_int32_59); +Instruction* ptr_453 = GetElementPtrInst::Create(ptr_425, ptr_453_indices.begin(), ptr_453_indices.end(), "", label_false_IFNE_i7_i_i_i_i); +CastInst* ptr__c1_i6_i_i_i_i = new IntToPtrInst(int32_406, PointerTy_30, ".c1.i6.i.i.i.i", label_false_IFNE_i7_i_i_i_i); + new StoreInst(ptr__c1_i6_i_i_i_i, ptr_453, false, label_false_IFNE_i7_i_i_i_i); BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i, label_false_IFNE_i7_i_i_i_i); // Block true IFNULL3.i8.i.i.i.i (label_true_IFNULL3_i8_i_i_i_i) -GetElementPtrInst* ptr_452 = GetElementPtrInst::Create(ptr_408, const_int32_61, "", label_true_IFNULL3_i8_i_i_i_i); -CastInst* ptr_453 = new BitCastInst(ptr_452, PointerTy_24, "", label_true_IFNULL3_i8_i_i_i_i); - new StoreInst(const_int32_55, ptr_453, false, label_true_IFNULL3_i8_i_i_i_i); +GetElementPtrInst* ptr_456 = GetElementPtrInst::Create(ptr_412, const_int32_65, "", label_true_IFNULL3_i8_i_i_i_i); +CastInst* ptr_457 = new BitCastInst(ptr_456, PointerTy_28, "", label_true_IFNULL3_i8_i_i_i_i); + new StoreInst(const_int32_59, ptr_457, false, label_true_IFNULL3_i8_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_true_IFNULL3_i8_i_i_i_i); // Block false IFNE.i (label_false_IFNE_i) -LoadInst* ptr_456 = new LoadInst(const_ptr_90, "", false, label_false_IFNE_i); -CastInst* int32_457 = new PtrToIntInst(ptr_456, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i); -GetElementPtrInst* ptr_458 = GetElementPtrInst::Create(ptr_287, const_int32_50, "", label_false_IFNE_i); -CastInst* ptr_459 = new BitCastInst(ptr_458, PointerTy_0, "", label_false_IFNE_i); -LoadInst* int8_460 = new LoadInst(ptr_459, "", false, label_false_IFNE_i); -BinaryOperator* int8_461 = BinaryOperator::Create(Instruction::And, int8_460, const_int8_78, "", label_false_IFNE_i); -CastInst* int8_462 = new TruncInst(int32_457, IntegerType::get(mod->getContext(), 8), "", label_false_IFNE_i); -BinaryOperator* int8_463 = BinaryOperator::Create(Instruction::Or, int8_461, int8_462, "", label_false_IFNE_i); - new StoreInst(int8_463, ptr_459, false, label_false_IFNE_i); +LoadInst* ptr_460 = new LoadInst(const_ptr_94, "", false, label_false_IFNE_i); +CastInst* int32_461 = new PtrToIntInst(ptr_460, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i); +GetElementPtrInst* ptr_462 = GetElementPtrInst::Create(ptr_291, const_int32_54, "", label_false_IFNE_i); +CastInst* ptr_463 = new BitCastInst(ptr_462, PointerTy_0, "", label_false_IFNE_i); +LoadInst* int8_464 = new LoadInst(ptr_463, "", false, label_false_IFNE_i); +BinaryOperator* int8_465 = BinaryOperator::Create(Instruction::And, int8_464, const_int8_82, "", label_false_IFNE_i); +CastInst* int8_466 = new TruncInst(int32_461, IntegerType::get(mod->getContext(), 8), "", label_false_IFNE_i); +BinaryOperator* int8_467 = BinaryOperator::Create(Instruction::Or, int8_465, int8_466, "", label_false_IFNE_i); + new StoreInst(int8_467, ptr_463, false, label_false_IFNE_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit, label_false_IFNE_i); // Block JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II.exit (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit) -LoadInst* ptr_466 = new LoadInst(ptr_res, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit); -CastInst* ptr_467 = new BitCastInst(ptr_466, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit); -ReturnInst::Create(mod->getContext(), ptr_467, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit); +LoadInst* ptr_470 = new LoadInst(ptr_res, "", false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit); +CastInst* ptr_471 = new BitCastInst(ptr_470, PointerTy_0, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit); +ReturnInst::Create(mod->getContext(), ptr_471, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II_exit); // Resolve Forward References -fwdref_355->replaceAllUsesWith(int1_364); delete fwdref_355; -fwdref_433->replaceAllUsesWith(int32_435); delete fwdref_433; -fwdref_357->replaceAllUsesWith(int32_359); delete fwdref_357; -fwdref_431->replaceAllUsesWith(int1_440); delete fwdref_431; +fwdref_361->replaceAllUsesWith(int32_363); delete fwdref_361; +fwdref_359->replaceAllUsesWith(int1_368); delete fwdref_359; +fwdref_437->replaceAllUsesWith(int32_439); delete fwdref_437; +fwdref_435->replaceAllUsesWith(int1_444); delete fwdref_435; return func_gcmalloc; } Modified: vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h Tue Apr 13 11:24:13 2010 @@ -16,6 +16,8 @@ namespace mvm { class MutatorThread : public mvm::Thread { +public: + MutatorThread() : mvm::Thread() {} }; } Modified: vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h Tue Apr 13 11:24:13 2010 @@ -18,6 +18,7 @@ class MutatorThread : public mvm::Thread { public: + MutatorThread() : mvm::Thread() {} mvm::BumpPtrAllocator Allocator; uintptr_t MutatorContext; Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Tue Apr 13 11:24:13 2010 @@ -25,7 +25,8 @@ } extern "C" void Java_org_j3_mmtk_ObjectModel_writeAvailableBitsWord__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Word_2 (JavaObject* OM, JavaObject* obj, uintptr_t val) { - assert((val & ~mvm::GCMask) == (((uintptr_t*)obj)[1] & ~mvm::GCMask) && "GC bits do not fit"); + // Comment the assert, it prevents MMTkInline.inc to be self-contained. + // assert((val & ~mvm::GCMask) == (((uintptr_t*)obj)[1] & ~mvm::GCMask) && "GC bits do not fit"); #if defined(__PPC__) ((uint8_t*)obj)[7] &= ~mvm::GCBitMask; ((uint8_t*)obj)[7] |= val; Modified: vmkit/trunk/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/vmjc.cpp (original) +++ vmkit/trunk/tools/vmjc/vmjc.cpp Tue Apr 13 11:24:13 2010 @@ -108,154 +108,146 @@ int main(int argc, char **argv) { llvm_shutdown_obj X; // Call llvm_shutdown() on exit. - try { - cl::ParseCommandLineOptions(argc, argv, "vmkit .class -> .ll compiler\n"); - sys::PrintStackTraceOnErrorSignal(); + cl::ParseCommandLineOptions(argc, argv, "vmkit .class -> .ll compiler\n"); + sys::PrintStackTraceOnErrorSignal(); - std::string ErrorMessage; + std::string ErrorMessage; - if (InputFilename == "-") { - cl::PrintHelpMessage(); - return 0; - } + if (InputFilename == "-") { + cl::PrintHelpMessage(); + return 0; + } - // Disable cross-compiling for now. - if (false) { - Module* TheModule = new Module("bootstrap module", - *(new llvm::LLVMContext())); - if (!TargetTriple.empty()) - TheModule->setTargetTriple(TargetTriple); - else - TheModule->setTargetTriple(mvm::MvmModule::getHostTriple()); + // Disable cross-compiling for now. + if (false) { + Module* TheModule = new Module("bootstrap module", + *(new llvm::LLVMContext())); + if (!TargetTriple.empty()) + TheModule->setTargetTriple(TargetTriple); + else + TheModule->setTargetTriple(mvm::MvmModule::getHostTriple()); #if 0 - // explicitly specified an architecture to compile for. - const Target *TheTarget = 0; - if (!MArch.empty()) { - for (TargetRegistry::iterator it = TargetRegistry::begin(), - ie = TargetRegistry::end(); it != ie; ++it) { - if (MArch == it->getName()) { - TheTarget = &*it; - break; - } + // explicitly specified an architecture to compile for. + const Target *TheTarget = 0; + if (!MArch.empty()) { + for (TargetRegistry::iterator it = TargetRegistry::begin(), + ie = TargetRegistry::end(); it != ie; ++it) { + if (MArch == it->getName()) { + TheTarget = &*it; + break; } + } - if (!TheTarget) { - errs() << argv[0] << ": error: invalid target '" << MArch << "'.\n"; - return 1; - } - } else { - std::string Err; - TheTarget = - TargetRegistry::getClosestStaticTargetForModule(*TheModule, Err); - if (TheTarget == 0) { - errs() << argv[0] << ": error auto-selecting target for module '" - << Err << "'. Please use the -march option to explicitly " - << "pick a target.\n"; - return 1; - } + if (!TheTarget) { + errs() << argv[0] << ": error: invalid target '" << MArch << "'.\n"; + return 1; } + } else { + std::string Err; + TheTarget = + TargetRegistry::getClosestStaticTargetForModule(*TheModule, Err); + if (TheTarget == 0) { + errs() << argv[0] << ": error auto-selecting target for module '" + << Err << "'. Please use the -march option to explicitly " + << "pick a target.\n"; + return 1; + } + } - std::string FeaturesStr; - std::auto_ptr - target(TheTarget->createTargetMachine(*TheModule, FeaturesStr)); - assert(target.get() && "Could not allocate target machine!"); - TargetMachine &Target = *target.get(); - - // Install information about target datalayout stuff into the module for - // optimizer use. - TheModule->setDataLayout(Target.getTargetData()-> - getStringRepresentation()); + std::string FeaturesStr; + std::auto_ptr + target(TheTarget->createTargetMachine(*TheModule, FeaturesStr)); + assert(target.get() && "Could not allocate target machine!"); + TargetMachine &Target = *target.get(); + + // Install information about target datalayout stuff into the module for + // optimizer use. + TheModule->setDataLayout(Target.getTargetData()-> + getStringRepresentation()); - mvm::MvmModule::initialise(CodeGenOpt::Default, TheModule, &Target); + mvm::MvmModule::initialise(CodeGenOpt::Default, TheModule, &Target); #endif - } else { - mvm::MvmModule::initialise(); - } + } else { + mvm::MvmModule::initialise(); + } - JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT"); + JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT"); - mvm::Collector::initialise(); + mvm::Collector::initialise(); - JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp, false); + JnjvmClassLoader* JCL = mvm::VirtualMachine::initialiseJVM(Comp, false); - if (DisableExceptions) Comp->disableExceptions(); - if (DisableStubs) Comp->generateStubs = false; - if (AssumeCompiled) Comp->assumeCompiled = true; - if (DisableCooperativeGC) Comp->disableCooperativeGC(); + 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); + mvm::BumpPtrAllocator A; + Jnjvm* vm = new(A, "Bootstrap loader") Jnjvm(A, (JnjvmBootstrapLoader*)JCL); - for (std::vector::iterator i = Properties.begin(), - e = Properties.end(); i != e; ++i) { + for (std::vector::iterator i = Properties.begin(), + e = Properties.end(); i != e; ++i) { - char* key = new char [(*i).size()+1]; - strcpy(key, (*i).c_str()); - char* value = strchr(key, '='); - if (!value) { - delete[] key; - } else { - value[0] = 0; - vm->addProperty(key, &value[1]); - } + char* key = new char [(*i).size()+1]; + strcpy(key, (*i).c_str()); + char* value = strchr(key, '='); + if (!value) { + delete[] key; + } else { + value[0] = 0; + vm->addProperty(key, &value[1]); } + } - Comp->clinits = &WithClinit; - Comp->compileFile(vm, InputFilename.c_str()); + Comp->clinits = &WithClinit; + Comp->compileFile(vm, InputFilename.c_str()); - if (!MainClass.empty()) { - Comp->generateMain(MainClass.c_str(), WithJIT); - } + if (!MainClass.empty()) { + Comp->generateMain(MainClass.c_str(), WithJIT); + } - if (PrintStats) - Comp->printStats(); + if (PrintStats) + Comp->printStats(); - // Infer the output filename if needed. - if (OutputFilename.empty()) { - if (InputFilename == "-") { - OutputFilename = "-"; + // Infer the output filename if needed. + if (OutputFilename.empty()) { + if (InputFilename == "-") { + OutputFilename = "-"; + } else { + std::string IFN = InputFilename; + int Len = IFN.length(); + if (IFN[Len-3] == '.' && IFN[Len-2] == 'l' && IFN[Len-1] == 'l') { + // Source ends in .ll + OutputFilename = std::string(IFN.begin(), IFN.end()-3); } else { - std::string IFN = InputFilename; - int Len = IFN.length(); - if (IFN[Len-3] == '.' && IFN[Len-2] == 'l' && IFN[Len-1] == 'l') { - // Source ends in .ll - OutputFilename = std::string(IFN.begin(), IFN.end()-3); - } else { - OutputFilename = IFN; // Append a .bc to it - } - OutputFilename += ".bc"; + OutputFilename = IFN; // Append a .bc to it } - } + OutputFilename += ".bc"; + } + } - std::string ErrorInfo; - std::auto_ptr Out + std::string ErrorInfo; + std::auto_ptr Out (new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, raw_fd_ostream::F_Binary)); - if (!ErrorInfo.empty()) { - errs() << ErrorInfo << '\n'; - return 1; - } + if (!ErrorInfo.empty()) { + errs() << ErrorInfo << '\n'; + return 1; + } - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT. - if (OutputFilename != "-") - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - - if (!DisableOutput) - if (Force || !CheckBitcodeOutputToConsole(*Out, true)) - WriteBitcodeToFile(Comp->getLLVMModule(), *Out); + // Make sure that the Out file gets unlinked from the disk if we get a + // SIGINT. + if (OutputFilename != "-") + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + + if (!DisableOutput) + if (Force || !CheckBitcodeOutputToConsole(*Out, true)) + WriteBitcodeToFile(Comp->getLLVMModule(), *Out); - return 0; - - } catch (const std::string& msg) { - errs() << argv[0] << ": " << msg << "\n"; - } catch (...) { - errs() << argv[0] << ": Unexpected unknown exception occurred.\n"; - } - return 1; + return 0; } Modified: vmkit/trunk/tools/vmkit/CommandLine.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmkit/CommandLine.cpp?rev=101135&r1=101134&r2=101135&view=diff ============================================================================== --- vmkit/trunk/tools/vmkit/CommandLine.cpp (original) +++ vmkit/trunk/tools/vmkit/CommandLine.cpp Tue Apr 13 11:24:13 2010 @@ -167,11 +167,7 @@ Thread::start(&tid, (int (*)(void *))startApp, thread_arg); #else VirtualMachine* VM = func(CU); - try { - VM->runApplication(argc, argv); - } catch(...) { - printf("Caught exception when running the VM"); - } + VM->runApplication(argc, argv); #endif } } From nicolas.geoffray at lip6.fr Wed Apr 14 15:07:51 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Apr 2010 22:07:51 -0000 Subject: [vmkit-commits] [vmkit] r101295 - in /vmkit/trunk/lib/J3/Compiler: ExceptionsCheck.inc JavaJIT.cpp JavaJIT.h Message-ID: <20100414220751.882AE2A6C12C@llvm.org> Author: geoffray Date: Wed Apr 14 17:07:51 2010 New Revision: 101295 URL: http://llvm.org/viewvc/llvm-project?rev=101295&view=rev Log: Use DebugLoc instead of DILocation. Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.h Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc?rev=101295&r1=101294&r2=101295&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc Wed Apr 14 17:07:51 2010 @@ -4,8 +4,8 @@ Instruction* res = CallInst::Create(F, args.begin(), args.end(), Name, InsertAtEnd); - - res->setMetadata("dbg", CreateLocation()); + DebugLoc DL = CreateLocation(); + res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); @@ -63,7 +63,8 @@ BasicBlock *InsertAtEnd) { Instruction* res = CallInst::Create(F, arg1, Name, InsertAtEnd); - res->setMetadata("dbg", CreateLocation()); + DebugLoc DL = CreateLocation(); + res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); @@ -115,7 +116,8 @@ Value* args[2] = { arg1, arg2 }; Instruction* res = CallInst::Create(F, args, args + 2, Name, InsertAtEnd); - res->setMetadata("dbg", CreateLocation()); + DebugLoc DL = CreateLocation(); + res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); @@ -164,7 +166,8 @@ Instruction* JavaJIT::invoke(Value *F, const char* Name, BasicBlock *InsertAtEnd) { Instruction* res = llvm::CallInst::Create(F, Name, InsertAtEnd); - res->setMetadata("dbg", CreateLocation()); + DebugLoc DL = CreateLocation(); + res->setDebugLoc(DL); if (TheCompiler->hasExceptionsEnabled()) { Value* threadId = getCurrentThread(intrinsics->JavaThreadType); @@ -212,7 +215,8 @@ void JavaJIT::throwException(llvm::Function* F, Value* arg1) { Instruction* obj = CallInst::Create(F, arg1, "", currentBlock); - obj->setMetadata("dbg", CreateLocation()); + DebugLoc DL = CreateLocation(); + obj->setDebugLoc(DL); if (currentExceptionBlock != endExceptionBlock) { Instruction* insn = currentExceptionBlock->begin(); @@ -254,7 +258,8 @@ void JavaJIT::throwException(llvm::Function* F, Value** args, uint32 nbArgs) { Instruction* obj = CallInst::Create(F, args, args + nbArgs, "", currentBlock); - obj->setMetadata("dbg", CreateLocation()); + DebugLoc DL = CreateLocation(); + obj->setDebugLoc(DL); if (currentExceptionBlock != endExceptionBlock) { Instruction* insn = currentExceptionBlock->begin(); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=101295&r1=101294&r2=101295&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Wed Apr 14 17:07:51 2010 @@ -782,7 +782,6 @@ Instruction* JavaJIT::inlineCompile(BasicBlock*& curBB, BasicBlock* endExBlock, std::vector& args) { - DbgSubprogram = TheCompiler->GetDbgSubprogram(compilingMethod); PRINT_DEBUG(JNJVM_COMPILE, 1, COLOR_NORMAL, "inline compile %s.%s\n", @@ -2608,13 +2607,11 @@ currentBlock = label_return; } -MDNode* JavaJIT::CreateLocation() { +DebugLoc JavaJIT::CreateLocation() { LineInfo LI = { currentLineNumber, currentCtpIndex, currentBytecodeIndex }; codeInfo.push_back(LI); - DILocation Location = TheCompiler->getDebugFactory()->CreateLocation( - callNumber, 0, DIScope(DbgSubprogram)); - callNumber++; - return Location.getNode(); + DebugLoc DL = DebugLoc::get(callNumber++, 0, DbgSubprogram); + return DL; } #ifdef DWARF_EXCEPTIONS Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=101295&r1=101294&r2=101295&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Wed Apr 14 17:07:51 2010 @@ -20,6 +20,7 @@ #include "llvm/Metadata.h" #include "llvm/Type.h" #include "llvm/Value.h" +#include "llvm/Support/DebugLoc.h" #include "llvm/Analysis/DebugInfo.h" #include "types.h" @@ -167,7 +168,7 @@ uint16 callNumber; /// CreateLocation - Create debug information for a call. - llvm::MDNode* CreateLocation(); + llvm::DebugLoc CreateLocation(); // codeInfo - List of LineInfo for this method. std::vector codeInfo; From nicolas.geoffray at lip6.fr Thu Apr 15 13:59:30 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 15 Apr 2010 20:59:30 -0000 Subject: [vmkit-commits] [vmkit] r101400 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/Mvm/CommonThread/ctthread.cpp Message-ID: <20100415205930.536572A6C12C@llvm.org> Author: geoffray Date: Thu Apr 15 15:59:30 2010 New Revision: 101400 URL: http://llvm.org/viewvc/llvm-project?rev=101400&view=rev Log: Use _setjmp and _longjmp on MacOS. Modified: vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=101400&r1=101399&r2=101400&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Thu Apr 15 15:59:30 2010 @@ -17,16 +17,20 @@ #include "types.h" #ifdef RUNTIME_DWARF_EXCEPTIONS -#define TRY try -#define CATCH catch(...) -#define IGNORE catch(...) { mvm::Thread::get()->clearException(); } -#define END_CATCH + #define TRY try + #define CATCH catch(...) + #define IGNORE catch(...) { mvm::Thread::get()->clearException(); } + #define END_CATCH #else -#include -#define TRY { mvm::ExceptionBuffer __buffer__; if (!setjmp(__buffer__.buffer)) -#define CATCH else -#define IGNORE else { mvm::Thread::get()->clearException(); }} -#define END_CATCH } + #include + #if defined(__MACH__) + #define TRY { mvm::ExceptionBuffer __buffer__; if (!_setjmp(__buffer__.buffer)) + #else + #define TRY { mvm::ExceptionBuffer __buffer__; if (!setjmp(__buffer__.buffer)) + #endif + #define CATCH else + #define IGNORE else { mvm::Thread::get()->clearException(); }} + #define END_CATCH } #endif namespace mvm { Modified: vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp?rev=101400&r1=101399&r2=101400&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Thu Apr 15 15:59:30 2010 @@ -90,8 +90,12 @@ internalPendingException = (void*)((uintptr_t)exc - 32); cxa_throw(exc, 0, 0); #else +#if defined(__MACH__) + _longjmp(lastExceptionBuffer->buffer, 1); +#else longjmp(lastExceptionBuffer->buffer, 1); #endif +#endif } void Thread::printBacktrace() { From nicolas.geoffray at lip6.fr Sat Apr 17 13:43:27 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 17 Apr 2010 20:43:27 -0000 Subject: [vmkit-commits] [vmkit] r101669 - in /vmkit/trunk/lib/J3: Compiler/JavaJIT.cpp Compiler/JavaJIT.h Compiler/JavaJITCompiler.cpp Compiler/JavaJITOpcodes.cpp VMCore/JavaClass.cpp VMCore/JavaClass.h VMCore/JavaRuntimeJIT.cpp Message-ID: <20100417204327.7AA042A6C12C@llvm.org> Author: geoffray Date: Sat Apr 17 15:43:27 2010 New Revision: 101669 URL: http://llvm.org/viewvc/llvm-project?rev=101669&view=rev Log: Take into account invokeinterface on abstract methods in j3ResolveVirtualStub. Modified: 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/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.h vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=101669&r1=101668&r2=101669&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sat Apr 17 15:43:27 2010 @@ -524,13 +524,12 @@ UTF8Buffer(compilingMethod->name).cString()); if (codeInfo.size()) { - mvm::BumpPtrAllocator& Alloc = compilingClass->classLoader->allocator; - compilingMethod->codeInfo = - new(Alloc, "CodeLineInfo") CodeLineInfo[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; } } @@ -1361,6 +1360,7 @@ 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; } } @@ -2608,7 +2608,8 @@ } DebugLoc JavaJIT::CreateLocation() { - LineInfo LI = { currentLineNumber, currentCtpIndex, currentBytecodeIndex }; + LineInfo LI = { currentLineNumber, currentCtpIndex, currentBytecodeIndex, + currentBytecode }; codeInfo.push_back(LI); DebugLoc DL = DebugLoc::get(callNumber++, 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=101669&r1=101668&r2=101669&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Sat Apr 17 15:43:27 2010 @@ -68,6 +68,7 @@ uint16 lineNumber; uint16 ctpIndex; uint16 bytecodeIndex; + uint16 bytecode; }; /// JavaJIT - The compilation engine of J3. Parses the bycode and returns @@ -92,6 +93,7 @@ currentLineNumber = 0; currentBytecodeIndex = 0; currentCtpIndex = -1; + currentBytecode = -1; callNumber = 0; } @@ -164,6 +166,9 @@ /// 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; Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=101669&r1=101668&r2=101669&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sat Apr 17 15:43:27 2010 @@ -115,6 +115,8 @@ currentCompiledMethod->codeInfo[first].bytecodeIndex; infoTable[i].ctpIndex = currentCompiledMethod->codeInfo[first].ctpIndex; + infoTable[i].bytecode = + currentCompiledMethod->codeInfo[first].bytecode; } delete[] currentCompiledMethod->codeInfo; currentCompiledMethod->codeInfo = infoTable; Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=101669&r1=101668&r2=101669&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sat Apr 17 15:43:27 2010 @@ -173,6 +173,7 @@ currentCtpIndex = -1; currentBytecodeIndex = i; + currentBytecode = bytecodes[i]; // To prevent a gcj bug with useless goto if (currentBlock->getTerminator() != 0) { Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=101669&r1=101668&r2=101669&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sat Apr 17 15:43:27 2010 @@ -1748,6 +1748,17 @@ } } +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 (codeInfoLength) return &(codeInfo[codeInfoLength - 1]); + return NULL; +} + uint16 JavaMethod::lookupLineNumber(uintptr_t ip) { for(uint16 i = 0; i < codeInfoLength; ++i) { if (codeInfo[i].address > ip) { Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.h?rev=101669&r1=101668&r2=101669&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.h Sat Apr 17 15:43:27 2010 @@ -983,6 +983,7 @@ uint16 lineNumber; uint16 ctpIndex; uint16 bytecodeIndex; + uint16 bytecode; // TODO: Use these fields when inlining. JavaMethod* executingMethod; // The code where the inlined method starts. @@ -1083,6 +1084,11 @@ /// related to the given instruction pointer. /// uint16 lookupCtpIndex(uintptr_t ip); + + /// lookupCodeLineInfo - Lookup the code line info related to the given + /// instruction pointer. + /// + CodeLineInfo* lookupCodeLineInfo(uintptr_t ip); /// getSignature - Get the signature of thes method, resolving it if /// necessary. Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=101669&r1=101668&r2=101669&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Sat Apr 17 15:43:27 2010 @@ -604,7 +604,9 @@ void* ip = *Walker; // Lookup the method info in the constant pool of the caller. - uint16 ctpIndex = meth->lookupCtpIndex(reinterpret_cast(ip)); + CodeLineInfo* CLInfo = + meth->lookupCodeLineInfo(reinterpret_cast(ip)); + uint16 ctpIndex = CLInfo->ctpIndex; assert(ctpIndex && "No constant pool index"); JavaConstantPool* ctpInfo = meth->classDef->getConstantPool(); CommonClass* ctpCl = 0; @@ -629,7 +631,7 @@ "The method's offset is greater than the virtual table size"); ((void**)obj->getVirtualTable())[Virt->offset] = result; - if (ctpCl->isInterface()) { + if (CLInfo->bytecode == 0xB9) { // INVOKEINTERFACE InterfaceMethodTable* IMT = cl->virtualVT->IMT; uint32_t index = InterfaceMethodTable::getIndex(Virt->name, Virt->type); if ((IMT->contents[index] & 1) == 0) { From nicolas.geoffray at lip6.fr Sat Apr 17 14:32:07 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 17 Apr 2010 21:32:07 -0000 Subject: [vmkit-commits] [vmkit] r101677 - /vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Message-ID: <20100417213207.6E4CF2A6C12C@llvm.org> Author: geoffray Date: Sat Apr 17 16:32:07 2010 New Revision: 101677 URL: http://llvm.org/viewvc/llvm-project?rev=101677&view=rev Log: Actually look at the original referenced method to see if it is an interface. Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=101677&r1=101676&r2=101677&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Sat Apr 17 16:32:07 2010 @@ -612,6 +612,8 @@ CommonClass* ctpCl = 0; const UTF8* utf8 = 0; Signdef* sign = 0; + JavaMethod* origMeth = 0; + ctpInfo->infoOfMethod(ctpIndex, ACC_VIRTUAL, ctpCl, origMeth); ctpInfo->resolveMethod(ctpIndex, ctpCl, utf8, sign); assert(cl->isAssignableFrom(ctpCl) && "Wrong call object"); @@ -631,7 +633,7 @@ "The method's offset is greater than the virtual table size"); ((void**)obj->getVirtualTable())[Virt->offset] = result; - if (CLInfo->bytecode == 0xB9) { // INVOKEINTERFACE + if (isInterface(origMeth->classDef->access)) { InterfaceMethodTable* IMT = cl->virtualVT->IMT; uint32_t index = InterfaceMethodTable::getIndex(Virt->name, Virt->type); if ((IMT->contents[index] & 1) == 0) { From nicolas.geoffray at lip6.fr Sun Apr 18 01:47:49 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Apr 2010 08:47:49 -0000 Subject: [vmkit-commits] [vmkit] r101708 - /vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Message-ID: <20100418084749.54EDA2A6C12C@llvm.org> Author: geoffray Date: Sun Apr 18 03:47:49 2010 New Revision: 101708 URL: http://llvm.org/viewvc/llvm-project?rev=101708&view=rev Log: Optimize a bit invoke virtual on JNI calls. Modified: vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Modified: vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp?rev=101708&r1=101707&r2=101708&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Sun Apr 18 03:47:49 2010 @@ -109,7 +109,7 @@ llvm_gcroot(obj, 0); \ verifyNull(obj); \ UserClass* objCl = obj->getClass()->isArray() ? obj->getClass()->super : obj->getClass()->asClass(); \ - JavaMethod* meth = objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ + JavaMethod* meth = (objCl == classDef) ? this : objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ assert(meth && "No method found"); \ void* func = meth->compiledPtr(); \ Signdef* sign = getSignature(); \ @@ -167,7 +167,7 @@ verifyNull(obj);\ Signdef* sign = getSignature(); \ UserClass* objCl = obj->getClass()->isArray() ? obj->getClass()->super : obj->getClass()->asClass(); \ - JavaMethod* meth = objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ + JavaMethod* meth = (objCl == classDef) ? this : objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ assert(meth && "No method found"); \ void* func = meth->compiledPtr(); \ FUNC_TYPE_VIRTUAL_BUF call = (FUNC_TYPE_VIRTUAL_BUF)sign->getVirtualCallBuf(); \ From nicolas.geoffray at lip6.fr Sun Apr 18 02:51:15 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Apr 2010 09:51:15 -0000 Subject: [vmkit-commits] [vmkit] r101713 - /vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Message-ID: <20100418095115.751362A6C12C@llvm.org> Author: geoffray Date: Sun Apr 18 04:51:15 2010 New Revision: 101713 URL: http://llvm.org/viewvc/llvm-project?rev=101713&view=rev Log: Continue optimizing a bit invokevirtual in JNI. Modified: vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Modified: vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp?rev=101713&r1=101712&r2=101713&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Sun Apr 18 04:51:15 2010 @@ -109,7 +109,11 @@ llvm_gcroot(obj, 0); \ verifyNull(obj); \ UserClass* objCl = obj->getClass()->isArray() ? obj->getClass()->super : obj->getClass()->asClass(); \ - JavaMethod* meth = (objCl == classDef) ? this : objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ + if (objCl == classDef || isFinal(access)) { \ + meth = this; \ + } else { \ + meth = objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ + } \ assert(meth && "No method found"); \ void* func = meth->compiledPtr(); \ Signdef* sign = getSignature(); \ @@ -167,7 +171,12 @@ verifyNull(obj);\ Signdef* sign = getSignature(); \ UserClass* objCl = obj->getClass()->isArray() ? obj->getClass()->super : obj->getClass()->asClass(); \ - JavaMethod* meth = (objCl == classDef) ? this : objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ + JavaMethod* meth = NULL; \ + if (objCl == classDef || isFinal(access)) { \ + meth = this; \ + } else { \ + meth = objCl->lookupMethodDontThrow(name, type, false, true, &cl); \ + } \ assert(meth && "No method found"); \ void* func = meth->compiledPtr(); \ FUNC_TYPE_VIRTUAL_BUF call = (FUNC_TYPE_VIRTUAL_BUF)sign->getVirtualCallBuf(); \ From nicolas.geoffray at lip6.fr Sun Apr 18 03:20:22 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Apr 2010 10:20:22 -0000 Subject: [vmkit-commits] [vmkit] r101714 - in /vmkit/trunk/lib/J3/VMCore: JnjvmClassLoader.cpp JnjvmClassLoader.h Message-ID: <20100418102022.E2F662A6C12C@llvm.org> Author: geoffray Date: Sun Apr 18 05:20:22 2010 New Revision: 101714 URL: http://llvm.org/viewvc/llvm-project?rev=101714&view=rev Log: Cache the loadClass method on class loaders to avoid lookups. Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=101714&r1=101713&r2=101714&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sun Apr 18 05:20:22 2010 @@ -280,8 +280,9 @@ isolate = I; JavaMethod* meth = bootstrapLoader->upcalls->loadInClassLoader; - loader->getClass()->asClass()->lookupMethodDontThrow(meth->name, meth->type, - false, true, &loadClass); + loadClassMethod = + loader->getClass()->asClass()->lookupMethodDontThrow( + meth->name, meth->type, false, true, &loadClass); assert(loadClass && "Loader does not have a loadClass function"); #if defined(SERVICE) @@ -386,8 +387,8 @@ if (!strName) { strName = JavaString::internalToJava(name, isolate); } - obj = upcalls->loadInClassLoader->invokeJavaObjectVirtual(isolate, forCtp, - javaLoader, &strName, doResolve); + obj = loadClassMethod->invokeJavaObjectVirtual(isolate, forCtp, javaLoader, + &strName, doResolve); cl = (UserCommonClass*)((JavaObjectClass*)obj)->getClass(); } Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=101714&r1=101713&r2=101714&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Sun Apr 18 05:20:22 2010 @@ -238,6 +238,10 @@ /// loadClass - The user class that defines the loadClass method. /// UserClass* loadClass; + + /// loadClassMethod - The loadClass defined by this class loader. + /// + JavaMethod* loadClassMethod; /// constructArrayName - Construct an array name based on a class name /// and the number of dimensions. From nicolas.geoffray at lip6.fr Sun Apr 18 04:33:25 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Apr 2010 11:33:25 -0000 Subject: [vmkit-commits] [vmkit] r101715 - in /vmkit/trunk/lib/J3: Classpath/ClasspathVMSystem.inc VMCore/JavaRuntimeJIT.cpp Message-ID: <20100418113325.251CC2A6C12C@llvm.org> Author: geoffray Date: Sun Apr 18 06:33:24 2010 New Revision: 101715 URL: http://llvm.org/viewvc/llvm-project?rev=101715&view=rev Log: Otpimize arraycopy and some other functions to not call setjmp. Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc?rev=101715&r1=101714&r2=101715&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMSystem.inc Sun Apr 18 06:33:24 2010 @@ -36,15 +36,18 @@ llvm_gcroot(dst, 0); llvm_gcroot(cur, 0); - BEGIN_NATIVE_EXCEPTION(0) + JavaThread* th = JavaThread::get(); + Jnjvm *vm = th->getJVM(); - j3::Jnjvm *vm = JavaThread::get()->getJVM(); - - verifyNull(src); - verifyNull(dst); + if (src == NULL || dst == NULL) { + th->pendingException = vm->CreateNullPointerException(); + return; + } if (!(src->getClass()->isArray() && dst->getClass()->isArray())) { - vm->arrayStoreException(); + th->pendingException = vm->CreateArrayStoreException( + (JavaVirtualTable*)dst->getVirtualTable()); + return; } UserClassArray* ts = (UserClassArray*)src->getClass(); @@ -53,23 +56,25 @@ UserCommonClass* srcType = ts->baseClass(); if (len > src->size) { - vm->indexOutOfBounds(src, len); + th->pendingException = vm->CreateIndexOutOfBoundsException(len); } else if (len > dst->size) { - vm->indexOutOfBounds(dst, len); + th->pendingException = vm->CreateIndexOutOfBoundsException(len); } else if (len + sstart > src->size) { - vm->indexOutOfBounds(src, len + sstart); + th->pendingException = vm->CreateIndexOutOfBoundsException(len + sstart); } else if (len + dstart > dst->size) { - vm->indexOutOfBounds(dst, len + dstart); + th->pendingException = vm->CreateIndexOutOfBoundsException(len + dstart); } else if (dstart < 0) { - vm->indexOutOfBounds(dst, dstart); + th->pendingException = vm->CreateIndexOutOfBoundsException(dstart); } else if (sstart < 0) { - vm->indexOutOfBounds(src, sstart); + th->pendingException = vm->CreateIndexOutOfBoundsException(sstart); } else if (len < 0) { - vm->indexOutOfBounds(src, len); + th->pendingException = vm->CreateIndexOutOfBoundsException(len); } else if ((dstType->isPrimitive() || srcType->isPrimitive()) && srcType != dstType) { - vm->arrayStoreException(); + th->pendingException = vm->CreateArrayStoreException( + (JavaVirtualTable*)dst->getVirtualTable()); } + if (th->pendingException != NULL) return; jint i = sstart; jint length = len; @@ -94,10 +99,10 @@ void* ptrSrc = (void*)((int64_t)(src->elements) + (sstart << logSize)); memmove(ptrDst, ptrSrc, length << logSize); - if (doThrow) - vm->arrayStoreException(); - - END_NATIVE_EXCEPTION + if (doThrow) { + th->pendingException = vm->CreateArrayStoreException( + (JavaVirtualTable*)dst->getVirtualTable()); + } } JNIEXPORT jint JNICALL Java_java_lang_VMSystem_identityHashCode( Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=101715&r1=101714&r2=101715&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Sun Apr 18 06:33:24 2010 @@ -354,22 +354,14 @@ // Never throws. extern "C" void j3JavaObjectAquire(JavaObject* obj) { - BEGIN_NATIVE_EXCEPTION(1) - llvm_gcroot(obj, 0); obj->acquire(); - - END_NATIVE_EXCEPTION } // Never throws. extern "C" void j3JavaObjectRelease(JavaObject* obj) { - BEGIN_NATIVE_EXCEPTION(1) - llvm_gcroot(obj, 0); obj->release(); - - END_NATIVE_EXCEPTION } // Does not call any Java code. Can not yield a GC. @@ -484,7 +476,7 @@ // Creates a Java object and then throws it. extern "C" JavaObject* j3ClassCastException(JavaObject* obj, - UserCommonClass* cl) { + UserCommonClass* cl) { JavaObject *exc = 0; llvm_gcroot(obj, 0); llvm_gcroot(exc, 0); @@ -508,7 +500,7 @@ // Creates a Java object and then throws it. extern "C" JavaObject* j3IndexOutOfBoundsException(JavaObject* obj, - sint32 index) { + sint32 index) { JavaObject *exc = 0; llvm_gcroot(obj, 0); llvm_gcroot(exc, 0); From nicolas.geoffray at lip6.fr Sun Apr 18 04:36:43 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Apr 2010 11:36:43 -0000 Subject: [vmkit-commits] [vmkit] r101716 - /vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Message-ID: <20100418113643.9D2952A6C12C@llvm.org> Author: geoffray Date: Sun Apr 18 06:36:43 2010 New Revision: 101716 URL: http://llvm.org/viewvc/llvm-project?rev=101716&view=rev Log: Remove warning. Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=101716&r1=101715&r2=101716&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sun Apr 18 06:36:43 2010 @@ -382,7 +382,6 @@ UserCommonClass* cl = lookupClass(name); if (!cl) { - Classpath* upcalls = bootstrapLoader->upcalls; UserClass* forCtp = loadClass; if (!strName) { strName = JavaString::internalToJava(name, isolate); From nicolas.geoffray at lip6.fr Sun Apr 18 05:13:17 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Apr 2010 12:13:17 -0000 Subject: [vmkit-commits] [vmkit] r101718 - /vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Message-ID: <20100418121317.B64972A6C12C@llvm.org> Author: geoffray Date: Sun Apr 18 07:13:17 2010 New Revision: 101718 URL: http://llvm.org/viewvc/llvm-project?rev=101718&view=rev Log: Optimize on String::intern. Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=101718&r1=101717&r2=101718&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Sun Apr 18 07:13:17 2010 @@ -376,12 +376,16 @@ llvm_gcroot(obj, 0); llvm_gcroot(array, 0); llvm_gcroot(res, 0); + // If the string is already interned, just return. + if (obj->getVirtualTable() == JavaString::internStringVT) return obj; BEGIN_NATIVE_EXCEPTION(0) Jnjvm* vm = JavaThread::get()->getJVM(); array = obj->strToArray(vm); res = vm->constructString(array); + assert(res->getVirtualTable() == JavaString::internStringVT && + "Wrong VT after interning a string"); END_NATIVE_EXCEPTION From nicolas.geoffray at lip6.fr Sun Apr 18 13:26:22 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Apr 2010 20:26:22 -0000 Subject: [vmkit-commits] [vmkit] r101753 - in /vmkit/trunk/lib/J3: Compiler/JavaJITOpcodes.cpp Compiler/LowerConstantCalls.cpp LLVMRuntime/runtime-default.ll VMCore/JavaClass.cpp VMCore/JavaConstantPool.cpp VMCore/JavaObject.h VMCore/JavaRuntimeJIT.cpp Message-ID: <20100418202622.E39E52A6C12C@llvm.org> Author: geoffray Date: Sun Apr 18 15:26:22 2010 New Revision: 101753 URL: http://llvm.org/viewvc/llvm-project?rev=101753&view=rev Log: Optimize ANEWARRAY when the array class is not loaded yet by getting the VT instead of the class. Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp vmkit/trunk/lib/J3/VMCore/JavaObject.h vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=101753&r1=101752&r2=101753&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sun Apr 18 15:26:22 2010 @@ -730,7 +730,7 @@ BranchInst::Create(endBlock, exceptionBlock, res, currentBlock); currentBlock = exceptionBlock; - throwException(intrinsics->ArrayStoreExceptionFunction, VTArgs, 1); + throwException(intrinsics->ArrayStoreExceptionFunction, VTArgs, 2); currentBlock = endBlock; } @@ -2009,10 +2009,10 @@ } } else { uint16 index = readU2(bytecodes, i); - CommonClass* cl = 0; - valCl = getResolvedCommonClass(index, true, &cl); + CommonClass* cl = + compilingClass->ctpInfo->getMethodClassIfLoaded(index); - if (cl) { + if (cl && (!cl->isClass() || cl->asClass()->isResolved())) { JnjvmClassLoader* JCL = cl->classLoader; const UTF8* arrayName = JCL->constructArrayName(1, cl->name); @@ -2033,12 +2033,12 @@ } else { const llvm::Type* Ty = - PointerType::getUnqual(intrinsics->JavaClassArrayType); - Value* args[2]= { valCl, Constant::getNullValue(Ty) }; - valCl = CallInst::Create(intrinsics->GetArrayClassFunction, args, - args + 2, "", currentBlock); - TheVT = CallInst::Create(intrinsics->GetVTFromClassArrayFunction, valCl, "", - currentBlock); + PointerType::getUnqual(intrinsics->VTType); + Value* args[3]= { TheCompiler->getNativeClass(compilingClass), + ConstantInt::get(Type::getInt32Ty(*llvmContext), index), + Constant::getNullValue(Ty) }; + TheVT = CallInst::Create(intrinsics->GetArrayClassFunction, args, + args + 3, "", currentBlock); } sizeElement = intrinsics->constantPtrLogSize; Modified: vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp?rev=101753&r1=101752&r2=101753&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp Sun Apr 18 15:26:22 2010 @@ -531,17 +531,16 @@ BranchInst::Create(NBB, trueCl); break; } else if (V == intrinsics->GetArrayClassFunction) { - const llvm::Type* Ty = - PointerType::getUnqual(intrinsics->JavaCommonClassType); + const llvm::Type* Ty = PointerType::getUnqual(intrinsics->VTType); Constant* nullValue = Constant::getNullValue(Ty); // Check if we have already proceed this call. - if (Call.getArgument(1) == nullValue) { + if (Call.getArgument(2) == nullValue) { BasicBlock* NBB = II->getParent()->splitBasicBlock(II); I->getParent()->getTerminator()->eraseFromParent(); - Constant* init = Constant::getNullValue(intrinsics->JavaClassArrayType); + Constant* init = Constant::getNullValue(intrinsics->VTType); GlobalVariable* GV = - new GlobalVariable(*(F.getParent()), intrinsics->JavaClassArrayType, + new GlobalVariable(*(F.getParent()), intrinsics->VTType, false, GlobalValue::ExternalLinkage, init, ""); @@ -551,21 +550,22 @@ BasicBlock* OKBlock = BasicBlock::Create(*Context, "", &F); BasicBlock* NotOKBlock = BasicBlock::Create(*Context, "", &F); - PHINode* node = PHINode::Create(intrinsics->JavaClassArrayType, "", + PHINode* node = PHINode::Create(intrinsics->VTType, "", OKBlock); node->addIncoming(LoadedGV, CI->getParent()); BranchInst::Create(NotOKBlock, OKBlock, cmp, CI); - Value* args[2] = { Call.getArgument(0), GV }; + Value* args[3] = { Call.getArgument(0), Call.getArgument(1), GV }; Value* res = CallInst::Create(intrinsics->GetArrayClassFunction, args, - args + 2, "", NotOKBlock); + args + 3, "", NotOKBlock); BranchInst::Create(OKBlock, NotOKBlock); node->addIncoming(res, NotOKBlock); CI->replaceAllUsesWith(node); CI->eraseFromParent(); BranchInst::Create(NBB, OKBlock); + Changed = true; break; } } else if (V == intrinsics->ForceInitialisationCheckFunction || 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=101753&r1=101752&r2=101753&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-default.ll Sun Apr 18 15:26:22 2010 @@ -184,8 +184,7 @@ declare %JavaObject* @j3RuntimeDelegatee(%JavaCommonClass*) readnone ;;; j3GetArrayClass - Get the array user class of the user class. -declare %JavaClassArray* @j3GetArrayClass(%JavaCommonClass*, - %JavaClassArray**) readnone +declare %VT* @j3GetArrayClass(%JavaClass*, i32, %VT**) readnone declare i8 @getFinalInt8Field(i8*) readnone declare i16 @getFinalInt16Field(i16*) readnone @@ -209,7 +208,7 @@ declare %JavaObject* @j3NegativeArraySizeException(i32) declare %JavaObject* @j3OutOfMemoryError(i32) declare %JavaObject* @j3StackOverflowError() -declare %JavaObject* @j3ArrayStoreException(%VT*) +declare %JavaObject* @j3ArrayStoreException(%VT*, %VT*) declare %JavaObject* @j3ArithmeticException() declare void @j3ThrowException(%JavaObject*) declare void @j3ThrowExceptionFromJIT() Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=101753&r1=101752&r2=101753&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sun Apr 18 15:26:22 2010 @@ -1486,8 +1486,6 @@ destructor = 0; nbSecondaryTypes = 0; } - - } JavaVirtualTable::JavaVirtualTable(ClassArray* C) { Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=101753&r1=101752&r2=101753&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Sun Apr 18 15:26:22 2010 @@ -288,10 +288,8 @@ if (name->elements[0] == I_TAB) { temp = loader->constructArray(name); } else { - // Put into ctpRes because there is only one representation of the class temp = loader->loadName(name, resolve, false); - } - + } ctpRes[index] = temp; } #endif Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.h?rev=101753&r1=101752&r2=101753&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.h Sun Apr 18 15:26:22 2010 @@ -81,8 +81,8 @@ /// JavaVirtualTable** secondaryTypes; - /// baseClass - Holds the base class VT of an array, or the array class VT - /// of a regular class. Used for AASTORE checks. + /// baseClassVT - Holds the base class VT of an array. Used for AASTORE + /// checks. /// JavaVirtualTable* baseClassVT; Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=101753&r1=101752&r2=101753&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Sun Apr 18 15:26:22 2010 @@ -189,13 +189,21 @@ BEGIN_NATIVE_EXCEPTION(1) UserConstantPool* ctpInfo = caller->getConstantPool(); - UserClass* cl = (UserClass*)ctpInfo->loadClass(index); + UserCommonClass* cl = ctpInfo->loadClass(index); // We can not initialize here, because bytecodes such as CHECKCAST // or classes used in catch clauses do not trigger class initialization. // This is really sad, because we need to insert class initialization checks // in the LLVM code. assert(cl && "No cl after class lookup"); res = (void*)cl; + + // Create the array class, in case we come from a ANEWARRAY. + if (cl->isClass() && !cl->virtualVT->baseClassVT) { + const UTF8* arrayName = + cl->classLoader->constructArrayName(1, cl->getName()); + cl->virtualVT->baseClassVT = + cl->classLoader->constructArray(arrayName)->virtualVT; + } END_NATIVE_EXCEPTION @@ -295,18 +303,22 @@ } // Throws if the class can not be resolved. -extern "C" UserClassArray* j3GetArrayClass(UserCommonClass* cl, - UserClassArray** dcl) { - UserClassArray* res = 0; - +extern "C" JavaVirtualTable* j3GetArrayClass(UserClass* caller, + uint32 index, + JavaVirtualTable** VT) { + JavaVirtualTable* res = 0; + assert(VT && "Incorrect call to j3GetArrayClass"); BEGIN_NATIVE_EXCEPTION(1) + UserConstantPool* ctpInfo = caller->getConstantPool(); + UserCommonClass* cl = ctpInfo->loadClass(index); + JnjvmClassLoader* JCL = cl->classLoader; if (cl->asClass()) cl->asClass()->resolveClass(); const UTF8* arrayName = JCL->constructArrayName(1, cl->getName()); - res = JCL->constructArray(arrayName); - if (dcl) *dcl = res; + res = JCL->constructArray(arrayName)->virtualVT; + *VT = res; END_NATIVE_EXCEPTION @@ -314,7 +326,7 @@ // exception check. Therefore, we trick LLVM to check the return value of the // function. JavaObject* obj = JavaThread::get()->pendingException; - if (obj) return (UserClassArray*)obj; + if (obj) return (JavaVirtualTable*)obj; return res; } @@ -523,12 +535,12 @@ } // Creates a Java object and then throws it. -extern "C" JavaObject* j3ArrayStoreException(JavaVirtualTable* VT) { +extern "C" JavaObject* j3ArrayStoreException(JavaVirtualTable* VT, + JavaVirtualTable* VT2) { JavaObject *exc = 0; JavaThread *th = JavaThread::get(); BEGIN_NATIVE_EXCEPTION(1) - exc = th->getJVM()->CreateArrayStoreException(VT); END_NATIVE_EXCEPTION From nicolas.geoffray at lip6.fr Tue Apr 20 12:32:41 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Apr 2010 19:32:41 -0000 Subject: [vmkit-commits] [vmkit] r101933 - in /vmkit/trunk/lib: J3/Compiler/JavaJIT.cpp J3/Compiler/JavaLLVMCompiler.cpp J3/Compiler/LowerConstantCalls.cpp Mvm/Compiler/LoopSafePoints.cpp Message-ID: <20100420193241.E5C0C2A6C12C@llvm.org> Author: geoffray Date: Tue Apr 20 14:32:41 2010 New Revision: 101933 URL: http://llvm.org/viewvc/llvm-project?rev=101933&view=rev Log: Inser the yield point im loops before doing any optimization. Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=101933&r1=101932&r2=101933&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Tue Apr 20 14:32:41 2010 @@ -1195,29 +1195,6 @@ if (isSynchro(compilingMethod->access)) beginSynchronize(); - - if (TheCompiler->hasExceptionsEnabled()) { - // Variables have been allocated and the lock has been taken. Do the stack - // check now: if there is an exception, we will go to the lock release code. - currentExceptionBlock = opcodeInfos[0].exceptionBlock; - Value* FrameAddr = CallInst::Create(intrinsics->llvm_frameaddress, - intrinsics->constantZero, "", currentBlock); - FrameAddr = new PtrToIntInst(FrameAddr, intrinsics->pointerSizeType, "", - currentBlock); - Value* stackCheck = - BinaryOperator::CreateAnd(FrameAddr, intrinsics->constantStackOverflowMask, - "", currentBlock); - - stackCheck = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, stackCheck, - intrinsics->constantPtrZero, ""); - BasicBlock* stackOverflow = createBasicBlock("stack overflow"); - BasicBlock* noStackOverflow = createBasicBlock("no stack overflow"); - BranchInst::Create(stackOverflow, noStackOverflow, stackCheck, - currentBlock); - currentBlock = stackOverflow; - throwException(intrinsics->StackOverflowErrorFunction, 0, 0); - currentBlock = noStackOverflow; - } if (TheCompiler->useCooperativeGC()) { Value* threadId = getCurrentThread(intrinsics->MutatorThreadType); @@ -1240,6 +1217,29 @@ currentBlock = continueBlock; } + + if (TheCompiler->hasExceptionsEnabled()) { + // Variables have been allocated and the lock has been taken. Do the stack + // check now: if there is an exception, we will go to the lock release code. + currentExceptionBlock = opcodeInfos[0].exceptionBlock; + Value* FrameAddr = CallInst::Create(intrinsics->llvm_frameaddress, + intrinsics->constantZero, "", currentBlock); + FrameAddr = new PtrToIntInst(FrameAddr, intrinsics->pointerSizeType, "", + currentBlock); + Value* stackCheck = + BinaryOperator::CreateAnd(FrameAddr, intrinsics->constantStackOverflowMask, + "", currentBlock); + + stackCheck = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, stackCheck, + intrinsics->constantPtrZero, ""); + BasicBlock* stackOverflow = createBasicBlock("stack overflow"); + BasicBlock* noStackOverflow = createBasicBlock("no stack overflow"); + BranchInst::Create(stackOverflow, noStackOverflow, stackCheck, + currentBlock); + currentBlock = stackOverflow; + throwException(intrinsics->StackOverflowErrorFunction, 0, 0); + currentBlock = noStackOverflow; + } compileOpcodes(&compilingClass->bytes->elements[start], codeLen); Modified: vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp?rev=101933&r1=101932&r2=101933&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp Tue Apr 20 14:32:41 2010 @@ -113,7 +113,7 @@ } namespace j3 { - llvm::FunctionPass* createLowerConstantCallsPass(J3Intrinsics* I); + llvm::FunctionPass* createLowerConstantCallsPass(JavaLLVMCompiler* I); } void JavaLLVMCompiler::addJavaPasses() { @@ -121,15 +121,17 @@ JavaNativeFunctionPasses->add(new TargetData(TheModule)); // Lower constant calls to lower things like getClass used // on synchronized methods. - JavaNativeFunctionPasses->add(createLowerConstantCallsPass(getIntrinsics())); + JavaNativeFunctionPasses->add(createLowerConstantCallsPass(this)); JavaFunctionPasses = new FunctionPassManager(TheModule); - mvm::MvmModule::addCommandLinePasses(JavaFunctionPasses); if (cooperativeGC) JavaFunctionPasses->add(mvm::createLoopSafePointsPass()); + // Add other passes after the loop pass, because safepoints may move objects. + // Moving objects disable many optimizations. + mvm::MvmModule::addCommandLinePasses(JavaFunctionPasses); // Re-enable this when the pointers in stack-allocated objects can // be given to the GC. //JavaFunctionPasses->add(mvm::createEscapeAnalysisPass()); - JavaFunctionPasses->add(createLowerConstantCallsPass(getIntrinsics())); + JavaFunctionPasses->add(createLowerConstantCallsPass(this)); } Modified: vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp?rev=101933&r1=101932&r2=101933&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp Tue Apr 20 14:32:41 2010 @@ -17,6 +17,7 @@ #include "llvm/Support/Debug.h" #include "JavaClass.h" +#include "j3/JavaLLVMCompiler.h" #include "j3/J3Intrinsics.h" using namespace llvm; @@ -26,9 +27,9 @@ class VISIBILITY_HIDDEN LowerConstantCalls : public FunctionPass { public: static char ID; - J3Intrinsics* intrinsics; - LowerConstantCalls(J3Intrinsics* I) : FunctionPass((intptr_t)&ID), - intrinsics(I) { } + JavaLLVMCompiler* TheCompiler; + LowerConstantCalls(JavaLLVMCompiler* Compiler) : FunctionPass((intptr_t)&ID), + TheCompiler(Compiler) { } virtual bool runOnFunction(Function &F); private: @@ -124,6 +125,9 @@ bool LowerConstantCalls::runOnFunction(Function& F) { LLVMContext* Context = &F.getContext(); bool Changed = false; + J3Intrinsics* intrinsics = TheCompiler->getIntrinsics(); + JavaMethod* meth = TheCompiler->getJavaMethod(&F); + assert(meth && "Method not registered"); for (Function::iterator BI = F.begin(), BE = F.end(); BI != BE; BI++) { BasicBlock *Cur = BI; for (BasicBlock::iterator II = Cur->begin(), IE = Cur->end(); II != IE;) { @@ -133,16 +137,12 @@ if (ICmpInst* Cmp = dyn_cast(I)) { if (Cmp->getOperand(1) == intrinsics->JavaObjectNullConstant) { Value* Arg = Cmp->getOperand(0); - -#if 0 - // Re-enable this once we can get access of the JavaMethod again. if (isVirtual(meth->access) && Arg == F.arg_begin()) { Changed = true; Cmp->replaceAllUsesWith(ConstantInt::getFalse(*Context)); Cmp->eraseFromParent(); break; } -#endif CallSite Ca = CallSite::get(Arg); Instruction* CI = Ca.getInstruction(); @@ -785,8 +785,8 @@ } -FunctionPass* createLowerConstantCallsPass(J3Intrinsics* M) { - return new LowerConstantCalls(M); +FunctionPass* createLowerConstantCallsPass(JavaLLVMCompiler* Compiler) { + return new LowerConstantCalls(Compiler); } } Modified: vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp?rev=101933&r1=101932&r2=101933&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp Tue Apr 20 14:32:41 2010 @@ -99,31 +99,6 @@ if (!YieldPtr) return false; - TerminatorInst* TI = Header->getTerminator(); - - // Insert the check after the entry block if the entry block does the - // loop exit. - if (BranchInst* BI = dyn_cast(TI)) { - if (BI->isConditional()) { - - BasicBlock* First = BI->getSuccessor(0); - BasicBlock* Second = BI->getSuccessor(1); - - bool containsFirst = L->contains(First); - bool containsSecond = L->contains(Second); - - if (!containsFirst) { - insertSafePoint(Second, SafeFunction, YieldPtr, L, LI); - return true; - } - - if (!containsSecond) { - insertSafePoint(First, SafeFunction, YieldPtr, L, LI); - return true; - } - } - } - insertSafePoint(Header, SafeFunction, YieldPtr, L, LI); return true; } From nicolas.geoffray at lip6.fr Sat Apr 24 13:35:27 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Apr 2010 20:35:27 -0000 Subject: [vmkit-commits] [vmkit] r102265 - /vmkit/trunk/lib/Mvm/Compiler/InlineMalloc.cpp Message-ID: <20100424203527.0CCF4312836B@llvm.org> Author: geoffray Date: Sat Apr 24 15:35:26 2010 New Revision: 102265 URL: http://llvm.org/viewvc/llvm-project?rev=102265&view=rev Log: Move ot new LLVM API. Modified: vmkit/trunk/lib/Mvm/Compiler/InlineMalloc.cpp Modified: vmkit/trunk/lib/Mvm/Compiler/InlineMalloc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/InlineMalloc.cpp?rev=102265&r1=102264&r2=102265&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/InlineMalloc.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/InlineMalloc.cpp Sat Apr 24 15:35:26 2010 @@ -55,7 +55,8 @@ Function* F = Call.getCalledFunction(); if (F == Malloc) { if (dyn_cast(Call.getArgument(0))) { - Changed |= InlineFunction(Call, 0, mvm::MvmModule::TheTargetData); + InlineFunctionInfo IFI(NULL, mvm::MvmModule::TheTargetData); + Changed |= InlineFunction(Call, IFI); break; } } From nicolas.geoffray at lip6.fr Sat Apr 24 13:36:11 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Apr 2010 20:36:11 -0000 Subject: [vmkit-commits] [vmkit] r102266 - in /vmkit/trunk: include/mvm/Allocator.h include/mvm/Threads/Locks.h lib/J3/Classpath/ClasspathField.inc lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/VMCore/JavaConstantPool.cpp lib/J3/VMCore/JavaMetaJIT.cpp lib/J3/VMCore/JavaObject.cpp lib/J3/VMCore/Jnjvm.cpp lib/Mvm/Compiler/JIT.cpp Message-ID: <20100424203611.41897312836B@llvm.org> Author: geoffray Date: Sat Apr 24 15:36:11 2010 New Revision: 102266 URL: http://llvm.org/viewvc/llvm-project?rev=102266&view=rev Log: Remove const warnings. Modified: vmkit/trunk/include/mvm/Allocator.h vmkit/trunk/include/mvm/Threads/Locks.h vmkit/trunk/lib/J3/Classpath/ClasspathField.inc vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaObject.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Modified: vmkit/trunk/include/mvm/Allocator.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Allocator.h?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Allocator.h (original) +++ vmkit/trunk/include/mvm/Allocator.h Sat Apr 24 15:36:11 2010 @@ -20,13 +20,6 @@ class VirtualTable; -#ifdef WITH_LLVM_GCC -extern "C" void __llvm_gcroot(const void**, void*) __attribute__((nothrow)); -#define llvm_gcroot(a, b) __llvm_gcroot((const void**)&a, b) -#else -#define llvm_gcroot(a, b) -#endif - #define declare_gcroot(type, name) type name; llvm_gcroot(name, 0); name namespace mvm { Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Sat Apr 24 15:36:11 2010 @@ -16,6 +16,13 @@ #include "mvm/Threads/Thread.h" +#ifdef WITH_LLVM_GCC +extern "C" void __llvm_gcroot(void**, void*) __attribute__((nothrow)); +#define llvm_gcroot(a, b) __llvm_gcroot((void**)&a, b) +#else +#define llvm_gcroot(a, b) +#endif + namespace mvm { extern "C" uint8 llvm_atomic_cmp_swap_i8(uint8* ptr, uint8 cmp, @@ -193,15 +200,6 @@ // Mask for the GC bits. static const uint64_t GCBitMask = 0x3; - - -#ifdef WITH_LLVM_GCC -extern "C" void __llvm_gcroot(const void**, void*) __attribute__((nothrow)); -#define llvm_gcroot(a, b) __llvm_gcroot((const void**)&a, b) -#else -#define llvm_gcroot(a, b) -#endif - class FatLockNoGC { public: static void gcroot(void* val, void* unused) Modified: vmkit/trunk/lib/J3/Classpath/ClasspathField.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathField.inc?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathField.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathField.inc Sat Apr 24 15:36:11 2010 @@ -92,7 +92,7 @@ } if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isInt()) res = (sint32)field->getInt32Field(stat ? StatPtr : obj); @@ -142,7 +142,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isInt()) res = (sint64)field->getInt32Field(stat ? StatPtr : obj); @@ -193,7 +193,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isBool()) res = (uint8)field->getInt8Field(stat ? StatPtr : obj); else @@ -235,7 +235,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isByte()) res = (jfloat)field->getInt8Field(stat ? StatPtr : obj); else if (prim->isInt()) @@ -287,7 +287,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isByte()) res = (sint8)field->getInt8Field(stat ? StatPtr : obj); else @@ -328,7 +328,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isChar()) res = (uint16)field->getInt16Field(stat ? StatPtr : obj); else @@ -371,7 +371,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isShort()) res = (sint16)field->getInt16Field(stat ? StatPtr : obj); else if (prim->isByte()) @@ -414,7 +414,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isByte()) res = (jdouble)(sint64)field->getInt8Field(stat ? StatPtr : obj); else if (prim->isInt()) @@ -469,7 +469,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isBool()) { uint8 val = field->getInt8Field(stat ? StatPtr : obj); res = vm->upcalls->boolClass->doNew(vm); @@ -551,7 +551,7 @@ if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isBool()) field->setInt8Field(stat ? StatPtr : obj, buf.z); else if (prim->isByte()) @@ -601,7 +601,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isBool()) field->setInt8Field(stat ? StatPtr : obj, (uint8)val); else @@ -640,7 +640,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isByte()) field->setInt8Field(stat ? StatPtr : obj, (sint8)val); else if (prim->isShort()) @@ -687,7 +687,7 @@ } const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isChar()) field->setInt16Field(stat ? StatPtr : obj, (uint16)val); else if (prim->isInt()) @@ -733,7 +733,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isShort()) field->setInt16Field(stat ? StatPtr : obj, (sint16)val); else if (prim->isInt()) @@ -779,7 +779,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isInt()) field->setInt32Field(stat ? StatPtr : obj, (sint32)val); else if (prim->isLong()) @@ -823,7 +823,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isLong()) field->setLongField(stat ? StatPtr : obj, (sint64)val); else if (prim->isFloat()) @@ -865,7 +865,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isFloat()) field->setFloatField(stat ? StatPtr : obj, (float)val); else if (prim->isDouble()) @@ -905,7 +905,7 @@ const Typedef* type = field->getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isDouble()) field->setDoubleField(stat ? StatPtr : obj, (double)val); else Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sat Apr 24 15:36:11 2010 @@ -394,7 +394,7 @@ void* obj = cl->getStaticInstance(); if (obj) { if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isBool() || prim->isByte()) { ConstantInt* CI = ConstantInt::get( Type::getInt8Ty(getLLVMContext()), @@ -672,7 +672,7 @@ JavaField& field = curCl->virtualFields[i]; const Typedef* type = field.getSignature(); if (type->isPrimitive()) { - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type; if (prim->isBool() || prim->isByte()) { ConstantInt* CI = ConstantInt::get(Type::getInt8Ty(getLLVMContext()), field.getInt8Field(obj)); Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Sat Apr 24 15:36:11 2010 @@ -219,7 +219,7 @@ JnjvmClassLoader* loader = classDef->classLoader; const UTF8* utf8 = loader->hashUTF8->lookupOrCreateReader(buf, n); - ctpRes[entry] = (UTF8*)utf8; + ctpRes[entry] = const_cast(utf8); PRINT_DEBUG(JNJVM_LOAD, 3, COLOR_NORMAL, "; [%5d] \t\t\"%s\"\n", entry, UTF8Buffer(utf8)->cString()); Modified: vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Sat Apr 24 15:36:11 2010 @@ -29,7 +29,7 @@ for (uint32 i = 0; i < signature->nbArguments; ++i) { \ const Typedef* type = arguments[i];\ if (type->isPrimitive()) {\ - const PrimitiveTypedef* prim = (PrimitiveTypedef*)type;\ + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)type;\ if (prim->isLong()) {\ buffer[i].j = va_arg(ap, sint64);\ } else if (prim->isInt()){ \ Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.cpp?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.cpp Sat Apr 24 15:36:11 2010 @@ -225,7 +225,7 @@ } else { UserCommonClass* cl = obj->getClass(); UserClassPrimitive* value = cl->toPrimitive(vm); - PrimitiveTypedef* prim = (PrimitiveTypedef*)signature; + const PrimitiveTypedef* prim = (const PrimitiveTypedef*)signature; if (value == 0) { vm->illegalArgumentException(""); Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sat Apr 24 15:36:11 2010 @@ -698,7 +698,7 @@ buf[i] = utf8->elements[i]; } - return hashStr.lookupOrCreate((const ArrayUInt16*&)tmp, this, + return hashStr.lookupOrCreate(const_cast(tmp), this, JavaString::stringDup); } Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=102266&r1=102265&r2=102266&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Sat Apr 24 15:36:11 2010 @@ -152,8 +152,8 @@ #endif // Disable branch fold for accurate line numbers. - char* commands[2] = { (char*)"vmkit", (char*)"-disable-branch-fold" }; - llvm::cl::ParseCommandLineOptions(2, commands); + const char* commands[2] = { "vmkit", "-disable-branch-fold" }; + llvm::cl::ParseCommandLineOptions(2, const_cast(commands)); if (!M) { globalModule = new Module("bootstrap module", *(new LLVMContext())); From nicolas.geoffray at lip6.fr Sun Apr 25 05:47:58 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Apr 2010 12:47:58 -0000 Subject: [vmkit-commits] [vmkit] r102304 - /vmkit/trunk/tools/llcj/llcj.cpp Message-ID: <20100425124758.9D041312836B@llvm.org> Author: geoffray Date: Sun Apr 25 07:47:58 2010 New Revision: 102304 URL: http://llvm.org/viewvc/llvm-project?rev=102304&view=rev Log: Remove warning. Modified: vmkit/trunk/tools/llcj/llcj.cpp Modified: vmkit/trunk/tools/llcj/llcj.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/llcj/llcj.cpp?rev=102304&r1=102303&r2=102304&view=diff ============================================================================== --- vmkit/trunk/tools/llcj/llcj.cpp (original) +++ vmkit/trunk/tools/llcj/llcj.cpp Sun Apr 25 07:47:58 2010 @@ -47,7 +47,7 @@ } else if (!strcmp(argv[i], "-O1") || !strcmp(argv[i], "-O2") || !strcmp(argv[i], "-O3")) { opt = argv[i]; - vmjcArgv[vmjcArgc++] = (char*)"-std-compile-opts"; + vmjcArgv[vmjcArgc++] = (const char*)"-std-compile-opts"; } else if (argv[i][0] == '-' && argv[i][1] == 'S') { runGCC = false; } else if (argv[i][0] == '-' && argv[i][1] == 'c') { From nicolas.geoffray at lip6.fr Sun Apr 25 05:51:46 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Apr 2010 12:51:46 -0000 Subject: [vmkit-commits] [vmkit] r102305 - in /vmkit/trunk: include/j3/JavaLLVMCompiler.h lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/Compiler/JavaLLVMCompiler.cpp Message-ID: <20100425125146.C8E1C312836B@llvm.org> Author: geoffray Date: Sun Apr 25 07:51:46 2010 New Revision: 102305 URL: http://llvm.org/viewvc/llvm-project?rev=102305&view=rev Log: Trust system classes in Java. Modified: vmkit/trunk/include/j3/JavaLLVMCompiler.h vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp Modified: vmkit/trunk/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaLLVMCompiler.h?rev=102305&r1=102304&r2=102305&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/trunk/include/j3/JavaLLVMCompiler.h Sun Apr 25 07:51:46 2010 @@ -49,7 +49,7 @@ llvm::DIFactory* DebugFactory; J3Intrinsics JavaIntrinsics; - void addJavaPasses(); + void addJavaPasses(bool trusted = false); private: bool enabledException; Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=102305&r1=102304&r2=102305&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sun Apr 25 07:51:46 2010 @@ -273,7 +273,11 @@ mvm::MvmModule::executionEngine->addModule(TheModule); mvm::MvmModule::protectEngine.unlock(); - addJavaPasses(); + + // The first JIT Compiler initialises JITListener and is trusted wrt. + // safe points. + bool trusted = (JITListener == NULL); + addJavaPasses(trusted); if (!JITListener) { JITListener = new JavaJITListener(); @@ -294,7 +298,7 @@ assert(VT && "No VT was allocated!"); if (VT->init) { - // The VT hash already been filled by the AOT compiler so there + // The VT has already been filled by the AOT compiler so there // is nothing left to do! return; } Modified: vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp?rev=102305&r1=102304&r2=102305&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaLLVMCompiler.cpp Sun Apr 25 07:51:46 2010 @@ -116,7 +116,7 @@ llvm::FunctionPass* createLowerConstantCallsPass(JavaLLVMCompiler* I); } -void JavaLLVMCompiler::addJavaPasses() { +void JavaLLVMCompiler::addJavaPasses(bool trusted) { JavaNativeFunctionPasses = new FunctionPassManager(TheModule); JavaNativeFunctionPasses->add(new TargetData(TheModule)); // Lower constant calls to lower things like getClass used @@ -124,7 +124,9 @@ JavaNativeFunctionPasses->add(createLowerConstantCallsPass(this)); JavaFunctionPasses = new FunctionPassManager(TheModule); - if (cooperativeGC) + // Add safe points in loops if we don't trust the code (trusted code doesn't + // do infinite loops). + if (cooperativeGC && !trusted) JavaFunctionPasses->add(mvm::createLoopSafePointsPass()); // Add other passes after the loop pass, because safepoints may move objects. // Moving objects disable many optimizations. From nicolas.geoffray at lip6.fr Sun Apr 25 09:32:02 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Apr 2010 16:32:02 -0000 Subject: [vmkit-commits] [vmkit] r102307 - in /vmkit/trunk/lib/J3/VMCore: JavaTypes.cpp JavaTypes.h Message-ID: <20100425163202.C65D0312836B@llvm.org> Author: geoffray Date: Sun Apr 25 11:32:02 2010 New Revision: 102307 URL: http://llvm.org/viewvc/llvm-project?rev=102307&view=rev Log: Array salso may load class with assocClass, so redefine findAssocClass. Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp vmkit/trunk/lib/J3/VMCore/JavaTypes.h Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp?rev=102307&r1=102306&r2=102307&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp Sun Apr 25 11:32:02 2010 @@ -28,6 +28,10 @@ return loader->lookupClassOrArray(pseudoAssocClassName); } +UserCommonClass* ArrayTypedef::findAssocClass(JnjvmClassLoader* loader) const { + return loader->lookupClassOrArray(keyName); +} + Signdef::Signdef(const UTF8* name, JnjvmClassLoader* loader, std::vector& args, Typedef* ret) { Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaTypes.h?rev=102307&r1=102306&r2=102307&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaTypes.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaTypes.h Sun Apr 25 11:32:02 2010 @@ -226,6 +226,7 @@ } virtual UserCommonClass* assocClass(JnjvmClassLoader* loader) const; + virtual UserCommonClass* findAssocClass(JnjvmClassLoader* loader) const; ArrayTypedef(const UTF8* name) { keyName = name; From nicolas.geoffray at lip6.fr Sun Apr 25 11:34:26 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Apr 2010 18:34:26 -0000 Subject: [vmkit-commits] [vmkit] r102308 - /vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Message-ID: <20100425183426.3636E312836B@llvm.org> Author: geoffray Date: Sun Apr 25 13:34:26 2010 New Revision: 102308 URL: http://llvm.org/viewvc/llvm-project?rev=102308&view=rev Log: Also look at super in lookupInterface. Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=102308&r1=102307&r2=102308&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sun Apr 25 13:34:26 2010 @@ -352,13 +352,16 @@ JavaMethod* Class::lookupInterfaceMethodDontThrow(const UTF8* name, const UTF8* type) { JavaMethod* cur = lookupMethodDontThrow(name, type, false, false, 0); - if (!cur) { + if (cur == NULL) { for (uint16 i = 0; i < nbInterfaces; ++i) { Class* I = interfaces[i]; cur = I->lookupInterfaceMethodDontThrow(name, type); if (cur) return cur; } } + if (cur == NULL && super != NULL) { + cur = super->lookupInterfaceMethodDontThrow(name, type); + } return cur; } From nicolas.geoffray at lip6.fr Thu Apr 29 00:23:34 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 29 Apr 2010 07:23:34 -0000 Subject: [vmkit-commits] [vmkit] r102609 - /vmkit/trunk/www/releases/index.html Message-ID: <20100429072334.E6FD7312800A@llvm.org> Author: geoffray Date: Thu Apr 29 02:23:34 2010 New Revision: 102609 URL: http://llvm.org/viewvc/llvm-project?rev=102609&view=rev Log: Add VMKit release 0.27. Modified: vmkit/trunk/www/releases/index.html Modified: vmkit/trunk/www/releases/index.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/releases/index.html?rev=102609&r1=102608&r2=102609&view=diff ============================================================================== --- vmkit/trunk/www/releases/index.html (original) +++ vmkit/trunk/www/releases/index.html Thu Apr 29 02:23:34 2010 @@ -27,6 +27,11 @@