From aishofpf at gmail.com Sun Jul 4 19:49:51 2010 From: aishofpf at gmail.com (Alysson) Date: Sun, 4 Jul 2010 23:49:51 -0300 Subject: [vmkit-commits] Problems to generate executable code Message-ID: Hi all, I´ve been working on a LLVM transformation pass which performs the remotion of some Java redundant instructions. So now it´s finished I´d like to run the optimized programs generated by mypass. But I´ve got some problems to do this, because I didn´t find a way to generate executable code from my output's pass. I'm using VMKit to compile java programs, and then I input the generated .bc code into my llvm pass. Here are what I'm doing: javac Example.java vmjc Example opt -load MyPass.so -myLLVMpass Example.bc -o output.bc Please, does anybody know how to generate executable code from an .bc file? Can VMKit do it? Thanks you all! Best regards, Alysson -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Mon Jul 5 09:04:54 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 05 Jul 2010 16:04:54 -0000 Subject: [vmkit-commits] [vmkit] r107619 - in /vmkit/trunk/lib/J3: Compiler/JavaJIT.cpp Compiler/JavaJIT.h Compiler/JavaJITCompiler.cpp Compiler/JavaJITOpcodes.cpp VMCore/Reader.h Message-ID: <20100705160454.A969E2A6C12C@llvm.org> Author: geoffray Date: Mon Jul 5 11:04:54 2010 New Revision: 107619 URL: http://llvm.org/viewvc/llvm-project?rev=107619&view=rev Log: Use a reader instead of accessing directly the Java bytes in the JIT. 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/Reader.h Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=107619&r1=107618&r2=107619&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Mon Jul 5 11:04:54 2010 @@ -95,19 +95,18 @@ const UTF8* name = 0; Signdef* signature = ctpInfo->infoOfInterfaceOrVirtualMethod(index, name); - - Value* obj = objectStack[stack.size() - signature->nbArguments - 1]; - JavaObject* source = TheCompiler->getFinalObject(obj); - if (source) { - canBeDirect = true; - CommonClass* sourceClass = JavaObject::getClass(source); - Class* lookup = sourceClass->isArray() ? sourceClass->super : - sourceClass->asClass(); - meth = lookup->lookupMethodDontThrow(name, signature->keyName, false, - true, 0); - } - + if (TheCompiler->isStaticCompiling()) { + Value* obj = objectStack[stack.size() - signature->nbArguments - 1]; + JavaObject* source = TheCompiler->getFinalObject(obj); + if (source) { + canBeDirect = true; + CommonClass* sourceClass = JavaObject::getClass(source); + Class* lookup = sourceClass->isArray() ? sourceClass->super : + sourceClass->asClass(); + meth = lookup->lookupMethodDontThrow(name, signature->keyName, false, + true, 0); + } CommonClass* unique = TheCompiler->getUniqueBaseClass(cl); if (unique) { canBeDirect = true; @@ -950,14 +949,15 @@ } } - // TODO: THIS IS UNSAFE! - exploreOpcodes(ArrayUInt8::getElements(compilingClass->bytes) + start, codeLen); + reader.cursor = start; + exploreOpcodes(reader, codeLen); if (returnType != Type::getVoidTy(*llvmContext)) { endNode = PHINode::Create(returnType, "", endBlock); } - compileOpcodes(ArrayUInt8::getElements(compilingClass->bytes) + start, codeLen); + reader.cursor = start; + compileOpcodes(reader, codeLen); PRINT_DEBUG(JNJVM_COMPILE, 1, COLOR_NORMAL, "--> end inline compiling %s.%s\n", @@ -1186,8 +1186,8 @@ } } - // TODO: THIS IS UNSAFE! - exploreOpcodes(ArrayUInt8::getElements(compilingClass->bytes) + start, codeLen); + reader.cursor = start; + exploreOpcodes(reader, codeLen); endBlock = createBasicBlock("end"); @@ -1243,8 +1243,8 @@ currentBlock = noStackOverflow; } - // TODO: THIS IS UNSAFE! - compileOpcodes(ArrayUInt8::getElements(compilingClass->bytes) + start, codeLen); + reader.cursor = start; + compileOpcodes(reader, codeLen); assert(stack.size() == 0 && "Stack not empty after compiling bytecode"); // Fix a javac(?) bug where a method only throws an exception and does Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=107619&r1=107618&r2=107619&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Mon Jul 5 11:04:54 2010 @@ -206,10 +206,10 @@ //===------------------------- Bytecode parsing ---------------------------===// /// compileOpcodes - Parse the bytecode and create LLVM instructions. - void compileOpcodes(uint8* bytecodes, uint32 codeLength); + void compileOpcodes(Reader& reader, uint32 codeLength); /// exploreOpcodes - Parse the bytecode and create the basic blocks. - void exploreOpcodes(uint8* bytecodes, uint32 codeLength); + void exploreOpcodes(Reader& reader, uint32 codeLength); /// readExceptionTable - Read the exception table in the bytecode. Prepare /// exception destination for all Java instructions and set the exception Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=107619&r1=107618&r2=107619&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Mon Jul 5 11:04:54 2010 @@ -163,10 +163,9 @@ } Constant* JavaJITCompiler::getString(JavaString* str) { - assert(str && "No string given"); - ConstantInt* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()), - uint64(str)); - return ConstantExpr::getIntToPtr(CI, JavaIntrinsics.JavaObjectType); + llvm_gcroot(str, 0); + fprintf(stderr, "Should not be here\n"); + abort(); } Constant* JavaJITCompiler::getStringPtr(JavaString** str) { @@ -196,18 +195,13 @@ } JavaObject* JavaJITCompiler::getFinalObject(llvm::Value* obj) { - if (ConstantExpr* CE = dyn_cast(obj)) { - if (ConstantInt* C = dyn_cast(CE->getOperand(0))) { - return (JavaObject*)C->getZExtValue(); - } - } - return 0; + // obj can not encode direclty an object. + return NULL; } Constant* JavaJITCompiler::getFinalObject(JavaObject* obj, CommonClass* cl) { - Constant* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()), - uint64(obj)); - return ConstantExpr::getIntToPtr(CI, JavaIntrinsics.JavaObjectType); + llvm_gcroot(obj, 0); + return NULL; } Constant* JavaJITCompiler::getStaticInstance(Class* classDef) { Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=107619&r1=107618&r2=107619&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Mon Jul 5 11:04:54 2010 @@ -32,6 +32,7 @@ #include "JavaThread.h" #include "JavaTypes.h" #include "Jnjvm.h" +#include "Reader.h" #include "j3/J3Intrinsics.h" @@ -68,49 +69,25 @@ } } -static inline sint8 readS1(uint8* bytecode, uint32& i) { - return ((sint8*)bytecode)[++i]; -} - -static inline uint8 readU1(uint8* bytecode, uint32& i) { - return bytecode[++i]; -} - -static inline sint16 readS2(uint8* bytecode, uint32& i) { - sint16 val = readS1(bytecode, i) << 8; - return val | readU1(bytecode, i); -} - -static inline uint16 readU2(uint8* bytecode, uint32& i) { - uint16 val = readU1(bytecode, i) << 8; - return val | readU1(bytecode, i); -} - -static inline sint32 readS4(uint8* bytecode, uint32& i) { - sint32 val = readU2(bytecode, i) << 16; - return val | readU2(bytecode, i); -} - - -static inline uint32 readU4(uint8* bytecode, uint32& i) { - return readS4(bytecode, i); -} - -static inline uint32 WREAD_U1(uint8* array, bool init, uint32 &i, bool& wide) { +static inline uint32 WREAD_U1(Reader& reader, bool init, uint32 &i, bool& wide) { if (wide) { - wide = init; - return readU2(array, i); + wide = init; + i += 2; + return reader.readU2(); } else { - return readU1(array, i); + i += 1; + return reader.readU1(); } } -static inline sint32 WREAD_S1(uint8* array, bool init, uint32 &i, bool &wide) { +static inline sint32 WREAD_S1(Reader& reader, bool init, uint32 &i, bool &wide) { if (wide) { wide = init; - return readS2(array, i); + i += 2; + return reader.readS2(); } else { - return readS1(array, i); + i += 1; + return reader.readS1(); } } @@ -123,15 +100,18 @@ } } -void JavaJIT::compileOpcodes(uint8* bytecodes, uint32 codeLength) { +void JavaJIT::compileOpcodes(Reader& reader, uint32 codeLength) { bool wide = false; uint32 jsrIndex = 0; + uint32 start = reader.cursor; for(uint32 i = 0; i < codeLength; ++i) { + reader.cursor = start + i; + uint8 bytecode = reader.readU1(); PRINT_DEBUG(JNJVM_COMPILE, 1, COLOR_NORMAL, "\t[at %5d] %-5d ", i, - bytecodes[i]); + bytecode); PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_BLUE, "compiling "); - PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_CYAN, OpcodeNames[bytecodes[i]]); + PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_CYAN, OpcodeNames[bytecode]); PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_BLUE, "\n"); Opinfo* opinfo = &(opcodeInfos[i]); @@ -173,7 +153,7 @@ currentCtpIndex = -1; currentBytecodeIndex = i; - currentBytecode = bytecodes[i]; + currentBytecode = bytecode; // To prevent a gcj bug with useless goto if (currentBlock->getTerminator() != 0) { @@ -183,7 +163,7 @@ #if JNJVM_EXECUTE > 1 { Value* args[3] = { - ConstantInt::get(Type::getInt32Ty(*llvmContext), (int64_t)bytecodes[i]), + ConstantInt::get(Type::getInt32Ty(*llvmContext), (int64_t)bytecode), ConstantInt::get(Type::getInt32Ty(*llvmContext), (int64_t)i), TheCompiler->getMethodInClass(compilingMethod) }; @@ -194,7 +174,7 @@ } #endif - switch (bytecodes[i]) { + switch (bytecode) { case NOP : break; @@ -264,53 +244,58 @@ case BIPUSH : push(ConstantExpr::getSExt(ConstantInt::get(Type::getInt8Ty(*llvmContext), - bytecodes[++i]), + reader.readU1()), Type::getInt32Ty(*llvmContext)), false); + i++; break; case SIPUSH : push(ConstantExpr::getSExt(ConstantInt::get(Type::getInt16Ty(*llvmContext), - readS2(bytecodes, i)), + reader.readS2()), Type::getInt32Ty(*llvmContext)), false); + i += 2; break; case LDC : - loadConstant(bytecodes[++i]); + loadConstant(reader.readU1()); + i++; break; case LDC_W : - loadConstant(readS2(bytecodes, i)); + loadConstant(reader.readS2()); + i += 2; break; case LDC2_W : - loadConstant(readS2(bytecodes, i)); + loadConstant(reader.readS2()); + i += 2; push(intrinsics->constantZero, false); break; case ILOAD : - push(new LoadInst(intLocals[WREAD_U1(bytecodes, false, i, wide)], "", + push(new LoadInst(intLocals[WREAD_U1(reader, false, i, wide)], "", currentBlock), false); break; case LLOAD : - push(new LoadInst(longLocals[WREAD_U1(bytecodes, false, i, wide)], "", + push(new LoadInst(longLocals[WREAD_U1(reader, false, i, wide)], "", currentBlock), false); push(intrinsics->constantZero, false); break; case FLOAD : - push(new LoadInst(floatLocals[WREAD_U1(bytecodes, false, i, wide)], "", + push(new LoadInst(floatLocals[WREAD_U1(reader, false, i, wide)], "", currentBlock), false); break; case DLOAD : - push(new LoadInst(doubleLocals[WREAD_U1(bytecodes, false, i, wide)], "", + push(new LoadInst(doubleLocals[WREAD_U1(reader, false, i, wide)], "", currentBlock), false); push(intrinsics->constantZero, false); break; case ALOAD : - push(new LoadInst(objectLocals[WREAD_U1(bytecodes, false, i, wide)], "", + push(new LoadInst(objectLocals[WREAD_U1(reader, false, i, wide)], "", currentBlock), false); break; @@ -503,32 +488,32 @@ case ISTORE : { Value* val = popAsInt(); - new StoreInst(val, intLocals[WREAD_U1(bytecodes, false, i, wide)], + new StoreInst(val, intLocals[WREAD_U1(reader, false, i, wide)], false, currentBlock); break; } case LSTORE : pop(); // remove the 0 on the stack - new StoreInst(pop(), longLocals[WREAD_U1(bytecodes, false, i, wide)], + new StoreInst(pop(), longLocals[WREAD_U1(reader, false, i, wide)], false, currentBlock); break; case FSTORE : - new StoreInst(pop(), floatLocals[WREAD_U1(bytecodes, false, i, wide)], + new StoreInst(pop(), floatLocals[WREAD_U1(reader, false, i, wide)], false, currentBlock); break; case DSTORE : pop(); // remove the 0 on the stack - new StoreInst(pop(), doubleLocals[WREAD_U1(bytecodes, false, i, wide)], + new StoreInst(pop(), doubleLocals[WREAD_U1(reader, false, i, wide)], false, currentBlock); break; case ASTORE : { CommonClass* cl = topTypeInfo(); Instruction* V = - new StoreInst(pop(), objectLocals[WREAD_U1(bytecodes, false, i, wide)], + new StoreInst(pop(), objectLocals[WREAD_U1(reader, false, i, wide)], false, currentBlock); addHighLevelType(V, cl); break; @@ -1294,8 +1279,8 @@ } case IINC : { - uint16 idx = WREAD_U1(bytecodes, true, i, wide); - sint16 val = WREAD_S1(bytecodes, false, i, wide); + uint16 idx = WREAD_U1(reader, true, i, wide); + sint16 val = WREAD_S1(reader, false, i, wide); llvm::Value* add = BinaryOperator::CreateAdd( new LoadInst(intLocals[idx], "", currentBlock), ConstantInt::get(Type::getInt32Ty(*llvmContext), val), "", @@ -1636,7 +1621,8 @@ case IFEQ : { uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; Value* op = pop(); @@ -1652,7 +1638,8 @@ case IFNE : { uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; Value* op = pop(); @@ -1668,7 +1655,8 @@ case IFLT : { uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; Value* op = pop(); const Type* type = op->getType(); @@ -1683,7 +1671,8 @@ case IFGE : { uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; Value* op = pop(); const Type* type = op->getType(); @@ -1698,7 +1687,8 @@ case IFGT : { uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; Value* op = pop(); const Type* type = op->getType(); @@ -1713,7 +1703,8 @@ case IFLE : { uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; Value* op = pop(); const Type* type = op->getType(); @@ -1730,7 +1721,8 @@ Value *val2 = popAsInt(); Value *val1 = popAsInt(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, val1, val2, ""); @@ -1744,7 +1736,8 @@ Value *val2 = popAsInt(); Value *val1 = popAsInt(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, val1, val2, ""); @@ -1758,7 +1751,8 @@ Value *val2 = popAsInt(); Value *val1 = popAsInt(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SLT, val1, val2, ""); @@ -1772,7 +1766,8 @@ Value *val2 = popAsInt(); Value *val1 = popAsInt(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SGE, val1, val2, ""); @@ -1786,7 +1781,8 @@ Value *val2 = popAsInt(); Value *val1 = popAsInt(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SGT, val1, val2, ""); @@ -1800,7 +1796,8 @@ Value *val2 = popAsInt(); Value *val1 = popAsInt(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SLE, val1, val2, ""); @@ -1814,7 +1811,8 @@ Value *val2 = pop(); Value *val1 = pop(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, val1, val2, ""); @@ -1828,7 +1826,8 @@ Value *val2 = pop(); Value *val1 = pop(); uint32 tmp = i; - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, val1, val2, ""); @@ -1840,8 +1839,9 @@ case GOTO : { uint32 tmp = i; - branch(opcodeInfos[tmp + readS2(bytecodes, i)], + branch(opcodeInfos[tmp + reader.readS2()], currentBlock); + i += 2; break; } @@ -1854,13 +1854,14 @@ uint64_t (index)), intrinsics->JavaObjectType); push(expr, false); - branch(opcodeInfos[tmp + readS2(bytecodes, i)], - currentBlock); + branch(opcodeInfos[tmp + reader.readS2()], currentBlock); + i += 2; break; } case RET : { - uint8 local = readU1(bytecodes, i); + uint8 local = reader.readU1(); + i += 1; Value* _val = new LoadInst(objectLocals[local], "", currentBlock); Value* val = new PtrToIntInst(_val, Type::getInt32Ty(*llvmContext), "", currentBlock); SwitchInst* inst = SwitchInst::Create(val, jsrs[0], jsrs.size(), @@ -1880,10 +1881,14 @@ uint32 reste = (i + 1) & 3; uint32 filled = reste ? (4 - reste) : 0; i += filled; - Opinfo& def = opcodeInfos[tmp + readU4(bytecodes, i)]; + reader.cursor += filled; + Opinfo& def = opcodeInfos[tmp + reader.readU4()]; + i += 4; - sint32 low = readS4(bytecodes, i); - sint32 high = readS4(bytecodes, i) + 1; + sint32 low = reader.readS4(); + i += 4; + sint32 high = reader.readS4() + 1; + i += 4; Value* index = pop(); @@ -1892,7 +1897,8 @@ Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, ConstantInt::get(type, cur), index, ""); BasicBlock* falseBlock = createBasicBlock("continue tableswitch"); - Opinfo& info = opcodeInfos[tmp + readU4(bytecodes, i)]; + Opinfo& info = opcodeInfos[tmp + reader.readU4()]; + i += 4; branch(cmp, info.newBlock, falseBlock, currentBlock, info); currentBlock = falseBlock; } @@ -1908,16 +1914,21 @@ uint32 tmp = i; uint32 filled = (3 - i) & 3; i += filled; - Opinfo& def = opcodeInfos[tmp + readU4(bytecodes, i)]; - uint32 nbs = readU4(bytecodes, i); + reader.cursor += filled; + Opinfo& def = opcodeInfos[tmp + reader.readU4()]; + i += 4; + uint32 nbs = reader.readU4(); + i += 4; Value* key = pop(); for (uint32 cur = 0; cur < nbs; ++cur) { - Value* val = ConstantInt::get(Type::getInt32Ty(*llvmContext), readU4(bytecodes, i)); + Value* val = ConstantInt::get(Type::getInt32Ty(*llvmContext), reader.readU4()); + i += 4; Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, val, key, ""); BasicBlock* falseBlock = createBasicBlock("continue lookupswitch"); - Opinfo& info = opcodeInfos[tmp + readU4(bytecodes, i)]; + Opinfo& info = opcodeInfos[tmp + reader.readU4()]; + i += 4; branch(cmp, info.newBlock, falseBlock, currentBlock, info); currentBlock = falseBlock; } @@ -1966,52 +1977,60 @@ } case GETSTATIC : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; getStaticField(index); break; } case PUTSTATIC : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; setStaticField(index); break; } case GETFIELD : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; getVirtualField(index); break; } case PUTFIELD : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; setVirtualField(index); break; } case INVOKEVIRTUAL : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; currentCtpIndex = index; invokeVirtual(index); break; } case INVOKESPECIAL : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; currentCtpIndex = index; invokeSpecial(index); break; } case INVOKESTATIC : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; currentCtpIndex = index; invokeStatic(index); break; } case INVOKEINTERFACE : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; currentCtpIndex = index; invokeInterface(index); i += 2; @@ -2019,7 +2038,8 @@ } case NEW : { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; invokeNew(index); break; } @@ -2032,8 +2052,9 @@ Value* valCl = 0; UserClassArray* dcl = 0; - if (bytecodes[i] == NEWARRAY) { - uint8 id = bytecodes[++i]; + if (bytecode == NEWARRAY) { + uint8 id = reader.readU1(); + i += 1; uint8 charId = arrayType(compilingMethod, id); #ifndef ISOLATE_SHARING JnjvmBootstrapLoader* loader = @@ -2059,7 +2080,8 @@ TheVT = TheCompiler->getVirtualTable(dcl->virtualVT); } } else { - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; CommonClass* cl = compilingClass->ctpInfo->getMethodClassIfLoaded(index); @@ -2163,17 +2185,19 @@ case CHECKCAST : if (!TheCompiler->hasExceptionsEnabled()) { i += 2; + reader.cursor += 2; break; } case INSTANCEOF : { - bool checkcast = (bytecodes[i] == CHECKCAST); + bool checkcast = (bytecode == CHECKCAST); BasicBlock* exceptionCheckcast = 0; BasicBlock* endCheckcast = 0; - uint16 index = readU2(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; UserCommonClass* cl = 0; Value* clVar = getResolvedCommonClass(index, true, &cl); Value* obj = top(); @@ -2273,8 +2297,10 @@ } case MULTIANEWARRAY : { - uint16 index = readU2(bytecodes, i); - uint8 dim = readU1(bytecodes, i); + uint16 index = reader.readU2(); + i += 2; + uint8 dim = reader.readU1(); + i += 1; UserCommonClass* dcl = 0; Value* valCl = getResolvedCommonClass(index, true, &dcl); @@ -2305,7 +2331,8 @@ llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, val, nil, ""); BasicBlock* ifFalse = createBasicBlock("true IFNULL"); - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; branch(test, ifTrue, ifFalse, currentBlock, ifTrueInfo); currentBlock = ifFalse; @@ -2319,7 +2346,8 @@ llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, val, nil, ""); BasicBlock* ifFalse = createBasicBlock("false IFNONNULL"); - Opinfo& ifTrueInfo = opcodeInfos[tmp + readS2(bytecodes, i)]; + Opinfo& ifTrueInfo = opcodeInfos[tmp + reader.readS2()]; + i += 2; BasicBlock* ifTrue = ifTrueInfo.newBlock; branch(test, ifTrue, ifFalse, currentBlock, ifTrueInfo); currentBlock = ifFalse; @@ -2328,7 +2356,7 @@ default : { fprintf(stderr, "I haven't verified your class file and it's malformed:" - " unknown bytecode %d in %s.%s\n!", bytecodes[i], + " unknown bytecode %d in %s.%s\n!", bytecode, UTF8Buffer(compilingClass->name).cString(), UTF8Buffer(compilingMethod->name).cString()); abort(); @@ -2337,17 +2365,19 @@ } } -void JavaJIT::exploreOpcodes(uint8* bytecodes, uint32 codeLength) { +void JavaJIT::exploreOpcodes(Reader& reader, uint32 codeLength) { bool wide = false; + uint32 start = reader.cursor; for(uint32 i = 0; i < codeLength; ++i) { - + reader.cursor = start + i; + uint8 bytecode = reader.readU1(); PRINT_DEBUG(JNJVM_COMPILE, 1, COLOR_NORMAL, "\t[at %5d] %-5d ", i, - bytecodes[i]); + bytecode); PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_BLUE, "exploring "); - PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_CYAN, OpcodeNames[bytecodes[i]]); + PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_CYAN, OpcodeNames[bytecode]); PRINT_DEBUG(JNJVM_COMPILE, 1, LIGHT_BLUE, "\n"); - switch (bytecodes[i]) { + switch (bytecode) { case NOP : case ACONST_NULL : @@ -2535,7 +2565,8 @@ case IF_ACMPNE : case GOTO : { uint32 tmp = i; - uint16 index = tmp + readU2(bytecodes, i); + uint16 index = tmp + reader.readU2(); + i += 2; if (!(opcodeInfos[index].newBlock)) opcodeInfos[index].newBlock = createBasicBlock("GOTO or IF*"); break; @@ -2543,7 +2574,8 @@ case JSR : { uint32 tmp = i; - uint16 index = tmp + readU2(bytecodes, i); + uint16 index = tmp + reader.readU2(); + i += 2; if (!(opcodeInfos[index].newBlock)) { BasicBlock* block = createBasicBlock("JSR"); opcodeInfos[index].newBlock = block; @@ -2565,16 +2597,21 @@ uint32 reste = (i + 1) & 3; uint32 filled = reste ? (4 - reste) : 0; i += filled; - uint32 index = tmp + readU4(bytecodes, i); + reader.cursor += filled; + uint32 index = tmp + reader.readU4(); + i += 4; if (!(opcodeInfos[index].newBlock)) { BasicBlock* block = createBasicBlock("tableswitch"); opcodeInfos[index].newBlock = block; } - uint32 low = readU4(bytecodes, i); - uint32 high = readU4(bytecodes, i) + 1; + uint32 low = reader.readU4(); + i += 4; + uint32 high = reader.readU4() + 1; + i += 4; uint32 depl = high - low; for (uint32 cur = 0; cur < depl; ++cur) { - uint32 index2 = tmp + readU4(bytecodes, i); + uint32 index2 = tmp + reader.readU4(); + i += 4; if (!(opcodeInfos[index2].newBlock)) { BasicBlock* block = createBasicBlock("tableswitch"); opcodeInfos[index2].newBlock = block; @@ -2588,15 +2625,20 @@ uint32 tmp = i; uint32 filled = (3 - i) & 3; i += filled; - uint32 index = tmp + readU4(bytecodes, i); + reader.cursor += filled; + uint32 index = tmp + reader.readU4(); + i += 4; if (!(opcodeInfos[index].newBlock)) { BasicBlock* block = createBasicBlock("tableswitch"); opcodeInfos[index].newBlock = block; } - uint32 nbs = readU4(bytecodes, i); + uint32 nbs = reader.readU4(); + i += 4; for (uint32 cur = 0; cur < nbs; ++cur) { i += 4; - uint32 index2 = tmp + readU4(bytecodes, i); + reader.cursor += 4; + uint32 index2 = tmp + reader.readU4(); + i += 4; if (!(opcodeInfos[index2].newBlock)) { BasicBlock* block = createBasicBlock("tableswitch"); opcodeInfos[index2].newBlock = block; @@ -2668,7 +2710,8 @@ case IFNULL : case IFNONNULL : { uint32 tmp = i; - uint16 index = tmp + readU2(bytecodes, i); + uint16 index = tmp + reader.readU2(); + i += 2; if (!(opcodeInfos[index].newBlock)) opcodeInfos[index].newBlock = createBasicBlock("true IF*NULL"); break; @@ -2677,7 +2720,7 @@ default : { fprintf(stderr, "I haven't verified your class file and it's malformed:" - " unknown bytecode %d in %s.%s!\n", bytecodes[i], + " unknown bytecode %d in %s.%s!\n", bytecode, UTF8Buffer(compilingClass->name).cString(), UTF8Buffer(compilingMethod->name).cString()); abort(); Modified: vmkit/trunk/lib/J3/VMCore/Reader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Reader.h?rev=107619&r1=107618&r2=107619&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Reader.h (original) +++ vmkit/trunk/lib/J3/VMCore/Reader.h Mon Jul 5 11:04:54 2010 @@ -99,7 +99,7 @@ sint16 readS2() { sint16 tmp = ((sint16)(readS1())) << 8; - return tmp | ((sint16)(readS1())); + return tmp | ((sint16)(readU1())); } uint32 readU4() { @@ -109,7 +109,7 @@ sint32 readS4() { sint32 tmp = ((sint32)(readS2())) << 16; - return tmp | ((sint32)(readS2())); + return tmp | ((sint32)(readU2())); } uint64 readU8() { @@ -118,8 +118,8 @@ } sint64 readS8() { - sint64 tmp = ((sint64)(readS8())) << 32; - return tmp | ((sint64)(readS8())); + sint64 tmp = ((sint64)(readS4())) << 32; + return tmp | ((sint64)(readU4())); } Reader(ArrayUInt8** array, uint32 start = 0, uint32 end = 0) { From nicolas.geoffray at gmail.com Mon Jul 5 15:24:06 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Mon, 5 Jul 2010 15:24:06 -0700 Subject: [vmkit-commits] Problems to generate executable code In-Reply-To: References: Message-ID: Hi Alysson, Did you consider applying your pass to the JIT? You can add a pass by running the command: ./vmkit -std-compile-opts -load MyPass.so -myLLVMPass -java Hello If you want to create an executable, you can use the llcj tool, that works just like gcj: llcj -std-compile-opts --main Hello Hello.class Note though that you will need to create the libvmjc.so file. Please follow the instructions here: http://vmkit.llvm.org/use_aot.html Nicolas On Sun, Jul 4, 2010 at 7:49 PM, Alysson wrote: > Hi all, > I´ve been working on a LLVM transformation pass which performs the remotion > of some Java redundant instructions. > So now it´s finished I´d like to run the optimized programs generated by > mypass. > But I´ve got some problems to do this, because I didn´t find a way to > generate executable code from my output's pass. > I'm using VMKit to compile java programs, and then I input the generated > .bc code into my llvm pass. > > Here are what I'm doing: > javac Example.java > vmjc Example > opt -load MyPass.so -myLLVMpass Example.bc -o output.bc > > Please, does anybody know how to generate executable code from an .bc file? > Can VMKit do it? > > Thanks you all! > Best regards, > Alysson > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Mon Jul 5 22:59:04 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Jul 2010 05:59:04 -0000 Subject: [vmkit-commits] [vmkit] r107643 - in /vmkit/trunk/lib/J3/Classpath: Classpath.inc ClasspathConstructor.inc ClasspathField.inc ClasspathMethod.inc ClasspathReflect.h ClasspathVMClass.inc ClasspathVMClassLoader.inc ClasspathVMStackWalker.inc ClasspathVMThread.inc ClasspathVMThrowable.inc JavaUpcalls.cpp Message-ID: <20100706055904.BAD682A6C12C@llvm.org> Author: geoffray Date: Tue Jul 6 00:59:04 2010 New Revision: 107643 URL: http://llvm.org/viewvc/llvm-project?rev=107643&view=rev Log: Added some missing llvm_gcroot. Also fixed a latent bug when initializaing the vmdata of the initial thread. Modified: vmkit/trunk/lib/J3/Classpath/Classpath.inc vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc vmkit/trunk/lib/J3/Classpath/ClasspathField.inc vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Modified: vmkit/trunk/lib/J3/Classpath/Classpath.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/Classpath.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/Classpath.inc (original) +++ vmkit/trunk/lib/J3/Classpath/Classpath.inc Tue Jul 6 00:59:04 2010 @@ -27,21 +27,21 @@ JNIEnv *env, jclass clazz, #endif -jclass Cl) { +JavaObject* Cl) { + llvm_gcroot(Cl, 0); bool res = false; BEGIN_NATIVE_EXCEPTION(0) verifyNull(Cl); Jnjvm* vm = JavaThread::get()->getJVM(); - UserCommonClass* cl = - UserCommonClass::resolvedImplClass(vm, (JavaObject*)Cl, true); + UserCommonClass* cl = UserCommonClass::resolvedImplClass(vm, Cl, true); if (cl->isClass() && cl->asClass()->lookupMethodDontThrow(vm->bootstrapLoader->clinitName, vm->bootstrapLoader->clinitType, true, false, 0)) - res = true; + res = true; END_NATIVE_EXCEPTION @@ -226,6 +226,7 @@ llvm_gcroot(res, 0); llvm_gcroot(target, 0); llvm_gcroot(constr, 0); + llvm_gcroot(cons, 0); BEGIN_NATIVE_EXCEPTION(0) Modified: vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc Tue Jul 6 00:59:04 2010 @@ -96,7 +96,7 @@ if (isAbstract(cl->access)) vm->instantiationException(cl); // Allocate a buffer to store the arguments. - jvalue* buf = size ? (jvalue*)alloca(size * sizeof(jvalue)) : 0; + jvalue* buf = size ? new jvalue[size] : NULL; if (size) memset(buf, 0, size * sizeof(jvalue)); if (nbArgs == size) { @@ -123,6 +123,7 @@ excp = th->getJavaException(); } END_CATCH; if (excp) { + if (size) delete[] buf; if (JavaObject::getClass(excp)->isAssignableFrom(vm->upcalls->newException)) { th->clearException(); // If it's an exception, we encapsule it in an @@ -135,12 +136,17 @@ return NULL; } } else { + if (size) delete[] buf; vm->illegalArgumentException("class is not a regular class"); + return NULL; } } else { + if (size) delete[] buf; vm->illegalArgumentException("wrong number of arguments"); + return NULL; } + if (size) delete[] buf; return res; } @@ -159,7 +165,6 @@ BEGIN_NATIVE_EXCEPTION(0) - // Proceed in another function because we are using alloca. res = proceedConstructor(cons, args, Clazz, index); END_NATIVE_EXCEPTION Modified: vmkit/trunk/lib/J3/Classpath/ClasspathField.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathField.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathField.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathField.inc Tue Jul 6 00:59:04 2010 @@ -573,44 +573,37 @@ field->getInstanceInt8Field(obj); res = vm->upcalls->boolClass->doNew(vm); vm->upcalls->boolValue->setInstanceInt8Field(res, val); - } - else if (prim->isByte()) { + } else if (prim->isByte()) { sint8 val = stat ? field->getStaticInt8Field() : field->getInstanceInt8Field(obj); res = vm->upcalls->byteClass->doNew(vm); vm->upcalls->byteValue->setInstanceInt8Field(res, val); - } - else if (prim->isChar()) { + } else if (prim->isChar()) { uint16 val = stat ? field->getStaticInt16Field() : field->getInstanceInt16Field(obj); res = vm->upcalls->charClass->doNew(vm); vm->upcalls->charValue->setInstanceInt16Field(res, val); - } - else if (prim->isShort()) { + } else if (prim->isShort()) { sint16 val = stat ? field->getStaticInt16Field() : field->getInstanceInt16Field(obj); res = vm->upcalls->shortClass->doNew(vm); vm->upcalls->shortValue->setInstanceInt16Field(res, val); - } - else if (prim->isInt()) { + } else if (prim->isInt()) { sint64 val = stat ? field->getStaticInt32Field() : field->getInstanceInt32Field(obj); res = vm->upcalls->intClass->doNew(vm); vm->upcalls->intValue->setInstanceInt32Field(res, val); - } - else if (prim->isLong()) { + } else if (prim->isLong()) { sint64 val = stat ? field->getStaticLongField() : field->getInstanceLongField(obj); res = vm->upcalls->longClass->doNew(vm); vm->upcalls->longValue->setInstanceLongField(res, val); - } - else if (prim->isFloat()) { + } else if (prim->isFloat()) { float val = stat ? field->getStaticFloatField() : field->getInstanceFloatField(obj); res = vm->upcalls->floatClass->doNew(vm); vm->upcalls->floatValue->setInstanceFloatField(res, val); - } - else if (prim->isDouble()) { + } else if (prim->isDouble()) { double val = stat ? field->getStaticDoubleField() : field->getInstanceDoubleField(obj); res = vm->upcalls->doubleClass->doNew(vm); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc Tue Jul 6 00:59:04 2010 @@ -83,7 +83,7 @@ JavaMethod* meth = JavaObjectMethod::getInternalMethod(Meth); JnjvmClassLoader* loader = cl->classLoader; - res = (meth->getParameterTypes(loader)); + res = meth->getParameterTypes(loader); END_NATIVE_EXCEPTION @@ -115,7 +115,7 @@ Signdef* sign = meth->getSignature(); sint32 size = sign->nbArguments; - jvalue* buf = size ? (jvalue*)alloca(size * sizeof(jvalue)) : 0; + jvalue* buf = size ? new jvalue[size] : 0; if (size) memset(buf, 0, size * sizeof(jvalue)); if (nbArgs == size) { @@ -167,6 +167,7 @@ exc = th->getJavaException(); \ } END_CATCH; \ if (exc) { \ + if (size) delete[] buf; \ if (JavaObject::getClass(exc)->isAssignableFrom( \ vm->upcalls->newException)) { \ th->clearException(); \ @@ -229,10 +230,12 @@ RUN_METH(JavaObject, res); } } else { + if (size) delete[] buf; vm->illegalArgumentException("wrong number of arguments"); return NULL; } + if (size) delete[] buf; return res; } @@ -253,7 +256,6 @@ BEGIN_NATIVE_EXCEPTION(0) - // Create a new function because we use alloca. res = proceedMethod(Meth, obj, args, Cl, index); END_NATIVE_EXCEPTION Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h Tue Jul 6 00:59:04 2010 @@ -158,8 +158,10 @@ mvm::Collector::markAndTrace(obj, &obj->thread, closure); } - void setVmdata(JavaThread* internal_thread) { - vmdata = internal_thread; + static void setVmdata(JavaObjectVMThread* vmthread, + JavaThread* internal_thread) { + llvm_gcroot(vmthread, 0); + vmthread->vmdata = internal_thread; } }; Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMClass.inc Tue Jul 6 00:59:04 2010 @@ -58,7 +58,7 @@ BEGIN_NATIVE_EXCEPTION(0) verifyNull(str); - Jnjvm* vm = JavaThread::get()->getJVM(); + Jnjvm* vm = JavaThread::get()->getJVM(); JnjvmClassLoader* JCL = JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loader, vm); UserCommonClass* cl = JCL->loadClassFromJavaString(str, true, false); @@ -67,7 +67,7 @@ if (clinit && cl->asClass()) { cl->asClass()->initialiseClass(vm); } - res =cl->getClassDelegatee(vm); + res = cl->getClassDelegatee(vm); } else { vm->classNotFoundException(str); } @@ -535,7 +535,6 @@ #endif JavaObject* Cl, bool publicOnly) { - ArrayObject* result = 0; llvm_gcroot(result, 0); llvm_gcroot(Cl, 0); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMClassLoader.inc Tue Jul 6 00:59:04 2010 @@ -120,10 +120,13 @@ JavaObject* pd) { JavaObject* res = 0; + JavaObject* excp = 0; llvm_gcroot(loader, 0); llvm_gcroot(str, 0); llvm_gcroot(bytes, 0); llvm_gcroot(pd, 0); + llvm_gcroot(res, 0); + llvm_gcroot(excp, 0); BEGIN_NATIVE_EXCEPTION(0) @@ -148,8 +151,8 @@ res = cl->getClassDelegatee(vm, pd); } else { - JavaObject* obj = vm->CreateLinkageError("duplicate class definition"); - JavaThread::get()->throwException(obj); + excp = vm->CreateLinkageError("duplicate class definition"); + JavaThread::get()->throwException(excp); } END_NATIVE_EXCEPTION Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc Tue Jul 6 00:59:04 2010 @@ -39,21 +39,22 @@ Jnjvm* vm = th->getJVM(); uint32 length = th->getFrameContextLength(); - void** buffer = (void**)alloca(length * sizeof(void*)); + uintptr_t* buffer = new uintptr_t[length]; - uint32 finalSize = th->getJavaFrameContext(buffer); + uint32 finalSize = th->getJavaFrameContext((void**)buffer); result = (ArrayObject*) vm->upcalls->stackTraceArray->doNew(finalSize, vm); for (uint32 i = 0; i != finalSize; ++i) { - JavaMethod* meth = (JavaMethod*)buffer[i]; + JavaMethod* meth = ((JavaMethod**)buffer)[i]; assert(meth && "Wrong stack trace"); ArrayObject::setElement(result, meth->classDef->getClassDelegatee(vm), i); } + delete[] buffer; END_NATIVE_EXCEPTION - + return result; } Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMThread.inc Tue Jul 6 00:59:04 2010 @@ -45,7 +45,7 @@ // which is the JavaThread object. vmThread = (JavaObjectVMThread*)thread->vmThread; assert(vmThread && "Didn't fix the vmThread of a j3 thread"); - vmThread->setVmdata(thread); + JavaObjectVMThread::setVmdata(vmThread, thread); UserClass* vmthClass = (UserClass*)JavaObject::getClass(vmThread); @@ -188,9 +188,10 @@ #ifdef NATIVE_JNI JNIEnv *env, #endif -JavaObject* vmthread, jobject exc) { +JavaObject* vmthread, JavaObject* exc) { // Currently not implemented llvm_gcroot(vmthread, 0); + llvm_gcroot(exc, 0); } // Never throws. Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMThrowable.inc Tue Jul 6 00:59:04 2010 @@ -28,22 +28,34 @@ JavaObject* internalFillInStackTrace(JavaObject* throwable) { JavaObject* vmThrowable = 0; + ArrayPtr* result = 0; llvm_gcroot(throwable, 0); llvm_gcroot(vmThrowable, 0); + llvm_gcroot(result, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); uint32 length = th->getFrameContextLength(); - ClassArray* cl = sizeof(void*) == 4 ? vm->upcalls->ArrayOfInt : - vm->upcalls->ArrayOfLong; - JavaObject* result = (JavaObject*) cl->doNew(length, vm); - void** tab = (void**)JavaArray::getElements(result); - - // Get the frame context. - th->getFrameContext(tab); + if (sizeof(void*) == 4) { + ClassArray* cl = vm->upcalls->ArrayOfInt; + result = (ArrayPtr*) cl->doNew(length, vm); + } else { + ClassArray* cl = vm->upcalls->ArrayOfLong; + result = (ArrayPtr*) cl->doNew(length, vm); + } + // Don't call th->getFrameContext because it is not GC-safe. + mvm::StackWalker Walker(th); + uint32_t i = 0; + + while (void* ip = *Walker) { + ArrayPtr::setElement(result, ip, i); + ++i; + ++Walker; + } + // Set the tempory data in the new VMThrowable object. vmThrowable = vm->upcalls->newVMThrowable->doNew(vm); vm->upcalls->vmDataVMThrowable->setInstanceObjectField(vmThrowable, result); Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=107643&r1=107642&r2=107643&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Tue Jul 6 00:59:04 2010 @@ -229,16 +229,17 @@ void Classpath::CreateJavaThread(Jnjvm* vm, JavaThread* myth, const char* thName, JavaObject* Group) { - JavaObject* vmth = NULL; + JavaObjectVMThread* vmth = NULL; JavaObject* th = NULL; JavaObject* name = NULL; llvm_gcroot(Group, 0); llvm_gcroot(vmth, 0); llvm_gcroot(th, 0); + llvm_gcroot(name, 0); th = newThread->doNew(vm); myth->javaThread = th; - vmth = newVMThread->doNew(vm); + vmth = (JavaObjectVMThread*)newVMThread->doNew(vm); name = vm->asciizToStr(thName); threadName->setInstanceObjectField(th, name); @@ -247,7 +248,7 @@ vmThread->setInstanceObjectField(th, vmth); assocThread->setInstanceObjectField(vmth, th); running->setInstanceInt8Field(vmth, (uint32)1); - ((JavaObjectVMThread*)vmdataVMThread)->setVmdata(myth); + JavaObjectVMThread::setVmdata(vmth, myth); group->setInstanceObjectField(th, Group); groupAddThread->invokeIntSpecial(vm, threadGroup, Group, &th); @@ -422,7 +423,7 @@ extern "C" JavaObject* nativeGetCallingClassLoader() { - JavaObject *res = 0; + JavaObject* res = 0; llvm_gcroot(res, 0); BEGIN_NATIVE_EXCEPTION(0) @@ -437,7 +438,7 @@ } extern "C" JavaObject* nativeFirstNonNullClassLoader() { - JavaObject *res = 0; + JavaObject* res = 0; llvm_gcroot(res, 0); BEGIN_NATIVE_EXCEPTION(0) @@ -452,7 +453,7 @@ extern "C" JavaObject* nativeGetCallerClass(uint32 index) { - JavaObject *res = 0; + JavaObject* res = 0; llvm_gcroot(res, 0); BEGIN_NATIVE_EXCEPTION(0) From nicolas.geoffray at lip6.fr Mon Jul 5 23:35:41 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Jul 2010 06:35:41 -0000 Subject: [vmkit-commits] [vmkit] r107644 - in /vmkit/trunk/lib/J3: Compiler/JavaJIT.cpp VMCore/JavaClass.cpp Message-ID: <20100706063541.4AE082A6C12C@llvm.org> Author: geoffray Date: Tue Jul 6 01:35:41 2010 New Revision: 107644 URL: http://llvm.org/viewvc/llvm-project?rev=107644&view=rev Log: Makre sure to initialize codeInfo. Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=107644&r1=107643&r2=107644&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Tue Jul 6 01:35:41 2010 @@ -530,6 +530,8 @@ compilingMethod->codeInfo[i].bytecodeIndex = codeInfo[i].bytecodeIndex; compilingMethod->codeInfo[i].bytecode = codeInfo[i].bytecode; } + } else { + compilingMethod->codeInfo == NULL; } return llvmFunction; @@ -1365,6 +1367,8 @@ compilingMethod->codeInfo[i].bytecodeIndex = codeInfo[i].bytecodeIndex; compilingMethod->codeInfo[i].bytecode = codeInfo[i].bytecode; } + } else { + compilingMethod->codeInfo == NULL; } return llvmFunction; Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=107644&r1=107643&r2=107644&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Tue Jul 6 01:35:41 2010 @@ -669,6 +669,7 @@ access = A; canBeInlined = false; offset = 0; + codeInfo = NULL; } void JavaField::initialise(Class* cl, const UTF8* N, const UTF8* T, uint16 A) { @@ -865,8 +866,10 @@ uint16 nbMethods = reader.readU2(); if (isAbstract(access)) { virtualMethods = new JavaMethod[nbMethods]; + memset(virtualMethods, 0, nbMethods * sizeof(JavaMethod)); } else { - virtualMethods = new(classLoader->allocator, "Methods") JavaMethod[nbMethods]; + virtualMethods = + new(classLoader->allocator, "Methods") JavaMethod[nbMethods]; } staticMethods = virtualMethods + nbMethods; for (int i = 0; i < nbMethods; i++) { From minas.subs at gmail.com Wed Jul 7 05:09:20 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Wed, 7 Jul 2010 17:09:20 +0500 Subject: [vmkit-commits] Error building VMkit: it tries to access private method of LLVM Message-ID: Hello, I just tried to build VMkit, as it written on getting_started, all steps went OK (except for broken link for treecc for pnet, which I found on GNU-savannah, by googling) But now the very strange error: in vmkit/lib/Mvm/Compiler/EscapeAnalysis.cpp, line 99: <<> llvm[3]: Compiling EscapeAnalysis.cpp for Debug build /home/mn/tests/VMkit/llvm/include/llvm/Instructions.h: In member function ‘virtual bool::EscapeAnalysis::runOnFunction(llvm::Function&)’: /home/mn/tests/VMkit/llvm/include/llvm/Instructions.h:1128: error: ‘llvm::Value* llvm::CallInst::getOperand(unsigned int) const’ is private EscapeAnalysis.cpp:99: error: within this context /home/mn/tests/VMkit/llvm/include/llvm/Instructions.h:1128: error: ‘llvm::Value* llvm::CallInst::getOperand(unsigned int) const’ is private EscapeAnalysis.cpp:99: error: within this context make[3]: *** [/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler/Debug/EscapeAnalysis.o] Error 1 make[3]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler' make[2]: *** [all] Error 1 <<...>> Excerpt from EscapeAnalysis.cpp: <<< if (CallInst *CI = dyn_cast(I)) { Changed |= processMalloc(CI, CI->getOperand(1), CI->getOperand(2), CurLoop); } else if (InvokeInst *CI = dyn_cast(I)) { Changed |= processMalloc(CI, CI->getOperand(3), CI->getOperand(4), CurLoop); } >>> These getOperand()-s are private, how it should now be built and work? Has anybody built it? -Minas Abrahamyan -------------- next part -------------- An HTML attachment was scrubbed... URL: From minas.subs at gmail.com Wed Jul 7 06:06:11 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Wed, 7 Jul 2010 18:06:11 +0500 Subject: [vmkit-commits] Investigated: changes in LLVM-2.8 Re: Error building VMkit: Message-ID: I've made some investigation on it and found the cause: Exceprt from Instructions.h: <<< CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const Twine &NameStr, Instruction *InsertBefore) :<<...>> // Note: if you get compile errors about private methods then // please update your code to use the high-level operand // interfaces. See line 943 above. ===line 943: /// @brief coerce out-of-tree code to abandon the low-level interfaces /// @detail see below comments and update your code to high-level interfaces /// in LLVM v2.8-only code /// - getOperand(N+1) ---> getArgOperand(N) /// - setOperand(N+1, V) ---> setArgOperand(N, V) /// - getNumOperands() ---> getNumArgOperands()+1 // note the "+1"! /// /// in backward compatible code please consult llvm/Support/CallSite.h, /// you should create a callsite using the CallInst pointer and call its /// methods /// >>> So, it seems, that it is a LLVM-2.8 new change in xxxOperand() functions Now what I could easily do, to get latest buildable VMkit instance?? Look at this: [ vmkit]$ find . -name "*.cpp" -o -name "*.h"|xargs grep -R -E "\<[gs]etOperand\>|\"|wc -l 13 13 places, not so bad. But after changing it will require for build only newest LLVM-2.8, and all current users will be required to upgrade their llvm Are users ready for changes? -Minas Abrahamyan On Wed, Jul 7, 2010 at 5:09 PM, Minas Abrahamyan wrote: > > Excerpt from EscapeAnalysis.cpp: > <<< > if (CallInst *CI = dyn_cast(I)) { > Changed |= processMalloc(CI, CI->getOperand(1), > CI->getOperand(2), > CurLoop); > } else if (InvokeInst *CI = dyn_cast(I)) { > Changed |= processMalloc(CI, CI->getOperand(3), > CI->getOperand(4), > CurLoop); > } > >>> > > These getOperand()-s are private, how it should now be built and work? > > -Minas Abrahamyan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Wed Jul 7 15:16:20 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 07 Jul 2010 22:16:20 -0000 Subject: [vmkit-commits] [vmkit] r107821 - /vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp Message-ID: <20100707221620.58B2C2A6C12C@llvm.org> Author: geoffray Date: Wed Jul 7 17:16:20 2010 New Revision: 107821 URL: http://llvm.org/viewvc/llvm-project?rev=107821&view=rev Log: Move to new LLVM API. Modified: vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp Modified: vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp?rev=107821&r1=107820&r2=107821&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp Wed Jul 7 17:16:20 2010 @@ -96,10 +96,10 @@ } if (CallInst *CI = dyn_cast(I)) { - Changed |= processMalloc(CI, CI->getOperand(1), CI->getOperand(2), + Changed |= processMalloc(CI, CI->getArgOperand(0), CI->getArgOperand(1), CurLoop); } else if (InvokeInst *CI = dyn_cast(I)) { - Changed |= processMalloc(CI, CI->getOperand(3), CI->getOperand(4), + Changed |= processMalloc(CI, CI->getArgOperand(0), CI->getArgOperand(1), CurLoop); } } From nicolas.geoffray at gmail.com Wed Jul 7 15:17:54 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Wed, 7 Jul 2010 15:17:54 -0700 Subject: [vmkit-commits] Error building VMkit: it tries to access private method of LLVM In-Reply-To: References: Message-ID: Hi Minas, N3 is not highly maintained anymore, so you shouldn't care about treecc. I have updated the EscapeAnalysis file, it should now build fine with the new LLVM API. Cheers, Nicolas On Wed, Jul 7, 2010 at 5:09 AM, Minas Abrahamyan wrote: > Hello, > > I just tried to build VMkit, as it written on getting_started, all steps > went OK > (except for broken link for treecc for pnet, which I found on GNU-savannah, > by googling) > > But now the very strange error: > in vmkit/lib/Mvm/Compiler/EscapeAnalysis.cpp, line 99: > > <<> > llvm[3]: Compiling EscapeAnalysis.cpp for Debug build > /home/mn/tests/VMkit/llvm/include/llvm/Instructions.h: In member function > ‘virtual bool::EscapeAnalysis::runOnFunction(llvm::Function&)’: > /home/mn/tests/VMkit/llvm/include/llvm/Instructions.h:1128: error: > ‘llvm::Value* llvm::CallInst::getOperand(unsigned int) const’ is private > EscapeAnalysis.cpp:99: error: within this context > /home/mn/tests/VMkit/llvm/include/llvm/Instructions.h:1128: error: > ‘llvm::Value* llvm::CallInst::getOperand(unsigned int) const’ is private > EscapeAnalysis.cpp:99: error: within this context > make[3]: *** > [/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler/Debug/EscapeAnalysis.o] Error 1 > make[3]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler' > make[2]: *** [all] Error 1 > <<...>> > > Excerpt from EscapeAnalysis.cpp: > <<< > if (CallInst *CI = dyn_cast(I)) { > Changed |= processMalloc(CI, CI->getOperand(1), > CI->getOperand(2), > CurLoop); > } else if (InvokeInst *CI = dyn_cast(I)) { > Changed |= processMalloc(CI, CI->getOperand(3), > CI->getOperand(4), > CurLoop); > } > >>> > > These getOperand()-s are private, how it should now be built and work? > > Has anybody built it? > > -Minas Abrahamyan > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Wed Jul 7 22:58:04 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Jul 2010 05:58:04 -0000 Subject: [vmkit-commits] [vmkit] r107855 - in /vmkit/trunk/lib/J3/VMCore: JavaClass.cpp JavaClass.h JavaConstantPool.h JavaLocks.cpp JavaMetaJIT.cpp JavaObject.cpp JavaRuntimeJIT.cpp JavaString.cpp Jni.cpp VirtualTables.cpp Message-ID: <20100708055804.E69DA2A6C12C@llvm.org> Author: geoffray Date: Thu Jul 8 00:58:04 2010 New Revision: 107855 URL: http://llvm.org/viewvc/llvm-project?rev=107855&view=rev Log: Continue fixing some llvm_gcroot, and fix a bug in the LockSystem. Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.h vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaObject.cpp vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaString.cpp vmkit/trunk/lib/J3/VMCore/Jni.cpp vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Thu Jul 8 00:58:04 2010 @@ -219,6 +219,7 @@ Class::Class(JnjvmClassLoader* loader, const UTF8* n, ArrayUInt8* B) : CommonClass(loader, n) { + llvm_gcroot(B, 0); virtualVT = 0; bytes = B; super = 0; @@ -254,13 +255,13 @@ } JavaObject* UserClassArray::doNew(sint32 n, Jnjvm* vm) { + JavaObject* res = NULL; + llvm_gcroot(res, 0); if (n < 0) { vm->negativeArraySizeException(n); } else if (n > JavaArray::MaxArraySize) { vm->outOfMemoryError(); } - JavaObject* res = NULL; - llvm_gcroot(res, 0); UserCommonClass* cl = baseClass(); uint32 logSize = cl->isPrimitive() ? cl->asPrimitiveClass()->logSize : (sizeof(JavaObject*) == 8 ? 3 : 2); @@ -471,7 +472,7 @@ } JavaObject* UserClass::doNew(Jnjvm* vm) { - JavaObject* res = 0; + JavaObject* res = NULL; llvm_gcroot(res, 0); assert(this && "No class when allocating."); assert((this->isInitializing() || @@ -1075,8 +1076,10 @@ ArrayObject* JavaMethod::getParameterTypes(JnjvmClassLoader* loader) { - ArrayObject* res = 0; + ArrayObject* res = NULL; + JavaObject* delegatee = NULL; llvm_gcroot(res, 0); + llvm_gcroot(delegatee, 0); Jnjvm* vm = JavaThread::get()->getJVM(); Signdef* sign = getSignature(); @@ -1084,7 +1087,8 @@ res = (ArrayObject*)vm->upcalls->classArrayClass->doNew(sign->nbArguments,vm); for (uint32 index = 0; index < sign->nbArguments; ++index) { - ArrayObject::setElement(res, getClassType(vm, loader, arguments[index]), index); + delegatee = getClassType(vm, loader, arguments[index]); + ArrayObject::setElement(res, delegatee, index); } return res; @@ -1099,8 +1103,10 @@ ArrayObject* JavaMethod::getExceptionTypes(JnjvmClassLoader* loader) { - ArrayObject* res = 0; + ArrayObject* res = NULL; + JavaObject* delegatee = NULL; llvm_gcroot(res, 0); + llvm_gcroot(delegatee, 0); Attribut* exceptionAtt = lookupAttribut(Attribut::exceptionsAttribut); Jnjvm* vm = JavaThread::get()->getJVM(); @@ -1117,7 +1123,8 @@ UserCommonClass* cl = ctp->loadClass(idx); assert(cl->asClass() && "Wrong exception type"); cl->asClass()->resolveClass(); - ArrayObject::setElement(res, cl->getClassDelegatee(vm), i); + delegatee = cl->getClassDelegatee(vm); + ArrayObject::setElement(res, delegatee, i); } return res; } Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.h?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.h Thu Jul 8 00:58:04 2010 @@ -1284,7 +1284,7 @@ /// void initialise(Class* cl, const UTF8* name, const UTF8* type, uint16 access); - /// ~JavaField - Destroy the field as well as its attributs. + /// ~JavaField - Destroy the field as well as its attributes. /// ~JavaField(); Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.h Thu Jul 8 00:58:04 2010 @@ -50,7 +50,7 @@ sint32* ctpDef; /// ctpRes - Objects resolved dynamically, e.g. UTF8s, classes, methods, - /// fields, strings. + /// fields, string pointers. /// void** ctpRes; Modified: vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp Thu Jul 8 00:58:04 2010 @@ -48,9 +48,10 @@ JavaLock** tab = LockTable[index >> BitIndex]; - if (tab == NULL) - tab = (JavaLock**)associatedVM->allocator.Allocate(IndexSize, - "Index LockTable"); + if (tab == NULL) { + tab = (JavaLock**)associatedVM->allocator.Allocate( + IndexSize * sizeof(JavaLock*), "Index LockTable"); + } threadLock.unlock(); // Allocate the lock. @@ -68,9 +69,9 @@ LockSystem::LockSystem(Jnjvm* vm) { associatedVM = vm; LockTable = (JavaLock* **) - vm->allocator.Allocate(GlobalSize, "Global LockTable"); + vm->allocator.Allocate(GlobalSize * sizeof(JavaLock**), "Global LockTable"); LockTable[0] = (JavaLock**) - vm->allocator.Allocate(IndexSize, "Index LockTable"); + vm->allocator.Allocate(IndexSize * sizeof(JavaLock*), "Index LockTable"); currentIndex = 0; } Modified: vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Thu Jul 8 00:58:04 2010 @@ -230,7 +230,6 @@ llvm_gcroot(obj, 0); \ va_list ap;\ va_start(ap, obj);\ - llvm_gcroot(obj, 0); \ TYPE res = invoke##TYPE_NAME##VirtualAP(vm, cl, obj, ap);\ va_end(ap); \ return res; \ Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.cpp Thu Jul 8 00:58:04 2010 @@ -24,8 +24,8 @@ void JavaObject::waitIntern( JavaObject* self, struct timeval* info, bool timed) { - JavaLock* l = 0; llvm_gcroot(self, 0); + JavaLock* l = 0; if (owner(self)) { l = self->lock.changeToFatlock(self); @@ -135,8 +135,8 @@ } void JavaObject::notify(JavaObject* self) { - JavaLock* l = 0; llvm_gcroot(self, 0); + JavaLock* l = 0; if (owner(self)) { l = self->lock.getFatLock(); @@ -179,8 +179,8 @@ } void JavaObject::notifyAll(JavaObject* self) { - JavaLock* l = 0; llvm_gcroot(self, 0); + JavaLock* l = 0; if (owner(self)) { l = self->lock.getFatLock(); Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Thu Jul 8 00:58:04 2010 @@ -257,9 +257,11 @@ assert(len > 0 && "Negative size given by VMKit"); JavaObject* _res = cl->doNew(dims[0], vm); - ArrayObject* res = 0; + ArrayObject* res = NULL; + JavaObject* temp = NULL; llvm_gcroot(_res, 0); llvm_gcroot(res, 0); + llvm_gcroot(temp, 0); if (len > 1) { res = (ArrayObject*)_res; @@ -268,8 +270,8 @@ UserClassArray* base = (UserClassArray*)_base; if (dims[0] > 0) { for (sint32 i = 0; i < dims[0]; ++i) { - ArrayObject::setElement( - res, multiCallNewIntern(base, (len - 1), &dims[1], vm), i); + temp = multiCallNewIntern(base, (len - 1), &dims[1], vm); + ArrayObject::setElement(res, temp, i); } } else { for (uint32 i = 1; i < len; ++i) { Modified: vmkit/trunk/lib/J3/VMCore/JavaString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaString.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaString.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaString.cpp Thu Jul 8 00:58:04 2010 @@ -36,7 +36,7 @@ // No need to call the Java function: both the Java function and // this function do the same thing. - setValue(res, array); + JavaString::setValue(res, array); res->count = ArrayUInt16::getSize(array); res->offset = 0; res->cachedHashCode = 0; @@ -44,39 +44,48 @@ } char* JavaString::strToAsciiz(JavaString* self) { + const ArrayUInt16* value = NULL; llvm_gcroot(self, 0); + llvm_gcroot(value, 0); + value = JavaString::getValue(self); char* buf = new char[self->count + 1]; for (sint32 i = 0; i < self->count; ++i) { - buf[i] = ArrayUInt16::getElement(getValue(self), i + self->offset); + buf[i] = ArrayUInt16::getElement(value, i + self->offset); } buf[self->count] = 0; return buf; } const ArrayUInt16* JavaString::strToArray(JavaString* self, Jnjvm* vm) { - ArrayUInt16* array = 0; + ArrayUInt16* array = NULL; + const ArrayUInt16* value = NULL; llvm_gcroot(self, 0); llvm_gcroot(array, 0); + llvm_gcroot(value, 0); + value = JavaString::getValue(self); assert(getValue(self) && "String without an array?"); if (self->offset || (self->count != ArrayUInt16::getSize(getValue(self)))) { array = (ArrayUInt16*)vm->upcalls->ArrayOfChar->doNew(self->count, vm); for (sint32 i = 0; i < self->count; i++) { ArrayUInt16::setElement( - array, ArrayUInt16::getElement(getValue(self), i + self->offset), i); + array, ArrayUInt16::getElement(value, i + self->offset), i); } return array; } else { - return getValue(self); + return value; } } void JavaString::stringDestructor(JavaString* str) { + const ArrayUInt16* value = NULL; llvm_gcroot(str, 0); + llvm_gcroot(value, 0); + value = JavaString::getValue(str); Jnjvm* vm = JavaThread::get()->getJVM(); assert(vm && "No vm when destroying a string"); - if (getValue(str) != NULL) vm->hashStr.removeUnlocked(getValue(str), str); + if (value != NULL) vm->hashStr.removeUnlocked(value, str); } JavaString* JavaString::internalToJava(const UTF8* name, Jnjvm* vm) { @@ -99,12 +108,15 @@ } const UTF8* JavaString::javaToInternal(const JavaString* self, UTF8Map* map) { + const ArrayUInt16* value = NULL; llvm_gcroot(self, 0); + llvm_gcroot(value, 0); + value = JavaString::getValue(self); uint16* java = new uint16[self->count]; for (sint32 i = 0; i < self->count; ++i) { - uint16 cur = ArrayUInt16::getElement(getValue(self), self->offset + i); + uint16 cur = ArrayUInt16::getElement(value, self->offset + i); if (cur == '.') java[i] = '/'; else java[i] = cur; } Modified: vmkit/trunk/lib/J3/VMCore/Jni.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jni.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jni.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jni.cpp Thu Jul 8 00:58:04 2010 @@ -2488,10 +2488,12 @@ BEGIN_JNI_EXCEPTION + JavaObject* obj = NULL; + llvm_gcroot(obj, 0); + JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* obj = vm->asciizToStr(bytes); - llvm_gcroot(obj, 0); + obj = vm->asciizToStr(bytes); jstring ret = (jstring)th->pushJNIRef(obj); RETURN_FROM_JNI(ret); @@ -2643,10 +2645,12 @@ BEGIN_JNI_EXCEPTION + JavaObject* res = NULL; + llvm_gcroot(res, 0); + JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfBool->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfBool->doNew(len, vm); jbooleanArray ret = (jbooleanArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2659,11 +2663,13 @@ jbyteArray NewByteArray(JNIEnv *env, jsize len) { BEGIN_JNI_EXCEPTION + + JavaObject* res = NULL; + llvm_gcroot(res, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfByte->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfByte->doNew(len, vm); jbyteArray ret = (jbyteArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2675,11 +2681,13 @@ jcharArray NewCharArray(JNIEnv *env, jsize len) { BEGIN_JNI_EXCEPTION + + JavaObject* res = NULL; + llvm_gcroot(res, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfChar->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfChar->doNew(len, vm); jcharArray ret = (jcharArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2691,11 +2699,13 @@ jshortArray NewShortArray(JNIEnv *env, jsize len) { BEGIN_JNI_EXCEPTION + + JavaObject* res = NULL; + llvm_gcroot(res, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfShort->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfShort->doNew(len, vm); jshortArray ret = (jshortArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2707,11 +2717,13 @@ jintArray NewIntArray(JNIEnv *env, jsize len) { BEGIN_JNI_EXCEPTION + + JavaObject* res = NULL; + llvm_gcroot(res, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfInt->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfInt->doNew(len, vm); jintArray ret = (jintArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2723,11 +2735,13 @@ jlongArray NewLongArray(JNIEnv *env, jsize len) { BEGIN_JNI_EXCEPTION + + JavaObject* res = NULL; + llvm_gcroot(res, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfLong->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfLong->doNew(len, vm); jlongArray ret = (jlongArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2739,11 +2753,13 @@ jfloatArray NewFloatArray(JNIEnv *env, jsize len) { BEGIN_JNI_EXCEPTION + + JavaObject* res = NULL; + llvm_gcroot(res, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfFloat->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfFloat->doNew(len, vm); jfloatArray ret = (jfloatArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2755,11 +2771,13 @@ jdoubleArray NewDoubleArray(JNIEnv *env, jsize len) { BEGIN_JNI_EXCEPTION + + JavaObject* res = NULL; + llvm_gcroot(res, 0); JavaThread* th = JavaThread::get(); Jnjvm* vm = th->getJVM(); - JavaObject* res = vm->upcalls->ArrayOfDouble->doNew(len, vm); - llvm_gcroot(res, 0); + res = vm->upcalls->ArrayOfDouble->doNew(len, vm); jdoubleArray ret = (jdoubleArray)th->pushJNIRef(res); RETURN_FROM_JNI(ret); @@ -2945,12 +2963,12 @@ BEGIN_JNI_EXCEPTION + ArrayUInt8* array = *(ArrayUInt8**)_array; + llvm_gcroot(array, 0); + if (mode == JNI_ABORT) { free(elems); } else { - ArrayUInt8* array = *(ArrayUInt8**)_array; - llvm_gcroot(array, 0); - sint32 len = ArrayUInt8::getSize(array); memcpy(ArrayUInt8::getElements(array), elems, len); @@ -2967,13 +2985,13 @@ jint mode) { BEGIN_JNI_EXCEPTION + + ArraySInt16* array = *(ArraySInt16**)_array; + llvm_gcroot(array, 0); if (mode == JNI_ABORT) { free(elems); } else { - ArraySInt16* array = *(ArraySInt16**)_array; - llvm_gcroot(array, 0); - sint32 len = ArraySInt16::getSize(array); memcpy(ArraySInt16::getElements(array), elems, len); @@ -2990,13 +3008,13 @@ jint mode) { BEGIN_JNI_EXCEPTION - + + ArrayUInt16* array = *(ArrayUInt16**)_array; + llvm_gcroot(array, 0); + if (mode == JNI_ABORT) { free(elems); } else { - ArrayUInt16* array = *(ArrayUInt16**)_array; - llvm_gcroot(array, 0); - sint32 len = ArrayUInt16::getSize(array) << 1; memcpy(ArrayUInt16::getElements(array), elems, len); @@ -3013,13 +3031,13 @@ jint mode) { BEGIN_JNI_EXCEPTION + + ArraySInt16* array = *(ArraySInt16**)_array; + llvm_gcroot(array, 0); if (mode == JNI_ABORT) { free(elems); } else { - ArraySInt16* array = *(ArraySInt16**)_array; - llvm_gcroot(array, 0); - sint32 len = ArraySInt16::getSize(array) << 1; memcpy(ArraySInt16::getElements(array), elems, len); @@ -3036,13 +3054,13 @@ jint mode) { BEGIN_JNI_EXCEPTION + + ArraySInt32* array = *(ArraySInt32**)_array; + llvm_gcroot(array, 0); if (mode == JNI_ABORT) { free(elems); } else { - ArraySInt32* array = *(ArraySInt32**)_array; - llvm_gcroot(array, 0); - sint32 len = ArraySInt32::getSize(array) << 2; memcpy(ArraySInt32::getElements(array), elems, len); @@ -3059,13 +3077,13 @@ jint mode) { BEGIN_JNI_EXCEPTION + + ArrayLong* array = *(ArrayLong**)_array; + llvm_gcroot(array, 0); if (mode == JNI_ABORT) { free(elems); } else { - ArrayLong* array = *(ArrayLong**)_array; - llvm_gcroot(array, 0); - sint32 len = ArrayLong::getSize(array) << 3; memcpy(ArrayLong::getElements(array), elems, len); @@ -3081,13 +3099,13 @@ void ReleaseFloatArrayElements(JNIEnv *env, jfloatArray _array, jfloat *elems, jint mode) { BEGIN_JNI_EXCEPTION + + ArrayFloat* array = *(ArrayFloat**)_array; + llvm_gcroot(array, 0); if (mode == JNI_ABORT) { free(elems); } else { - ArrayFloat* array = *(ArrayFloat**)_array; - llvm_gcroot(array, 0); - sint32 len = ArrayFloat::getSize(array) << 2; memcpy(ArrayFloat::getElements(array), elems, len); @@ -3104,13 +3122,13 @@ jdouble *elems, jint mode) { BEGIN_JNI_EXCEPTION + + ArrayDouble* array = *(ArrayDouble**)_array; + llvm_gcroot(array, 0); if (mode == JNI_ABORT) { free(elems); } else { - ArrayDouble* array = *(ArrayDouble**)_array; - llvm_gcroot(array, 0); - sint32 len = ArrayDouble::getSize(array) << 3; memcpy(ArrayDouble::getElements(array), elems, len); @@ -3470,12 +3488,12 @@ BEGIN_JNI_EXCEPTION + JavaObject* array = *(JavaObject**)_array; + llvm_gcroot(array, 0); + if (mode == JNI_ABORT) { free(carray); } else { - JavaObject* array = *(JavaObject**)_array; - llvm_gcroot(array, 0); - UserClassArray* cl = JavaObject::getClass(array)->asArrayClass(); uint32 logSize = cl->baseClass()->asPrimitiveClass()->logSize; sint32 len = JavaArray::getSize(array) << logSize; @@ -3519,10 +3537,13 @@ jobject NewGlobalRef(JNIEnv* env, jobject obj) { BEGIN_JNI_EXCEPTION + + JavaObject* Obj = NULL; + llvm_gcroot(Obj, 0); // Local object references. if (obj) { - JavaObject* Obj = *(JavaObject**)obj; + Obj = *(JavaObject**)obj; llvm_gcroot(Obj, 0); Jnjvm* vm = JavaThread::get()->getJVM(); Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=107855&r1=107854&r2=107855&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Thu Jul 8 00:58:04 2010 @@ -285,14 +285,22 @@ mvm::Collector::markAndTraceRoot(key, closure); } - for (uint32 i = 0; i < LockSystem::GlobalSize; i++) { + uint32 i = 0; + for (; i < LockSystem::GlobalSize; i++) { JavaLock** array = lockSystem.LockTable[i]; if (array == NULL) break; - for (uint32 j = 0; j < LockSystem::IndexSize; j++) { + uint32 j = 0; + for (; j < LockSystem::IndexSize; j++) { if (array[j] == NULL) break; JavaLock* lock = array[j]; mvm::Collector::markAndTraceRoot(lock->getAssociatedObjectPtr(), closure); } + for (j = j + 1; j < LockSystem::IndexSize; j++) { + assert(array[j] == NULL); + } + } + for (i = i + 1; i < LockSystem::GlobalSize; i++) { + assert(lockSystem.LockTable[i] == NULL); } #if defined(ISOLATE_SHARING) mvm::Collector::markAndTraceRoot(&JnjvmSharedLoader::sharedLoader, closure); From nicolas.geoffray at lip6.fr Thu Jul 8 00:12:59 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Jul 2010 07:12:59 -0000 Subject: [vmkit-commits] [vmkit] r107859 - in /vmkit/trunk/lib/J3: Compiler/JavaAOTCompiler.cpp VMCore/Jnjvm.cpp VMCore/JnjvmClassLoader.cpp VMCore/JnjvmClassLoader.h VMCore/VirtualTables.cpp VMCore/Zip.cpp VMCore/Zip.h Message-ID: <20100708071259.B326C2A6C12C@llvm.org> Author: geoffray Date: Thu Jul 8 02:12:59 2010 New Revision: 107859 URL: http://llvm.org/viewvc/llvm-project?rev=107859&view=rev Log: ZipArchive should have direct access to the bytes, as they are alive throughout the lifetime of the applications. Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp vmkit/trunk/lib/J3/VMCore/Zip.cpp vmkit/trunk/lib/J3/VMCore/Zip.h Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=107859&r1=107858&r2=107859&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Thu Jul 8 02:12:59 2010 @@ -1885,7 +1885,7 @@ JavaAOTCompiler* M, JnjvmBootstrapLoader* bootstrapLoader, std::vector& classes) { - ZipArchive archive(&bytes, bootstrapLoader->allocator); + ZipArchive archive(bytes, bootstrapLoader->allocator); char* realName = (char*)alloca(4096); for (ZipArchive::table_iterator i = archive.filetable.begin(), Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=107859&r1=107858&r2=107859&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Thu Jul 8 02:12:59 2010 @@ -865,13 +865,17 @@ return; } - ZipArchive archive(&bytes, vm->allocator); - if (archive.getOfscd() != -1) { - ZipFile* file = archive.getFile(PATH_MANIFEST); + mvm::BumpPtrAllocator allocator; + ZipArchive* archive = new(allocator, "TempZipArchive") + ZipArchive(bytes, allocator); + // Make sure it gets GC'd. + vm->bootstrapLoader->bootArchives.push_back(archive); + if (archive->getOfscd() != -1) { + ZipFile* file = archive->getFile(PATH_MANIFEST); if (file != NULL) { UserClassArray* array = vm->bootstrapLoader->upcalls->ArrayOfByte; res = (ArrayUInt8*)array->doNew(file->ucsize, vm); - int ok = archive.readFile(res, file); + int ok = archive->readFile(res, file); if (ok) { char* mainClass = findInformation(vm, res, MAIN_CLASS, LENGTH_MAIN_CLASS); @@ -893,6 +897,8 @@ } else { printf("Can't find archive %s\n", jarFile); } + // We don't need this archive anymore. + vm->bootstrapLoader->bootArchives.pop_back(); } void ClArgumentsInfo::nyi() { Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=107859&r1=107858&r2=107859&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Thu Jul 8 02:12:59 2010 @@ -343,7 +343,6 @@ ZipArchive* archive = *i; char* buf = (char*)alloca(alen + 7); sprintf(buf, "%s.class", asciiz); - // This array is not allocated by the GC. res = Reader::openZip(this, archive, buf); if (res) return res; } @@ -936,6 +935,8 @@ } void JnjvmBootstrapLoader::analyseClasspathEnv(const char* str) { + ArrayUInt8* bytes = NULL; + llvm_gcroot(bytes, 0); if (str != 0) { unsigned int len = strlen(str); char* buf = new char[len + 1]; @@ -963,10 +964,10 @@ temp[len + 1] = 0; bootClasspath.push_back(temp); } else { - ArrayUInt8* bytes = Reader::openFile(this, rp); + bytes = Reader::openFile(this, rp); if (bytes) { ZipArchive *archive = new(allocator, "ZipArchive") - ZipArchive(&bytes, allocator); + ZipArchive(bytes, allocator); if (archive) { bootArchives.push_back(archive); } Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=107859&r1=107858&r2=107859&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Thu Jul 8 02:12:59 2010 @@ -419,6 +419,8 @@ } virtual ~JnjvmBootstrapLoader(); + + friend class ClArgumentsInfo; }; /// VMClassLoader - The vmdata object that will be placed in and will only Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=107859&r1=107858&r2=107859&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Thu Jul 8 02:12:59 2010 @@ -240,7 +240,7 @@ for (std::vector::iterator i = bootArchives.begin(), e = bootArchives.end(); i != e; i++) { - mvm::Collector::markAndTraceRoot((*i)->bytes, closure); + mvm::Collector::markAndTraceRoot(&((*i)->bytes), closure); } } Modified: vmkit/trunk/lib/J3/VMCore/Zip.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Zip.cpp?rev=107859&r1=107858&r2=107859&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Zip.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Zip.cpp Thu Jul 8 02:12:59 2010 @@ -17,7 +17,8 @@ using namespace j3; -ZipArchive::ZipArchive(ArrayUInt8** bytes, mvm::BumpPtrAllocator& A) : allocator(A) { +ZipArchive::ZipArchive(ArrayUInt8* bytes, mvm::BumpPtrAllocator& A) : allocator(A) { + llvm_gcroot(bytes, 0); this->bytes = bytes; findOfscd(); if (ofscd > -1) addFiles(); @@ -73,7 +74,7 @@ sint32 minOffs = 0; sint32 st = END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4; - Reader reader(bytes); + Reader reader(&bytes); curOffs = reader.max; if (curOffs >= (65535 + END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4)) { minOffs = curOffs - (65535 + END_CENTRAL_DIRECTORY_FILE_HEADER_SIZE + 4); @@ -103,8 +104,8 @@ if (searchPos >= st) { sint32 searchPtr = temp + (searchPos - st); while (searchPtr > temp) { - if (ArrayUInt8::getElement(*(reader.bytes), searchPtr) == 'P' && - !(memcmp(ArrayUInt8::getElements(*(reader.bytes)) + searchPtr, HDR_ENDCENTRAL, 4))) { + if (ArrayUInt8::getElement(bytes, searchPtr) == 'P' && + !(memcmp(ArrayUInt8::getElements(bytes) + searchPtr, HDR_ENDCENTRAL, 4))) { sint32 offset = searchPtr + 4 + E_OFFSET_START_CENTRAL_DIRECTORY; reader.cursor = offset; this->ofscd = readEndianDep4(reader); @@ -119,11 +120,11 @@ void ZipArchive::addFiles() { sint32 temp = ofscd; - Reader reader(bytes); + Reader reader(&bytes); reader.cursor = temp; while (true) { - if (memcmp(ArrayUInt8::getElements(*(reader.bytes)) + temp, HDR_CENTRAL, 4)) return; + if (memcmp(ArrayUInt8::getElements(bytes) + temp, HDR_CENTRAL, 4)) return; ZipFile* ptr = new(allocator, "ZipFile") ZipFile(); reader.cursor = temp + 4 + C_COMPRESSION_METHOD; ptr->compressionMethod = readEndianDep2(reader); @@ -147,7 +148,7 @@ ptr->filename = (char*)allocator.Allocate(ptr->filenameLength + 1, "Zip file name"); - memcpy(ptr->filename, ArrayUInt8::getElements(*(reader.bytes)) + temp, + memcpy(ptr->filename, ArrayUInt8::getElements(bytes) + temp, ptr->filenameLength); ptr->filename[ptr->filenameLength] = 0; @@ -167,10 +168,10 @@ uint32 extraFieldLength = 0; uint32 temp = 0; - Reader reader(bytes); + Reader reader(&bytes); reader.cursor = file->rolh; - if (!(memcmp(ArrayUInt8::getElements(*(reader.bytes)) + file->rolh, HDR_LOCAL, 4))) { + if (!(memcmp(ArrayUInt8::getElements(bytes) + file->rolh, HDR_LOCAL, 4))) { reader.cursor += 4; temp = reader.cursor; reader.cursor += L_FILENAME_LENGTH; @@ -181,7 +182,7 @@ temp + extraFieldLength + filenameLength + LOCAL_FILE_HEADER_SIZE; if (file->compressionMethod == ZIP_STORE) { - memcpy(ArrayUInt8::getElements(array), ArrayUInt8::getElements(*(reader.bytes)) + reader.cursor, file->ucsize); + memcpy(ArrayUInt8::getElements(array), ArrayUInt8::getElements(bytes) + reader.cursor, file->ucsize); return 1; } else if (file->compressionMethod == ZIP_DEFLATE) { z_stream stre; @@ -201,7 +202,7 @@ while (bytesLeft) { uint32 size = 0; - stre.next_in = ArrayUInt8::getElements(*(reader.bytes)) + reader.cursor; + stre.next_in = ArrayUInt8::getElements(bytes) + reader.cursor; if (bytesLeft > 1024) size = 1024; else size = bytesLeft; Modified: vmkit/trunk/lib/J3/VMCore/Zip.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Zip.h?rev=107859&r1=107858&r2=107859&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Zip.h (original) +++ vmkit/trunk/lib/J3/VMCore/Zip.h Thu Jul 8 02:12:59 2010 @@ -49,7 +49,7 @@ public: std::map filetable; typedef std::map::iterator table_iterator; - ArrayUInt8** bytes; + ArrayUInt8* bytes; private: @@ -70,7 +70,7 @@ } int getOfscd() { return ofscd; } - ZipArchive(ArrayUInt8** bytes, mvm::BumpPtrAllocator& allocator); + ZipArchive(ArrayUInt8* bytes, mvm::BumpPtrAllocator& allocator); ZipFile* getFile(const char* filename); int readFile(ArrayUInt8* array, const ZipFile* file); From minas.subs at gmail.com Thu Jul 8 02:56:39 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Thu, 8 Jul 2010 14:56:39 +0500 Subject: [vmkit-commits] Error building VMkit: it tries to access private method of LLVM In-Reply-To: References: Message-ID: Hi Nicolas, Whether N3 is not in high support, or it is abandoned now and shouldn't be built? Trying to build VMkit now stumbles on undefined TRACER macros in N3 subtree, make output see below; In J3-branch of vmkit, I saw it includes lib/Mvm/BoehmGC/MvmGC.h, (through include/mvm/Object.h) which contains this TRACER define; (line 21) But nothing defines TRACER in N3 branch and I have no idea where is right place to add this or possible other similar missing defines. Thanks, Minas <<< make[2]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/J3' make[2]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/N3' make[3]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/N3/LLVMRuntime' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/N3/LLVMRuntime' make[3]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/N3/VMCore' llvm[3]: Compiling Assembly.cpp for Debug build In file included from Assembly.cpp:16: Assembly.h:140: error: variable or field ‘TRACER’ declared void In file included from Assembly.cpp:20: N3.h:109: error: variable or field ‘TRACER’ declared void In file included from Assembly.cpp:22: VMClass.h:56: error: variable or field ‘TRACER’ declared void VMClass.h:140: error: variable or field ‘TRACER’ declared void VMClass.h:165: error: variable or field ‘TRACER’ declared void VMClass.h:173: error: variable or field ‘TRACER’ declared void VMClass.h:194: error: variable or field ‘TRACER’ declared void VMClass.h:205: error: variable or field ‘TRACER’ declared void In file included from Assembly.cpp:22: VMClass.h:257: error: variable or field ‘TRACER’ declared void VMClass.h:265: error: variable or field ‘TRACER’ declared void In file included from Assembly.cpp:22: VMClass.h:302: error: variable or field ‘TRACER’ declared void In file included from Assembly.cpp:24: VMThread.h:50: error: variable or field ‘TRACER’ declared void In file included from Assembly.cpp:18: LockedMap.h: In member function ‘void n3::LockedMap::tracer() [with Key = llvm::Function*, Container = n3::VMMethod, Compare = std::less, Upcall = n3::N3]’: Assembly.cpp:1929: instantiated from here LockedMap.h:101: error: ‘class n3::VMMethod’ has no member named ‘tracer’ LockedMap.h: In member function ‘void n3::LockedMap::tracer() [with Key = const mvm::UTF8*, Container = n3::CLIString, Compare = std::less, Upcall = n3::N3]’: Assembly.cpp:1929: instantiated from here LockedMap.h:101: error: no matching function for call to ‘n3::CLIString::tracer()’ /home/mn/tests/VMkit/vmkit/include/mvm/Object.h:41: note: candidates are: virtual void mvm::Object::tracer(uintptr_t) LockedMap.h: In member function ‘void n3::LockedMap::tracer() [with Key = const mvm::UTF8*, Container = n3::Assembly, Compare = std::less, Upcall = n3::N3]’: Assembly.cpp:1929: instantiated from here LockedMap.h:101: error: ‘class n3::Assembly’ has no member named ‘tracer’ LockedMap.h: In member function ‘void n3::LockedMap::tracer() [with Key = unsigned int, Container = n3::VMMethod, Compare = std::less, Upcall = n3::Assembly]’: Assembly.cpp:1929: instantiated from here LockedMap.h:101: error: ‘class n3::VMMethod’ has no member named ‘tracer’ LockedMap.h: In member function ‘void n3::LockedMap::tracer() [with Key = unsigned int, Container = n3::VMField, Compare = std::less, Upcall = n3::Assembly]’: Assembly.cpp:1929: instantiated from here LockedMap.h:101: error: ‘class n3::VMField’ has no member named ‘tracer’ LockedMap.h: In member function ‘void n3::LockedMap::tracer() [with Key = unsigned int, Container = n3::VMCommonClass, Compare = std::less, Upcall = n3::Assembly]’: Assembly.cpp:1929: instantiated from here LockedMap.h:101: error: ‘class n3::VMCommonClass’ has no member named ‘tracer’ LockedMap.h: In member function ‘void n3::LockedMap::tracer() [with Key = n3::ClassNameCmp, Container = n3::VMCommonClass, Compare = std::less, Upcall = n3::Assembly]’: Assembly.cpp:1929: instantiated from here LockedMap.h:101: error: ‘class n3::VMCommonClass’ has no member named ‘tracer’ make[3]: *** [/home/mn/tests/VMkit/vmkit/lib/N3/VMCore/Debug/Assembly.o] Error 1 make[3]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/N3/VMCore' make[2]: *** [all] Error 1 make[2]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/N3' make[1]: *** [N3/.makeall] Error 2 make[1]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib' make: *** [all] Error 1 >>> On Thu, Jul 8, 2010 at 3:17 AM, nicolas geoffray wrote: > Hi Minas, > > N3 is not highly maintained anymore, so you shouldn't care about treecc. > > I have updated the EscapeAnalysis file, it should now build fine with the > new LLVM API. > > Cheers, > Nicolas > > On Wed, Jul 7, 2010 at 5:09 AM, Minas Abrahamyan wrote: > >> Hello, >> >> ... how it should now be built and work? >> >> Has anybody built it? >> >> -Minas Abrahamyan >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at gmail.com Thu Jul 8 09:02:34 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Thu, 8 Jul 2010 09:02:34 -0700 Subject: [vmkit-commits] Error building VMkit: it tries to access private method of LLVM In-Reply-To: References: Message-ID: Hi Minas, I wouldn't say N3 is abandoned (it's still in a TODO list :)), but it's normal if it does not compile anymore, it hasn't been updated for a while. Also, the Boehm GC is now an experimental feature, it hasn't been tried for a long time. The regular GC (MMap2) or MMTk are fully supported. Nicolas On Thu, Jul 8, 2010 at 2:56 AM, Minas Abrahamyan wrote: > Hi Nicolas, > > Whether N3 is not in high support, or it is abandoned now and shouldn't be > built? > > Trying to build VMkit now stumbles on undefined TRACER macros in N3 > subtree, make output see below; > > In J3-branch of vmkit, I saw it includes lib/Mvm/BoehmGC/MvmGC.h, (through > include/mvm/Object.h) which contains this TRACER define; (line 21) > But nothing defines TRACER in N3 branch and I have no idea where is right > place to add this or possible other similar missing defines. > > Thanks, > Minas > > > <<< > make[2]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/J3' > > make[2]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/N3' > make[3]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/N3/LLVMRuntime' > make[3]: Nothing to be done for `all'. > make[3]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/N3/LLVMRuntime' > make[3]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/N3/VMCore' > llvm[3]: Compiling Assembly.cpp for Debug build > In file included from Assembly.cpp:16: > Assembly.h:140: error: variable or field ‘TRACER’ declared void > In file included from Assembly.cpp:20: > N3.h:109: error: variable or field ‘TRACER’ declared void > In file included from Assembly.cpp:22: > VMClass.h:56: error: variable or field ‘TRACER’ declared void > VMClass.h:140: error: variable or field ‘TRACER’ declared void > VMClass.h:165: error: variable or field ‘TRACER’ declared void > VMClass.h:173: error: variable or field ‘TRACER’ declared void > VMClass.h:194: error: variable or field ‘TRACER’ declared void > VMClass.h:205: error: variable or field ‘TRACER’ declared void > In file included from Assembly.cpp:22: > VMClass.h:257: error: variable or field ‘TRACER’ declared void > VMClass.h:265: error: variable or field ‘TRACER’ declared void > In file included from Assembly.cpp:22: > VMClass.h:302: error: variable or field ‘TRACER’ declared void > In file included from Assembly.cpp:24: > VMThread.h:50: error: variable or field ‘TRACER’ declared void > In file included from Assembly.cpp:18: > LockedMap.h: In member function ‘void n3::LockedMap Compare, Upcall>::tracer() [with Key = llvm::Function*, Container = > n3::VMMethod, Compare = std::less, Upcall = n3::N3]’: > Assembly.cpp:1929: instantiated from here > LockedMap.h:101: error: ‘class n3::VMMethod’ has no member named ‘tracer’ > LockedMap.h: In member function ‘void n3::LockedMap Compare, Upcall>::tracer() [with Key = const mvm::UTF8*, Container = > n3::CLIString, Compare = std::less, Upcall = n3::N3]’: > Assembly.cpp:1929: instantiated from here > LockedMap.h:101: error: no matching function for call to > ‘n3::CLIString::tracer()’ > /home/mn/tests/VMkit/vmkit/include/mvm/Object.h:41: note: candidates are: > virtual void mvm::Object::tracer(uintptr_t) > LockedMap.h: In member function ‘void n3::LockedMap Compare, Upcall>::tracer() [with Key = const mvm::UTF8*, Container = > n3::Assembly, Compare = std::less, Upcall = n3::N3]’: > Assembly.cpp:1929: instantiated from here > LockedMap.h:101: error: ‘class n3::Assembly’ has no member named ‘tracer’ > LockedMap.h: In member function ‘void n3::LockedMap Compare, Upcall>::tracer() [with Key = unsigned int, Container = > n3::VMMethod, Compare = std::less, Upcall = n3::Assembly]’: > Assembly.cpp:1929: instantiated from here > LockedMap.h:101: error: ‘class n3::VMMethod’ has no member named ‘tracer’ > LockedMap.h: In member function ‘void n3::LockedMap Compare, Upcall>::tracer() [with Key = unsigned int, Container = > n3::VMField, Compare = std::less, Upcall = n3::Assembly]’: > Assembly.cpp:1929: instantiated from here > LockedMap.h:101: error: ‘class n3::VMField’ has no member named ‘tracer’ > LockedMap.h: In member function ‘void n3::LockedMap Compare, Upcall>::tracer() [with Key = unsigned int, Container = > n3::VMCommonClass, Compare = std::less, Upcall = > n3::Assembly]’: > Assembly.cpp:1929: instantiated from here > LockedMap.h:101: error: ‘class n3::VMCommonClass’ has no member named > ‘tracer’ > LockedMap.h: In member function ‘void n3::LockedMap Compare, Upcall>::tracer() [with Key = n3::ClassNameCmp, Container = > n3::VMCommonClass, Compare = std::less, Upcall = > n3::Assembly]’: > Assembly.cpp:1929: instantiated from here > LockedMap.h:101: error: ‘class n3::VMCommonClass’ has no member named > ‘tracer’ > make[3]: *** [/home/mn/tests/VMkit/vmkit/lib/N3/VMCore/Debug/Assembly.o] > Error 1 > make[3]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/N3/VMCore' > > make[2]: *** [all] Error 1 > make[2]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib/N3' > make[1]: *** [N3/.makeall] Error 2 > make[1]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib' > make: *** [all] Error 1 > >>> > > On Thu, Jul 8, 2010 at 3:17 AM, nicolas geoffray < > nicolas.geoffray at gmail.com> wrote: > >> Hi Minas, >> >> N3 is not highly maintained anymore, so you shouldn't care about treecc. >> >> I have updated the EscapeAnalysis file, it should now build fine with the >> new LLVM API. >> >> Cheers, >> Nicolas >> >> On Wed, Jul 7, 2010 at 5:09 AM, Minas Abrahamyan wrote: >> >>> Hello, >>> >>> ... how it should now be built and work? >>> >>> >>> Has anybody built it? >>> >>> -Minas Abrahamyan >>> >> > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Sat Jul 10 12:01:50 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Jul 2010 19:01:50 -0000 Subject: [vmkit-commits] [vmkit] r108049 - in /vmkit/trunk/lib/J3: Classpath/ClasspathReflect.h Classpath/ClasspathVMStackWalker.inc Classpath/JavaUpcalls.cpp Compiler/JavaJIT.cpp VMCore/Jnjvm.cpp VMCore/Jnjvm.h VMCore/JnjvmClassLoader.cpp Message-ID: <20100710190150.897D42A6C12C@llvm.org> Author: geoffray Date: Sat Jul 10 14:01:50 2010 New Revision: 108049 URL: http://llvm.org/viewvc/llvm-project?rev=108049&view=rev Log: Continue code cleanup and add some missing llvm_gcroot. Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.h vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h?rev=108049&r1=108048&r2=108049&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h Sat Jul 10 14:01:50 2010 @@ -151,6 +151,7 @@ public: static void staticDestructor(JavaObjectVMThread* obj) { + llvm_gcroot(obj, 0); mvm::Thread::releaseThread(obj->vmdata); } Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc?rev=108049&r1=108048&r2=108049&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc Sat Jul 10 14:01:50 2010 @@ -30,8 +30,10 @@ #endif ) { - ArrayObject* result = 0; + ArrayObject* result = NULL; + JavaObject* delegatee = NULL; llvm_gcroot(result, 0); + llvm_gcroot(delegatee, 0); BEGIN_NATIVE_EXCEPTION(0) @@ -49,7 +51,8 @@ for (uint32 i = 0; i != finalSize; ++i) { JavaMethod* meth = ((JavaMethod**)buffer)[i]; assert(meth && "Wrong stack trace"); - ArrayObject::setElement(result, meth->classDef->getClassDelegatee(vm), i); + delegatee = meth->classDef->getClassDelegatee(vm);; + ArrayObject::setElement(result, delegatee, i); } delete[] buffer; Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=108049&r1=108048&r2=108049&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Sat Jul 10 14:01:50 2010 @@ -522,6 +522,7 @@ } extern "C" void nativeJavaObjectVMThreadDestructor(JavaObjectVMThread* obj) { + llvm_gcroot(obj, 0); JavaObjectVMThread::staticDestructor(obj); } Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=108049&r1=108048&r2=108049&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sat Jul 10 14:01:50 2010 @@ -531,7 +531,7 @@ compilingMethod->codeInfo[i].bytecode = codeInfo[i].bytecode; } } else { - compilingMethod->codeInfo == NULL; + compilingMethod->codeInfo = NULL; } return llvmFunction; @@ -1368,7 +1368,7 @@ compilingMethod->codeInfo[i].bytecode = codeInfo[i].bytecode; } } else { - compilingMethod->codeInfo == NULL; + compilingMethod->codeInfo = NULL; } return llvmFunction; Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=108049&r1=108048&r2=108049&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sat Jul 10 14:01:50 2010 @@ -1447,19 +1447,6 @@ #endif } -const UTF8* Jnjvm::asciizToInternalUTF8(const char* asciiz) { - uint32 size = strlen(asciiz); - UTF8* tmp = (UTF8*)upcalls->ArrayOfChar->doNew(size, this); - uint16* buf = tmp->elements; - - for (uint32 i = 0; i < size; i++) { - if (asciiz[i] == '.') buf[i] = '/'; - else buf[i] = asciiz[i]; - } - return (const UTF8*)tmp; - -} - ArrayUInt16* Jnjvm::asciizToArray(const char* asciiz) { ArrayUInt16* tmp = NULL; llvm_gcroot(tmp, 0); Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.h?rev=108049&r1=108048&r2=108049&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.h Sat Jul 10 14:01:50 2010 @@ -294,11 +294,6 @@ /// JavaString* internalUTF8ToStr(const UTF8* utf8); - /// asciizToInternalUTF8 - Constructs an UTF8 out of the asciiz and changes - /// '.' into '/'. - /// - const UTF8* asciizToInternalUTF8(const char* asciiz); - /// asciizToUTF8 - Constructs an UTF8 out of the asciiz. /// ArrayUInt16* asciizToArray(const char* asciiz); Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108049&r1=108048&r2=108049&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Jul 10 14:01:50 2010 @@ -332,7 +332,6 @@ char* buf = (char*)alloca(strLen + alen + 7); sprintf(buf, "%s%s.class", str, asciiz); - // This array is not allocated by the GC. res = Reader::openFile(this, buf); if (res) return res; } @@ -577,15 +576,23 @@ for (sint32 i = 0; i < str->count; ++i) { uint16 cur = ArrayUInt16::getElement(JavaString::getValue(str), str->offset + i); if (cur == '.') name->elements[i] = '/'; - else if (cur == '/') return 0; + else if (cur == '/') { + free(name); + return 0; + } else name->elements[i] = cur; } } else { for (sint32 i = 0; i < str->count; ++i) { uint16 cur = ArrayUInt16::getElement(JavaString::getValue(str), str->offset + i); - if (cur == '.') name->elements[i] = '/'; - else if (cur == '/') return 0; - else name->elements[i] = cur; + if (cur == '.') { + name->elements[i] = '/'; + } else if (cur == '/') { + free(name); + return 0; + } else { + name->elements[i] = cur; + } } } From nicolas.geoffray at lip6.fr Sat Jul 10 12:56:31 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Jul 2010 19:56:31 -0000 Subject: [vmkit-commits] [vmkit] r108052 - in /vmkit/trunk/lib/J3: Compiler/JavaAOTCompiler.cpp VMCore/Jnjvm.cpp VMCore/JnjvmClassLoader.cpp Message-ID: <20100710195631.82C062A6C12C@llvm.org> Author: geoffray Date: Sat Jul 10 14:56:31 2010 New Revision: 108052 URL: http://llvm.org/viewvc/llvm-project?rev=108052&view=rev Log: Analyse the boot classpath once we are in a VM thread. Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=108052&r1=108051&r2=108052&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sat Jul 10 14:56:31 2010 @@ -1929,15 +1929,16 @@ JnjvmBootstrapLoader* bootstrapLoader = vm->bootstrapLoader; JavaAOTCompiler* M = (JavaAOTCompiler*)bootstrapLoader->getCompiler(); JavaJITCompiler* Comp = 0; - if (!M->clinits->empty()) { - Comp = JavaJITCompiler::CreateCompiler("JIT"); - Comp->EmitFunctionName = true; - bootstrapLoader->setCompiler(Comp); - bootstrapLoader->analyseClasspathEnv(vm->classpath); - } else { - bootstrapLoader->analyseClasspathEnv(vm->classpath); - bootstrapLoader->upcalls->initialiseClasspath(bootstrapLoader); - } + bootstrapLoader->analyseClasspathEnv(vm->bootstrapLoader->bootClasspathEnv); + if (!M->clinits->empty()) { + Comp = JavaJITCompiler::CreateCompiler("JIT"); + Comp->EmitFunctionName = true; + bootstrapLoader->setCompiler(Comp); + bootstrapLoader->analyseClasspathEnv(vm->classpath); + } else { + bootstrapLoader->analyseClasspathEnv(vm->classpath); + bootstrapLoader->upcalls->initialiseClasspath(bootstrapLoader); + } uint32 size = strlen(name); Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=108052&r1=108051&r2=108052&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sat Jul 10 14:56:31 2010 @@ -1294,6 +1294,7 @@ llvm_gcroot(exc, 0); Jnjvm* vm = thread->getJVM(); + vm->bootstrapLoader->analyseClasspathEnv(vm->bootstrapLoader->bootClasspathEnv); vm->argumentsInfo.readArgs(vm); if (vm->argumentsInfo.className == NULL) { vm->threadSystem.leave(); Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108052&r1=108051&r2=108052&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Jul 10 14:56:31 2010 @@ -196,12 +196,6 @@ arrayTable[JavaArray::T_LONG - 4] = upcalls->ArrayOfLong; arrayTable[JavaArray::T_DOUBLE - 4] = upcalls->ArrayOfDouble; - // Analyse the boot classpath to locate java/lang/Object. Since the - // analyseClasspathEnv function may require to create a Java byte array to - // hold the .zip file, we call the function after creation of the - // array classes. - analyseClasspathEnv(bootClasspathEnv); - Attribut::annotationsAttribut = asciizConstructUTF8("RuntimeVisibleAnnotations"); Attribut::codeAttribut = asciizConstructUTF8("Code"); From nicolas.geoffray at lip6.fr Sat Jul 10 13:10:59 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Jul 2010 20:10:59 -0000 Subject: [vmkit-commits] [vmkit] r108053 - in /vmkit/trunk: include/mvm/Allocator.h lib/J3/Compiler/ExceptionsCheck.inc lib/J3/Compiler/ExceptionsDwarf.inc lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJITOpcodes.cpp lib/J3/Compiler/LLVMInfo.cpp lib/J3/Compiler/LLVMMaterializer.cpp lib/J3/VMCore/JavaConstantPool.cpp lib/J3/VMCore/JavaMetaJIT.cpp lib/J3/VMCore/JavaRuntimeJIT.cpp lib/J3/VMCore/JavaTypes.cpp lib/J3/VMCore/JnjvmClassLoader.cpp Message-ID: <20100710201059.DB7B62A6C12C@llvm.org> Author: geoffray Date: Sat Jul 10 15:10:59 2010 New Revision: 108053 URL: http://llvm.org/viewvc/llvm-project?rev=108053&view=rev Log: Replace uses of alloca with a ThreadAllocator. Modified: vmkit/trunk/include/mvm/Allocator.h vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/include/mvm/Allocator.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Allocator.h?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Allocator.h (original) +++ vmkit/trunk/include/mvm/Allocator.h Sat Jul 10 15:10:59 2010 @@ -45,6 +45,24 @@ }; +class ThreadAllocator { +private: + llvm::BumpPtrAllocator Allocator; +public: + void* Allocate(size_t sz) { +#ifdef USE_GC_BOEHM + return GC_MALLOC(sz); +#else + void* res = Allocator.Allocate(sz, sizeof(void*)); + memset(res, 0, sz); + return res; +#endif + } + + void Deallocate(void* obj) {} + +}; + class PermanentObject { public: void* operator new(size_t sz, BumpPtrAllocator& allocator, Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsCheck.inc Sat Jul 10 15:10:59 2010 @@ -323,8 +323,10 @@ sint16 sync = isSynchro(compilingMethod->access) ? 1 : 0; nbe += sync; + mvm::ThreadAllocator allocator; // Loop over all handlers in the bytecode to initialize their values. - Handler* handlers = (Handler*)alloca(sizeof(Handler) * (nbe - sync)); + Handler* handlers = + (Handler*)allocator.Allocate(sizeof(Handler) * (nbe - sync)); for (uint16 i = 0; i < nbe - sync; ++i) { Handler* ex = &handlers[i]; ex->startpc = reader.readU2(); Modified: vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc (original) +++ vmkit/trunk/lib/J3/Compiler/ExceptionsDwarf.inc Sat Jul 10 15:10:59 2010 @@ -225,8 +225,10 @@ } } + mvm::ThreadAllocator allocator; // Loop over all handlers in the bytecode to initialize their values. - Handler* handlers = (Handler*)alloca(sizeof(Handler) * (nbe - sync)); + Handler* handlers = (Handler*) + allocator.Allocate(sizeof(Handler) * (nbe - sync)); for (uint16 i = 0; i < nbe - sync; ++i) { Handler* ex = &handlers[i]; ex->startpc = reader.readU2(); Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sat Jul 10 15:10:59 2010 @@ -1886,8 +1886,9 @@ JnjvmBootstrapLoader* bootstrapLoader, std::vector& classes) { ZipArchive archive(bytes, bootstrapLoader->allocator); - - char* realName = (char*)alloca(4096); + + mvm::ThreadAllocator allocator; + char* realName = (char*)allocator.Allocate(4096); for (ZipArchive::table_iterator i = archive.filetable.begin(), e = archive.filetable.end(); i != e; ++i) { ZipFile* file = i->second; @@ -1929,6 +1930,7 @@ JnjvmBootstrapLoader* bootstrapLoader = vm->bootstrapLoader; JavaAOTCompiler* M = (JavaAOTCompiler*)bootstrapLoader->getCompiler(); JavaJITCompiler* Comp = 0; + mvm::ThreadAllocator allocator; bootstrapLoader->analyseClasspathEnv(vm->bootstrapLoader->bootClasspathEnv); if (!M->clinits->empty()) { Comp = JavaJITCompiler::CreateCompiler("JIT"); @@ -1940,22 +1942,22 @@ bootstrapLoader->upcalls->initialiseClasspath(bootstrapLoader); } - uint32 size = strlen(name); + uint32 size = strlen(name); - if (size > 4 && - (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { + if (size > 4 && + (!strcmp(&name[size - 4], ".jar") || !strcmp(&name[size - 4], ".zip"))) { - std::vector classes; - ArrayUInt8* bytes = Reader::openFile(bootstrapLoader, name); + std::vector classes; + ArrayUInt8* bytes = Reader::openFile(bootstrapLoader, name); - if (!bytes) { - fprintf(stderr, "Can't find zip file.\n"); - goto end; - } + if (!bytes) { + fprintf(stderr, "Can't find zip file.\n"); + goto end; + } - extractFiles(bytes, M, bootstrapLoader, classes); - // Now that we know if we can trust this compiler, add the Java passes. - M->addJavaPasses(M->compileRT); + extractFiles(bytes, M, bootstrapLoader, classes); + // Now that we know if we can trust this compiler, add the Java passes. + M->addJavaPasses(M->compileRT); // First resolve everyone so that there can not be unknown references in @@ -2033,7 +2035,7 @@ } } else { - char* realName = (char*)alloca(size + 1); + char* realName = (char*)allocator.Allocate(size + 1); if (size > 6 && !strcmp(&name[size - 6], ".class")) { memcpy(realName, name, size - 6); realName[size - 6] = 0; Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sat Jul 10 15:10:59 2010 @@ -1507,7 +1507,8 @@ nb += 1; #endif Args.reserve(nb + 2); - Value** args = (Value**)alloca(nb*sizeof(Value*)); + mvm::ThreadAllocator threadAllocator; + Value** args = (Value**)threadAllocator.Allocate(nb*sizeof(Value*)); #if defined(ISOLATE_SHARING) args[nb - 1] = isolateLocal; sint32 start = nb - 2; Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sat Jul 10 15:10:59 2010 @@ -104,6 +104,7 @@ bool wide = false; uint32 jsrIndex = 0; uint32 start = reader.cursor; + mvm::ThreadAllocator allocator; for(uint32 i = 0; i < codeLength; ++i) { reader.cursor = start + i; uint8 bytecode = reader.readU1(); @@ -2304,7 +2305,7 @@ UserCommonClass* dcl = 0; Value* valCl = getResolvedCommonClass(index, true, &dcl); - Value** args = (Value**)alloca(sizeof(Value*) * (dim + 2)); + Value** args = (Value**)allocator.Allocate(sizeof(Value*) * (dim + 2)); args[0] = valCl; args[1] = ConstantInt::get(Type::getInt32Ty(*llvmContext), dim); Modified: vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp Sat Jul 10 15:10:59 2010 @@ -138,6 +138,7 @@ Function* LLVMMethodInfo::getMethod() { if (!methodFunction) { + mvm::ThreadAllocator allocator; JnjvmClassLoader* JCL = methodDef->classDef->classLoader; if (Compiler->emitFunctionName() || EmitDebugInfo) { const UTF8* jniConsClName = methodDef->classDef->name; @@ -147,8 +148,8 @@ sint32 mnlen = jniConsName->size; sint32 mtlen = jniConsType->size; - char* buf = (char*)alloca(3 + JNI_NAME_PRE_LEN + 1 + - ((mnlen + clen + mtlen) << 3)); + char* buf = (char*)allocator.Allocate( + 3 + JNI_NAME_PRE_LEN + 1 + ((mnlen + clen + mtlen) << 3)); bool j3 = false; if (isNative(methodDef->access)) { @@ -327,8 +328,10 @@ J3Intrinsics& Intrinsics = *Compiler->getIntrinsics(); Function* res = 0; if (Compiler->isStaticCompiling()) { + mvm::ThreadAllocator allocator; const char* type = virt ? "virtual_buf" : "static_buf"; - char* buf = (char*)alloca((signature->keyName->size << 1) + 1 + 11); + char* buf = (char*)allocator.Allocate( + (signature->keyName->size << 1) + 1 + 11); signature->nativeName(buf, type); res = Function::Create(virt ? getVirtualBufType() : getStaticBufType(), GlobalValue::ExternalLinkage, buf, Modified: vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp Sat Jul 10 15:10:59 2010 @@ -82,9 +82,10 @@ Function* F = 0; LLVMSignatureInfo* LSI = getSignatureInfo(sign); + mvm::ThreadAllocator allocator; const UTF8* name = cl->name; - char* key = (char*)alloca(name->size + 16); + char* key = (char*)allocator.Allocate(name->size + 16); for (sint32 i = 0; i < name->size; ++i) key[i] = name->elements[i]; sprintf(key + name->size, "%d", index); Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Sat Jul 10 15:10:59 2010 @@ -189,9 +189,10 @@ } if (!ctpRes[entry]) { + mvm::ThreadAllocator allocator; Reader reader(&(classDef->bytes), ctpDef[entry]); uint32 len = reader.readU2(); - uint16* buf = (uint16*)alloca(len * sizeof(uint16)); + uint16* buf = (uint16*)allocator.Allocate(len * sizeof(uint16)); uint32 n = 0; uint32 i = 0; Modified: vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaMetaJIT.cpp Sat Jul 10 15:10:59 2010 @@ -81,7 +81,8 @@ llvm_gcroot(obj, 0); \ verifyNull(obj); \ Signdef* sign = getSignature(); \ - jvalue* buf = (jvalue*)alloca(sign->nbArguments * sizeof(jvalue)); \ + mvm::ThreadAllocator allocator; \ + jvalue* buf = (jvalue*)allocator.Allocate(sign->nbArguments * sizeof(jvalue)); \ readArgs(buf, sign, ap, jni); \ return invoke##TYPE_NAME##VirtualBuf(vm, cl, obj, buf); \ }\ @@ -90,14 +91,16 @@ llvm_gcroot(obj, 0); \ verifyNull(obj); \ Signdef* sign = getSignature(); \ - jvalue* buf = (jvalue*)alloca(sign->nbArguments * sizeof(jvalue)); \ + mvm::ThreadAllocator allocator; \ + jvalue* buf = (jvalue*)allocator.Allocate(sign->nbArguments * sizeof(jvalue)); \ readArgs(buf, sign, ap, jni); \ return invoke##TYPE_NAME##SpecialBuf(vm, cl, obj, buf); \ }\ \ TYPE JavaMethod::invoke##TYPE_NAME##StaticAP(Jnjvm* vm, UserClass* cl, va_list ap) {\ Signdef* sign = getSignature(); \ - jvalue* buf = (jvalue*)alloca(sign->nbArguments * sizeof(jvalue)); \ + mvm::ThreadAllocator allocator; \ + jvalue* buf = (jvalue*)allocator.Allocate(sign->nbArguments * sizeof(jvalue)); \ readArgs(buf, sign, ap, jni); \ return invoke##TYPE_NAME##StaticBuf(vm, cl, buf); \ } Modified: vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaRuntimeJIT.cpp Sat Jul 10 15:10:59 2010 @@ -294,7 +294,8 @@ va_list ap; va_start(ap, len); - sint32* dims = (sint32*)alloca(sizeof(sint32) * len); + mvm::ThreadAllocator allocator; + sint32* dims = (sint32*)allocator.Allocate(sizeof(sint32) * len); for (uint32 i = 0; i < len; ++i){ dims[i] = va_arg(ap, int); } Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp Sat Jul 10 15:10:59 2010 @@ -59,7 +59,8 @@ intptr_t Signdef::staticCallBuf() { if (!_staticCallBuf) { - char* buf = (char*)alloca((keyName->size << 1) + 1 + 11); + mvm::ThreadAllocator allocator; + char* buf = (char*)allocator.Allocate((keyName->size << 1) + 1 + 11); nativeName(buf, "static_buf"); bool unused = false; intptr_t res = initialLoader->loadInLib(buf, unused); @@ -74,7 +75,8 @@ intptr_t Signdef::virtualCallBuf() { if (!_virtualCallBuf) { - char* buf = (char*)alloca((keyName->size << 1) + 1 + 11); + mvm::ThreadAllocator allocator; + char* buf = (char*)allocator.Allocate((keyName->size << 1) + 1 + 11); nativeName(buf, "virtual_buf"); bool unused = false; intptr_t res = initialLoader->loadInLib(buf, unused); @@ -89,7 +91,8 @@ intptr_t Signdef::staticCallAP() { if (!_staticCallAP) { - char* buf = (char*)alloca((keyName->size << 1) + 1 + 11); + mvm::ThreadAllocator allocator; + char* buf = (char*)allocator.Allocate((keyName->size << 1) + 1 + 11); nativeName(buf, "static_ap"); bool unused = false; intptr_t res = initialLoader->loadInLib(buf, unused); @@ -104,7 +107,8 @@ intptr_t Signdef::virtualCallAP() { if (!_virtualCallAP) { - char* buf = (char*)alloca((keyName->size << 1) + 1 + 11); + mvm::ThreadAllocator allocator; + char* buf = (char*)allocator.Allocate((keyName->size << 1) + 1 + 11); nativeName(buf, "virtual_ap"); bool unused = false; intptr_t res = initialLoader->loadInLib(buf, unused); @@ -119,7 +123,8 @@ intptr_t Signdef::virtualCallStub() { if (!_virtualCallAP) { - char* buf = (char*)alloca((keyName->size << 1) + 1 + 11); + mvm::ThreadAllocator allocator; + char* buf = (char*)allocator.Allocate((keyName->size << 1) + 1 + 11); nativeName(buf, "virtual_stub"); bool unused = false; intptr_t res = initialLoader->loadInLib(buf, unused); @@ -134,7 +139,8 @@ intptr_t Signdef::specialCallStub() { if (!_specialCallStub) { - char* buf = (char*)alloca((keyName->size << 1) + 1 + 11); + mvm::ThreadAllocator allocator; + char* buf = (char*)allocator.Allocate((keyName->size << 1) + 1 + 11); nativeName(buf, "special_stub"); bool unused = false; intptr_t res = initialLoader->loadInLib(buf, unused); @@ -149,7 +155,8 @@ intptr_t Signdef::staticCallStub() { if (!_staticCallStub) { - char* buf = (char*)alloca((keyName->size << 1) + 1 + 11); + mvm::ThreadAllocator allocator; + char* buf = (char*)allocator.Allocate((keyName->size << 1) + 1 + 11); nativeName(buf, "static_stub"); bool unused = false; intptr_t res = initialLoader->loadInLib(buf, unused); Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108053&r1=108052&r2=108053&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Jul 10 15:10:59 2010 @@ -311,8 +311,9 @@ ArrayUInt8* JnjvmBootstrapLoader::openName(const UTF8* utf8) { ArrayUInt8* res = 0; llvm_gcroot(res, 0); + mvm::ThreadAllocator threadAllocator; - char* asciiz = (char*)alloca(utf8->size + 1); + char* asciiz = (char*)threadAllocator.Allocate(utf8->size + 1); for (sint32 i = 0; i < utf8->size; ++i) asciiz[i] = utf8->elements[i]; asciiz[utf8->size] = 0; @@ -323,7 +324,7 @@ e = bootClasspath.end(); i != e; ++i) { const char* str = *i; unsigned int strLen = strlen(str); - char* buf = (char*)alloca(strLen + alen + 7); + char* buf = (char*)threadAllocator.Allocate(strLen + alen + 7); sprintf(buf, "%s%s.class", str, asciiz); res = Reader::openFile(this, buf); @@ -334,7 +335,7 @@ e = bootArchives.end(); i != e; ++i) { ZipArchive* archive = *i; - char* buf = (char*)alloca(alen + 7); + char* buf = (char*)threadAllocator.Allocate(alen + 7); sprintf(buf, "%s.class", asciiz); res = Reader::openZip(this, archive, buf); if (res) return res; @@ -511,8 +512,10 @@ if (name->size == 0) { return 0; } else if (name->elements[0] == I_TAB) { + mvm::ThreadAllocator threadAllocator; bool prim = false; - UTF8* holder = (UTF8*)alloca(sizeof(UTF8) + name->size * sizeof(uint16)); + UTF8* holder = (UTF8*)threadAllocator.Allocate( + sizeof(UTF8) + name->size * sizeof(uint16)); if (!holder) return 0; const UTF8* componentName = lookupComponentName(name, holder, prim); @@ -534,8 +537,10 @@ const UTF8* name = hashUTF8->lookupAsciiz(asciiz); if (!name) name = bootstrapLoader->hashUTF8->lookupAsciiz(asciiz); if (!name) { + mvm::ThreadAllocator threadAllocator; uint32 size = strlen(asciiz); - UTF8* temp = (UTF8*)alloca(sizeof(UTF8) + size * sizeof(uint16)); + UTF8* temp = (UTF8*)threadAllocator.Allocate( + sizeof(UTF8) + size * sizeof(uint16)); temp->size = size; if (!temp) return 0; @@ -938,6 +943,7 @@ void JnjvmBootstrapLoader::analyseClasspathEnv(const char* str) { ArrayUInt8* bytes = NULL; llvm_gcroot(bytes, 0); + mvm::ThreadAllocator threadAllocator; if (str != 0) { unsigned int len = strlen(str); char* buf = new char[len + 1]; @@ -951,7 +957,7 @@ if (top != 0) { memcpy(buf, cur, top); buf[top] = 0; - char* rp = (char*)alloca(PATH_MAX); + char* rp = (char*)threadAllocator.Allocate(PATH_MAX); memset(rp, 0, PATH_MAX); rp = realpath(buf, rp); if (rp && rp[PATH_MAX - 1] == 0 && strlen(rp) != 0) { @@ -1091,7 +1097,9 @@ void JnjvmClassLoader::loadLibFromJar(Jnjvm* vm, const char* name, const char* file) { - char* soName = (char*)alloca(strlen(name) + strlen(DYLD_EXTENSION)); + mvm::ThreadAllocator threadAllocator; + char* soName = (char*)threadAllocator.Allocate( + strlen(name) + strlen(DYLD_EXTENSION)); const char* ptr = strrchr(name, '/'); sprintf(soName, "%s%s", ptr ? ptr + 1 : name, DYLD_EXTENSION); void* handle = dlopen(soName, RTLD_LAZY | RTLD_LOCAL); @@ -1107,8 +1115,10 @@ } void JnjvmClassLoader::loadLibFromFile(Jnjvm* vm, const char* name) { + mvm::ThreadAllocator threadAllocator; assert(classes->map.size() == 0); - char* soName = (char*)alloca(strlen(name) + strlen(DYLD_EXTENSION)); + char* soName = (char*)threadAllocator.Allocate( + strlen(name) + strlen(DYLD_EXTENSION)); sprintf(soName, "%s%s", name, DYLD_EXTENSION); void* handle = dlopen(soName, RTLD_LAZY | RTLD_LOCAL); if (handle) { @@ -1201,8 +1211,9 @@ sint32 mnlen = jniConsName->size; sint32 mtlen = jniConsType->size; - char* buf = (char*)alloca(3 + JNI_NAME_PRE_LEN + 1 + - ((mnlen + clen + mtlen) << 3)); + mvm::ThreadAllocator threadAllocator; + char* buf = (char*)threadAllocator.Allocate( + 3 + JNI_NAME_PRE_LEN + 1 + ((mnlen + clen + mtlen) << 3)); intptr_t res = meth->classDef->classLoader->nativeLookup(meth, j3, buf); assert(res && "Could not find required native method"); return res; From nicolas.geoffray at lip6.fr Sat Jul 10 13:53:56 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Jul 2010 20:53:56 -0000 Subject: [vmkit-commits] [vmkit] r108057 - in /vmkit/trunk/lib/J3: Classpath/ClasspathConstructor.inc Classpath/ClasspathMethod.inc Classpath/ClasspathVMRuntime.inc Classpath/ClasspathVMStackWalker.inc Classpath/JavaUpcalls.cpp Compiler/JavaJITCompiler.cpp VMCore/JavaClass.cpp VMCore/JavaString.cpp VMCore/JavaString.h VMCore/Jnjvm.cpp VMCore/JnjvmClassLoader.cpp Message-ID: <20100710205356.6EC962A6C12C@llvm.org> Author: geoffray Date: Sat Jul 10 15:53:56 2010 New Revision: 108057 URL: http://llvm.org/viewvc/llvm-project?rev=108057&view=rev Log: Change allocation of temporary data that use new with the ThreadAllocator. Modified: vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaString.cpp vmkit/trunk/lib/J3/VMCore/JavaString.h vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathConstructor.inc Sat Jul 10 15:53:56 2010 @@ -95,9 +95,10 @@ if (isAbstract(cl->access)) vm->instantiationException(cl); + mvm::ThreadAllocator allocator; // Allocate a buffer to store the arguments. - jvalue* buf = size ? new jvalue[size] : NULL; - if (size) memset(buf, 0, size * sizeof(jvalue)); + jvalue* buf = size ? + (jvalue*)allocator.Allocate(size * sizeof(jvalue)) : NULL; if (nbArgs == size) { UserCommonClass* _cl = UserCommonClass::resolvedImplClass(vm, Clazz, false); @@ -123,7 +124,6 @@ excp = th->getJavaException(); } END_CATCH; if (excp) { - if (size) delete[] buf; if (JavaObject::getClass(excp)->isAssignableFrom(vm->upcalls->newException)) { th->clearException(); // If it's an exception, we encapsule it in an @@ -136,17 +136,14 @@ return NULL; } } else { - if (size) delete[] buf; vm->illegalArgumentException("class is not a regular class"); return NULL; } } else { - if (size) delete[] buf; vm->illegalArgumentException("wrong number of arguments"); return NULL; } - if (size) delete[] buf; return res; } Modified: vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc Sat Jul 10 15:53:56 2010 @@ -115,8 +115,9 @@ Signdef* sign = meth->getSignature(); sint32 size = sign->nbArguments; - jvalue* buf = size ? new jvalue[size] : 0; - if (size) memset(buf, 0, size * sizeof(jvalue)); + mvm::ThreadAllocator allocator; + jvalue* buf = size ? + (jvalue*)allocator.Allocate(size * sizeof(jvalue)) : NULL; if (nbArgs == size) { UserCommonClass* _cl = UserCommonClass::resolvedImplClass(vm, Cl, false); Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMRuntime.inc Sat Jul 10 15:53:56 2010 @@ -118,14 +118,13 @@ JnjvmClassLoader* loader = JnjvmClassLoader::getJnjvmLoaderFromJavaObject(javaLoader, vm); - char* buf = JavaString::strToAsciiz(str); + mvm::ThreadAllocator allocator; + char* buf = JavaString::strToAsciiz(str, &allocator); res = loader->loadLib(buf); if (res) callOnLoad(res, loader, vm); - delete[] buf; - END_NATIVE_EXCEPTION return res != 0; Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc Sat Jul 10 15:53:56 2010 @@ -41,7 +41,8 @@ Jnjvm* vm = th->getJVM(); uint32 length = th->getFrameContextLength(); - uintptr_t* buffer = new uintptr_t[length]; + mvm::ThreadAllocator allocator; + uintptr_t* buffer = (uintptr_t*)allocator.Allocate(length * sizeof(uintptr_t)); uint32 finalSize = th->getJavaFrameContext((void**)buffer); Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Sat Jul 10 15:53:56 2010 @@ -536,9 +536,9 @@ BEGIN_NATIVE_EXCEPTION(0) - char* buf = JavaString::strToAsciiz(str); + mvm::ThreadAllocator allocator; + char* buf = JavaString::strToAsciiz(str, &allocator); char* res = getenv(buf); - delete[] buf; if (res) { Jnjvm* vm = JavaThread::get()->getJVM(); ret = vm->asciizToStr(res); Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sat Jul 10 15:53:56 2010 @@ -428,7 +428,8 @@ mvm::MvmModule::initialise(); mvm::Collector::initialise(); - char** newArgv = new char*[argc + 1]; + mvm::ThreadAllocator allocator; + char** newArgv = (char**)allocator.Allocate((argc + 1) * sizeof(char*)); memcpy(newArgv + 1, argv, argc * sizeof(void*)); newArgv[0] = newArgv[1]; newArgv[1] = mainClass; Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Sat Jul 10 15:53:56 2010 @@ -865,9 +865,10 @@ void Class::readMethods(Reader& reader) { uint16 nbMethods = reader.readU2(); + mvm::ThreadAllocator allocator; if (isAbstract(access)) { - virtualMethods = new JavaMethod[nbMethods]; - memset(virtualMethods, 0, nbMethods * sizeof(JavaMethod)); + virtualMethods = (JavaMethod*) + allocator.Allocate(nbMethods * sizeof(JavaMethod)); } else { virtualMethods = new(classLoader->allocator, "Methods") JavaMethod[nbMethods]; @@ -910,7 +911,6 @@ realMethods[j++].initialise(this, cur->name, cur->type, cur->access); } } - delete[] virtualMethods; virtualMethods = realMethods; } } Modified: vmkit/trunk/lib/J3/VMCore/JavaString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaString.cpp?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaString.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaString.cpp Sat Jul 10 15:53:56 2010 @@ -56,6 +56,20 @@ return buf; } +char* JavaString::strToAsciiz(JavaString* self, + mvm::ThreadAllocator* allocator) { + const ArrayUInt16* value = NULL; + llvm_gcroot(self, 0); + llvm_gcroot(value, 0); + value = JavaString::getValue(self); + char* buf = (char*)allocator->Allocate((self->count + 1) * sizeof(char)); + for (sint32 i = 0; i < self->count; ++i) { + buf[i] = ArrayUInt16::getElement(value, i + self->offset); + } + buf[self->count] = 0; + return buf; +} + const ArrayUInt16* JavaString::strToArray(JavaString* self, Jnjvm* vm) { ArrayUInt16* array = NULL; const ArrayUInt16* value = NULL; @@ -112,8 +126,9 @@ llvm_gcroot(self, 0); llvm_gcroot(value, 0); value = JavaString::getValue(self); - - uint16* java = new uint16[self->count]; + + mvm::ThreadAllocator allocator; + uint16* java = (uint16*)allocator.Allocate(self->count * sizeof(uint16)); for (sint32 i = 0; i < self->count; ++i) { uint16 cur = ArrayUInt16::getElement(value, self->offset + i); @@ -122,6 +137,5 @@ } const UTF8* res = map->lookupOrCreateReader(java, self->count); - delete[] java; return res; } Modified: vmkit/trunk/lib/J3/VMCore/JavaString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaString.h?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaString.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaString.h Sat Jul 10 15:53:56 2010 @@ -50,6 +50,7 @@ static void stringDestructor(JavaString*); static char* strToAsciiz(JavaString* self); + static char* strToAsciiz(JavaString* self, mvm::ThreadAllocator* allocator); static const ArrayUInt16* strToArray(JavaString* self, Jnjvm* vm); /// javaToInternal - Replaces all '/' into '.'. Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Sat Jul 10 15:53:56 2010 @@ -1506,8 +1506,9 @@ // Helper function to run Jnjvm without JIT. extern "C" int StartJnjvmWithoutJIT(int argc, char** argv, char* mainClass) { mvm::Collector::initialise(); - - char** newArgv = new char*[argc + 1]; + + mvm::ThreadAllocator allocator; + char** newArgv = (char**)allocator.Allocate((argc + 1) * sizeof(char*)); memcpy(newArgv + 1, argv, argc * sizeof(char*)); newArgv[0] = newArgv[1]; newArgv[1] = mainClass; @@ -1517,8 +1518,6 @@ mvm::VirtualMachine* vm = mvm::VirtualMachine::createJVM(JCL); vm->runApplication(argc + 1, newArgv); vm->waitForExit(); - - delete[] newArgv; return 0; } Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108057&r1=108056&r2=108057&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Jul 10 15:53:56 2010 @@ -946,7 +946,7 @@ mvm::ThreadAllocator threadAllocator; if (str != 0) { unsigned int len = strlen(str); - char* buf = new char[len + 1]; + char* buf = (char*)threadAllocator.Allocate((len + 1) * sizeof(char)); const char* cur = str; int top = 0; char c = 1; @@ -985,7 +985,6 @@ cur = cur + top + 1; top = 0; } - delete[] buf; } } @@ -998,7 +997,8 @@ uint32 pos = steps; bool isTab = (className->elements[0] == I_TAB ? true : false); uint32 n = steps + len + (isTab ? 0 : 2); - uint16* buf = new uint16[n]; + mvm::ThreadAllocator allocator; + uint16* buf = (uint16*)allocator.Allocate(n * sizeof(uint16)); for (uint32 i = 0; i < steps; i++) { buf[i] = I_TAB; @@ -1018,7 +1018,6 @@ } const UTF8* res = readerConstructUTF8(buf, n); - delete[] buf; return res; } From nicolas.geoffray at lip6.fr Sat Jul 10 14:34:49 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Jul 2010 21:34:49 -0000 Subject: [vmkit-commits] [vmkit] r108058 - in /vmkit/trunk/lib/J3: Classpath/ClasspathMethod.inc Classpath/ClasspathVMStackWalker.inc Compiler/JavaJITCompiler.cpp VMCore/JnjvmClassLoader.cpp Message-ID: <20100710213450.0DCE52A6C12C@llvm.org> Author: geoffray Date: Sat Jul 10 16:34:49 2010 New Revision: 108058 URL: http://llvm.org/viewvc/llvm-project?rev=108058&view=rev Log: Replace uses of malloc with a ThreadAllocator. Modified: vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc?rev=108058&r1=108057&r2=108058&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathMethod.inc Sat Jul 10 16:34:49 2010 @@ -168,7 +168,6 @@ exc = th->getJavaException(); \ } END_CATCH; \ if (exc) { \ - if (size) delete[] buf; \ if (JavaObject::getClass(exc)->isAssignableFrom( \ vm->upcalls->newException)) { \ th->clearException(); \ @@ -231,12 +230,10 @@ RUN_METH(JavaObject, res); } } else { - if (size) delete[] buf; vm->illegalArgumentException("wrong number of arguments"); return NULL; } - if (size) delete[] buf; return res; } Modified: vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc?rev=108058&r1=108057&r2=108058&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathVMStackWalker.inc Sat Jul 10 16:34:49 2010 @@ -55,7 +55,6 @@ delegatee = meth->classDef->getClassDelegatee(vm);; ArrayObject::setElement(result, delegatee, i); } - delete[] buffer; END_NATIVE_EXCEPTION Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=108058&r1=108057&r2=108058&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Sat Jul 10 16:34:49 2010 @@ -440,7 +440,6 @@ vm->runApplication(argc + 1, newArgv); vm->waitForExit(); - delete[] newArgv; return 0; } Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108058&r1=108057&r2=108058&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Sat Jul 10 16:34:49 2010 @@ -567,8 +567,8 @@ bool doThrow) { llvm_gcroot(str, 0); - - UTF8* name = (UTF8*)malloc(sizeof(UTF8) + str->count * sizeof(uint16)); + mvm::ThreadAllocator allocator; + UTF8* name = (UTF8*)allocator.Allocate(sizeof(UTF8) + str->count * sizeof(uint16)); name->size = str->count; if (ArrayUInt16::getElement(JavaString::getValue(str), str->offset) != I_TAB) { @@ -576,7 +576,6 @@ uint16 cur = ArrayUInt16::getElement(JavaString::getValue(str), str->offset + i); if (cur == '.') name->elements[i] = '/'; else if (cur == '/') { - free(name); return 0; } else name->elements[i] = cur; @@ -587,7 +586,6 @@ if (cur == '.') { name->elements[i] = '/'; } else if (cur == '/') { - free(name); return 0; } else { name->elements[i] = cur; @@ -596,23 +594,25 @@ } UserCommonClass* cls = loadClassFromUserUTF8(name, doResolve, doThrow, str); - free(name); return cls; } UserCommonClass* JnjvmClassLoader::lookupClassFromJavaString(JavaString* str) { + const ArrayUInt16* value = NULL; llvm_gcroot(str, 0); + llvm_gcroot(value, 0); + value = JavaString::getValue(str); + mvm::ThreadAllocator allocator; - UTF8* name = (UTF8*)malloc(sizeof(UTF8) + str->count * sizeof(uint16)); + UTF8* name = (UTF8*)allocator.Allocate(sizeof(UTF8) + str->count * sizeof(uint16)); name->size = str->count; for (sint32 i = 0; i < str->count; ++i) { - uint16 cur = ArrayUInt16::getElement(JavaString::getValue(str), str->offset + i); + uint16 cur = ArrayUInt16::getElement(value, str->offset + i); if (cur == '.') name->elements[i] = '/'; else name->elements[i] = cur; } UserCommonClass* cls = lookupClass(name); - free(name); return cls; } From minas.subs at gmail.com Sun Jul 11 21:53:23 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Mon, 12 Jul 2010 09:53:23 +0500 Subject: [vmkit-commits] How to build VMkit without N3; How to build at all? Message-ID: I'm still trying to build vmkit. Since N3 part is not buildable, I've tryed to turn its compilation off, But there was no any halp to do this: ./configure --help prints how to build without J3, but no word how to build without N3. But I've found solution: *** To build vmkit without N3 (currently it is not buildable) run ./configure without both of these keys: --with-pnet-local-prefix --with-mono *** Please, add this asterisk-separated text to docs and to ./configure --help part Thanks == Now, however it doesn't build too, Although now at last no single word about N3, but: <<< make[1]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib' make[1]: Entering directory `/home/mn/tests/VMkit/vmkit/tools/vmjc' llvm[1]: Compiling vmjc.cpp for Debug build llvm[1]: Linking Debug executable vmjc /home/mn/tests/VMkit/vmkit/Debug/lib/libGCMmap2.a(gcinit.o): In function `mvm::Collector::initialise()': /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:22: undefined reference to `GCAllocator::operator new(unsigned long)' /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:22: undefined reference to `GCAllocator::GCAllocator()' /home/mn/tests/VMkit/vmkit/Debug/lib/libGCMmap2.a(gcinit.o): In function `mvm::Collector::destroy()': /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:42: undefined reference to `GCAllocator::~GCAllocator()' /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:42: undefined reference to `GCAllocator::operator delete(void*)' collect2: ld returned 1 exit status make[1]: *** [/home/mn/tests/VMkit/vmkit/Debug/bin/vmjc] Error 1 make[1]: Leaving directory `/home/mn/tests/VMkit/vmkit/tools/vmjc' make: *** [all] Error 1 >>> Is'not this related with latest GC checkins? Regards, Minas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at gmail.com Sun Jul 11 22:22:20 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Sun, 11 Jul 2010 22:22:20 -0700 Subject: [vmkit-commits] How to build VMkit without N3; How to build at all? In-Reply-To: References: Message-ID: Hi Minas, Glad you found the solution. Indeed, not providing any n3 related stuff will make configure disable compilation of n3. For your build problems, I have experienced similar errors due to order of linkage in the Makefile files. Try to move around Allocator.a in tools/vmjc/Makefile to see if that fixes the problem. Nicolas On Sun, Jul 11, 2010 at 9:53 PM, Minas Abrahamyan wrote: > I'm still trying to build vmkit. > Since N3 part is not buildable, I've tryed to turn its compilation off, > But there was no any halp to do this: > ./configure --help prints how to build without J3, but no word how to build > without N3. > > But I've found solution: > *** > To build vmkit without N3 (currently it is not buildable) > run ./configure without both of these keys: > --with-pnet-local-prefix > --with-mono > *** > > Please, add this asterisk-separated text to docs and to ./configure --help > part > Thanks > > == > > Now, however it doesn't build too, Although now at last no single word > about N3, > but: > > <<< > make[1]: Leaving directory `/home/mn/tests/VMkit/vmkit/lib' > make[1]: Entering directory `/home/mn/tests/VMkit/vmkit/tools/vmjc' > llvm[1]: Compiling vmjc.cpp for Debug build > llvm[1]: Linking Debug executable vmjc > /home/mn/tests/VMkit/vmkit/Debug/lib/libGCMmap2.a(gcinit.o): In function > `mvm::Collector::initialise()': > /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:22: undefined > reference to `GCAllocator::operator new(unsigned long)' > /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:22: undefined > reference to `GCAllocator::GCAllocator()' > /home/mn/tests/VMkit/vmkit/Debug/lib/libGCMmap2.a(gcinit.o): In function > `mvm::Collector::destroy()': > /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:42: undefined > reference to `GCAllocator::~GCAllocator()' > /home/mn/tests/VMkit/vmkit/lib/Mvm/GCMmap2/gcinit.cpp:42: undefined > reference to `GCAllocator::operator delete(void*)' > collect2: ld returned 1 exit status > make[1]: *** [/home/mn/tests/VMkit/vmkit/Debug/bin/vmjc] Error 1 > make[1]: Leaving directory `/home/mn/tests/VMkit/vmkit/tools/vmjc' > make: *** [all] Error 1 > >>> > > Is'not this related with latest GC checkins? > > Regards, > Minas > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Tue Jul 13 20:56:40 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jul 2010 03:56:40 -0000 Subject: [vmkit-commits] [vmkit] r108313 - /vmkit/trunk/configure Message-ID: <20100714035640.57E542A6C12C@llvm.org> Author: geoffray Date: Tue Jul 13 22:56:40 2010 New Revision: 108313 URL: http://llvm.org/viewvc/llvm-project?rev=108313&view=rev Log: Regenerated configure. Modified: vmkit/trunk/configure Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=108313&r1=108312&r2=108313&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Tue Jul 13 22:56:40 2010 @@ -1,12 +1,14 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for vmkit 0.28svn. +# Generated by GNU Autoconf 2.65 for vmkit 0.28svn. # # Report bugs to . # +# # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software -# Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -529,7 +531,8 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, @@ -638,6 +641,7 @@ ISOLATE_BUILD SERVICE_BUILD SINGLE_BUILD +MMTK_PLAN GC_LIBS GC_FLAGS GC_SINGLE_MMAP @@ -721,6 +725,7 @@ with_thread with_finalizer with_gc +with_mmtk_plan with_vm_type with_exception_type with_runtime_exception_type @@ -1364,6 +1369,8 @@ --with-finalizer Compile with finalizer (default yes) --with-gc=something GC type ('mmtk' (requires llvm-gcc) 'single-mmap' 'multi-mmap' or 'boehm') + --with-mmtk-plan=something + MMTk plan type ('marksweep') --with-vm-type=something VM type ('single' 'isolate' 'isolate-sharing' or 'service') @@ -1391,7 +1398,7 @@ LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command @@ -1464,7 +1471,7 @@ if $ac_init_version; then cat <<\_ACEOF vmkit configure 0.28svn -generated by GNU Autoconf 2.64 +generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1513,7 +1520,7 @@ ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1550,7 +1557,7 @@ ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1685,7 +1692,7 @@ fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1762,7 +1769,7 @@ # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1800,7 +1807,7 @@ ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1929,7 +1936,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by vmkit $as_me 0.28svn, which was -generated by GNU Autoconf 2.64. Invocation command line was +generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2182,7 +2189,7 @@ for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 @@ -2191,9 +2198,9 @@ done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in @@ -2872,32 +2879,30 @@ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err fi + rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + int main () { -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -2959,10 +2964,10 @@ else ac_file='' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then : - $as_echo "$as_me: failed program was:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 @@ -2970,51 +2975,18 @@ { as_fn_set_status 77 as_fn_error "C compiler cannot create executables See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" @@ -3047,13 +3019,72 @@ as_fn_error "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." "$LINENO" 5; } fi -rm -f conftest$ac_cv_exeext +rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : @@ -3826,6 +3857,16 @@ fi + +# Check whether --with-mmtk-plan was given. +if test "${with_mmtk_plan+set}" = set; then : + withval=$with_mmtk_plan; MMTK_PLAN=$withval +else + MMTK_PLAN=marksweep + +fi + + if test "x$gc" = "xboehm"; then GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/BoehmGC -DGC_THREADS" @@ -3845,7 +3886,6 @@ esac else if test "x$gc" = "xmmtk"; then - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/mmtk/mmtk-j3" GC_MULTI_MMAP=0 GC_SINGLE_MMAP=1 @@ -3857,7 +3897,7 @@ GC_MMTK=1 GC_LIBS=MMTk - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK" + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK -I\$(PROJ_SRC_ROOT)/mmtk/config/\$(MMTK_PLAN)" else GC_LIBS=GCMmap2 if test "x$gc" = "xmulti-mmap"; then @@ -3889,6 +3929,7 @@ + # Check whether --with-vm-type was given. if test "${with_vm_type+set}" = set; then : withval=$with_vm_type; vmtype=$withval @@ -3957,7 +3998,7 @@ if test "x$runtimeexceptiontype" != "xdwarf"; then if test "x$exceptiontype" != "xdwarf"; then - EXCEPTION_FLAGS="-fno-exceptions -Wno-uninitialized" + EXCEPTION_FLAGS="-fno-exceptions" fi fi @@ -4346,8 +4387,8 @@ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err fi + rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -4694,8 +4735,8 @@ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err fi + rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -6090,6 +6131,8 @@ ac_config_files="$ac_config_files tools/llcj/LinkPaths.h" +ac_config_files="$ac_config_files mmtk/java/build.xml" + ac_config_commands="$ac_config_commands Makefile" @@ -6605,7 +6648,7 @@ # values after options handling. ac_log=" This file was extended by vmkit $as_me 0.28svn, which was -generated by GNU Autoconf 2.64. Invocation command line was +generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6645,6 +6688,7 @@ -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -6667,10 +6711,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ vmkit config.status 0.28svn -configured by $0, generated by GNU Autoconf 2.64, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation @@ -6706,6 +6751,8 @@ ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) @@ -6795,6 +6842,7 @@ "lib/N3/PNetLib/PNetPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/PNetLib/PNetPath.inc" ;; "lib/N3/Mono/MonoPath.inc") CONFIG_FILES="$CONFIG_FILES lib/N3/Mono/MonoPath.inc" ;; "tools/llcj/LinkPaths.h") CONFIG_FILES="$CONFIG_FILES tools/llcj/LinkPaths.h" ;; + "mmtk/java/build.xml") CONFIG_FILES="$CONFIG_FILES mmtk/java/build.xml" ;; "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; @@ -6900,7 +6948,7 @@ t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -6914,7 +6962,7 @@ t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p From nicolas.geoffray at lip6.fr Tue Jul 13 20:57:37 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jul 2010 03:57:37 -0000 Subject: [vmkit-commits] [vmkit] r108314 - in /vmkit/trunk: Makefile.config.in autoconf/configure.ac lib/Mvm/Compiler/MMTkInline.inc lib/Mvm/Compiler/Makefile mmtk/Makefile mmtk/config/ mmtk/config/marksweep/ mmtk/config/marksweep/MMTkInline.inc mmtk/config/marksweep/Selected.java mmtk/java/build.xml mmtk/java/build.xml.in mmtk/java/src/org/j3/config/ Message-ID: <20100714035737.B79CF2A6C12C@llvm.org> Author: geoffray Date: Tue Jul 13 22:57:37 2010 New Revision: 108314 URL: http://llvm.org/viewvc/llvm-project?rev=108314&view=rev Log: Create a config directory in mmtk where all plan-specific code will be: - Selected.java - MMTkInline.inc - Any header files. Added: vmkit/trunk/mmtk/config/ vmkit/trunk/mmtk/config/marksweep/ vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc - copied unchanged from r108312, vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc vmkit/trunk/mmtk/config/marksweep/Selected.java - copied unchanged from r108312, vmkit/trunk/mmtk/java/src/org/j3/config/Selected.java vmkit/trunk/mmtk/java/build.xml.in - copied, changed from r108312, vmkit/trunk/mmtk/java/build.xml Removed: vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc vmkit/trunk/mmtk/java/build.xml vmkit/trunk/mmtk/java/src/org/j3/config/ Modified: vmkit/trunk/Makefile.config.in vmkit/trunk/autoconf/configure.ac vmkit/trunk/lib/Mvm/Compiler/Makefile vmkit/trunk/mmtk/Makefile Modified: vmkit/trunk/Makefile.config.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.config.in?rev=108314&r1=108313&r2=108314&view=diff ============================================================================== --- vmkit/trunk/Makefile.config.in (original) +++ vmkit/trunk/Makefile.config.in Tue Jul 13 22:57:37 2010 @@ -9,6 +9,7 @@ GC_BOEHM = @GC_BOEHM@ GC_MMAP2 = @GC_MMAP2@ GC_MMTK = @GC_MMTK@ +MMTK_PLAN = @MMTK_PLAN@ ISOLATE_BUILD = @ISOLATE_BUILD@ SERVICE_BUILD = @SERVICE_BUILD@ SINGLE_BUILD = @SINGLE_BUILD@ Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=108314&r1=108313&r2=108314&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Jul 13 22:57:37 2010 @@ -220,6 +220,13 @@ ]] ) +AC_ARG_WITH(mmtk-plan, + [AS_HELP_STRING(--with-mmtk-plan=something, + [MMTk plan type ('marksweep')])], + [[MMTK_PLAN=$withval]], + [[MMTK_PLAN=marksweep]] +) + if test "x$gc" = "xboehm"; then GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/BoehmGC -DGC_THREADS" AC_DEFINE([USE_GC_BOEHM], [1], [Using the boehm gc]) @@ -234,14 +241,13 @@ esac else if test "x$gc" = "xmmtk"; then - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/mmtk/mmtk-j3" AC_SUBST([GC_MULTI_MMAP], [0]) AC_SUBST([GC_SINGLE_MMAP], [1]) AC_SUBST(GC_MMAP2, [0]) AC_SUBST(GC_BOEHM, [0]) AC_SUBST(GC_MMTK, [1]) GC_LIBS=MMTk - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK" + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK -I\$(PROJ_SRC_ROOT)/mmtk/config/\$(MMTK_PLAN)" else GC_LIBS=GCMmap2 if test "x$gc" = "xmulti-mmap"; then @@ -262,6 +268,7 @@ AC_SUBST([GC_FLAGS]) AC_SUBST([GC_LIBS]) +AC_SUBST([MMTK_PLAN]) dnl ************************************************************************** dnl Virtual Machine type @@ -614,6 +621,7 @@ AC_CONFIG_FILES([lib/N3/PNetLib/PNetPath.inc]) AC_CONFIG_FILES([lib/N3/Mono/MonoPath.inc]) AC_CONFIG_FILES([tools/llcj/LinkPaths.h]) +AC_CONFIG_FILES([mmtk/java/build.xml]) dnl Do special configuration of Makefiles AC_CONFIG_MAKEFILE(Makefile) Removed: vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc?rev=108313&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc (original) +++ vmkit/trunk/lib/Mvm/Compiler/MMTkInline.inc (removed) @@ -1,1891 +0,0 @@ -// Generated by llvm2cpp - DO NOT MODIFY! - - -Function* makeLLVMFunction(Module *mod) { - -// Type Definitions -PointerType* PointerTy_0 = PointerType::get(IntegerType::get(mod->getContext(), 8), 0); - -std::vectorFuncTy_1_args; -FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_1_args.push_back(PointerTy_0); -FunctionType* FuncTy_1 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_1_args, - /*isVarArg=*/false); - -std::vectorFuncTy_3_args; -FuncTy_3_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_3 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_3_args, - /*isVarArg=*/false); - -PointerType* PointerTy_2 = PointerType::get(FuncTy_3, 0); - -std::vectorStructTy_struct_mvm__MutatorThread_fields; -std::vectorStructTy_struct_mvm__Thread_fields; -std::vectorStructTy_struct_mvm__CircularBase_fields; -std::vectorFuncTy_7_args; -FunctionType* FuncTy_7 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), - /*Params=*/FuncTy_7_args, - /*isVarArg=*/true); - -PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0); - -PointerType* PointerTy_5 = PointerType::get(PointerTy_6, 0); - -StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_5); -PATypeHolder StructTy_struct_mvm__CircularBase_fwd = OpaqueType::get(mod->getContext()); -PointerType* PointerTy_8 = PointerType::get(StructTy_struct_mvm__CircularBase_fwd, 0); - -StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8); -StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8); -StructType* StructTy_struct_mvm__CircularBase = StructType::get(mod->getContext(), StructTy_struct_mvm__CircularBase_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::CircularBase", StructTy_struct_mvm__CircularBase); -cast(StructTy_struct_mvm__CircularBase_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__CircularBase); -StructTy_struct_mvm__CircularBase = cast(StructTy_struct_mvm__CircularBase_fwd.get()); - - -StructTy_struct_mvm__Thread_fields.push_back(StructTy_struct_mvm__CircularBase); -StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 32)); -std::vectorStructTy_struct_mvm__VirtualMachine_fields; -StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_5); -std::vectorStructTy_struct_mvm__BumpPtrAllocator_fields; -std::vectorStructTy_struct_mvm__SpinLock_fields; -StructTy_struct_mvm__SpinLock_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructType* StructTy_struct_mvm__SpinLock = StructType::get(mod->getContext(), StructTy_struct_mvm__SpinLock_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::SpinLock", StructTy_struct_mvm__SpinLock); - -StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_mvm__SpinLock); -std::vectorStructTy_struct_llvm__BumpPtrAllocator_fields; -StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); -std::vectorStructTy_struct_gcRoot_fields; -StructTy_struct_gcRoot_fields.push_back(PointerTy_5); -StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false); -mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot); - -PointerType* PointerTy_11 = PointerType::get(StructTy_struct_gcRoot, 0); - -StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_11); -std::vectorStructTy_struct_llvm__MemSlab_fields; -StructTy_struct_llvm__MemSlab_fields.push_back(IntegerType::get(mod->getContext(), 32)); -PATypeHolder PointerTy_12_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_llvm__MemSlab_fields.push_back(PointerTy_12_fwd); -StructType* StructTy_struct_llvm__MemSlab = StructType::get(mod->getContext(), StructTy_struct_llvm__MemSlab_fields, /*isPacked=*/false); -mod->addTypeName("struct.llvm::MemSlab", StructTy_struct_llvm__MemSlab); - -PointerType* PointerTy_12 = PointerType::get(StructTy_struct_llvm__MemSlab, 0); -cast(PointerTy_12_fwd.get())->refineAbstractTypeTo(PointerTy_12); -PointerTy_12 = cast(PointerTy_12_fwd.get()); - - -StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_12); -StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0); -StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0); -StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructType* StructTy_struct_llvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_llvm__BumpPtrAllocator_fields, /*isPacked=*/false); -mod->addTypeName("struct.llvm::BumpPtrAllocator", StructTy_struct_llvm__BumpPtrAllocator); - -StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator); -StructType* StructTy_struct_mvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__BumpPtrAllocator_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::BumpPtrAllocator", StructTy_struct_mvm__BumpPtrAllocator); - -PointerType* PointerTy_10 = PointerType::get(StructTy_struct_mvm__BumpPtrAllocator, 0); - -StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_10); -PATypeHolder StructTy_struct_mvm__Thread_fwd = OpaqueType::get(mod->getContext()); -PointerType* PointerTy_13 = PointerType::get(StructTy_struct_mvm__Thread_fwd, 0); - -StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_13); -StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); -std::vectorStructTy_struct_mvm__ReferenceQueue_fields; -std::vectorStructTy_struct_gc_fields; -StructTy_struct_gc_fields.push_back(StructTy_struct_gcRoot); -StructType* StructTy_struct_gc = StructType::get(mod->getContext(), StructTy_struct_gc_fields, /*isPacked=*/false); -mod->addTypeName("struct.gc", StructTy_struct_gc); - -PointerType* PointerTy_15 = PointerType::get(StructTy_struct_gc, 0); - -PointerType* PointerTy_14 = PointerType::get(PointerTy_15, 0); - -StructTy_struct_mvm__ReferenceQueue_fields.push_back(PointerTy_14); -StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__ReferenceQueue_fields.push_back(StructTy_struct_mvm__SpinLock); -StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructType* StructTy_struct_mvm__ReferenceQueue = StructType::get(mod->getContext(), StructTy_struct_mvm__ReferenceQueue_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::ReferenceQueue", StructTy_struct_mvm__ReferenceQueue); - -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); -StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); -StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); -StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); -std::vectorStructTy_struct_mvm__Cond_fields; -std::vectorStructTy_union_pthread_cond_t_fields; -std::vectorStructTy_struct__2__13_fields; -StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); -StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); -StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64)); -StructTy_struct__2__13_fields.push_back(PointerTy_0); -StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructType* StructTy_struct__2__13 = StructType::get(mod->getContext(), StructTy_struct__2__13_fields, /*isPacked=*/false); -mod->addTypeName("struct..2._13", StructTy_struct__2__13); - -StructTy_union_pthread_cond_t_fields.push_back(StructTy_struct__2__13); -ArrayType* ArrayTy_16 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1); - -StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_16); -StructType* StructTy_union_pthread_cond_t = StructType::get(mod->getContext(), StructTy_union_pthread_cond_t_fields, /*isPacked=*/false); -mod->addTypeName("union.pthread_cond_t", StructTy_union_pthread_cond_t); - -StructTy_struct_mvm__Cond_fields.push_back(StructTy_union_pthread_cond_t); -StructType* StructTy_struct_mvm__Cond = StructType::get(mod->getContext(), StructTy_struct_mvm__Cond_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::Cond", StructTy_struct_mvm__Cond); - -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond); -std::vectorStructTy_struct_mvm__LockNormal_fields; -std::vectorStructTy_struct_mvm__Lock_fields; -StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5); -StructTy_struct_mvm__Lock_fields.push_back(PointerTy_13); -std::vectorStructTy_union_pthread_mutex_t_fields; -std::vectorStructTy_struct__1__pthread_mutex_s_fields; -StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct__1__pthread_mutex_s_fields.push_back(StructTy_struct_mvm__SpinLock); -StructType* StructTy_struct__1__pthread_mutex_s = StructType::get(mod->getContext(), StructTy_struct__1__pthread_mutex_s_fields, /*isPacked=*/false); -mod->addTypeName("struct..1__pthread_mutex_s", StructTy_struct__1__pthread_mutex_s); - -StructTy_union_pthread_mutex_t_fields.push_back(StructTy_struct__1__pthread_mutex_s); -StructType* StructTy_union_pthread_mutex_t = StructType::get(mod->getContext(), StructTy_union_pthread_mutex_t_fields, /*isPacked=*/false); -mod->addTypeName("union.pthread_mutex_t", StructTy_union_pthread_mutex_t); - -StructTy_struct_mvm__Lock_fields.push_back(StructTy_union_pthread_mutex_t); -StructType* StructTy_struct_mvm__Lock = StructType::get(mod->getContext(), StructTy_struct_mvm__Lock_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::Lock", StructTy_struct_mvm__Lock); - -StructTy_struct_mvm__LockNormal_fields.push_back(StructTy_struct_mvm__Lock); -StructType* StructTy_struct_mvm__LockNormal = StructType::get(mod->getContext(), StructTy_struct_mvm__LockNormal_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::LockNormal", StructTy_struct_mvm__LockNormal); - -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal); -StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14); -StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock); -StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_11); -std::vectorStructTy_struct_mvm__CollectionRV_fields; -StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__LockNormal); -StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond); -StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond); -StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructType* StructTy_struct_mvm__CollectionRV = StructType::get(mod->getContext(), StructTy_struct_mvm__CollectionRV_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::CollectionRV", StructTy_struct_mvm__CollectionRV); - -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__CollectionRV); -std::vectorStructTy_struct_mvm__StartEndFunctionMap_fields; -std::vectorStructTy_struct_mvm__FunctionMap_fields; -std::vectorStructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields; -std::vectorStructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields; -std::vectorStructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields; -std::vectorStructTy_struct___gnu_cxx__new_allocator_gc___fields; -StructTy_struct___gnu_cxx__new_allocator_gc___fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructType* StructTy_struct___gnu_cxx__new_allocator_gc__ = StructType::get(mod->getContext(), StructTy_struct___gnu_cxx__new_allocator_gc___fields, /*isPacked=*/true); -mod->addTypeName("struct.__gnu_cxx::new_allocator", StructTy_struct___gnu_cxx__new_allocator_gc__); - -StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct___gnu_cxx__new_allocator_gc__); -std::vectorStructTy_struct_std___Rb_tree_node_base_fields; -StructTy_struct_std___Rb_tree_node_base_fields.push_back(IntegerType::get(mod->getContext(), 32)); -PATypeHolder StructTy_struct_std___Rb_tree_node_base_fwd = OpaqueType::get(mod->getContext()); -PointerType* PointerTy_17 = PointerType::get(StructTy_struct_std___Rb_tree_node_base_fwd, 0); - -StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); -StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); -StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17); -StructType* StructTy_struct_std___Rb_tree_node_base = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_node_base_fields, /*isPacked=*/false); -mod->addTypeName("struct.std::_Rb_tree_node_base", StructTy_struct_std___Rb_tree_node_base); -cast(StructTy_struct_std___Rb_tree_node_base_fwd.get())->refineAbstractTypeTo(StructTy_struct_std___Rb_tree_node_base); -StructTy_struct_std___Rb_tree_node_base = cast(StructTy_struct_std___Rb_tree_node_base_fwd.get()); - - -StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct_std___Rb_tree_node_base); -StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields, /*isPacked=*/false); -mod->addTypeName("struct.std::_Rb_tree,std::_Select1st >,std::less,std::allocator > >::_Rb_tree_impl,false>", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_); - -StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_); -StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false); -mod->addTypeName("struct.std::_Rb_tree,std::_Select1st >,std::less,std::allocator > >", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); - -StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); -StructType* StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false); -mod->addTypeName("struct.std::map,std::allocator > >", StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); - -StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______); -StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_mvm__SpinLock); -StructType* StructTy_struct_mvm__FunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__FunctionMap_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::FunctionMap", StructTy_struct_mvm__FunctionMap); - -StructTy_struct_mvm__StartEndFunctionMap_fields.push_back(StructTy_struct_mvm__FunctionMap); -StructType* StructTy_struct_mvm__StartEndFunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__StartEndFunctionMap_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::StartEndFunctionMap", StructTy_struct_mvm__StartEndFunctionMap); - -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap); -StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap); -StructType* StructTy_struct_mvm__VirtualMachine = StructType::get(mod->getContext(), StructTy_struct_mvm__VirtualMachine_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::VirtualMachine", StructTy_struct_mvm__VirtualMachine); - -PointerType* PointerTy_9 = PointerType::get(StructTy_struct_mvm__VirtualMachine, 0); - -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_9); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); -StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0); -std::vectorFuncTy_19_args; -FuncTy_19_args.push_back(PointerTy_13); -FunctionType* FuncTy_19 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_19_args, - /*isVarArg=*/false); - -PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); - -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18); -std::vectorStructTy_struct_mvm__KnownFrame_fields; -PATypeHolder PointerTy_20_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_20_fwd); -StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0); -StructType* StructTy_struct_mvm__KnownFrame = StructType::get(mod->getContext(), StructTy_struct_mvm__KnownFrame_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::KnownFrame", StructTy_struct_mvm__KnownFrame); - -PointerType* PointerTy_20 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0); -cast(PointerTy_20_fwd.get())->refineAbstractTypeTo(PointerTy_20); -PointerTy_20 = cast(PointerTy_20_fwd.get()); - - -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20); -std::vectorStructTy_struct_mvm__ExceptionBuffer_fields; -PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext()); -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd); -std::vectorStructTy_struct___jmp_buf_tag_fields; -ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6); - -StructTy_struct___jmp_buf_tag_fields.push_back(ArrayTy_23); -StructTy_struct___jmp_buf_tag_fields.push_back(IntegerType::get(mod->getContext(), 32)); -std::vectorStructTy_struct___sigset_t_fields; -ArrayType* ArrayTy_24 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32); - -StructTy_struct___sigset_t_fields.push_back(ArrayTy_24); -StructType* StructTy_struct___sigset_t = StructType::get(mod->getContext(), StructTy_struct___sigset_t_fields, /*isPacked=*/false); -mod->addTypeName("struct.__sigset_t", StructTy_struct___sigset_t); - -StructTy_struct___jmp_buf_tag_fields.push_back(StructTy_struct___sigset_t); -StructType* StructTy_struct___jmp_buf_tag = StructType::get(mod->getContext(), StructTy_struct___jmp_buf_tag_fields, /*isPacked=*/false); -mod->addTypeName("struct.__jmp_buf_tag", StructTy_struct___jmp_buf_tag); - -ArrayType* ArrayTy_22 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1); - -StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22); -StructType* StructTy_struct_mvm__ExceptionBuffer = StructType::get(mod->getContext(), StructTy_struct_mvm__ExceptionBuffer_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::ExceptionBuffer", StructTy_struct_mvm__ExceptionBuffer); - -PointerType* PointerTy_21 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0); -cast(PointerTy_21_fwd.get())->refineAbstractTypeTo(PointerTy_21); -PointerTy_21 = cast(PointerTy_21_fwd.get()); - - -StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21); -StructType* StructTy_struct_mvm__Thread = StructType::get(mod->getContext(), StructTy_struct_mvm__Thread_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::Thread", StructTy_struct_mvm__Thread); -cast(StructTy_struct_mvm__Thread_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__Thread); -StructTy_struct_mvm__Thread = cast(StructTy_struct_mvm__Thread_fwd.get()); - - -StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread); -StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator); -StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32)); -StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18); -StructType* StructTy_struct_mvm__MutatorThread = StructType::get(mod->getContext(), StructTy_struct_mvm__MutatorThread_fields, /*isPacked=*/false); -mod->addTypeName("struct.mvm::MutatorThread", StructTy_struct_mvm__MutatorThread); - -PointerType* PointerTy_4 = PointerType::get(StructTy_struct_mvm__MutatorThread, 0); - -PointerType* PointerTy_25 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0); - -std::vectorStructTy_struct_j3__JavaObject_fields; -StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_gc); -StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_mvm__SpinLock); -StructType* StructTy_struct_j3__JavaObject = StructType::get(mod->getContext(), StructTy_struct_j3__JavaObject_fields, /*isPacked=*/false); -mod->addTypeName("struct.j3::JavaObject", StructTy_struct_j3__JavaObject); - -PointerType* PointerTy_26 = PointerType::get(StructTy_struct_j3__JavaObject, 0); - -std::vectorFuncTy_28_args; -FunctionType* FuncTy_28 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_28_args, - /*isVarArg=*/false); - -PointerType* PointerTy_27 = PointerType::get(FuncTy_28, 0); - -std::vectorStructTy_JavaObject_fields; -ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_6, 0); -mod->addTypeName("VT", ArrayTy_VT); - -PointerType* PointerTy_31 = PointerType::get(ArrayTy_VT, 0); - -StructTy_JavaObject_fields.push_back(PointerTy_31); -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_30 = PointerType::get(StructTy_JavaObject, 0); - -PointerType* PointerTy_29 = PointerType::get(PointerTy_30, 0); - -PointerType* PointerTy_32 = PointerType::get(PointerTy_0, 0); - -std::vectorFuncTy_34_args; -FuncTy_34_args.push_back(PointerTy_30); -FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 32)); -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_30, - /*Params=*/FuncTy_34_args, - /*isVarArg=*/false); - -PointerType* PointerTy_33 = PointerType::get(FuncTy_34, 0); - -PointerType* PointerTy_35 = PointerType::get(PointerTy_31, 0); - -std::vectorFuncTy_37_args; -FuncTy_37_args.push_back(PointerTy_30); -FuncTy_37_args.push_back(PointerTy_30); -FuncTy_37_args.push_back(PointerTy_30); -FuncTy_37_args.push_back(IntegerType::get(mod->getContext(), 32)); -FuncTy_37_args.push_back(IntegerType::get(mod->getContext(), 32)); -FunctionType* FuncTy_37 = FunctionType::get( - /*Result=*/PointerTy_30, - /*Params=*/FuncTy_37_args, - /*isVarArg=*/false); - -PointerType* PointerTy_36 = PointerType::get(FuncTy_37, 0); - -PointerType* PointerTy_38 = PointerType::get(StructTy_struct_mvm__SpinLock, 0); - -std::vectorStructTy_40_fields; -std::vectorStructTy_41_fields; -std::vectorStructTy_42_fields; -StructTy_42_fields.push_back(StructTy_JavaObject); -StructTy_42_fields.push_back(PointerTy_30); -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_30); -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_30); -StructTy_42_fields.push_back(PointerTy_30); -StructTy_42_fields.push_back(PointerTy_30); -StructTy_42_fields.push_back(PointerTy_30); -StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructType* StructTy_42 = StructType::get(mod->getContext(), StructTy_42_fields, /*isPacked=*/false); - -StructTy_41_fields.push_back(StructTy_42); -StructTy_41_fields.push_back(PointerTy_30); -StructTy_41_fields.push_back(PointerTy_30); -StructTy_41_fields.push_back(PointerTy_30); -StructTy_41_fields.push_back(PointerTy_30); -StructTy_41_fields.push_back(PointerTy_30); -StructTy_41_fields.push_back(PointerTy_30); -StructTy_41_fields.push_back(PointerTy_30); -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_30); -StructTy_40_fields.push_back(PointerTy_30); -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); - -PointerType* PointerTy_39 = PointerType::get(StructTy_40, 0); - -std::vectorStructTy_44_fields; -StructTy_44_fields.push_back(StructTy_42); -StructTy_44_fields.push_back(PointerTy_30); -StructType* StructTy_44 = StructType::get(mod->getContext(), StructTy_44_fields, /*isPacked=*/false); - -PointerType* PointerTy_43 = PointerType::get(StructTy_44, 0); - -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_30); -StructTy_46_fields.push_back(IntegerType::get(mod->getContext(), 8)); -StructTy_46_fields.push_back(PointerTy_30); -StructType* StructTy_46 = StructType::get(mod->getContext(), StructTy_46_fields, /*isPacked=*/false); - -PointerType* PointerTy_45 = PointerType::get(StructTy_46, 0); - -std::vectorStructTy_49_fields; -StructTy_49_fields.push_back(PointerTy_30); -StructTy_49_fields.push_back(PointerTy_30); -StructTy_49_fields.push_back(PointerTy_30); -StructTy_49_fields.push_back(PointerTy_30); -StructType* StructTy_49 = StructType::get(mod->getContext(), StructTy_49_fields, /*isPacked=*/false); - -PointerType* PointerTy_48 = PointerType::get(StructTy_49, 0); - -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_51_args, - /*isVarArg=*/false); - -PointerType* PointerTy_50 = PointerType::get(FuncTy_51, 0); - -std::vectorFuncTy_53_args; -FuncTy_53_args.push_back(PointerTy_25); -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_53_args, - /*isVarArg=*/false); - -PointerType* PointerTy_52 = PointerType::get(FuncTy_53, 0); - - -// Function Declarations - -Function* func_llvm_frameaddress = Function::Create( - /*Type=*/FuncTy_3, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"llvm.frameaddress", mod); // (external, no body) -func_llvm_frameaddress->setCallingConv(CallingConv::C); -AttrListPtr func_llvm_frameaddress_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind | Attribute::ReadNone; - Attrs.push_back(PAWI); - func_llvm_frameaddress_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); - -Function* func_abort = Function::Create( - /*Type=*/FuncTy_28, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"abort", mod); // (external, no body) -func_abort->setCallingConv(CallingConv::C); -AttrListPtr func_abort_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_abort->setAttributes(func_abort_PAL); - -Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create( - /*Type=*/FuncTy_34, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III", mod); -func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setCallingConv(CallingConv::C); -AttrListPtr func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; - Attrs.push_back(PAWI); - func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL); - -Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( - /*Type=*/FuncTy_37, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II", mod); -func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setCallingConv(CallingConv::C); -AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; - Attrs.push_back(PAWI); - func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setAttributes(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL); - -Function* func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III = Function::Create( - /*Type=*/FuncTy_34, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III", mod); -func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setCallingConv(CallingConv::C); -AttrListPtr func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; - Attrs.push_back(PAWI); - func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL); - -Function* func_llvm_memory_barrier = Function::Create( - /*Type=*/FuncTy_51, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"llvm.memory.barrier", mod); // (external, no body) -func_llvm_memory_barrier->setCallingConv(CallingConv::C); -AttrListPtr func_llvm_memory_barrier_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_llvm_memory_barrier_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL); - -Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create( - /*Type=*/FuncTy_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); -AttrListPtr func_llvm_atomic_cmp_swap_i32_p0i32_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoCapture; - Attrs.push_back(PAWI); - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_llvm_atomic_cmp_swap_i32_p0i32_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL); - -Function* func__ZN3mvm6Thread5yieldEv = Function::Create( - /*Type=*/FuncTy_28, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) -func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C); -AttrListPtr func__ZN3mvm6Thread5yieldEv_PAL; -func__ZN3mvm6Thread5yieldEv->setAttributes(func__ZN3mvm6Thread5yieldEv_PAL); - -// Global Variable Declarations - -GlobalVariable* gvar_struct_finalObject87 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_40, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject87"); - -GlobalVariable* gvar_struct_finalObject39 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_44, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject39"); - -GlobalVariable* gvar_struct_finalObject64 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_46, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject64"); - -GlobalVariable* gvar_struct_org_mmtk_utility_DoublyLinkedList_static = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_49, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/"org_mmtk_utility_DoublyLinkedList_static"); - -GlobalVariable* gvar_struct_finalObject105 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_40, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject105"); - -GlobalVariable* gvar_struct_finalObject121 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_46, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject121"); - -GlobalVariable* gvar_struct_finalObject142 = new GlobalVariable(/*Module=*/ *mod, -/*Type=*/StructTy_40, -/*isConstant=*/false, -/*Linkage=*/GlobalValue::ExternalLinkage, -/*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject142"); - -// Constant Definitions -ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); -ConstantInt* const_int32_55 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10)); -ConstantInt* const_int32_56 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); -ConstantInt* const_int32_57 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10)); -ConstantInt* const_int32_58 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10)); -ConstantInt* const_int32_59 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8193"), 10)); -ConstantInt* const_int32_60 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("4"), 10)); -ConstantInt* const_int32_61 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("7"), 10)); -ConstantInt* const_int32_62 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8"), 10)); -ConstantInt* const_int32_63 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-1"), 10)); -ConstantInt* const_int32_64 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("63"), 10)); -ConstantInt* const_int32_65 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("127"), 10)); -ConstantInt* const_int32_66 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("255"), 10)); -ConstantInt* const_int32_67 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("511"), 10)); -ConstantInt* const_int32_68 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2047"), 10)); -ConstantInt* const_int32_69 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("10"), 10)); -ConstantInt* const_int32_70 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("32"), 10)); -ConstantInt* const_int32_71 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("12"), 10)); -ConstantInt* const_int32_72 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10)); -ConstantInt* const_int32_73 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("16"), 10)); -ConstantInt* const_int32_74 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("6"), 10)); -ConstantInt* const_int32_75 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("20"), 10)); -ConstantInt* const_int32_76 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10)); -ConstantInt* const_int32_77 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); -ConstantPointerNull* const_ptr_78 = ConstantPointerNull::get(PointerTy_31); -std::vector const_ptr_79_indices; -const_ptr_79_indices.push_back(const_int32_56); -const_ptr_79_indices.push_back(const_int32_58); -Constant* const_ptr_79 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject87, &const_ptr_79_indices[0], const_ptr_79_indices.size()); -ConstantInt* const_int8_80 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("-4"), 10)); -std::vector const_ptr_81_indices; -const_ptr_81_indices.push_back(const_int32_56); -const_ptr_81_indices.push_back(const_int32_77); -Constant* const_ptr_81 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject39, &const_ptr_81_indices[0], const_ptr_81_indices.size()); -std::vector const_ptr_82_indices; -const_ptr_82_indices.push_back(const_int32_56); -const_ptr_82_indices.push_back(const_int32_77); -Constant* const_ptr_82 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject64, &const_ptr_82_indices[0], const_ptr_82_indices.size()); -std::vector const_ptr_83_indices; -const_ptr_83_indices.push_back(const_int32_56); -const_ptr_83_indices.push_back(const_int32_54); -Constant* const_ptr_83 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject64, &const_ptr_83_indices[0], const_ptr_83_indices.size()); -ConstantInt* const_int32_84 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); -ConstantPointerNull* const_ptr_85 = ConstantPointerNull::get(PointerTy_0); -std::vector const_ptr_86_indices; -const_ptr_86_indices.push_back(const_int32_56); -const_ptr_86_indices.push_back(const_int32_58); -Constant* const_ptr_86 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_86_indices[0], const_ptr_86_indices.size()); -ConstantPointerNull* const_ptr_87 = ConstantPointerNull::get(PointerTy_30); -ConstantInt* const_int32_88 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); -ConstantInt* const_int1_89 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10)); -std::vector const_ptr_90_indices; -const_ptr_90_indices.push_back(const_int32_56); -const_ptr_90_indices.push_back(const_int32_58); -Constant* const_ptr_90 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject105, &const_ptr_90_indices[0], const_ptr_90_indices.size()); -std::vector const_ptr_91_indices; -const_ptr_91_indices.push_back(const_int32_56); -const_ptr_91_indices.push_back(const_int32_77); -Constant* const_ptr_91 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject121, &const_ptr_91_indices[0], const_ptr_91_indices.size()); -std::vector const_ptr_92_indices; -const_ptr_92_indices.push_back(const_int32_56); -const_ptr_92_indices.push_back(const_int32_54); -Constant* const_ptr_92 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject121, &const_ptr_92_indices[0], const_ptr_92_indices.size()); -std::vector const_ptr_93_indices; -const_ptr_93_indices.push_back(const_int32_56); -const_ptr_93_indices.push_back(const_int32_58); -Constant* const_ptr_93 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject142, &const_ptr_93_indices[0], const_ptr_93_indices.size()); - -// Global Variable Definitions - -Function* func_gcmalloc = Function::Create( - /*Type=*/FuncTy_1, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"gcmalloc", mod); -func_gcmalloc->setCallingConv(CallingConv::C); -AttrListPtr func_gcmalloc_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -func_gcmalloc->setAttributes(func_gcmalloc_PAL); -Function::arg_iterator args = func_gcmalloc->arg_begin(); -Value* int32_sz = args++; -int32_sz->setName("sz"); -Value* ptr_VT = args++; -ptr_VT->setName("VT"); - -BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",func_gcmalloc,0); -BasicBlock* label_tableswitch_i_i1_i = BasicBlock::Create(mod->getContext(), "tableswitch.i.i1.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF__i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IFNE_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IFEQ_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_tableswitch3_i_i4_i = BasicBlock::Create(mod->getContext(), "tableswitch3.i.i4.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_4_i_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i6.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_6_i_i_i7_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i7.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_7_i_i1_i8_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i8.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_8_i_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i9.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_9_i_i_i10_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i10.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT16_i_i_i11_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i11.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT17_i_i_i12_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i12.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT18_i_i_i13_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i13.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT19_i_i_i14_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i14.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT20_i_i_i15_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i15.i.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF__i17_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i17.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IFNE_i21_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i21.i.i.i",func_gcmalloc,0); -BasicBlock* label_tableswitch5_i_i6_i = BasicBlock::Create(mod->getContext(), "tableswitch5.i.i6.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF__i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i",func_gcmalloc,0); -BasicBlock* label_tableswitch_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch.i.i.i",func_gcmalloc,0); -BasicBlock* label_tableswitch1_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch1.i.i.i",func_gcmalloc,0); -BasicBlock* label_tableswitch2_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch2.i.i.i",func_gcmalloc,0); -BasicBlock* label_tableswitch3_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch3.i.i.i",func_gcmalloc,0); -BasicBlock* label_true_IF_NULL_i1_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_1_i3_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_true_IFNULL_i5_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_bb_i_i34_i = BasicBlock::Create(mod->getContext(), "bb.i.i34.i",func_gcmalloc,0); -BasicBlock* label_bb1_i_i35_i = BasicBlock::Create(mod->getContext(), "bb1.i.i35.i",func_gcmalloc,0); -BasicBlock* label_bb2_i_i36_i = BasicBlock::Create(mod->getContext(), "bb2.i.i36.i",func_gcmalloc,0); -BasicBlock* label_bb4_preheader_i_i37_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i37.i",func_gcmalloc,0); -BasicBlock* label_bb3_i_i38_i = BasicBlock::Create(mod->getContext(), "bb3.i.i38.i",func_gcmalloc,0); -BasicBlock* label_false_IFNE_i7_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_true_IFNULL3_i8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i.i.i.i",func_gcmalloc,0); -BasicBlock* label_tableswitch4_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch4.i.i.i",func_gcmalloc,0); -BasicBlock* label_tableswitch5_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch5.i.i.i",func_gcmalloc,0); -BasicBlock* label_true_IF_NULL_i1_i_i3_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i3.i.i.i",func_gcmalloc,0); -BasicBlock* label_GOTO_or_IF_1_i3_i_i5_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i5.i.i.i",func_gcmalloc,0); -BasicBlock* label_true_IFNULL_i5_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i6.i.i.i",func_gcmalloc,0); -BasicBlock* label_bb_i_i_i = BasicBlock::Create(mod->getContext(), "bb.i.i.i",func_gcmalloc,0); -BasicBlock* label_bb1_i_i_i = BasicBlock::Create(mod->getContext(), "bb1.i.i.i",func_gcmalloc,0); -BasicBlock* label_bb2_i_i_i = BasicBlock::Create(mod->getContext(), "bb2.i.i.i",func_gcmalloc,0); -BasicBlock* label_bb4_preheader_i_i_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i.i",func_gcmalloc,0); -BasicBlock* label_bb3_i_i_i = BasicBlock::Create(mod->getContext(), "bb3.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IFNE_i7_i_i8_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i8.i.i.i",func_gcmalloc,0); -BasicBlock* label_true_IFNULL3_i8_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i9.i.i.i",func_gcmalloc,0); -BasicBlock* label_false_IFNE_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i.i",func_gcmalloc,0); -BasicBlock* label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit = BasicBlock::Create(mod->getContext(), "JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit",func_gcmalloc,0); - -// Block entry (label_entry) -BinaryOperator* int32_94 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_54, "", label_entry); -BinaryOperator* int32_95 = BinaryOperator::Create(Instruction::And, int32_94, const_int32_55, "", label_entry); -CallInst* ptr_96 = CallInst::Create(func_llvm_frameaddress, const_int32_56, "", label_entry); -ptr_96->setCallingConv(CallingConv::C); -ptr_96->setTailCall(true);AttrListPtr ptr_96_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_96_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_96->setAttributes(ptr_96_PAL); - -CastInst* int32_97 = new PtrToIntInst(ptr_96, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_98 = BinaryOperator::Create(Instruction::And, int32_97, const_int32_57, "", label_entry); -CastInst* ptr_99 = new IntToPtrInst(int32_98, PointerTy_4, "", label_entry); -std::vector ptr_100_indices; -ptr_100_indices.push_back(const_int32_56); -ptr_100_indices.push_back(const_int32_58); -Instruction* ptr_100 = GetElementPtrInst::Create(ptr_99, ptr_100_indices.begin(), ptr_100_indices.end(), "", label_entry); -LoadInst* int32_101 = new LoadInst(ptr_100, "", false, label_entry); -CastInst* ptr_102 = new IntToPtrInst(int32_101, PointerTy_26, "", label_entry); -ICmpInst* int1_103 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_95, const_int32_59, ""); -SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_103, const_int32_56, const_int32_60, "storemerge.i.i", label_entry); -SwitchInst* void_104 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i1_i, 7, label_entry); -void_104->addCase(const_int32_56, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -void_104->addCase(const_int32_58, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -void_104->addCase(const_int32_54, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -void_104->addCase(const_int32_60, label_tableswitch3_i_i4_i); -void_104->addCase(const_int32_61, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -void_104->addCase(const_int32_62, label_tableswitch5_i_i6_i); - - -// Block tableswitch.i.i1.i (label_tableswitch_i_i1_i) -CallInst* void_105 = CallInst::Create(func_abort, "", label_tableswitch_i_i1_i); -void_105->setCallingConv(CallingConv::C); -void_105->setTailCall(true);AttrListPtr void_105_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_105_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_105->setAttributes(void_105_PAL); - -new UnreachableInst(mod->getContext(), label_tableswitch_i_i1_i); - -// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i) -GetElementPtrInst* ptr_107 = GetElementPtrInst::Create(ptr_102, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -CastInst* ptr_108 = new BitCastInst(ptr_107, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -LoadInst* ptr_109 = new LoadInst(ptr_108, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -BinaryOperator* int32_110 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -ICmpInst* int1_111 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_111, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); - -// Block GOTO or IF*4.i.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i_i) -ICmpInst* int1_113 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_113, label_GOTO_or_IF_4_i_i_i_i_i_i); - -// Block GOTO or IF*6.i.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i_i) -ICmpInst* int1_115 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_115, label_GOTO_or_IF_6_i_i_i_i_i_i); - -// Block GOTO or IF*7.i.i1.i.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i_i) -ICmpInst* int1_117 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_117, label_GOTO_or_IF_7_i_i1_i_i_i_i); - -// Block GOTO or IF*8.i.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i_i) -ICmpInst* int1_119 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_68, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_119, label_GOTO_or_IF_8_i_i_i_i_i_i); - -// Block GOTO or IF*9.i.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i_i) -BinaryOperator* int32_121 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i_i); -BinaryOperator* int32_122 = BinaryOperator::Create(Instruction::Add, int32_121, const_int32_70, "", label_GOTO_or_IF_9_i_i_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i_i); - -// Block false IF_ICMPGT16.i.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i_i) -BinaryOperator* int32_124 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i); - -// Block false IF_ICMPGT17.i.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i_i) -BinaryOperator* int32_126 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); -BinaryOperator* int32_127 = BinaryOperator::Create(Instruction::Add, int32_126, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i); - -// Block false IF_ICMPGT18.i.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i_i) -BinaryOperator* int32_129 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); -BinaryOperator* int32_130 = BinaryOperator::Create(Instruction::Add, int32_129, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i); - -// Block false IF_ICMPGT19.i.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i_i) -BinaryOperator* int32_132 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); -BinaryOperator* int32_133 = BinaryOperator::Create(Instruction::Add, int32_132, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i); - -// Block false IF_ICMPGT20.i.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i_i) -BinaryOperator* int32_135 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); -BinaryOperator* int32_136 = BinaryOperator::Create(Instruction::Add, int32_135, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i); - -// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i) -PHINode* int32_138 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -int32_138->reserveOperandSpace(6); -int32_138->addIncoming(int32_124, label_false_IF_ICMPGT16_i_i_i_i_i_i); -int32_138->addIncoming(int32_127, label_false_IF_ICMPGT17_i_i_i_i_i_i); -int32_138->addIncoming(int32_130, label_false_IF_ICMPGT18_i_i_i_i_i_i); -int32_138->addIncoming(int32_133, label_false_IF_ICMPGT19_i_i_i_i_i_i); -int32_138->addIncoming(int32_136, label_false_IF_ICMPGT20_i_i_i_i_i_i); -int32_138->addIncoming(int32_122, label_GOTO_or_IF_9_i_i_i_i_i_i); - -std::vector ptr_139_indices; -ptr_139_indices.push_back(const_int32_77); -ptr_139_indices.push_back(const_int32_77); -Instruction* ptr_139 = GetElementPtrInst::Create(ptr_109, ptr_139_indices.begin(), ptr_139_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -LoadInst* ptr_140 = new LoadInst(ptr_139, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -BinaryOperator* int32_141 = BinaryOperator::Create(Instruction::Add, int32_138, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -CastInst* ptr_142 = new BitCastInst(ptr_140, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -GetElementPtrInst* ptr_143 = GetElementPtrInst::Create(ptr_142, int32_141, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -LoadInst* int32_144 = new LoadInst(ptr_143, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -CastInst* ptr_145 = new IntToPtrInst(int32_144, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -ICmpInst* int1_146 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_144, const_int32_56, ""); -BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_146, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); - -// Block GOTO or IF*.i.i.i.i (label_GOTO_or_IF__i_i_i_i) -std::vector ptr_148_params; -ptr_148_params.push_back(ptr_109); -ptr_148_params.push_back(int32_95); -ptr_148_params.push_back(const_int32_56); -ptr_148_params.push_back(const_int32_56); -CallInst* ptr_148 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_148_params.begin(), ptr_148_params.end(), "", label_GOTO_or_IF__i_i_i_i); -ptr_148->setCallingConv(CallingConv::C); -ptr_148->setTailCall(true);AttrListPtr ptr_148_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_148_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_148->setAttributes(ptr_148_PAL); - -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i_i_i_i); - -// Block false IFNE.i.i.i.i (label_false_IFNE_i_i_i_i) -CastInst* ptr_150 = new IntToPtrInst(int32_144, PointerTy_29, "", label_false_IFNE_i_i_i_i); -LoadInst* ptr_151 = new LoadInst(ptr_150, "", false, label_false_IFNE_i_i_i_i); -CastInst* int32_152 = new PtrToIntInst(ptr_151, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i); - new StoreInst(int32_152, ptr_143, false, label_false_IFNE_i_i_i_i); -std::vector ptr_154_indices; -ptr_154_indices.push_back(const_int32_56); -ptr_154_indices.push_back(const_int32_56); -Instruction* ptr_154 = GetElementPtrInst::Create(ptr_145, ptr_154_indices.begin(), ptr_154_indices.end(), "", label_false_IFNE_i_i_i_i); - new StoreInst(const_ptr_78, ptr_154, false, label_false_IFNE_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFNE_i_i_i_i); - -// Block JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i) -GetElementPtrInst* ptr_157 = GetElementPtrInst::Create(ptr_102, const_int32_58, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_158 = new BitCastInst(ptr_157, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -LoadInst* ptr_159 = new LoadInst(ptr_158, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -GetElementPtrInst* ptr_160 = GetElementPtrInst::Create(ptr_159, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_161 = new BitCastInst(ptr_160, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_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_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_i); -BinaryOperator* int32_164 = BinaryOperator::Create(Instruction::Add, int32_163, int32_95, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_165 = new IntToPtrInst(int32_164, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -std::vector ptr_166_indices; -ptr_166_indices.push_back(const_int32_77); -ptr_166_indices.push_back(const_int32_77); -Instruction* ptr_166 = GetElementPtrInst::Create(ptr_159, ptr_166_indices.begin(), ptr_166_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -LoadInst* ptr_167 = new LoadInst(ptr_166, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_168 = new BitCastInst(ptr_167, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -ICmpInst* int1_169 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_165, ptr_168, ""); -BranchInst::Create(label_false_IFEQ_i_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i, int1_169, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); - -// Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i) -std::vector ptr_171_indices; -ptr_171_indices.push_back(const_int32_77); -ptr_171_indices.push_back(const_int32_56); -Instruction* ptr_171 = GetElementPtrInst::Create(ptr_159, ptr_171_indices.begin(), ptr_171_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); -CastInst* ptr__c_i_i_i_i = new IntToPtrInst(int32_164, PointerTy_31, ".c.i.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); - new StoreInst(ptr__c_i_i_i_i, ptr_171, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); - -// Block false IFEQ.i.i.i.i (label_false_IFEQ_i_i_i_i) -std::vector ptr_174_params; -ptr_174_params.push_back(ptr_159); -ptr_174_params.push_back(ptr_162); -ptr_174_params.push_back(ptr_165); -ptr_174_params.push_back(const_int32_56); -ptr_174_params.push_back(const_int32_56); -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_i); -ptr_174->setCallingConv(CallingConv::C); -ptr_174->setTailCall(true);AttrListPtr ptr_174_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_174_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_174->setAttributes(ptr_174_PAL); - -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFEQ_i_i_i_i); - -// Block tableswitch3.i.i4.i (label_tableswitch3_i_i4_i) -std::vector ptr_176_indices; -ptr_176_indices.push_back(const_int32_58); -ptr_176_indices.push_back(const_int32_77); -Instruction* ptr_176 = GetElementPtrInst::Create(ptr_102, ptr_176_indices.begin(), ptr_176_indices.end(), "", label_tableswitch3_i_i4_i); -CastInst* ptr_177 = new BitCastInst(ptr_176, PointerTy_32, "", label_tableswitch3_i_i4_i); -LoadInst* ptr_178 = new LoadInst(ptr_177, "", false, label_tableswitch3_i_i4_i); -CastInst* ptr_179 = new BitCastInst(ptr_178, PointerTy_30, "", label_tableswitch3_i_i4_i); -std::vector ptr_180_params; -ptr_180_params.push_back(ptr_179); -ptr_180_params.push_back(int32_95); -ptr_180_params.push_back(const_int32_56); -ptr_180_params.push_back(const_int32_56); -CallInst* ptr_180 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_180_params.begin(), ptr_180_params.end(), "", label_tableswitch3_i_i4_i); -ptr_180->setCallingConv(CallingConv::C); -ptr_180->setTailCall(true);AttrListPtr ptr_180_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_180_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_180->setAttributes(ptr_180_PAL); - -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_tableswitch3_i_i4_i); - -// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i) -GetElementPtrInst* ptr_182 = GetElementPtrInst::Create(ptr_102, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -CastInst* ptr_183 = new BitCastInst(ptr_182, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -LoadInst* ptr_184 = new LoadInst(ptr_183, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -BinaryOperator* int32_185 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -ICmpInst* int1_186 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_186, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); - -// Block GOTO or IF*4.i.i.i6.i.i.i (label_GOTO_or_IF_4_i_i_i6_i_i_i) -ICmpInst* int1_188 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_188, label_GOTO_or_IF_4_i_i_i6_i_i_i); - -// Block GOTO or IF*6.i.i.i7.i.i.i (label_GOTO_or_IF_6_i_i_i7_i_i_i) -ICmpInst* int1_190 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_190, label_GOTO_or_IF_6_i_i_i7_i_i_i); - -// Block GOTO or IF*7.i.i1.i8.i.i.i (label_GOTO_or_IF_7_i_i1_i8_i_i_i) -ICmpInst* int1_192 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_192, label_GOTO_or_IF_7_i_i1_i8_i_i_i); - -// Block GOTO or IF*8.i.i.i9.i.i.i (label_GOTO_or_IF_8_i_i_i9_i_i_i) -ICmpInst* int1_194 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_68, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_194, label_GOTO_or_IF_8_i_i_i9_i_i_i); - -// Block GOTO or IF*9.i.i.i10.i.i.i (label_GOTO_or_IF_9_i_i_i10_i_i_i) -BinaryOperator* int32_196 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_69, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); -BinaryOperator* int32_197 = BinaryOperator::Create(Instruction::Add, int32_196, const_int32_70, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_GOTO_or_IF_9_i_i_i10_i_i_i); - -// Block false IF_ICMPGT16.i.i.i11.i.i.i (label_false_IF_ICMPGT16_i_i_i11_i_i_i) -BinaryOperator* int32_199 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i11_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i); - -// Block false IF_ICMPGT17.i.i.i12.i.i.i (label_false_IF_ICMPGT17_i_i_i12_i_i_i) -BinaryOperator* int32_201 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); -BinaryOperator* int32_202 = BinaryOperator::Create(Instruction::Add, int32_201, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i); - -// Block false IF_ICMPGT18.i.i.i13.i.i.i (label_false_IF_ICMPGT18_i_i_i13_i_i_i) -BinaryOperator* int32_204 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); -BinaryOperator* int32_205 = BinaryOperator::Create(Instruction::Add, int32_204, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i); - -// Block false IF_ICMPGT19.i.i.i14.i.i.i (label_false_IF_ICMPGT19_i_i_i14_i_i_i) -BinaryOperator* int32_207 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); -BinaryOperator* int32_208 = BinaryOperator::Create(Instruction::Add, int32_207, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i); - -// Block false IF_ICMPGT20.i.i.i15.i.i.i (label_false_IF_ICMPGT20_i_i_i15_i_i_i) -BinaryOperator* int32_210 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); -BinaryOperator* int32_211 = BinaryOperator::Create(Instruction::Add, int32_210, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i); - -// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i) -PHINode* int32_213 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -int32_213->reserveOperandSpace(6); -int32_213->addIncoming(int32_199, label_false_IF_ICMPGT16_i_i_i11_i_i_i); -int32_213->addIncoming(int32_202, label_false_IF_ICMPGT17_i_i_i12_i_i_i); -int32_213->addIncoming(int32_205, label_false_IF_ICMPGT18_i_i_i13_i_i_i); -int32_213->addIncoming(int32_208, label_false_IF_ICMPGT19_i_i_i14_i_i_i); -int32_213->addIncoming(int32_211, label_false_IF_ICMPGT20_i_i_i15_i_i_i); -int32_213->addIncoming(int32_197, label_GOTO_or_IF_9_i_i_i10_i_i_i); - -std::vector ptr_214_indices; -ptr_214_indices.push_back(const_int32_77); -ptr_214_indices.push_back(const_int32_77); -Instruction* ptr_214 = GetElementPtrInst::Create(ptr_184, ptr_214_indices.begin(), ptr_214_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -LoadInst* ptr_215 = new LoadInst(ptr_214, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -BinaryOperator* int32_216 = BinaryOperator::Create(Instruction::Add, int32_213, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -CastInst* ptr_217 = new BitCastInst(ptr_215, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -GetElementPtrInst* ptr_218 = GetElementPtrInst::Create(ptr_217, int32_216, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -LoadInst* int32_219 = new LoadInst(ptr_218, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -CastInst* ptr_220 = new IntToPtrInst(int32_219, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -ICmpInst* int1_221 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_219, const_int32_56, ""); -BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_221, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); - -// Block GOTO or IF*.i17.i.i.i (label_GOTO_or_IF__i17_i_i_i) -std::vector ptr_223_params; -ptr_223_params.push_back(ptr_184); -ptr_223_params.push_back(int32_95); -ptr_223_params.push_back(const_int32_56); -ptr_223_params.push_back(const_int32_56); -CallInst* ptr_223 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_223_params.begin(), ptr_223_params.end(), "", label_GOTO_or_IF__i17_i_i_i); -ptr_223->setCallingConv(CallingConv::C); -ptr_223->setTailCall(true);AttrListPtr ptr_223_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_223_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_223->setAttributes(ptr_223_PAL); - -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i17_i_i_i); - -// Block false IFNE.i21.i.i.i (label_false_IFNE_i21_i_i_i) -CastInst* ptr_225 = new IntToPtrInst(int32_219, PointerTy_29, "", label_false_IFNE_i21_i_i_i); -LoadInst* ptr_226 = new LoadInst(ptr_225, "", false, label_false_IFNE_i21_i_i_i); -CastInst* int32_227 = new PtrToIntInst(ptr_226, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i); - new StoreInst(int32_227, ptr_218, false, label_false_IFNE_i21_i_i_i); -std::vector ptr_229_indices; -ptr_229_indices.push_back(const_int32_56); -ptr_229_indices.push_back(const_int32_56); -Instruction* ptr_229 = GetElementPtrInst::Create(ptr_220, ptr_229_indices.begin(), ptr_229_indices.end(), "", label_false_IFNE_i21_i_i_i); - new StoreInst(const_ptr_78, ptr_229, false, label_false_IFNE_i21_i_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFNE_i21_i_i_i); - -// Block tableswitch5.i.i6.i (label_tableswitch5_i_i6_i) -std::vector ptr_232_indices; -ptr_232_indices.push_back(const_int32_54); -ptr_232_indices.push_back(const_int32_77); -Instruction* ptr_232 = GetElementPtrInst::Create(ptr_102, ptr_232_indices.begin(), ptr_232_indices.end(), "", label_tableswitch5_i_i6_i); -CastInst* ptr_233 = new BitCastInst(ptr_232, PointerTy_32, "", label_tableswitch5_i_i6_i); -LoadInst* ptr_234 = new LoadInst(ptr_233, "", false, label_tableswitch5_i_i6_i); -CastInst* ptr_235 = new BitCastInst(ptr_234, PointerTy_30, "", label_tableswitch5_i_i6_i); -std::vector ptr_236_params; -ptr_236_params.push_back(ptr_235); -ptr_236_params.push_back(int32_95); -ptr_236_params.push_back(const_int32_56); -ptr_236_params.push_back(const_int32_56); -CallInst* ptr_236 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_236_params.begin(), ptr_236_params.end(), "", label_tableswitch5_i_i6_i); -ptr_236->setCallingConv(CallingConv::C); -ptr_236->setTailCall(true);AttrListPtr ptr_236_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_236_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_236->setAttributes(ptr_236_PAL); - -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_tableswitch5_i_i6_i); - -// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i) -std::vector ptr_238_indices; -ptr_238_indices.push_back(const_int32_60); -ptr_238_indices.push_back(const_int32_77); -Instruction* ptr_238 = GetElementPtrInst::Create(ptr_102, ptr_238_indices.begin(), ptr_238_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -CastInst* ptr_239 = new BitCastInst(ptr_238, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -LoadInst* ptr_240 = new LoadInst(ptr_239, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -CastInst* ptr_241 = new BitCastInst(ptr_240, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -BinaryOperator* int32_242 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -ICmpInst* int1_243 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_243, 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_245 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_245, 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_247 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_247, 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_249 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_249, 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_251 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_68, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_251, 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_253 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i); -BinaryOperator* int32_254 = BinaryOperator::Create(Instruction::Add, int32_253, const_int32_70, "", 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_256 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_58, "", 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_258 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i); -BinaryOperator* int32_259 = BinaryOperator::Create(Instruction::Add, int32_258, const_int32_71, "", 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_261 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i); -BinaryOperator* int32_262 = BinaryOperator::Create(Instruction::Add, int32_261, const_int32_73, "", 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_264 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i); -BinaryOperator* int32_265 = BinaryOperator::Create(Instruction::Add, int32_264, const_int32_75, "", 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_267 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i); -BinaryOperator* int32_268 = BinaryOperator::Create(Instruction::Add, int32_267, const_int32_76, "", 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_270 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -int32_270->reserveOperandSpace(6); -int32_270->addIncoming(int32_256, label_false_IF_ICMPGT16_i_i_i_i_i); -int32_270->addIncoming(int32_259, label_false_IF_ICMPGT17_i_i_i_i_i); -int32_270->addIncoming(int32_262, label_false_IF_ICMPGT18_i_i_i_i_i); -int32_270->addIncoming(int32_265, label_false_IF_ICMPGT19_i_i_i_i_i); -int32_270->addIncoming(int32_268, label_false_IF_ICMPGT20_i_i_i_i_i); -int32_270->addIncoming(int32_254, label_GOTO_or_IF_9_i_i_i_i_i); - -GetElementPtrInst* ptr_271 = GetElementPtrInst::Create(ptr_240, const_int32_71, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -CastInst* ptr_272 = new BitCastInst(ptr_271, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -LoadInst* ptr_273 = new LoadInst(ptr_272, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -BinaryOperator* int32_274 = BinaryOperator::Create(Instruction::Add, int32_270, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -CastInst* ptr_275 = new BitCastInst(ptr_273, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -GetElementPtrInst* ptr_276 = GetElementPtrInst::Create(ptr_275, int32_274, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -LoadInst* int32_277 = new LoadInst(ptr_276, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -CastInst* ptr_278 = new IntToPtrInst(int32_277, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -ICmpInst* int1_279 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_277, const_int32_56, ""); -BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_279, 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_281_params; -ptr_281_params.push_back(ptr_241); -ptr_281_params.push_back(int32_95); -ptr_281_params.push_back(const_int32_56); -ptr_281_params.push_back(const_int32_56); -CallInst* ptr_281 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_281_params.begin(), ptr_281_params.end(), "", label_GOTO_or_IF__i_i_i); -ptr_281->setCallingConv(CallingConv::C); -ptr_281->setTailCall(true);AttrListPtr ptr_281_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_281_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_281->setAttributes(ptr_281_PAL); - -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i_i_i); - -// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i) -CastInst* ptr_283 = new IntToPtrInst(int32_277, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -LoadInst* ptr_284 = new LoadInst(ptr_283, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -CastInst* int32_285 = new PtrToIntInst(ptr_284, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); - new StoreInst(int32_285, ptr_276, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -std::vector ptr_287_indices; -ptr_287_indices.push_back(const_int32_56); -ptr_287_indices.push_back(const_int32_56); -Instruction* ptr_287 = GetElementPtrInst::Create(ptr_278, ptr_287_indices.begin(), ptr_287_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); - new StoreInst(const_ptr_78, ptr_287, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); - -// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i) -PHINode* ptr_290 = PHINode::Create(PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); -ptr_290->reserveOperandSpace(10); -ptr_290->addIncoming(ptr_236, label_tableswitch5_i_i6_i); -ptr_290->addIncoming(ptr_223, label_GOTO_or_IF__i17_i_i_i); -ptr_290->addIncoming(ptr_180, label_tableswitch3_i_i4_i); -ptr_290->addIncoming(ptr_162, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); -ptr_290->addIncoming(ptr_174, label_false_IFEQ_i_i_i_i); -ptr_290->addIncoming(ptr_148, label_GOTO_or_IF__i_i_i_i); -ptr_290->addIncoming(ptr_278, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -ptr_290->addIncoming(ptr_281, label_GOTO_or_IF__i_i_i); -ptr_290->addIncoming(ptr_145, label_false_IFNE_i_i_i_i); -ptr_290->addIncoming(ptr_220, label_false_IFNE_i21_i_i_i); - -std::vector ptr_291_indices; -ptr_291_indices.push_back(const_int32_56); -ptr_291_indices.push_back(const_int32_56); -Instruction* ptr_291 = GetElementPtrInst::Create(ptr_290, ptr_291_indices.begin(), ptr_291_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); -CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_31, ".c.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); - new StoreInst(ptr__c_i, ptr_291, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); -SwitchInst* void_293 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i_i, 7, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); -void_293->addCase(const_int32_56, label_false_IFNE_i_i); -void_293->addCase(const_int32_58, label_tableswitch1_i_i_i); -void_293->addCase(const_int32_54, label_tableswitch2_i_i_i); -void_293->addCase(const_int32_60, label_tableswitch3_i_i_i); -void_293->addCase(const_int32_61, label_tableswitch4_i_i_i); -void_293->addCase(const_int32_62, label_tableswitch5_i_i_i); - - -// Block tableswitch.i.i.i (label_tableswitch_i_i_i) -CallInst* void_294 = CallInst::Create(func_abort, "", label_tableswitch_i_i_i); -void_294->setCallingConv(CallingConv::C); -void_294->setTailCall(true);AttrListPtr void_294_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_294_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_294->setAttributes(void_294_PAL); - -new UnreachableInst(mod->getContext(), label_tableswitch_i_i_i); - -// Block tableswitch1.i.i.i (label_tableswitch1_i_i_i) -LoadInst* ptr_296 = new LoadInst(const_ptr_79, "", false, label_tableswitch1_i_i_i); -CastInst* int32_297 = new PtrToIntInst(ptr_296, IntegerType::get(mod->getContext(), 32), "", label_tableswitch1_i_i_i); -std::vector ptr_298_indices; -ptr_298_indices.push_back(const_int32_56); -ptr_298_indices.push_back(const_int32_77); -Instruction* ptr_298 = GetElementPtrInst::Create(ptr_290, ptr_298_indices.begin(), ptr_298_indices.end(), "", label_tableswitch1_i_i_i); -CastInst* ptr_299 = new BitCastInst(ptr_298, PointerTy_0, "", label_tableswitch1_i_i_i); -LoadInst* int8_300 = new LoadInst(ptr_299, "", false, label_tableswitch1_i_i_i); -BinaryOperator* int8_301 = BinaryOperator::Create(Instruction::And, int8_300, const_int8_80, "", label_tableswitch1_i_i_i); -CastInst* int8_302 = new TruncInst(int32_297, IntegerType::get(mod->getContext(), 8), "", label_tableswitch1_i_i_i); -BinaryOperator* int8_303 = BinaryOperator::Create(Instruction::Or, int8_301, int8_302, "", label_tableswitch1_i_i_i); - new StoreInst(int8_303, ptr_299, false, label_tableswitch1_i_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch1_i_i_i); - -// Block tableswitch2.i.i.i (label_tableswitch2_i_i_i) -std::vector ptr_306_indices; -ptr_306_indices.push_back(const_int32_56); -ptr_306_indices.push_back(const_int32_77); -Instruction* ptr_306 = GetElementPtrInst::Create(ptr_290, ptr_306_indices.begin(), ptr_306_indices.end(), "", label_tableswitch2_i_i_i); -CastInst* ptr_307 = new BitCastInst(ptr_306, PointerTy_25, "", label_tableswitch2_i_i_i); -LoadInst* int32_308 = new LoadInst(ptr_307, "", false, label_tableswitch2_i_i_i); -BinaryOperator* int32_309 = BinaryOperator::Create(Instruction::And, int32_308, const_int32_58, "", label_tableswitch2_i_i_i); -LoadInst* ptr_310 = new LoadInst(const_ptr_81, "", false, label_tableswitch2_i_i_i); -CastInst* int32_311 = new PtrToIntInst(ptr_310, IntegerType::get(mod->getContext(), 32), "", label_tableswitch2_i_i_i); -BinaryOperator* int32_312 = BinaryOperator::Create(Instruction::Or, int32_311, int32_309, "", label_tableswitch2_i_i_i); -CastInst* ptr_313 = new BitCastInst(ptr_306, PointerTy_0, "", label_tableswitch2_i_i_i); -CastInst* int8_trunc = new TruncInst(int32_308, IntegerType::get(mod->getContext(), 8), "trunc", label_tableswitch2_i_i_i); -BinaryOperator* int8_314 = BinaryOperator::Create(Instruction::And, int8_trunc, const_int8_80, "", label_tableswitch2_i_i_i); -CastInst* int8_315 = new TruncInst(int32_312, IntegerType::get(mod->getContext(), 8), "", label_tableswitch2_i_i_i); -BinaryOperator* int8_316 = BinaryOperator::Create(Instruction::Or, int8_315, int8_314, "", label_tableswitch2_i_i_i); - new StoreInst(int8_316, ptr_313, false, label_tableswitch2_i_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch2_i_i_i); - -// Block tableswitch3.i.i.i (label_tableswitch3_i_i_i) -LoadInst* ptr_319 = new LoadInst(const_ptr_82, "", false, label_tableswitch3_i_i_i); -CastInst* int32_320 = new PtrToIntInst(ptr_319, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i_i); -BinaryOperator* int32_321 = BinaryOperator::Create(Instruction::Or, int32_320, const_int32_58, "", label_tableswitch3_i_i_i); -std::vector ptr_322_indices; -ptr_322_indices.push_back(const_int32_56); -ptr_322_indices.push_back(const_int32_77); -Instruction* ptr_322 = GetElementPtrInst::Create(ptr_290, ptr_322_indices.begin(), ptr_322_indices.end(), "", label_tableswitch3_i_i_i); -CastInst* ptr_323 = new BitCastInst(ptr_322, PointerTy_0, "", label_tableswitch3_i_i_i); -LoadInst* int8_324 = new LoadInst(ptr_323, "", false, label_tableswitch3_i_i_i); -BinaryOperator* int8_325 = BinaryOperator::Create(Instruction::And, int8_324, const_int8_80, "", label_tableswitch3_i_i_i); -CastInst* int8_326 = new TruncInst(int32_321, IntegerType::get(mod->getContext(), 8), "", label_tableswitch3_i_i_i); -BinaryOperator* int8_327 = BinaryOperator::Create(Instruction::Or, int8_326, int8_325, "", label_tableswitch3_i_i_i); - new StoreInst(int8_327, ptr_323, false, label_tableswitch3_i_i_i); -LoadInst* ptr_329 = new LoadInst(const_ptr_83, "", false, label_tableswitch3_i_i_i); -CastInst* int32_330 = new PtrToIntInst(ptr_290, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i_i); -BinaryOperator* int32_331 = BinaryOperator::Create(Instruction::And, int32_330, const_int32_84, "", label_tableswitch3_i_i_i); -CastInst* ptr_332 = new IntToPtrInst(int32_331, PointerTy_30, "", label_tableswitch3_i_i_i); -std::vector ptr_333_indices; -ptr_333_indices.push_back(const_int32_58); -ptr_333_indices.push_back(const_int32_77); -Instruction* ptr_333 = GetElementPtrInst::Create(ptr_329, ptr_333_indices.begin(), ptr_333_indices.end(), "", label_tableswitch3_i_i_i); -LoadInst* ptr_334 = new LoadInst(ptr_333, "", false, label_tableswitch3_i_i_i); -GetElementPtrInst* ptr_335 = GetElementPtrInst::Create(ptr_334, const_int32_71, "", label_tableswitch3_i_i_i); -CastInst* ptr_336 = new BitCastInst(ptr_335, PointerTy_32, "", label_tableswitch3_i_i_i); -LoadInst* ptr_337 = new LoadInst(ptr_336, "", false, label_tableswitch3_i_i_i); -ICmpInst* int1_338 = new ICmpInst(*label_tableswitch3_i_i_i, ICmpInst::ICMP_EQ, ptr_337, const_ptr_85, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i5_i_i_i_i_i, int1_338, label_tableswitch3_i_i_i); - -// Block true IF*NULL.i1.i.i.i.i.i (label_true_IF_NULL_i1_i_i_i_i_i) -std::vector ptr_340_indices; -ptr_340_indices.push_back(const_int32_56); -ptr_340_indices.push_back(const_int32_56); -Instruction* ptr_340 = GetElementPtrInst::Create(ptr_332, ptr_340_indices.begin(), ptr_340_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i); - new StoreInst(const_ptr_78, ptr_340, false, label_true_IF_NULL_i1_i_i_i_i_i); -GetElementPtrInst* ptr_342 = GetElementPtrInst::Create(ptr_334, const_int32_62, "", label_true_IF_NULL_i1_i_i_i_i_i); -CastInst* ptr_343 = new BitCastInst(ptr_342, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i); -LoadInst* ptr_344 = new LoadInst(ptr_343, "", false, label_true_IF_NULL_i1_i_i_i_i_i); -LoadInst* ptr_345 = new LoadInst(const_ptr_86, "", false, label_true_IF_NULL_i1_i_i_i_i_i); -CastInst* int32_346 = new PtrToIntInst(ptr_345, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i); -BinaryOperator* int32_347 = BinaryOperator::Create(Instruction::Add, int32_346, int32_331, "", label_true_IF_NULL_i1_i_i_i_i_i); -CastInst* ptr_348 = new IntToPtrInst(int32_347, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i); - new StoreInst(ptr_344, ptr_348, false, label_true_IF_NULL_i1_i_i_i_i_i); -LoadInst* ptr_350 = new LoadInst(ptr_343, "", false, label_true_IF_NULL_i1_i_i_i_i_i); -ICmpInst* int1_351 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_350, const_ptr_87, ""); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i, int1_351, label_true_IF_NULL_i1_i_i_i_i_i); - -// Block GOTO or IF*1.i3.i.i.i.i.i (label_GOTO_or_IF_1_i3_i_i_i_i_i) -CastInst* ptr_353 = new BitCastInst(ptr_342, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i_i_i_i); -CastInst* ptr__c1_i2_i_i_i_i_i = new IntToPtrInst(int32_331, PointerTy_31, ".c1.i2.i.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i_i); - new StoreInst(ptr__c1_i2_i_i_i_i_i, ptr_353, false, label_GOTO_or_IF_1_i3_i_i_i_i_i); -LoadInst* ptr_355 = new LoadInst(ptr_336, "", false, label_GOTO_or_IF_1_i3_i_i_i_i_i); -ICmpInst* int1_356 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_355, const_ptr_85, ""); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i, int1_356, label_GOTO_or_IF_1_i3_i_i_i_i_i); - -// Block true IFNULL.i5.i.i.i.i.i (label_true_IFNULL_i5_i_i_i_i_i) -GetElementPtrInst* ptr_358 = GetElementPtrInst::Create(ptr_337, const_int32_62, "", label_true_IFNULL_i5_i_i_i_i_i); -CastInst* ptr_359 = new BitCastInst(ptr_358, PointerTy_25, "", label_true_IFNULL_i5_i_i_i_i_i); -BranchInst::Create(label_bb2_i_i36_i, label_true_IFNULL_i5_i_i_i_i_i); - -// Block bb.i.i34.i (label_bb_i_i34_i) -Argument* fwdref_362 = new Argument(IntegerType::get(mod->getContext(), 1)); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb1_i_i35_i, fwdref_362, label_bb_i_i34_i); - -// Block bb1.i.i35.i (label_bb1_i_i35_i) -Argument* fwdref_364 = new Argument(IntegerType::get(mod->getContext(), 32)); -BinaryOperator* int32_363 = BinaryOperator::Create(Instruction::Add, fwdref_364, const_int32_77, "", label_bb1_i_i35_i); -BranchInst::Create(label_bb2_i_i36_i, label_bb1_i_i35_i); - -// Block bb2.i.i36.i (label_bb2_i_i36_i) -PHINode* int32_366 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i36_i); -int32_366->reserveOperandSpace(2); -int32_366->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i_i_i_i); -int32_366->addIncoming(int32_363, label_bb1_i_i35_i); - -ICmpInst* int1_367 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_ULT, int32_366, const_int32_88, ""); -std::vector void_368_params; -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -CallInst* void_368 = CallInst::Create(func_llvm_memory_barrier, void_368_params.begin(), void_368_params.end(), "", label_bb2_i_i36_i); -void_368->setCallingConv(CallingConv::C); -void_368->setTailCall(true);AttrListPtr void_368_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_368_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_368->setAttributes(void_368_PAL); - -std::vector int32_369_params; -int32_369_params.push_back(ptr_359); -int32_369_params.push_back(const_int32_56); -int32_369_params.push_back(const_int32_77); -CallInst* int32_369 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_369_params.begin(), int32_369_params.end(), "", label_bb2_i_i36_i); -int32_369->setCallingConv(CallingConv::C); -int32_369->setTailCall(true);AttrListPtr int32_369_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_369_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -int32_369->setAttributes(int32_369_PAL); - -std::vector void_370_params; -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -CallInst* void_370 = CallInst::Create(func_llvm_memory_barrier, void_370_params.begin(), void_370_params.end(), "", label_bb2_i_i36_i); -void_370->setCallingConv(CallingConv::C); -void_370->setTailCall(true);AttrListPtr void_370_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_370_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_370->setAttributes(void_370_PAL); - -ICmpInst* int1_371 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_EQ, int32_369, const_int32_56, ""); -BranchInst::Create(label_bb_i_i34_i, label_bb4_preheader_i_i37_i, int1_367, label_bb2_i_i36_i); - -// Block bb4.preheader.i.i37.i (label_bb4_preheader_i_i37_i) -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_371, label_bb4_preheader_i_i37_i); - -// Block bb3.i.i38.i (label_bb3_i_i38_i) -CallInst* void_374 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i38_i); -void_374->setCallingConv(CallingConv::C); -void_374->setTailCall(true);AttrListPtr void_374_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_374_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_374->setAttributes(void_374_PAL); - -std::vector void_375_params; -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -CallInst* void_375 = CallInst::Create(func_llvm_memory_barrier, void_375_params.begin(), void_375_params.end(), "", label_bb3_i_i38_i); -void_375->setCallingConv(CallingConv::C); -void_375->setTailCall(true);AttrListPtr void_375_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_375_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_375->setAttributes(void_375_PAL); - -std::vector int32_376_params; -int32_376_params.push_back(ptr_359); -int32_376_params.push_back(const_int32_56); -int32_376_params.push_back(const_int32_77); -CallInst* int32_376 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_376_params.begin(), int32_376_params.end(), "", label_bb3_i_i38_i); -int32_376->setCallingConv(CallingConv::C); -int32_376->setTailCall(true);AttrListPtr int32_376_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_376_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -int32_376->setAttributes(int32_376_PAL); - -std::vector void_377_params; -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -CallInst* void_377 = CallInst::Create(func_llvm_memory_barrier, void_377_params.begin(), void_377_params.end(), "", label_bb3_i_i38_i); -void_377->setCallingConv(CallingConv::C); -void_377->setTailCall(true);AttrListPtr void_377_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_377_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_377->setAttributes(void_377_PAL); - -ICmpInst* int1_378 = new ICmpInst(*label_bb3_i_i38_i, ICmpInst::ICMP_EQ, int32_376, const_int32_56, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_378, label_bb3_i_i38_i); - -// Block false IFNE.i7.i.i.i.i.i (label_false_IFNE_i7_i_i_i_i_i) -std::vector ptr_380_indices; -ptr_380_indices.push_back(const_int32_56); -ptr_380_indices.push_back(const_int32_56); -Instruction* ptr_380 = GetElementPtrInst::Create(ptr_350, ptr_380_indices.begin(), ptr_380_indices.end(), "", label_false_IFNE_i7_i_i_i_i_i); -CastInst* ptr__c_i6_i_i_i_i_i = new IntToPtrInst(int32_331, PointerTy_31, ".c.i6.i.i.i.i.i", label_false_IFNE_i7_i_i_i_i_i); - new StoreInst(ptr__c_i6_i_i_i_i_i, ptr_380, false, label_false_IFNE_i7_i_i_i_i_i); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i); - -// Block true IFNULL3.i8.i.i.i.i.i (label_true_IFNULL3_i8_i_i_i_i_i) -GetElementPtrInst* ptr_383 = GetElementPtrInst::Create(ptr_355, const_int32_62, "", label_true_IFNULL3_i8_i_i_i_i_i); -CastInst* ptr_384 = new BitCastInst(ptr_383, PointerTy_25, "", label_true_IFNULL3_i8_i_i_i_i_i); - new StoreInst(const_int32_56, ptr_384, false, label_true_IFNULL3_i8_i_i_i_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i); - -// Block tableswitch4.i.i.i (label_tableswitch4_i_i_i) -LoadInst* ptr_387 = new LoadInst(const_ptr_90, "", false, label_tableswitch4_i_i_i); -CastInst* int32_388 = new PtrToIntInst(ptr_387, IntegerType::get(mod->getContext(), 32), "", label_tableswitch4_i_i_i); -std::vector ptr_389_indices; -ptr_389_indices.push_back(const_int32_56); -ptr_389_indices.push_back(const_int32_77); -Instruction* ptr_389 = GetElementPtrInst::Create(ptr_290, ptr_389_indices.begin(), ptr_389_indices.end(), "", label_tableswitch4_i_i_i); -CastInst* ptr_390 = new BitCastInst(ptr_389, PointerTy_0, "", label_tableswitch4_i_i_i); -LoadInst* int8_391 = new LoadInst(ptr_390, "", false, label_tableswitch4_i_i_i); -BinaryOperator* int8_392 = BinaryOperator::Create(Instruction::And, int8_391, const_int8_80, "", label_tableswitch4_i_i_i); -CastInst* int8_393 = new TruncInst(int32_388, IntegerType::get(mod->getContext(), 8), "", label_tableswitch4_i_i_i); -BinaryOperator* int8_394 = BinaryOperator::Create(Instruction::Or, int8_392, int8_393, "", label_tableswitch4_i_i_i); - new StoreInst(int8_394, ptr_390, false, label_tableswitch4_i_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch4_i_i_i); - -// Block tableswitch5.i.i.i (label_tableswitch5_i_i_i) -LoadInst* ptr_397 = new LoadInst(const_ptr_91, "", false, label_tableswitch5_i_i_i); -CastInst* int32_398 = new PtrToIntInst(ptr_397, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i); -BinaryOperator* int32_399 = BinaryOperator::Create(Instruction::Or, int32_398, const_int32_58, "", label_tableswitch5_i_i_i); -std::vector ptr_400_indices; -ptr_400_indices.push_back(const_int32_56); -ptr_400_indices.push_back(const_int32_77); -Instruction* ptr_400 = GetElementPtrInst::Create(ptr_290, ptr_400_indices.begin(), ptr_400_indices.end(), "", label_tableswitch5_i_i_i); -CastInst* ptr_401 = new BitCastInst(ptr_400, PointerTy_0, "", label_tableswitch5_i_i_i); -LoadInst* int8_402 = new LoadInst(ptr_401, "", false, label_tableswitch5_i_i_i); -BinaryOperator* int8_403 = BinaryOperator::Create(Instruction::And, int8_402, const_int8_80, "", label_tableswitch5_i_i_i); -CastInst* int8_404 = new TruncInst(int32_399, IntegerType::get(mod->getContext(), 8), "", label_tableswitch5_i_i_i); -BinaryOperator* int8_405 = BinaryOperator::Create(Instruction::Or, int8_404, int8_403, "", label_tableswitch5_i_i_i); - new StoreInst(int8_405, ptr_401, false, label_tableswitch5_i_i_i); -LoadInst* ptr_407 = new LoadInst(const_ptr_92, "", false, label_tableswitch5_i_i_i); -CastInst* int32_408 = new PtrToIntInst(ptr_290, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i); -BinaryOperator* int32_409 = BinaryOperator::Create(Instruction::And, int32_408, const_int32_84, "", label_tableswitch5_i_i_i); -CastInst* ptr_410 = new IntToPtrInst(int32_409, PointerTy_30, "", label_tableswitch5_i_i_i); -std::vector ptr_411_indices; -ptr_411_indices.push_back(const_int32_58); -ptr_411_indices.push_back(const_int32_77); -Instruction* ptr_411 = GetElementPtrInst::Create(ptr_407, ptr_411_indices.begin(), ptr_411_indices.end(), "", label_tableswitch5_i_i_i); -LoadInst* ptr_412 = new LoadInst(ptr_411, "", false, label_tableswitch5_i_i_i); -GetElementPtrInst* ptr_413 = GetElementPtrInst::Create(ptr_412, const_int32_71, "", label_tableswitch5_i_i_i); -CastInst* ptr_414 = new BitCastInst(ptr_413, PointerTy_32, "", label_tableswitch5_i_i_i); -LoadInst* ptr_415 = new LoadInst(ptr_414, "", false, label_tableswitch5_i_i_i); -ICmpInst* int1_416 = new ICmpInst(*label_tableswitch5_i_i_i, ICmpInst::ICMP_EQ, ptr_415, const_ptr_85, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_true_IFNULL_i5_i_i6_i_i_i, int1_416, label_tableswitch5_i_i_i); - -// Block true IF*NULL.i1.i.i3.i.i.i (label_true_IF_NULL_i1_i_i3_i_i_i) -std::vector ptr_418_indices; -ptr_418_indices.push_back(const_int32_56); -ptr_418_indices.push_back(const_int32_56); -Instruction* ptr_418 = GetElementPtrInst::Create(ptr_410, ptr_418_indices.begin(), ptr_418_indices.end(), "", label_true_IF_NULL_i1_i_i3_i_i_i); - new StoreInst(const_ptr_78, ptr_418, false, label_true_IF_NULL_i1_i_i3_i_i_i); -GetElementPtrInst* ptr_420 = GetElementPtrInst::Create(ptr_412, const_int32_62, "", label_true_IF_NULL_i1_i_i3_i_i_i); -CastInst* ptr_421 = new BitCastInst(ptr_420, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i); -LoadInst* ptr_422 = new LoadInst(ptr_421, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); -LoadInst* ptr_423 = new LoadInst(const_ptr_86, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); -CastInst* int32_424 = new PtrToIntInst(ptr_423, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i3_i_i_i); -BinaryOperator* int32_425 = BinaryOperator::Create(Instruction::Add, int32_424, int32_409, "", label_true_IF_NULL_i1_i_i3_i_i_i); -CastInst* ptr_426 = new IntToPtrInst(int32_425, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i); - new StoreInst(ptr_422, ptr_426, false, label_true_IF_NULL_i1_i_i3_i_i_i); -LoadInst* ptr_428 = new LoadInst(ptr_421, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); -ICmpInst* int1_429 = new ICmpInst(*label_true_IF_NULL_i1_i_i3_i_i_i, ICmpInst::ICMP_EQ, ptr_428, const_ptr_87, ""); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i_i, label_false_IFNE_i7_i_i8_i_i_i, int1_429, label_true_IF_NULL_i1_i_i3_i_i_i); - -// Block GOTO or IF*1.i3.i.i5.i.i.i (label_GOTO_or_IF_1_i3_i_i5_i_i_i) -CastInst* ptr_431 = new BitCastInst(ptr_420, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i5_i_i_i); -CastInst* ptr__c1_i2_i_i4_i_i_i = new IntToPtrInst(int32_409, PointerTy_31, ".c1.i2.i.i4.i.i.i", label_GOTO_or_IF_1_i3_i_i5_i_i_i); - new StoreInst(ptr__c1_i2_i_i4_i_i_i, ptr_431, false, label_GOTO_or_IF_1_i3_i_i5_i_i_i); -LoadInst* ptr_433 = new LoadInst(ptr_414, "", false, label_GOTO_or_IF_1_i3_i_i5_i_i_i); -ICmpInst* int1_434 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i5_i_i_i, ICmpInst::ICMP_EQ, ptr_433, const_ptr_85, ""); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i9_i_i_i, int1_434, label_GOTO_or_IF_1_i3_i_i5_i_i_i); - -// Block true IFNULL.i5.i.i6.i.i.i (label_true_IFNULL_i5_i_i6_i_i_i) -GetElementPtrInst* ptr_436 = GetElementPtrInst::Create(ptr_415, const_int32_62, "", label_true_IFNULL_i5_i_i6_i_i_i); -CastInst* ptr_437 = new BitCastInst(ptr_436, PointerTy_25, "", label_true_IFNULL_i5_i_i6_i_i_i); -BranchInst::Create(label_bb2_i_i_i, label_true_IFNULL_i5_i_i6_i_i_i); - -// Block bb.i.i.i (label_bb_i_i_i) -Argument* fwdref_440 = new Argument(IntegerType::get(mod->getContext(), 1)); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb1_i_i_i, fwdref_440, label_bb_i_i_i); - -// Block bb1.i.i.i (label_bb1_i_i_i) -Argument* fwdref_442 = new Argument(IntegerType::get(mod->getContext(), 32)); -BinaryOperator* int32_441 = BinaryOperator::Create(Instruction::Add, fwdref_442, const_int32_77, "", 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_444 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); -int32_444->reserveOperandSpace(2); -int32_444->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i6_i_i_i); -int32_444->addIncoming(int32_441, label_bb1_i_i_i); - -ICmpInst* int1_445 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_444, const_int32_88, ""); -std::vector void_446_params; -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -CallInst* void_446 = CallInst::Create(func_llvm_memory_barrier, void_446_params.begin(), void_446_params.end(), "", label_bb2_i_i_i); -void_446->setCallingConv(CallingConv::C); -void_446->setTailCall(true);AttrListPtr void_446_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_446_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_446->setAttributes(void_446_PAL); - -std::vector int32_447_params; -int32_447_params.push_back(ptr_437); -int32_447_params.push_back(const_int32_56); -int32_447_params.push_back(const_int32_77); -CallInst* int32_447 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_447_params.begin(), int32_447_params.end(), "", label_bb2_i_i_i); -int32_447->setCallingConv(CallingConv::C); -int32_447->setTailCall(true);AttrListPtr int32_447_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_447_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -int32_447->setAttributes(int32_447_PAL); - -std::vector void_448_params; -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -CallInst* void_448 = CallInst::Create(func_llvm_memory_barrier, void_448_params.begin(), void_448_params.end(), "", label_bb2_i_i_i); -void_448->setCallingConv(CallingConv::C); -void_448->setTailCall(true);AttrListPtr void_448_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_448_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_448->setAttributes(void_448_PAL); - -ICmpInst* int1_449 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_447, const_int32_56, ""); -BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_445, 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_i3_i_i_i, label_bb3_i_i_i, int1_449, label_bb4_preheader_i_i_i); - -// Block bb3.i.i.i (label_bb3_i_i_i) -CallInst* void_452 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); -void_452->setCallingConv(CallingConv::C); -void_452->setTailCall(true);AttrListPtr void_452_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_452_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_452->setAttributes(void_452_PAL); - -std::vector void_453_params; -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -CallInst* void_453 = CallInst::Create(func_llvm_memory_barrier, void_453_params.begin(), void_453_params.end(), "", label_bb3_i_i_i); -void_453->setCallingConv(CallingConv::C); -void_453->setTailCall(true);AttrListPtr void_453_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_453_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_453->setAttributes(void_453_PAL); - -std::vector int32_454_params; -int32_454_params.push_back(ptr_437); -int32_454_params.push_back(const_int32_56); -int32_454_params.push_back(const_int32_77); -CallInst* int32_454 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_454_params.begin(), int32_454_params.end(), "", label_bb3_i_i_i); -int32_454->setCallingConv(CallingConv::C); -int32_454->setTailCall(true);AttrListPtr int32_454_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_454_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -int32_454->setAttributes(int32_454_PAL); - -std::vector void_455_params; -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -CallInst* void_455 = CallInst::Create(func_llvm_memory_barrier, void_455_params.begin(), void_455_params.end(), "", label_bb3_i_i_i); -void_455->setCallingConv(CallingConv::C); -void_455->setTailCall(true);AttrListPtr void_455_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_455_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_455->setAttributes(void_455_PAL); - -ICmpInst* int1_456 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_454, const_int32_56, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb3_i_i_i, int1_456, label_bb3_i_i_i); - -// Block false IFNE.i7.i.i8.i.i.i (label_false_IFNE_i7_i_i8_i_i_i) -std::vector ptr_458_indices; -ptr_458_indices.push_back(const_int32_56); -ptr_458_indices.push_back(const_int32_56); -Instruction* ptr_458 = GetElementPtrInst::Create(ptr_428, ptr_458_indices.begin(), ptr_458_indices.end(), "", label_false_IFNE_i7_i_i8_i_i_i); -CastInst* ptr__c_i6_i_i7_i_i_i = new IntToPtrInst(int32_409, PointerTy_31, ".c.i6.i.i7.i.i.i", label_false_IFNE_i7_i_i8_i_i_i); - new StoreInst(ptr__c_i6_i_i7_i_i_i, ptr_458, false, label_false_IFNE_i7_i_i8_i_i_i); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i_i, label_false_IFNE_i7_i_i8_i_i_i); - -// Block true IFNULL3.i8.i.i9.i.i.i (label_true_IFNULL3_i8_i_i9_i_i_i) -GetElementPtrInst* ptr_461 = GetElementPtrInst::Create(ptr_433, const_int32_62, "", label_true_IFNULL3_i8_i_i9_i_i_i); -CastInst* ptr_462 = new BitCastInst(ptr_461, PointerTy_25, "", label_true_IFNULL3_i8_i_i9_i_i_i); - new StoreInst(const_int32_56, ptr_462, false, label_true_IFNULL3_i8_i_i9_i_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i9_i_i_i); - -// Block false IFNE.i.i (label_false_IFNE_i_i) -LoadInst* ptr_465 = new LoadInst(const_ptr_93, "", false, label_false_IFNE_i_i); -CastInst* int32_466 = new PtrToIntInst(ptr_465, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i); -std::vector ptr_467_indices; -ptr_467_indices.push_back(const_int32_56); -ptr_467_indices.push_back(const_int32_77); -Instruction* ptr_467 = GetElementPtrInst::Create(ptr_290, ptr_467_indices.begin(), ptr_467_indices.end(), "", label_false_IFNE_i_i); -CastInst* ptr_468 = new BitCastInst(ptr_467, PointerTy_0, "", label_false_IFNE_i_i); -LoadInst* int8_469 = new LoadInst(ptr_468, "", false, label_false_IFNE_i_i); -BinaryOperator* int8_470 = BinaryOperator::Create(Instruction::And, int8_469, const_int8_80, "", label_false_IFNE_i_i); -CastInst* int8_471 = new TruncInst(int32_466, IntegerType::get(mod->getContext(), 8), "", label_false_IFNE_i_i); -BinaryOperator* int8_472 = BinaryOperator::Create(Instruction::Or, int8_470, int8_471, "", label_false_IFNE_i_i); - new StoreInst(int8_472, ptr_468, false, label_false_IFNE_i_i); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFNE_i_i); - -// Block JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit (label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit) -CastInst* ptr_tmp1 = new BitCastInst(ptr_290, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); -ReturnInst::Create(mod->getContext(), ptr_tmp1, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); - -// Resolve Forward References -fwdref_364->replaceAllUsesWith(int32_366); delete fwdref_364; -fwdref_362->replaceAllUsesWith(int1_371); delete fwdref_362; -fwdref_442->replaceAllUsesWith(int32_444); delete fwdref_442; -fwdref_440->replaceAllUsesWith(int1_449); delete fwdref_440; -return func_gcmalloc; -} Modified: vmkit/trunk/lib/Mvm/Compiler/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/Makefile?rev=108314&r1=108313&r2=108314&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/Makefile (original) +++ vmkit/trunk/lib/Mvm/Compiler/Makefile Tue Jul 13 22:57:37 2010 @@ -18,6 +18,5 @@ VMKIT_RUNTIME = $(PROJ_SRC_DIR)/LLVMRuntime.ll BUILT_SOURCES = LLVMRuntime.inc -EXTRA_DIST = MMTkInline.inc include $(LEVEL)/Makefile.common Modified: vmkit/trunk/mmtk/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/Makefile?rev=108314&r1=108313&r2=108314&view=diff ============================================================================== --- vmkit/trunk/mmtk/Makefile (original) +++ vmkit/trunk/mmtk/Makefile Tue Jul 13 22:57:37 2010 @@ -9,6 +9,7 @@ LEVEL = .. DIRS = magic mmtk-j3 mmtk-alloc java +EXTRA_DIST = config/marksweep include $(LEVEL)/Makefile.config Removed: vmkit/trunk/mmtk/java/build.xml URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/build.xml?rev=108313&view=auto ============================================================================== --- vmkit/trunk/mmtk/java/build.xml (original) +++ vmkit/trunk/mmtk/java/build.xml (removed) @@ -1,9 +0,0 @@ - - - - - - - - - Copied: vmkit/trunk/mmtk/java/build.xml.in (from r108312, vmkit/trunk/mmtk/java/build.xml) URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/build.xml.in?p2=vmkit/trunk/mmtk/java/build.xml.in&p1=vmkit/trunk/mmtk/java/build.xml&r1=108312&r2=108314&rev=108314&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/build.xml (original) +++ vmkit/trunk/mmtk/java/build.xml.in Tue Jul 13 22:57:37 2010 @@ -1,7 +1,7 @@ - + From nicolas.geoffray at lip6.fr Tue Jul 13 21:24:36 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jul 2010 04:24:36 -0000 Subject: [vmkit-commits] [vmkit] r108316 - in /vmkit/trunk: include/mvm/Threads/Locks.h lib/J3/Compiler/JavaJIT.cpp lib/Mvm/GCMmap2/ObjectHeader.h mmtk/config/marksweep/ObjectHeader.h mmtk/mmtk-j3/ObjectModel.cpp Message-ID: <20100714042436.99C672A6C12C@llvm.org> Author: geoffray Date: Tue Jul 13 23:24:36 2010 New Revision: 108316 URL: http://llvm.org/viewvc/llvm-project?rev=108316&view=rev Log: Add an ObjectHeader.h file that will describe the header of a GC object. Added: vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h Modified: vmkit/trunk/include/mvm/Threads/Locks.h vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=108316&r1=108315&r2=108316&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Tue Jul 13 23:24:36 2010 @@ -14,6 +14,7 @@ #include #include +#include "ObjectHeader.h" #include "mvm/Threads/Thread.h" #ifdef WITH_LLVM_GCC @@ -184,44 +185,27 @@ void lockAll(int count); }; -#if (__WORDSIZE == 64) - static const uint64_t FatMask = 0x8000000000000000; -#else - static const uint64_t FatMask = 0x80000000; -#endif - - static const uint64_t ThinCountMask = 0xFF000; - static const uint64_t ThinCountShift = 12; - static const uint64_t ThinCountAdd = 0x1000; - // Mask for all GC objects. - static const uint64_t GCMask = 0xFFF; - // Mask for the hash code bits. - static const uint64_t HashMask = 0xFFC; - // Mask for the GC bits. - static const uint64_t GCBitMask = 0x3; - - class FatLockNoGC { - public: - static void gcroot(void* val, void* unused) - __attribute__ ((always_inline)) {} +class FatLockNoGC { +public: + static void gcroot(void* val, void* unused) + __attribute__ ((always_inline)) {} - static uintptr_t mask() { - return 0; - } - }; + static uintptr_t mask() { + return 0; + } +}; - class FatLockWithGC { - public: - static void gcroot(void* val, void* unused) - __attribute__ ((always_inline)) { - llvm_gcroot(val, unused); - } +class FatLockWithGC { +public: + static void gcroot(void* val, void* unused) + __attribute__ ((always_inline)) { + llvm_gcroot(val, unused); + } - static uintptr_t mask() { - return GCMask; - } - }; - + static uintptr_t mask() { + return NonLockBitsMask; + } +}; /// ThinLock - This class is an implementation of thin locks. The template class /// TFatLock is a virtual machine specific fat lock. @@ -231,9 +215,6 @@ public: uintptr_t lock; - - - /// overflowThinlock - Change the lock of this object to a fat lock because /// we have reached 0xFF locks. void overflowThinLock(Owner* O) { @@ -254,8 +235,7 @@ ThinLock() { initialise(); } - - + /// changeToFatlock - Change the lock of this object to a fat lock. The lock /// may be in a thin lock or fat lock state. TFatLock* changeToFatlock(Owner* O) { Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=108316&r1=108315&r2=108316&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Tue Jul 13 23:24:36 2010 @@ -546,10 +546,10 @@ Value* lock = new LoadInst(lockPtr, "", currentBlock); lock = new PtrToIntInst(lock, intrinsics->pointerSizeType, "", currentBlock); - Value* GCMask = ConstantInt::get(intrinsics->pointerSizeType, - mvm::GCMask); + Value* NonLockBitsMask = ConstantInt::get(intrinsics->pointerSizeType, + mvm::NonLockBitsMask); - lock = BinaryOperator::CreateAnd(lock, GCMask, "", currentBlock); + lock = BinaryOperator::CreateAnd(lock, NonLockBitsMask, "", currentBlock); lockPtr = new BitCastInst(lockPtr, PointerType::getUnqual(intrinsics->pointerSizeType), @@ -644,9 +644,11 @@ PointerType::getUnqual(intrinsics->pointerSizeType), "", currentBlock); Value* lock = new LoadInst(lockPtr, "", currentBlock); - Value* GCMask = ConstantInt::get(intrinsics->pointerSizeType, ~mvm::GCMask); + Value* NonLockBitsMask = ConstantInt::get( + intrinsics->pointerSizeType, ~mvm::NonLockBitsMask); - Value* lockedMask = BinaryOperator::CreateAnd(lock, GCMask, "", currentBlock); + Value* lockedMask = BinaryOperator::CreateAnd( + lock, NonLockBitsMask, "", currentBlock); Value* threadId = getCurrentThread(intrinsics->MutatorThreadType); threadId = new PtrToIntInst(threadId, intrinsics->pointerSizeType, "", @@ -667,8 +669,10 @@ // Locked once, set zero currentBlock = LockedOnceBB; - GCMask = ConstantInt::get(intrinsics->pointerSizeType, mvm::GCMask); - lockedMask = BinaryOperator::CreateAnd(lock, GCMask, "", currentBlock); + NonLockBitsMask = ConstantInt::get( + intrinsics->pointerSizeType, mvm::NonLockBitsMask); + lockedMask = BinaryOperator::CreateAnd( + lock, NonLockBitsMask, "", currentBlock); new StoreInst(lockedMask, lockPtr, false, currentBlock); BranchInst::Create(EndUnlock, currentBlock); Added: vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h?rev=108316&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h (added) +++ vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h Tue Jul 13 23:24:36 2010 @@ -0,0 +1,35 @@ +//===----- ObjectHeader.h - Macros for describing an object header --------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef MVM_OBJECT_HEADER_H +#define MVM_OBJECT_HEADER_H + +#include + +namespace mvm { + #if (__WORDSIZE == 64) + static const uint64_t FatMask = 0x8000000000000000; +#else + static const uint64_t FatMask = 0x80000000; +#endif + + static const uint64_t ThinCountMask = 0xFF000; + static const uint64_t ThinCountShift = 12; + static const uint64_t ThinCountAdd = 0x1000; + // Mask for all GC objects. + static const uint64_t NonLockBitsMask = 0xFFF; + // Mask for the hash code bits. + static const uint64_t HashMask = 0xFFC; + // Mask for the GC bits. + static const uint64_t GCBitMask = 0x3; + + static const bool MovesObject = false; +} + +#endif // MVM_OBJECT_HEADER_H Added: vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h?rev=108316&view=auto ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h (added) +++ vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h Tue Jul 13 23:24:36 2010 @@ -0,0 +1,35 @@ +//===----- ObjectHeader.h - Macros for describing an object header --------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef MVM_OBJECT_HEADER_H +#define MVM_OBJECT_HEADER_H + +#include + +namespace mvm { + #if (__WORDSIZE == 64) + static const uint64_t FatMask = 0x8000000000000000; +#else + static const uint64_t FatMask = 0x80000000; +#endif + + static const uint64_t ThinCountMask = 0xFF000; + static const uint64_t ThinCountShift = 12; + static const uint64_t ThinCountAdd = 0x1000; + // Mask for all GC objects. + static const uint64_t NonLockBitsMask = 0xFFF; + // Mask for the hash code bits. + static const uint64_t HashMask = 0xFFC; + // Mask for the GC bits. + static const uint64_t GCBitMask = 0x3; + + static const bool MovesObject = false; +} + +#endif // MVM_OBJECT_HEADER_H Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=108316&r1=108315&r2=108316&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Tue Jul 13 23:24:36 2010 @@ -26,7 +26,7 @@ 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) { // 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"); + // assert((val & ~mvm::NonLockBitsMask) == (((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; @@ -53,7 +53,7 @@ } extern "C" void Java_org_j3_mmtk_ObjectModel_writeAvailableByte__Lorg_vmmagic_unboxed_ObjectReference_2B (JavaObject* OM, JavaObject* obj, uint8_t val) { - assert((val & mvm::GCMask) == val && "GC bits do not fit"); + assert((val & mvm::NonLockBitsMask) == val && "GC bits do not fit"); #if defined(__PPC__) ((uint8_t*)obj)[7] &= ~mvm::GCBitMask; ((uint8_t*)obj)[7] |= val; From nicolas.geoffray at lip6.fr Tue Jul 13 23:01:52 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jul 2010 06:01:52 -0000 Subject: [vmkit-commits] [vmkit] r108321 - in /vmkit/trunk: lib/J3/VMCore/JavaLocks.cpp lib/J3/VMCore/JavaLocks.h lib/J3/VMCore/JavaObject.cpp lib/J3/VMCore/JavaObject.h lib/Mvm/GCMmap2/ObjectHeader.h mmtk/config/marksweep/ObjectHeader.h mmtk/mmtk-j3/ObjectModel.cpp Message-ID: <20100714060153.04F342A6C12C@llvm.org> Author: geoffray Date: Wed Jul 14 01:01:52 2010 New Revision: 108321 URL: http://llvm.org/viewvc/llvm-project?rev=108321&view=rev Log: Support for more than 2 GC bits in the object header. Modified: vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp vmkit/trunk/lib/J3/VMCore/JavaLocks.h vmkit/trunk/lib/J3/VMCore/JavaObject.cpp vmkit/trunk/lib/J3/VMCore/JavaObject.h vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Modified: vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp?rev=108321&r1=108320&r2=108321&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaLocks.cpp Wed Jul 14 01:01:52 2010 @@ -76,13 +76,13 @@ } uintptr_t JavaLock::getID() { - return (index << LockSystem::BitGCHash) | mvm::FatMask; + return (index << mvm::NonLockBits) | mvm::FatMask; } JavaLock* JavaLock::getFromID(uintptr_t ID) { Jnjvm* vm = JavaThread::get()->getJVM(); if (ID & mvm::FatMask) { - uint32_t index = (ID & ~mvm::FatMask) >> LockSystem::BitGCHash; + uint32_t index = (ID & ~mvm::FatMask) >> mvm::NonLockBits; JavaLock* res = vm->lockSystem.getLock(index); return res; } else { Modified: vmkit/trunk/lib/J3/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaLocks.h?rev=108321&r1=108320&r2=108321&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaLocks.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaLocks.h Wed Jul 14 01:01:52 2010 @@ -129,9 +129,6 @@ static const uint32_t IndexSize = 1 << BitIndex; static const uint32_t BitMask = IndexSize - 1; static const uint32_t MaxLocks = GlobalSize * IndexSize; - static const uint32_t BitGC = 2; - static const uint32_t BitHash = 10; - static const uint32_t BitGCHash = BitGC + BitHash; /// LockTable - The global table that will hold the locks. The table is /// a two-dimensional array, and only one entry is created, so that Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.cpp?rev=108321&r1=108320&r2=108321&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.cpp Wed Jul 14 01:01:52 2010 @@ -22,6 +22,31 @@ uint16_t JavaObject::hashCodeGenerator = 1; +/// hashCode - Return the hash code of this object. +uint32_t JavaObject::hashCode(JavaObject* self) { + llvm_gcroot(self, 0); + if (!mvm::MovesObject) return (uint32_t)self; + + uintptr_t oldLock = self->lock.lock; + uintptr_t val = (oldLock & mvm::HashMask) >> mvm::GCBits; + if (val) return val ^ (uintptr_t)getClass(self); + if (hashCodeGenerator >= (mvm::HashMask >> mvm::GCBits)) { + val = hashCodeGenerator = 1; + } else { + val = ++hashCodeGenerator; + } + + do { + uintptr_t oldLock = self->lock.lock; + uintptr_t newLock = (val << mvm::GCBits) | oldLock; + __sync_val_compare_and_swap(&(self->lock.lock), oldLock, newLock); + } while ((self->lock.lock & mvm::HashMask) == 0); + + return ((self->lock.lock & mvm::HashMask) >> mvm::GCBits) ^ + (uintptr_t)getClass(self); +} + + void JavaObject::waitIntern( JavaObject* self, struct timeval* info, bool timed) { llvm_gcroot(self, 0); Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.h?rev=108321&r1=108320&r2=108321&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.h Wed Jul 14 01:01:52 2010 @@ -320,25 +320,7 @@ static uint16_t hashCodeGenerator; /// hashCode - Return the hash code of this object. - static uint32_t hashCode(JavaObject* self) { - llvm_gcroot(self, 0); - uintptr_t oldLock = self->lock.lock; - uintptr_t val = (oldLock & mvm::HashMask) >> LockSystem::BitGC; - if (val) return val ^ (uintptr_t)getClass(self); - else { - if (hashCodeGenerator >= (mvm::HashMask >> LockSystem::BitGC)) - val = hashCodeGenerator = 1; - else val = ++hashCodeGenerator; - } - - do { - uintptr_t oldLock = self->lock.lock; - uintptr_t newLock = (val << LockSystem::BitGC) | oldLock; - __sync_val_compare_and_swap(&(self->lock.lock), oldLock, newLock); - } while ((self->lock.lock & mvm::HashMask) == 0); - return ((self->lock.lock & mvm::HashMask) >> LockSystem::BitGC) ^ - (uintptr_t)getClass(self); - } + static uint32_t hashCode(JavaObject* self); }; Modified: vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h?rev=108321&r1=108320&r2=108321&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/ObjectHeader.h Wed Jul 14 01:01:52 2010 @@ -13,7 +13,7 @@ #include namespace mvm { - #if (__WORDSIZE == 64) +#if (__WORDSIZE == 64) static const uint64_t FatMask = 0x8000000000000000; #else static const uint64_t FatMask = 0x80000000; @@ -22,13 +22,15 @@ static const uint64_t ThinCountMask = 0xFF000; static const uint64_t ThinCountShift = 12; static const uint64_t ThinCountAdd = 0x1000; - // Mask for all GC objects. + static const uint64_t NonLockBitsMask = 0xFFF; - // Mask for the hash code bits. static const uint64_t HashMask = 0xFFC; - // Mask for the GC bits. static const uint64_t GCBitMask = 0x3; + static const uint32_t GCBits = 2; + static const uint32_t HashBits = 10; + static const uint32_t NonLockBits = 12; + static const bool MovesObject = false; } Modified: vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h?rev=108321&r1=108320&r2=108321&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h (original) +++ vmkit/trunk/mmtk/config/marksweep/ObjectHeader.h Wed Jul 14 01:01:52 2010 @@ -13,7 +13,7 @@ #include namespace mvm { - #if (__WORDSIZE == 64) +#if (__WORDSIZE == 64) static const uint64_t FatMask = 0x8000000000000000; #else static const uint64_t FatMask = 0x80000000; @@ -22,12 +22,14 @@ static const uint64_t ThinCountMask = 0xFF000; static const uint64_t ThinCountShift = 12; static const uint64_t ThinCountAdd = 0x1000; - // Mask for all GC objects. + static const uint64_t NonLockBitsMask = 0xFFF; - // Mask for the hash code bits. - static const uint64_t HashMask = 0xFFC; - // Mask for the GC bits. - static const uint64_t GCBitMask = 0x3; + static const uint64_t HashMask = 0xFF0; + static const uint64_t GCBitMask = 0xF; + + static const uint32_t NonLockBits = 12; + static const uint32_t HashBits = 0; + static const uint32_t GCBits = 4; static const bool MovesObject = false; } Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=108321&r1=108320&r2=108321&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Wed Jul 14 01:01:52 2010 @@ -21,19 +21,12 @@ } extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_readAvailableBitsWord__Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* OM, JavaObject* obj) { - return ((uintptr_t*)obj)[1] & mvm::GCBitMask; + return ((uintptr_t*)obj)[1]; } -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) { - // Comment the assert, it prevents MMTkInline.inc to be self-contained. - // assert((val & ~mvm::NonLockBitsMask) == (((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; -#else - ((uint8_t*)obj)[4] &= ~mvm::GCBitMask; - ((uint8_t*)obj)[4] |= val; -#endif +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) { + ((uintptr_t*)obj)[1] = val; } extern "C" JavaObject* Java_org_j3_mmtk_ObjectModel_objectStartRef__Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* OM, JavaObject* obj) { @@ -67,16 +60,13 @@ return obj; } -extern "C" intptr_t Java_org_j3_mmtk_ObjectModel_prepareAvailableBits__Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* OM, JavaObject* obj) { - return ((intptr_t*)obj)[1]; +extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_prepareAvailableBits__Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* OM, JavaObject* obj) { + return ((uintptr_t*)obj)[1]; } extern "C" uint8_t Java_org_j3_mmtk_ObjectModel_attemptAvailableBits__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Word_2Lorg_vmmagic_unboxed_Word_2( - JavaObject* OM, JavaObject* obj, intptr_t oldValue, intptr_t newValue) { - - assert(((oldValue & ~mvm::GCBitMask) == (newValue & ~mvm::GCBitMask)) && - "GC bits do not fit"); + JavaObject* OM, JavaObject* obj, intptr_t oldValue, intptr_t newValue) { return __sync_bool_compare_and_swap(((intptr_t*)obj) + 1, oldValue, newValue); } From minas.subs at gmail.com Wed Jul 14 01:17:46 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Wed, 14 Jul 2010 13:17:46 +0500 Subject: [vmkit-commits] Building VMkit: 32 bit and 64 bit - patch to build 64bits+tests Message-ID: Hi, After reading about some problems with building VMkit x86_64 in llvm-dev list I realized that it wasn't tested too long to work in 64 bits So I tried to build VMkit on 32 bit linux and it works fine: I mean it was built ok, but crushes at run (SIGSEGV see net mail). Building 64 bit version requires changes in Makefiles, as in patch I'm supplying, and now 64bit version builds ok too. And J3 brings the same SIGSEGV error. Also I made some changes to tests (testAllocator, testCollector) to made them just build, although I saw they are now not much of usefulness, but anyway. Please see/review attached patch file and apply it to sources, or give me access for I do it myself. Regards, Minas PS will mailserver pass attachments? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- diff -r tools-orig/j3/Makefile tools/j3/Makefile 37c37 < Mvm.a MvmCompiler.a $(GCLIB).a CommonThread.a --- > Mvm.a MvmCompiler.a $(GCLIB).a Allocator.a CommonThread.a diff -r tools-orig/testAllocator/Main.cpp tools/testAllocator/Main.cpp 16a17,39 > #include > > void set_stack_size16M() > { > const rlim_t kStackSize = 16 * 1024 * 1024; // min stack size = 16 MB > struct rlimit rl; > int result; > > result = getrlimit(RLIMIT_STACK, &rl); > if (result == 0) > { > if (rl.rlim_cur < kStackSize) > { > rl.rlim_cur = kStackSize; > result = setrlimit(RLIMIT_STACK, &rl); > if (result != 0) > fprintf(stderr, "setrlimit returned result = %d\n", result); > else > fprintf(stderr, "setrlimit OK\n"); > } > } > } > 74c97 < size_t n = 512*1024; --- > size_t n = 512*1024; //512K 4bytes==2Mb, times3=6Mb; for x86_64:12Mb 118a142 > set_stack_size16M(); diff -r tools-orig/testAllocator/Makefile tools/testAllocator/Makefile 12c12 < USEDLIBS = Allocator --- > USEDLIBS = Allocator.a 16a17 > #CXX.Flags += -I$(LEVEL)/lib/Mvm/Allocator -Wl,--stack,14680064 \ No newline at end of file diff -r tools-orig/testCollector/Main.cpp tools/testCollector/Main.cpp 10c10 < #include "mvm/GC/GC.h" --- > #include "MvmGC.h" 14c14 < mvm::Key* mvm::Thread::threadKey = 0; --- > //? mvm::Key* mvm::Thread::threadKey = 0; 17c17 < printf("Destroy %p\n", me); --- > printf("Destroy %p\n", (void*)me); 21c21 < // printf("Trace %p\n", me); --- > // printf("Trace %p\n", (void*)me); 25c25 < // printf("Marker...\n"); --- > // printf("Marker...\n"); 29,30c29,30 < mvm::Thread::initialise(); < Collector::initialise(marker, 0); --- > //? mvm::Thread::initialise(); > mvm::Collector::initialise(); //initialise(marker, 0); 34c34 < Collector::destroy(); --- > mvm::Collector::destroy(); 39,43d38 < < < < < diff -r tools-orig/testCollector/Makefile tools/testCollector/Makefile 11,12c11,16 < TOOLNAME = CollectorTest < USEDLIBS = Allocator GCMmap2 CommonThread --- > TOOLNAME = testCollector > USEDLIBS=GCMmap2.a CommonThread.a Allocator.a GCMmap2.a Mvm.a GCMmap2.a > > LINK_COMPONENTS = support diff -r tools-orig/vmjc/Makefile tools/vmjc/Makefile 29c29 < Mvm.a MvmCompiler.a $(GCLIB).a CommonThread.a --- > Mvm.a MvmCompiler.a $(GCLIB).a Allocator.a CommonThread.a From minas.subs at gmail.com Wed Jul 14 01:31:37 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Wed, 14 Jul 2010 13:31:37 +0500 Subject: [vmkit-commits] J3 crushes on HelloWorld Message-ID: In both versions, 32 bit and 64-bit I now have VMkit is crushing: [bin]$ java HW Hello, world! [bin]$ ./j3 HW I received a SIGSEGV: either the VM code or an external native method is bogus. Aborting... Segmentation fault (core dumped) [bin]$ Didn't look deep inside of 32bit version, but in 64bit it fails as: (gdb) bt #0 0x0000000000ae1ba3 in j3::JnjvmClassLoader::loadClassFromAsciiz (this=0x0, asciiz=0x7ffff7b524f8 "gnu/classpath/Pointer64", doResolve=true, doThrow=true) at JnjvmClassLoader.cpp:537 #1 0x0000000000b057c5 in FindClass (env=0x1c35910, asciiz=0x7ffff7b524f8 "gnu/classpath/Pointer64") at Jni.cpp:75 #2 0x00007ffff7b4fdcd in JNI_OnLoad (vm=, reserved=) at jcl.c:73 #3 0x0000000000b24fe0 in callOnLoad (res=0x7ffff027e0b0, loader=0x1c326b0, vm=0x1c35578) at ClasspathVMRuntime.inc:95 #4 0x0000000000b250cd in Java_java_lang_VMRuntime_nativeLoad (str=0x7ffff039ede0, javaLoader=0x0) at ClasspathVMRuntime.inc:126 #5 0x00007ffff7ef3a51 in ?? () #6 0x00007ffff0104e76 in ?? () #7 0x00000001200fdbd0 in ?? () #8 0x00000001200fdbd0 in ?? () #9 0x00007ffff7ef4447 in ?? () #10 0x00007ffff01fa618 in ?? () #11 0x0000000000000000 in ?? () == No symbols now yet, but hope it could somehow help. /** cat HW.java */ public class HW { public static void main(final String args[]) { System.out.println("Hello, world!"); } } -Minas -------------- next part -------------- An HTML attachment was scrubbed... URL: From minas.subs at gmail.com Wed Jul 14 10:28:29 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Wed, 14 Jul 2010 22:28:29 +0500 Subject: [vmkit-commits] Build is broken: MMTkInline.inc is absent Message-ID: Hi, Build complains on absence of MMTkInline.inc file, make output: <<< make[3]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler' llvm[3]: Building LLVM runtime with /home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler/LLVMRuntime.ll llvm[3]: Compiling Disassembler.cpp for Debug build llvm[3]: Compiling EscapeAnalysis.cpp for Debug build llvm[3]: Compiling InlineMalloc.cpp for Debug build llvm[3]: Compiling JIT.cpp for Debug build JIT.cpp:74:30: error: MMTkInline.inc: No such file or directory JIT.cpp: In constructor ‘mvm::BaseIntrinsics::BaseIntrinsics(llvm::Module*)’: JIT.cpp:189: error: ‘makeLLVMFunction’ is not a member of ‘mvm::mmtk_runtime’ make[3]: *** [/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler/Debug/JIT.o] Error 1 >>> MMTkInline.inc place was changed in one recent commit, and now vmkit can't be built Regards, Minas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Wed Jul 14 11:29:40 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jul 2010 18:29:40 -0000 Subject: [vmkit-commits] [vmkit] r108344 - /vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Message-ID: <20100714182941.050AB2A6C12C@llvm.org> Author: geoffray Date: Wed Jul 14 13:29:40 2010 New Revision: 108344 URL: http://llvm.org/viewvc/llvm-project?rev=108344&view=rev Log: Don't include MMTkInline.inc if we're not using MMTk. Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=108344&r1=108343&r2=108344&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Wed Jul 14 13:29:40 2010 @@ -70,9 +70,11 @@ #include "LLVMRuntime.inc" } +#ifdef WITH_MMTK namespace mmtk_runtime { #include "MMTkInline.inc" } +#endif void linkVmkitGC(); } @@ -174,20 +176,21 @@ } } -static const char* MMTkSymbol = - "JnJVM_org_j3_bindings_Bindings_gcmalloc__" - "ILorg_vmmagic_unboxed_ObjectReference_2"; - BaseIntrinsics::BaseIntrinsics(llvm::Module* module) { module->setDataLayout(MvmModule::globalModule->getDataLayout()); module->setTargetTriple(MvmModule::globalModule->getTargetTriple()); LLVMContext& Context = module->getContext(); +#ifdef WITH_MMTK + static const char* MMTkSymbol = + "JnJVM_org_j3_bindings_Bindings_gcmalloc__" + "ILorg_vmmagic_unboxed_ObjectReference_2"; if (dlsym(SELF_HANDLE, MMTkSymbol)) { // If we have found MMTk, read the gcmalloc function. mvm::mmtk_runtime::makeLLVMFunction(module); } +#endif mvm::llvm_runtime::makeLLVMModuleContents(module); From nicolas.geoffray at gmail.com Wed Jul 14 11:31:28 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Wed, 14 Jul 2010 11:31:28 -0700 Subject: [vmkit-commits] Build is broken: MMTkInline.inc is absent In-Reply-To: References: Message-ID: Hi Minas, Indeed, I forgot to update the non-MMTk build. It should be fixed now. Thanks for reporting! Nicolas On Wed, Jul 14, 2010 at 10:28 AM, Minas Abrahamyan wrote: > Hi, > > Build complains on absence of MMTkInline.inc file, > make output: > > <<< > make[3]: Entering directory `/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler' > llvm[3]: Building LLVM runtime with > /home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler/LLVMRuntime.ll > llvm[3]: Compiling Disassembler.cpp for Debug build > llvm[3]: Compiling EscapeAnalysis.cpp for Debug build > llvm[3]: Compiling InlineMalloc.cpp for Debug build > llvm[3]: Compiling JIT.cpp for Debug build > JIT.cpp:74:30: error: MMTkInline.inc: No such file or directory > JIT.cpp: In constructor > ‘mvm::BaseIntrinsics::BaseIntrinsics(llvm::Module*)’: > JIT.cpp:189: error: ‘makeLLVMFunction’ is not a member of > ‘mvm::mmtk_runtime’ > make[3]: *** [/home/mn/tests/VMkit/vmkit/lib/Mvm/Compiler/Debug/JIT.o] > Error 1 > >>> > > MMTkInline.inc place was changed in one recent commit, and now vmkit can't > be built > > > Regards, > Minas > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at gmail.com Wed Jul 14 11:34:22 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Wed, 14 Jul 2010 11:34:22 -0700 Subject: [vmkit-commits] J3 crushes on HelloWorld In-Reply-To: References: Message-ID: Hi Minas, Could you test with the 32 bits version whether you get the same stack trace? The fact that "this" is null in loadClassFromAsciiz is surprising, and unfortunately, I don't have access to a 64bit machine. Thanks, Nicolas On Wed, Jul 14, 2010 at 1:31 AM, Minas Abrahamyan wrote: > In both versions, 32 bit and 64-bit I now have VMkit is crushing: > > [bin]$ java HW > Hello, world! > [bin]$ ./j3 HW > I received a SIGSEGV: either the VM code or an external > native method is bogus. Aborting... > Segmentation fault (core dumped) > [bin]$ > > Didn't look deep inside of 32bit version, but in 64bit it fails as: > (gdb) bt > #0 0x0000000000ae1ba3 in j3::JnjvmClassLoader::loadClassFromAsciiz > (this=0x0, > asciiz=0x7ffff7b524f8 "gnu/classpath/Pointer64", doResolve=true, > doThrow=true) at JnjvmClassLoader.cpp:537 > #1 0x0000000000b057c5 in FindClass (env=0x1c35910, asciiz=0x7ffff7b524f8 > "gnu/classpath/Pointer64") > at Jni.cpp:75 > #2 0x00007ffff7b4fdcd in JNI_OnLoad (vm=, > reserved=) at jcl.c:73 > #3 0x0000000000b24fe0 in callOnLoad (res=0x7ffff027e0b0, loader=0x1c326b0, > vm=0x1c35578) > at ClasspathVMRuntime.inc:95 > #4 0x0000000000b250cd in Java_java_lang_VMRuntime_nativeLoad > (str=0x7ffff039ede0, javaLoader=0x0) > at ClasspathVMRuntime.inc:126 > #5 0x00007ffff7ef3a51 in ?? () > #6 0x00007ffff0104e76 in ?? () > #7 0x00000001200fdbd0 in ?? () > #8 0x00000001200fdbd0 in ?? () > #9 0x00007ffff7ef4447 in ?? () > #10 0x00007ffff01fa618 in ?? () > #11 0x0000000000000000 in ?? () > == > No symbols now yet, but hope it could somehow help. > > /** cat HW.java */ > public class HW { > public static void main(final String args[]) { > System.out.println("Hello, world!"); > } > } > > > -Minas > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Wed Jul 14 12:55:22 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jul 2010 19:55:22 -0000 Subject: [vmkit-commits] [vmkit] r108352 - /vmkit/trunk/autoconf/configure.ac Message-ID: <20100714195522.3F5D62A6C12C@llvm.org> Author: geoffray Date: Wed Jul 14 14:55:22 2010 New Revision: 108352 URL: http://llvm.org/viewvc/llvm-project?rev=108352&view=rev Log: Detect ant if MMTk is provided and fail if it is not there. Patch by Chanwit Kaewkasi! Modified: vmkit/trunk/autoconf/configure.ac Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=108352&r1=108351&r2=108352&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Wed Jul 14 14:55:22 2010 @@ -473,7 +473,13 @@ AC_PATH_PROG(LLVMAS, [llvm-as], [llvm-as]) AC_PATH_PROG(LLC, [llc], [llc]) -AC_PATH_PROG(ANT, [ant]) + +if test "x$gc" = "xmmtk"; then + AC_PATH_PROG(ANT, [ant]) + if test -z "$ANT"; then + AC_MSG_ERROR([Apache ANT required for MMTk, but not found]) + fi +fi dnl Find the install program AC_PROG_INSTALL From nicolas.geoffray at lip6.fr Wed Jul 14 12:55:42 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Jul 2010 19:55:42 -0000 Subject: [vmkit-commits] [vmkit] r108353 - /vmkit/trunk/configure Message-ID: <20100714195542.167B82A6C12C@llvm.org> Author: geoffray Date: Wed Jul 14 14:55:41 2010 New Revision: 108353 URL: http://llvm.org/viewvc/llvm-project?rev=108353&view=rev Log: Regenerate Modified: vmkit/trunk/configure Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=108353&r1=108352&r2=108353&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Wed Jul 14 14:55:41 2010 @@ -5596,7 +5596,9 @@ fi -# Extract the first word of "ant", so it can be a program name with args. + +if test "x$gc" = "xmmtk"; then + # Extract the first word of "ant", so it can be a program name with args. set dummy ant; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -5636,6 +5638,10 @@ fi + if test -z "$ANT"; then + as_fn_error "Apache ANT required for MMTk, but not found" "$LINENO" 5 + fi +fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or From nicolas.geoffray at gmail.com Wed Jul 14 13:11:13 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Wed, 14 Jul 2010 13:11:13 -0700 Subject: [vmkit-commits] Building VMkit: 32 bit and 64 bit - patch to build 64bits+tests In-Reply-To: References: Message-ID: Hi Minas, Thanks for the patch! Indeed the tests are not useful, they're mainly here for historical reasons. Could you send me a file that I can use with the 'patch' tool? Cheers, Nicolas On Wed, Jul 14, 2010 at 1:17 AM, Minas Abrahamyan wrote: > Hi, > > After reading about some problems with building VMkit x86_64 in llvm-dev > list I realized that it wasn't tested too long to work in 64 bits > > So I tried to build VMkit on 32 bit linux and it works fine: I mean it was > built ok, but crushes at run (SIGSEGV see net mail). > > Building 64 bit version requires changes in Makefiles, as in patch I'm > supplying, and now 64bit version builds ok too. And J3 brings the same > SIGSEGV error. > > Also I made some changes to tests (testAllocator, testCollector) to made > them just build, although I saw they are now not much of usefulness, but > anyway. > > Please see/review attached patch file and apply it to sources, or give me > access for I do it myself. > > Regards, > Minas > > PS will mailserver pass attachments? > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From minas.subs at gmail.com Thu Jul 15 01:09:13 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Thu, 15 Jul 2010 13:09:13 +0500 Subject: [vmkit-commits] Building VMkit: 32 bit and 64 bit - patch to build 64bits+tests In-Reply-To: References: Message-ID: Hi Nicolas, Here is patch, and to apply it: $cd vmkit $patch -p2 <../vmkit_make64-2.patch There I changed also a new hashCode() function from lib/J3/VMCore/JavaObject.cpp - pointers in 64bit machines are of 8-byte size. Now 64 bit continues to build. Regards, Minas On Thu, Jul 15, 2010 at 1:11 AM, nicolas geoffray < nicolas.geoffray at gmail.com> wrote: > Hi Minas, > > Thanks for the patch! Indeed the tests are not useful, they're mainly here > for historical reasons. Could you send me a file that I can use with the > 'patch' tool? > > Cheers, > Nicolas > > On Wed, Jul 14, 2010 at 1:17 AM, Minas Abrahamyan wrote: > >> Hi, >> >> After reading about some problems with building VMkit x86_64 in llvm-dev >> list I realized that it wasn't tested too long to work in 64 bits >> >> So I tried to build VMkit on 32 bit linux and it works fine: I mean it was >> built ok, but crushes at run (SIGSEGV see net mail). >> >> Building 64 bit version requires changes in Makefiles, as in patch I'm >> supplying, and now 64bit version builds ok too. And J3 brings the same >> SIGSEGV error. >> >> Also I made some changes to tests (testAllocator, testCollector) to made >> them just build, although I saw they are now not much of usefulness, but >> anyway. >> >> Please see/review attached patch file and apply it to sources, or give me >> access for I do it myself. >> >> Regards, >> Minas >> >> PS will mailserver pass attachments? >> >> _______________________________________________ >> vmkit-commits mailing list >> vmkit-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >> >> > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vmkit_make64-2.patch Type: text/x-patch Size: 6289 bytes Desc: not available URL: From minas.subs at gmail.com Thu Jul 15 01:17:41 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Thu, 15 Jul 2010 13:17:41 +0500 Subject: [vmkit-commits] J3 crushes on HelloWorld In-Reply-To: References: Message-ID: Hi Nicolas, I've rebuilt 32-bit version and it passed this "HelloWorld" test ok, maybe error was in classpath of 64 version I moved before to there. ... 64-bits continue with same error, 'this' is null, because loader is null, etc. Regards, Minas On Wed, Jul 14, 2010 at 11:34 PM, nicolas geoffray < nicolas.geoffray at gmail.com> wrote: > Hi Minas, > > Could you test with the 32 bits version whether you get the same stack > trace? The fact that "this" is null in loadClassFromAsciiz is surprising, > and unfortunately, I don't have access to a 64bit machine. > > Thanks, > Nicolas > > On Wed, Jul 14, 2010 at 1:31 AM, Minas Abrahamyan wrote: > >> In both versions, 32 bit and 64-bit I now have VMkit is crushing: >> >> [bin]$ java HW >> Hello, world! >> [bin]$ ./j3 HW >> I received a SIGSEGV: either the VM code or an external >> native method is bogus. Aborting... >> Segmentation fault (core dumped) >> [bin]$ >> >> Didn't look deep inside of 32bit version, but in 64bit it fails as: >> (gdb) bt >> #0 0x0000000000ae1ba3 in j3::JnjvmClassLoader::loadClassFromAsciiz >> (this=0x0, >> asciiz=0x7ffff7b524f8 "gnu/classpath/Pointer64", doResolve=true, >> doThrow=true) at JnjvmClassLoader.cpp:537 >> #1 0x0000000000b057c5 in FindClass (env=0x1c35910, asciiz=0x7ffff7b524f8 >> "gnu/classpath/Pointer64") >> at Jni.cpp:75 >> #2 0x00007ffff7b4fdcd in JNI_OnLoad (vm=, >> reserved=) at jcl.c:73 >> #3 0x0000000000b24fe0 in callOnLoad (res=0x7ffff027e0b0, >> loader=0x1c326b0, vm=0x1c35578) >> at ClasspathVMRuntime.inc:95 >> #4 0x0000000000b250cd in Java_java_lang_VMRuntime_nativeLoad >> (str=0x7ffff039ede0, javaLoader=0x0) >> at ClasspathVMRuntime.inc:126 >> #5 0x00007ffff7ef3a51 in ?? () >> #6 0x00007ffff0104e76 in ?? () >> #7 0x00000001200fdbd0 in ?? () >> #8 0x00000001200fdbd0 in ?? () >> #9 0x00007ffff7ef4447 in ?? () >> #10 0x00007ffff01fa618 in ?? () >> #11 0x0000000000000000 in ?? () >> == >> No symbols now yet, but hope it could somehow help. >> >> /** cat HW.java */ >> public class HW { >> public static void main(final String args[]) { >> System.out.println("Hello, world!"); >> } >> } >> >> >> -Minas >> >> _______________________________________________ >> vmkit-commits mailing list >> vmkit-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >> >> > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Thu Jul 15 10:35:48 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 15 Jul 2010 17:35:48 -0000 Subject: [vmkit-commits] [vmkit] r108430 - in /vmkit/trunk: lib/J3/VMCore/JavaObject.cpp tools/j3/Makefile tools/testAllocator/Main.cpp tools/testAllocator/Makefile tools/testCollector/Main.cpp tools/testCollector/Makefile tools/vmjc/Makefile Message-ID: <20100715173548.194F22A6C12C@llvm.org> Author: geoffray Date: Thu Jul 15 12:35:47 2010 New Revision: 108430 URL: http://llvm.org/viewvc/llvm-project?rev=108430&view=rev Log: Patch for 64 bits by Minas Abrahamyan! Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.cpp vmkit/trunk/tools/j3/Makefile vmkit/trunk/tools/testAllocator/Main.cpp vmkit/trunk/tools/testAllocator/Makefile vmkit/trunk/tools/testCollector/Main.cpp vmkit/trunk/tools/testCollector/Makefile vmkit/trunk/tools/vmjc/Makefile Modified: vmkit/trunk/lib/J3/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaObject.cpp?rev=108430&r1=108429&r2=108430&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaObject.cpp Thu Jul 15 12:35:47 2010 @@ -25,7 +25,7 @@ /// hashCode - Return the hash code of this object. uint32_t JavaObject::hashCode(JavaObject* self) { llvm_gcroot(self, 0); - if (!mvm::MovesObject) return (uint32_t)self; + if (!mvm::MovesObject) return (uint32_t)(long)self; uintptr_t oldLock = self->lock.lock; uintptr_t val = (oldLock & mvm::HashMask) >> mvm::GCBits; Modified: vmkit/trunk/tools/j3/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/j3/Makefile?rev=108430&r1=108429&r2=108430&view=diff ============================================================================== --- vmkit/trunk/tools/j3/Makefile (original) +++ vmkit/trunk/tools/j3/Makefile Thu Jul 15 12:35:47 2010 @@ -34,7 +34,7 @@ else USEDLIBS = J3.a Classpath.a J3.a J3Compiler.a Allocator.a \ - Mvm.a MvmCompiler.a $(GCLIB).a CommonThread.a + Mvm.a MvmCompiler.a $(GCLIB).a Allocator.a CommonThread.a ifeq ($(ISOLATE_SHARING_BUILD), 1) USEDLIBS += Isolate Modified: vmkit/trunk/tools/testAllocator/Main.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/testAllocator/Main.cpp?rev=108430&r1=108429&r2=108430&view=diff ============================================================================== --- vmkit/trunk/tools/testAllocator/Main.cpp (original) +++ vmkit/trunk/tools/testAllocator/Main.cpp Thu Jul 15 12:35:47 2010 @@ -14,6 +14,28 @@ #include #include +#include +void set_stack_size(uint Mbs) +{ + const rlim_t kStackSize = Mbs * 1024 * 1024; + struct rlimit rl; + int result; + + result = getrlimit(RLIMIT_STACK, &rl); + if (result == 0) + { + if (rl.rlim_cur < kStackSize) + { + rl.rlim_cur = kStackSize; + result = setrlimit(RLIMIT_STACK, &rl); + if (result != 0) + fprintf(stderr, "setrlimit returned result = %d\n", result); + else + fprintf(stderr, "setrlimit OK\n"); + } + } +} + unsigned int rand(unsigned int min, unsigned int max) { return (unsigned int)nearbyint((((double)(max - min))*::rand())/(RAND_MAX + 1.0)) + min; } @@ -61,8 +83,8 @@ nf++; } - printf("; %d allocations (%d reallocations, %d free, %d chunks)\n", na, nr, nf, no); - printf("; Allocated: %d bytes, current %d bytes\n", totAllocated, curAllocated); + printf("; %lu allocations (%lu reallocations, %lu free, %lu chunks)\n", na, nr, nf, no); + printf("; Allocated: %lu bytes, current %lu bytes\n", totAllocated, curAllocated); struct timeval diff; timersub(end, start, &diff); @@ -71,7 +93,7 @@ } void mesureAllocateur() { - size_t n = 512*1024; + size_t n = 512*1024; //512K 4bytes==2Mb, times3=6Mb; for x86_64:12Mb size_t* vals = (size_t*)alloca(sizeof(size_t) * n); size_t* reallocs = (size_t*)alloca(sizeof(size_t) * n); size_t* frees = (size_t*)alloca(sizeof(size_t) * n); @@ -116,6 +138,8 @@ } int main(int argc, char **argv) { + if( sizeof(size_t) > 4) //bogus check for 64bits + set_stack_size(16); //update min stack size to 16 MB for mesureAllocateur() mesureAllocateur(); GCHash::destroy(); Modified: vmkit/trunk/tools/testAllocator/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/testAllocator/Makefile?rev=108430&r1=108429&r2=108430&view=diff ============================================================================== --- vmkit/trunk/tools/testAllocator/Makefile (original) +++ vmkit/trunk/tools/testAllocator/Makefile Thu Jul 15 12:35:47 2010 @@ -9,7 +9,7 @@ LEVEL = ../.. TOOLNAME = testAllocator -USEDLIBS = Allocator +USEDLIBS = Allocator.a include $(LEVEL)/Makefile.common Modified: vmkit/trunk/tools/testCollector/Main.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/testCollector/Main.cpp?rev=108430&r1=108429&r2=108430&view=diff ============================================================================== --- vmkit/trunk/tools/testCollector/Main.cpp (original) +++ vmkit/trunk/tools/testCollector/Main.cpp Thu Jul 15 12:35:47 2010 @@ -7,37 +7,29 @@ // //===----------------------------------------------------------------------===// -#include "mvm/GC/GC.h" +#include "MvmGC.h" #include "mvm/Threads/Thread.h" #include -mvm::Key* mvm::Thread::threadKey = 0; - void destr(gc *me, size_t sz) { - printf("Destroy %p\n", me); + printf("Destroy %p\n", (void*)me); } void trace(gc *me, size_t sz) { - // printf("Trace %p\n", me); + // printf("Trace %p\n", (void*)me); } void marker(void*) { - // printf("Marker...\n"); + // printf("Marker...\n"); } int main(int argc, char **argv) { - mvm::Thread::initialise(); - Collector::initialise(marker, 0); + mvm::Collector::initialise(); #ifdef MULTIPLE_GC mvm::Thread::get()->GC->destroy(); #else - Collector::destroy(); + mvm::Collector::destroy(); #endif return 0; } - - - - - Modified: vmkit/trunk/tools/testCollector/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/testCollector/Makefile?rev=108430&r1=108429&r2=108430&view=diff ============================================================================== --- vmkit/trunk/tools/testCollector/Makefile (original) +++ vmkit/trunk/tools/testCollector/Makefile Thu Jul 15 12:35:47 2010 @@ -8,8 +8,10 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. -TOOLNAME = CollectorTest -USEDLIBS = Allocator GCMmap2 CommonThread +TOOLNAME = testCollector +USEDLIBS=GCMmap2.a CommonThread.a Allocator.a GCMmap2.a Mvm.a GCMmap2.a + +LINK_COMPONENTS = support include $(LEVEL)/Makefile.common Modified: vmkit/trunk/tools/vmjc/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/Makefile?rev=108430&r1=108429&r2=108430&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/Makefile (original) +++ vmkit/trunk/tools/vmjc/Makefile Thu Jul 15 12:35:47 2010 @@ -26,7 +26,7 @@ else USEDLIBS = J3.a Classpath.a J3.a J3Compiler.a Allocator.a \ - Mvm.a MvmCompiler.a $(GCLIB).a CommonThread.a + Mvm.a MvmCompiler.a $(GCLIB).a Allocator.a CommonThread.a endif LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo bitwriter bitreader asmparser linker From nicolas.geoffray at gmail.com Thu Jul 15 10:37:15 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Thu, 15 Jul 2010 10:37:15 -0700 Subject: [vmkit-commits] Building VMkit: 32 bit and 64 bit - patch to build 64bits+tests In-Reply-To: References: Message-ID: Patch applied, thanks! http://lists.cs.uiuc.edu/pipermail/vmkit-commits/2010-July/001708.html On Thu, Jul 15, 2010 at 1:09 AM, Minas Abrahamyan wrote: > Hi Nicolas, > > Here is patch, and to apply it: > $cd vmkit > $patch -p2 <../vmkit_make64-2.patch > > There I changed also a new hashCode() function from > lib/J3/VMCore/JavaObject.cpp > - pointers in 64bit machines are of 8-byte size. Now 64 bit continues to > build. > > Regards, > Minas > > > On Thu, Jul 15, 2010 at 1:11 AM, nicolas geoffray < > nicolas.geoffray at gmail.com> wrote: > >> Hi Minas, >> >> Thanks for the patch! Indeed the tests are not useful, they're mainly here >> for historical reasons. Could you send me a file that I can use with the >> 'patch' tool? >> >> Cheers, >> Nicolas >> >> On Wed, Jul 14, 2010 at 1:17 AM, Minas Abrahamyan wrote: >> >>> Hi, >>> >>> After reading about some problems with building VMkit x86_64 in llvm-dev >>> list I realized that it wasn't tested too long to work in 64 bits >>> >>> So I tried to build VMkit on 32 bit linux and it works fine: I mean it >>> was built ok, but crushes at run (SIGSEGV see net mail). >>> >>> Building 64 bit version requires changes in Makefiles, as in patch I'm >>> supplying, and now 64bit version builds ok too. And J3 brings the same >>> SIGSEGV error. >>> >>> Also I made some changes to tests (testAllocator, testCollector) to made >>> them just build, although I saw they are now not much of usefulness, but >>> anyway. >>> >>> Please see/review attached patch file and apply it to sources, or give me >>> access for I do it myself. >>> >>> Regards, >>> Minas >>> >>> PS will mailserver pass attachments? >>> >>> _______________________________________________ >>> vmkit-commits mailing list >>> vmkit-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >>> >>> >> >> _______________________________________________ >> vmkit-commits mailing list >> vmkit-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >> >> > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willdtz at gmail.com Thu Jul 15 10:51:55 2010 From: willdtz at gmail.com (Will Dietz) Date: Thu, 15 Jul 2010 12:51:55 -0500 Subject: [vmkit-commits] VMKit AOT Compilation Error Message-ID: Hi all, I'm trying to use the AOT compilation feature of VMKit, and am struggling to compile glibj to native code. I'm working on Mac OS X x86, and have tried both VMkit-2.7 with LLVM-2.7 as well as TOT of both, and both cases yield: make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 llvm[0]: Compiling glibj.zip to llvm llvm[0]: Optimizing glibj.zip llvm[0]: Compiling glibj.zip.bc to native i64 zext (i32 add (i32 ptrtoint ([4 x i32 (...)*]* @261 to i32), i32 1) to i64) FIXME: Don't support this constant expr UNREACHABLE executed at /Users/wdietz2/llvm/tot/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1268! 0 llc 0x00000001009f9582 PrintStackTrace(void*) + 34 1 llc 0x00000001009fa223 SignalHandler(int) + 707 2 libSystem.B.dylib 0x00007fff83bc935a _sigtramp + 26 3 llc 0x0000000100cf9840 llvm::dbgs()::thestrm + 0 4 llc 0x00000001009d654d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 381 5 llc 0x00000001005cf0a7 LowerConstant(llvm::Constant const*, llvm::AsmPrinter&) + 2631 6 llc 0x00000001005ce8bd LowerConstant(llvm::Constant const*, llvm::AsmPrinter&) + 605 7 llc 0x00000001005cfa7c EmitGlobalConstantImpl(llvm::Constant const*, unsigned int, llvm::AsmPrinter&) + 2092 8 llc 0x00000001005d0e90 EmitGlobalConstantArray(llvm::ConstantArray const*, unsigned int, llvm::AsmPrinter&) + 80 9 llc 0x00000001005cf562 EmitGlobalConstantImpl(llvm::Constant const*, unsigned int, llvm::AsmPrinter&) + 786 10 llc 0x00000001005d1569 llvm::AsmPrinter::EmitGlobalVariable(llvm::GlobalVariable const*) + 1129 11 llc 0x00000001005d21bf llvm::AsmPrinter::doFinalization(llvm::Module&) + 79 12 llc 0x0000000100978986 llvm::FPPassManager::runOnModule(llvm::Module&) + 246 13 llc 0x000000010097a3dc llvm::MPPassManager::runOnModule(llvm::Module&) + 604 14 llc 0x000000010097a6d3 llvm::PassManagerImpl::run(llvm::Module&) + 163 15 llc 0x000000010097a7ad llvm::PassManager::run(llvm::Module&) + 13 16 llc 0x000000010001e980 main + 2928 17 llc 0x000000010001d3b8 start + 52 Stack dump: 0. Program arguments: /Users/wdietz2/llvm/tot/llvm-objects/Release+Asserts/bin/llc -relocation-model=pic -disable-fp-elim glibj-optimized.zip.bc -o glibj.zip.s 1. Running pass 'Function Pass Manager' on module 'glibj-optimized.zip.bc'. make: *** [glibj.zip.s] Abort trap I also get this error even if I skip the optimization step (run similar llc command on just glibj.bc), for whatever that's worth. Any thoughts on what might be wrong or where I might look to fix it? Anyone else seeing this? Thanks for your time, ~Will Dietz From minas.subs at gmail.com Thu Jul 15 21:05:56 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Fri, 16 Jul 2010 09:05:56 +0500 Subject: [vmkit-commits] VMKit AOT Compilation Error In-Reply-To: References: Message-ID: Hi Will, Just curious, you are stating use of 32-bit system (Mac OS X x86) but addresses in stacktrace you brought are 64-bit values. Maybe you're running x86_64 version? -Minas On Thu, Jul 15, 2010 at 10:51 PM, Will Dietz wrote: > Hi all, > > I'm trying to use the AOT compilation feature of VMKit, and am > struggling to compile glibj to native code. > > I'm working on Mac OS X x86, and have tried both VMkit-2.7 with > LLVM-2.7 as well as TOT of both, and both cases yield: > > make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 > llvm[0]: Compiling glibj.zip to llvm > llvm[0]: Optimizing glibj.zip > llvm[0]: Compiling glibj.zip.bc to native > i64 zext (i32 add (i32 ptrtoint ([4 x i32 (...)*]* @261 to i32), i32 1) to i64) >  FIXME: Don't support this constant expr >  UNREACHABLE executed at > /Users/wdietz2/llvm/tot/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1268! >  0  llc               0x00000001009f9582 PrintStackTrace(void*) + 34 >  1  llc               0x00000001009fa223 SignalHandler(int) + 707 >  2  libSystem.B.dylib 0x00007fff83bc935a _sigtramp + 26 >  3  llc               0x0000000100cf9840 llvm::dbgs()::thestrm + 0 >  4  llc               0x00000001009d654d > llvm::llvm_unreachable_internal(char const*, char const*, unsigned > int) + 381 >  5  llc               0x00000001005cf0a7 LowerConstant(llvm::Constant > const*, llvm::AsmPrinter&) + 2631 >  6  llc               0x00000001005ce8bd LowerConstant(llvm::Constant > const*, llvm::AsmPrinter&) + 605 >  7  llc               0x00000001005cfa7c > EmitGlobalConstantImpl(llvm::Constant const*, unsigned int, > llvm::AsmPrinter&) + 2092 >  8  llc               0x00000001005d0e90 > EmitGlobalConstantArray(llvm::ConstantArray const*, unsigned int, > llvm::AsmPrinter&) + 80 >  9  llc               0x00000001005cf562 > EmitGlobalConstantImpl(llvm::Constant const*, unsigned int, > llvm::AsmPrinter&) + 786 >  10 llc               0x00000001005d1569 > llvm::AsmPrinter::EmitGlobalVariable(llvm::GlobalVariable const*) + > 1129 >  11 llc               0x00000001005d21bf > llvm::AsmPrinter::doFinalization(llvm::Module&) + 79 >  12 llc               0x0000000100978986 > llvm::FPPassManager::runOnModule(llvm::Module&) + 246 >  13 llc               0x000000010097a3dc > llvm::MPPassManager::runOnModule(llvm::Module&) + 604 >  14 llc               0x000000010097a6d3 > llvm::PassManagerImpl::run(llvm::Module&) + 163 >  15 llc               0x000000010097a7ad > llvm::PassManager::run(llvm::Module&) + 13 >  16 llc               0x000000010001e980 main + 2928 >  17 llc               0x000000010001d3b8 start + 52 >  Stack dump: >  0.      Program arguments: > /Users/wdietz2/llvm/tot/llvm-objects/Release+Asserts/bin/llc > -relocation-model=pic -disable-fp-elim glibj-optimized.zip.bc -o > glibj.zip.s >  1.      Running pass 'Function Pass Manager' on module > 'glibj-optimized.zip.bc'. >  make: *** [glibj.zip.s] Abort trap > > I also get this error even if I skip the optimization step (run > similar llc command on just glibj.bc), for whatever that's worth. > > Any thoughts on what might be wrong or where I might look to fix it? > Anyone else seeing this? > > Thanks for your time, > > ~Will Dietz > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > From minas.subs at gmail.com Thu Jul 15 21:58:08 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Fri, 16 Jul 2010 09:58:08 +0500 Subject: [vmkit-commits] J3 crushes on HelloWorld In-Reply-To: References: Message-ID: Trying to debug this happens to very specific code peculiarities: Overuse of #define-s! All started with #define LOAD_CLASS( in Jnjvm.cpp Then, 1184 LOAD_CLASS(upcalls->SystemClass); surprisingly calls to: void UserClass::initialiseClass(Jnjvm* vm) in Jnjvm.cpp:53 because of multiple defines, most unexpeting one for which was: #define UserClass Class at JnjvmConfig.h:28 and its brother #defines: #define UserClassArray ClassArray #define UserClassPrimitive ClassPrimitive #define UserClass Class #define UserCommonClass CommonClass #define UserConstantPool JavaConstantPool Why are so many defines? why not use inline functions? I wasn't able to find the last magical #define of UserClass until I have all VMkit loaded into Eclipse and used its refactoring browser... On Thu, Jul 15, 2010 at 1:17 PM, Minas Abrahamyan wrote: > Hi Nicolas, > > 64-bits continue with same error, 'this' is null, because loader is null, > etc. > > Regards, > Minas From willdtz at gmail.com Thu Jul 15 23:28:08 2010 From: willdtz at gmail.com (Will Dietz) Date: Fri, 16 Jul 2010 01:28:08 -0500 Subject: [vmkit-commits] VMKit AOT Compilation Error In-Reply-To: References: Message-ID: Hi Minas, You're absolutely correct, thanks for the catch. I'm using a machine I only have remote access to, and trusted 'uname -m'... which apparently was a mistake. Sorry about the misinformation. ~Will On Thu, Jul 15, 2010 at 11:05 PM, Minas Abrahamyan wrote: > Hi Will, > > Just curious, you are stating use of 32-bit system (Mac OS X x86) but addresses > in stacktrace you brought are 64-bit values. Maybe you're running > x86_64 version? > > -Minas > > On Thu, Jul 15, 2010 at 10:51 PM, Will Dietz wrote: >> Hi all, >> >> I'm trying to use the AOT compilation feature of VMKit, and am >> struggling to compile glibj to native code. >> >> I'm working on Mac OS X x86, and have tried both VMkit-2.7 with >> LLVM-2.7 as well as TOT of both, and both cases yield: >> >> make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 >> llvm[0]: Compiling glibj.zip to llvm >> llvm[0]: Optimizing glibj.zip >> llvm[0]: Compiling glibj.zip.bc to native >> i64 zext (i32 add (i32 ptrtoint ([4 x i32 (...)*]* @261 to i32), i32 1) to i64) >>  FIXME: Don't support this constant expr >>  UNREACHABLE executed at >> /Users/wdietz2/llvm/tot/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1268! >>  0  llc               0x00000001009f9582 PrintStackTrace(void*) + 34 >>  1  llc               0x00000001009fa223 SignalHandler(int) + 707 >>  2  libSystem.B.dylib 0x00007fff83bc935a _sigtramp + 26 >>  3  llc               0x0000000100cf9840 llvm::dbgs()::thestrm + 0 >>  4  llc               0x00000001009d654d >> llvm::llvm_unreachable_internal(char const*, char const*, unsigned >> int) + 381 >>  5  llc               0x00000001005cf0a7 LowerConstant(llvm::Constant >> const*, llvm::AsmPrinter&) + 2631 >>  6  llc               0x00000001005ce8bd LowerConstant(llvm::Constant >> const*, llvm::AsmPrinter&) + 605 >>  7  llc               0x00000001005cfa7c >> EmitGlobalConstantImpl(llvm::Constant const*, unsigned int, >> llvm::AsmPrinter&) + 2092 >>  8  llc               0x00000001005d0e90 >> EmitGlobalConstantArray(llvm::ConstantArray const*, unsigned int, >> llvm::AsmPrinter&) + 80 >>  9  llc               0x00000001005cf562 >> EmitGlobalConstantImpl(llvm::Constant const*, unsigned int, >> llvm::AsmPrinter&) + 786 >>  10 llc               0x00000001005d1569 >> llvm::AsmPrinter::EmitGlobalVariable(llvm::GlobalVariable const*) + >> 1129 >>  11 llc               0x00000001005d21bf >> llvm::AsmPrinter::doFinalization(llvm::Module&) + 79 >>  12 llc               0x0000000100978986 >> llvm::FPPassManager::runOnModule(llvm::Module&) + 246 >>  13 llc               0x000000010097a3dc >> llvm::MPPassManager::runOnModule(llvm::Module&) + 604 >>  14 llc               0x000000010097a6d3 >> llvm::PassManagerImpl::run(llvm::Module&) + 163 >>  15 llc               0x000000010097a7ad >> llvm::PassManager::run(llvm::Module&) + 13 >>  16 llc               0x000000010001e980 main + 2928 >>  17 llc               0x000000010001d3b8 start + 52 >>  Stack dump: >>  0.      Program arguments: >> /Users/wdietz2/llvm/tot/llvm-objects/Release+Asserts/bin/llc >> -relocation-model=pic -disable-fp-elim glibj-optimized.zip.bc -o >> glibj.zip.s >>  1.      Running pass 'Function Pass Manager' on module >> 'glibj-optimized.zip.bc'. >>  make: *** [glibj.zip.s] Abort trap >> >> I also get this error even if I skip the optimization step (run >> similar llc command on just glibj.bc), for whatever that's worth. >> >> Any thoughts on what might be wrong or where I might look to fix it? >> Anyone else seeing this? >> >> Thanks for your time, >> >> ~Will Dietz >> _______________________________________________ >> vmkit-commits mailing list >> vmkit-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >> > From minas.subs at gmail.com Fri Jul 16 07:44:14 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Fri, 16 Jul 2010 19:44:14 +0500 Subject: [vmkit-commits] About j3-64bit crush Message-ID: Hi Nicolas, I've recently made existent traces of debug logging to work and added needed new PRINT_DEBUG-s, to see why j3 run on HelloWorld crushes. It's very beautufil to have such logs, it pretty visualizes the VMkit work. Also it is useful tool for extensive debugging. Crush occurs within j3::Jnjvm::loadBootstrap(): when running Class::initialiseClass() of last macro LOAD_CLASS(upcalls->SystemClass) but before initializing vm->appClassLoader; which would be done just by the next call to loadAppClassLoader() in Jnjvm.cpp. <<< native compile java/lang/VMRuntime.nativeLoad() --> end of native compile java/lang/VMRuntime.nativeLoad() [Switching to Thread 0x1200ff700 (LWP 11395)] Breakpoint 1, Java_java_lang_VMRuntime_nativeLoad (str=0x7ffff020b750, javaLoader=0x0) at ClasspathVMRuntime.inc:113 >>> ...many debugging results skipped... Fruitful was comparison with 32-bit version - as it's working. And I've found that Problem is FindClass does not load class "gnu/classpath/Pointer64" and returns 0, while the 32-bit counterpart does find and load corresponding "gnu/classpath/Pointer32"; This is result of UserClass* currentClass = th->getCallingClassLevel(0); in FindClass returns 0; <= JavaThread::getCallingClassLevel - returns 0, since all 'MethodInfo's in stack have value of MethodType==-1 While 32-bit version finds right value from stack, right value here is 'MethodInfo's with MethodType==1 //why not enums? So much for now. Something wrongly initializes type values of methods Regards, Minas From minas.subs at gmail.com Fri Jul 16 07:50:18 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Fri, 16 Jul 2010 19:50:18 +0500 Subject: [vmkit-commits] abortive style: 248 abort() and exit() calls in vmkit Message-ID: Hi, It is interesting style: many aborts here and there, without any notice to user: (although less than third of them prints backtrace) [vmkit]$ find . -iname "*.cpp" -o -iname "*.h" -o -iname "*.inc"|xargs grep -niE "abort\(\)|\\(\)"|wc -l 248 To look at them: $ find . -iname "*.cpp" -o -iname "*.h" -o -iname "*.inc"|xargs grep -niE "abort\(\)|\\(\)"|less Regards, Minas From actong88 at gmail.com Sun Jul 18 18:19:51 2010 From: actong88 at gmail.com (Allan Tong) Date: Sun, 18 Jul 2010 21:19:51 -0400 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: On Fri, Jul 16, 2010 at 10:44 AM, Minas Abrahamyan wrote: > Crush occurs within j3::Jnjvm::loadBootstrap(): > when running Class::initialiseClass() of last macro > LOAD_CLASS(upcalls->SystemClass) > but before initializing vm->appClassLoader; which would be done just > by the next call to loadAppClassLoader() > in Jnjvm.cpp. > > <<< > native compile java/lang/VMRuntime.nativeLoad() > --> end of native compile java/lang/VMRuntime.nativeLoad() > [Switching to Thread 0x1200ff700 (LWP 11395)] > > Breakpoint 1, Java_java_lang_VMRuntime_nativeLoad (str=0x7ffff020b750, > javaLoader=0x0) >    at ClasspathVMRuntime.inc:113 >>>> > ...many debugging results skipped... > > Fruitful was comparison with 32-bit version - as it's working. > > And I've found that Problem is FindClass does not load class > "gnu/classpath/Pointer64" and returns 0, > while the 32-bit counterpart does find and load corresponding > "gnu/classpath/Pointer32"; > > This is result of > UserClass* currentClass = th->getCallingClassLevel(0); > in FindClass returns 0; > <= JavaThread::getCallingClassLevel - returns 0, since all > 'MethodInfo's in stack have value of MethodType==-1 > > While 32-bit version finds right value from stack, right value here is > 'MethodInfo's with MethodType==1 > //why not enums? > > So much for now. Something wrongly initializes type values of methods Hi, I was having the same problem here. It turns out that the 64-bit build of Classpath was omitting frame pointers. Once I recompiled Classpath with -fno-omit-frame-pointer, the StackWalker was able to get past the offending stack frame and find the calling Java method. This resolves the segfault, though now I get a ClassNotFoundException trying to find my main class, which I haven't looked into yet. - Allan From willdtz at gmail.com Sun Jul 18 21:15:09 2010 From: willdtz at gmail.com (Will Dietz) Date: Sun, 18 Jul 2010 23:15:09 -0500 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: Recompiling classpath with framepointers as you suggested fixed my 64bit j3 nicely! Just wanted to thank you for sharing this :) ~Will On Sun, Jul 18, 2010 at 8:19 PM, Allan Tong wrote: > On Fri, Jul 16, 2010 at 10:44 AM, Minas Abrahamyan wrote: >> Crush occurs within j3::Jnjvm::loadBootstrap(): >> when running Class::initialiseClass() of last macro >> LOAD_CLASS(upcalls->SystemClass) >> but before initializing vm->appClassLoader; which would be done just >> by the next call to loadAppClassLoader() >> in Jnjvm.cpp. >> >> <<< >> native compile java/lang/VMRuntime.nativeLoad() >> --> end of native compile java/lang/VMRuntime.nativeLoad() >> [Switching to Thread 0x1200ff700 (LWP 11395)] >> >> Breakpoint 1, Java_java_lang_VMRuntime_nativeLoad (str=0x7ffff020b750, >> javaLoader=0x0) >>    at ClasspathVMRuntime.inc:113 >>>>> >> ...many debugging results skipped... >> >> Fruitful was comparison with 32-bit version - as it's working. >> >> And I've found that Problem is FindClass does not load class >> "gnu/classpath/Pointer64" and returns 0, >> while the 32-bit counterpart does find and load corresponding >> "gnu/classpath/Pointer32"; >> >> This is result of >> UserClass* currentClass = th->getCallingClassLevel(0); >> in FindClass returns 0; >> <= JavaThread::getCallingClassLevel - returns 0, since all >> 'MethodInfo's in stack have value of MethodType==-1 >> >> While 32-bit version finds right value from stack, right value here is >> 'MethodInfo's with MethodType==1 >> //why not enums? >> >> So much for now. Something wrongly initializes type values of methods > > Hi, > > I was having the same problem here.  It turns out that the 64-bit > build of Classpath was omitting frame pointers.  Once I recompiled > Classpath with -fno-omit-frame-pointer, the StackWalker was able to > get past the offending stack frame and find the calling Java method. > This resolves the segfault, though now I get a ClassNotFoundException > trying to find my main class, which I haven't looked into yet. > >  - Allan > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > From nicolas.geoffray at gmail.com Mon Jul 19 08:51:42 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Mon, 19 Jul 2010 17:51:42 +0200 Subject: [vmkit-commits] J3 crushes on HelloWorld In-Reply-To: References: Message-ID: Hi Minas, Consider that VMKit started as a research project (ie prototype), and these macros eased the implementation of another research project. They are not needed for a spec-compliant JVM, but the implementation of other projects was made easier by having them here. Nicolas On Fri, Jul 16, 2010 at 6:58 AM, Minas Abrahamyan wrote: > Trying to debug this happens to very specific code peculiarities: > > Overuse of #define-s! > > All started with > #define LOAD_CLASS( > in Jnjvm.cpp > Then, > 1184 LOAD_CLASS(upcalls->SystemClass); > surprisingly calls to: > void UserClass::initialiseClass(Jnjvm* vm) in Jnjvm.cpp:53 > > because of multiple defines, most unexpeting one for which was: > #define UserClass Class > at JnjvmConfig.h:28 > > and its brother #defines: > > #define UserClassArray ClassArray > #define UserClassPrimitive ClassPrimitive > #define UserClass Class > #define UserCommonClass CommonClass > #define UserConstantPool JavaConstantPool > > Why are so many defines? why not use inline functions? > > I wasn't able to find the last magical #define of UserClass until I > have all VMkit loaded into Eclipse and used its refactoring browser... > > > On Thu, Jul 15, 2010 at 1:17 PM, Minas Abrahamyan > wrote: > > Hi Nicolas, > > > > 64-bits continue with same error, 'this' is null, because loader is null, > > etc. > > > > Regards, > > Minas > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at gmail.com Mon Jul 19 08:53:35 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Mon, 19 Jul 2010 17:53:35 +0200 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: That's great news! Thanks Allan for sharing the fix. About this ClassNotFoundException, try to debug vmkit and see how the classpath is being parsed. Cheers, Nicolas On Mon, Jul 19, 2010 at 6:15 AM, Will Dietz wrote: > Recompiling classpath with framepointers as you suggested fixed my > 64bit j3 nicely! > > Just wanted to thank you for sharing this :) > > ~Will > > On Sun, Jul 18, 2010 at 8:19 PM, Allan Tong wrote: > > On Fri, Jul 16, 2010 at 10:44 AM, Minas Abrahamyan > wrote: > >> Crush occurs within j3::Jnjvm::loadBootstrap(): > >> when running Class::initialiseClass() of last macro > >> LOAD_CLASS(upcalls->SystemClass) > >> but before initializing vm->appClassLoader; which would be done just > >> by the next call to loadAppClassLoader() > >> in Jnjvm.cpp. > >> > >> <<< > >> native compile java/lang/VMRuntime.nativeLoad() > >> --> end of native compile java/lang/VMRuntime.nativeLoad() > >> [Switching to Thread 0x1200ff700 (LWP 11395)] > >> > >> Breakpoint 1, Java_java_lang_VMRuntime_nativeLoad (str=0x7ffff020b750, > >> javaLoader=0x0) > >> at ClasspathVMRuntime.inc:113 > >>>>> > >> ...many debugging results skipped... > >> > >> Fruitful was comparison with 32-bit version - as it's working. > >> > >> And I've found that Problem is FindClass does not load class > >> "gnu/classpath/Pointer64" and returns 0, > >> while the 32-bit counterpart does find and load corresponding > >> "gnu/classpath/Pointer32"; > >> > >> This is result of > >> UserClass* currentClass = th->getCallingClassLevel(0); > >> in FindClass returns 0; > >> <= JavaThread::getCallingClassLevel - returns 0, since all > >> 'MethodInfo's in stack have value of MethodType==-1 > >> > >> While 32-bit version finds right value from stack, right value here is > >> 'MethodInfo's with MethodType==1 > >> //why not enums? > >> > >> So much for now. Something wrongly initializes type values of methods > > > > Hi, > > > > I was having the same problem here. It turns out that the 64-bit > > build of Classpath was omitting frame pointers. Once I recompiled > > Classpath with -fno-omit-frame-pointer, the StackWalker was able to > > get past the offending stack frame and find the calling Java method. > > This resolves the segfault, though now I get a ClassNotFoundException > > trying to find my main class, which I haven't looked into yet. > > > > - Allan > > > > _______________________________________________ > > vmkit-commits mailing list > > vmkit-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at gmail.com Mon Jul 19 08:56:08 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Mon, 19 Jul 2010 17:56:08 +0200 Subject: [vmkit-commits] abortive style: 248 abort() and exit() calls in vmkit In-Reply-To: References: Message-ID: Again, VMKit was prototype-oriented and paper-driven, not quality and release-driven. But any changes to improve the readability and user experience in the code base are more than welcome! Cheers, Nicolas On Fri, Jul 16, 2010 at 4:50 PM, Minas Abrahamyan wrote: > Hi, > > It is interesting style: many aborts here and there, without any > notice to user: (although less than third of them > prints backtrace) > [vmkit]$ find . -iname "*.cpp" -o -iname "*.h" -o -iname "*.inc"|xargs > grep -niE "abort\(\)|\\(\)"|wc -l > 248 > > To look at them: > $ find . -iname "*.cpp" -o -iname "*.h" -o -iname "*.inc"|xargs grep > -niE "abort\(\)|\\(\)"|less > > Regards, > Minas > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Mon Jul 19 08:58:58 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Jul 2010 15:58:58 -0000 Subject: [vmkit-commits] [vmkit] r108702 - in /vmkit/trunk/lib/J3/Compiler: JavaJIT.cpp JavaJITCompiler.cpp Message-ID: <20100719155858.4C8C02A6C12C@llvm.org> Author: geoffray Date: Mon Jul 19 10:58:58 2010 New Revision: 108702 URL: http://llvm.org/viewvc/llvm-project?rev=108702&view=rev Log: Don't inline a java.lang.Class object in the code, but get a pointer from the class and load it. Also call j3PrintMethodStart after nullifying the object locals and stack. Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=108702&r1=108701&r2=108702&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Mon Jul 19 10:58:58 2010 @@ -729,7 +729,8 @@ if (isVirtual(compilingMethod->access)) { obj = llvmFunction->arg_begin(); } else { - obj = TheCompiler->getJavaClass(compilingClass); + obj = TheCompiler->getJavaClassPtr(compilingClass); + obj = new LoadInst(obj, "", false, currentBlock); } monitorEnter(obj); } @@ -739,7 +740,8 @@ if (isVirtual(compilingMethod->access)) { obj = llvmFunction->arg_begin(); } else { - obj = TheCompiler->getJavaClass(compilingClass); + obj = TheCompiler->getJavaClassPtr(compilingClass); + obj = new LoadInst(obj, "", false, currentBlock); } monitorExit(obj); } @@ -1030,17 +1032,6 @@ for (uint32 i = 0; i < codeLen; ++i) { opcodeInfos[i].exceptionBlock = endExceptionBlock; } - -#if JNJVM_EXECUTE > 0 - { - Value* arg = TheCompiler->getMethodInClass(compilingMethod); - - llvm::CallInst::Create(intrinsics->PrintMethodStartFunction, arg, "", - currentBlock); - } -#endif - - for (int i = 0; i < maxLocals; i++) { intLocals.push_back(new AllocaInst(Type::getInt32Ty(*llvmContext), "", currentBlock)); @@ -1067,6 +1058,15 @@ longStack.push_back(new AllocaInst(Type::getInt64Ty(*llvmContext), "", currentBlock)); floatStack.push_back(new AllocaInst(Type::getFloatTy(*llvmContext), "", currentBlock)); } + +#if JNJVM_EXECUTE > 0 + { + Value* arg = TheCompiler->getMethodInClass(compilingMethod); + + llvm::CallInst::Create(intrinsics->PrintMethodStartFunction, arg, "", + currentBlock); + } +#endif uint32 index = 0; uint32 count = 0; Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=108702&r1=108701&r2=108702&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Mon Jul 19 10:58:58 2010 @@ -177,11 +177,8 @@ } Constant* JavaJITCompiler::getJavaClass(CommonClass* cl) { - JavaObject* obj = cl->getClassDelegatee(JavaThread::get()->getJVM()); - assert(obj && "Delegatee not created"); - Constant* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()), - uint64(obj)); - return ConstantExpr::getIntToPtr(CI, JavaIntrinsics.JavaObjectType); + fprintf(stderr, "Should not be here\n"); + abort(); } Constant* JavaJITCompiler::getJavaClassPtr(CommonClass* cl) { From nicolas.geoffray at lip6.fr Mon Jul 19 09:01:17 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Jul 2010 16:01:17 -0000 Subject: [vmkit-commits] [vmkit] r108703 - in /vmkit/trunk/lib/J3: Compiler/JavaAOTCompiler.cpp VMCore/JavaClass.cpp VMCore/JavaConstantPool.cpp VMCore/JavaTypes.cpp VMCore/Jnjvm.cpp VMCore/JnjvmClassLoader.cpp VMCore/JnjvmClassLoader.h Message-ID: <20100719160117.DF3042A6C12C@llvm.org> Author: geoffray Date: Mon Jul 19 11:01:17 2010 New Revision: 108703 URL: http://llvm.org/viewvc/llvm-project?rev=108703&view=rev Log: Don't give a default parameter value to an object parameter (we never know). Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=108703&r1=108702&r2=108703&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Mon Jul 19 11:01:17 2010 @@ -2044,7 +2044,7 @@ } const UTF8* utf8 = bootstrapLoader->asciizConstructUTF8(realName); - UserClass* cl = bootstrapLoader->loadName(utf8, true, true); + UserClass* cl = bootstrapLoader->loadName(utf8, true, true, NULL); if (!M->clinits->empty()) { vm->loadBootstrap(); Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108703&r1=108702&r2=108703&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Mon Jul 19 11:01:17 2010 @@ -41,7 +41,6 @@ Class** ClassArray::InterfacesArray; extern "C" void JavaArrayTracer(JavaObject*); -extern "C" void JavaObjectTracer(JavaObject*); extern "C" void ArrayObjectTracer(JavaObject*); extern "C" void RegularObjectTracer(JavaObject*); @@ -686,7 +685,7 @@ uint16 superEntry = reader.readU2(); if (superEntry) { const UTF8* superUTF8 = ctpInfo->resolveClassName(superEntry); - super = classLoader->loadName(superUTF8, false, true); + super = classLoader->loadName(superUTF8, false, true, NULL); } uint16 nbI = reader.readU2(); @@ -698,7 +697,7 @@ // in anon-cooperative environment. for (int i = 0; i < nbI; i++) { const UTF8* name = ctpInfo->resolveClassName(reader.readU2()); - interfaces[i] = classLoader->loadName(name, false, true); + interfaces[i] = classLoader->loadName(name, false, true, NULL); } nbInterfaces = nbI; @@ -1431,11 +1430,11 @@ // so that the secondary type list of array VTs can reference them. ClassArray::InterfacesArray[0] = JCL->loadName(JCL->asciizConstructUTF8("java/lang/Cloneable"), - true, false); + true, false, NULL); ClassArray::InterfacesArray[1] = JCL->loadName(JCL->asciizConstructUTF8("java/io/Serializable"), - true, false); + true, false, NULL); // Load base array classes that JnJVM internally uses. Now that the interfaces // have been loaded, the secondary type can be safely created. @@ -1475,9 +1474,10 @@ if (C->super) { assert(C->super->virtualVT && "Super has no VT"); - - // Set the regular object tracer, destructor and delete. - tracer = (uintptr_t)RegularObjectTracer; + + // Will be RegularObjectTracer for regular Java objects, and + // ObjectReference tracer for java.lang.ref.Reference objects. + tracer = C->super->virtualVT->tracer; destructor = 0; operatorDelete = 0; @@ -1544,7 +1544,7 @@ } else { // Set the tracer, destructor and delete. - tracer = (uintptr_t)JavaObjectTracer; + tracer = (uintptr_t)RegularObjectTracer; destructor = 0; operatorDelete = 0; Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=108703&r1=108702&r2=108703&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Mon Jul 19 11:01:17 2010 @@ -289,7 +289,7 @@ if (name->elements[0] == I_TAB) { temp = loader->constructArray(name); } else { - temp = loader->loadName(name, resolve, false); + temp = loader->loadName(name, resolve, false, NULL); } ctpRes[index] = temp; } Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp?rev=108703&r1=108702&r2=108703&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp Mon Jul 19 11:01:17 2010 @@ -21,7 +21,7 @@ } UserCommonClass* ObjectTypedef::assocClass(JnjvmClassLoader* loader) const { - return loader->loadName(pseudoAssocClassName, false, true); + return loader->loadName(pseudoAssocClassName, false, true, NULL); } UserCommonClass* ObjectTypedef::findAssocClass(JnjvmClassLoader* loader) const { Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=108703&r1=108702&r2=108703&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Mon Jul 19 11:01:17 2010 @@ -1196,7 +1196,7 @@ // load and initialise math since it is responsible for dlopen'ing // libjavalang.so and we are optimizing some math operations UserCommonClass* math = - loader->loadName(loader->asciizConstructUTF8("java/lang/Math"), true, true); + loader->loadName(loader->asciizConstructUTF8("java/lang/Math"), true, true, NULL); math->asClass()->initialiseClass(this); } @@ -1217,7 +1217,7 @@ // If not, load the class. if (cl == NULL) { const UTF8* name = appClassLoader->asciizConstructUTF8(className); - cl = (UserClass*)appClassLoader->loadName(name, true, true); + cl = (UserClass*)appClassLoader->loadName(name, true, true, NULL); } cl->initialiseClass(this); @@ -1256,7 +1256,7 @@ llvm_gcroot(instrumenter, 0); TRY { const UTF8* name = appClassLoader->asciizConstructUTF8(className); - UserClass* cl = (UserClass*)appClassLoader->loadName(name, true, true); + UserClass* cl = (UserClass*)appClassLoader->loadName(name, true, true, NULL); cl->initialiseClass(this); const UTF8* funcSign = appClassLoader->asciizConstructUTF8( Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108703&r1=108702&r2=108703&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Mon Jul 19 11:01:17 2010 @@ -521,7 +521,7 @@ const UTF8* componentName = lookupComponentName(name, holder, prim); if (prim) return constructArray(name); if (componentName) { - UserCommonClass* temp = loadName(componentName, doResolve, doThrow); + UserCommonClass* temp = loadName(componentName, doResolve, doThrow, NULL); if (temp) return constructArray(name); } } else { @@ -558,7 +558,7 @@ if (temp) return temp; } - return loadClassFromUserUTF8(name, doResolve, doThrow); + return loadClassFromUserUTF8(name, doResolve, doThrow, NULL); } @@ -631,7 +631,7 @@ } else if (name->elements[start] == I_REF) { const UTF8* componentName = name->extract(hashUTF8, start + 1, start + len - 1); - UserCommonClass* cl = loadName(componentName, false, true); + UserCommonClass* cl = loadName(componentName, false, true, NULL); return cl; } else { Classpath* upcalls = bootstrapLoader->upcalls; Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=108703&r1=108702&r2=108703&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Mon Jul 19 11:01:17 2010 @@ -157,13 +157,13 @@ /// loadName - Loads the class of the given name. /// UserClass* loadName(const UTF8* name, bool doResolve, bool doThrow, - JavaString* strName = 0); + JavaString* strName); /// loadClassFromUTF8 - Lookup a class from an UTF8 name and load it. /// UserCommonClass* loadClassFromUserUTF8(const UTF8* utf8, bool doResolve, bool doThrow, - JavaString* strName = 0); + JavaString* strName); /// loadClassFromAsciiz - Lookup a class from an asciiz name and load it. /// @@ -483,7 +483,6 @@ JnjvmClassLoader* getClassLoader() { return JCL; } - }; #define MAXIMUM_STRINGS 100 From nicolas.geoffray at lip6.fr Mon Jul 19 09:02:26 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Jul 2010 16:02:26 -0000 Subject: [vmkit-commits] [vmkit] r108704 - /vmkit/trunk/Makefile.rules Message-ID: <20100719160226.731F52A6C12D@llvm.org> Author: geoffray Date: Mon Jul 19 11:02:26 2010 New Revision: 108704 URL: http://llvm.org/viewvc/llvm-project?rev=108704&view=rev Log: Add an option to not re-compile MMTk. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=108704&r1=108703&r2=108704&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Mon Jul 19 11:02:26 2010 @@ -127,6 +127,7 @@ ifdef RUN_ANT ifdef ANT +ifndef DISABLE_MMTK_COMPILE ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc all:: @@ -138,7 +139,7 @@ $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc #$(Verb) $(LLC) -march=cpp -cppgen=function -cppfor=gcmalloc $(LibDir)/FinalMMTk.bc -o $(PROJ_SRC_ROOT)/lib/Mvm/Compiler/MMTkInline.inc - +endif endif clean-local:: From nicolas.geoffray at lip6.fr Mon Jul 19 09:04:13 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Jul 2010 16:04:13 -0000 Subject: [vmkit-commits] [vmkit] r108705 - /vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h Message-ID: <20100719160413.E163D2A6C12D@llvm.org> Author: geoffray Date: Mon Jul 19 11:04:13 2010 New Revision: 108705 URL: http://llvm.org/viewvc/llvm-project?rev=108705&view=rev Log: Missed file from last commit. Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h?rev=108705&r1=108704&r2=108705&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h Mon Jul 19 11:04:13 2010 @@ -15,7 +15,7 @@ #include "JnjvmConfig.h" #define UPCALL_CLASS(vm, name) \ - vm->loadName(vm->asciizConstructUTF8(name), true, false) + vm->loadName(vm->asciizConstructUTF8(name), true, false, NULL) #define UPCALL_PRIMITIVE_CLASS(loader, name, nb) \ new(loader->allocator, "Primitive class") \ From nicolas.geoffray at lip6.fr Mon Jul 19 09:05:55 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Jul 2010 16:05:55 -0000 Subject: [vmkit-commits] [vmkit] r108706 - /vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Message-ID: <20100719160555.84E4B2A6C12D@llvm.org> Author: geoffray Date: Mon Jul 19 11:05:55 2010 New Revision: 108706 URL: http://llvm.org/viewvc/llvm-project?rev=108706&view=rev Log: Other missed file from last commit! 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=108706&r1=108705&r2=108706&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Mon Jul 19 11:05:55 2010 @@ -939,10 +939,10 @@ "Ljava/lang/Class;", ACC_VIRTUAL); loader->loadName(loader->asciizConstructUTF8("java/lang/String"), - true, false); + true, false, NULL); loader->loadName(loader->asciizConstructUTF8("java/lang/Object"), - true, false); + true, false, NULL); // Don't compile methods here, we still don't know where to allocate Java // strings. From minas.subs at gmail.com Mon Jul 19 10:15:01 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Mon, 19 Jul 2010 22:15:01 +0500 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: Wow, Alan! Thank you very much! You're like a magician, how did you know? It now works for me: <<< [bin]$ ./j3 HW 2>log.txt Hello, world! [bin]$ >>> Last lines of log.txt are: <<< compiling java/io/FileOutputStream.write() --> end compiling java/io/FileOutputStream.write() ;resolve {Class gnu/java/nio/FileChannelImpl }resolve; //Class gnu/java/nio/FileChannelImpl compiling gnu/java/nio/FileChannelImpl.write() --> end compiling gnu/java/nio/FileChannelImpl.write() compiling gnu/java/nio/VMChannel.write() --> end compiling gnu/java/nio/VMChannel.write() native compile gnu/java/nio/VMChannel.write() --> end native compile gnu/java/nio/VMChannel.write() --> end native compile gnu/java/nio/VMChannel.write() Hello, world! compiling java/io/OutputStream.flush() --> end compiling java/io/OutputStream.flush() >>> //except for "Hello, world!" printed on stdout I don't know what is right way to transfer classpath build system that "no-omit" option, but what I did was change in ./configure script. See patch for it I'm attaching; to be applied with: patch ./configure.orig ./classpath_configure64.patch -Minas PS Allan, maybe you're compiling something other than "Hello World" - then, I hope, next my patch (related with Debug output) will help you. Thanks again! PPS JFYI, article "Getting the call stack without a frame pointer": http://www.yosefk.com/blog/getting-the-call-stack-without-a-frame-pointer.html On Mon, Jul 19, 2010 at 6:19 AM, Allan Tong wrote: > Hi, > > I was having the same problem here.  It turns out that the 64-bit > build of Classpath was omitting frame pointers.  Once I recompiled > Classpath with -fno-omit-frame-pointer, the StackWalker was able to > get past the offending stack frame and find the calling Java method. > This resolves the segfault, though now I get a ClassNotFoundException > trying to find my main class, which I haven't looked into yet. > >  - Allan -------------- next part -------------- A non-text attachment was scrubbed... Name: classpath_configure64.patch Type: text/x-patch Size: 1264 bytes Desc: not available URL: From minas.subs at gmail.com Mon Jul 19 10:25:36 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Mon, 19 Jul 2010 22:25:36 +0500 Subject: [vmkit-commits] J3 crushes on HelloWorld In-Reply-To: References: Message-ID: Hi Nicolas, All what I meant was that macros: * make debugging more difficult through that they * hinder source code navigation It's Ok if you wrote it one time, it rock-stable works, and never need to get there again, But once it is needed to debug that code.... problems arise. Anyway, VMkit is very interesting project, thank you for it :) and other creators too). I'm almost get accustomed to it; especially after get debug-logging reenabled. *** So, how do you see VMkit now, what's its stage now? Where is its current place on roadmap? Regards, Minas On Mon, Jul 19, 2010 at 8:51 PM, nicolas geoffray wrote: > Hi Minas, > Consider that VMKit started as a research project (ie prototype), and these > macros eased the implementation of another research project. They are not > needed for a spec-compliant JVM, but the implementation of other projects > was made easier by having them here. > Nicolas > > On Fri, Jul 16, 2010 at 6:58 AM, Minas Abrahamyan > wrote: >> >> Trying to debug this happens to very specific code peculiarities: >> >> Overuse of #define-s! From minas.subs at gmail.com Mon Jul 19 10:27:49 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Mon, 19 Jul 2010 22:27:49 +0500 Subject: [vmkit-commits] abortive style: 248 abort() and exit() calls in vmkit In-Reply-To: References: Message-ID: I've just answered in that thread, On Mon, Jul 19, 2010 at 8:56 PM, nicolas geoffray wrote: > Again, VMKit was prototype-oriented and paper-driven, not quality and > release-driven. > But any changes to improve the readability and user > experience in the code base are more than welcome! Well, Will see and try :) > Cheers, > Nicolas > -Minas From minas.subs at gmail.com Mon Jul 19 11:18:10 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Mon, 19 Jul 2010 23:18:10 +0500 Subject: [vmkit-commits] Debug logger patch (PRINT_DEBUG()) and how to turn it on/off Message-ID: Hi all, Printing of debug messages is very useful for debugging of any kind; This patch allows to print them again, as it was possible few ages ago :) Maybe not everything in right include files here, but that is better than absence of debug logs To apply: $ cd vmkit $ patch -p1 <../vmkit_debuglog.patch To turn on: uncomment vmkit/include/debug.h line 13: #define DEBUG 10 To turn off - comment it back: //#define DEBUG 10 To manage VMCore subsystem logs generation: In vmkit/lib/J3/VMCore/JnjvmConfig.h, lines 43-47: #define JNJVM_LOAD 3 #define JNJVM_COMPILE 2 JNJVM_LOAD - class loading debug level, 1-4, when 0 it is turned off JNJVM_COMPILE - methods compiling debug level, when 0 it is turned off To add new logging messages, insert something like: PRINT_DEBUG(symb, level, color, printf-like-argslist) Fotr example: PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "Jnjvm::loadBootstrap(){\n"); where symb - is subsystem debug level, level - is current message required level; Message is printed only if symb>level; subsystem logging level is bigger than necessary by current message level; COLOR_NORMAL - is default color. ( In fact it supports fancy colour printing on terminal, through third argument, but I'm not using it.) In this example Message will be printed if DEBUG is defined, and JNJVM_LOAD >0. PRINT_DEBUG prints to stderr. == Nicolas, please review and apply this patch. Thanks. -Minas -------------- next part -------------- A non-text attachment was scrubbed... Name: vmkit_debuglog.patch Type: text/x-patch Size: 16766 bytes Desc: not available URL: From nicolas.geoffray at gmail.com Mon Jul 19 13:25:29 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Mon, 19 Jul 2010 22:25:29 +0200 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: That's great news also (the printing of Hello World!). Congrats! :) On Mon, Jul 19, 2010 at 7:15 PM, Minas Abrahamyan wrote: > Wow, Alan! > Thank you very much! You're like a magician, how did you know? > > It now works for me: > <<< > [bin]$ ./j3 HW 2>log.txt > Hello, world! > [bin]$ > >>> > > Last lines of log.txt are: > <<< > compiling java/io/FileOutputStream.write() > --> end compiling java/io/FileOutputStream.write() > ;resolve {Class gnu/java/nio/FileChannelImpl > }resolve; //Class gnu/java/nio/FileChannelImpl > compiling gnu/java/nio/FileChannelImpl.write() > --> end compiling gnu/java/nio/FileChannelImpl.write() > compiling gnu/java/nio/VMChannel.write() > --> end compiling gnu/java/nio/VMChannel.write() > native compile gnu/java/nio/VMChannel.write() > --> end native compile gnu/java/nio/VMChannel.write() > --> end native compile gnu/java/nio/VMChannel.write() > Hello, world! > compiling java/io/OutputStream.flush() > --> end compiling java/io/OutputStream.flush() > >>> > //except for "Hello, world!" printed on stdout > > I don't know what is right way to transfer classpath build system that > "no-omit" option, but what I did was > change in ./configure script. > > See patch for it I'm attaching; to be applied with: > patch ./configure.orig ./classpath_configure64.patch > > -Minas > > PS Allan, maybe you're compiling something other than "Hello World" - > then, I hope, next my patch (related with Debug output) will help you. > Thanks again! > > PPS > JFYI, article "Getting the call stack without a frame pointer": > > http://www.yosefk.com/blog/getting-the-call-stack-without-a-frame-pointer.html > > On Mon, Jul 19, 2010 at 6:19 AM, Allan Tong wrote: > > Hi, > > > > I was having the same problem here. It turns out that the 64-bit > > build of Classpath was omitting frame pointers. Once I recompiled > > Classpath with -fno-omit-frame-pointer, the StackWalker was able to > > get past the offending stack frame and find the calling Java method. > > This resolves the segfault, though now I get a ClassNotFoundException > > trying to find my main class, which I haven't looked into yet. > > > > - Allan > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From minas.subs at gmail.com Mon Jul 19 15:13:07 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Tue, 20 Jul 2010 03:13:07 +0500 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: Thanks! At last it worked! That was Debug version, but I hope Release will succeed too Cheers, Minas On Tue, Jul 20, 2010 at 1:25 AM, nicolas geoffray wrote: > That's great news also (the printing of Hello World!). > Congrats! :) > > On Mon, Jul 19, 2010 at 7:15 PM, Minas Abrahamyan > wrote: >> >> Wow, Alan! >> Thank you very much! You're like a magician, how did you know? >> >> It now works for me: >> <<< >> [bin]$ ./j3 HW 2>log.txt >> Hello, world! >> [bin]$ >> >>> From actong88 at gmail.com Mon Jul 19 15:57:15 2010 From: actong88 at gmail.com (Allan Tong) Date: Mon, 19 Jul 2010 18:57:15 -0400 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: It was my mistake. I had apparently deleted the class file so j3 was correctly throwing a ClassNotFoundException. What can I say, I was tired. :) - Allan On Mon, Jul 19, 2010 at 11:53 AM, nicolas geoffray wrote: > That's great news! Thanks Allan for sharing the fix. About this > ClassNotFoundException, try to debug vmkit and see how the classpath is > being parsed. From nicolas.geoffray at gmail.com Mon Jul 19 16:24:41 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Tue, 20 Jul 2010 01:24:41 +0200 Subject: [vmkit-commits] J3 crushes on HelloWorld In-Reply-To: References: Message-ID: Yes, I don't like macros either, and we should absolutely get rid of them in VMKit. To answer your question on VMKit's roadmap, here is at least mine from shorter to longer term: - Support copying and generational collectors of MMTk in J3: we are almost there - Re-factor VMKit to better be a VM framework - Re-write N3 Any help towards that roadmap is greatly appreciated :) Nicolas On Mon, Jul 19, 2010 at 7:25 PM, Minas Abrahamyan wrote: > Hi Nicolas, > > All what I meant was that macros: > * make debugging more difficult through that they > * hinder source code navigation > > It's Ok if you wrote it one time, it rock-stable works, and never need > to get there again, > But once it is needed to debug that code.... problems arise. > > Anyway, VMkit is very interesting project, thank you for it :) and > other creators too). > I'm almost get accustomed to it; especially after get debug-logging > reenabled. > > *** > So, how do you see VMkit now, what's its stage now? Where is its > current place on roadmap? > > Regards, > Minas > > On Mon, Jul 19, 2010 at 8:51 PM, nicolas geoffray > wrote: > > Hi Minas, > > Consider that VMKit started as a research project (ie prototype), and > these > > macros eased the implementation of another research project. They are not > > needed for a spec-compliant JVM, but the implementation of other projects > > was made easier by having them here. > > Nicolas > > > > On Fri, Jul 16, 2010 at 6:58 AM, Minas Abrahamyan > > wrote: > >> > >> Trying to debug this happens to very specific code peculiarities: > >> > >> Overuse of #define-s! > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From actong88 at gmail.com Mon Jul 19 16:24:50 2010 From: actong88 at gmail.com (Allan Tong) Date: Mon, 19 Jul 2010 19:24:50 -0400 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: On Mon, Jul 19, 2010 at 1:15 PM, Minas Abrahamyan wrote: > Thank you very much! You're like a magician, how did you know? I used a debugger to trace the execution of getCallingClassLevel and found that the stack frame for JNI_OnLoad in libjavanio.so had a NULL as the frame pointer to the caller's frame, which obviously couldn't be correct. Inspecting the disassembly of JNI_OnLoad showed it was missing the frame pointer setup prologue. Vmkit's StackWalker needs the frame pointer in order to walk up the stack, so it couldn't get past JNI_OnLoad and thus never found the calling Java method (MethodType == 1). > I don't know what is right way to transfer classpath build system that >  "no-omit" option, but what I did was > change in ./configure script. Not sure what the right way is either. I added the flag to the environment variables CFLAGS and CXXFLAGS. - Allan From nicolas.geoffray at lip6.fr Mon Jul 19 16:28:01 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Jul 2010 23:28:01 -0000 Subject: [vmkit-commits] [vmkit] r108768 - in /vmkit/trunk: Makefile.rules lib/J3/Classpath/JavaUpcalls.cpp lib/J3/Classpath/JavaUpcalls.h lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/JavaConstantPool.cpp lib/J3/VMCore/JavaTypes.cpp lib/J3/VMCore/Jnjvm.cpp lib/J3/VMCore/JnjvmClassLoader.cpp lib/J3/VMCore/JnjvmClassLoader.h Message-ID: <20100719232801.6249C2A6C12C@llvm.org> Author: geoffray Date: Mon Jul 19 18:28:01 2010 New Revision: 108768 URL: http://llvm.org/viewvc/llvm-project?rev=108768&view=rev Log: J3 is crashing, revert to r108703. Modified: vmkit/trunk/Makefile.rules vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Mon Jul 19 18:28:01 2010 @@ -127,7 +127,6 @@ ifdef RUN_ANT ifdef ANT -ifndef DISABLE_MMTK_COMPILE ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc all:: @@ -139,7 +138,7 @@ $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc #$(Verb) $(LLC) -march=cpp -cppgen=function -cppfor=gcmalloc $(LibDir)/FinalMMTk.bc -o $(PROJ_SRC_ROOT)/lib/Mvm/Compiler/MMTkInline.inc -endif + endif clean-local:: Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Mon Jul 19 18:28:01 2010 @@ -939,10 +939,10 @@ "Ljava/lang/Class;", ACC_VIRTUAL); loader->loadName(loader->asciizConstructUTF8("java/lang/String"), - true, false, NULL); + true, false); loader->loadName(loader->asciizConstructUTF8("java/lang/Object"), - true, false, NULL); + true, false); // Don't compile methods here, we still don't know where to allocate Java // strings. Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h Mon Jul 19 18:28:01 2010 @@ -15,7 +15,7 @@ #include "JnjvmConfig.h" #define UPCALL_CLASS(vm, name) \ - vm->loadName(vm->asciizConstructUTF8(name), true, false, NULL) + vm->loadName(vm->asciizConstructUTF8(name), true, false) #define UPCALL_PRIMITIVE_CLASS(loader, name, nb) \ new(loader->allocator, "Primitive class") \ Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Mon Jul 19 18:28:01 2010 @@ -2044,7 +2044,7 @@ } const UTF8* utf8 = bootstrapLoader->asciizConstructUTF8(realName); - UserClass* cl = bootstrapLoader->loadName(utf8, true, true, NULL); + UserClass* cl = bootstrapLoader->loadName(utf8, true, true); if (!M->clinits->empty()) { vm->loadBootstrap(); Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Mon Jul 19 18:28:01 2010 @@ -41,6 +41,7 @@ Class** ClassArray::InterfacesArray; extern "C" void JavaArrayTracer(JavaObject*); +extern "C" void JavaObjectTracer(JavaObject*); extern "C" void ArrayObjectTracer(JavaObject*); extern "C" void RegularObjectTracer(JavaObject*); @@ -685,7 +686,7 @@ uint16 superEntry = reader.readU2(); if (superEntry) { const UTF8* superUTF8 = ctpInfo->resolveClassName(superEntry); - super = classLoader->loadName(superUTF8, false, true, NULL); + super = classLoader->loadName(superUTF8, false, true); } uint16 nbI = reader.readU2(); @@ -697,7 +698,7 @@ // in anon-cooperative environment. for (int i = 0; i < nbI; i++) { const UTF8* name = ctpInfo->resolveClassName(reader.readU2()); - interfaces[i] = classLoader->loadName(name, false, true, NULL); + interfaces[i] = classLoader->loadName(name, false, true); } nbInterfaces = nbI; @@ -1430,11 +1431,11 @@ // so that the secondary type list of array VTs can reference them. ClassArray::InterfacesArray[0] = JCL->loadName(JCL->asciizConstructUTF8("java/lang/Cloneable"), - true, false, NULL); + true, false); ClassArray::InterfacesArray[1] = JCL->loadName(JCL->asciizConstructUTF8("java/io/Serializable"), - true, false, NULL); + true, false); // Load base array classes that JnJVM internally uses. Now that the interfaces // have been loaded, the secondary type can be safely created. @@ -1474,10 +1475,9 @@ if (C->super) { assert(C->super->virtualVT && "Super has no VT"); - - // Will be RegularObjectTracer for regular Java objects, and - // ObjectReference tracer for java.lang.ref.Reference objects. - tracer = C->super->virtualVT->tracer; + + // Set the regular object tracer, destructor and delete. + tracer = (uintptr_t)RegularObjectTracer; destructor = 0; operatorDelete = 0; @@ -1544,7 +1544,7 @@ } else { // Set the tracer, destructor and delete. - tracer = (uintptr_t)RegularObjectTracer; + tracer = (uintptr_t)JavaObjectTracer; destructor = 0; operatorDelete = 0; Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Mon Jul 19 18:28:01 2010 @@ -289,7 +289,7 @@ if (name->elements[0] == I_TAB) { temp = loader->constructArray(name); } else { - temp = loader->loadName(name, resolve, false, NULL); + temp = loader->loadName(name, resolve, false); } ctpRes[index] = temp; } Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp Mon Jul 19 18:28:01 2010 @@ -21,7 +21,7 @@ } UserCommonClass* ObjectTypedef::assocClass(JnjvmClassLoader* loader) const { - return loader->loadName(pseudoAssocClassName, false, true, NULL); + return loader->loadName(pseudoAssocClassName, false, true); } UserCommonClass* ObjectTypedef::findAssocClass(JnjvmClassLoader* loader) const { Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Mon Jul 19 18:28:01 2010 @@ -1196,7 +1196,7 @@ // load and initialise math since it is responsible for dlopen'ing // libjavalang.so and we are optimizing some math operations UserCommonClass* math = - loader->loadName(loader->asciizConstructUTF8("java/lang/Math"), true, true, NULL); + loader->loadName(loader->asciizConstructUTF8("java/lang/Math"), true, true); math->asClass()->initialiseClass(this); } @@ -1217,7 +1217,7 @@ // If not, load the class. if (cl == NULL) { const UTF8* name = appClassLoader->asciizConstructUTF8(className); - cl = (UserClass*)appClassLoader->loadName(name, true, true, NULL); + cl = (UserClass*)appClassLoader->loadName(name, true, true); } cl->initialiseClass(this); @@ -1256,7 +1256,7 @@ llvm_gcroot(instrumenter, 0); TRY { const UTF8* name = appClassLoader->asciizConstructUTF8(className); - UserClass* cl = (UserClass*)appClassLoader->loadName(name, true, true, NULL); + UserClass* cl = (UserClass*)appClassLoader->loadName(name, true, true); cl->initialiseClass(this); const UTF8* funcSign = appClassLoader->asciizConstructUTF8( Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Mon Jul 19 18:28:01 2010 @@ -521,7 +521,7 @@ const UTF8* componentName = lookupComponentName(name, holder, prim); if (prim) return constructArray(name); if (componentName) { - UserCommonClass* temp = loadName(componentName, doResolve, doThrow, NULL); + UserCommonClass* temp = loadName(componentName, doResolve, doThrow); if (temp) return constructArray(name); } } else { @@ -558,7 +558,7 @@ if (temp) return temp; } - return loadClassFromUserUTF8(name, doResolve, doThrow, NULL); + return loadClassFromUserUTF8(name, doResolve, doThrow); } @@ -631,7 +631,7 @@ } else if (name->elements[start] == I_REF) { const UTF8* componentName = name->extract(hashUTF8, start + 1, start + len - 1); - UserCommonClass* cl = loadName(componentName, false, true, NULL); + UserCommonClass* cl = loadName(componentName, false, true); return cl; } else { Classpath* upcalls = bootstrapLoader->upcalls; Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=108768&r1=108767&r2=108768&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Mon Jul 19 18:28:01 2010 @@ -157,13 +157,13 @@ /// loadName - Loads the class of the given name. /// UserClass* loadName(const UTF8* name, bool doResolve, bool doThrow, - JavaString* strName); + JavaString* strName = 0); /// loadClassFromUTF8 - Lookup a class from an UTF8 name and load it. /// UserCommonClass* loadClassFromUserUTF8(const UTF8* utf8, bool doResolve, bool doThrow, - JavaString* strName); + JavaString* strName = 0); /// loadClassFromAsciiz - Lookup a class from an asciiz name and load it. /// @@ -483,6 +483,7 @@ JnjvmClassLoader* getClassLoader() { return JCL; } + }; #define MAXIMUM_STRINGS 100 From minas.subs at gmail.com Mon Jul 19 17:03:14 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Tue, 20 Jul 2010 05:03:14 +0500 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: Thanks for explanation! -Minas On Tue, Jul 20, 2010 at 4:24 AM, Allan Tong wrote: > On Mon, Jul 19, 2010 at 1:15 PM, Minas Abrahamyan wrote: >> Thank you very much! You're like a magician, how did you know? > > I used a debugger to trace the execution of getCallingClassLevel and > found that the stack frame for JNI_OnLoad in libjavanio.so had a NULL > as the frame pointer to the caller's frame, which obviously couldn't > be correct.  Inspecting the disassembly of JNI_OnLoad showed it was > missing the frame pointer setup prologue.  Vmkit's StackWalker needs > the frame pointer in order to walk up the stack, so it couldn't get > past JNI_OnLoad and thus never found the calling Java method > (MethodType == 1). > >> I don't know what is right way to transfer classpath build system that >>  "no-omit" option, but what I did was >> change in ./configure script. > > Not sure what the right way is either.  I added the flag to the > environment variables CFLAGS and CXXFLAGS. > >  - Allan From nicolas.geoffray at lip6.fr Tue Jul 20 01:17:44 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 08:17:44 -0000 Subject: [vmkit-commits] [vmkit] r108817 - in /vmkit/trunk/lib/J3: Classpath/JavaUpcalls.cpp Classpath/JavaUpcalls.h Compiler/JavaAOTCompiler.cpp VMCore/JavaClass.cpp VMCore/JavaConstantPool.cpp VMCore/JavaTypes.cpp VMCore/Jnjvm.cpp VMCore/JnjvmClassLoader.cpp VMCore/JnjvmClassLoader.h Message-ID: <20100720081744.843122A6C12D@llvm.org> Author: geoffray Date: Tue Jul 20 03:17:44 2010 New Revision: 108817 URL: http://llvm.org/viewvc/llvm-project?rev=108817&view=rev Log: Remove some default parameter values (we never know what the compiler might do with it). Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Tue Jul 20 03:17:44 2010 @@ -939,10 +939,10 @@ "Ljava/lang/Class;", ACC_VIRTUAL); loader->loadName(loader->asciizConstructUTF8("java/lang/String"), - true, false); + true, false, NULL); loader->loadName(loader->asciizConstructUTF8("java/lang/Object"), - true, false); + true, false, NULL); // Don't compile methods here, we still don't know where to allocate Java // strings. Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.h Tue Jul 20 03:17:44 2010 @@ -15,7 +15,7 @@ #include "JnjvmConfig.h" #define UPCALL_CLASS(vm, name) \ - vm->loadName(vm->asciizConstructUTF8(name), true, false) + vm->loadName(vm->asciizConstructUTF8(name), true, false, NULL) #define UPCALL_PRIMITIVE_CLASS(loader, name, nb) \ new(loader->allocator, "Primitive class") \ Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Jul 20 03:17:44 2010 @@ -2044,7 +2044,7 @@ } const UTF8* utf8 = bootstrapLoader->asciizConstructUTF8(realName); - UserClass* cl = bootstrapLoader->loadName(utf8, true, true); + UserClass* cl = bootstrapLoader->loadName(utf8, true, true, NULL); if (!M->clinits->empty()) { vm->loadBootstrap(); Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Tue Jul 20 03:17:44 2010 @@ -686,7 +686,7 @@ uint16 superEntry = reader.readU2(); if (superEntry) { const UTF8* superUTF8 = ctpInfo->resolveClassName(superEntry); - super = classLoader->loadName(superUTF8, false, true); + super = classLoader->loadName(superUTF8, false, true, NULL); } uint16 nbI = reader.readU2(); @@ -698,7 +698,7 @@ // in anon-cooperative environment. for (int i = 0; i < nbI; i++) { const UTF8* name = ctpInfo->resolveClassName(reader.readU2()); - interfaces[i] = classLoader->loadName(name, false, true); + interfaces[i] = classLoader->loadName(name, false, true, NULL); } nbInterfaces = nbI; @@ -1431,11 +1431,11 @@ // so that the secondary type list of array VTs can reference them. ClassArray::InterfacesArray[0] = JCL->loadName(JCL->asciizConstructUTF8("java/lang/Cloneable"), - true, false); + true, false, NULL); ClassArray::InterfacesArray[1] = JCL->loadName(JCL->asciizConstructUTF8("java/io/Serializable"), - true, false); + true, false, NULL); // Load base array classes that JnJVM internally uses. Now that the interfaces // have been loaded, the secondary type can be safely created. Modified: vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaConstantPool.cpp Tue Jul 20 03:17:44 2010 @@ -289,7 +289,7 @@ if (name->elements[0] == I_TAB) { temp = loader->constructArray(name); } else { - temp = loader->loadName(name, resolve, false); + temp = loader->loadName(name, resolve, false, NULL); } ctpRes[index] = temp; } Modified: vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaTypes.cpp Tue Jul 20 03:17:44 2010 @@ -21,7 +21,7 @@ } UserCommonClass* ObjectTypedef::assocClass(JnjvmClassLoader* loader) const { - return loader->loadName(pseudoAssocClassName, false, true); + return loader->loadName(pseudoAssocClassName, false, true, NULL); } UserCommonClass* ObjectTypedef::findAssocClass(JnjvmClassLoader* loader) const { Modified: vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/Jnjvm.cpp Tue Jul 20 03:17:44 2010 @@ -1195,8 +1195,8 @@ obj, &javaLoader); // load and initialise math since it is responsible for dlopen'ing // libjavalang.so and we are optimizing some math operations - UserCommonClass* math = - loader->loadName(loader->asciizConstructUTF8("java/lang/Math"), true, true); + UserCommonClass* math = loader->loadName( + loader->asciizConstructUTF8("java/lang/Math"), true, true, NULL); math->asClass()->initialiseClass(this); } @@ -1217,7 +1217,7 @@ // If not, load the class. if (cl == NULL) { const UTF8* name = appClassLoader->asciizConstructUTF8(className); - cl = (UserClass*)appClassLoader->loadName(name, true, true); + cl = (UserClass*)appClassLoader->loadName(name, true, true, NULL); } cl->initialiseClass(this); @@ -1256,7 +1256,8 @@ llvm_gcroot(instrumenter, 0); TRY { const UTF8* name = appClassLoader->asciizConstructUTF8(className); - UserClass* cl = (UserClass*)appClassLoader->loadName(name, true, true); + UserClass* cl = (UserClass*) + appClassLoader->loadName(name, true, true, NULL); cl->initialiseClass(this); const UTF8* funcSign = appClassLoader->asciizConstructUTF8( Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.cpp Tue Jul 20 03:17:44 2010 @@ -521,7 +521,7 @@ const UTF8* componentName = lookupComponentName(name, holder, prim); if (prim) return constructArray(name); if (componentName) { - UserCommonClass* temp = loadName(componentName, doResolve, doThrow); + UserCommonClass* temp = loadName(componentName, doResolve, doThrow, NULL); if (temp) return constructArray(name); } } else { @@ -558,7 +558,7 @@ if (temp) return temp; } - return loadClassFromUserUTF8(name, doResolve, doThrow); + return loadClassFromUserUTF8(name, doResolve, doThrow, NULL); } @@ -631,7 +631,7 @@ } else if (name->elements[start] == I_REF) { const UTF8* componentName = name->extract(hashUTF8, start + 1, start + len - 1); - UserCommonClass* cl = loadName(componentName, false, true); + UserCommonClass* cl = loadName(componentName, false, true, NULL); return cl; } else { Classpath* upcalls = bootstrapLoader->upcalls; Modified: vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h?rev=108817&r1=108816&r2=108817&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/J3/VMCore/JnjvmClassLoader.h Tue Jul 20 03:17:44 2010 @@ -66,7 +66,7 @@ /// internalLoad - Load the class with the given name. /// virtual UserClass* internalLoad(const UTF8* utf8, bool doResolve, - JavaString* strName = 0); + JavaString* strName); /// internalConstructType - Hashes a Typedef, an internal representation of /// a class still not loaded. @@ -157,13 +157,13 @@ /// loadName - Loads the class of the given name. /// UserClass* loadName(const UTF8* name, bool doResolve, bool doThrow, - JavaString* strName = 0); + JavaString* strName); /// loadClassFromUTF8 - Lookup a class from an UTF8 name and load it. /// UserCommonClass* loadClassFromUserUTF8(const UTF8* utf8, bool doResolve, bool doThrow, - JavaString* strName = 0); + JavaString* strName); /// loadClassFromAsciiz - Lookup a class from an asciiz name and load it. /// @@ -308,7 +308,7 @@ /// internalLoad - Load the class with the given name. /// virtual UserClass* internalLoad(const UTF8* utf8, bool doResolve, - JavaString* strName = 0); + JavaString* strName); /// bootClasspath - List of paths for the base classes. /// @@ -347,7 +347,7 @@ /// if dlLoad is not false. /// JnjvmBootstrapLoader(mvm::BumpPtrAllocator& Alloc, JavaCompiler* Comp, - bool dlLoad = true); + bool dlLoad); virtual JavaString** UTF8ToStr(const UTF8* utf8); From nicolas.geoffray at lip6.fr Tue Jul 20 01:31:02 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 08:31:02 -0000 Subject: [vmkit-commits] [vmkit] r108819 - /vmkit/trunk/Makefile.rules Message-ID: <20100720083102.46CC82A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 03:31:02 2010 New Revision: 108819 URL: http://llvm.org/viewvc/llvm-project?rev=108819&view=rev Log: Add a flag to disable MMTk compilation. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=108819&r1=108818&r2=108819&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Jul 20 03:31:02 2010 @@ -127,9 +127,10 @@ ifdef RUN_ANT ifdef ANT -ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc +ifneq ($(DISABLE_MMTK_COMPILE), 1) + ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc -all:: + all:: $(Verb) $(ANT) -buildfile $(PROJ_SRC_ROOT)/mmtk/java/build.xml $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) $(Verb) $(LOPT) -load=$(LibDir)/JITGCPass$(SHLIBEXT) -std-compile-opts -JITGCPass -f $(LibDir)/MMTKAlloc.bc -o $(LibDir)/MMTKAlloc.bc @@ -138,8 +139,8 @@ $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc #$(Verb) $(LLC) -march=cpp -cppgen=function -cppfor=gcmalloc $(LibDir)/FinalMMTk.bc -o $(PROJ_SRC_ROOT)/lib/Mvm/Compiler/MMTkInline.inc +endif - endif clean-local:: $(Verb) $(RM) -rf classes $(JARNAME).jar $(JARNAME).bc $(JARNAME)-optimized.bc From nicolas.geoffray at lip6.fr Tue Jul 20 05:03:18 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 12:03:18 -0000 Subject: [vmkit-commits] [vmkit] r108825 - /vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Message-ID: <20100720120318.A3C522A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 07:03:18 2010 New Revision: 108825 URL: http://llvm.org/viewvc/llvm-project?rev=108825&view=rev Log: Do not create a frame for methods that start just when an ending label of the previous function begins. Modified: vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Modified: vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp?rev=108825&r1=108824&r2=108825&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/MethodInfo.cpp Tue Jul 20 07:03:18 2010 @@ -41,14 +41,14 @@ } void StaticCamlMethodInfo::print(void* ip, void* addr) { - fprintf(stderr, "; %p in %s static method\n", ip, name); + fprintf(stderr, "; %p (%p) in %s static method\n", ip, addr, name); } void DefaultMethodInfo::print(void* ip, void* addr) { Dl_info info; int res = dladdr(ip, &info); if (res != 0) { - fprintf(stderr, "; %p in %s\n", ip, info.dli_sname); + fprintf(stderr, "; %p (%p) in %s\n", ip, addr, info.dli_sname); } else { fprintf(stderr, "; %p in Unknown method\n", ip); } @@ -124,7 +124,10 @@ for (uint16_t i = 0; i < frames->NumDescriptors; i++) { int res = dladdr(currentFrame->ReturnAddress, &info); if (res != 0) { - if (previousPtr && info.dli_saddr != previousPtr) { + if (previousPtr && info.dli_saddr != previousPtr && + previousFrame->ReturnAddress != previousPtr) { // This test is to avoid adding a frame to a method + // that does not have one but starts just where the previous + // method ends. StaticCamlMethodInfo* MI = new(*StaticAllocator, "StaticCamlMethodInfo") StaticCamlMethodInfo(previousFrame, previousPtr, previousName); From nicolas.geoffray at lip6.fr Tue Jul 20 05:20:53 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 12:20:53 -0000 Subject: [vmkit-commits] [vmkit] r108826 - /vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Message-ID: <20100720122053.D1B882A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 07:20:53 2010 New Revision: 108826 URL: http://llvm.org/viewvc/llvm-project?rev=108826&view=rev Log: Remove use of alloca. Modified: vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Modified: vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp?rev=108826&r1=108825&r2=108826&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Tue Jul 20 07:20:53 2010 @@ -1,3 +1,4 @@ +#include "mvm/Allocator.h" #include "mvm/UTF8.h" #include "mvm/PrintBuffer.h" @@ -10,7 +11,8 @@ const UTF8* UTF8::extract(UTF8Map* map, uint32 start, uint32 end) const { uint32 len = end - start; - uint16* buf = (uint16*)alloca(sizeof(uint16) * len); + ThreadAllocator allocator; + uint16* buf = (uint16*)allocator.Allocate(sizeof(uint16) * len); for (uint32 i = 0; i < len; i++) { buf[i] = elements[i + start]; From nicolas.geoffray at lip6.fr Tue Jul 20 05:23:30 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 12:23:30 -0000 Subject: [vmkit-commits] [vmkit] r108827 - /vmkit/trunk/Makefile.rules Message-ID: <20100720122330.1F86E2A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 07:23:29 2010 New Revision: 108827 URL: http://llvm.org/viewvc/llvm-project?rev=108827&view=rev Log: Change the location of the MMTkInline.inc generated file. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=108827&r1=108826&r2=108827&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Jul 20 07:23:29 2010 @@ -138,7 +138,7 @@ $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc $(Verb) $(LLVMLD) -r -o $(LibDir)/FinalMMTk.bc $(LibDir)/MMTKAlloc.bc $(JARNAME)-optimized.bc $(LibDir)/MMTKRuntime.bc $(Verb) $(LOPT) -std-compile-opts $(LibDir)/FinalMMTk.bc -o $(LibDir)/FinalMMTk.bc - #$(Verb) $(LLC) -march=cpp -cppgen=function -cppfor=gcmalloc $(LibDir)/FinalMMTk.bc -o $(PROJ_SRC_ROOT)/lib/Mvm/Compiler/MMTkInline.inc + #$(Verb) $(LLC) -march=cpp -cppgen=function -cppfor=gcmalloc $(LibDir)/FinalMMTk.bc -o $(PROJ_SRC_ROOT)/mmtk/config/$(MMTK_PLAN)/MMTkInline.inc endif endif From nicolas.geoffray at lip6.fr Tue Jul 20 05:26:36 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 12:26:36 -0000 Subject: [vmkit-commits] [vmkit] r108828 - /vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Message-ID: <20100720122636.A10EC2A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 07:26:36 2010 New Revision: 108828 URL: http://llvm.org/viewvc/llvm-project?rev=108828&view=rev Log: Cosmetic change. Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=108828&r1=108827&r2=108828&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Tue Jul 20 07:26:36 2010 @@ -20,6 +20,7 @@ // //===----------------------------------------------------------------------===// +#include "ClasspathReflect.h" #include "JavaArray.h" #include "JavaClass.h" #include "JavaObject.h" @@ -64,25 +65,62 @@ //===----------------------------------------------------------------------===// // Trace methods for Java objects. There are four types of objects: -// (1) Base object whose class is not an array: needs to trace the classloader -// and the lock. -// (1) Object whose class is not an array: needs to trace the classloader, the -// lock and all the virtual fields. -// (2) Object whose class is an array of objects: needs to trace root (1) and -// all elements in the array. -// (3) Object whose class is a native array: only needs to trace the lock. The +// (1) Regular object: needs to trace the classloader, and all the virtual +// fields. +// (2) java.lang.ref.Reference objects: needs to trace the class loader and +// all the virtual fields except the referent. +// (3) Object whose class is an array of objects: needs to trace the class loader +// and all elements in the array. +// (4) Object whose class is a native array: nothing to trace. The // classloader is the bootstrap loader and is traced by the JVM. //===----------------------------------------------------------------------===// +/// Method for scanning regular objects. +extern "C" void RegularObjectTracer(JavaObject* obj, uintptr_t closure) { + Class* cl = JavaObject::getClass(obj)->asClass(); + assert(cl && "Not a class in regular tracer"); + mvm::Collector::markAndTraceRoot( + cl->classLoader->getJavaClassLoaderPtr(), closure); -/// Method for scanning the root of an object. -extern "C" void JavaObjectTracer(JavaObject* obj, uintptr_t closure) { - CommonClass* cl = JavaObject::getClass(obj); - assert(cl && "No class"); + while (cl->super != 0) { + for (uint32 i = 0; i < cl->nbVirtualFields; ++i) { + JavaField& field = cl->virtualFields[i]; + if (field.isReference()) { + JavaObject** ptr = field.getInstanceObjectFieldPtr(obj); + mvm::Collector::markAndTrace(obj, ptr, closure); + } + } + cl = cl->super; + } +} + +/// Method for scanning Java java.lang.ref.Reference objects. +extern "C" void ObjectReferenceTracer( + JavaObjectReference* obj, uintptr_t closure) { + Class* cl = JavaObject::getClass(obj)->asClass(); + assert(cl && "Not a class in reference tracer"); mvm::Collector::markAndTraceRoot( cl->classLoader->getJavaClassLoaderPtr(), closure); + + bool found = false; + while (cl->super != 0) { + for (uint32 i = 0; i < cl->nbVirtualFields; ++i) { + JavaField& field = cl->virtualFields[i]; + if (field.isReference()) { + JavaObject** ptr = field.getInstanceObjectFieldPtr(obj); + if (ptr != JavaObjectReference::getReferentPtr(obj)) { + mvm::Collector::markAndTrace(obj, ptr, closure); + } else { + found = true; + } + } + } + cl = cl->super; + } + assert(found && "No referent in a reference"); } + /// Method for scanning an array whose elements are JavaObjects. This method is /// called by all non-native Java arrays. extern "C" void ArrayObjectTracer(ArrayObject* obj, uintptr_t closure) { @@ -91,7 +129,6 @@ mvm::Collector::markAndTraceRoot( cl->classLoader->getJavaClassLoaderPtr(), closure); - for (sint32 i = 0; i < ArrayObject::getSize(obj); i++) { if (ArrayObject::getElement(obj, i) != NULL) { mvm::Collector::markAndTrace( @@ -106,26 +143,6 @@ extern "C" void JavaArrayTracer(JavaArray* obj, uintptr_t closure) { } -/// Method for scanning regular objects. -extern "C" void RegularObjectTracer(JavaObject* obj, uintptr_t closure) { - Class* cl = JavaObject::getClass(obj)->asClass(); - assert(cl && "Not a class in regular tracer"); - mvm::Collector::markAndTraceRoot( - cl->classLoader->getJavaClassLoaderPtr(), closure); - - while (cl->super != 0) { - for (uint32 i = 0; i < cl->nbVirtualFields; ++i) { - JavaField& field = cl->virtualFields[i]; - if (field.isReference()) { - JavaObject** ptr = field.getInstanceObjectFieldPtr(obj); - mvm::Collector::markAndTrace(obj, ptr, closure); - } - } - cl = cl->super; - } -} - - //===----------------------------------------------------------------------===// // Support for scanning Java objects referenced by classes. All classes must // trace: @@ -141,25 +158,27 @@ void CommonClass::tracer(uintptr_t closure) { - if (super && super->classLoader) { + if (super != NULL && super->classLoader != NULL) { JavaObject** Obj = super->classLoader->getJavaClassLoaderPtr(); if (*Obj) mvm::Collector::markAndTraceRoot(Obj, closure); for (uint32 i = 0; i < nbInterfaces; ++i) { - if (interfaces[i]->classLoader) { + if (interfaces[i]->classLoader != NULL) { JavaObject** Obj = interfaces[i]->classLoader->getJavaClassLoaderPtr(); - if (*Obj) mvm::Collector::markAndTraceRoot(Obj, closure); + if ((*Obj) != NULL) mvm::Collector::markAndTraceRoot(Obj, closure); } } } - if (classLoader) + if (classLoader != NULL) { mvm::Collector::markAndTraceRoot( classLoader->getJavaClassLoaderPtr(), closure); + } for (uint32 i = 0; i < NR_ISOLATES; ++i) { - // If the delegatee was static allocated, we want to trace its fields. - if (delegatee[i]) { + if (delegatee[i] != NULL) { + // TODO: remove the call to tracer until no j.l.Class are allocated + // statically in AOT. delegatee[i]->tracer(closure); mvm::Collector::markAndTraceRoot(delegatee + i, closure); } From nicolas.geoffray at lip6.fr Tue Jul 20 05:32:30 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 12:32:30 -0000 Subject: [vmkit-commits] [vmkit] r108829 - in /vmkit/trunk/lib: J3/Classpath/ClasspathReflect.h J3/Classpath/JavaUpcalls.cpp J3/VMCore/JavaClass.cpp Mvm/Runtime/Object.cpp Message-ID: <20100720123230.46AC62A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 07:32:30 2010 New Revision: 108829 URL: http://llvm.org/viewvc/llvm-project?rev=108829&view=rev Log: Bugfix for references: the special tracer wasn't set, so the referent was always traced! Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/Mvm/Runtime/Object.cpp Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h?rev=108829&r1=108828&r2=108829&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h Tue Jul 20 07:32:30 2010 @@ -210,16 +210,12 @@ llvm_gcroot(self, 0); return &(self->referent); } + static void setReferent(JavaObjectReference* self, JavaObject* r) { llvm_gcroot(self, 0); llvm_gcroot(r, 0); self->referent = r; } - - static void staticTracer(JavaObjectReference* obj, uintptr_t closure) { - mvm::Collector::markAndTrace(obj, &obj->queue, closure); - mvm::Collector::markAndTrace(obj, &obj->nextOnQueue, closure); - } }; } Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=108829&r1=108828&r2=108829&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Tue Jul 20 07:32:30 2010 @@ -511,11 +511,6 @@ JavaObjectConstructor::staticTracer(obj, closure); } -extern "C" void nativeJavaObjectReferenceTracer( - JavaObjectReference* obj, uintptr_t closure) { - JavaObjectReference::staticTracer(obj, closure); -} - extern "C" void nativeJavaObjectVMThreadTracer( JavaObjectVMThread* obj, uintptr_t closure) { JavaObjectVMThread::staticTracer(obj, closure); @@ -526,6 +521,9 @@ JavaObjectVMThread::staticDestructor(obj); } +extern "C" void ObjectReferenceTracer( + JavaObjectReference* obj, uintptr_t closure); + // Defined in Classpath/ClasspathVMClassLoader.cpp extern "C" ArrayObject* nativeGetBootPackages(); @@ -1043,8 +1041,7 @@ newReference = UPCALL_CLASS(loader, "java/lang/ref/Reference"); newReference->getVirtualVT()->setNativeTracer( - (uintptr_t)nativeJavaObjectReferenceTracer, - "nativeJavaObjectReferenceTracer"); + (uintptr_t)ObjectReferenceTracer, "ObjectReferenceTracer"); EnqueueReference = UPCALL_METHOD(loader, "java/lang/ref/Reference", "enqueue", "()Z", Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108829&r1=108828&r2=108829&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Tue Jul 20 07:32:30 2010 @@ -41,7 +41,6 @@ Class** ClassArray::InterfacesArray; extern "C" void JavaArrayTracer(JavaObject*); -extern "C" void JavaObjectTracer(JavaObject*); extern "C" void ArrayObjectTracer(JavaObject*); extern "C" void RegularObjectTracer(JavaObject*); @@ -1477,7 +1476,7 @@ assert(C->super->virtualVT && "Super has no VT"); // Set the regular object tracer, destructor and delete. - tracer = (uintptr_t)RegularObjectTracer; + tracer = (uintptr_t)C->super->tracer; destructor = 0; operatorDelete = 0; @@ -1544,7 +1543,7 @@ } else { // Set the tracer, destructor and delete. - tracer = (uintptr_t)JavaObjectTracer; + tracer = (uintptr_t)RegularObjectTracer; destructor = 0; operatorDelete = 0; Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=108829&r1=108828&r2=108829&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Tue Jul 20 07:32:30 2010 @@ -202,12 +202,14 @@ gc* reference, VirtualMachine* vm, uintptr_t closure) { if (!Collector::isLive(reference, closure)) { vm->clearReferent(reference); - return 0; + return NULL; } gc* referent = *(vm->getReferentPtr(reference)); - if (!referent) return 0; + if (!referent) { + return NULL; + } if (semantics == SOFT) { // TODO: are we are out of memory? Consider that we always are for now. @@ -218,16 +220,16 @@ // Nothing to do. } + gc* newReference = + mvm::Collector::getForwardedReference(reference, closure); if (Collector::isLive(referent, closure)) { gc* newReferent = mvm::Collector::getForwardedReferent(referent, closure); - gc* newReference = - mvm::Collector::getForwardedReference(reference, closure); vm->setReferent(newReference, newReferent); return newReference; } else { - vm->clearReferent(reference); - vm->addToEnqueue(reference); - return 0; + vm->clearReferent(newReference); + vm->addToEnqueue(newReference); + return NULL; } } From nicolas.geoffray at lip6.fr Tue Jul 20 06:01:41 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 13:01:41 -0000 Subject: [vmkit-commits] [vmkit] r108831 - in /vmkit/trunk/lib: J3/Classpath/ClasspathReflect.h J3/Classpath/JavaUpcalls.cpp J3/VMCore/JavaClass.cpp J3/VMCore/VirtualTables.cpp Mvm/Runtime/Object.cpp Message-ID: <20100720130141.DAE1A2A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 08:01:41 2010 New Revision: 108831 URL: http://llvm.org/viewvc/llvm-project?rev=108831&view=rev Log: Revert to r108827, J3 was crashing. Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp vmkit/trunk/lib/Mvm/Runtime/Object.cpp Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h?rev=108831&r1=108830&r2=108831&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h Tue Jul 20 08:01:41 2010 @@ -210,12 +210,16 @@ llvm_gcroot(self, 0); return &(self->referent); } - static void setReferent(JavaObjectReference* self, JavaObject* r) { llvm_gcroot(self, 0); llvm_gcroot(r, 0); self->referent = r; } + + static void staticTracer(JavaObjectReference* obj, uintptr_t closure) { + mvm::Collector::markAndTrace(obj, &obj->queue, closure); + mvm::Collector::markAndTrace(obj, &obj->nextOnQueue, closure); + } }; } Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=108831&r1=108830&r2=108831&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Tue Jul 20 08:01:41 2010 @@ -511,6 +511,11 @@ JavaObjectConstructor::staticTracer(obj, closure); } +extern "C" void nativeJavaObjectReferenceTracer( + JavaObjectReference* obj, uintptr_t closure) { + JavaObjectReference::staticTracer(obj, closure); +} + extern "C" void nativeJavaObjectVMThreadTracer( JavaObjectVMThread* obj, uintptr_t closure) { JavaObjectVMThread::staticTracer(obj, closure); @@ -521,9 +526,6 @@ JavaObjectVMThread::staticDestructor(obj); } -extern "C" void ObjectReferenceTracer( - JavaObjectReference* obj, uintptr_t closure); - // Defined in Classpath/ClasspathVMClassLoader.cpp extern "C" ArrayObject* nativeGetBootPackages(); @@ -1041,7 +1043,8 @@ newReference = UPCALL_CLASS(loader, "java/lang/ref/Reference"); newReference->getVirtualVT()->setNativeTracer( - (uintptr_t)ObjectReferenceTracer, "ObjectReferenceTracer"); + (uintptr_t)nativeJavaObjectReferenceTracer, + "nativeJavaObjectReferenceTracer"); EnqueueReference = UPCALL_METHOD(loader, "java/lang/ref/Reference", "enqueue", "()Z", Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108831&r1=108830&r2=108831&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Tue Jul 20 08:01:41 2010 @@ -41,6 +41,7 @@ Class** ClassArray::InterfacesArray; extern "C" void JavaArrayTracer(JavaObject*); +extern "C" void JavaObjectTracer(JavaObject*); extern "C" void ArrayObjectTracer(JavaObject*); extern "C" void RegularObjectTracer(JavaObject*); @@ -1476,7 +1477,7 @@ assert(C->super->virtualVT && "Super has no VT"); // Set the regular object tracer, destructor and delete. - tracer = (uintptr_t)C->super->tracer; + tracer = (uintptr_t)RegularObjectTracer; destructor = 0; operatorDelete = 0; @@ -1543,7 +1544,7 @@ } else { // Set the tracer, destructor and delete. - tracer = (uintptr_t)RegularObjectTracer; + tracer = (uintptr_t)JavaObjectTracer; destructor = 0; operatorDelete = 0; Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=108831&r1=108830&r2=108831&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Tue Jul 20 08:01:41 2010 @@ -20,7 +20,6 @@ // //===----------------------------------------------------------------------===// -#include "ClasspathReflect.h" #include "JavaArray.h" #include "JavaClass.h" #include "JavaObject.h" @@ -65,62 +64,25 @@ //===----------------------------------------------------------------------===// // Trace methods for Java objects. There are four types of objects: -// (1) Regular object: needs to trace the classloader, and all the virtual -// fields. -// (2) java.lang.ref.Reference objects: needs to trace the class loader and -// all the virtual fields except the referent. -// (3) Object whose class is an array of objects: needs to trace the class loader -// and all elements in the array. -// (4) Object whose class is a native array: nothing to trace. The +// (1) Base object whose class is not an array: needs to trace the classloader +// and the lock. +// (1) Object whose class is not an array: needs to trace the classloader, the +// lock and all the virtual fields. +// (2) Object whose class is an array of objects: needs to trace root (1) and +// all elements in the array. +// (3) Object whose class is a native array: only needs to trace the lock. The // classloader is the bootstrap loader and is traced by the JVM. //===----------------------------------------------------------------------===// -/// Method for scanning regular objects. -extern "C" void RegularObjectTracer(JavaObject* obj, uintptr_t closure) { - Class* cl = JavaObject::getClass(obj)->asClass(); - assert(cl && "Not a class in regular tracer"); - mvm::Collector::markAndTraceRoot( - cl->classLoader->getJavaClassLoaderPtr(), closure); - - while (cl->super != 0) { - for (uint32 i = 0; i < cl->nbVirtualFields; ++i) { - JavaField& field = cl->virtualFields[i]; - if (field.isReference()) { - JavaObject** ptr = field.getInstanceObjectFieldPtr(obj); - mvm::Collector::markAndTrace(obj, ptr, closure); - } - } - cl = cl->super; - } -} -/// Method for scanning Java java.lang.ref.Reference objects. -extern "C" void ObjectReferenceTracer( - JavaObjectReference* obj, uintptr_t closure) { - Class* cl = JavaObject::getClass(obj)->asClass(); - assert(cl && "Not a class in reference tracer"); +/// Method for scanning the root of an object. +extern "C" void JavaObjectTracer(JavaObject* obj, uintptr_t closure) { + CommonClass* cl = JavaObject::getClass(obj); + assert(cl && "No class"); mvm::Collector::markAndTraceRoot( cl->classLoader->getJavaClassLoaderPtr(), closure); - - bool found = false; - while (cl->super != 0) { - for (uint32 i = 0; i < cl->nbVirtualFields; ++i) { - JavaField& field = cl->virtualFields[i]; - if (field.isReference()) { - JavaObject** ptr = field.getInstanceObjectFieldPtr(obj); - if (ptr != JavaObjectReference::getReferentPtr(obj)) { - mvm::Collector::markAndTrace(obj, ptr, closure); - } else { - found = true; - } - } - } - cl = cl->super; - } - assert(found && "No referent in a reference"); } - /// Method for scanning an array whose elements are JavaObjects. This method is /// called by all non-native Java arrays. extern "C" void ArrayObjectTracer(ArrayObject* obj, uintptr_t closure) { @@ -129,6 +91,7 @@ mvm::Collector::markAndTraceRoot( cl->classLoader->getJavaClassLoaderPtr(), closure); + for (sint32 i = 0; i < ArrayObject::getSize(obj); i++) { if (ArrayObject::getElement(obj, i) != NULL) { mvm::Collector::markAndTrace( @@ -143,6 +106,26 @@ extern "C" void JavaArrayTracer(JavaArray* obj, uintptr_t closure) { } +/// Method for scanning regular objects. +extern "C" void RegularObjectTracer(JavaObject* obj, uintptr_t closure) { + Class* cl = JavaObject::getClass(obj)->asClass(); + assert(cl && "Not a class in regular tracer"); + mvm::Collector::markAndTraceRoot( + cl->classLoader->getJavaClassLoaderPtr(), closure); + + while (cl->super != 0) { + for (uint32 i = 0; i < cl->nbVirtualFields; ++i) { + JavaField& field = cl->virtualFields[i]; + if (field.isReference()) { + JavaObject** ptr = field.getInstanceObjectFieldPtr(obj); + mvm::Collector::markAndTrace(obj, ptr, closure); + } + } + cl = cl->super; + } +} + + //===----------------------------------------------------------------------===// // Support for scanning Java objects referenced by classes. All classes must // trace: @@ -158,27 +141,25 @@ void CommonClass::tracer(uintptr_t closure) { - if (super != NULL && super->classLoader != NULL) { + if (super && super->classLoader) { JavaObject** Obj = super->classLoader->getJavaClassLoaderPtr(); if (*Obj) mvm::Collector::markAndTraceRoot(Obj, closure); for (uint32 i = 0; i < nbInterfaces; ++i) { - if (interfaces[i]->classLoader != NULL) { + if (interfaces[i]->classLoader) { JavaObject** Obj = interfaces[i]->classLoader->getJavaClassLoaderPtr(); - if ((*Obj) != NULL) mvm::Collector::markAndTraceRoot(Obj, closure); + if (*Obj) mvm::Collector::markAndTraceRoot(Obj, closure); } } } - if (classLoader != NULL) { + if (classLoader) mvm::Collector::markAndTraceRoot( classLoader->getJavaClassLoaderPtr(), closure); - } for (uint32 i = 0; i < NR_ISOLATES; ++i) { - if (delegatee[i] != NULL) { - // TODO: remove the call to tracer until no j.l.Class are allocated - // statically in AOT. + // If the delegatee was static allocated, we want to trace its fields. + if (delegatee[i]) { delegatee[i]->tracer(closure); mvm::Collector::markAndTraceRoot(delegatee + i, closure); } Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=108831&r1=108830&r2=108831&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Tue Jul 20 08:01:41 2010 @@ -202,14 +202,12 @@ gc* reference, VirtualMachine* vm, uintptr_t closure) { if (!Collector::isLive(reference, closure)) { vm->clearReferent(reference); - return NULL; + return 0; } gc* referent = *(vm->getReferentPtr(reference)); - if (!referent) { - return NULL; - } + if (!referent) return 0; if (semantics == SOFT) { // TODO: are we are out of memory? Consider that we always are for now. @@ -220,16 +218,16 @@ // Nothing to do. } - gc* newReference = - mvm::Collector::getForwardedReference(reference, closure); if (Collector::isLive(referent, closure)) { gc* newReferent = mvm::Collector::getForwardedReferent(referent, closure); + gc* newReference = + mvm::Collector::getForwardedReference(reference, closure); vm->setReferent(newReference, newReferent); return newReference; } else { - vm->clearReferent(newReference); - vm->addToEnqueue(newReference); - return NULL; + vm->clearReferent(reference); + vm->addToEnqueue(reference); + return 0; } } From nicolas.geoffray at lip6.fr Tue Jul 20 07:00:42 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 14:00:42 -0000 Subject: [vmkit-commits] [vmkit] r108835 - /vmkit/trunk/lib/Mvm/Runtime/Object.cpp Message-ID: <20100720140042.1BE532A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 09:00:41 2010 New Revision: 108835 URL: http://llvm.org/viewvc/llvm-project?rev=108835&view=rev Log: Update the forwarded reference, not the old reference. Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=108835&r1=108834&r2=108835&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Tue Jul 20 09:00:41 2010 @@ -202,12 +202,14 @@ gc* reference, VirtualMachine* vm, uintptr_t closure) { if (!Collector::isLive(reference, closure)) { vm->clearReferent(reference); - return 0; + return NULL; } gc* referent = *(vm->getReferentPtr(reference)); - if (!referent) return 0; + if (!referent) { + return NULL; + } if (semantics == SOFT) { // TODO: are we are out of memory? Consider that we always are for now. @@ -218,16 +220,16 @@ // Nothing to do. } + gc* newReference = + mvm::Collector::getForwardedReference(reference, closure); if (Collector::isLive(referent, closure)) { gc* newReferent = mvm::Collector::getForwardedReferent(referent, closure); - gc* newReference = - mvm::Collector::getForwardedReference(reference, closure); vm->setReferent(newReference, newReferent); return newReference; } else { - vm->clearReferent(reference); - vm->addToEnqueue(reference); - return 0; + vm->clearReferent(newReference); + vm->addToEnqueue(newReference); + return NULL; } } From nicolas.geoffray at lip6.fr Tue Jul 20 07:32:37 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 14:32:37 -0000 Subject: [vmkit-commits] [vmkit] r108836 - in /vmkit/trunk: include/j3/J3Intrinsics.h include/j3/JavaAOTCompiler.h lib/J3/Compiler/J3Intrinsics.cpp lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/LLVMRuntime/Makefile lib/J3/LLVMRuntime/runtime-boehm.ll lib/J3/LLVMRuntime/runtime-multi-mmap.ll lib/J3/LLVMRuntime/runtime-single-mmap.ll lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/VirtualTables.cpp Message-ID: <20100720143237.A20A32A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 09:32:37 2010 New Revision: 108836 URL: http://llvm.org/viewvc/llvm-project?rev=108836&view=rev Log: Cleanup the tracers and remove them from the compiler intrinsics: the compilers do not use them anymore. Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-boehm.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-multi-mmap.ll vmkit/trunk/lib/J3/LLVMRuntime/runtime-single-mmap.ll Modified: vmkit/trunk/include/j3/J3Intrinsics.h vmkit/trunk/include/j3/JavaAOTCompiler.h vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/LLVMRuntime/Makefile vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=108836&r1=108835&r2=108836&view=diff ============================================================================== --- vmkit/trunk/include/j3/J3Intrinsics.h (original) +++ vmkit/trunk/include/j3/J3Intrinsics.h Tue Jul 20 09:32:37 2010 @@ -48,12 +48,6 @@ const llvm::Type* JnjvmType; #endif - llvm::Function* EmptyTracerFunction; - llvm::Function* JavaObjectTracerFunction; - llvm::Function* JavaArrayTracerFunction; - llvm::Function* ArrayObjectTracerFunction; - llvm::Function* RegularObjectTracerFunction; - llvm::Function* StartJNIFunction; llvm::Function* EndJNIFunction; llvm::Function* InterfaceLookupFunction; Modified: vmkit/trunk/include/j3/JavaAOTCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaAOTCompiler.h?rev=108836&r1=108835&r2=108836&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaAOTCompiler.h (original) +++ vmkit/trunk/include/j3/JavaAOTCompiler.h Tue Jul 20 09:32:37 2010 @@ -169,6 +169,9 @@ llvm::Function* StaticInitializer; llvm::Function* ObjectPrinter; llvm::Function* Callback; + llvm::Function* ArrayObjectTracer; + llvm::Function* RegularObjectTracer; + llvm::Function* JavaObjectTracer; bool generateStubs; bool assumeCompiled; Modified: vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp?rev=108836&r1=108835&r2=108836&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/J3Intrinsics.cpp Tue Jul 20 09:32:37 2010 @@ -241,12 +241,6 @@ ServiceCallStopFunction = module->getFunction("j3ServiceCallStop"); #endif - JavaObjectTracerFunction = module->getFunction("JavaObjectTracer"); - EmptyTracerFunction = module->getFunction("EmptyTracer"); - JavaArrayTracerFunction = module->getFunction("JavaArrayTracer"); - ArrayObjectTracerFunction = module->getFunction("ArrayObjectTracer"); - RegularObjectTracerFunction = module->getFunction("RegularObjectTracer"); - #ifndef WITHOUT_VTABLE VirtualLookupFunction = module->getFunction("j3VirtualTableLookup"); #endif Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=108836&r1=108835&r2=108836&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Jul 20 09:32:37 2010 @@ -1398,12 +1398,12 @@ Function* Tracer = 0; if (classDef->isArray()) { if (classDef->asArrayClass()->baseClass()->isPrimitive()) { - Tracer = JavaIntrinsics.JavaArrayTracerFunction; + Tracer = JavaObjectTracer; } else { - Tracer = JavaIntrinsics.ArrayObjectTracerFunction; + Tracer = ArrayObjectTracer; } } else if (classDef->isClass()) { - Tracer = JavaIntrinsics.RegularObjectTracerFunction; + Tracer = RegularObjectTracer; } Elemts.push_back(Tracer ? @@ -1630,7 +1630,17 @@ FTy = FunctionType::get(Type::getVoidTy(getLLVMContext()), llvmArgs, false); ObjectPrinter = Function::Create(FTy, GlobalValue::ExternalLinkage, "printJavaObject", getLLVMModule()); - + + ArrayObjectTracer = Function::Create(FTy, GlobalValue::ExternalLinkage, + "ArrayObjectTracer", getLLVMModule()); + + RegularObjectTracer = Function::Create(FTy, + GlobalValue::ExternalLinkage, + "RegularObjectTracer", + getLLVMModule()); + + JavaObjectTracer = Function::Create(FTy, GlobalValue::ExternalLinkage, + "JavaObjectTracer", getLLVMModule()); } void JavaAOTCompiler::printStats() { Modified: vmkit/trunk/lib/J3/LLVMRuntime/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/Makefile?rev=108836&r1=108835&r2=108836&view=diff ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/Makefile (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/Makefile Tue Jul 20 09:32:37 2010 @@ -23,19 +23,7 @@ endif ifeq ($(SERVICE_BUILD), 1) -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-service.ll $(PROJ_SRC_DIR)/runtime-isolate.ll $(PROJ_SRC_DIR)/runtime-single-mmap.ll -else -ifeq ($(GC_MULTI_MMAP), 1) -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-multi-mmap.ll -else -ifeq ($(GC_SINGLE_MMAP), 1) -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-single-mmap.ll -else -ifeq ($(GC_BOEHM), 1) -VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-boehm.ll -endif -endif -endif +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-service.ll $(PROJ_SRC_DIR)/runtime-isolate.ll endif ifeq ($(SINGLE_BUILD), 1) Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-boehm.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-boehm.ll?rev=108835&view=auto ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-boehm.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-boehm.ll (removed) @@ -1,5 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;; Collector specific methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare %JavaObject* @gcmalloc(i32, %VT*) Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-multi-mmap.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-multi-mmap.ll?rev=108835&view=auto ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-multi-mmap.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-multi-mmap.ll (removed) @@ -1,10 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;; Collector specific methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @MarkAndTrace(%JavaObject*, i8*) -declare void @JavaObjectTracer(%JavaObject*, i8*) -declare void @JavaArrayTracer(%JavaObject*, i8*) -declare void @ArrayObjectTracer(%JavaObject*, i8*) -declare void @RegularObjectTracer(%JavaObject*, i8*) -declare void @EmptyTracer(%JavaObject*, i8*) Removed: vmkit/trunk/lib/J3/LLVMRuntime/runtime-single-mmap.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/LLVMRuntime/runtime-single-mmap.ll?rev=108835&view=auto ============================================================================== --- vmkit/trunk/lib/J3/LLVMRuntime/runtime-single-mmap.ll (original) +++ vmkit/trunk/lib/J3/LLVMRuntime/runtime-single-mmap.ll (removed) @@ -1,10 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;; Collector specific methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -declare void @MarkAndTrace(%JavaObject*) -declare void @JavaObjectTracer(%JavaObject*) -declare void @JavaArrayTracer(%JavaObject*) -declare void @ArrayObjectTracer(%JavaObject*) -declare void @RegularObjectTracer(%JavaObject*) -declare void @EmptyTracer(%JavaObject*) Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108836&r1=108835&r2=108836&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Tue Jul 20 09:32:37 2010 @@ -40,7 +40,6 @@ Class* ClassArray::SuperArray; Class** ClassArray::InterfacesArray; -extern "C" void JavaArrayTracer(JavaObject*); extern "C" void JavaObjectTracer(JavaObject*); extern "C" void ArrayObjectTracer(JavaObject*); extern "C" void RegularObjectTracer(JavaObject*); @@ -1756,7 +1755,7 @@ } else { // Set the tracer, destructor and delete - tracer = (uintptr_t)JavaArrayTracer; + tracer = (uintptr_t)JavaObjectTracer; destructor = 0; operatorDelete = 0; Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=108836&r1=108835&r2=108836&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Tue Jul 20 09:32:37 2010 @@ -56,54 +56,16 @@ (uintptr_t)VMClassLoader::staticTracer); //===----------------------------------------------------------------------===// -// Empty tracer for static tracers of classes that do not declare static -// variables. +// Trace methods for Java objects. There are three types of objects: +// (1) java.lang.Object and primitive arrays: no need to trace anything. +// (2) Object whose class is not an array: needs to trace the classloader, and +// all the virtual fields. +// (3) Object whose class is an array of objects: needs to trace the class +// loader and all elements in the array. //===----------------------------------------------------------------------===// -extern "C" void EmptyTracer(void*, uintptr_t) {} - -//===----------------------------------------------------------------------===// -// Trace methods for Java objects. There are four types of objects: -// (1) Base object whose class is not an array: needs to trace the classloader -// and the lock. -// (1) Object whose class is not an array: needs to trace the classloader, the -// lock and all the virtual fields. -// (2) Object whose class is an array of objects: needs to trace root (1) and -// all elements in the array. -// (3) Object whose class is a native array: only needs to trace the lock. The -// classloader is the bootstrap loader and is traced by the JVM. -//===----------------------------------------------------------------------===// - - -/// Method for scanning the root of an object. +/// Scanning java.lang.Object and primitive arrays. extern "C" void JavaObjectTracer(JavaObject* obj, uintptr_t closure) { - CommonClass* cl = JavaObject::getClass(obj); - assert(cl && "No class"); - mvm::Collector::markAndTraceRoot( - cl->classLoader->getJavaClassLoaderPtr(), closure); -} - -/// Method for scanning an array whose elements are JavaObjects. This method is -/// called by all non-native Java arrays. -extern "C" void ArrayObjectTracer(ArrayObject* obj, uintptr_t closure) { - CommonClass* cl = JavaObject::getClass(obj); - assert(cl && "No class"); - mvm::Collector::markAndTraceRoot( - cl->classLoader->getJavaClassLoaderPtr(), closure); - - - for (sint32 i = 0; i < ArrayObject::getSize(obj); i++) { - if (ArrayObject::getElement(obj, i) != NULL) { - mvm::Collector::markAndTrace( - obj, ArrayObject::getElements(obj) + i, closure); - } - } -} - -/// Method for scanning a native array. The classloader of -/// the class is the bootstrap loader and therefore does not need to be -/// scanned here. -extern "C" void JavaArrayTracer(JavaArray* obj, uintptr_t closure) { } /// Method for scanning regular objects. @@ -125,6 +87,22 @@ } } +/// Method for scanning an array whose elements are JavaObjects. This method is +/// called for all non-native Java arrays. +extern "C" void ArrayObjectTracer(ArrayObject* obj, uintptr_t closure) { + CommonClass* cl = JavaObject::getClass(obj); + assert(cl && "No class"); + mvm::Collector::markAndTraceRoot( + cl->classLoader->getJavaClassLoaderPtr(), closure); + + + for (sint32 i = 0; i < ArrayObject::getSize(obj); i++) { + if (ArrayObject::getElement(obj, i) != NULL) { + mvm::Collector::markAndTrace( + obj, ArrayObject::getElements(obj) + i, closure); + } + } +} //===----------------------------------------------------------------------===// // Support for scanning Java objects referenced by classes. All classes must @@ -138,28 +116,29 @@ // (4) The static instance. //===----------------------------------------------------------------------===// - void CommonClass::tracer(uintptr_t closure) { - if (super && super->classLoader) { + if (super != NULL && super->classLoader != NULL) { JavaObject** Obj = super->classLoader->getJavaClassLoaderPtr(); - if (*Obj) mvm::Collector::markAndTraceRoot(Obj, closure); + if (*Obj != NULL) mvm::Collector::markAndTraceRoot(Obj, closure); for (uint32 i = 0; i < nbInterfaces; ++i) { if (interfaces[i]->classLoader) { JavaObject** Obj = interfaces[i]->classLoader->getJavaClassLoaderPtr(); - if (*Obj) mvm::Collector::markAndTraceRoot(Obj, closure); + if (*Obj != NULL) mvm::Collector::markAndTraceRoot(Obj, closure); } } } - if (classLoader) + if (classLoader != NULL) { mvm::Collector::markAndTraceRoot( classLoader->getJavaClassLoaderPtr(), closure); + } for (uint32 i = 0; i < NR_ISOLATES; ++i) { - // If the delegatee was static allocated, we want to trace its fields. - if (delegatee[i]) { + if (delegatee[i] != NULL) { + // TODO: remove this call to trace once no delegatee is static allocated + // in AOT mode. delegatee[i]->tracer(closure); mvm::Collector::markAndTraceRoot(delegatee + i, closure); } @@ -172,7 +151,7 @@ for (uint32 i = 0; i < NR_ISOLATES; ++i) { TaskClassMirror &M = IsolateInfo[i]; - if (M.staticInstance) { + if (M.staticInstance != NULL) { for (uint32 i = 0; i < nbStaticFields; ++i) { JavaField& field = staticFields[i]; if (field.isReference()) { @@ -263,13 +242,13 @@ VirtualMachine::tracer(closure); bootstrapLoader->tracer(closure); - if (appClassLoader) { + if (appClassLoader != NULL) { mvm::Collector::markAndTraceRoot( appClassLoader->getJavaClassLoaderPtr(), closure); } JNIGlobalReferences* start = &globalRefs; - while (start) { + while (start != NULL) { for (uint32 i = 0; i < start->length; ++i) { JavaObject** obj = start->globalReferences + i; mvm::Collector::markAndTraceRoot(obj, closure); @@ -312,7 +291,7 @@ } void JavaThread::tracer(uintptr_t closure) { - if (pendingException) { + if (pendingException != NULL) { mvm::Collector::markAndTraceRoot(&pendingException, closure); } mvm::Collector::markAndTraceRoot(&javaThread, closure); @@ -321,7 +300,7 @@ #endif JNILocalReferences* end = localJNIRefs; - while (end) { + while (end != NULL) { for (uint32 i = 0; i < end->length; ++i) { JavaObject** obj = end->localReferences + i; mvm::Collector::markAndTraceRoot(obj, closure); From nicolas.geoffray at gmail.com Tue Jul 20 09:05:12 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Tue, 20 Jul 2010 18:05:12 +0200 Subject: [vmkit-commits] Debug logger patch (PRINT_DEBUG()) and how to turn it on/off In-Reply-To: References: Message-ID: Thanks very much Minas! Actually, when it comes to debugging, I would love to be able to pass the debug level information at runtime rather than at compile-time. If you can come up with a better framework for debugging than what is currently there, that would be great. In other words, I would rather change the framework rather than improving it :) Still, I will take a look at your patch. Thanks! Nicolas On Mon, Jul 19, 2010 at 8:18 PM, Minas Abrahamyan wrote: > Hi all, > > Printing of debug messages is very useful for debugging of any kind; > This patch allows to print them again, as it was possible few ages ago :) > Maybe not everything in right include files here, but that is better > than absence of debug logs > > To apply: > $ cd vmkit > $ patch -p1 <../vmkit_debuglog.patch > > To turn on: uncomment vmkit/include/debug.h line 13: > #define DEBUG 10 > > To turn off - comment it back: > //#define DEBUG 10 > > To manage VMCore subsystem logs generation: > In vmkit/lib/J3/VMCore/JnjvmConfig.h, lines 43-47: > #define JNJVM_LOAD 3 > #define JNJVM_COMPILE 2 > > JNJVM_LOAD - class loading debug level, 1-4, when 0 it is turned off > JNJVM_COMPILE - methods compiling debug level, when 0 it is turned off > > To add new logging messages, insert something like: > PRINT_DEBUG(symb, level, color, printf-like-argslist) > Fotr example: > PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "Jnjvm::loadBootstrap(){\n"); > where > symb - is subsystem debug level, > level - is current message required level; > Message is printed only if symb>level; subsystem logging level is > bigger than necessary by current message level; > COLOR_NORMAL - is default color. > ( In fact it supports fancy colour printing on terminal, through > third argument, but I'm not using it.) > > In this example Message will be printed if DEBUG is defined, and JNJVM_LOAD > >0. > > PRINT_DEBUG prints to stderr. > > == > Nicolas, please review and apply this patch. > Thanks. > > -Minas > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at gmail.com Tue Jul 20 09:05:12 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Tue, 20 Jul 2010 18:05:12 +0200 Subject: [vmkit-commits] Debug logger patch (PRINT_DEBUG()) and how to turn it on/off In-Reply-To: References: Message-ID: Thanks very much Minas! Actually, when it comes to debugging, I would love to be able to pass the debug level information at runtime rather than at compile-time. If you can come up with a better framework for debugging than what is currently there, that would be great. In other words, I would rather change the framework rather than improving it :) Still, I will take a look at your patch. Thanks! Nicolas On Mon, Jul 19, 2010 at 8:18 PM, Minas Abrahamyan wrote: > Hi all, > > Printing of debug messages is very useful for debugging of any kind; > This patch allows to print them again, as it was possible few ages ago :) > Maybe not everything in right include files here, but that is better > than absence of debug logs > > To apply: > $ cd vmkit > $ patch -p1 <../vmkit_debuglog.patch > > To turn on: uncomment vmkit/include/debug.h line 13: > #define DEBUG 10 > > To turn off - comment it back: > //#define DEBUG 10 > > To manage VMCore subsystem logs generation: > In vmkit/lib/J3/VMCore/JnjvmConfig.h, lines 43-47: > #define JNJVM_LOAD 3 > #define JNJVM_COMPILE 2 > > JNJVM_LOAD - class loading debug level, 1-4, when 0 it is turned off > JNJVM_COMPILE - methods compiling debug level, when 0 it is turned off > > To add new logging messages, insert something like: > PRINT_DEBUG(symb, level, color, printf-like-argslist) > Fotr example: > PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "Jnjvm::loadBootstrap(){\n"); > where > symb - is subsystem debug level, > level - is current message required level; > Message is printed only if symb>level; subsystem logging level is > bigger than necessary by current message level; > COLOR_NORMAL - is default color. > ( In fact it supports fancy colour printing on terminal, through > third argument, but I'm not using it.) > > In this example Message will be printed if DEBUG is defined, and JNJVM_LOAD > >0. > > PRINT_DEBUG prints to stderr. > > == > Nicolas, please review and apply this patch. > Thanks. > > -Minas > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From minas.subs at gmail.com Tue Jul 20 15:15:44 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Wed, 21 Jul 2010 03:15:44 +0500 Subject: [vmkit-commits] Debug logger patch (PRINT_DEBUG()) and how to turn it on/off In-Reply-To: References: Message-ID: Hi Nicolas, I think it is better to check it in anyway, since it will free me from unnecessary merges of that debug logging: since I have it, and seen it usefulness, I won't get to renounce from its benefits. Beside that, IMO, it is easier to get working after changes on something working than while inserting new functionality without tests What is the point reconfigurable at runtime logger? Debugging logs are running in debug versions, sometime - in releases too, but could be switched off in final release version, Reserving place and functions for runtime-featured logging, could have impact on performance... or at least it is needed a global flag/define to turn them totally off. (Now that define is DEBUG) -Minas On Tue, Jul 20, 2010 at 9:05 PM, nicolas geoffray wrote: > Thanks very much Minas! > Actually, when it comes to debugging, I would love to be able to pass the > debug level information at runtime rather than at compile-time. If you can > come up with a better framework for debugging than what is currently there, > that would be great. In other words, I would rather change the framework > rather than improving it :) > Still, I will take a look at your patch. > Thanks! > Nicolas > > On Mon, Jul 19, 2010 at 8:18 PM, Minas Abrahamyan > wrote: >> >> Hi all, >> >> Printing of debug messages is very useful for debugging of any kind; >> This patch allows to print them again, as it was possible few ages ago :) >> Maybe not everything in right include files here, but that is better >> than absence of debug logs >> >> To apply: >> $ cd vmkit >> $ patch -p1 <../vmkit_debuglog.patch >> >> To turn on: uncomment vmkit/include/debug.h line 13: >> #define DEBUG 10 >> >> To turn off - comment it back: >> //#define DEBUG 10 >> >> To manage VMCore subsystem logs generation: >> In vmkit/lib/J3/VMCore/JnjvmConfig.h, lines 43-47: >> #define JNJVM_LOAD 3 >> #define JNJVM_COMPILE 2 >> >> JNJVM_LOAD - class loading debug level, 1-4, when 0 it is turned off >> JNJVM_COMPILE - methods compiling debug level, when 0 it is turned off >> >> To add new logging messages, insert something like: >> PRINT_DEBUG(symb, level, color, printf-like-argslist) >> Fotr example: >> PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "Jnjvm::loadBootstrap(){\n"); >> where >> symb - is subsystem debug level, >> level - is current message required level; >>  Message is printed only if symb>level; subsystem logging level is >> bigger than necessary by current message level; >> COLOR_NORMAL - is default color. >>  ( In fact it supports fancy colour printing on terminal, through >> third argument, but I'm not using it.) >> >> In this example Message will be printed if DEBUG is defined, and >> JNJVM_LOAD >0. >> >> PRINT_DEBUG prints to stderr. >> >> == >> Nicolas, please review and apply this patch. >> Thanks. >> >> -Minas >> >> _______________________________________________ >> vmkit-commits mailing list >> vmkit-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >> > > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > From nicolas.geoffray at lip6.fr Tue Jul 20 16:00:50 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Jul 2010 23:00:50 -0000 Subject: [vmkit-commits] [vmkit] r108960 - in /vmkit/trunk: include/j3/JavaAOTCompiler.h include/mvm/VirtualMachine.h lib/J3/Classpath/ClasspathReflect.h lib/J3/Classpath/JavaUpcalls.cpp lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/VMCore/JavaClass.cpp lib/J3/VMCore/VirtualTables.cpp Message-ID: <20100720230051.895F12A6C12C@llvm.org> Author: geoffray Date: Tue Jul 20 18:00:50 2010 New Revision: 108960 URL: http://llvm.org/viewvc/llvm-project?rev=108960&view=rev Log: Fix long-standing bugs on java.lang.ref.References. Modified: vmkit/trunk/include/j3/JavaAOTCompiler.h vmkit/trunk/include/mvm/VirtualMachine.h vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/J3/VMCore/JavaClass.cpp vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/j3/JavaAOTCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaAOTCompiler.h?rev=108960&r1=108959&r2=108960&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaAOTCompiler.h (original) +++ vmkit/trunk/include/j3/JavaAOTCompiler.h Tue Jul 20 18:00:50 2010 @@ -172,6 +172,7 @@ llvm::Function* ArrayObjectTracer; llvm::Function* RegularObjectTracer; llvm::Function* JavaObjectTracer; + llvm::Function* ReferenceObjectTracer; bool generateStubs; bool assumeCompiled; Modified: vmkit/trunk/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/VirtualMachine.h?rev=108960&r1=108959&r2=108960&view=diff ============================================================================== --- vmkit/trunk/include/mvm/VirtualMachine.h (original) +++ vmkit/trunk/include/mvm/VirtualMachine.h Tue Jul 20 18:00:50 2010 @@ -377,7 +377,9 @@ fprintf(stderr, "I don't know how to handle reference overflow yet!\n"); abort(); } - for (uint32 i = 0; i < QueueLength; ++i) newQueue[i] = ToEnqueue[i]; + for (uint32 i = 0; i < ToEnqueueLength; ++i) { + newQueue[i] = ToEnqueue[i]; + } delete[] ToEnqueue; ToEnqueue = newQueue; ToEnqueueLength = newLength; Modified: vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h?rev=108960&r1=108959&r2=108960&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/J3/Classpath/ClasspathReflect.h Tue Jul 20 18:00:50 2010 @@ -1,6 +1,4 @@ -//===------ ClasspathReflect.h - GNU classpath definitions of ----------------// -// java/lang/Class, java/lang/reflect/Field, java/lang/reflect/Method and ----// -// java/lang/reflect/Constructor as compiled by JnJVM. -----------------------// +//===-- ClasspathReflect.h - Internal representation of core system classes --// // // The VMKit project // @@ -210,16 +208,12 @@ llvm_gcroot(self, 0); return &(self->referent); } + static void setReferent(JavaObjectReference* self, JavaObject* r) { llvm_gcroot(self, 0); llvm_gcroot(r, 0); self->referent = r; } - - static void staticTracer(JavaObjectReference* obj, uintptr_t closure) { - mvm::Collector::markAndTrace(obj, &obj->queue, closure); - mvm::Collector::markAndTrace(obj, &obj->nextOnQueue, closure); - } }; } Modified: vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp?rev=108960&r1=108959&r2=108960&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/J3/Classpath/JavaUpcalls.cpp Tue Jul 20 18:00:50 2010 @@ -490,7 +490,6 @@ extern "C" void nativePropertiesPostInit(JavaObject* prop); - extern "C" void nativeJavaObjectClassTracer( JavaObjectClass* obj, uintptr_t closure) { JavaObjectClass::staticTracer(obj, closure); @@ -511,11 +510,6 @@ JavaObjectConstructor::staticTracer(obj, closure); } -extern "C" void nativeJavaObjectReferenceTracer( - JavaObjectReference* obj, uintptr_t closure) { - JavaObjectReference::staticTracer(obj, closure); -} - extern "C" void nativeJavaObjectVMThreadTracer( JavaObjectVMThread* obj, uintptr_t closure) { JavaObjectVMThread::staticTracer(obj, closure); @@ -1042,10 +1036,6 @@ newReference = UPCALL_CLASS(loader, "java/lang/ref/Reference"); - newReference->getVirtualVT()->setNativeTracer( - (uintptr_t)nativeJavaObjectReferenceTracer, - "nativeJavaObjectReferenceTracer"); - EnqueueReference = UPCALL_METHOD(loader, "java/lang/ref/Reference", "enqueue", "()Z", ACC_VIRTUAL); Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=108960&r1=108959&r2=108960&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Tue Jul 20 18:00:50 2010 @@ -1403,7 +1403,12 @@ Tracer = ArrayObjectTracer; } } else if (classDef->isClass()) { - Tracer = RegularObjectTracer; + if (classDef->isAssignableFrom( + classDef->classLoader->bootstrapLoader->upcalls->newReference)) { + Tracer = ReferenceObjectTracer; + } else { + Tracer = RegularObjectTracer; + } } Elemts.push_back(Tracer ? @@ -1641,6 +1646,11 @@ JavaObjectTracer = Function::Create(FTy, GlobalValue::ExternalLinkage, "JavaObjectTracer", getLLVMModule()); + + ReferenceObjectTracer = Function::Create(FTy, + GlobalValue::ExternalLinkage, + "ReferenceObjectTracer", + getLLVMModule()); } void JavaAOTCompiler::printStats() { Modified: vmkit/trunk/lib/J3/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/JavaClass.cpp?rev=108960&r1=108959&r2=108960&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/JavaClass.cpp Tue Jul 20 18:00:50 2010 @@ -43,6 +43,7 @@ extern "C" void JavaObjectTracer(JavaObject*); extern "C" void ArrayObjectTracer(JavaObject*); extern "C" void RegularObjectTracer(JavaObject*); +extern "C" void ReferenceObjectTracer(JavaObject*); Attribut::Attribut(const UTF8* name, uint32 length, uint32 offset) { @@ -50,7 +51,6 @@ this->start = offset; this->nbb = length; this->name = name; - } Attribut* Class::lookupAttribut(const UTF8* key ) { @@ -1472,23 +1472,28 @@ JavaVirtualTable::JavaVirtualTable(Class* C) { if (C->super) { - - assert(C->super->virtualVT && "Super has no VT"); - // Set the regular object tracer, destructor and delete. - tracer = (uintptr_t)RegularObjectTracer; + Class* referenceClass = + C->classLoader->bootstrapLoader->upcalls->newReference; + if (referenceClass != NULL && C->super->isAssignableFrom(referenceClass)) { + tracer = (uintptr_t)ReferenceObjectTracer; + } else { + tracer = (uintptr_t)RegularObjectTracer; + } destructor = 0; operatorDelete = 0; // Set IMT. - if (!isAbstract(C->access)) + if (!isAbstract(C->access)) { IMT = new (C->classLoader->allocator, "IMT") InterfaceMethodTable(); + } // Set the class of this VT. cl = C; // Set depth and display for fast dynamic type checking. - JavaVirtualTable* superVT = C->super->virtualVT; + JavaVirtualTable* superVT = C->super->virtualVT; + assert(superVT && "Super has no VT"); depth = superVT->depth + 1; nbSecondaryTypes = superVT->nbSecondaryTypes + cl->nbInterfaces; Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=108960&r1=108959&r2=108960&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Tue Jul 20 18:00:50 2010 @@ -20,6 +20,7 @@ // //===----------------------------------------------------------------------===// +#include "ClasspathReflect.h" #include "JavaArray.h" #include "JavaClass.h" #include "JavaObject.h" @@ -56,12 +57,14 @@ (uintptr_t)VMClassLoader::staticTracer); //===----------------------------------------------------------------------===// -// Trace methods for Java objects. There are three types of objects: +// Trace methods for Java objects. There are four types of objects: // (1) java.lang.Object and primitive arrays: no need to trace anything. // (2) Object whose class is not an array: needs to trace the classloader, and // all the virtual fields. // (3) Object whose class is an array of objects: needs to trace the class // loader and all elements in the array. +// (4) Objects that extend java.lang.ref.Reference: must trace the class loader +// and all the fields except the referent. //===----------------------------------------------------------------------===// /// Scanning java.lang.Object and primitive arrays. @@ -104,6 +107,32 @@ } } +/// Method for scanning Java java.lang.ref.Reference objects. +extern "C" void ReferenceObjectTracer( + JavaObjectReference* obj, uintptr_t closure) { + Class* cl = JavaObject::getClass(obj)->asClass(); + assert(cl && "Not a class in reference tracer"); + mvm::Collector::markAndTraceRoot( + cl->classLoader->getJavaClassLoaderPtr(), closure); + + bool found = false; + while (cl->super != 0) { + for (uint32 i = 0; i < cl->nbVirtualFields; ++i) { + JavaField& field = cl->virtualFields[i]; + if (field.isReference()) { + JavaObject** ptr = field.getInstanceObjectFieldPtr(obj); + if (ptr != JavaObjectReference::getReferentPtr(obj)) { + mvm::Collector::markAndTrace(obj, ptr, closure); + } else { + found = true; + } + } + } + cl = cl->super; + } + assert(found && "No referent in a reference"); +} + //===----------------------------------------------------------------------===// // Support for scanning Java objects referenced by classes. All classes must // trace: @@ -190,7 +219,7 @@ } StringList* end = strings; - while (end) { + while (end != NULL) { for (uint32 i = 0; i < end->length; ++i) { JavaString** obj = end->strings + i; mvm::Collector::markAndTraceRoot(obj, closure); From minas.subs at gmail.com Tue Jul 20 16:12:40 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Wed, 21 Jul 2010 04:12:40 +0500 Subject: [vmkit-commits] Does llc compilation of glibj.zip work on 32 bits? Message-ID: Hi, Does llc compilation of glibj.zip work on 32 bits? or anywhere I reported bug about crushing of llc in llvmdev@ but yet unresponded Talking about: http://vmkit.llvm.org/use_aot.html : > make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 -Minas From willdtz at gmail.com Tue Jul 20 16:17:58 2010 From: willdtz at gmail.com (Will Dietz) Date: Tue, 20 Jul 2010 18:17:58 -0500 Subject: [vmkit-commits] Does llc compilation of glibj.zip work on 32 bits? In-Reply-To: References: Message-ID: Hi Minas, all, I haven't got it working on 64bit linux, 64bit Mac, or 32bit linux. Reports of it working on any platform/architecture would interest me as well. Both optimized and unoptimized glibj.bc fail when I try to use llc to convert them to machine code (glibj.s). ~Will On Tue, Jul 20, 2010 at 6:12 PM, Minas Abrahamyan wrote: > Hi, > > Does llc compilation of glibj.zip work on 32 bits? or anywhere > > I reported bug about crushing of llc in llvmdev@ but yet unresponded > Talking about: http://vmkit.llvm.org/use_aot.html : >> make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 > > -Minas > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > From nicolas.geoffray at gmail.com Tue Jul 20 16:33:37 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Wed, 21 Jul 2010 01:33:37 +0200 Subject: [vmkit-commits] Does llc compilation of glibj.zip work on 32 bits? In-Reply-To: References: Message-ID: I will take a look on my linux/32bit machine whether it works tomorrow (and, as you notice Minas, will take lots of coffee waiting for it to finish). It used to work not so long ago. It is also the only platform where I could get it working. However, it has never been tested on a 64bits. Nicolas On Wed, Jul 21, 2010 at 1:17 AM, Will Dietz wrote: > Hi Minas, all, > > I haven't got it working on 64bit linux, 64bit Mac, or 32bit linux. > Reports of it working on any platform/architecture would interest me > as well. > > Both optimized and unoptimized glibj.bc fail when I try to use llc to > convert them to machine code (glibj.s). > > ~Will > > On Tue, Jul 20, 2010 at 6:12 PM, Minas Abrahamyan > wrote: > > Hi, > > > > Does llc compilation of glibj.zip work on 32 bits? or anywhere > > > > I reported bug about crushing of llc in llvmdev@ but yet unresponded > > Talking about: http://vmkit.llvm.org/use_aot.html : > >> make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 > > > > -Minas > > _______________________________________________ > > vmkit-commits mailing list > > vmkit-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > > _______________________________________________ > vmkit-commits mailing list > vmkit-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willdtz at gmail.com Tue Jul 20 22:41:20 2010 From: willdtz at gmail.com (Will Dietz) Date: Wed, 21 Jul 2010 00:41:20 -0500 Subject: [vmkit-commits] About j3-64bit crush In-Reply-To: References: Message-ID: On Mon, Jul 19, 2010 at 10:53 AM, nicolas geoffray wrote: > That's great news! Thanks Allan for sharing the fix. About this > ClassNotFoundException, try to debug vmkit and see how the classpath is > being parsed. > Cheers, > Nicolas When you get a chance, would you mind adding mention of this fix to the 'getting started' documentation? Might be useful for those attempting to use it on 64bit in the future. Just a thought, and I understand you're busy :). ~Will From nicolas.geoffray at lip6.fr Wed Jul 21 03:29:20 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 21 Jul 2010 10:29:20 -0000 Subject: [vmkit-commits] [vmkit] r109008 - in /vmkit/trunk: include/debug.h mmtk/config/marksweep/MMTkInline.inc mmtk/java/src/org/j3/bindings/Bindings.java mmtk/mmtk-j3/ActivePlan.cpp mmtk/mmtk-j3/Assert.cpp mmtk/mmtk-j3/Collection.cpp mmtk/mmtk-j3/FinalizableProcessor.cpp mmtk/mmtk-j3/Lock.cpp mmtk/mmtk-j3/Memory.cpp mmtk/mmtk-j3/ObjectModel.cpp mmtk/mmtk-j3/ReferenceProcessor.cpp mmtk/mmtk-j3/Scanning.cpp mmtk/mmtk-j3/Strings.cpp mmtk/mmtk-j3/SynchronizedCounter.cpp mmtk/mmtk-j3/TraceInterface.cpp mmtk/mmtk-j3/VM.cpp Message-ID: <20100721102921.1FFB32A6C12C@llvm.org> Author: geoffray Date: Wed Jul 21 05:29:20 2010 New Revision: 109008 URL: http://llvm.org/viewvc/llvm-project?rev=109008&view=rev Log: Add an UNIMPLEMENTED macro. Also implement some MMTK-copy related functions. Modified: vmkit/trunk/include/debug.h vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc vmkit/trunk/mmtk/java/src/org/j3/bindings/Bindings.java vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp vmkit/trunk/mmtk/mmtk-j3/Assert.cpp vmkit/trunk/mmtk/mmtk-j3/Collection.cpp vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp vmkit/trunk/mmtk/mmtk-j3/Lock.cpp vmkit/trunk/mmtk/mmtk-j3/Memory.cpp vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp vmkit/trunk/mmtk/mmtk-j3/Strings.cpp vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp vmkit/trunk/mmtk/mmtk-j3/VM.cpp Modified: vmkit/trunk/include/debug.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/debug.h?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/include/debug.h (original) +++ vmkit/trunk/include/debug.h Wed Jul 21 05:29:20 2010 @@ -1,6 +1,6 @@ //===----------------- debug.h - Debug facilities -------------------------===// // -// Mvm +// The VMKit project // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. @@ -64,5 +64,14 @@ #define PRINT_DEBUG(symb, level, color, args...) do {} while(0); #endif +#define UNIMPLEMENTED() { \ + mvm::Thread::get()->printBacktrace(); \ + fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); \ + abort(); } \ + +#define ABORT() UNIMPLEMENTED() + +#define ASSERT(cond) { \ + if (!cond) ABORT(); } \ #endif Modified: vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc (original) +++ vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Wed Jul 21 05:29:20 2010 @@ -10,16 +10,16 @@ FuncTy_1_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_1_args.push_back(PointerTy_0); FunctionType* FuncTy_1 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_1_args, - /*isVarArg=*/false); + /*Result=*/PointerTy_0, + /*Params=*/FuncTy_1_args, + /*isVarArg=*/false); std::vectorFuncTy_3_args; FuncTy_3_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_3 = FunctionType::get( - /*Result=*/PointerTy_0, - /*Params=*/FuncTy_3_args, - /*isVarArg=*/false); + /*Result=*/PointerTy_0, + /*Params=*/FuncTy_3_args, + /*isVarArg=*/false); PointerType* PointerTy_2 = PointerType::get(FuncTy_3, 0); @@ -28,9 +28,9 @@ std::vectorStructTy_struct_mvm__CircularBase_fields; std::vectorFuncTy_7_args; FunctionType* FuncTy_7 = FunctionType::get( - /*Result=*/IntegerType::get(mod->getContext(), 32), - /*Params=*/FuncTy_7_args, - /*isVarArg=*/true); + /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Params=*/FuncTy_7_args, + /*isVarArg=*/true); PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0); @@ -266,9 +266,9 @@ std::vectorFuncTy_19_args; FuncTy_19_args.push_back(PointerTy_13); FunctionType* FuncTy_19 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_19_args, - /*isVarArg=*/false); + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_19_args, + /*isVarArg=*/false); PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0); @@ -344,9 +344,9 @@ std::vectorFuncTy_28_args; FunctionType* FuncTy_28 = FunctionType::get( - /*Result=*/Type::getVoidTy(mod->getContext()), - /*Params=*/FuncTy_28_args, - /*isVarArg=*/false); + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_28_args, + /*isVarArg=*/false); PointerType* PointerTy_27 = PointerType::get(FuncTy_28, 0); @@ -373,9 +373,9 @@ 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_30, - /*Params=*/FuncTy_34_args, - /*isVarArg=*/false); + /*Result=*/PointerTy_30, + /*Params=*/FuncTy_34_args, + /*isVarArg=*/false); PointerType* PointerTy_33 = PointerType::get(FuncTy_34, 0); @@ -388,9 +388,9 @@ FuncTy_37_args.push_back(IntegerType::get(mod->getContext(), 32)); FuncTy_37_args.push_back(IntegerType::get(mod->getContext(), 32)); FunctionType* FuncTy_37 = FunctionType::get( - /*Result=*/PointerTy_30, - /*Params=*/FuncTy_37_args, - /*isVarArg=*/false); + /*Result=*/PointerTy_30, + /*Params=*/FuncTy_37_args, + /*isVarArg=*/false); PointerType* PointerTy_36 = PointerType::get(FuncTy_37, 0); @@ -470,9 +470,9 @@ 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_51_args, - /*isVarArg=*/false); + /*Result=*/Type::getVoidTy(mod->getContext()), + /*Params=*/FuncTy_51_args, + /*isVarArg=*/false); PointerType* PointerTy_50 = PointerType::get(FuncTy_51, 0); @@ -481,9 +481,9 @@ 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_53_args, - /*isVarArg=*/false); + /*Result=*/IntegerType::get(mod->getContext(), 32), + /*Params=*/FuncTy_53_args, + /*isVarArg=*/false); PointerType* PointerTy_52 = PointerType::get(FuncTy_53, 0); @@ -491,177 +491,177 @@ // Function Declarations Function* func_llvm_frameaddress = Function::Create( - /*Type=*/FuncTy_3, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"llvm.frameaddress", mod); // (external, no body) + /*Type=*/FuncTy_3, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.frameaddress", mod); // (external, no body) func_llvm_frameaddress->setCallingConv(CallingConv::C); AttrListPtr func_llvm_frameaddress_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind | Attribute::ReadNone; - Attrs.push_back(PAWI); - func_llvm_frameaddress_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind | Attribute::ReadNone; + Attrs.push_back(PAWI); + func_llvm_frameaddress_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL); Function* func_abort = Function::Create( - /*Type=*/FuncTy_28, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"abort", mod); // (external, no body) + /*Type=*/FuncTy_28, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"abort", mod); // (external, no body) func_abort->setCallingConv(CallingConv::C); AttrListPtr func_abort_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_abort->setAttributes(func_abort_PAL); Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create( - /*Type=*/FuncTy_34, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III", mod); + /*Type=*/FuncTy_34, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III", mod); func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setCallingConv(CallingConv::C); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; - Attrs.push_back(PAWI); - func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; + Attrs.push_back(PAWI); + func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL); Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create( - /*Type=*/FuncTy_37, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II", mod); + /*Type=*/FuncTy_37, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II", mod); func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setCallingConv(CallingConv::C); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; - Attrs.push_back(PAWI); - func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; + Attrs.push_back(PAWI); + func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setAttributes(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL); Function* func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III = Function::Create( - /*Type=*/FuncTy_34, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III", mod); + /*Type=*/FuncTy_34, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III", mod); func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setCallingConv(CallingConv::C); AttrListPtr func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; - Attrs.push_back(PAWI); - func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline; + Attrs.push_back(PAWI); + func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL); Function* func_llvm_memory_barrier = Function::Create( - /*Type=*/FuncTy_51, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"llvm.memory.barrier", mod); // (external, no body) + /*Type=*/FuncTy_51, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"llvm.memory.barrier", mod); // (external, no body) func_llvm_memory_barrier->setCallingConv(CallingConv::C); AttrListPtr func_llvm_memory_barrier_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_llvm_memory_barrier_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_memory_barrier_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL); Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create( - /*Type=*/FuncTy_53, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"llvm.atomic.cmp.swap.i32.p0i32", mod); // (external, no body) + /*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); AttrListPtr func_llvm_atomic_cmp_swap_i32_p0i32_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoCapture; - Attrs.push_back(PAWI); - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_llvm_atomic_cmp_swap_i32_p0i32_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoCapture; + Attrs.push_back(PAWI); + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_llvm_atomic_cmp_swap_i32_p0i32_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL); Function* func__ZN3mvm6Thread5yieldEv = Function::Create( - /*Type=*/FuncTy_28, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) + /*Type=*/FuncTy_28, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body) func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C); AttrListPtr func__ZN3mvm6Thread5yieldEv_PAL; func__ZN3mvm6Thread5yieldEv->setAttributes(func__ZN3mvm6Thread5yieldEv_PAL); // Global Variable Declarations -GlobalVariable* gvar_struct_finalObject87 = new GlobalVariable(/*Module=*/ *mod, +GlobalVariable* gvar_struct_finalObject67 = new GlobalVariable(/*Module=*/*mod, /*Type=*/StructTy_40, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject87"); +/*Name=*/"finalObject67"); -GlobalVariable* gvar_struct_finalObject39 = new GlobalVariable(/*Module=*/ *mod, +GlobalVariable* gvar_struct_finalObject2 = new GlobalVariable(/*Module=*/*mod, /*Type=*/StructTy_44, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject39"); +/*Name=*/"finalObject2"); -GlobalVariable* gvar_struct_finalObject64 = new GlobalVariable(/*Module=*/ *mod, +GlobalVariable* gvar_struct_finalObject32 = new GlobalVariable(/*Module=*/*mod, /*Type=*/StructTy_46, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject64"); +/*Name=*/"finalObject32"); -GlobalVariable* gvar_struct_org_mmtk_utility_DoublyLinkedList_static = new GlobalVariable(/*Module=*/ *mod, +GlobalVariable* gvar_struct_org_mmtk_utility_DoublyLinkedList_static = new GlobalVariable(/*Module=*/*mod, /*Type=*/StructTy_49, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below /*Name=*/"org_mmtk_utility_DoublyLinkedList_static"); -GlobalVariable* gvar_struct_finalObject105 = new GlobalVariable(/*Module=*/ *mod, +GlobalVariable* gvar_struct_finalObject85 = new GlobalVariable(/*Module=*/*mod, /*Type=*/StructTy_40, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject105"); +/*Name=*/"finalObject85"); -GlobalVariable* gvar_struct_finalObject121 = new GlobalVariable(/*Module=*/ *mod, +GlobalVariable* gvar_struct_finalObject101 = new GlobalVariable(/*Module=*/*mod, /*Type=*/StructTy_46, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject121"); +/*Name=*/"finalObject101"); -GlobalVariable* gvar_struct_finalObject142 = new GlobalVariable(/*Module=*/ *mod, +GlobalVariable* gvar_struct_finalObject122 = new GlobalVariable(/*Module=*/*mod, /*Type=*/StructTy_40, /*isConstant=*/false, /*Linkage=*/GlobalValue::ExternalLinkage, /*Initializer=*/0, // has initializer, specified below -/*Name=*/"finalObject142"); +/*Name=*/"finalObject122"); // Constant Definitions ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10)); @@ -689,64 +689,65 @@ ConstantInt* const_int32_76 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10)); ConstantInt* const_int32_77 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); ConstantPointerNull* const_ptr_78 = ConstantPointerNull::get(PointerTy_31); -std::vector const_ptr_79_indices; -const_ptr_79_indices.push_back(const_int32_56); -const_ptr_79_indices.push_back(const_int32_58); -Constant* const_ptr_79 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject87, &const_ptr_79_indices[0], const_ptr_79_indices.size()); -ConstantInt* const_int8_80 = ConstantInt::get(mod->getContext(), APInt(8, StringRef("-4"), 10)); -std::vector const_ptr_81_indices; -const_ptr_81_indices.push_back(const_int32_56); -const_ptr_81_indices.push_back(const_int32_77); -Constant* const_ptr_81 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject39, &const_ptr_81_indices[0], const_ptr_81_indices.size()); +ConstantInt* const_int32_79 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-16"), 10)); +std::vector const_ptr_80_indices; +const_ptr_80_indices.push_back(const_int32_56); +const_ptr_80_indices.push_back(const_int32_58); +Constant* const_ptr_80 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject67, &const_ptr_80_indices[0], const_ptr_80_indices.size()); +ConstantInt* const_int32_81 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-2"), 10)); std::vector const_ptr_82_indices; const_ptr_82_indices.push_back(const_int32_56); const_ptr_82_indices.push_back(const_int32_77); -Constant* const_ptr_82 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject64, &const_ptr_82_indices[0], const_ptr_82_indices.size()); +Constant* const_ptr_82 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject2, &const_ptr_82_indices[0], const_ptr_82_indices.size()); std::vector const_ptr_83_indices; const_ptr_83_indices.push_back(const_int32_56); -const_ptr_83_indices.push_back(const_int32_54); -Constant* const_ptr_83 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject64, &const_ptr_83_indices[0], const_ptr_83_indices.size()); -ConstantInt* const_int32_84 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); -ConstantPointerNull* const_ptr_85 = ConstantPointerNull::get(PointerTy_0); -std::vector const_ptr_86_indices; -const_ptr_86_indices.push_back(const_int32_56); -const_ptr_86_indices.push_back(const_int32_58); -Constant* const_ptr_86 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_86_indices[0], const_ptr_86_indices.size()); -ConstantPointerNull* const_ptr_87 = ConstantPointerNull::get(PointerTy_30); -ConstantInt* const_int32_88 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10)); -ConstantInt* const_int1_89 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10)); -std::vector const_ptr_90_indices; -const_ptr_90_indices.push_back(const_int32_56); -const_ptr_90_indices.push_back(const_int32_58); -Constant* const_ptr_90 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject105, &const_ptr_90_indices[0], const_ptr_90_indices.size()); +const_ptr_83_indices.push_back(const_int32_77); +Constant* const_ptr_83 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_83_indices[0], const_ptr_83_indices.size()); +std::vector const_ptr_84_indices; +const_ptr_84_indices.push_back(const_int32_56); +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()); +ConstantInt* const_int32_85 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10)); +ConstantPointerNull* const_ptr_86 = ConstantPointerNull::get(PointerTy_0); +std::vector const_ptr_87_indices; +const_ptr_87_indices.push_back(const_int32_56); +const_ptr_87_indices.push_back(const_int32_58); +Constant* const_ptr_87 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_87_indices[0], const_ptr_87_indices.size()); +ConstantPointerNull* const_ptr_88 = ConstantPointerNull::get(PointerTy_30); +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_56); -const_ptr_91_indices.push_back(const_int32_77); -Constant* const_ptr_91 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject121, &const_ptr_91_indices[0], const_ptr_91_indices.size()); +const_ptr_91_indices.push_back(const_int32_58); +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_56); -const_ptr_92_indices.push_back(const_int32_54); -Constant* const_ptr_92 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject121, &const_ptr_92_indices[0], const_ptr_92_indices.size()); +const_ptr_92_indices.push_back(const_int32_77); +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_56); -const_ptr_93_indices.push_back(const_int32_58); -Constant* const_ptr_93 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject142, &const_ptr_93_indices[0], const_ptr_93_indices.size()); +const_ptr_93_indices.push_back(const_int32_54); +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_56); +const_ptr_94_indices.push_back(const_int32_58); +Constant* const_ptr_94 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject122, &const_ptr_94_indices[0], const_ptr_94_indices.size()); // Global Variable Definitions Function* func_gcmalloc = Function::Create( - /*Type=*/FuncTy_1, - /*Linkage=*/GlobalValue::ExternalLinkage, - /*Name=*/"gcmalloc", mod); + /*Type=*/FuncTy_1, + /*Linkage=*/GlobalValue::ExternalLinkage, + /*Name=*/"gcmalloc", mod); func_gcmalloc->setCallingConv(CallingConv::C); AttrListPtr func_gcmalloc_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + func_gcmalloc_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } func_gcmalloc->setAttributes(func_gcmalloc_PAL); Function::arg_iterator args = func_gcmalloc->arg_begin(); @@ -835,1057 +836,1076 @@ BasicBlock* label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit = BasicBlock::Create(mod->getContext(), "JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit",func_gcmalloc,0); // Block entry (label_entry) -BinaryOperator* int32_94 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_54, "", label_entry); -BinaryOperator* int32_95 = BinaryOperator::Create(Instruction::And, int32_94, const_int32_55, "", label_entry); -CallInst* ptr_96 = CallInst::Create(func_llvm_frameaddress, const_int32_56, "", label_entry); -ptr_96->setCallingConv(CallingConv::C); -ptr_96->setTailCall(true);AttrListPtr ptr_96_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_96_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -ptr_96->setAttributes(ptr_96_PAL); - -CastInst* int32_97 = new PtrToIntInst(ptr_96, IntegerType::get(mod->getContext(), 32), "", label_entry); -BinaryOperator* int32_98 = BinaryOperator::Create(Instruction::And, int32_97, const_int32_57, "", label_entry); -CastInst* ptr_99 = new IntToPtrInst(int32_98, PointerTy_4, "", label_entry); -std::vector ptr_100_indices; -ptr_100_indices.push_back(const_int32_56); -ptr_100_indices.push_back(const_int32_58); -Instruction* ptr_100 = GetElementPtrInst::Create(ptr_99, ptr_100_indices.begin(), ptr_100_indices.end(), "", label_entry); -LoadInst* int32_101 = new LoadInst(ptr_100, "", false, label_entry); -CastInst* ptr_102 = new IntToPtrInst(int32_101, PointerTy_26, "", label_entry); -ICmpInst* int1_103 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_95, const_int32_59, ""); -SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_103, const_int32_56, const_int32_60, "storemerge.i.i", label_entry); -SwitchInst* void_104 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i1_i, 7, label_entry); -void_104->addCase(const_int32_56, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -void_104->addCase(const_int32_58, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -void_104->addCase(const_int32_54, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -void_104->addCase(const_int32_60, label_tableswitch3_i_i4_i); -void_104->addCase(const_int32_61, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -void_104->addCase(const_int32_62, label_tableswitch5_i_i6_i); +BinaryOperator* int32_95 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_54, "", label_entry); +BinaryOperator* int32_96 = BinaryOperator::Create(Instruction::And, int32_95, const_int32_55, "", label_entry); +CallInst* ptr_97 = CallInst::Create(func_llvm_frameaddress, const_int32_56, "", label_entry); +ptr_97->setCallingConv(CallingConv::C); +ptr_97->setTailCall(true); +AttrListPtr ptr_97_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_97_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +ptr_97->setAttributes(ptr_97_PAL); + +CastInst* int32_98 = new PtrToIntInst(ptr_97, IntegerType::get(mod->getContext(), 32), "", label_entry); +BinaryOperator* int32_99 = BinaryOperator::Create(Instruction::And, int32_98, const_int32_57, "", label_entry); +CastInst* ptr_100 = new IntToPtrInst(int32_99, PointerTy_4, "", label_entry); +std::vector ptr_101_indices; +ptr_101_indices.push_back(const_int32_56); +ptr_101_indices.push_back(const_int32_58); +Instruction* ptr_101 = GetElementPtrInst::Create(ptr_100, ptr_101_indices.begin(), ptr_101_indices.end(), "", label_entry); +LoadInst* int32_102 = new LoadInst(ptr_101, "", false, label_entry); +CastInst* ptr_103 = new IntToPtrInst(int32_102, PointerTy_26, "", label_entry); +ICmpInst* int1_104 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_96, const_int32_59, ""); +SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_104, const_int32_56, const_int32_60, "storemerge.i.i", label_entry); +SwitchInst* void_105 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i1_i, 7, label_entry); +void_105->addCase(const_int32_56, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +void_105->addCase(const_int32_58, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +void_105->addCase(const_int32_54, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +void_105->addCase(const_int32_60, label_tableswitch3_i_i4_i); +void_105->addCase(const_int32_61, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +void_105->addCase(const_int32_62, label_tableswitch5_i_i6_i); // Block tableswitch.i.i1.i (label_tableswitch_i_i1_i) -CallInst* void_105 = CallInst::Create(func_abort, "", label_tableswitch_i_i1_i); -void_105->setCallingConv(CallingConv::C); -void_105->setTailCall(true);AttrListPtr void_105_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_105_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +CallInst* void_106 = CallInst::Create(func_abort, "", label_tableswitch_i_i1_i); +void_106->setCallingConv(CallingConv::C); +void_106->setTailCall(true); +AttrListPtr void_106_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_106_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -void_105->setAttributes(void_105_PAL); +void_106->setAttributes(void_106_PAL); new UnreachableInst(mod->getContext(), label_tableswitch_i_i1_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i) -GetElementPtrInst* ptr_107 = GetElementPtrInst::Create(ptr_102, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -CastInst* ptr_108 = new BitCastInst(ptr_107, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -LoadInst* ptr_109 = new LoadInst(ptr_108, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -BinaryOperator* int32_110 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); -ICmpInst* int1_111 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_111, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +GetElementPtrInst* ptr_108 = GetElementPtrInst::Create(ptr_103, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +CastInst* ptr_109 = new BitCastInst(ptr_108, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +LoadInst* ptr_110 = new LoadInst(ptr_109, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +BinaryOperator* int32_111 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); +ICmpInst* int1_112 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_112, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i); // Block GOTO or IF*4.i.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i_i) -ICmpInst* int1_113 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_113, label_GOTO_or_IF_4_i_i_i_i_i_i); +ICmpInst* int1_114 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_114, label_GOTO_or_IF_4_i_i_i_i_i_i); // Block GOTO or IF*6.i.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i_i) -ICmpInst* int1_115 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_115, label_GOTO_or_IF_6_i_i_i_i_i_i); +ICmpInst* int1_116 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_116, label_GOTO_or_IF_6_i_i_i_i_i_i); // Block GOTO or IF*7.i.i1.i.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i_i) -ICmpInst* int1_117 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_117, label_GOTO_or_IF_7_i_i1_i_i_i_i); +ICmpInst* int1_118 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_118, label_GOTO_or_IF_7_i_i1_i_i_i_i); // Block GOTO or IF*8.i.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i_i) -ICmpInst* int1_119 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_110, const_int32_68, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_119, label_GOTO_or_IF_8_i_i_i_i_i_i); +ICmpInst* int1_120 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_68, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_120, label_GOTO_or_IF_8_i_i_i_i_i_i); // Block GOTO or IF*9.i.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i_i) -BinaryOperator* int32_121 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i_i); -BinaryOperator* int32_122 = BinaryOperator::Create(Instruction::Add, int32_121, const_int32_70, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BinaryOperator* int32_122 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i_i); +BinaryOperator* int32_123 = BinaryOperator::Create(Instruction::Add, int32_122, const_int32_70, "", label_GOTO_or_IF_9_i_i_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i_i); // Block false IF_ICMPGT16.i.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i_i) -BinaryOperator* int32_124 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i_i_i_i); +BinaryOperator* int32_125 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i); // Block false IF_ICMPGT17.i.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i_i) -BinaryOperator* int32_126 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); -BinaryOperator* int32_127 = BinaryOperator::Create(Instruction::Add, int32_126, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BinaryOperator* int32_127 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); +BinaryOperator* int32_128 = BinaryOperator::Create(Instruction::Add, int32_127, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i); // Block false IF_ICMPGT18.i.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i_i) -BinaryOperator* int32_129 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); -BinaryOperator* int32_130 = BinaryOperator::Create(Instruction::Add, int32_129, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BinaryOperator* int32_130 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); +BinaryOperator* int32_131 = BinaryOperator::Create(Instruction::Add, int32_130, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i); // Block false IF_ICMPGT19.i.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i_i) -BinaryOperator* int32_132 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); -BinaryOperator* int32_133 = BinaryOperator::Create(Instruction::Add, int32_132, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BinaryOperator* int32_133 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); +BinaryOperator* int32_134 = BinaryOperator::Create(Instruction::Add, int32_133, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i); // Block false IF_ICMPGT20.i.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i_i) -BinaryOperator* int32_135 = BinaryOperator::Create(Instruction::AShr, int32_110, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); -BinaryOperator* int32_136 = BinaryOperator::Create(Instruction::Add, int32_135, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BinaryOperator* int32_136 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); +BinaryOperator* int32_137 = BinaryOperator::Create(Instruction::Add, int32_136, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i); // Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i) -PHINode* int32_138 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -int32_138->reserveOperandSpace(6); -int32_138->addIncoming(int32_124, label_false_IF_ICMPGT16_i_i_i_i_i_i); -int32_138->addIncoming(int32_127, label_false_IF_ICMPGT17_i_i_i_i_i_i); -int32_138->addIncoming(int32_130, label_false_IF_ICMPGT18_i_i_i_i_i_i); -int32_138->addIncoming(int32_133, label_false_IF_ICMPGT19_i_i_i_i_i_i); -int32_138->addIncoming(int32_136, label_false_IF_ICMPGT20_i_i_i_i_i_i); -int32_138->addIncoming(int32_122, label_GOTO_or_IF_9_i_i_i_i_i_i); - -std::vector ptr_139_indices; -ptr_139_indices.push_back(const_int32_77); -ptr_139_indices.push_back(const_int32_77); -Instruction* ptr_139 = GetElementPtrInst::Create(ptr_109, ptr_139_indices.begin(), ptr_139_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -LoadInst* ptr_140 = new LoadInst(ptr_139, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -BinaryOperator* int32_141 = BinaryOperator::Create(Instruction::Add, int32_138, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -CastInst* ptr_142 = new BitCastInst(ptr_140, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -GetElementPtrInst* ptr_143 = GetElementPtrInst::Create(ptr_142, int32_141, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -LoadInst* int32_144 = new LoadInst(ptr_143, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -CastInst* ptr_145 = new IntToPtrInst(int32_144, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); -ICmpInst* int1_146 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_144, const_int32_56, ""); -BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_146, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +PHINode* int32_139 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +int32_139->reserveOperandSpace(6); +int32_139->addIncoming(int32_125, label_false_IF_ICMPGT16_i_i_i_i_i_i); +int32_139->addIncoming(int32_128, label_false_IF_ICMPGT17_i_i_i_i_i_i); +int32_139->addIncoming(int32_131, label_false_IF_ICMPGT18_i_i_i_i_i_i); +int32_139->addIncoming(int32_134, label_false_IF_ICMPGT19_i_i_i_i_i_i); +int32_139->addIncoming(int32_137, label_false_IF_ICMPGT20_i_i_i_i_i_i); +int32_139->addIncoming(int32_123, label_GOTO_or_IF_9_i_i_i_i_i_i); + +std::vector ptr_140_indices; +ptr_140_indices.push_back(const_int32_77); +ptr_140_indices.push_back(const_int32_77); +Instruction* ptr_140 = GetElementPtrInst::Create(ptr_110, ptr_140_indices.begin(), ptr_140_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* ptr_141 = new LoadInst(ptr_140, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +BinaryOperator* int32_142 = BinaryOperator::Create(Instruction::Add, int32_139, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_143 = new BitCastInst(ptr_141, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +GetElementPtrInst* ptr_144 = GetElementPtrInst::Create(ptr_143, int32_142, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +LoadInst* int32_145 = new LoadInst(ptr_144, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +CastInst* ptr_146 = new IntToPtrInst(int32_145, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); +ICmpInst* int1_147 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_145, const_int32_56, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_147, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i); // Block GOTO or IF*.i.i.i.i (label_GOTO_or_IF__i_i_i_i) -std::vector ptr_148_params; -ptr_148_params.push_back(ptr_109); -ptr_148_params.push_back(int32_95); -ptr_148_params.push_back(const_int32_56); -ptr_148_params.push_back(const_int32_56); -CallInst* ptr_148 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_148_params.begin(), ptr_148_params.end(), "", label_GOTO_or_IF__i_i_i_i); -ptr_148->setCallingConv(CallingConv::C); -ptr_148->setTailCall(true);AttrListPtr ptr_148_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_148_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +std::vector ptr_149_params; +ptr_149_params.push_back(ptr_110); +ptr_149_params.push_back(int32_96); +ptr_149_params.push_back(const_int32_56); +ptr_149_params.push_back(const_int32_56); +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_i); +ptr_149->setCallingConv(CallingConv::C); +ptr_149->setTailCall(true); +AttrListPtr ptr_149_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_149_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -ptr_148->setAttributes(ptr_148_PAL); +ptr_149->setAttributes(ptr_149_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i_i_i_i); // Block false IFNE.i.i.i.i (label_false_IFNE_i_i_i_i) -CastInst* ptr_150 = new IntToPtrInst(int32_144, PointerTy_29, "", label_false_IFNE_i_i_i_i); -LoadInst* ptr_151 = new LoadInst(ptr_150, "", false, label_false_IFNE_i_i_i_i); -CastInst* int32_152 = new PtrToIntInst(ptr_151, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i); - new StoreInst(int32_152, ptr_143, false, label_false_IFNE_i_i_i_i); -std::vector ptr_154_indices; -ptr_154_indices.push_back(const_int32_56); -ptr_154_indices.push_back(const_int32_56); -Instruction* ptr_154 = GetElementPtrInst::Create(ptr_145, ptr_154_indices.begin(), ptr_154_indices.end(), "", label_false_IFNE_i_i_i_i); - new StoreInst(const_ptr_78, ptr_154, false, label_false_IFNE_i_i_i_i); +CastInst* ptr_151 = new IntToPtrInst(int32_145, PointerTy_29, "", label_false_IFNE_i_i_i_i); +LoadInst* ptr_152 = new LoadInst(ptr_151, "", false, label_false_IFNE_i_i_i_i); +CastInst* int32_153 = new PtrToIntInst(ptr_152, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i); + new StoreInst(int32_153, ptr_144, false, label_false_IFNE_i_i_i_i); +std::vector ptr_155_indices; +ptr_155_indices.push_back(const_int32_56); +ptr_155_indices.push_back(const_int32_56); +Instruction* ptr_155 = GetElementPtrInst::Create(ptr_146, ptr_155_indices.begin(), ptr_155_indices.end(), "", label_false_IFNE_i_i_i_i); + new StoreInst(const_ptr_78, ptr_155, false, label_false_IFNE_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFNE_i_i_i_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i) -GetElementPtrInst* ptr_157 = GetElementPtrInst::Create(ptr_102, const_int32_58, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_158 = new BitCastInst(ptr_157, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -LoadInst* ptr_159 = new LoadInst(ptr_158, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -GetElementPtrInst* ptr_160 = GetElementPtrInst::Create(ptr_159, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_161 = new BitCastInst(ptr_160, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_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_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_i); -BinaryOperator* int32_164 = BinaryOperator::Create(Instruction::Add, int32_163, int32_95, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_165 = new IntToPtrInst(int32_164, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -std::vector ptr_166_indices; -ptr_166_indices.push_back(const_int32_77); -ptr_166_indices.push_back(const_int32_77); -Instruction* ptr_166 = GetElementPtrInst::Create(ptr_159, ptr_166_indices.begin(), ptr_166_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -LoadInst* ptr_167 = new LoadInst(ptr_166, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -CastInst* ptr_168 = new BitCastInst(ptr_167, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); -ICmpInst* int1_169 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_165, ptr_168, ""); -BranchInst::Create(label_false_IFEQ_i_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i, int1_169, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +GetElementPtrInst* ptr_158 = GetElementPtrInst::Create(ptr_103, const_int32_58, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_159 = new BitCastInst(ptr_158, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_160 = new LoadInst(ptr_159, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +GetElementPtrInst* ptr_161 = GetElementPtrInst::Create(ptr_160, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_162 = new BitCastInst(ptr_161, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_163 = new LoadInst(ptr_162, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* int32_164 = new PtrToIntInst(ptr_163, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +BinaryOperator* int32_165 = BinaryOperator::Create(Instruction::Add, int32_164, int32_96, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_166 = new IntToPtrInst(int32_165, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +std::vector ptr_167_indices; +ptr_167_indices.push_back(const_int32_77); +ptr_167_indices.push_back(const_int32_77); +Instruction* ptr_167 = GetElementPtrInst::Create(ptr_160, ptr_167_indices.begin(), ptr_167_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +LoadInst* ptr_168 = new LoadInst(ptr_167, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +CastInst* ptr_169 = new BitCastInst(ptr_168, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); +ICmpInst* int1_170 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_166, ptr_169, ""); +BranchInst::Create(label_false_IFEQ_i_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i, int1_170, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i) -std::vector ptr_171_indices; -ptr_171_indices.push_back(const_int32_77); -ptr_171_indices.push_back(const_int32_56); -Instruction* ptr_171 = GetElementPtrInst::Create(ptr_159, ptr_171_indices.begin(), ptr_171_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); -CastInst* ptr__c_i_i_i_i = new IntToPtrInst(int32_164, PointerTy_31, ".c.i.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); - new StoreInst(ptr__c_i_i_i_i, ptr_171, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); +std::vector ptr_172_indices; +ptr_172_indices.push_back(const_int32_77); +ptr_172_indices.push_back(const_int32_56); +Instruction* ptr_172 = GetElementPtrInst::Create(ptr_160, ptr_172_indices.begin(), ptr_172_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); +CastInst* ptr__c_i_i_i_i = new IntToPtrInst(int32_165, PointerTy_31, ".c.i.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); + new StoreInst(ptr__c_i_i_i_i, ptr_172, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); // Block false IFEQ.i.i.i.i (label_false_IFEQ_i_i_i_i) -std::vector ptr_174_params; -ptr_174_params.push_back(ptr_159); -ptr_174_params.push_back(ptr_162); -ptr_174_params.push_back(ptr_165); -ptr_174_params.push_back(const_int32_56); -ptr_174_params.push_back(const_int32_56); -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_i); -ptr_174->setCallingConv(CallingConv::C); -ptr_174->setTailCall(true);AttrListPtr ptr_174_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_174_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +std::vector ptr_175_params; +ptr_175_params.push_back(ptr_160); +ptr_175_params.push_back(ptr_163); +ptr_175_params.push_back(ptr_166); +ptr_175_params.push_back(const_int32_56); +ptr_175_params.push_back(const_int32_56); +CallInst* ptr_175 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_175_params.begin(), ptr_175_params.end(), "", label_false_IFEQ_i_i_i_i); +ptr_175->setCallingConv(CallingConv::C); +ptr_175->setTailCall(true); +AttrListPtr ptr_175_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_175_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -ptr_174->setAttributes(ptr_174_PAL); +ptr_175->setAttributes(ptr_175_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFEQ_i_i_i_i); // Block tableswitch3.i.i4.i (label_tableswitch3_i_i4_i) -std::vector ptr_176_indices; -ptr_176_indices.push_back(const_int32_58); -ptr_176_indices.push_back(const_int32_77); -Instruction* ptr_176 = GetElementPtrInst::Create(ptr_102, ptr_176_indices.begin(), ptr_176_indices.end(), "", label_tableswitch3_i_i4_i); -CastInst* ptr_177 = new BitCastInst(ptr_176, PointerTy_32, "", label_tableswitch3_i_i4_i); -LoadInst* ptr_178 = new LoadInst(ptr_177, "", false, label_tableswitch3_i_i4_i); -CastInst* ptr_179 = new BitCastInst(ptr_178, PointerTy_30, "", label_tableswitch3_i_i4_i); -std::vector ptr_180_params; -ptr_180_params.push_back(ptr_179); -ptr_180_params.push_back(int32_95); -ptr_180_params.push_back(const_int32_56); -ptr_180_params.push_back(const_int32_56); -CallInst* ptr_180 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_180_params.begin(), ptr_180_params.end(), "", label_tableswitch3_i_i4_i); -ptr_180->setCallingConv(CallingConv::C); -ptr_180->setTailCall(true);AttrListPtr ptr_180_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_180_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +std::vector ptr_177_indices; +ptr_177_indices.push_back(const_int32_58); +ptr_177_indices.push_back(const_int32_77); +Instruction* ptr_177 = GetElementPtrInst::Create(ptr_103, ptr_177_indices.begin(), ptr_177_indices.end(), "", label_tableswitch3_i_i4_i); +CastInst* ptr_178 = new BitCastInst(ptr_177, PointerTy_32, "", label_tableswitch3_i_i4_i); +LoadInst* ptr_179 = new LoadInst(ptr_178, "", false, label_tableswitch3_i_i4_i); +CastInst* ptr_180 = new BitCastInst(ptr_179, PointerTy_30, "", label_tableswitch3_i_i4_i); +std::vector ptr_181_params; +ptr_181_params.push_back(ptr_180); +ptr_181_params.push_back(int32_96); +ptr_181_params.push_back(const_int32_56); +ptr_181_params.push_back(const_int32_56); +CallInst* ptr_181 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_181_params.begin(), ptr_181_params.end(), "", label_tableswitch3_i_i4_i); +ptr_181->setCallingConv(CallingConv::C); +ptr_181->setTailCall(true); +AttrListPtr ptr_181_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_181_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -ptr_180->setAttributes(ptr_180_PAL); +ptr_181->setAttributes(ptr_181_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_tableswitch3_i_i4_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i) -GetElementPtrInst* ptr_182 = GetElementPtrInst::Create(ptr_102, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -CastInst* ptr_183 = new BitCastInst(ptr_182, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -LoadInst* ptr_184 = new LoadInst(ptr_183, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -BinaryOperator* int32_185 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); -ICmpInst* int1_186 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_186, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +GetElementPtrInst* ptr_183 = GetElementPtrInst::Create(ptr_103, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +CastInst* ptr_184 = new BitCastInst(ptr_183, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +LoadInst* ptr_185 = new LoadInst(ptr_184, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +BinaryOperator* int32_186 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); +ICmpInst* int1_187 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_187, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i); // Block GOTO or IF*4.i.i.i6.i.i.i (label_GOTO_or_IF_4_i_i_i6_i_i_i) -ICmpInst* int1_188 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_188, label_GOTO_or_IF_4_i_i_i6_i_i_i); +ICmpInst* int1_189 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_189, label_GOTO_or_IF_4_i_i_i6_i_i_i); // Block GOTO or IF*6.i.i.i7.i.i.i (label_GOTO_or_IF_6_i_i_i7_i_i_i) -ICmpInst* int1_190 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_190, label_GOTO_or_IF_6_i_i_i7_i_i_i); +ICmpInst* int1_191 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_191, label_GOTO_or_IF_6_i_i_i7_i_i_i); // Block GOTO or IF*7.i.i1.i8.i.i.i (label_GOTO_or_IF_7_i_i1_i8_i_i_i) -ICmpInst* int1_192 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_192, label_GOTO_or_IF_7_i_i1_i8_i_i_i); +ICmpInst* int1_193 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_193, label_GOTO_or_IF_7_i_i1_i8_i_i_i); // Block GOTO or IF*8.i.i.i9.i.i.i (label_GOTO_or_IF_8_i_i_i9_i_i_i) -ICmpInst* int1_194 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_185, const_int32_68, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_194, label_GOTO_or_IF_8_i_i_i9_i_i_i); +ICmpInst* int1_195 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_68, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_195, label_GOTO_or_IF_8_i_i_i9_i_i_i); // Block GOTO or IF*9.i.i.i10.i.i.i (label_GOTO_or_IF_9_i_i_i10_i_i_i) -BinaryOperator* int32_196 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_69, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); -BinaryOperator* int32_197 = BinaryOperator::Create(Instruction::Add, int32_196, const_int32_70, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BinaryOperator* int32_197 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_69, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); +BinaryOperator* int32_198 = BinaryOperator::Create(Instruction::Add, int32_197, const_int32_70, "", label_GOTO_or_IF_9_i_i_i10_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_GOTO_or_IF_9_i_i_i10_i_i_i); // Block false IF_ICMPGT16.i.i.i11.i.i.i (label_false_IF_ICMPGT16_i_i_i11_i_i_i) -BinaryOperator* int32_199 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i11_i_i_i); +BinaryOperator* int32_200 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i11_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i); // Block false IF_ICMPGT17.i.i.i12.i.i.i (label_false_IF_ICMPGT17_i_i_i12_i_i_i) -BinaryOperator* int32_201 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); -BinaryOperator* int32_202 = BinaryOperator::Create(Instruction::Add, int32_201, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BinaryOperator* int32_202 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); +BinaryOperator* int32_203 = BinaryOperator::Create(Instruction::Add, int32_202, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i); // Block false IF_ICMPGT18.i.i.i13.i.i.i (label_false_IF_ICMPGT18_i_i_i13_i_i_i) -BinaryOperator* int32_204 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); -BinaryOperator* int32_205 = BinaryOperator::Create(Instruction::Add, int32_204, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BinaryOperator* int32_205 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); +BinaryOperator* int32_206 = BinaryOperator::Create(Instruction::Add, int32_205, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i); // Block false IF_ICMPGT19.i.i.i14.i.i.i (label_false_IF_ICMPGT19_i_i_i14_i_i_i) -BinaryOperator* int32_207 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); -BinaryOperator* int32_208 = BinaryOperator::Create(Instruction::Add, int32_207, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BinaryOperator* int32_208 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); +BinaryOperator* int32_209 = BinaryOperator::Create(Instruction::Add, int32_208, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i); // Block false IF_ICMPGT20.i.i.i15.i.i.i (label_false_IF_ICMPGT20_i_i_i15_i_i_i) -BinaryOperator* int32_210 = BinaryOperator::Create(Instruction::AShr, int32_185, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); -BinaryOperator* int32_211 = BinaryOperator::Create(Instruction::Add, int32_210, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BinaryOperator* int32_211 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); +BinaryOperator* int32_212 = BinaryOperator::Create(Instruction::Add, int32_211, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i); // Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i) -PHINode* int32_213 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -int32_213->reserveOperandSpace(6); -int32_213->addIncoming(int32_199, label_false_IF_ICMPGT16_i_i_i11_i_i_i); -int32_213->addIncoming(int32_202, label_false_IF_ICMPGT17_i_i_i12_i_i_i); -int32_213->addIncoming(int32_205, label_false_IF_ICMPGT18_i_i_i13_i_i_i); -int32_213->addIncoming(int32_208, label_false_IF_ICMPGT19_i_i_i14_i_i_i); -int32_213->addIncoming(int32_211, label_false_IF_ICMPGT20_i_i_i15_i_i_i); -int32_213->addIncoming(int32_197, label_GOTO_or_IF_9_i_i_i10_i_i_i); - -std::vector ptr_214_indices; -ptr_214_indices.push_back(const_int32_77); -ptr_214_indices.push_back(const_int32_77); -Instruction* ptr_214 = GetElementPtrInst::Create(ptr_184, ptr_214_indices.begin(), ptr_214_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -LoadInst* ptr_215 = new LoadInst(ptr_214, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -BinaryOperator* int32_216 = BinaryOperator::Create(Instruction::Add, int32_213, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -CastInst* ptr_217 = new BitCastInst(ptr_215, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -GetElementPtrInst* ptr_218 = GetElementPtrInst::Create(ptr_217, int32_216, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -LoadInst* int32_219 = new LoadInst(ptr_218, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -CastInst* ptr_220 = new IntToPtrInst(int32_219, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); -ICmpInst* int1_221 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_219, const_int32_56, ""); -BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_221, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +PHINode* int32_214 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +int32_214->reserveOperandSpace(6); +int32_214->addIncoming(int32_200, label_false_IF_ICMPGT16_i_i_i11_i_i_i); +int32_214->addIncoming(int32_203, label_false_IF_ICMPGT17_i_i_i12_i_i_i); +int32_214->addIncoming(int32_206, label_false_IF_ICMPGT18_i_i_i13_i_i_i); +int32_214->addIncoming(int32_209, label_false_IF_ICMPGT19_i_i_i14_i_i_i); +int32_214->addIncoming(int32_212, label_false_IF_ICMPGT20_i_i_i15_i_i_i); +int32_214->addIncoming(int32_198, label_GOTO_or_IF_9_i_i_i10_i_i_i); + +std::vector ptr_215_indices; +ptr_215_indices.push_back(const_int32_77); +ptr_215_indices.push_back(const_int32_77); +Instruction* ptr_215 = GetElementPtrInst::Create(ptr_185, ptr_215_indices.begin(), ptr_215_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* ptr_216 = new LoadInst(ptr_215, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +BinaryOperator* int32_217 = BinaryOperator::Create(Instruction::Add, int32_214, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_218 = new BitCastInst(ptr_216, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +GetElementPtrInst* ptr_219 = GetElementPtrInst::Create(ptr_218, int32_217, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +LoadInst* int32_220 = new LoadInst(ptr_219, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +CastInst* ptr_221 = new IntToPtrInst(int32_220, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); +ICmpInst* int1_222 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_220, const_int32_56, ""); +BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_222, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i); // Block GOTO or IF*.i17.i.i.i (label_GOTO_or_IF__i17_i_i_i) -std::vector ptr_223_params; -ptr_223_params.push_back(ptr_184); -ptr_223_params.push_back(int32_95); -ptr_223_params.push_back(const_int32_56); -ptr_223_params.push_back(const_int32_56); -CallInst* ptr_223 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_223_params.begin(), ptr_223_params.end(), "", label_GOTO_or_IF__i17_i_i_i); -ptr_223->setCallingConv(CallingConv::C); -ptr_223->setTailCall(true);AttrListPtr ptr_223_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_223_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +std::vector ptr_224_params; +ptr_224_params.push_back(ptr_185); +ptr_224_params.push_back(int32_96); +ptr_224_params.push_back(const_int32_56); +ptr_224_params.push_back(const_int32_56); +CallInst* ptr_224 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_224_params.begin(), ptr_224_params.end(), "", label_GOTO_or_IF__i17_i_i_i); +ptr_224->setCallingConv(CallingConv::C); +ptr_224->setTailCall(true); +AttrListPtr ptr_224_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_224_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -ptr_223->setAttributes(ptr_223_PAL); +ptr_224->setAttributes(ptr_224_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i17_i_i_i); // Block false IFNE.i21.i.i.i (label_false_IFNE_i21_i_i_i) -CastInst* ptr_225 = new IntToPtrInst(int32_219, PointerTy_29, "", label_false_IFNE_i21_i_i_i); -LoadInst* ptr_226 = new LoadInst(ptr_225, "", false, label_false_IFNE_i21_i_i_i); -CastInst* int32_227 = new PtrToIntInst(ptr_226, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i); - new StoreInst(int32_227, ptr_218, false, label_false_IFNE_i21_i_i_i); -std::vector ptr_229_indices; -ptr_229_indices.push_back(const_int32_56); -ptr_229_indices.push_back(const_int32_56); -Instruction* ptr_229 = GetElementPtrInst::Create(ptr_220, ptr_229_indices.begin(), ptr_229_indices.end(), "", label_false_IFNE_i21_i_i_i); - new StoreInst(const_ptr_78, ptr_229, false, label_false_IFNE_i21_i_i_i); +CastInst* ptr_226 = new IntToPtrInst(int32_220, PointerTy_29, "", label_false_IFNE_i21_i_i_i); +LoadInst* ptr_227 = new LoadInst(ptr_226, "", false, label_false_IFNE_i21_i_i_i); +CastInst* int32_228 = new PtrToIntInst(ptr_227, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i); + new StoreInst(int32_228, ptr_219, false, label_false_IFNE_i21_i_i_i); +std::vector ptr_230_indices; +ptr_230_indices.push_back(const_int32_56); +ptr_230_indices.push_back(const_int32_56); +Instruction* ptr_230 = GetElementPtrInst::Create(ptr_221, ptr_230_indices.begin(), ptr_230_indices.end(), "", label_false_IFNE_i21_i_i_i); + new StoreInst(const_ptr_78, ptr_230, false, label_false_IFNE_i21_i_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFNE_i21_i_i_i); // Block tableswitch5.i.i6.i (label_tableswitch5_i_i6_i) -std::vector ptr_232_indices; -ptr_232_indices.push_back(const_int32_54); -ptr_232_indices.push_back(const_int32_77); -Instruction* ptr_232 = GetElementPtrInst::Create(ptr_102, ptr_232_indices.begin(), ptr_232_indices.end(), "", label_tableswitch5_i_i6_i); -CastInst* ptr_233 = new BitCastInst(ptr_232, PointerTy_32, "", label_tableswitch5_i_i6_i); -LoadInst* ptr_234 = new LoadInst(ptr_233, "", false, label_tableswitch5_i_i6_i); -CastInst* ptr_235 = new BitCastInst(ptr_234, PointerTy_30, "", label_tableswitch5_i_i6_i); -std::vector ptr_236_params; -ptr_236_params.push_back(ptr_235); -ptr_236_params.push_back(int32_95); -ptr_236_params.push_back(const_int32_56); -ptr_236_params.push_back(const_int32_56); -CallInst* ptr_236 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_236_params.begin(), ptr_236_params.end(), "", label_tableswitch5_i_i6_i); -ptr_236->setCallingConv(CallingConv::C); -ptr_236->setTailCall(true);AttrListPtr ptr_236_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_236_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +std::vector ptr_233_indices; +ptr_233_indices.push_back(const_int32_54); +ptr_233_indices.push_back(const_int32_77); +Instruction* ptr_233 = GetElementPtrInst::Create(ptr_103, ptr_233_indices.begin(), ptr_233_indices.end(), "", label_tableswitch5_i_i6_i); +CastInst* ptr_234 = new BitCastInst(ptr_233, PointerTy_32, "", label_tableswitch5_i_i6_i); +LoadInst* ptr_235 = new LoadInst(ptr_234, "", false, label_tableswitch5_i_i6_i); +CastInst* ptr_236 = new BitCastInst(ptr_235, PointerTy_30, "", label_tableswitch5_i_i6_i); +std::vector ptr_237_params; +ptr_237_params.push_back(ptr_236); +ptr_237_params.push_back(int32_96); +ptr_237_params.push_back(const_int32_56); +ptr_237_params.push_back(const_int32_56); +CallInst* ptr_237 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_237_params.begin(), ptr_237_params.end(), "", label_tableswitch5_i_i6_i); +ptr_237->setCallingConv(CallingConv::C); +ptr_237->setTailCall(true); +AttrListPtr ptr_237_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_237_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -ptr_236->setAttributes(ptr_236_PAL); +ptr_237->setAttributes(ptr_237_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_tableswitch5_i_i6_i); // Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i) -std::vector ptr_238_indices; -ptr_238_indices.push_back(const_int32_60); -ptr_238_indices.push_back(const_int32_77); -Instruction* ptr_238 = GetElementPtrInst::Create(ptr_102, ptr_238_indices.begin(), ptr_238_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -CastInst* ptr_239 = new BitCastInst(ptr_238, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -LoadInst* ptr_240 = new LoadInst(ptr_239, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -CastInst* ptr_241 = new BitCastInst(ptr_240, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -BinaryOperator* int32_242 = BinaryOperator::Create(Instruction::Add, int32_95, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); -ICmpInst* int1_243 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_64, ""); -BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_243, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +std::vector ptr_239_indices; +ptr_239_indices.push_back(const_int32_60); +ptr_239_indices.push_back(const_int32_77); +Instruction* ptr_239 = GetElementPtrInst::Create(ptr_103, ptr_239_indices.begin(), ptr_239_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_240 = new BitCastInst(ptr_239, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +LoadInst* ptr_241 = new LoadInst(ptr_240, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +CastInst* ptr_242 = new BitCastInst(ptr_241, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +BinaryOperator* int32_243 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i); +ICmpInst* int1_244 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_64, ""); +BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_244, 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_245 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_65, ""); -BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_245, label_GOTO_or_IF_4_i_i_i_i_i); +ICmpInst* int1_246 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_65, ""); +BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_246, 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_247 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_66, ""); -BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_247, label_GOTO_or_IF_6_i_i_i_i_i); +ICmpInst* int1_248 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_66, ""); +BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_248, 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_249 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_67, ""); -BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_249, label_GOTO_or_IF_7_i_i1_i_i_i); +ICmpInst* int1_250 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_67, ""); +BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_250, 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_251 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_242, const_int32_68, ""); -BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_251, label_GOTO_or_IF_8_i_i_i_i_i); +ICmpInst* int1_252 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_68, ""); +BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_252, 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_253 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i); -BinaryOperator* int32_254 = BinaryOperator::Create(Instruction::Add, int32_253, const_int32_70, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_254 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i); +BinaryOperator* int32_255 = BinaryOperator::Create(Instruction::Add, int32_254, const_int32_70, "", 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_256 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i_i_i); +BinaryOperator* int32_257 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_58, "", 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_258 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i); -BinaryOperator* int32_259 = BinaryOperator::Create(Instruction::Add, int32_258, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_259 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i); +BinaryOperator* int32_260 = BinaryOperator::Create(Instruction::Add, int32_259, const_int32_71, "", 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_261 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i); -BinaryOperator* int32_262 = BinaryOperator::Create(Instruction::Add, int32_261, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_262 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i); +BinaryOperator* int32_263 = BinaryOperator::Create(Instruction::Add, int32_262, const_int32_73, "", 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_264 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i); -BinaryOperator* int32_265 = BinaryOperator::Create(Instruction::Add, int32_264, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_265 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i); +BinaryOperator* int32_266 = BinaryOperator::Create(Instruction::Add, int32_265, const_int32_75, "", 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_267 = BinaryOperator::Create(Instruction::AShr, int32_242, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i); -BinaryOperator* int32_268 = BinaryOperator::Create(Instruction::Add, int32_267, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_268 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i); +BinaryOperator* int32_269 = BinaryOperator::Create(Instruction::Add, int32_268, const_int32_76, "", 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_270 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -int32_270->reserveOperandSpace(6); -int32_270->addIncoming(int32_256, label_false_IF_ICMPGT16_i_i_i_i_i); -int32_270->addIncoming(int32_259, label_false_IF_ICMPGT17_i_i_i_i_i); -int32_270->addIncoming(int32_262, label_false_IF_ICMPGT18_i_i_i_i_i); -int32_270->addIncoming(int32_265, label_false_IF_ICMPGT19_i_i_i_i_i); -int32_270->addIncoming(int32_268, label_false_IF_ICMPGT20_i_i_i_i_i); -int32_270->addIncoming(int32_254, label_GOTO_or_IF_9_i_i_i_i_i); - -GetElementPtrInst* ptr_271 = GetElementPtrInst::Create(ptr_240, const_int32_71, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -CastInst* ptr_272 = new BitCastInst(ptr_271, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -LoadInst* ptr_273 = new LoadInst(ptr_272, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -BinaryOperator* int32_274 = BinaryOperator::Create(Instruction::Add, int32_270, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -CastInst* ptr_275 = new BitCastInst(ptr_273, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -GetElementPtrInst* ptr_276 = GetElementPtrInst::Create(ptr_275, int32_274, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -LoadInst* int32_277 = new LoadInst(ptr_276, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -CastInst* ptr_278 = new IntToPtrInst(int32_277, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); -ICmpInst* int1_279 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_277, const_int32_56, ""); -BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_279, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +PHINode* int32_271 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +int32_271->reserveOperandSpace(6); +int32_271->addIncoming(int32_257, label_false_IF_ICMPGT16_i_i_i_i_i); +int32_271->addIncoming(int32_260, label_false_IF_ICMPGT17_i_i_i_i_i); +int32_271->addIncoming(int32_263, label_false_IF_ICMPGT18_i_i_i_i_i); +int32_271->addIncoming(int32_266, label_false_IF_ICMPGT19_i_i_i_i_i); +int32_271->addIncoming(int32_269, label_false_IF_ICMPGT20_i_i_i_i_i); +int32_271->addIncoming(int32_255, label_GOTO_or_IF_9_i_i_i_i_i); + +GetElementPtrInst* ptr_272 = GetElementPtrInst::Create(ptr_241, const_int32_71, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_273 = new BitCastInst(ptr_272, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* ptr_274 = new LoadInst(ptr_273, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +BinaryOperator* int32_275 = BinaryOperator::Create(Instruction::Add, int32_271, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_276 = new BitCastInst(ptr_274, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +GetElementPtrInst* ptr_277 = GetElementPtrInst::Create(ptr_276, int32_275, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +LoadInst* int32_278 = new LoadInst(ptr_277, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +CastInst* ptr_279 = new IntToPtrInst(int32_278, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i); +ICmpInst* int1_280 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_278, const_int32_56, ""); +BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_280, 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_281_params; -ptr_281_params.push_back(ptr_241); -ptr_281_params.push_back(int32_95); -ptr_281_params.push_back(const_int32_56); -ptr_281_params.push_back(const_int32_56); -CallInst* ptr_281 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_281_params.begin(), ptr_281_params.end(), "", label_GOTO_or_IF__i_i_i); -ptr_281->setCallingConv(CallingConv::C); -ptr_281->setTailCall(true);AttrListPtr ptr_281_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - ptr_281_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +std::vector ptr_282_params; +ptr_282_params.push_back(ptr_242); +ptr_282_params.push_back(int32_96); +ptr_282_params.push_back(const_int32_56); +ptr_282_params.push_back(const_int32_56); +CallInst* ptr_282 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_282_params.begin(), ptr_282_params.end(), "", label_GOTO_or_IF__i_i_i); +ptr_282->setCallingConv(CallingConv::C); +ptr_282->setTailCall(true); +AttrListPtr ptr_282_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + ptr_282_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -ptr_281->setAttributes(ptr_281_PAL); +ptr_282->setAttributes(ptr_282_PAL); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i_i_i); // Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i) -CastInst* ptr_283 = new IntToPtrInst(int32_277, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -LoadInst* ptr_284 = new LoadInst(ptr_283, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -CastInst* int32_285 = new PtrToIntInst(ptr_284, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); - new StoreInst(int32_285, ptr_276, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -std::vector ptr_287_indices; -ptr_287_indices.push_back(const_int32_56); -ptr_287_indices.push_back(const_int32_56); -Instruction* ptr_287 = GetElementPtrInst::Create(ptr_278, ptr_287_indices.begin(), ptr_287_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); - new StoreInst(const_ptr_78, ptr_287, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +CastInst* ptr_284 = new IntToPtrInst(int32_278, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +LoadInst* ptr_285 = new LoadInst(ptr_284, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +CastInst* int32_286 = new PtrToIntInst(ptr_285, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(int32_286, ptr_277, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +std::vector ptr_288_indices; +ptr_288_indices.push_back(const_int32_56); +ptr_288_indices.push_back(const_int32_56); +Instruction* ptr_288 = GetElementPtrInst::Create(ptr_279, ptr_288_indices.begin(), ptr_288_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); + new StoreInst(const_ptr_78, ptr_288, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); // Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i) -PHINode* ptr_290 = PHINode::Create(PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); -ptr_290->reserveOperandSpace(10); -ptr_290->addIncoming(ptr_236, label_tableswitch5_i_i6_i); -ptr_290->addIncoming(ptr_223, label_GOTO_or_IF__i17_i_i_i); -ptr_290->addIncoming(ptr_180, label_tableswitch3_i_i4_i); -ptr_290->addIncoming(ptr_162, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); -ptr_290->addIncoming(ptr_174, label_false_IFEQ_i_i_i_i); -ptr_290->addIncoming(ptr_148, label_GOTO_or_IF__i_i_i_i); -ptr_290->addIncoming(ptr_278, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); -ptr_290->addIncoming(ptr_281, label_GOTO_or_IF__i_i_i); -ptr_290->addIncoming(ptr_145, label_false_IFNE_i_i_i_i); -ptr_290->addIncoming(ptr_220, label_false_IFNE_i21_i_i_i); - -std::vector ptr_291_indices; -ptr_291_indices.push_back(const_int32_56); -ptr_291_indices.push_back(const_int32_56); -Instruction* ptr_291 = GetElementPtrInst::Create(ptr_290, ptr_291_indices.begin(), ptr_291_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +PHINode* ptr_291 = PHINode::Create(PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +ptr_291->reserveOperandSpace(10); +ptr_291->addIncoming(ptr_237, label_tableswitch5_i_i6_i); +ptr_291->addIncoming(ptr_224, label_GOTO_or_IF__i17_i_i_i); +ptr_291->addIncoming(ptr_181, label_tableswitch3_i_i4_i); +ptr_291->addIncoming(ptr_163, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i); +ptr_291->addIncoming(ptr_175, label_false_IFEQ_i_i_i_i); +ptr_291->addIncoming(ptr_149, label_GOTO_or_IF__i_i_i_i); +ptr_291->addIncoming(ptr_279, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i); +ptr_291->addIncoming(ptr_282, label_GOTO_or_IF__i_i_i); +ptr_291->addIncoming(ptr_146, label_false_IFNE_i_i_i_i); +ptr_291->addIncoming(ptr_221, label_false_IFNE_i21_i_i_i); + +std::vector ptr_292_indices; +ptr_292_indices.push_back(const_int32_56); +ptr_292_indices.push_back(const_int32_56); +Instruction* ptr_292 = GetElementPtrInst::Create(ptr_291, ptr_292_indices.begin(), ptr_292_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_31, ".c.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); - new StoreInst(ptr__c_i, ptr_291, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); -SwitchInst* void_293 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i_i, 7, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); -void_293->addCase(const_int32_56, label_false_IFNE_i_i); -void_293->addCase(const_int32_58, label_tableswitch1_i_i_i); -void_293->addCase(const_int32_54, label_tableswitch2_i_i_i); -void_293->addCase(const_int32_60, label_tableswitch3_i_i_i); -void_293->addCase(const_int32_61, label_tableswitch4_i_i_i); -void_293->addCase(const_int32_62, label_tableswitch5_i_i_i); + new StoreInst(ptr__c_i, ptr_292, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +SwitchInst* void_294 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i_i, 7, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i); +void_294->addCase(const_int32_56, label_false_IFNE_i_i); +void_294->addCase(const_int32_58, label_tableswitch1_i_i_i); +void_294->addCase(const_int32_54, label_tableswitch2_i_i_i); +void_294->addCase(const_int32_60, label_tableswitch3_i_i_i); +void_294->addCase(const_int32_61, label_tableswitch4_i_i_i); +void_294->addCase(const_int32_62, label_tableswitch5_i_i_i); // Block tableswitch.i.i.i (label_tableswitch_i_i_i) -CallInst* void_294 = CallInst::Create(func_abort, "", label_tableswitch_i_i_i); -void_294->setCallingConv(CallingConv::C); -void_294->setTailCall(true);AttrListPtr void_294_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_294_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +CallInst* void_295 = CallInst::Create(func_abort, "", label_tableswitch_i_i_i); +void_295->setCallingConv(CallingConv::C); +void_295->setTailCall(true); +AttrListPtr void_295_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_295_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -void_294->setAttributes(void_294_PAL); +void_295->setAttributes(void_295_PAL); new UnreachableInst(mod->getContext(), label_tableswitch_i_i_i); // Block tableswitch1.i.i.i (label_tableswitch1_i_i_i) -LoadInst* ptr_296 = new LoadInst(const_ptr_79, "", false, label_tableswitch1_i_i_i); -CastInst* int32_297 = new PtrToIntInst(ptr_296, IntegerType::get(mod->getContext(), 32), "", label_tableswitch1_i_i_i); -std::vector ptr_298_indices; -ptr_298_indices.push_back(const_int32_56); -ptr_298_indices.push_back(const_int32_77); -Instruction* ptr_298 = GetElementPtrInst::Create(ptr_290, ptr_298_indices.begin(), ptr_298_indices.end(), "", label_tableswitch1_i_i_i); -CastInst* ptr_299 = new BitCastInst(ptr_298, PointerTy_0, "", label_tableswitch1_i_i_i); -LoadInst* int8_300 = new LoadInst(ptr_299, "", false, label_tableswitch1_i_i_i); -BinaryOperator* int8_301 = BinaryOperator::Create(Instruction::And, int8_300, const_int8_80, "", label_tableswitch1_i_i_i); -CastInst* int8_302 = new TruncInst(int32_297, IntegerType::get(mod->getContext(), 8), "", label_tableswitch1_i_i_i); -BinaryOperator* int8_303 = BinaryOperator::Create(Instruction::Or, int8_301, int8_302, "", label_tableswitch1_i_i_i); - new StoreInst(int8_303, ptr_299, false, label_tableswitch1_i_i_i); +std::vector ptr_297_indices; +ptr_297_indices.push_back(const_int32_56); +ptr_297_indices.push_back(const_int32_77); +Instruction* ptr_297 = GetElementPtrInst::Create(ptr_291, ptr_297_indices.begin(), ptr_297_indices.end(), "", label_tableswitch1_i_i_i); +CastInst* ptr_298 = new BitCastInst(ptr_297, PointerTy_25, "", label_tableswitch1_i_i_i); +LoadInst* int32_299 = new LoadInst(ptr_298, "", false, label_tableswitch1_i_i_i); +BinaryOperator* int32_300 = BinaryOperator::Create(Instruction::And, int32_299, const_int32_79, "", label_tableswitch1_i_i_i); +LoadInst* ptr_301 = new LoadInst(const_ptr_80, "", false, label_tableswitch1_i_i_i); +CastInst* int32_302 = new PtrToIntInst(ptr_301, IntegerType::get(mod->getContext(), 32), "", label_tableswitch1_i_i_i); +BinaryOperator* int32_303 = BinaryOperator::Create(Instruction::Or, int32_302, int32_300, "", label_tableswitch1_i_i_i); +CastInst* ptr__c5 = new IntToPtrInst(int32_303, PointerTy_0, ".c5", label_tableswitch1_i_i_i); + new StoreInst(ptr__c5, ptr_297, false, label_tableswitch1_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch1_i_i_i); // Block tableswitch2.i.i.i (label_tableswitch2_i_i_i) std::vector ptr_306_indices; ptr_306_indices.push_back(const_int32_56); ptr_306_indices.push_back(const_int32_77); -Instruction* ptr_306 = GetElementPtrInst::Create(ptr_290, ptr_306_indices.begin(), ptr_306_indices.end(), "", label_tableswitch2_i_i_i); +Instruction* ptr_306 = GetElementPtrInst::Create(ptr_291, ptr_306_indices.begin(), ptr_306_indices.end(), "", label_tableswitch2_i_i_i); CastInst* ptr_307 = new BitCastInst(ptr_306, PointerTy_25, "", label_tableswitch2_i_i_i); LoadInst* int32_308 = new LoadInst(ptr_307, "", false, label_tableswitch2_i_i_i); -BinaryOperator* int32_309 = BinaryOperator::Create(Instruction::And, int32_308, const_int32_58, "", label_tableswitch2_i_i_i); -LoadInst* ptr_310 = new LoadInst(const_ptr_81, "", false, label_tableswitch2_i_i_i); +BinaryOperator* int32_309 = BinaryOperator::Create(Instruction::And, int32_308, const_int32_81, "", label_tableswitch2_i_i_i); +LoadInst* ptr_310 = new LoadInst(const_ptr_82, "", false, label_tableswitch2_i_i_i); CastInst* int32_311 = new PtrToIntInst(ptr_310, IntegerType::get(mod->getContext(), 32), "", label_tableswitch2_i_i_i); BinaryOperator* int32_312 = BinaryOperator::Create(Instruction::Or, int32_311, int32_309, "", label_tableswitch2_i_i_i); -CastInst* ptr_313 = new BitCastInst(ptr_306, PointerTy_0, "", label_tableswitch2_i_i_i); -CastInst* int8_trunc = new TruncInst(int32_308, IntegerType::get(mod->getContext(), 8), "trunc", label_tableswitch2_i_i_i); -BinaryOperator* int8_314 = BinaryOperator::Create(Instruction::And, int8_trunc, const_int8_80, "", label_tableswitch2_i_i_i); -CastInst* int8_315 = new TruncInst(int32_312, IntegerType::get(mod->getContext(), 8), "", label_tableswitch2_i_i_i); -BinaryOperator* int8_316 = BinaryOperator::Create(Instruction::Or, int8_315, int8_314, "", label_tableswitch2_i_i_i); - new StoreInst(int8_316, ptr_313, false, label_tableswitch2_i_i_i); +CastInst* ptr__c4 = new IntToPtrInst(int32_312, PointerTy_0, ".c4", label_tableswitch2_i_i_i); + new StoreInst(ptr__c4, ptr_306, false, label_tableswitch2_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch2_i_i_i); // Block tableswitch3.i.i.i (label_tableswitch3_i_i_i) -LoadInst* ptr_319 = new LoadInst(const_ptr_82, "", false, label_tableswitch3_i_i_i); +std::vector ptr_315_indices; +ptr_315_indices.push_back(const_int32_56); +ptr_315_indices.push_back(const_int32_77); +Instruction* ptr_315 = GetElementPtrInst::Create(ptr_291, ptr_315_indices.begin(), ptr_315_indices.end(), "", label_tableswitch3_i_i_i); +CastInst* ptr_316 = new BitCastInst(ptr_315, PointerTy_25, "", label_tableswitch3_i_i_i); +LoadInst* int32_317 = new LoadInst(ptr_316, "", false, label_tableswitch3_i_i_i); +BinaryOperator* int32_318 = BinaryOperator::Create(Instruction::And, int32_317, const_int32_55, "", label_tableswitch3_i_i_i); +LoadInst* ptr_319 = new LoadInst(const_ptr_83, "", false, label_tableswitch3_i_i_i); CastInst* int32_320 = new PtrToIntInst(ptr_319, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i_i); -BinaryOperator* int32_321 = BinaryOperator::Create(Instruction::Or, int32_320, const_int32_58, "", label_tableswitch3_i_i_i); -std::vector ptr_322_indices; -ptr_322_indices.push_back(const_int32_56); -ptr_322_indices.push_back(const_int32_77); -Instruction* ptr_322 = GetElementPtrInst::Create(ptr_290, ptr_322_indices.begin(), ptr_322_indices.end(), "", label_tableswitch3_i_i_i); -CastInst* ptr_323 = new BitCastInst(ptr_322, PointerTy_0, "", label_tableswitch3_i_i_i); -LoadInst* int8_324 = new LoadInst(ptr_323, "", false, label_tableswitch3_i_i_i); -BinaryOperator* int8_325 = BinaryOperator::Create(Instruction::And, int8_324, const_int8_80, "", label_tableswitch3_i_i_i); -CastInst* int8_326 = new TruncInst(int32_321, IntegerType::get(mod->getContext(), 8), "", label_tableswitch3_i_i_i); -BinaryOperator* int8_327 = BinaryOperator::Create(Instruction::Or, int8_326, int8_325, "", label_tableswitch3_i_i_i); - new StoreInst(int8_327, ptr_323, false, label_tableswitch3_i_i_i); -LoadInst* ptr_329 = new LoadInst(const_ptr_83, "", false, label_tableswitch3_i_i_i); -CastInst* int32_330 = new PtrToIntInst(ptr_290, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i_i); -BinaryOperator* int32_331 = BinaryOperator::Create(Instruction::And, int32_330, const_int32_84, "", label_tableswitch3_i_i_i); -CastInst* ptr_332 = new IntToPtrInst(int32_331, PointerTy_30, "", label_tableswitch3_i_i_i); -std::vector ptr_333_indices; -ptr_333_indices.push_back(const_int32_58); -ptr_333_indices.push_back(const_int32_77); -Instruction* ptr_333 = GetElementPtrInst::Create(ptr_329, ptr_333_indices.begin(), ptr_333_indices.end(), "", label_tableswitch3_i_i_i); -LoadInst* ptr_334 = new LoadInst(ptr_333, "", false, label_tableswitch3_i_i_i); -GetElementPtrInst* ptr_335 = GetElementPtrInst::Create(ptr_334, const_int32_71, "", label_tableswitch3_i_i_i); -CastInst* ptr_336 = new BitCastInst(ptr_335, PointerTy_32, "", label_tableswitch3_i_i_i); -LoadInst* ptr_337 = new LoadInst(ptr_336, "", false, label_tableswitch3_i_i_i); -ICmpInst* int1_338 = new ICmpInst(*label_tableswitch3_i_i_i, ICmpInst::ICMP_EQ, ptr_337, const_ptr_85, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i5_i_i_i_i_i, int1_338, label_tableswitch3_i_i_i); +BinaryOperator* int32_321 = BinaryOperator::Create(Instruction::Or, int32_318, const_int32_58, "", label_tableswitch3_i_i_i); +BinaryOperator* int32_322 = BinaryOperator::Create(Instruction::Or, int32_321, int32_320, "", label_tableswitch3_i_i_i); +CastInst* ptr__c3 = new IntToPtrInst(int32_322, PointerTy_0, ".c3", label_tableswitch3_i_i_i); + new StoreInst(ptr__c3, ptr_315, false, label_tableswitch3_i_i_i); +LoadInst* ptr_324 = new LoadInst(const_ptr_84, "", false, label_tableswitch3_i_i_i); +CastInst* int32_325 = new PtrToIntInst(ptr_291, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i_i); +BinaryOperator* int32_326 = BinaryOperator::Create(Instruction::And, int32_325, const_int32_85, "", label_tableswitch3_i_i_i); +CastInst* ptr_327 = new IntToPtrInst(int32_326, PointerTy_30, "", label_tableswitch3_i_i_i); +std::vector ptr_328_indices; +ptr_328_indices.push_back(const_int32_58); +ptr_328_indices.push_back(const_int32_77); +Instruction* ptr_328 = GetElementPtrInst::Create(ptr_324, ptr_328_indices.begin(), ptr_328_indices.end(), "", label_tableswitch3_i_i_i); +LoadInst* ptr_329 = new LoadInst(ptr_328, "", false, label_tableswitch3_i_i_i); +GetElementPtrInst* ptr_330 = GetElementPtrInst::Create(ptr_329, const_int32_71, "", label_tableswitch3_i_i_i); +CastInst* ptr_331 = new BitCastInst(ptr_330, PointerTy_32, "", label_tableswitch3_i_i_i); +LoadInst* ptr_332 = new LoadInst(ptr_331, "", false, label_tableswitch3_i_i_i); +ICmpInst* int1_333 = new ICmpInst(*label_tableswitch3_i_i_i, ICmpInst::ICMP_EQ, ptr_332, const_ptr_86, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i5_i_i_i_i_i, int1_333, label_tableswitch3_i_i_i); // Block true IF*NULL.i1.i.i.i.i.i (label_true_IF_NULL_i1_i_i_i_i_i) -std::vector ptr_340_indices; -ptr_340_indices.push_back(const_int32_56); -ptr_340_indices.push_back(const_int32_56); -Instruction* ptr_340 = GetElementPtrInst::Create(ptr_332, ptr_340_indices.begin(), ptr_340_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i); - new StoreInst(const_ptr_78, ptr_340, false, label_true_IF_NULL_i1_i_i_i_i_i); -GetElementPtrInst* ptr_342 = GetElementPtrInst::Create(ptr_334, const_int32_62, "", label_true_IF_NULL_i1_i_i_i_i_i); -CastInst* ptr_343 = new BitCastInst(ptr_342, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i); -LoadInst* ptr_344 = new LoadInst(ptr_343, "", false, label_true_IF_NULL_i1_i_i_i_i_i); -LoadInst* ptr_345 = new LoadInst(const_ptr_86, "", false, label_true_IF_NULL_i1_i_i_i_i_i); -CastInst* int32_346 = new PtrToIntInst(ptr_345, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i); -BinaryOperator* int32_347 = BinaryOperator::Create(Instruction::Add, int32_346, int32_331, "", label_true_IF_NULL_i1_i_i_i_i_i); -CastInst* ptr_348 = new IntToPtrInst(int32_347, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i); - new StoreInst(ptr_344, ptr_348, false, label_true_IF_NULL_i1_i_i_i_i_i); -LoadInst* ptr_350 = new LoadInst(ptr_343, "", false, label_true_IF_NULL_i1_i_i_i_i_i); -ICmpInst* int1_351 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_350, const_ptr_87, ""); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i, int1_351, label_true_IF_NULL_i1_i_i_i_i_i); +std::vector ptr_335_indices; +ptr_335_indices.push_back(const_int32_56); +ptr_335_indices.push_back(const_int32_56); +Instruction* ptr_335 = GetElementPtrInst::Create(ptr_327, ptr_335_indices.begin(), ptr_335_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(const_ptr_78, ptr_335, false, label_true_IF_NULL_i1_i_i_i_i_i); +GetElementPtrInst* ptr_337 = GetElementPtrInst::Create(ptr_329, const_int32_62, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_338 = new BitCastInst(ptr_337, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_339 = new LoadInst(ptr_338, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_340 = new LoadInst(const_ptr_87, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* int32_341 = new PtrToIntInst(ptr_340, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i); +BinaryOperator* int32_342 = BinaryOperator::Create(Instruction::Add, int32_341, int32_326, "", label_true_IF_NULL_i1_i_i_i_i_i); +CastInst* ptr_343 = new IntToPtrInst(int32_342, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i); + new StoreInst(ptr_339, ptr_343, false, label_true_IF_NULL_i1_i_i_i_i_i); +LoadInst* ptr_345 = new LoadInst(ptr_338, "", false, label_true_IF_NULL_i1_i_i_i_i_i); +ICmpInst* int1_346 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_345, const_ptr_88, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i, int1_346, label_true_IF_NULL_i1_i_i_i_i_i); // Block GOTO or IF*1.i3.i.i.i.i.i (label_GOTO_or_IF_1_i3_i_i_i_i_i) -CastInst* ptr_353 = new BitCastInst(ptr_342, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i_i_i_i); -CastInst* ptr__c1_i2_i_i_i_i_i = new IntToPtrInst(int32_331, PointerTy_31, ".c1.i2.i.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i_i); - new StoreInst(ptr__c1_i2_i_i_i_i_i, ptr_353, false, label_GOTO_or_IF_1_i3_i_i_i_i_i); -LoadInst* ptr_355 = new LoadInst(ptr_336, "", false, label_GOTO_or_IF_1_i3_i_i_i_i_i); -ICmpInst* int1_356 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_355, const_ptr_85, ""); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i, int1_356, label_GOTO_or_IF_1_i3_i_i_i_i_i); +CastInst* ptr_348 = new BitCastInst(ptr_337, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i_i_i_i); +CastInst* ptr__c1_i2_i_i_i_i_i = new IntToPtrInst(int32_326, PointerTy_31, ".c1.i2.i.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i_i); + new StoreInst(ptr__c1_i2_i_i_i_i_i, ptr_348, false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +LoadInst* ptr_350 = new LoadInst(ptr_331, "", false, label_GOTO_or_IF_1_i3_i_i_i_i_i); +ICmpInst* int1_351 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_350, const_ptr_86, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i, int1_351, label_GOTO_or_IF_1_i3_i_i_i_i_i); // Block true IFNULL.i5.i.i.i.i.i (label_true_IFNULL_i5_i_i_i_i_i) -GetElementPtrInst* ptr_358 = GetElementPtrInst::Create(ptr_337, const_int32_62, "", label_true_IFNULL_i5_i_i_i_i_i); -CastInst* ptr_359 = new BitCastInst(ptr_358, PointerTy_25, "", label_true_IFNULL_i5_i_i_i_i_i); +GetElementPtrInst* ptr_353 = GetElementPtrInst::Create(ptr_332, const_int32_62, "", label_true_IFNULL_i5_i_i_i_i_i); +CastInst* ptr_354 = new BitCastInst(ptr_353, PointerTy_25, "", label_true_IFNULL_i5_i_i_i_i_i); BranchInst::Create(label_bb2_i_i36_i, label_true_IFNULL_i5_i_i_i_i_i); // Block bb.i.i34.i (label_bb_i_i34_i) -Argument* fwdref_362 = new Argument(IntegerType::get(mod->getContext(), 1)); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb1_i_i35_i, fwdref_362, label_bb_i_i34_i); +Argument* fwdref_357 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb1_i_i35_i, fwdref_357, label_bb_i_i34_i); // Block bb1.i.i35.i (label_bb1_i_i35_i) -Argument* fwdref_364 = new Argument(IntegerType::get(mod->getContext(), 32)); -BinaryOperator* int32_363 = BinaryOperator::Create(Instruction::Add, fwdref_364, const_int32_77, "", label_bb1_i_i35_i); +Argument* fwdref_359 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_358 = BinaryOperator::Create(Instruction::Add, fwdref_359, const_int32_77, "", label_bb1_i_i35_i); BranchInst::Create(label_bb2_i_i36_i, label_bb1_i_i35_i); // Block bb2.i.i36.i (label_bb2_i_i36_i) -PHINode* int32_366 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i36_i); -int32_366->reserveOperandSpace(2); -int32_366->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i_i_i_i); -int32_366->addIncoming(int32_363, label_bb1_i_i35_i); - -ICmpInst* int1_367 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_ULT, int32_366, const_int32_88, ""); -std::vector void_368_params; -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -void_368_params.push_back(const_int1_89); -CallInst* void_368 = CallInst::Create(func_llvm_memory_barrier, void_368_params.begin(), void_368_params.end(), "", label_bb2_i_i36_i); -void_368->setCallingConv(CallingConv::C); -void_368->setTailCall(true);AttrListPtr void_368_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_368_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_368->setAttributes(void_368_PAL); - -std::vector int32_369_params; -int32_369_params.push_back(ptr_359); -int32_369_params.push_back(const_int32_56); -int32_369_params.push_back(const_int32_77); -CallInst* int32_369 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_369_params.begin(), int32_369_params.end(), "", label_bb2_i_i36_i); -int32_369->setCallingConv(CallingConv::C); -int32_369->setTailCall(true);AttrListPtr int32_369_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_369_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +PHINode* int32_361 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i36_i); +int32_361->reserveOperandSpace(2); +int32_361->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i_i_i_i); +int32_361->addIncoming(int32_358, label_bb1_i_i35_i); + +ICmpInst* int1_362 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_ULT, int32_361, const_int32_89, ""); +std::vector void_363_params; +void_363_params.push_back(const_int1_90); +void_363_params.push_back(const_int1_90); +void_363_params.push_back(const_int1_90); +void_363_params.push_back(const_int1_90); +void_363_params.push_back(const_int1_90); +CallInst* void_363 = CallInst::Create(func_llvm_memory_barrier, void_363_params.begin(), void_363_params.end(), "", label_bb2_i_i36_i); +void_363->setCallingConv(CallingConv::C); +void_363->setTailCall(true); +AttrListPtr void_363_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_363_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_363->setAttributes(void_363_PAL); + +std::vector int32_364_params; +int32_364_params.push_back(ptr_354); +int32_364_params.push_back(const_int32_56); +int32_364_params.push_back(const_int32_77); +CallInst* int32_364 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_364_params.begin(), int32_364_params.end(), "", label_bb2_i_i36_i); +int32_364->setCallingConv(CallingConv::C); +int32_364->setTailCall(true); +AttrListPtr int32_364_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_364_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_364->setAttributes(int32_364_PAL); + +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_i36_i); +void_365->setCallingConv(CallingConv::C); +void_365->setTailCall(true); +AttrListPtr void_365_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_365_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -int32_369->setAttributes(int32_369_PAL); +void_365->setAttributes(void_365_PAL); + +ICmpInst* int1_366 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_EQ, int32_364, const_int32_56, ""); +BranchInst::Create(label_bb_i_i34_i, label_bb4_preheader_i_i37_i, int1_362, label_bb2_i_i36_i); + +// Block bb4.preheader.i.i37.i (label_bb4_preheader_i_i37_i) +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_366, label_bb4_preheader_i_i37_i); + +// Block bb3.i.i38.i (label_bb3_i_i38_i) +CallInst* void_369 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i38_i); +void_369->setCallingConv(CallingConv::C); +void_369->setTailCall(true); +AttrListPtr void_369_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_369_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_369->setAttributes(void_369_PAL); std::vector void_370_params; -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -void_370_params.push_back(const_int1_89); -CallInst* void_370 = CallInst::Create(func_llvm_memory_barrier, void_370_params.begin(), void_370_params.end(), "", label_bb2_i_i36_i); +void_370_params.push_back(const_int1_90); +void_370_params.push_back(const_int1_90); +void_370_params.push_back(const_int1_90); +void_370_params.push_back(const_int1_90); +void_370_params.push_back(const_int1_90); +CallInst* void_370 = CallInst::Create(func_llvm_memory_barrier, void_370_params.begin(), void_370_params.end(), "", label_bb3_i_i38_i); void_370->setCallingConv(CallingConv::C); -void_370->setTailCall(true);AttrListPtr void_370_PAL; +void_370->setTailCall(true); +AttrListPtr void_370_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_370_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_370_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } void_370->setAttributes(void_370_PAL); -ICmpInst* int1_371 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_EQ, int32_369, const_int32_56, ""); -BranchInst::Create(label_bb_i_i34_i, label_bb4_preheader_i_i37_i, int1_367, label_bb2_i_i36_i); - -// Block bb4.preheader.i.i37.i (label_bb4_preheader_i_i37_i) -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_371, label_bb4_preheader_i_i37_i); - -// Block bb3.i.i38.i (label_bb3_i_i38_i) -CallInst* void_374 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i38_i); -void_374->setCallingConv(CallingConv::C); -void_374->setTailCall(true);AttrListPtr void_374_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_374_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_374->setAttributes(void_374_PAL); - -std::vector void_375_params; -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -void_375_params.push_back(const_int1_89); -CallInst* void_375 = CallInst::Create(func_llvm_memory_barrier, void_375_params.begin(), void_375_params.end(), "", label_bb3_i_i38_i); -void_375->setCallingConv(CallingConv::C); -void_375->setTailCall(true);AttrListPtr void_375_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_375_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_375->setAttributes(void_375_PAL); - -std::vector int32_376_params; -int32_376_params.push_back(ptr_359); -int32_376_params.push_back(const_int32_56); -int32_376_params.push_back(const_int32_77); -CallInst* int32_376 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_376_params.begin(), int32_376_params.end(), "", label_bb3_i_i38_i); -int32_376->setCallingConv(CallingConv::C); -int32_376->setTailCall(true);AttrListPtr int32_376_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_376_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -int32_376->setAttributes(int32_376_PAL); - -std::vector void_377_params; -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -void_377_params.push_back(const_int1_89); -CallInst* void_377 = CallInst::Create(func_llvm_memory_barrier, void_377_params.begin(), void_377_params.end(), "", label_bb3_i_i38_i); -void_377->setCallingConv(CallingConv::C); -void_377->setTailCall(true);AttrListPtr void_377_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_377_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - +std::vector int32_371_params; +int32_371_params.push_back(ptr_354); +int32_371_params.push_back(const_int32_56); +int32_371_params.push_back(const_int32_77); +CallInst* int32_371 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_371_params.begin(), int32_371_params.end(), "", label_bb3_i_i38_i); +int32_371->setCallingConv(CallingConv::C); +int32_371->setTailCall(true); +AttrListPtr int32_371_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_371_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_371->setAttributes(int32_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_i38_i); +void_372->setCallingConv(CallingConv::C); +void_372->setTailCall(true); +AttrListPtr void_372_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_372_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } -void_377->setAttributes(void_377_PAL); +void_372->setAttributes(void_372_PAL); -ICmpInst* int1_378 = new ICmpInst(*label_bb3_i_i38_i, ICmpInst::ICMP_EQ, int32_376, const_int32_56, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_378, label_bb3_i_i38_i); +ICmpInst* int1_373 = new ICmpInst(*label_bb3_i_i38_i, ICmpInst::ICMP_EQ, int32_371, const_int32_56, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_373, label_bb3_i_i38_i); // Block false IFNE.i7.i.i.i.i.i (label_false_IFNE_i7_i_i_i_i_i) -std::vector ptr_380_indices; -ptr_380_indices.push_back(const_int32_56); -ptr_380_indices.push_back(const_int32_56); -Instruction* ptr_380 = GetElementPtrInst::Create(ptr_350, ptr_380_indices.begin(), ptr_380_indices.end(), "", label_false_IFNE_i7_i_i_i_i_i); -CastInst* ptr__c_i6_i_i_i_i_i = new IntToPtrInst(int32_331, PointerTy_31, ".c.i6.i.i.i.i.i", label_false_IFNE_i7_i_i_i_i_i); - new StoreInst(ptr__c_i6_i_i_i_i_i, ptr_380, false, label_false_IFNE_i7_i_i_i_i_i); +std::vector ptr_375_indices; +ptr_375_indices.push_back(const_int32_56); +ptr_375_indices.push_back(const_int32_56); +Instruction* ptr_375 = GetElementPtrInst::Create(ptr_345, ptr_375_indices.begin(), ptr_375_indices.end(), "", label_false_IFNE_i7_i_i_i_i_i); +CastInst* ptr__c_i6_i_i_i_i_i = new IntToPtrInst(int32_326, PointerTy_31, ".c.i6.i.i.i.i.i", label_false_IFNE_i7_i_i_i_i_i); + new StoreInst(ptr__c_i6_i_i_i_i_i, ptr_375, false, label_false_IFNE_i7_i_i_i_i_i); BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i); // Block true IFNULL3.i8.i.i.i.i.i (label_true_IFNULL3_i8_i_i_i_i_i) -GetElementPtrInst* ptr_383 = GetElementPtrInst::Create(ptr_355, const_int32_62, "", label_true_IFNULL3_i8_i_i_i_i_i); -CastInst* ptr_384 = new BitCastInst(ptr_383, PointerTy_25, "", label_true_IFNULL3_i8_i_i_i_i_i); - new StoreInst(const_int32_56, ptr_384, false, label_true_IFNULL3_i8_i_i_i_i_i); +GetElementPtrInst* ptr_378 = GetElementPtrInst::Create(ptr_350, const_int32_62, "", label_true_IFNULL3_i8_i_i_i_i_i); +CastInst* ptr_379 = new BitCastInst(ptr_378, PointerTy_25, "", label_true_IFNULL3_i8_i_i_i_i_i); + new StoreInst(const_int32_56, ptr_379, false, label_true_IFNULL3_i8_i_i_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i); // Block tableswitch4.i.i.i (label_tableswitch4_i_i_i) -LoadInst* ptr_387 = new LoadInst(const_ptr_90, "", false, label_tableswitch4_i_i_i); -CastInst* int32_388 = new PtrToIntInst(ptr_387, IntegerType::get(mod->getContext(), 32), "", label_tableswitch4_i_i_i); -std::vector ptr_389_indices; -ptr_389_indices.push_back(const_int32_56); -ptr_389_indices.push_back(const_int32_77); -Instruction* ptr_389 = GetElementPtrInst::Create(ptr_290, ptr_389_indices.begin(), ptr_389_indices.end(), "", label_tableswitch4_i_i_i); -CastInst* ptr_390 = new BitCastInst(ptr_389, PointerTy_0, "", label_tableswitch4_i_i_i); -LoadInst* int8_391 = new LoadInst(ptr_390, "", false, label_tableswitch4_i_i_i); -BinaryOperator* int8_392 = BinaryOperator::Create(Instruction::And, int8_391, const_int8_80, "", label_tableswitch4_i_i_i); -CastInst* int8_393 = new TruncInst(int32_388, IntegerType::get(mod->getContext(), 8), "", label_tableswitch4_i_i_i); -BinaryOperator* int8_394 = BinaryOperator::Create(Instruction::Or, int8_392, int8_393, "", label_tableswitch4_i_i_i); - new StoreInst(int8_394, ptr_390, false, label_tableswitch4_i_i_i); +std::vector ptr_382_indices; +ptr_382_indices.push_back(const_int32_56); +ptr_382_indices.push_back(const_int32_77); +Instruction* ptr_382 = GetElementPtrInst::Create(ptr_291, ptr_382_indices.begin(), ptr_382_indices.end(), "", label_tableswitch4_i_i_i); +CastInst* ptr_383 = new BitCastInst(ptr_382, PointerTy_25, "", label_tableswitch4_i_i_i); +LoadInst* int32_384 = new LoadInst(ptr_383, "", false, label_tableswitch4_i_i_i); +BinaryOperator* int32_385 = BinaryOperator::Create(Instruction::And, int32_384, const_int32_79, "", label_tableswitch4_i_i_i); +LoadInst* ptr_386 = new LoadInst(const_ptr_91, "", false, label_tableswitch4_i_i_i); +CastInst* int32_387 = new PtrToIntInst(ptr_386, IntegerType::get(mod->getContext(), 32), "", label_tableswitch4_i_i_i); +BinaryOperator* int32_388 = BinaryOperator::Create(Instruction::Or, int32_387, int32_385, "", label_tableswitch4_i_i_i); +CastInst* ptr__c2 = new IntToPtrInst(int32_388, PointerTy_0, ".c2", label_tableswitch4_i_i_i); + new StoreInst(ptr__c2, ptr_382, false, label_tableswitch4_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch4_i_i_i); // Block tableswitch5.i.i.i (label_tableswitch5_i_i_i) -LoadInst* ptr_397 = new LoadInst(const_ptr_91, "", false, label_tableswitch5_i_i_i); -CastInst* int32_398 = new PtrToIntInst(ptr_397, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i); -BinaryOperator* int32_399 = BinaryOperator::Create(Instruction::Or, int32_398, const_int32_58, "", label_tableswitch5_i_i_i); -std::vector ptr_400_indices; -ptr_400_indices.push_back(const_int32_56); -ptr_400_indices.push_back(const_int32_77); -Instruction* ptr_400 = GetElementPtrInst::Create(ptr_290, ptr_400_indices.begin(), ptr_400_indices.end(), "", label_tableswitch5_i_i_i); -CastInst* ptr_401 = new BitCastInst(ptr_400, PointerTy_0, "", label_tableswitch5_i_i_i); -LoadInst* int8_402 = new LoadInst(ptr_401, "", false, label_tableswitch5_i_i_i); -BinaryOperator* int8_403 = BinaryOperator::Create(Instruction::And, int8_402, const_int8_80, "", label_tableswitch5_i_i_i); -CastInst* int8_404 = new TruncInst(int32_399, IntegerType::get(mod->getContext(), 8), "", label_tableswitch5_i_i_i); -BinaryOperator* int8_405 = BinaryOperator::Create(Instruction::Or, int8_404, int8_403, "", label_tableswitch5_i_i_i); - new StoreInst(int8_405, ptr_401, false, label_tableswitch5_i_i_i); -LoadInst* ptr_407 = new LoadInst(const_ptr_92, "", false, label_tableswitch5_i_i_i); -CastInst* int32_408 = new PtrToIntInst(ptr_290, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i); -BinaryOperator* int32_409 = BinaryOperator::Create(Instruction::And, int32_408, const_int32_84, "", label_tableswitch5_i_i_i); -CastInst* ptr_410 = new IntToPtrInst(int32_409, PointerTy_30, "", label_tableswitch5_i_i_i); -std::vector ptr_411_indices; -ptr_411_indices.push_back(const_int32_58); -ptr_411_indices.push_back(const_int32_77); -Instruction* ptr_411 = GetElementPtrInst::Create(ptr_407, ptr_411_indices.begin(), ptr_411_indices.end(), "", label_tableswitch5_i_i_i); -LoadInst* ptr_412 = new LoadInst(ptr_411, "", false, label_tableswitch5_i_i_i); -GetElementPtrInst* ptr_413 = GetElementPtrInst::Create(ptr_412, const_int32_71, "", label_tableswitch5_i_i_i); -CastInst* ptr_414 = new BitCastInst(ptr_413, PointerTy_32, "", label_tableswitch5_i_i_i); -LoadInst* ptr_415 = new LoadInst(ptr_414, "", false, label_tableswitch5_i_i_i); -ICmpInst* int1_416 = new ICmpInst(*label_tableswitch5_i_i_i, ICmpInst::ICMP_EQ, ptr_415, const_ptr_85, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_true_IFNULL_i5_i_i6_i_i_i, int1_416, label_tableswitch5_i_i_i); +std::vector ptr_391_indices; +ptr_391_indices.push_back(const_int32_56); +ptr_391_indices.push_back(const_int32_77); +Instruction* ptr_391 = GetElementPtrInst::Create(ptr_291, ptr_391_indices.begin(), ptr_391_indices.end(), "", label_tableswitch5_i_i_i); +CastInst* ptr_392 = new BitCastInst(ptr_391, PointerTy_25, "", label_tableswitch5_i_i_i); +LoadInst* int32_393 = new LoadInst(ptr_392, "", false, label_tableswitch5_i_i_i); +BinaryOperator* int32_394 = BinaryOperator::Create(Instruction::And, int32_393, const_int32_55, "", label_tableswitch5_i_i_i); +LoadInst* ptr_395 = new LoadInst(const_ptr_92, "", false, label_tableswitch5_i_i_i); +CastInst* int32_396 = new PtrToIntInst(ptr_395, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i); +BinaryOperator* int32_397 = BinaryOperator::Create(Instruction::Or, int32_394, const_int32_58, "", label_tableswitch5_i_i_i); +BinaryOperator* int32_398 = BinaryOperator::Create(Instruction::Or, int32_397, int32_396, "", label_tableswitch5_i_i_i); +CastInst* ptr__c = new IntToPtrInst(int32_398, PointerTy_0, ".c", label_tableswitch5_i_i_i); + new StoreInst(ptr__c, ptr_391, false, label_tableswitch5_i_i_i); +LoadInst* ptr_400 = new LoadInst(const_ptr_93, "", false, label_tableswitch5_i_i_i); +CastInst* int32_401 = new PtrToIntInst(ptr_291, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i); +BinaryOperator* int32_402 = BinaryOperator::Create(Instruction::And, int32_401, const_int32_85, "", label_tableswitch5_i_i_i); +CastInst* ptr_403 = new IntToPtrInst(int32_402, PointerTy_30, "", label_tableswitch5_i_i_i); +std::vector ptr_404_indices; +ptr_404_indices.push_back(const_int32_58); +ptr_404_indices.push_back(const_int32_77); +Instruction* ptr_404 = GetElementPtrInst::Create(ptr_400, ptr_404_indices.begin(), ptr_404_indices.end(), "", label_tableswitch5_i_i_i); +LoadInst* ptr_405 = new LoadInst(ptr_404, "", false, label_tableswitch5_i_i_i); +GetElementPtrInst* ptr_406 = GetElementPtrInst::Create(ptr_405, const_int32_71, "", label_tableswitch5_i_i_i); +CastInst* ptr_407 = new BitCastInst(ptr_406, PointerTy_32, "", label_tableswitch5_i_i_i); +LoadInst* ptr_408 = new LoadInst(ptr_407, "", false, label_tableswitch5_i_i_i); +ICmpInst* int1_409 = new ICmpInst(*label_tableswitch5_i_i_i, ICmpInst::ICMP_EQ, ptr_408, const_ptr_86, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_true_IFNULL_i5_i_i6_i_i_i, int1_409, label_tableswitch5_i_i_i); // Block true IF*NULL.i1.i.i3.i.i.i (label_true_IF_NULL_i1_i_i3_i_i_i) -std::vector ptr_418_indices; -ptr_418_indices.push_back(const_int32_56); -ptr_418_indices.push_back(const_int32_56); -Instruction* ptr_418 = GetElementPtrInst::Create(ptr_410, ptr_418_indices.begin(), ptr_418_indices.end(), "", label_true_IF_NULL_i1_i_i3_i_i_i); - new StoreInst(const_ptr_78, ptr_418, false, label_true_IF_NULL_i1_i_i3_i_i_i); -GetElementPtrInst* ptr_420 = GetElementPtrInst::Create(ptr_412, const_int32_62, "", label_true_IF_NULL_i1_i_i3_i_i_i); -CastInst* ptr_421 = new BitCastInst(ptr_420, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i); -LoadInst* ptr_422 = new LoadInst(ptr_421, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); -LoadInst* ptr_423 = new LoadInst(const_ptr_86, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); -CastInst* int32_424 = new PtrToIntInst(ptr_423, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i3_i_i_i); -BinaryOperator* int32_425 = BinaryOperator::Create(Instruction::Add, int32_424, int32_409, "", label_true_IF_NULL_i1_i_i3_i_i_i); -CastInst* ptr_426 = new IntToPtrInst(int32_425, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i); - new StoreInst(ptr_422, ptr_426, false, label_true_IF_NULL_i1_i_i3_i_i_i); -LoadInst* ptr_428 = new LoadInst(ptr_421, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); -ICmpInst* int1_429 = new ICmpInst(*label_true_IF_NULL_i1_i_i3_i_i_i, ICmpInst::ICMP_EQ, ptr_428, const_ptr_87, ""); -BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i_i, label_false_IFNE_i7_i_i8_i_i_i, int1_429, label_true_IF_NULL_i1_i_i3_i_i_i); +std::vector ptr_411_indices; +ptr_411_indices.push_back(const_int32_56); +ptr_411_indices.push_back(const_int32_56); +Instruction* ptr_411 = GetElementPtrInst::Create(ptr_403, ptr_411_indices.begin(), ptr_411_indices.end(), "", label_true_IF_NULL_i1_i_i3_i_i_i); + new StoreInst(const_ptr_78, ptr_411, false, label_true_IF_NULL_i1_i_i3_i_i_i); +GetElementPtrInst* ptr_413 = GetElementPtrInst::Create(ptr_405, const_int32_62, "", label_true_IF_NULL_i1_i_i3_i_i_i); +CastInst* ptr_414 = new BitCastInst(ptr_413, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i); +LoadInst* ptr_415 = new LoadInst(ptr_414, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); +LoadInst* ptr_416 = new LoadInst(const_ptr_87, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); +CastInst* int32_417 = new PtrToIntInst(ptr_416, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i3_i_i_i); +BinaryOperator* int32_418 = BinaryOperator::Create(Instruction::Add, int32_417, int32_402, "", label_true_IF_NULL_i1_i_i3_i_i_i); +CastInst* ptr_419 = new IntToPtrInst(int32_418, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i); + new StoreInst(ptr_415, ptr_419, false, label_true_IF_NULL_i1_i_i3_i_i_i); +LoadInst* ptr_421 = new LoadInst(ptr_414, "", false, label_true_IF_NULL_i1_i_i3_i_i_i); +ICmpInst* int1_422 = new ICmpInst(*label_true_IF_NULL_i1_i_i3_i_i_i, ICmpInst::ICMP_EQ, ptr_421, const_ptr_88, ""); +BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i_i, label_false_IFNE_i7_i_i8_i_i_i, int1_422, label_true_IF_NULL_i1_i_i3_i_i_i); // Block GOTO or IF*1.i3.i.i5.i.i.i (label_GOTO_or_IF_1_i3_i_i5_i_i_i) -CastInst* ptr_431 = new BitCastInst(ptr_420, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i5_i_i_i); -CastInst* ptr__c1_i2_i_i4_i_i_i = new IntToPtrInst(int32_409, PointerTy_31, ".c1.i2.i.i4.i.i.i", label_GOTO_or_IF_1_i3_i_i5_i_i_i); - new StoreInst(ptr__c1_i2_i_i4_i_i_i, ptr_431, false, label_GOTO_or_IF_1_i3_i_i5_i_i_i); -LoadInst* ptr_433 = new LoadInst(ptr_414, "", false, label_GOTO_or_IF_1_i3_i_i5_i_i_i); -ICmpInst* int1_434 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i5_i_i_i, ICmpInst::ICMP_EQ, ptr_433, const_ptr_85, ""); -BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i9_i_i_i, int1_434, label_GOTO_or_IF_1_i3_i_i5_i_i_i); +CastInst* ptr_424 = new BitCastInst(ptr_413, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i5_i_i_i); +CastInst* ptr__c1_i2_i_i4_i_i_i = new IntToPtrInst(int32_402, PointerTy_31, ".c1.i2.i.i4.i.i.i", label_GOTO_or_IF_1_i3_i_i5_i_i_i); + new StoreInst(ptr__c1_i2_i_i4_i_i_i, ptr_424, false, label_GOTO_or_IF_1_i3_i_i5_i_i_i); +LoadInst* ptr_426 = new LoadInst(ptr_407, "", false, label_GOTO_or_IF_1_i3_i_i5_i_i_i); +ICmpInst* int1_427 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i5_i_i_i, ICmpInst::ICMP_EQ, ptr_426, const_ptr_86, ""); +BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i9_i_i_i, int1_427, label_GOTO_or_IF_1_i3_i_i5_i_i_i); // Block true IFNULL.i5.i.i6.i.i.i (label_true_IFNULL_i5_i_i6_i_i_i) -GetElementPtrInst* ptr_436 = GetElementPtrInst::Create(ptr_415, const_int32_62, "", label_true_IFNULL_i5_i_i6_i_i_i); -CastInst* ptr_437 = new BitCastInst(ptr_436, PointerTy_25, "", label_true_IFNULL_i5_i_i6_i_i_i); +GetElementPtrInst* ptr_429 = GetElementPtrInst::Create(ptr_408, const_int32_62, "", label_true_IFNULL_i5_i_i6_i_i_i); +CastInst* ptr_430 = new BitCastInst(ptr_429, PointerTy_25, "", label_true_IFNULL_i5_i_i6_i_i_i); BranchInst::Create(label_bb2_i_i_i, label_true_IFNULL_i5_i_i6_i_i_i); // Block bb.i.i.i (label_bb_i_i_i) -Argument* fwdref_440 = new Argument(IntegerType::get(mod->getContext(), 1)); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb1_i_i_i, fwdref_440, label_bb_i_i_i); +Argument* fwdref_433 = new Argument(IntegerType::get(mod->getContext(), 1)); +BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb1_i_i_i, fwdref_433, label_bb_i_i_i); // Block bb1.i.i.i (label_bb1_i_i_i) -Argument* fwdref_442 = new Argument(IntegerType::get(mod->getContext(), 32)); -BinaryOperator* int32_441 = BinaryOperator::Create(Instruction::Add, fwdref_442, const_int32_77, "", label_bb1_i_i_i); +Argument* fwdref_435 = new Argument(IntegerType::get(mod->getContext(), 32)); +BinaryOperator* int32_434 = BinaryOperator::Create(Instruction::Add, fwdref_435, const_int32_77, "", 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_444 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); -int32_444->reserveOperandSpace(2); -int32_444->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i6_i_i_i); -int32_444->addIncoming(int32_441, label_bb1_i_i_i); +PHINode* int32_437 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i); +int32_437->reserveOperandSpace(2); +int32_437->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i6_i_i_i); +int32_437->addIncoming(int32_434, label_bb1_i_i_i); + +ICmpInst* int1_438 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_437, const_int32_89, ""); +std::vector void_439_params; +void_439_params.push_back(const_int1_90); +void_439_params.push_back(const_int1_90); +void_439_params.push_back(const_int1_90); +void_439_params.push_back(const_int1_90); +void_439_params.push_back(const_int1_90); +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(true); +AttrListPtr void_439_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_439_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_439->setAttributes(void_439_PAL); + +std::vector int32_440_params; +int32_440_params.push_back(ptr_430); +int32_440_params.push_back(const_int32_56); +int32_440_params.push_back(const_int32_77); +CallInst* int32_440 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_440_params.begin(), int32_440_params.end(), "", label_bb2_i_i_i); +int32_440->setCallingConv(CallingConv::C); +int32_440->setTailCall(true); +AttrListPtr int32_440_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_440_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +int32_440->setAttributes(int32_440_PAL); + +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(true); +AttrListPtr void_441_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_441_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_441->setAttributes(void_441_PAL); + +ICmpInst* int1_442 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_440, const_int32_56, ""); +BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_438, 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_i3_i_i_i, label_bb3_i_i_i, int1_442, label_bb4_preheader_i_i_i); + +// Block bb3.i.i.i (label_bb3_i_i_i) +CallInst* void_445 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); +void_445->setCallingConv(CallingConv::C); +void_445->setTailCall(true); +AttrListPtr void_445_PAL; +{ + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_445_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + +} +void_445->setAttributes(void_445_PAL); -ICmpInst* int1_445 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_444, const_int32_88, ""); std::vector void_446_params; -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -void_446_params.push_back(const_int1_89); -CallInst* void_446 = CallInst::Create(func_llvm_memory_barrier, void_446_params.begin(), void_446_params.end(), "", label_bb2_i_i_i); +void_446_params.push_back(const_int1_90); +void_446_params.push_back(const_int1_90); +void_446_params.push_back(const_int1_90); +void_446_params.push_back(const_int1_90); +void_446_params.push_back(const_int1_90); +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(true);AttrListPtr void_446_PAL; +void_446->setTailCall(true); +AttrListPtr void_446_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_446_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_446_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } void_446->setAttributes(void_446_PAL); std::vector int32_447_params; -int32_447_params.push_back(ptr_437); +int32_447_params.push_back(ptr_430); int32_447_params.push_back(const_int32_56); int32_447_params.push_back(const_int32_77); -CallInst* int32_447 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_447_params.begin(), int32_447_params.end(), "", label_bb2_i_i_i); +CallInst* int32_447 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_447_params.begin(), int32_447_params.end(), "", label_bb3_i_i_i); int32_447->setCallingConv(CallingConv::C); -int32_447->setTailCall(true);AttrListPtr int32_447_PAL; +int32_447->setTailCall(true); +AttrListPtr int32_447_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_447_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + int32_447_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } int32_447->setAttributes(int32_447_PAL); std::vector void_448_params; -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -void_448_params.push_back(const_int1_89); -CallInst* void_448 = CallInst::Create(func_llvm_memory_barrier, void_448_params.begin(), void_448_params.end(), "", label_bb2_i_i_i); +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(true);AttrListPtr void_448_PAL; +void_448->setTailCall(true); +AttrListPtr void_448_PAL; { - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_448_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - + SmallVector Attrs; + AttributeWithIndex PAWI; + PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; + Attrs.push_back(PAWI); + void_448_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); + } void_448->setAttributes(void_448_PAL); -ICmpInst* int1_449 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_447, const_int32_56, ""); -BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_445, 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_i3_i_i_i, label_bb3_i_i_i, int1_449, label_bb4_preheader_i_i_i); - -// Block bb3.i.i.i (label_bb3_i_i_i) -CallInst* void_452 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i); -void_452->setCallingConv(CallingConv::C); -void_452->setTailCall(true);AttrListPtr void_452_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_452_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_452->setAttributes(void_452_PAL); - -std::vector void_453_params; -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -void_453_params.push_back(const_int1_89); -CallInst* void_453 = CallInst::Create(func_llvm_memory_barrier, void_453_params.begin(), void_453_params.end(), "", label_bb3_i_i_i); -void_453->setCallingConv(CallingConv::C); -void_453->setTailCall(true);AttrListPtr void_453_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_453_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_453->setAttributes(void_453_PAL); - -std::vector int32_454_params; -int32_454_params.push_back(ptr_437); -int32_454_params.push_back(const_int32_56); -int32_454_params.push_back(const_int32_77); -CallInst* int32_454 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_454_params.begin(), int32_454_params.end(), "", label_bb3_i_i_i); -int32_454->setCallingConv(CallingConv::C); -int32_454->setTailCall(true);AttrListPtr int32_454_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - int32_454_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -int32_454->setAttributes(int32_454_PAL); - -std::vector void_455_params; -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -void_455_params.push_back(const_int1_89); -CallInst* void_455 = CallInst::Create(func_llvm_memory_barrier, void_455_params.begin(), void_455_params.end(), "", label_bb3_i_i_i); -void_455->setCallingConv(CallingConv::C); -void_455->setTailCall(true);AttrListPtr void_455_PAL; -{ - SmallVector Attrs; - AttributeWithIndex PAWI; - PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind; - Attrs.push_back(PAWI); - void_455_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end()); - -} -void_455->setAttributes(void_455_PAL); - -ICmpInst* int1_456 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_454, const_int32_56, ""); -BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb3_i_i_i, int1_456, label_bb3_i_i_i); +ICmpInst* int1_449 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_447, const_int32_56, ""); +BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb3_i_i_i, int1_449, label_bb3_i_i_i); // Block false IFNE.i7.i.i8.i.i.i (label_false_IFNE_i7_i_i8_i_i_i) -std::vector ptr_458_indices; -ptr_458_indices.push_back(const_int32_56); -ptr_458_indices.push_back(const_int32_56); -Instruction* ptr_458 = GetElementPtrInst::Create(ptr_428, ptr_458_indices.begin(), ptr_458_indices.end(), "", label_false_IFNE_i7_i_i8_i_i_i); -CastInst* ptr__c_i6_i_i7_i_i_i = new IntToPtrInst(int32_409, PointerTy_31, ".c.i6.i.i7.i.i.i", label_false_IFNE_i7_i_i8_i_i_i); - new StoreInst(ptr__c_i6_i_i7_i_i_i, ptr_458, false, label_false_IFNE_i7_i_i8_i_i_i); +std::vector ptr_451_indices; +ptr_451_indices.push_back(const_int32_56); +ptr_451_indices.push_back(const_int32_56); +Instruction* ptr_451 = GetElementPtrInst::Create(ptr_421, ptr_451_indices.begin(), ptr_451_indices.end(), "", label_false_IFNE_i7_i_i8_i_i_i); +CastInst* ptr__c_i6_i_i7_i_i_i = new IntToPtrInst(int32_402, PointerTy_31, ".c.i6.i.i7.i.i.i", label_false_IFNE_i7_i_i8_i_i_i); + new StoreInst(ptr__c_i6_i_i7_i_i_i, ptr_451, false, label_false_IFNE_i7_i_i8_i_i_i); BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i_i, label_false_IFNE_i7_i_i8_i_i_i); // Block true IFNULL3.i8.i.i9.i.i.i (label_true_IFNULL3_i8_i_i9_i_i_i) -GetElementPtrInst* ptr_461 = GetElementPtrInst::Create(ptr_433, const_int32_62, "", label_true_IFNULL3_i8_i_i9_i_i_i); -CastInst* ptr_462 = new BitCastInst(ptr_461, PointerTy_25, "", label_true_IFNULL3_i8_i_i9_i_i_i); - new StoreInst(const_int32_56, ptr_462, false, label_true_IFNULL3_i8_i_i9_i_i_i); +GetElementPtrInst* ptr_454 = GetElementPtrInst::Create(ptr_426, const_int32_62, "", label_true_IFNULL3_i8_i_i9_i_i_i); +CastInst* ptr_455 = new BitCastInst(ptr_454, PointerTy_25, "", label_true_IFNULL3_i8_i_i9_i_i_i); + new StoreInst(const_int32_56, ptr_455, false, label_true_IFNULL3_i8_i_i9_i_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i9_i_i_i); // Block false IFNE.i.i (label_false_IFNE_i_i) -LoadInst* ptr_465 = new LoadInst(const_ptr_93, "", false, label_false_IFNE_i_i); -CastInst* int32_466 = new PtrToIntInst(ptr_465, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i); -std::vector ptr_467_indices; -ptr_467_indices.push_back(const_int32_56); -ptr_467_indices.push_back(const_int32_77); -Instruction* ptr_467 = GetElementPtrInst::Create(ptr_290, ptr_467_indices.begin(), ptr_467_indices.end(), "", label_false_IFNE_i_i); -CastInst* ptr_468 = new BitCastInst(ptr_467, PointerTy_0, "", label_false_IFNE_i_i); -LoadInst* int8_469 = new LoadInst(ptr_468, "", false, label_false_IFNE_i_i); -BinaryOperator* int8_470 = BinaryOperator::Create(Instruction::And, int8_469, const_int8_80, "", label_false_IFNE_i_i); -CastInst* int8_471 = new TruncInst(int32_466, IntegerType::get(mod->getContext(), 8), "", label_false_IFNE_i_i); -BinaryOperator* int8_472 = BinaryOperator::Create(Instruction::Or, int8_470, int8_471, "", label_false_IFNE_i_i); - new StoreInst(int8_472, ptr_468, false, label_false_IFNE_i_i); +std::vector ptr_458_indices; +ptr_458_indices.push_back(const_int32_56); +ptr_458_indices.push_back(const_int32_77); +Instruction* ptr_458 = GetElementPtrInst::Create(ptr_291, ptr_458_indices.begin(), ptr_458_indices.end(), "", label_false_IFNE_i_i); +CastInst* ptr_459 = new BitCastInst(ptr_458, PointerTy_25, "", label_false_IFNE_i_i); +LoadInst* int32_460 = new LoadInst(ptr_459, "", false, label_false_IFNE_i_i); +BinaryOperator* int32_461 = BinaryOperator::Create(Instruction::And, int32_460, const_int32_79, "", label_false_IFNE_i_i); +LoadInst* ptr_462 = new LoadInst(const_ptr_94, "", false, label_false_IFNE_i_i); +CastInst* int32_463 = new PtrToIntInst(ptr_462, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i); +BinaryOperator* int32_464 = BinaryOperator::Create(Instruction::Or, int32_463, int32_461, "", label_false_IFNE_i_i); +CastInst* ptr__c6 = new IntToPtrInst(int32_464, PointerTy_0, ".c6", label_false_IFNE_i_i); + new StoreInst(ptr__c6, ptr_458, false, label_false_IFNE_i_i); BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFNE_i_i); // Block JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit (label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit) -CastInst* ptr_tmp1 = new BitCastInst(ptr_290, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); +CastInst* ptr_tmp1 = new BitCastInst(ptr_291, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); ReturnInst::Create(mod->getContext(), ptr_tmp1, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit); // Resolve Forward References -fwdref_364->replaceAllUsesWith(int32_366); delete fwdref_364; -fwdref_362->replaceAllUsesWith(int1_371); delete fwdref_362; -fwdref_442->replaceAllUsesWith(int32_444); delete fwdref_442; -fwdref_440->replaceAllUsesWith(int1_449); delete fwdref_440; +fwdref_359->replaceAllUsesWith(int32_361); delete fwdref_359; +fwdref_357->replaceAllUsesWith(int1_366); delete fwdref_357; +fwdref_435->replaceAllUsesWith(int32_437); delete fwdref_435; +fwdref_433->replaceAllUsesWith(int1_442); delete fwdref_433; return func_gcmalloc; } Modified: vmkit/trunk/mmtk/java/src/org/j3/bindings/Bindings.java URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/bindings/Bindings.java?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/src/org/j3/bindings/Bindings.java (original) +++ vmkit/trunk/mmtk/java/src/org/j3/bindings/Bindings.java Wed Jul 21 05:29:20 2010 @@ -96,4 +96,22 @@ plan.postBoot(); plan.fullyBooted(); } + + @Inline + private static Address copy(ObjectReference from, + ObjectReference virtualTable, + int size, + int allocator) { + Selected.Collector plan = Selected.Collector.get(); + allocator = plan.copyCheckAllocator(from, size, 0, allocator); + Address to = plan.allocCopy(from, size, 0, 0, allocator); + memcpy(to.toObjectReference(), from, size); + plan.postCopy(to.toObjectReference(), virtualTable, size, allocator); + return to; + } + + @Inline + private static native void memcpy( + ObjectReference to, ObjectReference from, int size); + } Modified: vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp Wed Jul 21 05:29:20 2010 @@ -13,6 +13,8 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; struct ActivePlan { @@ -37,4 +39,4 @@ A->next = 0; } -extern "C" void Java_org_j3_mmtk_ActivePlan_collectorCount__ () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_ActivePlan_collectorCount__ () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Assert.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Assert.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Assert.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Assert.cpp Wed Jul 21 05:29:20 2010 @@ -7,9 +7,12 @@ // //===----------------------------------------------------------------------===// +#include "mvm/VirtualMachine.h" #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; -extern "C" void Java_org_j3_mmtk_Assert_dumpStack__ () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_Assert_dumpStack__ () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Wed Jul 21 05:29:20 2010 @@ -12,6 +12,8 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; extern "C" void JnJVM_org_mmtk_plan_Plan_setCollectionTriggered__(); @@ -110,9 +112,9 @@ } -extern "C" void Java_org_j3_mmtk_Collection_reportPhysicalAllocationFailed__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_Collection_triggerAsyncCollection__I () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_Collection_noThreadsInGC__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_Collection_activeGCThreads__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_Collection_activeGCThreadOrdinal__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_Collection_requestMutatorFlush__ () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_Collection_reportPhysicalAllocationFailed__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_triggerAsyncCollection__I () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_noThreadsInGC__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_activeGCThreads__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_activeGCThreadOrdinal__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_requestMutatorFlush__ () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp Wed Jul 21 05:29:20 2010 @@ -13,15 +13,17 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; extern "C" void Java_org_j3_mmtk_FinalizableProcessor_clear__ () { - JavaThread::get()->printBacktrace(); abort(); + UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_FinalizableProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z () { - JavaThread::get()->printBacktrace(); abort(); + UNIMPLEMENTED(); } extern "C" void Modified: vmkit/trunk/mmtk/mmtk-j3/Lock.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Lock.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Lock.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Lock.cpp Wed Jul 21 05:29:20 2010 @@ -11,6 +11,9 @@ #include "JavaString.h" #include "JavaThread.h" #include "mvm/Threads/Locks.h" +#include "mvm/VirtualMachine.h" + +#include "debug.h" using namespace j3; @@ -24,7 +27,7 @@ extern "C" void Java_org_j3_mmtk_Lock_acquire__(Lock* l) { l->spin.acquire(); } -extern "C" void Java_org_j3_mmtk_Lock_check__I () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_Lock_check__I () { UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Lock_release__(Lock* l) { l->spin.release(); Modified: vmkit/trunk/mmtk/mmtk-j3/Memory.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Memory.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Memory.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Memory.cpp Wed Jul 21 05:29:20 2010 @@ -9,11 +9,14 @@ #include - +#include "mvm/VirtualMachine.h" #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; + extern "C" uintptr_t Java_org_j3_mmtk_Memory_getHeapStartConstant__ () { return (uintptr_t)0x30000000; } @@ -40,12 +43,12 @@ extern "C" void Java_org_j3_mmtk_Memory_mprotect__Lorg_vmmagic_unboxed_Address_2I () { - JavaThread::get()->printBacktrace(); abort(); + UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Memory_munprotect__Lorg_vmmagic_unboxed_Address_2I () { - JavaThread::get()->printBacktrace(); abort(); + UNIMPLEMENTED(); } extern "C" void @@ -57,10 +60,10 @@ extern "C" void Java_org_j3_mmtk_Memory_zeroPages__Lorg_vmmagic_unboxed_Address_2I () { - JavaThread::get()->printBacktrace(); abort(); + UNIMPLEMENTED(); } extern "C" void Java_org_j3_mmtk_Memory_dumpMemory__Lorg_vmmagic_unboxed_Address_2II () { - JavaThread::get()->printBacktrace(); abort(); + UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Wed Jul 21 05:29:20 2010 @@ -7,9 +7,13 @@ // //===----------------------------------------------------------------------===// +#include "JavaArray.h" +#include "JavaClass.h" #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; extern "C" intptr_t Java_org_j3_mmtk_ObjectModel_getArrayBaseOffset__ () { @@ -70,18 +74,56 @@ return __sync_bool_compare_and_swap(((intptr_t*)obj) + 1, oldValue, newValue); } -extern "C" void Java_org_j3_mmtk_ObjectModel_copy__Lorg_vmmagic_unboxed_ObjectReference_2I () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_copyTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getReferenceWhenCopiedTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getObjectEndAddress__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getSizeWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignOffsetWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getCurrentSize__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getNextObject__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getArrayLength__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_isArray__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_isPrimitiveArray__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_isAcyclic__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_dumpObject__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_bindings_Bindings_memcpy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2I( + void* res, void* src, int size) __attribute__ ((always_inline)); + +extern "C" void Java_org_j3_bindings_Bindings_memcpy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2I( + void* res, void* src, int size) { + memcpy(res, src, size); +} + +extern "C" uintptr_t JnJVM_org_j3_bindings_Bindings_copy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II( + JavaObject* obj, VirtualTable* VT, int size, int allocator) __attribute__ ((always_inline)); + +extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_copy__Lorg_vmmagic_unboxed_ObjectReference_2I ( + JavaObject* OM, JavaObject* src, int allocator) __attribute__ ((always_inline)); + +extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_copy__Lorg_vmmagic_unboxed_ObjectReference_2I ( + JavaObject* OM, JavaObject* src, int allocator) { + size_t size = 0; + VirtualTable* VT = src->getVirtualTable(); + if (VMClassLoader::isVMClassLoader(src)) { + size = sizeof(VMClassLoader); + } else { + CommonClass* cl = JavaObject::getClass(src); + if (cl->isArray()) { + UserClassArray* array = cl->asArrayClass(); + UserCommonClass* base = array->baseClass(); + uint32 logSize = base->isPrimitive() ? + base->asPrimitiveClass()->logSize : (sizeof(JavaObject*) == 8 ? 3 : 2); + + size = sizeof(JavaObject) + sizeof(ssize_t) + + (JavaArray::getSize(src) << logSize); + } else { + assert(cl->isClass() && "Not a class!"); + size = cl->asClass()->getVirtualSize(); + } + } + size = llvm::RoundUpToAlignment(size, sizeof(void*)); + return JnJVM_org_j3_bindings_Bindings_copy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II(src, VT, size, allocator); +} + +extern "C" void Java_org_j3_mmtk_ObjectModel_copyTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getReferenceWhenCopiedTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getObjectEndAddress__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getSizeWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignOffsetWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getCurrentSize__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getNextObject__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_getArrayLength__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_isArray__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_isPrimitiveArray__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_isAcyclic__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_dumpObject__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp Wed Jul 21 05:29:20 2010 @@ -13,6 +13,8 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; struct ReferenceProcessor { @@ -36,6 +38,6 @@ } -extern "C" void Java_org_j3_mmtk_ReferenceProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ReferenceProcessor_clear__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_ReferenceProcessor_countWaitingReferences__ () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_ReferenceProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ReferenceProcessor_clear__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ReferenceProcessor_countWaitingReferences__ () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Wed Jul 21 05:29:20 2010 @@ -12,6 +12,8 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; extern "C" void Java_org_j3_mmtk_Scanning_computeThreadRoots__Lorg_mmtk_plan_TraceLocal_2 (JavaObject* Scanning, JavaObject* TL) { @@ -58,6 +60,9 @@ } } -extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_Scanning_precopyChildren__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_Scanning_preCopyGCInstances__Lorg_mmtk_plan_TraceLocal_2 () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_Scanning_preCopyGCInstances__Lorg_mmtk_plan_TraceLocal_2 (JavaObject* Scanning, JavaObject* TL) { + // Nothing to do, there are no GC objects on which the GC depends. +} + +extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Scanning_precopyChildren__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Strings.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Strings.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Strings.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Strings.cpp Wed Jul 21 05:29:20 2010 @@ -24,7 +24,7 @@ } } -extern "C" void Java_org_j3_mmtk_Strings_writeThreadId___3CI(JavaObject*str, +extern "C" void Java_org_j3_mmtk_Strings_writeThreadId___3CI(JavaObject* str, ArrayUInt16* msg, sint32 len) { llvm_gcroot(str, 0); Modified: vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/SynchronizedCounter.cpp Wed Jul 21 05:29:20 2010 @@ -11,8 +11,10 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; -extern "C" void Java_org_j3_mmtk_SynchronizedCounter_reset__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_SynchronizedCounter_increment__ () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_SynchronizedCounter_reset__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_SynchronizedCounter_increment__ () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp Wed Jul 21 05:29:20 2010 @@ -10,21 +10,23 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; -extern "C" void Java_org_j3_mmtk_TraceInterface_gcEnabled__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_adjustSlotOffset__ZLorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_skipOwnFramesAndDump__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_updateDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_setDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Word_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_setLink__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_updateTime__Lorg_vmmagic_unboxed_Word_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getOID__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getLink__Lorg_vmmagic_unboxed_ObjectReference_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getBootImageLink__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getOID__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_setOID__Lorg_vmmagic_unboxed_Word_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getHeaderSize__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getHeaderEndOffset__ () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_gcEnabled__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_adjustSlotOffset__ZLorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_skipOwnFramesAndDump__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_updateDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_setDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Word_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_setLink__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_updateTime__Lorg_vmmagic_unboxed_Word_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_getOID__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_getDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_getLink__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_getBootImageLink__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_getOID__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_setOID__Lorg_vmmagic_unboxed_Word_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_getHeaderSize__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_TraceInterface_getHeaderEndOffset__ () { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/VM.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/VM.cpp?rev=109008&r1=109007&r2=109008&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/VM.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/VM.cpp Wed Jul 21 05:29:20 2010 @@ -10,41 +10,34 @@ #include "JavaObject.h" #include "JavaThread.h" +#include "debug.h" + using namespace j3; -extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Extent_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Address_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__F () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__I () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__Ljava_lang_String_2 () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_runtime_VM_sysWriteln__ () { JavaThread::get()->printBacktrace(); abort(); } -extern "C" void Java_org_j3_runtime_VM_sysWriteln__Ljava_lang_String_2 () { JavaThread::get()->printBacktrace(); abort(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Extent_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__F () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__I () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__Ljava_lang_String_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWriteln__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWriteln__Ljava_lang_String_2 () { UNIMPLEMENTED(); } extern "C" void Java_org_j3_runtime_VM__1assert__ZLjava_lang_String_2 () { -#ifdef DEBUG - JavaThread::get()->printBacktrace(); -#endif - abort(); + ABORT(); } extern "C" void Java_org_j3_runtime_VM_sysExit__I () { -#ifdef DEBUG - JavaThread::get()->printBacktrace(); -#endif - abort(); + ABORT(); } - -extern "C" void Java_org_j3_runtime_VM_sysFail__Ljava_lang_String_2 () { -#ifdef DEBUG - JavaThread::get()->printBacktrace(); -#endif +extern "C" void Java_org_j3_runtime_VM_sysFail__Ljava_lang_String_2 () { + // Just call abort because gcmalloc calls this function. If it were to + // call printf, MMTkInline.inc could not be JIT-compiled. abort(); } extern "C" void Java_org_j3_runtime_VM__1assert__Z (bool cond) { - - assert(cond); + ASSERT(cond); } extern "C" bool Java_org_j3_runtime_VM_buildFor64Addr__ () { From nicolas.geoffray at lip6.fr Wed Jul 21 06:05:01 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 21 Jul 2010 13:05:01 -0000 Subject: [vmkit-commits] [vmkit] r109011 - in /vmkit/trunk: include/debug.h mmtk/mmtk-alloc/Selected.cpp mmtk/mmtk-j3/ObjectModel.cpp mmtk/mmtk-j3/Scanning.cpp Message-ID: <20100721130501.D9C472A6C12C@llvm.org> Author: geoffray Date: Wed Jul 21 08:05:01 2010 New Revision: 109011 URL: http://llvm.org/viewvc/llvm-project?rev=109011&view=rev Log: Add a macro for __attribute__ ((always_inline)) Modified: vmkit/trunk/include/debug.h vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/trunk/include/debug.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/debug.h?rev=109011&r1=109010&r2=109011&view=diff ============================================================================== --- vmkit/trunk/include/debug.h (original) +++ vmkit/trunk/include/debug.h Wed Jul 21 08:05:01 2010 @@ -74,4 +74,7 @@ #define ASSERT(cond) { \ if (!cond) ABORT(); } \ +#undef ALWAYS_INLINE +#define ALWAYS_INLINE __attribute__ ((always_inline)) + #endif Modified: vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp?rev=109011&r1=109010&r2=109011&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp Wed Jul 21 08:05:01 2010 @@ -15,41 +15,39 @@ #include #include +#include "debug.h" + using namespace mvm; int Collector::verbose = 0; -extern "C" void Java_org_j3_mmtk_Collection_triggerCollection__I( - uintptr_t, int32_t) __attribute__ ((always_inline)); +extern "C" void Java_org_j3_mmtk_Collection_triggerCollection__I(uintptr_t, int32_t) ALWAYS_INLINE; -extern "C" intptr_t JnJVM_org_j3_bindings_Bindings_allocateMutator__I( - int32_t) __attribute__ ((always_inline)); -extern "C" void JnJVM_org_j3_bindings_Bindings_freeMutator__Lorg_mmtk_plan_MutatorContext_2( - intptr_t) __attribute__ ((always_inline)); -extern "C" void JnJVM_org_j3_bindings_Bindings_boot__Lorg_vmmagic_unboxed_Extent_2Lorg_vmmagic_unboxed_Extent_2( - intptr_t, intptr_t) __attribute__ ((always_inline)); +extern "C" intptr_t JnJVM_org_j3_bindings_Bindings_allocateMutator__I(int32_t) ALWAYS_INLINE; +extern "C" void JnJVM_org_j3_bindings_Bindings_freeMutator__Lorg_mmtk_plan_MutatorContext_2(intptr_t) ALWAYS_INLINE; +extern "C" void JnJVM_org_j3_bindings_Bindings_boot__Lorg_vmmagic_unboxed_Extent_2Lorg_vmmagic_unboxed_Extent_2(intptr_t, intptr_t) ALWAYS_INLINE; extern "C" void JnJVM_org_j3_bindings_Bindings_processEdge__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2( - uintptr_t closure, void* source, void* slot) __attribute__ ((always_inline)); + uintptr_t closure, void* source, void* slot) ALWAYS_INLINE; extern "C" void JnJVM_org_j3_bindings_Bindings_reportDelayedRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2( - uintptr_t TraceLocal, void** slot) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void** slot) ALWAYS_INLINE; extern "C" void JnJVM_org_j3_bindings_Bindings_processRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2Z( - uintptr_t TraceLocal, void* slot, uint8_t untraced) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void* slot, uint8_t untraced) ALWAYS_INLINE; extern "C" gc* JnJVM_org_j3_bindings_Bindings_retainForFinalize__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2( - uintptr_t TraceLocal, void* obj) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void* obj) ALWAYS_INLINE; extern "C" gc* JnJVM_org_j3_bindings_Bindings_retainReferent__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2( - uintptr_t TraceLocal, void* obj) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void* obj) ALWAYS_INLINE; extern "C" gc* JnJVM_org_j3_bindings_Bindings_getForwardedReference__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2( - uintptr_t TraceLocal, void* obj) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void* obj) ALWAYS_INLINE; extern "C" gc* JnJVM_org_j3_bindings_Bindings_getForwardedReferent__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2( - uintptr_t TraceLocal, void* obj) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void* obj) ALWAYS_INLINE; extern "C" gc* JnJVM_org_j3_bindings_Bindings_getForwardedFinalizable__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2( - uintptr_t TraceLocal, void* obj) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void* obj) ALWAYS_INLINE; extern "C" uint8_t JnJVM_org_j3_bindings_Bindings_isLive__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2( - uintptr_t TraceLocal, void* obj) __attribute__ ((always_inline)); + uintptr_t TraceLocal, void* obj) ALWAYS_INLINE; extern "C" void* JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2( - int sz, void* VT) __attribute__ ((always_inline)); + int sz, void* VT) ALWAYS_INLINE; extern "C" void* gcmalloc(uint32_t sz, void* VT) { sz = llvm::RoundUpToAlignment(sz, sizeof(void*)); Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=109011&r1=109010&r2=109011&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Wed Jul 21 08:05:01 2010 @@ -75,7 +75,7 @@ } extern "C" void Java_org_j3_bindings_Bindings_memcpy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2I( - void* res, void* src, int size) __attribute__ ((always_inline)); + void* res, void* src, int size) ALWAYS_INLINE; extern "C" void Java_org_j3_bindings_Bindings_memcpy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2I( void* res, void* src, int size) { @@ -83,10 +83,10 @@ } extern "C" uintptr_t JnJVM_org_j3_bindings_Bindings_copy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II( - JavaObject* obj, VirtualTable* VT, int size, int allocator) __attribute__ ((always_inline)); + JavaObject* obj, VirtualTable* VT, int size, int allocator) ALWAYS_INLINE; extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_copy__Lorg_vmmagic_unboxed_ObjectReference_2I ( - JavaObject* OM, JavaObject* src, int allocator) __attribute__ ((always_inline)); + JavaObject* OM, JavaObject* src, int allocator) ALWAYS_INLINE; extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_copy__Lorg_vmmagic_unboxed_ObjectReference_2I ( JavaObject* OM, JavaObject* src, int allocator) { Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=109011&r1=109010&r2=109011&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Wed Jul 21 08:05:01 2010 @@ -50,7 +50,7 @@ // 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) 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(obj && "No object to trace"); From willdtz at gmail.com Wed Jul 21 11:33:46 2010 From: willdtz at gmail.com (Will Dietz) Date: Wed, 21 Jul 2010 13:33:46 -0500 Subject: [vmkit-commits] Does llc compilation of glibj.zip work on 32 bits? In-Reply-To: References: Message-ID: Thanks for looking into this Nicolas! When I do the same on 32bit linux I get a different error complaining "unsupported GC: vkmit". Any thoughts? For what it's worth, the command line invocation the Makefile generates is this: /home/will/llvm/tot/llvm-objects-32/Release+Asserts/bin/llc -relocation-model=pic -disable-fp-elim glibj-optimized.zip.bc -o glibj.zip.s So it's using stock llc, is that right (seems that you'd need to load something to tell llc about the vmkit gc)? I definitely don't know but thought I'd mention it. Thanks for your time, ~Will On Tue, Jul 20, 2010 at 6:33 PM, nicolas geoffray wrote: > I will take a look on my linux/32bit machine whether it works tomorrow (and, > as you notice Minas, will take lots of coffee waiting for it to finish). It > used to work not so long ago. It is also the only platform where I could get > it working. > However, it has never been tested on a 64bits. > Nicolas > > On Wed, Jul 21, 2010 at 1:17 AM, Will Dietz wrote: >> >> Hi Minas, all, >> >> I haven't got it working on 64bit linux, 64bit Mac, or 32bit linux. >> Reports of it working on any platform/architecture would interest me >> as well. >> >> Both optimized and unoptimized glibj.bc fail when I try to use llc to >> convert them to machine code (glibj.s). >> >> ~Will >> >> On Tue, Jul 20, 2010 at 6:12 PM, Minas Abrahamyan >> wrote: >> > Hi, >> > >> > Does llc compilation of glibj.zip work on 32 bits? or anywhere >> > >> > I reported bug about crushing of llc in llvmdev@ but yet unresponded >> > Talking about: http://vmkit.llvm.org/use_aot.html : >> >> make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 >> > >> > -Minas >> > _______________________________________________ >> > vmkit-commits mailing list >> > vmkit-commits at cs.uiuc.edu >> > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >> > >> _______________________________________________ >> vmkit-commits mailing list >> vmkit-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > From minas.subs at gmail.com Fri Jul 23 05:30:56 2010 From: minas.subs at gmail.com (Minas Abrahamyan) Date: Fri, 23 Jul 2010 17:30:56 +0500 Subject: [vmkit-commits] Debug logger patch (PRINT_DEBUG()) and how to turn it on/off In-Reply-To: References: Message-ID: Hi Nicolas, So, I've seen, that you preferred not to checkin logger (reanimated) parts, the patch I've gave. And also didn't received any answer about how do you see the use of runtime reconfiguration of logger. The only scenario I can imagine for runtime is something similar to -verbose key of 'java' utility: <<< -verbose[:class|gc|jni] enable verbose output >>> Also: <<< -Xloggc: log GC status to a file with time stamps >>> But this is quite a different story. I would prefer, in any case, to have also an option to turn off all logging for optimized Release version, for performance. Regards, Minas On Wed, Jul 21, 2010 at 3:15 AM, Minas Abrahamyan wrote: > Hi Nicolas, > > I think it is better to check it in anyway, since it will free me from > unnecessary merges of that debug logging: > since I have it, and seen it usefulness, I won't get to renounce from > its benefits. > Beside that, IMO, it is easier to get working after changes on > something working than while inserting new functionality without tests > > What is the point reconfigurable at runtime logger? > Debugging logs are running in debug versions, sometime - in releases > too, but could be switched off in final release version, > Reserving place and functions for runtime-featured logging, could have > impact on performance... or at least it is needed a global flag/define > to turn them totally off. (Now that define is DEBUG) > > -Minas > > On Tue, Jul 20, 2010 at 9:05 PM, nicolas geoffray > wrote: >> Thanks very much Minas! >> Actually, when it comes to debugging, I would love to be able to pass the >> debug level information at runtime rather than at compile-time. If you can >> come up with a better framework for debugging than what is currently there, >> that would be great. In other words, I would rather change the framework >> rather than improving it :) >> Still, I will take a look at your patch. >> Thanks! >> Nicolas >> >> On Mon, Jul 19, 2010 at 8:18 PM, Minas Abrahamyan >> wrote: >>> >>> Hi all, >>> >>> Printing of debug messages is very useful for debugging of any kind; >>> This patch allows to print them again, as it was possible few ages ago :) >>> Maybe not everything in right include files here, but that is better >>> than absence of debug logs >>> >>> To apply: >>> $ cd vmkit >>> $ patch -p1 <../vmkit_debuglog.patch >>> >>> To turn on: uncomment vmkit/include/debug.h line 13: >>> #define DEBUG 10 >>> >>> To turn off - comment it back: >>> //#define DEBUG 10 >>> >>> To manage VMCore subsystem logs generation: >>> In vmkit/lib/J3/VMCore/JnjvmConfig.h, lines 43-47: >>> #define JNJVM_LOAD 3 >>> #define JNJVM_COMPILE 2 >>> >>> JNJVM_LOAD - class loading debug level, 1-4, when 0 it is turned off >>> JNJVM_COMPILE - methods compiling debug level, when 0 it is turned off >>> >>> To add new logging messages, insert something like: >>> PRINT_DEBUG(symb, level, color, printf-like-argslist) >>> Fotr example: >>> PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "Jnjvm::loadBootstrap(){\n"); >>> where >>> symb - is subsystem debug level, >>> level - is current message required level; >>>  Message is printed only if symb>level; subsystem logging level is >>> bigger than necessary by current message level; >>> COLOR_NORMAL - is default color. >>>  ( In fact it supports fancy colour printing on terminal, through >>> third argument, but I'm not using it.) >>> >>> In this example Message will be printed if DEBUG is defined, and >>> JNJVM_LOAD >0. >>> >>> PRINT_DEBUG prints to stderr. >>> >>> == >>> Nicolas, please review and apply this patch. >>> Thanks. >>> >>> -Minas >>> >>> _______________________________________________ >>> vmkit-commits mailing list >>> vmkit-commits at cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >>> >> >> >> _______________________________________________ >> vmkit-commits mailing list >> vmkit-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits >> >> > From nicolas.geoffray at lip6.fr Sat Jul 24 03:01:51 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Jul 2010 10:01:51 -0000 Subject: [vmkit-commits] [vmkit] r109336 - /vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Message-ID: <20100724100151.3FFE72A6C12C@llvm.org> Author: geoffray Date: Sat Jul 24 05:01:51 2010 New Revision: 109336 URL: http://llvm.org/viewvc/llvm-project?rev=109336&view=rev Log: Don't forget to add the Java passes when compiling a single file. Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=109336&r1=109335&r2=109336&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Sat Jul 24 05:01:51 2010 @@ -2055,6 +2055,7 @@ } } else { + M->addJavaPasses(false); char* realName = (char*)allocator.Allocate(size + 1); if (size > 6 && !strcmp(&name[size - 6], ".class")) { memcpy(realName, name, size - 6); From nicolas.geoffray at gmail.com Sat Jul 24 03:09:24 2010 From: nicolas.geoffray at gmail.com (nicolas geoffray) Date: Sat, 24 Jul 2010 12:09:24 +0200 Subject: [vmkit-commits] Does llc compilation of glibj.zip work on 32 bits? In-Reply-To: References: Message-ID: Hi Will, I have successfully compiled glibj.zip on my linux/32bit machine, using gcc-4.3.2 version. Note that I haven't tested with llvm-gcc, and I have configured vmkit to use the GCMmap2 GC, and not MMTk. What did you give to configure? If you're not using llvm-gcc nor MMTk, llc should not complain about the GC. Nicolas On Wed, Jul 21, 2010 at 8:33 PM, Will Dietz wrote: > Thanks for looking into this Nicolas! > > When I do the same on 32bit linux I get a different error complaining > "unsupported GC: vkmit". > > Any thoughts? > > For what it's worth, the command line invocation the Makefile generates is > this: > > /home/will/llvm/tot/llvm-objects-32/Release+Asserts/bin/llc > -relocation-model=pic -disable-fp-elim glibj-optimized.zip.bc -o > glibj.zip.s > > So it's using stock llc, is that right (seems that you'd need to load > something to tell llc about the vmkit gc)? I definitely don't know > but thought I'd mention it. > > Thanks for your time, > > ~Will > > On Tue, Jul 20, 2010 at 6:33 PM, nicolas geoffray > wrote: > > I will take a look on my linux/32bit machine whether it works tomorrow > (and, > > as you notice Minas, will take lots of coffee waiting for it to finish). > It > > used to work not so long ago. It is also the only platform where I could > get > > it working. > > However, it has never been tested on a 64bits. > > Nicolas > > > > On Wed, Jul 21, 2010 at 1:17 AM, Will Dietz wrote: > >> > >> Hi Minas, all, > >> > >> I haven't got it working on 64bit linux, 64bit Mac, or 32bit linux. > >> Reports of it working on any platform/architecture would interest me > >> as well. > >> > >> Both optimized and unoptimized glibj.bc fail when I try to use llc to > >> convert them to machine code (glibj.s). > >> > >> ~Will > >> > >> On Tue, Jul 20, 2010 at 6:12 PM, Minas Abrahamyan > > >> wrote: > >> > Hi, > >> > > >> > Does llc compilation of glibj.zip work on 32 bits? or anywhere > >> > > >> > I reported bug about crushing of llc in llvmdev@ but yet unresponded > >> > Talking about: http://vmkit.llvm.org/use_aot.html : > >> >> make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 > >> > > >> > -Minas > >> > _______________________________________________ > >> > vmkit-commits mailing list > >> > vmkit-commits at cs.uiuc.edu > >> > http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > >> > > >> _______________________________________________ > >> vmkit-commits mailing list > >> vmkit-commits at cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.geoffray at lip6.fr Sat Jul 24 06:26:08 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Jul 2010 13:26:08 -0000 Subject: [vmkit-commits] [vmkit] r109338 - /vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp Message-ID: <20100724132608.CC0122A6C12C@llvm.org> Author: geoffray Date: Sat Jul 24 08:26:08 2010 New Revision: 109338 URL: http://llvm.org/viewvc/llvm-project?rev=109338&view=rev Log: Unlock the RV lock when finishing synchronizing, so that blocked threads can lock the RV lock when they wake up. Modified: vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp Modified: vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp?rev=109338&r1=109337&r2=109338&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp Sat Jul 24 08:26:08 2010 @@ -78,6 +78,7 @@ // And wait for other threads to finish. waitRV(); + unlockRV(); } void CollectionRV::join() { @@ -152,6 +153,4 @@ condEndRV.broadcast(); self->inRV = false; self->MyVM->ThreadLock.unlock(); - - unlockRV(); } From nicolas.geoffray at lip6.fr Sat Jul 24 08:38:55 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Jul 2010 15:38:55 -0000 Subject: [vmkit-commits] [vmkit] r109342 - in /vmkit/trunk/lib/J3/Compiler: JavaJIT.cpp JavaJIT.h Message-ID: <20100724153855.377BA2A6C12C@llvm.org> Author: geoffray Date: Sat Jul 24 10:38:55 2010 New Revision: 109342 URL: http://llvm.org/viewvc/llvm-project?rev=109342&view=rev Log: don't synchronize on the argument direclty but on the local that saved the argument. Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.h Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=109342&r1=109341&r2=109342&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sat Jul 24 10:38:55 2010 @@ -347,10 +347,6 @@ Constant* sizeF = ConstantInt::get(Type::getInt32Ty(*llvmContext), 2 * sizeof(void*)); Value* Frame = new AllocaInst(Type::getInt8Ty(*llvmContext), sizeF, "", currentBlock); - // Synchronize before saying we're entering native - if (isSynchro(compilingMethod->access)) - beginSynchronize(); - uint32 nargs = func->arg_size() + 1 + (stat ? 1 : 0); std::vector nativeArgs; @@ -400,6 +396,9 @@ Instruction* temp = new AllocaInst(intrinsics->JavaObjectType, "", func->begin()->getTerminator()); + if (i == func->arg_begin() && !stat) { + this->thisObject = temp; + } if (TheCompiler->useCooperativeGC()) { Value* GCArgs[2] = { @@ -473,6 +472,10 @@ currentBlock = endBlock; nativeFunc = node; } + + // Synchronize before saying we're entering native + if (isSynchro(compilingMethod->access)) + beginSynchronize(); Value* Args4[3] = { temp, oldCLIN, Frame }; @@ -727,7 +730,8 @@ void JavaJIT::beginSynchronize() { Value* obj = 0; if (isVirtual(compilingMethod->access)) { - obj = llvmFunction->arg_begin(); + assert(thisObject != NULL && "beginSynchronize without this"); + obj = new LoadInst(thisObject, "", false, currentBlock); } else { obj = TheCompiler->getJavaClassPtr(compilingClass); obj = new LoadInst(obj, "", false, currentBlock); @@ -738,7 +742,8 @@ void JavaJIT::endSynchronize() { Value* obj = 0; if (isVirtual(compilingMethod->access)) { - obj = llvmFunction->arg_begin(); + assert(thisObject != NULL && "endSynchronize without this"); + obj = new LoadInst(thisObject, "", false, currentBlock); } else { obj = TheCompiler->getJavaClassPtr(compilingClass); obj = new LoadInst(obj, "", false, currentBlock); @@ -908,6 +913,7 @@ ++i; ++index; ++count; + thisObject = objectLocals[0]; } @@ -1086,6 +1092,7 @@ ++i; ++index; ++count; + thisObject = objectLocals[0]; } for (;count < max; ++i, ++index, ++count, ++type) { Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=109342&r1=109341&r2=109342&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Sat Jul 24 10:38:55 2010 @@ -95,6 +95,7 @@ currentCtpIndex = -1; currentBytecode = -1; callNumber = 0; + thisObject = NULL; } /// javaCompile - Compile the Java method. @@ -403,6 +404,8 @@ //===-------------------------- Synchronization --------------------------===// + llvm::Value* thisObject; + /// beginSynchronize - Emit synchronization code to acquire the instance /// or the class. void beginSynchronize(); From nicolas.geoffray at lip6.fr Sat Jul 24 10:53:00 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Jul 2010 17:53:00 -0000 Subject: [vmkit-commits] [vmkit] r109345 - in /vmkit/trunk/mmtk: java/src/org/j3/mmtk/MMTk_Events.java mmtk-j3/ActivePlan.cpp mmtk-j3/MMTk_Events.cpp Message-ID: <20100724175300.EECB32A6C12C@llvm.org> Author: geoffray Date: Sat Jul 24 12:53:00 2010 New Revision: 109345 URL: http://llvm.org/viewvc/llvm-project?rev=109345&view=rev Log: Fix a bug where not all threads were returned by getNextMutator. Also implement MMTk_Events.java. Added: vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/MMTk_Events.java vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/MMTk_Events.java URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/mmtk/MMTk_Events.java?rev=109345&r1=109344&r2=109345&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/src/org/j3/mmtk/MMTk_Events.java (original) +++ vmkit/trunk/mmtk/java/src/org/j3/mmtk/MMTk_Events.java Sat Jul 24 12:53:00 2010 @@ -21,12 +21,9 @@ @Uninterruptible public class MMTk_Events extends org.mmtk.vm.MMTk_Events { - public void tracePageAcquired(Space space, Address startAddress, int numPages) { - } + public native void tracePageAcquired(Space space, Address startAddress, int numPages); - public void tracePageReleased(Space space, Address startAddress, int numPages) { - } + public native void tracePageReleased(Space space, Address startAddress, int numPages); - public void heapSizeChanged(Extent heapSize) { - } + public native void heapSizeChanged(Extent heapSize); } Modified: vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp?rev=109345&r1=109344&r2=109345&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp Sat Jul 24 12:53:00 2010 @@ -19,24 +19,26 @@ struct ActivePlan { JavaObject obj; - mvm::MutatorThread* next; + mvm::MutatorThread* current; }; extern "C" JavaObject* Java_org_j3_mmtk_ActivePlan_getNextMutator__ (ActivePlan* A) { assert(A && "No active plan"); - if (A->next == 0) A->next = (mvm::MutatorThread*)JavaThread::get()->MyVM->mainThread; - else if (A->next->next() != JavaThread::get()->MyVM->mainThread) { - A->next = 0; - return 0; + if (A->current == NULL) { + A->current = (mvm::MutatorThread*)JavaThread::get()->MyVM->mainThread; + } else if (A->current->next() == JavaThread::get()->MyVM->mainThread) { + A->current = NULL; + return NULL; + } else { + A->current = (mvm::MutatorThread*)A->current->next(); } - else A->next = (mvm::MutatorThread*)A->next->next(); - return (JavaObject*)A->next->MutatorContext; + return (JavaObject*)A->current->MutatorContext; } extern "C" void Java_org_j3_mmtk_ActivePlan_resetMutatorIterator__ (ActivePlan* A) { - A->next = 0; + A->current = NULL; } extern "C" void Java_org_j3_mmtk_ActivePlan_collectorCount__ () { UNIMPLEMENTED(); } Added: vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp?rev=109345&view=auto ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp (added) +++ vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp Sat Jul 24 12:53:00 2010 @@ -0,0 +1,37 @@ +//===----- MMTk_Events.cpp - Implementation of the MMTk_Events class -----===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "JavaArray.h" +#include "JavaClass.h" +#include "JavaObject.h" +#include "JavaThread.h" +#include "MutatorThread.h" + +using namespace j3; + +extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageAcquired__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( + JavaObject* event, JavaObject* space, uintptr_t address, int numPages) { +#ifdef DEBUG + fprintf(stderr, "Pages acquired by thread %p from space %p at %x (%d)\n", (void*)mvm::Thread::get(), (void*)space, address, numPages); +#endif +} + +extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageReleased__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( + JavaObject* event, JavaObject* space, uintptr_t address, int numPages) { +#ifdef DEBUG + fprintf(stderr, "Pages released by thread %p from space %p at %x (%d)\n", (void*)mvm::Thread::get(), (void*)space, address, numPages); +#endif +} + +extern "C" void Java_org_j3_mmtk_MMTk_1Events_heapSizeChanged__Lorg_vmmagic_unboxed_Extent_2( + uintptr_t heapSize) { +#ifdef DEBUG + fprintf(stderr, "New heap size : %d\n", (int)heapSize); +#endif +} From nicolas.geoffray at lip6.fr Sat Jul 24 12:04:07 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Jul 2010 19:04:07 -0000 Subject: [vmkit-commits] [vmkit] r109350 - in /vmkit/trunk/mmtk/mmtk-j3: ActivePlan.cpp Collection.cpp FinalizableProcessor.cpp MMTk_Events.cpp Memory.cpp ObjectModel.cpp ReferenceProcessor.cpp Scanning.cpp Statistics.cpp TraceInterface.cpp VM.cpp Message-ID: <20100724190407.A747C2A6C12C@llvm.org> Author: geoffray Date: Sat Jul 24 14:04:07 2010 New Revision: 109350 URL: http://llvm.org/viewvc/llvm-project?rev=109350&view=rev Log: Set the correct number of arguments to unimplemented functions to get rid of compile-time warnings. Modified: 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/MMTk_Events.cpp vmkit/trunk/mmtk/mmtk-j3/Memory.cpp vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp vmkit/trunk/mmtk/mmtk-j3/VM.cpp Modified: vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp Sat Jul 24 14:04:07 2010 @@ -41,4 +41,4 @@ A->current = NULL; } -extern "C" void Java_org_j3_mmtk_ActivePlan_collectorCount__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ActivePlan_collectorCount__ (ActivePlan* A) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Sat Jul 24 14:04:07 2010 @@ -112,9 +112,9 @@ } -extern "C" void Java_org_j3_mmtk_Collection_reportPhysicalAllocationFailed__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Collection_triggerAsyncCollection__I () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Collection_noThreadsInGC__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Collection_activeGCThreads__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Collection_activeGCThreadOrdinal__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Collection_requestMutatorFlush__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_reportPhysicalAllocationFailed__ (JavaObject* C) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_triggerAsyncCollection__I (JavaObject* C, sint32 val) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_noThreadsInGC__ (JavaObject* C) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_activeGCThreads__ (JavaObject* C) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_activeGCThreadOrdinal__ (JavaObject* C) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Collection_requestMutatorFlush__ (JavaObject* C) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp Sat Jul 24 14:04:07 2010 @@ -17,12 +17,12 @@ using namespace j3; -extern "C" void Java_org_j3_mmtk_FinalizableProcessor_clear__ () { +extern "C" void Java_org_j3_mmtk_FinalizableProcessor_clear__ (JavaObject* P) { UNIMPLEMENTED(); } extern "C" void -Java_org_j3_mmtk_FinalizableProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z () { +Java_org_j3_mmtk_FinalizableProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z (JavaObject* P, uintptr_t TL, uint8_t nursery) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/MMTk_Events.cpp Sat Jul 24 14:04:07 2010 @@ -30,7 +30,7 @@ } extern "C" void Java_org_j3_mmtk_MMTk_1Events_heapSizeChanged__Lorg_vmmagic_unboxed_Extent_2( - uintptr_t heapSize) { + JavaObject* event, uintptr_t heapSize) { #ifdef DEBUG fprintf(stderr, "New heap size : %d\n", (int)heapSize); #endif Modified: vmkit/trunk/mmtk/mmtk-j3/Memory.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Memory.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Memory.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Memory.cpp Sat Jul 24 14:04:07 2010 @@ -17,19 +17,19 @@ using namespace j3; -extern "C" uintptr_t Java_org_j3_mmtk_Memory_getHeapStartConstant__ () { +extern "C" uintptr_t Java_org_j3_mmtk_Memory_getHeapStartConstant__ (JavaObject* M) { return (uintptr_t)0x30000000; } -extern "C" uintptr_t Java_org_j3_mmtk_Memory_getHeapEndConstant__ () { +extern "C" uintptr_t Java_org_j3_mmtk_Memory_getHeapEndConstant__ (JavaObject* M) { return (uintptr_t)0x70000000; } -extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableStartConstant__ () { +extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableStartConstant__ (JavaObject* M) { return (uintptr_t)0x30000000; } -extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableEndConstant__ () { +extern "C" uintptr_t Java_org_j3_mmtk_Memory_getAvailableEndConstant__ (JavaObject* M) { return (uintptr_t)0x70000000; } @@ -42,12 +42,12 @@ } extern "C" void -Java_org_j3_mmtk_Memory_mprotect__Lorg_vmmagic_unboxed_Address_2I () { +Java_org_j3_mmtk_Memory_mprotect__Lorg_vmmagic_unboxed_Address_2I (JavaObject* M, uintptr_t address, sint32 size) { UNIMPLEMENTED(); } extern "C" void -Java_org_j3_mmtk_Memory_munprotect__Lorg_vmmagic_unboxed_Address_2I () { +Java_org_j3_mmtk_Memory_munprotect__Lorg_vmmagic_unboxed_Address_2I (JavaObject* M, uintptr_t address, sint32 size) { UNIMPLEMENTED(); } @@ -59,11 +59,11 @@ } extern "C" void -Java_org_j3_mmtk_Memory_zeroPages__Lorg_vmmagic_unboxed_Address_2I () { +Java_org_j3_mmtk_Memory_zeroPages__Lorg_vmmagic_unboxed_Address_2I (JavaObject* M, uintptr_t address, sint32 size) { UNIMPLEMENTED(); } extern "C" void -Java_org_j3_mmtk_Memory_dumpMemory__Lorg_vmmagic_unboxed_Address_2II () { +Java_org_j3_mmtk_Memory_dumpMemory__Lorg_vmmagic_unboxed_Address_2II (JavaObject* M, uintptr_t address, sint32 before, sint32 after) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Sat Jul 24 14:04:07 2010 @@ -16,11 +16,11 @@ using namespace j3; -extern "C" intptr_t Java_org_j3_mmtk_ObjectModel_getArrayBaseOffset__ () { +extern "C" intptr_t Java_org_j3_mmtk_ObjectModel_getArrayBaseOffset__ (JavaObject* OM) { return sizeof(JavaObject) + sizeof(ssize_t); } -extern "C" intptr_t Java_org_j3_mmtk_ObjectModel_GC_1HEADER_1OFFSET__ () { +extern "C" intptr_t Java_org_j3_mmtk_ObjectModel_GC_1HEADER_1OFFSET__ (JavaObject* OM) { return sizeof(void*); } @@ -113,17 +113,44 @@ return JnJVM_org_j3_bindings_Bindings_copy__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II(src, VT, size, allocator); } -extern "C" void Java_org_j3_mmtk_ObjectModel_copyTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getReferenceWhenCopiedTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getObjectEndAddress__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getSizeWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignOffsetWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getCurrentSize__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getNextObject__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_getArrayLength__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_isArray__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_isPrimitiveArray__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_isAcyclic__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_dumpObject__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ObjectModel_copyTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 ( + JavaObject* OM, uintptr_t from, uintptr_t to, uintptr_t region) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getReferenceWhenCopiedTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 ( + JavaObject* OM, uintptr_t from, uintptr_t to) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getObjectEndAddress__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getSizeWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getAlignOffsetWhenCopied__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getCurrentSize__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getNextObject__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getTypeDescriptor__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_getArrayLength__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_isArray__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_isPrimitiveArray__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_isAcyclic__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_ObjectModel_dumpObject__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* OM, uintptr_t object) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp Sat Jul 24 14:04:07 2010 @@ -23,21 +23,21 @@ uint32_t ordinal; }; -extern "C" void Java_org_j3_mmtk_ReferenceProcessor_scan__Lorg_mmtk_plan_TraceLocal_2Z (ReferenceProcessor* RP, JavaObject* TL, uint8_t nursery) { +extern "C" void Java_org_j3_mmtk_ReferenceProcessor_scan__Lorg_mmtk_plan_TraceLocal_2Z (ReferenceProcessor* RP, uintptr_t TL, uint8_t nursery) { mvm::Thread* th = mvm::Thread::get(); uint32_t val = RP->ordinal; if (val == 0) { - th->MyVM->scanSoftReferencesQueue(reinterpret_cast(TL)); + th->MyVM->scanSoftReferencesQueue(TL); } else if (val == 1) { - th->MyVM->scanWeakReferencesQueue(reinterpret_cast(TL)); + th->MyVM->scanWeakReferencesQueue(TL); } else { assert(val == 2); - th->MyVM->scanPhantomReferencesQueue(reinterpret_cast(TL)); + th->MyVM->scanPhantomReferencesQueue(TL); } } -extern "C" void Java_org_j3_mmtk_ReferenceProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ReferenceProcessor_clear__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_ReferenceProcessor_countWaitingReferences__ () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ReferenceProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z (ReferenceProcessor* RP, uintptr_t TL, uint8_t nursery) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ReferenceProcessor_clear__ (ReferenceProcessor* RP) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_ReferenceProcessor_countWaitingReferences__ (ReferenceProcessor* RP) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Sat Jul 24 14:04:07 2010 @@ -64,5 +64,8 @@ // Nothing to do, there are no GC objects on which the GC depends. } -extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_Scanning_precopyChildren__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* Scanning, JavaObject* TL, uintptr_t ref) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_Scanning_precopyChildren__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* Scanning, JavaObject TL, uintptr_t ref) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp Sat Jul 24 14:04:07 2010 @@ -15,15 +15,15 @@ using namespace j3; -extern "C" void Java_org_j3_mmtk_Statistics_perfCtrInit__I (JavaObject* S) { +extern "C" void Java_org_j3_mmtk_Statistics_perfCtrInit__I (JavaObject* S, sint32 val) { // Implement me } -extern "C" int64_t Java_org_j3_mmtk_Statistics_cycles__ () { +extern "C" int64_t Java_org_j3_mmtk_Statistics_cycles__ (JavaObject* S) { return 0; } -extern "C" int64_t Java_org_j3_mmtk_Statistics_nanoTime__ () { +extern "C" int64_t Java_org_j3_mmtk_Statistics_nanoTime__ (JavaObject* S) { int64_t result; struct timeval tp; @@ -46,6 +46,7 @@ extern "C" int64_t Java_org_j3_mmtk_Statistics_perfCtrReadCycles__ (JavaObject* S) { return 0; } + extern "C" int64_t Java_org_j3_mmtk_Statistics_perfCtrReadMetric__ (JavaObject* S) { return 0; } Modified: vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/TraceInterface.cpp Sat Jul 24 14:04:07 2010 @@ -14,19 +14,44 @@ using namespace j3; -extern "C" void Java_org_j3_mmtk_TraceInterface_gcEnabled__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_adjustSlotOffset__ZLorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_skipOwnFramesAndDump__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_updateDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_setDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Word_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_setLink__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_updateTime__Lorg_vmmagic_unboxed_Word_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getOID__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getLink__Lorg_vmmagic_unboxed_ObjectReference_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getBootImageLink__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getOID__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_setOID__Lorg_vmmagic_unboxed_Word_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getHeaderSize__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_mmtk_TraceInterface_getHeaderEndOffset__ () { UNIMPLEMENTED(); } +extern "C" bool Java_org_j3_mmtk_TraceInterface_gcEnabled__ (JavaObject* TI) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_adjustSlotOffset__ZLorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 ( + JavaObject* TI, bool scalar, uintptr_t src, uintptr_t slot) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_skipOwnFramesAndDump__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* TI, uintptr_t typeRef) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_updateDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* TI, uintptr_t obj) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_setDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Word_2 ( + JavaObject* TI, uintptr_t ref, uintptr_t time) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_setLink__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* TI, uintptr_t ref, uintptr_t link) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_updateTime__Lorg_vmmagic_unboxed_Word_2 ( + JavaObject* TI, uintptr_t obj) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_getOID__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* TI, uintptr_t ref) { UNIMPLEMENTED(); } + +extern "C" uintptr_t Java_org_j3_mmtk_TraceInterface_getDeathTime__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* TI, uintptr_t ref) { UNIMPLEMENTED(); } + +extern "C" uintptr_t Java_org_j3_mmtk_TraceInterface_getLink__Lorg_vmmagic_unboxed_ObjectReference_2 ( + JavaObject* TI, uintptr_t ref) { UNIMPLEMENTED(); } + +extern "C" uintptr_t Java_org_j3_mmtk_TraceInterface_getBootImageLink__ ( + JavaObject* TI) { UNIMPLEMENTED(); } + +extern "C" uintptr_t Java_org_j3_mmtk_TraceInterface_getOID__ ( + JavaObject* TI) { UNIMPLEMENTED(); } + +extern "C" void Java_org_j3_mmtk_TraceInterface_setOID__Lorg_vmmagic_unboxed_Word_2 ( + JavaObject* TI, uintptr_t oid) { UNIMPLEMENTED(); } + +extern "C" sint32 Java_org_j3_mmtk_TraceInterface_getHeaderSize__ (JavaObject* TI) { UNIMPLEMENTED(); } +extern "C" sint32 Java_org_j3_mmtk_TraceInterface_getHeaderEndOffset__ (JavaObject* TI) { UNIMPLEMENTED(); } Modified: vmkit/trunk/mmtk/mmtk-j3/VM.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/VM.cpp?rev=109350&r1=109349&r2=109350&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/VM.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/VM.cpp Sat Jul 24 14:04:07 2010 @@ -8,29 +8,30 @@ //===----------------------------------------------------------------------===// #include "JavaObject.h" +#include "JavaString.h" #include "JavaThread.h" #include "debug.h" using namespace j3; -extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Extent_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Address_2 () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__F () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__I () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_runtime_VM_sysWrite__Ljava_lang_String_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Extent_2 (uintptr_t e) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__Lorg_vmmagic_unboxed_Address_2 (uintptr_t a) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__F (float f) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__I (int i) { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWrite__Ljava_lang_String_2 (JavaString* msg) { UNIMPLEMENTED(); } extern "C" void Java_org_j3_runtime_VM_sysWriteln__ () { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_runtime_VM_sysWriteln__Ljava_lang_String_2 () { UNIMPLEMENTED(); } +extern "C" void Java_org_j3_runtime_VM_sysWriteln__Ljava_lang_String_2 (JavaString* msg) { UNIMPLEMENTED(); } -extern "C" void Java_org_j3_runtime_VM__1assert__ZLjava_lang_String_2 () { +extern "C" void Java_org_j3_runtime_VM__1assert__ZLjava_lang_String_2 (bool cond, JavaString* msg) { ABORT(); } -extern "C" void Java_org_j3_runtime_VM_sysExit__I () { +extern "C" void Java_org_j3_runtime_VM_sysExit__I (int i) { ABORT(); } -extern "C" void Java_org_j3_runtime_VM_sysFail__Ljava_lang_String_2 () { +extern "C" void Java_org_j3_runtime_VM_sysFail__Ljava_lang_String_2 (JavaString* msg) { // Just call abort because gcmalloc calls this function. If it were to // call printf, MMTkInline.inc could not be JIT-compiled. abort(); From nicolas.geoffray at lip6.fr Sat Jul 24 12:32:17 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 24 Jul 2010 19:32:17 -0000 Subject: [vmkit-commits] [vmkit] r109352 - /vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Message-ID: <20100724193217.CEEAD2A6C12C@llvm.org> Author: geoffray Date: Sat Jul 24 14:32:17 2010 New Revision: 109352 URL: http://llvm.org/viewvc/llvm-project?rev=109352&view=rev Log: If the return value is an object, save it in a stack slot before calling endSynchronize. Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=109352&r1=109351&r2=109352&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sat Jul 24 14:32:17 2010 @@ -1280,6 +1280,22 @@ } currentBlock = endBlock; + + Instruction* returnValue = NULL; + if (returnType == intrinsics->JavaObjectType && + TheCompiler->useCooperativeGC()) { + returnValue = new AllocaInst(intrinsics->JavaObjectType, "", + func->begin()->getTerminator()); + Value* GCArgs[2] = { + new BitCastInst(returnValue, intrinsics->ptrPtrType, "", + func->begin()->getTerminator()), + intrinsics->constantPtrNull + }; + + CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, GCArgs + 2, "", + func->begin()->getTerminator()); + new StoreInst(endNode, returnValue, currentBlock); + } if (isSynchro(compilingMethod->access)) endSynchronize(); @@ -1318,10 +1334,18 @@ if (PI == PE) { currentBlock->eraseFromParent(); } else { - if (returnType != Type::getVoidTy(*llvmContext)) - ReturnInst::Create(*llvmContext, endNode, currentBlock); - else + if (returnType != Type::getVoidTy(*llvmContext)) { + if (returnType == intrinsics->JavaObjectType && + TheCompiler->useCooperativeGC()) { + assert(returnValue && "No return value set"); + Value* obj = new LoadInst(returnValue, "", false, currentBlock); + ReturnInst::Create(*llvmContext, obj, currentBlock); + } else { + ReturnInst::Create(*llvmContext, endNode, currentBlock); + } + } else { ReturnInst::Create(*llvmContext, currentBlock); + } } currentBlock = endExceptionBlock; From nicolas.geoffray at lip6.fr Sun Jul 25 03:44:47 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Jul 2010 10:44:47 -0000 Subject: [vmkit-commits] [vmkit] r109369 - /vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Message-ID: <20100725104447.A33552A6C12C@llvm.org> Author: geoffray Date: Sun Jul 25 05:44:47 2010 New Revision: 109369 URL: http://llvm.org/viewvc/llvm-project?rev=109369&view=rev Log: don't trace the delegatee direclty, it triggers an MMTk assert. Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp?rev=109369&r1=109368&r2=109369&view=diff ============================================================================== --- vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/J3/VMCore/VirtualTables.cpp Sun Jul 25 05:44:47 2010 @@ -166,9 +166,6 @@ for (uint32 i = 0; i < NR_ISOLATES; ++i) { if (delegatee[i] != NULL) { - // TODO: remove this call to trace once no delegatee is static allocated - // in AOT mode. - delegatee[i]->tracer(closure); mvm::Collector::markAndTraceRoot(delegatee + i, closure); } } From nicolas.geoffray at lip6.fr Sun Jul 25 03:45:35 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Jul 2010 10:45:35 -0000 Subject: [vmkit-commits] [vmkit] r109370 - /vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Message-ID: <20100725104536.66B412A6C12C@llvm.org> Author: geoffray Date: Sun Jul 25 05:45:35 2010 New Revision: 109370 URL: http://llvm.org/viewvc/llvm-project?rev=109370&view=rev Log: Implement Scanning.scanObject. Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=109370&r1=109369&r2=109370&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Sun Jul 25 05:45:35 2010 @@ -65,7 +65,13 @@ } extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 ( - JavaObject* Scanning, JavaObject* TL, uintptr_t ref) { UNIMPLEMENTED(); } + JavaObject* Scanning, uintptr_t TC, JavaObject* obj) { + assert(obj && "No object to trace"); + if (obj->getVirtualTable()) { + assert(obj->getVirtualTable()->tracer && "No tracer in VT"); + obj->tracer(TC); + } +} extern "C" void Java_org_j3_mmtk_Scanning_precopyChildren__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2 ( JavaObject* Scanning, JavaObject TL, uintptr_t ref) { UNIMPLEMENTED(); } From nicolas.geoffray at lip6.fr Sun Jul 25 03:47:32 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Jul 2010 10:47:32 -0000 Subject: [vmkit-commits] [vmkit] r109371 - /vmkit/trunk/include/debug.h Message-ID: <20100725104732.E00BA2A6C12C@llvm.org> Author: geoffray Date: Sun Jul 25 05:47:32 2010 New Revision: 109371 URL: http://llvm.org/viewvc/llvm-project?rev=109371&view=rev Log: define DEBUG if _DEBUG is defined. Modified: vmkit/trunk/include/debug.h Modified: vmkit/trunk/include/debug.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/debug.h?rev=109371&r1=109370&r2=109371&view=diff ============================================================================== --- vmkit/trunk/include/debug.h (original) +++ vmkit/trunk/include/debug.h Sun Jul 25 05:47:32 2010 @@ -77,4 +77,10 @@ #undef ALWAYS_INLINE #define ALWAYS_INLINE __attribute__ ((always_inline)) +#ifndef DEBUG +#ifdef _DEBUG +#define DEBUG +#endif +#endif + #endif From nicolas.geoffray at lip6.fr Sun Jul 25 11:17:16 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 25 Jul 2010 18:17:16 -0000 Subject: [vmkit-commits] [vmkit] r109376 - in /vmkit/trunk/lib/J3/Compiler: JavaJIT.cpp JavaJIT.h JavaJITOpcodes.cpp Message-ID: <20100725181716.5A22C2A6C12C@llvm.org> Author: geoffray Date: Sun Jul 25 13:17:16 2010 New Revision: 109376 URL: http://llvm.org/viewvc/llvm-project?rev=109376&view=rev Log: Don't load values before calling the runtime. Make sure there are no loaded values before a runtime call. Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp vmkit/trunk/lib/J3/Compiler/JavaJIT.h vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=109376&r1=109375&r2=109376&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Sun Jul 25 13:17:16 2010 @@ -116,19 +116,17 @@ } } -#if !defined(WITHOUT_VTABLE) Typedef* retTypedef = signature->getReturnType(); std::vector args; // size = [signature->nbIn + 3]; LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature); const llvm::FunctionType* virtualType = LSI->getVirtualType(); FunctionType::param_iterator it = virtualType->param_end(); - makeArgs(it, index, args, signature->nbArguments + 1); const llvm::Type* retType = virtualType->getReturnType(); - - JITVerifyNull(args[0]); bool needsInit = false; if (canBeDirect && meth && !TheCompiler->needsCallback(meth, &needsInit)) { + makeArgs(it, index, args, signature->nbArguments + 1); + JITVerifyNull(args[0]); val = invoke(TheCompiler->getMethod(meth), args, "", currentBlock); } else { @@ -167,8 +165,6 @@ } #endif - Value* VT = CallInst::Create(intrinsics->GetVTFunction, args[0], "", - currentBlock); Value* indexes2[2]; indexes2[0] = intrinsics->constantZero; @@ -206,7 +202,9 @@ Args.push_back(TheCompiler->getNativeClass(compilingClass)); Args.push_back(ConstantInt::get(Type::getInt32Ty(*llvmContext), index)); Args.push_back(GV); - Args.push_back(args[0]); + Value* targetObject = getTarget(virtualType->param_end(), + signature->nbArguments + 1); + Args.push_back(new LoadInst(targetObject, "", false, currentBlock)); load = invoke(intrinsics->VirtualLookupFunction, Args, "", currentBlock); node->addIncoming(load, currentBlock); BranchInst::Create(endResolveVirtual, currentBlock); @@ -219,6 +217,11 @@ indexesCtp = mul; #endif } + + makeArgs(it, index, args, signature->nbArguments + 1); + JITVerifyNull(args[0]); + Value* VT = CallInst::Create(intrinsics->GetVTFunction, args[0], "", + currentBlock); Value* FuncPtr = GetElementPtrInst::Create(VT, indexes2, indexes2 + 2, "", currentBlock); @@ -256,10 +259,6 @@ } } } - -#else - return invokeInterface(index); -#endif } llvm::Value* JavaJIT::getCurrentThread(const llvm::Type* Ty) { @@ -1570,7 +1569,28 @@ for (uint32 i = 0; i < nb; ++i) { Args.push_back(args[i]); } - +} + +Value* JavaJIT::getTarget(FunctionType::param_iterator it, uint32 nb) { +#if defined(ISOLATE_SHARING) + nb += 1; +#endif +#if defined(ISOLATE_SHARING) + sint32 start = nb - 2; + it--; + it--; +#else + sint32 start = nb - 1; +#endif + uint32 nbObjects = 0; + for (sint32 i = start; i >= 0; --i) { + it--; + if (it->get() == intrinsics->JavaObjectType) { + nbObjects++; + } + } + assert(nbObjects > 0 && "No this"); + return objectStack[currentStackIndex - nbObjects]; } Instruction* JavaJIT::lowerMathOps(const UTF8* name, @@ -1707,19 +1727,6 @@ LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature); const llvm::FunctionType* virtualType = LSI->getVirtualType(); llvm::Instruction* val = 0; - - std::vector args; - FunctionType::param_iterator it = virtualType->param_end(); - makeArgs(it, index, args, signature->nbArguments + 1); - - if (!meth) { - meth = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_VIRTUAL, signature); - } - - if (meth == compilingClass->classLoader->bootstrapLoader->upcalls->InitObject) - return; - - JITVerifyNull(args[0]); #if defined(ISOLATE_SHARING) const Type* Ty = intrinsics->ConstantPoolType; @@ -1747,27 +1754,41 @@ args.push_back(node); #endif + if (!meth) { + meth = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_VIRTUAL, signature); + } + + Value* func = 0; + bool needsInit = false; + if (TheCompiler->needsCallback(meth, &needsInit)) { + if (needsInit) { + // Make sure the class is loaded before materializing the method. + uint32 clIndex = ctpInfo->getClassIndexFromMethod(index); + UserCommonClass* cl = 0; + Value* Cl = getResolvedCommonClass(clIndex, false, &cl); + if (cl == NULL) { + CallInst::Create(intrinsics->ForceLoadedCheckFunction, Cl, "", + currentBlock); + } + } + func = TheCompiler->addCallback(compilingClass, index, signature, false, + currentBlock); + } else { + func = TheCompiler->getMethod(meth); + } + + std::vector args; + FunctionType::param_iterator it = virtualType->param_end(); + makeArgs(it, index, args, signature->nbArguments + 1); + JITVerifyNull(args[0]); + + if (meth == compilingClass->classLoader->bootstrapLoader->upcalls->InitObject) { + return; + } + if (meth && canBeInlined(meth)) { val = invokeInline(meth, args); } else { - Value* func = 0; - bool needsInit = false; - if (TheCompiler->needsCallback(meth, &needsInit)) { - if (needsInit) { - // Make sure the class is loaded before materializing the method. - uint32 clIndex = ctpInfo->getClassIndexFromMethod(index); - UserCommonClass* cl = 0; - Value* Cl = getResolvedCommonClass(clIndex, false, &cl); - if (!cl) { - CallInst::Create(intrinsics->ForceLoadedCheckFunction, Cl, "", - currentBlock); - } - } - func = TheCompiler->addCallback(compilingClass, index, signature, false, - currentBlock); - } else { - func = TheCompiler->getMethod(meth); - } val = invoke(func, args, "", currentBlock); } @@ -1784,70 +1805,66 @@ } } } - } void JavaJIT::invokeStatic(uint16 index) { JavaConstantPool* ctpInfo = compilingClass->ctpInfo; Signdef* signature = 0; const UTF8* name = 0; - const UTF8* cl = 0; - ctpInfo->nameOfStaticOrSpecialMethod(index, cl, name, signature); + const UTF8* className = 0; + ctpInfo->nameOfStaticOrSpecialMethod(index, className, name, signature); LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature); const llvm::FunctionType* staticType = LSI->getStaticType(); - llvm::Instruction* val = 0; - - std::vector args; // size = [signature->nbIn + 2]; - FunctionType::param_iterator it = staticType->param_end(); - makeArgs(it, index, args, signature->nbArguments); ctpInfo->markAsStaticCall(index); - JnjvmBootstrapLoader* loader = compilingClass->classLoader->bootstrapLoader; - if (cl->equals(loader->mathName)) { - val = lowerMathOps(name, args); - } - - else if (cl->equals(loader->stackWalkerName)) { + llvm::Instruction* val = 0; + + if (className->equals(loader->stackWalkerName)) { callsStackWalker = true; } - if (!val) { - JavaMethod* meth = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_STATIC, - signature); + JavaMethod* meth = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_STATIC, + signature); + uint32 clIndex = ctpInfo->getClassIndexFromMethod(index); + UserClass* cl = 0; + Value* Cl = getResolvedClass(clIndex, true, true, &cl); + if (!meth || (cl && needsInitialisationCheck(cl, compilingClass))) { + CallInst::Create(intrinsics->ForceInitialisationCheckFunction, Cl, "", + currentBlock); + } + + Value* func = 0; + bool needsInit = false; + if (TheCompiler->needsCallback(meth, &needsInit)) { + func = TheCompiler->addCallback(compilingClass, index, signature, + true, currentBlock); + } else { + func = TheCompiler->getMethod(meth); + } + #if defined(ISOLATE_SHARING) - Value* newCtpCache = getConstantPoolAt(index, - intrinsics->StaticCtpLookupFunction, - intrinsics->ConstantPoolType, 0, - false); - args.push_back(newCtpCache); + Value* newCtpCache = getConstantPoolAt(index, + intrinsics->StaticCtpLookupFunction, + intrinsics->ConstantPoolType, 0, + false); #endif + std::vector args; // size = [signature->nbIn + 2]; + FunctionType::param_iterator it = staticType->param_end(); + makeArgs(it, index, args, signature->nbArguments); +#if defined(ISOLATE_SHARING) + args.push_back(newCtpCache); +#endif + + if (className->equals(loader->mathName)) { + val = lowerMathOps(name, args); + } - uint32 clIndex = ctpInfo->getClassIndexFromMethod(index); - UserClass* cl = 0; - Value* Cl = getResolvedClass(clIndex, true, true, &cl); - if (!meth || (cl && needsInitialisationCheck(cl, compilingClass))) { - CallInst::Create(intrinsics->ForceInitialisationCheckFunction, Cl, "", - currentBlock); - } - - if (meth && canBeInlined(meth)) { + if (val == NULL) { + if (meth != NULL && canBeInlined(meth)) { val = invokeInline(meth, args); } else { - Value* func = 0; - bool needsInit = false; - if (TheCompiler->needsCallback(meth, &needsInit)) { - func = TheCompiler->addCallback(compilingClass, index, signature, - true, currentBlock); - } else { - /*if (meth == upcalls->SystemArraycopy || - meth == upcalls->VMSystemArraycopy) { - lowerArraycopy(args); - return; - }*/ - func = TheCompiler->getMethod(meth); - } val = invoke(func, args, "", currentBlock); } } @@ -2009,7 +2026,7 @@ } Value* JavaJIT::ldResolved(uint16 index, bool stat, Value* object, - const Type* fieldType, const Type* fieldTypePtr) { + const Type* fieldTypePtr) { JavaConstantPool* info = compilingClass->ctpInfo; JavaField* field = info->lookupField(index, stat); @@ -2038,6 +2055,8 @@ currentBlock); #endif } else { + object = new LoadInst(object, false, currentBlock); + JITVerifyNull(object); type = LCI->getVirtualType(); } @@ -2057,13 +2076,15 @@ intrinsics->VirtualFieldLookupFunction; const Type* returnType = 0; - if (stat) + if (stat) { returnType = intrinsics->ptrType; - else + } else { returnType = Type::getInt32Ty(*llvmContext); + } Value* ptr = getConstantPoolAt(index, func, returnType, 0, true); if (!stat) { + object = new LoadInst(object, false, currentBlock); Value* tmp = new BitCastInst(object, Pty, "", currentBlock); Value* args[2] = { zero, ptr }; ptr = GetElementPtrInst::Create(tmp, args, args + 2, "", currentBlock); @@ -2100,22 +2121,22 @@ void JavaJIT::setStaticField(uint16 index) { - Value* val = pop(); - Typedef* sign = compilingClass->ctpInfo->infoOfField(index); LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign); const Type* type = LAI.llvmType; - - if (type == Type::getInt64Ty(*llvmContext) || type == Type::getDoubleTy(*llvmContext)) { + + Value* ptr = ldResolved(index, true, NULL, LAI.llvmTypePtr); + + Value* val = pop(); + if (type == Type::getInt64Ty(*llvmContext) || + type == Type::getDoubleTy(*llvmContext)) { val = pop(); } - - Value* ptr = ldResolved(index, true, 0, type, LAI.llvmTypePtr); - + if (type != val->getType()) { // int1, int8, int16 convertValue(val, type, currentBlock, false); } - + new StoreInst(val, ptr, false, currentBlock); } @@ -2124,7 +2145,7 @@ LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign); const Type* type = LAI.llvmType; - Value* ptr = ldResolved(index, true, 0, type, LAI.llvmTypePtr); + Value* ptr = ldResolved(index, true, NULL, LAI.llvmTypePtr); bool final = false; #if !defined(ISOLATE) && !defined(ISOLATE_SHARING) @@ -2194,20 +2215,24 @@ } void JavaJIT::setVirtualField(uint16 index) { - Value* val = pop(); Typedef* sign = compilingClass->ctpInfo->infoOfField(index); LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign); const Type* type = LAI.llvmType; - + int stackIndex = currentStackIndex - 2; + if (type == Type::getInt64Ty(*llvmContext) || + type == Type::getDoubleTy(*llvmContext)) { + stackIndex--; + } + Value* object = objectStack[stackIndex]; + Value* ptr = ldResolved(index, false, object, LAI.llvmTypePtr); + + Value* val = pop(); if (type == Type::getInt64Ty(*llvmContext) || type == Type::getDoubleTy(*llvmContext)) { val = pop(); } + pop(); // Pop the object - Value* object = pop(); - JITVerifyNull(object); - Value* ptr = ldResolved(index, false, object, type, LAI.llvmTypePtr); - if (type != val->getType()) { // int1, int8, int16 convertValue(val, type, currentBlock, false); } @@ -2222,10 +2247,10 @@ LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign); const Type* type = LAI.llvmType; - Value* obj = pop(); - JITVerifyNull(obj); + Value* obj = objectStack[currentStackIndex - 1]; + pop(); // Pop the object - Value* ptr = ldResolved(index, false, obj, type, LAI.llvmTypePtr); + Value* ptr = ldResolved(index, false, obj, LAI.llvmTypePtr); JnjvmBootstrapLoader* JBL = compilingClass->classLoader->bootstrapLoader; bool final = false; @@ -2282,12 +2307,7 @@ LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature); const llvm::FunctionType* virtualType = LSI->getVirtualType(); const llvm::PointerType* virtualPtrType = LSI->getVirtualPtrType(); - - std::vector args; // size = [signature->nbIn + 3]; - - FunctionType::param_iterator it = virtualType->param_end(); - makeArgs(it, index, args, signature->nbArguments + 1); - + const llvm::Type* retType = virtualType->getReturnType(); BasicBlock* endBlock = createBasicBlock("end interface invoke"); PHINode * node = 0; @@ -2295,7 +2315,6 @@ node = PHINode::Create(retType, "", endBlock); } - JITVerifyNull(args[0]); CommonClass* cl = 0; JavaMethod* meth = 0; @@ -2309,6 +2328,14 @@ intrinsics->JavaMethodType, 0, true); } + // Compute the arguments after calling getConstantPoolAt because the + // arguments will be loaded and the runtime may trigger GC. + std::vector args; // size = [signature->nbIn + 3]; + + FunctionType::param_iterator it = virtualType->param_end(); + makeArgs(it, index, args, signature->nbArguments + 1); + JITVerifyNull(args[0]); + BasicBlock* label_bb = createBasicBlock("bb"); BasicBlock* label_bb4 = createBasicBlock("bb4"); BasicBlock* label_bb6 = createBasicBlock("bb6"); Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=109376&r1=109375&r2=109376&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Sun Jul 25 13:17:16 2010 @@ -301,6 +301,7 @@ #endif } + /// pop - Pop a value from the stack and return it. llvm::Value* pop() { llvm::Value* res = top(); @@ -312,21 +313,22 @@ /// top - Return the value on top of the stack. llvm::Value* top() { CommonClass* cl = stack.back(); - if (cl == upcalls->OfInt) + if (cl == upcalls->OfInt) { return new llvm::LoadInst(intStack[currentStackIndex - 1], false, currentBlock); - if (cl == upcalls->OfFloat) + } else if (cl == upcalls->OfFloat) { return new llvm::LoadInst(floatStack[currentStackIndex - 1], false, currentBlock); - if (cl == upcalls->OfDouble) + } else if (cl == upcalls->OfDouble) { return new llvm::LoadInst(doubleStack[currentStackIndex - 1], false, currentBlock); - if (cl == upcalls->OfLong) + } else if (cl == upcalls->OfLong) { return new llvm::LoadInst(longStack[currentStackIndex - 1], false, currentBlock); - - return new llvm::LoadInst(objectStack[currentStackIndex - 1], false, - currentBlock); + } else { + return new llvm::LoadInst(objectStack[currentStackIndex - 1], false, + currentBlock); + } } /// topTypeInfo - Return the type of the value on top of the stack. @@ -440,7 +442,6 @@ /// ldResolved - Emit code to get a pointer to a field. llvm::Value* ldResolved(uint16 index, bool stat, llvm::Value* object, - const llvm::Type* fieldType, const llvm::Type* fieldTypePtr); //===--------------------- Constant pool accesses ------------------------===// @@ -470,6 +471,9 @@ void makeArgs(llvm::FunctionType::param_iterator it, uint32 index, std::vector& result, uint32 nb); + /// getTarget - Get the target object for invocation. + llvm::Value* getTarget(llvm::FunctionType::param_iterator it, uint32 nb); + /// invokeVirtual - Invoke a Java virtual method. void invokeVirtual(uint16 index); Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=109376&r1=109375&r2=109376&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Sun Jul 25 13:17:16 2010 @@ -682,14 +682,14 @@ } case AASTORE : { - Value* val = pop(); - Value* index = pop(); - Value* obj = pop(); - Value* ptr = verifyAndComputePtr(obj, index, - intrinsics->JavaArrayObjectType); - if (TheCompiler->hasExceptionsEnabled()) { - + // Get val and object and don't pop them: IsAssignableFromFunction + // may go into runtime and we don't want values in registers at that + // point. + Value* val = new LoadInst(objectStack[currentStackIndex - 1], false, + currentBlock); + Value* obj = new LoadInst(objectStack[currentStackIndex - 3], false, + currentBlock); Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, val, intrinsics->JavaObjectNullConstant, ""); @@ -720,6 +720,11 @@ currentBlock = endBlock; } + Value* val = pop(); + Value* index = pop(); + Value* obj = pop(); + Value* ptr = verifyAndComputePtr(obj, index, + intrinsics->JavaArrayObjectType); new StoreInst(val, ptr, false, currentBlock); break; From nicolas.geoffray at lip6.fr Mon Jul 26 11:25:18 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 26 Jul 2010 18:25:18 -0000 Subject: [vmkit-commits] [vmkit] r109417 - /vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Message-ID: <20100726182518.1B2682A6C12F@llvm.org> Author: geoffray Date: Mon Jul 26 13:25:17 2010 New Revision: 109417 URL: http://llvm.org/viewvc/llvm-project?rev=109417&view=rev Log: Minor bugfixes in the compiler for the GC. Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=109417&r1=109416&r2=109417&view=diff ============================================================================== --- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Mon Jul 26 13:25:17 2010 @@ -1063,16 +1063,7 @@ longStack.push_back(new AllocaInst(Type::getInt64Ty(*llvmContext), "", currentBlock)); floatStack.push_back(new AllocaInst(Type::getFloatTy(*llvmContext), "", currentBlock)); } - -#if JNJVM_EXECUTE > 0 - { - Value* arg = TheCompiler->getMethodInClass(compilingMethod); - - llvm::CallInst::Create(intrinsics->PrintMethodStartFunction, arg, "", - currentBlock); - } -#endif - + uint32 index = 0; uint32 count = 0; #if defined(ISOLATE_SHARING) @@ -1121,6 +1112,16 @@ } } + // Now that arguments have been setup, we can proceed with runtime calls. +#if JNJVM_EXECUTE > 0 + { + Value* arg = TheCompiler->getMethodInClass(compilingMethod); + + llvm::CallInst::Create(intrinsics->PrintMethodStartFunction, arg, "", + currentBlock); + } +#endif + #if defined(ISOLATE_SHARING) ctpCache = i; Value* addrCtpCache = new AllocaInst(intrinsics->ConstantPoolType, "", @@ -1284,15 +1285,16 @@ if (returnType == intrinsics->JavaObjectType && TheCompiler->useCooperativeGC()) { returnValue = new AllocaInst(intrinsics->JavaObjectType, "", - func->begin()->getTerminator()); - Value* GCArgs[2] = { - new BitCastInst(returnValue, intrinsics->ptrPtrType, "", - func->begin()->getTerminator()), - intrinsics->constantPtrNull - }; + func->begin()->begin()); + Instruction* cast = + new BitCastInst(returnValue, intrinsics->ptrPtrType, ""); + cast->insertAfter(returnValue); + Value* GCArgs[2] = { cast, intrinsics->constantPtrNull }; - CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, GCArgs + 2, "", - func->begin()->getTerminator()); + Instruction* call = + CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, GCArgs + 2, ""); + call->insertAfter(cast); + new StoreInst(endNode, returnValue, currentBlock); } From nicolas.geoffray at lip6.fr Mon Jul 26 11:26:14 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 26 Jul 2010 18:26:14 -0000 Subject: [vmkit-commits] [vmkit] r109418 - /vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Message-ID: <20100726182614.934232A6C12F@llvm.org> Author: geoffray Date: Mon Jul 26 13:26:14 2010 New Revision: 109418 URL: http://llvm.org/viewvc/llvm-project?rev=109418&view=rev Log: The virtual table *must* be set. Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=109418&r1=109417&r2=109418&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Mon Jul 26 13:26:14 2010 @@ -54,10 +54,9 @@ 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(obj && "No object to trace"); - if (obj->getVirtualTable()) { - assert(obj->getVirtualTable()->tracer && "No tracer in VT"); - obj->tracer(reinterpret_cast(TC)); - } + assert(obj->getVirtualTable() && "Vo virtual table"); + assert(obj->getVirtualTable()->tracer && "No tracer in VT"); + obj->tracer(reinterpret_cast(TC)); } extern "C" void Java_org_j3_mmtk_Scanning_preCopyGCInstances__Lorg_mmtk_plan_TraceLocal_2 (JavaObject* Scanning, JavaObject* TL) { @@ -67,10 +66,9 @@ extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 ( JavaObject* Scanning, uintptr_t TC, JavaObject* obj) { assert(obj && "No object to trace"); - if (obj->getVirtualTable()) { - assert(obj->getVirtualTable()->tracer && "No tracer in VT"); - obj->tracer(TC); - } + assert(obj->getVirtualTable() && "Vo virtual table"); + assert(obj->getVirtualTable()->tracer && "No tracer in VT"); + obj->tracer(TC); } extern "C" void Java_org_j3_mmtk_Scanning_precopyChildren__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_ObjectReference_2 ( From nicolas.geoffray at lip6.fr Mon Jul 26 14:40:47 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 26 Jul 2010 21:40:47 -0000 Subject: [vmkit-commits] [vmkit] r109446 - /vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Message-ID: <20100726214047.54B0F2A6C12C@llvm.org> Author: geoffray Date: Mon Jul 26 16:40:47 2010 New Revision: 109446 URL: http://llvm.org/viewvc/llvm-project?rev=109446&view=rev Log: Fix typo. Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=109446&r1=109445&r2=109446&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Mon Jul 26 16:40:47 2010 @@ -54,7 +54,7 @@ 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(obj && "No object to trace"); - assert(obj->getVirtualTable() && "Vo virtual table"); + assert(obj->getVirtualTable() && "No virtual table"); assert(obj->getVirtualTable()->tracer && "No tracer in VT"); obj->tracer(reinterpret_cast(TC)); } @@ -66,7 +66,7 @@ extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 ( JavaObject* Scanning, uintptr_t TC, JavaObject* obj) { assert(obj && "No object to trace"); - assert(obj->getVirtualTable() && "Vo virtual table"); + assert(obj->getVirtualTable() && "No virtual table"); assert(obj->getVirtualTable()->tracer && "No tracer in VT"); obj->tracer(TC); } From nicolas.geoffray at lip6.fr Wed Jul 28 16:04:40 2010 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 28 Jul 2010 23:04:40 -0000 Subject: [vmkit-commits] [vmkit] r109688 - in /vmkit/trunk: include/debug.h include/mvm/Threads/CollectionRV.h include/mvm/Threads/Thread.h include/mvm/VirtualMachine.h lib/Mvm/CommonThread/CollectionRV.cpp lib/Mvm/CommonThread/ctthread.cpp Message-ID: <20100728230440.E3F3C2A6C12C@llvm.org> Author: geoffray Date: Wed Jul 28 18:04:40 2010 New Revision: 109688 URL: http://llvm.org/viewvc/llvm-project?rev=109688&view=rev Log: Rewrite CollectionRV with two classes: one for uncooperative mode, one for cooperative mode. Modified: vmkit/trunk/include/debug.h vmkit/trunk/include/mvm/Threads/CollectionRV.h vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/include/mvm/VirtualMachine.h vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Modified: vmkit/trunk/include/debug.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/debug.h?rev=109688&r1=109687&r2=109688&view=diff ============================================================================== --- vmkit/trunk/include/debug.h (original) +++ vmkit/trunk/include/debug.h Wed Jul 28 18:04:40 2010 @@ -70,6 +70,7 @@ abort(); } \ #define ABORT() UNIMPLEMENTED() +#define UNREACHABLE() ABORT() #define ASSERT(cond) { \ if (!cond) ABORT(); } \ Modified: vmkit/trunk/include/mvm/Threads/CollectionRV.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/CollectionRV.h?rev=109688&r1=109687&r2=109688&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/CollectionRV.h (original) +++ vmkit/trunk/include/mvm/Threads/CollectionRV.h Wed Jul 28 18:04:40 2010 @@ -17,7 +17,7 @@ namespace mvm { class CollectionRV { - +protected: /// _lockRV - Lock for synchronization. LockNormal _lockRV; @@ -30,26 +30,11 @@ /// nbJoined - Number of threads that joined the rendezvous. unsigned nbJoined; - /// cooperative - Is the rendez-vous cooperative? - bool cooperative; - - /// rendezvousNb - The identifier of the rendez-vous. - unsigned rendezvousNb; - -public: - +public: CollectionRV() { - rendezvousNb = 0; nbJoined = 0; -#ifdef WITH_LLVM_GCC - cooperative = true; -#else - cooperative = false; -#endif } - bool isCooperative() { return cooperative; } - void lockRV() { _lockRV.lock(); } void unlockRV() { _lockRV.unlock(); } @@ -65,20 +50,38 @@ unlockRV(); mvm::Thread::get()->inRV = false; } - - void finishRV(); - void collectorGo() { condInitiator.broadcast(); } + void another_mark(); - void another_mark() { nbJoined++; } + virtual void finishRV() = 0; + virtual void synchronize() = 0; + virtual void join() = 0; + virtual void joinAfterUncooperative() = 0; + virtual void joinBeforeUncooperative() = 0; +}; + +class CooperativeCollectionRV : public CollectionRV { +public: + void finishRV(); void synchronize(); void join(); + void joinAfterUncooperative(); + void joinBeforeUncooperative(); +}; + +class UncooperativeCollectionRV : public CollectionRV { +public: + void finishRV(); + void synchronize(); - unsigned getNumber() { return rendezvousNb; } + void join(); + void joinAfterUncooperative(); + void joinBeforeUncooperative(); }; + } #endif Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=109688&r1=109687&r2=109688&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Wed Jul 28 18:04:40 2010 @@ -231,10 +231,6 @@ /// virtual void internalClearException() {} - /// joinRV - Join a rendezvous. - /// - void joinRV(); - public: /// tracer - Does nothing. Used for child classes which may defined @@ -244,6 +240,9 @@ void* getLastSP() { return lastSP; } void setLastSP(void* V) { lastSP = V; } + + void joinRVBeforeEnter(); + void joinRVAfterLeave(); void enterUncooperativeCode(unsigned level = 0) __attribute__ ((noinline)) { if (isMvmThread()) { @@ -253,7 +252,7 @@ void* temp = __builtin_frame_address(0); while (level--) temp = ((void**)temp)[0]; lastSP = temp; - if (doYield) joinRV(); + if (doYield) joinRVBeforeEnter(); assert(lastSP && "No last SP when entering uncooperative code"); } } @@ -264,7 +263,7 @@ if (!inRV) { assert(!lastSP && "SP already set when entering uncooperative code"); lastSP = SP; - if (doYield) joinRV(); + if (doYield) joinRVBeforeEnter(); assert(lastSP && "No last SP when entering uncooperative code"); } } @@ -274,13 +273,9 @@ if (isMvmThread()) { if (!inRV) { assert(lastSP && "No last SP when leaving uncooperative code"); - // Check to see if a rendezvous has been set while being in native code. - if (doYield) joinRV(); - // Clear lastSP. If a rendezvous happens there, the thread will join it - // in the next iteration and set lastSP. lastSP = 0; // A rendezvous has just been initiated, join it. - if (doYield) joinRV(); + if (doYield) joinRVAfterLeave(); assert(!lastSP && "SP has a value after leaving uncooperative code"); } } Modified: vmkit/trunk/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/VirtualMachine.h?rev=109688&r1=109687&r2=109688&view=diff ============================================================================== --- vmkit/trunk/include/mvm/VirtualMachine.h (original) +++ vmkit/trunk/include/mvm/VirtualMachine.h Wed Jul 28 18:04:40 2010 @@ -510,7 +510,11 @@ /// rendezvous - The rendezvous implementation for garbage collection. /// - CollectionRV rendezvous; +#ifdef WITH_LLVM_GCC + CooperativeCollectionRV rendezvous; +#else + UncooperativeCollectionRV rendezvous; +#endif StartEndFunctionMap RuntimeFunctions; Modified: vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp?rev=109688&r1=109687&r2=109688&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/CollectionRV.cpp Wed Jul 28 18:04:40 2010 @@ -12,15 +12,25 @@ #include "mvm/VirtualMachine.h" #include "mvm/Threads/CollectionRV.h" +#include "debug.h" + using namespace mvm; +void CollectionRV::another_mark() { + mvm::Thread* th = mvm::Thread::get(); + assert(th->getLastSP() != NULL); + assert(nbJoined < th->MyVM->NumberOfThreads); + nbJoined++; + if (nbJoined == th->MyVM->NumberOfThreads) { + condInitiator.broadcast(); + } +} + void CollectionRV::waitEndOfRV() { mvm::Thread* th = mvm::Thread::get(); - unsigned cm = rendezvousNb; + assert(th->getLastSP() != NULL); - if (nbJoined == th->MyVM->NumberOfThreads) collectorGo(); - - while (rendezvousNb == cm) { + while (th->doYield) { condEndRV.wait(&_lockRV); } } @@ -28,107 +38,140 @@ void CollectionRV::waitRV() { mvm::Thread* self = mvm::Thread::get(); // Add myself. - another_mark(); + nbJoined++; - while (nbJoined < self->MyVM->NumberOfThreads) + while (nbJoined != self->MyVM->NumberOfThreads) { condInitiator.wait(&_lockRV); - + } } -void CollectionRV::synchronize() { - +void CooperativeCollectionRV::synchronize() { + assert(nbJoined == 0); mvm::Thread* self = mvm::Thread::get(); - assert(self && "No thread local data for this thread"); - self->inRV = true; - // Lock thread lock, so that we can traverse the thread list safely. This will // be released on finishRV. self->MyVM->ThreadLock.lock(); - if (cooperative) { - - mvm::Thread* cur = self; - do { - cur->joinedRV = false; - cur->doYield = true; - cur = (mvm::Thread*)cur->next(); - } while (cur != self); - - // Lookup currently blocked threads. - for (cur = (mvm::Thread*)self->next(); cur != self; - cur = (mvm::Thread*)cur->next()) { - if (cur->getLastSP()) { - another_mark(); - cur->joinedRV = true; - } - } - - } else { - mvm::Thread* self = mvm::Thread::get(); - self->joinedRV = false; - assert(self && "No thread local data for this thread"); - - for (mvm::Thread* cur = (mvm::Thread*)self->next(); cur != self; - cur = (mvm::Thread*)cur->next()) { - cur->joinedRV = false; - cur->killForRendezvous(); + mvm::Thread* cur = self; + do { + assert(!cur->doYield); + cur->doYield = true; + assert(!cur->joinedRV); + cur = (mvm::Thread*)cur->next(); + } while (cur != self); + + self->joinedRV = true; + // Lookup currently blocked threads. + for (cur = (mvm::Thread*)self->next(); cur != self; + cur = (mvm::Thread*)cur->next()) { + if (cur->getLastSP()) { + nbJoined++; + cur->joinedRV = true; } - } // And wait for other threads to finish. waitRV(); + + // Unlock, so that threads in uncooperative code that go back to cooperative + // code can set back their lastSP. + unlockRV(); +} + +void UncooperativeCollectionRV::synchronize() { + assert(nbJoined == 0); + mvm::Thread* self = mvm::Thread::get(); + // Lock thread lock, so that we can traverse the thread list safely. This will + // be released on finishRV. + self->MyVM->ThreadLock.lock(); + + for (mvm::Thread* cur = (mvm::Thread*)self->next(); cur != self; + cur = (mvm::Thread*)cur->next()) { + cur->killForRendezvous(); + } + + // And wait for other threads to finish. + waitRV(); + + // Unlock, so that threads in uncooperative code that go back to cooperative + // code can set back their lastSP. unlockRV(); } -void CollectionRV::join() { + +void UncooperativeCollectionRV::join() { mvm::Thread* th = mvm::Thread::get(); th->inRV = true; - bool changed = false; - + lockRV(); + void* old = th->getLastSP(); + th->setLastSP(FRAME_PTR()); + another_mark(); + waitEndOfRV(); + th->setLastSP(old); + unlockRV(); - if (isCooperative() && !th->doYield) { - // I was previously blocked, and I'm running late: someone else collected - // my stack, and the GC has finished already. Just unlock and return. - unlockRV(); - th->inRV = false; - return; - } - - // I woke up while a GC was happening, and no-one has listed me yet. - if (!th->joinedRV) { - another_mark(); - th->joinedRV = true; - } - - // lastSP may not be set in two cases: - // (1) The thread was interrupted while executing regular code (ie cooperative - // code). - // (2) The thread left uncooperative code and has just cleared lastSP. - if (!th->getLastSP()) { - changed = true; - th->setLastSP(FRAME_PTR()); - } + th->inRV = false; +} - assert(th->getLastSP() && "Joined without giving a SP"); - - do { - // Wait for the rendezvous to finish. - waitEndOfRV(); - // If we wake up here and doYield is set, this means that a new GC is - // happening, so join it. - } while (th->doYield); +void CooperativeCollectionRV::join() { + mvm::Thread* th = mvm::Thread::get(); + assert(th->doYield && "No yield"); + assert((th->getLastSP() == NULL) && "SP present in cooperative code"); + + th->inRV = true; - if (changed) th->setLastSP(0); - - // Unlock after modifying lastSP, because lastSP is also read by the - // rendezvous initiator. + lockRV(); + th->setLastSP(FRAME_PTR()); + th->joinedRV = true; + another_mark(); + waitEndOfRV(); + th->setLastSP(0); unlockRV(); - // The rendezvous is finished. Set inRV to false. th->inRV = false; +} + +void CooperativeCollectionRV::joinBeforeUncooperative() { + mvm::Thread* th = mvm::Thread::get(); + assert((th->getLastSP() != NULL) && + "SP not set before entering uncooperative code"); + + th->inRV = true; + lockRV(); + if (th->doYield) { + if (!th->joinedRV) { + th->joinedRV = true; + another_mark(); + } + waitEndOfRV(); + } + unlockRV(); + + th->inRV = false; +} + +void CooperativeCollectionRV::joinAfterUncooperative() { + mvm::Thread* th = mvm::Thread::get(); + assert((th->getLastSP() == NULL) && + "SP set after entering uncooperative code"); + + th->inRV = true; + + lockRV(); + if (th->doYield) { + th->setLastSP(FRAME_PTR()); + if (!th->joinedRV) { + th->joinedRV = true; + another_mark(); + } + waitEndOfRV(); + th->setLastSP(NULL); + } + unlockRV(); + + th->inRV = false; } extern "C" void conditionalSafePoint() { @@ -136,21 +179,42 @@ th->MyVM->rendezvous.join(); } -void CollectionRV::finishRV() { +void CooperativeCollectionRV::finishRV() { + lockRV(); - mvm::Thread* self = mvm::Thread::get(); - if (cooperative) { - mvm::Thread* initiator = mvm::Thread::get(); - mvm::Thread* cur = initiator; - do { - cur->doYield = false; - cur = (mvm::Thread*)cur->next(); - } while (cur != initiator); - } + mvm::Thread* initiator = mvm::Thread::get(); + mvm::Thread* cur = initiator; + do { + assert(cur->doYield && "Inconsistent state"); + assert(cur->joinedRV && "Inconsistent state"); + cur->doYield = false; + cur->joinedRV = false; + cur = (mvm::Thread*)cur->next(); + } while (cur != initiator); + assert(nbJoined == initiator->MyVM->NumberOfThreads && "Inconsistent state"); nbJoined = 0; - rendezvousNb++; + initiator->MyVM->ThreadLock.unlock(); condEndRV.broadcast(); - self->inRV = false; - self->MyVM->ThreadLock.unlock(); + unlockRV(); + initiator->inRV = false; +} + +void UncooperativeCollectionRV::finishRV() { + lockRV(); + mvm::Thread* initiator = mvm::Thread::get(); + assert(nbJoined == initiator->MyVM->NumberOfThreads && "Inconsistent state"); + nbJoined = 0; + initiator->MyVM->ThreadLock.unlock(); + condEndRV.broadcast(); + unlockRV(); + initiator->inRV = false; +} + +void UncooperativeCollectionRV::joinAfterUncooperative() { + UNREACHABLE(); +} + +void UncooperativeCollectionRV::joinBeforeUncooperative() { + UNREACHABLE(); } Modified: vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp?rev=109688&r1=109687&r2=109688&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Wed Jul 28 18:04:40 2010 @@ -41,13 +41,19 @@ void Thread::yield(void) { Thread* th = mvm::Thread::get(); if (th->isMvmThread()) { - if (th->doYield && !th->inRV) th->joinRV(); + if (th->doYield && !th->inRV) { + th->MyVM->rendezvous.join(); + } } sched_yield(); } -void Thread::joinRV() { - MyVM->rendezvous.join(); +void Thread::joinRVBeforeEnter() { + MyVM->rendezvous.joinBeforeUncooperative(); +} + +void Thread::joinRVAfterLeave() { + MyVM->rendezvous.joinAfterUncooperative(); } void Thread::startKnownFrame(KnownFrame& F) {