From nicolas.geoffray at lip6.fr Thu Oct 1 08:42:29 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 01 Oct 2009 15:42:29 -0000 Subject: [vmkit-commits] [vmkit] r83201 - /vmkit/trunk/tools/n3-pnetlib/Makefile Message-ID: <200910011542.n91FgTwe007665@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 1 10:42:28 2009 New Revision: 83201 URL: http://llvm.org/viewvc/llvm-project?rev=83201&view=rev Log: Fix typo. Modified: vmkit/trunk/tools/n3-pnetlib/Makefile Modified: vmkit/trunk/tools/n3-pnetlib/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/n3-pnetlib/Makefile?rev=83201&r1=83200&r2=83201&view=diff ============================================================================== --- vmkit/trunk/tools/n3-pnetlib/Makefile (original) +++ vmkit/trunk/tools/n3-pnetlib/Makefile Thu Oct 1 10:42:28 2009 @@ -15,7 +15,7 @@ ifeq ($(WITH_LLVM_GCC), 1) MODULESNAME = vmkit - USEDMODULES = N3.bc PNetLibc.bc Allocator.bc CommonThread.bc Mvm.bc \ + USEDMODULES = N3.bc PNetLib.bc Allocator.bc CommonThread.bc Mvm.bc \ MvmCompiler.bc $(GCLIB).bc BUILT_SOURCES = vmkit.s SOURCES = vmkit.s $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp)) From nicolas.geoffray at lip6.fr Sun Oct 4 08:40:28 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 04 Oct 2009 15:40:28 -0000 Subject: [vmkit-commits] [vmkit] r83278 - in /vmkit/trunk: include/mvm/Threads/Locks.h lib/JnJVM/VMCore/JavaClass.h lib/JnJVM/VMCore/JavaObject.h Message-ID: <200910041540.n94FeSBM020912@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 4 10:40:28 2009 New Revision: 83278 URL: http://llvm.org/viewvc/llvm-project?rev=83278&view=rev Log: Use a new class template for ThinLock to express if the FatLock is a GC object or not. Modified: vmkit/trunk/include/mvm/Threads/Locks.h vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=83278&r1=83277&r2=83278&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Sun Oct 4 10:40:28 2009 @@ -187,18 +187,45 @@ static const uint64_t ThinCountMask = 0xFF; + +#ifdef WITH_LLVM_GCC +extern "C" void __llvm_gcroot(const void**, void*) __attribute__((nothrow)); +#define llvm_gcroot(a, b) __llvm_gcroot((const void**)&a, b) +#else +#define llvm_gcroot(a, b) +#endif + + class FatLockNoGC { + public: + static void gcroot(void* val, void* unused) + __attribute__ ((always_inline)) {} + }; + + class FatLockWithGC { + public: + static void gcroot(void* val, void* unused) + __attribute__ ((always_inline)) { + llvm_gcroot(val, unused); + } + }; + + /// ThinLock - This class is an implementation of thin locks. The template class /// TFatLock is a virtual machine specific fat lock. /// -template +template class ThinLock { uintptr_t lock; public: + + + /// overflowThinlock - Change the lock of this object to a fat lock because /// we have reached 0xFF locks. void overflowThinLock(Owner* O = 0) { TFatLock* obj = TFatLock::allocate(O); + IsGC::gcroot(obj, 0); obj->acquireAll(257); lock = ((uintptr_t)obj >> 1) | FatMask; } @@ -221,6 +248,7 @@ TFatLock* changeToFatlock(Owner* O) { if (!(lock & FatMask)) { TFatLock* obj = TFatLock::allocate(O); + IsGC::gcroot(obj, 0); size_t val = (((size_t) obj) >> 1) | FatMask; uint32 count = lock & ThinCountMask; obj->acquireAll(count + 1); @@ -247,6 +275,7 @@ } } else { TFatLock* obj = TFatLock::allocate(O); + IsGC::gcroot(obj, 0); uintptr_t val = ((uintptr_t)obj >> 1) | FatMask; loop: while (lock) { @@ -282,6 +311,7 @@ lock = 0; } else if (lock & FatMask) { TFatLock* obj = (TFatLock*)(lock << 1); + IsGC::gcroot(obj, 0); obj->release(); } else { lock--; @@ -293,6 +323,7 @@ void broadcast() { if (lock & FatMask) { TFatLock* obj = (TFatLock*)(lock << 1); + IsGC::gcroot(obj, 0); obj->broadcast(); } } @@ -301,6 +332,7 @@ void signal() { if (lock & FatMask) { TFatLock* obj = (TFatLock*)(lock << 1); + IsGC::gcroot(obj, 0); obj->signal(); } } @@ -313,6 +345,7 @@ if ((lock & ThinMask) == id) return true; if (lock & FatMask) { TFatLock* obj = (TFatLock*)(lock << 1); + IsGC::gcroot(obj, 0); return obj->owner(); } return false; @@ -321,6 +354,7 @@ mvm::Thread* getOwner() { if (lock & FatMask) { TFatLock* obj = (TFatLock*)(lock << 1); + IsGC::gcroot(obj, 0); return obj->getOwner(); } else { return (mvm::Thread*)(lock & ThinMask); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=83278&r1=83277&r2=83278&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Sun Oct 4 10:40:28 2009 @@ -387,7 +387,7 @@ class Class : public CommonClass { private: - + /// FatLock - This class is the inflated lock of Class instances. It should /// be very rare that such locks are allocated. class FatLock : public mvm::PermanentObject { @@ -448,7 +448,7 @@ /// lock - The lock of this class. It should be very rare that this lock /// inflates. /// - mvm::ThinLock lock; + mvm::ThinLock lock; /// virtualFields - List of all the virtual fields defined in this class. /// This does not contain non-redefined super fields. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=83278&r1=83277&r2=83278&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Sun Oct 4 10:40:28 2009 @@ -270,7 +270,7 @@ /// lock - The monitor of this object. Most of the time null. /// - mvm::ThinLock lock; + mvm::ThinLock lock; /// wait - Java wait. Makes the current thread waiting on a monitor. /// From nicolas.geoffray at lip6.fr Sun Oct 4 09:50:01 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 04 Oct 2009 16:50:01 -0000 Subject: [vmkit-commits] [vmkit] r83281 - /vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Message-ID: <200910041650.n94Go1k7029605@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 4 11:50:01 2009 New Revision: 83281 URL: http://llvm.org/viewvc/llvm-project?rev=83281&view=rev Log: Change the list of pass to mirror what LLVM is doing. Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83281&r1=83280&r2=83281&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Sun Oct 4 11:50:01 2009 @@ -1744,46 +1744,38 @@ // LLVM does not allow calling functions from other modules in verifier //PM->add(llvm::createVerifierPass()); // Verify that input is correct - addPass(PM, llvm::createCFGSimplificationPass()); // Clean up disgusting code - addPass(PM, llvm::createScalarReplAggregatesPass());// Kill useless allocas - addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after IPCP & DAE - addPass(PM, llvm::createCFGSimplificationPass()); // Clean up after IPCP & DAE - addPass(PM, llvm::createPromoteMemoryToRegisterPass());// Kill useless allocas - addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after IPCP & DAE - addPass(PM, llvm::createCFGSimplificationPass()); // Clean up after IPCP & DAE + addPass(PM, createCFGSimplificationPass()); // Clean up disgusting code + addPass(PM, createPromoteMemoryToRegisterPass());// Kill useless allocas - addPass(PM, llvm::createTailDuplicationPass()); // Simplify cfg by copying code - addPass(PM, llvm::createInstructionCombiningPass()); // Cleanup for scalarrepl. - addPass(PM, llvm::createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, llvm::createScalarReplAggregatesPass()); // Break up aggregate allocas - addPass(PM, llvm::createInstructionCombiningPass()); // Combine silly seq's - addPass(PM, llvm::createCondPropagationPass()); // Propagate conditionals - - - addPass(PM, llvm::createTailCallEliminationPass()); // Eliminate tail calls - addPass(PM, llvm::createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, llvm::createReassociatePass()); // Reassociate expressions - addPass(PM, llvm::createLoopRotatePass()); - addPass(PM, llvm::createLICMPass()); // Hoist loop invariants - addPass(PM, llvm::createLoopUnswitchPass()); // Unswitch loops. - addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after LICM/reassoc - addPass(PM, llvm::createIndVarSimplifyPass()); // Canonicalize indvars - addPass(PM, llvm::createLoopUnrollPass()); // Unroll small loops - addPass(PM, llvm::createInstructionCombiningPass()); // Clean up after the unroller - //addPass(PM, mvm::createArrayChecksPass()); - addPass(PM, llvm::createGVNPass()); // GVN for load instructions - //addPass(PM, llvm::createGCSEPass()); // Remove common subexprs - addPass(PM, llvm::createSCCPPass()); // Constant prop with SCCP - addPass(PM, llvm::createPredicateSimplifierPass()); + addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl. + addPass(PM, createJumpThreadingPass()); // Thread jumps. + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs + addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas + addPass(PM, createInstructionCombiningPass()); // Combine silly seq's + addPass(PM, createCondPropagationPass()); // Propagate conditionals + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs + addPass(PM, createPredicateSimplifierPass()); + addPass(PM, createReassociatePass()); // Reassociate expressions + addPass(PM, createLICMPass()); // Hoist loop invariants + addPass(PM, createLoopUnswitchPass()); // Unswitch loops. + addPass(PM, createIndVarSimplifyPass()); // Canonicalize indvars + addPass(PM, createLoopDeletionPass()); // Delete dead loops + addPass(PM, createLoopUnrollPass()); // Unroll small loops*/ + addPass(PM, createInstructionCombiningPass()); // Clean up after the unroller + addPass(PM, createGVNPass()); // Remove redundancies + addPass(PM, createSCCPPass()); // Constant prop with SCCP + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs + // Run instcombine after redundancy elimination to exploit opportunities // opened up by them. - addPass(PM, llvm::createInstructionCombiningPass()); - addPass(PM, llvm::createCondPropagationPass()); // Propagate conditionals + addPass(PM, createInstructionCombiningPass()); + addPass(PM, createCondPropagationPass()); // Propagate conditionals + + addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores + addPass(PM, createAggressiveDCEPass()); // Delete dead instructions + addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, llvm::createDeadStoreEliminationPass()); // Delete dead stores - addPass(PM, llvm::createAggressiveDCEPass()); // SSA based 'Aggressive DCE' - addPass(PM, llvm::createCFGSimplificationPass()); // Merge & remove BBs addPass(PM, mvm::createLowerArrayLengthPass()); } From nicolas.geoffray at lip6.fr Mon Oct 5 06:47:45 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 05 Oct 2009 13:47:45 -0000 Subject: [vmkit-commits] [vmkit] r83304 - in /vmkit/trunk: include/mvm/VirtualMachine.h lib/JnJVM/Compiler/JavaJITCompiler.cpp lib/JnJVM/VMCore/JavaClass.cpp Message-ID: <200910051347.n95DljxM005619@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 5 08:47:44 2009 New Revision: 83304 URL: http://llvm.org/viewvc/llvm-project?rev=83304&view=rev Log: Use a JITEventListener to register a code pointer. This is necessary for multithreaded applications, where a code pointer may be registered after a thread calls it. Modified: vmkit/trunk/include/mvm/VirtualMachine.h vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Modified: vmkit/trunk/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/VirtualMachine.h?rev=83304&r1=83303&r2=83304&view=diff ============================================================================== --- vmkit/trunk/include/mvm/VirtualMachine.h (original) +++ vmkit/trunk/include/mvm/VirtualMachine.h Mon Oct 5 08:47:44 2009 @@ -382,8 +382,9 @@ // Decrement because we had the "greater than" value. I--; + T* res = (T*)I->second; FunctionMapLock.release(); - return (T*)I->second; + return res; } void setScanner(mvm::StackScanner* s) { Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp?rev=83304&r1=83303&r2=83304&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp Mon Oct 5 08:47:44 2009 @@ -14,6 +14,7 @@ #include "llvm/Module.h" #include "llvm/CodeGen/GCStrategy.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" +#include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" @@ -24,6 +25,7 @@ #include "JavaClass.h" #include "JavaConstantPool.h" #include "JavaThread.h" +#include "Jnjvm.h" #include "jnjvm/JnjvmModule.h" #include "jnjvm/JnjvmModuleProvider.h" @@ -31,6 +33,27 @@ using namespace jnjvm; using namespace llvm; +class JavaJITListener : public llvm::JITEventListener { + JavaMethod* currentCompiledMethod; +public: + virtual void NotifyFunctionEmitted(const Function &F, + void *Code, size_t Size, + const EmittedFunctionDetails &Details) { + if (currentCompiledMethod) { + assert(JavaLLVMCompiler::getMethod(currentCompiledMethod) == &F && + "Method mismatch"); + Jnjvm* vm = JavaThread::get()->getJVM(); + vm->addMethodInFunctionMap(currentCompiledMethod, Code); + } + } + + void setCurrentCompiledMethod(JavaMethod* meth) { + currentCompiledMethod = meth; + } +}; + +static JavaJITListener* JITListener = 0; + Constant* JavaJITCompiler::getNativeClass(CommonClass* classDef) { const llvm::Type* Ty = classDef->isClass() ? JnjvmModule::JavaClassType : JnjvmModule::JavaCommonClassType; @@ -161,6 +184,11 @@ #endif TheModuleProvider = new JnjvmModuleProvider(TheModule, this); addJavaPasses(); + + if (!JITListener) { + JITListener = new JavaJITListener(); + mvm::MvmModule::executionEngine->RegisterJITEventListener(JITListener); + } } #ifdef SERVICE @@ -225,7 +253,9 @@ void* JavaJITCompiler::materializeFunction(JavaMethod* meth) { mvm::MvmModule::protectIR(); Function* func = parseFunction(meth); + JITListener->setCurrentCompiledMethod(meth); void* res = mvm::MvmModule::executionEngine->getPointerToGlobal(func); + JITListener->setCurrentCompiledMethod(0); func->deleteBody(); // Update the GC info. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp?rev=83304&r1=83303&r2=83304&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Mon Oct 5 08:47:44 2009 @@ -314,8 +314,6 @@ } #endif code = classDef->classLoader->getCompiler()->materializeFunction(this); - Jnjvm* vm = JavaThread::get()->getJVM(); - vm->addMethodInFunctionMap(this, code); } return code; From nicolas.geoffray at lip6.fr Mon Oct 5 06:48:42 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 05 Oct 2009 13:48:42 -0000 Subject: [vmkit-commits] [vmkit] r83305 - /vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Message-ID: <200910051348.n95Dmghq005748@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 5 08:48:42 2009 New Revision: 83305 URL: http://llvm.org/viewvc/llvm-project?rev=83305&view=rev Log: Print the information whether the function comes from a stub. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp?rev=83305&r1=83304&r2=83305&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Mon Oct 5 08:48:42 2009 @@ -330,9 +330,11 @@ if (isStub) ip = addr[2]; JavaMethod* meth = vm->IPToMethod(ip); assert(meth && "Wrong stack"); - fprintf(stderr, "; %p in %s.%s\n", ip, + fprintf(stderr, "; %p in %s.%s", ip, UTF8Buffer(meth->classDef->name).cString(), UTF8Buffer(meth->name).cString()); + if (isStub) fprintf(stderr, " (from stub)"); + fprintf(stderr, "\n"); addr = (void**)addr[0]; // End walking the stack when we cross a native -> Java call. Here // the iterator points to a native -> Java call. We dereference addr twice From nicolas.geoffray at lip6.fr Mon Oct 5 09:10:29 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 05 Oct 2009 16:10:29 -0000 Subject: [vmkit-commits] [vmkit] r83309 - in /vmkit/trunk/mmtk/magic: LowerJavaRT.cpp LowerMagic.cpp Message-ID: <200910051610.n95GATdA024186@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 5 11:10:29 2009 New Revision: 83309 URL: http://llvm.org/viewvc/llvm-project?rev=83309&view=rev Log: Move to new LLVM API. Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp vmkit/trunk/mmtk/magic/LowerMagic.cpp Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerJavaRT.cpp?rev=83309&r1=83308&r2=83309&view=diff ============================================================================== --- vmkit/trunk/mmtk/magic/LowerJavaRT.cpp (original) +++ vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Mon Oct 5 11:10:29 2009 @@ -43,9 +43,9 @@ for (Module::iterator I = M.begin(), E = M.end(); I != E;) { GlobalValue& GV = *I; ++I; - if (!strncmp(GV.getName().c_str(), "JnJVM_java", 10) || - !strncmp(GV.getName().c_str(), "java", 4)) { - GV.replaceAllUsesWith(M.getContext().getNullValue(GV.getType())); + if (!strncmp(GV.getName().data(), "JnJVM_java", 10) || + !strncmp(GV.getName().data(), "java", 4)) { + GV.replaceAllUsesWith(Constant::getNullValue(GV.getType())); GV.eraseFromParent(); } } @@ -54,9 +54,9 @@ I != E;) { GlobalValue& GV = *I; ++I; - if (!strncmp(GV.getName().c_str(), "JnJVM_java", 10) || - !strncmp(GV.getName().c_str(), "java", 4)) { - GV.replaceAllUsesWith(M.getContext().getNullValue(GV.getType())); + if (!strncmp(GV.getName().data(), "JnJVM_java", 10) || + !strncmp(GV.getName().data(), "java", 4)) { + GV.replaceAllUsesWith(Constant::getNullValue(GV.getType())); GV.eraseFromParent(); } } Modified: vmkit/trunk/mmtk/magic/LowerMagic.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerMagic.cpp?rev=83309&r1=83308&r2=83309&view=diff ============================================================================== --- vmkit/trunk/mmtk/magic/LowerMagic.cpp (original) +++ vmkit/trunk/mmtk/magic/LowerMagic.cpp Mon Oct 5 11:10:29 2009 @@ -325,7 +325,7 @@ static bool removePotentialNullCheck(BasicBlock* Cur, Value* Obj) { BasicBlock* BB = Cur->getUniquePredecessor(); - LLVMContext* Context = Cur->getParent()->getContext(); + LLVMContext& Context = Cur->getParent()->getContext(); if (BB) { Instruction* T = BB->getTerminator(); if (dyn_cast(T) && T != BB->begin()) { @@ -335,8 +335,8 @@ if (ICmpInst* IE = dyn_cast(BIE)) { if (IE->getPredicate() == ICmpInst::ICMP_EQ && IE->getOperand(0) == Obj && - IE->getOperand(1) == Context->getNullValue(Obj->getType())) { - BIE->replaceAllUsesWith(ConstantInt::getFalse()); + IE->getOperand(1) == Constant::getNullValue(Obj->getType())) { + BIE->replaceAllUsesWith(ConstantInt::getFalse(Context)); BIE->eraseFromParent(); return true; } @@ -352,11 +352,11 @@ bool Changed = false; const llvm::Type* pointerSizeType = globalModule->getPointerSize() == llvm::Module::Pointer32 ? - Type::Int32Ty : Type::Int64Ty; + Type::getInt32Ty(Context) : Type::getInt64Ty(Context); initialiseFunctions(globalModule); if (!CASPtr || CASPtr->getParent() != globalModule) { - if (pointerSizeType == Type::Int32Ty) { + if (pointerSizeType == Type::getInt32Ty(Context)) { CASPtr = globalModule->getFunction("llvm.atomic.cmp.swap.i32.p0i32"); } else { CASPtr = globalModule->getFunction("llvm.atomic.cmp.swap.i64.p0i64"); @@ -374,8 +374,8 @@ if (CI) { Value* V = Call.getCalledValue(); if (Function* FCur = dyn_cast(V)) { - const char* name = FCur->getNameStart(); - unsigned len = FCur->getNameLen(); + const char* name = FCur->getName().data(); + unsigned len = FCur->getName().size(); if (len > strlen(AddressClass) && !memcmp(AddressClass, name, strlen(AddressClass))) { @@ -385,42 +385,42 @@ removePotentialNullCheck(Cur, Call.getArgument(0)); } - if (!strcmp(FCur->getNameStart(), AddressZeroMethod)) { - Constant* N = Context.getNullValue(FCur->getReturnType()); + if (!strcmp(FCur->getName().data(), AddressZeroMethod)) { + Constant* N = Constant::getNullValue(FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressMaxMethod)) { - ConstantInt* M = Context.getConstantInt(Type::Int64Ty, (uint64_t)-1); + } else if (!strcmp(FCur->getName().data(), AddressMaxMethod)) { + ConstantInt* M = ConstantInt::get(Type::getInt64Ty(Context), (uint64_t)-1); Constant* N = ConstantExpr::getIntToPtr(M, FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressStoreObjectReferenceMethod) || - !strcmp(FCur->getNameStart(), AddressStoreAddressMethod) || - !strcmp(FCur->getNameStart(), AddressStoreShortMethod) || - !strcmp(FCur->getNameStart(), AddressStoreByteMethod) || - !strcmp(FCur->getNameStart(), AddressStoreIntMethod) || - !strcmp(FCur->getNameStart(), AddressStoreWordMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressStoreObjectReferenceMethod) || + !strcmp(FCur->getName().data(), AddressStoreAddressMethod) || + !strcmp(FCur->getName().data(), AddressStoreShortMethod) || + !strcmp(FCur->getName().data(), AddressStoreByteMethod) || + !strcmp(FCur->getName().data(), AddressStoreIntMethod) || + !strcmp(FCur->getName().data(), AddressStoreWordMethod)) { Value* Addr = Call.getArgument(0); Value* Obj = Call.getArgument(1); const llvm::Type* Ty = PointerType::getUnqual(Obj->getType()); Addr = new BitCastInst(Addr, Ty, "", CI); new StoreInst(Obj, Addr, CI); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressLoadObjectReferenceMethod) || - !strcmp(FCur->getNameStart(), AddressLoadAddressMethod) || - !strcmp(FCur->getNameStart(), AddressLoadWordMethod) || - !strcmp(FCur->getNameStart(), AddressLoadShortMethod) || - !strcmp(FCur->getNameStart(), AddressLoadByteMethod) || - !strcmp(FCur->getNameStart(), AddressLoadIntMethod) || - !strcmp(FCur->getNameStart(), AddressPrepareWordMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressLoadObjectReferenceMethod) || + !strcmp(FCur->getName().data(), AddressLoadAddressMethod) || + !strcmp(FCur->getName().data(), AddressLoadWordMethod) || + !strcmp(FCur->getName().data(), AddressLoadShortMethod) || + !strcmp(FCur->getName().data(), AddressLoadByteMethod) || + !strcmp(FCur->getName().data(), AddressLoadIntMethod) || + !strcmp(FCur->getName().data(), AddressPrepareWordMethod)) { Value* Addr = Call.getArgument(0); const Type* Ty = PointerType::getUnqual(FCur->getReturnType()); Addr = new BitCastInst(Addr, Ty, "", CI); Value* LD = new LoadInst(Addr, "", CI); CI->replaceAllUsesWith(LD); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressDiffMethod) || - !strcmp(FCur->getNameStart(), AddressMinusExtentMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressDiffMethod) || + !strcmp(FCur->getName().data(), AddressMinusExtentMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -429,7 +429,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressPlusOffsetMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressPlusOffsetMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -438,7 +438,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressPlusIntMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressPlusIntMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -448,7 +448,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressMinusIntMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressMinusIntMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -458,7 +458,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressLTMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressLTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -467,7 +467,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressGTMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressGTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -476,7 +476,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressEQMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressEQMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -485,7 +485,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressNEMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressNEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -494,7 +494,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressLEMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressLEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -503,7 +503,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressGEMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressGEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -512,13 +512,13 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressToObjectReferenceMethod) || - !strcmp(FCur->getNameStart(), AddressToWordMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressToObjectReferenceMethod) || + !strcmp(FCur->getName().data(), AddressToWordMethod)) { Value* Val = Call.getArgument(0); Val = new BitCastInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressAttemptWordAtOffsetMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressAttemptWordAtOffsetMethod)) { Value* Ptr = Call.getArgument(0); Value* Old = Call.getArgument(1); Value* Val = Call.getArgument(2); @@ -539,7 +539,7 @@ CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressAttemptWordMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressAttemptWordMethod)) { Value* Ptr = Call.getArgument(0); Value* Old = Call.getArgument(1); Value* Val = Call.getArgument(2); @@ -556,13 +556,13 @@ CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressPrepareWordAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressLoadWordAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressLoadAddressAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressLoadObjectReferenceAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressLoadByteAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressLoadIntAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressLoadShortAtOffsetMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressPrepareWordAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressLoadWordAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressLoadAddressAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressLoadObjectReferenceAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressLoadByteAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressLoadIntAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressLoadShortAtOffsetMethod)) { Value* Ptr = Call.getArgument(0); Value* Offset = Call.getArgument(1); @@ -575,10 +575,10 @@ CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressStoreWordAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressStoreAddressAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressStoreByteAtOffsetMethod) || - !strcmp(FCur->getNameStart(), AddressStoreShortAtOffsetMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressStoreWordAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressStoreAddressAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressStoreByteAtOffsetMethod) || + !strcmp(FCur->getName().data(), AddressStoreShortAtOffsetMethod)) { Value* Ptr = Call.getArgument(0); Value* Val = Call.getArgument(1); Value* Offset = Call.getArgument(2); @@ -591,7 +591,7 @@ new StoreInst(Val, Ptr, CI); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressPlusExtentMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressPlusExtentMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -600,28 +600,28 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressIsZeroMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressIsZeroMethod)) { Value* Val = Call.getArgument(0); - Constant* N = Context.getNullValue(Val->getType()); + Constant* N = Constant::getNullValue(Val->getType()); Value* Res = new ICmpInst(CI, ICmpInst::ICMP_EQ, Val, N, ""); Res = new ZExtInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressToLongMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressToLongMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int64Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt64Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressFromIntZeroExtendMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressFromIntZeroExtendMethod)) { Value* Val = Call.getArgument(0); - if (pointerSizeType != Type::Int32Ty) + if (pointerSizeType != Type::getInt32Ty(Context)) Val = new ZExtInst(Val, pointerSizeType, "", CI); Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), AddressToIntMethod)) { + } else if (!strcmp(FCur->getName().data(), AddressToIntMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int32Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt32Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); } else { @@ -638,10 +638,10 @@ removePotentialNullCheck(Cur, Call.getArgument(0)); } - if (!strcmp(FCur->getNameStart(), ExtentToWordMethod)) { + if (!strcmp(FCur->getName().data(), ExtentToWordMethod)) { CI->replaceAllUsesWith(Call.getArgument(0)); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentMinusExtentMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentMinusExtentMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -650,7 +650,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentPlusExtentMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentPlusExtentMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -659,7 +659,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentPlusIntMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentPlusIntMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -669,7 +669,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentMinusIntMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentMinusIntMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -679,26 +679,26 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentFromIntZeroExtendMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentFromIntZeroExtendMethod)) { Value* Val = Call.getArgument(0); - if (pointerSizeType != Type::Int32Ty) + if (pointerSizeType != Type::getInt32Ty(Context)) Val = new ZExtInst(Val, pointerSizeType, "", CI); Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentFromIntSignExtendMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentFromIntSignExtendMethod)) { Value* Val = Call.getArgument(0); - if (pointerSizeType != Type::Int32Ty) + if (pointerSizeType != Type::getInt32Ty(Context)) Val = new SExtInst(Val, pointerSizeType, "", CI); Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentOneMethod)) { - Constant* N = Context.getConstantInt(pointerSizeType, 1); + } else if (!strcmp(FCur->getName().data(), ExtentOneMethod)) { + Constant* N = ConstantInt::get(pointerSizeType, 1); N = ConstantExpr::getIntToPtr(N, FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentNEMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentNEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -707,7 +707,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentEQMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentEQMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -716,7 +716,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentGTMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentGTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -725,7 +725,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentLTMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentLTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -734,22 +734,22 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentZeroMethod)) { - Constant* N = Context.getNullValue(FCur->getReturnType()); + } else if (!strcmp(FCur->getName().data(), ExtentZeroMethod)) { + Constant* N = Constant::getNullValue(FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentToLongMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentToLongMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int64Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt64Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentToIntMethod)) { + } else if (!strcmp(FCur->getName().data(), ExtentToIntMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int32Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt32Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ExtentMaxMethod)) { - ConstantInt* M = Context.getConstantInt(Type::Int64Ty, (uint64_t)-1); + } else if (!strcmp(FCur->getName().data(), ExtentMaxMethod)) { + ConstantInt* M = ConstantInt::get(Type::getInt64Ty(Context), (uint64_t)-1); Constant* N = ConstantExpr::getIntToPtr(M, FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); @@ -766,7 +766,7 @@ removePotentialNullCheck(Cur, Call.getArgument(0)); } - if (!strcmp(FCur->getNameStart(), OffsetSLTMethod)) { + if (!strcmp(FCur->getName().data(), OffsetSLTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -775,16 +775,16 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetToWordMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetToWordMethod)) { Value* Val = Call.getArgument(0); Val = new BitCastInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetZeroMethod)) { - Constant* N = Context.getNullValue(FCur->getReturnType()); + } else if (!strcmp(FCur->getName().data(), OffsetZeroMethod)) { + Constant* N = Constant::getNullValue(FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetSGTMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetSGTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -793,7 +793,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetSGEMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetSGEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -802,7 +802,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetSLEMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetSLEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -811,7 +811,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetEQMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetEQMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -820,21 +820,21 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetFromIntSignExtendMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetFromIntSignExtendMethod)) { Value* Val = Call.getArgument(0); - if (pointerSizeType != Type::Int32Ty) + if (pointerSizeType != Type::getInt32Ty(Context)) Val = new SExtInst(Val, pointerSizeType, "", CI); Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetFromIntZeroExtendMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetFromIntZeroExtendMethod)) { Value* Val = Call.getArgument(0); - if (pointerSizeType != Type::Int32Ty) + if (pointerSizeType != Type::getInt32Ty(Context)) Val = new ZExtInst(Val, pointerSizeType, "", CI); Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetPlusIntMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetPlusIntMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -844,24 +844,24 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetToIntMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetToIntMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int32Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt32Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetToLongMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetToLongMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int64Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt64Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetIsZeroMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetIsZeroMethod)) { Value* Val = Call.getArgument(0); - Constant* N = Context.getNullValue(Val->getType()); + Constant* N = Constant::getNullValue(Val->getType()); Value* Res = new ICmpInst(CI, ICmpInst::ICMP_EQ, Val, N, ""); Res = new ZExtInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetMinusIntMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetMinusIntMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -871,7 +871,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), OffsetMinusOffsetMethod)) { + } else if (!strcmp(FCur->getName().data(), OffsetMinusOffsetMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -893,28 +893,28 @@ removePotentialNullCheck(Cur, Call.getArgument(0)); } - if (!strcmp(FCur->getNameStart(), ObjectReferenceNullReferenceMethod)) { - Constant* N = Context.getNullValue(FCur->getReturnType()); + if (!strcmp(FCur->getName().data(), ObjectReferenceNullReferenceMethod)) { + Constant* N = Constant::getNullValue(FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ObjectReferenceFromObjectMethod)) { + } else if (!strcmp(FCur->getName().data(), ObjectReferenceFromObjectMethod)) { Value* Val = Call.getArgument(0); Val = new BitCastInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ObjectReferenceToAddressMethod)) { + } else if (!strcmp(FCur->getName().data(), ObjectReferenceToAddressMethod)) { Value* Val = Call.getArgument(0); Val = new BitCastInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ObjectReferenceToObjectMethod)) { + } else if (!strcmp(FCur->getName().data(), ObjectReferenceToObjectMethod)) { Value* Val = Call.getArgument(0); Val = new BitCastInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), ObjectReferenceIsNullMethod)) { + } else if (!strcmp(FCur->getName().data(), ObjectReferenceIsNullMethod)) { Value* Val = Call.getArgument(0); - Constant* N = Context.getNullValue(Val->getType()); + Constant* N = Constant::getNullValue(Val->getType()); Value* Res = new ICmpInst(CI, ICmpInst::ICMP_EQ, Val, N, ""); Res = new ZExtInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); @@ -932,7 +932,7 @@ removePotentialNullCheck(Cur, Call.getArgument(0)); } - if (!strcmp(FCur->getNameStart(), WordOrMethod)) { + if (!strcmp(FCur->getName().data(), WordOrMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -941,7 +941,7 @@ Res = new IntToPtrInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordAndMethod)) { + } else if (!strcmp(FCur->getName().data(), WordAndMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -950,7 +950,7 @@ Res = new IntToPtrInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordXorMethod)) { + } else if (!strcmp(FCur->getName().data(), WordXorMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -959,7 +959,7 @@ Res = new IntToPtrInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordRshlMethod)) { + } else if (!strcmp(FCur->getName().data(), WordRshlMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -969,7 +969,7 @@ Res = new IntToPtrInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordLshMethod)) { + } else if (!strcmp(FCur->getName().data(), WordLshMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -979,37 +979,37 @@ Res = new IntToPtrInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordToIntMethod)) { + } else if (!strcmp(FCur->getName().data(), WordToIntMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int32Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt32Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordNotMethod)) { + } else if (!strcmp(FCur->getName().data(), WordNotMethod)) { Value* Val = Call.getArgument(0); Val = new PtrToIntInst(Val, pointerSizeType, "", CI); - Constant* M1 = Context.getConstantInt(pointerSizeType, -1); + Constant* M1 = ConstantInt::get(pointerSizeType, -1); Value* Res = BinaryOperator::CreateXor(Val, M1, "", CI); Res = new IntToPtrInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordZeroMethod)) { - Constant* N = Context.getNullValue(FCur->getReturnType()); + } else if (!strcmp(FCur->getName().data(), WordZeroMethod)) { + Constant* N = Constant::getNullValue(FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordOneMethod)) { - Constant* N = Context.getConstantInt(pointerSizeType, 1); + } else if (!strcmp(FCur->getName().data(), WordOneMethod)) { + Constant* N = ConstantInt::get(pointerSizeType, 1); N = ConstantExpr::getIntToPtr(N, FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordToAddressMethod) || - !strcmp(FCur->getNameStart(), WordToOffsetMethod) || - !strcmp(FCur->getNameStart(), WordToExtentMethod)) { + } else if (!strcmp(FCur->getName().data(), WordToAddressMethod) || + !strcmp(FCur->getName().data(), WordToOffsetMethod) || + !strcmp(FCur->getName().data(), WordToExtentMethod)) { Value* Val = Call.getArgument(0); Val = new BitCastInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordMinusWordMethod) || - !strcmp(FCur->getNameStart(), WordMinusExtentMethod)) { + } else if (!strcmp(FCur->getName().data(), WordMinusWordMethod) || + !strcmp(FCur->getName().data(), WordMinusExtentMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1018,7 +1018,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordPlusWordMethod)) { + } else if (!strcmp(FCur->getName().data(), WordPlusWordMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1027,7 +1027,7 @@ res = new IntToPtrInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordLTMethod)) { + } else if (!strcmp(FCur->getName().data(), WordLTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1036,7 +1036,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordLEMethod)) { + } else if (!strcmp(FCur->getName().data(), WordLEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1045,7 +1045,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordGEMethod)) { + } else if (!strcmp(FCur->getName().data(), WordGEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1054,7 +1054,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordEQMethod)) { + } else if (!strcmp(FCur->getName().data(), WordEQMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1063,7 +1063,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordGTMethod)) { + } else if (!strcmp(FCur->getName().data(), WordGTMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1072,7 +1072,7 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordNEMethod)) { + } else if (!strcmp(FCur->getName().data(), WordNEMethod)) { Value* Val1 = Call.getArgument(0); Value* Val2 = Call.getArgument(1); Val1 = new PtrToIntInst(Val1, pointerSizeType, "", CI); @@ -1081,34 +1081,34 @@ res = new ZExtInst(res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordFromIntSignExtendMethod)) { + } else if (!strcmp(FCur->getName().data(), WordFromIntSignExtendMethod)) { Value* Val = Call.getArgument(0); - if (pointerSizeType != Type::Int32Ty) + if (pointerSizeType != Type::getInt32Ty(Context)) Val = new SExtInst(Val, pointerSizeType, "", CI); Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordFromIntZeroExtendMethod)) { + } else if (!strcmp(FCur->getName().data(), WordFromIntZeroExtendMethod)) { Value* Val = Call.getArgument(0); - if (pointerSizeType != Type::Int32Ty) + if (pointerSizeType != Type::getInt32Ty(Context)) Val = new ZExtInst(Val, pointerSizeType, "", CI); Val = new IntToPtrInst(Val, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordIsZeroMethod)) { + } else if (!strcmp(FCur->getName().data(), WordIsZeroMethod)) { Value* Val = Call.getArgument(0); - Constant* N = Context.getNullValue(Val->getType()); + Constant* N = Constant::getNullValue(Val->getType()); Value* Res = new ICmpInst(CI, ICmpInst::ICMP_EQ, Val, N, ""); Res = new ZExtInst(Res, FCur->getReturnType(), "", CI); CI->replaceAllUsesWith(Res); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordToLongMethod)) { + } else if (!strcmp(FCur->getName().data(), WordToLongMethod)) { Value* Val = Call.getArgument(0); - Val = new PtrToIntInst(Val, Type::Int64Ty, "", CI); + Val = new PtrToIntInst(Val, Type::getInt64Ty(Context), "", CI); CI->replaceAllUsesWith(Val); CI->eraseFromParent(); - } else if (!strcmp(FCur->getNameStart(), WordMaxMethod)) { - ConstantInt* M = Context.getConstantInt(Type::Int64Ty, (uint64_t)-1); + } else if (!strcmp(FCur->getName().data(), WordMaxMethod)) { + ConstantInt* M = ConstantInt::get(Type::getInt64Ty(Context), (uint64_t)-1); Constant* N = ConstantExpr::getIntToPtr(M, FCur->getReturnType()); CI->replaceAllUsesWith(N); CI->eraseFromParent(); From nicolas.geoffray at lip6.fr Mon Oct 5 23:27:28 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 06:27:28 -0000 Subject: [vmkit-commits] [vmkit] r83372 - /vmkit/trunk/tools/vmjc/vmjc.cpp Message-ID: <200910060627.n966RST6005337@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 01:27:28 2009 New Revision: 83372 URL: http://llvm.org/viewvc/llvm-project?rev=83372&view=rev Log: Add a DisableCooperativeGC flag. Modified: vmkit/trunk/tools/vmjc/vmjc.cpp Modified: vmkit/trunk/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=83372&r1=83371&r2=83372&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/vmjc.cpp (original) +++ vmkit/trunk/tools/vmjc/vmjc.cpp Tue Oct 6 01:27:28 2009 @@ -100,6 +100,11 @@ cl::desc("Disable Java exceptions")); static cl::opt +DisableCooperativeGC("disable-cooperativegc", + cl::desc("Disable cooperative garbage collection")); + + +static cl::opt DisableStubs("disable-stubs", cl::desc("Disable Java stubs")); @@ -245,6 +250,7 @@ if (DisableExceptions) Comp->disableExceptions(); if (DisableStubs) Comp->generateStubs = false; if (AssumeCompiled) Comp->assumeCompiled = true; + if (DisableCooperativeGC) Comp->disableCooperativeGC(); mvm::BumpPtrAllocator A; Jnjvm* vm = new(A, "Bootstrap loader") Jnjvm(A, (JnjvmBootstrapLoader*)JCL); From nicolas.geoffray at lip6.fr Mon Oct 5 23:28:02 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 06:28:02 -0000 Subject: [vmkit-commits] [vmkit] r83373 - /vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp Message-ID: <200910060628.n966S27d005421@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 01:28:02 2009 New Revision: 83373 URL: http://llvm.org/viewvc/llvm-project?rev=83373&view=rev Log: Just return if there is no YieldPtr. Modified: vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp Modified: vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp?rev=83373&r1=83372&r2=83373&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/LoopSafePoints.cpp Tue Oct 6 01:28:02 2009 @@ -97,7 +97,7 @@ if (YieldPtr) break; } - assert(YieldPtr && "Could not find initial yield pointer."); + if (!YieldPtr) return false; TerminatorInst* TI = Header->getTerminator(); From nicolas.geoffray at lip6.fr Tue Oct 6 09:17:45 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 16:17:45 -0000 Subject: [vmkit-commits] [vmkit] r83382 - /vmkit/trunk/Makefile.rules Message-ID: <200910061617.n96GHjYi030985@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 11:17:44 2009 New Revision: 83382 URL: http://llvm.org/viewvc/llvm-project?rev=83382&view=rev Log: Add a new rule to compile MMTk. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=83382&r1=83381&r2=83382&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Oct 6 11:17:44 2009 @@ -110,7 +110,7 @@ $(MODULESNAME).s : $(MODULESNAME).bc $(Echo) Building $(BuildMode) Assembly file $(notdir $@) - $(Verb) $(LOPT) -load=$(LibDir)/StaticGCPass.so -std-compile-opts -StaticGCPass -f $(MODULESNAME).bc -o vmkitoptimized.bc + $(Verb) $(LOPT) -load=$(LibDir)/StaticGCPass$(SHLIBEXT) -std-compile-opts -StaticGCPass -f $(MODULESNAME).bc -o vmkitoptimized.bc $(Verb) $(LLC) -disable-fp-elim -f vmkitoptimized.bc -o $(MODULESNAME).s $(ObjDir)/%.o: %.s $(ObjDir)/.dir $(BUILT_SOURCES) @@ -123,3 +123,17 @@ endif endif +ifdef RUN_ANT + +ANT = ant + +all:: + $(Verb) $(ANT) + $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) + $(Verb) $(VMJC) -std-compile-opts -load=$(LibDir)/MMTKRuntime$(SHLIBEXT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc + $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc + +clean-local:: + $(Verb) $(RM) -rf classes $(JARNAME).jar $(JARNAME).bc $(JARNAME)-optimized.bc + +endif From nicolas.geoffray at lip6.fr Tue Oct 6 09:42:42 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 16:42:42 -0000 Subject: [vmkit-commits] [vmkit] r83384 - /vmkit/trunk/autoconf/configure.ac Message-ID: <200910061642.n96Gggmv001832@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 11:42:42 2009 New Revision: 83384 URL: http://llvm.org/viewvc/llvm-project?rev=83384&view=rev Log: Add ANT and put back version 2.59 of autoconf. 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=83384&r1=83383&r2=83384&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Oct 6 11:42:42 2009 @@ -40,7 +40,7 @@ dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we dnl use some autoconf macros only available in 2.59. -AC_PREREQ(2.63) +AC_PREREQ(2.59) dnl Verify that the source directory is valid. This makes sure that we are dnl configuring VMKit and not some other package (it validates --srcdir argument) @@ -432,8 +432,9 @@ AC_PATH_PROG(BINPWD,[pwd], [pwd]) AC_PATH_PROG(CAT,[cat], [cat]) -AC_PATH_PROG(LLVMAS,[llvm-as], [llvm-as]) -AC_PATH_PROG(LLC,[llc], [llc]) +AC_PATH_PROG(LLVMAS, [llvm-as], [llvm-as]) +AC_PATH_PROG(LLC, [llc], [llc]) +AC_PATH_PROG(ANT, [ant]) dnl Find the install program AC_PROG_INSTALL @@ -537,18 +538,6 @@ AC_TYPE_PID_T AC_TYPE_SIZE_T -AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void. -Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl -AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE( -[AC_LANG_PROGRAM([#include -#include -], - [return *(signal (0, 0)) (0) == 1;])], - [ac_cv_type_signal=int], - [ac_cv_type_signal=void])]) -AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers - (`int' or `void').]) - AC_STRUCT_TM AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found])) AC_CHECK_TYPES([uint64_t],, From nicolas.geoffray at lip6.fr Tue Oct 6 09:44:12 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 16:44:12 -0000 Subject: [vmkit-commits] [vmkit] r83386 - /vmkit/trunk/configure Message-ID: <200910061644.n96GiDgj002076@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 11:44:12 2009 New Revision: 83386 URL: http://llvm.org/viewvc/llvm-project?rev=83386&view=rev Log: Regenerate. Modified: vmkit/trunk/configure Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=83386&r1=83385&r2=83386&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Tue Oct 6 11:44:12 2009 @@ -1,15 +1,15 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for vmkit 0.26svn. +# Generated by GNU Autoconf 2.61 for vmkit 0.26svn. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # -# Copyright (c) 2003-2008 Universite Pierre et Marie Curie. +# Copyright (c) 2003-2009 Universite Pierre et Marie Curie. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -19,7 +19,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -41,45 +41,17 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -95,6 +67,8 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -117,7 +91,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -130,10 +104,17 @@ PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -155,7 +136,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -181,7 +162,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -263,7 +244,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -284,7 +265,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -364,10 +345,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -436,10 +417,9 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell bug-autoconf at gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. + echo Please tell autoconf at gnu.org about your system, + echo including any error possibly output before this + echo message } @@ -475,7 +455,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -503,6 +483,7 @@ *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -515,22 +496,19 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -555,10 +533,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -640,139 +618,123 @@ #endif" ac_unique_file=""Makefile.common.in"" -ac_subst_vars='LTLIBOBJS -LIBOBJS -LLVMGXX -LLVMGCC -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -LLC -LLVMAS -CAT -BINPWD -TAR -SED -RM -RANLIB -MV -MKDIR -FIND -DATE -CP -CMP -LN_S -NM -ac_ct_CXX -CXXFLAGS -CXX -WITH_N3 -monopath -WITH_N3_MONO -pnetlibpath -N3_LIB -WITH_N3_PNETLIB -pnetlocalprefix -WITH_JNJVM -classpathversion -classpathinclude -classpathlibs -classpathglibj -EXCEPTION_FLAGS -VM_FLAGS -ISOLATE_BUILD -SERVICE_BUILD -SINGLE_BUILD -GC_LIBS -GC_FLAGS -GC_SINGLE_MMAP -GC_MULTI_MMAP -GC_BOEHM -GC_MMAP2 -WITH_64 -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -LLVM_FLAGS -WITH_LLVM_GCC -DYLIB_EXTENSION -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LLVM_OBJ -LLVM_SRC -VMKIT_COPYRIGHT -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME +ac_subst_vars='SHELL PATH_SEPARATOR -SHELL' +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +VMKIT_COPYRIGHT +LLVM_SRC +LLVM_OBJ +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +DYLIB_EXTENSION +WITH_LLVM_GCC +LLVM_FLAGS +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +WITH_64 +GC_MMAP2 +GC_BOEHM +GC_MULTI_MMAP +GC_SINGLE_MMAP +GC_FLAGS +GC_LIBS +SINGLE_BUILD +SERVICE_BUILD +ISOLATE_BUILD +VM_FLAGS +EXCEPTION_FLAGS +classpathglibj +classpathlibs +classpathinclude +classpathversion +WITH_JNJVM +pnetlocalprefix +WITH_N3_PNETLIB +N3_LIB +pnetlibpath +WITH_N3_MONO +monopath +WITH_N3 +CXX +CXXFLAGS +ac_ct_CXX +NM +LN_S +CMP +CP +DATE +FIND +MKDIR +MV +RANLIB +RM +SED +TAR +BINPWD +CAT +LLVMAS +LLC +ANT +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +LLVMGCC +LLVMGXX +LIBOBJS +LTLIBOBJS' ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_llvmsrc -with_llvmobj -with_llvmgcc -with_thread -with_finalizer -with_gc -with_vm_type -with_exception_type -with_gnu_classpath_libs -with_gnu_classpath_glibj -with_jnjvm -with_pnet_local_prefix -with_pnetlib -with_mono -' ac_precious_vars='build_alias host_alias target_alias @@ -790,8 +752,6 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -890,21 +850,13 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -917,21 +869,13 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1122,38 +1066,22 @@ ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -1173,7 +1101,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option + -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1182,16 +1110,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1200,38 +1128,22 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. +# Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1246,7 +1158,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1262,10 +1174,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1273,12 +1185,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1305,12 +1217,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1359,9 +1271,9 @@ Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1371,25 +1283,25 @@ For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/vmkit] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/vmkit] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1458,17 +1370,15 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1504,7 +1414,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1514,14 +1424,14 @@ if $ac_init_version; then cat <<\_ACEOF vmkit configure 0.26svn -generated by GNU Autoconf 2.63 +generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -Copyright (c) 2003-2008 Universite Pierre et Marie Curie. +Copyright (c) 2003-2009 Universite Pierre et Marie Curie. _ACEOF exit fi @@ -1530,7 +1440,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by vmkit $as_me 0.26svn, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1566,7 +1476,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1601,7 +1511,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1653,12 +1563,11 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1688,9 +1597,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1705,9 +1614,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1723,8 +1632,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1766,24 +1675,21 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE +# Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + set x "$prefix/share/config.site" "$prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" +shift +for ac_site_file do - test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1793,16 +1699,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1816,38 +1722,29 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1857,12 +1754,10 @@ fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1898,7 +1793,7 @@ -VMKIT_COPYRIGHT="Copyright (c) 2003-2008 Universite Pierre et Marie Curie." +VMKIT_COPYRIGHT="Copyright (c) 2003-2009 Universite Pierre et Marie Curie." @@ -1909,8 +1804,8 @@ if test ${srcdir} != "." ; then if test -f ${srcdir}/include/mvm/Config/config.h ; then - { { $as_echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5 -$as_echo "$as_me: error: Already configured in ${srcdir}" >&2;} + { { echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5 +echo "$as_me: error: Already configured in ${srcdir}" >&2;} { (exit 1); exit 1; }; } fi fi @@ -1932,8 +1827,8 @@ fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&2;} { (exit 1); exit 1; }; } fi @@ -1975,34 +1870,34 @@ # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -2019,27 +1914,27 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -2056,27 +1951,27 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -$as_echo "$as_me: error: invalid value of canonical target" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target @@ -2100,27 +1995,27 @@ NONENONEs,x,x, && program_prefix=${target_alias}- -{ $as_echo "$as_me:$LINENO: checking type of operating system we're going to host on" >&5 -$as_echo_n "checking type of operating system we're going to host on... " >&6; } +{ echo "$as_me:$LINENO: checking type of operating system we're going to host on" >&5 +echo $ECHO_N "checking type of operating system we're going to host on... $ECHO_C" >&6; } if test "${vmkit_cv_os_type+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $host in *-*-aix*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="AIX" vmkit_cv_platform_type="Unix" ;; *-*-irix*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="IRIX" vmkit_cv_platform_type="Unix" ;; *-*-cygwin*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Cygwin" vmkit_cv_platform_type="Unix" ;; @@ -2129,32 +2024,32 @@ vmkit_cv_os_type="Darwin" vmkit_cv_platform_type="Unix" ;; *-*-freebsd*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="FreeBSD" vmkit_cv_platform_type="Unix" ;; *-*-openbsd*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="OpenBSD" vmkit_cv_platform_type="Unix" ;; *-*-netbsd*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="NetBSD" vmkit_cv_platform_type="Unix" ;; *-*-hpux*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="HP-UX" vmkit_cv_platform_type="Unix" ;; *-*-interix*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Interix" vmkit_cv_platform_type="Unix" ;; @@ -2163,33 +2058,33 @@ vmkit_cv_os_type="Linux" vmkit_cv_platform_type="Unix" ;; *-*-solaris*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="SunOS" vmkit_cv_platform_type="Unix" ;; *-*-win32*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Win32" vmkit_cv_platform_type="Win32" ;; *-*-mingw*) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="MingW" vmkit_cv_platform_type="Win32" ;; *) - { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Unknown" vmkit_cv_platform_type="Unknown" ;; esac fi -{ $as_echo "$as_me:$LINENO: result: $vmkit_cv_os_type" >&5 -$as_echo "$vmkit_cv_os_type" >&6; } +{ echo "$as_me:$LINENO: result: $vmkit_cv_os_type" >&5 +echo "${ECHO_T}$vmkit_cv_os_type" >&6; } @@ -2230,10 +2125,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2246,7 +2141,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2257,11 +2152,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2270,10 +2165,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2286,7 +2181,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2297,11 +2192,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2309,8 +2204,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2323,10 +2222,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2339,7 +2238,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2350,11 +2249,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2363,10 +2262,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2384,7 +2283,7 @@ continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2407,11 +2306,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2422,10 +2321,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2438,7 +2337,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2449,11 +2348,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2466,10 +2365,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2482,7 +2381,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2493,11 +2392,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2509,8 +2408,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2520,50 +2423,44 @@ fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2582,22 +2479,27 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out 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:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2608,11 +2510,10 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2623,7 +2524,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2650,27 +2551,25 @@ ac_file='' fi -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables +echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } fi 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:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2679,53 +2578,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. +echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi fi fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out 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:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (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:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2734,33 +2629,31 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2783,43 +2676,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2845,21 +2735,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -2869,19 +2758,15 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -2908,21 +2793,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -2947,21 +2831,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -2987,21 +2870,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3016,8 +2898,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3033,10 +2915,10 @@ CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3107,21 +2989,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3137,15 +3018,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3161,15 +3042,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3201,21 +3082,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3239,14 +3119,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3254,7 +3133,7 @@ # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3279,8 +3158,8 @@ else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3308,21 +3187,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3346,14 +3224,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3361,7 +3238,7 @@ # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3377,13 +3254,11 @@ if $ac_preproc_ok; then : else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi ac_ext=c @@ -3393,37 +3268,42 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -z "$GREP"; then ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3438,60 +3318,74 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_GREP_found && break 3 - done + + $ac_path_GREP_found && break 3 done done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } - fi +fi + else ac_cv_path_GREP=$GREP fi + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - if test -z "$EGREP"; then + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3506,31 +3400,40 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_EGREP_found && break 3 - done + + $ac_path_EGREP_found && break 3 done done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } - fi +fi + else ac_cv_path_EGREP=$EGREP fi + fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3557,21 +3460,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -3663,40 +3565,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3718,11 +3617,11 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3740,21 +3639,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -3762,15 +3660,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -3780,17 +3675,17 @@ if test "x$thread" != "xno"; then if test "${ac_cv_header_pthread_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 -$as_echo_n "checking for pthread.h... " >&6; } + { echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -$as_echo "$ac_cv_header_pthread_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking pthread.h usability" >&5 -$as_echo_n "checking pthread.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3806,33 +3701,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking pthread.h presence" >&5 -$as_echo_n "checking pthread.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3846,52 +3740,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------------- ## ## Report this to nicolas.geoffray at lip6.fr ## @@ -3900,30 +3793,30 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 -$as_echo_n "checking for pthread.h... " >&6; } +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -$as_echo "$ac_cv_header_pthread_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } fi -if test "x$ac_cv_header_pthread_h" = x""yes; then +if test $ac_cv_header_pthread_h = yes; then : else - { $as_echo "$as_me:$LINENO: WARNING: phtread include NOT found" >&5 -$as_echo "$as_me: WARNING: phtread include NOT found" >&2;} + { echo "$as_me:$LINENO: WARNING: phtread include NOT found" >&5 +echo "$as_me: WARNING: phtread include NOT found" >&2;} fi -{ $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -3955,37 +3848,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_create=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } +if test $ac_cv_lib_pthread_pthread_create = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -3993,8 +3882,8 @@ LIBS="-lpthread $LIBS" else - { { $as_echo "$as_me:$LINENO: error: pthread library not found" >&5 -$as_echo "$as_me: error: pthread library not found" >&2;} + { { echo "$as_me:$LINENO: error: pthread library not found" >&5 +echo "$as_me: error: pthread library not found" >&2;} { (exit 1); exit 1; }; } fi @@ -4282,15 +4171,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -4322,21 +4211,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -4360,14 +4248,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -4375,7 +4262,7 @@ # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -4400,8 +4287,8 @@ else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -4429,21 +4316,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -4467,14 +4353,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -4482,7 +4367,7 @@ # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -4498,13 +4383,11 @@ if $ac_preproc_ok; then : else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi ac_ext=c @@ -4523,10 +4406,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -4539,7 +4422,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4550,11 +4433,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -4567,10 +4450,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -4583,7 +4466,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4594,11 +4477,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -4610,8 +4493,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4619,56 +4506,50 @@ fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4694,21 +4575,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -4718,19 +4598,15 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -4757,21 +4633,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -4796,21 +4671,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -4836,21 +4710,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4865,8 +4738,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -4882,10 +4755,10 @@ CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -4956,21 +4829,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4986,15 +4858,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -5018,10 +4890,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -5034,7 +4906,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5045,11 +4917,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:$LINENO: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -5062,10 +4934,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -5078,7 +4950,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5089,11 +4961,11 @@ fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -5105,8 +4977,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -5116,47 +4992,43 @@ fi fi # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5182,21 +5054,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -5206,19 +5077,15 @@ ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes @@ -5245,21 +5112,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" @@ -5284,21 +5150,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag @@ -5324,21 +5189,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -5353,8 +5217,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then @@ -5377,10 +5241,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -$as_echo_n "checking for BSD-compatible nm... " >&6; } +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. @@ -5426,29 +5290,29 @@ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" -{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } fi # Extract the first word of "cmp", so it can be a program name with args. set dummy cmp; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CMP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CMP in [\\/]* | ?:[\\/]*) @@ -5463,7 +5327,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5476,20 +5340,20 @@ fi CMP=$ac_cv_path_CMP if test -n "$CMP"; then - { $as_echo "$as_me:$LINENO: result: $CMP" >&5 -$as_echo "$CMP" >&6; } + { echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CP in [\\/]* | ?:[\\/]*) @@ -5504,7 +5368,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5517,20 +5381,20 @@ fi CP=$ac_cv_path_CP if test -n "$CP"; then - { $as_echo "$as_me:$LINENO: result: $CP" >&5 -$as_echo "$CP" >&6; } + { echo "$as_me:$LINENO: result: $CP" >&5 +echo "${ECHO_T}$CP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "date", so it can be a program name with args. set dummy date; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_DATE+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DATE in [\\/]* | ?:[\\/]*) @@ -5545,7 +5409,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5558,20 +5422,20 @@ fi DATE=$ac_cv_path_DATE if test -n "$DATE"; then - { $as_echo "$as_me:$LINENO: result: $DATE" >&5 -$as_echo "$DATE" >&6; } + { echo "$as_me:$LINENO: result: $DATE" >&5 +echo "${ECHO_T}$DATE" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "find", so it can be a program name with args. set dummy find; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_FIND+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $FIND in [\\/]* | ?:[\\/]*) @@ -5586,7 +5450,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5599,20 +5463,20 @@ fi FIND=$ac_cv_path_FIND if test -n "$FIND"; then - { $as_echo "$as_me:$LINENO: result: $FIND" >&5 -$as_echo "$FIND" >&6; } + { echo "$as_me:$LINENO: result: $FIND" >&5 +echo "${ECHO_T}$FIND" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GREP in [\\/]* | ?:[\\/]*) @@ -5627,7 +5491,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5640,20 +5504,20 @@ fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then - { $as_echo "$as_me:$LINENO: result: $GREP" >&5 -$as_echo "$GREP" >&6; } + { echo "$as_me:$LINENO: result: $GREP" >&5 +echo "${ECHO_T}$GREP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MKDIR+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MKDIR in [\\/]* | ?:[\\/]*) @@ -5668,7 +5532,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5681,20 +5545,20 @@ fi MKDIR=$ac_cv_path_MKDIR if test -n "$MKDIR"; then - { $as_echo "$as_me:$LINENO: result: $MKDIR" >&5 -$as_echo "$MKDIR" >&6; } + { echo "$as_me:$LINENO: result: $MKDIR" >&5 +echo "${ECHO_T}$MKDIR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MV+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MV in [\\/]* | ?:[\\/]*) @@ -5709,7 +5573,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5722,21 +5586,21 @@ fi MV=$ac_cv_path_MV if test -n "$MV"; then - { $as_echo "$as_me:$LINENO: result: $MV" >&5 -$as_echo "$MV" >&6; } + { echo "$as_me:$LINENO: result: $MV" >&5 +echo "${ECHO_T}$MV" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -5749,7 +5613,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5760,11 +5624,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -5773,10 +5637,10 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -5789,7 +5653,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5800,11 +5664,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5812,8 +5676,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5824,10 +5692,10 @@ # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RM in [\\/]* | ?:[\\/]*) @@ -5842,7 +5710,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5855,20 +5723,20 @@ fi RM=$ac_cv_path_RM if test -n "$RM"; then - { $as_echo "$as_me:$LINENO: result: $RM" >&5 -$as_echo "$RM" >&6; } + { echo "$as_me:$LINENO: result: $RM" >&5 +echo "${ECHO_T}$RM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_SED+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SED in [\\/]* | ?:[\\/]*) @@ -5883,7 +5751,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5896,20 +5764,20 @@ fi SED=$ac_cv_path_SED if test -n "$SED"; then - { $as_echo "$as_me:$LINENO: result: $SED" >&5 -$as_echo "$SED" >&6; } + { echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_TAR+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $TAR in [\\/]* | ?:[\\/]*) @@ -5924,7 +5792,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5937,20 +5805,20 @@ fi TAR=$ac_cv_path_TAR if test -n "$TAR"; then - { $as_echo "$as_me:$LINENO: result: $TAR" >&5 -$as_echo "$TAR" >&6; } + { echo "$as_me:$LINENO: result: $TAR" >&5 +echo "${ECHO_T}$TAR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "pwd", so it can be a program name with args. set dummy pwd; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_BINPWD+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $BINPWD in [\\/]* | ?:[\\/]*) @@ -5965,7 +5833,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_BINPWD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5978,20 +5846,20 @@ fi BINPWD=$ac_cv_path_BINPWD if test -n "$BINPWD"; then - { $as_echo "$as_me:$LINENO: result: $BINPWD" >&5 -$as_echo "$BINPWD" >&6; } + { echo "$as_me:$LINENO: result: $BINPWD" >&5 +echo "${ECHO_T}$BINPWD" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CAT+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CAT in [\\/]* | ?:[\\/]*) @@ -6006,7 +5874,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6019,21 +5887,21 @@ fi CAT=$ac_cv_path_CAT if test -n "$CAT"; then - { $as_echo "$as_me:$LINENO: result: $CAT" >&5 -$as_echo "$CAT" >&6; } + { echo "$as_me:$LINENO: result: $CAT" >&5 +echo "${ECHO_T}$CAT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "llvm-as", so it can be a program name with args. set dummy llvm-as; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LLVMAS+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LLVMAS in [\\/]* | ?:[\\/]*) @@ -6048,7 +5916,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLVMAS="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6061,20 +5929,20 @@ fi LLVMAS=$ac_cv_path_LLVMAS if test -n "$LLVMAS"; then - { $as_echo "$as_me:$LINENO: result: $LLVMAS" >&5 -$as_echo "$LLVMAS" >&6; } + { echo "$as_me:$LINENO: result: $LLVMAS" >&5 +echo "${ECHO_T}$LLVMAS" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "llc", so it can be a program name with args. set dummy llc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LLC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LLC in [\\/]* | ?:[\\/]*) @@ -6089,7 +5957,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6102,11 +5970,51 @@ fi LLC=$ac_cv_path_LLC if test -n "$LLC"; then - { $as_echo "$as_me:$LINENO: result: $LLC" >&5 -$as_echo "$LLC" >&6; } + { echo "$as_me:$LINENO: result: $LLC" >&5 +echo "${ECHO_T}$LLC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +# Extract the first word of "ant", so it can be a program name with args. +set dummy ant; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_ANT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ANT in + [\\/]* | ?:[\\/]*) + ac_cv_path_ANT="$ANT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +ANT=$ac_cv_path_ANT +if test -n "$ANT"; then + { echo "$as_me:$LINENO: result: $ANT" >&5 +echo "${ECHO_T}$ANT" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6124,12 +6032,11 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6158,29 +6065,17 @@ # program-specific install script used by HP pwplus--don't use. : else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done done ;; esac - done IFS=$as_save_IFS -rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -6193,8 +6088,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -6210,10 +6105,10 @@ LLVMGXX="llvm-g++${EXEEXT}" # Extract the first word of "$LLVMGCC", so it can be a program name with args. set dummy $LLVMGCC; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LLVMGCC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LLVMGCC in [\\/]* | ?:[\\/]*) @@ -6228,7 +6123,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLVMGCC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6240,20 +6135,20 @@ fi LLVMGCC=$ac_cv_path_LLVMGCC if test -n "$LLVMGCC"; then - { $as_echo "$as_me:$LINENO: result: $LLVMGCC" >&5 -$as_echo "$LLVMGCC" >&6; } + { echo "$as_me:$LINENO: result: $LLVMGCC" >&5 +echo "${ECHO_T}$LLVMGCC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "$LLVMGXX", so it can be a program name with args. set dummy $LLVMGXX; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_LLVMGXX+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LLVMGXX in [\\/]* | ?:[\\/]*) @@ -6268,7 +6163,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLVMGXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6280,11 +6175,11 @@ fi LLVMGXX=$ac_cv_path_LLVMGXX if test -n "$LLVMGXX"; then - { $as_echo "$as_me:$LINENO: result: $LLVMGXX" >&5 -$as_echo "$LLVMGXX" >&6; } + { echo "$as_me:$LINENO: result: $LLVMGXX" >&5 +echo "${ECHO_T}$LLVMGXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6301,8 +6196,8 @@ fi -{ $as_echo "$as_me:$LINENO: checking tool compatibility" >&5 -$as_echo_n "checking tool compatibility... " >&6; } +{ echo "$as_me:$LINENO: checking tool compatibility" >&5 +echo $ECHO_N "checking tool compatibility... $ECHO_C" >&6; } ICC=no IXX=no @@ -6317,15 +6212,15 @@ if test "$GCC" != "yes" && test "$ICC" != "yes" then - { { $as_echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5 -$as_echo "$as_me: error: gcc|icc required but not found" >&2;} + { { echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5 +echo "$as_me: error: gcc|icc required but not found" >&2;} { (exit 1); exit 1; }; } fi if test "$GXX" != "yes" && test "$IXX" != "yes" then - { { $as_echo "$as_me:$LINENO: error: g++|icc required but not found" >&5 -$as_echo "$as_me: error: g++|icc required but not found" >&2;} + { { echo "$as_me:$LINENO: error: g++|icc required but not found" >&5 +echo "$as_me: error: g++|icc required but not found" >&2;} { (exit 1); exit 1; }; } fi @@ -6343,41 +6238,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { { $as_echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 -$as_echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} + { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 +echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} { (exit 1); exit 1; }; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: ok" >&5 -$as_echo "ok" >&6; } +{ echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } -{ $as_echo "$as_me:$LINENO: checking for inflate in -lz" >&5 -$as_echo_n "checking for inflate in -lz... " >&6; } +{ echo "$as_me:$LINENO: checking for inflate in -lz" >&5 +echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6; } if test "${ac_cv_lib_z_inflate+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -6409,37 +6303,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_z_inflate=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflate=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5 -$as_echo "$ac_cv_lib_z_inflate" >&6; } -if test "x$ac_cv_lib_z_inflate" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5 +echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6; } +if test $ac_cv_lib_z_inflate = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF @@ -6448,8 +6338,8 @@ else \ - { { $as_echo "$as_me:$LINENO: error: You need to install the zlib package (z)." >&5 -$as_echo "$as_me: error: You need to install the zlib package (z)." >&2;} + { { echo "$as_me:$LINENO: error: You need to install the zlib package (z)." >&5 +echo "$as_me: error: You need to install the zlib package (z)." >&2;} { (exit 1); exit 1; }; } fi @@ -6457,10 +6347,10 @@ if test "x$gc" = "xboehm"; then -{ $as_echo "$as_me:$LINENO: checking for GC_malloc in -lgc" >&5 -$as_echo_n "checking for GC_malloc in -lgc... " >&6; } +{ echo "$as_me:$LINENO: checking for GC_malloc in -lgc" >&5 +echo $ECHO_N "checking for GC_malloc in -lgc... $ECHO_C" >&6; } if test "${ac_cv_lib_gc_GC_malloc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgc $LIBS" @@ -6492,37 +6382,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gc_GC_malloc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gc_GC_malloc=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_malloc" >&5 -$as_echo "$ac_cv_lib_gc_GC_malloc" >&6; } -if test "x$ac_cv_lib_gc_GC_malloc" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_malloc" >&5 +echo "${ECHO_T}$ac_cv_lib_gc_GC_malloc" >&6; } +if test $ac_cv_lib_gc_GC_malloc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGC 1 _ACEOF @@ -6531,8 +6417,8 @@ else \ - { { $as_echo "$as_me:$LINENO: error: You need to install the boehm-gc package (gc)." >&5 -$as_echo "$as_me: error: You need to install the boehm-gc package (gc)." >&2;} + { { echo "$as_me:$LINENO: error: You need to install the boehm-gc package (gc)." >&5 +echo "$as_me: error: You need to install the boehm-gc package (gc)." >&2;} { (exit 1); exit 1; }; } fi @@ -6541,17 +6427,17 @@ if test "${ac_cv_header_zlib_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 -$as_echo_n "checking for zlib.h... " >&6; } + { echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -$as_echo "$ac_cv_header_zlib_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5 -$as_echo_n "checking zlib.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6567,33 +6453,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5 -$as_echo_n "checking zlib.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking zlib.h presence" >&5 +echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6607,52 +6492,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------------- ## ## Report this to nicolas.geoffray at lip6.fr ## @@ -6661,23 +6545,23 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 -$as_echo_n "checking for zlib.h... " >&6; } +{ echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -$as_echo "$ac_cv_header_zlib_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } fi -if test "x$ac_cv_header_zlib_h" = x""yes; then +if test $ac_cv_header_zlib_h = yes; then : else \ - { { $as_echo "$as_me:$LINENO: error: You need to install the zlib devel package (zlib.h)." >&5 -$as_echo "$as_me: error: You need to install the zlib devel package (zlib.h)." >&2;} + { { echo "$as_me:$LINENO: error: You need to install the zlib devel package (zlib.h)." >&5 +echo "$as_me: error: You need to install the zlib devel package (zlib.h)." >&2;} { (exit 1); exit 1; }; } fi @@ -6686,17 +6570,17 @@ if test "x$gc" = "xboehm"; then if test "${ac_cv_header_gc_gc_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for gc/gc.h" >&5 -$as_echo_n "checking for gc/gc.h... " >&6; } + { echo "$as_me:$LINENO: checking for gc/gc.h" >&5 +echo $ECHO_N "checking for gc/gc.h... $ECHO_C" >&6; } if test "${ac_cv_header_gc_gc_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 -$as_echo "$ac_cv_header_gc_gc_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 +echo "${ECHO_T}$ac_cv_header_gc_gc_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking gc/gc.h usability" >&5 -$as_echo_n "checking gc/gc.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking gc/gc.h usability" >&5 +echo $ECHO_N "checking gc/gc.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6712,33 +6596,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking gc/gc.h presence" >&5 -$as_echo_n "checking gc/gc.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking gc/gc.h presence" >&5 +echo $ECHO_N "checking gc/gc.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6752,52 +6635,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: gc/gc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: gc/gc.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: gc/gc.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: gc/gc.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------------- ## ## Report this to nicolas.geoffray at lip6.fr ## @@ -6806,23 +6688,23 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for gc/gc.h" >&5 -$as_echo_n "checking for gc/gc.h... " >&6; } +{ echo "$as_me:$LINENO: checking for gc/gc.h" >&5 +echo $ECHO_N "checking for gc/gc.h... $ECHO_C" >&6; } if test "${ac_cv_header_gc_gc_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gc_gc_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 -$as_echo "$ac_cv_header_gc_gc_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 +echo "${ECHO_T}$ac_cv_header_gc_gc_h" >&6; } fi -if test "x$ac_cv_header_gc_gc_h" = x""yes; then +if test $ac_cv_header_gc_gc_h = yes; then : else \ - { { $as_echo "$as_me:$LINENO: error: You need to install the boehm-gc devel package (gc/gc.h)." >&5 -$as_echo "$as_me: error: You need to install the boehm-gc devel package (gc/gc.h)." >&2;} + { { echo "$as_me:$LINENO: error: You need to install the boehm-gc devel package (gc/gc.h)." >&5 +echo "$as_me: error: You need to install the boehm-gc devel package (gc/gc.h)." >&2;} { (exit 1); exit 1; }; } fi @@ -6833,46 +6715,11 @@ nl===-----------------------------------------------------------------------=== -{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 -$as_echo_n "checking for pid_t... " >&6; } +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_pid_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6880,11 +6727,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef pid_t ac__type_new_; int main () { -if (sizeof ((pid_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -6895,39 +6745,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_pid_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=yes + ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -$as_echo "$ac_cv_type_pid_t" >&6; } -if test "x$ac_cv_type_pid_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } +if test $ac_cv_type_pid_t = yes; then : else @@ -6937,46 +6778,11 @@ fi -{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 -$as_echo_n "checking for size_t... " >&6; } +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_size_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6984,11 +6790,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef size_t ac__type_new_; int main () { -if (sizeof ((size_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -6999,39 +6808,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_size_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=yes + ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -$as_echo "$ac_cv_type_size_t" >&6; } -if test "x$ac_cv_type_size_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then : else @@ -7041,68 +6841,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_signal=int -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_signal=void -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7118,7 +6860,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -7129,21 +6871,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -7151,8 +6892,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -7161,46 +6902,11 @@ fi -{ $as_echo "$as_me:$LINENO: checking for int64_t" >&5 -$as_echo_n "checking for int64_t... " >&6; } +{ echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } if test "${ac_cv_type_int64_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_int64_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (int64_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7208,11 +6914,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int64_t ac__type_new_; int main () { -if (sizeof ((int64_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7223,39 +6932,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_int64_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int64_t=yes + ac_cv_type_int64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -$as_echo "$ac_cv_type_int64_t" >&6; } -if test "x$ac_cv_type_int64_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6; } +if test $ac_cv_type_int64_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INT64_T 1 @@ -7263,51 +6963,16 @@ else - { { $as_echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5 -$as_echo "$as_me: error: Type int64_t required but not found" >&2;} + { { echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5 +echo "$as_me: error: Type int64_t required but not found" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 -$as_echo_n "checking for uint64_t... " >&6; } +{ echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint64_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_uint64_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (uint64_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7315,11 +6980,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef uint64_t ac__type_new_; int main () { -if (sizeof ((uint64_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7330,39 +6998,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + ac_cv_type_uint64_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uint64_t=yes + ac_cv_type_uint64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -$as_echo "$ac_cv_type_uint64_t" >&6; } -if test "x$ac_cv_type_uint64_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } +if test $ac_cv_type_uint64_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_UINT64_T 1 @@ -7370,46 +7029,11 @@ else - { $as_echo "$as_me:$LINENO: checking for u_int64_t" >&5 -$as_echo_n "checking for u_int64_t... " >&6; } + { echo "$as_me:$LINENO: checking for u_int64_t" >&5 +echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int64_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_u_int64_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (u_int64_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7417,11 +7041,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef u_int64_t ac__type_new_; int main () { -if (sizeof ((u_int64_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7432,39 +7059,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_u_int64_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_u_int64_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_u_int64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -$as_echo "$ac_cv_type_u_int64_t" >&6; } -if test "x$ac_cv_type_u_int64_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; } +if test $ac_cv_type_u_int64_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_U_INT64_T 1 @@ -7472,8 +7090,8 @@ else - { { $as_echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5 -$as_echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;} + { { echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5 +echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;} { (exit 1); exit 1; }; } fi @@ -7485,11 +7103,11 @@ for ac_func in setjmp longjmp do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7542,42 +7160,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -7640,12 +7251,11 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -7678,12 +7288,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7699,7 +7309,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -7712,12 +7322,11 @@ : ${CONFIG_STATUS=./config.status} -ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -7730,7 +7339,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -7740,7 +7349,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -7762,45 +7371,17 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -7816,6 +7397,8 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -7838,7 +7421,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -7851,10 +7434,17 @@ PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -7876,7 +7466,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -7927,7 +7517,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -7955,6 +7545,7 @@ *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -7967,22 +7558,19 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -8007,10 +7595,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -8033,7 +7621,7 @@ # values after options handling. ac_log=" This file was extended by vmkit $as_me 0.26svn, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8046,16 +7634,7 @@ _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -8063,23 +7642,22 @@ _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -8093,24 +7671,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ vmkit config.status 0.26svn -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do @@ -8132,36 +7710,30 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 + { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 + -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -8180,29 +7752,27 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL export CONFIG_SHELL - exec "\$@" + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # @@ -8210,7 +7780,7 @@ _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets @@ -8227,8 +7797,8 @@ "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -8269,143 +7839,221 @@ (umask 077 && mkdir "$tmp") } || { - $as_echo "$as_me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then +_ACEOF -ac_cr=' ' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +VMKIT_COPYRIGHT!$VMKIT_COPYRIGHT$ac_delim +LLVM_SRC!$LLVM_SRC$ac_delim +LLVM_OBJ!$LLVM_OBJ$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +DYLIB_EXTENSION!$DYLIB_EXTENSION$ac_delim +WITH_LLVM_GCC!$WITH_LLVM_GCC$ac_delim +LLVM_FLAGS!$LLVM_FLAGS$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +WITH_64!$WITH_64$ac_delim +GC_MMAP2!$GC_MMAP2$ac_delim +GC_BOEHM!$GC_BOEHM$ac_delim +GC_MULTI_MMAP!$GC_MULTI_MMAP$ac_delim +GC_SINGLE_MMAP!$GC_SINGLE_MMAP$ac_delim +GC_FLAGS!$GC_FLAGS$ac_delim +GC_LIBS!$GC_LIBS$ac_delim +SINGLE_BUILD!$SINGLE_BUILD$ac_delim +SERVICE_BUILD!$SERVICE_BUILD$ac_delim +ISOLATE_BUILD!$ISOLATE_BUILD$ac_delim +VM_FLAGS!$VM_FLAGS$ac_delim +EXCEPTION_FLAGS!$EXCEPTION_FLAGS$ac_delim +classpathglibj!$classpathglibj$ac_delim +classpathlibs!$classpathlibs$ac_delim +classpathinclude!$classpathinclude$ac_delim +classpathversion!$classpathversion$ac_delim +WITH_JNJVM!$WITH_JNJVM$ac_delim +pnetlocalprefix!$pnetlocalprefix$ac_delim +WITH_N3_PNETLIB!$WITH_N3_PNETLIB$ac_delim +N3_LIB!$N3_LIB$ac_delim +pnetlibpath!$pnetlibpath$ac_delim +WITH_N3_MONO!$WITH_N3_MONO$ac_delim +monopath!$monopath$ac_delim +WITH_N3!$WITH_N3$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +NM!$NM$ac_delim +LN_S!$LN_S$ac_delim +CMP!$CMP$ac_delim +CP!$CP$ac_delim +DATE!$DATE$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof _ACEOF -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + cat >conf$$subs.sed <<_ACEOF +FIND!$FIND$ac_delim +MKDIR!$MKDIR$ac_delim +MV!$MV$ac_delim +RANLIB!$RANLIB$ac_delim +RM!$RM$ac_delim +SED!$SED$ac_delim +TAR!$TAR$ac_delim +BINPWD!$BINPWD$ac_delim +CAT!$CAT$ac_delim +LLVMAS!$LLVMAS$ac_delim +LLC!$LLC$ac_delim +ANT!$ANT$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +LLVMGCC!$LLVMGCC$ac_delim +LLVMGXX!$LLVMGXX$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done -rm -f conf$$subs.sh -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } -_ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and @@ -8422,133 +8070,19 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } -fi # test -n "$CONFIG_HEADERS" - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -8577,38 +8111,26 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac @@ -8618,7 +8140,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8644,7 +8166,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -8653,7 +8175,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8674,17 +8196,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -8724,13 +8246,12 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { +case `sed -n '/datarootdir/ { p q } @@ -8739,14 +8260,13 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -8760,16 +8280,15 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t +s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -8779,62 +8298,123 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac ;; :H) # # CONFIG_HEADER # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + rm -f $ac_file + mv "$tmp/config.h" $ac_file fi else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" ;; - :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -8854,11 +8434,6 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -8880,8 +8455,4 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi From nicolas.geoffray at lip6.fr Tue Oct 6 09:43:32 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 16:43:32 -0000 Subject: [vmkit-commits] [vmkit] r83385 - /vmkit/trunk/autoconf/configure.ac Message-ID: <200910061643.n96GhWuF001962@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 11:43:32 2009 New Revision: 83385 URL: http://llvm.org/viewvc/llvm-project?rev=83385&view=rev Log: Also change the dates of copyright. 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=83385&r1=83384&r2=83385&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Oct 6 11:43:32 2009 @@ -35,8 +35,8 @@ dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. -AC_SUBST(VMKIT_COPYRIGHT,["Copyright (c) 2003-2008 Universite Pierre et Marie Curie."]) -AC_COPYRIGHT([Copyright (c) 2003-2008 Universite Pierre et Marie Curie.]) +AC_SUBST(VMKIT_COPYRIGHT,["Copyright (c) 2003-2009 Universite Pierre et Marie Curie."]) +AC_COPYRIGHT([Copyright (c) 2003-2009 Universite Pierre et Marie Curie.]) dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we dnl use some autoconf macros only available in 2.59. From nicolas.geoffray at lip6.fr Tue Oct 6 09:45:10 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 16:45:10 -0000 Subject: [vmkit-commits] [vmkit] r83388 - in /vmkit/trunk: Makefile.config.in Makefile.rules Message-ID: <200910061645.n96GjAdf002238@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 11:45:09 2009 New Revision: 83388 URL: http://llvm.org/viewvc/llvm-project?rev=83388&view=rev Log: Use the ANT that was found by configure. Modified: vmkit/trunk/Makefile.config.in vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.config.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.config.in?rev=83388&r1=83387&r2=83388&view=diff ============================================================================== --- vmkit/trunk/Makefile.config.in (original) +++ vmkit/trunk/Makefile.config.in Tue Oct 6 11:45:09 2009 @@ -13,3 +13,5 @@ SINGLE_BUILD = @SINGLE_BUILD@ WITH_64 = @WITH_64@ WITH_LLVM_GCC = @WITH_LLVM_GCC@ + +ANT = @ANT@ Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=83388&r1=83387&r2=83388&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Oct 6 11:45:09 2009 @@ -124,8 +124,8 @@ endif ifdef RUN_ANT +ifdef ANT -ANT = ant all:: $(Verb) $(ANT) @@ -133,7 +133,8 @@ $(Verb) $(VMJC) -std-compile-opts -load=$(LibDir)/MMTKRuntime$(SHLIBEXT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc + +endif clean-local:: $(Verb) $(RM) -rf classes $(JARNAME).jar $(JARNAME).bc $(JARNAME)-optimized.bc - endif From nicolas.geoffray at lip6.fr Tue Oct 6 09:46:44 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 16:46:44 -0000 Subject: [vmkit-commits] [vmkit] r83389 - in /vmkit/trunk/mmtk: Makefile java/Makefile mmtk-j3/Makefile Message-ID: <200910061646.n96Gki8S002457@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 11:46:44 2009 New Revision: 83389 URL: http://llvm.org/viewvc/llvm-project?rev=83389&view=rev Log: Makefile updates to compile MMTk. Added: vmkit/trunk/mmtk/Makefile vmkit/trunk/mmtk/java/Makefile Modified: vmkit/trunk/mmtk/mmtk-j3/Makefile Added: vmkit/trunk/mmtk/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/Makefile?rev=83389&view=auto ============================================================================== --- vmkit/trunk/mmtk/Makefile (added) +++ vmkit/trunk/mmtk/Makefile Tue Oct 6 11:46:44 2009 @@ -0,0 +1,16 @@ +##===- mmtk/Makefile ---------------------------------------*- Makefile -*-===## +# +# The vmkit project +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = .. + +DIRS = magic mmtk-j3 java + +include $(LEVEL)/Makefile.config + +include $(LEVEL)/Makefile.common + Added: vmkit/trunk/mmtk/java/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/Makefile?rev=83389&view=auto ============================================================================== --- vmkit/trunk/mmtk/java/Makefile (added) +++ vmkit/trunk/mmtk/java/Makefile Tue Oct 6 11:46:44 2009 @@ -0,0 +1,16 @@ +##===- mmtk/java/Makefile ----------------------------------*- Makefile -*-===## +# +# The vmkit project +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = ../.. + +include $(LEVEL)/Makefile.config + +RUN_ANT = 1 +JARNAME = mmtk-vmkit + +include $(LEVEL)/Makefile.common Modified: vmkit/trunk/mmtk/mmtk-j3/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Makefile?rev=83389&r1=83388&r2=83389&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Makefile (original) +++ vmkit/trunk/mmtk/mmtk-j3/Makefile Tue Oct 6 11:46:44 2009 @@ -1,6 +1,6 @@ -##===- mmtk/magic/Makefile ---------------------------------*- Makefile -*-===## +##===- mmtk/mmtk-j3/Makefile -------------------------------*- Makefile -*-===## # -# The LLVM Compiler Infrastructure +# The vmkit project # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. @@ -8,7 +8,15 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. -LIBRARYNAME = MMTKRuntime + +include $(LEVEL)/Makefile.config + +ifeq ($(WITH_LLVM_GCC), 1) + MODULE_NAME = MMTKRuntime +else + LIBRARYNAME = MMTKRuntime +endif + LOADABLE_MODULE = 1 USEDLIBS = From nicolas.geoffray at lip6.fr Tue Oct 6 13:16:14 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 20:16:14 -0000 Subject: [vmkit-commits] [vmkit] r83406 - /vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Message-ID: <200910062016.n96KGE0S031200@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 15:16:14 2009 New Revision: 83406 URL: http://llvm.org/viewvc/llvm-project?rev=83406&view=rev Log: Add some debugging stuff. 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=83406&r1=83405&r2=83406&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Tue Oct 6 15:16:14 2009 @@ -350,6 +350,8 @@ void** addr = mvm::Thread::get() == th ? (void**)FRAME_PTR() : (void**)th->getLastSP(); void** oldAddr = addr; + DEBUG(fprintf(stderr, "%p trace %p\n", (void*)mvm::Thread::get(), (void*)th)); + DEBUG(th->printBacktraceAfterSignal()); // Loop until we cross the first Java frame. while (it != th->addresses.begin()) { From nicolas.geoffray at lip6.fr Tue Oct 6 13:29:23 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 20:29:23 -0000 Subject: [vmkit-commits] [vmkit] r83409 - in /vmkit/trunk/lib: Mvm/Compiler/JIT.cpp N3/VMCore/CLIJit.cpp Message-ID: <200910062029.n96KTNwX000635@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 15:29:23 2009 New Revision: 83409 URL: http://llvm.org/viewvc/llvm-project?rev=83409&view=rev Log: Remove references to predicate simplifier. Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=83409&r1=83408&r2=83409&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Tue Oct 6 15:29:23 2009 @@ -289,7 +289,6 @@ addPass(PM, createCondPropagationPass()); // Propagate conditionals addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, createPredicateSimplifierPass()); addPass(PM, createReassociatePass()); // Reassociate expressions addPass(PM, createLICMPass()); // Hoist loop invariants Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83409&r1=83408&r2=83409&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Tue Oct 6 15:29:23 2009 @@ -1754,7 +1754,6 @@ addPass(PM, createCondPropagationPass()); // Propagate conditionals addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs - addPass(PM, createPredicateSimplifierPass()); addPass(PM, createReassociatePass()); // Reassociate expressions addPass(PM, createLICMPass()); // Hoist loop invariants From nicolas.geoffray at lip6.fr Tue Oct 6 13:37:16 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 06 Oct 2009 20:37:16 -0000 Subject: [vmkit-commits] [vmkit] r83411 - in /vmkit/trunk: include/jnjvm/JavaCompiler.h lib/JnJVM/VMCore/JnjvmClassLoader.cpp Message-ID: <200910062037.n96KbG3i001873@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 6 15:37:15 2009 New Revision: 83411 URL: http://llvm.org/viewvc/llvm-project?rev=83411&view=rev Log: Move the dlsym functionality to the compiler. Modified: vmkit/trunk/include/jnjvm/JavaCompiler.h vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/include/jnjvm/JavaCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/jnjvm/JavaCompiler.h?rev=83411&r1=83410&r2=83411&view=diff ============================================================================== --- vmkit/trunk/include/jnjvm/JavaCompiler.h (original) +++ vmkit/trunk/include/jnjvm/JavaCompiler.h Tue Oct 6 15:37:15 2009 @@ -13,6 +13,7 @@ #include #include #include +#include #include "mvm/GC/GC.h" @@ -83,6 +84,10 @@ virtual mvm::StackScanner* createStackScanner() { return new mvm::UnpreciseStackScanner(); } + + virtual void* loadMethod(void* handle, const char* symbol) { + return dlsym(handle, symbol); + } }; } Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.cpp?rev=83411&r1=83410&r2=83411&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.cpp Tue Oct 6 15:37:15 2009 @@ -1026,12 +1026,12 @@ } intptr_t JnjvmClassLoader::loadInLib(const char* buf, bool& jnjvm) { - uintptr_t res = (uintptr_t)dlsym(SELF_HANDLE, buf); + uintptr_t res = (uintptr_t)TheCompiler->loadMethod(SELF_HANDLE, buf); if (!res) { for (std::vector::iterator i = nativeLibs.begin(), e = nativeLibs.end(); i!= e; ++i) { - res = (uintptr_t)dlsym((*i), buf); + res = (uintptr_t)TheCompiler->loadMethod((*i), buf); if (res) break; } } else { @@ -1051,7 +1051,7 @@ } intptr_t JnjvmClassLoader::loadInLib(const char* name, void* handle) { - return (intptr_t)dlsym(handle, name); + return (intptr_t)TheCompiler->loadMethod(handle, name); } intptr_t JnjvmClassLoader::nativeLookup(JavaMethod* meth, bool& jnjvm, From nicolas.geoffray at lip6.fr Wed Oct 7 09:53:50 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 07 Oct 2009 16:53:50 -0000 Subject: [vmkit-commits] [vmkit] r83463 - /vmkit/trunk/Makefile Message-ID: <200910071653.n97GroBV025754@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 7 11:53:50 2009 New Revision: 83463 URL: http://llvm.org/viewvc/llvm-project?rev=83463&view=rev Log: Build MMTk only if llvm-gcc is used. Modified: vmkit/trunk/Makefile Modified: vmkit/trunk/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile?rev=83463&r1=83462&r2=83463&view=diff ============================================================================== --- vmkit/trunk/Makefile (original) +++ vmkit/trunk/Makefile Wed Oct 7 11:53:50 2009 @@ -9,9 +9,16 @@ LEVEL := . +include $(LEVEL)/Makefile.config + # Top-Level vmkit Build Stages: # DIRS := lib tools + +ifeq ($(WITH_LLVM_GCC), 1) + DIRS += mmtk +endif + EXTRA_DIST=include include $(LEVEL)/Makefile.common From nicolas.geoffray at lip6.fr Wed Oct 7 10:07:44 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 07 Oct 2009 17:07:44 -0000 Subject: [vmkit-commits] [vmkit] r83466 - in /vmkit/trunk: include/jnjvm/JnjvmModule.h lib/JnJVM/Compiler/JavaJITCompiler.cpp Message-ID: <200910071707.n97H7jpU027546@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 7 12:07:44 2009 New Revision: 83466 URL: http://llvm.org/viewvc/llvm-project?rev=83466&view=rev Log: When looking for a native method, first look if the method is in the globalModule. Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/jnjvm/JnjvmModule.h?rev=83466&r1=83465&r2=83466&view=diff ============================================================================== --- vmkit/trunk/include/jnjvm/JnjvmModule.h (original) +++ vmkit/trunk/include/jnjvm/JnjvmModule.h Wed Oct 7 12:07:44 2009 @@ -482,7 +482,7 @@ virtual void virtualCallAP(Signdef* sign) { getSignatureInfo(sign)->getVirtualAP(); } - + llvm::Function* NativeLoader; }; @@ -566,6 +566,8 @@ return new mvm::UnpreciseStackScanner(); } #endif + + virtual void* loadMethod(void* handle, const char* symbol); }; Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp?rev=83466&r1=83465&r2=83466&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp Wed Oct 7 12:07:44 2009 @@ -304,3 +304,14 @@ delete[] newArgv; return 0; } + +void* JavaJITCompiler::loadMethod(void* handle, const char* symbol) { + Function* F = mvm::MvmModule::globalModule->getFunction(symbol); + if (F) { + void* res = mvm::MvmModule::executionEngine->getPointerToFunction(F); + return res; + } + + return JavaCompiler::loadMethod(handle, symbol); +} + From nicolas.geoffray at lip6.fr Thu Oct 8 00:58:17 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 07:58:17 -0000 Subject: [vmkit-commits] [vmkit] r83534 - /vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp Message-ID: <200910080758.n987wHwD013025@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 02:58:16 2009 New Revision: 83534 URL: http://llvm.org/viewvc/llvm-project?rev=83534&view=rev Log: The code emitted for a JNI call was not correct. Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp?rev=83534&r1=83533&r2=83534&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp Thu Oct 8 02:58:16 2009 @@ -387,16 +387,16 @@ ResultObject = new AllocaInst(module->JavaObjectType, "", func->begin()->begin()); Value* GCArgs[2] = { - new BitCastInst(ResultObject, module->ptrPtrType, "", ResultObject), + new BitCastInst(ResultObject, module->ptrPtrType, "", currentBlock), module->constantPtrNull }; if (TheCompiler->useCooperativeGC()) { CallInst::Create(module->llvm_gc_gcroot, GCArgs, GCArgs + 2, "", - ResultObject); + currentBlock); } new StoreInst(module->JavaObjectNullConstant, ResultObject, "", - ResultObject); + currentBlock); } Value* nativeFunc = TheCompiler->getNativeFunction(compilingMethod, From nicolas.geoffray at lip6.fr Thu Oct 8 01:00:34 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 08:00:34 -0000 Subject: [vmkit-commits] [vmkit] r83535 - /vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp Message-ID: <200910080800.n9880Y6d015066@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 03:00:33 2009 New Revision: 83535 URL: http://llvm.org/viewvc/llvm-project?rev=83535&view=rev Log: Properly initialize a JavaJITListener. Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp?rev=83535&r1=83534&r2=83535&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJITCompiler.cpp Thu Oct 8 03:00:33 2009 @@ -50,6 +50,10 @@ void setCurrentCompiledMethod(JavaMethod* meth) { currentCompiledMethod = meth; } + + JavaJITListener() { + currentCompiledMethod = 0; + } }; static JavaJITListener* JITListener = 0; From nicolas.geoffray at lip6.fr Thu Oct 8 01:58:48 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 08:58:48 -0000 Subject: [vmkit-commits] [vmkit] r83536 - in /vmkit/trunk: include/jnjvm/JnjvmModule.h lib/JnJVM/Compiler/JavaAOTCompiler.cpp Message-ID: <200910080858.n988wmYv025210@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 03:58:47 2009 New Revision: 83536 URL: http://llvm.org/viewvc/llvm-project?rev=83536&view=rev Log: The AOT compiler should also define loadMethod, so that it thinks that a method loaded by a .bc file is defined in the VM. Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/jnjvm/JnjvmModule.h?rev=83536&r1=83535&r2=83536&view=diff ============================================================================== --- vmkit/trunk/include/jnjvm/JnjvmModule.h (original) +++ vmkit/trunk/include/jnjvm/JnjvmModule.h Thu Oct 8 03:58:47 2009 @@ -621,6 +621,8 @@ #endif virtual ~JavaAOTCompiler() {} + + virtual void* loadMethod(void* handle, const char* symbol); private: Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp?rev=83536&r1=83535&r2=83536&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Thu Oct 8 03:58:47 2009 @@ -1998,3 +1998,18 @@ ReturnInst::Create(getGlobalContext(), res, currentBlock); } + + +// Use a FakeFunction to return from loadMethod, so that the compiler thinks +// the method is defined by J3. +extern "C" void __JavaAOTFakeFunction__() {} + +void* JavaAOTCompiler::loadMethod(void* handle, const char* symbol) { + Function* F = mvm::MvmModule::globalModule->getFunction(symbol); + if (F) { + return (void*)(uintptr_t)__JavaAOTFakeFunction__; + } + + return JavaCompiler::loadMethod(handle, symbol); +} + From nicolas.geoffray at lip6.fr Thu Oct 8 01:59:27 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 08:59:27 -0000 Subject: [vmkit-commits] [vmkit] r83537 - /vmkit/trunk/tools/vmjc/vmjc.cpp Message-ID: <200910080859.n988xRdb025318@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 03:59:26 2009 New Revision: 83537 URL: http://llvm.org/viewvc/llvm-project?rev=83537&view=rev Log: Fix comment. Modified: vmkit/trunk/tools/vmjc/vmjc.cpp Modified: vmkit/trunk/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=83537&r1=83536&r2=83537&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/vmjc.cpp (original) +++ vmkit/trunk/tools/vmjc/vmjc.cpp Thu Oct 8 03:59:26 2009 @@ -121,7 +121,7 @@ Properties("D", cl::desc("Set a property"), cl::Prefix, cl::ZeroOrMore); static cl::list -WithClinit("with-clinit", cl::desc("Set a property"), cl::ZeroOrMore, +WithClinit("with-clinit", cl::desc("Classes to clinit"), cl::ZeroOrMore, cl::CommaSeparated); From nicolas.geoffray at lip6.fr Thu Oct 8 02:01:00 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 09:01:00 -0000 Subject: [vmkit-commits] [vmkit] r83538 - in /vmkit/trunk: lib/Mvm/Compiler/JIT.cpp tools/jnjvm/Makefile tools/n3-mono/Makefile tools/n3-pnetlib/Makefile tools/vmjc/Makefile tools/vmkit/Makefile Message-ID: <200910080901.n98910cP025574@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 04:01:00 2009 New Revision: 83538 URL: http://llvm.org/viewvc/llvm-project?rev=83538&view=rev Log: Add the possibility to load .bc or .ll files dynamically and link with application code. Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp vmkit/trunk/tools/jnjvm/Makefile vmkit/trunk/tools/n3-mono/Makefile vmkit/trunk/tools/n3-pnetlib/Makefile vmkit/trunk/tools/vmjc/Makefile vmkit/trunk/tools/vmkit/Makefile Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=83538&r1=83537&r2=83538&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Thu Oct 8 04:01:00 2009 @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -19,11 +20,15 @@ #include #include #include +#include #include #include #include +#include "llvm/Support/CommandLine.h" #include +#include #include +#include "llvm/Support/SourceMgr.h" #include #include #include @@ -40,6 +45,10 @@ using namespace llvm; +static cl::list +LoadBytecodeFiles("load-bc", cl::desc("Load bytecode file"), cl::ZeroOrMore, + cl::CommaSeparated); + namespace mvm { namespace llvm_runtime { #include "LLVMRuntime.inc" @@ -51,6 +60,17 @@ return LLVM_HOSTTRIPLE; } +void MvmModule::loadBytecodeFile(const std::string& str) { + SMDiagnostic Err; + Module* M = ParseIRFile(str, Err, getGlobalContext()); + if (M) { + M->setTargetTriple(getHostTriple()); + Linker::LinkModules(globalModule, M, 0); + delete M; + } else { + Err.Print("load bytecode", errs()); + } +} void MvmModule::initialise(CodeGenOpt::Level level, Module* M, TargetMachine* T) { @@ -97,7 +117,12 @@ ptrPtrType = PointerType::getUnqual(ptrType); pointerSizeType = globalModule->getPointerSize() == Module::Pointer32 ? Type::getInt32Ty(Context) : Type::getInt64Ty(Context); - + + for (std::vector::iterator i = LoadBytecodeFiles.begin(), + e = LoadBytecodeFiles.end(); i != e; ++i) { + loadBytecodeFile(*i); + } + } @@ -333,12 +358,12 @@ // Loop over all of the functions in the src module, mapping them over for (Module::const_iterator I = Src->begin(), E = Src->end(); I != E; ++I) { const Function *SF = I; // SrcFunction - assert(SF->isDeclaration() && - "Don't know how top copy functions with body"); - Function* F = Function::Create(SF->getFunctionType(), - GlobalValue::ExternalLinkage, - SF->getName(), Dst); - F->setAttributes(SF->getAttributes()); + if (SF->isDeclaration()) { + Function* F = Function::Create(SF->getFunctionType(), + GlobalValue::ExternalLinkage, + SF->getName(), Dst); + F->setAttributes(SF->getAttributes()); + } } } Modified: vmkit/trunk/tools/jnjvm/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/jnjvm/Makefile?rev=83538&r1=83537&r2=83538&view=diff ============================================================================== --- vmkit/trunk/tools/jnjvm/Makefile (original) +++ vmkit/trunk/tools/jnjvm/Makefile Thu Oct 8 04:01:00 2009 @@ -37,7 +37,7 @@ endif -LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo +LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo bitreader asmparser linker include $(LEVEL)/Makefile.common Modified: vmkit/trunk/tools/n3-mono/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/n3-mono/Makefile?rev=83538&r1=83537&r2=83538&view=diff ============================================================================== --- vmkit/trunk/tools/n3-mono/Makefile (original) +++ vmkit/trunk/tools/n3-mono/Makefile Thu Oct 8 04:01:00 2009 @@ -11,7 +11,7 @@ include $(LEVEL)/Makefile.config TOOLNAME = n3-mono -LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo +LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo bitreader asmparser linker ifeq ($(WITH_LLVM_GCC), 1) Modified: vmkit/trunk/tools/n3-pnetlib/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/n3-pnetlib/Makefile?rev=83538&r1=83537&r2=83538&view=diff ============================================================================== --- vmkit/trunk/tools/n3-pnetlib/Makefile (original) +++ vmkit/trunk/tools/n3-pnetlib/Makefile Thu Oct 8 04:01:00 2009 @@ -11,7 +11,7 @@ include $(LEVEL)/Makefile.config TOOLNAME = n3-pnetlib -LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo +LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo bitreader asmparser linker ifeq ($(WITH_LLVM_GCC), 1) MODULESNAME = vmkit Modified: vmkit/trunk/tools/vmjc/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/Makefile?rev=83538&r1=83537&r2=83538&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/Makefile (original) +++ vmkit/trunk/tools/vmjc/Makefile Thu Oct 8 04:01:00 2009 @@ -29,6 +29,6 @@ Mvm.a MvmCompiler.a $(GCLIB).a endif -LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo bitwriter +LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo bitwriter bitreader asmparser linker include $(LEVEL)/Makefile.common Modified: vmkit/trunk/tools/vmkit/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmkit/Makefile?rev=83538&r1=83537&r2=83538&view=diff ============================================================================== --- vmkit/trunk/tools/vmkit/Makefile (original) +++ vmkit/trunk/tools/vmkit/Makefile Thu Oct 8 04:01:00 2009 @@ -53,7 +53,7 @@ endif -LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo +LINK_COMPONENTS = jit nativecodegen scalaropts instrumentation ipa ipo bitreader asmparser linker include $(LEVEL)/Makefile.common From nicolas.geoffray at lip6.fr Thu Oct 8 02:01:53 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 09:01:53 -0000 Subject: [vmkit-commits] [vmkit] r83539 - /vmkit/trunk/Makefile.rules Message-ID: <200910080901.n9891rZi025728@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 04:01:53 2009 New Revision: 83539 URL: http://llvm.org/viewvc/llvm-project?rev=83539&view=rev Log: Load the .bc file, not the dynamic library. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=83539&r1=83538&r2=83539&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Thu Oct 8 04:01:53 2009 @@ -130,7 +130,7 @@ all:: $(Verb) $(ANT) $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) - $(Verb) $(VMJC) -std-compile-opts -load=$(LibDir)/MMTKRuntime$(SHLIBEXT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc + $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc From nicolas.geoffray at lip6.fr Thu Oct 8 02:05:03 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 09:05:03 -0000 Subject: [vmkit-commits] [vmkit] r83540 - /vmkit/trunk/include/mvm/JIT.h Message-ID: <200910080905.n98953qa026359@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 04:05:02 2009 New Revision: 83540 URL: http://llvm.org/viewvc/llvm-project?rev=83540&view=rev Log: Forgot that file from last commit. Modified: vmkit/trunk/include/mvm/JIT.h Modified: vmkit/trunk/include/mvm/JIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=83540&r1=83539&r2=83540&view=diff ============================================================================== --- vmkit/trunk/include/mvm/JIT.h (original) +++ vmkit/trunk/include/mvm/JIT.h Thu Oct 8 04:05:02 2009 @@ -186,6 +186,7 @@ static void initialise(llvm::CodeGenOpt::Level = llvm::CodeGenOpt::Default, llvm::Module* TheModule = 0, llvm::TargetMachine* TheTarget = 0); + static void loadBytecodeFile(const std::string& str); static int disassemble(unsigned int* addr); From nicolas.geoffray at lip6.fr Thu Oct 8 02:11:11 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 09:11:11 -0000 Subject: [vmkit-commits] [vmkit] r83541 - /vmkit/trunk/Makefile.rules Message-ID: <200910080911.n989BBQZ027634@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 04:11:11 2009 New Revision: 83541 URL: http://llvm.org/viewvc/llvm-project?rev=83541&view=rev Log: Only compile an ANT rule if LLVM_GCC is defined. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=83541&r1=83540&r2=83541&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Thu Oct 8 04:11:11 2009 @@ -123,6 +123,7 @@ endif endif +ifeq ($(WITH_LLVM_GCC), 1) ifdef RUN_ANT ifdef ANT @@ -138,3 +139,4 @@ clean-local:: $(Verb) $(RM) -rf classes $(JARNAME).jar $(JARNAME).bc $(JARNAME)-optimized.bc endif +endif From nicolas.geoffray at lip6.fr Thu Oct 8 03:33:38 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 10:33:38 -0000 Subject: [vmkit-commits] [vmkit] r83542 - in /vmkit/trunk: Makefile.rules mmtk/java/vmkit.properties Message-ID: <200910081033.n98AXdki008981@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 05:33:38 2009 New Revision: 83542 URL: http://llvm.org/viewvc/llvm-project?rev=83542&view=rev Log: Add a vmkit.properties file for MMTk properties. Added: vmkit/trunk/mmtk/java/vmkit.properties Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=83542&r1=83541&r2=83542&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Thu Oct 8 05:33:38 2009 @@ -131,7 +131,7 @@ all:: $(Verb) $(ANT) $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) - $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc + $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=vmkit.properties $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc Added: vmkit/trunk/mmtk/java/vmkit.properties URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/vmkit.properties?rev=83542&view=auto ============================================================================== --- vmkit/trunk/mmtk/java/vmkit.properties (added) +++ vmkit/trunk/mmtk/java/vmkit.properties Thu Oct 8 05:33:38 2009 @@ -0,0 +1,10 @@ +# This file is licensed to You under the Eclipse Public License (EPL); +# You may not use this file except in compliance with the License. You +# may obtain a copy of the License at +# +# http://www.opensource.org/licenses/eclipse-1.0.php +# +# See the COPYRIGHT.txt file distributed with this work for information +# regarding copyright ownership. +# +mmtk.headerMarkBit = false From nicolas.geoffray at lip6.fr Thu Oct 8 05:23:52 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 12:23:52 -0000 Subject: [vmkit-commits] [vmkit] r83543 - in /vmkit/trunk/lib/JnJVM: Compiler/JnjvmModule.cpp LLVMRuntime/runtime-single.ll VMCore/JavaClass.h Message-ID: <200910081223.n98CNqNm028633@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 07:23:51 2009 New Revision: 83543 URL: http://llvm.org/viewvc/llvm-project?rev=83543&view=rev Log: Add a new field inf JavaClass for instance alignment. Modified: vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Modified: vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp?rev=83543&r1=83542&r2=83543&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp Thu Oct 8 07:23:51 2009 @@ -194,8 +194,8 @@ OffsetObjectSizeInClassConstant = constantOne; OffsetVTInClassConstant = ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 7); - OffsetTaskClassMirrorInClassConstant = constantTwo; - OffsetStaticInstanceInTaskClassMirrorConstant = constantTwo; + OffsetTaskClassMirrorInClassConstant = constantThree; + OffsetStaticInstanceInTaskClassMirrorConstant = constantThree; OffsetStatusInTaskClassMirrorConstant = constantZero; OffsetInitializedInTaskClassMirrorConstant = constantOne; Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll?rev=83543&r1=83542&r2=83543&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll (original) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-single.ll Thu Oct 8 07:23:51 2009 @@ -6,7 +6,7 @@ %JavaClass**, i16, %UTF8*, %JavaClass*, i8*, %VT* } -%JavaClass = type { %JavaCommonClass, i32, [1 x %TaskClassMirror], i8*, +%JavaClass = type { %JavaCommonClass, i32, i32, [1 x %TaskClassMirror], i8*, %JavaField*, i16, %JavaField*, i16, %JavaMethod*, i16, %JavaMethod*, i16, i8*, %ArrayUInt8*, i8*, %Attribut*, i16, %JavaClass**, i16, %JavaClass*, i16, i8, i8, i32, i32, Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=83543&r1=83542&r2=83543&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Thu Oct 8 07:23:51 2009 @@ -440,6 +440,10 @@ /// uint32 virtualSize; + /// aligment - Alignment of instances of this class. + /// + uint32 alignment; + /// IsolateInfo - Per isolate informations for static instances and /// initialization state. /// From nicolas.geoffray at lip6.fr Thu Oct 8 05:24:24 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 12:24:24 -0000 Subject: [vmkit-commits] [vmkit] r83544 - /vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll Message-ID: <200910081224.n98COOLJ028727@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 07:24:24 2009 New Revision: 83544 URL: http://llvm.org/viewvc/llvm-project?rev=83544&view=rev Log: Forgot this file from last commit. Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll?rev=83544&r1=83543&r2=83544&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll (original) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-isolate.ll Thu Oct 8 07:24:24 2009 @@ -9,7 +9,7 @@ %VT* } -%JavaClass = type { %JavaCommonClass, i32, [32 x %TaskClassMirror], i8*, +%JavaClass = type { %JavaCommonClass, i32, i32, [32 x %TaskClassMirror], i8*, %JavaField*, i16, %JavaField*, i16, %JavaMethod*, i16, %JavaMethod*, i16, i8*, %ArrayUInt8*, i8*, %Attribut*, i16, %JavaClass**, i16, %JavaClass*, i16, i8, i8, i32, i32, From nicolas.geoffray at lip6.fr Thu Oct 8 06:12:11 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 13:12:11 -0000 Subject: [vmkit-commits] [vmkit] r83545 - /vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Message-ID: <200910081312.n98DCBv6003097@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 08:12:11 2009 New Revision: 83545 URL: http://llvm.org/viewvc/llvm-project?rev=83545&view=rev Log: Adjust AOT emission of Java classes. Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp?rev=83545&r1=83544&r2=83545&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Thu Oct 8 08:12:11 2009 @@ -1010,9 +1010,13 @@ // virtualSize ClassElts.push_back(ConstantInt::get(Type::getInt32Ty(getGlobalContext()), cl->virtualSize)); + + // alginment + ClassElts.push_back(ConstantInt::get(Type::getInt32Ty(getGlobalContext()), + cl->alignment)); // IsolateInfo - const ArrayType* ATy = dyn_cast(STy->getContainedType(2)); + const ArrayType* ATy = dyn_cast(STy->getContainedType(3)); assert(ATy && "Malformed type"); const StructType* TCMTy = dyn_cast(ATy->getContainedType(0)); From nicolas.geoffray at lip6.fr Thu Oct 8 06:12:38 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 13:12:38 -0000 Subject: [vmkit-commits] [vmkit] r83546 - /vmkit/trunk/lib/JnJVM/Compiler/JITInfo.cpp Message-ID: <200910081312.n98DCct2003167@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 08:12:37 2009 New Revision: 83546 URL: http://llvm.org/viewvc/llvm-project?rev=83546&view=rev Log: Set the alignment of classes. Modified: vmkit/trunk/lib/JnJVM/Compiler/JITInfo.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JITInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JITInfo.cpp?rev=83546&r1=83545&r2=83546&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JITInfo.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JITInfo.cpp Thu Oct 8 08:12:37 2009 @@ -80,6 +80,7 @@ uint64 size = JnjvmModule::getTypeSize(structType); classDef->virtualSize = (uint32)size; + classDef->alignment = sl->getAlignment(); virtualSizeConstant = ConstantInt::get(Type::getInt32Ty(context), size); Mod->makeVT(classDef); From nicolas.geoffray at lip6.fr Thu Oct 8 11:00:01 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Thu, 08 Oct 2009 18:00:01 -0000 Subject: [vmkit-commits] [vmkit] r83561 - /vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Message-ID: <200910081800.n98I01ht009767@zion.cs.uiuc.edu> Author: geoffray Date: Thu Oct 8 13:00:01 2009 New Revision: 83561 URL: http://llvm.org/viewvc/llvm-project?rev=83561&view=rev Log: Remove line from bugous commit. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=83561&r1=83560&r2=83561&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Thu Oct 8 13:00:01 2009 @@ -51,7 +51,6 @@ #define END_JNI_EXCEPTION \ } catch(...) { \ - fprintf(stderr, "I have caught something here\n"); \ th->endNative(); \ th->addresses.pop_back(); \ th->enterUncooperativeCode(SP); \ From nicolas.geoffray at lip6.fr Fri Oct 9 03:28:23 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 10:28:23 -0000 Subject: [vmkit-commits] [vmkit] r83630 - in /vmkit/trunk/lib: JnJVM/Compiler/JnjvmModule.cpp Mvm/GCMmap2/gcthread.h Message-ID: <200910091028.n99ASNvg011803@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 05:28:22 2009 New Revision: 83630 URL: http://llvm.org/viewvc/llvm-project?rev=83630&view=rev Log: Enable cooperative GC if we're compiling with llvm-gcc. Modified: vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h Modified: vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp?rev=83630&r1=83629&r2=83630&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp Fri Oct 9 05:28:22 2009 @@ -67,7 +67,11 @@ JavaIntrinsics(TheModule) { enabledException = true; +#ifdef WITH_LLVM_GCC + cooperativeGC = true; +#else cooperativeGC = false; +#endif } void JavaLLVMCompiler::resolveVirtualClass(Class* cl) { Modified: vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h?rev=83630&r1=83629&r2=83630&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h Fri Oct 9 05:28:22 2009 @@ -53,7 +53,11 @@ _nb_collected = 0; current_collector = 0; base = 0; +#ifdef WITH_LLVM_GCC + cooperative = true; +#else cooperative = false; +#endif } inline unsigned int get_nb_threads() { From nicolas.geoffray at lip6.fr Fri Oct 9 03:31:18 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 10:31:18 -0000 Subject: [vmkit-commits] [vmkit] r83631 - /vmkit/branches/release_026/ Message-ID: <200910091031.n99AVIgc011937@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 05:31:18 2009 New Revision: 83631 URL: http://llvm.org/viewvc/llvm-project?rev=83631&view=rev Log: Create 0.26 branch. Added: vmkit/branches/release_026/ - copied from r83630, vmkit/trunk/ From nicolas.geoffray at lip6.fr Fri Oct 9 03:50:49 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 10:50:49 -0000 Subject: [vmkit-commits] [vmkit] r83632 - /vmkit/branches/release_026/autoconf/configure.ac Message-ID: <200910091050.n99AonWd012875@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 05:50:49 2009 New Revision: 83632 URL: http://llvm.org/viewvc/llvm-project?rev=83632&view=rev Log: Move to version 0.26. Modified: vmkit/branches/release_026/autoconf/configure.ac Modified: vmkit/branches/release_026/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/autoconf/configure.ac?rev=83632&r1=83631&r2=83632&view=diff ============================================================================== --- vmkit/branches/release_026/autoconf/configure.ac (original) +++ vmkit/branches/release_026/autoconf/configure.ac Fri Oct 9 05:50:49 2009 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([vmkit],[0.26svn],[nicolas.geoffray at lip6.fr]) +AC_INIT([vmkit],[0.26],[nicolas.geoffray at lip6.fr]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. From nicolas.geoffray at lip6.fr Fri Oct 9 03:51:19 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 10:51:19 -0000 Subject: [vmkit-commits] [vmkit] r83633 - /vmkit/trunk/autoconf/configure.ac Message-ID: <200910091051.n99ApJQa012903@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 05:51:19 2009 New Revision: 83633 URL: http://llvm.org/viewvc/llvm-project?rev=83633&view=rev Log: Move to version 0.27svn. 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=83633&r1=83632&r2=83633&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Fri Oct 9 05:51:19 2009 @@ -31,7 +31,7 @@ dnl===-----------------------------------------------------------------------=== dnl Initialize autoconf and define the package name, version number and dnl email address for reporting bugs. -AC_INIT([vmkit],[0.26svn],[nicolas.geoffray at lip6.fr]) +AC_INIT([vmkit],[0.27svn],[nicolas.geoffray at lip6.fr]) dnl Provide a copyright substitution and ensure the copyright notice is included dnl in the output of --version option of the generated configure script. From nicolas.geoffray at lip6.fr Fri Oct 9 03:53:04 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 10:53:04 -0000 Subject: [vmkit-commits] [vmkit] r83634 - /vmkit/branches/release_026/configure Message-ID: <200910091053.n99Ar4J9013062@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 05:53:04 2009 New Revision: 83634 URL: http://llvm.org/viewvc/llvm-project?rev=83634&view=rev Log: Regenerate. Modified: vmkit/branches/release_026/configure Modified: vmkit/branches/release_026/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/configure?rev=83634&r1=83633&r2=83634&view=diff ============================================================================== --- vmkit/branches/release_026/configure (original) +++ vmkit/branches/release_026/configure Fri Oct 9 05:53:04 2009 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for vmkit 0.26svn. +# Generated by GNU Autoconf 2.61 for vmkit 0.26. # # Report bugs to . # @@ -576,8 +576,8 @@ # Identity of this package. PACKAGE_NAME='vmkit' PACKAGE_TARNAME='vmkit' -PACKAGE_VERSION='0.26svn' -PACKAGE_STRING='vmkit 0.26svn' +PACKAGE_VERSION='0.26' +PACKAGE_STRING='vmkit 0.26' PACKAGE_BUGREPORT='nicolas.geoffray at lip6.fr' ac_unique_file="lib/Mvm/Runtime/Object.cpp" @@ -1249,7 +1249,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vmkit 0.26svn to adapt to many kinds of systems. +\`configure' configures vmkit 0.26 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vmkit 0.26svn:";; + short | recursive ) echo "Configuration of vmkit 0.26:";; esac cat <<\_ACEOF @@ -1423,7 +1423,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vmkit configure 0.26svn +vmkit configure 0.26 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1439,7 +1439,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vmkit $as_me 0.26svn, which was +It was created by vmkit $as_me 0.26, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -7620,7 +7620,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vmkit $as_me 0.26svn, which was +This file was extended by vmkit $as_me 0.26, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7673,7 +7673,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -vmkit config.status 0.26svn +vmkit config.status 0.26 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -8421,9 +8421,9 @@ case $ac_file$ac_mode in "Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/Makefile Makefile ;; + ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;; "lib/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname lib/Makefile` - ${SHELL} ${llvm_src}/autoconf/install-sh -m 0644 -c ${srcdir}/lib/Makefile lib/Makefile ;; + ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/lib/Makefile lib/Makefile ;; esac done # for ac_tag From nicolas.geoffray at lip6.fr Fri Oct 9 03:53:28 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 10:53:28 -0000 Subject: [vmkit-commits] [vmkit] r83635 - /vmkit/trunk/configure Message-ID: <200910091053.n99ArSI0013085@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 05:53:28 2009 New Revision: 83635 URL: http://llvm.org/viewvc/llvm-project?rev=83635&view=rev Log: Regenerate. Modified: vmkit/trunk/configure Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=83635&r1=83634&r2=83635&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Fri Oct 9 05:53:28 2009 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for vmkit 0.26svn. +# Generated by GNU Autoconf 2.61 for vmkit 0.27svn. # # Report bugs to . # @@ -576,8 +576,8 @@ # Identity of this package. PACKAGE_NAME='vmkit' PACKAGE_TARNAME='vmkit' -PACKAGE_VERSION='0.26svn' -PACKAGE_STRING='vmkit 0.26svn' +PACKAGE_VERSION='0.27svn' +PACKAGE_STRING='vmkit 0.27svn' PACKAGE_BUGREPORT='nicolas.geoffray at lip6.fr' ac_unique_file="lib/Mvm/Runtime/Object.cpp" @@ -1249,7 +1249,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures vmkit 0.26svn to adapt to many kinds of systems. +\`configure' configures vmkit 0.27svn to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vmkit 0.26svn:";; + short | recursive ) echo "Configuration of vmkit 0.27svn:";; esac cat <<\_ACEOF @@ -1423,7 +1423,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vmkit configure 0.26svn +vmkit configure 0.27svn generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1439,7 +1439,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by vmkit $as_me 0.26svn, which was +It was created by vmkit $as_me 0.27svn, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -7620,7 +7620,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by vmkit $as_me 0.26svn, which was +This file was extended by vmkit $as_me 0.27svn, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7673,7 +7673,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -vmkit config.status 0.26svn +vmkit config.status 0.27svn configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" From nicolas.geoffray at lip6.fr Fri Oct 9 04:11:25 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 11:11:25 -0000 Subject: [vmkit-commits] [vmkit] r83636 - in /vmkit/trunk: lib/JnJVM/VMCore/JavaThread.h lib/Mvm/GCMmap2/MutatorThread.h mmtk/mmtk-j3/MutatorThread.h Message-ID: <200910091111.n99BBPEl013761@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 06:11:25 2009 New Revision: 83636 URL: http://llvm.org/viewvc/llvm-project?rev=83636&view=rev Log: Add a MutatorThread.h interface, that is specialized by each GC. Added: vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=83636&r1=83635&r2=83636&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Fri Oct 9 06:11:25 2009 @@ -18,6 +18,8 @@ #include "mvm/Threads/Locks.h" #include "mvm/Threads/Thread.h" +#include "MutatorThread.h" + #include "JavaObject.h" #include "JNIReferences.h" @@ -73,7 +75,7 @@ /// It maintains thread-specific information such as its state, the current /// exception if there is one, the layout of the stack, etc. /// -class JavaThread : public mvm::Thread { +class JavaThread : public mvm::MutatorThread { public: Added: vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h?rev=83636&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h (added) +++ vmkit/trunk/lib/Mvm/GCMmap2/MutatorThread.h Fri Oct 9 06:11:25 2009 @@ -0,0 +1,23 @@ +//===--------- MutatorThread.h - Thread for GC ----------------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#ifndef MVM_MUTATOR_THREAD_H +#define MVM_MUTATOR_THREAD_H + +#include "mvm/Threads/Thread.h" + +namespace mvm { + +class MutatorThread : public mvm::Thread { +}; + +} + +#endif Added: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h?rev=83636&view=auto ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h (added) +++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Fri Oct 9 06:11:25 2009 @@ -0,0 +1,43 @@ +//===--------- MutatorThread.h - Thread for GC ----------------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#ifndef MVM_MUTATOR_THREAD_H +#define MVM_MUTATOR_THREAD_H + +#include "mvm/Allocator.h" +#include "mvm/Threads/Thread.h" + +namespace mvm { + + +class MutatorThread : public mvm::Thread { +public: + mvm::BumpPtrAllocator Allocator; + uintptr_t MutatorContext; + uintptr_t CollectorContext; + + static size_t MutatorSize; + static size_t CollectorSize; + + static void (*CollectorInit)(uintptr_t); + static void (*MutatorInit)(uintptr_t); + + MutatorThread() { + MutatorContext = Allocator.Allocate(MutatorSize); + MutatorInit(MutatorContext); + CollectorContext = Allocator.Allocate(CollectorSize); + CollectorInit(CollectorContext); + } + +}; + +} + +#endif From nicolas.geoffray at lip6.fr Fri Oct 9 06:47:27 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 13:47:27 -0000 Subject: [vmkit-commits] [vmkit] r83639 - /vmkit/branches/release_026/lib/N3/VMCore/N3Initialise.cpp Message-ID: <200910091347.n99DlRwW019299@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 08:47:27 2009 New Revision: 83639 URL: http://llvm.org/viewvc/llvm-project?rev=83639&view=rev Log: Put the destructor to zero, as UTF8s may be allocated by the main thread that does not have a VM. Modified: vmkit/branches/release_026/lib/N3/VMCore/N3Initialise.cpp Modified: vmkit/branches/release_026/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/lib/N3/VMCore/N3Initialise.cpp?rev=83639&r1=83638&r2=83639&view=diff ============================================================================== --- vmkit/branches/release_026/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/branches/release_026/lib/N3/VMCore/N3Initialise.cpp Fri Oct 9 08:47:27 2009 @@ -189,6 +189,7 @@ { UTF8 fake(0); UTF8::VT = ((VirtualTable**)(void*)(&fake))[0]; + ((void**)UTF8::VT)[0] = 0; } INIT(VMCond); From nicolas.geoffray at lip6.fr Fri Oct 9 06:48:43 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 13:48:43 -0000 Subject: [vmkit-commits] [vmkit] r83641 - /vmkit/branches/release_026/configure Message-ID: <200910091348.n99Dmho0019356@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 08:48:43 2009 New Revision: 83641 URL: http://llvm.org/viewvc/llvm-project?rev=83641&view=rev Log: Regnerate. Modified: vmkit/branches/release_026/configure Modified: vmkit/branches/release_026/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/configure?rev=83641&r1=83640&r2=83641&view=diff ============================================================================== --- vmkit/branches/release_026/configure (original) +++ vmkit/branches/release_026/configure Fri Oct 9 08:48:43 2009 @@ -1324,7 +1324,6 @@ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-llvmsrc Location of LLVM Source Code --with-llvmobj Location of LLVM Object Code - --with-llvmgcc Compile with llvm-gcc --with-thread=something Thread type ('common' or 'no') --with-finalizer Compile with finalizer (default yes) --with-gc=something GC type ('single-mmap' 'multi-mmap' or 'boehm') @@ -2090,19 +2089,7 @@ - -# Check whether --with-llvmgcc was given. -if test "${with_llvmgcc+set}" = set; then - withval=$with_llvmgcc; withllvm=yes -else - withllvm=no -fi - - -if test "x$withllvm" = "xyes"; then - WITH_LLVM_GCC=1 - LLVM_FLAGS=-DWITH_LLVM_GCC -fi +WITH_LLVM_GCC=0 From nicolas.geoffray at lip6.fr Fri Oct 9 06:48:23 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 13:48:23 -0000 Subject: [vmkit-commits] [vmkit] r83640 - /vmkit/branches/release_026/autoconf/configure.ac Message-ID: <200910091348.n99DmNeC019333@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 08:48:22 2009 New Revision: 83640 URL: http://llvm.org/viewvc/llvm-project?rev=83640&view=rev Log: Do not externalize --with-llvmgcc, it does not work with this revision. Modified: vmkit/branches/release_026/autoconf/configure.ac Modified: vmkit/branches/release_026/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/autoconf/configure.ac?rev=83640&r1=83639&r2=83640&view=diff ============================================================================== --- vmkit/branches/release_026/autoconf/configure.ac (original) +++ vmkit/branches/release_026/autoconf/configure.ac Fri Oct 9 08:48:22 2009 @@ -149,17 +149,7 @@ dnl=== dnl===-----------------------------------------------------------------------=== -AC_ARG_WITH(llvmgcc, - [AS_HELP_STRING(--with-llvmgcc, - [Compile with llvm-gcc])], - [[withllvm=yes]], - [[withllvm=no]], -) - -if test "x$withllvm" = "xyes"; then - WITH_LLVM_GCC=1 - LLVM_FLAGS=-DWITH_LLVM_GCC -fi +WITH_LLVM_GCC=0 AC_SUBST([WITH_LLVM_GCC]) AC_SUBST([LLVM_FLAGS]) From nicolas.geoffray at lip6.fr Fri Oct 9 07:11:49 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 14:11:49 -0000 Subject: [vmkit-commits] [vmkit] r83642 - /vmkit/branches/release_026/tools/vmjc/vmjc.cpp Message-ID: <200910091411.n99EBnvP020060@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 09:11:49 2009 New Revision: 83642 URL: http://llvm.org/viewvc/llvm-project?rev=83642&view=rev Log: Move to LLVM 2.6 API. Modified: vmkit/branches/release_026/tools/vmjc/vmjc.cpp Modified: vmkit/branches/release_026/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/tools/vmjc/vmjc.cpp?rev=83642&r1=83641&r2=83642&view=diff ============================================================================== --- vmkit/branches/release_026/tools/vmjc/vmjc.cpp (original) +++ vmkit/branches/release_026/tools/vmjc/vmjc.cpp Fri Oct 9 09:11:49 2009 @@ -297,9 +297,8 @@ } std::string ErrorInfo; - std::auto_ptr Out - (new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary)); + raw_ostream* Out + (new raw_fd_ostream(OutputFilename.c_str(), true, Force, ErrorInfo)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; return 1; @@ -312,7 +311,7 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); if (!DisableOutput) - if (Force || !CheckBitcodeOutputToConsole(*Out, true)) + if (Force || !CheckBitcodeOutputToConsole(Out, true)) WriteBitcodeToFile(Comp->getLLVMModule(), *Out); return 0; From nicolas.geoffray at lip6.fr Fri Oct 9 07:12:17 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 14:12:17 -0000 Subject: [vmkit-commits] [vmkit] r83643 - /vmkit/branches/release_026/lib/Mvm/Compiler/EscapeAnalysis.cpp Message-ID: <200910091412.n99ECHpa020085@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 09:12:16 2009 New Revision: 83643 URL: http://llvm.org/viewvc/llvm-project?rev=83643&view=rev Log: Add missing include. Modified: vmkit/branches/release_026/lib/Mvm/Compiler/EscapeAnalysis.cpp Modified: vmkit/branches/release_026/lib/Mvm/Compiler/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/lib/Mvm/Compiler/EscapeAnalysis.cpp?rev=83643&r1=83642&r2=83643&view=diff ============================================================================== --- vmkit/branches/release_026/lib/Mvm/Compiler/EscapeAnalysis.cpp (original) +++ vmkit/branches/release_026/lib/Mvm/Compiler/EscapeAnalysis.cpp Fri Oct 9 09:12:16 2009 @@ -18,6 +18,7 @@ #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" #include #include From nicolas.geoffray at lip6.fr Fri Oct 9 07:13:06 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 14:13:06 -0000 Subject: [vmkit-commits] [vmkit] r83644 - /vmkit/branches/release_026/lib/Mvm/Compiler/JIT.cpp Message-ID: <200910091413.n99ED6lh020115@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 09:13:06 2009 New Revision: 83644 URL: http://llvm.org/viewvc/llvm-project?rev=83644&view=rev Log: IRReader does not exist in 2.6. Modified: vmkit/branches/release_026/lib/Mvm/Compiler/JIT.cpp Modified: vmkit/branches/release_026/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/lib/Mvm/Compiler/JIT.cpp?rev=83644&r1=83643&r2=83644&view=diff ============================================================================== --- vmkit/branches/release_026/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/branches/release_026/lib/Mvm/Compiler/JIT.cpp Fri Oct 9 09:13:06 2009 @@ -26,7 +26,6 @@ #include #include "llvm/Support/CommandLine.h" #include -#include #include #include "llvm/Support/SourceMgr.h" #include @@ -62,7 +61,7 @@ void MvmModule::loadBytecodeFile(const std::string& str) { SMDiagnostic Err; - Module* M = ParseIRFile(str, Err, getGlobalContext()); + Module* M = ParseAssemblyFile(str, Err, getGlobalContext()); if (M) { M->setTargetTriple(getHostTriple()); Linker::LinkModules(globalModule, M, 0); From nicolas.geoffray at lip6.fr Fri Oct 9 07:13:51 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 14:13:51 -0000 Subject: [vmkit-commits] [vmkit] r83645 - /vmkit/branches/release_026/lib/JnJVM/Classpath/Makefile Message-ID: <200910091413.n99EDplo020146@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 09:13:51 2009 New Revision: 83645 URL: http://llvm.org/viewvc/llvm-project?rev=83645&view=rev Log: Add EXTRA_DIST files. Modified: vmkit/branches/release_026/lib/JnJVM/Classpath/Makefile Modified: vmkit/branches/release_026/lib/JnJVM/Classpath/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/lib/JnJVM/Classpath/Makefile?rev=83645&r1=83644&r2=83645&view=diff ============================================================================== --- vmkit/branches/release_026/lib/JnJVM/Classpath/Makefile (original) +++ vmkit/branches/release_026/lib/JnJVM/Classpath/Makefile Fri Oct 9 09:13:51 2009 @@ -8,6 +8,12 @@ ##===----------------------------------------------------------------------===## LEVEL = ../../.. + +EXTRA_DIST = ClasspathConstructor.inc ClasspathField.inc Classpath.inc ClasspathMethod.inc \ + ClasspathVMClass.inc ClasspathVMClassLoader.inc ClasspathVMObject.inc \ + ClasspathVMRuntime.inc ClasspathVMStackWalker.inc ClasspathVMSystem.inc \ + ClasspathVMSystemProperties.inc ClasspathVMThread.inc ClasspathVMThrowable.inc + include $(LEVEL)/Makefile.config ifeq ($(WITH_LLVM_GCC), 1) From nicolas.geoffray at lip6.fr Fri Oct 9 07:20:07 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 14:20:07 -0000 Subject: [vmkit-commits] [vmkit] r83646 - /vmkit/branches/release_026/lib/N3/VMCore/Makefile Message-ID: <200910091420.n99EK79N020355@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 09:20:07 2009 New Revision: 83646 URL: http://llvm.org/viewvc/llvm-project?rev=83646&view=rev Log: Add EXTRA_DIST file. Modified: vmkit/branches/release_026/lib/N3/VMCore/Makefile Modified: vmkit/branches/release_026/lib/N3/VMCore/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/lib/N3/VMCore/Makefile?rev=83646&r1=83645&r2=83646&view=diff ============================================================================== --- vmkit/branches/release_026/lib/N3/VMCore/Makefile (original) +++ vmkit/branches/release_026/lib/N3/VMCore/Makefile Fri Oct 9 09:20:07 2009 @@ -8,6 +8,8 @@ ##===----------------------------------------------------------------------===## LEVEL = ../../.. +EXTRA_DIST = MSCorlib.inc + include $(LEVEL)/Makefile.config ifeq ($(WITH_LLVM_GCC), 1) From nicolas.geoffray at lip6.fr Fri Oct 9 09:19:49 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 09 Oct 2009 16:19:49 -0000 Subject: [vmkit-commits] [vmkit] r83647 - /vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Message-ID: <200910091619.n99GJnRO024508@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 9 11:19:49 2009 New Revision: 83647 URL: http://llvm.org/viewvc/llvm-project?rev=83647&view=rev Log: Fix include. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=83647&r1=83646&r2=83647&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Fri Oct 9 11:19:49 2009 @@ -19,7 +19,7 @@ #include "mvm/Threads/Locks.h" #include "JavaAccess.h" -#include "JavaArray.h" +#include "JavaObject.h" #include "JnjvmClassLoader.h" #include "JnjvmConfig.h" From nicolas.geoffray at lip6.fr Sat Oct 10 12:48:14 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Oct 2009 19:48:14 -0000 Subject: [vmkit-commits] [vmkit] r83725 - /vmkit/branches/release_026/include/mvm/GC/GC.h Message-ID: <200910101948.n9AJmEbh029691@zion.cs.uiuc.edu> Author: geoffray Date: Sat Oct 10 14:48:14 2009 New Revision: 83725 URL: http://llvm.org/viewvc/llvm-project?rev=83725&view=rev Log: Remove MacOS warning. Modified: vmkit/branches/release_026/include/mvm/GC/GC.h Modified: vmkit/branches/release_026/include/mvm/GC/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/release_026/include/mvm/GC/GC.h?rev=83725&r1=83724&r2=83725&view=diff ============================================================================== --- vmkit/branches/release_026/include/mvm/GC/GC.h (original) +++ vmkit/branches/release_026/include/mvm/GC/GC.h Sat Oct 10 14:48:14 2009 @@ -99,6 +99,7 @@ class StackScanner { public: virtual void scanStack(mvm::Thread* th) = 0; + virtual ~StackScanner() {} }; class UnpreciseStackScanner : public StackScanner { From nicolas.geoffray at lip6.fr Sat Oct 10 13:04:00 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Oct 2009 20:04:00 -0000 Subject: [vmkit-commits] [vmkit] r83727 - in /vmkit/trunk/mmtk/mmtk-j3: MutatorThread.cpp MutatorThread.h Message-ID: <200910102004.n9AK416g030215@zion.cs.uiuc.edu> Author: geoffray Date: Sat Oct 10 15:04:00 2009 New Revision: 83727 URL: http://llvm.org/viewvc/llvm-project?rev=83727&view=rev Log: Fix compilation. Added: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp Modified: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Added: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp?rev=83727&view=auto ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp (added) +++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp Sat Oct 10 15:04:00 2009 @@ -0,0 +1,20 @@ +//===--------- MutatorThread.cpp - Thread for GC --------------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#include "MutatorThread.h" +#include "mvm/Threads/Thread.h" + +using namespace mvm; + +extern "C" void* MMTkMutatorAllocate(uint32_t size, VirtualTable* VT) { + void* val = MutatorThread::get()->Allocator.Allocate(size, "MMTk"); + ((void**)val)[0] = VT; + return val; +} Modified: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h?rev=83727&r1=83726&r2=83727&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h (original) +++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Sat Oct 10 15:04:00 2009 @@ -16,6 +16,12 @@ namespace mvm { +extern "C" size_t MMTkMutatorSize; +extern "C" size_t MMTkCollectorSize; + +extern "C" void JnJVM_org_j3_config_Selected_00024Mutator__0003Cinit_0003E__(uintptr_t); +extern "C" void JnJVM_org_j3_config_Selected_00024Collector__0003Cinit_0003E__(uintptr_t); + class MutatorThread : public mvm::Thread { public: @@ -23,17 +29,15 @@ uintptr_t MutatorContext; uintptr_t CollectorContext; - static size_t MutatorSize; - static size_t CollectorSize; - - static void (*CollectorInit)(uintptr_t); - static void (*MutatorInit)(uintptr_t); - MutatorThread() { - MutatorContext = Allocator.Allocate(MutatorSize); - MutatorInit(MutatorContext); - CollectorContext = Allocator.Allocate(CollectorSize); - CollectorInit(CollectorContext); + MutatorContext = (uintptr_t)Allocator.Allocate(MMTkMutatorSize, "Mutator"); + JnJVM_org_j3_config_Selected_00024Mutator__0003Cinit_0003E__(MutatorContext); + CollectorContext = (uintptr_t)Allocator.Allocate(MMTkCollectorSize, "Collector"); + JnJVM_org_j3_config_Selected_00024Collector__0003Cinit_0003E__(CollectorContext); + } + + static MutatorThread* get() { + return (MutatorThread*)mvm::Thread::get(); } }; From nicolas.geoffray at lip6.fr Sat Oct 10 13:18:03 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Oct 2009 20:18:03 -0000 Subject: [vmkit-commits] [vmkit] r83730 - in /vmkit/trunk/lib: JnJVM/Classpath/Makefile N3/VMCore/Makefile Message-ID: <200910102018.n9AKI3ph030787@zion.cs.uiuc.edu> Author: geoffray Date: Sat Oct 10 15:18:02 2009 New Revision: 83730 URL: http://llvm.org/viewvc/llvm-project?rev=83730&view=rev Log: Update Makefile for EXTRA_DIST. Modified: vmkit/trunk/lib/JnJVM/Classpath/Makefile vmkit/trunk/lib/N3/VMCore/Makefile Modified: vmkit/trunk/lib/JnJVM/Classpath/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/Makefile?rev=83730&r1=83729&r2=83730&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/Makefile (original) +++ vmkit/trunk/lib/JnJVM/Classpath/Makefile Sat Oct 10 15:18:02 2009 @@ -8,6 +8,12 @@ ##===----------------------------------------------------------------------===## LEVEL = ../../.. + +EXTRA_DIST = ClasspathConstructor.inc ClasspathField.inc Classpath.inc ClasspathMethod.inc \ + ClasspathVMClass.inc ClasspathVMClassLoader.inc ClasspathVMObject.inc \ + ClasspathVMRuntime.inc ClasspathVMStackWalker.inc ClasspathVMSystem.inc \ + ClasspathVMSystemProperties.inc ClasspathVMThread.inc ClasspathVMThrowable.inc + include $(LEVEL)/Makefile.config ifeq ($(WITH_LLVM_GCC), 1) Modified: vmkit/trunk/lib/N3/VMCore/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Makefile?rev=83730&r1=83729&r2=83730&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Makefile (original) +++ vmkit/trunk/lib/N3/VMCore/Makefile Sat Oct 10 15:18:02 2009 @@ -8,6 +8,8 @@ ##===----------------------------------------------------------------------===## LEVEL = ../../.. +EXTRA_DIST = MSCorlib.inc + include $(LEVEL)/Makefile.config ifeq ($(WITH_LLVM_GCC), 1) From nicolas.geoffray at lip6.fr Sat Oct 10 13:24:36 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sat, 10 Oct 2009 20:24:36 -0000 Subject: [vmkit-commits] [vmkit] r83731 - /vmkit/trunk/include/mvm/GC/GC.h Message-ID: <200910102024.n9AKOaDl031129@zion.cs.uiuc.edu> Author: geoffray Date: Sat Oct 10 15:24:36 2009 New Revision: 83731 URL: http://llvm.org/viewvc/llvm-project?rev=83731&view=rev Log: Fix compilation warning on MacOSX Modified: vmkit/trunk/include/mvm/GC/GC.h Modified: vmkit/trunk/include/mvm/GC/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/GC/GC.h?rev=83731&r1=83730&r2=83731&view=diff ============================================================================== --- vmkit/trunk/include/mvm/GC/GC.h (original) +++ vmkit/trunk/include/mvm/GC/GC.h Sat Oct 10 15:24:36 2009 @@ -99,6 +99,7 @@ class StackScanner { public: virtual void scanStack(mvm::Thread* th) = 0; + virtual ~StackScanner() {} }; class UnpreciseStackScanner : public StackScanner { From gael.thomas at lip6.fr Thu Oct 1 10:19:25 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Thu, 01 Oct 2009 17:19:25 -0000 Subject: [vmkit-commits] [vmkit] r83202 - in /vmkit/trunk: ./ autoconf/configure.ac configure include/mvm/Config/config.h.in lib/Mvm/GCMmap2/MvmGC.h lib/N3/VMCore/N3Initialise.cpp tools/n3-pnetlib/Makefile tools/vmkit/Launcher.cpp Message-ID: <200910011719.n91HJQgU020083@zion.cs.uiuc.edu> Author: gthomas Date: Thu Oct 1 12:19:23 2009 New Revision: 83202 URL: http://llvm.org/viewvc/llvm-project?rev=83202&view=rev Log: Fix a cast in Launcher.cpp. Add a new option to disable finalization. Required for the moment to boot n3 on recent Linux. Will be removed latter. Can now compile n3 with llvm. Modified: vmkit/trunk/ (props changed) vmkit/trunk/autoconf/configure.ac vmkit/trunk/configure vmkit/trunk/include/mvm/Config/config.h.in vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/tools/n3-pnetlib/Makefile vmkit/trunk/tools/vmkit/Launcher.cpp Propchange: vmkit/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Thu Oct 1 12:19:23 2009 @@ -1,2 +1,39 @@ -Debug -Release +Makefile.config +do-conf +config.log +config.status +svn-ignore +Makefile.common +do-make +include/mvm/Config/config.h +tools/vmjc/vmkitoptimized.bc +tools/vmjc/vmkit.s +tools/vmjc/vmkit.bc +tools/jnjvm/vmkitoptimized.bc +tools/jnjvm/jnjvm.s +tools/jnjvm/jnjvm.bc +tools/llcj/LinkPaths.h +tools/vmkit/vmkitoptimized.bc +tools/vmkit/vmkit.s +tools/vmkit/vmkit.bc +tools/n3-pnetlib/Release +tools/n3-pnetlib/vmkitoptimized.bc +tools/n3-pnetlib/vmkit.s +tools/n3-pnetlib/vmkit.bc +lib/Mvm/Runtime/LLVMAssembly.gen.ll +lib/Mvm/Runtime/LLVMAssembly.s +lib/Mvm/StaticGCPass/Release +lib/Mvm/Compiler/LLVMRuntime.inc +lib/Mvm/Compiler/LLVMRuntime.gen.ll +lib/N3/Mono/MonoPath.inc +lib/N3/VMCore/Release +lib/N3/PNetLib/Release +lib/N3/PNetLib/PNetPath.inc +lib/N3/LLVMRuntime/LLVMRuntime.inc +lib/N3/LLVMRuntime/LLVMRuntime.gen.ll +lib/JnJVM/Classpath/Classpath.h +lib/JnJVM/LLVMRuntime/LLVMRuntime.inc +lib/JnJVM/LLVMRuntime/LLVMRuntime.gen.ll +autoconf/autom4te.cache +autoconf/aclocal.m4 +autoconf/configure.bak Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=83202&r1=83201&r2=83202&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Thu Oct 1 12:19:23 2009 @@ -40,7 +40,7 @@ dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we dnl use some autoconf macros only available in 2.59. -AC_PREREQ(2.59) +AC_PREREQ(2.63) dnl Verify that the source directory is valid. This makes sure that we are dnl configuring VMKit and not some other package (it validates --srcdir argument) @@ -182,6 +182,17 @@ AC_DEFINE([HAVE_PTHREAD], [1], [Using pthread library]) fi +AC_ARG_WITH(finalizer, + [AS_HELP_STRING(--with-finalizer, + [Compile with finalizer (default yes)])], + [[withfinalizer=$withfinalizer]], + [[withfinalizer=yes]], +) + +if test ! "x$withfinalizer" = "xyes"; then + AC_DEFINE(WITHOUT_FINALIZER, [1], [Not using finalizer]) +fi + dnl ************************************************************************** dnl Architecture dnl ************************************************************************** @@ -526,7 +537,18 @@ AC_TYPE_PID_T AC_TYPE_SIZE_T -AC_TYPE_SIGNAL +AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void. +Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl +AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([#include +#include +], + [return *(signal (0, 0)) (0) == 1;])], + [ac_cv_type_signal=int], + [ac_cv_type_signal=void])]) +AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers + (`int' or `void').]) + AC_STRUCT_TM AC_CHECK_TYPES([int64_t],,AC_MSG_ERROR([Type int64_t required but not found])) AC_CHECK_TYPES([uint64_t],, Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=83202&r1=83201&r2=83202&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Thu Oct 1 12:19:23 2009 @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for vmkit 0.26svn. +# Generated by GNU Autoconf 2.63 for vmkit 0.26svn. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # @@ -19,7 +19,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -41,17 +41,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -67,8 +95,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -91,7 +117,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -104,17 +130,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -136,7 +155,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -162,7 +181,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -244,7 +263,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -265,7 +284,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -345,10 +364,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -417,9 +436,10 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf at gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf at gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -455,7 +475,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -483,7 +503,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -496,19 +515,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -533,10 +555,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -618,122 +640,139 @@ #endif" ac_unique_file=""Makefile.common.in"" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -VMKIT_COPYRIGHT -LLVM_SRC -LLVM_OBJ -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -DYLIB_EXTENSION -WITH_LLVM_GCC -LLVM_FLAGS -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -GREP -EGREP -WITH_64 -GC_MMAP2 -GC_BOEHM -GC_MULTI_MMAP -GC_SINGLE_MMAP -GC_FLAGS -GC_LIBS -SINGLE_BUILD -SERVICE_BUILD -ISOLATE_BUILD -VM_FLAGS -EXCEPTION_FLAGS -classpathglibj -classpathlibs -classpathinclude -classpathversion -WITH_JNJVM -pnetlocalprefix -WITH_N3_PNETLIB -N3_LIB -pnetlibpath -WITH_N3_MONO -monopath -WITH_N3 -CXX -CXXFLAGS -ac_ct_CXX -NM -LN_S -CMP -CP -DATE -FIND -MKDIR -MV -RANLIB -RM -SED -TAR -BINPWD -CAT -LLVMAS -LLC -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -LLVMGCC -LLVMGXX +ac_subst_vars='LTLIBOBJS LIBOBJS -LTLIBOBJS' +LLVMGXX +LLVMGCC +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +LLC +LLVMAS +CAT +BINPWD +TAR +SED +RM +RANLIB +MV +MKDIR +FIND +DATE +CP +CMP +LN_S +NM +ac_ct_CXX +CXXFLAGS +CXX +WITH_N3 +monopath +WITH_N3_MONO +pnetlibpath +N3_LIB +WITH_N3_PNETLIB +pnetlocalprefix +WITH_JNJVM +classpathversion +classpathinclude +classpathlibs +classpathglibj +EXCEPTION_FLAGS +VM_FLAGS +ISOLATE_BUILD +SERVICE_BUILD +SINGLE_BUILD +GC_LIBS +GC_FLAGS +GC_SINGLE_MMAP +GC_MULTI_MMAP +GC_BOEHM +GC_MMAP2 +WITH_64 +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +LLVM_FLAGS +WITH_LLVM_GCC +DYLIB_EXTENSION +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LLVM_OBJ +LLVM_SRC +VMKIT_COPYRIGHT +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_llvmsrc +with_llvmobj +with_llvmgcc +with_thread +with_finalizer +with_gc +with_vm_type +with_exception_type +with_gnu_classpath_libs +with_gnu_classpath_glibj +with_jnjvm +with_pnet_local_prefix +with_pnetlib +with_mono +' ac_precious_vars='build_alias host_alias target_alias @@ -751,6 +790,8 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -849,13 +890,21 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -868,13 +917,21 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1065,22 +1122,38 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1100,7 +1173,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1109,16 +1182,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1127,22 +1200,38 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1157,7 +1246,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1173,10 +1262,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1184,12 +1273,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1216,12 +1305,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1270,9 +1359,9 @@ Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1282,25 +1371,25 @@ For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/vmkit] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/vmkit] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1325,6 +1414,7 @@ --with-llvmobj Location of LLVM Object Code --with-llvmgcc Compile with llvm-gcc --with-thread=something Thread type ('common' or 'no') + --with-finalizer Compile with finalizer (default yes) --with-gc=something GC type ('single-mmap' 'multi-mmap' or 'boehm') --with-vm-type=something VM type ('single' 'isolate' 'isolate-sharing' or @@ -1368,15 +1458,17 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1412,7 +1504,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1422,10 +1514,10 @@ if $ac_init_version; then cat <<\_ACEOF vmkit configure 0.26svn -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -1438,7 +1530,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by vmkit $as_me 0.26svn, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1474,7 +1566,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1509,7 +1601,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1561,11 +1653,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1595,9 +1688,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1612,9 +1705,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1630,8 +1723,8 @@ echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1673,21 +1766,24 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +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 - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$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 . "$ac_site_file" fi @@ -1697,16 +1793,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1720,29 +1816,38 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1752,10 +1857,12 @@ fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1802,8 +1909,8 @@ if test ${srcdir} != "." ; then if test -f ${srcdir}/include/mvm/Config/config.h ; then - { { echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5 -echo "$as_me: error: Already configured in ${srcdir}" >&2;} + { { $as_echo "$as_me:$LINENO: error: Already configured in ${srcdir}" >&5 +$as_echo "$as_me: error: Already configured in ${srcdir}" >&2;} { (exit 1); exit 1; }; } fi fi @@ -1825,8 +1932,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in $LLVM_SRC_ROOT/autoconf \"$srcdir\"/$LLVM_SRC_ROOT/autoconf" >&2;} { (exit 1); exit 1; }; } fi @@ -1868,34 +1975,34 @@ # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -1912,27 +2019,27 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -1949,27 +2056,27 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target @@ -1993,27 +2100,27 @@ NONENONEs,x,x, && program_prefix=${target_alias}- -{ echo "$as_me:$LINENO: checking type of operating system we're going to host on" >&5 -echo $ECHO_N "checking type of operating system we're going to host on... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking type of operating system we're going to host on" >&5 +$as_echo_n "checking type of operating system we're going to host on... " >&6; } if test "${vmkit_cv_os_type+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $host in *-*-aix*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="AIX" vmkit_cv_platform_type="Unix" ;; *-*-irix*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="IRIX" vmkit_cv_platform_type="Unix" ;; *-*-cygwin*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Cygwin" vmkit_cv_platform_type="Unix" ;; @@ -2022,32 +2129,32 @@ vmkit_cv_os_type="Darwin" vmkit_cv_platform_type="Unix" ;; *-*-freebsd*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="FreeBSD" vmkit_cv_platform_type="Unix" ;; *-*-openbsd*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="OpenBSD" vmkit_cv_platform_type="Unix" ;; *-*-netbsd*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="NetBSD" vmkit_cv_platform_type="Unix" ;; *-*-hpux*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="HP-UX" vmkit_cv_platform_type="Unix" ;; *-*-interix*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Interix" vmkit_cv_platform_type="Unix" ;; @@ -2056,33 +2163,33 @@ vmkit_cv_os_type="Linux" vmkit_cv_platform_type="Unix" ;; *-*-solaris*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="SunOS" vmkit_cv_platform_type="Unix" ;; *-*-win32*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Win32" vmkit_cv_platform_type="Win32" ;; *-*-mingw*) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="MingW" vmkit_cv_platform_type="Win32" ;; *) - { { echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 -echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Good luck porting vmkit to your host!" >&5 +$as_echo "$as_me: error: Good luck porting vmkit to your host!" >&2;} { (exit 1); exit 1; }; } vmkit_cv_os_type="Unknown" vmkit_cv_platform_type="Unknown" ;; esac fi -{ echo "$as_me:$LINENO: result: $vmkit_cv_os_type" >&5 -echo "${ECHO_T}$vmkit_cv_os_type" >&6; } +{ $as_echo "$as_me:$LINENO: result: $vmkit_cv_os_type" >&5 +$as_echo "$vmkit_cv_os_type" >&6; } @@ -2123,10 +2230,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2139,7 +2246,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2150,11 +2257,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2163,10 +2270,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2179,7 +2286,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2190,11 +2297,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2202,12 +2309,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2220,10 +2323,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2236,7 +2339,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2247,11 +2350,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2260,10 +2363,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2281,7 +2384,7 @@ continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2304,11 +2407,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2319,10 +2422,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2335,7 +2438,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2346,11 +2449,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2363,10 +2466,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2379,7 +2482,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2390,11 +2493,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2406,12 +2509,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2421,44 +2520,50 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2477,27 +2582,22 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.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. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2508,10 +2608,11 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2522,7 +2623,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2549,25 +2650,27 @@ ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi 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. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2576,49 +2679,53 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.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. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2627,31 +2734,33 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$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 - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2674,40 +2783,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2733,20 +2845,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -2756,15 +2869,19 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -2791,20 +2908,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -2829,20 +2947,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -2868,20 +2987,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2896,8 +3016,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2913,10 +3033,10 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -2987,20 +3107,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3016,15 +3137,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3040,15 +3161,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3080,20 +3201,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3117,13 +3239,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3131,7 +3254,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3156,8 +3279,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3185,20 +3308,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3222,13 +3346,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3236,7 +3361,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3252,11 +3377,13 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3266,42 +3393,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3316,74 +3438,60 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3398,40 +3506,31 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_EGREP=$EGREP fi - fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3458,20 +3557,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -3563,37 +3663,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3615,11 +3718,11 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3637,20 +3740,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -3658,12 +3762,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -3673,17 +3780,17 @@ if test "x$thread" != "xno"; then if test "${ac_cv_header_pthread_h+set}" = set; then - { echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 +$as_echo_n "checking for pthread.h... " >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +$as_echo "$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 -echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking pthread.h usability" >&5 +$as_echo_n "checking pthread.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3699,32 +3806,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 -echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking pthread.h presence" >&5 +$as_echo_n "checking pthread.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3738,51 +3846,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------------- ## ## Report this to nicolas.geoffray at lip6.fr ## @@ -3791,30 +3900,30 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread.h" >&5 +$as_echo_n "checking for pthread.h... " >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +$as_echo "$ac_cv_header_pthread_h" >&6; } fi -if test $ac_cv_header_pthread_h = yes; then +if test "x$ac_cv_header_pthread_h" = x""yes; then : else - { echo "$as_me:$LINENO: WARNING: phtread include NOT found" >&5 -echo "$as_me: WARNING: phtread include NOT found" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: phtread include NOT found" >&5 +$as_echo "$as_me: WARNING: phtread include NOT found" >&2;} fi -{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -3846,33 +3955,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } -if test $ac_cv_lib_pthread_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -3880,8 +3993,8 @@ LIBS="-lpthread $LIBS" else - { { echo "$as_me:$LINENO: error: pthread library not found" >&5 -echo "$as_me: error: pthread library not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: pthread library not found" >&5 +$as_echo "$as_me: error: pthread library not found" >&2;} { (exit 1); exit 1; }; } fi @@ -3899,6 +4012,23 @@ fi +# Check whether --with-finalizer was given. +if test "${with_finalizer+set}" = set; then + withval=$with_finalizer; withfinalizer=$withfinalizer +else + withfinalizer=yes +fi + + +if test ! "x$withfinalizer" = "xyes"; then + +cat >>confdefs.h <<\_ACEOF +#define WITHOUT_FINALIZER 1 +_ACEOF + +fi + + case $target_cpu in powerpc) @@ -4156,15 +4286,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -4196,20 +4326,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -4233,13 +4364,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -4247,7 +4379,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -4272,8 +4404,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -4301,20 +4433,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -4338,13 +4471,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -4352,7 +4486,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -4368,11 +4502,13 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -4391,10 +4527,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -4407,7 +4543,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4418,11 +4554,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4435,10 +4571,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -4451,7 +4587,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4462,11 +4598,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4478,12 +4614,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -4491,50 +4623,56 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4560,20 +4698,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -4583,15 +4722,19 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -4618,20 +4761,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -4656,20 +4800,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -4695,20 +4840,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4723,8 +4869,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -4740,10 +4886,10 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -4814,20 +4960,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4843,15 +4990,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -4875,10 +5022,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -4891,7 +5038,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4902,11 +5049,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4919,10 +5066,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -4935,7 +5082,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4946,11 +5093,11 @@ fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4962,12 +5109,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -4977,43 +5120,47 @@ fi fi # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5039,20 +5186,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -5062,15 +5210,19 @@ ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } -GXX=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes @@ -5097,20 +5249,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" @@ -5135,20 +5288,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag @@ -5174,20 +5328,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -5202,8 +5357,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then @@ -5226,10 +5381,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +$as_echo_n "checking for BSD-compatible nm... " >&6; } if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. @@ -5275,29 +5430,29 @@ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } +{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" -{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } + { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi # Extract the first word of "cmp", so it can be a program name with args. set dummy cmp; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CMP in [\\/]* | ?:[\\/]*) @@ -5312,7 +5467,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5325,20 +5480,20 @@ fi CMP=$ac_cv_path_CMP if test -n "$CMP"; then - { echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6; } + { $as_echo "$as_me:$LINENO: result: $CMP" >&5 +$as_echo "$CMP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CP in [\\/]* | ?:[\\/]*) @@ -5353,7 +5508,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5366,20 +5521,20 @@ fi CP=$ac_cv_path_CP if test -n "$CP"; then - { echo "$as_me:$LINENO: result: $CP" >&5 -echo "${ECHO_T}$CP" >&6; } + { $as_echo "$as_me:$LINENO: result: $CP" >&5 +$as_echo "$CP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "date", so it can be a program name with args. set dummy date; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_DATE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $DATE in [\\/]* | ?:[\\/]*) @@ -5394,7 +5549,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5407,20 +5562,20 @@ fi DATE=$ac_cv_path_DATE if test -n "$DATE"; then - { echo "$as_me:$LINENO: result: $DATE" >&5 -echo "${ECHO_T}$DATE" >&6; } + { $as_echo "$as_me:$LINENO: result: $DATE" >&5 +$as_echo "$DATE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "find", so it can be a program name with args. set dummy find; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_FIND+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $FIND in [\\/]* | ?:[\\/]*) @@ -5435,7 +5590,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5448,20 +5603,20 @@ fi FIND=$ac_cv_path_FIND if test -n "$FIND"; then - { echo "$as_me:$LINENO: result: $FIND" >&5 -echo "${ECHO_T}$FIND" >&6; } + { $as_echo "$as_me:$LINENO: result: $FIND" >&5 +$as_echo "$FIND" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "grep", so it can be a program name with args. set dummy grep; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GREP in [\\/]* | ?:[\\/]*) @@ -5476,7 +5631,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5489,20 +5644,20 @@ fi GREP=$ac_cv_path_GREP if test -n "$GREP"; then - { echo "$as_me:$LINENO: result: $GREP" >&5 -echo "${ECHO_T}$GREP" >&6; } + { $as_echo "$as_me:$LINENO: result: $GREP" >&5 +$as_echo "$GREP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MKDIR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MKDIR in [\\/]* | ?:[\\/]*) @@ -5517,7 +5672,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5530,20 +5685,20 @@ fi MKDIR=$ac_cv_path_MKDIR if test -n "$MKDIR"; then - { echo "$as_me:$LINENO: result: $MKDIR" >&5 -echo "${ECHO_T}$MKDIR" >&6; } + { $as_echo "$as_me:$LINENO: result: $MKDIR" >&5 +$as_echo "$MKDIR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MV+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MV in [\\/]* | ?:[\\/]*) @@ -5558,7 +5713,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5571,21 +5726,21 @@ fi MV=$ac_cv_path_MV if test -n "$MV"; then - { echo "$as_me:$LINENO: result: $MV" >&5 -echo "${ECHO_T}$MV" >&6; } + { $as_echo "$as_me:$LINENO: result: $MV" >&5 +$as_echo "$MV" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -5598,7 +5753,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5609,11 +5764,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5622,10 +5777,10 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -5638,7 +5793,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5649,11 +5804,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -5661,12 +5816,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -5677,10 +5828,10 @@ # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_RM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $RM in [\\/]* | ?:[\\/]*) @@ -5695,7 +5846,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5708,20 +5859,20 @@ fi RM=$ac_cv_path_RM if test -n "$RM"; then - { echo "$as_me:$LINENO: result: $RM" >&5 -echo "${ECHO_T}$RM" >&6; } + { $as_echo "$as_me:$LINENO: result: $RM" >&5 +$as_echo "$RM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SED in [\\/]* | ?:[\\/]*) @@ -5736,7 +5887,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5749,20 +5900,20 @@ fi SED=$ac_cv_path_SED if test -n "$SED"; then - { echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } + { $as_echo "$as_me:$LINENO: result: $SED" >&5 +$as_echo "$SED" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_TAR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $TAR in [\\/]* | ?:[\\/]*) @@ -5777,7 +5928,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5790,20 +5941,20 @@ fi TAR=$ac_cv_path_TAR if test -n "$TAR"; then - { echo "$as_me:$LINENO: result: $TAR" >&5 -echo "${ECHO_T}$TAR" >&6; } + { $as_echo "$as_me:$LINENO: result: $TAR" >&5 +$as_echo "$TAR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "pwd", so it can be a program name with args. set dummy pwd; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_BINPWD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $BINPWD in [\\/]* | ?:[\\/]*) @@ -5818,7 +5969,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_BINPWD="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5831,20 +5982,20 @@ fi BINPWD=$ac_cv_path_BINPWD if test -n "$BINPWD"; then - { echo "$as_me:$LINENO: result: $BINPWD" >&5 -echo "${ECHO_T}$BINPWD" >&6; } + { $as_echo "$as_me:$LINENO: result: $BINPWD" >&5 +$as_echo "$BINPWD" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "cat", so it can be a program name with args. set dummy cat; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CAT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CAT in [\\/]* | ?:[\\/]*) @@ -5859,7 +6010,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5872,21 +6023,21 @@ fi CAT=$ac_cv_path_CAT if test -n "$CAT"; then - { echo "$as_me:$LINENO: result: $CAT" >&5 -echo "${ECHO_T}$CAT" >&6; } + { $as_echo "$as_me:$LINENO: result: $CAT" >&5 +$as_echo "$CAT" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "llvm-as", so it can be a program name with args. set dummy llvm-as; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_LLVMAS+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $LLVMAS in [\\/]* | ?:[\\/]*) @@ -5901,7 +6052,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLVMAS="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5914,20 +6065,20 @@ fi LLVMAS=$ac_cv_path_LLVMAS if test -n "$LLVMAS"; then - { echo "$as_me:$LINENO: result: $LLVMAS" >&5 -echo "${ECHO_T}$LLVMAS" >&6; } + { $as_echo "$as_me:$LINENO: result: $LLVMAS" >&5 +$as_echo "$LLVMAS" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "llc", so it can be a program name with args. set dummy llc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_LLC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $LLC in [\\/]* | ?:[\\/]*) @@ -5942,7 +6093,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5955,11 +6106,11 @@ fi LLC=$ac_cv_path_LLC if test -n "$LLC"; then - { echo "$as_me:$LINENO: result: $LLC" >&5 -echo "${ECHO_T}$LLC" >&6; } + { $as_echo "$as_me:$LINENO: result: $LLC" >&5 +$as_echo "$LLC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5977,11 +6128,12 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6010,17 +6162,29 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -6033,8 +6197,8 @@ INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -6050,10 +6214,10 @@ LLVMGXX="llvm-g++${EXEEXT}" # Extract the first word of "$LLVMGCC", so it can be a program name with args. set dummy $LLVMGCC; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_LLVMGCC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $LLVMGCC in [\\/]* | ?:[\\/]*) @@ -6068,7 +6232,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLVMGCC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6080,20 +6244,20 @@ fi LLVMGCC=$ac_cv_path_LLVMGCC if test -n "$LLVMGCC"; then - { echo "$as_me:$LINENO: result: $LLVMGCC" >&5 -echo "${ECHO_T}$LLVMGCC" >&6; } + { $as_echo "$as_me:$LINENO: result: $LLVMGCC" >&5 +$as_echo "$LLVMGCC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "$LLVMGXX", so it can be a program name with args. set dummy $LLVMGXX; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_LLVMGXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $LLVMGXX in [\\/]* | ?:[\\/]*) @@ -6108,7 +6272,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_LLVMGXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6120,11 +6284,11 @@ fi LLVMGXX=$ac_cv_path_LLVMGXX if test -n "$LLVMGXX"; then - { echo "$as_me:$LINENO: result: $LLVMGXX" >&5 -echo "${ECHO_T}$LLVMGXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $LLVMGXX" >&5 +$as_echo "$LLVMGXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6141,8 +6305,8 @@ fi -{ echo "$as_me:$LINENO: checking tool compatibility" >&5 -echo $ECHO_N "checking tool compatibility... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking tool compatibility" >&5 +$as_echo_n "checking tool compatibility... " >&6; } ICC=no IXX=no @@ -6157,15 +6321,15 @@ if test "$GCC" != "yes" && test "$ICC" != "yes" then - { { echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5 -echo "$as_me: error: gcc|icc required but not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: gcc|icc required but not found" >&5 +$as_echo "$as_me: error: gcc|icc required but not found" >&2;} { (exit 1); exit 1; }; } fi if test "$GXX" != "yes" && test "$IXX" != "yes" then - { { echo "$as_me:$LINENO: error: g++|icc required but not found" >&5 -echo "$as_me: error: g++|icc required but not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: g++|icc required but not found" >&5 +$as_echo "$as_me: error: g++|icc required but not found" >&2;} { (exit 1); exit 1; }; } fi @@ -6183,40 +6347,41 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { { echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 -echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} + { { $as_echo "$as_me:$LINENO: error: gcc 3.x required, but you have a lower version" >&5 +$as_echo "$as_me: error: gcc 3.x required, but you have a lower version" >&2;} { (exit 1); exit 1; }; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } +{ $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } -{ echo "$as_me:$LINENO: checking for inflate in -lz" >&5 -echo $ECHO_N "checking for inflate in -lz... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inflate in -lz" >&5 +$as_echo_n "checking for inflate in -lz... " >&6; } if test "${ac_cv_lib_z_inflate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -6248,33 +6413,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_z_inflate=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflate=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5 -echo "${ECHO_T}$ac_cv_lib_z_inflate" >&6; } -if test $ac_cv_lib_z_inflate = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflate" >&5 +$as_echo "$ac_cv_lib_z_inflate" >&6; } +if test "x$ac_cv_lib_z_inflate" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF @@ -6283,8 +6452,8 @@ else \ - { { echo "$as_me:$LINENO: error: You need to install the zlib package (z)." >&5 -echo "$as_me: error: You need to install the zlib package (z)." >&2;} + { { $as_echo "$as_me:$LINENO: error: You need to install the zlib package (z)." >&5 +$as_echo "$as_me: error: You need to install the zlib package (z)." >&2;} { (exit 1); exit 1; }; } fi @@ -6292,10 +6461,10 @@ if test "x$gc" = "xboehm"; then -{ echo "$as_me:$LINENO: checking for GC_malloc in -lgc" >&5 -echo $ECHO_N "checking for GC_malloc in -lgc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for GC_malloc in -lgc" >&5 +$as_echo_n "checking for GC_malloc in -lgc... " >&6; } if test "${ac_cv_lib_gc_GC_malloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgc $LIBS" @@ -6327,33 +6496,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_gc_GC_malloc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gc_GC_malloc=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_malloc" >&5 -echo "${ECHO_T}$ac_cv_lib_gc_GC_malloc" >&6; } -if test $ac_cv_lib_gc_GC_malloc = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_malloc" >&5 +$as_echo "$ac_cv_lib_gc_GC_malloc" >&6; } +if test "x$ac_cv_lib_gc_GC_malloc" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGC 1 _ACEOF @@ -6362,8 +6535,8 @@ else \ - { { echo "$as_me:$LINENO: error: You need to install the boehm-gc package (gc)." >&5 -echo "$as_me: error: You need to install the boehm-gc package (gc)." >&2;} + { { $as_echo "$as_me:$LINENO: error: You need to install the boehm-gc package (gc)." >&5 +$as_echo "$as_me: error: You need to install the boehm-gc package (gc)." >&2;} { (exit 1); exit 1; }; } fi @@ -6372,17 +6545,17 @@ if test "${ac_cv_header_zlib_h+set}" = set; then - { echo "$as_me:$LINENO: checking for zlib.h" >&5 -echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 +$as_echo_n "checking for zlib.h... " >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +$as_echo "$ac_cv_header_zlib_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking zlib.h usability" >&5 -echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5 +$as_echo_n "checking zlib.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6398,32 +6571,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking zlib.h presence" >&5 -echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5 +$as_echo_n "checking zlib.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6437,51 +6611,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------------- ## ## Report this to nicolas.geoffray at lip6.fr ## @@ -6490,23 +6665,23 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for zlib.h" >&5 -echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 +$as_echo_n "checking for zlib.h... " >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +$as_echo "$ac_cv_header_zlib_h" >&6; } fi -if test $ac_cv_header_zlib_h = yes; then +if test "x$ac_cv_header_zlib_h" = x""yes; then : else \ - { { echo "$as_me:$LINENO: error: You need to install the zlib devel package (zlib.h)." >&5 -echo "$as_me: error: You need to install the zlib devel package (zlib.h)." >&2;} + { { $as_echo "$as_me:$LINENO: error: You need to install the zlib devel package (zlib.h)." >&5 +$as_echo "$as_me: error: You need to install the zlib devel package (zlib.h)." >&2;} { (exit 1); exit 1; }; } fi @@ -6515,17 +6690,17 @@ if test "x$gc" = "xboehm"; then if test "${ac_cv_header_gc_gc_h+set}" = set; then - { echo "$as_me:$LINENO: checking for gc/gc.h" >&5 -echo $ECHO_N "checking for gc/gc.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for gc/gc.h" >&5 +$as_echo_n "checking for gc/gc.h... " >&6; } if test "${ac_cv_header_gc_gc_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 -echo "${ECHO_T}$ac_cv_header_gc_gc_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 +$as_echo "$ac_cv_header_gc_gc_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking gc/gc.h usability" >&5 -echo $ECHO_N "checking gc/gc.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking gc/gc.h usability" >&5 +$as_echo_n "checking gc/gc.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6541,32 +6716,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking gc/gc.h presence" >&5 -echo $ECHO_N "checking gc/gc.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking gc/gc.h presence" >&5 +$as_echo_n "checking gc/gc.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6580,51 +6756,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: gc/gc.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: gc/gc.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: gc/gc.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: gc/gc.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: gc/gc.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: gc/gc.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: gc/gc.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: gc/gc.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## --------------------------------------- ## ## Report this to nicolas.geoffray at lip6.fr ## @@ -6633,23 +6810,23 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for gc/gc.h" >&5 -echo $ECHO_N "checking for gc/gc.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gc/gc.h" >&5 +$as_echo_n "checking for gc/gc.h... " >&6; } if test "${ac_cv_header_gc_gc_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_gc_gc_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 -echo "${ECHO_T}$ac_cv_header_gc_gc_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_gc_gc_h" >&5 +$as_echo "$ac_cv_header_gc_gc_h" >&6; } fi -if test $ac_cv_header_gc_gc_h = yes; then +if test "x$ac_cv_header_gc_gc_h" = x""yes; then : else \ - { { echo "$as_me:$LINENO: error: You need to install the boehm-gc devel package (gc/gc.h)." >&5 -echo "$as_me: error: You need to install the boehm-gc devel package (gc/gc.h)." >&2;} + { { $as_echo "$as_me:$LINENO: error: You need to install the boehm-gc devel package (gc/gc.h)." >&5 +$as_echo "$as_me: error: You need to install the boehm-gc devel package (gc/gc.h)." >&2;} { (exit 1); exit 1; }; } fi @@ -6660,26 +6837,58 @@ nl===-----------------------------------------------------------------------=== -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef pid_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pid_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; ; return 0; } @@ -6690,30 +6899,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=no + ac_cv_type_pid_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then : else @@ -6723,26 +6941,58 @@ fi -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (size_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -6753,30 +7003,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then : else @@ -6786,10 +7045,10 @@ fi -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6814,20 +7073,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void @@ -6835,18 +7095,18 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6862,7 +7122,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -6873,20 +7133,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -6894,8 +7155,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -6904,26 +7165,58 @@ fi -{ echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for int64_t" >&5 +$as_echo_n "checking for int64_t... " >&6; } if test "${ac_cv_type_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_int64_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int64_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (int64_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((int64_t))) + return 0; ; return 0; } @@ -6934,30 +7227,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int64_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_int64_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int64_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_int64_t" >&6; } -if test $ac_cv_type_int64_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +$as_echo "$ac_cv_type_int64_t" >&6; } +if test "x$ac_cv_type_int64_t" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_INT64_T 1 @@ -6965,31 +7267,63 @@ else - { { echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5 -echo "$as_me: error: Type int64_t required but not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: Type int64_t required but not found" >&5 +$as_echo "$as_me: error: Type int64_t required but not found" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 +$as_echo_n "checking for uint64_t... " >&6; } if test "${ac_cv_type_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_uint64_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef uint64_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (uint64_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((uint64_t))) + return 0; ; return 0; } @@ -7000,30 +7334,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uint64_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uint64_t=no + ac_cv_type_uint64_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_type_uint64_t" >&6; } -if test $ac_cv_type_uint64_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +$as_echo "$ac_cv_type_uint64_t" >&6; } +if test "x$ac_cv_type_uint64_t" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_UINT64_T 1 @@ -7031,26 +7374,58 @@ else - { echo "$as_me:$LINENO: checking for u_int64_t" >&5 -echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for u_int64_t" >&5 +$as_echo_n "checking for u_int64_t... " >&6; } if test "${ac_cv_type_u_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_u_int64_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef u_int64_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (u_int64_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((u_int64_t))) + return 0; ; return 0; } @@ -7061,30 +7436,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_u_int64_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_u_int64_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_u_int64_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 -echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; } -if test $ac_cv_type_u_int64_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 +$as_echo "$ac_cv_type_u_int64_t" >&6; } +if test "x$ac_cv_type_u_int64_t" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_U_INT64_T 1 @@ -7092,8 +7476,8 @@ else - { { echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5 -echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: Type uint64_t or u_int64_t required but not found" >&5 +$as_echo "$as_me: error: Type uint64_t or u_int64_t required but not found" >&2;} { (exit 1); exit 1; }; } fi @@ -7105,11 +7489,11 @@ for ac_func in setjmp longjmp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7162,35 +7546,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -7253,11 +7644,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -7290,12 +7682,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7311,7 +7703,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -7324,11 +7716,12 @@ : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -7341,7 +7734,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -7351,7 +7744,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -7373,17 +7766,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -7399,8 +7820,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -7423,7 +7842,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -7436,17 +7855,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -7468,7 +7880,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -7519,7 +7931,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -7547,7 +7959,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -7560,19 +7971,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -7597,10 +8011,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -7623,7 +8037,7 @@ # values after options handling. ac_log=" This file was extended by vmkit $as_me 0.26svn, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7636,7 +8050,16 @@ _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -7644,22 +8067,23 @@ _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -7673,24 +8097,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ vmkit config.status 0.26svn -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -7712,30 +8136,36 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -7754,27 +8184,29 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # @@ -7782,7 +8214,7 @@ _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -7799,8 +8231,8 @@ "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; "lib/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -7841,220 +8273,143 @@ (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -VMKIT_COPYRIGHT!$VMKIT_COPYRIGHT$ac_delim -LLVM_SRC!$LLVM_SRC$ac_delim -LLVM_OBJ!$LLVM_OBJ$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -DYLIB_EXTENSION!$DYLIB_EXTENSION$ac_delim -WITH_LLVM_GCC!$WITH_LLVM_GCC$ac_delim -LLVM_FLAGS!$LLVM_FLAGS$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -WITH_64!$WITH_64$ac_delim -GC_MMAP2!$GC_MMAP2$ac_delim -GC_BOEHM!$GC_BOEHM$ac_delim -GC_MULTI_MMAP!$GC_MULTI_MMAP$ac_delim -GC_SINGLE_MMAP!$GC_SINGLE_MMAP$ac_delim -GC_FLAGS!$GC_FLAGS$ac_delim -GC_LIBS!$GC_LIBS$ac_delim -SINGLE_BUILD!$SINGLE_BUILD$ac_delim -SERVICE_BUILD!$SERVICE_BUILD$ac_delim -ISOLATE_BUILD!$ISOLATE_BUILD$ac_delim -VM_FLAGS!$VM_FLAGS$ac_delim -EXCEPTION_FLAGS!$EXCEPTION_FLAGS$ac_delim -classpathglibj!$classpathglibj$ac_delim -classpathlibs!$classpathlibs$ac_delim -classpathinclude!$classpathinclude$ac_delim -classpathversion!$classpathversion$ac_delim -WITH_JNJVM!$WITH_JNJVM$ac_delim -pnetlocalprefix!$pnetlocalprefix$ac_delim -WITH_N3_PNETLIB!$WITH_N3_PNETLIB$ac_delim -N3_LIB!$N3_LIB$ac_delim -pnetlibpath!$pnetlibpath$ac_delim -WITH_N3_MONO!$WITH_N3_MONO$ac_delim -monopath!$monopath$ac_delim -WITH_N3!$WITH_N3$ac_delim -CXX!$CXX$ac_delim -CXXFLAGS!$CXXFLAGS$ac_delim -ac_ct_CXX!$ac_ct_CXX$ac_delim -NM!$NM$ac_delim -LN_S!$LN_S$ac_delim -CMP!$CMP$ac_delim -CP!$CP$ac_delim -DATE!$DATE$ac_delim -_ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr fi -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -FIND!$FIND$ac_delim -MKDIR!$MKDIR$ac_delim -MV!$MV$ac_delim -RANLIB!$RANLIB$ac_delim -RM!$RM$ac_delim -SED!$SED$ac_delim -TAR!$TAR$ac_delim -BINPWD!$BINPWD$ac_delim -CAT!$CAT$ac_delim -LLVMAS!$LLVMAS$ac_delim -LLC!$LLC$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -LLVMGCC!$LLVMGCC$ac_delim -LLVMGXX!$LLVMGXX$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and @@ -8071,19 +8426,133 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -8112,26 +8581,38 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -8141,7 +8622,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8167,7 +8648,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -8176,7 +8657,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -8197,17 +8678,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -8247,12 +8728,13 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -8261,13 +8743,14 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -8281,15 +8764,16 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -8299,123 +8783,62 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} + :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -8435,6 +8858,11 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -8456,4 +8884,8 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi Modified: vmkit/trunk/include/mvm/Config/config.h.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Config/config.h.in?rev=83202&r1=83201&r2=83202&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Config/config.h.in (original) +++ vmkit/trunk/include/mvm/Config/config.h.in Thu Oct 1 12:19:23 2009 @@ -9,6 +9,9 @@ /* Define to 1 if you have the `gc' library (-lgc). */ #undef HAVE_LIBGC +/* Define to 1 if you are not using finalizers */ +#undef WITHOUT_FINALIZER + /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=83202&r1=83201&r2=83202&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Thu Oct 1 12:19:23 2009 @@ -12,6 +12,7 @@ #define MVM_MMAP_GC_H #include +#include "mvm/Config/config.h" #include "mvm/GC/GC.h" #include "types.h" #include "gcalloc.h" @@ -193,9 +194,11 @@ unlock(); +#if !defined(WITHOUT_FINALIZER) if (vt->destructor) { mvm::Thread::get()->MyVM->addFinalizationCandidate((gc*)p); } +#endif return p; #endif Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83202&r1=83201&r2=83202&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Thu Oct 1 12:19:23 2009 @@ -164,10 +164,18 @@ static void initialiseVT() { -# define INIT(X) { \ - X fake; \ - X::VT = ((VirtualTable**)(void*)(&fake))[0];\ - ((void**)X::VT)[0] = 0; } +#if defined(WITHOUT_FINALIZER) +# define INIT(X) { \ + X fake; \ + X::VT = ((VirtualTable**)(void*)(&fake))[0]; \ + } +#else +# define INIT(X) { \ + X fake; \ + X::VT = ((VirtualTable**)(void*)(&fake))[0]; \ + ((void**)X::VT)[0] = 0; \ + } +#endif INIT(Assembly); INIT(Header); Modified: vmkit/trunk/tools/n3-pnetlib/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/n3-pnetlib/Makefile?rev=83202&r1=83201&r2=83202&view=diff ============================================================================== --- vmkit/trunk/tools/n3-pnetlib/Makefile (original) +++ vmkit/trunk/tools/n3-pnetlib/Makefile Thu Oct 1 12:19:23 2009 @@ -21,7 +21,7 @@ SOURCES = vmkit.s $(notdir $(wildcard $(PROJ_SRC_DIR)/*.cpp)) else USEDLIBS = N3.a PNetLib.a Allocator.a CommonThread.a Mvm.a MvmCompiler.a \ - $(GCLIB).a + $(GCLIB).a endif include $(LEVEL)/Makefile.common Modified: vmkit/trunk/tools/vmkit/Launcher.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmkit/Launcher.cpp?rev=83202&r1=83201&r2=83202&view=diff ============================================================================== --- vmkit/trunk/tools/vmkit/Launcher.cpp (original) +++ vmkit/trunk/tools/vmkit/Launcher.cpp Thu Oct 1 12:19:23 2009 @@ -165,7 +165,7 @@ mvm::CompilationUnit* CLICompiler = mvm::VirtualMachine::initialiseCLIVM(); MyCl.vmlets["net"] = (create_vm_t)(mvm::VirtualMachine::createCLIVM); - MyCl.compilers["net"] = CLICompiler; + MyCl.compilers["net"] = (mvm::Object*)CLICompiler; #endif MyCl.start(); } From gael.thomas at lip6.fr Thu Oct 1 10:35:10 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Thu, 01 Oct 2009 17:35:10 -0000 Subject: [vmkit-commits] [vmkit] r83205 - in /vmkit/trunk: autoconf/configure.ac configure include/mvm/Config/config.h.in lib/Mvm/GCMmap2/MvmGC.h Message-ID: <200910011735.n91HZA4e022158@zion.cs.uiuc.edu> Author: gthomas Date: Thu Oct 1 12:35:09 2009 New Revision: 83205 URL: http://llvm.org/viewvc/llvm-project?rev=83205&view=rev Log: Hi llvm :) (for my second commit) Define WITHOUT_FINALIZER through a gcc option and not through config.h to avoid collision between vmkit's and llvm's config.h Modified: vmkit/trunk/autoconf/configure.ac vmkit/trunk/configure vmkit/trunk/include/mvm/Config/config.h.in vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=83205&r1=83204&r2=83205&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Thu Oct 1 12:35:09 2009 @@ -190,7 +190,7 @@ ) if test ! "x$withfinalizer" = "xyes"; then - AC_DEFINE(WITHOUT_FINALIZER, [1], [Not using finalizer]) + VM_FLAGS="$VM_FLAGS -DWITHOUT_FINALIZER" fi dnl ************************************************************************** Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=83205&r1=83204&r2=83205&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Thu Oct 1 12:35:09 2009 @@ -4021,11 +4021,7 @@ if test ! "x$withfinalizer" = "xyes"; then - -cat >>confdefs.h <<\_ACEOF -#define WITHOUT_FINALIZER 1 -_ACEOF - + VM_FLAGS="$VM_FLAGS -DWITHOUT_FINALIZER" fi Modified: vmkit/trunk/include/mvm/Config/config.h.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Config/config.h.in?rev=83205&r1=83204&r2=83205&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Config/config.h.in (original) +++ vmkit/trunk/include/mvm/Config/config.h.in Thu Oct 1 12:35:09 2009 @@ -9,9 +9,6 @@ /* Define to 1 if you have the `gc' library (-lgc). */ #undef HAVE_LIBGC -/* Define to 1 if you are not using finalizers */ -#undef WITHOUT_FINALIZER - /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=83205&r1=83204&r2=83205&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Thu Oct 1 12:35:09 2009 @@ -12,7 +12,6 @@ #define MVM_MMAP_GC_H #include -#include "mvm/Config/config.h" #include "mvm/GC/GC.h" #include "types.h" #include "gcalloc.h" From gael.thomas at lip6.fr Fri Oct 2 04:17:01 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Fri, 02 Oct 2009 11:17:01 -0000 Subject: [vmkit-commits] [vmkit] r83245 - in /vmkit/trunk: include/mvm/VirtualMachine.h lib/JnJVM/VMCore/Jnjvm.cpp lib/JnJVM/VMCore/Jnjvm.h lib/N3/VMCore/Assembly.cpp lib/N3/VMCore/Assembly.h lib/N3/VMCore/LockedMap.h lib/N3/VMCore/N3.cpp lib/N3/VMCore/N3.h lib/N3/VMCore/N3Initialise.cpp lib/N3/VMCore/VirtualMachine.cpp lib/N3/VMCore/VirtualMachine.h lib/N3/VMCore/VirtualTables.cpp Message-ID: <200910021117.n92BH1DO024163@zion.cs.uiuc.edu> Author: gthomas Date: Fri Oct 2 06:17:00 2009 New Revision: 83245 URL: http://llvm.org/viewvc/llvm-project?rev=83245&view=rev Log: BumpPtrAllocator is now in mvm::VirtualMachine and used by N3 and J3. N3, Assembly and maps are not more collectable objects but allocated with a BumpPtrAllocator. Modified: vmkit/trunk/include/mvm/VirtualMachine.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/LockedMap.h vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp vmkit/trunk/lib/N3/VMCore/VirtualMachine.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/VirtualMachine.h?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/include/mvm/VirtualMachine.h (original) +++ vmkit/trunk/include/mvm/VirtualMachine.h Fri Oct 2 06:17:00 2009 @@ -102,7 +102,8 @@ protected: - VirtualMachine() : + VirtualMachine(mvm::BumpPtrAllocator &Alloc) : + allocator(Alloc), WeakReferencesQueue(ReferenceQueue::WEAK), SoftReferencesQueue(ReferenceQueue::SOFT), PhantomReferencesQueue(ReferenceQueue::PHANTOM) { @@ -129,6 +130,8 @@ } public: + mvm::BumpPtrAllocator& allocator; + virtual void tracer() {} virtual ~VirtualMachine() {} Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Fri Oct 2 06:17:00 2009 @@ -1269,7 +1269,7 @@ } Jnjvm::Jnjvm(mvm::BumpPtrAllocator& Alloc, JnjvmBootstrapLoader* loader) : - VirtualMachine(), allocator(Alloc) { + VirtualMachine(Alloc) { classpath = getenv("CLASSPATH"); if (!classpath) classpath = "."; Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Fri Oct 2 06:17:00 2009 @@ -104,10 +104,6 @@ class Jnjvm : public mvm::VirtualMachine { friend class JnjvmClassLoader; public: - /// allocator - Memory allocator of this JVM. - /// - mvm::BumpPtrAllocator& allocator; - /// throwable - The java/lang/Throwable class. In an isolate /// environment, generated code references this field. UserClass* throwable; Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Fri Oct 2 06:17:00 2009 @@ -465,11 +465,12 @@ } Assembly* Assembly::allocate(const UTF8* name) { - Assembly* ass = gc_new(Assembly)(); - ass->loadedNameClasses = ClassNameMap::allocate(); - ass->loadedTokenClasses = ClassTokenMap::allocate(); - ass->loadedTokenMethods = MethodTokenMap::allocate(); - ass->loadedTokenFields = FieldTokenMap::allocate(); + mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); + Assembly* ass = new(*a, "Assembly") Assembly(*a); + ass->loadedNameClasses = ClassNameMap::allocate(ass->allocator); + ass->loadedTokenClasses = ClassTokenMap::allocate(ass->allocator); + ass->loadedTokenMethods = MethodTokenMap::allocate(ass->allocator); + ass->loadedTokenFields = FieldTokenMap::allocate(ass->allocator); ass->assemblyRefs = 0; ass->isRead = false; ass->name = name; Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Fri Oct 2 06:17:00 2009 @@ -133,9 +133,8 @@ typedef VMCommonClass* (*signatureVector_t)(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod); -class Assembly : public mvm::Object { +class Assembly : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -188,6 +187,10 @@ uint32 resRva; uint32 resSize; + mvm::BumpPtrAllocator &allocator; + + Assembly(mvm::BumpPtrAllocator &Alloc) : allocator(Alloc) {} + static Assembly* allocate(const UTF8* name); static const UTF8* readUTF8(VirtualMachine* vm, uint32 len, Reader* reader); static const UTF8* readUTF16(VirtualMachine* vm, uint32 len, Reader* reader); Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.h?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.h Fri Oct 2 06:17:00 2009 @@ -37,7 +37,7 @@ class UTF8; template -class LockedMap : public mvm::Object { +class LockedMap : public mvm::PermanentObject { public: typedef typename std::map::iterator iterator; typedef Container* (*funcCreate)(Key& V, Upcall* ass); @@ -92,7 +92,7 @@ virtual void TRACER { //lock->MARK_AND_TRACE; for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->MARK_AND_TRACE; + i->second->CALL_TRACER; } } @@ -120,9 +120,8 @@ class ClassNameMap : public LockedMap, Assembly > { public: - static VirtualTable* VT; - static ClassNameMap* allocate() { - ClassNameMap* map = gc_new(ClassNameMap)(); + static ClassNameMap* allocate(mvm::BumpPtrAllocator &allocator) { + ClassNameMap* map = new(allocator, "ClassNameMap") ClassNameMap(); map->lock = new mvm::LockNormal(); return map; } @@ -131,9 +130,8 @@ class ClassTokenMap : public LockedMap, Assembly > { public: - static VirtualTable* VT; - static ClassTokenMap* allocate() { - ClassTokenMap* map = gc_new(ClassTokenMap)(); + static ClassTokenMap* allocate(mvm::BumpPtrAllocator &allocator) { + ClassTokenMap* map = new(allocator, "ClassTokenMap") ClassTokenMap(); map->lock = new mvm::LockNormal(); return map; } @@ -143,9 +141,8 @@ class FieldTokenMap : public LockedMap, Assembly > { public: - static VirtualTable* VT; - static FieldTokenMap* allocate() { - FieldTokenMap* map = gc_new(FieldTokenMap)(); + static FieldTokenMap* allocate(mvm::BumpPtrAllocator &allocator) { + FieldTokenMap* map = new(allocator, "FieldTokenMap") FieldTokenMap(); map->lock = new mvm::LockNormal(); return map; } @@ -154,9 +151,8 @@ class MethodTokenMap : public LockedMap, Assembly > { public: - static VirtualTable* VT; - static MethodTokenMap* allocate() { - MethodTokenMap* map = gc_new(MethodTokenMap)(); + static MethodTokenMap* allocate(mvm::BumpPtrAllocator &allocator) { + MethodTokenMap* map = new(allocator, "MethodTokenMap") MethodTokenMap(); map->lock = new mvm::LockNormal(); return map; } @@ -165,9 +161,8 @@ class AssemblyMap : public LockedMap, N3 > { public: - static VirtualTable* VT; - static AssemblyMap* allocate() { - AssemblyMap* map = gc_new(AssemblyMap)(); + static AssemblyMap* allocate(mvm::BumpPtrAllocator &allocator) { + AssemblyMap* map = new(allocator, "AssemblyMap") AssemblyMap(); map->lock = new mvm::LockNormal(); return map; } @@ -177,9 +172,8 @@ class StringMap : public LockedMap, N3 > { public: - static VirtualTable* VT; - static StringMap* allocate() { - StringMap* map = gc_new(StringMap)(); + static StringMap* allocate(mvm::BumpPtrAllocator &allocator) { + StringMap* map = new(allocator, "StringMap") StringMap(); map->lock = new mvm::LockRecursive(); return map; } @@ -188,9 +182,8 @@ class FunctionMap : public LockedMap, N3 > { public: - static VirtualTable* VT; - static FunctionMap* allocate() { - FunctionMap* map = gc_new(FunctionMap)(); + static FunctionMap* allocate(mvm::BumpPtrAllocator &allocator) { + FunctionMap* map = new(allocator, "FunctionMap") FunctionMap(); map->lock = new mvm::LockNormal(); return map; } @@ -198,14 +191,14 @@ -class UTF8Map : public mvm::Object { +class UTF8Map : public mvm::PermanentObject { public: typedef std::multimap::iterator iterator; mvm::Lock* lock; std::multimap, gc_allocator > > map; - static VirtualTable* VT; + const UTF8* lookupOrCreateAsciiz(const char* asciiz); const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); @@ -220,8 +213,8 @@ buf->write("UTF8 Hashtable<>"); } - static UTF8Map* allocate() { - UTF8Map* map = gc_new(UTF8Map)(); + static UTF8Map* allocate(mvm::BumpPtrAllocator &allocator) { + UTF8Map* map = new(allocator, "UTF8Map") UTF8Map(); map->lock = new mvm::LockNormal(); return map; } Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Fri Oct 2 06:17:00 2009 @@ -60,8 +60,8 @@ } N3* N3::allocateBootstrap() { - mvm::BumpPtrAllocator * A = new mvm::BumpPtrAllocator(); - N3 *vm= new(*A, "VM") N3(); + mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); + N3 *vm= new(*a, "VM") N3(*a); std::string str = mvm::MvmModule::executionEngine->getTargetData()->getStringRepresentation(); @@ -70,14 +70,14 @@ vm->module = new mvm::MvmModule(vm->LLVMModule); vm->getLLVMModule()->setDataLayout(str); vm->protectModule = new mvm::LockNormal(); - vm->functions = FunctionMap::allocate(); + vm->functions = FunctionMap::allocate(vm->allocator); vm->TheModuleProvider = new N3ModuleProvider(vm->LLVMModule, vm->functions); CLIJit::initialiseBootstrapVM(vm); vm->name = "bootstrapN3"; - vm->hashUTF8 = UTF8Map::allocate(); - vm->hashStr = StringMap::allocate(); - vm->loadedAssemblies = AssemblyMap::allocate(); + vm->hashUTF8 = UTF8Map::allocate(vm->allocator); + vm->hashStr = StringMap::allocate(vm->allocator); + vm->loadedAssemblies = AssemblyMap::allocate(vm->allocator); vm->scanner = new mvm::UnpreciseStackScanner(); return vm; @@ -85,8 +85,8 @@ N3* N3::allocate(const char* name, N3* parent) { - mvm::BumpPtrAllocator * A = new mvm::BumpPtrAllocator(); - N3 *vm= new(*A, "VM") N3(); + mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); + N3 *vm= new(*a, "VM") N3(*a); vm->scanner = new mvm::UnpreciseStackScanner(); std::string str = @@ -95,7 +95,7 @@ vm->module = new mvm::MvmModule(vm->LLVMModule); vm->LLVMModule->setDataLayout(str); vm->protectModule = new mvm::LockNormal(); - vm->functions = FunctionMap::allocate(); + vm->functions = FunctionMap::allocate(vm->allocator); vm->TheModuleProvider = new N3ModuleProvider(vm->LLVMModule, vm->functions); CLIJit::initialiseAppDomain(vm); @@ -103,8 +103,8 @@ vm->threadSystem = ThreadSystem::allocateThreadSystem(); vm->name = name; vm->hashUTF8 = parent->hashUTF8; - vm->hashStr = StringMap::allocate(); - vm->loadedAssemblies = AssemblyMap::allocate(); + vm->hashStr = StringMap::allocate(vm->allocator); + vm->loadedAssemblies = AssemblyMap::allocate(vm->allocator); vm->assemblyPath = parent->assemblyPath; vm->coreAssembly = parent->coreAssembly; vm->loadedAssemblies->hash(parent->coreAssembly->name, parent->coreAssembly); Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Fri Oct 2 06:17:00 2009 @@ -50,10 +50,11 @@ class N3 : public VirtualMachine { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; + N3(mvm::BumpPtrAllocator &allocator) : VirtualMachine(allocator) {} + VMObject* asciizToStr(const char* asciiz); VMObject* UTF8ToStr(const UTF8* utf8); Assembly* constructAssembly(const UTF8* name); Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Fri Oct 2 06:17:00 2009 @@ -177,7 +177,6 @@ } #endif - INIT(Assembly); INIT(Header); INIT(Property); INIT(Param); @@ -210,17 +209,7 @@ INIT(VMThread); //mvm::Key::VT = mvm::ThreadKey::VT; INIT(ThreadSystem); - INIT(N3); INIT(Reader); - INIT(UTF8Map); - INIT(AssemblyMap); - INIT(ClassNameMap); - INIT(ClassTokenMap); - INIT(FieldTokenMap); - INIT(MethodTokenMap); - INIT(StringMap); - INIT(FunctionMap); - INIT(VirtualMachine); INIT(CLIString); INIT(CLIJit); INIT(CacheNode); Modified: vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp Fri Oct 2 06:17:00 2009 @@ -155,7 +155,8 @@ delete TheModuleProvider; } -VirtualMachine::VirtualMachine() { +VirtualMachine::VirtualMachine(mvm::BumpPtrAllocator &allocator) + : mvm::VirtualMachine(allocator) { module = 0; TheModuleProvider = 0; } Modified: vmkit/trunk/lib/N3/VMCore/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualMachine.h?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualMachine.h (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualMachine.h Fri Oct 2 06:17:00 2009 @@ -48,7 +48,6 @@ class VirtualMachine : public mvm::VirtualMachine { public: - static VirtualTable* VT; ThreadSystem* threadSystem; const UTF8* asciizConstructUTF8(const char* asciiz); @@ -119,7 +118,7 @@ } ~VirtualMachine(); - VirtualMachine(); + VirtualMachine(mvm::BumpPtrAllocator &allocator); mvm::Lock* protectModule; FunctionMap* functions; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83245&r1=83244&r2=83245&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Fri Oct 2 06:17:00 2009 @@ -50,21 +50,10 @@ INIT(LockObj); INIT(VMObject); INIT(VMThread); - INIT(VirtualMachine); - INIT(UTF8Map); - INIT(ClassNameMap); - INIT(ClassTokenMap); - INIT(FieldTokenMap); - INIT(MethodTokenMap); - INIT(StringMap); - INIT(FunctionMap); - INIT(N3); - INIT(Assembly); INIT(Section); INIT(Stream); INIT(Table); INIT(Header); - INIT(AssemblyMap); INIT(ThreadSystem); INIT(CLIString); INIT(Property); @@ -158,7 +147,7 @@ TRACE_VECTOR(VMCommonClass*, display, std::allocator); vm->CALL_TRACER; - assembly->MARK_AND_TRACE; + assembly->CALL_TRACER; //funcs->MARK_AND_TRACE; TRACE_VECTOR(Property*, properties, gc_allocator); } @@ -235,8 +224,8 @@ void VirtualMachine::TRACER { threadSystem->MARK_AND_TRACE; - hashUTF8->MARK_AND_TRACE; - functions->MARK_AND_TRACE; + hashUTF8->CALL_TRACER; + functions->CALL_TRACER; if (bootstrapThread) { bootstrapThread->CALL_TRACER; for (VMThread* th = (VMThread*)bootstrapThread->next(); @@ -258,10 +247,10 @@ } void Assembly::TRACER { - loadedNameClasses->MARK_AND_TRACE; - loadedTokenClasses->MARK_AND_TRACE; - loadedTokenMethods->MARK_AND_TRACE; - loadedTokenFields->MARK_AND_TRACE; + loadedNameClasses->CALL_TRACER; + loadedTokenClasses->CALL_TRACER; + loadedTokenMethods->CALL_TRACER; + loadedTokenFields->CALL_TRACER; //lockVar->MARK_AND_TRACE; //condVar->MARK_AND_TRACE; name->MARK_AND_TRACE; @@ -277,9 +266,9 @@ void N3::TRACER { VirtualMachine::CALL_TRACER; - hashUTF8->MARK_AND_TRACE; - hashStr->MARK_AND_TRACE; - loadedAssemblies->MARK_AND_TRACE; + hashUTF8->CALL_TRACER; + hashStr->CALL_TRACER; + loadedAssemblies->CALL_TRACER; } void Section::TRACER { From gael.thomas at lip6.fr Fri Oct 2 07:02:29 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Fri, 02 Oct 2009 14:02:29 -0000 Subject: [vmkit-commits] [vmkit] r83247 - in /vmkit/trunk/lib/N3: PNetLib/PNetLib.cpp VMCore/Assembly.cpp VMCore/Assembly.h VMCore/LockedMap.h VMCore/N3.cpp VMCore/N3.h VMCore/N3Initialise.cpp VMCore/Reader.cpp VMCore/Reader.h VMCore/VirtualTables.cpp Message-ID: <200910021402.n92E2Tr5013256@zion.cs.uiuc.edu> Author: gthomas Date: Fri Oct 2 09:02:28 2009 New Revision: 83247 URL: http://llvm.org/viewvc/llvm-project?rev=83247&view=rev Log: A reader is now allocated by a BumpPtrAllocator. Use constructors whenever possible (and remove static allocate functions). Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/LockedMap.h vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/Reader.cpp vmkit/trunk/lib/N3/VMCore/Reader.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Fri Oct 2 09:02:28 2009 @@ -840,7 +840,7 @@ uint32 length = 0; uint32 pad = 0; - Reader* reader = Reader::allocateReader(ass->bytes); + Reader* reader = ass->newReader(ass->bytes); section = textSection->rawAddress + (resRva - textSection->virtualAddress); reader->seek(section, Reader::SeekSet); Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Fri Oct 2 09:02:28 2009 @@ -464,17 +464,15 @@ return meth; } -Assembly* Assembly::allocate(const UTF8* name) { - mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); - Assembly* ass = new(*a, "Assembly") Assembly(*a); - ass->loadedNameClasses = ClassNameMap::allocate(ass->allocator); - ass->loadedTokenClasses = ClassTokenMap::allocate(ass->allocator); - ass->loadedTokenMethods = MethodTokenMap::allocate(ass->allocator); - ass->loadedTokenFields = FieldTokenMap::allocate(ass->allocator); - ass->assemblyRefs = 0; - ass->isRead = false; - ass->name = name; - return ass; +Assembly::Assembly(mvm::BumpPtrAllocator &allocator, const UTF8 *name) : allocator(allocator) { + this->loadedNameClasses = new(allocator, "ClassNameMap") ClassNameMap(); + this->loadedTokenClasses = new(allocator, "ClassTokenMap") ClassTokenMap(); + this->loadedTokenMethods = new(allocator, "MethodTokenMap") MethodTokenMap(); + this->loadedTokenFields = new(allocator, "FieldTokenMap") FieldTokenMap(); + + this->assemblyRefs = 0; + this->isRead = false; + this->name = name; } static void unimplemented(uint32 index, @@ -669,7 +667,7 @@ characteristics = reader->readU4(); } -void Header::read(Reader* reader, N3* vm) { +void Header::read(mvm::BumpPtrAllocator &allocator, Reader* reader, N3* vm) { uint32 start = reader->cursor; signature = reader->readU4(); major = reader->readU2(); @@ -686,7 +684,7 @@ uint32 len = strlen((char*)(&(reader->bytes->elements[reader->cursor]))); - Stream* stream = gc_new(Stream)(); + Stream* stream = new(allocator, "Stream") Stream(); char* str = (char*)malloc(len + 1); memcpy(str, &(reader->bytes->elements[reader->cursor]), len + 1); reader->cursor += (len + (4 - (len % 4))); @@ -788,7 +786,7 @@ uint32 offset = 0; for (uint32 i = 0; i < 32; ++i) { - Table* table = gc_new(Table)(); + Table* table = new(allocator, "Table") Table(); if ((1 << i) & validLow) { table->rowsNumber = reader->readU4(); ++tableNumber; @@ -799,7 +797,7 @@ } for (uint32 i = 0; i < 32; ++i) { - Table* table = gc_new(Table)(); + Table* table = new(allocator, "Table") Table(); if ((1 << i) & validHigh) { table->rowsNumber = reader->readU4(); ++tableNumber; @@ -824,14 +822,18 @@ } } +Reader *Assembly::newReader(ArrayUInt8* array, uint32 start, uint32 end) { + return new(allocator, "Reader") Reader(array, start, end); +} + void Assembly::read() { - Reader* reader = Reader::allocateReader(bytes); + Reader* reader = newReader(bytes); PRINT_DEBUG(DEBUG_LOAD, 1, LIGHT_GREEN, "Reading %s::%s", vm->printString(), this->printString()); - textSection = gc_new(Section)(); - rsrcSection = gc_new(Section)(); - relocSection = gc_new(Section)(); + textSection = new(allocator, "Section") Section(); + rsrcSection = new(allocator, "Section") Section(); + relocSection = new(allocator, "Section") Section(); reader->seek(TEXT_SECTION_HEADER, Reader::SeekSet); textSection->read(reader, vm); @@ -857,8 +859,8 @@ reader->seek(textSection->rawAddress + (mdRva - textSection->virtualAddress), Reader::SeekSet); - CLIHeader = gc_new(Header)(); - CLIHeader->read(reader, vm); + CLIHeader = new (allocator, "Header") Header(); + CLIHeader->read(allocator, reader, vm); reader->seek(CLIHeader->tildStream->realOffset, Reader::SeekSet); Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Fri Oct 2 09:02:28 2009 @@ -52,9 +52,8 @@ class VMGenericClass; class VMGenericMethod; -class Section : public mvm::Object { +class Section : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -72,9 +71,8 @@ void read(Reader* reader, N3* vm); }; -class Stream : public mvm::Object { +class Stream : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -83,9 +81,8 @@ uint32 size; }; -class Table : public mvm::Object { +class Table : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -101,9 +98,8 @@ }; -class Header : public mvm::Object { +class Header : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -123,7 +119,7 @@ Stream* guidStream; std::vector > tables; - void read(Reader* reader, N3* vm); + void read(mvm::BumpPtrAllocator &allocator, Reader* reader, N3* vm); }; typedef void (*maskVector_t)(uint32 index, @@ -189,9 +185,8 @@ mvm::BumpPtrAllocator &allocator; - Assembly(mvm::BumpPtrAllocator &Alloc) : allocator(Alloc) {} + Assembly(mvm::BumpPtrAllocator &Alloc, const UTF8* name); - static Assembly* allocate(const UTF8* name); static const UTF8* readUTF8(VirtualMachine* vm, uint32 len, Reader* reader); static const UTF8* readUTF16(VirtualMachine* vm, uint32 len, Reader* reader); static const UTF8* readUTF8(VirtualMachine* vm, uint32 len, ArrayUInt8* bytes, @@ -208,6 +203,8 @@ static const char* signatureNames[0x46]; + Reader *newReader(ArrayUInt8* array, uint32 start = 0, uint32 end = 0); + uint32 uncompressSignature(uint32& offset); uint32 getTypeDefTokenFromMethod(uint32 token); VMCommonClass* loadType(N3* vm, uint32 token, bool resolveFunc, bool resolve, @@ -268,7 +265,6 @@ private: VMMethod *instantiateGenericMethod(std::vector *genArgs, VMCommonClass *type, const UTF8 *& name, std::vector & args, uint32 token, bool virt, VMGenericClass* genClass); - }; Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.h?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.h Fri Oct 2 09:02:28 2009 @@ -39,12 +39,17 @@ template class LockedMap : public mvm::PermanentObject { public: + typedef typename std::map::iterator iterator; typedef Container* (*funcCreate)(Key& V, Upcall* ass); - mvm::Lock* lock; + mvm::Lock *lock; std::map > > map; + + LockedMap(mvm::Lock *lock) { + this->lock = lock; + } inline Container* lookupOrCreate(Key& V, Upcall* ass, funcCreate func) { lock->lock(); @@ -117,76 +122,40 @@ }; -class ClassNameMap : - public LockedMap, Assembly > { +class ClassNameMap : public LockedMap, Assembly > { public: - static ClassNameMap* allocate(mvm::BumpPtrAllocator &allocator) { - ClassNameMap* map = new(allocator, "ClassNameMap") ClassNameMap(); - map->lock = new mvm::LockNormal(); - return map; - } + ClassNameMap() : LockedMap, Assembly >(new mvm::LockNormal()) {} }; -class ClassTokenMap : - public LockedMap, Assembly > { +class ClassTokenMap : public LockedMap, Assembly > { public: - static ClassTokenMap* allocate(mvm::BumpPtrAllocator &allocator) { - ClassTokenMap* map = new(allocator, "ClassTokenMap") ClassTokenMap(); - map->lock = new mvm::LockNormal(); - return map; - } - + ClassTokenMap() : LockedMap, Assembly >(new mvm::LockNormal()) {} }; -class FieldTokenMap : - public LockedMap, Assembly > { +class FieldTokenMap : public LockedMap, Assembly > { public: - static FieldTokenMap* allocate(mvm::BumpPtrAllocator &allocator) { - FieldTokenMap* map = new(allocator, "FieldTokenMap") FieldTokenMap(); - map->lock = new mvm::LockNormal(); - return map; - } + FieldTokenMap() : LockedMap, Assembly >(new mvm::LockNormal()) {} }; -class MethodTokenMap : - public LockedMap, Assembly > { +class MethodTokenMap : public LockedMap, Assembly > { public: - static MethodTokenMap* allocate(mvm::BumpPtrAllocator &allocator) { - MethodTokenMap* map = new(allocator, "MethodTokenMap") MethodTokenMap(); - map->lock = new mvm::LockNormal(); - return map; - } + MethodTokenMap() : LockedMap, Assembly >(new mvm::LockNormal()) {} }; -class AssemblyMap : - public LockedMap, N3 > { +class AssemblyMap : public LockedMap, N3 > { public: - static AssemblyMap* allocate(mvm::BumpPtrAllocator &allocator) { - AssemblyMap* map = new(allocator, "AssemblyMap") AssemblyMap(); - map->lock = new mvm::LockNormal(); - return map; - } + AssemblyMap() : LockedMap, N3 >(new mvm::LockNormal()) {} }; -class StringMap : - public LockedMap, N3 > { +class StringMap : public LockedMap, N3 > { public: - static StringMap* allocate(mvm::BumpPtrAllocator &allocator) { - StringMap* map = new(allocator, "StringMap") StringMap(); - map->lock = new mvm::LockRecursive(); - return map; - } + StringMap() : LockedMap, N3 >(new mvm::LockRecursive()) {} }; -class FunctionMap : - public LockedMap, N3 > { +class FunctionMap : public LockedMap, N3 > { public: - static FunctionMap* allocate(mvm::BumpPtrAllocator &allocator) { - FunctionMap* map = new(allocator, "FunctionMap") FunctionMap(); - map->lock = new mvm::LockNormal(); - return map; - } + FunctionMap() : LockedMap, N3 >(new mvm::LockNormal()) {} }; @@ -202,6 +171,10 @@ const UTF8* lookupOrCreateAsciiz(const char* asciiz); const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); + UTF8Map() { + lock = new mvm::LockNormal(); + } + virtual void TRACER { //lock->MARK_AND_TRACE; for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { @@ -212,14 +185,6 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("UTF8 Hashtable<>"); } - - static UTF8Map* allocate(mvm::BumpPtrAllocator &allocator) { - UTF8Map* map = new(allocator, "UTF8Map") UTF8Map(); - map->lock = new mvm::LockNormal(); - return map; - } - - }; } // end namespace n3 Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Fri Oct 2 09:02:28 2009 @@ -47,8 +47,8 @@ } static Assembly* assemblyDup(const UTF8*& name, N3* vm) { - Assembly* res = Assembly::allocate(name); - return res; + mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); + return new(*a, "Assembly") Assembly(*a, name); } Assembly* N3::constructAssembly(const UTF8* name) { @@ -59,55 +59,48 @@ return loadedAssemblies->lookup(name); } +N3::N3(mvm::BumpPtrAllocator &allocator, const char *name) : VirtualMachine(allocator) { + this->name = name; + + this->scanner = new mvm::UnpreciseStackScanner(); + this->LLVMModule = new llvm::Module(name, llvm::getGlobalContext()); + this->module = new mvm::MvmModule(this->LLVMModule); + + this->LLVMModule->setDataLayout(mvm::MvmModule::executionEngine->getTargetData()->getStringRepresentation()); + this->protectModule = new mvm::LockNormal(); + + this->functions = new(allocator, "FunctionMap") FunctionMap(); + this->hashStr = new(allocator, "StringMap") StringMap(); + this->loadedAssemblies = new(allocator, "AssemblyMap") AssemblyMap(); + + this->TheModuleProvider = new N3ModuleProvider(this->LLVMModule, this->functions); +} + N3* N3::allocateBootstrap() { mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); - N3 *vm= new(*a, "VM") N3(*a); - - std::string str = - mvm::MvmModule::executionEngine->getTargetData()->getStringRepresentation(); + N3 *vm= new(*a, "VM") N3(*a, "bootstrapN3"); + + vm->hashUTF8 = new(vm->allocator, "UTF8Map") UTF8Map(); - vm->LLVMModule = new llvm::Module("Bootstrap N3", llvm::getGlobalContext()); - vm->module = new mvm::MvmModule(vm->LLVMModule); - vm->getLLVMModule()->setDataLayout(str); - vm->protectModule = new mvm::LockNormal(); - vm->functions = FunctionMap::allocate(vm->allocator); - vm->TheModuleProvider = new N3ModuleProvider(vm->LLVMModule, vm->functions); CLIJit::initialiseBootstrapVM(vm); - vm->name = "bootstrapN3"; - vm->hashUTF8 = UTF8Map::allocate(vm->allocator); - vm->hashStr = StringMap::allocate(vm->allocator); - vm->loadedAssemblies = AssemblyMap::allocate(vm->allocator); - vm->scanner = new mvm::UnpreciseStackScanner(); - return vm; } N3* N3::allocate(const char* name, N3* parent) { mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); - N3 *vm= new(*a, "VM") N3(*a); - vm->scanner = new mvm::UnpreciseStackScanner(); - - std::string str = - mvm::MvmModule::executionEngine->getTargetData()->getStringRepresentation(); - vm->LLVMModule = new llvm::Module("Bootstrap N3", llvm::getGlobalContext()); - vm->module = new mvm::MvmModule(vm->LLVMModule); - vm->LLVMModule->setDataLayout(str); - vm->protectModule = new mvm::LockNormal(); - vm->functions = FunctionMap::allocate(vm->allocator); - vm->TheModuleProvider = new N3ModuleProvider(vm->LLVMModule, vm->functions); - CLIJit::initialiseAppDomain(vm); + N3 *vm= new(*a, "VM") N3(*a, name); + vm->hashUTF8 = parent->hashUTF8; vm->threadSystem = ThreadSystem::allocateThreadSystem(); - vm->name = name; - vm->hashUTF8 = parent->hashUTF8; - vm->hashStr = StringMap::allocate(vm->allocator); - vm->loadedAssemblies = AssemblyMap::allocate(vm->allocator); + vm->assemblyPath = parent->assemblyPath; vm->coreAssembly = parent->coreAssembly; vm->loadedAssemblies->hash(parent->coreAssembly->name, parent->coreAssembly); + + CLIJit::initialiseAppDomain(vm); return vm; } Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Fri Oct 2 09:02:28 2009 @@ -53,8 +53,6 @@ virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; - N3(mvm::BumpPtrAllocator &allocator) : VirtualMachine(allocator) {} - VMObject* asciizToStr(const char* asciiz); VMObject* UTF8ToStr(const UTF8* utf8); Assembly* constructAssembly(const UTF8* name); @@ -67,6 +65,10 @@ std::vector assemblyPath; Assembly* coreAssembly; +private: + N3(mvm::BumpPtrAllocator &allocator, const char *name); + +public: static N3* allocateBootstrap(); static N3* allocate(const char* name, N3* parent); Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Fri Oct 2 09:02:28 2009 @@ -177,12 +177,8 @@ } #endif - INIT(Header); INIT(Property); INIT(Param); - INIT(Section); - INIT(Stream); - INIT(Table); INIT(VMArray); INIT(ArrayUInt8); INIT(ArraySInt8); @@ -207,9 +203,7 @@ INIT(LockObj); INIT(VMObject); INIT(VMThread); - //mvm::Key::VT = mvm::ThreadKey::VT; INIT(ThreadSystem); - INIT(Reader); INIT(CLIString); INIT(CLIJit); INIT(CacheNode); Modified: vmkit/trunk/lib/N3/VMCore/Reader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Reader.cpp?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Reader.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Reader.cpp Fri Oct 2 09:02:28 2009 @@ -104,25 +104,23 @@ return tmp | (((sint64)(readS8())) << 32); } -Reader* Reader::allocateReader(ArrayUInt8* array, uint32 start, - uint32 end) { - Reader* reader = gc_new(Reader)(); - if (!end) end = array->size; - reader->bytes = array; - reader->cursor = start; - reader->min = start; - reader->max = start + end; - return reader; - +Reader::Reader(ArrayUInt8* array, uint32 start, uint32 end) { + if (!end) + end = array->size; + + bytes = array; + cursor = start; + min = start; + max = start + end; } unsigned int Reader::tell() { return cursor - min; } -Reader* Reader::derive(uint32 nbb) { - return allocateReader(bytes, cursor, nbb); -} +// Reader* Reader::derive(uint32 nbb) { +// return new(allocator, "Reader") Reader(allocator, bytes, cursor, nbb); +// } void Reader::seek(uint32 pos, int from) { uint32 n = 0; Modified: vmkit/trunk/lib/N3/VMCore/Reader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Reader.h?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Reader.h (original) +++ vmkit/trunk/lib/N3/VMCore/Reader.h Fri Oct 2 09:02:28 2009 @@ -19,14 +19,15 @@ namespace n3 { -class Reader : public mvm::Object { +class Reader : public mvm::PermanentObject { public: - static VirtualTable* VT; ArrayUInt8* bytes; uint32 min; uint32 cursor; uint32 max; + Reader(ArrayUInt8* array, uint32 start = 0, uint32 end = 0); + static double readDouble(int first, int second); static sint64 readLong(int first, int second); @@ -43,10 +44,8 @@ sint32 readS4(); uint64 readU8(); sint64 readS8(); - static Reader* allocateReader(ArrayUInt8* array, uint32 start = 0, - uint32 end = 0); unsigned int tell(); - Reader* derive(uint32 nbb); + // Reader* derive(uint32 nbb); void seek(uint32 pos, int from); virtual void print(mvm::PrintBuffer* buf) const; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83247&r1=83246&r2=83247&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Fri Oct 2 09:02:28 2009 @@ -50,17 +50,12 @@ INIT(LockObj); INIT(VMObject); INIT(VMThread); - INIT(Section); - INIT(Stream); - INIT(Table); - INIT(Header); INIT(ThreadSystem); INIT(CLIString); INIT(Property); INIT(Param); INIT(CacheNode); INIT(Enveloppe); - INIT(Reader); INIT(Opinfo); INIT(CLIJit); INIT(Exception); @@ -132,6 +127,12 @@ i!= e; ++i) { \ (*i)->MARK_AND_TRACE; }} +#define CALL_TRACER_VECTOR(type, name, alloc) { \ + for (std::vector >::iterator i = name.begin(), e = name.end(); \ + i!= e; ++i) { \ + (*i)->CALL_TRACER; }} + + void VMCommonClass::TRACER { name->MARK_AND_TRACE; nameSpace->MARK_AND_TRACE; @@ -255,10 +256,10 @@ //condVar->MARK_AND_TRACE; name->MARK_AND_TRACE; bytes->MARK_AND_TRACE; - textSection->MARK_AND_TRACE; - rsrcSection->MARK_AND_TRACE; - relocSection->MARK_AND_TRACE; - CLIHeader->MARK_AND_TRACE; + textSection->CALL_TRACER; + rsrcSection->CALL_TRACER; + relocSection->CALL_TRACER; + CLIHeader->CALL_TRACER; vm->CALL_TRACER; delegatee->MARK_AND_TRACE; // TODO trace assembly refs... @@ -282,12 +283,12 @@ void Header::TRACER { versionName->MARK_AND_TRACE; - tildStream->MARK_AND_TRACE; - stringStream->MARK_AND_TRACE; - usStream->MARK_AND_TRACE; - blobStream->MARK_AND_TRACE; - guidStream->MARK_AND_TRACE; - TRACE_VECTOR(Table*, tables, gc_allocator); + tildStream->CALL_TRACER; + stringStream->CALL_TRACER; + usStream->CALL_TRACER; + blobStream->CALL_TRACER; + guidStream->CALL_TRACER; + CALL_TRACER_VECTOR(Table*, tables, gc_allocator); } void CLIString::TRACER { From gael.thomas at lip6.fr Fri Oct 2 07:52:23 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Fri, 02 Oct 2009 14:52:23 -0000 Subject: [vmkit-commits] [vmkit] r83248 - in /vmkit/trunk: include/mvm/PrintBuffer.h lib/N3/VMCore/Assembly.cpp lib/N3/VMCore/CLIJit.cpp lib/N3/VMCore/CLISignature.cpp lib/N3/VMCore/N3Initialise.cpp lib/N3/VMCore/VMClass.cpp lib/N3/VMCore/VMClass.h lib/N3/VMCore/VirtualTables.cpp Message-ID: <200910021452.n92EqNVJ019722@zion.cs.uiuc.edu> Author: gthomas Date: Fri Oct 2 09:52:22 2009 New Revision: 83248 URL: http://llvm.org/viewvc/llvm-project?rev=83248&view=rev Log: VMClass(es) are now allocated with BumpPtrAllocator. Add a generic method in PrintBuffer to call printString even if the object is not an instance of mvm::Object. Modified: vmkit/trunk/include/mvm/PrintBuffer.h vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLISignature.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/mvm/PrintBuffer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/include/mvm/PrintBuffer.h (original) +++ vmkit/trunk/include/mvm/PrintBuffer.h Fri Oct 2 09:52:22 2009 @@ -186,6 +186,13 @@ return pbf; } + template + static char *objectToString(T *obj) { + PrintBuffer *buf = alloc(); + obj->print(buf); + return buf->contents()->cString(); + } + /// tracer - Traces this PrintBuffer. /// static void staticTracer(PrintBuffer* obj) { Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Fri Oct 2 09:52:22 2009 @@ -244,7 +244,7 @@ } static VMCommonClass* arrayDup(ClassNameCmp &cmp, Assembly* ass) { - VMClassArray* cl = gc_new(VMClassArray)(); + VMClassArray* cl = new(ass->allocator, "VMClassArray") VMClassArray(); cl->initialise(ass->vm, true); cl->name = cmp.name; cl->nameSpace = cmp.nameSpace; @@ -280,7 +280,7 @@ } static VMCommonClass* pointerDup(ClassNameCmp &cmp, Assembly* ass) { - VMClassPointer* cl = gc_new(VMClassPointer)(); + VMClassPointer* cl = new(ass->allocator, "VMClassPointer") VMClassPointer(); cl->initialise(ass->vm, false); cl->isPointer = true; cl->name = cmp.name; @@ -317,7 +317,7 @@ } static VMCommonClass* classDup(ClassNameCmp &cmp, Assembly* ass) { - VMClass* cl = gc_new(VMClass)(); + VMClass* cl = new(ass->allocator, "VMClass") VMClass(); cl->initialise(ass->vm, false); cl->name = cmp.name; cl->nameSpace = cmp.nameSpace; @@ -341,7 +341,7 @@ } static VMCommonClass* genClassDup(ClassNameCmp &cmp, Assembly* ass) { - VMClass* cl = gc_new(VMGenericClass)(); + VMClass* cl = new(ass->allocator, "VMGenericClass") VMGenericClass(); cl->initialise(ass->vm, false); cl->name = cmp.name; cl->nameSpace = cmp.nameSpace; Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Fri Oct 2 09:52:22 2009 @@ -608,7 +608,7 @@ Value* obj = 0; if (type->isPointer) { - VMThread::get()->vm->error("implement me %s", type->printString()); + VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer::objectToString(type)); } else if (type->isArray) { VMClassArray* arrayType = (VMClassArray*)type; Value* valCl = new LoadInst(arrayType->llvmVar(), "", currentBlock); @@ -920,8 +920,7 @@ else if (name == N3::invokeName) return invokeDelegate(); else VMThread::get()->vm->error("implement me"); } else { - VMThread::get()->vm->error("implement me %s", - compilingClass->printString()); + VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer::objectToString(compilingClass)); } return 0; } Modified: vmkit/trunk/lib/N3/VMCore/CLISignature.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLISignature.cpp?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLISignature.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLISignature.cpp Fri Oct 2 09:52:22 2009 @@ -182,7 +182,7 @@ uint32 numSizes = ass->uncompressSignature(offset); if (numSizes != 0) { - printf("type = %s\n", cl->printString()); + printf("type = %s\n", mvm::PrintBuffer::objectToString(cl)); VMThread::get()->vm->error("implement me"); } @@ -302,7 +302,7 @@ // of generic methods we need create a placeholder for each of them, // this is done by creating a dummy VMClass which has the assembly field // set to NULL, the token field is used to store the generic argument number - VMClass* cl = gc_new(VMClass)(); + VMClass* cl = new(ass->allocator, "VMClass") VMClass(); cl->token = number; cl->assembly = ass; cl->nameSpace = ass->name; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Fri Oct 2 09:52:22 2009 @@ -191,11 +191,6 @@ INIT(ArrayDouble); INIT(ArrayObject); INIT(UTF8); - INIT(VMCommonClass); - INIT(VMClass); - INIT(VMClassPointer); - INIT(VMGenericClass); - INIT(VMClassArray); INIT(VMMethod); INIT(VMGenericMethod); INIT(VMField); Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Fri Oct 2 09:52:22 2009 @@ -563,7 +563,7 @@ if (!res) { VMThread::get()->vm->error(VirtualMachine::MissingMethodException, "unable to find %s in %s", - name->printString(), this->printString()); + mvm::PrintBuffer::objectToString(name), mvm::PrintBuffer::objectToString(this)); } return res; } @@ -610,7 +610,7 @@ if (!res) { VMThread::get()->vm->error(VirtualMachine::MissingFieldException, "unable to find %s in %s", - name->printString(), this->printString()); + mvm::PrintBuffer::objectToString(name), mvm::PrintBuffer::objectToString(this)); } return res; } Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Fri Oct 2 09:52:22 2009 @@ -44,9 +44,8 @@ }VMClassState; -class VMCommonClass : public mvm::Object { +class VMCommonClass : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -131,7 +130,6 @@ class VMClass : public VMCommonClass { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -157,7 +155,6 @@ // add flag to VMClass instead class VMGenericClass : public VMClass { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -166,7 +163,6 @@ class VMClassArray : public VMCommonClass { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -188,7 +184,6 @@ class VMClassPointer : public VMCommonClass { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83248&r1=83247&r2=83248&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Fri Oct 2 09:52:22 2009 @@ -38,11 +38,6 @@ INIT(ArrayDouble); INIT(ArrayObject); INIT(UTF8); - INIT(VMCommonClass); - INIT(VMClass); - INIT(VMGenericClass); - INIT(VMClassArray); - INIT(VMClassPointer); INIT(VMMethod); INIT(VMGenericMethod); INIT(VMField); @@ -67,7 +62,7 @@ void CLIJit::TRACER { compilingMethod->MARK_AND_TRACE; - compilingClass->MARK_AND_TRACE; + compilingClass->CALL_TRACER; } void ThreadSystem::TRACER { @@ -81,7 +76,7 @@ void CacheNode::TRACER { ((mvm::Object*)methPtr)->MARK_AND_TRACE; - lastCible->MARK_AND_TRACE; + lastCible->CALL_TRACER; next->MARK_AND_TRACE; enveloppe->MARK_AND_TRACE; } @@ -136,8 +131,8 @@ void VMCommonClass::TRACER { name->MARK_AND_TRACE; nameSpace->MARK_AND_TRACE; - super->MARK_AND_TRACE; - TRACE_VECTOR(VMClass*, interfaces, std::allocator); + super->CALL_TRACER; + CALL_TRACER_VECTOR(VMClass*, interfaces, std::allocator); //lockVar->MARK_AND_TRACE; //condVar->MARK_AND_TRACE; TRACE_VECTOR(VMMethod*, virtualMethods, std::allocator); @@ -145,7 +140,7 @@ TRACE_VECTOR(VMField*, virtualFields, std::allocator); TRACE_VECTOR(VMField*, staticFields, std::allocator); delegatee->MARK_AND_TRACE; - TRACE_VECTOR(VMCommonClass*, display, std::allocator); + CALL_TRACER_VECTOR(VMCommonClass*, display, std::allocator); vm->CALL_TRACER; assembly->CALL_TRACER; @@ -157,31 +152,31 @@ VMCommonClass::CALL_TRACER; staticInstance->MARK_AND_TRACE; virtualInstance->MARK_AND_TRACE; - TRACE_VECTOR(VMClass*, innerClasses, std::allocator); - outerClass->MARK_AND_TRACE; + CALL_TRACER_VECTOR(VMClass*, innerClasses, std::allocator); + outerClass->CALL_TRACER; TRACE_VECTOR(VMMethod*, genericMethods, std::allocator); } void VMGenericClass::TRACER { VMClass::CALL_TRACER; - TRACE_VECTOR(VMCommonClass*, genericParams, std::allocator); + CALL_TRACER_VECTOR(VMCommonClass*, genericParams, std::allocator); } void VMClassArray::TRACER { VMCommonClass::CALL_TRACER; - baseClass->MARK_AND_TRACE; + baseClass->CALL_TRACER; } void VMClassPointer::TRACER { VMCommonClass::CALL_TRACER; - baseClass->MARK_AND_TRACE; + baseClass->CALL_TRACER; } void VMMethod::TRACER { delegatee->MARK_AND_TRACE; //signature->MARK_AND_TRACE; - classDef->MARK_AND_TRACE; + classDef->CALL_TRACER; TRACE_VECTOR(Param*, params, gc_allocator); TRACE_VECTOR(Enveloppe*, caches, gc_allocator); name->MARK_AND_TRACE; @@ -189,12 +184,12 @@ void VMGenericMethod::TRACER { VMMethod::CALL_TRACER; - TRACE_VECTOR(VMCommonClass*, genericParams, std::allocator); + CALL_TRACER_VECTOR(VMCommonClass*, genericParams, std::allocator); } void VMField::TRACER { - signature->MARK_AND_TRACE; - classDef->MARK_AND_TRACE; + signature->CALL_TRACER; + classDef->CALL_TRACER; name->MARK_AND_TRACE; } @@ -211,7 +206,7 @@ } void VMObject::TRACER { - classOf->MARK_AND_TRACE; + classOf->CALL_TRACER; lockObj->MARK_AND_TRACE; } @@ -241,7 +236,7 @@ } void Property::TRACER { - type->MARK_AND_TRACE; + type->CALL_TRACER; //signature->MARK_AND_TRACE; name->MARK_AND_TRACE; delegatee->MARK_AND_TRACE; @@ -295,7 +290,7 @@ } void Exception::TRACER { - catchClass->MARK_AND_TRACE; + catchClass->CALL_TRACER; } #ifdef MULTIPLE_GC @@ -303,7 +298,7 @@ #else extern "C" void CLIObjectTracer(VMObject* obj) { #endif - obj->classOf->MARK_AND_TRACE; + obj->classOf->CALL_TRACER; obj->lockObj->MARK_AND_TRACE; } From gael.thomas at lip6.fr Fri Oct 2 10:53:15 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Fri, 02 Oct 2009 17:53:15 -0000 Subject: [vmkit-commits] [vmkit] r83250 - in /vmkit/trunk/lib/N3/VMCore: Assembly.cpp CLIJit.cpp LockedMap.cpp N3Initialise.cpp NativeUtil.cpp Opcodes.cpp VMClass.h VirtualTables.cpp Message-ID: <200910021753.n92HrGWZ010574@zion.cs.uiuc.edu> Author: gthomas Date: Fri Oct 2 12:53:15 2009 New Revision: 83250 URL: http://llvm.org/viewvc/llvm-project?rev=83250&view=rev Log: Param, VMMethod, VMGenericMethod and VMField are also allocated with a BumpPtrAllocator Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/LockedMap.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Fri Oct 2 12:53:15 2009 @@ -387,7 +387,7 @@ } static VMField* fieldDup(uint32& key, Assembly* ass) { - VMField* field = gc_new(VMField)(); + VMField* field = new(ass->allocator, "VMField") VMField(); field->token = key; return field; } @@ -414,14 +414,14 @@ } static VMMethod* methodDup(uint32& key, Assembly* ass) { - VMMethod* meth = gc_new(VMMethod)(); + VMMethod* meth = new(ass->allocator, "VMMethod") VMMethod(); meth->token = key; meth->canBeInlined = false; return meth; } static VMGenericMethod* genMethodDup(uint32& key, Assembly* ass) { - VMGenericMethod* meth = gc_new(VMGenericMethod)(); + VMGenericMethod* meth = new(ass->allocator, "VMGenericMethod") VMGenericMethod(); meth->token = key; meth->canBeInlined = false; return meth; @@ -1415,7 +1415,7 @@ uint32 name = paramArray[CONSTANT_PARAM_NAME]; uint32 sequence = paramArray[CONSTANT_PARAM_SEQUENCE]; - Param* param = gc_new(Param)(); + Param* param = new(allocator, "Param") Param(); param->flags = flags; param->sequence = sequence; param->name = readString(meth->classDef->vm, stringOffset + name); @@ -1779,7 +1779,7 @@ } else { type->resolveType(false, false, genMethod); - VMMethod* meth = gc_new(VMMethod)() ; + VMMethod* meth = new(allocator, "VMMethod") VMMethod() ; bool virt = extractMethodSignature(offset, type, args, genClass, genMethod); bool structReturn = false; const llvm::FunctionType* signature = VMMethod::resolveSignature(args, Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Fri Oct 2 12:53:15 2009 @@ -1472,7 +1472,7 @@ classDef->aquire(); if (methPtr == 0) { methPtr = Function::Create(getSignature(genMethod), GlobalValue::GhostLinkage, - printString(), classDef->vm->getLLVMModule()); + mvm::PrintBuffer::objectToString(this), classDef->vm->getLLVMModule()); classDef->vm->functions->hash(methPtr, this); } classDef->release(); Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.cpp?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.cpp Fri Oct 2 12:53:15 2009 @@ -75,7 +75,7 @@ } if (res == 0) { - UTF8* tmp = UTF8::acons(size, MSCorlib::arrayChar); + UTF8* tmp = (UTF8 *)UTF8::acons(size, MSCorlib::arrayChar); for (sint32 i = 0; i < size; i++) { tmp->setAt(i, asciiz[i]); } Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Fri Oct 2 12:53:15 2009 @@ -178,7 +178,6 @@ #endif INIT(Property); - INIT(Param); INIT(VMArray); INIT(ArrayUInt8); INIT(ArraySInt8); @@ -191,9 +190,6 @@ INIT(ArrayDouble); INIT(ArrayObject); INIT(UTF8); - INIT(VMMethod); - INIT(VMGenericMethod); - INIT(VMField); INIT(VMCond); INIT(LockObj); INIT(VMObject); Modified: vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp Fri Oct 2 12:53:15 2009 @@ -47,7 +47,7 @@ if (!res) { VMThread::get()->vm->error("unable to find native method %s", - meth->printString()); + mvm::PrintBuffer::objectToString(meth)); } return res; Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Fri Oct 2 12:53:15 2009 @@ -107,7 +107,7 @@ extern "C" void n3PrintExecution(char* opcode, VMMethod* meth) { - fprintf(stderr, "executing %s %s\n", meth->printString(), opcode); + fprintf(stderr, "executing %s %s\n", mvm::PrintBuffer::objectToString(meth), opcode); } Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Fri Oct 2 12:53:15 2009 @@ -193,9 +193,8 @@ void makeType(); }; -class VMMethod : public mvm::Object { +class VMMethod : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -239,16 +238,14 @@ // add flag to VMMethod instead class VMGenericMethod : public VMMethod { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; std::vector genericParams; }; -class VMField : public mvm::Object { +class VMField : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -279,9 +276,8 @@ llvm::GlobalVariable* _llvmVar; }; -class Param : public mvm::Object { +class Param : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83250&r1=83249&r2=83250&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Fri Oct 2 12:53:15 2009 @@ -38,9 +38,6 @@ INIT(ArrayDouble); INIT(ArrayObject); INIT(UTF8); - INIT(VMMethod); - INIT(VMGenericMethod); - INIT(VMField); INIT(VMCond); INIT(LockObj); INIT(VMObject); @@ -48,7 +45,6 @@ INIT(ThreadSystem); INIT(CLIString); INIT(Property); - INIT(Param); INIT(CacheNode); INIT(Enveloppe); INIT(Opinfo); @@ -61,7 +57,7 @@ } void CLIJit::TRACER { - compilingMethod->MARK_AND_TRACE; + compilingMethod->CALL_TRACER; compilingClass->CALL_TRACER; } @@ -84,7 +80,7 @@ void Enveloppe::TRACER { firstCache->MARK_AND_TRACE; //cacheLock->MARK_AND_TRACE; - originalMethod->MARK_AND_TRACE; + originalMethod->CALL_TRACER; } void VMArray::TRACER { @@ -135,10 +131,10 @@ CALL_TRACER_VECTOR(VMClass*, interfaces, std::allocator); //lockVar->MARK_AND_TRACE; //condVar->MARK_AND_TRACE; - TRACE_VECTOR(VMMethod*, virtualMethods, std::allocator); - TRACE_VECTOR(VMMethod*, staticMethods, std::allocator); - TRACE_VECTOR(VMField*, virtualFields, std::allocator); - TRACE_VECTOR(VMField*, staticFields, std::allocator); + CALL_TRACER_VECTOR(VMMethod*, virtualMethods, std::allocator); + CALL_TRACER_VECTOR(VMMethod*, staticMethods, std::allocator); + CALL_TRACER_VECTOR(VMField*, virtualFields, std::allocator); + CALL_TRACER_VECTOR(VMField*, staticFields, std::allocator); delegatee->MARK_AND_TRACE; CALL_TRACER_VECTOR(VMCommonClass*, display, std::allocator); vm->CALL_TRACER; @@ -154,7 +150,7 @@ virtualInstance->MARK_AND_TRACE; CALL_TRACER_VECTOR(VMClass*, innerClasses, std::allocator); outerClass->CALL_TRACER; - TRACE_VECTOR(VMMethod*, genericMethods, std::allocator); + CALL_TRACER_VECTOR(VMMethod*, genericMethods, std::allocator); } void VMGenericClass::TRACER { @@ -177,7 +173,7 @@ delegatee->MARK_AND_TRACE; //signature->MARK_AND_TRACE; classDef->CALL_TRACER; - TRACE_VECTOR(Param*, params, gc_allocator); + CALL_TRACER_VECTOR(Param*, params, gc_allocator); TRACE_VECTOR(Enveloppe*, caches, gc_allocator); name->MARK_AND_TRACE; } @@ -231,7 +227,7 @@ } void Param::TRACER { - method->MARK_AND_TRACE; + method->CALL_TRACER; name->MARK_AND_TRACE; } From gael.thomas at lip6.fr Sat Oct 3 11:13:47 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 03 Oct 2009 18:13:47 -0000 Subject: [vmkit-commits] [vmkit] r83269 - in /vmkit/trunk: include/jnjvm/JnjvmModule.h include/mvm/UTF8.h lib/JnJVM/Compiler/JavaJIT.h lib/JnJVM/VMCore/JavaArray.cpp lib/JnJVM/VMCore/JavaArray.h lib/JnJVM/VMCore/JavaCache.h lib/JnJVM/VMCore/JavaClass.h lib/JnJVM/VMCore/JavaConstantPool.h lib/JnJVM/VMCore/JavaString.h lib/JnJVM/VMCore/JavaTypes.h lib/JnJVM/VMCore/Jnjvm.h lib/JnJVM/VMCore/JnjvmClassLoader.h lib/JnJVM/VMCore/LockedMap.cpp lib/JnJVM/VMCore/LockedMap.h lib/JnJVM/VMCore/UTF8.h lib/Mvm/Runtime/UTF8.cpp Message-ID: <200910031813.n93IDlCM015559@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 3 13:13:46 2009 New Revision: 83269 URL: http://llvm.org/viewvc/llvm-project?rev=83269&view=rev Log: Remove UTF8 from JnJVM and put it in Mvm. It will be usefull for N3. JnJVM uses now mvm::UTF8 (mvm::UTF8 is also linked to jnjvm::UTF8). Added: vmkit/trunk/include/mvm/UTF8.h vmkit/trunk/lib/JnJVM/VMCore/UTF8.h vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h vmkit/trunk/lib/JnJVM/VMCore/JavaString.h vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.h vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/jnjvm/JnjvmModule.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/include/jnjvm/JnjvmModule.h (original) +++ vmkit/trunk/include/jnjvm/JnjvmModule.h Sat Oct 3 13:13:46 2009 @@ -15,6 +15,7 @@ #include "mvm/Allocator.h" #include "mvm/JIT.h" +#include "mvm/UTF8.h" #include "JavaCompiler.h" @@ -52,7 +53,8 @@ class JnjvmModule; class Typedef; class Signdef; -class UTF8; + +using mvm::UTF8; class LLVMAssessorInfo { public: Added: vmkit/trunk/include/mvm/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/UTF8.h?rev=83269&view=auto ============================================================================== --- vmkit/trunk/include/mvm/UTF8.h (added) +++ vmkit/trunk/include/mvm/UTF8.h Sat Oct 3 13:13:46 2009 @@ -0,0 +1,137 @@ +#ifndef _UTF8_INTERNAL_H_ +#define _UTF8_INTERNAL_H_ + +#include +#include "mvm/Allocator.h" + +namespace mvm { + +class UTF8Map; + +class UTF8 { + friend class UTF8Map; +private: + + /// operator new - Redefines the new operator of this class to allocate + /// its objects in permanent memory, not with the garbage collector. + void* operator new(size_t sz, mvm::BumpPtrAllocator& allocator, sint32 size) { + return allocator.Allocate(sizeof(ssize_t) + size * sizeof(uint16), "UTF8"); + } + + UTF8(sint32 n) { + size = n; + } + +public: + /// size - The (constant) size of the array. + ssize_t size; + + /// elements - Elements of this array. The size here is different than the + /// actual size of the Java array. This is to facilitate Java array accesses + /// in JnJVM code. The size should be set to zero, but this is invalid C99. + uint16 elements[1]; + + /// extract - Similar, but creates it in the map. + const UTF8* extract(UTF8Map* map, uint32 start, uint32 len) const; + + /// equals - Are the two UTF8s equal? + bool equals(const UTF8* other) const { + if (other == this) return true; + else if (size != other->size) return false; + else return !memcmp(elements, other->elements, size * sizeof(uint16)); + } + + /// equals - Does the UTF8 equal to the buffer? + bool equals(const uint16* buf, sint32 len) const { + if (size != len) return false; + else return !memcmp(elements, buf, size * sizeof(uint16)); + } + + /// lessThan - strcmp-like function for UTF8s, used by hash tables. + bool lessThan(const UTF8* other) const { + if (size < other->size) return true; + else if (size > other->size) return false; + else return memcmp((const char*)elements, (const char*)other->elements, + size * sizeof(uint16)) < 0; + } + +}; + + +class UTF8Map : public mvm::PermanentObject { +private: + typedef std::multimap::iterator iterator; + + mvm::LockNormal lock; + mvm::BumpPtrAllocator& allocator; + std::multimap map; +public: + + const UTF8* lookupOrCreateAsciiz(const char* asciiz); + const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); + const UTF8* lookupAsciiz(const char* asciiz); + const UTF8* lookupReader(const uint16* buf, uint32 size); + + UTF8Map(mvm::BumpPtrAllocator& A) : allocator(A) {} + + ~UTF8Map() { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + allocator.Deallocate((void*)i->second); + } + } + + void copy(UTF8Map* newMap) { + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + newMap->map.insert(*i); + } + } + + void replace(const UTF8* oldUTF8, const UTF8* newUTF8); + void insert(const UTF8* val); +}; + +/// UTF8Buffer - Helper class to create char* buffers suitable for +/// printf. +/// +class UTF8Buffer { + + /// buffer - The buffer that holds a string representation. + /// + char* buffer; +public: + + /// UTF8Buffer - Create a buffer with the following UTF8. + /// + UTF8Buffer(const UTF8* val) { + buffer = new char[val->size + 1]; + for (sint32 i = 0; i < val->size; ++i) + buffer[i] = val->elements[i]; + buffer[val->size] = 0; + } + + /// ~UTF8Buffer - Delete the buffer, as well as all dynamically + /// allocated memory. + /// + ~UTF8Buffer() { + delete[] buffer; + } + + /// replaceWith - replace the content of the buffer and free the old buffer + /// + void replaceWith(char *buffer) { + delete[] this->buffer; + this->buffer = buffer; + } + + + /// cString - Return a C string representation of the buffer, suitable + /// for printf. + /// + const char* cString() { + return buffer; + } +}; + +} // end namespace mvm + +#endif Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h Sat Oct 3 13:13:46 2009 @@ -31,7 +31,6 @@ class JavaMethod; class JnjvmModule; class Reader; -class UTF8; /// Opinfo - This class gives for each opcode if it starts a new block and /// its exception destination. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp Sat Oct 3 13:13:46 2009 @@ -34,14 +34,3 @@ const unsigned int JavaArray::T_SHORT = 9; const unsigned int JavaArray::T_INT = 10; const unsigned int JavaArray::T_LONG = 11; - -const UTF8* UTF8::extract(UTF8Map* map, uint32 start, uint32 end) const { - uint32 len = end - start; - uint16* buf = (uint16*)alloca(sizeof(uint16) * len); - - for (uint32 i = 0; i < len; i++) { - buf[i] = elements[i + start]; - } - - return map->lookupOrCreateReader(buf, len); -} Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Sat Oct 3 13:13:46 2009 @@ -20,13 +20,14 @@ #include "JavaObject.h" +#include "UTF8.h" + namespace jnjvm { class ClassArray; class CommonClass; class JavaObject; class Jnjvm; -class UTF8Map; /// TJavaArray - Template class to be instantiated by real arrays. All arrays /// have a constant size and an array of element. When JnJVM allocates an @@ -85,127 +86,6 @@ #undef ARRAYCLASS -/// UTF8 - The UTF8 class is basically the ArrayUInt16 class (arrays of elements -/// of type uint16) with helper functions for manipulating UTF8. Each JVM -/// instance hashes UTF8. UTF8 are not allocated by the application's garbage -/// collector, but resides in permanent memory (e.g malloc). -class UTF8 { - friend class UTF8Map; -private: - - /// operator new - Redefines the new operator of this class to allocate - /// its objects in permanent memory, not with the garbage collector. - void* operator new(size_t sz, mvm::BumpPtrAllocator& allocator, - sint32 size) { - return allocator.Allocate(sizeof(ssize_t) + size * sizeof(uint16), "UTF8"); - } - - UTF8(sint32 n) { - size = n; - } - -public: - /// size - The (constant) size of the array. - ssize_t size; - - /// elements - Elements of this array. The size here is different than the - /// actual size of the Java array. This is to facilitate Java array accesses - /// in JnJVM code. The size should be set to zero, but this is invalid C99. - uint16 elements[1]; - - /// extract - Similar, but creates it in the map. - const UTF8* extract(UTF8Map* map, uint32 start, uint32 len) const; - - /// equals - Are the two UTF8s equal? - bool equals(const UTF8* other) const { - if (other == this) return true; - else if (size != other->size) return false; - else return !memcmp(elements, other->elements, size * sizeof(uint16)); - } - - /// equals - Does the UTF8 equal to the buffer? - bool equals(const uint16* buf, sint32 len) const { - if (size != len) return false; - else return !memcmp(elements, buf, size * sizeof(uint16)); - } - - /// lessThan - strcmp-like function for UTF8s, used by hash tables. - bool lessThan(const UTF8* other) const { - if (size < other->size) return true; - else if (size > other->size) return false; - else return memcmp((const char*)elements, (const char*)other->elements, - size * sizeof(uint16)) < 0; - } - -}; - - -/// UTF8Buffer - Helper class to create char* buffers suitable for -/// printf. -/// -class UTF8Buffer { - - /// buffer - The buffer that holds a string representation. - /// - char* buffer; -public: - - /// UTF8Buffer - Create a buffer with the following UTF8. - /// - UTF8Buffer(const UTF8* val) { - buffer = new char[val->size + 1]; - for (sint32 i = 0; i < val->size; ++i) - buffer[i] = val->elements[i]; - buffer[val->size] = 0; - } - - /// ~UTF8Buffer - Delete the buffer, as well as all dynamically - /// allocated memory. - /// - ~UTF8Buffer() { - delete[] buffer; - } - - /// toCompileName - Change the utf8 following JNI conventions. - /// - UTF8Buffer* toCompileName() { - uint32 len = strlen(buffer); - char* newBuffer = new char[(len << 1) + 1]; - uint32 j = 0; - for (uint32 i = 0; i < len; ++i) { - if (buffer[i] == '/') { - newBuffer[j++] = '_'; - } else if (buffer[i] == '_') { - newBuffer[j++] = '_'; - newBuffer[j++] = '1'; - } else if (buffer[i] == ';') { - newBuffer[j++] = '_'; - newBuffer[j++] = '2'; - } else if (buffer[i] == '[') { - newBuffer[j++] = '_'; - newBuffer[j++] = '3'; - } else if (buffer[i] == '$') { - newBuffer[j++] = '_'; - newBuffer[j++] = '4'; - } else { - newBuffer[j++] = buffer[i]; - } - } - newBuffer[j] = 0; - delete[] buffer; - buffer = newBuffer; - return this; - } - - /// cString - Return a C string representation of the buffer, suitable - /// for printf. - /// - const char* cString() { - return buffer; - } - -}; - } // end namespace jnjvm #endif Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaCache.h Sat Oct 3 13:13:46 2009 @@ -28,12 +28,12 @@ #include "types.h" #include "JnjvmConfig.h" +#include "UTF8.h" namespace jnjvm { class Enveloppe; class JavaVirtualTable; -class UTF8; /// CacheNode - A {class, method pointer} pair. class CacheNode : public mvm::PermanentObject { Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Sat Oct 3 13:13:46 2009 @@ -42,7 +42,6 @@ class Reader; class Signdef; class Typedef; -class UTF8; /// JavaState - List of states a Java class can have. A class is ready to be Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaConstantPool.h Sat Oct 3 13:13:46 2009 @@ -24,7 +24,6 @@ class Reader; class Signdef; class Typedef; -class UTF8; /// JavaConstantPool - This class represents a Java constant pool, a place where Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaString.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaString.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaString.h Sat Oct 3 13:13:46 2009 @@ -18,8 +18,6 @@ class ArrayUInt16; class Jnjvm; -class UTF8; -class UTF8Map; class JavaString : public JavaObject { public: Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h Sat Oct 3 13:13:46 2009 @@ -21,8 +21,6 @@ class UserCommonClass; class JnjvmClassLoader; class UserClassPrimitive; -class UTF8; -class UTF8Map; #define VOID_ID 0 #define BOOL_ID 1 Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Sat Oct 3 13:13:46 2009 @@ -41,7 +41,6 @@ class UserClassArray; class UserClassPrimitive; class UserCommonClass; -class UTF8; /// ThreadSystem - Thread management of a JVM. Each JVM has one thread /// management system to count the number of non-daemon threads it owns. Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmClassLoader.h Sat Oct 3 13:13:46 2009 @@ -16,6 +16,8 @@ #include "types.h" +#include "UTF8.h" + #include "mvm/Allocator.h" #include "mvm/Object.h" @@ -41,8 +43,6 @@ class StringList; class Typedef; class TypeMap; -class UTF8; -class UTF8Map; class ZipArchive; Modified: vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/LockedMap.cpp Sat Oct 3 13:13:46 2009 @@ -20,157 +20,6 @@ using namespace jnjvm; - -static uint32 asciizHasher(const char* asciiz, sint32 size) { - uint32 r0 = 0, r1 = 0; - for (sint32 i = 0; i < size; i++) { - char c = asciiz[i]; - r0 += c; - r1 ^= c; - } - return (r1 & 255) + ((r0 & 255) << 8); -} - -static uint32 readerHasher(const uint16* buf, sint32 size) { - uint32 r0 = 0, r1 = 0; - for (sint32 i = 0; i < size; i++) { - uint16 c = buf[i]; - r0 += c; - r1 ^= c; - } - return (r1 & 255) + ((r0 & 255) << 8); -} - -static bool asciizEqual(const UTF8* val, const char* asciiz, sint32 size) { - sint32 len = val->size; - if (len != size) return false; - else { - for (sint32 i = 0; i < len; i++) { - if (asciiz[i] != val->elements[i]) return false; - } - return true; - } -} - -static bool readerEqual(const UTF8* val, const uint16* buf, sint32 size) { - sint32 len = val->size; - if (len != size) return false; - else return !(memcmp(val->elements, buf, len * sizeof(uint16))); -} - -void UTF8Map::replace(const UTF8* oldUTF8, const UTF8* newUTF8) { - lock.lock(); - uint32 key = readerHasher(oldUTF8->elements, oldUTF8->size); - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (i->second == oldUTF8) { - map.erase(i); - break; - } - } - map.insert(std::make_pair(key, newUTF8)); - lock.unlock(); - -} - -const UTF8* UTF8Map::lookupOrCreateAsciiz(const char* asciiz) { - sint32 size = strlen(asciiz); - uint32 key = asciizHasher(asciiz, size); - const UTF8* res = 0; - lock.lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (asciizEqual(i->second, asciiz, size)) { - res = i->second; - break; - } - } - - if (res == 0) { - UTF8* tmp = new(allocator, size) UTF8(size); - for (sint32 i = 0; i < size; i++) { - tmp->elements[i] = asciiz[i]; - } - res = (const UTF8*)tmp; - map.insert(std::make_pair(key, res)); - } - - lock.unlock(); - return res; -} - -const UTF8* UTF8Map::lookupOrCreateReader(const uint16* buf, uint32 len) { - sint32 size = (sint32)len; - uint32 key = readerHasher(buf, size); - const UTF8* res = 0; - lock.lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (readerEqual(i->second, buf, size)) { - res = i->second; - break; - } - } - - if (res == 0) { - UTF8* tmp = new(allocator, size) UTF8(size); - memcpy(tmp->elements, buf, len * sizeof(uint16)); - res = (const UTF8*)tmp; - map.insert(std::make_pair(key, res)); - } - - lock.unlock(); - return res; -} - -const UTF8* UTF8Map::lookupAsciiz(const char* asciiz) { - sint32 size = strlen(asciiz); - uint32 key = asciizHasher(asciiz, size); - const UTF8* res = 0; - lock.lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (asciizEqual(i->second, asciiz, size)) { - res = i->second; - break; - } - } - - lock.unlock(); - return res; -} - -const UTF8* UTF8Map::lookupReader(const uint16* buf, uint32 len) { - sint32 size = (sint32)len; - uint32 key = readerHasher(buf, size); - const UTF8* res = 0; - lock.lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (readerEqual(i->second, buf, size)) { - res = i->second; - break; - } - } - - lock.unlock(); - return res; -} - - -void UTF8Map::insert(const UTF8* val) { - map.insert(std::make_pair(readerHasher(val->elements, val->size), val)); -} - void StringMap::insert(JavaString* str) { map.insert(std::make_pair(str->value, str)); } Modified: vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h?rev=83269&r1=83268&r2=83269&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h Sat Oct 3 13:13:46 2009 @@ -24,6 +24,7 @@ #include "mvm/Allocator.h" #include "mvm/Threads/Locks.h" +#include "UTF8.h" #include "JavaArray.h" // for comparing UTF8s @@ -116,36 +117,6 @@ ~LockedMap() {} }; -class UTF8Map : public mvm::PermanentObject { -public: - typedef std::multimap::iterator iterator; - - mvm::LockNormal lock; - mvm::BumpPtrAllocator& allocator; - std::multimap map; - const UTF8* lookupOrCreateAsciiz(const char* asciiz); - const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); - const UTF8* lookupAsciiz(const char* asciiz); - const UTF8* lookupReader(const uint16* buf, uint32 size); - - UTF8Map(mvm::BumpPtrAllocator& A) : allocator(A) {} - - ~UTF8Map() { - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - allocator.Deallocate((void*)i->second); - } - } - - void copy(UTF8Map* newMap) { - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - newMap->map.insert(*i); - } - } - - void replace(const UTF8* oldUTF8, const UTF8* newUTF8); - void insert(const UTF8* val); -}; - class ClassMap : public LockedMap { Added: vmkit/trunk/lib/JnJVM/VMCore/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/UTF8.h?rev=83269&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/UTF8.h (added) +++ vmkit/trunk/lib/JnJVM/VMCore/UTF8.h Sat Oct 3 13:13:46 2009 @@ -0,0 +1,54 @@ +#ifndef _JNJVM_UTF8_H_ +#define _JNJVM_UTF8_H_ + +#include "types.h" + +#include "mvm/UTF8.h" + +namespace jnjvm { + using mvm::UTF8; + using mvm::UTF8Map; + +/// UTF8Buffer - Helper class to create char* buffers suitable for +/// printf. +/// +class UTF8Buffer : public mvm::UTF8Buffer { +public: + /// UTF8Buffer - Create a buffer with the following UTF8. + UTF8Buffer(const UTF8* val) : mvm::UTF8Buffer(val) {} + + /// toCompileName - Change the utf8 following JNI conventions. + /// + UTF8Buffer* toCompileName() { + const char *buffer = cString(); + uint32 len = strlen(buffer); + char* newBuffer = new char[(len << 1) + 1]; + uint32 j = 0; + for (uint32 i = 0; i < len; ++i) { + if (buffer[i] == '/') { + newBuffer[j++] = '_'; + } else if (buffer[i] == '_') { + newBuffer[j++] = '_'; + newBuffer[j++] = '1'; + } else if (buffer[i] == ';') { + newBuffer[j++] = '_'; + newBuffer[j++] = '2'; + } else if (buffer[i] == '[') { + newBuffer[j++] = '_'; + newBuffer[j++] = '3'; + } else if (buffer[i] == '$') { + newBuffer[j++] = '_'; + newBuffer[j++] = '4'; + } else { + newBuffer[j++] = buffer[i]; + } + } + newBuffer[j] = 0; + replaceWith(newBuffer); + return this; + } +}; + +} + +#endif Added: vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp?rev=83269&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp (added) +++ vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Sat Oct 3 13:13:46 2009 @@ -0,0 +1,163 @@ +#include "mvm/UTF8.h" + +using namespace mvm; + +const UTF8* UTF8::extract(UTF8Map* map, uint32 start, uint32 end) const { + uint32 len = end - start; + uint16* buf = (uint16*)alloca(sizeof(uint16) * len); + + for (uint32 i = 0; i < len; i++) { + buf[i] = elements[i + start]; + } + + return map->lookupOrCreateReader(buf, len); +} + +static uint32 asciizHasher(const char* asciiz, sint32 size) { + uint32 r0 = 0, r1 = 0; + for (sint32 i = 0; i < size; i++) { + char c = asciiz[i]; + r0 += c; + r1 ^= c; + } + return (r1 & 255) + ((r0 & 255) << 8); +} + +static uint32 readerHasher(const uint16* buf, sint32 size) { + uint32 r0 = 0, r1 = 0; + for (sint32 i = 0; i < size; i++) { + uint16 c = buf[i]; + r0 += c; + r1 ^= c; + } + return (r1 & 255) + ((r0 & 255) << 8); +} + +static bool asciizEqual(const UTF8* val, const char* asciiz, sint32 size) { + sint32 len = val->size; + if (len != size) return false; + else { + for (sint32 i = 0; i < len; i++) { + if (asciiz[i] != val->elements[i]) return false; + } + return true; + } +} + +static bool readerEqual(const UTF8* val, const uint16* buf, sint32 size) { + sint32 len = val->size; + if (len != size) return false; + else return !(memcmp(val->elements, buf, len * sizeof(uint16))); +} + +void UTF8Map::replace(const UTF8* oldUTF8, const UTF8* newUTF8) { + lock.lock(); + uint32 key = readerHasher(oldUTF8->elements, oldUTF8->size); + std::pair p = map.equal_range(key); + + for (UTF8Map::iterator i = p.first; i != p.second; i++) { + if (i->second == oldUTF8) { + map.erase(i); + break; + } + } + map.insert(std::make_pair(key, newUTF8)); + lock.unlock(); + +} + +const UTF8* UTF8Map::lookupOrCreateAsciiz(const char* asciiz) { + sint32 size = strlen(asciiz); + uint32 key = asciizHasher(asciiz, size); + const UTF8* res = 0; + lock.lock(); + + std::pair p = map.equal_range(key); + + for (UTF8Map::iterator i = p.first; i != p.second; i++) { + if (asciizEqual(i->second, asciiz, size)) { + res = i->second; + break; + } + } + + if (res == 0) { + UTF8* tmp = new(allocator, size) UTF8(size); + for (sint32 i = 0; i < size; i++) { + tmp->elements[i] = asciiz[i]; + } + res = (const UTF8*)tmp; + map.insert(std::make_pair(key, res)); + } + + lock.unlock(); + return res; +} + +const UTF8* UTF8Map::lookupOrCreateReader(const uint16* buf, uint32 len) { + sint32 size = (sint32)len; + uint32 key = readerHasher(buf, size); + const UTF8* res = 0; + lock.lock(); + + std::pair p = map.equal_range(key); + + for (UTF8Map::iterator i = p.first; i != p.second; i++) { + if (readerEqual(i->second, buf, size)) { + res = i->second; + break; + } + } + + if (res == 0) { + UTF8* tmp = new(allocator, size) UTF8(size); + memcpy(tmp->elements, buf, len * sizeof(uint16)); + res = (const UTF8*)tmp; + map.insert(std::make_pair(key, res)); + } + + lock.unlock(); + return res; +} + +const UTF8* UTF8Map::lookupAsciiz(const char* asciiz) { + sint32 size = strlen(asciiz); + uint32 key = asciizHasher(asciiz, size); + const UTF8* res = 0; + lock.lock(); + + std::pair p = map.equal_range(key); + + for (UTF8Map::iterator i = p.first; i != p.second; i++) { + if (asciizEqual(i->second, asciiz, size)) { + res = i->second; + break; + } + } + + lock.unlock(); + return res; +} + +const UTF8* UTF8Map::lookupReader(const uint16* buf, uint32 len) { + sint32 size = (sint32)len; + uint32 key = readerHasher(buf, size); + const UTF8* res = 0; + lock.lock(); + + std::pair p = map.equal_range(key); + + for (UTF8Map::iterator i = p.first; i != p.second; i++) { + if (readerEqual(i->second, buf, size)) { + res = i->second; + break; + } + } + + lock.unlock(); + return res; +} + +void UTF8Map::insert(const UTF8* val) { + map.insert(std::make_pair(readerHasher(val->elements, val->size), val)); +} From gael.thomas at lip6.fr Mon Oct 5 10:36:52 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 05 Oct 2009 17:36:52 -0000 Subject: [vmkit-commits] [vmkit] r83315 - in /vmkit/trunk: include/mvm/ lib/N3/Mono/ lib/N3/PNetLib/ lib/N3/VMCore/ Message-ID: <200910051736.n95HarJN002702@zion.cs.uiuc.edu> Author: gthomas Date: Mon Oct 5 12:36:51 2009 New Revision: 83315 URL: http://llvm.org/viewvc/llvm-project?rev=83315&view=rev Log: Unify VirtualMachine and N3 Factorize construction of UTF8 in UTF8.h/UTF8.cpp Use only N3 methods to build array of uint16, utf8 and strings Removed: vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp vmkit/trunk/lib/N3/VMCore/VirtualMachine.h Modified: vmkit/trunk/include/mvm/UTF8.h vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/LockedMap.cpp vmkit/trunk/lib/N3/VMCore/LockedMap.h vmkit/trunk/lib/N3/VMCore/MSCorlib.inc vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMArray.cpp vmkit/trunk/lib/N3/VMCore/VMArray.h vmkit/trunk/lib/N3/VMCore/VMCache.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMThread.cpp vmkit/trunk/lib/N3/VMCore/VMThread.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/mvm/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/UTF8.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/include/mvm/UTF8.h (original) +++ vmkit/trunk/include/mvm/UTF8.h Mon Oct 5 12:36:51 2009 @@ -90,6 +90,48 @@ void insert(const UTF8* val); }; +class UTF8Builder { + uint16 *buf; + uint32 cur; + uint32 size; + +public: + UTF8Builder(size_t size) { + size = (size < 4) ? 4 : size; + this->buf = new uint16[size]; + this->size = size; + } + + UTF8Builder *append(const UTF8 *utf8, uint32 start=0, uint32 length=0xffffffff) { + length = length == 0xffffffff ? utf8->size : length; + uint32 req = cur + length; + + if(req > size) { + uint32 newSize = size<<1; + while(req < newSize) + newSize <<= 1; + uint16 *newBuf = new uint16[newSize]; + memcpy(newBuf, buf, cur<<1); + delete []buf; + buf = newBuf; + size = newSize; + } + + memcpy(buf + cur, &utf8->elements + start, length<<1); + cur = req; + + return this; + } + + const UTF8 *toUTF8(UTF8Map *map) { + return map->lookupOrCreateReader(buf, size); + } + + ~UTF8Builder() { + delete [] buf; + } +}; + /// UTF8Buffer - Helper class to create char* buffers suitable for /// printf. /// Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Mon Oct 5 12:36:51 2009 @@ -110,9 +110,10 @@ *int_code_page |= 0x10000000; free (codepage); - if (want_name && *int_code_page == -1) - return (MonoString*)(((N3*)VMThread::get()->vm)->asciizToStr(cset)); - else + if (want_name && *int_code_page == -1) { + N3 *vm = (N3*)VMThread::get()->vm; + return (MonoString*)(vm->arrayToString(vm->asciizToArray(cset))); + } else return NULL; } @@ -157,10 +158,11 @@ extern "C" MonoString * System_Environment_get_NewLine (void) { + N3 *vm = (N3*)VMThread::get()->vm; #if defined (PLATFORM_WIN32) - return (MonoString*)((N3*)VMThread::get()->vm)->asciizToStr("\r\n"); + return (MonoString*)(vm->arrayToString(vm->asciizToArray("\r\n"))); #else - return (MonoString*)((N3*)VMThread::get()->vm)->asciizToStr("\n"); + return (MonoString*)(vm->arrayToString(vm->asciizToArray("\n"))); #endif } @@ -279,7 +281,7 @@ extern "C" void System_String__ctor(MonoString* str, ArrayUInt16* array, sint32 startIndex, sint32 count) { VirtualMachine* vm = VMThread::get()->vm; - const UTF8* utf8 = vm->readerConstructUTF8(&(array->elements[startIndex]), count); + const UTF8* utf8 = vm->bufToUTF8(&(array->elements[startIndex]), count); str->length = count; str->startChar = array->elements[startIndex]; str->value = utf8; @@ -331,8 +333,8 @@ } N3* vm = (N3*)VMThread::get()->vm; - const UTF8* utf8 = vm->readerConstructUTF8(dest, length); - return (MonoString*)vm->UTF8ToStr(utf8); + const ArrayUInt16* array = vm->bufToArray(dest, length); + return (MonoString*)vm->arrayToString(array); } extern "C" MonoString * Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Mon Oct 5 12:36:51 2009 @@ -21,8 +21,8 @@ void MSCorlib::loadStringClass(N3* vm) { VMClass* type = (VMClass*)vm->coreAssembly->loadTypeFromName( - vm->asciizConstructUTF8("String"), - vm->asciizConstructUTF8("System"), + vm->asciizToUTF8("String"), + vm->asciizToUTF8("System"), false, false, false, true); MSCorlib::pString = type; MSCorlib::pObject->resolveType(true, false, NULL); @@ -43,8 +43,8 @@ VMClass* realClrType = 0; #define INIT(var, nameSpace, name, type, prim) {\ var = (VMClass*)vm->coreAssembly->loadTypeFromName( \ - vm->asciizConstructUTF8(name), \ - vm->asciizConstructUTF8(nameSpace),\ + vm->asciizToUTF8(name), \ + vm->asciizToUTF8(nameSpace),\ false, false, false, true); \ var->isPrimitive = prim; \ if (type) { \ @@ -65,7 +65,7 @@ { MSCorlib::clrType->resolveType(false, false, NULL); - MSCorlib::typeClrType = realClrType->lookupField(vm->asciizConstructUTF8("_impl"), runtimeTypeHandle, false, false); + MSCorlib::typeClrType = realClrType->lookupField(vm->asciizToUTF8("_impl"), runtimeTypeHandle, false, false); } /* @@ -74,8 +74,8 @@ std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(MSCorlib::assemblyReflection); - MSCorlib::ctorAssemblyReflection = MSCorlib::assemblyReflection->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); - MSCorlib::assemblyAssemblyReflection = MSCorlib::assemblyReflection->lookupField(vm->asciizConstructUTF8("privateData"), MSCorlib::pIntPtr, false, false); + MSCorlib::ctorAssemblyReflection = MSCorlib::assemblyReflection->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); + MSCorlib::assemblyAssemblyReflection = MSCorlib::assemblyReflection->lookupField(vm->asciizToUTF8("privateData"), MSCorlib::pIntPtr, false, false); } { @@ -83,8 +83,8 @@ std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(MSCorlib::propertyType); - MSCorlib::ctorPropertyType = MSCorlib::propertyType->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); - MSCorlib::propertyPropertyType = MSCorlib::propertyType->lookupField(vm->asciizConstructUTF8("privateData"), MSCorlib::pIntPtr, false, false); + MSCorlib::ctorPropertyType = MSCorlib::propertyType->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); + MSCorlib::propertyPropertyType = MSCorlib::propertyType->lookupField(vm->asciizToUTF8("privateData"), MSCorlib::pIntPtr, false, false); } { @@ -92,8 +92,8 @@ std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(MSCorlib::methodType); - MSCorlib::ctorMethodType = MSCorlib::methodType->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); - MSCorlib::methodMethodType = MSCorlib::methodType->lookupField(vm->asciizConstructUTF8("privateData"), MSCorlib::pIntPtr, false, false); + MSCorlib::ctorMethodType = MSCorlib::methodType->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); + MSCorlib::methodMethodType = MSCorlib::methodType->lookupField(vm->asciizToUTF8("privateData"), MSCorlib::pIntPtr, false, false); } { @@ -104,13 +104,13 @@ args.push_back(MSCorlib::pIntPtr); args.push_back(MSCorlib::pSInt64); args.push_back(MSCorlib::pSInt64); - MSCorlib::ctorResourceStreamType = MSCorlib::resourceStreamType->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); + MSCorlib::ctorResourceStreamType = MSCorlib::resourceStreamType->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); } VMCommonClass* voidPtr = vm->coreAssembly->constructPointer(MSCorlib::pVoid, 1); #define INIT(var, cl, type) {\ cl->resolveType(false, false); \ - var = cl->lookupField(vm->asciizConstructUTF8("value_"), type, false, false); \ + var = cl->lookupField(vm->asciizToUTF8("value_"), type, false, false); \ } INIT(MSCorlib::ctorBoolean, MSCorlib::pBoolean, MSCorlib::pBoolean); @@ -164,8 +164,8 @@ void MSCorlib::loadBootstrap(N3* vm) { VMClass* cl = (VMClass*)vm->coreAssembly->loadTypeFromName( - vm->asciizConstructUTF8("Thread"), - vm->asciizConstructUTF8("System.Threading"), + vm->asciizToUTF8("Thread"), + vm->asciizToUTF8("System.Threading"), true, true, true, true); VMObject* th = (*cl)(); VMThread* myth = VMThread::get(); Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Mon Oct 5 12:36:51 2009 @@ -45,6 +45,7 @@ #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" +#include "CLIString.h" #include "PNetPath.inc" @@ -164,16 +165,16 @@ char* val = ILGetCultureName(); N3* vm = (N3*)(VMThread::get()->vm); if (val) { - VMObject* ret = vm->asciizToStr(val); + VMObject* ret = vm->arrayToString(vm->asciizToArray(val)); free(val); return ret; } else { - VMObject* ret = vm->asciizToStr("iv"); + VMObject* ret = vm->arrayToString(vm->asciizToArray("iv")); return ret; } } -static const UTF8* newBuilder(N3* vm, PNetString* value, uint32 length) { +static const ArrayUInt16* newBuilder(N3* vm, PNetString* value, uint32 length) { uint32 valueLength = value ? value->length : 0; const UTF8* utf8 = value ? value->value : 0; uint32 roundLength = (7 + length) & 0xfffffff8; @@ -190,20 +191,19 @@ } } - return vm->readerConstructUTF8(buf, strLength); - + return vm->bufToArray(buf, strLength); } extern "C" VMObject* System_String_NewBuilder(PNetString* value, uint32 length) { N3* vm = (N3*)(VMThread::get()->vm); - PNetString* str = (PNetString*)vm->UTF8ToStr(newBuilder(vm, value, length)); + PNetString* str = (PNetString*)vm->arrayToString(newBuilder(vm, value, length)); return str; } extern "C" VMObject* Platform_SysCharInfo_GetNewLine() { N3* vm = (N3*)(VMThread::get()->vm); - return vm->asciizToStr("\n"); + return vm->arrayToString(vm->asciizToArray("\n")); } extern "C" void System_String_CopyToChecked(PNetString* str, sint32 sstart, @@ -297,7 +297,7 @@ memcpy(buf, utf8Dest->elements, len1 * sizeof(uint16)); memcpy(buf + len1, utf8Dest->elements, len2 * sizeof(uint16)); - const UTF8* utf8 = VMThread::get()->vm->readerConstructUTF8(buf, + const UTF8* utf8 = VMThread::get()->vm->bufToUTF8(buf, len1 + len2); dest->value = utf8; dest->length = dest->value->size; @@ -375,7 +375,7 @@ } buf[index] = value; - PNetString* str = (PNetString*)vm->UTF8ToStr(vm->readerConstructUTF8(buf, length)); + PNetString* str = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length)); obj->buildString = str; return obj; @@ -407,7 +407,7 @@ (buildLength - index) * sizeof(uint16)); } - PNetString* val = (PNetString*)vm->UTF8ToStr(vm->readerConstructUTF8(buf, length)); + PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length)); obj->buildString = val; return obj; @@ -425,7 +425,7 @@ memcpy(buf, utf8->elements, length * sizeof(uint16)); buf[length] = value; - PNetString* val = (PNetString*)vm->UTF8ToStr(vm->readerConstructUTF8(buf, length + 1)); + PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length + 1)); obj->buildString = val; return obj; } @@ -446,7 +446,7 @@ memcpy(buf, buildUtf8->elements, buildLength * sizeof(uint16)); memcpy(&(buf[buildLength]), strUtf8->elements, strLength * sizeof(uint16)); - PNetString* val = (PNetString*)vm->UTF8ToStr(vm->readerConstructUTF8(buf, length)); + PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length)); obj->buildString = val; return obj; } @@ -522,7 +522,7 @@ memcpy(buf, u1->elements, len1 * sizeof(uint16)); memcpy(&(buf[len1]), u2->elements, len2 * sizeof(uint16)); - PNetString* val = (PNetString*)vm->UTF8ToStr(vm->readerConstructUTF8(buf, len1 + len2)); + PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, len1 + len2)); return val; } @@ -541,7 +541,7 @@ memcpy(&(buf[len1]), u2->elements, len2 * sizeof(uint16)); memcpy(&(buf[len1 + len2]), u3->elements, len3 * sizeof(uint16)); - PNetString* val = (PNetString*)vm->UTF8ToStr(vm->readerConstructUTF8(buf, len1 + len2 + len3)); + PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, len1 + len2 + len3)); return val; } @@ -570,7 +570,7 @@ memcpy(&(buf[j]), &(utf8->elements[index + length]), (strLength - (index + length)) * sizeof(uint16)); } - const UTF8* res = VMThread::get()->vm->readerConstructUTF8(buf, j); + const UTF8* res = VMThread::get()->vm->bufToUTF8(buf, j); str->value = res; str->length = j; } @@ -581,7 +581,7 @@ array->elements[i] = ch; } - const UTF8* utf8 = VMThread::get()->vm->readerConstructUTF8(array->elements, array->size); + const UTF8* utf8 = VMThread::get()->vm->bufToUTF8(array->elements, array->size); str->value = utf8; str->length = array->size; str->capacity = array->size; @@ -610,7 +610,7 @@ index[0] = 0; ++index; - VMCommonClass* cl = ass->loadTypeFromName(vm->asciizConstructUTF8(index), vm->asciizConstructUTF8(asciiz), true, true, true, onError); + VMCommonClass* cl = ass->loadTypeFromName(vm->asciizToUTF8(index), vm->asciizToUTF8(asciiz), true, true, true, onError); if (!cl) VMThread::get()->vm->error("implement me"); return cl->getClassDelegatee(); } @@ -679,8 +679,8 @@ char* asciiz = prop->name->UTF8ToAsciiz(); char* buf = (char*)alloca(strlen(asciiz) + 5); sprintf(buf, "get_%s", asciiz); - VirtualMachine* vm = VMThread::get()->vm; - VMMethod* meth = prop->type->lookupMethod(vm->asciizConstructUTF8(buf), prop->parameters, true, false); + N3* vm = VMThread::get()->vm; + VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false); assert(meth); return meth->getMethodDelegatee(); } @@ -880,7 +880,7 @@ uint32 manRows = manTable->rowsNumber; sint32 pos = -1; uint32 i = 0; - VirtualMachine* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->vm; while ((pos == -1) && (i < manRows)) { uint32 nameOffset = manTable->readIndexInRow(i + 1, CONSTANT_MANIFEST_RESOURCE_NAME, ass->bytes); @@ -912,12 +912,12 @@ uint16* buf = (uint16*)alloca(length * sizeof(uint16)); - VirtualMachine* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->vm; memcpy(buf, utf8->elements, length * sizeof(uint16)); ILUnicodeStringToLower((void*)buf, (void*)utf8->elements, length); - const UTF8* res = vm->readerConstructUTF8(buf, length); - return ((N3*)vm)->UTF8ToStr(res); + const ArrayUInt16* res = vm->bufToArray(buf, length); + return ((N3*)vm)->arrayToString(res); } extern "C" VMObject* System_String_Replace(PNetString* str, uint16 c1, uint16 c2) { @@ -932,8 +932,8 @@ } N3* vm = (N3*)VMThread::get()->vm; - const UTF8* res = vm->readerConstructUTF8(buf, length); - return vm->UTF8ToStr(res); + const ArrayUInt16* res = vm->bufToArray(buf, length); + return vm->arrayToString(res); } extern "C" uint32 System_Reflection_ClrResourceStream_ResourceRead(Assembly* assembly, uint64 position, ArrayUInt8* buffer, uint32 offset, uint32 count) { @@ -991,8 +991,8 @@ buf[i + start] = ch; } - VirtualMachine* vm = VMThread::get()->vm; - const UTF8* val = vm->readerConstructUTF8(buf, length); + N3* vm = VMThread::get()->vm; + const UTF8* val = vm->bufToUTF8(buf, length); str->value = val; str->length = length; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Mon Oct 5 12:36:51 2009 @@ -21,8 +21,8 @@ void MSCorlib::loadStringClass(N3* vm) { VMClass* type = (VMClass*)vm->coreAssembly->loadTypeFromName( - vm->asciizConstructUTF8("String"), - vm->asciizConstructUTF8("System"), + vm->asciizToUTF8("String"), + vm->asciizToUTF8("System"), false, false, false, true); MSCorlib::pString = type; MSCorlib::pObject->resolveType(true, false, NULL); @@ -40,8 +40,8 @@ void MSCorlib::initialise(N3* vm) { #define INIT(var, nameSpace, name, type, prim) {\ var = (VMClass*)vm->coreAssembly->loadTypeFromName( \ - vm->asciizConstructUTF8(name), \ - vm->asciizConstructUTF8(nameSpace),\ + vm->asciizToUTF8(name), \ + vm->asciizToUTF8(nameSpace),\ false, false, false, true); \ var->isPrimitive = prim; \ if (type) { \ @@ -63,8 +63,8 @@ std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(MSCorlib::clrType); - MSCorlib::ctorClrType = MSCorlib::clrType->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); - MSCorlib::typeClrType = MSCorlib::clrType->lookupField(vm->asciizConstructUTF8("privateData"), MSCorlib::pIntPtr, false, false); + MSCorlib::ctorClrType = MSCorlib::clrType->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); + MSCorlib::typeClrType = MSCorlib::clrType->lookupField(vm->asciizToUTF8("privateData"), MSCorlib::pIntPtr, false, false); } { @@ -72,8 +72,8 @@ std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(MSCorlib::assemblyReflection); - MSCorlib::ctorAssemblyReflection = MSCorlib::assemblyReflection->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); - MSCorlib::assemblyAssemblyReflection = MSCorlib::assemblyReflection->lookupField(vm->asciizConstructUTF8("privateData"), MSCorlib::pIntPtr, false, false); + MSCorlib::ctorAssemblyReflection = MSCorlib::assemblyReflection->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); + MSCorlib::assemblyAssemblyReflection = MSCorlib::assemblyReflection->lookupField(vm->asciizToUTF8("privateData"), MSCorlib::pIntPtr, false, false); } { @@ -81,8 +81,8 @@ std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(MSCorlib::propertyType); - MSCorlib::ctorPropertyType = MSCorlib::propertyType->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); - MSCorlib::propertyPropertyType = MSCorlib::propertyType->lookupField(vm->asciizConstructUTF8("privateData"), MSCorlib::pIntPtr, false, false); + MSCorlib::ctorPropertyType = MSCorlib::propertyType->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); + MSCorlib::propertyPropertyType = MSCorlib::propertyType->lookupField(vm->asciizToUTF8("privateData"), MSCorlib::pIntPtr, false, false); } { @@ -90,8 +90,8 @@ std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(MSCorlib::methodType); - MSCorlib::ctorMethodType = MSCorlib::methodType->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); - MSCorlib::methodMethodType = MSCorlib::methodType->lookupField(vm->asciizConstructUTF8("privateData"), MSCorlib::pIntPtr, false, false); + MSCorlib::ctorMethodType = MSCorlib::methodType->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); + MSCorlib::methodMethodType = MSCorlib::methodType->lookupField(vm->asciizToUTF8("privateData"), MSCorlib::pIntPtr, false, false); } { @@ -102,13 +102,13 @@ args.push_back(MSCorlib::pIntPtr); args.push_back(MSCorlib::pSInt64); args.push_back(MSCorlib::pSInt64); - MSCorlib::ctorResourceStreamType = MSCorlib::resourceStreamType->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, false, false); + MSCorlib::ctorResourceStreamType = MSCorlib::resourceStreamType->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); } VMCommonClass* voidPtr = vm->coreAssembly->constructPointer(MSCorlib::pVoid, 1); #define INIT(var, cl, type) {\ cl->resolveType(false, false, NULL); \ - var = cl->lookupField(vm->asciizConstructUTF8("value_"), type, false, false); \ + var = cl->lookupField(vm->asciizToUTF8("value_"), type, false, false); \ } INIT(MSCorlib::ctorBoolean, MSCorlib::pBoolean, MSCorlib::pBoolean); @@ -169,15 +169,15 @@ static void mapInitialThread(N3* vm) { VMClass* cl = (VMClass*)vm->coreAssembly->loadTypeFromName( - vm->asciizConstructUTF8("Thread"), - vm->asciizConstructUTF8("System.Threading"), + vm->asciizToUTF8("Thread"), + vm->asciizToUTF8("System.Threading"), true, true, true, true); VMObject* th = (*cl)(); std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(cl); args.push_back(MSCorlib::pIntPtr); - VMMethod* meth = cl->lookupMethod(vm->asciizConstructUTF8(".ctor"), args, + VMMethod* meth = cl->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); VMThread* myth = VMThread::get(); (*meth)(th, myth); Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.cpp Mon Oct 5 12:36:51 2009 @@ -37,18 +37,18 @@ return obj; } -char* CLIString::strToAsciiz() { - return ((PNetString*)this)->value->UTF8ToAsciiz(); +const UTF8* CLIString::strToUTF8(N3* vm) { + return (UTF8*)((PNetString*)this)->value; } -const UTF8* CLIString::strToUTF8(N3* vm) { - return ((PNetString*)this)->value; +ArrayUInt16* CLIString::strToArray(N3* vm) const { + return (ArrayUInt16*)((PNetString*)this)->value; } GlobalVariable* CLIString::llvmVar() { PNetString* str = (PNetString*)this; if (!str->_llvmVar) { - VirtualMachine* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->vm; if (!str->_llvmVar) { const Type* pty = mvm::MvmModule::ptrType; Constant* cons = Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Mon Oct 5 12:36:51 2009 @@ -18,7 +18,6 @@ #include "MSCorlib.h" #include "N3.h" #include "Reader.h" -#include "VirtualMachine.h" #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" @@ -702,13 +701,13 @@ } } -const UTF8* Assembly::readUTF16(VirtualMachine* vm, uint32 len, +const ArrayUInt16* Assembly::readUTF16(N3* vm, uint32 len, Reader* reader) { return readUTF16(vm, len, reader->bytes, reader->cursor); } -const UTF8* Assembly::readUTF16(VirtualMachine* vm, uint32 len, - ArrayUInt8* bytes, uint32 &offset) { +const ArrayUInt16* Assembly::readUTF16(N3* vm, uint32 len, + ArrayUInt8* bytes, uint32 &offset) { uint32 realLen = len >> 1; uint16* buf = (uint16*)alloca(len); uint32 i = 0; @@ -717,16 +716,14 @@ buf[i] = cur; ++i; } - const UTF8* utf8 = UTF8::readerConstruct(vm, buf, realLen); - - return utf8; + return vm->bufToArray(buf, realLen); } -const UTF8* Assembly::readUTF8(VirtualMachine* vm, uint32 len, Reader* reader) { +const UTF8* Assembly::readUTF8(N3* vm, uint32 len, Reader* reader) { return readUTF8(vm, len, reader->bytes, reader->cursor); } -const UTF8* Assembly::readUTF8(VirtualMachine* vm, uint32 len, +const UTF8* Assembly::readUTF8(N3* vm, uint32 len, ArrayUInt8* bytes, uint32 &offset) { uint16* buf = (uint16*)alloca(len * sizeof(uint16)); uint32 n = 0; @@ -759,7 +756,7 @@ return utf8; } -const UTF8* Assembly::readString(VirtualMachine* vm, uint32 offset) { +const UTF8* Assembly::readString(N3* vm, uint32 offset) { uint32 end = offset; uint32 cur = 0; while ((cur = READ_U1(bytes, end)) != 0) {} @@ -1840,7 +1837,7 @@ return NULL; } -const UTF8* Assembly::readUserString(uint32 token) { +const ArrayUInt16* Assembly::readUserString(uint32 token) { uint32 offset = CLIHeader->usStream->realOffset + token; uint8 size = READ_U1(bytes, offset); @@ -1855,8 +1852,7 @@ } } - const UTF8* res = readUTF16((N3*)(VMThread::get()->vm), size, bytes, offset); - return res; + return readUTF16((N3*)(VMThread::get()->vm), size, bytes, offset); } uint32 Assembly::getRVAFromField(uint32 token) { Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Mon Oct 5 12:36:51 2009 @@ -28,6 +28,7 @@ namespace n3 { +class ArrayUInt16; class ArrayUInt8; class ArrayObject; class Assembly; @@ -40,7 +41,6 @@ class Property; class Reader; class UTF8; -class VirtualMachine; class VMClass; class VMGenericClass; class VMClassArray; @@ -187,13 +187,13 @@ Assembly(mvm::BumpPtrAllocator &Alloc, const UTF8* name); - static const UTF8* readUTF8(VirtualMachine* vm, uint32 len, Reader* reader); - static const UTF8* readUTF16(VirtualMachine* vm, uint32 len, Reader* reader); - static const UTF8* readUTF8(VirtualMachine* vm, uint32 len, ArrayUInt8* bytes, + static const UTF8* readUTF8(N3* vm, uint32 len, Reader* reader); + static const UTF8* readUTF8(N3* vm, uint32 len, ArrayUInt8* bytes, uint32& offset); - static const UTF8* readUTF16(VirtualMachine* vm, uint32 len, - ArrayUInt8* bytes, uint32& offset); - const UTF8* readString(VirtualMachine* vm, uint32 offset); + static const ArrayUInt16* readUTF16(N3* vm, uint32 len, Reader* reader); + static const ArrayUInt16* readUTF16(N3* vm, uint32 len, + ArrayUInt8* bytes, uint32& offset); + const UTF8* readString(N3* vm, uint32 offset); void read(); void readTables(Reader* reader); @@ -253,7 +253,7 @@ uint32 getTypedefTokenFromMethod(uint32 token); VMMethod* readMemberRefAsMethod(uint32 token, std::vector* genArgs, VMGenericClass* genClass, VMGenericMethod* genMethod); - const UTF8* readUserString(uint32 token); + const ArrayUInt16* readUserString(uint32 token); uint32 getExplicitLayout(uint32 token); uint32 getRVAFromField(uint32 token); Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Mon Oct 5 12:36:51 2009 @@ -25,7 +25,6 @@ #include "N3.h" #include "N3ModuleProvider.h" #include "Reader.h" -#include "VirtualMachine.h" #include "VMArray.h" #include "VMCache.h" #include "VMClass.h" @@ -478,12 +477,12 @@ if (meth->classDef->isArray) { uint8 func = 0; - VirtualMachine* vm = VMThread::get()->vm; - if (meth->name == vm->asciizConstructUTF8("Set")) { + N3* vm = VMThread::get()->vm; + if (meth->name == vm->asciizToUTF8("Set")) { func = 0; - } else if (meth->name == vm->asciizConstructUTF8("Get")) { + } else if (meth->name == vm->asciizToUTF8("Get")) { func = 1; - } else if (meth->name == vm->asciizConstructUTF8("Address")) { + } else if (meth->name == vm->asciizToUTF8("Address")) { func = 2; } else { vm->error("implement me %s", meth->name->printString()); Modified: vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp Mon Oct 5 12:36:51 2009 @@ -19,7 +19,7 @@ #include "CLIAccess.h" #include "CLIJit.h" #include "CLIString.h" -#include "VirtualMachine.h" +#include "N3.h" #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Mon Oct 5 12:36:51 2009 @@ -53,10 +53,9 @@ assert(0 && "implement index out of bounds exception"); } -extern "C" VMObject* newString(const UTF8* utf8) { - CLIString * str = - (CLIString*)(((N3*)VMThread::get()->vm)->UTF8ToStr(utf8)); - return str; +extern "C" VMObject* newString(const ArrayUInt16* utf8) { + N3 *vm = (N3*)VMThread::get()->vm; + return vm->arrayToString(utf8); } extern "C" bool n3InstanceOf(VMObject* obj, VMCommonClass* cl) { @@ -147,7 +146,7 @@ strlen(nameAsciiz) + strlen(nameSpaceAsciiz)); sprintf(buf, "%s.%s.%s", nameSpaceAsciiz, nameAsciiz, methAsciiz); - const UTF8* newName = VMThread::get()->vm->asciizConstructUTF8(buf); + const UTF8* newName = VMThread::get()->vm->asciizToUTF8(buf); dmeth = ocl->lookupMethod(newName, orig->parameters, false, true); } Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Mon Oct 5 12:36:51 2009 @@ -21,6 +21,7 @@ class UTF8; class N3; +class ArrayUInt16; class CLIString : public VMObject { public: @@ -34,9 +35,8 @@ static CLIString* stringDup(const UTF8*& utf8, N3* vm); - char* strToAsciiz(); - const UTF8* strToUTF8(N3* vm); - + const UTF8* strToUTF8(N3* vm); + ArrayUInt16 *strToArray(N3 *vm) const; }; } // end namespace jnjvm Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.cpp Mon Oct 5 12:36:51 2009 @@ -19,97 +19,3 @@ #include using namespace n3; - - -static uint32 asciizHasher(const char* asciiz, sint32 size) { - uint32 r0 = 0, r1 = 0; - for (sint32 i = 0; i < size; i++) { - char c = asciiz[i]; - r0 += c; - r1 ^= c; - } - return (r1 & 255) + ((r0 & 255) << 8); -} - -static uint32 readerHasher(const uint16* buf, sint32 size) { - uint32 r0 = 0, r1 = 0; - for (sint32 i = 0; i < size; i++) { - uint16 c = buf[i]; - r0 += c; - r1 ^= c; - } - return (r1 & 255) + ((r0 & 255) << 8); -} - -static bool asciizEqual(const UTF8* val, const char* asciiz, sint32 size) { - sint32 len = val->size; - if (len != size) return false; - else { - for (sint32 i = 0; i < len; i++) { - if (asciiz[i] != val->at(i)) return false; - } - return true; - } -} - -static bool readerEqual(const UTF8* val, const uint16* buf, sint32 size) { - sint32 len = val->size; - if (len != size) return false; - else return !(memcmp(val->elements, buf, len * sizeof(uint16))); -} - - -const UTF8* UTF8Map::lookupOrCreateAsciiz(const char* asciiz) { - sint32 size = strlen(asciiz); - uint32 key = asciizHasher(asciiz, size); - const UTF8* res = 0; - lock->lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (asciizEqual(i->second, asciiz, size)) { - res = i->second; - break; - } - } - - if (res == 0) { - UTF8* tmp = (UTF8 *)UTF8::acons(size, MSCorlib::arrayChar); - for (sint32 i = 0; i < size; i++) { - tmp->setAt(i, asciiz[i]); - } - res = (const UTF8*)tmp; - map.insert(std::make_pair(key, res)); - } - - lock->unlock(); - return res; -} - -const UTF8* UTF8Map::lookupOrCreateReader(const uint16* buf, uint32 len) { - sint32 size = (sint32)len; - uint32 key = readerHasher(buf, size); - const UTF8* res = 0; - lock->lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (readerEqual(i->second, buf, size)) { - res = i->second; - break; - } - } - - if (res == 0) { - UTF8* tmp = UTF8::acons(size, MSCorlib::arrayChar); - memcpy(tmp->elements, buf, len * sizeof(uint16)); - res = (const UTF8*)tmp; - map.insert(std::make_pair(key, res)); - } - - lock->unlock(); - return res; -} - Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.h Mon Oct 5 12:36:51 2009 @@ -24,6 +24,8 @@ #include "CLIString.h" #include "VMArray.h" +#include "UTF8.h" + namespace n3 { class Assembly; @@ -158,35 +160,6 @@ FunctionMap() : LockedMap, N3 >(new mvm::LockNormal()) {} }; - - -class UTF8Map : public mvm::PermanentObject { -public: - typedef std::multimap::iterator iterator; - - mvm::Lock* lock; - std::multimap, - gc_allocator > > map; - - const UTF8* lookupOrCreateAsciiz(const char* asciiz); - const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); - - UTF8Map() { - lock = new mvm::LockNormal(); - } - - virtual void TRACER { - //lock->MARK_AND_TRACE; - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->MARK_AND_TRACE; - } - } - - virtual void print(mvm::PrintBuffer* buf) const { - buf->write("UTF8 Hashtable<>"); - } -}; - } // end namespace n3 #endif Modified: vmkit/trunk/lib/N3/VMCore/MSCorlib.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/MSCorlib.inc?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/MSCorlib.inc (original) +++ vmkit/trunk/lib/N3/VMCore/MSCorlib.inc Mon Oct 5 12:36:51 2009 @@ -86,7 +86,7 @@ // The caller of the CLI function; cur = (void**)cur[0]; - VirtualMachine* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->vm; VMMethod* meth = vm->IPToMethod(FRAME_IP(cur)); @@ -105,7 +105,7 @@ // The CLI function. cur = (void**)cur[0]; - VirtualMachine* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->vm; VMMethod* meth = vm->IPToMethod(FRAME_IP(cur)); Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Mon Oct 5 12:36:51 2009 @@ -8,42 +8,184 @@ //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" +#include +#include + +#include "llvm/Function.h" #include "llvm/Module.h" +#include "llvm/LLVMContext.h" #include "llvm/Support/CommandLine.h" +#include "mvm/Object.h" +#include "mvm/PrintBuffer.h" +#include "mvm/Threads/Cond.h" +#include "mvm/Threads/Locks.h" #include "mvm/JIT.h" #include "types.h" + #include "Assembly.h" -#include "CLIJit.h" -#include "CLIString.h" #include "LinkN3Runtime.h" #include "LockedMap.h" #include "MSCorlib.h" #include "N3.h" #include "N3ModuleProvider.h" #include "Reader.h" -#include "VirtualMachine.h" +#include "VMArray.h" #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" +#include "CLIJit.h" +#include "CLIString.h" + using namespace n3; -void N3::print(mvm::PrintBuffer* buf) const { - buf->write("N3 virtual machine<>"); +#define DECLARE_EXCEPTION(EXCP) \ + const char* N3::EXCP = #EXCP + +DECLARE_EXCEPTION(SystemException); +DECLARE_EXCEPTION(OverFlowException); +DECLARE_EXCEPTION(OutOfMemoryException); +DECLARE_EXCEPTION(IndexOutOfRangeException); +DECLARE_EXCEPTION(NullReferenceException); +DECLARE_EXCEPTION(SynchronizationLocException); +DECLARE_EXCEPTION(ThreadInterruptedException); +DECLARE_EXCEPTION(MissingMethodException); +DECLARE_EXCEPTION(MissingFieldException); +DECLARE_EXCEPTION(ArrayTypeMismatchException); +DECLARE_EXCEPTION(ArgumentException); + +/* +DECLARE_EXCEPTION(ArithmeticException); +DECLARE_EXCEPTION(InvocationTargetException); +DECLARE_EXCEPTION(ArrayStoreException); +DECLARE_EXCEPTION(ClassCastException); +DECLARE_EXCEPTION(ArrayIndexOutOfBoundsException); +DECLARE_EXCEPTION(SecurityException); +DECLARE_EXCEPTION(ClassFormatError); +DECLARE_EXCEPTION(ClassCircularityError); +DECLARE_EXCEPTION(NoClassDefFoundError); +DECLARE_EXCEPTION(UnsupportedClassVersionError); +DECLARE_EXCEPTION(NoSuchFieldError); +DECLARE_EXCEPTION(NoSuchMethodError); +DECLARE_EXCEPTION(InstantiationError); +DECLARE_EXCEPTION(IllegalAccessError); +DECLARE_EXCEPTION(IllegalAccessException); +DECLARE_EXCEPTION(VerifyError); +DECLARE_EXCEPTION(ExceptionInInitializerError); +DECLARE_EXCEPTION(LinkageError); +DECLARE_EXCEPTION(AbstractMethodError); +DECLARE_EXCEPTION(UnsatisfiedLinkError); +DECLARE_EXCEPTION(InternalError); +DECLARE_EXCEPTION(StackOverflowError); +DECLARE_EXCEPTION(ClassNotFoundException); +*/ + +#undef DECLARE_EXCEPTION + +void ThreadSystem::print(mvm::PrintBuffer* buf) const { + buf->write("ThreadSystem<>"); +} + +ThreadSystem* ThreadSystem::allocateThreadSystem() { + ThreadSystem* res = gc_new(ThreadSystem)(); + res->nonDaemonThreads = 1; + res->nonDaemonLock = new mvm::LockNormal(); + res->nonDaemonVar = new mvm::Cond(); + return res; } -VMObject* N3::asciizToStr(const char* asciiz) { - const UTF8* var = asciizConstructUTF8(asciiz); - return UTF8ToStr(var); +N3::N3(mvm::BumpPtrAllocator &allocator, const char *name) : mvm::VirtualMachine(allocator) { + this->module = 0; + this->TheModuleProvider = 0; + this->name = name; + + this->scanner = new mvm::UnpreciseStackScanner(); + this->LLVMModule = new llvm::Module(name, llvm::getGlobalContext()); + this->module = new mvm::MvmModule(this->LLVMModule); + + this->LLVMModule->setDataLayout(mvm::MvmModule::executionEngine->getTargetData()->getStringRepresentation()); + this->protectModule = new mvm::LockNormal(); + + this->functions = new(allocator, "FunctionMap") FunctionMap(); + this->hashStr = new(allocator, "StringMap") StringMap(); + this->loadedAssemblies = new(allocator, "AssemblyMap") AssemblyMap(); + + this->TheModuleProvider = new N3ModuleProvider(this->LLVMModule, this->functions); } -VMObject* N3::UTF8ToStr(const UTF8* utf8) { - VMObject* res = CLIString::stringDup(utf8, this); - //VMObject* res = hashStr->lookupOrCreate(utf8, this, CLIString::stringDup); - return res; +N3::~N3() { + delete module; + delete TheModuleProvider; +} + +void N3::error(const char* className, const char* fmt, va_list ap) { + fprintf(stderr, "Internal exception of type %s during bootstrap: ", className); + vfprintf(stderr, fmt, ap); + throw 1; +} + +void N3::indexOutOfBounds(const VMObject* obj, sint32 entry) { + error(IndexOutOfRangeException, "%d", entry); +} + +void N3::negativeArraySizeException(sint32 size) { + error(OverFlowException, "%d", size); +} + +void N3::nullPointerException(const char* fmt, ...) { + va_list ap; + va_start(ap, fmt); + error(NullReferenceException, fmt, va_arg(ap, char*)); +} + + +void N3::illegalMonitorStateException(const VMObject* obj) { + error(SynchronizationLocException, ""); +} + +void N3::interruptedException(const VMObject* obj) { + error(ThreadInterruptedException, ""); +} + +void N3::outOfMemoryError(sint32 n) { + error(OutOfMemoryException, ""); +} + +void N3::arrayStoreException() { + error(ArrayTypeMismatchException, ""); +} + +void N3::illegalArgumentException(const char* name) { + error(ArgumentException, name); +} + +void N3::unknownError(const char* fmt, ...) { + va_list ap; + va_start(ap, fmt); + error(SystemException, fmt, ap); +} + +void N3::error(const char* fmt, ...) { + va_list ap; + va_start(ap, fmt); + error(SystemException, fmt, ap); +} + +void N3::error(const char* name, const char* fmt, ...) { + va_list ap; + va_start(ap, fmt); + error(name, fmt, ap); +} + + + + +using namespace n3; + +void N3::print(mvm::PrintBuffer* buf) const { + buf->write("N3 virtual machine<>"); } static Assembly* assemblyDup(const UTF8*& name, N3* vm) { @@ -59,23 +201,11 @@ return loadedAssemblies->lookup(name); } -N3::N3(mvm::BumpPtrAllocator &allocator, const char *name) : VirtualMachine(allocator) { - this->name = name; - - this->scanner = new mvm::UnpreciseStackScanner(); - this->LLVMModule = new llvm::Module(name, llvm::getGlobalContext()); - this->module = new mvm::MvmModule(this->LLVMModule); - - this->LLVMModule->setDataLayout(mvm::MvmModule::executionEngine->getTargetData()->getStringRepresentation()); - this->protectModule = new mvm::LockNormal(); - - this->functions = new(allocator, "FunctionMap") FunctionMap(); - this->hashStr = new(allocator, "StringMap") StringMap(); - this->loadedAssemblies = new(allocator, "AssemblyMap") AssemblyMap(); - - this->TheModuleProvider = new N3ModuleProvider(this->LLVMModule, this->functions); +VMMethod* N3::lookupFunction(Function* F) { + return functions->lookup(F); } + N3* N3::allocateBootstrap() { mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); N3 *vm= new(*a, "VM") N3(*a, "bootstrapN3"); @@ -190,7 +320,7 @@ } void N3::executeAssembly(const char* _name, ArrayObject* args) { - const UTF8* name = asciizConstructUTF8(_name); + const UTF8* name = asciizToUTF8(_name); Assembly* assembly = loadAssembly(name, 0); if (assembly == 0) { error("Can not find assembly %s", _name); @@ -233,7 +363,7 @@ ClArgumentsInfo& info = vm->argumentsInfo; ArrayObject* args = ArrayObject::acons(info.argc - 2, MSCorlib::arrayString); for (int i = 2; i < info.argc; ++i) { - args->setAt(i - 2, (VMObject*)vm->asciizToStr(info.argv[i])); + args->setAt(i - 2, (VMObject*)vm->arrayToString(vm->asciizToArray(info.argv[i]))); } try{ @@ -250,4 +380,41 @@ vm->threadSystem->nonDaemonLock->unlock(); } + + +ArrayUInt16* N3::asciizToArray(const char* asciiz) { + uint32 len = strlen(asciiz); + ArrayUInt16 *res = (ArrayUInt16*)MSCorlib::arrayChar->doNew(len); + for(uint32 i=0; ielements[i] = asciiz[i]; + return res; +} + +ArrayUInt16* N3::bufToArray(const uint16* buf, uint32 size) { + ArrayUInt16 *res = (ArrayUInt16*)MSCorlib::arrayChar->doNew(size); + memcpy(res->elements, buf, size<<1); + return res; +} + +ArrayUInt16* N3::UTF8ToArray(const UTF8 *utf8) { + return bufToArray(utf8->elements, utf8->size); +} + +const UTF8* N3::asciizToUTF8(const char* asciiz) { + return hashUTF8->lookupOrCreateAsciiz(asciiz); +} + +const UTF8* N3::bufToUTF8(const uint16* buf, uint32 len) { + return hashUTF8->lookupOrCreateReader(buf, len); +} + +const UTF8* N3::arrayToUTF8(const ArrayUInt16 *array) { + return bufToUTF8(array->elements, array->size); +} + +CLIString *N3::arrayToString(const ArrayUInt16 *array) { + const UTF8 *utf8 = arrayToUTF8(array); + return (CLIString*)CLIString::stringDup(utf8, this); +} + #include "MSCorlib.inc" Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Mon Oct 5 12:36:51 2009 @@ -13,7 +13,17 @@ #include "types.h" -#include "VirtualMachine.h" +#include + +#include "llvm/Function.h" + +#include "mvm/JIT.h" +#include "mvm/Object.h" +#include "mvm/PrintBuffer.h" +#include "mvm/Threads/Cond.h" +#include "mvm/Threads/Locks.h" + +#include "types.h" namespace n3 { @@ -21,7 +31,6 @@ class ArrayUInt8; class Assembly; class AssemblyMap; -class FunctionMap; class N3; class N3ModuleProvider; class StringMap; @@ -32,6 +41,28 @@ class VMCommonClass; class VMField; class VMMethod; +class FunctionMap; +class N3ModuleProvider; +class UTF8; +class UTF8Map; +class VMMethod; +class VMObject; +class VMThread; +class ArrayUInt16; +class CLIString; + +class ThreadSystem : public mvm::Object { +public: + static VirtualTable* VT; + uint16 nonDaemonThreads; + mvm::Lock* nonDaemonLock; + mvm::Cond* nonDaemonVar; + + virtual void print(mvm::PrintBuffer* buf) const; + virtual void TRACER; + + static ThreadSystem* allocateThreadSystem(); +}; class ClArgumentsInfo { public: @@ -48,40 +79,86 @@ }; -class N3 : public VirtualMachine { +class N3 : public mvm::VirtualMachine { public: + // instance fields + const char* name; + + ClArgumentsInfo argumentsInfo; + AssemblyMap* loadedAssemblies; + std::vector assemblyPath; + Assembly* coreAssembly; + + ThreadSystem* threadSystem; + VMThread* bootstrapThread; + + StringMap* hashStr; + UTF8Map* hashUTF8; + + mvm::Lock* protectModule; + FunctionMap* functions; + + mvm::MvmModule* module; + llvm::Module* LLVMModule; + N3ModuleProvider* TheModuleProvider; + + // constructors / destructors + N3(mvm::BumpPtrAllocator &allocator, const char *name); + ~N3(); + + // virtual methods virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; + virtual void runApplication(int argc, char** argv); + virtual void compile(const char* name); + virtual void waitForExit(); + + // non virtual methods + ArrayUInt8* openAssembly(const UTF8* name, const char* extension); + Assembly* loadAssembly(const UTF8* name, const char* extension); + void executeAssembly(const char* name, ArrayObject* args); + void runMain(int argc, char** argv); + + VMMethod* lookupFunction(llvm::Function* F); + + llvm::Module* getLLVMModule() { return LLVMModule; } + - VMObject* asciizToStr(const char* asciiz); - VMObject* UTF8ToStr(const UTF8* utf8); Assembly* constructAssembly(const UTF8* name); Assembly* lookupAssembly(const UTF8* name); - - ClArgumentsInfo argumentsInfo; - const char* name; - StringMap * hashStr; - AssemblyMap* loadedAssemblies; - std::vector assemblyPath; - Assembly* coreAssembly; -private: - N3(mvm::BumpPtrAllocator &allocator, const char *name); + // usefull string, uint16 and utf8 functions -public: + ArrayUInt16* asciizToArray(const char *asciiz); // done + ArrayUInt16* bufToArray(const uint16 *buf, uint32 len); // done + ArrayUInt16* UTF8ToArray(const UTF8 *utf8); // done + const UTF8* asciizToUTF8(const char *asciiz); // done + const UTF8* bufToUTF8(const uint16 *buf, uint32 len); // done + const UTF8* arrayToUTF8(const ArrayUInt16 *array); // done + CLIString* arrayToString(const ArrayUInt16 *array); + + /* + void illegalAccessException(const char* msg); + void initializerError(const VMObject* excp); + void invocationTargetException(const VMObject* obj); + void classCastException(const char* msg); + void errorWithExcp(const char* className, const VMObject* excp);*/ + void illegalArgumentException(const char* msg); + void arrayStoreException(); + void illegalMonitorStateException(const VMObject* obj); + void interruptedException(const VMObject* obj); + void nullPointerException(const char* fmt, ...); + void outOfMemoryError(sint32 n); + void indexOutOfBounds(const VMObject* obj, sint32 entry); + void negativeArraySizeException(int size); + void unknownError(const char* fmt, ...); + + void error(const char* fmt, ...); + void error(const char* className, const char* fmt, ...); + void error(const char* className, const char* fmt, va_list ap); - static N3* allocateBootstrap(); - static N3* allocate(const char* name, N3* parent); - - ArrayUInt8* openAssembly(const UTF8* name, const char* extension); - - Assembly* loadAssembly(const UTF8* name, const char* extension); - void executeAssembly(const char* name, ArrayObject* args); - void runMain(int argc, char** argv); - virtual void waitForExit(); - static void mainCLIStart(VMThread* th); - - static N3* bootstrapVM; + // static fields + static N3* bootstrapVM; static const UTF8* clinitName; static const UTF8* ctorName; @@ -100,7 +177,48 @@ static const UTF8* floatName; static const UTF8* doubleName; static const UTF8* testInfinity; - + + // Exceptions name + static const char* SystemException; + static const char* OverFlowException; + static const char* OutOfMemoryException; + static const char* IndexOutOfRangeException; + static const char* SynchronizationLocException; + static const char* NullReferenceException; + static const char* ThreadInterruptedException; + static const char* MissingMethodException; + static const char* MissingFieldException; + static const char* ArrayTypeMismatchException; + static const char* ArgumentException; + /*static const char* ArithmeticException; + static const char* ClassNotFoundException; + static const char* InvocationTargetException; + static const char* ClassCastException; + static const char* ArrayIndexOutOfBoundsException; + static const char* SecurityException; + static const char* ClassFormatError; + static const char* ClassCircularityError; + static const char* NoClassDefFoundError; + static const char* UnsupportedClassVersionError; + static const char* NoSuchFieldError; + static const char* NoSuchMethodError; + static const char* InstantiationError; + static const char* IllegalAccessError; + static const char* IllegalAccessException; + static const char* VerifyError; + static const char* ExceptionInInitializerError; + static const char* LinkageError; + static const char* AbstractMethodError; + static const char* UnsatisfiedLinkError; + static const char* InternalError; + static const char* StackOverflowError; + */ + // Exceptions + + // static methods + static N3* allocateBootstrap(); + static N3* allocate(const char* name, N3* parent); + static void mainCLIStart(VMThread* th); }; } // end namespace n3 Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Mon Oct 5 12:36:51 2009 @@ -23,7 +23,6 @@ #include "N3.h" #include "N3ModuleProvider.h" #include "Reader.h" -#include "VirtualMachine.h" #include "VMArray.h" #include "VMCache.h" #include "VMClass.h" @@ -220,7 +219,7 @@ vm->assemblyPath.push_back(""); vm->assemblyPath.push_back(MSCorlib::libsPath); - const UTF8* mscorlib = vm->asciizConstructUTF8("mscorlib"); + const UTF8* mscorlib = vm->asciizToUTF8("mscorlib"); Assembly* ass = vm->loadAssembly(mscorlib, "dll"); if (ass == 0) VMThread::get()->vm->error("can not load mscorlib.dll. Abort"); @@ -228,8 +227,8 @@ vm->coreAssembly = ass; // Array initialization - const UTF8* System = vm->asciizConstructUTF8("System"); - const UTF8* utf8OfChar = vm->asciizConstructUTF8("Char"); + const UTF8* System = vm->asciizToUTF8("System"); + const UTF8* utf8OfChar = vm->asciizToUTF8("Char"); MSCorlib::arrayChar = ass->constructArray(utf8OfChar, System, 1); ((UTF8*)System)->classOf = MSCorlib::arrayChar; @@ -238,8 +237,8 @@ #define INIT(var, nameSpace, name, type, prim) {\ var = (VMClass*)vm->coreAssembly->loadTypeFromName( \ - vm->asciizConstructUTF8(name), \ - vm->asciizConstructUTF8(nameSpace),\ + vm->asciizToUTF8(name), \ + vm->asciizToUTF8(nameSpace),\ false, false, false, true); \ var->isPrimitive = prim; \ if (type) { \ @@ -275,41 +274,43 @@ MSCorlib::arrayChar->baseClass = MSCorlib::pChar; VMClassArray::SuperArray = MSCorlib::pArray; MSCorlib::arrayChar->super = MSCorlib::pArray; - + MSCorlib::loadStringClass(vm); - MSCorlib::arrayString = ass->constructArray(vm->asciizConstructUTF8("String"), + MSCorlib::arrayString = ass->constructArray(vm->asciizToUTF8("String"), System, 1); MSCorlib::arrayString->baseClass = MSCorlib::pString; - MSCorlib::arrayByte = ass->constructArray(vm->asciizConstructUTF8("Byte"), + MSCorlib::arrayByte = ass->constructArray(vm->asciizToUTF8("Byte"), System, 1); MSCorlib::arrayByte->baseClass = MSCorlib::pUInt8; - MSCorlib::arrayObject = ass->constructArray(vm->asciizConstructUTF8("Object"), + MSCorlib::arrayObject = ass->constructArray(vm->asciizToUTF8("Object"), System, 1); MSCorlib::arrayObject->baseClass = MSCorlib::pObject; - N3::clinitName = vm->asciizConstructUTF8(".cctor"); - N3::ctorName = vm->asciizConstructUTF8(".ctor"); - N3::invokeName = vm->asciizConstructUTF8("Invoke"); - N3::math = vm->asciizConstructUTF8("Math"); - N3::system = vm->asciizConstructUTF8("System"); - N3::sqrt = vm->asciizConstructUTF8("Sqrt"); - N3::sin = vm->asciizConstructUTF8("Sin"); - N3::cos = vm->asciizConstructUTF8("Cos"); - N3::exp = vm->asciizConstructUTF8("Exp"); - N3::log = vm->asciizConstructUTF8("Log"); - N3::floor = vm->asciizConstructUTF8("Floor"); - N3::log10 = vm->asciizConstructUTF8("Log10"); - N3::isNan = vm->asciizConstructUTF8("IsNaN"); - N3::pow = vm->asciizConstructUTF8("Pow"); - N3::floatName = vm->asciizConstructUTF8("Float"); - N3::doubleName = vm->asciizConstructUTF8("Double"); - N3::testInfinity = vm->asciizConstructUTF8("TestInfinity"); + N3::clinitName = vm->asciizToUTF8(".cctor"); + N3::ctorName = vm->asciizToUTF8(".ctor"); + N3::invokeName = vm->asciizToUTF8("Invoke"); + N3::math = vm->asciizToUTF8("Math"); + N3::system = vm->asciizToUTF8("System"); + N3::sqrt = vm->asciizToUTF8("Sqrt"); + N3::sin = vm->asciizToUTF8("Sin"); + N3::cos = vm->asciizToUTF8("Cos"); + N3::exp = vm->asciizToUTF8("Exp"); + N3::log = vm->asciizToUTF8("Log"); + N3::floor = vm->asciizToUTF8("Floor"); + N3::log10 = vm->asciizToUTF8("Log10"); + N3::isNan = vm->asciizToUTF8("IsNaN"); + N3::pow = vm->asciizToUTF8("Pow"); + N3::floatName = vm->asciizToUTF8("Float"); + N3::doubleName = vm->asciizToUTF8("Double"); + N3::testInfinity = vm->asciizToUTF8("TestInfinity"); + MSCorlib::pArray->resolveType(1, 0, 0); + MSCorlib::initialise(vm); } @@ -323,11 +324,11 @@ return 0; } -void VirtualMachine::runApplication(int argc, char** argv) { +void N3::runApplication(int argc, char** argv) { ((N3*)this)->runMain(argc, argv); } -void VirtualMachine::compile(const char* argv) { +void N3::compile(const char* argv) { assert(0 && "This virtual machine does not perform static compilation yet!\n"); } Modified: vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp Mon Oct 5 12:36:51 2009 @@ -15,9 +15,9 @@ #include "Assembly.h" #include "CLIJit.h" #include "N3ModuleProvider.h" -#include "VirtualMachine.h" #include "VMClass.h" #include "VMThread.h" +#include "N3.h" using namespace llvm; using namespace n3; @@ -40,7 +40,7 @@ CLIJit::compile(meth->classDef, meth); void* res = mvm::MvmModule::executionEngine->getPointerToGlobal(meth->methPtr); meth->code = res; - VirtualMachine* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->vm; vm->addMethodInFunctionMap(meth, res); } meth->classDef->release(); Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Mon Oct 5 12:36:51 2009 @@ -1577,8 +1577,8 @@ case LDSTR : { uint32 value = readU4(bytecodes, i); uint32 index = value & 0xfffffff; - const UTF8* utf8 = compilingClass->assembly->readUserString(index); - Value* val = ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), (int64_t)utf8), + const ArrayUInt16* array = compilingClass->assembly->readUserString(index); + Value* val = ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), (int64_t)array), module->ptrType); Value* res = CallInst::Create(newStringLLVM, val, "", currentBlock); /*CLIString * str = Modified: vmkit/trunk/lib/N3/VMCore/VMArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.cpp Mon Oct 5 12:36:51 2009 @@ -9,11 +9,11 @@ #include -#include "VirtualMachine.h" #include "VMArray.h" #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" +#include "N3.h" using namespace n3; @@ -166,54 +166,7 @@ } -AT(UTF8, uint16) -INITIALISE(UTF8) - #undef AT #undef INITIALISE #undef ACONS #undef ARRAYCLASS - -UTF8* UTF8::acons(sint32 n, VMClassArray* atype) { - if (n < 0) - VMThread::get()->vm->negativeArraySizeException(n); - else if (n > VMArray::MaxArraySize) - VMThread::get()->vm->outOfMemoryError(n); - uint32 size = sizeof(VMObject) + sizeof(sint32) + n * sizeof(uint16); - UTF8* res = (UTF8*)gc::operator new(size, UTF8::VT); - res->initialise(atype, n); - return res; -} - -void UTF8::print(mvm::PrintBuffer* buf) const { - for (int i = 0; i < size; i++) - buf->writeChar((char)elements[i]); -} - -const UTF8* UTF8::extract(VirtualMachine *vm, uint32 start, uint32 end) const { - uint32 len = end - start; - uint16* buf = (uint16*)alloca(sizeof(uint16) * len); - - for (uint32 i = 0; i < len; i++) { - buf[i] = at(i + start); - } - - return readerConstruct(vm, buf, len); -} - -const UTF8* UTF8::asciizConstruct(VirtualMachine* vm, const char* asciiz) { - return vm->asciizConstructUTF8(asciiz); -} - -const UTF8* UTF8::readerConstruct(VirtualMachine* vm, uint16* buf, uint32 n) { - return vm->readerConstructUTF8(buf, n); -} - -char* UTF8::UTF8ToAsciiz() const { - mvm::NativeString* buf = mvm::NativeString::alloc(size + 1); - for (sint32 i = 0; i < size; ++i) { - buf->setAt(i, elements[i]); - } - buf->setAt(size, 0); - return buf->cString(); -} Modified: vmkit/trunk/lib/N3/VMCore/VMArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.h Mon Oct 5 12:36:51 2009 @@ -19,12 +19,13 @@ #include "VMObject.h" +#include "UTF8.h" + namespace n3 { class VMClassArray; class VMCommonClass; class VMObject; -class VirtualMachine; class VMArray : public VMObject { public: @@ -84,27 +85,6 @@ virtual void TRACER; }; -class UTF8 : public VMObject { -public: - static VirtualTable* VT; - sint32 size; - uint16 elements[1]; - - static const llvm::Type* llvmType; - static UTF8* acons(sint32 n, VMClassArray* cl); - void initialise(VMCommonClass* atype, sint32 n); - - unsigned short int at(sint32) const; - void setAt(sint32, uint16); - - virtual void print(mvm::PrintBuffer* buf) const; - - char* UTF8ToAsciiz() const; - static const UTF8* asciizConstruct(VirtualMachine *vm, const char* asciiz); - static const UTF8* readerConstruct(VirtualMachine *vm, uint16* buf, uint32 n); - - const UTF8* extract(VirtualMachine *vm, uint32 start, uint32 len) const; -}; } // end namespace n3 Modified: vmkit/trunk/lib/N3/VMCore/VMCache.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.cpp Mon Oct 5 12:36:51 2009 @@ -21,7 +21,6 @@ #include "CLIJit.h" #include "MSCorlib.h" #include "N3.h" -#include "VirtualMachine.h" #include "VMArray.h" #include "VMCache.h" #include "VMClass.h" Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Mon Oct 5 12:36:51 2009 @@ -25,7 +25,6 @@ #include "CLIJit.h" #include "MSCorlib.h" #include "N3.h" -#include "VirtualMachine.h" #include "VMArray.h" #include "VMClass.h" #include "VMThread.h" @@ -160,7 +159,7 @@ } -void VMCommonClass::initialise(VirtualMachine* vm, bool isArray) { +void VMCommonClass::initialise(N3* vm, bool isArray) { this->lockVar = new mvm::LockRecursive(); this->condVar = new mvm::Cond(); this->delegatee = 0; @@ -181,7 +180,7 @@ sprintf(res, "%s[]", res); } - return VMThread::get()->vm->asciizConstructUTF8(res); + return VMThread::get()->vm->asciizToUTF8(res); } const UTF8* VMClassPointer::constructPointerName(const UTF8* name, uint32 dims) { @@ -193,7 +192,7 @@ sprintf(res, "%s*", res); } - return VMThread::get()->vm->asciizConstructUTF8(res); + return VMThread::get()->vm->asciizToUTF8(res); } @@ -221,6 +220,7 @@ typedef void (*clinit_t)(void); void VMCommonClass::clinitClass(VMGenericMethod* genMethod) { + // printf("----- clinit: %s\n", mvm::PrintBuffer::objectToString(this)); VMCommonClass* cl = this; if (cl->status < ready) { cl->aquire(); @@ -401,6 +401,7 @@ } void VMCommonClass::resolveVirtual(VMGenericClass* genClass, VMGenericMethod *genMethod) { + // printf("Resolve virtual: %s\n", mvm::PrintBuffer::objectToString(this)); VMCommonClass* cl = this; if (cl->status < virtual_resolved) { @@ -415,7 +416,9 @@ if (cl->isArray) { VMClassArray* arrayCl = (VMClassArray*)cl; VMCommonClass* baseClass = arrayCl->baseClass; + // printf("Resolveing base class: %s\n", mvm::PrintBuffer::objectToString(baseClass)); baseClass->resolveType(false, false, genMethod); + // printf("Resolveing base class: %s done\n", mvm::PrintBuffer::objectToString(baseClass)); arrayCl->makeType(); cl->status = virtual_resolved; } else if (cl->isPointer) { @@ -476,11 +479,13 @@ } void VMCommonClass::resolveType(bool stat, bool clinit, VMGenericMethod* genMethod) { + // printf("Resolve type: %s %d %d\n", mvm::PrintBuffer::objectToString(this), stat, clinit); resolveVirtual(dynamic_cast(this), genMethod); if (stat) resolveStatic(clinit, genMethod); } void VMCommonClass::resolveStatic(bool clinit, VMGenericMethod* genMethod) { + // printf("Resolve static: %s %d\n", mvm::PrintBuffer::objectToString(this), clinit); VMCommonClass* cl = this; if (cl->status < static_resolved) { cl->aquire(); @@ -489,6 +494,8 @@ cl->release(); } else if (status < virtual_resolved) { cl->release(); + // printf("Will throw an exception: %s....\n", mvm::PrintBuffer::objectToString(this)); + // ((char *)0)[0] = 22; VMThread::get()->vm->unknownError("try to resolve static of a not virtual-resolved class"); } else if (status == virtual_resolved) { if (cl->isArray) { @@ -561,7 +568,7 @@ VMMethod* res = lookupMethodDontThrow(name, args, isStatic, recurse); if (!res) { - VMThread::get()->vm->error(VirtualMachine::MissingMethodException, + VMThread::get()->vm->error(N3::MissingMethodException, "unable to find %s in %s", mvm::PrintBuffer::objectToString(name), mvm::PrintBuffer::objectToString(this)); } @@ -608,7 +615,7 @@ VMField* res = lookupFieldDontThrow(name, type, isStatic, recurse); if (!res) { - VMThread::get()->vm->error(VirtualMachine::MissingFieldException, + VMThread::get()->vm->error(N3::MissingFieldException, "unable to find %s in %s", mvm::PrintBuffer::objectToString(name), mvm::PrintBuffer::objectToString(this)); } Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Mon Oct 5 12:36:51 2009 @@ -31,13 +31,13 @@ class Param; class Property; class UTF8; -class VirtualMachine; class VMClass; class VMField; class VMMethod; class VMObject; class VMGenericClass; class VMGenericMethod; +class N3; typedef enum VMClassState { hashed = 0, loaded, prepared, readed, virtual_resolved, static_resolved, clinitParent, inClinit, ready @@ -56,7 +56,7 @@ std::vector interfaces; std::vector interfacesToken; VMCommonClass* super; - VirtualMachine* vm; + N3* vm; const UTF8* name; const UTF8* nameSpace; mvm::Lock* lockVar; @@ -86,7 +86,7 @@ void broadcastClass(); bool ownerClass(); - void initialise(VirtualMachine* vm, bool isArray); + void initialise(N3* vm, bool isArray); const llvm::Type* naturalType; // true type const llvm::Type* virtualType; // true type or box Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Mon Oct 5 12:36:51 2009 @@ -14,7 +14,7 @@ #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" -#include "VirtualMachine.h" +#include "N3.h" using namespace n3; Modified: vmkit/trunk/lib/N3/VMCore/VMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.cpp Mon Oct 5 12:36:51 2009 @@ -20,7 +20,7 @@ #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" -#include "VirtualMachine.h" +#include "N3.h" using namespace n3; @@ -43,7 +43,7 @@ extern void AddStandardCompilePasses(llvm::FunctionPassManager*); -VMThread* VMThread::allocate(VMObject* thread, VirtualMachine* vm) { +VMThread* VMThread::allocate(VMObject* thread, N3* vm) { VMThread* key = new VMThread(); key->vmThread = thread; key->vm = vm; Modified: vmkit/trunk/lib/N3/VMCore/VMThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.h?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.h Mon Oct 5 12:36:51 2009 @@ -21,7 +21,7 @@ namespace n3 { -class VirtualMachine; +class N3; class VMClass; class VMGenericClass; class VMObject; @@ -31,7 +31,7 @@ public: static VirtualTable *VT; VMObject* vmThread; - VirtualMachine* vm; + N3* vm; mvm::Lock* lock; mvm::Cond* varcond; VMObject* pendingException; @@ -54,7 +54,7 @@ static VMThread* get() { return TheThread; } - static VMThread* allocate(VMObject* thread, VirtualMachine* vm); + static VMThread* allocate(VMObject* thread, N3* vm); static VMObject* currentThread(); static VMObject* getCLIException(); Removed: vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp?rev=83314&view=auto ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualMachine.cpp (removed) @@ -1,166 +0,0 @@ -//===------ VirtualMachine.cpp - Virtual machine description --------------===// -// -// N3 -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include -#include - -#include "llvm/Function.h" -#include "llvm/Module.h" - -#include "mvm/Object.h" -#include "mvm/PrintBuffer.h" -#include "mvm/Threads/Cond.h" -#include "mvm/Threads/Locks.h" - -#include "types.h" - -#include "Assembly.h" -#include "LockedMap.h" -#include "N3ModuleProvider.h" -#include "VirtualMachine.h" -#include "VMArray.h" -#include "VMClass.h" - -using namespace n3; - -#define DECLARE_EXCEPTION(EXCP) \ - const char* VirtualMachine::EXCP = #EXCP - -DECLARE_EXCEPTION(SystemException); -DECLARE_EXCEPTION(OverFlowException); -DECLARE_EXCEPTION(OutOfMemoryException); -DECLARE_EXCEPTION(IndexOutOfRangeException); -DECLARE_EXCEPTION(NullReferenceException); -DECLARE_EXCEPTION(SynchronizationLocException); -DECLARE_EXCEPTION(ThreadInterruptedException); -DECLARE_EXCEPTION(MissingMethodException); -DECLARE_EXCEPTION(MissingFieldException); -DECLARE_EXCEPTION(ArrayTypeMismatchException); -DECLARE_EXCEPTION(ArgumentException); - -/* -DECLARE_EXCEPTION(ArithmeticException); -DECLARE_EXCEPTION(InvocationTargetException); -DECLARE_EXCEPTION(ArrayStoreException); -DECLARE_EXCEPTION(ClassCastException); -DECLARE_EXCEPTION(ArrayIndexOutOfBoundsException); -DECLARE_EXCEPTION(SecurityException); -DECLARE_EXCEPTION(ClassFormatError); -DECLARE_EXCEPTION(ClassCircularityError); -DECLARE_EXCEPTION(NoClassDefFoundError); -DECLARE_EXCEPTION(UnsupportedClassVersionError); -DECLARE_EXCEPTION(NoSuchFieldError); -DECLARE_EXCEPTION(NoSuchMethodError); -DECLARE_EXCEPTION(InstantiationError); -DECLARE_EXCEPTION(IllegalAccessError); -DECLARE_EXCEPTION(IllegalAccessException); -DECLARE_EXCEPTION(VerifyError); -DECLARE_EXCEPTION(ExceptionInInitializerError); -DECLARE_EXCEPTION(LinkageError); -DECLARE_EXCEPTION(AbstractMethodError); -DECLARE_EXCEPTION(UnsatisfiedLinkError); -DECLARE_EXCEPTION(InternalError); -DECLARE_EXCEPTION(StackOverflowError); -DECLARE_EXCEPTION(ClassNotFoundException); -*/ - -#undef DECLARE_EXCEPTION -void ThreadSystem::print(mvm::PrintBuffer* buf) const { - buf->write("ThreadSystem<>"); -} - -ThreadSystem* ThreadSystem::allocateThreadSystem() { - ThreadSystem* res = gc_new(ThreadSystem)(); - res->nonDaemonThreads = 1; - res->nonDaemonLock = new mvm::LockNormal(); - res->nonDaemonVar = new mvm::Cond(); - return res; -} - -const UTF8* VirtualMachine::asciizConstructUTF8(const char* asciiz) { - return hashUTF8->lookupOrCreateAsciiz(asciiz); -} - -const UTF8* VirtualMachine::readerConstructUTF8(const uint16* buf, uint32 len) { - return hashUTF8->lookupOrCreateReader(buf, len); -} - -void VirtualMachine::error(const char* className, const char* fmt, va_list ap) { - fprintf(stderr, "Internal exception of type %s during bootstrap: ", className); - vfprintf(stderr, fmt, ap); - throw 1; -} - -void VirtualMachine::indexOutOfBounds(const VMObject* obj, sint32 entry) { - error(IndexOutOfRangeException, "%d", entry); -} - -void VirtualMachine::negativeArraySizeException(sint32 size) { - error(OverFlowException, "%d", size); -} - -void VirtualMachine::nullPointerException(const char* fmt, ...) { - va_list ap; - va_start(ap, fmt); - error(NullReferenceException, fmt, va_arg(ap, char*)); -} - - -void VirtualMachine::illegalMonitorStateException(const VMObject* obj) { - error(SynchronizationLocException, ""); -} - -void VirtualMachine::interruptedException(const VMObject* obj) { - error(ThreadInterruptedException, ""); -} - -void VirtualMachine::outOfMemoryError(sint32 n) { - error(OutOfMemoryException, ""); -} - -void VirtualMachine::arrayStoreException() { - error(ArrayTypeMismatchException, ""); -} - -void VirtualMachine::illegalArgumentException(const char* name) { - error(ArgumentException, name); -} - -void VirtualMachine::unknownError(const char* fmt, ...) { - va_list ap; - va_start(ap, fmt); - error(SystemException, fmt, ap); -} - -void VirtualMachine::error(const char* fmt, ...) { - va_list ap; - va_start(ap, fmt); - error(SystemException, fmt, ap); -} - -void VirtualMachine::error(const char* name, const char* fmt, ...) { - va_list ap; - va_start(ap, fmt); - error(name, fmt, ap); -} - -VirtualMachine::~VirtualMachine() { - delete module; - delete TheModuleProvider; -} - -VirtualMachine::VirtualMachine(mvm::BumpPtrAllocator &allocator) - : mvm::VirtualMachine(allocator) { - module = 0; - TheModuleProvider = 0; -} - -VMMethod* VirtualMachine::lookupFunction(Function* F) { - return functions->lookup(F); -} Removed: vmkit/trunk/lib/N3/VMCore/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualMachine.h?rev=83314&view=auto ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualMachine.h (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualMachine.h (removed) @@ -1,144 +0,0 @@ -//===------- VirtualMachine.h - Virtual machine description ---------------===// -// -// N3 -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef N3_VIRTUAL_MACHINE_H -#define N3_VIRTUAL_MACHINE_H - -#include - -#include "llvm/Function.h" - -#include "mvm/JIT.h" -#include "mvm/Object.h" -#include "mvm/PrintBuffer.h" -#include "mvm/VirtualMachine.h" -#include "mvm/Threads/Cond.h" -#include "mvm/Threads/Locks.h" - -#include "types.h" - -namespace n3 { - -class FunctionMap; -class N3ModuleProvider; -class UTF8; -class UTF8Map; -class VMMethod; -class VMObject; -class VMThread; - -class ThreadSystem : public mvm::Object { -public: - static VirtualTable* VT; - uint16 nonDaemonThreads; - mvm::Lock* nonDaemonLock; - mvm::Cond* nonDaemonVar; - - virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; - - static ThreadSystem* allocateThreadSystem(); -}; - -class VirtualMachine : public mvm::VirtualMachine { -public: - ThreadSystem* threadSystem; - - const UTF8* asciizConstructUTF8(const char* asciiz); - const UTF8* readerConstructUTF8(const uint16* buf, uint32 len); - UTF8Map * hashUTF8; - - - // Exceptions name - static const char* SystemException; - static const char* OverFlowException; - static const char* OutOfMemoryException; - static const char* IndexOutOfRangeException; - static const char* SynchronizationLocException; - static const char* NullReferenceException; - static const char* ThreadInterruptedException; - static const char* MissingMethodException; - static const char* MissingFieldException; - static const char* ArrayTypeMismatchException; - static const char* ArgumentException; - /*static const char* ArithmeticException; - static const char* ClassNotFoundException; - static const char* InvocationTargetException; - static const char* ClassCastException; - static const char* ArrayIndexOutOfBoundsException; - static const char* SecurityException; - static const char* ClassFormatError; - static const char* ClassCircularityError; - static const char* NoClassDefFoundError; - static const char* UnsupportedClassVersionError; - static const char* NoSuchFieldError; - static const char* NoSuchMethodError; - static const char* InstantiationError; - static const char* IllegalAccessError; - static const char* IllegalAccessException; - static const char* VerifyError; - static const char* ExceptionInInitializerError; - static const char* LinkageError; - static const char* AbstractMethodError; - static const char* UnsatisfiedLinkError; - static const char* InternalError; - static const char* StackOverflowError; - */ - // Exceptions - - /* - void illegalAccessException(const char* msg); - void initializerError(const VMObject* excp); - void invocationTargetException(const VMObject* obj); - void classCastException(const char* msg); - void errorWithExcp(const char* className, const VMObject* excp);*/ - void illegalArgumentException(const char* msg); - void arrayStoreException(); - void illegalMonitorStateException(const VMObject* obj); - void interruptedException(const VMObject* obj); - void nullPointerException(const char* fmt, ...); - void outOfMemoryError(sint32 n); - void indexOutOfBounds(const VMObject* obj, sint32 entry); - void negativeArraySizeException(int size); - void unknownError(const char* fmt, ...); - void error(const char* fmt, ...); - void error(const char* className, const char* fmt, ...); - void error(const char* className, const char* fmt, va_list ap); - - - virtual void TRACER; - virtual void print(mvm::PrintBuffer* buf) const { - buf->write("Virtual Machine<>"); - } - - ~VirtualMachine(); - VirtualMachine(mvm::BumpPtrAllocator &allocator); - - mvm::Lock* protectModule; - FunctionMap* functions; - mvm::MvmModule* module; - llvm::Module* LLVMModule; - N3ModuleProvider* TheModuleProvider; - VMThread* bootstrapThread; - - virtual void runApplication(int argc, char** argv); - virtual void compile(const char* name); - virtual void waitForExit() { - // Currently unimplemented. - } - - VMMethod* lookupFunction(llvm::Function* F); - - llvm::Module* getLLVMModule() { return LLVMModule; } - -}; - -} // end namespace n3 - -#endif Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83315&r1=83314&r2=83315&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Mon Oct 5 12:36:51 2009 @@ -15,7 +15,6 @@ #include "LockedMap.h" #include "N3.h" #include "Reader.h" -#include "VirtualMachine.h" #include "VMArray.h" #include "VMCache.h" #include "VMClass.h" @@ -214,18 +213,6 @@ pendingException->MARK_AND_TRACE; } -void VirtualMachine::TRACER { - threadSystem->MARK_AND_TRACE; - hashUTF8->CALL_TRACER; - functions->CALL_TRACER; - if (bootstrapThread) { - bootstrapThread->CALL_TRACER; - for (VMThread* th = (VMThread*)bootstrapThread->next(); - th != bootstrapThread; th = (VMThread*)th->next()) - th->CALL_TRACER; - } -} - void Param::TRACER { method->CALL_TRACER; name->MARK_AND_TRACE; @@ -257,7 +244,15 @@ } void N3::TRACER { - VirtualMachine::CALL_TRACER; + threadSystem->MARK_AND_TRACE; + hashUTF8->CALL_TRACER; + functions->CALL_TRACER; + if (bootstrapThread) { + bootstrapThread->CALL_TRACER; + for (VMThread* th = (VMThread*)bootstrapThread->next(); + th != bootstrapThread; th = (VMThread*)th->next()) + th->CALL_TRACER; + } hashUTF8->CALL_TRACER; hashStr->CALL_TRACER; loadedAssemblies->CALL_TRACER; From gael.thomas at lip6.fr Mon Oct 5 12:43:45 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 05 Oct 2009 19:43:45 -0000 Subject: [vmkit-commits] [vmkit] r83320 - in /vmkit/trunk/lib/N3: PNetLib/PNetLib.cpp PNetLib/PNetString.cpp PNetLib/PNetString.h VMCore/CLIString.h VMCore/N3.cpp VMCore/N3.h VMCore/N3Initialise.cpp VMCore/Reader.cpp Message-ID: <200910051943.n95Jhj3S019513@zion.cs.uiuc.edu> Author: gthomas Date: Mon Oct 5 14:43:44 2009 New Revision: 83320 URL: http://llvm.org/viewvc/llvm-project?rev=83320&view=rev Log: PNetString are now using ArrayUInt16. An utf8 is still an object. Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.h vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/Reader.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Mon Oct 5 14:43:44 2009 @@ -176,17 +176,17 @@ static const ArrayUInt16* newBuilder(N3* vm, PNetString* value, uint32 length) { uint32 valueLength = value ? value->length : 0; - const UTF8* utf8 = value ? value->value : 0; + const ArrayUInt16* array = value ? value->value : 0; uint32 roundLength = (7 + length) & 0xfffffff8; uint16* buf = (uint16*)alloca(roundLength * sizeof(uint16)); uint32 strLength = 0; if (value != 0) { if (valueLength <= roundLength) { - memcpy(buf, utf8->elements, valueLength * sizeof(uint16)); + memcpy(buf, array->elements, valueLength * sizeof(uint16)); strLength = valueLength; } else { - memcpy(buf, utf8->elements, roundLength * sizeof(uint16)); + memcpy(buf, array->elements, roundLength * sizeof(uint16)); strLength = roundLength; } } @@ -209,7 +209,7 @@ extern "C" void System_String_CopyToChecked(PNetString* str, sint32 sstart, ArrayUInt16* dest, sint32 dstart, sint32 count) { - const UTF8* value = str->value; + const ArrayUInt16* value = str->value; memcpy(&dest->elements[dstart], &value->elements[sstart], count << 1); } @@ -264,8 +264,7 @@ extern "C" void System_String_Copy_3(PNetString* dest, sint32 pos, PNetString* src) { - ArrayUInt16* arr = ArrayUInt16::acons(pos + src->value->size, - (VMClassArray*)MSCorlib::pChar); + ArrayUInt16* arr = (ArrayUInt16*)MSCorlib::arrayChar->doNew(pos + src->value->size); for (sint32 i = 0; i < pos; ++i) { arr->setAt(i, dest->value->at(i)); @@ -275,34 +274,52 @@ arr->setAt(pos + i, src->value->at(i)); } - dest->value = ((UTF8*)arr)->extract(VMThread::get()->vm, 0, pos + src->value->size); + dest->value = arr; dest->length = dest->value->size; } extern "C" void System_String_Copy_5(PNetString* dest, sint32 destPos, PNetString* src, sint32 srcPos, sint32 length) { - const UTF8* utf8Src = src->value->extract(VMThread::get()->vm, srcPos, - srcPos + length); - if (destPos == 0) { - dest->value = utf8Src; - dest->length = dest->value->size; - } else { - const UTF8* utf8Dest = dest->value->extract(VMThread::get()->vm, 0, - destPos); - sint32 len1 = utf8Dest->size; - sint32 len2 = utf8Src->size; - uint16* buf = (uint16*)alloca((len1 + len2) * sizeof(uint16)); - - memcpy(buf, utf8Dest->elements, len1 * sizeof(uint16)); - memcpy(buf + len1, utf8Dest->elements, len2 * sizeof(uint16)); - - const UTF8* utf8 = VMThread::get()->vm->bufToUTF8(buf, - len1 + len2); - dest->value = utf8; - dest->length = dest->value->size; - } + const ArrayUInt16 *arraySrc = src->value; + + if(destPos == 0 && srcPos == 0 && length == src->length) { + dest->value = arraySrc; + dest->length = length; + } else { + sint32 newLength = destPos + length; + + if(newLength <= dest->length) { + memcpy((uint16*)dest->value->elements + destPos, (uint16*)src->value->elements + srcPos, length<<1); + } else { + uint16 *buf = (uint16*)alloca(newLength<<1); + memcpy(buf, (uint16*)dest->value->elements, destPos<<1); + memcpy(buf + destPos, (uint16*)src->value->elements + srcPos, length<<1); + dest->length = newLength; + dest->value = VMThread::get()->vm->bufToArray(buf, newLength); + } + } } +// const UTF8* utf8Src = src->value->extract(VMThread::get()->vm, srcPos, +// srcPos + length); +// if (destPos == 0) { +// dest->value = utf8Src; +// dest->length = dest->value->size; +// } else { +// const UTF8* utf8Dest = dest->value->extract(VMThread::get()->vm, 0, +// destPos); +// sint32 len1 = utf8Dest->size; +// sint32 len2 = utf8Src->size; +// uint16* buf = (uint16*)alloca((len1 + len2) * sizeof(uint16)); + +// memcpy(buf, utf8Dest->elements, len1 * sizeof(uint16)); +// memcpy(buf + len1, utf8Dest->elements, len2 * sizeof(uint16)); + +// const UTF8* utf8 = VMThread::get()->vm->bufToUTF8(buf, +// len1 + len2); +// dest->value = utf8; +// dest->length = dest->value->size; +// } extern "C" void System_Threading_Monitor_Enter(VMObject* obj) { obj->aquire(); @@ -336,9 +353,9 @@ } sint32 i = startIndex; - const UTF8* utf8 = str->value; + const ArrayUInt16* array = str->value; while (i < startIndex + count) { - if (utf8->at(i) == value) return i; + if (array->at(i) == value) return i; else ++i; } @@ -347,9 +364,9 @@ extern "C" sint32 System_String_GetHashCode(PNetString* str) { sint32 hash = 0; - const UTF8* utf8 = str->value; - for (sint32 i = 0; i < utf8->size; ++i) { - hash += ((hash << 5) + utf8->elements[i]); + const ArrayUInt16* array = str->value; + for (sint32 i = 0; i < array->size; ++i) { + hash += ((hash << 5) + array->elements[i]); } return hash; } @@ -360,17 +377,17 @@ uint16 value) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const UTF8* utf8 = buildString->value; + const ArrayUInt16* array = buildString->value; sint32 strLength = buildString->length; sint32 length = (index + 1) > strLength ? index + 1 : strLength + 1; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); if (index != 0) { - memcpy(buf, utf8->elements, index * sizeof(uint16)); + memcpy(buf, array->elements, index * sizeof(uint16)); } if (strLength > index) { - memcpy(&(buf[index + 1]), &(utf8->elements[index]), + memcpy(&(buf[index + 1]), &(array->elements[index]), (strLength - index) * sizeof(uint16)); } @@ -387,23 +404,23 @@ PNetString* str) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const UTF8* strUtf8 = str->value; - const UTF8* buildUtf8 = buildString->value; + const ArrayUInt16* strArray = str->value; + const ArrayUInt16* buildArray = buildString->value; sint32 strLength = str->length; sint32 buildLength = buildString->length; sint32 length = strLength + buildLength; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); if (index != 0) { - memcpy(buf, buildUtf8->elements, index * sizeof(uint16)); + memcpy(buf, buildArray->elements, index * sizeof(uint16)); } if (strLength != 0) { - memcpy(&(buf[index]), strUtf8->elements, strLength * sizeof(uint16)); + memcpy(&(buf[index]), strArray->elements, strLength * sizeof(uint16)); } if (buildLength - index > 0) { - memcpy(&(buf[strLength + index]), &(buildUtf8->elements[index]), + memcpy(&(buf[strLength + index]), &(buildArray->elements[index]), (buildLength - index) * sizeof(uint16)); } @@ -418,11 +435,11 @@ uint16 value) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const UTF8* utf8 = buildString->value; + const ArrayUInt16* array = buildString->value; sint32 length = buildString->length; uint16* buf = (uint16*)alloca((length + 1) * sizeof(uint16)); - memcpy(buf, utf8->elements, length * sizeof(uint16)); + memcpy(buf, array->elements, length * sizeof(uint16)); buf[length] = value; PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length + 1)); @@ -436,15 +453,15 @@ PNetString* str) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const UTF8* buildUtf8 = buildString->value; - const UTF8* strUtf8 = str->value; + const ArrayUInt16* buildArray = buildString->value; + const ArrayUInt16* strArray = str->value; sint32 buildLength = buildString->length; sint32 strLength = str->length; sint32 length = buildLength + strLength; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); - memcpy(buf, buildUtf8->elements, buildLength * sizeof(uint16)); - memcpy(&(buf[buildLength]), strUtf8->elements, strLength * sizeof(uint16)); + memcpy(buf, buildArray->elements, buildLength * sizeof(uint16)); + memcpy(&(buf[buildLength]), strArray->elements, strLength * sizeof(uint16)); PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length)); obj->buildString = val; @@ -505,7 +522,7 @@ extern "C" VMObject* System_Reflection_Assembly_LoadFromName(PNetString* str, sint32 & error, VMObject* parent) { N3* vm = (N3*)(VMThread::get()->vm); - Assembly* ass = vm->loadAssembly(str->value, "dll"); + Assembly* ass = vm->loadAssembly(vm->arrayToUTF8(str->value), "dll"); if (!ass) vm->error("unfound assembly %s\n", str->value->printString()); error = 0; return ass->getAssemblyDelegatee(); @@ -513,14 +530,14 @@ extern "C" PNetString* System_String_Concat_2(PNetString* str1, PNetString* str2) { N3* vm = (N3*)(VMThread::get()->vm); - const UTF8* u1 = str1->value; - const UTF8* u2 = str2->value; + const ArrayUInt16* a1 = str1->value; + const ArrayUInt16* a2 = str2->value; sint32 len1 = str1->length; sint32 len2 = str2->length; uint16* buf = (uint16*)alloca((len1 + len2) * sizeof(uint16)); - memcpy(buf, u1->elements, len1 * sizeof(uint16)); - memcpy(&(buf[len1]), u2->elements, len2 * sizeof(uint16)); + memcpy(buf, a1->elements, len1 * sizeof(uint16)); + memcpy(&(buf[len1]), a2->elements, len2 * sizeof(uint16)); PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, len1 + len2)); @@ -529,17 +546,17 @@ extern "C" PNetString* System_String_Concat_3(PNetString* str1, PNetString* str2, PNetString* str3) { N3* vm = (N3*)(VMThread::get()->vm); - const UTF8* u1 = str1->value; - const UTF8* u2 = str2->value; - const UTF8* u3 = str3->value; + const ArrayUInt16* a1 = str1->value; + const ArrayUInt16* a2 = str2->value; + const ArrayUInt16* a3 = str3->value; sint32 len1 = str1->length; sint32 len2 = str2->length; sint32 len3 = str3->length; uint16* buf = (uint16*)alloca((len1 + len2 + len3) * sizeof(uint16)); - memcpy(buf, u1->elements, len1 * sizeof(uint16)); - memcpy(&(buf[len1]), u2->elements, len2 * sizeof(uint16)); - memcpy(&(buf[len1 + len2]), u3->elements, len3 * sizeof(uint16)); + memcpy(buf, a1->elements, len1 * sizeof(uint16)); + memcpy(&(buf[len1]), a2->elements, len2 * sizeof(uint16)); + memcpy(&(buf[len1 + len2]), a3->elements, len3 * sizeof(uint16)); PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, len1 + len2 + len3)); @@ -547,18 +564,18 @@ } extern "C" void System_String_RemoveSpace(PNetString* str, sint32 index, sint32 length) { - const UTF8* utf8 = str->value; + const ArrayUInt16* array = str->value; sint32 strLength = str->length; uint16* buf = (uint16*)alloca(strLength * sizeof(uint16)); sint32 j = index; if (index != 0) { - memcpy(buf, utf8->elements, index * sizeof(uint16)); + memcpy(buf, array->elements, index * sizeof(uint16)); } // 32 is space for (sint32 i = 0; i < length; ++i) { - uint16 cur = utf8->elements[index + i]; + uint16 cur = array->elements[index + i]; if (cur != 32) { buf[j] = cur; } else { @@ -567,22 +584,21 @@ } if (strLength > (index + length)) { - memcpy(&(buf[j]), &(utf8->elements[index + length]), (strLength - (index + length)) * sizeof(uint16)); + memcpy(&(buf[j]), &(array->elements[index + length]), (strLength - (index + length)) * sizeof(uint16)); } - const UTF8* res = VMThread::get()->vm->bufToUTF8(buf, j); + const ArrayUInt16* res = VMThread::get()->vm->bufToArray(buf, j); str->value = res; str->length = j; } extern "C" void System_String__ctor_3(PNetString* str, uint16 ch, sint32 count) { - ArrayUInt16* array = ArrayUInt16::acons(count, MSCorlib::arrayChar); + ArrayUInt16* array = (ArrayUInt16*)MSCorlib::arrayChar->doNew(count); for (sint32 i = 0; i < count; ++i) { array->elements[i] = ch; } - const UTF8* utf8 = VMThread::get()->vm->bufToUTF8(array->elements, array->size); - str->value = utf8; + str->value = array; str->length = array->size; str->capacity = array->size; } @@ -603,8 +619,8 @@ extern "C" VMObject* System_Reflection_Assembly_GetType(VMObject* obj, PNetString* str, bool onError, bool ignoreCase) { Assembly* ass = ASSEMBLY_VALUE(obj); - const UTF8* utf8 = str->value; - char* asciiz = utf8->UTF8ToAsciiz(); + const ArrayUInt16* array = str->value; + char* asciiz = ass->vm->arrayToAsciiz(array); char* index = (char*)sys_memrchr(asciiz, '.', strlen(asciiz)); N3* vm = ass->vm; @@ -628,7 +644,8 @@ extern "C" VMObject* System_Reflection_ClrType_GetMemberImpl(VMObject* Type, PNetString* str, sint32 memberTypes, sint32 bindingFlags, VMObject* binder, sint32 callingConventions, ArrayObject* types, VMObject* modifiers) { VMCommonClass* type = (VMCommonClass*)((*MSCorlib::typeClrType)(Type).PointerVal); - const UTF8* name = str->value; + N3* vm = (N3*)(VMThread::get()->vm); + const UTF8* name = vm->arrayToUTF8(str->value); if (memberTypes == MEMBER_TYPES_PROPERTY) { std::vector > properties = type->properties; @@ -873,20 +890,20 @@ extern "C" VMObject* System_Reflection_Assembly_GetManifestResourceStream(VMObject* Ass, PNetString* str) { Assembly* ass = (Assembly*)(*MSCorlib::assemblyAssemblyReflection)(Ass).PointerVal; - const UTF8* utf8 = str->value; + N3* vm = (N3*)(VMThread::get()->vm); + const UTF8* id = vm->arrayToUTF8(str->value); Header* header = ass->CLIHeader; uint32 stringOffset = header->stringStream->realOffset; Table* manTable = header->tables[CONSTANT_ManifestResource]; uint32 manRows = manTable->rowsNumber; sint32 pos = -1; uint32 i = 0; - N3* vm = VMThread::get()->vm; while ((pos == -1) && (i < manRows)) { uint32 nameOffset = manTable->readIndexInRow(i + 1, CONSTANT_MANIFEST_RESOURCE_NAME, ass->bytes); const UTF8* name = ass->readString(vm, stringOffset + nameOffset); - if (name == utf8) { + if (name == id) { pos = i; } else { ++i; @@ -907,26 +924,26 @@ extern "C" VMObject* System_Globalization_TextInfo_ToLower(VMObject* obj, PNetString* str) { verifyNull(str); - const UTF8* utf8 = str->value; + const ArrayUInt16* array = str->value; uint32 length = str->length; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); N3* vm = VMThread::get()->vm; - memcpy(buf, utf8->elements, length * sizeof(uint16)); - ILUnicodeStringToLower((void*)buf, (void*)utf8->elements, length); + memcpy(buf, array->elements, length * sizeof(uint16)); + ILUnicodeStringToLower((void*)buf, (void*)array->elements, length); const ArrayUInt16* res = vm->bufToArray(buf, length); return ((N3*)vm)->arrayToString(res); } extern "C" VMObject* System_String_Replace(PNetString* str, uint16 c1, uint16 c2) { - const UTF8* utf8 = str->value; + const ArrayUInt16* array = str->value; uint32 length = str->length; if ((c1 == c2) || length == 0) return str; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); - memcpy(buf, utf8->elements, length * sizeof(uint16)); + memcpy(buf, array->elements, length * sizeof(uint16)); for (uint32 i = 0; i < length; ++i) { if (buf[i] == c1) buf[i] = c2; } @@ -982,17 +999,17 @@ } extern "C" void System_String_CharFill(PNetString* str, sint32 start, sint32 count, char ch) { - const UTF8* utf8 = str->value; + const ArrayUInt16* array = str->value; sint32 length = start + count; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); - memcpy(buf, utf8->elements, start * sizeof(uint16)); + memcpy(buf, array->elements, start * sizeof(uint16)); for (sint32 i = 0; i < count; ++i) { buf[i + start] = ch; } N3* vm = VMThread::get()->vm; - const UTF8* val = vm->bufToUTF8(buf, length); + const ArrayUInt16* val = vm->bufToArray(buf, length); str->value = val; str->length = length; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.cpp?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.cpp Mon Oct 5 14:43:44 2009 @@ -24,25 +24,21 @@ using namespace llvm; -CLIString* CLIString::stringDup(const UTF8*& utf8, N3* vm) { +CLIString* CLIString::stringDup(const ArrayUInt16*& array, N3* vm) { PNetString* obj = (PNetString*)(*MSCorlib::pString)(); - obj->capacity = utf8->size; - obj->length = utf8->size; - if (utf8->size == 0) { + obj->capacity = array->size; + obj->length = array->size; + if (array->size == 0) { obj->firstChar = 0; } else { - obj->firstChar = utf8->at(0); + obj->firstChar = array->at(0); } - obj->value = utf8; + obj->value = array; return obj; } -const UTF8* CLIString::strToUTF8(N3* vm) { - return (UTF8*)((PNetString*)this)->value; -} - -ArrayUInt16* CLIString::strToArray(N3* vm) const { - return (ArrayUInt16*)((PNetString*)this)->value; +const ArrayUInt16* CLIString::strToArray(N3* vm) const { + return ((PNetString*)this)->value; } GlobalVariable* CLIString::llvmVar() { Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.h?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.h (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.h Mon Oct 5 14:43:44 2009 @@ -19,7 +19,7 @@ namespace n3 { -class UTF8; +class ArrayUInt16; class PNetString : public CLIString { public: @@ -28,7 +28,7 @@ sint32 capacity; sint32 length; uint8 firstChar; - const UTF8* value; + const ArrayUInt16* value; llvm::GlobalVariable* _llvmVar; }; Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Mon Oct 5 14:43:44 2009 @@ -34,9 +34,8 @@ llvm::GlobalVariable* llvmVar(); - static CLIString* stringDup(const UTF8*& utf8, N3* vm); - const UTF8* strToUTF8(N3* vm); - ArrayUInt16 *strToArray(N3 *vm) const; + static CLIString* stringDup(const ArrayUInt16*& array, N3* vm); + const ArrayUInt16 *strToArray(N3 *vm) const; }; } // end namespace jnjvm Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Mon Oct 5 14:43:44 2009 @@ -361,7 +361,7 @@ MSCorlib::loadBootstrap(vm); ClArgumentsInfo& info = vm->argumentsInfo; - ArrayObject* args = ArrayObject::acons(info.argc - 2, MSCorlib::arrayString); + ArrayObject* args = (ArrayObject*)MSCorlib::arrayString->doNew(info.argc-2); for (int i = 2; i < info.argc; ++i) { args->setAt(i - 2, (VMObject*)vm->arrayToString(vm->asciizToArray(info.argv[i]))); } @@ -413,8 +413,17 @@ } CLIString *N3::arrayToString(const ArrayUInt16 *array) { - const UTF8 *utf8 = arrayToUTF8(array); - return (CLIString*)CLIString::stringDup(utf8, this); + return (CLIString*)CLIString::stringDup(array, this); +} + +char* N3::arrayToAsciiz(const ArrayUInt16 *array) { + int size = array->size; + mvm::NativeString* buf = mvm::NativeString::alloc(size + 1); + for (sint32 i = 0; i < size; ++i) { + buf->setAt(i, array->elements[i]); + } + buf->setAt(size, 0); + return buf->cString(); } #include "MSCorlib.inc" Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Mon Oct 5 14:43:44 2009 @@ -129,6 +129,7 @@ // usefull string, uint16 and utf8 functions + char* arrayToAsciiz(const ArrayUInt16 *array); ArrayUInt16* asciizToArray(const char *asciiz); // done ArrayUInt16* bufToArray(const uint16 *buf, uint32 len); // done ArrayUInt16* UTF8ToArray(const UTF8 *utf8); // done Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Mon Oct 5 14:43:44 2009 @@ -277,18 +277,14 @@ MSCorlib::loadStringClass(vm); - MSCorlib::arrayString = ass->constructArray(vm->asciizToUTF8("String"), - System, 1); + MSCorlib::arrayString = ass->constructArray(vm->asciizToUTF8("String"), System, 1); MSCorlib::arrayString->baseClass = MSCorlib::pString; - MSCorlib::arrayByte = ass->constructArray(vm->asciizToUTF8("Byte"), - System, 1); + MSCorlib::arrayByte = ass->constructArray(vm->asciizToUTF8("Byte"), System, 1); MSCorlib::arrayByte->baseClass = MSCorlib::pUInt8; - MSCorlib::arrayObject = ass->constructArray(vm->asciizToUTF8("Object"), - System, 1); + MSCorlib::arrayObject = ass->constructArray(vm->asciizToUTF8("Object"), System, 1); MSCorlib::arrayObject->baseClass = MSCorlib::pObject; - N3::clinitName = vm->asciizToUTF8(".cctor"); N3::ctorName = vm->asciizToUTF8(".ctor"); Modified: vmkit/trunk/lib/N3/VMCore/Reader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Reader.cpp?rev=83320&r1=83319&r2=83320&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Reader.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Reader.cpp Mon Oct 5 14:43:44 2009 @@ -15,6 +15,7 @@ #include "MSCorlib.h" #include "N3.h" #include "VMArray.h" +#include "VMClass.h" #include "VMThread.h" #include "Reader.h" @@ -59,6 +60,8 @@ fseek(fp, 0, SeekEnd); long nbb = ftell(fp); fseek(fp, 0, SeekSet); + // printf("---> %p\n", MSCorlib::arrayByte); + // MSCorlib::arrayByte->doNew(nbb); res = ArrayUInt8::acons(nbb, MSCorlib::arrayByte); fread(res->elements, nbb, 1, fp); fclose(fp); From gael.thomas at lip6.fr Tue Oct 6 13:37:43 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 06 Oct 2009 20:37:43 -0000 Subject: [vmkit-commits] [vmkit] r83412 - in /vmkit/trunk/lib/N3/VMCore: UTF8.cpp UTF8.h Message-ID: <200910062037.n96KbhJH001954@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 6 15:37:42 2009 New Revision: 83412 URL: http://llvm.org/viewvc/llvm-project?rev=83412&view=rev Log: Add UTF8.cpp/UTF8.h. Added: vmkit/trunk/lib/N3/VMCore/UTF8.cpp vmkit/trunk/lib/N3/VMCore/UTF8.h Added: vmkit/trunk/lib/N3/VMCore/UTF8.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.cpp?rev=83412&view=auto ============================================================================== --- vmkit/trunk/lib/N3/VMCore/UTF8.cpp (added) +++ vmkit/trunk/lib/N3/VMCore/UTF8.cpp Tue Oct 6 15:37:42 2009 @@ -0,0 +1,175 @@ +#include "UTF8.h" +#include "VMThread.h" +#include "VMClass.h" +#include "VMArray.h" +#include "N3.h" +#include "MSCorlib.h" + +using namespace n3; + +#define AT(name, elmt) \ + elmt name::at(sint32 offset) const { \ + if (offset >= size) \ + VMThread::get()->vm->indexOutOfBounds(this, offset); \ + return elements[offset]; \ + } \ + void name::setAt(sint32 offset, elmt value) { \ + if (offset >= size) \ + VMThread::get()->vm->indexOutOfBounds(this, offset); \ + elements[offset] = value; \ + } + +#define INITIALISE(name) \ + void name::initialise(VMCommonClass* atype, sint32 n) { \ + VMObject::initialise(atype); \ + this->size = n; \ + for (int i = 0; i < n; i++) \ + elements[i] = 0; \ + } \ + +AT(UTF8, uint16) +INITIALISE(UTF8) + +#undef AT +#undef INITIALISE + + +UTF8* UTF8::acons(sint32 n, VMClassArray* atype) { + if (n < 0) + VMThread::get()->vm->negativeArraySizeException(n); + else if (n > VMArray::MaxArraySize) + VMThread::get()->vm->outOfMemoryError(n); + uint32 size = sizeof(VMObject) + sizeof(sint32) + n * sizeof(uint16); + UTF8* res = (UTF8*)gc::operator new(size, UTF8::VT); + res->initialise(atype, n); + return res; +} + +void UTF8::print(mvm::PrintBuffer* buf) const { + for (int i = 0; i < size; i++) + buf->writeChar((char)elements[i]); +} + +const UTF8* UTF8::extract(N3 *vm, uint32 start, uint32 end) const { + uint32 len = end - start; + uint16* buf = (uint16*)alloca(sizeof(uint16) * len); + + for (uint32 i = 0; i < len; i++) { + buf[i] = at(i + start); + } + + return readerConstruct(vm, buf, len); +} + +const UTF8* UTF8::asciizConstruct(N3* vm, const char* asciiz) { + return vm->asciizToUTF8(asciiz); +} + +const UTF8* UTF8::readerConstruct(N3* vm, uint16* buf, uint32 n) { + return vm->bufToUTF8(buf, n); +} + +char* UTF8::UTF8ToAsciiz() const { + mvm::NativeString* buf = mvm::NativeString::alloc(size + 1); + for (sint32 i = 0; i < size; ++i) { + buf->setAt(i, elements[i]); + } + buf->setAt(size, 0); + return buf->cString(); +} + + + +static uint32 asciizHasher(const char* asciiz, sint32 size) { + uint32 r0 = 0, r1 = 0; + for (sint32 i = 0; i < size; i++) { + char c = asciiz[i]; + r0 += c; + r1 ^= c; + } + return (r1 & 255) + ((r0 & 255) << 8); +} + +static uint32 readerHasher(const uint16* buf, sint32 size) { + uint32 r0 = 0, r1 = 0; + for (sint32 i = 0; i < size; i++) { + uint16 c = buf[i]; + r0 += c; + r1 ^= c; + } + return (r1 & 255) + ((r0 & 255) << 8); +} + +static bool asciizEqual(const UTF8* val, const char* asciiz, sint32 size) { + sint32 len = val->size; + if (len != size) return false; + else { + for (sint32 i = 0; i < len; i++) { + if (asciiz[i] != val->at(i)) return false; + } + return true; + } +} + +static bool readerEqual(const UTF8* val, const uint16* buf, sint32 size) { + sint32 len = val->size; + if (len != size) return false; + else return !(memcmp(val->elements, buf, len * sizeof(uint16))); +} + + +const UTF8* UTF8Map::lookupOrCreateAsciiz(const char* asciiz) { + sint32 size = strlen(asciiz); + uint32 key = asciizHasher(asciiz, size); + const UTF8* res = 0; + lock->lock(); + + std::pair p = map.equal_range(key); + + for (UTF8Map::iterator i = p.first; i != p.second; i++) { + if (asciizEqual(i->second, asciiz, size)) { + res = i->second; + break; + } + } + + if (res == 0) { + UTF8* tmp = (UTF8 *)UTF8::acons(size, MSCorlib::arrayChar); + for (sint32 i = 0; i < size; i++) { + tmp->setAt(i, asciiz[i]); + } + res = (const UTF8*)tmp; + map.insert(std::make_pair(key, res)); + } + + lock->unlock(); + return res; +} + +const UTF8* UTF8Map::lookupOrCreateReader(const uint16* buf, uint32 len) { + sint32 size = (sint32)len; + uint32 key = readerHasher(buf, size); + const UTF8* res = 0; + lock->lock(); + + std::pair p = map.equal_range(key); + + for (UTF8Map::iterator i = p.first; i != p.second; i++) { + if (readerEqual(i->second, buf, size)) { + res = i->second; + break; + } + } + + if (res == 0) { + UTF8* tmp = UTF8::acons(size, MSCorlib::arrayChar); + memcpy(tmp->elements, buf, len * sizeof(uint16)); + res = (const UTF8*)tmp; + map.insert(std::make_pair(key, res)); + } + + lock->unlock(); + return res; +} + + Added: vmkit/trunk/lib/N3/VMCore/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.h?rev=83412&view=auto ============================================================================== --- vmkit/trunk/lib/N3/VMCore/UTF8.h (added) +++ vmkit/trunk/lib/N3/VMCore/UTF8.h Tue Oct 6 15:37:42 2009 @@ -0,0 +1,109 @@ +#ifndef _N3_UTF8_ +#define _N3_UTF8_ + +#include "VMObject.h" +#include "mvm/PrintBuffer.h" + +namespace mvm { + class VirtualTable; +} + +namespace n3 { + class VMClassArray; + class N3; + +class UTF8 : public VMObject { +public: + static VirtualTable* VT; + sint32 size; + uint16 elements[1]; + + static const llvm::Type* llvmType; + static UTF8* acons(sint32 n, VMClassArray* cl); + void initialise(VMCommonClass* atype, sint32 n); + + unsigned short int at(sint32) const; + void setAt(sint32, uint16); + + virtual void print(mvm::PrintBuffer* buf) const; + + char* UTF8ToAsciiz() const; + static const UTF8* asciizConstruct(N3 *vm, const char* asciiz); + static const UTF8* readerConstruct(N3 *vm, uint16* buf, uint32 n); + + const UTF8* extract(N3 *vm, uint32 start, uint32 len) const; +}; + +class UTF8Map : public mvm::PermanentObject { +public: + typedef std::multimap::iterator iterator; + + mvm::Lock* lock; + std::multimap, + gc_allocator > > map; + + const UTF8* lookupOrCreateAsciiz(const char* asciiz); + const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); + + UTF8Map() { + lock = new mvm::LockNormal(); + } + + virtual void TRACER { + //lock->MARK_AND_TRACE; + for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { + i->second->MARK_AND_TRACE; + } + } + + virtual void print(mvm::PrintBuffer* buf) const { + buf->write("UTF8 Hashtable<>"); + } +}; + + +class UTF8Builder { + uint16 *buf; + uint32 cur; + uint32 size; + +public: + UTF8Builder(size_t size) { + size = (size < 4) ? 4 : size; + this->buf = new uint16[size]; + this->size = size; + } + + UTF8Builder *append(const UTF8 *utf8, uint32 start=0, uint32 length=0xffffffff) { + length = length == 0xffffffff ? utf8->size : length; + uint32 req = cur + length; + + if(req > size) { + uint32 newSize = size<<1; + while(req < newSize) + newSize <<= 1; + uint16 *newBuf = new uint16[newSize]; + memcpy(newBuf, buf, cur<<1); + delete []buf; + buf = newBuf; + size = newSize; + } + + memcpy(buf + cur, &utf8->elements + start, length<<1); + cur = req; + + return this; + } + + const UTF8 *toUTF8(UTF8Map *map) { + return map->lookupOrCreateReader(buf, size); + } + + ~UTF8Builder() { + delete [] buf; + } +}; + +} + +#endif From gael.thomas at lip6.fr Tue Oct 6 14:50:20 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 06 Oct 2009 21:50:20 -0000 Subject: [vmkit-commits] [vmkit] r83418 - in /vmkit/trunk/lib/N3/Mono: Mono.cpp MonoString.cpp MonoString.h Message-ID: <200910062150.n96LoK1s011880@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 6 16:50:20 2009 New Revision: 83418 URL: http://llvm.org/viewvc/llvm-project?rev=83418&view=rev Log: Adjust the mono version of n3 to use the new version of strings Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoString.cpp vmkit/trunk/lib/N3/Mono/MonoString.h Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=83418&r1=83417&r2=83418&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Tue Oct 6 16:50:20 2009 @@ -168,7 +168,7 @@ extern "C" void System_String_InternalCopyTo(MonoString* str, sint32 sindex, VMArray* dest, sint32 destIndex, sint32 count) { - const UTF8* contents = str->value; + const ArrayUInt16* contents = str->value; memcpy(&dest->elements[destIndex], &contents->elements[sindex], count * sizeof(uint16)); } @@ -280,11 +280,11 @@ extern "C" void System_String__ctor(MonoString* str, ArrayUInt16* array, sint32 startIndex, sint32 count) { - VirtualMachine* vm = VMThread::get()->vm; - const UTF8* utf8 = vm->bufToUTF8(&(array->elements[startIndex]), count); + N3* vm = VMThread::get()->vm; + const ArrayUInt16* value = vm->bufToArray(&(array->elements[startIndex]), count); str->length = count; str->startChar = array->elements[startIndex]; - str->value = utf8; + str->value = value; } extern "C" MonoString * Modified: vmkit/trunk/lib/N3/Mono/MonoString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.cpp?rev=83418&r1=83417&r2=83418&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.cpp Tue Oct 6 16:50:20 2009 @@ -25,30 +25,26 @@ using namespace llvm; -CLIString* CLIString::stringDup(const UTF8*& utf8, N3* vm) { +CLIString* CLIString::stringDup(const ArrayUInt16*& array, N3* vm) { MonoString* obj = (MonoString*)(*MSCorlib::pString)(); - obj->length = utf8->size; - if (utf8->size == 0) { + obj->length = array->size; + if (array->size == 0) { obj->startChar = 0; } else { - obj->startChar = utf8->at(0); + obj->startChar = array->at(0); } - obj->value = utf8; + obj->value = array; return obj; } -char* CLIString::strToAsciiz() { - return ((MonoString*)this)->value->UTF8ToAsciiz(); -} - -const UTF8* CLIString::strToUTF8(N3* vm) { - return ((MonoString*)this)->value; +const ArrayUInt16* CLIString::strToArray(N3* vm) const { + return ((MonoString *)this)->value; } GlobalVariable* CLIString::llvmVar() { MonoString* str = (MonoString*)this; if (!str->_llvmVar) { - VirtualMachine* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->vm; if (!str->_llvmVar) { const Type* pty = mvm::MvmModule::ptrType; Module* Mod = vm->getLLVMModule(); Modified: vmkit/trunk/lib/N3/Mono/MonoString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.h?rev=83418&r1=83417&r2=83418&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.h (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.h Tue Oct 6 16:50:20 2009 @@ -27,7 +27,7 @@ // !!! mono layout !!! sint32 length; uint8 startChar; - const UTF8* value; + const ArrayUInt16* value; llvm::GlobalVariable* _llvmVar; }; From gael.thomas at lip6.fr Tue Oct 6 16:21:44 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 06 Oct 2009 23:21:44 -0000 Subject: [vmkit-commits] [vmkit] r83431 - in /vmkit/trunk: ./ autoconf/ include/mvm/Config/ lib/JnJVM/Classpath/ lib/JnJVM/LLVMRuntime/ lib/Mvm/Compiler/ lib/Mvm/StaticGCPass/ lib/N3/LLVMRuntime/ lib/N3/Mono/ lib/N3/PNetLib/ lib/N3/VMCore/ tools/jnjvm/ tools/llcj/ tools/n3-mono/ tools/n3-pnetlib/ tools/vmjc/ tools/vmkit/ Message-ID: <200910062321.n96NLio2023965@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 6 18:21:43 2009 New Revision: 83431 URL: http://llvm.org/viewvc/llvm-project?rev=83431&view=rev Log: Add svn:ignore in most of the directories Modified: vmkit/trunk/ (props changed) vmkit/trunk/autoconf/ (props changed) vmkit/trunk/include/mvm/Config/ (props changed) vmkit/trunk/lib/JnJVM/Classpath/ (props changed) vmkit/trunk/lib/JnJVM/LLVMRuntime/ (props changed) vmkit/trunk/lib/Mvm/Compiler/ (props changed) vmkit/trunk/lib/Mvm/StaticGCPass/ (props changed) vmkit/trunk/lib/N3/LLVMRuntime/ (props changed) vmkit/trunk/lib/N3/Mono/ (props changed) vmkit/trunk/lib/N3/PNetLib/ (props changed) vmkit/trunk/lib/N3/VMCore/ (props changed) vmkit/trunk/tools/jnjvm/ (props changed) vmkit/trunk/tools/llcj/ (props changed) vmkit/trunk/tools/n3-mono/ (props changed) vmkit/trunk/tools/n3-pnetlib/ (props changed) vmkit/trunk/tools/vmjc/ (props changed) vmkit/trunk/tools/vmkit/ (props changed) Propchange: vmkit/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -1,39 +1,10 @@ +do-find Makefile.config -do-conf +replace.sh config.log +*.tmp +Release +do-conf +configure.out config.status -svn-ignore Makefile.common -do-make -include/mvm/Config/config.h -tools/vmjc/vmkitoptimized.bc -tools/vmjc/vmkit.s -tools/vmjc/vmkit.bc -tools/jnjvm/vmkitoptimized.bc -tools/jnjvm/jnjvm.s -tools/jnjvm/jnjvm.bc -tools/llcj/LinkPaths.h -tools/vmkit/vmkitoptimized.bc -tools/vmkit/vmkit.s -tools/vmkit/vmkit.bc -tools/n3-pnetlib/Release -tools/n3-pnetlib/vmkitoptimized.bc -tools/n3-pnetlib/vmkit.s -tools/n3-pnetlib/vmkit.bc -lib/Mvm/Runtime/LLVMAssembly.gen.ll -lib/Mvm/Runtime/LLVMAssembly.s -lib/Mvm/StaticGCPass/Release -lib/Mvm/Compiler/LLVMRuntime.inc -lib/Mvm/Compiler/LLVMRuntime.gen.ll -lib/N3/Mono/MonoPath.inc -lib/N3/VMCore/Release -lib/N3/PNetLib/Release -lib/N3/PNetLib/PNetPath.inc -lib/N3/LLVMRuntime/LLVMRuntime.inc -lib/N3/LLVMRuntime/LLVMRuntime.gen.ll -lib/JnJVM/Classpath/Classpath.h -lib/JnJVM/LLVMRuntime/LLVMRuntime.inc -lib/JnJVM/LLVMRuntime/LLVMRuntime.gen.ll -autoconf/autom4te.cache -autoconf/aclocal.m4 -autoconf/configure.bak Propchange: vmkit/trunk/autoconf/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1,3 @@ +autom4te.cache +aclocal.m4 +configure.bak Propchange: vmkit/trunk/include/mvm/Config/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1 @@ +config.h Propchange: vmkit/trunk/lib/JnJVM/Classpath/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -1,2 +1,3 @@ -Debug Release +Classpath.inc +Classpath.h Propchange: vmkit/trunk/lib/JnJVM/LLVMRuntime/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1,3 @@ +Release +LLVMRuntime.inc +LLVMRuntime.gen.ll Propchange: vmkit/trunk/lib/Mvm/Compiler/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -1,2 +1,3 @@ -Debug Release +LLVMRuntime.inc +LLVMRuntime.gen.ll Propchange: vmkit/trunk/lib/Mvm/StaticGCPass/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1 @@ +Release Propchange: vmkit/trunk/lib/N3/LLVMRuntime/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1,3 @@ +Release +LLVMRuntime.inc +LLVMRuntime.gen.ll Propchange: vmkit/trunk/lib/N3/Mono/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1,2 @@ +Release +MonoPath.inc Propchange: vmkit/trunk/lib/N3/PNetLib/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1,2 @@ +Release +PNetPath.inc Propchange: vmkit/trunk/lib/N3/VMCore/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1 @@ +Release Propchange: vmkit/trunk/tools/jnjvm/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -1,2 +1,6 @@ -Debug Release +vmkitoptimized.bc +vmkit.s +vmkit.bc +jnjvm.s +jnjvm.bc Propchange: vmkit/trunk/tools/llcj/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -1,2 +1,2 @@ -Debug Release +LinkPaths.h Propchange: vmkit/trunk/tools/n3-mono/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1,4 @@ +Release +vmkitoptimized.bc +vmkit.s +vmkit.bc Propchange: vmkit/trunk/tools/n3-pnetlib/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -0,0 +1,4 @@ +Release +vmkitoptimized.bc +vmkit.s +vmkit.bc Propchange: vmkit/trunk/tools/vmjc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -1,2 +1,4 @@ -Debug Release +vmkitoptimized.bc +vmkit.s +vmkit.bc Propchange: vmkit/trunk/tools/vmkit/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Tue Oct 6 18:21:43 2009 @@ -1,2 +1,4 @@ -Debug Release +vmkitoptimized.bc +vmkit.s +vmkit.bc From gael.thomas at lip6.fr Thu Oct 8 09:55:30 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Thu, 08 Oct 2009 16:55:30 -0000 Subject: [vmkit-commits] [vmkit] r83554 - in /vmkit/trunk/lib/N3: PNetLib/PNetLib.cpp VMCore/Assembly.cpp VMCore/CLIJit.cpp VMCore/CLIRuntimeJIT.cpp VMCore/N3.cpp VMCore/N3Initialise.cpp VMCore/UTF8.cpp VMCore/UTF8.h VMCore/VMClass.cpp Message-ID: <200910081655.n98GtUGc001116@zion.cs.uiuc.edu> Author: gthomas Date: Thu Oct 8 11:55:29 2009 New Revision: 83554 URL: http://llvm.org/viewvc/llvm-project?rev=83554&view=rev Log: Unification of n3::UTF8 and mvm::UTF8 in progress Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/UTF8.cpp vmkit/trunk/lib/N3/VMCore/UTF8.h vmkit/trunk/lib/N3/VMCore/VMClass.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Thu Oct 8 11:55:29 2009 @@ -693,7 +693,7 @@ if (item->getVirtualTable() == Property::VT) { Property* prop = (Property*)item; if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) { - char* asciiz = prop->name->UTF8ToAsciiz(); + const char* asciiz = utf8ToAsciiz(prop->name); char* buf = (char*)alloca(strlen(asciiz) + 5); sprintf(buf, "get_%s", asciiz); N3* vm = VMThread::get()->vm; Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Thu Oct 8 11:55:29 2009 @@ -363,12 +363,12 @@ } uint16* buf = (uint16*) alloca(sizeof(uint16) * size); for (i = 0; i < name->size; i++) { - buf[i] = name->at(i); + buf[i] = name->elements[i]; } buf[i++] = '<'; for (std::vector::iterator it = genArgs.begin(), e = genArgs.end(); it!= e; ++it) { for (int j = 0; j < (*it)->name->size; i++, j++) { - buf[i] = (*it)->name->at(j); + buf[i] = (*it)->name->elements[j]; } buf[i++] = ','; } @@ -1253,7 +1253,7 @@ } } - ArrayObject* res = ArrayObject::acons(vec.size(), MSCorlib::arrayObject); + ArrayObject* res = (ArrayObject*)MSCorlib::arrayObject->doNew(vec.size()); for (uint32 i = 0; i < vec.size(); ++i) res->elements[i] = vec[i]; Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Thu Oct 8 11:55:29 2009 @@ -1547,8 +1547,8 @@ PointerType::getUnqual(module->getTypeByName("ArrayFloat")); ArrayObject::llvmType = PointerType::getUnqual(module->getTypeByName("ArrayObject")); - UTF8::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayUInt16")); + // UTF8::llvmType = + // PointerType::getUnqual(module->getTypeByName("ArrayUInt16")); CacheNode::llvmType = PointerType::getUnqual(module->getTypeByName("CacheNode")); Enveloppe::llvmType = Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Thu Oct 8 11:55:29 2009 @@ -138,9 +138,9 @@ orig->parameters, false, true); if (dmeth == 0) { - char* methAsciiz = orig->name->UTF8ToAsciiz(); - char* nameAsciiz = orig->classDef->name->UTF8ToAsciiz(); - char* nameSpaceAsciiz = orig->classDef->nameSpace->UTF8ToAsciiz(); + const char* methAsciiz = utf8ToAsciiz(orig->name); + const char* nameAsciiz = utf8ToAsciiz(orig->classDef->name); + const char* nameSpaceAsciiz = utf8ToAsciiz(orig->classDef->nameSpace); char *buf = (char*)alloca(3 + strlen(methAsciiz) + strlen(nameAsciiz) + Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Thu Oct 8 11:55:29 2009 @@ -236,9 +236,9 @@ } ArrayUInt8* N3::openAssembly(const UTF8* name, const char* ext) { - char* asciiz = name->UTF8ToAsciiz(); + const char* asciiz = utf8ToAsciiz(name); uint32 alen = strlen(asciiz); - + ArrayUInt8* res = 0; uint32 idx = 0; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Thu Oct 8 11:55:29 2009 @@ -157,9 +157,6 @@ const llvm::Type* ArrayDouble::llvmType = 0; const llvm::Type* ArrayLong::llvmType = 0; const llvm::Type* ArrayObject::llvmType = 0; -const llvm::Type* UTF8::llvmType = 0; - - static void initialiseVT() { @@ -188,7 +185,12 @@ INIT(ArrayFloat); INIT(ArrayDouble); INIT(ArrayObject); - INIT(UTF8); + + { + UTF8 fake(0); + UTF8::VT = ((VirtualTable**)(void*)(&fake))[0]; + } + INIT(VMCond); INIT(LockObj); INIT(VMObject); Modified: vmkit/trunk/lib/N3/VMCore/UTF8.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/UTF8.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/UTF8.cpp Thu Oct 8 11:55:29 2009 @@ -7,58 +7,20 @@ using namespace n3; -#define AT(name, elmt) \ - elmt name::at(sint32 offset) const { \ - if (offset >= size) \ - VMThread::get()->vm->indexOutOfBounds(this, offset); \ - return elements[offset]; \ - } \ - void name::setAt(sint32 offset, elmt value) { \ - if (offset >= size) \ - VMThread::get()->vm->indexOutOfBounds(this, offset); \ - elements[offset] = value; \ - } - -#define INITIALISE(name) \ - void name::initialise(VMCommonClass* atype, sint32 n) { \ - VMObject::initialise(atype); \ - this->size = n; \ - for (int i = 0; i < n; i++) \ - elements[i] = 0; \ - } \ - -AT(UTF8, uint16) -INITIALISE(UTF8) - -#undef AT -#undef INITIALISE - - -UTF8* UTF8::acons(sint32 n, VMClassArray* atype) { - if (n < 0) - VMThread::get()->vm->negativeArraySizeException(n); - else if (n > VMArray::MaxArraySize) - VMThread::get()->vm->outOfMemoryError(n); - uint32 size = sizeof(VMObject) + sizeof(sint32) + n * sizeof(uint16); - UTF8* res = (UTF8*)gc::operator new(size, UTF8::VT); - res->initialise(atype, n); - return res; -} - void UTF8::print(mvm::PrintBuffer* buf) const { for (int i = 0; i < size; i++) buf->writeChar((char)elements[i]); } -const UTF8* UTF8::extract(N3 *vm, uint32 start, uint32 end) const { +const UTF8* UTF8::extract(UTF8Map *map, uint32 start, uint32 end) const { uint32 len = end - start; uint16* buf = (uint16*)alloca(sizeof(uint16) * len); for (uint32 i = 0; i < len; i++) { - buf[i] = at(i + start); + buf[i] = elements[i + start]; } - return readerConstruct(vm, buf, len); + return map->lookupOrCreateReader(buf, len); } const UTF8* UTF8::asciizConstruct(N3* vm, const char* asciiz) { @@ -69,17 +31,6 @@ return vm->bufToUTF8(buf, n); } -char* UTF8::UTF8ToAsciiz() const { - mvm::NativeString* buf = mvm::NativeString::alloc(size + 1); - for (sint32 i = 0; i < size; ++i) { - buf->setAt(i, elements[i]); - } - buf->setAt(size, 0); - return buf->cString(); -} - - - static uint32 asciizHasher(const char* asciiz, sint32 size) { uint32 r0 = 0, r1 = 0; for (sint32 i = 0; i < size; i++) { @@ -105,7 +56,7 @@ if (len != size) return false; else { for (sint32 i = 0; i < len; i++) { - if (asciiz[i] != val->at(i)) return false; + if (asciiz[i] != val->elements[i]) return false; } return true; } @@ -134,9 +85,9 @@ } if (res == 0) { - UTF8* tmp = (UTF8 *)UTF8::acons(size, MSCorlib::arrayChar); + UTF8* tmp = (UTF8 *)new(size) UTF8(size); for (sint32 i = 0; i < size; i++) { - tmp->setAt(i, asciiz[i]); + tmp->elements[i] = asciiz[i]; } res = (const UTF8*)tmp; map.insert(std::make_pair(key, res)); @@ -162,7 +113,7 @@ } if (res == 0) { - UTF8* tmp = UTF8::acons(size, MSCorlib::arrayChar); + UTF8* tmp = new(size) UTF8(size); memcpy(tmp->elements, buf, len * sizeof(uint16)); res = (const UTF8*)tmp; map.insert(std::make_pair(key, res)); Modified: vmkit/trunk/lib/N3/VMCore/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.h?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/UTF8.h (original) +++ vmkit/trunk/lib/N3/VMCore/UTF8.h Thu Oct 8 11:55:29 2009 @@ -10,6 +10,7 @@ namespace n3 { class VMClassArray; + class UTF8Map; class N3; class UTF8 : public VMObject { @@ -17,21 +18,23 @@ static VirtualTable* VT; sint32 size; uint16 elements[1]; - - static const llvm::Type* llvmType; - static UTF8* acons(sint32 n, VMClassArray* cl); - void initialise(VMCommonClass* atype, sint32 n); - unsigned short int at(sint32) const; - void setAt(sint32, uint16); + /// operator new - Redefines the new operator of this class to allocate + /// its objects in permanent memory, not with the garbage collector. + void* operator new(size_t sz, sint32 n) { + return gc::operator new(sizeof(VMObject) + sizeof(sint32) + n * sizeof(uint16), UTF8::VT); + } + UTF8(sint32 n) { + size = n; + } + virtual void print(mvm::PrintBuffer* buf) const; - char* UTF8ToAsciiz() const; static const UTF8* asciizConstruct(N3 *vm, const char* asciiz); static const UTF8* readerConstruct(N3 *vm, uint16* buf, uint32 n); - const UTF8* extract(N3 *vm, uint32 start, uint32 len) const; + const UTF8* extract(UTF8Map *vm, uint32 start, uint32 len) const; }; class UTF8Map : public mvm::PermanentObject { @@ -104,6 +107,61 @@ } }; + +/// UTF8Buffer - Helper class to create char* buffers suitable for +/// printf. +/// +class UTF8Buffer { + + /// buffer - The buffer that holds a string representation. + /// + char* buffer; +public: + + /// UTF8Buffer - Create a buffer with the following UTF8. + /// + UTF8Buffer(const UTF8* val) { + buffer = new char[val->size + 1]; + for (sint32 i = 0; i < val->size; ++i) + buffer[i] = val->elements[i]; + buffer[val->size] = 0; + printf("buffer: %s (%d)\n", buffer, val->size); + } + + /// ~UTF8Buffer - Delete the buffer, as well as all dynamically + /// allocated memory. + /// + ~UTF8Buffer() { + printf("Destructor :(\n"); + delete[] buffer; + } + + /// replaceWith - replace the content of the buffer and free the old buffer + /// + void replaceWith(char *buffer) { + delete[] this->buffer; + this->buffer = buffer; + } + + + /// cString - Return a C string representation of the buffer, suitable + /// for printf. + /// + const char* cString() { + printf("cString: %s\n", buffer); + return buffer; + } +}; + +inline char *_utf8ToAsciiz(const UTF8 *val, char *buffer) { + for (sint32 i = 0; i < val->size; ++i) + buffer[i] = val->elements[i]; + buffer[val->size] = 0; + return buffer; +} + +#define utf8ToAsciiz(utf8) _utf8ToAsciiz(utf8, (char*)alloca(utf8->size + 1)) + } #endif Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83554&r1=83553&r2=83554&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Thu Oct 8 11:55:29 2009 @@ -172,7 +172,7 @@ } const UTF8* VMClassArray::constructArrayName(const UTF8* name, uint32 dims) { - const char* asciiz = name->UTF8ToAsciiz(); + const char* asciiz = utf8ToAsciiz(name); char* res = (char*)alloca(strlen(asciiz) + (dims * 2) + 1); sprintf(res, asciiz); @@ -184,7 +184,7 @@ } const UTF8* VMClassPointer::constructPointerName(const UTF8* name, uint32 dims) { - const char* asciiz = name->UTF8ToAsciiz(); + const char* asciiz = utf8ToAsciiz(name); char* res = (char*)alloca(strlen(asciiz) + (dims * 2) + 1); sprintf(res, asciiz); From gael.thomas at lip6.fr Sat Oct 10 04:41:27 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 11:41:27 -0000 Subject: [vmkit-commits] [vmkit] r83708 - in /vmkit/trunk: include/mvm/Object.h include/mvm/PrintBuffer.h include/mvm/UTF8.h lib/JnJVM/VMCore/JavaClass.cpp lib/JnJVM/VMCore/Jnjvm.cpp lib/Mvm/Runtime/Object.cpp lib/Mvm/Runtime/UTF8.cpp lib/N3/PNetLib/PNetLib.cpp lib/N3/VMCore/Assembly.cpp lib/N3/VMCore/CLIJit.cpp lib/N3/VMCore/CLISignature.cpp lib/N3/VMCore/N3.cpp lib/N3/VMCore/N3.h lib/N3/VMCore/N3Initialise.cpp lib/N3/VMCore/NativeUtil.cpp lib/N3/VMCore/Opcodes.cpp lib/N3/VMCore/VMArray.cpp lib/N3/VMCore/VMClass.cpp Message-ID: <200910101141.n9ABfSTK014481@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 06:41:26 2009 New Revision: 83708 URL: http://llvm.org/viewvc/llvm-project?rev=83708&view=rev Log: Remove definitely printString. Now, a PrintBuffer is used without the gc. Remark: there is a buf when I launch vmkit without parameter. I do not understand this bug and I don't now if it comes from my modifications... Modified: vmkit/trunk/include/mvm/Object.h vmkit/trunk/include/mvm/PrintBuffer.h vmkit/trunk/include/mvm/UTF8.h vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp vmkit/trunk/lib/Mvm/Runtime/Object.cpp vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLISignature.cpp vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMArray.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp Modified: vmkit/trunk/include/mvm/Object.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Object.h?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Object.h (original) +++ vmkit/trunk/include/mvm/Object.h Sat Oct 10 06:41:26 2009 @@ -32,11 +32,6 @@ /// class Object : public gc { public: - - /// printString - Returns a string representation of this object. - /// - char *printString(void) const; - /// tracer - Default implementation of tracer. Does nothing. /// virtual void tracer() {} Modified: vmkit/trunk/include/mvm/PrintBuffer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/include/mvm/PrintBuffer.h (original) +++ vmkit/trunk/include/mvm/PrintBuffer.h Sat Oct 10 06:41:26 2009 @@ -15,66 +15,18 @@ #include "types.h" #include "mvm/Object.h" +#include "mvm/UTF8.h" namespace mvm { - -/// NativeString - This class is the equivalent of a char*, but allocated -/// by the GC, hence has a virtual table. -/// -class NativeString : public gc { -public: - - /// VT - The virtual table of this class. - /// - static VirtualTable VT; - - /// cString - Returns the C equivalent of the NativeString. - /// - inline char *cString() { return (char *)(this + 1); } - - /// readString - Copies the C string to a newly allocated NativeString. - inline static NativeString *readString(char *cStr) { - size_t nbb = strlen(cStr); - NativeString * res = alloc(nbb + 1); - memcpy(res->cString(), cStr, nbb + 1); - return res; - } - - /// alloc - Allocates a NativeString of size len. - /// - static inline NativeString *alloc(size_t len) { - return (NativeString *)gc::operator new(len + sizeof(VirtualTable*), &VT); - } - - /// realloc - Reallocate a native string of size len. - /// - inline NativeString *realloc(size_t len) { - return (NativeString *)gc::realloc(len + sizeof(VirtualTable*)); - } - - /// setAt - Sets the char c at position pos in the NativeString. - /// - inline void setAt(int pos, char c) { - cString()[pos] = c; - } - -public: - - /// print - Just prints the NativeString. - /// - virtual void print(PrintBuffer *buf) const; - -}; - /// PrintBuffer - This class is a buffered string. /// -class PrintBuffer : public gc { -private: +class PrintBuffer { +public: - /// _contents - The buffer. + /// contents - The buffer. /// - NativeString* _contents; + char* contents; /// capacity - The capacity of the current buffer. /// @@ -85,40 +37,64 @@ /// uint32 writePosition; + void init() { + capacity = 256; + contents = new char[capacity]; + writePosition = 0; + } public: - - /// VT - The virtual table of this class. - /// - static VirtualTable VT; - - - /// contents - Returns the buffer. - /// - NativeString* contents() { - return _contents; - } + PrintBuffer() { + init(); + } - /// setContents - Sets the buffer. - /// - void setContents(NativeString* n) { - _contents = n; - } + template + PrintBuffer(const T *obj) { + init(); + writeObj(obj); + } - /// write - Writes to this PrintBuffer. - /// - inline PrintBuffer *write(const char *string) { - size_t len= strlen(string); - if ((writePosition + len + 1) >= capacity) { - while ((writePosition + len + 1) >= capacity) + ~PrintBuffer() { + delete contents; + } + + char *cString() { + return contents; + } + + void ensureCapacity(uint32 len) { + uint32 size = writePosition + len + 1; + if (size >= capacity) { + while (size >= capacity) capacity*= 4; - setContents(contents()->realloc(capacity)); + char *newContents = new char[capacity]; + memcpy(newContents, contents, writePosition); + delete[] contents; + contents = newContents; } - strcpy(contents()->cString() + writePosition, string); + } + + /// write - Writes to this PrintBuffer. + /// + virtual PrintBuffer *write(const char *string) { + uint32 len= strlen(string); + ensureCapacity(len); + strcpy(cString() + writePosition, string); writePosition+= len; return this; } - + + /// writeChar - Writes a char. + inline PrintBuffer *writeUTF8(const UTF8 *utf8) { + uint32 len = utf8->size; + ensureCapacity(len); + for(uint32 i=0; ielements[i], utf8->elements[i]); + contents[writePosition + i] = utf8->elements[i]; + } + contents[writePosition += len] = 0; + return this; + } /// writeChar - Writes a char. inline PrintBuffer *writeChar(char v) { @@ -126,7 +102,6 @@ sprintf(buf, "%c", v); return write(buf); } - /// writeChar - Writes a int32. inline PrintBuffer *writeS4(int v) { @@ -172,32 +147,11 @@ /// writeObj - Writes an Object to the buffer. /// - PrintBuffer *writeObj(const Object *); - -public: - - /// alloc - Allocates a default PrintBuffer. - /// - static PrintBuffer *alloc(void) { - PrintBuffer* pbf = (PrintBuffer*)gc::operator new(sizeof(PrintBuffer), &VT); - pbf->capacity= 32; - pbf->writePosition= 0; - pbf->setContents(NativeString::alloc(pbf->capacity)); - return pbf; - } - - template - static char *objectToString(T *obj) { - PrintBuffer *buf = alloc(); - obj->print(buf); - return buf->contents()->cString(); + template + inline PrintBuffer *writeObj(const T *obj) { + obj->print(this); + return this; } - - /// tracer - Traces this PrintBuffer. - /// - static void staticTracer(PrintBuffer* obj) { - obj->contents()->markAndTrace(); - } }; } // end namespace mvm Modified: vmkit/trunk/include/mvm/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/UTF8.h?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/include/mvm/UTF8.h (original) +++ vmkit/trunk/include/mvm/UTF8.h Sat Oct 10 06:41:26 2009 @@ -6,6 +6,7 @@ namespace mvm { +class PrintBuffer; class UTF8Map; class UTF8 { @@ -14,8 +15,8 @@ /// operator new - Redefines the new operator of this class to allocate /// its objects in permanent memory, not with the garbage collector. - void* operator new(size_t sz, mvm::BumpPtrAllocator& allocator, sint32 size) { - return allocator.Allocate(sizeof(ssize_t) + size * sizeof(uint16), "UTF8"); + void* operator new(size_t sz, mvm::BumpPtrAllocator& allocator, sint32 n) { + return allocator.Allocate(sizeof(UTF8) + (n - 1) * sizeof(uint16), "UTF8"); } UTF8(sint32 n) { @@ -54,7 +55,8 @@ else return memcmp((const char*)elements, (const char*)other->elements, size * sizeof(uint16)) < 0; } - + + virtual void print(PrintBuffer *pb) const; }; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.cpp Sat Oct 10 06:41:26 2009 @@ -819,7 +819,7 @@ PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "; ", 0); PRINT_DEBUG(JNJVM_LOAD, 0, LIGHT_GREEN, "reading ", 0); - PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "%s\n", printString()); + PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "%s\n", mvm::PrintBuffer(this).cString()); Reader reader(&bytes); uint32 magic = reader.readU4(); Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Sat Oct 10 06:41:26 2009 @@ -174,7 +174,7 @@ PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "; ", 0); PRINT_DEBUG(JNJVM_LOAD, 0, LIGHT_GREEN, "clinit ", 0); - PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "%s\n", printString()); + PRINT_DEBUG(JNJVM_LOAD, 0, COLOR_NORMAL, "%s\n", mvm::PrintString(this).cString()); Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Sat Oct 10 06:41:26 2009 @@ -20,10 +20,6 @@ using namespace mvm; - -VirtualTable NativeString::VT(0, 0, (uintptr_t)VirtualTable::emptyTracer); -VirtualTable PrintBuffer::VT(0, 0, (uintptr_t)PrintBuffer::staticTracer); - extern "C" void printFloat(float f) { fprintf(stderr, "%f\n", f); } @@ -40,32 +36,6 @@ fprintf(stderr, "%d\n", i); } -extern "C" void printObject(mvm::Object* obj) { - fprintf(stderr, "%s\n", obj->printString()); -} - - -PrintBuffer *PrintBuffer::writeObj(const Object *obj) { - Object *beg = (Object*)Collector::begOf(obj); - - if(beg) { - if(beg == obj) { - obj->print((mvm::PrintBuffer*)this); - } else { - write("print(this); - write("] -- offset "); - writeS4((intptr_t)obj - (intptr_t)beg); - write(">"); - } - } else { - write(""); - } - return this; -} - extern "C" void write_ptr(PrintBuffer* buf, void* obj) { buf->writePtr(obj); } @@ -78,43 +48,12 @@ buf->write(a); } -char *Object::printString(void) const { - PrintBuffer *buf= PrintBuffer::alloc(); - buf->writeObj(this); - return buf->contents()->cString(); -} - void Object::print(PrintBuffer *buf) const { buf->write("writePtr((void*)this); buf->write(">"); } -void NativeString::print(PrintBuffer *buf) const { - NativeString *const self= (NativeString *)this; - buf->write("\""); - for (size_t i= 0; i < strlen(self->cString()); ++i) { - int c= self->cString()[i]; - switch (c) { - case '\b': buf->write("\\b"); break; - case '\f': buf->write("\\f"); break; - case '\n': buf->write("\\n"); break; - case '\r': buf->write("\\r"); break; - case '\t': buf->write("\\t"); break; - case '"': buf->write("\\\""); break; - default: { - char esc[32]; - if (c < 32) - sprintf(esc, "\\x%02x", c); - else - sprintf(esc, "%c", c); - buf->write(esc); - } - } - } - buf->write("\""); -} - typedef void (*destructor_t)(void*); Modified: vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/UTF8.cpp Sat Oct 10 06:41:26 2009 @@ -1,7 +1,13 @@ #include "mvm/UTF8.h" +#include "mvm/PrintBuffer.h" using namespace mvm; +void UTF8::print(PrintBuffer *pb) const { + pb->writeUTF8(this); +} + + const UTF8* UTF8::extract(UTF8Map* map, uint32 start, uint32 end) const { uint32 len = end - start; uint16* buf = (uint16*)alloca(sizeof(uint16) * len); Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 10 06:41:26 2009 @@ -523,7 +523,7 @@ extern "C" VMObject* System_Reflection_Assembly_LoadFromName(PNetString* str, sint32 & error, VMObject* parent) { N3* vm = (N3*)(VMThread::get()->vm); Assembly* ass = vm->loadAssembly(vm->arrayToUTF8(str->value), "dll"); - if (!ass) vm->error("unfound assembly %s\n", str->value->printString()); + if (!ass) vm->error("unfound assembly %s\n", mvm::PrintBuffer(str->value).cString()); error = 0; return ass->getAssemblyDelegatee(); } @@ -620,7 +620,8 @@ extern "C" VMObject* System_Reflection_Assembly_GetType(VMObject* obj, PNetString* str, bool onError, bool ignoreCase) { Assembly* ass = ASSEMBLY_VALUE(obj); const ArrayUInt16* array = str->value; - char* asciiz = ass->vm->arrayToAsciiz(array); + mvm::PrintBuffer pb(array); + char* asciiz = pb.cString(); char* index = (char*)sys_memrchr(asciiz, '.', strlen(asciiz)); N3* vm = ass->vm; @@ -758,7 +759,7 @@ if ((obj != 0) && virt) { if (!(obj->classOf->isAssignableFrom(type))) { - VMThread::get()->vm->illegalArgumentException(meth->name->printString()); + VMThread::get()->vm->illegalArgumentException(mvm::PrintBuffer(meth->name).cString()); } verifyNull(obj); } Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sat Oct 10 06:41:26 2009 @@ -374,7 +374,7 @@ } buf[i] = '>'; const UTF8* genName = UTF8::readerConstruct(VMThread::get()->vm, buf, size); - //printf("%s\n", genName->printString()); + //printf("%s\n", mvm::PrintBuffer(genName).cString()); ClassNameCmp CC(genName, nameSpace); VMGenericClass* cl = (VMGenericClass*) loadedNameClasses->lookupOrCreate(CC, this, genClassDup); @@ -825,8 +825,8 @@ void Assembly::read() { Reader* reader = newReader(bytes); - PRINT_DEBUG(DEBUG_LOAD, 1, LIGHT_GREEN, "Reading %s::%s", vm->printString(), - this->printString()); + PRINT_DEBUG(DEBUG_LOAD, 1, LIGHT_GREEN, "Reading %s::%s", mvm::PrintBuffer(vm).cString(), + mvm::PrintBuffer(this).cString()); textSection = new(allocator, "Section") Section(); rsrcSection = new(allocator, "Section") Section(); Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Sat Oct 10 06:41:26 2009 @@ -485,7 +485,7 @@ } else if (meth->name == vm->asciizToUTF8("Address")) { func = 2; } else { - vm->error("implement me %s", meth->name->printString()); + vm->error("implement me %s", mvm::PrintBuffer(meth->name).cString()); } VMClassArray* type = (VMClassArray*)meth->classDef; @@ -607,7 +607,7 @@ Value* obj = 0; if (type->isPointer) { - VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer::objectToString(type)); + VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer(type).cString()); } else if (type->isArray) { VMClassArray* arrayType = (VMClassArray*)type; Value* valCl = new LoadInst(arrayType->llvmVar(), "", currentBlock); @@ -911,7 +911,7 @@ Function* CLIJit::compileIntern() { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "intern compile %s\n", - compilingMethod->printString()); + mvm::PrintBuffer(compilingMethod).cString()); if (compilingClass->subclassOf(MSCorlib::pDelegate)) { const UTF8* name = compilingMethod->name; @@ -919,14 +919,14 @@ else if (name == N3::invokeName) return invokeDelegate(); else VMThread::get()->vm->error("implement me"); } else { - VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer::objectToString(compilingClass)); + VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer(compilingClass).cString()); } return 0; } Function* CLIJit::compileNative(VMGenericMethod* genMethod) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "native compile %s\n", - compilingMethod->printString()); + mvm::PrintBuffer(compilingMethod)); const FunctionType *funcType = compilingMethod->getSignature(genMethod); @@ -1148,7 +1148,7 @@ Function* CLIJit::compileFatOrTiny(VMGenericClass* genClass, VMGenericMethod* genMethod) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "tiny or fat compile %s\n", - compilingMethod->printString()); + mvm::PrintBuffer(compilingMethod).cString()); uint32 offset = compilingMethod->offset; ArrayUInt8* bytes = compilingClass->assembly->bytes; uint8 header = READ_U1(bytes, offset); @@ -1314,7 +1314,7 @@ if (nbe == 0 && codeLen < 50) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "%s can be inlined\n", - compilingMethod->printString()); + mvm::PrintBuffer(compilingMethod).cString()); compilingMethod->canBeInlined = true; } @@ -1326,7 +1326,7 @@ std::vector& args, VMGenericClass* genClass, VMGenericMethod* genMethod) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "tiny or fat inline compile %s\n", - compilingMethod->printString()); + mvm::PrintBuffer(compilingMethod).cString()); uint32 offset = compilingMethod->offset; ArrayUInt8* bytes = compilingClass->assembly->bytes; uint8 header = READ_U1(bytes, offset); @@ -1439,7 +1439,7 @@ PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "end tiny or fat inline compile %s\n", - compilingMethod->printString()); + mvm::PrintBuffer(compilingMethod).cString()); return endNode; } @@ -1471,7 +1471,7 @@ classDef->aquire(); if (methPtr == 0) { methPtr = Function::Create(getSignature(genMethod), GlobalValue::GhostLinkage, - mvm::PrintBuffer::objectToString(this), classDef->vm->getLLVMModule()); + mvm::PrintBuffer(this).cString(), classDef->vm->getLLVMModule()); classDef->vm->functions->hash(methPtr, this); } classDef->release(); Modified: vmkit/trunk/lib/N3/VMCore/CLISignature.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLISignature.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLISignature.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLISignature.cpp Sat Oct 10 06:41:26 2009 @@ -182,7 +182,7 @@ uint32 numSizes = ass->uncompressSignature(offset); if (numSizes != 0) { - printf("type = %s\n", mvm::PrintBuffer::objectToString(cl)); + printf("type = %s\n", mvm::PrintBuffer(cl).cString()); VMThread::get()->vm->error("implement me"); } Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Sat Oct 10 06:41:26 2009 @@ -370,7 +370,7 @@ vm->executeAssembly(info.assembly, args); }catch(...) { VMObject* exc = th->pendingException; - printf("N3 caught %s\n", exc->printString()); + printf("N3 caught %s\n", mvm::PrintBuffer(exc).cString()); } vm->threadSystem->nonDaemonLock->lock(); @@ -416,14 +416,4 @@ return (CLIString*)CLIString::stringDup(array, this); } -char* N3::arrayToAsciiz(const ArrayUInt16 *array) { - int size = array->size; - mvm::NativeString* buf = mvm::NativeString::alloc(size + 1); - for (sint32 i = 0; i < size; ++i) { - buf->setAt(i, array->elements[i]); - } - buf->setAt(size, 0); - return buf->cString(); -} - #include "MSCorlib.inc" Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Sat Oct 10 06:41:26 2009 @@ -129,7 +129,6 @@ // usefull string, uint16 and utf8 functions - char* arrayToAsciiz(const ArrayUInt16 *array); ArrayUInt16* asciizToArray(const char *asciiz); // done ArrayUInt16* bufToArray(const uint16 *buf, uint32 len); // done ArrayUInt16* UTF8ToArray(const UTF8 *utf8); // done Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 06:41:26 2009 @@ -189,6 +189,9 @@ { UTF8 fake(0); UTF8::VT = ((VirtualTable**)(void*)(&fake))[0]; +#if !defined(WITHOUT_FINALIZER) + ((void**)UTF8::VT)[0] = 0; +#endif } INIT(VMCond); Modified: vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp Sat Oct 10 06:41:26 2009 @@ -30,7 +30,11 @@ static void* makeFull(VMCommonClass* cl, VMMethod* meth) { char* buf = (char*)alloca(4096); - sprintf(buf, "%s_%s_%s", cl->nameSpace->printString(), cl->name->printString(), meth->name->printString()); + sprintf(buf, + "%s_%s_%s", + mvm::PrintBuffer(cl->nameSpace).cString(), + mvm::PrintBuffer(cl->name).cString(), + mvm::PrintBuffer(meth->name).cString()); std::vector::iterator i = meth->parameters.begin(), e = meth->parameters.end(); @@ -39,7 +43,7 @@ ++i; for ( ; i!= e; ++i) { VMCommonClass* cl = *i; - sprintf(buf, "%s_%s_%s", buf, cl->nameSpace->printString(), cl->name->printString()); + sprintf(buf, "%s_%s_%s", buf, mvm::PrintBuffer(cl->nameSpace).cString(), mvm::PrintBuffer(cl->name).cString()); } cliToInternal(buf); @@ -47,16 +51,19 @@ if (!res) { VMThread::get()->vm->error("unable to find native method %s", - mvm::PrintBuffer::objectToString(meth)); + mvm::PrintBuffer(meth).cString()); } return res; } void* NativeUtil::nativeLookup(VMCommonClass* cl, VMMethod* meth) { - char* name = cl->name->printString(); - char* nameSpace = cl->nameSpace->printString(); - char* methName = meth->name->printString(); + mvm::PrintBuffer _name(cl->name); + mvm::PrintBuffer _nameSpace(cl->nameSpace); + mvm::PrintBuffer _methName(meth->name); + char* name = _name.cString(); + char* nameSpace = _nameSpace.cString(); + char* methName = _methName.cString(); char* buf = (char*)alloca(6 + strlen(name) + strlen(nameSpace) + strlen(methName)); Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Sat Oct 10 06:41:26 2009 @@ -107,7 +107,7 @@ extern "C" void n3PrintExecution(char* opcode, VMMethod* meth) { - fprintf(stderr, "executing %s %s\n", mvm::PrintBuffer::objectToString(meth), opcode); + fprintf(stderr, "executing %s %s\n", mvm::PrintBuffer(meth).cString(), opcode); } @@ -208,7 +208,7 @@ if (bytecodes[i] != 0xFE) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "\t[at %5x] %-5d ", i, bytecodes[i]); - PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "compiling %s::", compilingMethod->printString()); + PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "compiling %s::", mvm::PrintBuffer(compilingMethod).cString()); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_CYAN, OpcodeNames[bytecodes[i]]); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "\n"); } @@ -1827,7 +1827,7 @@ case 0xFE : { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "\t[at %5x] %-5d ", i, bytecodes[i + 1]); - PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "compiling %s::", compilingMethod->printString()); + PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "compiling %s::", mvm::PrintBuffer(compilingMethod).cString()); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_CYAN, OpcodeNamesFE[bytecodes[i + 1]]); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "\n"); @@ -2023,7 +2023,7 @@ if (bytecodes[i] != 0xFE) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "\t[at %5x] %-5d ", i, bytecodes[i]); - PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "exploring %s::", compilingMethod->printString()); + PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "exploring %s::", mvm::PrintBuffer(compilingMethod).cString()); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_CYAN, OpcodeNames[bytecodes[i]]); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "\n"); } @@ -2467,7 +2467,7 @@ PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "\t[at %5x] %-5d ", i, bytecodes[i + 1]); - PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "exploring %s::", compilingMethod->printString()); + PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "exploring %s::", mvm::PrintBuffer(compilingMethod).cString()); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_CYAN, OpcodeNamesFE[bytecodes[i + 1]]); PRINT_DEBUG(N3_COMPILE, 1, LIGHT_BLUE, "\n"); Modified: vmkit/trunk/lib/N3/VMCore/VMArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.cpp Sat Oct 10 06:41:26 2009 @@ -159,7 +159,7 @@ void ArrayObject::print(mvm::PrintBuffer *buf) const { buf->write("Array<"); for (int i = 0; i < size; i++) { - buf->writeObj(elements[i]); + elements[i]->print(buf); buf->write(" "); } buf->write(">"); Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83708&r1=83707&r2=83708&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Sat Oct 10 06:41:26 2009 @@ -246,8 +246,8 @@ PRINT_DEBUG(N3_LOAD, 0, COLOR_NORMAL, "%s", "; "); PRINT_DEBUG(N3_LOAD, 0, LIGHT_GREEN, "%s", "clinit "); - PRINT_DEBUG(N3_LOAD, 0, COLOR_NORMAL, "%s::%s\n", printString(), - cl->printString()); + PRINT_DEBUG(N3_LOAD, 0, COLOR_NORMAL, "%s::%s\n", mvm::PrintBuffer(this).cString(), + mvm::PrintBuffer(cl).cString()); if (meth) { llvm::Function* pred = meth->compiledPtr(genMethod); @@ -570,7 +570,7 @@ if (!res) { VMThread::get()->vm->error(N3::MissingMethodException, "unable to find %s in %s", - mvm::PrintBuffer::objectToString(name), mvm::PrintBuffer::objectToString(this)); + mvm::PrintBuffer(name).cString(), mvm::PrintBuffer(this).cString()); } return res; } @@ -617,7 +617,7 @@ if (!res) { VMThread::get()->vm->error(N3::MissingFieldException, "unable to find %s in %s", - mvm::PrintBuffer::objectToString(name), mvm::PrintBuffer::objectToString(this)); + mvm::PrintBuffer(name).cString(), mvm::PrintBuffer(this).cString()); } return res; } From gael.thomas at lip6.fr Sat Oct 10 04:54:43 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 11:54:43 -0000 Subject: [vmkit-commits] [vmkit] r83709 - in /vmkit/trunk: include/mvm/PrintBuffer.h include/mvm/UTF8.h lib/JnJVM/VMCore/UTF8.h Message-ID: <200910101154.n9ABsitx014866@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 06:54:43 2009 New Revision: 83709 URL: http://llvm.org/viewvc/llvm-project?rev=83709&view=rev Log: Remove the useless UTF8Buffer from mvm. Define UTF8Buffer in Jnjvm for compatibility. It inherits from mvm::PrintBuffer Modified: vmkit/trunk/include/mvm/PrintBuffer.h vmkit/trunk/include/mvm/UTF8.h vmkit/trunk/lib/JnJVM/VMCore/UTF8.h Modified: vmkit/trunk/include/mvm/PrintBuffer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=83709&r1=83708&r2=83709&view=diff ============================================================================== --- vmkit/trunk/include/mvm/PrintBuffer.h (original) +++ vmkit/trunk/include/mvm/PrintBuffer.h Sat Oct 10 06:54:43 2009 @@ -152,6 +152,14 @@ obj->print(this); return this; } + + + /// replaceWith - replace the content of the buffer and free the old buffer + /// + void replaceWith(char *buffer) { + delete[] this->contents; + this->contents = buffer; + } }; } // end namespace mvm Modified: vmkit/trunk/include/mvm/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/UTF8.h?rev=83709&r1=83708&r2=83709&view=diff ============================================================================== --- vmkit/trunk/include/mvm/UTF8.h (original) +++ vmkit/trunk/include/mvm/UTF8.h Sat Oct 10 06:54:43 2009 @@ -134,48 +134,6 @@ } }; -/// UTF8Buffer - Helper class to create char* buffers suitable for -/// printf. -/// -class UTF8Buffer { - - /// buffer - The buffer that holds a string representation. - /// - char* buffer; -public: - - /// UTF8Buffer - Create a buffer with the following UTF8. - /// - UTF8Buffer(const UTF8* val) { - buffer = new char[val->size + 1]; - for (sint32 i = 0; i < val->size; ++i) - buffer[i] = val->elements[i]; - buffer[val->size] = 0; - } - - /// ~UTF8Buffer - Delete the buffer, as well as all dynamically - /// allocated memory. - /// - ~UTF8Buffer() { - delete[] buffer; - } - - /// replaceWith - replace the content of the buffer and free the old buffer - /// - void replaceWith(char *buffer) { - delete[] this->buffer; - this->buffer = buffer; - } - - - /// cString - Return a C string representation of the buffer, suitable - /// for printf. - /// - const char* cString() { - return buffer; - } -}; - } // end namespace mvm #endif Modified: vmkit/trunk/lib/JnJVM/VMCore/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/UTF8.h?rev=83709&r1=83708&r2=83709&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/UTF8.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/UTF8.h Sat Oct 10 06:54:43 2009 @@ -4,6 +4,7 @@ #include "types.h" #include "mvm/UTF8.h" +#include "mvm/PrintBuffer.h" namespace jnjvm { using mvm::UTF8; @@ -12,10 +13,10 @@ /// UTF8Buffer - Helper class to create char* buffers suitable for /// printf. /// -class UTF8Buffer : public mvm::UTF8Buffer { +class UTF8Buffer : public mvm::PrintBuffer { public: /// UTF8Buffer - Create a buffer with the following UTF8. - UTF8Buffer(const UTF8* val) : mvm::UTF8Buffer(val) {} + UTF8Buffer(const UTF8* val) : mvm::PrintBuffer(val) {} /// toCompileName - Change the utf8 following JNI conventions. /// From gael.thomas at lip6.fr Sat Oct 10 05:12:51 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 12:12:51 -0000 Subject: [vmkit-commits] [vmkit] r83711 - in /vmkit/trunk/lib/N3: Mono/MonoString.h PNetLib/PNetLib.cpp VMCore/Assembly.cpp VMCore/Assembly.h VMCore/CLIRuntimeJIT.cpp VMCore/CLISignature.cpp VMCore/CLIString.h VMCore/LinkN3Runtime.h VMCore/LockedMap.h VMCore/N3.cpp VMCore/N3.h VMCore/N3Initialise.cpp VMCore/UTF8.cpp VMCore/UTF8.h VMCore/VMCache.h VMCore/VMClass.cpp VMCore/VMClass.h VMCore/VMObject.h VMCore/VirtualTables.cpp Message-ID: <200910101212.n9ACCpw7015434@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 07:12:50 2009 New Revision: 83711 URL: http://llvm.org/viewvc/llvm-project?rev=83711&view=rev Log: n3::UTF8 is now a mvm::UTF8 and not more a gc object Modified: vmkit/trunk/lib/N3/Mono/MonoString.h vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/CLISignature.cpp vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h vmkit/trunk/lib/N3/VMCore/LockedMap.h vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/UTF8.cpp vmkit/trunk/lib/N3/VMCore/UTF8.h vmkit/trunk/lib/N3/VMCore/VMCache.h vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/Mono/MonoString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.h (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.h Sat Oct 10 07:12:50 2009 @@ -19,8 +19,6 @@ namespace n3 { -class UTF8; - class MonoString : public CLIString { public: Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 10 07:12:50 2009 @@ -694,7 +694,8 @@ if (item->getVirtualTable() == Property::VT) { Property* prop = (Property*)item; if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) { - const char* asciiz = utf8ToAsciiz(prop->name); + mvm::PrintBuffer _asciiz(prop->name); + const char* asciiz = _asciiz.cString(); char* buf = (char*)alloca(strlen(asciiz) + 5); sprintf(buf, "get_%s", asciiz); N3* vm = VMThread::get()->vm; Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sat Oct 10 07:12:50 2009 @@ -373,7 +373,7 @@ buf[i++] = ','; } buf[i] = '>'; - const UTF8* genName = UTF8::readerConstruct(VMThread::get()->vm, buf, size); + const UTF8* genName = VMThread::get()->vm->bufToUTF8(buf, size); //printf("%s\n", mvm::PrintBuffer(genName).cString()); ClassNameCmp CC(genName, nameSpace); @@ -751,7 +751,7 @@ ++n; } - const UTF8* utf8 = UTF8::readerConstruct(vm, buf, n); + const UTF8* utf8 = vm->bufToUTF8(buf, n); return utf8; } Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Sat Oct 10 07:12:50 2009 @@ -26,8 +26,16 @@ class GenericValue; } +namespace mvm { + class UTF8; + class UTF8Map; +} + namespace n3 { +using mvm::UTF8; +using mvm::UTF8Map; + class ArrayUInt16; class ArrayUInt8; class ArrayObject; @@ -40,7 +48,6 @@ class Param; class Property; class Reader; -class UTF8; class VMClass; class VMGenericClass; class VMClassArray; Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Sat Oct 10 07:12:50 2009 @@ -138,9 +138,12 @@ orig->parameters, false, true); if (dmeth == 0) { - const char* methAsciiz = utf8ToAsciiz(orig->name); - const char* nameAsciiz = utf8ToAsciiz(orig->classDef->name); - const char* nameSpaceAsciiz = utf8ToAsciiz(orig->classDef->nameSpace); + mvm::PrintBuffer _methAsciiz(orig->name); + mvm::PrintBuffer _nameAsciiz(orig->classDef->name); + mvm::PrintBuffer _nameSpaceAsciiz(orig->classDef->nameSpace); + const char* methAsciiz = _methAsciiz.cString(); + const char* nameAsciiz = _nameAsciiz.cString(); + const char* nameSpaceAsciiz = _nameSpaceAsciiz.cString(); char *buf = (char*)alloca(3 + strlen(methAsciiz) + strlen(nameAsciiz) + Modified: vmkit/trunk/lib/N3/VMCore/CLISignature.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLISignature.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLISignature.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLISignature.cpp Sat Oct 10 07:12:50 2009 @@ -308,7 +308,7 @@ cl->nameSpace = ass->name; char *tmp = (char *) alloca(100); snprintf(tmp, 100, "!!%d", number); - cl->name = UTF8::asciizConstruct(VMThread::get()->vm, tmp); + cl->name = VMThread::get()->vm->asciizToUTF8(tmp); return cl; } else { return currGenericMethod->genericParams[number]; Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Sat Oct 10 07:12:50 2009 @@ -19,7 +19,6 @@ namespace n3 { -class UTF8; class N3; class ArrayUInt16; Modified: vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h (original) +++ vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h Sat Oct 10 07:12:50 2009 @@ -11,10 +11,13 @@ #ifndef JNJVM_LINK_N3_RUNTIME_H #define JNJVM_LINK_N3_RUNTIME_H +namespace mvm { + class UTF8; +} namespace n3 { + using mvm::UTF8; class CacheNode; - class UTF8; class VMClass; class VMClassArray; class VMCommonClass; Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/LockedMap.h (original) +++ vmkit/trunk/lib/N3/VMCore/LockedMap.h Sat Oct 10 07:12:50 2009 @@ -36,7 +36,6 @@ class VMObject; class VMMethod; class VMField; -class UTF8; template class LockedMap : public mvm::PermanentObject { Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Sat Oct 10 07:12:50 2009 @@ -210,7 +210,7 @@ mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); N3 *vm= new(*a, "VM") N3(*a, "bootstrapN3"); - vm->hashUTF8 = new(vm->allocator, "UTF8Map") UTF8Map(); + vm->hashUTF8 = new(vm->allocator, "UTF8Map") UTF8Map(vm->allocator); CLIJit::initialiseBootstrapVM(vm); @@ -236,7 +236,8 @@ } ArrayUInt8* N3::openAssembly(const UTF8* name, const char* ext) { - const char* asciiz = utf8ToAsciiz(name); + mvm::PrintBuffer _asciiz = mvm::PrintBuffer(name); + const char* asciiz = _asciiz.cString(); uint32 alen = strlen(asciiz); ArrayUInt8* res = 0; Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Sat Oct 10 07:12:50 2009 @@ -25,8 +25,14 @@ #include "types.h" -namespace n3 { +namespace mvm { + class UTF8; + class UTF8Map; +} +namespace n3 { +using mvm::UTF8; +using mvm::UTF8Map; class ArrayObject; class ArrayUInt8; class Assembly; @@ -34,8 +40,6 @@ class N3; class N3ModuleProvider; class StringMap; -class UTF8; -class UTF8Map; class VMClass; class VMClassArray; class VMCommonClass; @@ -43,8 +47,6 @@ class VMMethod; class FunctionMap; class N3ModuleProvider; -class UTF8; -class UTF8Map; class VMMethod; class VMObject; class VMThread; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 07:12:50 2009 @@ -185,15 +185,6 @@ INIT(ArrayFloat); INIT(ArrayDouble); INIT(ArrayObject); - - { - UTF8 fake(0); - UTF8::VT = ((VirtualTable**)(void*)(&fake))[0]; -#if !defined(WITHOUT_FINALIZER) - ((void**)UTF8::VT)[0] = 0; -#endif - } - INIT(VMCond); INIT(LockObj); INIT(VMObject); @@ -236,9 +227,6 @@ const UTF8* utf8OfChar = vm->asciizToUTF8("Char"); MSCorlib::arrayChar = ass->constructArray(utf8OfChar, System, 1); - ((UTF8*)System)->classOf = MSCorlib::arrayChar; - ((UTF8*)utf8OfChar)->classOf = MSCorlib::arrayChar; - ((UTF8*)mscorlib)->classOf = MSCorlib::arrayChar; #define INIT(var, nameSpace, name, type, prim) {\ var = (VMClass*)vm->coreAssembly->loadTypeFromName( \ Modified: vmkit/trunk/lib/N3/VMCore/UTF8.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/UTF8.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/UTF8.cpp Sat Oct 10 07:12:50 2009 @@ -1,126 +0,0 @@ -#include "UTF8.h" -#include "VMThread.h" -#include "VMClass.h" -#include "VMArray.h" -#include "N3.h" -#include "MSCorlib.h" - -using namespace n3; - -void UTF8::print(mvm::PrintBuffer* buf) const { - for (int i = 0; i < size; i++) - buf->writeChar((char)elements[i]); -} - -const UTF8* UTF8::extract(UTF8Map *map, uint32 start, uint32 end) const { - uint32 len = end - start; - uint16* buf = (uint16*)alloca(sizeof(uint16) * len); - - for (uint32 i = 0; i < len; i++) { - buf[i] = elements[i + start]; - } - - return map->lookupOrCreateReader(buf, len); -} - -const UTF8* UTF8::asciizConstruct(N3* vm, const char* asciiz) { - return vm->asciizToUTF8(asciiz); -} - -const UTF8* UTF8::readerConstruct(N3* vm, uint16* buf, uint32 n) { - return vm->bufToUTF8(buf, n); -} - -static uint32 asciizHasher(const char* asciiz, sint32 size) { - uint32 r0 = 0, r1 = 0; - for (sint32 i = 0; i < size; i++) { - char c = asciiz[i]; - r0 += c; - r1 ^= c; - } - return (r1 & 255) + ((r0 & 255) << 8); -} - -static uint32 readerHasher(const uint16* buf, sint32 size) { - uint32 r0 = 0, r1 = 0; - for (sint32 i = 0; i < size; i++) { - uint16 c = buf[i]; - r0 += c; - r1 ^= c; - } - return (r1 & 255) + ((r0 & 255) << 8); -} - -static bool asciizEqual(const UTF8* val, const char* asciiz, sint32 size) { - sint32 len = val->size; - if (len != size) return false; - else { - for (sint32 i = 0; i < len; i++) { - if (asciiz[i] != val->elements[i]) return false; - } - return true; - } -} - -static bool readerEqual(const UTF8* val, const uint16* buf, sint32 size) { - sint32 len = val->size; - if (len != size) return false; - else return !(memcmp(val->elements, buf, len * sizeof(uint16))); -} - - -const UTF8* UTF8Map::lookupOrCreateAsciiz(const char* asciiz) { - sint32 size = strlen(asciiz); - uint32 key = asciizHasher(asciiz, size); - const UTF8* res = 0; - lock->lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (asciizEqual(i->second, asciiz, size)) { - res = i->second; - break; - } - } - - if (res == 0) { - UTF8* tmp = (UTF8 *)new(size) UTF8(size); - for (sint32 i = 0; i < size; i++) { - tmp->elements[i] = asciiz[i]; - } - res = (const UTF8*)tmp; - map.insert(std::make_pair(key, res)); - } - - lock->unlock(); - return res; -} - -const UTF8* UTF8Map::lookupOrCreateReader(const uint16* buf, uint32 len) { - sint32 size = (sint32)len; - uint32 key = readerHasher(buf, size); - const UTF8* res = 0; - lock->lock(); - - std::pair p = map.equal_range(key); - - for (UTF8Map::iterator i = p.first; i != p.second; i++) { - if (readerEqual(i->second, buf, size)) { - res = i->second; - break; - } - } - - if (res == 0) { - UTF8* tmp = new(size) UTF8(size); - memcpy(tmp->elements, buf, len * sizeof(uint16)); - res = (const UTF8*)tmp; - map.insert(std::make_pair(key, res)); - } - - lock->unlock(); - return res; -} - - Modified: vmkit/trunk/lib/N3/VMCore/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/UTF8.h (original) +++ vmkit/trunk/lib/N3/VMCore/UTF8.h Sat Oct 10 07:12:50 2009 @@ -1,167 +1,11 @@ #ifndef _N3_UTF8_ #define _N3_UTF8_ -#include "VMObject.h" -#include "mvm/PrintBuffer.h" - -namespace mvm { - class VirtualTable; -} +#include "mvm/UTF8.h" namespace n3 { - class VMClassArray; - class UTF8Map; - class N3; - -class UTF8 : public VMObject { -public: - static VirtualTable* VT; - sint32 size; - uint16 elements[1]; - - /// operator new - Redefines the new operator of this class to allocate - /// its objects in permanent memory, not with the garbage collector. - void* operator new(size_t sz, sint32 n) { - return gc::operator new(sizeof(VMObject) + sizeof(sint32) + n * sizeof(uint16), UTF8::VT); - } - - UTF8(sint32 n) { - size = n; - } - - virtual void print(mvm::PrintBuffer* buf) const; - - static const UTF8* asciizConstruct(N3 *vm, const char* asciiz); - static const UTF8* readerConstruct(N3 *vm, uint16* buf, uint32 n); - - const UTF8* extract(UTF8Map *vm, uint32 start, uint32 len) const; -}; - -class UTF8Map : public mvm::PermanentObject { -public: - typedef std::multimap::iterator iterator; - - mvm::Lock* lock; - std::multimap, - gc_allocator > > map; - - const UTF8* lookupOrCreateAsciiz(const char* asciiz); - const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size); - - UTF8Map() { - lock = new mvm::LockNormal(); - } - - virtual void TRACER { - //lock->MARK_AND_TRACE; - for (iterator i = map.begin(), e = map.end(); i!= e; ++i) { - i->second->MARK_AND_TRACE; - } - } - - virtual void print(mvm::PrintBuffer* buf) const { - buf->write("UTF8 Hashtable<>"); - } -}; - - -class UTF8Builder { - uint16 *buf; - uint32 cur; - uint32 size; - -public: - UTF8Builder(size_t size) { - size = (size < 4) ? 4 : size; - this->buf = new uint16[size]; - this->size = size; - } - - UTF8Builder *append(const UTF8 *utf8, uint32 start=0, uint32 length=0xffffffff) { - length = length == 0xffffffff ? utf8->size : length; - uint32 req = cur + length; - - if(req > size) { - uint32 newSize = size<<1; - while(req < newSize) - newSize <<= 1; - uint16 *newBuf = new uint16[newSize]; - memcpy(newBuf, buf, cur<<1); - delete []buf; - buf = newBuf; - size = newSize; - } - - memcpy(buf + cur, &utf8->elements + start, length<<1); - cur = req; - - return this; - } - - const UTF8 *toUTF8(UTF8Map *map) { - return map->lookupOrCreateReader(buf, size); - } - - ~UTF8Builder() { - delete [] buf; - } -}; - - -/// UTF8Buffer - Helper class to create char* buffers suitable for -/// printf. -/// -class UTF8Buffer { - - /// buffer - The buffer that holds a string representation. - /// - char* buffer; -public: - - /// UTF8Buffer - Create a buffer with the following UTF8. - /// - UTF8Buffer(const UTF8* val) { - buffer = new char[val->size + 1]; - for (sint32 i = 0; i < val->size; ++i) - buffer[i] = val->elements[i]; - buffer[val->size] = 0; - printf("buffer: %s (%d)\n", buffer, val->size); - } - - /// ~UTF8Buffer - Delete the buffer, as well as all dynamically - /// allocated memory. - /// - ~UTF8Buffer() { - printf("Destructor :(\n"); - delete[] buffer; - } - - /// replaceWith - replace the content of the buffer and free the old buffer - /// - void replaceWith(char *buffer) { - delete[] this->buffer; - this->buffer = buffer; - } - - - /// cString - Return a C string representation of the buffer, suitable - /// for printf. - /// - const char* cString() { - printf("cString: %s\n", buffer); - return buffer; - } -}; - -inline char *_utf8ToAsciiz(const UTF8 *val, char *buffer) { - for (sint32 i = 0; i < val->size; ++i) - buffer[i] = val->elements[i]; - buffer[val->size] = 0; - return buffer; -} - -#define utf8ToAsciiz(utf8) _utf8ToAsciiz(utf8, (char*)alloca(utf8->size + 1)) - + using mvm::UTF8; + using mvm::UTF8Map; } #endif Modified: vmkit/trunk/lib/N3/VMCore/VMCache.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.h Sat Oct 10 07:12:50 2009 @@ -22,7 +22,6 @@ class Assembly; class Enveloppe; -class UTF8; class VMClass; class CacheNode : public mvm::Object { Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Sat Oct 10 07:12:50 2009 @@ -172,7 +172,8 @@ } const UTF8* VMClassArray::constructArrayName(const UTF8* name, uint32 dims) { - const char* asciiz = utf8ToAsciiz(name); + mvm::PrintBuffer _asciiz(name); + const char* asciiz = _asciiz.cString(); char* res = (char*)alloca(strlen(asciiz) + (dims * 2) + 1); sprintf(res, asciiz); @@ -184,7 +185,8 @@ } const UTF8* VMClassPointer::constructPointerName(const UTF8* name, uint32 dims) { - const char* asciiz = utf8ToAsciiz(name); + mvm::PrintBuffer _asciiz(name); + const char* asciiz = _asciiz.cString(); char* res = (char*)alloca(strlen(asciiz) + (dims * 2) + 1); sprintf(res, asciiz); Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Sat Oct 10 07:12:50 2009 @@ -23,14 +23,18 @@ #include +namespace mvm { + class UTF8; +} + namespace n3 { +using mvm::UTF8; class ArraySInt32; class Assembly; class Enveloppe; class Param; class Property; -class UTF8; class VMClass; class VMField; class VMMethod; Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Sat Oct 10 07:12:50 2009 @@ -27,7 +27,6 @@ class VMField; class VMObject; class VMThread; -class UTF8; class VMCond : public mvm::Object { public: Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83711&r1=83710&r2=83711&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 10 07:12:50 2009 @@ -36,7 +36,6 @@ INIT(ArrayFloat); INIT(ArrayDouble); INIT(ArrayObject); - INIT(UTF8); INIT(VMCond); INIT(LockObj); INIT(VMObject); @@ -124,8 +123,6 @@ void VMCommonClass::TRACER { - name->MARK_AND_TRACE; - nameSpace->MARK_AND_TRACE; super->CALL_TRACER; CALL_TRACER_VECTOR(VMClass*, interfaces, std::allocator); //lockVar->MARK_AND_TRACE; @@ -174,7 +171,6 @@ classDef->CALL_TRACER; CALL_TRACER_VECTOR(Param*, params, gc_allocator); TRACE_VECTOR(Enveloppe*, caches, gc_allocator); - name->MARK_AND_TRACE; } void VMGenericMethod::TRACER { @@ -185,7 +181,6 @@ void VMField::TRACER { signature->CALL_TRACER; classDef->CALL_TRACER; - name->MARK_AND_TRACE; } void VMCond::TRACER { @@ -215,13 +210,11 @@ void Param::TRACER { method->CALL_TRACER; - name->MARK_AND_TRACE; } void Property::TRACER { type->CALL_TRACER; //signature->MARK_AND_TRACE; - name->MARK_AND_TRACE; delegatee->MARK_AND_TRACE; } @@ -232,7 +225,6 @@ loadedTokenFields->CALL_TRACER; //lockVar->MARK_AND_TRACE; //condVar->MARK_AND_TRACE; - name->MARK_AND_TRACE; bytes->MARK_AND_TRACE; textSection->CALL_TRACER; rsrcSection->CALL_TRACER; @@ -245,7 +237,6 @@ void N3::TRACER { threadSystem->MARK_AND_TRACE; - hashUTF8->CALL_TRACER; functions->CALL_TRACER; if (bootstrapThread) { bootstrapThread->CALL_TRACER; @@ -253,7 +244,6 @@ th != bootstrapThread; th = (VMThread*)th->next()) th->CALL_TRACER; } - hashUTF8->CALL_TRACER; hashStr->CALL_TRACER; loadedAssemblies->CALL_TRACER; } @@ -268,7 +258,6 @@ } void Header::TRACER { - versionName->MARK_AND_TRACE; tildStream->CALL_TRACER; stringStream->CALL_TRACER; usStream->CALL_TRACER; From gael.thomas at lip6.fr Sat Oct 10 05:22:33 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 12:22:33 -0000 Subject: [vmkit-commits] [vmkit] r83712 - in /vmkit/trunk/lib/N3/VMCore: N3Initialise.cpp VMThread.cpp VMThread.h VirtualTables.cpp Message-ID: <200910101222.n9ACMXhO015723@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 07:22:33 2009 New Revision: 83712 URL: http://llvm.org/viewvc/llvm-project?rev=83712&view=rev Log: VMThread is now a MutatorThread. Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMThread.cpp vmkit/trunk/lib/N3/VMCore/VMThread.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83712&r1=83711&r2=83712&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 07:22:33 2009 @@ -188,7 +188,6 @@ INIT(VMCond); INIT(LockObj); INIT(VMObject); - INIT(VMThread); INIT(ThreadSystem); INIT(CLIString); INIT(CLIJit); @@ -209,7 +208,7 @@ VMObject::globalLock = new mvm::LockNormal(); N3* vm = N3::bootstrapVM = N3::allocateBootstrap(); - VMThread::TheThread = VMThread::allocate(0, vm); + VMThread::TheThread = new VMThread(0, vm); vm->assemblyPath.push_back(""); Modified: vmkit/trunk/lib/N3/VMCore/VMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.cpp?rev=83712&r1=83711&r2=83712&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.cpp Sat Oct 10 07:22:33 2009 @@ -33,29 +33,24 @@ vmThread->print(buf); } +extern void AddStandardCompilePasses(llvm::FunctionPassManager*); + VMThread::~VMThread() { delete perFunctionPasses; } -VMThread::VMThread() { - perFunctionPasses = 0; -} - -extern void AddStandardCompilePasses(llvm::FunctionPassManager*); - -VMThread* VMThread::allocate(VMObject* thread, N3* vm) { - VMThread* key = new VMThread(); - key->vmThread = thread; - key->vm = vm; - key->lock = new mvm::LockNormal(); - key->varcond = new mvm::Cond(); - key->interruptFlag = 0; - key->state = StateRunning; - key->pendingException = 0; - key->perFunctionPasses = new llvm::FunctionPassManager(vm->TheModuleProvider); - key->perFunctionPasses->add(new llvm::TargetData(vm->getLLVMModule())); - AddStandardCompilePasses(key->perFunctionPasses); - return key; +VMThread::VMThread(VMObject* thread, N3* vm) { + this->perFunctionPasses = 0; + this->vmThread = thread; + this->vm = vm; + this->lock = new mvm::LockNormal(); + this->varcond = new mvm::Cond(); + this->interruptFlag = 0; + this->state = StateRunning; + this->pendingException = 0; + this->perFunctionPasses = new llvm::FunctionPassManager(vm->TheModuleProvider); + this->perFunctionPasses->add(new llvm::TargetData(vm->getLLVMModule())); + AddStandardCompilePasses(this->perFunctionPasses); } VMObject* VMThread::currentThread() { Modified: vmkit/trunk/lib/N3/VMCore/VMThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.h?rev=83712&r1=83711&r2=83712&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.h Sat Oct 10 07:22:33 2009 @@ -17,7 +17,7 @@ #include "mvm/Object.h" #include "mvm/Threads/Cond.h" #include "mvm/Threads/Locks.h" -#include "mvm/Threads/Thread.h" +#include "MutatorThread.h" namespace n3 { @@ -27,9 +27,8 @@ class VMObject; class VMGenericMethod; -class VMThread : public mvm::Thread { +class VMThread : public mvm::MutatorThread { public: - static VirtualTable *VT; VMObject* vmThread; N3* vm; mvm::Lock* lock; @@ -46,7 +45,7 @@ virtual void print(mvm::PrintBuffer *buf) const; virtual void TRACER; ~VMThread(); - VMThread(); + VMThread(VMObject *thread, N3 *vm); // Temporary solution until N3 can cleanly bootstrap itself and // implement threads. @@ -54,7 +53,6 @@ static VMThread* get() { return TheThread; } - static VMThread* allocate(VMObject* thread, N3* vm); static VMObject* currentThread(); static VMObject* getCLIException(); Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83712&r1=83711&r2=83712&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 10 07:22:33 2009 @@ -39,7 +39,6 @@ INIT(VMCond); INIT(LockObj); INIT(VMObject); - INIT(VMThread); INIT(ThreadSystem); INIT(CLIString); INIT(Property); From gael.thomas at lip6.fr Sat Oct 10 05:32:38 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 12:32:38 -0000 Subject: [vmkit-commits] [vmkit] r83713 - in /vmkit/trunk/lib/N3/VMCore: CLIJit.cpp CLIJit.h N3Initialise.cpp VirtualTables.cpp Message-ID: <200910101232.n9ACWcJ7016106@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 07:32:38 2009 New Revision: 83713 URL: http://llvm.org/viewvc/llvm-project?rev=83713&view=rev Log: CLIJit is now allocated when a compilation start and deleted at the end Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83713&r1=83712&r2=83713&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Sat Oct 10 07:32:38 2009 @@ -456,7 +456,7 @@ Instruction* CLIJit::invokeInline(VMMethod* meth, std::vector& args, VMGenericClass* genClass, VMGenericMethod* genMethod) { - CLIJit* jit = gc_new(CLIJit)(); + CLIJit* jit = new CLIJit(); jit->module = meth->classDef->vm->module; jit->compilingClass = meth->classDef; jit->compilingMethod = meth; @@ -467,7 +467,8 @@ Instruction* ret = jit->inlineCompile(llvmFunction, currentBlock, currentExceptionBlock, args, dynamic_cast(jit->compilingClass), genMethod); inlineMethods[meth] = false; - + + delete jit; return ret; } @@ -1446,7 +1447,7 @@ Function* CLIJit::compile(VMClass* cl, VMMethod* meth) { - CLIJit* jit = gc_new(CLIJit)(); + CLIJit* jit = new CLIJit(); jit->compilingClass = cl; jit->compilingMethod = meth; jit->module = cl->vm->module; @@ -1460,7 +1461,8 @@ } else { func = jit->compileFatOrTiny(dynamic_cast(cl), dynamic_cast(meth)); } - + + delete jit; return func; } Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=83713&r1=83712&r2=83713&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Sat Oct 10 07:32:38 2009 @@ -71,16 +71,13 @@ }; -class CLIJit : public mvm::Object { +class CLIJit { public: - - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLIJit"); } virtual void TRACER; - static const char* OpcodeNames[0xE1]; static const char* OpcodeNamesFE[0x23]; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83713&r1=83712&r2=83713&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 07:32:38 2009 @@ -190,7 +190,6 @@ INIT(VMObject); INIT(ThreadSystem); INIT(CLIString); - INIT(CLIJit); INIT(CacheNode); INIT(Enveloppe); INIT(Opinfo); Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83713&r1=83712&r2=83713&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 10 07:32:38 2009 @@ -45,7 +45,6 @@ INIT(CacheNode); INIT(Enveloppe); INIT(Opinfo); - INIT(CLIJit); INIT(Exception); #undef INIT From gael.thomas at lip6.fr Sat Oct 10 05:46:27 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 12:46:27 -0000 Subject: [vmkit-commits] [vmkit] r83714 - in /vmkit/trunk/lib/N3/VMCore: CLIRuntimeJIT.cpp N3Initialise.cpp VMCache.cpp VMCache.h VirtualTables.cpp Message-ID: <200910101246.n9ACkSx5016682@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 07:46:27 2009 New Revision: 83714 URL: http://llvm.org/viewvc/llvm-project?rev=83714&view=rev Log: Caches are allocated in the assembly Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMCache.cpp vmkit/trunk/lib/N3/VMCore/VMCache.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83714&r1=83713&r2=83714&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Sat Oct 10 07:46:27 2009 @@ -27,6 +27,7 @@ #include "VMClass.h" #include "VMObject.h" #include "VMThread.h" +#include "Assembly.h" #include @@ -154,7 +155,7 @@ } if (cache->methPtr) { - rcache = CacheNode::allocate(); + rcache = CacheNode::allocate(orig->classDef->assembly->allocator); rcache->enveloppe = enveloppe; } else { rcache = cache; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83714&r1=83713&r2=83714&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 07:46:27 2009 @@ -190,8 +190,6 @@ INIT(VMObject); INIT(ThreadSystem); INIT(CLIString); - INIT(CacheNode); - INIT(Enveloppe); INIT(Opinfo); INIT(Exception); Modified: vmkit/trunk/lib/N3/VMCore/VMCache.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.cpp?rev=83714&r1=83713&r2=83714&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.cpp Sat Oct 10 07:46:27 2009 @@ -47,17 +47,17 @@ buf->write("Enveloppe<>"); } -CacheNode* CacheNode::allocate() { - CacheNode* cache = gc_new(CacheNode)(); +CacheNode* CacheNode::allocate(mvm::BumpPtrAllocator &allocator) { + CacheNode* cache = new(allocator, "CacheNode") CacheNode(); cache->lastCible = 0; cache->methPtr = 0; cache->next = 0; return cache; } -Enveloppe* Enveloppe::allocate(VMMethod* meth) { - Enveloppe* enveloppe = gc_new(Enveloppe)(); - enveloppe->firstCache = CacheNode::allocate(); +Enveloppe* Enveloppe::allocate(mvm::BumpPtrAllocator &allocator, VMMethod* meth) { + Enveloppe* enveloppe = new(allocator, "Enveloppe") Enveloppe(); + enveloppe->firstCache = CacheNode::allocate(allocator); enveloppe->firstCache->enveloppe = enveloppe; enveloppe->cacheLock = new mvm::LockNormal(); enveloppe->originalMethod = meth; @@ -82,7 +82,7 @@ JITVerifyNull(argObj); // ok now the cache - Enveloppe* enveloppe = Enveloppe::allocate(origMeth); + Enveloppe* enveloppe = Enveloppe::allocate(origMeth->classDef->assembly->allocator, origMeth); compilingMethod->caches.push_back(enveloppe); Value* zero = module->constantZero; Modified: vmkit/trunk/lib/N3/VMCore/VMCache.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.h?rev=83714&r1=83713&r2=83714&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.h Sat Oct 10 07:46:27 2009 @@ -24,9 +24,8 @@ class Enveloppe; class VMClass; -class CacheNode : public mvm::Object { +class CacheNode : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; @@ -38,13 +37,11 @@ static const llvm::Type* llvmType; - static CacheNode* allocate(); - + static CacheNode* allocate(mvm::BumpPtrAllocator &allocator); }; -class Enveloppe : public mvm::Object { +class Enveloppe : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void TRACER; virtual void print(mvm::PrintBuffer* buf) const; @@ -54,7 +51,7 @@ static const llvm::Type* llvmType; - static Enveloppe* allocate(VMMethod* orig); + static Enveloppe* allocate(mvm::BumpPtrAllocator &allocator, VMMethod* orig); }; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83714&r1=83713&r2=83714&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 10 07:46:27 2009 @@ -42,8 +42,6 @@ INIT(ThreadSystem); INIT(CLIString); INIT(Property); - INIT(CacheNode); - INIT(Enveloppe); INIT(Opinfo); INIT(Exception); @@ -69,12 +67,12 @@ void CacheNode::TRACER { ((mvm::Object*)methPtr)->MARK_AND_TRACE; lastCible->CALL_TRACER; - next->MARK_AND_TRACE; - enveloppe->MARK_AND_TRACE; + next->CALL_TRACER; + enveloppe->CALL_TRACER; } void Enveloppe::TRACER { - firstCache->MARK_AND_TRACE; + firstCache->CALL_TRACER; //cacheLock->MARK_AND_TRACE; originalMethod->CALL_TRACER; } @@ -168,7 +166,7 @@ //signature->MARK_AND_TRACE; classDef->CALL_TRACER; CALL_TRACER_VECTOR(Param*, params, gc_allocator); - TRACE_VECTOR(Enveloppe*, caches, gc_allocator); + CALL_TRACER_VECTOR(Enveloppe*, caches, gc_allocator); } void VMGenericMethod::TRACER { From gael.thomas at lip6.fr Sat Oct 10 11:57:23 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 18:57:23 -0000 Subject: [vmkit-commits] [vmkit] r83718 - in /vmkit/trunk/lib/N3: PNetLib/PNetLib.cpp VMCore/Assembly.cpp VMCore/Assembly.h VMCore/N3.cpp VMCore/N3.h VMCore/N3Initialise.cpp Message-ID: <200910101857.n9AIvNnN027968@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 13:57:23 2009 New Revision: 83718 URL: http://llvm.org/viewvc/llvm-project?rev=83718&view=rev Log: Simplify the loading phase of an assembly. Simplify the bootstrap. Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83718&r1=83717&r2=83718&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 10 13:57:23 2009 @@ -522,8 +522,11 @@ extern "C" VMObject* System_Reflection_Assembly_LoadFromName(PNetString* str, sint32 & error, VMObject* parent) { N3* vm = (N3*)(VMThread::get()->vm); - Assembly* ass = vm->loadAssembly(vm->arrayToUTF8(str->value), "dll"); - if (!ass) vm->error("unfound assembly %s\n", mvm::PrintBuffer(str->value).cString()); + Assembly* ass = vm->constructAssembly(vm->arrayToUTF8(str->value)); + + if(!ass->resolve(1, "dll")) + vm->error("unfound assembly %s\n", mvm::PrintBuffer(str->value).cString()); + error = 0; return ass->getAssemblyDelegatee(); } Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83718&r1=83717&r2=83718&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sat Oct 10 13:57:23 2009 @@ -463,7 +463,8 @@ return meth; } -Assembly::Assembly(mvm::BumpPtrAllocator &allocator, const UTF8 *name) : allocator(allocator) { +Assembly::Assembly(mvm::BumpPtrAllocator &allocator, N3 *vm, const UTF8 *name) : allocator(allocator) { + this->lockVar = new mvm::LockRecursive(); this->loadedNameClasses = new(allocator, "ClassNameMap") ClassNameMap(); this->loadedTokenClasses = new(allocator, "ClassTokenMap") ClassTokenMap(); this->loadedTokenMethods = new(allocator, "MethodTokenMap") MethodTokenMap(); @@ -471,6 +472,7 @@ this->assemblyRefs = 0; this->isRead = false; + this->vm = vm; this->name = name; } @@ -823,45 +825,85 @@ return new(allocator, "Reader") Reader(array, start, end); } -void Assembly::read() { - Reader* reader = newReader(bytes); - PRINT_DEBUG(DEBUG_LOAD, 1, LIGHT_GREEN, "Reading %s::%s", mvm::PrintBuffer(vm).cString(), - mvm::PrintBuffer(this).cString()); - - textSection = new(allocator, "Section") Section(); - rsrcSection = new(allocator, "Section") Section(); - relocSection = new(allocator, "Section") Section(); - - reader->seek(TEXT_SECTION_HEADER, Reader::SeekSet); - textSection->read(reader, vm); - rsrcSection->read(reader, vm); - relocSection->read(reader, vm); - - reader->seek(CLI_HEADER, Reader::SeekSet); - CLIHeaderLocation = reader->readU4(); - reader->seek(textSection->rawAddress + - (CLIHeaderLocation - textSection->virtualAddress), - Reader::SeekSet); - - cb = reader->readU4(); - major = reader->readU2(); - minor = reader->readU2(); - mdRva = reader->readU4(); - mdSize = reader->readU4(); - flags = reader->readU4(); - entryPoint = reader->readU4(); - resRva = reader->readU4(); - resSize = reader->readU4(); - - reader->seek(textSection->rawAddress + (mdRva - textSection->virtualAddress), - Reader::SeekSet); +int Assembly::resolve(int doResolve, const char *ext) { + if(!bytes) + open(ext); + + if(bytes && doResolve && !isRead) { + lockVar->lock(); + if(!isRead) { + Reader* reader = newReader(bytes); + PRINT_DEBUG(DEBUG_LOAD, 1, LIGHT_GREEN, "Reading %s::%s", mvm::PrintBuffer(vm).cString(), + mvm::PrintBuffer(this).cString()); + + textSection = new(allocator, "Section") Section(); + rsrcSection = new(allocator, "Section") Section(); + relocSection = new(allocator, "Section") Section(); + + reader->seek(TEXT_SECTION_HEADER, Reader::SeekSet); + textSection->read(reader, vm); + rsrcSection->read(reader, vm); + relocSection->read(reader, vm); + + reader->seek(CLI_HEADER, Reader::SeekSet); + CLIHeaderLocation = reader->readU4(); + reader->seek(textSection->rawAddress + + (CLIHeaderLocation - textSection->virtualAddress), + Reader::SeekSet); + + cb = reader->readU4(); + major = reader->readU2(); + minor = reader->readU2(); + mdRva = reader->readU4(); + mdSize = reader->readU4(); + flags = reader->readU4(); + entryPoint = reader->readU4(); + resRva = reader->readU4(); + resSize = reader->readU4(); + + reader->seek(textSection->rawAddress + (mdRva - textSection->virtualAddress), + Reader::SeekSet); + + CLIHeader = new (allocator, "Header") Header(); + CLIHeader->read(allocator, reader, vm); + + reader->seek(CLIHeader->tildStream->realOffset, Reader::SeekSet); + + readTables(reader); + + isRead = 1; + } + lockVar->unlock(); + } + + return bytes ? (doResolve ? isRead : 1) : 0; +} + +int Assembly::open(const char *ext) { + lockVar->lock(); + mvm::PrintBuffer _asciiz = mvm::PrintBuffer(name); + const char* asciiz = _asciiz.cString(); + uint32 alen = strlen(asciiz); + + uint32 idx = 0; + + while ((bytes == 0) && (idx < vm->assemblyPath.size())) { + const char* cur = vm->assemblyPath[idx]; + uint32 strLen = strlen(cur); + char* buf = (char*)alloca(strLen + alen + 16); + + if (ext != 0) { + sprintf(buf, "%s%s.%s", cur, asciiz, ext); + } else { + sprintf(buf, "%s%s", cur, asciiz); + } + + bytes = Reader::openFile(buf); + ++idx; + } + lockVar->unlock(); - CLIHeader = new (allocator, "Header") Header(); - CLIHeader->read(allocator, reader, vm); - - reader->seek(CLIHeader->tildStream->realOffset, Reader::SeekSet); - - readTables(reader); + return bytes ? 1 : 0; } uint32 Assembly::getTypeDefTokenFromMethod(uint32 token) { @@ -963,8 +1005,11 @@ const UTF8* name = readString(vm, stringOffset + assArray[CONSTANT_ASSEMBLY_REF_NAME]); - ref = vm->loadAssembly(name, "dll"); - if (ref == 0) VMThread::get()->vm->error("implement me"); + ref = vm->constructAssembly(name); + + if(!ref->resolve(1, "dll")) + VMThread::get()->vm->error("implement me"); + assemblyRefs[index - 1] = ref; } return ref; Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83718&r1=83717&r2=83718&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Sat Oct 10 13:57:23 2009 @@ -136,6 +136,17 @@ typedef VMCommonClass* (*signatureVector_t)(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod); +// class ByteCode : mvm::PermanentObject { +// public: +// ByteCode(mvm::BumpPtrAllocator &allocator, int size) { +// this->size = size; +// this->elements = mvm::BumpPtrAllocator::operator new(0, "ByteCode", size * sizeof(uint8)); +// } + +// uint32 size; +// uint8 *elements; +// }; + class Assembly : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; @@ -160,26 +171,27 @@ VMMethod* lookupMethodFromToken(uint32 token); VMField* lookupFieldFromToken(uint32 token); + VMObject* getAssemblyDelegatee(); + ClassNameMap* loadedNameClasses; ClassTokenMap* loadedTokenClasses; MethodTokenMap* loadedTokenMethods; FieldTokenMap* loadedTokenFields; - mvm::Lock* lockVar; - mvm::Cond* condVar; - const UTF8* name; - ArrayUInt8* bytes; - Section* textSection; - Section* rsrcSection; - Section* relocSection; - Header* CLIHeader; - N3* vm; - VMObject* delegatee; - Assembly** assemblyRefs; - VMObject* getAssemblyDelegatee(); + N3* vm; + mvm::Lock* lockVar; + mvm::Cond* condVar; + const UTF8* name; + ArrayUInt8* bytes; + Section* textSection; + Section* rsrcSection; + Section* relocSection; + Header* CLIHeader; + VMObject* delegatee; + Assembly** assemblyRefs; uint32 CLIHeaderLocation; - bool isRead; + volatile bool isRead; uint32 cb; uint32 major; uint32 minor; @@ -192,7 +204,10 @@ mvm::BumpPtrAllocator &allocator; - Assembly(mvm::BumpPtrAllocator &Alloc, const UTF8* name); + Assembly(mvm::BumpPtrAllocator &Alloc, N3 *vm, const UTF8* name); + + int open(const char *ext); + int resolve(int doResolve, const char *ext); static const UTF8* readUTF8(N3* vm, uint32 len, Reader* reader); static const UTF8* readUTF8(N3* vm, uint32 len, ArrayUInt8* bytes, @@ -201,7 +216,6 @@ static const ArrayUInt16* readUTF16(N3* vm, uint32 len, ArrayUInt8* bytes, uint32& offset); const UTF8* readString(N3* vm, uint32 offset); - void read(); void readTables(Reader* reader); static maskVector_t maskVector[64]; Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83718&r1=83717&r2=83718&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Sat Oct 10 13:57:23 2009 @@ -190,7 +190,7 @@ static Assembly* assemblyDup(const UTF8*& name, N3* vm) { mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); - return new(*a, "Assembly") Assembly(*a, name); + return new(*a, "Assembly") Assembly(*a, vm, name); } Assembly* N3::constructAssembly(const UTF8* name) { @@ -235,32 +235,6 @@ return vm; } -ArrayUInt8* N3::openAssembly(const UTF8* name, const char* ext) { - mvm::PrintBuffer _asciiz = mvm::PrintBuffer(name); - const char* asciiz = _asciiz.cString(); - uint32 alen = strlen(asciiz); - - ArrayUInt8* res = 0; - uint32 idx = 0; - - while ((res == 0) && (idx < assemblyPath.size())) { - const char* cur = assemblyPath[idx]; - uint32 strLen = strlen(cur); - char* buf = (char*)alloca(strLen + alen + 16); - - if (ext != 0) { - sprintf(buf, "%s%s.%s", cur, asciiz, ext); - } else { - sprintf(buf, "%s%s", cur, asciiz); - } - - res = Reader::openFile(buf); - ++idx; - } - - return res; -} - void ClArgumentsInfo::nyi() { fprintf(stdout, "Not yet implemented\n"); } @@ -305,28 +279,14 @@ return; } -Assembly* N3::loadAssembly(const UTF8* name, const char* ext) { - Assembly* ass = lookupAssembly(name); - if (ass == 0 || !ass->isRead) { - ArrayUInt8* bytes = openAssembly(name, ext); - if (bytes != 0) { - if (ass == 0) ass = constructAssembly(name); - ass->bytes = bytes; - ass->vm = this; - ass->read(); - ass->isRead = true; - } - } - return ass; -} - void N3::executeAssembly(const char* _name, ArrayObject* args) { const UTF8* name = asciizToUTF8(_name); - Assembly* assembly = loadAssembly(name, 0); - if (assembly == 0) { + Assembly* assembly = constructAssembly(name); + + if(!assembly->resolve(1, 0)) error("Can not find assembly %s", _name); - } else { - uint32 entryPoint = assembly->entryPoint; + else { + uint32 entryPoint = assembly->entryPoint; uint32 table = entryPoint >> 24; if (table != CONSTANT_MethodDef) { error("Entry point does not point to a method"); Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83718&r1=83717&r2=83718&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Sat Oct 10 13:57:23 2009 @@ -116,27 +116,24 @@ virtual void waitForExit(); // non virtual methods - ArrayUInt8* openAssembly(const UTF8* name, const char* extension); - Assembly* loadAssembly(const UTF8* name, const char* extension); void executeAssembly(const char* name, ArrayObject* args); void runMain(int argc, char** argv); VMMethod* lookupFunction(llvm::Function* F); llvm::Module* getLLVMModule() { return LLVMModule; } - - Assembly* constructAssembly(const UTF8* name); - Assembly* lookupAssembly(const UTF8* name); + Assembly* constructAssembly(const UTF8* name); + Assembly* lookupAssembly(const UTF8* name); // usefull string, uint16 and utf8 functions - ArrayUInt16* asciizToArray(const char *asciiz); // done - ArrayUInt16* bufToArray(const uint16 *buf, uint32 len); // done - ArrayUInt16* UTF8ToArray(const UTF8 *utf8); // done - const UTF8* asciizToUTF8(const char *asciiz); // done - const UTF8* bufToUTF8(const uint16 *buf, uint32 len); // done - const UTF8* arrayToUTF8(const ArrayUInt16 *array); // done + ArrayUInt16* asciizToArray(const char *asciiz); + ArrayUInt16* bufToArray(const uint16 *buf, uint32 len); + ArrayUInt16* UTF8ToArray(const UTF8 *utf8); + const UTF8* asciizToUTF8(const char *asciiz); + const UTF8* bufToUTF8(const uint16 *buf, uint32 len); + const UTF8* arrayToUTF8(const ArrayUInt16 *array); CLIString* arrayToString(const ArrayUInt16 *array); /* Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83718&r1=83717&r2=83718&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 13:57:23 2009 @@ -211,19 +211,13 @@ vm->assemblyPath.push_back(""); vm->assemblyPath.push_back(MSCorlib::libsPath); - const UTF8* mscorlib = vm->asciizToUTF8("mscorlib"); - Assembly* ass = vm->loadAssembly(mscorlib, "dll"); - if (ass == 0) + Assembly* ass = vm->constructAssembly(vm->asciizToUTF8("mscorlib")); + + if(!ass->resolve(1, "dll")) VMThread::get()->vm->error("can not load mscorlib.dll. Abort"); vm->coreAssembly = ass; - // Array initialization - const UTF8* System = vm->asciizToUTF8("System"); - const UTF8* utf8OfChar = vm->asciizToUTF8("Char"); - - MSCorlib::arrayChar = ass->constructArray(utf8OfChar, System, 1); - #define INIT(var, nameSpace, name, type, prim) {\ var = (VMClass*)vm->coreAssembly->loadTypeFromName( \ vm->asciizToUTF8(name), \ @@ -258,46 +252,37 @@ INIT(MSCorlib::pDelegate, "System", "Delegate", 0, false); #undef INIT - - MSCorlib::arrayChar->baseClass = MSCorlib::pChar; - VMClassArray::SuperArray = MSCorlib::pArray; - MSCorlib::arrayChar->super = MSCorlib::pArray; + VMClassArray::SuperArray = MSCorlib::pArray; MSCorlib::loadStringClass(vm); - MSCorlib::arrayString = ass->constructArray(vm->asciizToUTF8("String"), System, 1); - MSCorlib::arrayString->baseClass = MSCorlib::pString; - - MSCorlib::arrayByte = ass->constructArray(vm->asciizToUTF8("Byte"), System, 1); - MSCorlib::arrayByte->baseClass = MSCorlib::pUInt8; - - MSCorlib::arrayObject = ass->constructArray(vm->asciizToUTF8("Object"), System, 1); - MSCorlib::arrayObject->baseClass = MSCorlib::pObject; - - N3::clinitName = vm->asciizToUTF8(".cctor"); - N3::ctorName = vm->asciizToUTF8(".ctor"); - N3::invokeName = vm->asciizToUTF8("Invoke"); - N3::math = vm->asciizToUTF8("Math"); - N3::system = vm->asciizToUTF8("System"); - N3::sqrt = vm->asciizToUTF8("Sqrt"); - N3::sin = vm->asciizToUTF8("Sin"); - N3::cos = vm->asciizToUTF8("Cos"); - N3::exp = vm->asciizToUTF8("Exp"); - N3::log = vm->asciizToUTF8("Log"); - N3::floor = vm->asciizToUTF8("Floor"); - N3::log10 = vm->asciizToUTF8("Log10"); - N3::isNan = vm->asciizToUTF8("IsNaN"); - N3::pow = vm->asciizToUTF8("Pow"); - N3::floatName = vm->asciizToUTF8("Float"); - N3::doubleName = vm->asciizToUTF8("Double"); - N3::testInfinity = vm->asciizToUTF8("TestInfinity"); - + MSCorlib::arrayChar = ass->constructArray(MSCorlib::pChar, 1); + MSCorlib::arrayString = ass->constructArray(MSCorlib::pString, 1); + MSCorlib::arrayByte = ass->constructArray(MSCorlib::pUInt8, 1); + MSCorlib::arrayObject = ass->constructArray(MSCorlib::pObject, 1); + + N3::clinitName = vm->asciizToUTF8(".cctor"); + N3::ctorName = vm->asciizToUTF8(".ctor"); + N3::invokeName = vm->asciizToUTF8("Invoke"); + N3::math = vm->asciizToUTF8("Math"); + N3::system = vm->asciizToUTF8("System"); + N3::sqrt = vm->asciizToUTF8("Sqrt"); + N3::sin = vm->asciizToUTF8("Sin"); + N3::cos = vm->asciizToUTF8("Cos"); + N3::exp = vm->asciizToUTF8("Exp"); + N3::log = vm->asciizToUTF8("Log"); + N3::floor = vm->asciizToUTF8("Floor"); + N3::log10 = vm->asciizToUTF8("Log10"); + N3::isNan = vm->asciizToUTF8("IsNaN"); + N3::pow = vm->asciizToUTF8("Pow"); + N3::floatName = vm->asciizToUTF8("Float"); + N3::doubleName = vm->asciizToUTF8("Double"); + N3::testInfinity = vm->asciizToUTF8("TestInfinity"); MSCorlib::pArray->resolveType(1, 0, 0); MSCorlib::initialise(vm); - } From gael.thomas at lip6.fr Sat Oct 10 12:43:40 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 19:43:40 -0000 Subject: [vmkit-commits] [vmkit] r83723 - in /vmkit/trunk/lib/N3: PNetLib/PNetLib.cpp VMCore/Assembly.cpp VMCore/Assembly.h VMCore/CLIJit.cpp VMCore/MSCorlib.inc VMCore/Reader.cpp VMCore/Reader.h VMCore/VirtualTables.cpp Message-ID: <200910101943.n9AJheiQ029528@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 14:43:39 2009 New Revision: 83723 URL: http://llvm.org/viewvc/llvm-project?rev=83723&view=rev Log: A N3 bytecode is now allocated with a BumpPtrAllocator. Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/MSCorlib.inc vmkit/trunk/lib/N3/VMCore/Reader.cpp vmkit/trunk/lib/N3/VMCore/Reader.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 10 14:43:39 2009 @@ -960,7 +960,7 @@ extern "C" uint32 System_Reflection_ClrResourceStream_ResourceRead(Assembly* assembly, uint64 position, ArrayUInt8* buffer, uint32 offset, uint32 count) { uint32 resRva = assembly->resRva; - ArrayUInt8* bytes = assembly->bytes; + ByteCode* bytes = assembly->bytes; Section* textSection = assembly->textSection; uint32 section = 0; Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sat Oct 10 14:43:39 2009 @@ -619,7 +619,7 @@ #define EXTRACT_SIZE(bitmask, index) \ (1 + (3 & (bitmask >> (index << 1)))) -void Table::readRow(uint32* result, uint32 row, ArrayUInt8* array) { +void Table::readRow(uint32* result, uint32 row, ByteCode* array) { uint32 rowOffset = offset + ((row - 1) * rowSize); for (uint32 i = 0; i < count; ++i) { uint32 size = EXTRACT_SIZE(sizeMask, i); @@ -632,7 +632,7 @@ } } -uint32 Table::readIndexInRow(uint32 row, uint32 index, ArrayUInt8* array) { +uint32 Table::readIndexInRow(uint32 row, uint32 index, ByteCode* array) { uint32 indexOffset = offset + ((row - 1) * rowSize); for (uint32 i = 0; i < index; ++i) { indexOffset += EXTRACT_SIZE(sizeMask, i); @@ -709,7 +709,7 @@ } const ArrayUInt16* Assembly::readUTF16(N3* vm, uint32 len, - ArrayUInt8* bytes, uint32 &offset) { + ByteCode* bytes, uint32 &offset) { uint32 realLen = len >> 1; uint16* buf = (uint16*)alloca(len); uint32 i = 0; @@ -726,7 +726,7 @@ } const UTF8* Assembly::readUTF8(N3* vm, uint32 len, - ArrayUInt8* bytes, uint32 &offset) { + ByteCode* bytes, uint32 &offset) { uint16* buf = (uint16*)alloca(len * sizeof(uint16)); uint32 n = 0; uint32 i = 0; @@ -821,7 +821,7 @@ } } -Reader *Assembly::newReader(ArrayUInt8* array, uint32 start, uint32 end) { +Reader *Assembly::newReader(ByteCode* array, uint32 start, uint32 end) { return new(allocator, "Reader") Reader(array, start, end); } @@ -898,7 +898,7 @@ sprintf(buf, "%s%s", cur, asciiz); } - bytes = Reader::openFile(buf); + bytes = Reader::openFile(allocator, buf); ++idx; } lockVar->unlock(); Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Sat Oct 10 14:43:39 2009 @@ -22,6 +22,8 @@ #include "llvm/DerivedTypes.h" #include "llvm/Type.h" +#include "VMArray.h" + namespace llvm { class GenericValue; } @@ -58,6 +60,7 @@ class VMObject; class VMGenericClass; class VMGenericMethod; +class ByteCode; class Section : public mvm::PermanentObject { public: @@ -99,8 +102,8 @@ uint32 count; uint32 sizeMask; - void readRow(uint32* result, uint32 row, ArrayUInt8* array); - uint32 readIndexInRow(uint32 row, uint32 index, ArrayUInt8* array); + void readRow(uint32* result, uint32 row, ByteCode* array); + uint32 readIndexInRow(uint32 row, uint32 index, ByteCode* array); }; @@ -136,17 +139,6 @@ typedef VMCommonClass* (*signatureVector_t)(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod); -// class ByteCode : mvm::PermanentObject { -// public: -// ByteCode(mvm::BumpPtrAllocator &allocator, int size) { -// this->size = size; -// this->elements = mvm::BumpPtrAllocator::operator new(0, "ByteCode", size * sizeof(uint8)); -// } - -// uint32 size; -// uint8 *elements; -// }; - class Assembly : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; @@ -182,7 +174,7 @@ mvm::Lock* lockVar; mvm::Cond* condVar; const UTF8* name; - ArrayUInt8* bytes; + ByteCode* bytes; Section* textSection; Section* rsrcSection; Section* relocSection; @@ -210,11 +202,9 @@ int resolve(int doResolve, const char *ext); static const UTF8* readUTF8(N3* vm, uint32 len, Reader* reader); - static const UTF8* readUTF8(N3* vm, uint32 len, ArrayUInt8* bytes, - uint32& offset); + static const UTF8* readUTF8(N3* vm, uint32 len, ByteCode* bytes, uint32& offset); static const ArrayUInt16* readUTF16(N3* vm, uint32 len, Reader* reader); - static const ArrayUInt16* readUTF16(N3* vm, uint32 len, - ArrayUInt8* bytes, uint32& offset); + static const ArrayUInt16* readUTF16(N3* vm, uint32 len, ByteCode* bytes, uint32& offset); const UTF8* readString(N3* vm, uint32 offset); void readTables(Reader* reader); @@ -224,7 +214,7 @@ static const char* signatureNames[0x46]; - Reader *newReader(ArrayUInt8* array, uint32 start = 0, uint32 end = 0); + Reader *newReader(ByteCode* array, uint32 start = 0, uint32 end = 0); uint32 uncompressSignature(uint32& offset); uint32 getTypeDefTokenFromMethod(uint32 token); Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Sat Oct 10 14:43:39 2009 @@ -968,7 +968,7 @@ uint32 CLIJit::readExceptionTable(uint32 offset, bool fat, VMGenericClass* genClass, VMGenericMethod* genMethod) { Assembly* ass = compilingClass->assembly; - ArrayUInt8* bytes = ass->bytes; + ByteCode* bytes = ass->bytes; uint32 nbe = 0; if (fat) { nbe = (READ_U3(bytes, offset) - 4) / 24; @@ -1151,7 +1151,7 @@ PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "tiny or fat compile %s\n", mvm::PrintBuffer(compilingMethod).cString()); uint32 offset = compilingMethod->offset; - ArrayUInt8* bytes = compilingClass->assembly->bytes; + ByteCode* bytes = compilingClass->assembly->bytes; uint8 header = READ_U1(bytes, offset); bool tiny = false; uint32 localVarSig = 0; @@ -1329,7 +1329,7 @@ PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "tiny or fat inline compile %s\n", mvm::PrintBuffer(compilingMethod).cString()); uint32 offset = compilingMethod->offset; - ArrayUInt8* bytes = compilingClass->assembly->bytes; + ByteCode* bytes = compilingClass->assembly->bytes; uint8 header = READ_U1(bytes, offset); bool tiny = false; uint32 localVarSig = 0; Modified: vmkit/trunk/lib/N3/VMCore/MSCorlib.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/MSCorlib.inc?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/MSCorlib.inc (original) +++ vmkit/trunk/lib/N3/VMCore/MSCorlib.inc Sat Oct 10 14:43:39 2009 @@ -49,7 +49,7 @@ uint32 size = array->size; uint32 offset = inSection->rawAddress + (rva - inSection->virtualAddress); - ArrayUInt8* bytes = ass->bytes; + ByteCode* bytes = ass->bytes; if (bs == MSCorlib::pChar) { for (uint32 i = 0; i < size; ++i) { Modified: vmkit/trunk/lib/N3/VMCore/Reader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Reader.cpp?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Reader.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Reader.cpp Sat Oct 10 14:43:39 2009 @@ -53,16 +53,19 @@ const int Reader::SeekCur = SEEK_CUR; const int Reader::SeekEnd = SEEK_END; -ArrayUInt8* Reader::openFile(char* path) { +ByteCode::ByteCode(mvm::BumpPtrAllocator &allocator, int size) { + this->size = size; + this->elements = (uint8*)allocator.Allocate(size * sizeof(uint8), "uint8[]"); +} + +ByteCode* Reader::openFile(mvm::BumpPtrAllocator &allocator, char* path) { FILE* fp = fopen(path, "r"); - ArrayUInt8* res = 0; + ByteCode* res = 0; if (fp != 0) { fseek(fp, 0, SeekEnd); long nbb = ftell(fp); fseek(fp, 0, SeekSet); - // printf("---> %p\n", MSCorlib::arrayByte); - // MSCorlib::arrayByte->doNew(nbb); - res = ArrayUInt8::acons(nbb, MSCorlib::arrayByte); + res = new(allocator, "ByteCode") ByteCode(allocator, nbb); fread(res->elements, nbb, 1, fp); fclose(fp); } @@ -70,7 +73,9 @@ } uint8 Reader::readU1() { - return bytes->at(cursor++); + if(cursor >= (uint32)bytes->size) + VMThread::get()->vm->error("readU1 outside the buffer"); + return bytes->elements[cursor++]; } sint8 Reader::readS1() { @@ -107,7 +112,7 @@ return tmp | (((sint64)(readS8())) << 32); } -Reader::Reader(ArrayUInt8* array, uint32 start, uint32 end) { +Reader::Reader(ByteCode* array, uint32 start, uint32 end) { if (!end) end = array->size; Modified: vmkit/trunk/lib/N3/VMCore/Reader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Reader.h?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Reader.h (original) +++ vmkit/trunk/lib/N3/VMCore/Reader.h Sat Oct 10 14:43:39 2009 @@ -14,19 +14,24 @@ #include "types.h" -#include "VMArray.h" - namespace n3 { +class ByteCode : public mvm::PermanentObject { +public: + sint32 size; + uint8 *elements; + + ByteCode(mvm::BumpPtrAllocator &allocator, int nbb); +}; class Reader : public mvm::PermanentObject { public: - ArrayUInt8* bytes; + ByteCode* bytes; uint32 min; uint32 cursor; uint32 max; - Reader(ArrayUInt8* array, uint32 start = 0, uint32 end = 0); + Reader(ByteCode* array, uint32 start = 0, uint32 end = 0); static double readDouble(int first, int second); static sint64 readLong(int first, int second); @@ -35,7 +40,7 @@ static const int SeekCur; static const int SeekEnd; - static ArrayUInt8* openFile(char* path); + static ByteCode* openFile(mvm::BumpPtrAllocator &allocator, char* path); uint8 readU1(); sint8 readS1(); uint16 readU2(); @@ -49,43 +54,41 @@ void seek(uint32 pos, int from); virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; }; -static sint8 inline READ_S1(ArrayUInt8* bytes, uint32& offset) { +static sint8 inline READ_S1(ByteCode* bytes, uint32& offset) { return (sint8)(bytes->elements[offset++]); } -static uint8 inline READ_U1(ArrayUInt8* bytes, uint32& offset) { +static uint8 inline READ_U1(ByteCode* bytes, uint32& offset) { return(uint8)(bytes->elements[offset++]); } -static sint16 inline READ_S2(ArrayUInt8* bytes, uint32& offset) { +static sint16 inline READ_S2(ByteCode* bytes, uint32& offset) { sint16 val = READ_S1(bytes, offset); return val | (READ_U1(bytes, offset) << 8); } -static uint16 inline READ_U2(ArrayUInt8* bytes, uint32& offset) { +static uint16 inline READ_U2(ByteCode* bytes, uint32& offset) { uint16 val = READ_U1(bytes, offset); return val | (READ_U1(bytes, offset) << 8); } -static sint32 inline READ_S4(ArrayUInt8* bytes, uint32& offset) { +static sint32 inline READ_S4(ByteCode* bytes, uint32& offset) { sint32 val = READ_U2(bytes, offset); return val | (READ_U2(bytes, offset) << 16); } -static uint32 inline READ_U3(ArrayUInt8* bytes, uint32& offset) { +static uint32 inline READ_U3(ByteCode* bytes, uint32& offset) { uint32 val = READ_U2(bytes, offset); return val | (READ_U1(bytes, offset) << 16); } - -static uint32 inline READ_U4(ArrayUInt8* bytes, uint32& offset) { +static uint32 inline READ_U4(ByteCode* bytes, uint32& offset) { return READ_S4(bytes, offset); } -static uint32 inline READ_U8(ArrayUInt8* bytes, uint32& offset) { +static uint32 inline READ_U8(ByteCode* bytes, uint32& offset) { uint64 val1 = READ_U4(bytes, offset); uint64 val2 = READ_U4(bytes, offset); return (val2 << 32) + val1; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83723&r1=83722&r2=83723&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 10 14:43:39 2009 @@ -56,12 +56,6 @@ } void ThreadSystem::TRACER { - //nonDaemonLock->MARK_AND_TRACE; - //nonDaemonVar->MARK_AND_TRACE; -} - -void Reader::TRACER { - bytes->MARK_AND_TRACE; } void CacheNode::TRACER { @@ -221,7 +215,6 @@ loadedTokenFields->CALL_TRACER; //lockVar->MARK_AND_TRACE; //condVar->MARK_AND_TRACE; - bytes->MARK_AND_TRACE; textSection->CALL_TRACER; rsrcSection->CALL_TRACER; relocSection->CALL_TRACER; From gael.thomas at lip6.fr Sat Oct 10 12:56:35 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 10 Oct 2009 19:56:35 -0000 Subject: [vmkit-commits] [vmkit] r83726 - in /vmkit/trunk/lib/N3/VMCore: Assembly.h CLIJit.h N3Initialise.cpp VirtualTables.cpp Message-ID: <200910101956.n9AJuZSg029946@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 10 14:56:35 2009 New Revision: 83726 URL: http://llvm.org/viewvc/llvm-project?rev=83726&view=rev Log: Opinfo is not more a gc object Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/CLIJit.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83726&r1=83725&r2=83726&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Sat Oct 10 14:56:35 2009 @@ -65,7 +65,6 @@ class Section : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; char* name; uint32 virtualSize; @@ -84,7 +83,6 @@ class Stream : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; char* name; uint32 realOffset; @@ -94,7 +92,6 @@ class Table : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; uint32 offset; uint32 rowsNumber; @@ -111,7 +108,6 @@ class Header : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; uint32 signature; uint32 major; Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=83726&r1=83725&r2=83726&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Sat Oct 10 14:56:35 2009 @@ -56,9 +56,8 @@ virtual void TRACER; }; -class Opinfo : public mvm::Object { +class Opinfo { public: - static VirtualTable* VT; llvm::BasicBlock* newBlock; llvm::BasicBlock* exceptionBlock; bool reqSuppl; @@ -67,7 +66,6 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("Opinfo"); } - virtual void TRACER; }; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83726&r1=83725&r2=83726&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 14:56:35 2009 @@ -174,6 +174,10 @@ #endif INIT(Property); + INIT(VMCond); + INIT(LockObj); + + INIT(VMObject); INIT(VMArray); INIT(ArrayUInt8); INIT(ArraySInt8); @@ -185,13 +189,9 @@ INIT(ArrayFloat); INIT(ArrayDouble); INIT(ArrayObject); - INIT(VMCond); - INIT(LockObj); - INIT(VMObject); - INIT(ThreadSystem); - INIT(CLIString); - INIT(Opinfo); INIT(Exception); + INIT(CLIString); + INIT(ThreadSystem); #undef INIT Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83726&r1=83725&r2=83726&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 10 14:56:35 2009 @@ -42,14 +42,10 @@ INIT(ThreadSystem); INIT(CLIString); INIT(Property); - INIT(Opinfo); INIT(Exception); #undef INIT -void Opinfo::TRACER { -} - void CLIJit::TRACER { compilingMethod->CALL_TRACER; compilingClass->CALL_TRACER; @@ -213,12 +209,6 @@ loadedTokenClasses->CALL_TRACER; loadedTokenMethods->CALL_TRACER; loadedTokenFields->CALL_TRACER; - //lockVar->MARK_AND_TRACE; - //condVar->MARK_AND_TRACE; - textSection->CALL_TRACER; - rsrcSection->CALL_TRACER; - relocSection->CALL_TRACER; - CLIHeader->CALL_TRACER; vm->CALL_TRACER; delegatee->MARK_AND_TRACE; // TODO trace assembly refs... @@ -237,24 +227,6 @@ loadedAssemblies->CALL_TRACER; } -void Section::TRACER { -} - -void Stream::TRACER { -} - -void Table::TRACER { -} - -void Header::TRACER { - tildStream->CALL_TRACER; - stringStream->CALL_TRACER; - usStream->CALL_TRACER; - blobStream->CALL_TRACER; - guidStream->CALL_TRACER; - CALL_TRACER_VECTOR(Table*, tables, gc_allocator); -} - void CLIString::TRACER { } From gael.thomas at lip6.fr Sun Oct 11 08:15:16 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sun, 11 Oct 2009 15:15:16 -0000 Subject: [vmkit-commits] [vmkit] r83774 - in /vmkit/trunk/lib/N3: PNetLib/PNetLib.cpp VMCore/Assembly.cpp VMCore/CLIJit.cpp VMCore/CLIRuntimeJIT.cpp VMCore/Opcodes.cpp VMCore/VMClass.cpp VMCore/VirtualTables.cpp Message-ID: <200910111515.n9BFFHeE007362@zion.cs.uiuc.edu> Author: gthomas Date: Sun Oct 11 10:15:16 2009 New Revision: 83774 URL: http://llvm.org/viewvc/llvm-project?rev=83774&view=rev Log: Fix a bug in PNetLib.cpp::...Copy5. Add a N3Debug file Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83774&r1=83773&r2=83774&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sun Oct 11 10:15:16 2009 @@ -283,50 +283,39 @@ sint32 length) { const ArrayUInt16 *arraySrc = src->value; + // printf("Copy %p %p %d %d %d (%p %d)\n", (void *)dest, (void *)src, destPos, srcPos, length, (void *)dest->value, dest->length); + if(destPos == 0 && srcPos == 0 && length == src->length) { dest->value = arraySrc; dest->length = length; } else { - sint32 newLength = destPos + length; + sint32 top = destPos + length; + uint16 *buf = (uint16*)alloca((top < dest->length ? dest->length : top) * sizeof(uint16)); - if(newLength <= dest->length) { - memcpy((uint16*)dest->value->elements + destPos, (uint16*)src->value->elements + srcPos, length<<1); - } else { - uint16 *buf = (uint16*)alloca(newLength<<1); - memcpy(buf, (uint16*)dest->value->elements, destPos<<1); - memcpy(buf + destPos, (uint16*)src->value->elements + srcPos, length<<1); - dest->length = newLength; - dest->value = VMThread::get()->vm->bufToArray(buf, newLength); - } + if(destPos) + memcpy(buf, dest->value->elements, destPos * sizeof(uint16)); + + memcpy(buf + destPos, src->value->elements + srcPos, length * sizeof(uint16)); + + if(top <= dest->length) + memcpy(buf + top, dest->value->elements + top, (dest->length - top) * sizeof(uint16)); + else + dest->length = top; + + dest->value = VMThread::get()->vm->bufToArray(buf, dest->length); } + // printf("---> %s\n", mvm::PrintBuffer(VMThread::get()->vm->arrayToUTF8(dest->value)).cString()); } -// const UTF8* utf8Src = src->value->extract(VMThread::get()->vm, srcPos, -// srcPos + length); -// if (destPos == 0) { -// dest->value = utf8Src; -// dest->length = dest->value->size; -// } else { -// const UTF8* utf8Dest = dest->value->extract(VMThread::get()->vm, 0, -// destPos); -// sint32 len1 = utf8Dest->size; -// sint32 len2 = utf8Src->size; -// uint16* buf = (uint16*)alloca((len1 + len2) * sizeof(uint16)); - -// memcpy(buf, utf8Dest->elements, len1 * sizeof(uint16)); -// memcpy(buf + len1, utf8Dest->elements, len2 * sizeof(uint16)); - -// const UTF8* utf8 = VMThread::get()->vm->bufToUTF8(buf, -// len1 + len2); -// dest->value = utf8; -// dest->length = dest->value->size; -// } extern "C" void System_Threading_Monitor_Enter(VMObject* obj) { + // printf("Take lock on: %p\n", (void *)obj); obj->aquire(); } extern "C" void System_Threading_Monitor_Exit(VMObject* obj) { + // printf("Release lock on: %p\n", (void *)obj); obj->unlock(); + // printf("Release lock on: %p done\n", (void *)obj); } Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83774&r1=83773&r2=83774&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sun Oct 11 10:15:16 2009 @@ -9,7 +9,7 @@ #include -#include "debug.h" +#include "N3Debug.h" #include "types.h" #include "Assembly.h" @@ -833,7 +833,7 @@ lockVar->lock(); if(!isRead) { Reader* reader = newReader(bytes); - PRINT_DEBUG(DEBUG_LOAD, 1, LIGHT_GREEN, "Reading %s::%s", mvm::PrintBuffer(vm).cString(), + PRINT_DEBUG(N3_LOAD, 1, LIGHT_GREEN, "Reading %s::%s", mvm::PrintBuffer(vm).cString(), mvm::PrintBuffer(this).cString()); textSection = new(allocator, "Section") Section(); Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83774&r1=83773&r2=83774&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Sun Oct 11 10:15:16 2009 @@ -7,14 +7,6 @@ // //===----------------------------------------------------------------------===// -#define DEBUG 0 -#define N3_COMPILE 0 -#define N3_EXECUTE 0 - - - - - #include "mvm/JIT.h" #include "Assembly.h" @@ -42,7 +34,8 @@ #include #include -#include "debug.h" +#include "N3Debug.h" + #include "types.h" using namespace llvm; @@ -927,7 +920,7 @@ Function* CLIJit::compileNative(VMGenericMethod* genMethod) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "native compile %s\n", - mvm::PrintBuffer(compilingMethod)); + mvm::PrintBuffer(compilingMethod).cString()); const FunctionType *funcType = compilingMethod->getSignature(genMethod); @@ -1125,22 +1118,24 @@ #if N3_EXECUTE > 1 static void printArgs(std::vector args, BasicBlock* insertAt) { + N3 *vm = VMThread::get()->vm; + for (std::vector::iterator i = args.begin(), e = args.end(); i!= e; ++i) { llvm::Value* arg = *i; const llvm::Type* type = arg->getType(); if (type == Type::getInt8Ty(getGlobalContext()) || type == Type::getInt16Ty(getGlobalContext()) || type == Type::getInt1Ty(getGlobalContext())) { - CallInst::Create(module->printIntLLVM, new ZExtInst(arg, Type::getInt32Ty(getGlobalContext()), "", insertAt), "", insertAt); + CallInst::Create(vm->module->printIntLLVM, new ZExtInst(arg, Type::getInt32Ty(getGlobalContext()), "", insertAt), "", insertAt); } else if (type == Type::getInt32Ty(getGlobalContext())) { - CallInst::Create(module->printIntLLVM, arg, "", insertAt); + CallInst::Create(vm->module->printIntLLVM, arg, "", insertAt); } else if (type == Type::getInt64Ty(getGlobalContext())) { - CallInst::Create(module->printLongLLVM, arg, "", insertAt); + CallInst::Create(vm->module->printLongLLVM, arg, "", insertAt); } else if (type == Type::getFloatTy(getGlobalContext())) { - CallInst::Create(module->printFloatLLVM, arg, "", insertAt); + CallInst::Create(vm->module->printFloatLLVM, arg, "", insertAt); } else if (type == Type::getDoubleTy(getGlobalContext())) { - CallInst::Create(module->printDoubleLLVM, arg, "", insertAt); + CallInst::Create(vm->module->printDoubleLLVM, arg, "", insertAt); } else { - CallInst::Create(module->printIntLLVM, new PtrToIntInst(arg, Type::getInt32Ty(getGlobalContext()), "", insertAt), "", insertAt); + CallInst::Create(vm->module->printIntLLVM, new PtrToIntInst(arg, Type::getInt32Ty(getGlobalContext()), "", insertAt), "", insertAt); } } @@ -1463,6 +1458,7 @@ } delete jit; + // printf("Compiling: %s\n", mvm::PrintBuffer(meth).cString()); return func; } Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83774&r1=83773&r2=83774&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Sun Oct 11 10:15:16 2009 @@ -118,7 +118,7 @@ Enveloppe* enveloppe = cache->enveloppe; VMCommonClass* ocl = obj->classOf; VMMethod* orig = enveloppe->originalMethod; - + CacheNode* rcache = 0; CacheNode* tmp = enveloppe->firstCache; CacheNode* last = tmp; Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83774&r1=83773&r2=83774&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Sun Oct 11 10:15:16 2009 @@ -7,9 +7,7 @@ // //===----------------------------------------------------------------------===// -#define DEBUG 0 -#define N3_COMPILE 0 -#define N3_EXECUTE 0 +#include "N3Debug.h" #include @@ -28,8 +26,6 @@ #include "mvm/JIT.h" -#include "debug.h" - #include "Assembly.h" #include "CLIJit.h" #include "CLIString.h" Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83774&r1=83773&r2=83774&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Sun Oct 11 10:15:16 2009 @@ -13,7 +13,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/Module.h" -#include "debug.h" +#include "N3Debug.h" #include "types.h" #include "mvm/JIT.h" #include "mvm/PrintBuffer.h" Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83774&r1=83773&r2=83774&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sun Oct 11 10:15:16 2009 @@ -150,7 +150,6 @@ baseClass->CALL_TRACER; } - void VMMethod::TRACER { delegatee->MARK_AND_TRACE; //signature->MARK_AND_TRACE; From nicolas.geoffray at lip6.fr Sun Oct 11 10:32:36 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 11 Oct 2009 17:32:36 -0000 Subject: [vmkit-commits] [vmkit] r83775 - /vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp Message-ID: <200910111732.n9BHWa4Y012051@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 11 12:32:35 2009 New Revision: 83775 URL: http://llvm.org/viewvc/llvm-project?rev=83775&view=rev Log: Add include. 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=83775&r1=83774&r2=83775&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/EscapeAnalysis.cpp Sun Oct 11 12:32:35 2009 @@ -18,6 +18,7 @@ #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" #include #include From nicolas.geoffray at lip6.fr Sun Oct 11 10:33:20 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 11 Oct 2009 17:33:20 -0000 Subject: [vmkit-commits] [vmkit] r83776 - in /vmkit/trunk/include/mvm: PrintBuffer.h UTF8.h Message-ID: <200910111733.n9BHXKm3012086@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 11 12:33:20 2009 New Revision: 83776 URL: http://llvm.org/viewvc/llvm-project?rev=83776&view=rev Log: Remove warnings on MacOSX. Modified: vmkit/trunk/include/mvm/PrintBuffer.h vmkit/trunk/include/mvm/UTF8.h Modified: vmkit/trunk/include/mvm/PrintBuffer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=83776&r1=83775&r2=83776&view=diff ============================================================================== --- vmkit/trunk/include/mvm/PrintBuffer.h (original) +++ vmkit/trunk/include/mvm/PrintBuffer.h Sun Oct 11 12:33:20 2009 @@ -54,7 +54,7 @@ writeObj(obj); } - ~PrintBuffer() { + virtual ~PrintBuffer() { delete contents; } Modified: vmkit/trunk/include/mvm/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/UTF8.h?rev=83776&r1=83775&r2=83776&view=diff ============================================================================== --- vmkit/trunk/include/mvm/UTF8.h (original) +++ vmkit/trunk/include/mvm/UTF8.h Sun Oct 11 12:33:20 2009 @@ -57,6 +57,7 @@ } virtual void print(PrintBuffer *pb) const; + virtual ~UTF8() {} }; From gael.thomas at lip6.fr Mon Oct 12 00:56:47 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 12 Oct 2009 07:56:47 -0000 Subject: [vmkit-commits] [vmkit] r83829 - in /vmkit/trunk: lib/N3/PNetLib/PNetLib.cpp lib/N3/VMCore/Assembly.cpp lib/N3/VMCore/CLIJit.cpp lib/N3/VMCore/CLIJit.h lib/N3/VMCore/N3Debug.h lib/N3/VMCore/N3Initialise.cpp lib/N3/VMCore/Opcodes.cpp lib/N3/VMCore/VMClass.h lib/N3/VMCore/VirtualTables.cpp mmtk/magic/ mmtk/mmtk-j3/ Message-ID: <200910120756.n9C7ulHC017955@zion.cs.uiuc.edu> Author: gthomas Date: Mon Oct 12 02:56:45 2009 New Revision: 83829 URL: http://llvm.org/viewvc/llvm-project?rev=83829&view=rev Log: Add a N3Debug.h file. Rename Exception to ExceptionBlockDesc to avoid any confusion. ExceptionBlockDesc is now allocated with the CLIJit (and deleted after a compilation). Property is now allocated in the Assembly BumpPtrAllocator. Added: vmkit/trunk/lib/N3/VMCore/N3Debug.h Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp vmkit/trunk/mmtk/magic/ (props changed) vmkit/trunk/mmtk/mmtk-j3/ (props changed) Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Mon Oct 12 02:56:45 2009 @@ -308,14 +308,11 @@ } extern "C" void System_Threading_Monitor_Enter(VMObject* obj) { - // printf("Take lock on: %p\n", (void *)obj); - obj->aquire(); + obj->aquire(); } extern "C" void System_Threading_Monitor_Exit(VMObject* obj) { - // printf("Release lock on: %p\n", (void *)obj); - obj->unlock(); - // printf("Release lock on: %p done\n", (void *)obj); + obj->unlock(); } @@ -683,21 +680,22 @@ } extern "C" VMObject* System_Reflection_ClrHelpers_GetSemantics(mvm::Object* item, uint32 attributes, bool nonPublic) { - if (item->getVirtualTable() == Property::VT) { - Property* prop = (Property*)item; - if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) { - mvm::PrintBuffer _asciiz(prop->name); - const char* asciiz = _asciiz.cString(); - char* buf = (char*)alloca(strlen(asciiz) + 5); - sprintf(buf, "get_%s", asciiz); - N3* vm = VMThread::get()->vm; - VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false); - assert(meth); - return meth->getMethodDelegatee(); - } - } else { - VMThread::get()->vm->error("implement me"); - } + VMThread::get()->vm->error("implement me: System_Reflection_ClrHelpers_GetSemantics"); +// if (item->getVirtualTable() == Property::VT) { +// Property* prop = (Property*)item; +// if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) { +// mvm::PrintBuffer _asciiz(prop->name); +// const char* asciiz = _asciiz.cString(); +// char* buf = (char*)alloca(strlen(asciiz) + 5); +// sprintf(buf, "get_%s", asciiz); +// N3* vm = VMThread::get()->vm; +// VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false); +// assert(meth); +// return meth->getMethodDelegatee(); +// } +// } else { +// VMThread::get()->vm->error("implement me"); +// } return 0; } Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Mon Oct 12 02:56:45 2009 @@ -1354,7 +1354,7 @@ uint32 nameIndex = propArray[CONSTANT_PROPERTY_NAME]; uint32 type = propArray[CONSTANT_PROPERTY_TYPE]; - Property* prop = gc_new(Property)(); + Property* prop = new(allocator, "Property") Property(); prop->name = readString(VMThread::get()->vm, stringOffset + nameIndex); prop->flags = flags; prop->type = cl; Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Mon Oct 12 02:56:45 2009 @@ -41,7 +41,7 @@ using namespace llvm; using namespace n3; -void Exception::print(mvm::PrintBuffer* buf) const { +void ExceptionBlockDesc::print(mvm::PrintBuffer* buf) const { buf->write("Exception<>"); } @@ -447,9 +447,9 @@ } Instruction* CLIJit::invokeInline(VMMethod* meth, - std::vector& args, VMGenericClass* genClass, VMGenericMethod* genMethod) { - - CLIJit* jit = new CLIJit(); + std::vector& args, VMGenericClass* genClass, VMGenericMethod* genMethod) { + mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); + CLIJit* jit = new(*a, "CLIJit") CLIJit(*a); jit->module = meth->classDef->vm->module; jit->compilingClass = meth->classDef; jit->compilingMethod = meth; @@ -461,7 +461,7 @@ currentExceptionBlock, args, dynamic_cast(jit->compilingClass), genMethod); inlineMethods[meth] = false; - delete jit; + delete a; return ret; } @@ -979,7 +979,7 @@ // TODO synchronized for (uint32 i = 0; i < nbe; ++i) { - Exception* ex = gc_new(Exception)(); + ExceptionBlockDesc* ex = new(allocator, "ExceptionBlockDesc") ExceptionBlockDesc(); uint32 flags = 0; uint32 classToken = 0; if (fat) { @@ -1031,11 +1031,11 @@ } bool first = true; - for (std::vector::iterator i = exceptions.begin(), + for (std::vector::iterator i = exceptions.begin(), e = exceptions.end(); i!= e; ++i) { - Exception* cur = *i; - Exception* next = 0; + ExceptionBlockDesc* cur = *i; + ExceptionBlockDesc* next = 0; if (i + 1 != e) { next = *(i + 1); } @@ -1054,11 +1054,11 @@ } - for (std::vector::iterator i = exceptions.begin(), + for (std::vector::iterator i = exceptions.begin(), e = exceptions.end(); i!= e; ++i) { - Exception* cur = *i; - Exception* next = 0; + ExceptionBlockDesc* cur = *i; + ExceptionBlockDesc* next = 0; BasicBlock* bbNext = 0; if (i + 1 != e) { next = *(i + 1); @@ -1442,7 +1442,8 @@ Function* CLIJit::compile(VMClass* cl, VMMethod* meth) { - CLIJit* jit = new CLIJit(); + mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator(); + CLIJit* jit = new(*a, "CLIJit") CLIJit(*a); jit->compilingClass = cl; jit->compilingMethod = meth; jit->module = cl->vm->module; @@ -1457,7 +1458,7 @@ func = jit->compileFatOrTiny(dynamic_cast(cl), dynamic_cast(meth)); } - delete jit; + delete a; // printf("Compiling: %s\n", mvm::PrintBuffer(meth).cString()); return func; } Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Mon Oct 12 02:56:45 2009 @@ -40,20 +40,19 @@ class VMGenericClass; class VMGenericMethod; -class Exception : public mvm::Object { +class ExceptionBlockDesc : public mvm::PermanentObject { public: - static VirtualTable* VT; - uint32 tryOffset; - uint32 tryLength; - uint32 handlerOffset; - uint32 handlerLength; - VMCommonClass* catchClass; - llvm::BasicBlock* test; - llvm::BasicBlock* realTest; - llvm::BasicBlock* handler; + static VirtualTable* VT; + uint32 tryOffset; + uint32 tryLength; + uint32 handlerOffset; + uint32 handlerLength; + VMCommonClass* catchClass; + llvm::BasicBlock* test; + llvm::BasicBlock* realTest; + llvm::BasicBlock* handler; - virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; + virtual void print(mvm::PrintBuffer* buf) const; }; class Opinfo { @@ -69,8 +68,12 @@ }; -class CLIJit { +class CLIJit : public mvm::PermanentObject { public: + mvm::BumpPtrAllocator &allocator; + + CLIJit(mvm::BumpPtrAllocator &a) : allocator(a) {} + virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLIJit"); } @@ -115,13 +118,14 @@ llvm::Value* top(); // exceptions - llvm::BasicBlock* endExceptionBlock; - llvm::BasicBlock* currentExceptionBlock; - llvm::BasicBlock* unifiedUnreachable; - std::vector exceptions; - std::vector finallyHandlers; + llvm::BasicBlock* endExceptionBlock; + llvm::BasicBlock* currentExceptionBlock; + llvm::BasicBlock* unifiedUnreachable; + std::vector exceptions; + std::vector finallyHandlers; + uint32 readExceptionTable(uint32 offset, bool fat, VMGenericClass* genClass, VMGenericMethod* genMethod); - std::vector leaves; + std::vector leaves; llvm::Value* supplLocal; // calls Added: vmkit/trunk/lib/N3/VMCore/N3Debug.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Debug.h?rev=83829&view=auto ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Debug.h (added) +++ vmkit/trunk/lib/N3/VMCore/N3Debug.h Mon Oct 12 02:56:45 2009 @@ -0,0 +1,20 @@ +#ifndef _N3_DEBUG_H_ +#define _N3_DEBUG_H_ + +#if 0 +#define DEBUG 1 +#define WITH_COLOR 1 +#define N3_COMPILE 2 +#define N3_EXECUTE 2 +#define N3_LOAD 1 +#else +#define DEBUG 0 +#define WITH_COLOR 0 +#define N3_COMPILE 0 +#define N3_EXECUTE 0 +#define N3_LOAD 0 +#endif + +#include "debug.h" + +#endif Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Mon Oct 12 02:56:45 2009 @@ -173,7 +173,6 @@ } #endif - INIT(Property); INIT(VMCond); INIT(LockObj); @@ -189,7 +188,6 @@ INIT(ArrayFloat); INIT(ArrayDouble); INIT(ArrayObject); - INIT(Exception); INIT(CLIString); INIT(ThreadSystem); Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Mon Oct 12 02:56:45 2009 @@ -937,10 +937,10 @@ assert(bb); stack.clear(); if (finallyHandlers.size()) { - Exception* res = 0; - for (std::vector::iterator i = finallyHandlers.begin(), + ExceptionBlockDesc* res = 0; + for (std::vector::iterator i = finallyHandlers.begin(), e = finallyHandlers.end(); i!= e; ++i) { - Exception* ex = (*i); + ExceptionBlockDesc* ex = (*i); if (tmp >= ex->tryOffset && tmp < ex->tryOffset + ex->tryLength) { res = ex; break; @@ -969,10 +969,10 @@ assert(bb); stack.clear(); if (finallyHandlers.size()) { - Exception* res = 0; - for (std::vector::iterator i = finallyHandlers.begin(), + ExceptionBlockDesc* res = 0; + for (std::vector::iterator i = finallyHandlers.begin(), e = finallyHandlers.end(); i!= e; ++i) { - Exception* ex = (*i); + ExceptionBlockDesc* ex = (*i); if (tmp >= ex->tryOffset && tmp < ex->tryOffset + ex->tryLength) { res = ex; break; Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Mon Oct 12 02:56:45 2009 @@ -291,9 +291,8 @@ const UTF8* name; }; -class Property : public mvm::Object { +class Property : public mvm::PermanentObject { public: - static VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83829&r1=83828&r2=83829&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Mon Oct 12 02:56:45 2009 @@ -41,8 +41,6 @@ INIT(VMObject); INIT(ThreadSystem); INIT(CLIString); - INIT(Property); - INIT(Exception); #undef INIT @@ -123,7 +121,7 @@ assembly->CALL_TRACER; //funcs->MARK_AND_TRACE; - TRACE_VECTOR(Property*, properties, gc_allocator); + CALL_TRACER_VECTOR(Property*, properties, gc_allocator); } void VMClass::TRACER { @@ -229,10 +227,6 @@ void CLIString::TRACER { } -void Exception::TRACER { - catchClass->CALL_TRACER; -} - #ifdef MULTIPLE_GC extern "C" void CLIObjectTracer(VMObject* obj, Collector* GC) { #else Propchange: vmkit/trunk/mmtk/magic/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Oct 12 02:56:45 2009 @@ -0,0 +1 @@ +Release Propchange: vmkit/trunk/mmtk/mmtk-j3/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Oct 12 02:56:45 2009 @@ -0,0 +1 @@ +Release From gael.thomas at lip6.fr Mon Oct 12 01:39:33 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 12 Oct 2009 08:39:33 -0000 Subject: [vmkit-commits] [vmkit] r83832 - in /vmkit/trunk/lib/N3/VMCore: N3.cpp N3.h N3Initialise.cpp Message-ID: <200910120839.n9C8dXts023996@zion.cs.uiuc.edu> Author: gthomas Date: Mon Oct 12 03:39:32 2009 New Revision: 83832 URL: http://llvm.org/viewvc/llvm-project?rev=83832&view=rev Log: ThreadSystem is now allocated with the assembly. Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83832&r1=83831&r2=83832&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Mon Oct 12 03:39:32 2009 @@ -88,12 +88,10 @@ buf->write("ThreadSystem<>"); } -ThreadSystem* ThreadSystem::allocateThreadSystem() { - ThreadSystem* res = gc_new(ThreadSystem)(); - res->nonDaemonThreads = 1; - res->nonDaemonLock = new mvm::LockNormal(); - res->nonDaemonVar = new mvm::Cond(); - return res; +ThreadSystem::ThreadSystem() { + nonDaemonThreads = 1; + nonDaemonLock = new mvm::LockNormal(); + nonDaemonVar = new mvm::Cond(); } N3::N3(mvm::BumpPtrAllocator &allocator, const char *name) : mvm::VirtualMachine(allocator) { @@ -224,7 +222,7 @@ vm->hashUTF8 = parent->hashUTF8; - vm->threadSystem = ThreadSystem::allocateThreadSystem(); + vm->threadSystem = new(*a, "ThreadSystem") ThreadSystem(); vm->assemblyPath = parent->assemblyPath; vm->coreAssembly = parent->coreAssembly; Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83832&r1=83831&r2=83832&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Mon Oct 12 03:39:32 2009 @@ -53,17 +53,15 @@ class ArrayUInt16; class CLIString; -class ThreadSystem : public mvm::Object { +class ThreadSystem : public mvm::PermanentObject { public: - static VirtualTable* VT; + ThreadSystem(); + uint16 nonDaemonThreads; mvm::Lock* nonDaemonLock; mvm::Cond* nonDaemonVar; virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; - - static ThreadSystem* allocateThreadSystem(); }; class ClArgumentsInfo { Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83832&r1=83831&r2=83832&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Mon Oct 12 03:39:32 2009 @@ -189,7 +189,6 @@ INIT(ArrayDouble); INIT(ArrayObject); INIT(CLIString); - INIT(ThreadSystem); #undef INIT From gael.thomas at lip6.fr Mon Oct 12 02:13:50 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 12 Oct 2009 09:13:50 -0000 Subject: [vmkit-commits] [vmkit] r83836 - in /vmkit/trunk/lib/N3/VMCore: N3Initialise.cpp VMObject.cpp VMObject.h VirtualTables.cpp Message-ID: <200910120913.n9C9Domf025692@zion.cs.uiuc.edu> Author: gthomas Date: Mon Oct 12 04:13:50 2009 New Revision: 83836 URL: http://llvm.org/viewvc/llvm-project?rev=83836&view=rev Log: Put VMCond inside a LockObj (it is not allocated with the gc). Only applicative objects are now allocated with the gc (arrays, LockObj and VMObject). Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83836&r1=83835&r2=83836&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Mon Oct 12 04:13:50 2009 @@ -173,9 +173,7 @@ } #endif - INIT(VMCond); INIT(LockObj); - INIT(VMObject); INIT(VMArray); INIT(ArrayUInt8); Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=83836&r1=83835&r2=83836&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Mon Oct 12 04:13:50 2009 @@ -23,10 +23,6 @@ this->lockObj = 0; } -VMCond* VMCond::allocate() { - return gc_new(VMCond)(); -} - void VMCond::notify() { for (std::vector::iterator i = threads.begin(), e = threads.end(); i!= e; ++i) { @@ -77,21 +73,19 @@ LockObj* LockObj::allocate() { LockObj* res = gc_new(LockObj)(); - res->lock = new mvm::LockRecursive(); - res->varcond = VMCond::allocate(); return res; } void LockObj::aquire() { - lock->lock(); + lock.lock(); } void LockObj::release() { - lock->unlock(); + lock.unlock(); } bool LockObj::owner() { - return lock->selfOwner(); + return lock.selfOwner(); } void VMObject::print(mvm::PrintBuffer* buf) const { @@ -142,10 +136,10 @@ thread->interruptFlag = 0; thread->vm->interruptedException(this); } else { - unsigned int recur = l->lock->recursionCount(); + unsigned int recur = l->lock.recursionCount(); bool timeout = false; - l->lock->unlockAll(); - l->varcond->wait(thread); + l->lock.unlockAll(); + l->varcond.wait(thread); thread->state = VMThread::StateWaiting; if (timed) { @@ -156,10 +150,10 @@ bool interrupted = (thread->interruptFlag != 0); mutexThread->unlock(); - l->lock->lockAll(recur); + l->lock.lockAll(recur); if (interrupted || timeout) { - l->varcond->remove(thread); + l->varcond.remove(thread); } thread->state = VMThread::StateRunning; @@ -185,7 +179,7 @@ void VMObject::notify() { LockObj* l = myLock(this); if (l->owner()) { - l->varcond->notify(); + l->varcond.notify(); } else { VMThread::get()->vm->illegalMonitorStateException(this); } @@ -194,7 +188,7 @@ void VMObject::notifyAll() { LockObj* l = myLock(this); if (l->owner()) { - l->varcond->notifyAll(); + l->varcond.notifyAll(); } else { VMThread::get()->vm->illegalMonitorStateException(this); } Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=83836&r1=83835&r2=83836&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Mon Oct 12 04:13:50 2009 @@ -28,27 +28,21 @@ class VMObject; class VMThread; -class VMCond : public mvm::Object { +class VMCond { public: - static VirtualTable* VT; std::vector threads; - static VMCond* allocate(); - void notify(); void notifyAll(); void wait(VMThread* th); void remove(VMThread* th); - - virtual void TRACER; }; - class LockObj : public mvm::Object { public: static VirtualTable* VT; - mvm::LockRecursive *lock; - VMCond* varcond; + mvm::LockRecursive lock; + VMCond varcond; virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83836&r1=83835&r2=83836&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Mon Oct 12 04:13:50 2009 @@ -36,10 +36,8 @@ INIT(ArrayFloat); INIT(ArrayDouble); INIT(ArrayObject); - INIT(VMCond); INIT(LockObj); INIT(VMObject); - INIT(ThreadSystem); INIT(CLIString); #undef INIT @@ -49,9 +47,6 @@ compilingClass->CALL_TRACER; } -void ThreadSystem::TRACER { -} - void CacheNode::TRACER { ((mvm::Object*)methPtr)->MARK_AND_TRACE; lastCible->CALL_TRACER; @@ -106,6 +101,16 @@ (*i)->CALL_TRACER; }} +// root of tracing +void VMThread::TRACER { + vmThread->MARK_AND_TRACE; + vm->CALL_TRACER; + //lock->MARK_AND_TRACE; + //varcond->MARK_AND_TRACE; + pendingException->MARK_AND_TRACE; +} + + void VMCommonClass::TRACER { super->CALL_TRACER; CALL_TRACER_VECTOR(VMClass*, interfaces, std::allocator); @@ -166,16 +171,7 @@ classDef->CALL_TRACER; } -void VMCond::TRACER { - for (std::vector >::iterator i = threads.begin(), e = threads.end(); - i!= e; ++i) { - (*i)->CALL_TRACER; - } -} - void LockObj::TRACER { - //lock->MARK_AND_TRACE; - varcond->MARK_AND_TRACE; } void VMObject::TRACER { @@ -183,14 +179,6 @@ lockObj->MARK_AND_TRACE; } -void VMThread::TRACER { - vmThread->MARK_AND_TRACE; - vm->CALL_TRACER; - //lock->MARK_AND_TRACE; - //varcond->MARK_AND_TRACE; - pendingException->MARK_AND_TRACE; -} - void Param::TRACER { method->CALL_TRACER; } @@ -212,7 +200,6 @@ } void N3::TRACER { - threadSystem->MARK_AND_TRACE; functions->CALL_TRACER; if (bootstrapThread) { bootstrapThread->CALL_TRACER; From nicolas.geoffray at lip6.fr Mon Oct 12 03:26:37 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 10:26:37 -0000 Subject: [vmkit-commits] [vmkit] r83840 - /vmkit/trunk/lib/Mvm/MMTk/ Message-ID: <200910121026.n9CAQbxb032392@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 05:26:37 2009 New Revision: 83840 URL: http://llvm.org/viewvc/llvm-project?rev=83840&view=rev Log: Add a new directory for MMTk GC. Added: vmkit/trunk/lib/Mvm/MMTk/ From nicolas.geoffray at lip6.fr Mon Oct 12 03:28:20 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 10:28:20 -0000 Subject: [vmkit-commits] [vmkit] r83841 - in /vmkit/trunk/mmtk/mmtk-j3: MutatorThread.cpp MutatorThread.h Message-ID: <200910121028.n9CASLSr032509@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 05:28:20 2009 New Revision: 83841 URL: http://llvm.org/viewvc/llvm-project?rev=83841&view=rev Log: Compilation fixes. Modified: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Modified: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp?rev=83841&r1=83840&r2=83841&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp Mon Oct 12 05:28:20 2009 @@ -9,10 +9,20 @@ #include "MutatorThread.h" -#include "mvm/Threads/Thread.h" +#include "MvmGC.h" using namespace mvm; +uint32_t MutatorThread::MMTkMutatorSize = 0; +uint32_t MutatorThread::MMTkCollectorSize = 0; + +void (*MutatorThread::MutatorInit)(uintptr_t) = 0; +void (*MutatorThread::CollectorInit)(uintptr_t) = 0; + +gc* (*gc::MMTkGCAllocator)(uintptr_t Mutator, uint32_t sz, uint32_t align, + uint32_t offset, uint32_t allocator, + uint32_t site); + extern "C" void* MMTkMutatorAllocate(uint32_t size, VirtualTable* VT) { void* val = MutatorThread::get()->Allocator.Allocate(size, "MMTk"); ((void**)val)[0] = VT; Modified: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h?rev=83841&r1=83840&r2=83841&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h (original) +++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Mon Oct 12 05:28:20 2009 @@ -16,24 +16,25 @@ namespace mvm { -extern "C" size_t MMTkMutatorSize; -extern "C" size_t MMTkCollectorSize; - -extern "C" void JnJVM_org_j3_config_Selected_00024Mutator__0003Cinit_0003E__(uintptr_t); -extern "C" void JnJVM_org_j3_config_Selected_00024Collector__0003Cinit_0003E__(uintptr_t); - - class MutatorThread : public mvm::Thread { public: mvm::BumpPtrAllocator Allocator; uintptr_t MutatorContext; uintptr_t CollectorContext; + static uint32_t MMTkMutatorSize; + static uint32_t MMTkCollectorSize; + + static void (*MutatorInit)(uintptr_t); + static void (*CollectorInit)(uintptr_t); + + MutatorThread() { MutatorContext = (uintptr_t)Allocator.Allocate(MMTkMutatorSize, "Mutator"); - JnJVM_org_j3_config_Selected_00024Mutator__0003Cinit_0003E__(MutatorContext); - CollectorContext = (uintptr_t)Allocator.Allocate(MMTkCollectorSize, "Collector"); - JnJVM_org_j3_config_Selected_00024Collector__0003Cinit_0003E__(CollectorContext); + MutatorInit(MutatorContext); + CollectorContext = + (uintptr_t)Allocator.Allocate(MMTkCollectorSize, "Collector"); + CollectorInit(CollectorContext); } static MutatorThread* get() { From nicolas.geoffray at lip6.fr Mon Oct 12 03:44:38 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 10:44:38 -0000 Subject: [vmkit-commits] [vmkit] r83843 - /vmkit/trunk/configure Message-ID: <200910121044.n9CAickO000688@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 05:44:38 2009 New Revision: 83843 URL: http://llvm.org/viewvc/llvm-project?rev=83843&view=rev Log: Regenerate. Modified: vmkit/trunk/configure Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=83843&r1=83842&r2=83843&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Mon Oct 12 05:44:38 2009 @@ -3965,29 +3965,43 @@ ;; esac else - GC_LIBS=GCMmap2 - if test "x$gc" = "xmulti-mmap"; then - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -DMULTIPLE_GC -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" - GC_MULTI_MMAP=1 + if test "x$gc" = "xmmtk"; then + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/mmtk/mmtk-j3" + GC_MULTI_MMAP=0 + + GC_SINGLE_MMAP=1 - GC_SINGLE_MMAP=0 + GC_MMAP2=0 + GC_BOEHM=0 + + GC_LIBS=MMTk + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk" else - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" - GC_MULTI_MMAP=0 + GC_LIBS=GCMmap2 + if test "x$gc" = "xmulti-mmap"; then + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -DMULTIPLE_GC -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" + GC_MULTI_MMAP=1 - GC_SINGLE_MMAP=1 + GC_SINGLE_MMAP=0 - fi + else + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" + GC_MULTI_MMAP=0 + + GC_SINGLE_MMAP=1 + + fi cat >>confdefs.h <<\_ACEOF #define USE_GC_MMAP2 1 _ACEOF - GC_MMAP2=1 + GC_MMAP2=1 - GC_BOEHM=0 + GC_BOEHM=0 + fi fi From nicolas.geoffray at lip6.fr Mon Oct 12 03:44:17 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 10:44:17 -0000 Subject: [vmkit-commits] [vmkit] r83842 - /vmkit/trunk/autoconf/configure.ac Message-ID: <200910121044.n9CAiH5A000667@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 05:44:16 2009 New Revision: 83842 URL: http://llvm.org/viewvc/llvm-project?rev=83842&view=rev Log: Add a new GC: MMTk. 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=83842&r1=83841&r2=83842&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Mon Oct 12 05:44:16 2009 @@ -232,19 +232,29 @@ ;; esac else - GC_LIBS=GCMmap2 - if test "x$gc" = "xmulti-mmap"; then - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -DMULTIPLE_GC -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" - AC_SUBST([GC_MULTI_MMAP], [1]) - AC_SUBST([GC_SINGLE_MMAP], [0]) - else - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" + 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]) + GC_LIBS=MMTk + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk" + else + GC_LIBS=GCMmap2 + if test "x$gc" = "xmulti-mmap"; then + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -DMULTIPLE_GC -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" + AC_SUBST([GC_MULTI_MMAP], [1]) + AC_SUBST([GC_SINGLE_MMAP], [0]) + else + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/GCMmap2 -DWITH_TRACER -I\$(PROJ_SRC_ROOT)/lib/Mvm/Allocator" + AC_SUBST([GC_MULTI_MMAP], [0]) + AC_SUBST([GC_SINGLE_MMAP], [1]) + fi + AC_DEFINE([USE_GC_MMAP2], [1], [Using the gcmmap2]) + AC_SUBST(GC_MMAP2, [1]) + AC_SUBST(GC_BOEHM, [0]) fi - AC_DEFINE([USE_GC_MMAP2], [1], [Using the gcmmap2]) - AC_SUBST(GC_MMAP2, [1]) - AC_SUBST(GC_BOEHM, [0]) fi AC_SUBST([GC_FLAGS]) From nicolas.geoffray at lip6.fr Mon Oct 12 03:45:30 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 10:45:30 -0000 Subject: [vmkit-commits] [vmkit] r83844 - in /vmkit/trunk/lib/Mvm: MMTk/Makefile Makefile Message-ID: <200910121045.n9CAjUB8000741@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 05:45:29 2009 New Revision: 83844 URL: http://llvm.org/viewvc/llvm-project?rev=83844&view=rev Log: Add Makefiles for MMTk. Added: vmkit/trunk/lib/Mvm/MMTk/Makefile Modified: vmkit/trunk/lib/Mvm/Makefile Added: vmkit/trunk/lib/Mvm/MMTk/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/Makefile?rev=83844&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/Makefile (added) +++ vmkit/trunk/lib/Mvm/MMTk/Makefile Mon Oct 12 05:45:29 2009 @@ -0,0 +1,19 @@ +##===- lib/Mvm/MMTk/Makefile -------------------------------*- Makefile -*-===## +# +# The vmkit project +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## +LEVEL = ../../.. + +include $(LEVEL)/Makefile.config + +ifeq ($(WITH_LLVM_GCC), 1) + MODULE_NAME = MMTk +else + LIBRARYNAME = MMTk +endif + +include $(LEVEL)/Makefile.common Modified: vmkit/trunk/lib/Mvm/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Makefile?rev=83844&r1=83843&r2=83844&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Makefile (original) +++ vmkit/trunk/lib/Mvm/Makefile Mon Oct 12 05:45:29 2009 @@ -10,7 +10,7 @@ include $(LEVEL)/Makefile.config -EXTRA_DIST = BoehmGC GCMmap2 +EXTRA_DIST = BoehmGC GCMmap2 MMTk DIRS = Allocator CommonThread $(GCLIB) Runtime Compiler StaticGCPass From nicolas.geoffray at lip6.fr Mon Oct 12 03:48:23 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 10:48:23 -0000 Subject: [vmkit-commits] [vmkit] r83845 - /vmkit/trunk/Makefile.rules Message-ID: <200910121048.n9CAmN1n000881@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 05:48:22 2009 New Revision: 83845 URL: http://llvm.org/viewvc/llvm-project?rev=83845&view=rev Log: Disable stubs when generating MMTK.bc Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=83845&r1=83844&r2=83845&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Mon Oct 12 05:48:22 2009 @@ -131,7 +131,7 @@ all:: $(Verb) $(ANT) $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) - $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=vmkit.properties + $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=vmkit.properties -disable-stubs $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc From nicolas.geoffray at lip6.fr Mon Oct 12 04:08:45 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 11:08:45 -0000 Subject: [vmkit-commits] [vmkit] r83846 - in /vmkit/trunk: lib/Mvm/MMTk/MutatorThread.cpp lib/Mvm/MMTk/MutatorThread.h mmtk/mmtk-j3/MutatorThread.cpp mmtk/mmtk-j3/MutatorThread.h Message-ID: <200910121108.n9CB8jKr001717@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 06:08:45 2009 New Revision: 83846 URL: http://llvm.org/viewvc/llvm-project?rev=83846&view=rev Log: Move MMTk runtime. Added: vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp - copied unchanged from r83841, vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h - copied unchanged from r83841, vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Removed: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h Removed: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp?rev=83845&view=auto ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.cpp (removed) @@ -1,30 +0,0 @@ -//===--------- MutatorThread.cpp - Thread for GC --------------------------===// -// -// The VMKit project -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -#include "MutatorThread.h" -#include "MvmGC.h" - -using namespace mvm; - -uint32_t MutatorThread::MMTkMutatorSize = 0; -uint32_t MutatorThread::MMTkCollectorSize = 0; - -void (*MutatorThread::MutatorInit)(uintptr_t) = 0; -void (*MutatorThread::CollectorInit)(uintptr_t) = 0; - -gc* (*gc::MMTkGCAllocator)(uintptr_t Mutator, uint32_t sz, uint32_t align, - uint32_t offset, uint32_t allocator, - uint32_t site); - -extern "C" void* MMTkMutatorAllocate(uint32_t size, VirtualTable* VT) { - void* val = MutatorThread::get()->Allocator.Allocate(size, "MMTk"); - ((void**)val)[0] = VT; - return val; -} Removed: vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h?rev=83845&view=auto ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h (original) +++ vmkit/trunk/mmtk/mmtk-j3/MutatorThread.h (removed) @@ -1,48 +0,0 @@ -//===--------- MutatorThread.h - Thread for GC ----------------------------===// -// -// The VMKit project -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - - -#ifndef MVM_MUTATOR_THREAD_H -#define MVM_MUTATOR_THREAD_H - -#include "mvm/Allocator.h" -#include "mvm/Threads/Thread.h" - -namespace mvm { - -class MutatorThread : public mvm::Thread { -public: - mvm::BumpPtrAllocator Allocator; - uintptr_t MutatorContext; - uintptr_t CollectorContext; - - static uint32_t MMTkMutatorSize; - static uint32_t MMTkCollectorSize; - - static void (*MutatorInit)(uintptr_t); - static void (*CollectorInit)(uintptr_t); - - - MutatorThread() { - MutatorContext = (uintptr_t)Allocator.Allocate(MMTkMutatorSize, "Mutator"); - MutatorInit(MutatorContext); - CollectorContext = - (uintptr_t)Allocator.Allocate(MMTkCollectorSize, "Collector"); - CollectorInit(CollectorContext); - } - - static MutatorThread* get() { - return (MutatorThread*)mvm::Thread::get(); - } - -}; - -} - -#endif From gael.thomas at lip6.fr Mon Oct 12 10:59:53 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 12 Oct 2009 17:59:53 -0000 Subject: [vmkit-commits] [vmkit] r83864 - in /vmkit/trunk: include/mvm/ lib/N3/Mono/ lib/N3/PNetLib/ lib/N3/VMCore/ Message-ID: <200910121759.n9CHxt3S017019@zion.cs.uiuc.edu> Author: gthomas Date: Mon Oct 12 12:59:53 2009 New Revision: 83864 URL: http://llvm.org/viewvc/llvm-project?rev=83864&view=rev Log: Add a "declare_gcroot" to define a gc root variable. VMThread::vmThread is a gcroot. Remove useless functions of VMArray(s): acons, initialise, at, setAt. Create an ArrayChar different from ArrayUInt16 to have a "char[]" printer. Assign the pretty array printers in vt in makeArrayVT. Remove useless tracer from CacheNode, Enveloppe, Param, CLIJit. Modify all tracers to avoid cycle. Modified: vmkit/trunk/include/mvm/Allocator.h vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/Mono/MonoString.cpp vmkit/trunk/lib/N3/Mono/MonoString.h vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.h vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.h vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/MSCorlib.inc vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMArray.cpp vmkit/trunk/lib/N3/VMCore/VMArray.h vmkit/trunk/lib/N3/VMCore/VMCache.h vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMThread.cpp vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/mvm/Allocator.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Allocator.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Allocator.h (original) +++ vmkit/trunk/include/mvm/Allocator.h Mon Oct 12 12:59:53 2009 @@ -27,6 +27,8 @@ #define llvm_gcroot(a, b) #endif +#define declare_gcroot(type, name) type name; llvm_gcroot(name, 0); name + namespace mvm { class Allocator { Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Mon Oct 12 12:59:53 2009 @@ -168,7 +168,7 @@ extern "C" void System_String_InternalCopyTo(MonoString* str, sint32 sindex, VMArray* dest, sint32 destIndex, sint32 count) { - const ArrayUInt16* contents = str->value; + const ArrayChar* contents = str->value; memcpy(&dest->elements[destIndex], &contents->elements[sindex], count * sizeof(uint16)); } @@ -244,7 +244,8 @@ } extern "C" VMObject* System_Threading_Thread_CurrentThread_internal() { - return VMThread::get()->vmThread; + declare_gcroot(VMObject*, res) = VMThread::get()->vmThread; + return res; } extern "C" VMObject* @@ -279,9 +280,9 @@ } extern "C" void -System_String__ctor(MonoString* str, ArrayUInt16* array, sint32 startIndex, sint32 count) { +System_String__ctor(MonoString* str, ArrayChar* array, sint32 startIndex, sint32 count) { N3* vm = VMThread::get()->vm; - const ArrayUInt16* value = vm->bufToArray(&(array->elements[startIndex]), count); + const ArrayChar* value = vm->bufToArray(&(array->elements[startIndex]), count); str->length = count; str->startChar = array->elements[startIndex]; str->value = value; @@ -333,7 +334,7 @@ } N3* vm = (N3*)VMThread::get()->vm; - const ArrayUInt16* array = vm->bufToArray(dest, length); + const ArrayChar* array = vm->bufToArray(dest, length); return (MonoString*)vm->arrayToString(array); } Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Mon Oct 12 12:59:53 2009 @@ -168,7 +168,7 @@ vm->asciizToUTF8("System.Threading"), true, true, true, true); VMObject* th = (*cl)(); - VMThread* myth = VMThread::get(); + declare_gcroot(VMThread*, myth) = VMThread::get(); myth->vmThread = th; } Modified: vmkit/trunk/lib/N3/Mono/MonoString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.cpp Mon Oct 12 12:59:53 2009 @@ -25,19 +25,19 @@ using namespace llvm; -CLIString* CLIString::stringDup(const ArrayUInt16*& array, N3* vm) { +CLIString* CLIString::stringDup(const ArrayChar*& array, N3* vm) { MonoString* obj = (MonoString*)(*MSCorlib::pString)(); obj->length = array->size; if (array->size == 0) { obj->startChar = 0; } else { - obj->startChar = array->at(0); + obj->startChar = array->elements[0]; } obj->value = array; return obj; } -const ArrayUInt16* CLIString::strToArray(N3* vm) const { +const ArrayChar* CLIString::strToArray(N3* vm) const { return ((MonoString *)this)->value; } Modified: vmkit/trunk/lib/N3/Mono/MonoString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.h (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.h Mon Oct 12 12:59:53 2009 @@ -25,7 +25,7 @@ // !!! mono layout !!! sint32 length; uint8 startChar; - const ArrayUInt16* value; + const ArrayChar* value; llvm::GlobalVariable* _llvmVar; }; Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Mon Oct 12 12:59:53 2009 @@ -174,9 +174,9 @@ } } -static const ArrayUInt16* newBuilder(N3* vm, PNetString* value, uint32 length) { +static const ArrayChar* newBuilder(N3* vm, PNetString* value, uint32 length) { uint32 valueLength = value ? value->length : 0; - const ArrayUInt16* array = value ? value->value : 0; + const ArrayChar* array = value ? value->value : 0; uint32 roundLength = (7 + length) & 0xfffffff8; uint16* buf = (uint16*)alloca(roundLength * sizeof(uint16)); uint32 strLength = 0; @@ -207,9 +207,9 @@ } extern "C" void System_String_CopyToChecked(PNetString* str, sint32 sstart, - ArrayUInt16* dest, sint32 dstart, + ArrayChar* dest, sint32 dstart, sint32 count) { - const ArrayUInt16* value = str->value; + const ArrayChar* value = str->value; memcpy(&dest->elements[dstart], &value->elements[sstart], count << 1); } @@ -236,7 +236,7 @@ } } -extern "C" sint32 System_Text_DefaultEncoding_InternalGetBytes(ArrayUInt16* chars, +extern "C" sint32 System_Text_DefaultEncoding_InternalGetBytes(ArrayChar* chars, sint32 charIndex, sint32 charCount, ArrayUInt8* bytes, sint32 byteIndex) { return ILAnsiGetBytes(&chars->elements[charIndex], charCount, &bytes->elements[byteIndex], bytes->size - byteIndex); @@ -264,14 +264,14 @@ extern "C" void System_String_Copy_3(PNetString* dest, sint32 pos, PNetString* src) { - ArrayUInt16* arr = (ArrayUInt16*)MSCorlib::arrayChar->doNew(pos + src->value->size); + ArrayChar* arr = (ArrayChar*)MSCorlib::arrayChar->doNew(pos + src->value->size); for (sint32 i = 0; i < pos; ++i) { - arr->setAt(i, dest->value->at(i)); + arr->elements[i] = dest->value->elements[i]; } - + for (sint32 i = 0; i < src->length; ++i) { - arr->setAt(pos + i, src->value->at(i)); + arr->elements[pos + i] = src->value->elements[i]; } dest->value = arr; @@ -281,7 +281,7 @@ extern "C" void System_String_Copy_5(PNetString* dest, sint32 destPos, PNetString* src, sint32 srcPos, sint32 length) { - const ArrayUInt16 *arraySrc = src->value; + const ArrayChar *arraySrc = src->value; // printf("Copy %p %p %d %d %d (%p %d)\n", (void *)dest, (void *)src, destPos, srcPos, length, (void *)dest->value, dest->length); @@ -308,11 +308,11 @@ } extern "C" void System_Threading_Monitor_Enter(VMObject* obj) { - obj->aquire(); + // obj->aquire(); } extern "C" void System_Threading_Monitor_Exit(VMObject* obj) { - obj->unlock(); + // obj->unlock(); } @@ -325,7 +325,7 @@ } extern "C" uint16 System_String_GetChar(PNetString* str, sint32 index) { - return str->value->at(index); + return str->value->elements[index]; } extern "C" sint32 System_String_IndexOf(PNetString* str, uint16 value, @@ -339,9 +339,9 @@ } sint32 i = startIndex; - const ArrayUInt16* array = str->value; + const ArrayChar* array = str->value; while (i < startIndex + count) { - if (array->at(i) == value) return i; + if (array->elements[i] == value) return i; else ++i; } @@ -350,7 +350,7 @@ extern "C" sint32 System_String_GetHashCode(PNetString* str) { sint32 hash = 0; - const ArrayUInt16* array = str->value; + const ArrayChar* array = str->value; for (sint32 i = 0; i < array->size; ++i) { hash += ((hash << 5) + array->elements[i]); } @@ -363,7 +363,7 @@ uint16 value) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const ArrayUInt16* array = buildString->value; + const ArrayChar* array = buildString->value; sint32 strLength = buildString->length; sint32 length = (index + 1) > strLength ? index + 1 : strLength + 1; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); @@ -390,8 +390,8 @@ PNetString* str) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const ArrayUInt16* strArray = str->value; - const ArrayUInt16* buildArray = buildString->value; + const ArrayChar* strArray = str->value; + const ArrayChar* buildArray = buildString->value; sint32 strLength = str->length; sint32 buildLength = buildString->length; sint32 length = strLength + buildLength; @@ -421,7 +421,7 @@ uint16 value) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const ArrayUInt16* array = buildString->value; + const ArrayChar* array = buildString->value; sint32 length = buildString->length; uint16* buf = (uint16*)alloca((length + 1) * sizeof(uint16)); @@ -439,8 +439,8 @@ PNetString* str) { N3* vm = (N3*)(VMThread::get()->vm); PNetString* buildString = obj->buildString; - const ArrayUInt16* buildArray = buildString->value; - const ArrayUInt16* strArray = str->value; + const ArrayChar* buildArray = buildString->value; + const ArrayChar* strArray = str->value; sint32 buildLength = buildString->length; sint32 strLength = str->length; sint32 length = buildLength + strLength; @@ -519,8 +519,8 @@ extern "C" PNetString* System_String_Concat_2(PNetString* str1, PNetString* str2) { N3* vm = (N3*)(VMThread::get()->vm); - const ArrayUInt16* a1 = str1->value; - const ArrayUInt16* a2 = str2->value; + const ArrayChar* a1 = str1->value; + const ArrayChar* a2 = str2->value; sint32 len1 = str1->length; sint32 len2 = str2->length; uint16* buf = (uint16*)alloca((len1 + len2) * sizeof(uint16)); @@ -535,9 +535,9 @@ extern "C" PNetString* System_String_Concat_3(PNetString* str1, PNetString* str2, PNetString* str3) { N3* vm = (N3*)(VMThread::get()->vm); - const ArrayUInt16* a1 = str1->value; - const ArrayUInt16* a2 = str2->value; - const ArrayUInt16* a3 = str3->value; + const ArrayChar* a1 = str1->value; + const ArrayChar* a2 = str2->value; + const ArrayChar* a3 = str3->value; sint32 len1 = str1->length; sint32 len2 = str2->length; sint32 len3 = str3->length; @@ -553,7 +553,7 @@ } extern "C" void System_String_RemoveSpace(PNetString* str, sint32 index, sint32 length) { - const ArrayUInt16* array = str->value; + const ArrayChar* array = str->value; sint32 strLength = str->length; uint16* buf = (uint16*)alloca(strLength * sizeof(uint16)); sint32 j = index; @@ -576,13 +576,13 @@ memcpy(&(buf[j]), &(array->elements[index + length]), (strLength - (index + length)) * sizeof(uint16)); } - const ArrayUInt16* res = VMThread::get()->vm->bufToArray(buf, j); + const ArrayChar* res = VMThread::get()->vm->bufToArray(buf, j); str->value = res; str->length = j; } extern "C" void System_String__ctor_3(PNetString* str, uint16 ch, sint32 count) { - ArrayUInt16* array = (ArrayUInt16*)MSCorlib::arrayChar->doNew(count); + ArrayChar* array = (ArrayChar*)MSCorlib::arrayChar->doNew(count); for (sint32 i = 0; i < count; ++i) { array->elements[i] = ch; } @@ -607,8 +607,9 @@ } extern "C" VMObject* System_Reflection_Assembly_GetType(VMObject* obj, PNetString* str, bool onError, bool ignoreCase) { + printf("Get type\n"); Assembly* ass = ASSEMBLY_VALUE(obj); - const ArrayUInt16* array = str->value; + const ArrayChar* array = str->value; mvm::PrintBuffer pb(array); char* asciiz = pb.cString(); char* index = (char*)sys_memrchr(asciiz, '.', strlen(asciiz)); @@ -916,7 +917,7 @@ extern "C" VMObject* System_Globalization_TextInfo_ToLower(VMObject* obj, PNetString* str) { verifyNull(str); - const ArrayUInt16* array = str->value; + const ArrayChar* array = str->value; uint32 length = str->length; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); @@ -925,12 +926,12 @@ memcpy(buf, array->elements, length * sizeof(uint16)); ILUnicodeStringToLower((void*)buf, (void*)array->elements, length); - const ArrayUInt16* res = vm->bufToArray(buf, length); + const ArrayChar* res = vm->bufToArray(buf, length); return ((N3*)vm)->arrayToString(res); } extern "C" VMObject* System_String_Replace(PNetString* str, uint16 c1, uint16 c2) { - const ArrayUInt16* array = str->value; + const ArrayChar* array = str->value; uint32 length = str->length; if ((c1 == c2) || length == 0) return str; @@ -941,7 +942,7 @@ } N3* vm = (N3*)VMThread::get()->vm; - const ArrayUInt16* res = vm->bufToArray(buf, length); + const ArrayChar* res = vm->bufToArray(buf, length); return vm->arrayToString(res); } @@ -991,7 +992,7 @@ } extern "C" void System_String_CharFill(PNetString* str, sint32 start, sint32 count, char ch) { - const ArrayUInt16* array = str->value; + const ArrayChar* array = str->value; sint32 length = start + count; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); @@ -1001,7 +1002,7 @@ } N3* vm = VMThread::get()->vm; - const ArrayUInt16* val = vm->bufToArray(buf, length); + const ArrayChar* val = vm->bufToArray(buf, length); str->value = val; str->length = length; } @@ -1064,5 +1065,6 @@ } extern "C" VMObject* System_Threading_Thread_InternalCurrentThread() { - return VMThread::get()->vmThread; + declare_gcroot(VMObject*, res) = VMThread::get()->vmThread; + return res; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Mon Oct 12 12:59:53 2009 @@ -179,7 +179,7 @@ args.push_back(MSCorlib::pIntPtr); VMMethod* meth = cl->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); - VMThread* myth = VMThread::get(); + declare_gcroot(VMThread*, myth) = VMThread::get(); (*meth)(th, myth); myth->vmThread = th; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.cpp Mon Oct 12 12:59:53 2009 @@ -24,20 +24,20 @@ using namespace llvm; -CLIString* CLIString::stringDup(const ArrayUInt16*& array, N3* vm) { +CLIString* CLIString::stringDup(const ArrayChar*& array, N3* vm) { PNetString* obj = (PNetString*)(*MSCorlib::pString)(); obj->capacity = array->size; obj->length = array->size; if (array->size == 0) { obj->firstChar = 0; } else { - obj->firstChar = array->at(0); + obj->firstChar = array->elements[0]; } obj->value = array; return obj; } -const ArrayUInt16* CLIString::strToArray(N3* vm) const { +const ArrayChar* CLIString::strToArray(N3* vm) const { return ((PNetString*)this)->value; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.h (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.h Mon Oct 12 12:59:53 2009 @@ -19,7 +19,7 @@ namespace n3 { -class ArrayUInt16; +class ArrayChar; class PNetString : public CLIString { public: @@ -28,7 +28,7 @@ sint32 capacity; sint32 length; uint8 firstChar; - const ArrayUInt16* value; + const ArrayChar* value; llvm::GlobalVariable* _llvmVar; }; Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Mon Oct 12 12:59:53 2009 @@ -703,12 +703,12 @@ } } -const ArrayUInt16* Assembly::readUTF16(N3* vm, uint32 len, +const ArrayChar* Assembly::readUTF16(N3* vm, uint32 len, Reader* reader) { return readUTF16(vm, len, reader->bytes, reader->cursor); } -const ArrayUInt16* Assembly::readUTF16(N3* vm, uint32 len, +const ArrayChar* Assembly::readUTF16(N3* vm, uint32 len, ByteCode* bytes, uint32 &offset) { uint32 realLen = len >> 1; uint16* buf = (uint16*)alloca(len); @@ -1882,7 +1882,7 @@ return NULL; } -const ArrayUInt16* Assembly::readUserString(uint32 token) { +const ArrayChar* Assembly::readUserString(uint32 token) { uint32 offset = CLIHeader->usStream->realOffset + token; uint8 size = READ_U1(bytes, offset); Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Mon Oct 12 12:59:53 2009 @@ -38,7 +38,7 @@ using mvm::UTF8; using mvm::UTF8Map; -class ArrayUInt16; +class ArrayChar; class ArrayUInt8; class ArrayObject; class Assembly; @@ -199,8 +199,8 @@ static const UTF8* readUTF8(N3* vm, uint32 len, Reader* reader); static const UTF8* readUTF8(N3* vm, uint32 len, ByteCode* bytes, uint32& offset); - static const ArrayUInt16* readUTF16(N3* vm, uint32 len, Reader* reader); - static const ArrayUInt16* readUTF16(N3* vm, uint32 len, ByteCode* bytes, uint32& offset); + static const ArrayChar* readUTF16(N3* vm, uint32 len, Reader* reader); + static const ArrayChar* readUTF16(N3* vm, uint32 len, ByteCode* bytes, uint32& offset); const UTF8* readString(N3* vm, uint32 offset); void readTables(Reader* reader); @@ -260,7 +260,7 @@ uint32 getTypedefTokenFromMethod(uint32 token); VMMethod* readMemberRefAsMethod(uint32 token, std::vector* genArgs, VMGenericClass* genClass, VMGenericMethod* genMethod); - const ArrayUInt16* readUserString(uint32 token); + const ArrayChar* readUserString(uint32 token); uint32 getExplicitLayout(uint32 token); uint32 getRVAFromField(uint32 token); Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Mon Oct 12 12:59:53 2009 @@ -140,6 +140,7 @@ } #endif + VirtualTable* CLIJit::makeArrayVT(VMClassArray* cl) { VirtualTable * res = (VirtualTable*)malloc(VT_SIZE); memcpy(res, VMObject::VT, VT_SIZE); @@ -236,6 +237,28 @@ cl->virtualTracer = func; #endif + + if (cl->baseClass == MSCorlib::pChar) { + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayChar::VT)[VT_PRINT_OFFSET]; + } else if(cl->baseClass == MSCorlib::pSInt8) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArraySInt8::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pUInt8) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayUInt8::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pSInt16) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArraySInt16::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pUInt16) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayUInt16::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pSInt32) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArraySInt32::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pUInt32) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayUInt32::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pSInt64) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayLong::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pFloat) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayFloat::VT)[VT_PRINT_OFFSET]; + else if(cl->baseClass == MSCorlib::pDouble) + ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayDouble::VT)[VT_PRINT_OFFSET]; + return res; } @@ -288,6 +311,7 @@ cl->staticTracer = func; } #endif + return res; } @@ -1532,6 +1556,8 @@ PointerType::getUnqual(module->getTypeByName("ArrayUInt8")); ArraySInt8::llvmType = PointerType::getUnqual(module->getTypeByName("ArraySInt8")); + ArrayChar::llvmType = + PointerType::getUnqual(module->getTypeByName("ArrayUInt16")); // should be ArrayChar... but it does not work? ArrayUInt16::llvmType = PointerType::getUnqual(module->getTypeByName("ArrayUInt16")); ArraySInt16::llvmType = @@ -1546,13 +1572,11 @@ PointerType::getUnqual(module->getTypeByName("ArrayFloat")); ArrayObject::llvmType = PointerType::getUnqual(module->getTypeByName("ArrayObject")); - // UTF8::llvmType = - // PointerType::getUnqual(module->getTypeByName("ArrayUInt16")); CacheNode::llvmType = PointerType::getUnqual(module->getTypeByName("CacheNode")); Enveloppe::llvmType = PointerType::getUnqual(module->getTypeByName("Enveloppe")); - + #ifdef WITH_TRACER markAndTraceLLVM = module->getFunction("MarkAndTrace"); markAndTraceLLVMType = markAndTraceLLVM->getFunctionType(); Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Mon Oct 12 12:59:53 2009 @@ -77,7 +77,6 @@ virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLIJit"); } - virtual void TRACER; static const char* OpcodeNames[0xE1]; static const char* OpcodeNamesFE[0x23]; Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Mon Oct 12 12:59:53 2009 @@ -54,7 +54,7 @@ assert(0 && "implement index out of bounds exception"); } -extern "C" VMObject* newString(const ArrayUInt16* utf8) { +extern "C" VMObject* newString(const ArrayChar* utf8) { N3 *vm = (N3*)VMThread::get()->vm; return vm->arrayToString(utf8); } Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Mon Oct 12 12:59:53 2009 @@ -20,7 +20,7 @@ namespace n3 { class N3; -class ArrayUInt16; +class ArrayChar; class CLIString : public VMObject { public: @@ -33,8 +33,8 @@ llvm::GlobalVariable* llvmVar(); - static CLIString* stringDup(const ArrayUInt16*& array, N3* vm); - const ArrayUInt16 *strToArray(N3 *vm) const; + static CLIString* stringDup(const ArrayChar*& array, N3* vm); + const ArrayChar *strToArray(N3 *vm) const; }; } // end namespace jnjvm Modified: vmkit/trunk/lib/N3/VMCore/MSCorlib.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/MSCorlib.inc?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/MSCorlib.inc (original) +++ vmkit/trunk/lib/N3/VMCore/MSCorlib.inc Mon Oct 12 12:59:53 2009 @@ -157,7 +157,7 @@ } else if (srcType->super != MSCorlib::pValue && srcType->super != MSCorlib::pEnum) { sint32 i = sstart; while (i < sstart + len && !doThrow) { - VMObject* cur = ((ArrayObject*)src)->at(i); + VMObject* cur = ((ArrayObject*)src)->elements[i]; if (cur) { if (!(cur->classOf->isAssignableFrom(dstType))) { doThrow = true; Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Mon Oct 12 12:59:53 2009 @@ -107,7 +107,6 @@ this->protectModule = new mvm::LockNormal(); this->functions = new(allocator, "FunctionMap") FunctionMap(); - this->hashStr = new(allocator, "StringMap") StringMap(); this->loadedAssemblies = new(allocator, "AssemblyMap") AssemblyMap(); this->TheModuleProvider = new N3ModuleProvider(this->LLVMModule, this->functions); @@ -322,7 +321,7 @@ ClArgumentsInfo& info = vm->argumentsInfo; ArrayObject* args = (ArrayObject*)MSCorlib::arrayString->doNew(info.argc-2); for (int i = 2; i < info.argc; ++i) { - args->setAt(i - 2, (VMObject*)vm->arrayToString(vm->asciizToArray(info.argv[i]))); + args->elements[i - 2] = (VMObject*)vm->arrayToString(vm->asciizToArray(info.argv[i])); } try{ @@ -341,21 +340,21 @@ -ArrayUInt16* N3::asciizToArray(const char* asciiz) { +ArrayChar* N3::asciizToArray(const char* asciiz) { uint32 len = strlen(asciiz); - ArrayUInt16 *res = (ArrayUInt16*)MSCorlib::arrayChar->doNew(len); + ArrayChar *res = (ArrayChar*)MSCorlib::arrayChar->doNew(len); for(uint32 i=0; ielements[i] = asciiz[i]; return res; } -ArrayUInt16* N3::bufToArray(const uint16* buf, uint32 size) { - ArrayUInt16 *res = (ArrayUInt16*)MSCorlib::arrayChar->doNew(size); +ArrayChar* N3::bufToArray(const uint16* buf, uint32 size) { + ArrayChar *res = (ArrayChar*)MSCorlib::arrayChar->doNew(size); memcpy(res->elements, buf, size<<1); return res; } -ArrayUInt16* N3::UTF8ToArray(const UTF8 *utf8) { +ArrayChar* N3::UTF8ToArray(const UTF8 *utf8) { return bufToArray(utf8->elements, utf8->size); } @@ -367,11 +366,11 @@ return hashUTF8->lookupOrCreateReader(buf, len); } -const UTF8* N3::arrayToUTF8(const ArrayUInt16 *array) { +const UTF8* N3::arrayToUTF8(const ArrayChar *array) { return bufToUTF8(array->elements, array->size); } -CLIString *N3::arrayToString(const ArrayUInt16 *array) { +CLIString *N3::arrayToString(const ArrayChar *array) { return (CLIString*)CLIString::stringDup(array, this); } Modified: vmkit/trunk/lib/N3/VMCore/N3.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.h (original) +++ vmkit/trunk/lib/N3/VMCore/N3.h Mon Oct 12 12:59:53 2009 @@ -34,7 +34,6 @@ using mvm::UTF8; using mvm::UTF8Map; class ArrayObject; -class ArrayUInt8; class Assembly; class AssemblyMap; class N3; @@ -50,7 +49,7 @@ class VMMethod; class VMObject; class VMThread; -class ArrayUInt16; +class ArrayChar; class CLIString; class ThreadSystem : public mvm::PermanentObject { @@ -92,7 +91,6 @@ ThreadSystem* threadSystem; VMThread* bootstrapThread; - StringMap* hashStr; UTF8Map* hashUTF8; mvm::Lock* protectModule; @@ -126,13 +124,13 @@ // usefull string, uint16 and utf8 functions - ArrayUInt16* asciizToArray(const char *asciiz); - ArrayUInt16* bufToArray(const uint16 *buf, uint32 len); - ArrayUInt16* UTF8ToArray(const UTF8 *utf8); + ArrayChar* asciizToArray(const char *asciiz); + ArrayChar* bufToArray(const uint16 *buf, uint32 len); + ArrayChar* UTF8ToArray(const UTF8 *utf8); const UTF8* asciizToUTF8(const char *asciiz); const UTF8* bufToUTF8(const uint16 *buf, uint32 len); - const UTF8* arrayToUTF8(const ArrayUInt16 *array); - CLIString* arrayToString(const ArrayUInt16 *array); + const UTF8* arrayToUTF8(const ArrayChar *array); + CLIString* arrayToString(const ArrayChar *array); /* void illegalAccessException(const char* msg); Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Mon Oct 12 12:59:53 2009 @@ -149,6 +149,7 @@ const llvm::Type* ArrayUInt8::llvmType = 0; const llvm::Type* ArraySInt8::llvmType = 0; +const llvm::Type* ArrayChar::llvmType = 0; const llvm::Type* ArrayUInt16::llvmType = 0; const llvm::Type* ArraySInt16::llvmType = 0; const llvm::Type* ArrayUInt32::llvmType = 0; @@ -178,6 +179,7 @@ INIT(VMArray); INIT(ArrayUInt8); INIT(ArraySInt8); + INIT(ArrayChar); INIT(ArrayUInt16); INIT(ArraySInt16); INIT(ArrayUInt32); Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Mon Oct 12 12:59:53 2009 @@ -1573,7 +1573,7 @@ case LDSTR : { uint32 value = readU4(bytecodes, i); uint32 index = value & 0xfffffff; - const ArrayUInt16* array = compilingClass->assembly->readUserString(index); + const ArrayChar* array = compilingClass->assembly->readUserString(index); Value* val = ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), (int64_t)array), module->ptrType); Value* res = CallInst::Create(newStringLLVM, val, "", currentBlock); Modified: vmkit/trunk/lib/N3/VMCore/VMArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.cpp Mon Oct 12 12:59:53 2009 @@ -20,152 +20,38 @@ const sint32 VMArray::MaxArraySize = 268435455; -#define ACONS(name, elmt, size) \ - name *name::acons(sint32 n, VMClassArray* atype) { \ - if (n < 0) \ - VMThread::get()->vm->negativeArraySizeException(n); \ - else if (n > VMArray::MaxArraySize) \ - VMThread::get()->vm->outOfMemoryError(n); \ - name* res = (name*) \ - gc::operator new(sizeof(VMObject) + sizeof(sint32) + n * size, \ - VMObject::VT); \ - res->initialise(atype, n); \ - res->setVirtualTable(name::VT); \ - return res; \ - } - -#define INITIALISE(name) \ - void name::initialise(VMCommonClass* atype, sint32 n) { \ - VMObject::initialise(atype); \ - this->size = n; \ - for (int i = 0; i < n; i++) \ - elements[i] = 0; \ - } \ - -#define AT(name, elmt) \ - elmt name::at(sint32 offset) const { \ - if (offset >= size) \ - VMThread::get()->vm->indexOutOfBounds(this, offset); \ - return elements[offset]; \ - } \ - void name::setAt(sint32 offset, elmt value) { \ - if (offset >= size) \ - VMThread::get()->vm->indexOutOfBounds(this, offset); \ - elements[offset] = value; \ - } - -#define ARRAYCLASS(name, elmt, size) \ - ACONS(name, elmt, size) \ - INITIALISE(name) \ - AT(name, elmt) \ - -ARRAYCLASS(ArrayUInt8, uint8, 1) -ARRAYCLASS(ArraySInt8, sint8, 1) -ARRAYCLASS(ArrayUInt16, uint16, 2) -ARRAYCLASS(ArraySInt16, sint16, 2) -ARRAYCLASS(ArrayUInt32, uint32, 4) -ARRAYCLASS(ArraySInt32, sint32, 4) -ARRAYCLASS(ArrayLong, sint64, 8) -ARRAYCLASS(ArrayFloat, float, 4) -ARRAYCLASS(ArrayDouble, double, 8) -ARRAYCLASS(ArrayObject, VMObject*, 4) +#define PRINT(name, printer, pre, sep, post) \ + void name::print(mvm::PrintBuffer *buf) const { \ + declare_gcroot(const name *, self) = this; \ + buf->write(pre); \ + for(int i=0; isize; i++) { \ + if(i) \ + buf->write(sep); \ + buf->printer(self->elements[i]); \ + } \ + buf->write(post); \ + } + +#define ARRAYCLASS(name, elmt, size, printer, pre, sep, post) \ + PRINT(name, printer, pre, sep, post) + +ARRAYCLASS(ArrayUInt8, uint8, 1, writeS4, "Array<", " ", ">") +ARRAYCLASS(ArraySInt8, sint8, 1, writeS4, "Array<", " ", ">") +ARRAYCLASS(ArrayChar, uint16, 2, writeChar, "", "", "") +ARRAYCLASS(ArrayUInt16, uint16, 2, writeS4, "Array<", " ", ">") +ARRAYCLASS(ArraySInt16, sint16, 2, writeS4, "Array<", " ", ">") +ARRAYCLASS(ArrayUInt32, uint32, 4, writeS4, "Array<", " ", ">") +ARRAYCLASS(ArraySInt32, sint32, 4, writeS4, "Array<", " ", ">") +ARRAYCLASS(ArrayLong, sint64, 8, writeS8, "Array<", " ", ">") +ARRAYCLASS(ArrayFloat, float, 4, writeFP, "Array<", " ", ">") +ARRAYCLASS(ArrayDouble, double, 8, writeFP, "Array<", " ", ">") +ARRAYCLASS(ArrayObject, VMObject*, 4, writeObj, "Array<", " ", ">") void VMArray::print(mvm::PrintBuffer *buf) const { assert(0 && "should not be here"); } - -void ArrayUInt8::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS4(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArraySInt8::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS4(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArrayUInt16::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS4(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArraySInt16::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS4(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArrayUInt32::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS4(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArraySInt32::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS4(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArrayLong::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeS8(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArrayFloat::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeFP(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArrayDouble::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - buf->writeFP(elements[i]); - buf->write(" "); - } - buf->write(">"); -} - -void ArrayObject::print(mvm::PrintBuffer *buf) const { - buf->write("Array<"); - for (int i = 0; i < size; i++) { - elements[i]->print(buf); - buf->write(" "); - } - buf->write(">"); -} - - +#undef PRINT #undef AT #undef INITIALISE #undef ACONS Modified: vmkit/trunk/lib/N3/VMCore/VMArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.h Mon Oct 12 12:59:53 2009 @@ -51,16 +51,13 @@ static const llvm::Type* llvmType; \ sint32 size; \ elmt elements[1]; \ - static name *acons(sint32 n, VMClassArray* cl); \ - void initialise(VMCommonClass* atype, sint32 n); \ - elmt at(sint32) const; \ - void setAt(sint32, elmt); \ virtual void print(mvm::PrintBuffer* buf) const; \ virtual void TRACER; \ } ARRAYCLASS(ArrayUInt8, uint8); ARRAYCLASS(ArraySInt8, sint8); +ARRAYCLASS(ArrayChar, uint16); ARRAYCLASS(ArrayUInt16, uint16); ARRAYCLASS(ArraySInt16, sint16); ARRAYCLASS(ArrayUInt32, uint32); @@ -68,23 +65,10 @@ ARRAYCLASS(ArrayLong, sint64); ARRAYCLASS(ArrayFloat, float); ARRAYCLASS(ArrayDouble, double); +ARRAYCLASS(ArrayObject, VMObject*); #undef ARRAYCLASS -class ArrayObject : public VMObject { -public: - static VirtualTable* VT; - static const llvm::Type* llvmType; - sint32 size; - VMObject* elements[1]; - static ArrayObject *acons(sint32 n, VMClassArray* cl); - void initialise(VMCommonClass* atype, sint32 n); - VMObject* at(sint32) const; - void setAt(sint32, VMObject*); - virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; -}; - } // end namespace n3 Modified: vmkit/trunk/lib/N3/VMCore/VMCache.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.h Mon Oct 12 12:59:53 2009 @@ -27,7 +27,6 @@ class CacheNode : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; void* methPtr; VMClass* lastCible; @@ -42,7 +41,6 @@ class Enveloppe : public mvm::PermanentObject { public: - virtual void TRACER; virtual void print(mvm::PrintBuffer* buf) const; CacheNode *firstCache; Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Mon Oct 12 12:59:53 2009 @@ -283,7 +283,6 @@ class Param : public mvm::PermanentObject { public: virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; uint32 flags; uint32 sequence; Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Mon Oct 12 12:59:53 2009 @@ -31,14 +31,17 @@ if (cur->interruptFlag != 0) { cur->lock->unlock(); continue; - } else if (cur->vmThread != 0) { - cur->varcond->signal(); - cur->lock->unlock(); - threads.erase(i); - break; - } else { // dead thread - threads.erase(i); - } + } else { + declare_gcroot(VMObject *, th) = cur->vmThread; + if (th != 0) { + cur->varcond->signal(); + cur->lock->unlock(); + threads.erase(i); + break; + } else { // dead thread + threads.erase(i); + } + } } } Modified: vmkit/trunk/lib/N3/VMCore/VMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.cpp Mon Oct 12 12:59:53 2009 @@ -30,7 +30,8 @@ void VMThread::print(mvm::PrintBuffer* buf) const { buf->write("Thread:"); - vmThread->print(buf); + declare_gcroot(VMObject *, th) = vmThread; + th->print(buf); } extern void AddStandardCompilePasses(llvm::FunctionPassManager*); @@ -40,6 +41,7 @@ } VMThread::VMThread(VMObject* thread, N3* vm) { + llvm_gcroot(thread, 0); this->perFunctionPasses = 0; this->vmThread = thread; this->vm = vm; @@ -55,9 +57,10 @@ VMObject* VMThread::currentThread() { VMThread* result = get(); - if (result != 0) - return result->vmThread; - else + if (result != 0) { + declare_gcroot(VMObject *, res) = result->vmThread; + return res; + } else return 0; } Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83864&r1=83863&r2=83864&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Mon Oct 12 12:59:53 2009 @@ -28,6 +28,7 @@ INIT(VMArray); INIT(ArrayUInt8); INIT(ArraySInt8); + INIT(ArrayChar); INIT(ArrayUInt16); INIT(ArraySInt16); INIT(ArrayUInt32); @@ -42,22 +43,24 @@ #undef INIT -void CLIJit::TRACER { - compilingMethod->CALL_TRACER; - compilingClass->CALL_TRACER; -} - -void CacheNode::TRACER { - ((mvm::Object*)methPtr)->MARK_AND_TRACE; - lastCible->CALL_TRACER; - next->CALL_TRACER; - enveloppe->CALL_TRACER; -} - -void Enveloppe::TRACER { - firstCache->CALL_TRACER; - //cacheLock->MARK_AND_TRACE; - originalMethod->CALL_TRACER; +#ifdef MULTIPLE_GC +extern "C" void CLIObjectTracer(VMObject* obj, Collector* GC) { +#else +extern "C" void CLIObjectTracer(VMObject* obj) { +#endif + obj->lockObj->MARK_AND_TRACE; +} + +// N3 Objects +void LockObj::TRACER { +} + +void VMObject::TRACER { + lockObj->MARK_AND_TRACE; +} + +void CLIString::TRACER { + VMObject::CALL_TRACER; } void VMArray::TRACER { @@ -79,6 +82,7 @@ ARRAYTRACER(ArrayUInt8) ARRAYTRACER(ArraySInt8) +ARRAYTRACER(ArrayChar) ARRAYTRACER(ArrayUInt16) ARRAYTRACER(ArraySInt16) ARRAYTRACER(ArrayUInt32) @@ -89,7 +93,6 @@ #undef ARRAYTRACER - #define TRACE_VECTOR(type, name, alloc) { \ for (std::vector >::iterator i = name.begin(), e = name.end(); \ i!= e; ++i) { \ @@ -100,32 +103,35 @@ i!= e; ++i) { \ (*i)->CALL_TRACER; }} - -// root of tracing +// internal objects void VMThread::TRACER { - vmThread->MARK_AND_TRACE; - vm->CALL_TRACER; - //lock->MARK_AND_TRACE; - //varcond->MARK_AND_TRACE; + declare_gcroot(VMObject*, th) = vmThread; + th->MARK_AND_TRACE; pendingException->MARK_AND_TRACE; + // I suppose that the vm is already traced by the gc + // vm->CALL_TRACER; } +void N3::TRACER { + // If I understand, the gc already call trace for all VMThread +// if (bootstrapThread) { +// bootstrapThread->CALL_TRACER; +// for (VMThread* th = (VMThread*)bootstrapThread->next(); +// th != bootstrapThread; th = (VMThread*)th->next()) +// th->CALL_TRACER; +// } + loadedAssemblies->CALL_TRACER; +} -void VMCommonClass::TRACER { - super->CALL_TRACER; - CALL_TRACER_VECTOR(VMClass*, interfaces, std::allocator); - //lockVar->MARK_AND_TRACE; - //condVar->MARK_AND_TRACE; - CALL_TRACER_VECTOR(VMMethod*, virtualMethods, std::allocator); - CALL_TRACER_VECTOR(VMMethod*, staticMethods, std::allocator); - CALL_TRACER_VECTOR(VMField*, virtualFields, std::allocator); - CALL_TRACER_VECTOR(VMField*, staticFields, std::allocator); +void Assembly::TRACER { + loadedNameClasses->CALL_TRACER; delegatee->MARK_AND_TRACE; - CALL_TRACER_VECTOR(VMCommonClass*, display, std::allocator); - vm->CALL_TRACER; +} - assembly->CALL_TRACER; - //funcs->MARK_AND_TRACE; +void VMCommonClass::TRACER { + delegatee->MARK_AND_TRACE; + CALL_TRACER_VECTOR(VMMethod*, virtualMethods, std::allocator); + CALL_TRACER_VECTOR(VMMethod*, staticMethods, std::allocator); CALL_TRACER_VECTOR(Property*, properties, gc_allocator); } @@ -133,93 +139,32 @@ VMCommonClass::CALL_TRACER; staticInstance->MARK_AND_TRACE; virtualInstance->MARK_AND_TRACE; - CALL_TRACER_VECTOR(VMClass*, innerClasses, std::allocator); - outerClass->CALL_TRACER; - CALL_TRACER_VECTOR(VMMethod*, genericMethods, std::allocator); } void VMGenericClass::TRACER { VMClass::CALL_TRACER; - CALL_TRACER_VECTOR(VMCommonClass*, genericParams, std::allocator); } void VMClassArray::TRACER { VMCommonClass::CALL_TRACER; - baseClass->CALL_TRACER; } void VMClassPointer::TRACER { VMCommonClass::CALL_TRACER; - baseClass->CALL_TRACER; } void VMMethod::TRACER { delegatee->MARK_AND_TRACE; - //signature->MARK_AND_TRACE; - classDef->CALL_TRACER; - CALL_TRACER_VECTOR(Param*, params, gc_allocator); - CALL_TRACER_VECTOR(Enveloppe*, caches, gc_allocator); } void VMGenericMethod::TRACER { VMMethod::CALL_TRACER; - CALL_TRACER_VECTOR(VMCommonClass*, genericParams, std::allocator); -} - -void VMField::TRACER { - signature->CALL_TRACER; - classDef->CALL_TRACER; -} - -void LockObj::TRACER { -} - -void VMObject::TRACER { - classOf->CALL_TRACER; - lockObj->MARK_AND_TRACE; -} - -void Param::TRACER { - method->CALL_TRACER; } void Property::TRACER { - type->CALL_TRACER; - //signature->MARK_AND_TRACE; delegatee->MARK_AND_TRACE; } -void Assembly::TRACER { - loadedNameClasses->CALL_TRACER; - loadedTokenClasses->CALL_TRACER; - loadedTokenMethods->CALL_TRACER; - loadedTokenFields->CALL_TRACER; - vm->CALL_TRACER; - delegatee->MARK_AND_TRACE; - // TODO trace assembly refs... -} - -void N3::TRACER { - functions->CALL_TRACER; - if (bootstrapThread) { - bootstrapThread->CALL_TRACER; - for (VMThread* th = (VMThread*)bootstrapThread->next(); - th != bootstrapThread; th = (VMThread*)th->next()) - th->CALL_TRACER; - } - hashStr->CALL_TRACER; - loadedAssemblies->CALL_TRACER; -} - -void CLIString::TRACER { -} - -#ifdef MULTIPLE_GC -extern "C" void CLIObjectTracer(VMObject* obj, Collector* GC) { -#else -extern "C" void CLIObjectTracer(VMObject* obj) { -#endif - obj->classOf->CALL_TRACER; - obj->lockObj->MARK_AND_TRACE; +// never called but it simplifies the definition of LockedMap +void VMField::TRACER { } - From nicolas.geoffray at lip6.fr Mon Oct 12 11:21:06 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 18:21:06 -0000 Subject: [vmkit-commits] [vmkit] r83866 - in /vmkit/trunk: include/mvm/VirtualMachine.h lib/JnJVM/VMCore/Jnjvm.h lib/Mvm/CommonThread/ctthread.cpp lib/Mvm/GCMmap2/MvmGC.h lib/Mvm/GCMmap2/gcinit.cpp lib/Mvm/GCMmap2/gcthread.cpp lib/Mvm/GCMmap2/gcthread.h Message-ID: <200910121821.n9CIL64Y017969@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 13:21:05 2009 New Revision: 83866 URL: http://llvm.org/viewvc/llvm-project?rev=83866&view=rev Log: Move the list of threads from GCThread to VirtualMachine. Modified: vmkit/trunk/include/mvm/VirtualMachine.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp vmkit/trunk/lib/Mvm/GCMmap2/gcthread.cpp vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h Modified: vmkit/trunk/include/mvm/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/VirtualMachine.h?rev=83866&r1=83865&r2=83866&view=diff ============================================================================== --- vmkit/trunk/include/mvm/VirtualMachine.h (original) +++ vmkit/trunk/include/mvm/VirtualMachine.h Mon Oct 12 13:21:05 2009 @@ -127,11 +127,60 @@ ToEnqueue = new gc*[INITIAL_QUEUE_SIZE]; ToEnqueueLength = INITIAL_QUEUE_SIZE; ToEnqueueIndex = 0; + + mainThread = 0; + NumberOfThreads = 0; } public: + /// allocator - Bump pointer allocator to allocate permanent memory + /// related to this VM. + /// mvm::BumpPtrAllocator& allocator; + /// mainThread - The main thread of this VM. + /// + mvm::Thread* mainThread; + + /// NumberOfThreads - The number of threads that currently run under this VM. + /// + uint32_t NumberOfThreads; + + /// ThreadLock - Lock to create or destroy a new thread. + /// + mvm::SpinLock ThreadLock; + + /// setMainThread - Set the main thread of this VM. + /// + void setMainThread(mvm::Thread* th) { mainThread = th; } + + /// getMainThread - Get the main thread of this VM. + /// + mvm::Thread* getMainThread() const { return mainThread; } + + /// addThread - Add a new thread to the list of threads. + /// + void addThread(mvm::Thread* th) { + ThreadLock.lock(); + NumberOfThreads++; + if (th != mainThread) { + if (mainThread) th->append(mainThread); + else mainThread = th; + } + ThreadLock.unlock(); + } + + /// removeThread - Remove the thread from the list of threads. + /// + void removeThread(mvm::Thread* th) { + ThreadLock.lock(); + NumberOfThreads--; + th->remove(); + if (!NumberOfThreads) mainThread = 0; + ThreadLock.unlock(); + } + + virtual void tracer() {} virtual ~VirtualMachine() {} Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=83866&r1=83865&r2=83866&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Mon Oct 12 13:21:05 2009 @@ -109,10 +109,6 @@ private: - /// mainThread - The initial thread of this JVM. - /// - JavaThread* mainThread; - /// finalizerThread - The thread that finalizes Java objects. /// JavaThread* finalizerThread; @@ -294,14 +290,6 @@ /// ArrayUInt16* asciizToArray(const char* asciiz); - /// setMainThread - Set the main thread of this VM. - /// - void setMainThread(JavaThread* th) { mainThread = th; } - - /// getMainThread - Get the main thread of this VM. - /// - JavaThread* getMainThread() const { return mainThread; } - /// setFinalizerThread - Set the finalizer thread of this VM. /// void setFinalizerThread(JavaThread* th) { finalizerThread = th; } Modified: vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp?rev=83866&r1=83865&r2=83866&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp (original) +++ vmkit/trunk/lib/Mvm/CommonThread/ctthread.cpp Mon Oct 12 13:21:05 2009 @@ -173,13 +173,13 @@ sa.sa_sigaction = sigsegvHandler; sigaction(SIGSEGV, &sa, NULL); -#ifdef ISOLATE assert(th->MyVM && "VM not set in a thread"); +#ifdef ISOLATE th->IsolateID = th->MyVM->IsolateID; #endif - Collector::inject_my_thread(th); + th->MyVM->addThread(th); th->routine(th); - Collector::remove_my_thread(th); + th->MyVM->removeThread(th); } Modified: vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h?rev=83866&r1=83865&r2=83866&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/MvmGC.h Mon Oct 12 13:21:05 2009 @@ -92,11 +92,6 @@ siggc_handler(0); } - static void inject_my_thread(mvm::Thread* th); - static inline void remove_my_thread(mvm::Thread* th) { - threads->remove(th); - } - static inline void *allocate_unprotected(size_t sz) { return allocator->alloc(sz); } Modified: vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp?rev=83866&r1=83865&r2=83866&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gcinit.cpp Mon Oct 12 13:21:05 2009 @@ -65,7 +65,3 @@ allocator = 0; } -void Collector::inject_my_thread(mvm::Thread* th) { - threads->inject(th); -} - Modified: vmkit/trunk/lib/Mvm/GCMmap2/gcthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gcthread.cpp?rev=83866&r1=83865&r2=83866&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gcthread.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gcthread.cpp Mon Oct 12 13:21:05 2009 @@ -13,17 +13,22 @@ using namespace mvm; void GCThread::waitStacks() { + mvm::Thread* self = mvm::Thread::get(); _stackLock.lock(); - while(_nb_collected < _nb_threads) + while(_nb_collected < self->MyVM->NumberOfThreads) _stackCond.wait(&_stackLock); _stackLock.unlock(); } void GCThread::synchronize() { - + + mvm::Thread* self = mvm::Thread::get(); + assert(self && "No thread local data for this thread"); + + // Lock thread lock, so that we can traverse the thread list safely. + self->MyVM->ThreadLock.lock(); + if (cooperative) { - mvm::Thread* self = mvm::Thread::get(); - assert(self && "No thread local data for this thread"); current_collector = self; _nb_collected = 0; @@ -74,4 +79,6 @@ waitStacks(); } + + self->MyVM->ThreadLock.unlock(); } Modified: vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h?rev=83866&r1=83865&r2=83866&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gcthread.h Mon Oct 12 13:21:05 2009 @@ -29,9 +29,6 @@ /// _collectionCond - Condition for unblocking the collector. Cond _collectionCond; - /// _nb_threads - Number of active threads. - unsigned int _nb_threads; - /// _nb_collected - Number of threads collected. unsigned int _nb_collected; @@ -41,7 +38,6 @@ public: - mvm::Thread* base; bool cooperative; mvm::Thread* getCurrentCollector() { @@ -49,10 +45,8 @@ } GCThread() { - _nb_threads = 0; _nb_collected = 0; current_collector = 0; - base = 0; #ifdef WITH_LLVM_GCC cooperative = true; #else @@ -60,9 +54,6 @@ #endif } - inline unsigned int get_nb_threads() { - return _nb_threads; - } inline void lock() { _globalLock.lock(); } inline void unlock() { _globalLock.unlock(); } @@ -92,46 +83,10 @@ inline void collectorGo() { _stackCond.broadcast(); } - inline void cancel() { - // all stacks have been collected - _nb_collected = _nb_threads; - // unblock all threads in stack collection - collectorGo(); - // unblock mutators - collectionFinished(); - } - inline void another_mark() { _nb_collected++; } void synchronize(); - inline void remove(mvm::Thread* th) { - lock(); - th->remove(); - _nb_threads--; - if (!_nb_threads) base = 0; -#ifdef SERVICE - th->MyVM->numThreads--; -#endif - unlock(); - } - - inline void inject(mvm::Thread* th) { - lock(); -#ifdef SERVICE - if (th->MyVM->numThreads + 1 > th->MyVM->threadLimit) { - unlock(); - th->MyVM->stopService(); - } - th->MyVM->numThreads++; -#endif - if (base) - th->append(base); - else - base = th; - _nb_threads++; - unlock(); - } }; } From nicolas.geoffray at lip6.fr Mon Oct 12 11:21:44 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 12 Oct 2009 18:21:44 -0000 Subject: [vmkit-commits] [vmkit] r83867 - /vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp Message-ID: <200910121821.n9CILiJR018001@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 12 13:21:44 2009 New Revision: 83867 URL: http://llvm.org/viewvc/llvm-project?rev=83867&view=rev Log: Forgot that file from last commit. Modified: vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp Modified: vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp?rev=83867&r1=83866&r2=83867&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp Mon Oct 12 13:21:44 2009 @@ -270,7 +270,7 @@ void* Stat = threadGroup->getStaticInstance(); RG = rootGroup->getObjectField(Stat); assert(vm->getMainThread() && "VM did not set its main thread"); - CreateJavaThread(vm, vm->getMainThread(), "main", RG); + CreateJavaThread(vm, (JavaThread*)vm->getMainThread(), "main", RG); // Create the "system" group. SystemGroup = threadGroup->doNew(vm); From gael.thomas at lip6.fr Mon Oct 12 12:58:42 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Mon, 12 Oct 2009 19:58:42 -0000 Subject: [vmkit-commits] [vmkit] r83885 - /vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Message-ID: <200910121958.n9CJwgsg022903@zion.cs.uiuc.edu> Author: gthomas Date: Mon Oct 12 14:58:42 2009 New Revision: 83885 URL: http://llvm.org/viewvc/llvm-project?rev=83885&view=rev Log: ClrHelper.GetSemantics is ok. Can execute scimark2.exe and linpack.exe. Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83885&r1=83884&r2=83885&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Mon Oct 12 14:58:42 2009 @@ -607,7 +607,6 @@ } extern "C" VMObject* System_Reflection_Assembly_GetType(VMObject* obj, PNetString* str, bool onError, bool ignoreCase) { - printf("Get type\n"); Assembly* ass = ASSEMBLY_VALUE(obj); const ArrayChar* array = str->value; mvm::PrintBuffer pb(array); @@ -681,23 +680,20 @@ } extern "C" VMObject* System_Reflection_ClrHelpers_GetSemantics(mvm::Object* item, uint32 attributes, bool nonPublic) { - VMThread::get()->vm->error("implement me: System_Reflection_ClrHelpers_GetSemantics"); -// if (item->getVirtualTable() == Property::VT) { -// Property* prop = (Property*)item; -// if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) { -// mvm::PrintBuffer _asciiz(prop->name); -// const char* asciiz = _asciiz.cString(); -// char* buf = (char*)alloca(strlen(asciiz) + 5); -// sprintf(buf, "get_%s", asciiz); -// N3* vm = VMThread::get()->vm; -// VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false); -// assert(meth); -// return meth->getMethodDelegatee(); -// } -// } else { -// VMThread::get()->vm->error("implement me"); -// } - return 0; + if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) { + Property* prop = (Property*)item; + mvm::PrintBuffer _asciiz(prop->name); + const char* asciiz = _asciiz.cString(); + char* buf = (char*)alloca(strlen(asciiz) + 5); + sprintf(buf, "get_%s", asciiz); + N3* vm = VMThread::get()->vm; + VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false); + assert(meth); + return meth->getMethodDelegatee(); + } else { + VMThread::get()->vm->error("implement me: GetSemantics: %d", attributes); + return 0; + } } static void decapsulePrimitive(VMObject* arg, const llvm::Type* type, std::vector& args) { From nicolas.geoffray at lip6.fr Tue Oct 13 00:07:35 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 07:07:35 -0000 Subject: [vmkit-commits] [vmkit] r83954 - in /vmkit/trunk: Makefile.config.in autoconf/configure.ac Message-ID: <200910130707.n9D77ZJw007191@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 02:07:35 2009 New Revision: 83954 URL: http://llvm.org/viewvc/llvm-project?rev=83954&view=rev Log: Add a new macro to test if building with MMTk. Modified: vmkit/trunk/Makefile.config.in vmkit/trunk/autoconf/configure.ac Modified: vmkit/trunk/Makefile.config.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.config.in?rev=83954&r1=83953&r2=83954&view=diff ============================================================================== --- vmkit/trunk/Makefile.config.in (original) +++ vmkit/trunk/Makefile.config.in Tue Oct 13 02:07:35 2009 @@ -8,6 +8,7 @@ GC_SINGLE_MMAP = @GC_SINGLE_MMAP@ GC_BOEHM = @GC_BOEHM@ GC_MMAP2 = @GC_MMAP2@ +GC_MMTK = @GC_MMTK@ 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=83954&r1=83953&r2=83954&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Oct 13 02:07:35 2009 @@ -225,6 +225,7 @@ AC_DEFINE([USE_GC_BOEHM], [1], [Using the boehm gc]) AC_SUBST(GC_MMAP2, [0]) AC_SUBST(GC_BOEHM, [1]) + AC_SUBST(GC_MMTK, [0]) GC_LIBS=BoehmGC case $target_os in *linux*) @@ -238,8 +239,9 @@ 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" + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK" else GC_LIBS=GCMmap2 if test "x$gc" = "xmulti-mmap"; then @@ -254,6 +256,7 @@ AC_DEFINE([USE_GC_MMAP2], [1], [Using the gcmmap2]) AC_SUBST(GC_MMAP2, [1]) AC_SUBST(GC_BOEHM, [0]) + AC_SUBST(GC_MMTK, [0]) fi fi From nicolas.geoffray at lip6.fr Tue Oct 13 00:08:14 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 07:08:14 -0000 Subject: [vmkit-commits] [vmkit] r83955 - /vmkit/trunk/configure Message-ID: <200910130708.n9D78E8V007219@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 02:08:14 2009 New Revision: 83955 URL: http://llvm.org/viewvc/llvm-project?rev=83955&view=rev Log: Regenerate. Modified: vmkit/trunk/configure Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=83955&r1=83954&r2=83955&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Tue Oct 13 02:08:14 2009 @@ -686,6 +686,7 @@ WITH_64 GC_MMAP2 GC_BOEHM +GC_MMTK GC_MULTI_MMAP GC_SINGLE_MMAP GC_FLAGS @@ -3958,6 +3959,8 @@ GC_BOEHM=1 + GC_MMTK=0 + GC_LIBS=BoehmGC case $target_os in *linux*) @@ -3975,8 +3978,10 @@ GC_BOEHM=0 + GC_MMTK=1 + GC_LIBS=MMTk - GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk" + GC_FLAGS="-I\$(PROJ_SRC_ROOT)/lib/Mvm/MMTk -DWITH_MMTK" else GC_LIBS=GCMmap2 if test "x$gc" = "xmulti-mmap"; then @@ -4001,6 +4006,8 @@ GC_BOEHM=0 + GC_MMTK=0 + fi fi @@ -7940,6 +7947,7 @@ WITH_64!$WITH_64$ac_delim GC_MMAP2!$GC_MMAP2$ac_delim GC_BOEHM!$GC_BOEHM$ac_delim +GC_MMTK!$GC_MMTK$ac_delim GC_MULTI_MMAP!$GC_MULTI_MMAP$ac_delim GC_SINGLE_MMAP!$GC_SINGLE_MMAP$ac_delim GC_FLAGS!$GC_FLAGS$ac_delim @@ -7968,7 +7976,6 @@ LN_S!$LN_S$ac_delim CMP!$CMP$ac_delim CP!$CP$ac_delim -DATE!$DATE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -8010,6 +8017,7 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +DATE!$DATE$ac_delim FIND!$FIND$ac_delim MKDIR!$MKDIR$ac_delim MV!$MV$ac_delim @@ -8031,7 +8039,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 From nicolas.geoffray at lip6.fr Tue Oct 13 00:11:08 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 07:11:08 -0000 Subject: [vmkit-commits] [vmkit] r83956 - in /vmkit/trunk: include/jnjvm/JnjvmModule.h lib/JnJVM/Compiler/ExceptionsCheck.inc lib/JnJVM/Compiler/ExceptionsDwarf.inc lib/JnJVM/Compiler/JavaJIT.cpp lib/JnJVM/Compiler/JavaJIT.h lib/JnJVM/Compiler/JnjvmModule.cpp lib/JnJVM/LLVMRuntime/Makefile lib/JnJVM/LLVMRuntime/runtime-default-thread.ll lib/JnJVM/LLVMRuntime/runtime-default.ll lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll Message-ID: <200910130711.n9D7B8LH007410@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 02:11:07 2009 New Revision: 83956 URL: http://llvm.org/viewvc/llvm-project?rev=83956&view=rev Log: The Thread layout is different whether we are building with MMTk or not. Added: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc vmkit/trunk/lib/JnJVM/Compiler/ExceptionsDwarf.inc vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll Modified: vmkit/trunk/include/jnjvm/JnjvmModule.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/jnjvm/JnjvmModule.h?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/include/jnjvm/JnjvmModule.h (original) +++ vmkit/trunk/include/jnjvm/JnjvmModule.h Tue Oct 13 02:11:07 2009 @@ -239,6 +239,7 @@ static const llvm::Type* JavaFieldType; static const llvm::Type* AttributType; static const llvm::Type* JavaThreadType; + static const llvm::Type* MutatorThreadType; #ifdef ISOLATE_SHARING static const llvm::Type* JnjvmType; Modified: vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc (original) +++ vmkit/trunk/lib/JnJVM/Compiler/ExceptionsCheck.inc Tue Oct 13 02:11:07 2009 @@ -6,7 +6,7 @@ InsertAtEnd); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps[2] = { module->constantZero, module->OffsetJavaExceptionInThreadConstant }; @@ -63,7 +63,7 @@ Instruction* res = CallInst::Create(F, arg1, Name, InsertAtEnd); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps[2] = { module->constantZero, module->OffsetJavaExceptionInThreadConstant }; @@ -114,7 +114,7 @@ Instruction* res = CallInst::Create(F, args, args + 2, Name, InsertAtEnd); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps[2] = { module->constantZero, module->OffsetJavaExceptionInThreadConstant }; @@ -162,7 +162,7 @@ Instruction* res = llvm::CallInst::Create(F, Name, InsertAtEnd); if (TheCompiler->hasExceptionsEnabled()) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps[2] = { module->constantZero, module->OffsetJavaExceptionInThreadConstant }; @@ -222,7 +222,7 @@ } void JavaJIT::throwException(Value* obj) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps[2] = { module->constantZero, module->OffsetJavaExceptionInThreadConstant }; @@ -400,7 +400,7 @@ // catch the exception but resume unwinding. JnjvmClassLoader* loader = compilingClass->classLoader;; if (loader != loader->bootstrapLoader) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->MutatorThreadType); Value* Isolate = GetElementPtrInst::Create(threadId, module->constantFour, "", currentBlock); @@ -475,7 +475,7 @@ // First thing in the handler: clear the exception. Value* geps[2] = { module->constantZero, module->OffsetJavaExceptionInThreadConstant }; - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", currentBlock); @@ -496,7 +496,7 @@ Value* IsolatePtr = 0; currentBlock = cur->javaHandler; if (loader != loader->bootstrapLoader) { - threadId = getCurrentThread(); + threadId = getCurrentThread(module->MutatorThreadType); IsolateIDPtr = GetElementPtrInst::Create(threadId, module->constantThree, "", cur->javaHandler); Modified: vmkit/trunk/lib/JnJVM/Compiler/ExceptionsDwarf.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/ExceptionsDwarf.inc?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/ExceptionsDwarf.inc (original) +++ vmkit/trunk/lib/JnJVM/Compiler/ExceptionsDwarf.inc Tue Oct 13 02:11:07 2009 @@ -388,7 +388,7 @@ // catch the exception but resume unwinding. JnjvmClassLoader* loader = compilingClass->classLoader;; if (loader != loader->bootstrapLoader) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->MutatorThreadType); Value* Isolate = GetElementPtrInst::Create(threadId, module->constantFour, "", currentBlock); @@ -413,7 +413,7 @@ } #endif - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps[2] = { module->constantZero, module->OffsetJavaExceptionInThreadConstant }; @@ -465,7 +465,7 @@ currentBlock = cur->nativeHandler; - threadId = getCurrentThread(); + threadId = getCurrentThread(module->JavaThreadType); javaExceptionPtr = GetElementPtrInst::Create(threadId, geps, geps + 2, "", currentBlock); @@ -521,7 +521,7 @@ Value* IsolatePtr = 0; currentBlock = cur->javaHandler; if (loader != loader->bootstrapLoader) { - threadId = getCurrentThread(); + threadId = getCurrentThread(module->MutatorThreadType); IsolateIDPtr = GetElementPtrInst::Create(threadId, module->constantThree, "", cur->javaHandler); @@ -558,7 +558,7 @@ if (PI == PE) { endExceptionBlock->eraseFromParent(); } else { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); Value* geps2[2] = { module->constantZero, module->OffsetCXXExceptionInThreadConstant }; Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.cpp Tue Oct 13 02:11:07 2009 @@ -209,15 +209,14 @@ #endif } -llvm::Value* JavaJIT::getCurrentThread() { +llvm::Value* JavaJIT::getCurrentThread(const llvm::Type* Ty) { Value* FrameAddr = CallInst::Create(module->llvm_frameaddress, module->constantZero, "", currentBlock); Value* threadId = new PtrToIntInst(FrameAddr, module->pointerSizeType, "", currentBlock); threadId = BinaryOperator::CreateAnd(threadId, module->constantThreadIDMask, "", currentBlock); - threadId = new IntToPtrInst(threadId, module->JavaThreadType, "", - currentBlock); + threadId = new IntToPtrInst(threadId, Ty, "", currentBlock); return threadId; } @@ -315,9 +314,10 @@ std::vector nativeArgs; - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->JavaThreadType); - Value* geps[2] = { module->constantZero, module->OffsetJNIInThreadConstant }; + Value* geps[2] = { module->constantZero, + module->OffsetJNIInThreadConstant }; Value* jniEnv = GetElementPtrInst::Create(threadId, geps, geps + 2, "", currentBlock); @@ -499,7 +499,7 @@ lockPtr = new BitCastInst(lockPtr, PointerType::getUnqual(module->pointerSizeType), "", currentBlock); - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->MutatorThreadType); threadId = new PtrToIntInst(threadId, module->pointerSizeType, "", currentBlock); @@ -589,7 +589,7 @@ "", currentBlock); Value* lock = new LoadInst(lockPtr, "", currentBlock); - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->MutatorThreadType); threadId = new PtrToIntInst(threadId, module->pointerSizeType, "", currentBlock); @@ -1036,7 +1036,7 @@ Value* NewIsolate = 0; Value* IsolatePtr = 0; if (loader != loader->bootstrapLoader && isPublic(compilingMethod->access)) { - threadId = getCurrentThread(); + threadId = getCurrentThread(module->MutatorThreadType); IsolateIDPtr = GetElementPtrInst::Create(threadId, module->constantThree, "", currentBlock); @@ -1117,7 +1117,7 @@ } if (TheCompiler->useCooperativeGC()) { - Value* threadId = getCurrentThread(); + Value* threadId = getCurrentThread(module->MutatorThreadType); Value* GEP[2] = { module->constantZero, module->OffsetDoYieldInThreadConstant }; Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJIT.h Tue Oct 13 02:11:07 2009 @@ -126,7 +126,7 @@ llvm::BasicBlock* currentBlock, bool usign); /// getCurrentThread - Emit code to get the current thread. - llvm::Value* getCurrentThread(); + llvm::Value* getCurrentThread(const llvm::Type* Ty); //===--------------------------- Inline support ---------------------------===// Modified: vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp Tue Oct 13 02:11:07 2009 @@ -50,6 +50,7 @@ const llvm::Type* JnjvmModule::JavaMethodType = 0; const llvm::Type* JnjvmModule::AttributType = 0; const llvm::Type* JnjvmModule::JavaThreadType = 0; +const llvm::Type* JnjvmModule::MutatorThreadType = 0; #ifdef ISOLATE_SHARING const llvm::Type* JnjvmModule::JnjvmType = 0; @@ -161,6 +162,8 @@ PointerType::getUnqual(module->getTypeByName("Attribut")); JavaThreadType = PointerType::getUnqual(module->getTypeByName("JavaThread")); + MutatorThreadType = + PointerType::getUnqual(module->getTypeByName("MutatorThread")); LLVMAssessorInfo::initialise(); } @@ -208,11 +211,11 @@ OffsetDoYieldInThreadConstant = ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 6); OffsetJNIInThreadConstant = - ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 13); + ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 1); OffsetJavaExceptionInThreadConstant = - ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 14); + ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 2); OffsetCXXExceptionInThreadConstant = - ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 15); + ConstantInt::get(Type::getInt32Ty(getGlobalContext()), 3); ClassReadyConstant = ConstantInt::get(Type::getInt8Ty(getGlobalContext()), ready); Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile (original) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/Makefile Tue Oct 13 02:11:07 2009 @@ -12,6 +12,12 @@ VMKIT_RUNTIME = $(PROJ_SRC_DIR)/runtime-default.ll +ifeq ($(GC_MMTK), 1) +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-mmtk-thread.ll +else +VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-default-thread.ll +endif + ifeq ($(ISOLATE_BUILD), 1) VMKIT_RUNTIME += $(PROJ_SRC_DIR)/runtime-isolate.ll endif Added: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll?rev=83956&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll (added) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll Tue Oct 13 02:11:07 2009 @@ -0,0 +1,17 @@ +%Vector = type {i32, i8*, i8*} + +;;; Field 0: the VT of threads +;;; Field 1: next +;;; Field 2: prev +;;; Field 3: IsolateID +;;; Field 4: MyVM +;;; Field 5: baseSP +;;; Field 6: doYield +;;; Field 7: inGC +;;; Field 8: stackScanned +;;; Field 9: lastSP +;;; Field 10: internalThreadID +;;; field 11: routine +;;; field 12: addresses +%MutatorThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, + i1, i8*, i8*, i8*, %Vector} Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll?rev=83956&r1=83955&r2=83956&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll (original) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll Tue Oct 13 02:11:07 2009 @@ -34,26 +34,7 @@ ;;; Field 3: The static instance %TaskClassMirror = type { i8, i1, i8* } -%Vector = type {i32, i8*, i8*} - -;;; Field 0: the VT of threads -;;; Field 1: next -;;; Field 2: prev -;;; Field 3: IsolateID -;;; Field 4: MyVM -;;; Field 5: baseSP -;;; Field 6: doYield -;;; Field 7: inGC -;;; Field 8: stackScanned -;;; Field 9: lastSP -;;; Field 10: internalThreadID -;;; field 11: routine -;;; field 12: addresses -;;; field 13: jnienv -;;; field 14: Java pendingException -;;; field 15: CXX pendingException -%JavaThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, - i1, i8*, i8*, i8*, %Vector, i8*, %JavaObject*, i8* } +%JavaThread = type { %MutatorThread, i8*, %JavaObject*, i8* } %Attribut = type { %UTF8*, i32, i32 } Added: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll?rev=83956&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll (added) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll Tue Oct 13 02:11:07 2009 @@ -0,0 +1,21 @@ +%Vector = type {i32, i8*, i8*} +%BumpPtrAllocator = type { i32, i32, i8*, i8*, i8*, i8*, i32 } + +;;; Field 0: the VT of threads +;;; Field 1: next +;;; Field 2: prev +;;; Field 3: IsolateID +;;; Field 4: MyVM +;;; Field 5: baseSP +;;; Field 6: doYield +;;; Field 7: inGC +;;; Field 8: stackScanned +;;; Field 9: lastSP +;;; Field 10: internalThreadID +;;; field 11: routine +;;; field 12: addresses +;;; field 13: allocator +;;; field 14: MutatorContext +;;; field 15: CollectorContext +%MutatorThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, + i1, i8*, i8*, i8*, %Vector, %BumpPtrAllocator, i8*, i8* } From nicolas.geoffray at lip6.fr Tue Oct 13 01:46:47 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 08:46:47 -0000 Subject: [vmkit-commits] [vmkit] r83961 - in /vmkit/trunk/lib/N3: Mono/Mono.cpp Mono/MonoMSCorlib.cpp Mono/MonoString.cpp PNetLib/PNetLib.cpp PNetLib/PNetString.cpp VMCore/Assembly.cpp VMCore/CLIJit.cpp VMCore/CLIJitMeta.cpp VMCore/CLIRuntimeJIT.cpp VMCore/CLISignature.cpp VMCore/MSCorlib.inc VMCore/N3.cpp VMCore/N3Initialise.cpp VMCore/N3ModuleProvider.cpp VMCore/NativeUtil.cpp VMCore/Opcodes.cpp VMCore/Reader.cpp VMCore/VMClass.cpp VMCore/VMObject.cpp VMCore/VMObject.h VMCore/VMThread.cpp VMCore/VMThread.h Message-ID: <200910130846.n9D8kmMp023935@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 03:46:46 2009 New Revision: 83961 URL: http://llvm.org/viewvc/llvm-project?rev=83961&view=rev Log: Fix build. Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/Mono/MonoString.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/CLISignature.cpp vmkit/trunk/lib/N3/VMCore/MSCorlib.inc vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/Reader.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VMThread.cpp vmkit/trunk/lib/N3/VMCore/VMThread.h Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Tue Oct 13 03:46:46 2009 @@ -111,7 +111,7 @@ free (codepage); if (want_name && *int_code_page == -1) { - N3 *vm = (N3*)VMThread::get()->vm; + N3 *vm = (N3*)VMThread::get()->getVM(); return (MonoString*)(vm->arrayToString(vm->asciizToArray(cset))); } else return NULL; @@ -158,7 +158,7 @@ extern "C" MonoString * System_Environment_get_NewLine (void) { - N3 *vm = (N3*)VMThread::get()->vm; + N3 *vm = (N3*)VMThread::get()->getVM(); #if defined (PLATFORM_WIN32) return (MonoString*)(vm->arrayToString(vm->asciizToArray("\r\n"))); #else @@ -281,7 +281,7 @@ extern "C" void System_String__ctor(MonoString* str, ArrayChar* array, sint32 startIndex, sint32 count) { - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); const ArrayChar* value = vm->bufToArray(&(array->elements[startIndex]), count); str->length = count; str->startChar = array->elements[startIndex]; @@ -333,7 +333,7 @@ } } - N3* vm = (N3*)VMThread::get()->vm; + N3* vm = (N3*)VMThread::get()->getVM(); const ArrayChar* array = vm->bufToArray(dest, length); return (MonoString*)vm->arrayToString(array); } Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Tue Oct 13 03:46:46 2009 @@ -135,14 +135,14 @@ VMObject* Property::getPropertyDelegatee() { if (!delegatee) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } return delegatee; } VMObject* VMMethod::getMethodDelegatee() { if (!delegatee) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } return delegatee; } @@ -157,7 +157,7 @@ VMObject* Assembly::getAssemblyDelegatee() { if (!delegatee) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } return delegatee; } Modified: vmkit/trunk/lib/N3/Mono/MonoString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.cpp Tue Oct 13 03:46:46 2009 @@ -44,7 +44,7 @@ GlobalVariable* CLIString::llvmVar() { MonoString* str = (MonoString*)this; if (!str->_llvmVar) { - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); if (!str->_llvmVar) { const Type* pty = mvm::MvmModule::ptrType; Module* Mod = vm->getLLVMModule(); Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Tue Oct 13 03:46:46 2009 @@ -163,7 +163,7 @@ extern "C" VMObject* System_Globalization_CultureInfo_InternalCultureName() { char* val = ILGetCultureName(); - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); if (val) { VMObject* ret = vm->arrayToString(vm->asciizToArray(val)); free(val); @@ -196,13 +196,13 @@ extern "C" VMObject* System_String_NewBuilder(PNetString* value, uint32 length) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); PNetString* str = (PNetString*)vm->arrayToString(newBuilder(vm, value, length)); return str; } extern "C" VMObject* Platform_SysCharInfo_GetNewLine() { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); return vm->arrayToString(vm->asciizToArray("\n")); } @@ -249,7 +249,7 @@ extern "C" VMObject* System_Reflection_ClrType_GetElementType(VMObject* Klass) { VMCommonClass* cl = (VMCommonClass*)((*Klass)(MSCorlib::typeClrType).PointerVal); if (!cl->isArray) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } else { return ((VMClassArray*)cl)->baseClass->getClassDelegatee(); @@ -302,9 +302,9 @@ else dest->length = top; - dest->value = VMThread::get()->vm->bufToArray(buf, dest->length); + dest->value = VMThread::get()->getVM()->bufToArray(buf, dest->length); } - // printf("---> %s\n", mvm::PrintBuffer(VMThread::get()->vm->arrayToUTF8(dest->value)).cString()); + // printf("---> %s\n", mvm::PrintBuffer(VMThread::get()->getVM()->arrayToUTF8(dest->value)).cString()); } extern "C" void System_Threading_Monitor_Enter(VMObject* obj) { @@ -331,11 +331,11 @@ extern "C" sint32 System_String_IndexOf(PNetString* str, uint16 value, sint32 startIndex, sint32 count) { if (startIndex < 0) { - VMThread::get()->vm->error("shoud throw arg range"); + VMThread::get()->getVM()->error("shoud throw arg range"); } if ((count < 0) || (str->length - startIndex < count)) { - VMThread::get()->vm->error("shoud throw arg range"); + VMThread::get()->getVM()->error("shoud throw arg range"); } sint32 i = startIndex; @@ -361,7 +361,7 @@ StringBuilder* obj, sint32 index, uint16 value) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); PNetString* buildString = obj->buildString; const ArrayChar* array = buildString->value; sint32 strLength = buildString->length; @@ -388,7 +388,7 @@ StringBuilder* obj, sint32 index, PNetString* str) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); PNetString* buildString = obj->buildString; const ArrayChar* strArray = str->value; const ArrayChar* buildArray = buildString->value; @@ -419,7 +419,7 @@ extern "C" VMObject* System_Text_StringBuilder_Append_System_Text_StringBuilder_System_Char( StringBuilder* obj, uint16 value) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); PNetString* buildString = obj->buildString; const ArrayChar* array = buildString->value; sint32 length = buildString->length; @@ -437,7 +437,7 @@ extern "C" VMObject* System_Text_StringBuilder_Append_System_Text_StringBuilder_System_String( StringBuilder* obj, PNetString* str) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); PNetString* buildString = obj->buildString; const ArrayChar* buildArray = buildString->value; const ArrayChar* strArray = str->value; @@ -507,7 +507,7 @@ } extern "C" VMObject* System_Reflection_Assembly_LoadFromName(PNetString* str, sint32 & error, VMObject* parent) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); Assembly* ass = vm->constructAssembly(vm->arrayToUTF8(str->value)); if(!ass->resolve(1, "dll")) @@ -518,7 +518,7 @@ } extern "C" PNetString* System_String_Concat_2(PNetString* str1, PNetString* str2) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); const ArrayChar* a1 = str1->value; const ArrayChar* a2 = str2->value; sint32 len1 = str1->length; @@ -534,7 +534,7 @@ } extern "C" PNetString* System_String_Concat_3(PNetString* str1, PNetString* str2, PNetString* str3) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); const ArrayChar* a1 = str1->value; const ArrayChar* a2 = str2->value; const ArrayChar* a3 = str3->value; @@ -576,7 +576,7 @@ memcpy(&(buf[j]), &(array->elements[index + length]), (strLength - (index + length)) * sizeof(uint16)); } - const ArrayChar* res = VMThread::get()->vm->bufToArray(buf, j); + const ArrayChar* res = VMThread::get()->getVM()->bufToArray(buf, j); str->value = res; str->length = j; } @@ -617,7 +617,7 @@ index[0] = 0; ++index; VMCommonClass* cl = ass->loadTypeFromName(vm->asciizToUTF8(index), vm->asciizToUTF8(asciiz), true, true, true, onError); - if (!cl) VMThread::get()->vm->error("implement me"); + if (!cl) VMThread::get()->getVM()->error("implement me"); return cl->getClassDelegatee(); } @@ -634,7 +634,7 @@ extern "C" VMObject* System_Reflection_ClrType_GetMemberImpl(VMObject* Type, PNetString* str, sint32 memberTypes, sint32 bindingFlags, VMObject* binder, sint32 callingConventions, ArrayObject* types, VMObject* modifiers) { VMCommonClass* type = (VMCommonClass*)((*MSCorlib::typeClrType)(Type).PointerVal); - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); const UTF8* name = vm->arrayToUTF8(str->value); if (memberTypes == MEMBER_TYPES_PROPERTY) { std::vector > properties = @@ -647,7 +647,7 @@ break; } } - if (res == 0) VMThread::get()->vm->error("implement me"); + if (res == 0) VMThread::get()->getVM()->error("implement me"); return res->getPropertyDelegatee(); } else if (memberTypes == MEMBER_TYPES_METHOD) { std::vector virtualMethods = type->virtualMethods; @@ -674,7 +674,7 @@ } } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } return 0; } @@ -686,12 +686,12 @@ const char* asciiz = _asciiz.cString(); char* buf = (char*)alloca(strlen(asciiz) + 5); sprintf(buf, "get_%s", asciiz); - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false); assert(meth); return meth->getMethodDelegatee(); } else { - VMThread::get()->vm->error("implement me: GetSemantics: %d", attributes); + VMThread::get()->getVM()->error("implement me: GetSemantics: %d", attributes); return 0; } } @@ -732,7 +732,7 @@ llvm::GenericValue gv(((void**)arg)[VALUE_OFFSET]); args.push_back(gv); } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } @@ -747,7 +747,7 @@ if ((obj != 0) && virt) { if (!(obj->classOf->isAssignableFrom(type))) { - VMThread::get()->vm->illegalArgumentException(mvm::PrintBuffer(meth->name).cString()); + VMThread::get()->getVM()->illegalArgumentException(mvm::PrintBuffer(meth->name).cString()); } verifyNull(obj); } @@ -828,7 +828,7 @@ (*MSCorlib::ctorDouble)(res, gv.DoubleVal); } else { if (retType->super == MSCorlib::pValue || retType->super == MSCorlib::pEnum) - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); res = (VMObject*)gv.PointerVal; } @@ -879,7 +879,7 @@ extern "C" VMObject* System_Reflection_Assembly_GetManifestResourceStream(VMObject* Ass, PNetString* str) { Assembly* ass = (Assembly*)(*MSCorlib::assemblyAssemblyReflection)(Ass).PointerVal; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); const UTF8* id = vm->arrayToUTF8(str->value); Header* header = ass->CLIHeader; uint32 stringOffset = header->stringStream->realOffset; @@ -918,7 +918,7 @@ uint16* buf = (uint16*)alloca(length * sizeof(uint16)); - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); memcpy(buf, array->elements, length * sizeof(uint16)); ILUnicodeStringToLower((void*)buf, (void*)array->elements, length); @@ -937,7 +937,7 @@ if (buf[i] == c1) buf[i] = c2; } - N3* vm = (N3*)VMThread::get()->vm; + N3* vm = (N3*)VMThread::get()->getVM(); const ArrayChar* res = vm->bufToArray(buf, length); return vm->arrayToString(res); } @@ -997,7 +997,7 @@ buf[i + start] = ch; } - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); const ArrayChar* val = vm->bufToArray(buf, length); str->value = val; str->length = length; Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.cpp Tue Oct 13 03:46:46 2009 @@ -44,7 +44,7 @@ GlobalVariable* CLIString::llvmVar() { PNetString* str = (PNetString*)this; if (!str->_llvmVar) { - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); if (!str->_llvmVar) { const Type* pty = mvm::MvmModule::ptrType; Constant* cons = Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Tue Oct 13 03:46:46 2009 @@ -307,7 +307,7 @@ VMClassArray* Assembly::constructArray(const UTF8* name, const UTF8* nameSpace, uint32 dims) { - assert(this == ((N3*)VMThread::get()->vm)->coreAssembly); + assert(this == ((N3*)VMThread::get()->getVM())->coreAssembly); ClassNameCmp CC(VMClassArray::constructArrayName(name, dims), nameSpace); VMClassArray* cl = (VMClassArray*)(loadedNameClasses->lookupOrCreate(CC, this, arrayDup)); @@ -373,7 +373,7 @@ buf[i++] = ','; } buf[i] = '>'; - const UTF8* genName = VMThread::get()->vm->bufToUTF8(buf, size); + const UTF8* genName = VMThread::get()->getVM()->bufToUTF8(buf, size); //printf("%s\n", mvm::PrintBuffer(genName).cString()); ClassNameCmp CC(genName, nameSpace); @@ -479,7 +479,7 @@ static void unimplemented(uint32 index, std::vector >& tables, uint32 heapSizes) { - VMThread::get()->vm->error("Unknown table %x", index); + VMThread::get()->getVM()->error("Unknown table %x", index); } maskVector_t Assembly::maskVector[64] = { @@ -624,10 +624,10 @@ for (uint32 i = 0; i < count; ++i) { uint32 size = EXTRACT_SIZE(sizeMask, i); switch(size) { - case 1: VMThread::get()->vm->error("implement me"); break; + case 1: VMThread::get()->getVM()->error("implement me"); break; case 2: result[i] = READ_U2(array, rowOffset); break; case 4: result[i] = READ_U4(array, rowOffset); break; - default: VMThread::get()->vm->error("unknown size %d", size); break; + default: VMThread::get()->getVM()->error("unknown size %d", size); break; } } } @@ -641,10 +641,10 @@ uint32 size = EXTRACT_SIZE(sizeMask, index); switch(size) { - case 1: VMThread::get()->vm->error("implement me"); break; + case 1: VMThread::get()->getVM()->error("implement me"); break; case 2: return READ_U2(array, indexOffset); case 4: return READ_U4(array, indexOffset); - default: VMThread::get()->vm->error("unknown size %d", size); break; + default: VMThread::get()->getVM()->error("unknown size %d", size); break; } // unreachable @@ -699,7 +699,7 @@ else if (!(strcmp(str, "#US"))) usStream = stream; else if (!(strcmp(str, "#Blob"))) blobStream = stream; else if (!(strcmp(str, "#GUID"))) guidStream = stream; - else VMThread::get()->vm->error("invalid stream %s", str); + else VMThread::get()->getVM()->error("invalid stream %s", str); } } @@ -1008,7 +1008,7 @@ ref = vm->constructAssembly(name); if(!ref->resolve(1, "dll")) - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); assemblyRefs[index - 1] = ref; } @@ -1033,17 +1033,17 @@ VMCommonClass* type = 0; switch (val) { - case 0: VMThread::get()->vm->error("implement me %d %d", val, entry); break; - case 1: VMThread::get()->vm->error("implement me %d, %d", val, entry); break; + case 0: VMThread::get()->getVM()->error("implement me %d %d", val, entry); break; + case 1: VMThread::get()->getVM()->error("implement me %d, %d", val, entry); break; case 2: { Assembly* refAssembly = readAssemblyRef(vm, entry); type = refAssembly->getClassFromName(vm, readString(vm, stringOffset + name), readString(vm, stringOffset + nameSpace)); break; } - case 3: VMThread::get()->vm->error("implement me %d %d",val, entry); break; + case 3: VMThread::get()->getVM()->error("implement me %d %d",val, entry); break; default: - VMThread::get()->vm->error("unkknown resolution scope %x", val); + VMThread::get()->getVM()->error("unkknown resolution scope %x", val); break; } return type; @@ -1102,11 +1102,11 @@ break; } case 2: { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } default: { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } } @@ -1138,7 +1138,7 @@ case 0: interfaceToken += (CONSTANT_TypeDef << 24); break; case 1: interfaceToken += (CONSTANT_TypeRef << 24); break; case 2: interfaceToken += (CONSTANT_TypeSpec << 24); break; - default: VMThread::get()->vm->error("unknown table %x", table); break; + default: VMThread::get()->getVM()->error("unknown table %x", table); break; } tokens.push_back(interfaceToken); } @@ -1167,11 +1167,11 @@ } else if (table == CONSTANT_TypeSpec) { type = readTypeSpec(vm, index, genClass, genMethod); } else { - VMThread::get()->vm->error("implement me %x", token); + VMThread::get()->getVM()->error("implement me %x", token); } } - if (type == 0) VMThread::get()->vm->error("implement me"); + if (type == 0) VMThread::get()->getVM()->error("implement me"); if (type->status == hashed) { type->aquire(); if (type->status == hashed) { @@ -1245,7 +1245,7 @@ uncompressSignature(offset); uint16 prolog = READ_U2(bytes, offset); - if (prolog != 0x1) VMThread::get()->vm->error("unknown prolog"); + if (prolog != 0x1) VMThread::get()->getVM()->error("unknown prolog"); uint32 start = meth->virt ? 1 : 0; @@ -1255,7 +1255,7 @@ gv.IntVal = llvm::APInt(32, READ_U4(bytes, offset)); args.push_back(gv); } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } @@ -1276,7 +1276,7 @@ switch(table) { default: - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; case 2: cons = getMethodFromToken(index + (CONSTANT_MethodDef << 24), NULL, NULL); @@ -1355,7 +1355,7 @@ uint32 type = propArray[CONSTANT_PROPERTY_TYPE]; Property* prop = new(allocator, "Property") Property(); - prop->name = readString(VMThread::get()->vm, stringOffset + nameIndex); + prop->name = readString(VMThread::get()->getVM(), stringOffset + nameIndex); prop->flags = flags; prop->type = cl; uint32 offset = blobOffset + type; @@ -1472,9 +1472,9 @@ bool clinit, bool dothrow) { VMCommonClass* cl = lookupClassFromName(name, nameSpace); if (cl == 0 || cl->status == hashed) { - cl = getClassFromName(((N3*)VMThread::get()->vm), name, nameSpace); + cl = getClassFromName(((N3*)VMThread::get()->getVM()), name, nameSpace); - if (cl == 0) VMThread::get()->vm->error("implement me"); + if (cl == 0) VMThread::get()->getVM()->error("implement me"); if (cl->status == hashed) { cl->aquire(); @@ -1495,7 +1495,7 @@ uint32 table = localVarSig >> 24; uint32 index = localVarSig & 0xffff; if (table != CONSTANT_StandaloneSig) { - VMThread::get()->vm->error("locals do not point to a StandAloneSig table"); + VMThread::get()->getVM()->error("locals do not point to a StandAloneSig table"); } Table* signatures = CLIHeader->tables[CONSTANT_StandaloneSig]; uint32* array = (uint32*)alloca(sizeof(uint32) * signatures->rowSize); @@ -1518,16 +1518,16 @@ uint32 newTable = typeToken >> 24; switch (newTable) { case CONSTANT_TypeDef : { - loadType((N3*)(VMThread::get()->vm), typeToken, true, true, false, + loadType((N3*)(VMThread::get()->getVM()), typeToken, true, true, false, true, genClass, genMethod); field = lookupFieldFromToken(token); if (!field) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } break; } default : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } break; @@ -1539,7 +1539,7 @@ } default : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } } @@ -1590,7 +1590,7 @@ } if (!found) - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return size; } @@ -1605,7 +1605,7 @@ uint32 stringOffset = CLIHeader->stringStream->realOffset; uint32 blobOffset = CLIHeader->blobStream->realOffset; - const UTF8* name = readString((N3*)(VMThread::get()->vm), stringOffset + + const UTF8* name = readString((N3*)(VMThread::get()->getVM()), stringOffset + memberArray[CONSTANT_MEMBERREF_NAME]); @@ -1618,28 +1618,28 @@ switch (table) { case 0 : { uint32 typeToken = index + (CONSTANT_TypeDef << 24); - type = loadType(((N3*)VMThread::get()->vm), typeToken, + type = loadType(((N3*)VMThread::get()->getVM()), typeToken, true, false, false, true, genClass, genMethod); break; } case 1 : { uint32 typeToken = index + (CONSTANT_TypeRef << 24); - type = loadType(((N3*)VMThread::get()->vm), typeToken, + type = loadType(((N3*)VMThread::get()->getVM()), typeToken, true, false, false, true, genClass, genMethod); break; } case 2: - case 3: VMThread::get()->vm->error("implement me"); break; + case 3: VMThread::get()->getVM()->error("implement me"); break; case 4: { uint32 typeToken = index + (CONSTANT_TypeSpec << 24); - type = loadType(((N3*)VMThread::get()->vm), typeToken, + type = loadType(((N3*)VMThread::get()->getVM()), typeToken, true, false, false, true, genClass, genMethod); break; } default: - VMThread::get()->vm->error("unknown MemberRefParent tag %d", table); + VMThread::get()->getVM()->error("unknown MemberRefParent tag %d", table); } @@ -1672,16 +1672,16 @@ uint32 newTable = typeToken >> 24; switch (newTable) { case CONSTANT_TypeDef : { - loadType((N3*)(VMThread::get()->vm), typeToken, true, true, false, + loadType((N3*)(VMThread::get()->getVM()), typeToken, true, true, false, true, genClass, genMethod); meth = lookupMethodFromToken(token); if (!meth) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } break; } default : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } break; @@ -1698,7 +1698,7 @@ } default : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } } @@ -1740,7 +1740,7 @@ VMClass* cl = dynamic_cast (type); if (cl == NULL) { - VMThread::get()->vm->error( + VMThread::get()->getVM()->error( "Only instances of generic classes are allowed."); } @@ -1774,7 +1774,7 @@ uint32 stringOffset = CLIHeader->stringStream->realOffset; uint32 blobOffset = CLIHeader->blobStream->realOffset; - const UTF8* name = readString((N3*)(VMThread::get()->vm), stringOffset + + const UTF8* name = readString((N3*)(VMThread::get()->getVM()), stringOffset + memberArray[CONSTANT_MEMBERREF_NAME]); uint32 offset = blobOffset + memberArray[CONSTANT_MEMBERREF_SIGNATURE]; @@ -1788,7 +1788,7 @@ switch (table) { case 0 : { uint32 typeToken = index + (CONSTANT_TypeDef << 24); - VMCommonClass* type = loadType(((N3*)(VMThread::get()->vm)), typeToken, true, false, false, true, genClass, genMethod); + VMCommonClass* type = loadType(((N3*)(VMThread::get()->getVM())), typeToken, true, false, false, true, genClass, genMethod); bool virt = extractMethodSignature(offset, type, args, genClass, genMethod); VMMethod *meth = instantiateGenericMethod(genArgs, type, name, args, token, virt, genClass); return meth; @@ -1796,7 +1796,7 @@ case 1 : { uint32 typeToken = index + (CONSTANT_TypeRef << 24); - VMCommonClass* type = loadType(((N3*)VMThread::get()->vm), typeToken, + VMCommonClass* type = loadType(((N3*)VMThread::get()->getVM()), typeToken, true, false, false, true, genClass, genMethod); bool virt = extractMethodSignature(offset, type, args, genClass, genMethod); VMMethod *meth = instantiateGenericMethod(genArgs, type, name, args, token, virt, genClass); @@ -1804,7 +1804,7 @@ } case 2: - case 3: VMThread::get()->vm->error("implement me %d", table); break; + case 3: VMThread::get()->getVM()->error("implement me %d", table); break; case 4: { VMClass* type = (VMClass*) readTypeSpec(vm, index, genClass, genMethod); @@ -1836,7 +1836,7 @@ } } default: - VMThread::get()->vm->error("unknown MemberRefParent tag %d", table); + VMThread::get()->getVM()->error("unknown MemberRefParent tag %d", table); } @@ -1868,7 +1868,7 @@ switch (table) { case 0 : { methodToken = index + (CONSTANT_MethodDef << 24); - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case 1 : { @@ -1876,7 +1876,7 @@ return readMemberRefAsMethod(methodToken, &genArgs, genClass, genMethod); } default: - VMThread::get()->vm->error("Invalid MethodSpec!"); + VMThread::get()->getVM()->error("Invalid MethodSpec!"); } return NULL; @@ -1897,7 +1897,7 @@ } } - return readUTF16((N3*)(VMThread::get()->vm), size, bytes, offset); + return readUTF16((N3*)(VMThread::get()->getVM()), size, bytes, offset); } uint32 Assembly::getRVAFromField(uint32 token) { Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Tue Oct 13 03:46:46 2009 @@ -495,7 +495,7 @@ if (meth->classDef->isArray) { uint8 func = 0; - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); if (meth->name == vm->asciizToUTF8("Set")) { func = 0; } else if (meth->name == vm->asciizToUTF8("Get")) { @@ -625,7 +625,7 @@ Value* obj = 0; if (type->isPointer) { - VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer(type).cString()); + VMThread::get()->getVM()->error("implement me %s", mvm::PrintBuffer(type).cString()); } else if (type->isArray) { VMClassArray* arrayType = (VMClassArray*)type; Value* valCl = new LoadInst(arrayType->llvmVar(), "", currentBlock); @@ -874,11 +874,11 @@ } Constant* VMArray::sizeOffset() { - return VMThread::get()->vm->module->constantOne; + return VMThread::get()->getVM()->module->constantOne; } Constant* VMArray::elementsOffset() { - return VMThread::get()->vm->module->constantTwo; + return VMThread::get()->getVM()->module->constantTwo; } Value* CLIJit::arraySize(Value* array) { @@ -923,7 +923,7 @@ return func; } Function* CLIJit::invokeDelegate() { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } @@ -935,9 +935,9 @@ const UTF8* name = compilingMethod->name; if (name == N3::ctorName) return createDelegate(); else if (name == N3::invokeName) return invokeDelegate(); - else VMThread::get()->vm->error("implement me"); + else VMThread::get()->getVM()->error("implement me"); } else { - VMThread::get()->vm->error("implement me %s", mvm::PrintBuffer(compilingClass).cString()); + VMThread::get()->getVM()->error("implement me %s", mvm::PrintBuffer(compilingClass).cString()); } return 0; } @@ -1032,7 +1032,7 @@ if (flags == CONSTANT_COR_ILEXCEPTION_CLAUSE_EXCEPTION) { ex->test = createBasicBlock("testException"); if (classToken) { - ex->catchClass = ass->loadType((N3*)VMThread::get()->vm, classToken, + ex->catchClass = ass->loadType((N3*)VMThread::get()->getVM(), classToken, true, false, false, true, genClass, genMethod); } else { ex->catchClass = MSCorlib::pException; @@ -1050,7 +1050,7 @@ ex->catchClass = 0; finallyHandlers.push_back(ex); } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } @@ -1142,7 +1142,7 @@ #if N3_EXECUTE > 1 static void printArgs(std::vector args, BasicBlock* insertAt) { - N3 *vm = VMThread::get()->vm; + N3 *vm = VMThread::get()->getVM(); for (std::vector::iterator i = args.begin(), e = args.end(); i!= e; ++i) { @@ -1182,7 +1182,7 @@ tiny = true; codeLen = (header & 0xfffc) >> 2; } else if ((header & 3) != CONSTANT_CorILMethod_FatFormat) { - VMThread::get()->vm->error("unknown Method Format"); + VMThread::get()->getVM()->error("unknown Method Format"); } else { header += (READ_U1(bytes, offset) << 8); //header maxStack = READ_U2(bytes, offset); @@ -1359,7 +1359,7 @@ tiny = true; codeLen = (header & 0xfffc) >> 2; } else if ((header & 3) != CONSTANT_CorILMethod_FatFormat) { - VMThread::get()->vm->error("unknown Method Format"); + VMThread::get()->getVM()->error("unknown Method Format"); } else { header += (READ_U1(bytes, offset) << 8); //header maxStack = READ_U2(bytes, offset); @@ -1503,7 +1503,7 @@ } VMMethod* CLIJit::getMethod(llvm::Function* F) { - VMMethod* meth = VMThread::get()->vm->functions->lookup(F); + VMMethod* meth = VMThread::get()->getVM()->functions->lookup(F); return meth; } Modified: vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp Tue Oct 13 03:46:46 2009 @@ -45,7 +45,7 @@ if (signature->naturalType == Type::getFloatTy(getGlobalContext())) { ((float*)ptr)[0] = val; } else { - VMThread::get()->vm->unknownError("wrong type in field assignment"); + VMThread::get()->getVM()->unknownError("wrong type in field assignment"); } return; @@ -63,7 +63,7 @@ if (signature->naturalType == Type::getDoubleTy(getGlobalContext())) { ((double*)ptr)[0] = val; } else { - VMThread::get()->vm->unknownError("wrong type in field assignment"); + VMThread::get()->getVM()->unknownError("wrong type in field assignment"); } return; @@ -81,7 +81,7 @@ if (signature->naturalType == Type::getInt64Ty(getGlobalContext())) { ((uint64*)ptr)[0] = val; } else { - VMThread::get()->vm->unknownError("wrong type in field assignment"); + VMThread::get()->getVM()->unknownError("wrong type in field assignment"); } return; @@ -99,7 +99,7 @@ if (signature->naturalType == Type::getInt32Ty(getGlobalContext())) { ((uint32*)ptr)[0] = val; } else { - VMThread::get()->vm->unknownError("wrong type in field assignment"); + VMThread::get()->getVM()->unknownError("wrong type in field assignment"); } return; @@ -117,7 +117,7 @@ if (llvm::isa(signature->naturalType)) { ((VMObject**)ptr)[0] = val; } else { - VMThread::get()->vm->unknownError("wrong type in field assignment"); + VMThread::get()->getVM()->unknownError("wrong type in field assignment"); } return; @@ -134,7 +134,7 @@ if (signature->naturalType == Type::getInt1Ty(getGlobalContext())) { ((bool*)ptr)[0] = val; } else { - VMThread::get()->vm->unknownError("wrong type in field assignment"); + VMThread::get()->getVM()->unknownError("wrong type in field assignment"); } return; @@ -420,5 +420,5 @@ } Constant* VMObject::classOffset() { - return VMThread::get()->vm->module->constantOne; + return VMThread::get()->getVM()->module->constantOne; } Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Tue Oct 13 03:46:46 2009 @@ -55,7 +55,7 @@ } extern "C" VMObject* newString(const ArrayChar* utf8) { - N3 *vm = (N3*)VMThread::get()->vm; + N3 *vm = (N3*)VMThread::get()->getVM(); return vm->arrayToString(utf8); } @@ -84,9 +84,9 @@ } static VMObject* doMultiNewIntern(VMClassArray* cl, uint32 dim, sint32* buf) { - if (dim <= 0) VMThread::get()->vm->error("Can't happen"); + if (dim <= 0) VMThread::get()->getVM()->error("Can't happen"); sint32 n = buf[0]; - if (n < 0) VMThread::get()->vm->negativeArraySizeException(n); + if (n < 0) VMThread::get()->getVM()->negativeArraySizeException(n); VMArray* res = (VMArray*)cl->doNew(n); if (dim > 1) { @@ -97,7 +97,7 @@ } } for (uint32 i = 1; i < dim; ++i) { - if (buf[i] < 0) VMThread::get()->vm->negativeArraySizeException(buf[i]); + if (buf[i] < 0) VMThread::get()->getVM()->negativeArraySizeException(buf[i]); } } return res; @@ -150,7 +150,7 @@ strlen(nameAsciiz) + strlen(nameSpaceAsciiz)); sprintf(buf, "%s.%s.%s", nameSpaceAsciiz, nameAsciiz, methAsciiz); - const UTF8* newName = VMThread::get()->vm->asciizToUTF8(buf); + const UTF8* newName = VMThread::get()->getVM()->asciizToUTF8(buf); dmeth = ocl->lookupMethod(newName, orig->parameters, false, true); } Modified: vmkit/trunk/lib/N3/VMCore/CLISignature.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLISignature.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLISignature.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLISignature.cpp Tue Oct 13 03:46:46 2009 @@ -24,7 +24,7 @@ static VMCommonClass* METHOD_ElementTypeEnd(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } @@ -128,12 +128,12 @@ table = CONSTANT_TypeSpec; break; default: - VMThread::get()->vm->error("unknown TypeDefOrRefEncoded %d", index); + VMThread::get()->getVM()->error("unknown TypeDefOrRefEncoded %d", index); break; } token = (table << 24) + index; - VMCommonClass* cl = ass->loadType((N3*) (VMThread::get()->vm), token, false, + VMCommonClass* cl = ass->loadType((N3*) (VMThread::get()->getVM()), token, false, false, false, true, genClass, genMethod); return cl; } @@ -156,12 +156,12 @@ table = CONSTANT_TypeSpec; break; default: - VMThread::get()->vm->error("unknown TypeDefOrRefEncoded %d", index); + VMThread::get()->getVM()->error("unknown TypeDefOrRefEncoded %d", index); break; } token = (table << 24) + index; - VMCommonClass* cl = ass->loadType((N3*) (VMThread::get()->vm), token, false, + VMCommonClass* cl = ass->loadType((N3*) (VMThread::get()->getVM()), token, false, false, false, true, genClass, genMethod); return cl; } @@ -183,7 +183,7 @@ if (numSizes != 0) { printf("type = %s\n", mvm::PrintBuffer(cl).cString()); - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } for (uint32 i = 0; i < numSizes; ++i) { @@ -192,7 +192,7 @@ uint32 numObounds = ass->uncompressSignature(offset); if (numObounds != 0) - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); for (uint32 i = 0; i < numObounds; ++i) { ass->uncompressSignature(offset); @@ -247,12 +247,12 @@ table = CONSTANT_TypeSpec; break; default: - VMThread::get()->vm->error("unknown TypeDefOrRefEncoded %d", index); + VMThread::get()->getVM()->error("unknown TypeDefOrRefEncoded %d", index); break; } token = (table << 24) + index; - VMCommonClass* cl = ass->loadType((N3*) (VMThread::get()->vm), token, false, + VMCommonClass* cl = ass->loadType((N3*) (VMThread::get()->getVM()), token, false, false, false, true, args, genClass, genMethod); // restore endOffset offset = endOffset; @@ -277,7 +277,7 @@ static VMCommonClass* METHOD_ElementTypeFnptr(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } @@ -308,7 +308,7 @@ cl->nameSpace = ass->name; char *tmp = (char *) alloca(100); snprintf(tmp, 100, "!!%d", number); - cl->name = VMThread::get()->vm->asciizToUTF8(tmp); + cl->name = VMThread::get()->getVM()->asciizToUTF8(tmp); return cl; } else { return currGenericMethod->genericParams[number]; @@ -317,31 +317,31 @@ static VMCommonClass* METHOD_ElementTypeCmodReqd(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } static VMCommonClass* METHOD_ElementTypeCmodOpt(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } static VMCommonClass* METHOD_ElementTypeInternal(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } static VMCommonClass* METHOD_ElementTypeModifier(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } static VMCommonClass* METHOD_ElementTypeSentinel(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } @@ -352,7 +352,7 @@ static VMCommonClass* unimplemented(uint32 op, Assembly* ass, uint32& offset, VMGenericClass* genClass, VMGenericMethod* genMethod) { - VMThread::get()->vm->error("unknown signature"); + VMThread::get()->getVM()->error("unknown signature"); return 0; } @@ -474,7 +474,7 @@ uint32 genericSig = uncompressSignature(offset); if (genericSig != 0x0a) { - VMThread::get()->vm->error("unknown methodSpec sig %x", genericSig); + VMThread::get()->getVM()->error("unknown methodSpec sig %x", genericSig); } uint32 genArgCount = uncompressSignature(offset); @@ -492,7 +492,7 @@ uint32 nbLocals = uncompressSignature(offset); if (localSig != 0x7) { - VMThread::get()->vm->error("unknown local sig %x", localSig); + VMThread::get()->getVM()->error("unknown local sig %x", localSig); } for (uint32 i = 0; i < nbLocals; ++i) { @@ -510,7 +510,7 @@ uint32 fieldSig = uncompressSignature(offset); if (fieldSig != 0x6) { - VMThread::get()->vm->error("unknown field sig %x", fieldSig); + VMThread::get()->getVM()->error("unknown field sig %x", fieldSig); } // TODO implement support for custom modifiers Modified: vmkit/trunk/lib/N3/VMCore/MSCorlib.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/MSCorlib.inc?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/MSCorlib.inc (original) +++ vmkit/trunk/lib/N3/VMCore/MSCorlib.inc Tue Oct 13 03:46:46 2009 @@ -64,7 +64,7 @@ ((ArrayDouble*)array)->elements[i] = READ_U8(bytes, offset); } } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } } @@ -86,7 +86,7 @@ // The caller of the CLI function; cur = (void**)cur[0]; - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); VMMethod* meth = vm->IPToMethod(FRAME_IP(cur)); @@ -105,7 +105,7 @@ // The CLI function. cur = (void**)cur[0]; - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); VMMethod* meth = vm->IPToMethod(FRAME_IP(cur)); @@ -115,13 +115,13 @@ } extern "C" void System_Reflection_Assembly_LoadFromFile() { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } extern "C" void System_Array_InternalCopy(VMArray* src, sint32 sstart, VMArray* dst, sint32 dstart, sint32 len) { - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); verifyNull(src); verifyNull(dst); @@ -185,7 +185,7 @@ if (arr->classOf->isArray) { return ((VMClassArray*)(arr->classOf))->dims; } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } } @@ -195,7 +195,7 @@ if (arr->classOf->isArray) { return ((VMArray*)arr)->size; } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0; } } @@ -210,7 +210,7 @@ } extern "C" double System_Decimal_ToDouble(void* ptr) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return 0.0; } Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Tue Oct 13 03:46:46 2009 @@ -306,7 +306,7 @@ bootstrapThread = VMThread::TheThread; - bootstrapThread->vm = this; + bootstrapThread->MyVM = this; bootstrapThread->start((void (*)(mvm::Thread*))mainCLIStart); } else { @@ -315,7 +315,7 @@ } void N3::mainCLIStart(VMThread* th) { - N3* vm = (N3*)th->vm; + N3* vm = (N3*)th->getVM(); MSCorlib::loadBootstrap(vm); ClArgumentsInfo& info = vm->argumentsInfo; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue Oct 13 03:46:46 2009 @@ -211,7 +211,7 @@ Assembly* ass = vm->constructAssembly(vm->asciizToUTF8("mscorlib")); if(!ass->resolve(1, "dll")) - VMThread::get()->vm->error("can not load mscorlib.dll. Abort"); + VMThread::get()->getVM()->error("can not load mscorlib.dll. Abort"); vm->coreAssembly = ass; Modified: vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp Tue Oct 13 03:46:46 2009 @@ -40,7 +40,7 @@ CLIJit::compile(meth->classDef, meth); void* res = mvm::MvmModule::executionEngine->getPointerToGlobal(meth->methPtr); meth->code = res; - N3* vm = VMThread::get()->vm; + N3* vm = VMThread::get()->getVM(); vm->addMethodInFunctionMap(meth, res); } meth->classDef->release(); Modified: vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/NativeUtil.cpp Tue Oct 13 03:46:46 2009 @@ -50,7 +50,7 @@ void* res = dlsym(0, buf); if (!res) { - VMThread::get()->vm->error("unable to find native method %s", + VMThread::get()->getVM()->error("unable to find native method %s", mvm::PrintBuffer(meth).cString()); } Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Tue Oct 13 03:46:46 2009 @@ -256,12 +256,12 @@ } case ADD_OVF: { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case ADD_OVF_UN: { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -365,12 +365,12 @@ } case CALLI: { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); break; } case CKFINITE : { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); break; } @@ -383,7 +383,7 @@ type == Type::getInt64Ty(getGlobalContext())) { push(new TruncInst(val, Type::getInt8Ty(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -398,7 +398,7 @@ } else if (type == Type::getInt8Ty(getGlobalContext())) { push(new SExtInst(val, Type::getInt16Ty(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -415,7 +415,7 @@ } else if (type == Type::getInt32Ty(getGlobalContext())) { push(val); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -429,7 +429,7 @@ type == Type::getInt32Ty(getGlobalContext())) { push(new SExtInst(val, Type::getInt64Ty(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -442,7 +442,7 @@ } else if (type->isInteger()) { push(new SIToFPInst(val, Type::getFloatTy(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -457,7 +457,7 @@ } else if (type == Type::getDoubleTy(getGlobalContext())) { push(val); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -471,7 +471,7 @@ type == Type::getInt64Ty(getGlobalContext())) { push(new TruncInst(val, Type::getInt8Ty(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -486,7 +486,7 @@ } else if (type == Type::getInt8Ty(getGlobalContext())) { push(new ZExtInst(val, Type::getInt16Ty(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -501,7 +501,7 @@ } else if (type == Type::getInt8Ty(getGlobalContext()) || type == Type::getInt16Ty(getGlobalContext())) { push(new ZExtInst(val, Type::getInt16Ty(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -515,7 +515,7 @@ type == Type::getInt32Ty(getGlobalContext())) { push(new ZExtInst(val, Type::getInt64Ty(getGlobalContext()), "", currentBlock)); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } @@ -532,7 +532,7 @@ } else if (!val->getType()->isFloatingPoint()) { res = new BitCastInst(val, PointerType::getUnqual(Type::getInt8Ty(getGlobalContext())), "", currentBlock); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } push(res); @@ -540,7 +540,7 @@ } case CONV_U : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -554,68 +554,68 @@ } else if (type == Type::getDoubleTy(getGlobalContext())) { push(val); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } case CONV_OVF_I1 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_I2 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_I4 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_I8 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U1 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U2 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U4 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U8 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_I : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_I1_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_I2_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -631,33 +631,33 @@ } else if (type == Type::getInt32Ty(getGlobalContext())) { push(val); } else { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); } break; } case CONV_OVF_I8_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U1_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U2_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U4_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case CONV_OVF_U8_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -708,7 +708,7 @@ } case JMP : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1004,12 +1004,12 @@ } case MUL_OVF : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case MUL_OVF_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1236,12 +1236,12 @@ } case SUB_OVF : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case SUB_OVF_UN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1272,7 +1272,7 @@ case BOX : { uint32 token = readU4(bytecodes, i); Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); VMCommonClass* type = assembly->loadType(vm, token, true, false, false, true, genClass, genMethod); assert(type); @@ -1324,7 +1324,7 @@ case CASTCLASS : { Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); uint32 token = readU4(bytecodes, i); VMCommonClass* dcl = assembly->loadType(vm, token, true, false, false, true, genClass, genMethod); @@ -1366,13 +1366,13 @@ case CPOBJ : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case ISINST : { Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); uint32 token = readU4(bytecodes, i); VMCommonClass* dcl = assembly->loadType(vm, token, true, false, false, true, genClass, genMethod); @@ -1420,12 +1420,12 @@ } case LDELEM : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case LDELEM_I1 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1511,7 +1511,7 @@ case LDELEMA : { Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); uint32 token = readU4(bytecodes, i); VMCommonClass* cl = assembly->loadType(vm, token, true, false, false, true, genClass, genMethod); @@ -1545,7 +1545,7 @@ case LDOBJ : { Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); uint32 token = readU4(bytecodes, i); VMCommonClass* cl = assembly->loadType(vm, token, true, false, false, true, genClass, genMethod); @@ -1578,7 +1578,7 @@ module->ptrType); Value* res = CallInst::Create(newStringLLVM, val, "", currentBlock); /*CLIString * str = - (CLIString*)(((N3*)VMThread::get()->vm)->UTF8ToStr(utf8)); + (CLIString*)(((N3*)VMThread::get()->getVM())->UTF8ToStr(utf8)); GlobalVariable* gv = str->llvmVar(); push(new BitCastInst(new LoadInst(gv, "", currentBlock), MSCorlib::pString->naturalType, "", currentBlock));*/ @@ -1590,14 +1590,14 @@ uint32 token = readU4(bytecodes, i); uint32 table = token >> 24; Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); switch (table) { case CONSTANT_Field : { uint32 typeToken = assembly->getTypedefTokenFromField(token); assembly->loadType(vm, typeToken, true, true, false, true, genClass, genMethod); VMField* field = assembly->lookupFieldFromToken(token); if (!field) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } Value* arg = new LoadInst(field->llvmVar(), "", currentBlock); push(arg); @@ -1609,7 +1609,7 @@ assembly->loadType(vm, typeToken, true, true, false, true, genClass, genMethod); VMMethod* meth = assembly->lookupMethodFromToken(token); if (!meth) { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } Value* arg = new LoadInst(meth->llvmVar(), "", currentBlock); push(arg); @@ -1626,20 +1626,20 @@ } default : - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } break; } case MKREFANY : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case NEWARR : { uint32 value = readU4(bytecodes, i); Assembly* ass = compilingClass->assembly; - VMCommonClass* baseType = ass->loadType((N3*)(VMThread::get()->vm), + VMCommonClass* baseType = ass->loadType((N3*)(VMThread::get()->getVM()), value, true, false, false, true, genClass, genMethod); @@ -1662,12 +1662,12 @@ } case REFANYVAL : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case STELEM : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1732,7 +1732,7 @@ } case STELEM_I : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1754,7 +1754,7 @@ } case STOBJ : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); isVolatile = false; break; } @@ -1783,7 +1783,7 @@ case UNBOX : { uint32 token = readU4(bytecodes, i); Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); VMCommonClass* type = assembly->loadType(vm, token, true, false, false, true, genClass, genMethod); assert(type); @@ -1816,7 +1816,7 @@ } case UNBOX_ANY : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1866,7 +1866,7 @@ } case ENDFILTER: { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1882,18 +1882,18 @@ case LDFTN : { Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); uint32 token = readU4(bytecodes, i); uint32 table = token >> 24; if (table == CONSTANT_MethodDef) { uint32 typeToken = assembly->getTypedefTokenFromMethod(token); assembly->loadType(vm, typeToken, true, false, false, true, genClass, genMethod); VMMethod* meth = assembly->lookupMethodFromToken(token); - if (!meth) VMThread::get()->vm->error("implement me"); + if (!meth) VMThread::get()->getVM()->error("implement me"); Value* arg = new LoadInst(meth->llvmVar(), "", currentBlock); push(arg); } else { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); } break; } @@ -1940,14 +1940,14 @@ } case ARGLIST : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case INITOBJ : { uint32 token = readU4(bytecodes, i); Assembly* assembly = compilingClass->assembly; - N3* vm = (N3*)(VMThread::get()->vm); + N3* vm = (N3*)(VMThread::get()->getVM()); VMCommonClass* type = assembly->loadType(vm, token, true, false, false, true, genClass, genMethod); if (type->super == MSCorlib::pValue) { @@ -1967,12 +1967,12 @@ } case LDVIRTFTN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case REFANYTYPE : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -1993,7 +1993,7 @@ } case SIZEOF : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2002,13 +2002,13 @@ break; } default : - VMThread::get()->vm->unknownError("unknown bytecode"); + VMThread::get()->getVM()->unknownError("unknown bytecode"); } break; } default : - VMThread::get()->vm->unknownError("unknown bytecode"); + VMThread::get()->getVM()->unknownError("unknown bytecode"); } } } @@ -2096,12 +2096,12 @@ } case CALLI: { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); break; } case CKFINITE : { - VMThread::get()->vm->unknownError("implement me"); + VMThread::get()->getVM()->unknownError("implement me"); break; } @@ -2142,7 +2142,7 @@ case ENDFINALLY : break; case JMP : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2328,7 +2328,7 @@ } case CPOBJ : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2338,12 +2338,12 @@ } case LDELEM : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case LDELEM_I1 : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2397,7 +2397,7 @@ } case MKREFANY : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2412,12 +2412,12 @@ } case REFANYVAL : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case STELEM : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2436,7 +2436,7 @@ } case STOBJ : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2455,7 +2455,7 @@ } case UNBOX_ANY : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2477,7 +2477,7 @@ case CPBLK : break; case ENDFILTER: { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2521,7 +2521,7 @@ } case ARGLIST : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2531,12 +2531,12 @@ } case LDVIRTFTN : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } case REFANYTYPE : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2545,7 +2545,7 @@ } case SIZEOF : { - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); break; } @@ -2553,13 +2553,13 @@ break; } default : - VMThread::get()->vm->unknownError("unknown bytecode"); + VMThread::get()->getVM()->unknownError("unknown bytecode"); } break; } default : - VMThread::get()->vm->unknownError("unknown bytecode"); + VMThread::get()->getVM()->unknownError("unknown bytecode"); } } } Modified: vmkit/trunk/lib/N3/VMCore/Reader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Reader.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Reader.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Reader.cpp Tue Oct 13 03:46:46 2009 @@ -74,7 +74,7 @@ uint8 Reader::readU1() { if(cursor >= (uint32)bytes->size) - VMThread::get()->vm->error("readU1 outside the buffer"); + VMThread::get()->getVM()->error("readU1 outside the buffer"); return bytes->elements[cursor++]; } @@ -141,7 +141,7 @@ if ((n < start) || (n > end)) - VMThread::get()->vm->unknownError("out of range %d %d", n, end); + VMThread::get()->getVM()->unknownError("out of range %d %d", n, end); cursor = n; } Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Tue Oct 13 03:46:46 2009 @@ -181,7 +181,7 @@ sprintf(res, "%s[]", res); } - return VMThread::get()->vm->asciizToUTF8(res); + return VMThread::get()->getVM()->asciizToUTF8(res); } const UTF8* VMClassPointer::constructPointerName(const UTF8* name, uint32 dims) { @@ -194,7 +194,7 @@ sprintf(res, "%s*", res); } - return VMThread::get()->vm->asciizToUTF8(res); + return VMThread::get()->getVM()->asciizToUTF8(res); } @@ -262,7 +262,7 @@ cl->broadcastClass(); } else if (status < static_resolved) { cl->release(); - VMThread::get()->vm->unknownError("try to clinit a not-readed class..."); + VMThread::get()->getVM()->unknownError("try to clinit a not-readed class..."); } else { if (!cl->ownerClass()) { while (status < ready) cl->waitClass(); @@ -323,7 +323,7 @@ if (super == MSCorlib::pValue) { uint32 size = virtualFields.size(); if (size == 1) { - virtualFields[0]->offset = VMThread::get()->vm->module->constantZero; + virtualFields[0]->offset = VMThread::get()->getVM()->module->constantZero; ResultTy = virtualFields[0]->signature->naturalType; } else if (size == 0) { ResultTy = llvm::Type::getVoidTy(llvm::getGlobalContext()); @@ -413,7 +413,7 @@ cl->release(); } else if (status < loaded) { cl->release(); - VMThread::get()->vm->unknownError("try to resolve a not-readed class"); + VMThread::get()->getVM()->unknownError("try to resolve a not-readed class"); } else if (status == loaded) { if (cl->isArray) { VMClassArray* arrayCl = (VMClassArray*)cl; @@ -498,7 +498,7 @@ cl->release(); // printf("Will throw an exception: %s....\n", mvm::PrintBuffer::objectToString(this)); // ((char *)0)[0] = 22; - VMThread::get()->vm->unknownError("try to resolve static of a not virtual-resolved class"); + VMThread::get()->getVM()->unknownError("try to resolve static of a not virtual-resolved class"); } else if (status == virtual_resolved) { if (cl->isArray) { VMClassArray* arrayCl = (VMClassArray*)cl; @@ -570,7 +570,7 @@ VMMethod* res = lookupMethodDontThrow(name, args, isStatic, recurse); if (!res) { - VMThread::get()->vm->error(N3::MissingMethodException, + VMThread::get()->getVM()->error(N3::MissingMethodException, "unable to find %s in %s", mvm::PrintBuffer(name).cString(), mvm::PrintBuffer(this).cString()); } @@ -617,7 +617,7 @@ VMField* res = lookupFieldDontThrow(name, type, isStatic, recurse); if (!res) { - VMThread::get()->vm->error(N3::MissingFieldException, + VMThread::get()->getVM()->error(N3::MissingFieldException, "unable to find %s in %s", mvm::PrintBuffer(name).cString(), mvm::PrintBuffer(this).cString()); } @@ -774,7 +774,7 @@ } else if (cl->isArray) { return this->instantiationOfArray(cl); } else if (cl->isPointer){ - VMThread::get()->vm->error("implement me"); + VMThread::get()->getVM()->error("implement me"); return false; } else { return this->subclassOf(cl); Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Tue Oct 13 03:46:46 2009 @@ -137,7 +137,7 @@ if (thread->interruptFlag != 0) { mutexThread->unlock(); thread->interruptFlag = 0; - thread->vm->interruptedException(this); + thread->getVM()->interruptedException(this); } else { unsigned int recur = l->lock.recursionCount(); bool timeout = false; @@ -163,11 +163,11 @@ if (interrupted) { thread->interruptFlag = 0; - thread->vm->interruptedException(this); + thread->getVM()->interruptedException(this); } } } else { - VMThread::get()->vm->illegalMonitorStateException(this); + VMThread::get()->getVM()->illegalMonitorStateException(this); } } @@ -184,7 +184,7 @@ if (l->owner()) { l->varcond.notify(); } else { - VMThread::get()->vm->illegalMonitorStateException(this); + VMThread::get()->getVM()->illegalMonitorStateException(this); } } @@ -193,7 +193,7 @@ if (l->owner()) { l->varcond.notifyAll(); } else { - VMThread::get()->vm->illegalMonitorStateException(this); + VMThread::get()->getVM()->illegalMonitorStateException(this); } } Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Tue Oct 13 03:46:46 2009 @@ -86,7 +86,7 @@ #define verifyNull(obj) {} #else #define verifyNull(obj) \ - if (obj == 0) VMThread::get()->vm->nullPointerException(""); + if (obj == 0) VMThread::get()->getVM()->nullPointerException(""); #endif llvm::GenericValue operator()(VMField* field); Modified: vmkit/trunk/lib/N3/VMCore/VMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.cpp?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.cpp Tue Oct 13 03:46:46 2009 @@ -44,7 +44,7 @@ llvm_gcroot(thread, 0); this->perFunctionPasses = 0; this->vmThread = thread; - this->vm = vm; + this->MyVM = vm; this->lock = new mvm::LockNormal(); this->varcond = new mvm::Cond(); this->interruptFlag = 0; Modified: vmkit/trunk/lib/N3/VMCore/VMThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.h?rev=83961&r1=83960&r2=83961&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.h Tue Oct 13 03:46:46 2009 @@ -30,7 +30,11 @@ class VMThread : public mvm::MutatorThread { public: VMObject* vmThread; - N3* vm; + + N3* getVM() { + return (N3*)MyVM; + } + mvm::Lock* lock; mvm::Cond* varcond; VMObject* pendingException; From nicolas.geoffray at lip6.fr Tue Oct 13 07:35:58 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 14:35:58 -0000 Subject: [vmkit-commits] [vmkit] r83966 - /vmkit/trunk/Makefile.rules Message-ID: <200910131435.n9DEZw7x004120@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 09:35:57 2009 New Revision: 83966 URL: http://llvm.org/viewvc/llvm-project?rev=83966&view=rev Log: Compile array classes for MMTk. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=83966&r1=83965&r2=83966&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Oct 13 09:35:57 2009 @@ -131,7 +131,7 @@ all:: $(Verb) $(ANT) $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) - $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=vmkit.properties -disable-stubs + $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=vmkit.properties -disable-stubs -assume-compiled $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc From nicolas.geoffray at lip6.fr Tue Oct 13 07:37:09 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 14:37:09 -0000 Subject: [vmkit-commits] [vmkit] r83967 - /vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Message-ID: <200910131437.n9DEb9TJ004179@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 09:37:09 2009 New Revision: 83967 URL: http://llvm.org/viewvc/llvm-project?rev=83967&view=rev Log: Compile the virtual table of array classes when assumeCompiles is set. Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp?rev=83967&r1=83966&r2=83967&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Tue Oct 13 09:37:09 2009 @@ -484,7 +484,7 @@ JnjvmModule::VTType); virtualTables.insert(std::make_pair(VT, res)); - if (isCompiling(classDef)) { + if (isCompiling(classDef) || assumeCompiled) { Constant* C = CreateConstantFromVT(VT); varGV->setInitializer(C); } From nicolas.geoffray at lip6.fr Tue Oct 13 07:38:25 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 14:38:25 -0000 Subject: [vmkit-commits] [vmkit] r83968 - /vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp Message-ID: <200910131438.n9DEcPd3004225@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 09:38:25 2009 New Revision: 83968 URL: http://llvm.org/viewvc/llvm-project?rev=83968&view=rev Log: Load the contents of LLVMRuntime.inc only if an equivalent was not loaded previoulsy. Modified: vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp?rev=83968&r1=83967&r2=83968&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JnjvmModule.cpp Tue Oct 13 09:38:25 2009 @@ -100,7 +100,9 @@ void JnjvmModule::initialise() { Module* module = globalModule; - jnjvm::llvm_runtime::makeLLVMModuleContents(module); + + if (!module->getTypeByName("JavaThread")) + jnjvm::llvm_runtime::makeLLVMModuleContents(module); VTType = PointerType::getUnqual(module->getTypeByName("VT")); From gael.thomas at lip6.fr Tue Oct 13 07:39:26 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 13 Oct 2009 14:39:26 -0000 Subject: [vmkit-commits] [vmkit] r83969 - in /vmkit/trunk/lib/N3: LLVMRuntime/runtime.ll VMCore/CLIJit.cpp VMCore/N3Initialise.cpp VMCore/Opcodes.cpp VMCore/VMArray.cpp VMCore/VMArray.h VMCore/VirtualTables.cpp Message-ID: <200910131439.n9DEdQxi004280@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 13 09:39:26 2009 New Revision: 83969 URL: http://llvm.org/viewvc/llvm-project?rev=83969&view=rev Log: Unify array definition with a new macro applied on all arrays (ON_ARRAY_CLASSES). Remove Array*::tracer. Use directly the generated tracer of CLIJit::makeArrayVT. Array*::print is now a static method (called do_print to avoid confusion). The printer is put in the virtual table of an array directly in CLIJit::makeArrayVT Modified: vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMArray.cpp vmkit/trunk/lib/N3/VMCore/VMArray.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll?rev=83969&r1=83968&r2=83969&view=diff ============================================================================== --- vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll (original) +++ vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll Tue Oct 13 09:39:26 2009 @@ -2,16 +2,18 @@ ;;; Types for CLI arrays. A size of 0 means an undefined size. %CLIArray = type { %CLIObject, i32 } -%ArrayDouble = type { %CLIObject, i32, [0 x double] } -%ArrayFloat = type { %CLIObject, i32, [0 x float] } -%ArrayLong = type { %CLIObject, i32, [0 x i64] } -%ArrayObject = type { %CLIObject, i32, [0 x %CLIObject*] } +%ArraySInt8 = type { %CLIObject, i32, [0 x i8] } +%ArrayUInt8 = type { %CLIObject, i32, [0 x i8] } +%ArrayChar = type { %CLIObject, i32, [0 x i16] } %ArraySInt16 = type { %CLIObject, i32, [0 x i16] } -%ArraySInt32 = type { %CLIObject, i32, [0 x i32] } -%ArraySInt8 = type { %CLIObject, i32, [0 x i8] } %ArrayUInt16 = type { %CLIObject, i32, [0 x i16] } +%ArraySInt32 = type { %CLIObject, i32, [0 x i32] } %ArrayUInt32 = type { %CLIObject, i32, [0 x i32] } -%ArrayUInt8 = type { %CLIObject, i32, [0 x i8] } +%ArraySInt64 = type { %CLIObject, i32, [0 x i64] } +%ArrayUInt64 = type { %CLIObject, i32, [0 x i64] } +%ArrayFloat = type { %CLIObject, i32, [0 x float] } +%ArrayDouble = type { %CLIObject, i32, [0 x double] } +%ArrayObject = type { %CLIObject, i32, [0 x %CLIObject*] } %CacheNode = type {i8*, i8*, i8*, i8*, i8*, i1} Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=83969&r1=83968&r2=83969&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Tue Oct 13 09:39:26 2009 @@ -237,27 +237,14 @@ cl->virtualTracer = func; #endif +#define CASE_ARRAY(name, elmt, nbb, printer, pre, sep, post) \ + else if(cl->baseClass == MSCorlib::p##name) { \ + ((void**)res)[VT_PRINT_OFFSET] = ((void **)(unsigned int)Array##name::do_print); \ + } + + if(0) {} ON_ARRAY_CLASSES(CASE_ARRAY) - if (cl->baseClass == MSCorlib::pChar) { - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayChar::VT)[VT_PRINT_OFFSET]; - } else if(cl->baseClass == MSCorlib::pSInt8) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArraySInt8::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pUInt8) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayUInt8::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pSInt16) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArraySInt16::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pUInt16) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayUInt16::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pSInt32) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArraySInt32::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pUInt32) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayUInt32::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pSInt64) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayLong::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pFloat) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayFloat::VT)[VT_PRINT_OFFSET]; - else if(cl->baseClass == MSCorlib::pDouble) - ((void**)res)[VT_PRINT_OFFSET] = ((void **)ArrayDouble::VT)[VT_PRINT_OFFSET]; +#undef CASE_ARRAY return res; } @@ -1552,31 +1539,17 @@ PointerType::getUnqual(module->getTypeByName("CLIObject")); VMArray::llvmType = PointerType::getUnqual(module->getTypeByName("CLIArray")); - ArrayUInt8::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayUInt8")); - ArraySInt8::llvmType = - PointerType::getUnqual(module->getTypeByName("ArraySInt8")); - ArrayChar::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayUInt16")); // should be ArrayChar... but it does not work? - ArrayUInt16::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayUInt16")); - ArraySInt16::llvmType = - PointerType::getUnqual(module->getTypeByName("ArraySInt16")); - ArraySInt32::llvmType = - PointerType::getUnqual(module->getTypeByName("ArraySInt32")); - ArrayLong::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayLong")); - ArrayDouble::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayDouble")); - ArrayFloat::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayFloat")); - ArrayObject::llvmType = - PointerType::getUnqual(module->getTypeByName("ArrayObject")); CacheNode::llvmType = PointerType::getUnqual(module->getTypeByName("CacheNode")); Enveloppe::llvmType = PointerType::getUnqual(module->getTypeByName("Enveloppe")); +#define GET_LLVM_ARRAY_TYPE(name, elmt, nbb, printer, pre, sep, post) \ + Array##name::llvmType = \ + PointerType::getUnqual(module->getTypeByName("Array"#name)); + ON_ARRAY_CLASSES(GET_LLVM_ARRAY_TYPE) +#undef GET_LLVM_ARRAY_TYPE + #ifdef WITH_TRACER markAndTraceLLVM = module->getFunction("MarkAndTrace"); markAndTraceLLVMType = markAndTraceLLVM->getFunctionType(); Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83969&r1=83968&r2=83969&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue Oct 13 09:39:26 2009 @@ -146,18 +146,12 @@ llvm::Function* CLIJit::getCppExceptionLLVM; llvm::Function* CLIJit::newStringLLVM; +#define DEFINE_ARRAY_LLVM_TYPE(name, elmt, size, printer, pre, sep, post) \ + const llvm::Type* Array##name::llvmType = 0; -const llvm::Type* ArrayUInt8::llvmType = 0; -const llvm::Type* ArraySInt8::llvmType = 0; -const llvm::Type* ArrayChar::llvmType = 0; -const llvm::Type* ArrayUInt16::llvmType = 0; -const llvm::Type* ArraySInt16::llvmType = 0; -const llvm::Type* ArrayUInt32::llvmType = 0; -const llvm::Type* ArraySInt32::llvmType = 0; -const llvm::Type* ArrayFloat::llvmType = 0; -const llvm::Type* ArrayDouble::llvmType = 0; -const llvm::Type* ArrayLong::llvmType = 0; -const llvm::Type* ArrayObject::llvmType = 0; +ON_ARRAY_CLASSES(DEFINE_ARRAY_LLVM_TYPE) + +#undef DEFINE_ARRAY_LLVM_TYPE static void initialiseVT() { @@ -176,20 +170,12 @@ INIT(LockObj); INIT(VMObject); - INIT(VMArray); - INIT(ArrayUInt8); - INIT(ArraySInt8); - INIT(ArrayChar); - INIT(ArrayUInt16); - INIT(ArraySInt16); - INIT(ArrayUInt32); - INIT(ArraySInt32); - INIT(ArrayLong); - INIT(ArrayFloat); - INIT(ArrayDouble); - INIT(ArrayObject); INIT(CLIString); +#define INIT_ARRAY(name, elmt, nbb, printer, pre, sep, post) INIT(Array##name) + ON_ARRAY_CLASSES(INIT_ARRAY); +#undef INIT_ARRAY + #undef INIT } Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=83969&r1=83968&r2=83969&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Tue Oct 13 09:39:26 2009 @@ -1448,7 +1448,7 @@ case LDELEM_I8 : { Value* index = pop(); Value* obj = pop(); - Value* ptr = verifyAndComputePtr(obj, index, ArrayLong::llvmType); + Value* ptr = verifyAndComputePtr(obj, index, ArrayUInt64::llvmType); push(new LoadInst(ptr, "", currentBlock)); break; } @@ -1705,7 +1705,7 @@ Value* val = pop(); Value* index = pop(); Value* obj = pop(); - Value* ptr = verifyAndComputePtr(obj, index, ArrayLong::llvmType); + Value* ptr = verifyAndComputePtr(obj, index, ArrayUInt64::llvmType); convertValue(val, Type::getInt64Ty(getGlobalContext()), currentBlock); new StoreInst(val, ptr, false, currentBlock); break; Modified: vmkit/trunk/lib/N3/VMCore/VMArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.cpp?rev=83969&r1=83968&r2=83969&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.cpp Tue Oct 13 09:39:26 2009 @@ -20,9 +20,9 @@ const sint32 VMArray::MaxArraySize = 268435455; -#define PRINT(name, printer, pre, sep, post) \ - void name::print(mvm::PrintBuffer *buf) const { \ - declare_gcroot(const name *, self) = this; \ +#define DEFINE_ARRAY_PRINT(name, elmt, nbb, printer, pre, sep, post) \ + void Array##name::do_print(const Array##name *self, mvm::PrintBuffer *buf) { \ + llvm_gcroot(self, 0); \ buf->write(pre); \ for(int i=0; isize; i++) { \ if(i) \ @@ -32,27 +32,6 @@ buf->write(post); \ } -#define ARRAYCLASS(name, elmt, size, printer, pre, sep, post) \ - PRINT(name, printer, pre, sep, post) +ON_ARRAY_CLASSES(DEFINE_ARRAY_PRINT) -ARRAYCLASS(ArrayUInt8, uint8, 1, writeS4, "Array<", " ", ">") -ARRAYCLASS(ArraySInt8, sint8, 1, writeS4, "Array<", " ", ">") -ARRAYCLASS(ArrayChar, uint16, 2, writeChar, "", "", "") -ARRAYCLASS(ArrayUInt16, uint16, 2, writeS4, "Array<", " ", ">") -ARRAYCLASS(ArraySInt16, sint16, 2, writeS4, "Array<", " ", ">") -ARRAYCLASS(ArrayUInt32, uint32, 4, writeS4, "Array<", " ", ">") -ARRAYCLASS(ArraySInt32, sint32, 4, writeS4, "Array<", " ", ">") -ARRAYCLASS(ArrayLong, sint64, 8, writeS8, "Array<", " ", ">") -ARRAYCLASS(ArrayFloat, float, 4, writeFP, "Array<", " ", ">") -ARRAYCLASS(ArrayDouble, double, 8, writeFP, "Array<", " ", ">") -ARRAYCLASS(ArrayObject, VMObject*, 4, writeObj, "Array<", " ", ">") - -void VMArray::print(mvm::PrintBuffer *buf) const { - assert(0 && "should not be here"); -} - -#undef PRINT -#undef AT -#undef INITIALISE -#undef ACONS -#undef ARRAYCLASS +#undef DEFINE_ARRAY_PRINT Modified: vmkit/trunk/lib/N3/VMCore/VMArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.h?rev=83969&r1=83968&r2=83969&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.h Tue Oct 13 09:39:26 2009 @@ -27,47 +27,53 @@ class VMCommonClass; class VMObject; + // never allocate a VMArray, it is just a C++ type to access N3 object class VMArray : public VMObject { + void *operator new(size_t n) { return VMObject::operator new(n, 0); } + public: - static VirtualTable* VT; sint32 size; void* elements[1]; + static const sint32 MaxArraySize; static const llvm::Type* llvmType; - static llvm::Constant* sizeOffset(); static llvm::Constant* elementsOffset(); - virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; - }; -typedef VMArray* (*arrayCtor_t)(uint32 len, VMCommonClass* cl); +#define ON_ARRAY_PRIMITIVE_CLASSES(_) \ + _(UInt8, uint8, 1, writeS4, "Array<", " ", ">") \ + _(SInt8, sint8, 1, writeS4, "Array<", " ", ">") \ + _(Char, uint16, 2, writeChar, "", "", "") \ + _(UInt16, uint16, 2, writeS4, "Array<", " ", ">") \ + _(SInt16, sint16, 2, writeS4, "Array<", " ", ">") \ + _(UInt32, uint32, 4, writeS4, "Array<", " ", ">") \ + _(SInt32, sint32, 4, writeS4, "Array<", " ", ">") \ + _(UInt64, uint64, 8, writeS8, "Array<", " ", ">") \ + _(SInt64, sint64, 8, writeS8, "Array<", " ", ">") \ + _(Float, float, 4, writeFP, "Array<", " ", ">") \ + _(Double, double, 8, writeFP, "Array<", " ", ">") + +#define ON_ARRAY_CLASSES(_) \ + ON_ARRAY_PRIMITIVE_CLASSES(_) \ + _(Object, VMObject*, 4, writeObj, "Array<", " ", ">") + + + // never allocate a VMArray, it is just a C++ type to access N3 object +#define DEFINE_ARRAY_CLASS(name, elmt, nbb, printer, pre, sep, post) \ + class Array##name : public VMObject { \ + void *operator new(size_t n) { return VMObject::operator new(n, 0); } \ + public: \ + static VirtualTable* VT; \ + static const llvm::Type* llvmType; \ + sint32 size; \ + elmt elements[1]; \ + static void do_print(const Array##name *self, mvm::PrintBuffer* buf); \ + }; -#define ARRAYCLASS(name, elmt) \ -class name : public VMObject { \ -public: \ - static VirtualTable* VT; \ - static const llvm::Type* llvmType; \ - sint32 size; \ - elmt elements[1]; \ - virtual void print(mvm::PrintBuffer* buf) const; \ - virtual void TRACER; \ -} - -ARRAYCLASS(ArrayUInt8, uint8); -ARRAYCLASS(ArraySInt8, sint8); -ARRAYCLASS(ArrayChar, uint16); -ARRAYCLASS(ArrayUInt16, uint16); -ARRAYCLASS(ArraySInt16, sint16); -ARRAYCLASS(ArrayUInt32, uint32); -ARRAYCLASS(ArraySInt32, sint32); -ARRAYCLASS(ArrayLong, sint64); -ARRAYCLASS(ArrayFloat, float); -ARRAYCLASS(ArrayDouble, double); -ARRAYCLASS(ArrayObject, VMObject*); +ON_ARRAY_CLASSES(DEFINE_ARRAY_CLASS) -#undef ARRAYCLASS +#undef DEFINE_ARRAY_CLASS } // end namespace n3 Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83969&r1=83968&r2=83969&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Tue Oct 13 09:39:26 2009 @@ -25,21 +25,13 @@ #define INIT(X) VirtualTable* X::VT = 0 - INIT(VMArray); - INIT(ArrayUInt8); - INIT(ArraySInt8); - INIT(ArrayChar); - INIT(ArrayUInt16); - INIT(ArraySInt16); - INIT(ArrayUInt32); - INIT(ArraySInt32); - INIT(ArrayLong); - INIT(ArrayFloat); - INIT(ArrayDouble); - INIT(ArrayObject); - INIT(LockObj); - INIT(VMObject); - INIT(CLIString); +INIT(LockObj); +INIT(VMObject); +INIT(CLIString); + +#define INIT_ARRAY(name, elmt, size, printer, pre, sep, post) INIT(Array##name); +ON_ARRAY_CLASSES(INIT_ARRAY) +#undef INIT_ARRAY #undef INIT @@ -63,36 +55,6 @@ VMObject::CALL_TRACER; } -void VMArray::TRACER { - VMObject::CALL_TRACER; -} - -void ArrayObject::TRACER { - VMObject::CALL_TRACER; - for (sint32 i = 0; i < size; i++) { - elements[i]->MARK_AND_TRACE; - } -} - -#define ARRAYTRACER(name) \ - void name::TRACER { \ - VMObject::CALL_TRACER; \ - } - - -ARRAYTRACER(ArrayUInt8) -ARRAYTRACER(ArraySInt8) -ARRAYTRACER(ArrayChar) -ARRAYTRACER(ArrayUInt16) -ARRAYTRACER(ArraySInt16) -ARRAYTRACER(ArrayUInt32) -ARRAYTRACER(ArraySInt32) -ARRAYTRACER(ArrayLong) -ARRAYTRACER(ArrayFloat) -ARRAYTRACER(ArrayDouble) - -#undef ARRAYTRACER - #define TRACE_VECTOR(type, name, alloc) { \ for (std::vector >::iterator i = name.begin(), e = name.end(); \ i!= e; ++i) { \ @@ -165,6 +127,6 @@ delegatee->MARK_AND_TRACE; } -// never called but it simplifies the definition of LockedMap +// useless (never called or used) but it simplifies the definition of LockedMap void VMField::TRACER { } From gael.thomas at lip6.fr Tue Oct 13 07:51:54 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 13 Oct 2009 14:51:54 -0000 Subject: [vmkit-commits] [vmkit] r83971 - in /vmkit/trunk/lib/N3: Mono/Mono.cpp Mono/MonoMSCorlib.cpp PNetLib/PNetLib.cpp PNetLib/PNetMSCorlib.cpp VMCore/N3Initialise.cpp VMCore/VMThread.cpp VMCore/VMThread.h VMCore/VirtualTables.cpp Message-ID: <200910131451.n9DEptUB004753@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 13 09:51:54 2009 New Revision: 83971 URL: http://llvm.org/viewvc/llvm-project?rev=83971&view=rev Log: Rename vmThread to ooo_appThread. All N3 references in C++ fields will be called ooo_*. Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMThread.cpp vmkit/trunk/lib/N3/VMCore/VMThread.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Tue Oct 13 09:51:54 2009 @@ -244,8 +244,8 @@ } extern "C" VMObject* System_Threading_Thread_CurrentThread_internal() { - declare_gcroot(VMObject*, res) = VMThread::get()->vmThread; - return res; + declare_gcroot(VMObject*, appThread) = VMThread::get()->ooo_appThread; + return appThread; } extern "C" VMObject* Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Tue Oct 13 09:51:54 2009 @@ -167,8 +167,6 @@ vm->asciizToUTF8("Thread"), vm->asciizToUTF8("System.Threading"), true, true, true, true); - VMObject* th = (*cl)(); - declare_gcroot(VMThread*, myth) = VMThread::get(); - myth->vmThread = th; - + declare_gcroot(VMObject*, appThread) = (*cl)(); + VMThread::get()->ooo_appThread = appThread; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Tue Oct 13 09:51:54 2009 @@ -1061,6 +1061,6 @@ } extern "C" VMObject* System_Threading_Thread_InternalCurrentThread() { - declare_gcroot(VMObject*, res) = VMThread::get()->vmThread; - return res; + declare_gcroot(VMObject*, appThread) = VMThread::get()->ooo_appThread; + return appThread; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Tue Oct 13 09:51:54 2009 @@ -172,16 +172,16 @@ vm->asciizToUTF8("Thread"), vm->asciizToUTF8("System.Threading"), true, true, true, true); - VMObject* th = (*cl)(); + declare_gcroot(VMObject*, appThread) = (*cl)(); std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(cl); args.push_back(MSCorlib::pIntPtr); VMMethod* meth = cl->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); - declare_gcroot(VMThread*, myth) = VMThread::get(); - (*meth)(th, myth); - myth->vmThread = th; + VMThread* myth = VMThread::get(); + (*meth)(appThread, myth); + myth->ooo_appThread = appThread; } void MSCorlib::loadBootstrap(N3* vm) { Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue Oct 13 09:51:54 2009 @@ -190,7 +190,6 @@ N3* vm = N3::bootstrapVM = N3::allocateBootstrap(); VMThread::TheThread = new VMThread(0, vm); - vm->assemblyPath.push_back(""); vm->assemblyPath.push_back(MSCorlib::libsPath); Modified: vmkit/trunk/lib/N3/VMCore/VMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.cpp?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.cpp Tue Oct 13 09:51:54 2009 @@ -29,9 +29,9 @@ const unsigned int VMThread::StateInterrupted = 2; void VMThread::print(mvm::PrintBuffer* buf) const { - buf->write("Thread:"); - declare_gcroot(VMObject *, th) = vmThread; - th->print(buf); + buf->write("Thread<>"); + declare_gcroot(VMObject *, appThread) = ooo_appThread; + appThread->print(buf); } extern void AddStandardCompilePasses(llvm::FunctionPassManager*); @@ -40,10 +40,10 @@ delete perFunctionPasses; } -VMThread::VMThread(VMObject* thread, N3* vm) { - llvm_gcroot(thread, 0); +VMThread::VMThread(VMObject* appThread, N3* vm) { + llvm_gcroot(appThread, 0); this->perFunctionPasses = 0; - this->vmThread = thread; + this->ooo_appThread = appThread; this->MyVM = vm; this->lock = new mvm::LockNormal(); this->varcond = new mvm::Cond(); @@ -58,8 +58,8 @@ VMObject* VMThread::currentThread() { VMThread* result = get(); if (result != 0) { - declare_gcroot(VMObject *, res) = result->vmThread; - return res; + declare_gcroot(VMObject *, appThread) = result->ooo_appThread; + return appThread; } else return 0; } Modified: vmkit/trunk/lib/N3/VMCore/VMThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.h?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.h Tue Oct 13 09:51:54 2009 @@ -29,7 +29,7 @@ class VMThread : public mvm::MutatorThread { public: - VMObject* vmThread; + VMObject* ooo_appThread; N3* getVM() { return (N3*)MyVM; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83971&r1=83970&r2=83971&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Tue Oct 13 09:51:54 2009 @@ -67,8 +67,8 @@ // internal objects void VMThread::TRACER { - declare_gcroot(VMObject*, th) = vmThread; - th->MARK_AND_TRACE; + declare_gcroot(VMObject*, appThread) = ooo_appThread; + appThread->MARK_AND_TRACE; pendingException->MARK_AND_TRACE; // I suppose that the vm is already traced by the gc // vm->CALL_TRACER; From gael.thomas at lip6.fr Tue Oct 13 08:09:19 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 13 Oct 2009 15:09:19 -0000 Subject: [vmkit-commits] [vmkit] r83972 - in /vmkit/trunk/lib/N3/VMCore: VMArray.cpp VMObject.cpp VirtualTables.cpp Message-ID: <200910131509.n9DF9KkY005516@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 13 10:09:19 2009 New Revision: 83972 URL: http://llvm.org/viewvc/llvm-project?rev=83972&view=rev Log: Rename also vmThread in VMObject.cpp. ArrayObject::do_print ensures that elements are gcroot. Does not define gcroot in tracers. Modified: vmkit/trunk/lib/N3/VMCore/VMArray.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/VMArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.cpp?rev=83972&r1=83971&r2=83972&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.cpp Tue Oct 13 10:09:19 2009 @@ -32,6 +32,18 @@ buf->write(post); \ } -ON_ARRAY_CLASSES(DEFINE_ARRAY_PRINT) +ON_ARRAY_PRIMITIVE_CLASSES(DEFINE_ARRAY_PRINT) + +void ArrayObject::do_print(const ArrayObject *self, mvm::PrintBuffer *buf) { + llvm_gcroot(self, 0); + buf->write("Array<"); + for(int i=0; isize; i++) { + if(i) + buf->write(" "); + declare_gcroot(VMObject*, cur) = self->elements[i]; + buf->writeObj(cur); + } + buf->write(">"); +} #undef DEFINE_ARRAY_PRINT Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=83972&r1=83971&r2=83972&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Tue Oct 13 10:09:19 2009 @@ -32,7 +32,7 @@ cur->lock->unlock(); continue; } else { - declare_gcroot(VMObject *, th) = cur->vmThread; + declare_gcroot(VMObject *, th) = cur->ooo_appThread; if (th != 0) { cur->varcond->signal(); cur->lock->unlock(); Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83972&r1=83971&r2=83972&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Tue Oct 13 10:09:19 2009 @@ -67,8 +67,7 @@ // internal objects void VMThread::TRACER { - declare_gcroot(VMObject*, appThread) = ooo_appThread; - appThread->MARK_AND_TRACE; + ooo_appThread->MARK_AND_TRACE; pendingException->MARK_AND_TRACE; // I suppose that the vm is already traced by the gc // vm->CALL_TRACER; From gael.thomas at lip6.fr Tue Oct 13 13:48:25 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 13 Oct 2009 20:48:25 -0000 Subject: [vmkit-commits] [vmkit] r84021 - in /vmkit/trunk/lib/N3/VMCore: CLIJit.cpp CLIJit.h CLIString.h N3Initialise.cpp VMArray.h VMClass.cpp VMObject.cpp VMObject.h VirtualTables.cpp Message-ID: <200910132048.n9DKmQqd020243@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 13 15:48:25 2009 New Revision: 84021 URL: http://llvm.org/viewvc/llvm-project?rev=84021&view=rev Log: Define a new N3VirtualTable that inherits from VirtualTable. Put VMCond inside LockObj. Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.h vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMArray.h vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Tue Oct 13 15:48:25 2009 @@ -141,8 +141,8 @@ #endif -VirtualTable* CLIJit::makeArrayVT(VMClassArray* cl) { - VirtualTable * res = (VirtualTable*)malloc(VT_SIZE); +N3VirtualTable* CLIJit::makeArrayVT(VMClassArray* cl) { + N3VirtualTable * res = (N3VirtualTable*)malloc(VT_SIZE); memcpy(res, VMObject::VT, VT_SIZE); #ifdef WITH_TRACER Function* func = Function::Create(markAndTraceLLVMType, @@ -249,17 +249,17 @@ return res; } -VirtualTable* CLIJit::makeVT(VMClass* cl, bool stat) { - VirtualTable * res = (VirtualTable*)malloc(VT_SIZE); +N3VirtualTable* CLIJit::makeVT(VMClass* cl, bool stat) { + N3VirtualTable * res = (N3VirtualTable*)malloc(VT_SIZE); memcpy(res, VMObject::VT, VT_SIZE); #ifdef WITH_TRACER const Type* type = stat ? cl->staticType : cl->virtualType; std::vector &fields = stat ? cl->staticFields : cl->virtualFields; Function* func = Function::Create(markAndTraceLLVMType, - GlobalValue::ExternalLinkage, - "markAndTraceObject", - cl->vm->getLLVMModule()); + GlobalValue::ExternalLinkage, + "markAndTraceObject", + cl->vm->getLLVMModule()); Argument* arg = func->arg_begin(); #ifdef MULTIPLE_GC @@ -298,7 +298,7 @@ cl->staticTracer = func; } #endif - + return res; } Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Tue Oct 13 15:48:25 2009 @@ -42,7 +42,6 @@ class ExceptionBlockDesc : public mvm::PermanentObject { public: - static VirtualTable* VT; uint32 tryOffset; uint32 tryLength; uint32 handlerOffset; @@ -81,8 +80,8 @@ static const char* OpcodeNames[0xE1]; static const char* OpcodeNamesFE[0x23]; - static VirtualTable* makeVT(VMClass* cl, bool isStatic); - static VirtualTable* makeArrayVT(VMClassArray* cl); + static N3VirtualTable* makeVT(VMClass* cl, bool isStatic); + static N3VirtualTable* makeArrayVT(VMClassArray* cl); static void printExecution(char*, n3::VMMethod*); void compileOpcodes(uint8*, uint32, VMGenericClass* genClass, VMGenericMethod* genMethod); Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Tue Oct 13 15:48:25 2009 @@ -24,7 +24,7 @@ class CLIString : public VMObject { public: - static VirtualTable* VT; + static N3VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLI string"); } Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue Oct 13 15:48:25 2009 @@ -158,12 +158,12 @@ #if defined(WITHOUT_FINALIZER) # define INIT(X) { \ X fake; \ - X::VT = ((VirtualTable**)(void*)(&fake))[0]; \ + X::VT = ((N3VirtualTable**)(void*)(&fake))[0]; \ } #else # define INIT(X) { \ X fake; \ - X::VT = ((VirtualTable**)(void*)(&fake))[0]; \ + X::VT = ((N3VirtualTable**)(void*)(&fake))[0]; \ ((void**)X::VT)[0] = 0; \ } #endif Modified: vmkit/trunk/lib/N3/VMCore/VMArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.h?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.h Tue Oct 13 15:48:25 2009 @@ -64,7 +64,7 @@ class Array##name : public VMObject { \ void *operator new(size_t n) { return VMObject::operator new(n, 0); } \ public: \ - static VirtualTable* VT; \ + static N3VirtualTable* VT; \ static const llvm::Type* llvmType; \ sint32 size; \ elmt elements[1]; \ Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Tue Oct 13 15:48:25 2009 @@ -292,7 +292,7 @@ cl->staticType = llvm::PointerType::getUnqual(llvm::StructType::get(vm->LLVMModule->getContext(), fields, false)); - VirtualTable* VT = CLIJit::makeVT(cl, true); + N3VirtualTable* VT = CLIJit::makeVT(cl, true); uint64 size = mvm::MvmModule::getTypeSize(cl->staticType->getContainedType(0)); cl->staticInstance = (VMObject*)gc::operator new(size, VT); @@ -465,7 +465,7 @@ // We check for virtual instance because the string class has a // bigger size than the class declares. if (super != MSCorlib::pEnum && !cl->virtualInstance) { - VirtualTable* VT = CLIJit::makeVT(cl, false); + N3VirtualTable* VT = CLIJit::makeVT(cl, false); uint64 size = mvm::MvmModule::getTypeSize(cl->virtualType->getContainedType(0)); cl->virtualInstance = (VMObject*)gc::operator new(size, VT); Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Tue Oct 13 15:48:25 2009 @@ -23,7 +23,7 @@ this->lockObj = 0; } -void VMCond::notify() { +void LockObj::notify() { for (std::vector::iterator i = threads.begin(), e = threads.end(); i!= e; ++i) { VMThread* cur = *i; @@ -45,7 +45,7 @@ } } -void VMCond::notifyAll() { +void LockObj::notifyAll() { for (std::vector::iterator i = threads.begin(), e = threads.end(); i!= e; ++i) { VMThread* cur = *i; @@ -56,11 +56,11 @@ } } -void VMCond::wait(VMThread* th) { +void LockObj::wait(VMThread* th) { threads.push_back(th); } -void VMCond::remove(VMThread* th) { +void LockObj::remove(VMThread* th) { for (std::vector::iterator i = threads.begin(), e = threads.end(); i!= e; ++i) { if (*i == th) { @@ -142,7 +142,7 @@ unsigned int recur = l->lock.recursionCount(); bool timeout = false; l->lock.unlockAll(); - l->varcond.wait(thread); + l->wait(thread); thread->state = VMThread::StateWaiting; if (timed) { @@ -156,7 +156,7 @@ l->lock.lockAll(recur); if (interrupted || timeout) { - l->varcond.remove(thread); + l->remove(thread); } thread->state = VMThread::StateRunning; @@ -182,7 +182,7 @@ void VMObject::notify() { LockObj* l = myLock(this); if (l->owner()) { - l->varcond.notify(); + l->notify(); } else { VMThread::get()->getVM()->illegalMonitorStateException(this); } @@ -191,7 +191,7 @@ void VMObject::notifyAll() { LockObj* l = myLock(this); if (l->owner()) { - l->varcond.notifyAll(); + l->notifyAll(); } else { VMThread::get()->getVM()->illegalMonitorStateException(this); } Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Tue Oct 13 15:48:25 2009 @@ -19,6 +19,8 @@ #include "mvm/Object.h" #include "mvm/Threads/Locks.h" +#include "mvm/GC/GC.h" + #include "types.h" namespace n3 { @@ -28,26 +30,32 @@ class VMObject; class VMThread; -class VMCond { -public: - std::vector threads; - - void notify(); - void notifyAll(); - void wait(VMThread* th); - void remove(VMThread* th); +struct N3VirtualTable : VirtualTable { + uintptr_t print; + uintptr_t hashcode; + + N3VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, uintptr_t p, uintptr_t h) : VirtualTable(d, o, t) { + print = p; + hashcode = h; + } }; class LockObj : public mvm::Object { public: - static VirtualTable* VT; - mvm::LockRecursive lock; - VMCond varcond; + static N3VirtualTable* VT; + mvm::LockRecursive lock; + std::vector threads; + + static LockObj* allocate(); virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; + + void notify(); + void notifyAll(); + void wait(VMThread* th); + void remove(VMThread* th); - static LockObj* allocate(); void aquire(); void release(); bool owner(); @@ -57,7 +65,7 @@ class VMObject : public mvm::Object { public: - static VirtualTable* VT; + static N3VirtualTable* VT; VMCommonClass* classOf; LockObj* lockObj; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84021&r1=84020&r2=84021&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Tue Oct 13 15:48:25 2009 @@ -23,7 +23,7 @@ using namespace n3; -#define INIT(X) VirtualTable* X::VT = 0 +#define INIT(X) N3VirtualTable* X::VT = 0 INIT(LockObj); INIT(VMObject); From gael.thomas at lip6.fr Tue Oct 13 13:55:45 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Tue, 13 Oct 2009 20:55:45 -0000 Subject: [vmkit-commits] [vmkit] r84023 - in /vmkit/trunk/lib/N3/VMCore: Assembly.cpp CLIJit.cpp CLIJit.h VMClass.h Message-ID: <200910132055.n9DKtjDs020576@zion.cs.uiuc.edu> Author: gthomas Date: Tue Oct 13 15:55:45 2009 New Revision: 84023 URL: http://llvm.org/viewvc/llvm-project?rev=84023&view=rev Log: Rename VMMethod::offset on VMMethod::offsetInTextSection. Avoid any confusion with a futur offset in vt :) Fix a compilation bug in CLIJit.h: add a definition of the new N3VirtualTable. Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.h vmkit/trunk/lib/N3/VMCore/VMClass.h Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=84023&r1=84022&r2=84023&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Tue Oct 13 15:55:45 2009 @@ -1400,10 +1400,10 @@ meth->implFlags = implFlags; if (rva) { - meth->offset = textSection->rawAddress + - (rva - textSection->virtualAddress); + meth->offsetInTextSection = textSection->rawAddress + + (rva - textSection->virtualAddress); } else { - meth->offset = 0; + meth->offsetInTextSection = 0; } if (paramList && paramTable != 0 && paramList <= paramSize) { Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84023&r1=84022&r2=84023&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Tue Oct 13 15:55:45 2009 @@ -1156,7 +1156,7 @@ Function* CLIJit::compileFatOrTiny(VMGenericClass* genClass, VMGenericMethod* genMethod) { PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "tiny or fat compile %s\n", mvm::PrintBuffer(compilingMethod).cString()); - uint32 offset = compilingMethod->offset; + uint32 offset = compilingMethod->offsetInTextSection; ByteCode* bytes = compilingClass->assembly->bytes; uint8 header = READ_U1(bytes, offset); bool tiny = false; @@ -1334,7 +1334,7 @@ PRINT_DEBUG(N3_COMPILE, 1, COLOR_NORMAL, "tiny or fat inline compile %s\n", mvm::PrintBuffer(compilingMethod).cString()); - uint32 offset = compilingMethod->offset; + uint32 offset = compilingMethod->offsetInTextSection; ByteCode* bytes = compilingClass->assembly->bytes; uint8 header = READ_U1(bytes, offset); bool tiny = false; @@ -1463,7 +1463,7 @@ if (isInternal(meth->implFlags)) { func = jit->compileNative(dynamic_cast(meth)); - } else if (meth->offset == 0) { + } else if (meth->offsetInTextSection == 0) { func = jit->compileIntern(); } else { func = jit->compileFatOrTiny(dynamic_cast(cl), dynamic_cast(meth)); Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.h?rev=84023&r1=84022&r2=84023&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.h Tue Oct 13 15:55:45 2009 @@ -39,6 +39,7 @@ class VMObject; class VMGenericClass; class VMGenericMethod; +class N3VirtualTable; class ExceptionBlockDesc : public mvm::PermanentObject { public: Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=84023&r1=84022&r2=84023&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Tue Oct 13 15:55:45 2009 @@ -203,7 +203,7 @@ virtual void TRACER; uint32 flags; - uint32 offset; + uint32 offsetInTextSection; uint32 implFlags; uint32 token; From nicolas.geoffray at lip6.fr Tue Oct 13 14:52:17 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 13 Oct 2009 21:52:17 -0000 Subject: [vmkit-commits] [vmkit] r84035 - /vmkit/trunk/include/mvm/UTF8.h Message-ID: <200910132152.n9DLqHWK022887@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 13 16:52:17 2009 New Revision: 84035 URL: http://llvm.org/viewvc/llvm-project?rev=84035&view=rev Log: Remove virtual functions in UTF8 class. Modified: vmkit/trunk/include/mvm/UTF8.h Modified: vmkit/trunk/include/mvm/UTF8.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/UTF8.h?rev=84035&r1=84034&r2=84035&view=diff ============================================================================== --- vmkit/trunk/include/mvm/UTF8.h (original) +++ vmkit/trunk/include/mvm/UTF8.h Tue Oct 13 16:52:17 2009 @@ -56,8 +56,7 @@ size * sizeof(uint16)) < 0; } - virtual void print(PrintBuffer *pb) const; - virtual ~UTF8() {} + void print(PrintBuffer *pb) const; }; From gael.thomas at lip6.fr Wed Oct 14 02:46:12 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 09:46:12 -0000 Subject: [vmkit-commits] [vmkit] r84082 - in /vmkit/trunk/lib/N3/VMCore: CLIJit.cpp N3Initialise.cpp VMClass.cpp VMClass.h VMObject.cpp VMObject.h Message-ID: <200910140946.n9E9kDU2030231@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 04:46:11 2009 New Revision: 84082 URL: http://llvm.org/viewvc/llvm-project?rev=84082&view=rev Log: Define a new N3VirtualTable. Compute the real size of vt to dispatch virtual call with vt. It will not be used for the moment. Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84082&r1=84081&r2=84082&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Wed Oct 14 04:46:11 2009 @@ -142,8 +142,9 @@ N3VirtualTable* CLIJit::makeArrayVT(VMClassArray* cl) { - N3VirtualTable * res = (N3VirtualTable*)malloc(VT_SIZE); - memcpy(res, VMObject::VT, VT_SIZE); + VMClass *super = (VMClass*)cl->super; + N3VirtualTable * res = new(super->vtSize) N3VirtualTable(super->virtualInstance->getN3VirtualTable(), super->vtSize); + #ifdef WITH_TRACER Function* func = Function::Create(markAndTraceLLVMType, GlobalValue::ExternalLinkage, @@ -250,8 +251,13 @@ } N3VirtualTable* CLIJit::makeVT(VMClass* cl, bool stat) { - N3VirtualTable * res = (N3VirtualTable*)malloc(VT_SIZE); - memcpy(res, VMObject::VT, VT_SIZE); + int n = N3VirtualTable::baseVtSize(); + N3VirtualTable * res = + stat || !cl->super ? + new(n) N3VirtualTable(VMObject::VT, n) : + new(cl->vtSize) N3VirtualTable(((VMClass *)cl->super)->virtualInstance->getN3VirtualTable(), n, cl->vtSize); + + #ifdef WITH_TRACER const Type* type = stat ? cl->staticType : cl->virtualType; std::vector &fields = stat ? cl->staticFields : cl->virtualFields; Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=84082&r1=84081&r2=84082&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Wed Oct 14 04:46:11 2009 @@ -263,6 +263,7 @@ N3::testInfinity = vm->asciizToUTF8("TestInfinity"); MSCorlib::pArray->resolveType(1, 0, 0); + MSCorlib::pArray->resolveVT(); MSCorlib::initialise(vm); } Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=84082&r1=84081&r2=84082&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Wed Oct 14 04:46:11 2009 @@ -453,31 +453,40 @@ void VMCommonClass::resolveVT() { VMCommonClass* cl = this; - if (cl->isArray) { - VMClassArray* arrayCl = (VMClassArray*)cl; - arrayCl->baseClass->resolveVT(); - arrayCl->arrayVT = CLIJit::makeArrayVT(arrayCl); - } else if (cl->isPointer) { - } else { - VMClass* cl = (VMClass*)this; - if (super) super->resolveVT(); - - // We check for virtual instance because the string class has a - // bigger size than the class declares. - if (super != MSCorlib::pEnum && !cl->virtualInstance) { - N3VirtualTable* VT = CLIJit::makeVT(cl, false); - - uint64 size = mvm::MvmModule::getTypeSize(cl->virtualType->getContainedType(0)); - cl->virtualInstance = (VMObject*)gc::operator new(size, VT); - cl->virtualInstance->initialise(cl); + if (cl->isArray) { + VMClassArray* arrayCl = (VMClassArray*)cl; + arrayCl->baseClass->resolveVT(); + // printf("Making vt of %s\n", mvm::PrintBuffer(this).cString()); + arrayCl->arrayVT = CLIJit::makeArrayVT(arrayCl); + } else if (cl->isPointer) { + } else { + VMClass* cl = (VMClass*)this; + if (super) + super->resolveVT(); + + // We check for virtual instance because the string class has a + // bigger size than the class declares. + if (super != MSCorlib::pEnum && !cl->virtualInstance) { + cl->vtSize = super ? ((VMClass*)super)->vtSize : sizeof(N3VirtualTable) / sizeof(uintptr_t); + for (std::vector::iterator i = virtualMethods.begin(), + e = virtualMethods.end(); i!= e; ++i) { + (*i)->offsetInVt = cl->vtSize++; + } - for (std::vector::iterator i = cl->virtualFields.begin(), - e = cl->virtualFields.end(); i!= e; ++i) { - - (*i)->initField(cl->virtualInstance); - } - } - } + // printf("Making vt of %s with %d elements\n", mvm::PrintBuffer(this).cString(), cl->vtSize); + N3VirtualTable* VT = CLIJit::makeVT(cl, false); + + uint64 size = mvm::MvmModule::getTypeSize(cl->virtualType->getContainedType(0)); + cl->virtualInstance = (VMObject*)gc::operator new(size, VT); + cl->virtualInstance->initialise(cl); + + for (std::vector::iterator i = cl->virtualFields.begin(), + e = cl->virtualFields.end(); i!= e; ++i) { + + (*i)->initField(cl->virtualInstance); + } + } + } } void VMCommonClass::resolveType(bool stat, bool clinit, VMGenericMethod* genMethod) { Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=84082&r1=84081&r2=84082&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Wed Oct 14 04:46:11 2009 @@ -147,6 +147,7 @@ std::vector innerClasses; VMClass* outerClass; std::vector genericMethods; + uint32 vtSize; // in number of methods VMObject* operator()(); VMObject* doNew(); @@ -201,7 +202,8 @@ public: virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; - + + uint32 offsetInVt; uint32 flags; uint32 offsetInTextSection; uint32 implFlags; Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=84082&r1=84081&r2=84082&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Wed Oct 14 04:46:11 2009 @@ -18,6 +18,27 @@ using namespace n3; +void *N3VirtualTable::operator new(size_t size, size_t totalVtSize) { + //printf("Allocate N3VirtualTable with %d elements\n", totalVtSize); + return malloc(totalVtSize * sizeof(uintptr_t)); +} + +N3VirtualTable::N3VirtualTable() { +} + +N3VirtualTable::N3VirtualTable(N3VirtualTable *baseVt, uint32 baseVtSize, uint32 totalSize) { + memcpy(this, baseVt, baseVtSize * sizeof(uintptr_t)); +} + +N3VirtualTable::N3VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, uintptr_t p, uintptr_t h) : VirtualTable(d, o, t) { + print = p; + hashcode = h; +} + +uint32 N3VirtualTable::baseVtSize() { + return sizeof(N3VirtualTable) / sizeof(uintptr_t); +} + void VMObject::initialise(VMCommonClass* cl) { this->classOf = cl; this->lockObj = 0; Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84082&r1=84081&r2=84082&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Wed Oct 14 04:46:11 2009 @@ -34,10 +34,13 @@ uintptr_t print; uintptr_t hashcode; - N3VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, uintptr_t p, uintptr_t h) : VirtualTable(d, o, t) { - print = p; - hashcode = h; - } + void *operator new(size_t size, size_t totalVtSize); + + N3VirtualTable(); + N3VirtualTable(N3VirtualTable *vmobjVt, uint32 baseVtSize, uint32 totalVtSize=-1); + N3VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, uintptr_t p, uintptr_t h); + + static uint32 baseVtSize(); }; class LockObj : public mvm::Object { @@ -90,6 +93,8 @@ bool instanceOf(VMCommonClass* cl); + N3VirtualTable *getN3VirtualTable() { return (N3VirtualTable*)getVirtualTable(); } + #ifdef SIGSEGV_THROW_NULL #define verifyNull(obj) {} #else From gael.thomas at lip6.fr Wed Oct 14 04:25:29 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 11:25:29 -0000 Subject: [vmkit-commits] [vmkit] r84084 - in /vmkit/trunk: include/mvm/Object.h lib/Mvm/Runtime/Object.cpp lib/N3/VMCore/N3Initialise.cpp lib/N3/VMCore/VMArray.h lib/N3/VMCore/VMObject.cpp lib/N3/VMCore/VMObject.h lib/N3/VMCore/VirtualTables.cpp Message-ID: <200910141125.n9EBPTBx001212@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 06:25:28 2009 New Revision: 84084 URL: http://llvm.org/viewvc/llvm-project?rev=84084&view=rev Log: Remove vt from arrays. Define default functions for the vt in Object.h. Modified: vmkit/trunk/include/mvm/Object.h vmkit/trunk/lib/Mvm/Runtime/Object.cpp vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMArray.h vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/mvm/Object.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Object.h?rev=84084&r1=84083&r2=84084&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Object.h (original) +++ vmkit/trunk/include/mvm/Object.h Wed Oct 14 06:25:28 2009 @@ -32,18 +32,22 @@ /// class Object : public gc { public: + static void default_tracer(gc *o) {} + static intptr_t default_hashcode(gc *o) { return (intptr_t)o; } + static void default_print(const gc *o, PrintBuffer *buf); + /// tracer - Default implementation of tracer. Does nothing. /// - virtual void tracer() {} + virtual void tracer() { default_tracer(this); } /// print - Default implementation of print. /// - virtual void print(PrintBuffer *buf) const; + virtual void print(PrintBuffer *buf) const { default_print(this, buf); } /// hashCode - Default implementation of hashCode. Returns the address /// of this object. /// - virtual intptr_t hashCode(){ return (intptr_t)this;} + virtual intptr_t hashCode(){ return default_hashcode(this);} }; Modified: vmkit/trunk/lib/Mvm/Runtime/Object.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Runtime/Object.cpp?rev=84084&r1=84083&r2=84084&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Wed Oct 14 06:25:28 2009 @@ -48,9 +48,10 @@ buf->write(a); } -void Object::print(PrintBuffer *buf) const { +void Object::default_print(const gc *o, PrintBuffer *buf) { + llvm_gcroot(o, 0); buf->write("writePtr((void*)this); + buf->writePtr((void*)o); buf->write(">"); } Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=84084&r1=84083&r2=84084&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Wed Oct 14 06:25:28 2009 @@ -172,10 +172,6 @@ INIT(VMObject); INIT(CLIString); -#define INIT_ARRAY(name, elmt, nbb, printer, pre, sep, post) INIT(Array##name) - ON_ARRAY_CLASSES(INIT_ARRAY); -#undef INIT_ARRAY - #undef INIT } Modified: vmkit/trunk/lib/N3/VMCore/VMArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.h?rev=84084&r1=84083&r2=84084&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.h Wed Oct 14 06:25:28 2009 @@ -64,7 +64,6 @@ class Array##name : public VMObject { \ void *operator new(size_t n) { return VMObject::operator new(n, 0); } \ public: \ - static N3VirtualTable* VT; \ static const llvm::Type* llvmType; \ sint32 size; \ elmt elements[1]; \ Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=84084&r1=84083&r2=84084&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Wed Oct 14 06:25:28 2009 @@ -18,6 +18,8 @@ using namespace n3; +N3VirtualTable LockObj::_VT(LockObj::_destroy, 0, mvm::no_tracer, LockObj::_print, ) + void *N3VirtualTable::operator new(size_t size, size_t totalVtSize) { //printf("Allocate N3VirtualTable with %d elements\n", totalVtSize); return malloc(totalVtSize * sizeof(uintptr_t)); Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84084&r1=84083&r2=84084&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Wed Oct 14 06:25:28 2009 @@ -45,6 +45,7 @@ class LockObj : public mvm::Object { public: + static N3VirtualTable _VT; static N3VirtualTable* VT; mvm::LockRecursive lock; std::vector threads; @@ -53,6 +54,9 @@ virtual void print(mvm::PrintBuffer* buf) const; virtual void TRACER; + + static void _destroy(LockObj *); + static void _print(LockObj *); void notify(); void notifyAll(); Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84084&r1=84083&r2=84084&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Wed Oct 14 06:25:28 2009 @@ -29,10 +29,6 @@ INIT(VMObject); INIT(CLIString); -#define INIT_ARRAY(name, elmt, size, printer, pre, sep, post) INIT(Array##name); -ON_ARRAY_CLASSES(INIT_ARRAY) -#undef INIT_ARRAY - #undef INIT #ifdef MULTIPLE_GC From nicolas.geoffray at lip6.fr Wed Oct 14 04:39:30 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:39:30 -0000 Subject: [vmkit-commits] [vmkit] r84085 - /vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp Message-ID: <200910141139.n9EBdUSZ001627@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:39:30 2009 New Revision: 84085 URL: http://llvm.org/viewvc/llvm-project?rev=84085&view=rev Log: Add an assert. Modified: vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp Modified: vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp?rev=84085&r1=84084&r2=84085&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/JnJVM/Classpath/JavaUpcalls.cpp Wed Oct 14 06:39:30 2009 @@ -269,6 +269,7 @@ // Create the main thread void* Stat = threadGroup->getStaticInstance(); RG = rootGroup->getObjectField(Stat); + assert(RG && "No root group"); assert(vm->getMainThread() && "VM did not set its main thread"); CreateJavaThread(vm, (JavaThread*)vm->getMainThread(), "main", RG); From nicolas.geoffray at lip6.fr Wed Oct 14 04:41:25 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:41:25 -0000 Subject: [vmkit-commits] [vmkit] r84086 - /vmkit/trunk/lib/Mvm/Runtime/Object.cpp Message-ID: <200910141141.n9EBfPLh001697@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:41:25 2009 New Revision: 84086 URL: http://llvm.org/viewvc/llvm-project?rev=84086&view=rev Log: Put back printObject. 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=84086&r1=84085&r2=84086&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Runtime/Object.cpp (original) +++ vmkit/trunk/lib/Mvm/Runtime/Object.cpp Wed Oct 14 06:41:25 2009 @@ -36,6 +36,10 @@ fprintf(stderr, "%d\n", i); } +extern "C" void printObject(void* ptr) { + fprintf(stderr, "%p\n", ptr); +} + extern "C" void write_ptr(PrintBuffer* buf, void* obj) { buf->writePtr(obj); } From nicolas.geoffray at lip6.fr Wed Oct 14 04:44:23 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:44:23 -0000 Subject: [vmkit-commits] [vmkit] r84087 - in /vmkit/trunk: include/mvm/Threads/Thread.h lib/Mvm/MMTk/MutatorThread.cpp lib/Mvm/MMTk/MutatorThread.h lib/Mvm/MMTk/MvmGC.cpp lib/Mvm/MMTk/MvmGC.h Message-ID: <200910141144.n9EBiNlK001811@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:44:23 2009 New Revision: 84087 URL: http://llvm.org/viewvc/llvm-project?rev=84087&view=rev Log: More implementation of MMTk interface. Added: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Modified: vmkit/trunk/include/mvm/Threads/Thread.h vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h Modified: vmkit/trunk/include/mvm/Threads/Thread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=84087&r1=84086&r2=84087&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Thread.h (original) +++ vmkit/trunk/include/mvm/Threads/Thread.h Wed Oct 14 06:44:23 2009 @@ -121,7 +121,7 @@ /// start - Start the execution of a thread. /// - int start(void (*fct)(mvm::Thread*)); + virtual int start(void (*fct)(mvm::Thread*)); uint64_t getThreadID() { return (uint64_t)this; Modified: vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp?rev=84087&r1=84086&r2=84087&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp (original) +++ vmkit/trunk/lib/Mvm/MMTk/MutatorThread.cpp Wed Oct 14 06:44:23 2009 @@ -16,12 +16,8 @@ uint32_t MutatorThread::MMTkMutatorSize = 0; uint32_t MutatorThread::MMTkCollectorSize = 0; -void (*MutatorThread::MutatorInit)(uintptr_t) = 0; -void (*MutatorThread::CollectorInit)(uintptr_t) = 0; - -gc* (*gc::MMTkGCAllocator)(uintptr_t Mutator, uint32_t sz, uint32_t align, - uint32_t offset, uint32_t allocator, - uint32_t site); +MutatorThread::MMTkInitType MutatorThread::MutatorInit = 0; +MutatorThread::MMTkInitType MutatorThread::CollectorInit = 0; extern "C" void* MMTkMutatorAllocate(uint32_t size, VirtualTable* VT) { void* val = MutatorThread::get()->Allocator.Allocate(size, "MMTk"); Modified: vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h?rev=84087&r1=84086&r2=84087&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MutatorThread.h Wed Oct 14 06:44:23 2009 @@ -21,26 +21,40 @@ mvm::BumpPtrAllocator Allocator; uintptr_t MutatorContext; uintptr_t CollectorContext; + + /// realRoutine - The function to invoke when the thread starts. + /// + void (*realRoutine)(mvm::Thread*); + static uint32_t MMTkMutatorSize; static uint32_t MMTkCollectorSize; - static void (*MutatorInit)(uintptr_t); - static void (*CollectorInit)(uintptr_t); + typedef void (*MMTkInitType)(uintptr_t); + static MMTkInitType MutatorInit; + static MMTkInitType CollectorInit; - MutatorThread() { - MutatorContext = (uintptr_t)Allocator.Allocate(MMTkMutatorSize, "Mutator"); - MutatorInit(MutatorContext); - CollectorContext = - (uintptr_t)Allocator.Allocate(MMTkCollectorSize, "Collector"); - CollectorInit(CollectorContext); + static void init(Thread* _th) { + MutatorThread* th = (MutatorThread*)_th; + th->MutatorContext = + (uintptr_t)th->Allocator.Allocate(MMTkMutatorSize, "Mutator"); + MutatorInit(th->MutatorContext); + th->CollectorContext = + (uintptr_t)th->Allocator.Allocate(MMTkCollectorSize, "Collector"); + CollectorInit(th->CollectorContext); + th->realRoutine(_th); } static MutatorThread* get() { return (MutatorThread*)mvm::Thread::get(); } + virtual int start(void (*fct)(mvm::Thread*)) { + realRoutine = fct; + routine = init; + return Thread::start(init); + } }; } Added: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp?rev=84087&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp (added) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp Wed Oct 14 06:44:23 2009 @@ -0,0 +1,79 @@ +//===----------- MvmGC.cpp - Garbage Collection Interface -----------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#include "MvmGC.h" +#include "MutatorThread.h" + +#include + +using namespace mvm; + +gc::MMTkAllocType gc::MMTkGCAllocator = 0; +gc::MMTkPostAllocType gc::MMTkGCPostAllocator = 0; + + +static std::set Set; +static mvm::SpinLock lock; + +extern "C" gc* internalMalloc(uintptr_t Mutator, uint32_t sz, uint32_t align, + uint32_t offset, uint32_t allocator, + uint32_t site) { + + + gc* res = (gc*)malloc(sz); + memset(res, 0, sz); + + lock.acquire(); + Set.insert(res); + lock.release(); + + return res; +} + +void* Collector::begOf(gc* obj) { + if (gc::MMTkGCAllocator == internalMalloc) { + lock.acquire(); + std::set::iterator I = Set.find(obj); + std::set::iterator E = Set.end(); + lock.release(); + + if (I != E) return obj; + return 0; + } else { + abort(); + } +} + +extern "C" void fakeInit(uintptr_t) { +} + +void Collector::initialise() { + if (!gc::MMTkGCAllocator) { + gc::MMTkGCAllocator = internalMalloc; + MutatorThread::MMTkMutatorSize = 0; + MutatorThread::MMTkCollectorSize = 0; + MutatorThread::MutatorInit = fakeInit; + MutatorThread::CollectorInit = fakeInit; + } +} + +extern "C" void conditionalSafePoint() { + mvm::Thread::get()->startNative(1); + abort(); + mvm::Thread::get()->endNative(); +} + +extern "C" void* gcmalloc(size_t sz, VirtualTable* VT) { + mvm::Thread::get()->startNative(1); + void* res = gc::operator new(sz, VT); + mvm::Thread::get()->endNative(); + return res; +} + Added: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.h?rev=84087&view=auto ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.h (added) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Wed Oct 14 06:44:23 2009 @@ -0,0 +1,114 @@ +//===----------- MvmGC.h - Garbage Collection Interface -------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + + +#ifndef MVM_MMTK_GC_H +#define MVM_MMTK_GC_H + +#include "MutatorThread.h" +#include "mvm/VirtualMachine.h" +#include "mvm/GC/GC.h" + +#define gc_allocator std::allocator +#define gc_new(Class) __gc_new(Class::VT) Class +#define __gc_new new + + +#define TRACER tracer() +#define MARK_AND_TRACE markAndTrace() +#define CALL_TRACER tracer() + + + +class gc : public gcRoot { +public: + + void markAndTrace() const { + fprintf(stderr, "Implement mark and trace\n"); + abort(); + } + + size_t objectSize() const { + fprintf(stderr, "Implement object size\n"); + abort(); + return 0; + } + + typedef gc* (*MMTkAllocType)(uintptr_t Mutator, uint32_t sz, uint32_t align, + uint32_t offset, uint32_t allocator, + uint32_t site); + + typedef gc* (*MMTkPostAllocType)(uintptr_t Mutator, uintptr_t ref, + uintptr_t typeref, uint32_t bytes, + uint32_t allocator); + + static MMTkAllocType MMTkGCAllocator; + + static MMTkPostAllocType MMTkGCPostAllocator; + + + void* operator new(size_t sz, VirtualTable *VT) { + gc* res = (gc*)MMTkGCAllocator(mvm::MutatorThread::get()->MutatorContext, + sz, 0, 0, 0, 0); + res->setVirtualTable(VT); + + if (VT->destructor) { + mvm::Thread::get()->MyVM->addFinalizationCandidate(res); + } + return res; + } + +}; + +namespace mvm { + +class Collector { +public: + + static bool isLive(gc*) { + abort(); + } + + static void traceStackThread() { + abort(); + } + + static void scanObject(void*) { + abort(); + } + + static void collect() { + abort(); + } + + static void initialise(); + + static int getMaxMemory() { + return 0; + } + + static int getFreeMemory() { + return 0; + } + + static int getTotalMemory() { + return 0; + } + + void setMaxMemory(size_t sz){ + } + + void setMinMemory(size_t sz){ + } + + static void* begOf(gc*); +}; + +} +#endif From nicolas.geoffray at lip6.fr Wed Oct 14 04:46:09 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:46:09 -0000 Subject: [vmkit-commits] [vmkit] r84088 - /vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Message-ID: <200910141146.n9EBk9iY001912@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:46:09 2009 New Revision: 84088 URL: http://llvm.org/viewvc/llvm-project?rev=84088&view=rev Log: Be precise with LLVM_GCC. Modified: vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Modified: vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp?rev=84088&r1=84087&r2=84088&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp (original) +++ vmkit/trunk/lib/Mvm/GCMmap2/gc.cpp Wed Oct 14 06:46:09 2009 @@ -52,7 +52,7 @@ if (obj) { GCChunkNode *node = o2node(obj); -#if 0//def WITH_LLVM_GCC +#ifdef WITH_LLVM_GCC assert(node && "No node in precise GC mode"); #endif From nicolas.geoffray at lip6.fr Wed Oct 14 04:47:32 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:47:32 -0000 Subject: [vmkit-commits] [vmkit] r84089 - /vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Message-ID: <200910141147.n9EBlWCl002004@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:47:32 2009 New Revision: 84089 URL: http://llvm.org/viewvc/llvm-project?rev=84089&view=rev Log: Initialize MMTk fields with the JIT. 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=84089&r1=84088&r2=84089&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Wed Oct 14 06:47:32 2009 @@ -39,6 +39,7 @@ #include "mvm/Threads/Thread.h" #include "mvm/VirtualMachine.h" #include "mvm/GC/GC.h" +#include "MutatorThread.h" #include "MvmGC.h" using namespace mvm; @@ -92,7 +93,7 @@ InitializeNativeTarget(); executionEngine = ExecutionEngine::createJIT(globalModuleProvider, 0, - 0, level); + 0, level, false); std::string str = executionEngine->getTargetData()->getStringRepresentation(); @@ -123,6 +124,42 @@ loadBytecodeFile(*i); } +#ifdef WITH_MMTK + llvm::GlobalVariable* GV = globalModule->getGlobalVariable("MMTkCollectorSize", false); + if (GV && executionEngine) { + ConstantInt* C = dyn_cast(GV->getInitializer()); + uint64_t val = C->getZExtValue(); + MutatorThread::MMTkCollectorSize = val; + + GV = globalModule->getGlobalVariable("MMTkMutatorSize", false); + assert(GV && "Could not find MMTkMutatorSize"); + C = dyn_cast(GV->getInitializer()); + val = C->getZExtValue(); + MutatorThread::MMTkMutatorSize = val; + + Function* F = globalModule->getFunction("JnJVM_org_j3_config_Selected_00024Mutator__0003Cinit_0003E__"); + assert(F && "Could not find from Mutator"); + MutatorThread::MutatorInit = (MutatorThread::MMTkInitType) + (uintptr_t)executionEngine->getPointerToFunction(F); + + F = globalModule->getFunction("JnJVM_org_j3_config_Selected_00024Collector__0003Cinit_0003E__"); + assert(F && "Could not find from Collector"); + MutatorThread::CollectorInit = (MutatorThread::MMTkInitType) + (uintptr_t)executionEngine->getPointerToFunction(F); + + GlobalAlias* GA = dyn_cast(globalModule->getNamedValue("MMTkAlloc")); + assert(GA && "Could not find MMTkAlloc alias"); + F = dyn_cast(GA->getAliasee()); + gc::MMTkGCAllocator = (gc::MMTkAllocType) + (uintptr_t)executionEngine->getPointerToFunction(F); + + GA = dyn_cast(globalModule->getNamedValue("MMTkPostAlloc")); + assert(GA && "Could not find MMTkPostAlloc alias"); + F = dyn_cast(GA->getAliasee()); + gc::MMTkGCPostAllocator = (gc::MMTkPostAllocType) + (uintptr_t)executionEngine->getPointerToFunction(F); + } +#endif } From gael.thomas at lip6.fr Wed Oct 14 04:48:09 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 11:48:09 -0000 Subject: [vmkit-commits] [vmkit] r84090 - in /vmkit/trunk: include/mvm/PrintBuffer.h lib/N3/VMCore/CLIJit.cpp lib/N3/VMCore/CLIString.h lib/N3/VMCore/N3Initialise.cpp lib/N3/VMCore/VMObject.cpp lib/N3/VMCore/VMObject.h lib/N3/VMCore/VirtualTables.cpp Message-ID: <200910141148.n9EBm9JA002038@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 06:48:08 2009 New Revision: 84090 URL: http://llvm.org/viewvc/llvm-project?rev=84090&view=rev Log: LockObj defines its vt with N3VirtualTable. CLIString does not define any vt. Modified: vmkit/trunk/include/mvm/PrintBuffer.h vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/mvm/PrintBuffer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=84090&r1=84089&r2=84090&view=diff ============================================================================== --- vmkit/trunk/include/mvm/PrintBuffer.h (original) +++ vmkit/trunk/include/mvm/PrintBuffer.h Wed Oct 14 06:48:08 2009 @@ -54,6 +54,12 @@ writeObj(obj); } + PrintBuffer(const Object *obj) { + llvm_gcroot(obj, 0); + init(); + writeObj(obj); + } + virtual ~PrintBuffer() { delete contents; } @@ -145,7 +151,7 @@ return this; } - /// writeObj - Writes an Object to the buffer. + /// writeObj - Writes anything (except an object) to the buffer. /// template inline PrintBuffer *writeObj(const T *obj) { @@ -153,6 +159,14 @@ return this; } + /// writeObj - Writes a gc Object to the buffer. + /// + inline PrintBuffer *writeObj(const Object *obj) { + llvm_gcroot(obj, 0); + obj->print(this); + return this; + } + /// replaceWith - replace the content of the buffer and free the old buffer /// Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84090&r1=84089&r2=84090&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Wed Oct 14 06:48:08 2009 @@ -143,7 +143,8 @@ N3VirtualTable* CLIJit::makeArrayVT(VMClassArray* cl) { VMClass *super = (VMClass*)cl->super; - N3VirtualTable * res = new(super->vtSize) N3VirtualTable(super->virtualInstance->getN3VirtualTable(), super->vtSize); + N3VirtualTable * res = + new(cl->assembly->allocator, super->vtSize) N3VirtualTable(super->virtualInstance->getN3VirtualTable(), super->vtSize); #ifdef WITH_TRACER Function* func = Function::Create(markAndTraceLLVMType, @@ -254,8 +255,8 @@ int n = N3VirtualTable::baseVtSize(); N3VirtualTable * res = stat || !cl->super ? - new(n) N3VirtualTable(VMObject::VT, n) : - new(cl->vtSize) N3VirtualTable(((VMClass *)cl->super)->virtualInstance->getN3VirtualTable(), n, cl->vtSize); + new(cl->assembly->allocator, n) N3VirtualTable(VMObject::VT, n) : + new(cl->assembly->allocator, cl->vtSize) N3VirtualTable(((VMClass *)cl->super)->virtualInstance->getN3VirtualTable(), n, cl->vtSize); #ifdef WITH_TRACER Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=84090&r1=84089&r2=84090&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Wed Oct 14 06:48:08 2009 @@ -23,12 +23,12 @@ class ArrayChar; class CLIString : public VMObject { + CLIString() {} public: static N3VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLI string"); } - virtual void TRACER; llvm::GlobalVariable* llvmVar(); Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=84090&r1=84089&r2=84090&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Wed Oct 14 06:48:08 2009 @@ -168,9 +168,7 @@ } #endif - INIT(LockObj); INIT(VMObject); - INIT(CLIString); #undef INIT Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=84090&r1=84089&r2=84090&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Wed Oct 14 06:48:08 2009 @@ -18,11 +18,16 @@ using namespace n3; -N3VirtualTable LockObj::_VT(LockObj::_destroy, 0, mvm::no_tracer, LockObj::_print, ) +N3VirtualTable LockObj::_VT((uintptr_t)LockObj::_destroy, + (uintptr_t)0, + (uintptr_t)mvm::Object::default_tracer, + (uintptr_t)LockObj::_print, + (uintptr_t)mvm::Object::default_hashcode); +N3VirtualTable *LockObj::VT = &_VT; -void *N3VirtualTable::operator new(size_t size, size_t totalVtSize) { +void *N3VirtualTable::operator new(size_t size, mvm::BumpPtrAllocator &allocator, size_t totalVtSize) { //printf("Allocate N3VirtualTable with %d elements\n", totalVtSize); - return malloc(totalVtSize * sizeof(uintptr_t)); + return allocator.Allocate(totalVtSize * sizeof(uintptr_t), "N3VirtualTable"); } N3VirtualTable::N3VirtualTable() { @@ -46,6 +51,21 @@ this->lockObj = 0; } + +LockObj* LockObj::allocate() { + LockObj* res = gc_new(LockObj)(); + return res; +} + +void LockObj::_print(const LockObj *self, mvm::PrintBuffer* buf) { + llvm_gcroot(self, 0); + buf->write("Lock<>"); +} + +void LockObj::_destroy(LockObj *self) { + llvm_gcroot(self, 0); +} + void LockObj::notify() { for (std::vector::iterator i = threads.begin(), e = threads.end(); i!= e; ++i) { @@ -93,15 +113,6 @@ } } -void LockObj::print(mvm::PrintBuffer* buf) const { - buf->write("Lock<>"); -} - -LockObj* LockObj::allocate() { - LockObj* res = gc_new(LockObj)(); - return res; -} - void LockObj::aquire() { lock.lock(); } Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84090&r1=84089&r2=84090&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Wed Oct 14 06:48:08 2009 @@ -34,7 +34,7 @@ uintptr_t print; uintptr_t hashcode; - void *operator new(size_t size, size_t totalVtSize); + void *operator new(size_t size, mvm::BumpPtrAllocator &allocator, size_t totalVtSize); N3VirtualTable(); N3VirtualTable(N3VirtualTable *vmobjVt, uint32 baseVtSize, uint32 totalVtSize=-1); @@ -52,11 +52,8 @@ static LockObj* allocate(); - virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; - static void _destroy(LockObj *); - static void _print(LockObj *); + static void _print(const LockObj *, mvm::PrintBuffer *); void notify(); void notifyAll(); Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84090&r1=84089&r2=84090&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Wed Oct 14 06:48:08 2009 @@ -25,7 +25,6 @@ #define INIT(X) N3VirtualTable* X::VT = 0 -INIT(LockObj); INIT(VMObject); INIT(CLIString); @@ -40,17 +39,10 @@ } // N3 Objects -void LockObj::TRACER { -} - void VMObject::TRACER { lockObj->MARK_AND_TRACE; } -void CLIString::TRACER { - VMObject::CALL_TRACER; -} - #define TRACE_VECTOR(type, name, alloc) { \ for (std::vector >::iterator i = name.begin(), e = name.end(); \ i!= e; ++i) { \ From nicolas.geoffray at lip6.fr Wed Oct 14 04:48:35 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:48:35 -0000 Subject: [vmkit-commits] [vmkit] r84091 - /vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Message-ID: <200910141148.n9EBmZEk002059@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:48:35 2009 New Revision: 84091 URL: http://llvm.org/viewvc/llvm-project?rev=84091&view=rev Log: Initialize internalPendingException to zero. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp?rev=84091&r1=84090&r2=84091&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.cpp Wed Oct 14 06:48:35 2009 @@ -33,6 +33,7 @@ interruptFlag = 0; state = StateRunning; pendingException = 0; + internalPendingException = 0; jniEnv = isolate->jniEnv; localJNIRefs = new JNILocalReferences(); currentAddedReferences = 0; From nicolas.geoffray at lip6.fr Wed Oct 14 04:49:53 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:49:53 -0000 Subject: [vmkit-commits] [vmkit] r84092 - /vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll Message-ID: <200910141149.n9EBnreh002104@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:49:53 2009 New Revision: 84092 URL: http://llvm.org/viewvc/llvm-project?rev=84092&view=rev Log: Update std::vector type. Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll?rev=84092&r1=84091&r2=84092&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll (original) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default-thread.ll Wed Oct 14 06:49:53 2009 @@ -1,4 +1,4 @@ -%Vector = type {i32, i8*, i8*} +%Vector = type {i8*, i8*, i8*} ;;; Field 0: the VT of threads ;;; Field 1: next From nicolas.geoffray at lip6.fr Wed Oct 14 04:50:22 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:50:22 -0000 Subject: [vmkit-commits] [vmkit] r84093 - /vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll Message-ID: <200910141150.n9EBoMqI002132@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:50:22 2009 New Revision: 84093 URL: http://llvm.org/viewvc/llvm-project?rev=84093&view=rev Log: Update types. Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll?rev=84093&r1=84092&r2=84093&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll (original) +++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-mmtk-thread.ll Wed Oct 14 06:50:22 2009 @@ -1,5 +1,5 @@ -%Vector = type {i32, i8*, i8*} -%BumpPtrAllocator = type { i32, i32, i8*, i8*, i8*, i8*, i32 } +%Vector = type {i8*, i8*, i8*} +%BumpPtrAllocator = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8* } ;;; Field 0: the VT of threads ;;; Field 1: next @@ -18,4 +18,5 @@ ;;; field 14: MutatorContext ;;; field 15: CollectorContext %MutatorThread = type { %VT*, %JavaThread*, %JavaThread*, i8*, i8*, i8*, i1, i1, - i1, i8*, i8*, i8*, %Vector, %BumpPtrAllocator, i8*, i8* } + i1, i8*, i8*, i8*, %Vector, %BumpPtrAllocator, i8*, i8*, + i8* } From nicolas.geoffray at lip6.fr Wed Oct 14 04:51:12 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:51:12 -0000 Subject: [vmkit-commits] [vmkit] r84094 - /vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Message-ID: <200910141151.n9EBpC6S002163@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:51:11 2009 New Revision: 84094 URL: http://llvm.org/viewvc/llvm-project?rev=84094&view=rev Log: Create aliases and global variables with simple names for VMKit/MMTk interface. Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerJavaRT.cpp?rev=84094&r1=84093&r2=84094&view=diff ============================================================================== --- vmkit/trunk/mmtk/magic/LowerJavaRT.cpp (original) +++ vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Wed Oct 14 06:51:11 2009 @@ -16,10 +16,10 @@ #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" #include "jnjvm/JnjvmModule.h" -#include using namespace llvm; @@ -60,8 +60,68 @@ GV.eraseFromParent(); } } + + // Replace gcmalloc with the allocator of MMTk objects in VMKit + Function* F = M.getFunction("gcmalloc"); + + Function* NewFunction = + Function::Create(F->getFunctionType(), GlobalValue::ExternalLinkage, + "MMTkMutatorAllocate", &M); + + F->replaceAllUsesWith(NewFunction); + F->eraseFromParent(); + + // Declare two global variables for allocating a MutatorContext object + // and a CollectorContext object. + + const Type* Ty = IntegerType::getInt32Ty(M.getContext()); + GlobalVariable* GV = M.getGlobalVariable("org_j3_config_Selected_4Collector", + false); + Constant* C = GV->getInitializer(); + C = C->getOperand(1); + new GlobalVariable(M, Ty, true, GlobalValue::ExternalLinkage, + C, "MMTkCollectorSize"); + + + GV = M.getGlobalVariable("org_j3_config_Selected_4Mutator", false); + C = GV->getInitializer(); + C = C->getOperand(1); + new GlobalVariable(M, Ty, true, GlobalValue::ExternalLinkage, + C, "MMTkMutatorSize"); + + + GV = M.getGlobalVariable("org_mmtk_plan_MutatorContext_VT", false); + ConstantArray* CA = dyn_cast(GV->getInitializer()); + + Function* Alloc = M.getFunction("JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII"); + Function* PostAlloc = M.getFunction("JnJVM_org_mmtk_plan_MutatorContext_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II"); + uint32_t AllocIndex = 0; + uint32_t PostAllocIndex = 0; + for (uint32_t i = 0; i < CA->getNumOperands(); ++i) { + ConstantExpr* CE = dyn_cast(CA->getOperand(i)); + if (CE) { + C = CE->getOperand(0); + if (C == Alloc) { + AllocIndex = i; + } else if (C == PostAlloc) { + PostAllocIndex = i; + } + } + } + GV = M.getGlobalVariable("org_j3_config_Selected_4Mutator_VT", false); + CA = dyn_cast(GV->getInitializer()); + C = CA->getOperand(AllocIndex); + C = C->getOperand(0); + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, "MMTkAlloc", + C, &M); + + C = CA->getOperand(PostAllocIndex); + C = C->getOperand(0); + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, "MMTkPostAlloc", + C, &M); + return Changed; } From nicolas.geoffray at lip6.fr Wed Oct 14 04:52:14 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:52:14 -0000 Subject: [vmkit-commits] [vmkit] r84095 - in /vmkit/trunk/mmtk: java/src/org/j3/config/Selected.java java/src/org/j3/mmtk/BuildTimeConfig.java mmtk-j3/ActivePlan.cpp mmtk-j3/Collection.cpp mmtk-j3/FinalizableProcessor.cpp mmtk-j3/ObjectModel.cpp mmtk-j3/ReferenceProcessor.cpp mmtk-j3/Scanning.cpp mmtk-j3/Selected.cpp Message-ID: <200910141152.n9EBqEGi002209@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:52:13 2009 New Revision: 84095 URL: http://llvm.org/viewvc/llvm-project?rev=84095&view=rev Log: Update MMTk interface. Modified: vmkit/trunk/mmtk/java/src/org/j3/config/Selected.java vmkit/trunk/mmtk/java/src/org/j3/mmtk/BuildTimeConfig.java 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/ObjectModel.cpp vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp vmkit/trunk/mmtk/mmtk-j3/Selected.cpp Modified: vmkit/trunk/mmtk/java/src/org/j3/config/Selected.java URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/config/Selected.java?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/src/org/j3/config/Selected.java (original) +++ vmkit/trunk/mmtk/java/src/org/j3/config/Selected.java Wed Oct 14 06:52:13 2009 @@ -52,6 +52,8 @@ { private static final Mutator bootstrapThread = new Mutator(); + public Mutator() {} + @Inline public static native Mutator get(); } Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/BuildTimeConfig.java URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/mmtk/BuildTimeConfig.java?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/java/src/org/j3/mmtk/BuildTimeConfig.java (original) +++ vmkit/trunk/mmtk/java/src/org/j3/mmtk/BuildTimeConfig.java Wed Oct 14 06:52:13 2009 @@ -49,17 +49,16 @@ */ private Properties getProperties(String property_file_property, String default_property_file) { Properties props = new Properties(); - return props; - /*String propFileName; + String propFileName; if (default_property_file == null) { propFileName = System.getProperty(property_file_property); if (propFileName == null) { System.err.println(property_file_property+" must specify a properties file"); VM.sysExit(1); - } + } } else { propFileName = System.getProperty(property_file_property, default_property_file); - } + } File propFile = new File(propFileName); try { @@ -70,12 +69,12 @@ if (!propFileName.equals(default_property_file)) { System.err.println(propFileName+" not found."); VM.sysExit(1); - } + } } catch (IOException e) { e.printStackTrace(); VM.sysExit(1); - } - return props;*/ + } + return props; } @Override Modified: vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ActivePlan.cpp Wed Oct 14 06:52:13 2009 @@ -12,11 +12,11 @@ using namespace jnjvm; extern "C" JavaObject* Java_org_j3_mmtk_ActivePlan_getNextMutator__ (JavaObject* A) { - return 0; + abort(); } extern "C" void Java_org_j3_mmtk_ActivePlan_resetMutatorIterator__ (JavaObject* A) { - return; + abort(); } extern "C" void Java_org_j3_mmtk_ActivePlan_collectorCount__ () { abort(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Wed Oct 14 06:52:13 2009 @@ -19,28 +19,31 @@ extern "C" bool Java_org_j3_mmtk_Collection_isEmergencyAllocation__ (JavaObject* C) { - return false; + abort(); } extern "C" void Java_org_j3_mmtk_Collection_reportAllocationSuccess__ (JavaObject* C) { + abort(); } extern "C" void Java_org_j3_mmtk_Collection_triggerCollection__I (JavaObject* C, int why) { + abort(); JnJVM_org_mmtk_plan_Plan_setCollectionTriggered__(); JnJVM_org_j3_config_Selected_00024Collector_staticCollect__(); JnJVM_org_mmtk_plan_Plan_collectionComplete__(); } extern "C" int Java_org_j3_mmtk_Collection_rendezvous__I (JavaObject* C, int where) { - return 1; + abort(); } extern "C" int Java_org_j3_mmtk_Collection_maximumCollectionAttempt__ (JavaObject* C) { - return 1; + abort(); } extern "C" void Java_org_j3_mmtk_Collection_prepareCollector__Lorg_mmtk_plan_CollectorContext_2 (JavaObject* C, JavaObject* CC) { + abort(); } Modified: vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/FinalizableProcessor.cpp Wed Oct 14 06:52:13 2009 @@ -23,4 +23,5 @@ extern "C" void Java_org_j3_mmtk_FinalizableProcessor_scan__Lorg_mmtk_plan_TraceLocal_2Z () { + abort(); } Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Wed Oct 14 06:52:13 2009 @@ -20,10 +20,12 @@ } extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_readAvailableBitsWord__Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* OM, JavaObject* obj) { + abort(); 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) { + abort(); ((uintptr_t*)obj)[1] = val; } Modified: vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ReferenceProcessor.cpp Wed Oct 14 06:52:13 2009 @@ -13,6 +13,7 @@ using namespace jnjvm; extern "C" void Java_org_j3_mmtk_ReferenceProcessor_scan__Lorg_mmtk_plan_TraceLocal_2Z () { + abort(); } extern "C" void Java_org_j3_mmtk_ReferenceProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z () { abort(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Scanning.cpp Wed Oct 14 06:52:13 2009 @@ -12,15 +12,19 @@ using namespace jnjvm; extern "C" void Java_org_j3_mmtk_Scanning_computeThreadRoots__Lorg_mmtk_plan_TraceLocal_2 () { + abort(); } extern "C" void Java_org_j3_mmtk_Scanning_computeGlobalRoots__Lorg_mmtk_plan_TraceLocal_2 () { + abort(); } extern "C" void Java_org_j3_mmtk_Scanning_computeStaticRoots__Lorg_mmtk_plan_TraceLocal_2 () { + abort(); } extern "C" void Java_org_j3_mmtk_Scanning_resetThreadCounter__ () { + abort(); } extern "C" void Java_org_j3_mmtk_Scanning_scanObject__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2 () { abort(); } Modified: vmkit/trunk/mmtk/mmtk-j3/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Selected.cpp?rev=84095&r1=84094&r2=84095&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Selected.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Selected.cpp Wed Oct 14 06:52:13 2009 @@ -14,29 +14,12 @@ using namespace jnjvm; -#if 1 - -extern "C" JavaObject* org_j3_config_Selected_4Mutator_static; -extern "C" JavaObject* org_j3_config_Selected_4Collector_static; - - -extern "C" JavaObject* Java_org_j3_config_Selected_00024Collector_get__() { - JavaObject* obj = org_j3_config_Selected_4Collector_static; - return obj; -} - -extern "C" JavaObject* Java_org_j3_config_Selected_00024Mutator_get__() { - JavaObject* obj = org_j3_config_Selected_4Mutator_static; - return obj; -} - - -#else extern "C" JavaObject* Java_org_j3_config_Selected_00024Collector_get__() { + abort(); return 0; } extern "C" JavaObject* Java_org_j3_config_Selected_00024Mutator_get__() { + abort(); return 0; } -#endif From nicolas.geoffray at lip6.fr Wed Oct 14 04:53:23 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 14 Oct 2009 11:53:23 -0000 Subject: [vmkit-commits] [vmkit] r84096 - /vmkit/trunk/ Message-ID: <200910141153.n9EBrN9R002252@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 14 06:53:22 2009 New Revision: 84096 URL: http://llvm.org/viewvc/llvm-project?rev=84096&view=rev Log: Add some svn:ignore. Modified: vmkit/trunk/ (props changed) Propchange: vmkit/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Wed Oct 14 06:53:22 2009 @@ -8,3 +8,6 @@ configure.out config.status Makefile.common +Release-Asserts +Debug + From gael.thomas at lip6.fr Wed Oct 14 07:33:21 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 14:33:21 -0000 Subject: [vmkit-commits] [vmkit] r84097 - in /vmkit/trunk: include/mvm/Object.h lib/N3/VMCore/CLIJit.cpp lib/N3/VMCore/CLIString.h lib/N3/VMCore/N3Initialise.cpp lib/N3/VMCore/VMObject.cpp lib/N3/VMCore/VMObject.h lib/N3/VMCore/VirtualTables.cpp Message-ID: <200910141433.n9EEXMVP008362@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 09:33:20 2009 New Revision: 84097 URL: http://llvm.org/viewvc/llvm-project?rev=84097&view=rev Log: The vt of N3Object is dynamically built in makeVT. Remove the last vts (except LockObj). Modified: vmkit/trunk/include/mvm/Object.h vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIString.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/include/mvm/Object.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Object.h?rev=84097&r1=84096&r2=84097&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Object.h (original) +++ vmkit/trunk/include/mvm/Object.h Wed Oct 14 09:33:20 2009 @@ -33,7 +33,7 @@ class Object : public gc { public: static void default_tracer(gc *o) {} - static intptr_t default_hashcode(gc *o) { return (intptr_t)o; } + static intptr_t default_hashCode(const gc *o) { return (intptr_t)o; } static void default_print(const gc *o, PrintBuffer *buf); /// tracer - Default implementation of tracer. Does nothing. @@ -47,7 +47,7 @@ /// hashCode - Default implementation of hashCode. Returns the address /// of this object. /// - virtual intptr_t hashCode(){ return default_hashcode(this);} + virtual intptr_t hashCode() const { return default_hashCode(this);} }; Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84097&r1=84096&r2=84097&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Wed Oct 14 09:33:20 2009 @@ -240,11 +240,11 @@ #endif #define CASE_ARRAY(name, elmt, nbb, printer, pre, sep, post) \ - else if(cl->baseClass == MSCorlib::p##name) { \ + if(cl->baseClass == MSCorlib::p##name) { \ ((void**)res)[VT_PRINT_OFFSET] = ((void **)(unsigned int)Array##name::do_print); \ - } + } else - if(0) {} ON_ARRAY_CLASSES(CASE_ARRAY) + ON_ARRAY_CLASSES(CASE_ARRAY) {} #undef CASE_ARRAY @@ -254,9 +254,19 @@ N3VirtualTable* CLIJit::makeVT(VMClass* cl, bool stat) { int n = N3VirtualTable::baseVtSize(); N3VirtualTable * res = - stat || !cl->super ? - new(cl->assembly->allocator, n) N3VirtualTable(VMObject::VT, n) : - new(cl->assembly->allocator, cl->vtSize) N3VirtualTable(((VMClass *)cl->super)->virtualInstance->getN3VirtualTable(), n, cl->vtSize); + stat ? new(cl->assembly->allocator, n) N3VirtualTable((uintptr_t)0, + (uintptr_t)0, + (uintptr_t)VMObject::_trace, + (uintptr_t)VMObject::_print, + (uintptr_t)mvm::Object::default_hashCode) : ( + cl->super ? new(cl->assembly->allocator, cl->vtSize) N3VirtualTable(((VMClass *)cl->super)->virtualInstance->getN3VirtualTable(), + n, + cl->vtSize) : + new(cl->assembly->allocator, cl->vtSize) N3VirtualTable((uintptr_t)0, + (uintptr_t)0, + (uintptr_t)VMObject::_trace, + (uintptr_t)VMObject::_print, + (uintptr_t)mvm::Object::default_hashCode)); #ifdef WITH_TRACER Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=84097&r1=84096&r2=84097&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Wed Oct 14 09:33:20 2009 @@ -25,7 +25,6 @@ class CLIString : public VMObject { CLIString() {} public: - static N3VirtualTable* VT; virtual void print(mvm::PrintBuffer* buf) const { buf->write("CLI string"); } Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=84097&r1=84096&r2=84097&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Wed Oct 14 09:33:20 2009 @@ -154,24 +154,6 @@ #undef DEFINE_ARRAY_LLVM_TYPE static void initialiseVT() { - -#if defined(WITHOUT_FINALIZER) -# define INIT(X) { \ - X fake; \ - X::VT = ((N3VirtualTable**)(void*)(&fake))[0]; \ - } -#else -# define INIT(X) { \ - X fake; \ - X::VT = ((N3VirtualTable**)(void*)(&fake))[0]; \ - ((void**)X::VT)[0] = 0; \ - } -#endif - - INIT(VMObject); - -#undef INIT - } VMThread* VMThread::TheThread = 0; Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=84097&r1=84096&r2=84097&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Wed Oct 14 09:33:20 2009 @@ -22,8 +22,7 @@ (uintptr_t)0, (uintptr_t)mvm::Object::default_tracer, (uintptr_t)LockObj::_print, - (uintptr_t)mvm::Object::default_hashcode); -N3VirtualTable *LockObj::VT = &_VT; + (uintptr_t)mvm::Object::default_hashCode); void *N3VirtualTable::operator new(size_t size, mvm::BumpPtrAllocator &allocator, size_t totalVtSize) { //printf("Allocate N3VirtualTable with %d elements\n", totalVtSize); @@ -39,7 +38,7 @@ N3VirtualTable::N3VirtualTable(uintptr_t d, uintptr_t o, uintptr_t t, uintptr_t p, uintptr_t h) : VirtualTable(d, o, t) { print = p; - hashcode = h; + hashCode = h; } uint32 N3VirtualTable::baseVtSize() { @@ -53,7 +52,7 @@ LockObj* LockObj::allocate() { - LockObj* res = gc_new(LockObj)(); + LockObj* res = new(&_VT) LockObj(); return res; } @@ -125,18 +124,15 @@ return lock.selfOwner(); } -void VMObject::print(mvm::PrintBuffer* buf) const { +void VMObject::_print(const VMObject *self, mvm::PrintBuffer* buf) { + llvm_gcroot(self, 0); buf->write("VMObject<"); - classOf->print(buf); + self->classOf->print(buf); + buf->write("@0x"); + buf->writePtr((void*)self->hashCode()); buf->write(">"); } -VMObject* VMObject::allocate(VMCommonClass* cl) { - VMObject* res = gc_new(VMObject)(); - res->classOf = cl; - return res; -} - static LockObj* myLock(VMObject* obj) { verifyNull(obj); if (obj->lockObj == 0) { Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84097&r1=84096&r2=84097&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Wed Oct 14 09:33:20 2009 @@ -32,7 +32,7 @@ struct N3VirtualTable : VirtualTable { uintptr_t print; - uintptr_t hashcode; + uintptr_t hashCode; void *operator new(size_t size, mvm::BumpPtrAllocator &allocator, size_t totalVtSize); @@ -46,7 +46,6 @@ class LockObj : public mvm::Object { public: static N3VirtualTable _VT; - static N3VirtualTable* VT; mvm::LockRecursive lock; std::vector threads; @@ -69,17 +68,15 @@ class VMObject : public mvm::Object { public: - static N3VirtualTable* VT; VMCommonClass* classOf; LockObj* lockObj; static mvm::Lock* globalLock; static const llvm::Type* llvmType; + + static void _print(const VMObject *, mvm::PrintBuffer *); + static void _trace(VMObject *); - virtual void print(mvm::PrintBuffer* buf) const; - virtual void TRACER; - - static VMObject* allocate(VMCommonClass* cl); void aquire(); void unlock(); void waitIntern(struct timeval *info, bool timed); Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84097&r1=84096&r2=84097&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Wed Oct 14 09:33:20 2009 @@ -23,24 +23,14 @@ using namespace n3; -#define INIT(X) N3VirtualTable* X::VT = 0 - -INIT(VMObject); -INIT(CLIString); - -#undef INIT - -#ifdef MULTIPLE_GC -extern "C" void CLIObjectTracer(VMObject* obj, Collector* GC) { -#else extern "C" void CLIObjectTracer(VMObject* obj) { -#endif - obj->lockObj->MARK_AND_TRACE; + VMObject::_trace(obj); } // N3 Objects -void VMObject::TRACER { - lockObj->MARK_AND_TRACE; +void VMObject::_trace(VMObject *self) { + llvm_gcroot(self, 0); + self->lockObj->MARK_AND_TRACE; } #define TRACE_VECTOR(type, name, alloc) { \ From gael.thomas at lip6.fr Wed Oct 14 09:51:22 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 16:51:22 -0000 Subject: [vmkit-commits] [vmkit] r84112 - in /vmkit/trunk/lib/N3: Mono/Mono.cpp VMCore/CLIJit.cpp VMCore/VMObject.cpp VMCore/VMObject.h Message-ID: <200910141651.n9EGpM1j013943@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 11:51:21 2009 New Revision: 84112 URL: http://llvm.org/viewvc/llvm-project?rev=84112&view=rev Log: All access to VMObject::lockObj are safe (use llvm_gcroot) Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=84112&r1=84111&r2=84112&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Wed Oct 14 11:51:21 2009 @@ -119,7 +119,7 @@ extern "C" void System_Threading_Monitor_Monitor_exit(VMObject* obj) { // TODO: There's a bug in the bootstrap, see why - if (obj->lockObj->owner()) obj->unlock(); + if (LockObj::owner(obj->lockObj)) obj->unlock(); } extern "C" bool System_Threading_Monitor_Monitor_try_enter(VMObject* obj, int ms) { Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84112&r1=84111&r2=84112&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Wed Oct 14 11:51:21 2009 @@ -240,7 +240,7 @@ #endif #define CASE_ARRAY(name, elmt, nbb, printer, pre, sep, post) \ - if(cl->baseClass == MSCorlib::p##name) { \ + if(cl->baseClass == MSCorlib::p##name) { \ ((void**)res)[VT_PRINT_OFFSET] = ((void **)(unsigned int)Array##name::do_print); \ } else Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=84112&r1=84111&r2=84112&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Wed Oct 14 11:51:21 2009 @@ -45,14 +45,11 @@ return sizeof(N3VirtualTable) / sizeof(uintptr_t); } -void VMObject::initialise(VMCommonClass* cl) { - this->classOf = cl; - this->lockObj = 0; -} - LockObj* LockObj::allocate() { - LockObj* res = new(&_VT) LockObj(); + declare_gcroot(LockObj*, res) = new(&_VT) LockObj(); + res->threads = new std::vector(); + res->lock = new mvm::LockRecursive(); return res; } @@ -63,11 +60,14 @@ void LockObj::_destroy(LockObj *self) { llvm_gcroot(self, 0); + delete self->threads; + delete self->lock; } -void LockObj::notify() { - for (std::vector::iterator i = threads.begin(), - e = threads.end(); i!= e; ++i) { +void LockObj::notify(LockObj *self) { + llvm_gcroot(self, 0); + for (std::vector::iterator i = self->threads->begin(), + e = self->threads->end(); i!= e; ++i) { VMThread* cur = *i; cur->lock->lock(); if (cur->interruptFlag != 0) { @@ -78,50 +78,61 @@ if (th != 0) { cur->varcond->signal(); cur->lock->unlock(); - threads.erase(i); + self->threads->erase(i); break; } else { // dead thread - threads.erase(i); + self->threads->erase(i); } } } } -void LockObj::notifyAll() { - for (std::vector::iterator i = threads.begin(), - e = threads.end(); i!= e; ++i) { +void LockObj::notifyAll(LockObj *self) { + llvm_gcroot(self, 0); + for (std::vector::iterator i = self->threads->begin(), + e = self->threads->end(); i!= e; ++i) { VMThread* cur = *i; cur->lock->lock(); cur->varcond->signal(); cur->lock->unlock(); - threads.erase(i); + self->threads->erase(i); } } -void LockObj::wait(VMThread* th) { - threads.push_back(th); +void LockObj::wait(LockObj *self, VMThread* th) { + llvm_gcroot(self, 0); + self->threads->push_back(th); } -void LockObj::remove(VMThread* th) { - for (std::vector::iterator i = threads.begin(), - e = threads.end(); i!= e; ++i) { +void LockObj::remove(LockObj *self, VMThread* th) { + llvm_gcroot(self, 0); + for (std::vector::iterator i = self->threads->begin(), + e = self->threads->end(); i!= e; ++i) { if (*i == th) { - threads.erase(i); + self->threads->erase(i); break; } } } -void LockObj::aquire() { - lock.lock(); +void LockObj::aquire(LockObj *self) { + llvm_gcroot(self, 0); + self->lock->lock(); +} + +void LockObj::release(LockObj *self) { + llvm_gcroot(self, 0); + self->lock->unlock(); } -void LockObj::release() { - lock.unlock(); +bool LockObj::owner(LockObj *self) { + llvm_gcroot(self, 0); + return self->lock->selfOwner(); } -bool LockObj::owner() { - return lock.selfOwner(); +void VMObject::initialise(VMCommonClass* cl) { + this->classOf = cl; + this->lockObj = 0; } void VMObject::_print(const VMObject *self, mvm::PrintBuffer* buf) { @@ -134,29 +145,35 @@ } static LockObj* myLock(VMObject* obj) { + llvm_gcroot(obj, 0); verifyNull(obj); - if (obj->lockObj == 0) { + declare_gcroot(LockObj*, lock) = obj->lockObj; + if (lock == 0) { VMObject::globalLock->lock(); - if (obj->lockObj == 0) { - obj->lockObj = LockObj::allocate(); + lock = obj->lockObj; + if (lock == 0) { + lock = LockObj::allocate(); + obj->lockObj = lock; } VMObject::globalLock->unlock(); } - return obj->lockObj; + return lock; } void VMObject::aquire() { - myLock(this)->aquire(); + declare_gcroot(LockObj*, lock) = myLock(this); + LockObj::aquire(lock); } void VMObject::unlock() { verifyNull(this); - lockObj->release(); + declare_gcroot(LockObj*, lock) = myLock(this); + LockObj::release(lock); } void VMObject::waitIntern(struct timeval* info, bool timed) { - LockObj * l = myLock(this); - bool owner = l->owner(); + declare_gcroot(LockObj *, l) = myLock(this); + bool owner = LockObj::owner(l); if (owner) { VMThread* thread = VMThread::get(); @@ -169,10 +186,10 @@ thread->interruptFlag = 0; thread->getVM()->interruptedException(this); } else { - unsigned int recur = l->lock.recursionCount(); + unsigned int recur = l->lock->recursionCount(); bool timeout = false; - l->lock.unlockAll(); - l->wait(thread); + l->lock->unlockAll(); + LockObj::wait(l, thread); thread->state = VMThread::StateWaiting; if (timed) { @@ -183,10 +200,10 @@ bool interrupted = (thread->interruptFlag != 0); mutexThread->unlock(); - l->lock.lockAll(recur); + l->lock->lockAll(recur); if (interrupted || timeout) { - l->remove(thread); + LockObj::remove(l, thread); } thread->state = VMThread::StateRunning; @@ -210,18 +227,18 @@ } void VMObject::notify() { - LockObj* l = myLock(this); - if (l->owner()) { - l->notify(); + declare_gcroot(LockObj*, l) = myLock(this); + if (LockObj::owner(l)) { + LockObj::notify(l); } else { VMThread::get()->getVM()->illegalMonitorStateException(this); } } void VMObject::notifyAll() { - LockObj* l = myLock(this); - if (l->owner()) { - l->notifyAll(); + declare_gcroot(LockObj*, l) = myLock(this); + if (LockObj::owner(l)) { + LockObj::notifyAll(l); } else { VMThread::get()->getVM()->illegalMonitorStateException(this); } Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84112&r1=84111&r2=84112&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Wed Oct 14 11:51:21 2009 @@ -46,22 +46,21 @@ class LockObj : public mvm::Object { public: static N3VirtualTable _VT; - mvm::LockRecursive lock; - std::vector threads; + mvm::LockRecursive *lock; + std::vector *threads; static LockObj* allocate(); - static void _destroy(LockObj *); static void _print(const LockObj *, mvm::PrintBuffer *); - void notify(); - void notifyAll(); - void wait(VMThread* th); - void remove(VMThread* th); - - void aquire(); - void release(); - bool owner(); + static void notify(LockObj*); + static void notifyAll(LockObj*); + static void wait(LockObj*, VMThread* th); + static void remove(LockObj*, VMThread* th); + + static void aquire(LockObj*); + static void release(LockObj*); + static bool owner(LockObj*); }; #define VALUE_OFFSET 3 @@ -69,7 +68,7 @@ class VMObject : public mvm::Object { public: VMCommonClass* classOf; - LockObj* lockObj; + LockObj* lockObj; static mvm::Lock* globalLock; static const llvm::Type* llvmType; From gael.thomas at lip6.fr Wed Oct 14 10:12:50 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 17:12:50 -0000 Subject: [vmkit-commits] [vmkit] r84116 - in /vmkit/trunk/lib/N3: Mono/Mono.cpp Mono/MonoMSCorlib.cpp PNetLib/PNetMSCorlib.cpp VMCore/CLIJit.cpp VMCore/CLIRuntimeJIT.cpp VMCore/VMClass.cpp VMCore/VMObject.cpp VMCore/VMObject.h Message-ID: <200910141712.n9EHCoVd014989@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 12:12:49 2009 New Revision: 84116 URL: http://llvm.org/viewvc/llvm-project?rev=84116&view=rev Log: All access to VMObject are safe (use llvm_gcroot) Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMObject.cpp vmkit/trunk/lib/N3/VMCore/VMObject.h Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Wed Oct 14 12:12:49 2009 @@ -119,11 +119,11 @@ extern "C" void System_Threading_Monitor_Monitor_exit(VMObject* obj) { // TODO: There's a bug in the bootstrap, see why - if (LockObj::owner(obj->lockObj)) obj->unlock(); + if (LockObj::owner(obj->lockObj)) VMObject::unlock(obj); } extern "C" bool System_Threading_Monitor_Monitor_try_enter(VMObject* obj, int ms) { - obj->aquire(); + VMObject::aquire(obj); return true; } @@ -262,7 +262,7 @@ extern "C" VMObject* System_Object_MemberwiseClone(VMObject* obj) { uint64 size = obj->objectSize(); - VMObject* res = (VMObject*)gc::operator new(size, obj->getVirtualTable()); + VMObject* res = ((VMClass*)obj->classOf)->doNew(); memcpy(res, obj, size); res->lockObj = 0; return res; Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Wed Oct 14 12:12:49 2009 @@ -32,8 +32,8 @@ uint64 size = mvm::MvmModule::getTypeSize(type->virtualType->getContainedType(0)) + sizeof(const UTF8*) + sizeof(llvm::GlobalVariable*); type->virtualInstance = - (VMObject*)gc::operator new(size, type->virtualInstance->getVirtualTable()); - type->virtualInstance->initialise(type); + (VMObject*)gc::operator new(size, VMObject::getN3VirtualTable(type->virtualInstance)); + VMObject::initialise(type->virtualInstance, type); } Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Wed Oct 14 12:12:49 2009 @@ -32,8 +32,8 @@ uint64 size = mvm::MvmModule::getTypeSize(type->virtualType->getContainedType(0)) + sizeof(const UTF8*) + sizeof(llvm::GlobalVariable*); type->virtualInstance = - (VMObject*)gc::operator new(size, type->virtualInstance->getVirtualTable()); - type->virtualInstance->initialise(type); + (VMObject*)gc::operator new(size, VMObject::getN3VirtualTable(type->virtualInstance)); + VMObject::initialise(type->virtualInstance, type); } Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Wed Oct 14 12:12:49 2009 @@ -144,7 +144,7 @@ N3VirtualTable* CLIJit::makeArrayVT(VMClassArray* cl) { VMClass *super = (VMClass*)cl->super; N3VirtualTable * res = - new(cl->assembly->allocator, super->vtSize) N3VirtualTable(super->virtualInstance->getN3VirtualTable(), super->vtSize); + new(cl->assembly->allocator, super->vtSize) N3VirtualTable(VMObject::getN3VirtualTable(super->virtualInstance), super->vtSize); #ifdef WITH_TRACER Function* func = Function::Create(markAndTraceLLVMType, @@ -254,19 +254,21 @@ N3VirtualTable* CLIJit::makeVT(VMClass* cl, bool stat) { int n = N3VirtualTable::baseVtSize(); N3VirtualTable * res = - stat ? new(cl->assembly->allocator, n) N3VirtualTable((uintptr_t)0, - (uintptr_t)0, - (uintptr_t)VMObject::_trace, - (uintptr_t)VMObject::_print, - (uintptr_t)mvm::Object::default_hashCode) : ( - cl->super ? new(cl->assembly->allocator, cl->vtSize) N3VirtualTable(((VMClass *)cl->super)->virtualInstance->getN3VirtualTable(), - n, - cl->vtSize) : - new(cl->assembly->allocator, cl->vtSize) N3VirtualTable((uintptr_t)0, - (uintptr_t)0, - (uintptr_t)VMObject::_trace, - (uintptr_t)VMObject::_print, - (uintptr_t)mvm::Object::default_hashCode)); + stat ? + new(cl->assembly->allocator, n) N3VirtualTable((uintptr_t)0, + (uintptr_t)0, + (uintptr_t)VMObject::_trace, + (uintptr_t)VMObject::_print, + (uintptr_t)mvm::Object::default_hashCode) : + (cl->super ? + new(cl->assembly->allocator, cl->vtSize) N3VirtualTable(VMObject::getN3VirtualTable(((VMClass *)cl->super)->virtualInstance), + n, + cl->vtSize) : + new(cl->assembly->allocator, cl->vtSize) N3VirtualTable((uintptr_t)0, + (uintptr_t)0, + (uintptr_t)VMObject::_trace, + (uintptr_t)VMObject::_print, + (uintptr_t)mvm::Object::default_hashCode)); #ifdef WITH_TRACER Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Wed Oct 14 12:12:49 2009 @@ -60,7 +60,7 @@ } extern "C" bool n3InstanceOf(VMObject* obj, VMCommonClass* cl) { - return obj->instanceOf(cl); + return VMObject::instanceOf(obj, cl); } extern "C" void* GetCppException() { Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Wed Oct 14 12:12:49 2009 @@ -296,7 +296,7 @@ uint64 size = mvm::MvmModule::getTypeSize(cl->staticType->getContainedType(0)); cl->staticInstance = (VMObject*)gc::operator new(size, VT); - cl->staticInstance->initialise(cl); + VMObject::initialise(cl->staticInstance, cl); for (std::vector::iterator i = cl->staticFields.begin(), e = cl->staticFields.end(); i!= e; ++i) { @@ -478,7 +478,7 @@ uint64 size = mvm::MvmModule::getTypeSize(cl->virtualType->getContainedType(0)); cl->virtualInstance = (VMObject*)gc::operator new(size, VT); - cl->virtualInstance->initialise(cl); + VMObject::initialise(cl->virtualInstance, cl); for (std::vector::iterator i = cl->virtualFields.begin(), e = cl->virtualFields.end(); i!= e; ++i) { @@ -643,7 +643,7 @@ if (status < inClinit) resolveType(true, true, NULL); uint64 size = mvm::MvmModule::getTypeSize(virtualType->getContainedType(0)); VMObject* res = (VMObject*) - gc::operator new(size, virtualInstance->getVirtualTable()); + gc::operator new(size, VMObject::getN3VirtualTable(virtualInstance)); memcpy(res, virtualInstance, size); return res; } @@ -654,7 +654,7 @@ VMArray* res = (VMArray*) gc::operator new(size * nb + sizeof(VMObject) + sizeof(sint32), arrayVT); memset(res->elements, 0, size * nb); - res->initialise(this); + VMObject::initialise(res, this); res->size = nb; return res; } Modified: vmkit/trunk/lib/N3/VMCore/VMObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.cpp?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.cpp Wed Oct 14 12:12:49 2009 @@ -130,20 +130,6 @@ return self->lock->selfOwner(); } -void VMObject::initialise(VMCommonClass* cl) { - this->classOf = cl; - this->lockObj = 0; -} - -void VMObject::_print(const VMObject *self, mvm::PrintBuffer* buf) { - llvm_gcroot(self, 0); - buf->write("VMObject<"); - self->classOf->print(buf); - buf->write("@0x"); - buf->writePtr((void*)self->hashCode()); - buf->write(">"); -} - static LockObj* myLock(VMObject* obj) { llvm_gcroot(obj, 0); verifyNull(obj); @@ -160,19 +146,37 @@ return lock; } -void VMObject::aquire() { - declare_gcroot(LockObj*, lock) = myLock(this); +void VMObject::initialise(VMObject* self, VMCommonClass* cl) { + llvm_gcroot(self, 0); + self->classOf = cl; + self->lockObj = 0; +} + +void VMObject::_print(const VMObject *self, mvm::PrintBuffer* buf) { + llvm_gcroot(self, 0); + buf->write("VMObject<"); + self->classOf->print(buf); + buf->write("@0x"); + buf->writePtr((void*)self->hashCode()); + buf->write(">"); +} + +void VMObject::aquire(VMObject* self) { + llvm_gcroot(self, 0); + declare_gcroot(LockObj*, lock) = myLock(self); LockObj::aquire(lock); } -void VMObject::unlock() { - verifyNull(this); - declare_gcroot(LockObj*, lock) = myLock(this); +void VMObject::unlock(VMObject* self) { + llvm_gcroot(self, 0); + verifyNull(self); + declare_gcroot(LockObj*, lock) = myLock(self); LockObj::release(lock); } -void VMObject::waitIntern(struct timeval* info, bool timed) { - declare_gcroot(LockObj *, l) = myLock(this); +void VMObject::waitIntern(VMObject* self, struct timeval* info, bool timed) { + llvm_gcroot(self, 0); + declare_gcroot(LockObj *, l) = myLock(self); bool owner = LockObj::owner(l); if (owner) { @@ -184,7 +188,7 @@ if (thread->interruptFlag != 0) { mutexThread->unlock(); thread->interruptFlag = 0; - thread->getVM()->interruptedException(this); + thread->getVM()->interruptedException(self); } else { unsigned int recur = l->lock->recursionCount(); bool timeout = false; @@ -210,41 +214,46 @@ if (interrupted) { thread->interruptFlag = 0; - thread->getVM()->interruptedException(this); + thread->getVM()->interruptedException(self); } } } else { - VMThread::get()->getVM()->illegalMonitorStateException(this); + VMThread::get()->getVM()->illegalMonitorStateException(self); } } -void VMObject::wait() { - waitIntern(0, false); +void VMObject::wait(VMObject* self) { + llvm_gcroot(self, 0); + waitIntern(self, 0, false); } -void VMObject::timedWait(struct timeval& info) { - waitIntern(&info, false); +void VMObject::timedWait(VMObject* self, struct timeval& info) { + llvm_gcroot(self, 0); + waitIntern(self, &info, false); } -void VMObject::notify() { - declare_gcroot(LockObj*, l) = myLock(this); +void VMObject::notify(VMObject* self) { + llvm_gcroot(self, 0); + declare_gcroot(LockObj*, l) = myLock(self); if (LockObj::owner(l)) { LockObj::notify(l); } else { - VMThread::get()->getVM()->illegalMonitorStateException(this); + VMThread::get()->getVM()->illegalMonitorStateException(self); } } -void VMObject::notifyAll() { - declare_gcroot(LockObj*, l) = myLock(this); +void VMObject::notifyAll(VMObject* self) { + llvm_gcroot(self, 0); + declare_gcroot(LockObj*, l) = myLock(self); if (LockObj::owner(l)) { LockObj::notifyAll(l); } else { - VMThread::get()->getVM()->illegalMonitorStateException(this); + VMThread::get()->getVM()->illegalMonitorStateException(self); } } -bool VMObject::instanceOf(VMCommonClass* cl) { - if (!this) return false; - else return this->classOf->isAssignableFrom(cl); +bool VMObject::instanceOf(VMObject* self, VMCommonClass* cl) { + llvm_gcroot(self, 0); + if (!self) return false; + else return self->classOf->isAssignableFrom(cl); } Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84116&r1=84115&r2=84116&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Wed Oct 14 12:12:49 2009 @@ -70,27 +70,27 @@ VMCommonClass* classOf; LockObj* lockObj; - static mvm::Lock* globalLock; + static mvm::Lock* globalLock; static const llvm::Type* llvmType; static void _print(const VMObject *, mvm::PrintBuffer *); static void _trace(VMObject *); - void aquire(); - void unlock(); - void waitIntern(struct timeval *info, bool timed); - void wait(); - void timedWait(struct timeval &info); - void notify(); - void notifyAll(); - void initialise(VMCommonClass* cl); + static void aquire(VMObject *self); + static void unlock(VMObject *self); + static void waitIntern(VMObject *self, struct timeval *info, bool timed); + static void wait(VMObject *self); + static void timedWait(VMObject *self, struct timeval &info); + static void notify(VMObject *self); + static void notifyAll(VMObject *self); + static void initialise(VMObject *self, VMCommonClass* cl); static llvm::Constant* classOffset(); - bool instanceOf(VMCommonClass* cl); + static bool instanceOf(VMObject *self, VMCommonClass* cl); - N3VirtualTable *getN3VirtualTable() { return (N3VirtualTable*)getVirtualTable(); } + static N3VirtualTable *getN3VirtualTable(VMObject *self) { llvm_gcroot(self, 0); return *((N3VirtualTable**)self); } #ifdef SIGSEGV_THROW_NULL #define verifyNull(obj) {} From gael.thomas at lip6.fr Wed Oct 14 11:32:01 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 18:32:01 -0000 Subject: [vmkit-commits] [vmkit] r84121 - in /vmkit/trunk/lib/N3: PNetLib/PNetLib.cpp VMCore/VMCache.cpp Message-ID: <200910141832.n9EIW27Q017669@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 13:32:01 2009 New Revision: 84121 URL: http://llvm.org/viewvc/llvm-project?rev=84121&view=rev Log: Remove last mvm::Object Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/VMCore/VMCache.cpp Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=84121&r1=84120&r2=84121&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Wed Oct 14 13:32:01 2009 @@ -679,7 +679,7 @@ return 0; } -extern "C" VMObject* System_Reflection_ClrHelpers_GetSemantics(mvm::Object* item, uint32 attributes, bool nonPublic) { +extern "C" VMObject* System_Reflection_ClrHelpers_GetSemantics(uintptr_t item, uint32 attributes, bool nonPublic) { if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) { Property* prop = (Property*)item; mvm::PrintBuffer _asciiz(prop->name); Modified: vmkit/trunk/lib/N3/VMCore/VMCache.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.cpp?rev=84121&r1=84120&r2=84121&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.cpp Wed Oct 14 13:32:01 2009 @@ -36,7 +36,7 @@ if (lastCible) { lastCible->print(buf); buf->write(" -- "); - ((mvm::Object*)((void**)methPtr - 1))->print(buf); + buf->writePtr(methPtr - 1); } buf->write(" in "); enveloppe->print(buf); From gael.thomas at lip6.fr Wed Oct 14 12:11:51 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 19:11:51 -0000 Subject: [vmkit-commits] [vmkit] r84126 - in /vmkit/trunk/lib/N3/VMCore: CLIRuntimeJIT.cpp N3.cpp VMCache.cpp VMThread.cpp VMThread.h VirtualTables.cpp Message-ID: <200910141911.n9EJBpuJ019360@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 14:11:51 2009 New Revision: 84126 URL: http://llvm.org/viewvc/llvm-project?rev=84126&view=rev Log: pendingException is safe Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/VMCache.cpp vmkit/trunk/lib/N3/VMCore/VMThread.cpp vmkit/trunk/lib/N3/VMCore/VMThread.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=84126&r1=84125&r2=84126&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Wed Oct 14 14:11:51 2009 @@ -72,7 +72,8 @@ } extern "C" VMObject* GetCLIException() { - return VMThread::getCLIException(); + declare_gcroot(VMObject*, res) = VMThread::getCLIException(); + return res; } extern "C" bool CompareException(VMClass* cl) { Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=84126&r1=84125&r2=84126&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Wed Oct 14 14:11:51 2009 @@ -327,7 +327,7 @@ try{ vm->executeAssembly(info.assembly, args); }catch(...) { - VMObject* exc = th->pendingException; + declare_gcroot(VMObject*, exc) = th->ooo_pendingException; printf("N3 caught %s\n", mvm::PrintBuffer(exc).cString()); } Modified: vmkit/trunk/lib/N3/VMCore/VMCache.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.cpp?rev=84126&r1=84125&r2=84126&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMCache.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMCache.cpp Wed Oct 14 14:11:51 2009 @@ -36,7 +36,7 @@ if (lastCible) { lastCible->print(buf); buf->write(" -- "); - buf->writePtr(methPtr - 1); + buf->writePtr(methPtr); } buf->write(" in "); enveloppe->print(buf); Modified: vmkit/trunk/lib/N3/VMCore/VMThread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.cpp?rev=84126&r1=84125&r2=84126&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.cpp Wed Oct 14 14:11:51 2009 @@ -49,7 +49,7 @@ this->varcond = new mvm::Cond(); this->interruptFlag = 0; this->state = StateRunning; - this->pendingException = 0; + this->ooo_pendingException = 0; this->perFunctionPasses = new llvm::FunctionPassManager(vm->TheModuleProvider); this->perFunctionPasses->add(new llvm::TargetData(vm->getLLVMModule())); AddStandardCompilePasses(this->perFunctionPasses); @@ -70,7 +70,8 @@ VMObject* VMThread::getCLIException() { VMThread* th = VMThread::get(); - return th->pendingException; + declare_gcroot(VMObject *, pendingException) = th->ooo_pendingException; + return pendingException; } extern "C" void* __cxa_allocate_exception(unsigned); @@ -78,21 +79,22 @@ void VMThread::throwException(VMObject* obj) { + llvm_gcroot(obj, 0); VMThread* th = VMThread::get(); - assert(th->pendingException == 0 && "pending exception already there?"); - th->pendingException = obj; + assert(th->ooo_pendingException == 0 && "pending exception already there?"); + th->ooo_pendingException = obj; void* exc = __cxa_allocate_exception(0); th->internalPendingException = exc; __cxa_throw(exc, 0, 0); } void VMThread::internalClearException() { - pendingException = 0; + ooo_pendingException = 0; internalPendingException = 0; } bool VMThread::compareException(VMClass* cl) { - VMObject* pe = VMThread::get()->pendingException; + declare_gcroot(VMObject*, pe) = VMThread::get()->ooo_pendingException; assert(pe && "no pending exception?"); return pe->classOf->subclassOf(cl); } Modified: vmkit/trunk/lib/N3/VMCore/VMThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMThread.h?rev=84126&r1=84125&r2=84126&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMThread.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMThread.h Wed Oct 14 14:11:51 2009 @@ -35,10 +35,10 @@ return (N3*)MyVM; } - mvm::Lock* lock; - mvm::Cond* varcond; - VMObject* pendingException; - void* internalPendingException; + mvm::Lock* lock; + mvm::Cond* varcond; + VMObject* ooo_pendingException; + void* internalPendingException; unsigned int interruptFlag; unsigned int state; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84126&r1=84125&r2=84126&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Wed Oct 14 14:11:51 2009 @@ -29,7 +29,6 @@ // N3 Objects void VMObject::_trace(VMObject *self) { - llvm_gcroot(self, 0); self->lockObj->MARK_AND_TRACE; } @@ -46,7 +45,7 @@ // internal objects void VMThread::TRACER { ooo_appThread->MARK_AND_TRACE; - pendingException->MARK_AND_TRACE; + ooo_pendingException->MARK_AND_TRACE; // I suppose that the vm is already traced by the gc // vm->CALL_TRACER; } From gael.thomas at lip6.fr Wed Oct 14 14:26:20 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 21:26:20 -0000 Subject: [vmkit-commits] [vmkit] r84139 - in /vmkit/trunk/lib/N3: Mono/MonoMSCorlib.cpp PNetLib/PNetLib.cpp PNetLib/PNetMSCorlib.cpp VMCore/Assembly.h VMCore/VirtualTables.cpp Message-ID: <200910142126.n9ELQLG4024062@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 16:26:20 2009 New Revision: 84139 URL: http://llvm.org/viewvc/llvm-project?rev=84139&view=rev Log: Safe access to Assembly::delegatee Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=84139&r1=84138&r2=84139&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Wed Oct 14 16:26:20 2009 @@ -156,6 +156,7 @@ } VMObject* Assembly::getAssemblyDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; if (!delegatee) { VMThread::get()->getVM()->error("implement me"); } Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=84139&r1=84138&r2=84139&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Wed Oct 14 16:26:20 2009 @@ -514,7 +514,8 @@ vm->error("unfound assembly %s\n", mvm::PrintBuffer(str->value).cString()); error = 0; - return ass->getAssemblyDelegatee(); + declare_gcroot(VMObject*, delegatee) = ass->getAssemblyDelegatee(); + return delegatee; } extern "C" PNetString* System_String_Concat_2(PNetString* str1, PNetString* str2) { Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=84139&r1=84138&r2=84139&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Wed Oct 14 16:26:20 2009 @@ -159,6 +159,8 @@ } VMObject* Assembly::getAssemblyDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { delegatee = (*MSCorlib::assemblyReflection)(); (*MSCorlib::ctorAssemblyReflection)(delegatee); Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=84139&r1=84138&r2=84139&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Wed Oct 14 16:26:20 2009 @@ -175,7 +175,7 @@ Section* rsrcSection; Section* relocSection; Header* CLIHeader; - VMObject* delegatee; + VMObject* ooo_delegatee; Assembly** assemblyRefs; uint32 CLIHeaderLocation; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84139&r1=84138&r2=84139&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Wed Oct 14 16:26:20 2009 @@ -63,7 +63,7 @@ void Assembly::TRACER { loadedNameClasses->CALL_TRACER; - delegatee->MARK_AND_TRACE; + ooo_delegatee->MARK_AND_TRACE; } void VMCommonClass::TRACER { From gael.thomas at lip6.fr Wed Oct 14 14:36:58 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Wed, 14 Oct 2009 21:36:58 -0000 Subject: [vmkit-commits] [vmkit] r84143 - in /vmkit/trunk/lib/N3: Mono/MonoMSCorlib.cpp PNetLib/PNetLib.cpp PNetLib/PNetMSCorlib.cpp VMCore/VMClass.cpp VMCore/VMClass.h VMCore/VirtualTables.cpp Message-ID: <200910142136.n9ELawJJ024421@zion.cs.uiuc.edu> Author: gthomas Date: Wed Oct 14 16:36:58 2009 New Revision: 84143 URL: http://llvm.org/viewvc/llvm-project?rev=84143&view=rev Log: Safe access to the gc object VMCommonClass::delegatee Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=84143&r1=84142&r2=84143&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Wed Oct 14 16:36:58 2009 @@ -148,8 +148,9 @@ } VMObject* VMCommonClass::getClassDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; if (!delegatee) { - delegatee = (*MSCorlib::clrType)(); + ooo_delegatee = delegatee = (*MSCorlib::clrType)(); (*MSCorlib::typeClrType)(delegatee, (VMObject*)this); } return delegatee; Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=84143&r1=84142&r2=84143&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Wed Oct 14 16:36:58 2009 @@ -252,7 +252,8 @@ VMThread::get()->getVM()->error("implement me"); return 0; } else { - return ((VMClassArray*)cl)->baseClass->getClassDelegatee(); + declare_gcroot(VMObject *, delegatee) = ((VMClassArray*)cl)->baseClass->getClassDelegatee(); + return delegatee; } } @@ -619,7 +620,8 @@ ++index; VMCommonClass* cl = ass->loadTypeFromName(vm->asciizToUTF8(index), vm->asciizToUTF8(asciiz), true, true, true, onError); if (!cl) VMThread::get()->getVM()->error("implement me"); - return cl->getClassDelegatee(); + declare_gcroot(VMObject *, delegatee) = cl->getClassDelegatee(); + return delegatee; } static bool parameterMatch(std::vector params, ArrayObject* types, bool virt) { Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=84143&r1=84142&r2=84143&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Wed Oct 14 16:36:58 2009 @@ -150,8 +150,10 @@ } VMObject* VMCommonClass::getClassDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { - delegatee = (*MSCorlib::clrType)(); + ooo_delegatee = delegatee = (*MSCorlib::clrType)(); (*MSCorlib::ctorClrType)(delegatee); (*MSCorlib::typeClrType)(delegatee, (VMObject*)this); } @@ -162,7 +164,7 @@ declare_gcroot(VMObject*, delegatee) = ooo_delegatee; if (!delegatee) { - delegatee = (*MSCorlib::assemblyReflection)(); + ooo_delegatee = delegatee = (*MSCorlib::assemblyReflection)(); (*MSCorlib::ctorAssemblyReflection)(delegatee); (*MSCorlib::assemblyAssemblyReflection)(delegatee, (VMObject*)this); } Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=84143&r1=84142&r2=84143&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Wed Oct 14 16:36:58 2009 @@ -162,7 +162,7 @@ void VMCommonClass::initialise(N3* vm, bool isArray) { this->lockVar = new mvm::LockRecursive(); this->condVar = new mvm::Cond(); - this->delegatee = 0; + this->ooo_delegatee = 0; this->status = hashed; this->vm = vm; this->isArray = isArray; Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=84143&r1=84142&r2=84143&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Wed Oct 14 16:36:58 2009 @@ -65,7 +65,7 @@ const UTF8* nameSpace; mvm::Lock* lockVar; mvm::Cond* condVar; - VMObject* delegatee; + VMObject* ooo_delegatee; std::vector display; Assembly* assembly; std::vector > properties; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84143&r1=84142&r2=84143&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Wed Oct 14 16:36:58 2009 @@ -67,7 +67,7 @@ } void VMCommonClass::TRACER { - delegatee->MARK_AND_TRACE; + ooo_delegatee->MARK_AND_TRACE; CALL_TRACER_VECTOR(VMMethod*, virtualMethods, std::allocator); CALL_TRACER_VECTOR(VMMethod*, staticMethods, std::allocator); CALL_TRACER_VECTOR(Property*, properties, gc_allocator); From gael.thomas at lip6.fr Sat Oct 17 06:01:26 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 17 Oct 2009 13:01:26 -0000 Subject: [vmkit-commits] [vmkit] r84331 - in /vmkit/trunk: include/mvm/ lib/N3/LLVMRuntime/ lib/N3/Mono/ lib/N3/PNetLib/ lib/N3/VMCore/ Message-ID: <200910171301.n9HD1Rpv006060@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 17 08:01:15 2009 New Revision: 84331 URL: http://llvm.org/viewvc/llvm-project?rev=84331&view=rev Log: Define macros to construct types. All vmfield assessors are safe. Added: vmkit/trunk/lib/N3/VMCore/N3MetaType.h Modified: vmkit/trunk/include/mvm/PrintBuffer.h vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/Assembly.h vmkit/trunk/lib/N3/VMCore/CLIJit.cpp vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp vmkit/trunk/lib/N3/VMCore/MSCorlib.h vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp vmkit/trunk/lib/N3/VMCore/VMArray.cpp vmkit/trunk/lib/N3/VMCore/VMArray.h vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VMObject.h Modified: vmkit/trunk/include/mvm/PrintBuffer.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/PrintBuffer.h?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/include/mvm/PrintBuffer.h (original) +++ vmkit/trunk/include/mvm/PrintBuffer.h Sat Oct 17 08:01:15 2009 @@ -103,6 +103,11 @@ } /// writeChar - Writes a char. + inline PrintBuffer *writeBool(bool v) { + return write(v ? "true" : "false"); + } + + /// writeChar - Writes a char. inline PrintBuffer *writeChar(char v) { char buf[32]; sprintf(buf, "%c", v); Modified: vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll (original) +++ vmkit/trunk/lib/N3/LLVMRuntime/runtime.ll Sat Oct 17 08:01:15 2009 @@ -2,18 +2,21 @@ ;;; Types for CLI arrays. A size of 0 means an undefined size. %CLIArray = type { %CLIObject, i32 } -%ArraySInt8 = type { %CLIObject, i32, [0 x i8] } -%ArrayUInt8 = type { %CLIObject, i32, [0 x i8] } -%ArrayChar = type { %CLIObject, i32, [0 x i16] } -%ArraySInt16 = type { %CLIObject, i32, [0 x i16] } -%ArrayUInt16 = type { %CLIObject, i32, [0 x i16] } -%ArraySInt32 = type { %CLIObject, i32, [0 x i32] } -%ArrayUInt32 = type { %CLIObject, i32, [0 x i32] } -%ArraySInt64 = type { %CLIObject, i32, [0 x i64] } -%ArrayUInt64 = type { %CLIObject, i32, [0 x i64] } -%ArrayFloat = type { %CLIObject, i32, [0 x float] } -%ArrayDouble = type { %CLIObject, i32, [0 x double] } -%ArrayObject = type { %CLIObject, i32, [0 x %CLIObject*] } +%ArrayBoolean = type { %CLIObject, i32, [0 x i8] } +%ArrayUInt8 = type { %CLIObject, i32, [0 x i8] } +%ArraySInt8 = type { %CLIObject, i32, [0 x i8] } +%ArrayChar = type { %CLIObject, i32, [0 x i16] } +%ArraySInt16 = type { %CLIObject, i32, [0 x i16] } +%ArrayUInt16 = type { %CLIObject, i32, [0 x i16] } +%ArraySInt32 = type { %CLIObject, i32, [0 x i32] } +%ArrayUInt32 = type { %CLIObject, i32, [0 x i32] } +%ArraySInt64 = type { %CLIObject, i32, [0 x i64] } +%ArrayUInt64 = type { %CLIObject, i32, [0 x i64] } +%ArrayIntPtr = type { %CLIObject, i32, [0 x i32*] } +%ArrayUIntPtr = type { %CLIObject, i32, [0 x i32*] } +%ArrayFloat = type { %CLIObject, i32, [0 x float] } +%ArrayDouble = type { %CLIObject, i32, [0 x double] } +%ArrayObject = type { %CLIObject, i32, [0 x %CLIObject*] } %CacheNode = type {i8*, i8*, i8*, i8*, i8*, i1} Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Sat Oct 17 08:01:15 2009 @@ -151,7 +151,7 @@ declare_gcroot(VMObject*, delegatee) = ooo_delegatee; if (!delegatee) { ooo_delegatee = delegatee = (*MSCorlib::clrType)(); - (*MSCorlib::typeClrType)(delegatee, (VMObject*)this); + MSCorlib::typeClrType->setIntPtr(delegatee, (int*)this); } return delegatee; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 17 08:01:15 2009 @@ -247,7 +247,7 @@ } extern "C" VMObject* System_Reflection_ClrType_GetElementType(VMObject* Klass) { - VMCommonClass* cl = (VMCommonClass*)((*Klass)(MSCorlib::typeClrType).PointerVal); + VMCommonClass* cl = (VMCommonClass*)MSCorlib::typeClrType->getIntPtr(Klass); if (!cl->isArray) { VMThread::get()->getVM()->error("implement me"); return 0; @@ -628,7 +628,7 @@ uint32 v = virt ? 1 : 0; if (types->size + v + 1 != params.size()) return false; for (sint32 i = 0; i < types->size; ++i) { - VMCommonClass* cur = (VMCommonClass*)(*MSCorlib::typeClrType)(types->elements[i]).PointerVal; + VMCommonClass* cur = (VMCommonClass*)MSCorlib::typeClrType->getIntPtr(types->elements[i]); if (cur != params[i + 1 + v]) return false; } return true; @@ -636,7 +636,7 @@ extern "C" VMObject* System_Reflection_ClrType_GetMemberImpl(VMObject* Type, PNetString* str, sint32 memberTypes, sint32 bindingFlags, VMObject* binder, sint32 callingConventions, ArrayObject* types, VMObject* modifiers) { - VMCommonClass* type = (VMCommonClass*)((*MSCorlib::typeClrType)(Type).PointerVal); + VMCommonClass* type = (VMCommonClass*)MSCorlib::typeClrType->getIntPtr(Type); N3* vm = (N3*)(VMThread::get()->getVM()); const UTF8* name = vm->arrayToUTF8(str->value); if (memberTypes == MEMBER_TYPES_PROPERTY) { @@ -740,7 +740,7 @@ } extern "C" VMObject* System_Reflection_ClrMethod_Invoke(VMObject* Method, VMObject* obj, sint32 invokeAttr, VMObject* binder, ArrayObject* args, VMObject* culture) { - VMMethod* meth = (VMMethod*)(*MSCorlib::methodMethodType)(Method).PointerVal; + VMMethod* meth = (VMMethod*)MSCorlib::methodMethodType->getIntPtr(Method); meth->getSignature(NULL); meth->compiledPtr(NULL); llvm::Function* func = CLIJit::compile(meth->classDef, meth); @@ -785,51 +785,16 @@ VMObject* res = 0; VMCommonClass* retType = meth->parameters[0]; + +#define CONSTRUCT_RES(name, type, gv_extractor) \ + else if(retType == MSCorlib::p##name) { \ + res = MSCorlib::p##name->doNew(); \ + MSCorlib::ctor##name->set##name(res, (type)gv.gv_extractor); \ + } + if (retType == MSCorlib::pVoid) { res = (*MSCorlib::pVoid)(); - } else if (retType == MSCorlib::pBoolean) { - res = (*MSCorlib::pBoolean)(); - (*MSCorlib::ctorBoolean)(res, gv.IntVal.getBoolValue()); - } else if (retType == MSCorlib::pUInt8) { - res = (*MSCorlib::pUInt8)(); - (*MSCorlib::ctorUInt8)(res, (uint8)gv.IntVal.getZExtValue()); - } else if (retType == MSCorlib::pSInt8) { - res = (*MSCorlib::pSInt8)(); - (*MSCorlib::ctorSInt8)(res, (uint8)gv.IntVal.getSExtValue()); - } else if (retType == MSCorlib::pChar) { - res = (*MSCorlib::pChar)(); - (*MSCorlib::ctorChar)(res, (uint16)gv.IntVal.getZExtValue()); - } else if (retType == MSCorlib::pSInt16) { - res = (*MSCorlib::pSInt16)(); - (*MSCorlib::ctorSInt16)(res, (sint16)gv.IntVal.getSExtValue()); - } else if (retType == MSCorlib::pUInt16) { - res = (*MSCorlib::pUInt16)(); - (*MSCorlib::ctorUInt16)(res, (uint16)gv.IntVal.getZExtValue()); - } else if (retType == MSCorlib::pSInt32) { - res = (*MSCorlib::pSInt32)(); - (*MSCorlib::ctorSInt32)(res, (sint32)gv.IntVal.getSExtValue()); - } else if (retType == MSCorlib::pUInt32) { - res = (*MSCorlib::pUInt32)(); - (*MSCorlib::ctorUInt32)(res, (sint32)gv.IntVal.getZExtValue()); - } else if (retType == MSCorlib::pSInt64) { - res = (*MSCorlib::pSInt64)(); - (*MSCorlib::ctorSInt64)(res, (sint64)gv.IntVal.getSExtValue()); - } else if (retType == MSCorlib::pUInt64) { - res = (*MSCorlib::pUInt64)(); - (*MSCorlib::ctorUInt64)(res, (sint64)gv.IntVal.getZExtValue()); - } else if (retType == MSCorlib::pIntPtr) { - res = (*MSCorlib::pIntPtr)(); - (*MSCorlib::ctorIntPtr)(res, (void*)gv.IntVal.getSExtValue()); - } else if (retType == MSCorlib::pUIntPtr) { - res = (*MSCorlib::pUIntPtr)(); - (*MSCorlib::ctorUIntPtr)(res, (void*)gv.IntVal.getZExtValue()); - } else if (retType == MSCorlib::pFloat) { - res = (*MSCorlib::pFloat)(); - (*MSCorlib::ctorFloat)(res, gv.FloatVal); - } else if (retType == MSCorlib::pDouble) { - res = (*MSCorlib::pDouble)(); - (*MSCorlib::ctorDouble)(res, gv.DoubleVal); - } else { + } ON_PRIMITIVES(CONSTRUCT_RES, _F_NTE) else { if (retType->super == MSCorlib::pValue || retType->super == MSCorlib::pEnum) VMThread::get()->getVM()->error("implement me"); res = (VMObject*)gv.PointerVal; @@ -881,7 +846,7 @@ } extern "C" VMObject* System_Reflection_Assembly_GetManifestResourceStream(VMObject* Ass, PNetString* str) { - Assembly* ass = (Assembly*)(*MSCorlib::assemblyAssemblyReflection)(Ass).PointerVal; + Assembly* ass = (Assembly*)MSCorlib::assemblyAssemblyReflection->getIntPtr(Ass); N3* vm = (N3*)(VMThread::get()->getVM()); const UTF8* id = vm->arrayToUTF8(str->value); Header* header = ass->CLIHeader; Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Sat Oct 17 08:01:15 2009 @@ -135,7 +135,7 @@ if (!delegatee) { delegatee = (*MSCorlib::propertyType)(); (*MSCorlib::ctorPropertyType)(delegatee); - (*MSCorlib::propertyPropertyType)(delegatee, (VMObject*)this); + MSCorlib::propertyPropertyType->setIntPtr(delegatee, (int*)this); } return delegatee; } @@ -144,7 +144,7 @@ if (!delegatee) { delegatee = (*MSCorlib::methodType)(); (*MSCorlib::ctorMethodType)(delegatee); - (*MSCorlib::methodMethodType)(delegatee, (VMObject*)this); + MSCorlib::methodMethodType->setIntPtr(delegatee, (int*)this); } return delegatee; } @@ -155,7 +155,7 @@ if (!delegatee) { ooo_delegatee = delegatee = (*MSCorlib::clrType)(); (*MSCorlib::ctorClrType)(delegatee); - (*MSCorlib::typeClrType)(delegatee, (VMObject*)this); + MSCorlib::typeClrType->setIntPtr(delegatee, (int*)this); } return delegatee; } @@ -166,7 +166,7 @@ if (!delegatee) { ooo_delegatee = delegatee = (*MSCorlib::assemblyReflection)(); (*MSCorlib::ctorAssemblyReflection)(delegatee); - (*MSCorlib::assemblyAssemblyReflection)(delegatee, (VMObject*)this); + MSCorlib::assemblyAssemblyReflection->setIntPtr(delegatee, (int*)this); } return delegatee; } Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sat Oct 17 08:01:15 2009 @@ -1293,7 +1293,7 @@ args.push_back(llvm::GenericValue(obj)); readCustomAttributes(blobOffset + attrArray[CONSTANT_CUSTOM_ATTRIBUTE_VALUE], args, cons); - (*cons)(args); + cons->compileToNative()->invokeGeneric(args); vec.push_back(obj); } } Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.h (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.h Sat Oct 17 08:01:15 2009 @@ -39,7 +39,6 @@ using mvm::UTF8Map; class ArrayChar; -class ArrayUInt8; class ArrayObject; class Assembly; class ClassNameMap; Modified: vmkit/trunk/lib/N3/VMCore/CLIJit.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJit.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJit.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJit.cpp Sat Oct 17 08:01:15 2009 @@ -21,6 +21,7 @@ #include "VMCache.h" #include "VMClass.h" #include "VMThread.h" +#include "N3MetaType.h" #include #include @@ -239,12 +240,12 @@ cl->virtualTracer = func; #endif -#define CASE_ARRAY(name, elmt, nbb, printer, pre, sep, post) \ +#define CASE_ARRAY(name, type) \ if(cl->baseClass == MSCorlib::p##name) { \ ((void**)res)[VT_PRINT_OFFSET] = ((void **)(unsigned int)Array##name::do_print); \ } else - ON_ARRAY_CLASSES(CASE_ARRAY) {} + ON_TYPES(CASE_ARRAY, _F_NT) {} #undef CASE_ARRAY @@ -1563,10 +1564,12 @@ Enveloppe::llvmType = PointerType::getUnqual(module->getTypeByName("Enveloppe")); -#define GET_LLVM_ARRAY_TYPE(name, elmt, nbb, printer, pre, sep, post) \ +#define GET_LLVM_ARRAY_TYPE(name, type) \ Array##name::llvmType = \ - PointerType::getUnqual(module->getTypeByName("Array"#name)); - ON_ARRAY_CLASSES(GET_LLVM_ARRAY_TYPE) + PointerType::getUnqual(module->getTypeByName("Array"#name)); \ + + ON_TYPES(GET_LLVM_ARRAY_TYPE, _F_NT) + #undef GET_LLVM_ARRAY_TYPE #ifdef WITH_TRACER Modified: vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp Sat Oct 17 08:01:15 2009 @@ -33,163 +33,113 @@ return doNew(); } -void VMField::operator()(VMObject* obj, float val) { - - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); - - bool stat = isStatic(flags); - if (stat) obj = classDef->staticInstance; - void* ptr = (void*)((uint64)obj + ptrOffset); - - if (signature->naturalType == Type::getFloatTy(getGlobalContext())) { - ((float*)ptr)[0] = val; - } else { - VMThread::get()->getVM()->unknownError("wrong type in field assignment"); - } - - return; -} - -void VMField::operator()(VMObject* obj, double val) { - - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); - - bool stat = isStatic(flags); - if (stat) obj = classDef->staticInstance; - void* ptr = (void*)((uint64)obj + ptrOffset); - - if (signature->naturalType == Type::getDoubleTy(getGlobalContext())) { - ((double*)ptr)[0] = val; - } else { - VMThread::get()->getVM()->unknownError("wrong type in field assignment"); - } - - return; -} - -void VMField::operator()(VMObject* obj, sint64 val) { - - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); - - bool stat = isStatic(flags); - if (stat) obj = classDef->staticInstance; - void* ptr = (void*)((uint64)obj + ptrOffset); - - if (signature->naturalType == Type::getInt64Ty(getGlobalContext())) { - ((uint64*)ptr)[0] = val; - } else { - VMThread::get()->getVM()->unknownError("wrong type in field assignment"); - } - - return; -} - -void VMField::operator()(VMObject* obj, sint32 val) { - - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); - - bool stat = isStatic(flags); - if (stat) obj = classDef->staticInstance; - void* ptr = (void*)((uint64)obj + ptrOffset); - - if (signature->naturalType == Type::getInt32Ty(getGlobalContext())) { - ((uint32*)ptr)[0] = val; - } else { - VMThread::get()->getVM()->unknownError("wrong type in field assignment"); - } - - return; -} - -void VMField::operator()(VMObject* obj, VMObject* val) { - - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); - - bool stat = isStatic(flags); - if (stat) obj = classDef->staticInstance; - void* ptr = (void*)((uint64)obj + ptrOffset); - - if (llvm::isa(signature->naturalType)) { - ((VMObject**)ptr)[0] = val; - } else { - VMThread::get()->getVM()->unknownError("wrong type in field assignment"); - } +// TODO: MUST CHECK the type! +// if (llvm::isa(signature->naturalType)) { +// if (signature->naturalType == Type::getFloatTy(getGlobalContext())) { + +#define IMPLEMENTS_VMFIELD_ASSESSORS(name, type, do_root) \ + void VMField::set##name(VMObject* obj, type val) { \ + llvm_gcroot(obj, 0); \ + do_root(val, 0); \ + \ + if (classDef->status < ready) \ + classDef->resolveType(true, true, NULL); \ + \ + *(type*)((char *)obj + ptrOffset) = val; \ + \ + return; \ + } \ + \ + type VMField::get##name(VMObject* obj) { \ + llvm_gcroot(obj, 0); \ + if (classDef->status < ready) \ + classDef->resolveType(true, true, NULL); \ + \ + type res; \ + do_root(res, 0); \ + res = *(type *)((char *)obj + ptrOffset); \ + return res; \ + } + +ON_TYPES(IMPLEMENTS_VMFIELD_ASSESSORS, _F_NTR) + +#undef IMPLEMENTS_VMFIELD_ASSESSORS + +GenericValue VMMethod::invokeGeneric(std::vector& args) { + assert(code); + return mvm::MvmModule::executionEngine->runFunction(methPtr, args); +} + +GenericValue VMMethod::invokeGeneric(va_list ap) { + assert(code); + + Function* func = methPtr; + std::vector args; + for (Function::arg_iterator i = func->arg_begin(), e = func->arg_end(); + i != e; ++i) { + const Type* cur = i->getType(); + if (cur == Type::getInt8Ty(getGlobalContext())) { + GenericValue gv; + gv.IntVal = APInt(8, va_arg(ap, int)); + args.push_back(gv); + } else if (cur == Type::getInt16Ty(getGlobalContext())) { + GenericValue gv; + gv.IntVal = APInt(16, va_arg(ap, int)); + args.push_back(gv); + } else if (cur == Type::getInt32Ty(getGlobalContext())) { + GenericValue gv; + gv.IntVal = APInt(32, va_arg(ap, int)); + args.push_back(gv); + } else if (cur == Type::getInt64Ty(getGlobalContext())) { + GenericValue gv1; + gv1.IntVal = APInt(64, va_arg(ap, uint64)); + args.push_back(gv1); + } else if (cur == Type::getDoubleTy(getGlobalContext())) { + GenericValue gv1; + gv1.DoubleVal = va_arg(ap, double); + args.push_back(gv1); + } else if (cur == Type::getFloatTy(getGlobalContext())) { + GenericValue gv; + gv.FloatVal = (float)(va_arg(ap, double)); + args.push_back(gv); + } else { + GenericValue gv(va_arg(ap, VMObject*)); + args.push_back(gv); + } + } + + return invokeGeneric(args); +} + + +#define DEFINE_INVOKE(name, type, extractor) \ + type VMMethod::invoke##name(...) { \ + va_list ap; \ + va_start(ap, this); \ + GenericValue res = invokeGeneric(ap); \ + va_end(ap); \ + return (type)res.extractor; \ + } + +ON_TYPES(DEFINE_INVOKE, _F_NTE) + +#undef DEFINE_INVOKE + +#define DEFINE_INVOKE_VOID(name, type, extractor) \ + type VMMethod::invoke##name(...) { \ + va_list ap; \ + va_start(ap, this); \ + invokeGeneric(ap); \ + va_end(ap); \ + } - return; -} -void VMField::operator()(VMObject* obj, bool val) { - - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); - - bool stat = isStatic(flags); - if (stat) obj = classDef->staticInstance; - void* ptr = (void*)((uint64)obj + ptrOffset); - - if (signature->naturalType == Type::getInt1Ty(getGlobalContext())) { - ((bool*)ptr)[0] = val; - } else { - VMThread::get()->getVM()->unknownError("wrong type in field assignment"); - } +ON_VOID(DEFINE_INVOKE_VOID, _F_NTE) - return; -} +#undef DEFINE_INVOKE_VOID -GenericValue VMField::operator()(VMObject* obj) { - - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); - - bool stat = isStatic(flags); - if (stat) { - if (obj != 0) { - // Assignment to a static var - void* ptr = (void*)((uint64)(classDef->staticInstance) + ptrOffset); - ((VMObject**)ptr)[0] = obj; - return GenericValue(0); - } else { - // Get a static var - obj = classDef->staticInstance; - } - } - - void* ptr = (void*)((uint64)obj + ptrOffset); - const Type* type = signature->naturalType; - if (type == Type::getInt8Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(8, ((uint8*)ptr)[0]); - return gv; - } else if (type == Type::getInt16Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(16, ((uint16*)ptr)[0]); - return gv; - } else if (type == Type::getInt32Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(32, ((uint32*)ptr)[0]); - return gv; - } else if (type == Type::getInt64Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(64, ((uint64*)ptr)[0]); - return gv; - } else if (type == Type::getDoubleTy(getGlobalContext())) { - GenericValue gv; - gv.DoubleVal = ((double*)ptr)[0]; - return gv; - } else if (type == Type::getFloatTy(getGlobalContext())) { - GenericValue gv; - gv.FloatVal = ((float*)ptr)[0]; - return gv; - } else { - GenericValue gv(((VMObject**)ptr)[0]); - return gv; - } -} +// mettre en param un Function * +// materializeFunction avant GenericValue VMMethod::operator()(va_list ap) { if (classDef->status < ready) @@ -307,59 +257,6 @@ return mvm::MvmModule::executionEngine->runFunction(func, args); } -GenericValue VMObject::operator()(VMField* field) { - return (*field)(this); -} - -void VMObject::operator()(VMField* field, float val) { - return (*field)(this, val); -} - -void VMObject::operator()(VMField* field, double val) { - return (*field)(this, val); -} - -void VMObject::operator()(VMField* field, sint32 val) { - return (*field)(this, val); -} - -void VMObject::operator()(VMField* field, sint64 val) { - return (*field)(this, val); -} - -void VMObject::operator()(VMField* field, VMObject* val) { - return (*field)(this, val); -} - -void VMObject::operator()(VMField* field, bool val) { - return (*field)(this, val); -} - -void VMField::operator()(float val) { - VMField * field = this; - return (*field)(classDef->virtualInstance, val); -} - -void VMField::operator()(double val) { - VMField * field = this; - return (*field)(classDef->virtualInstance, val); -} - -void VMField::operator()(sint64 val) { - VMField * field = this; - return (*field)(classDef->virtualInstance, val); -} - -void VMField::operator()(sint32 val) { - VMField * field = this; - return (*field)(classDef->virtualInstance, val); -} - -void VMField::operator()(bool val) { - VMField * field = this; - return (*field)(classDef->virtualInstance, val); -} - GlobalVariable* VMCommonClass::llvmVar() { if (!_llvmVar) { aquire(); Modified: vmkit/trunk/lib/N3/VMCore/MSCorlib.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/MSCorlib.h?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/MSCorlib.h (original) +++ vmkit/trunk/lib/N3/VMCore/MSCorlib.h Sat Oct 17 08:01:15 2009 @@ -10,6 +10,8 @@ #ifndef N3_MSCORLIB_H #define N3_MSCORLIB_H +#include "N3MetaType.h" + namespace n3 { class N3; @@ -44,47 +46,27 @@ static VMClass* resourceStreamType; static VMMethod* ctorResourceStreamType; + +#define DEF_TYPE(name, type) \ + static VMClass* p##name; + +#define DEF_ARRAY_AND_TYPE(name, type) \ + DEF_TYPE(name, type) \ + static VMClassArray* array##name; \ + static VMField* ctor##name; + + ON_TYPES(DEF_ARRAY_AND_TYPE, _F_NT) + ON_STRING(DEF_ARRAY_AND_TYPE, _F_NT) + ON_VOID(DEF_TYPE, _F_NT) + +#undef DEF_ARRAY_AND_TYPE +#undef DEF_TYPE - static VMClass* pVoid; - static VMClass* pBoolean; - static VMClass* pChar; - static VMClass* pSInt8; - static VMClass* pUInt8; - static VMClass* pSInt16; - static VMClass* pUInt16; - static VMClass* pSInt32; - static VMClass* pUInt32; - static VMClass* pSInt64; - static VMClass* pUInt64; - static VMClass* pFloat; - static VMClass* pDouble; - static VMClass* pIntPtr; - static VMClass* pUIntPtr; - static VMClass* pString; - static VMClass* pObject; static VMClass* pValue; static VMClass* pEnum; static VMClass* pArray; static VMClass* pDelegate; static VMClass* pException; - static VMClassArray* arrayChar; - static VMClassArray* arrayString; - static VMClassArray* arrayByte; - static VMClassArray* arrayObject; - static VMField* ctorBoolean; - static VMField* ctorUInt8; - static VMField* ctorSInt8; - static VMField* ctorChar; - static VMField* ctorSInt16; - static VMField* ctorUInt16; - static VMField* ctorSInt32; - static VMField* ctorUInt32; - static VMField* ctorSInt64; - static VMField* ctorUInt64; - static VMField* ctorIntPtr; - static VMField* ctorUIntPtr; - static VMField* ctorDouble; - static VMField* ctorFloat; }; } // end namespace n3 Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 17 08:01:15 2009 @@ -34,70 +34,61 @@ N3* N3::bootstrapVM = 0; mvm::Lock* VMObject::globalLock = 0; -VMCommonClass* VMClassArray::SuperArray = 0; -std::vector VMClassArray::InterfacesArray; +VMCommonClass* VMClassArray::SuperArray = 0; +std::vector VMClassArray::InterfacesArray; std::vector VMClassArray::VirtualMethodsArray; std::vector VMClassArray::StaticMethodsArray; -std::vector VMClassArray::VirtualFieldsArray; -std::vector VMClassArray::StaticFieldsArray; +std::vector VMClassArray::VirtualFieldsArray; +std::vector VMClassArray::StaticFieldsArray; + +#define DEF_TYPE(name, type) \ + VMClass *MSCorlib::p##name = 0; + +#define DEF_ARRAY_LLVM_TYPE(name, type) \ + const llvm::Type* Array##name::llvmType = 0; + +#define DEF_ARRAY_AND_TYPE(name, type) \ + DEF_TYPE(name, type) \ + VMClassArray *MSCorlib::array##name = 0; \ + VMField* MSCorlib::ctor##name = 0; + +ON_TYPES(DEF_ARRAY_AND_TYPE, _F_NT) +ON_TYPES(DEF_ARRAY_LLVM_TYPE, _F_NT) +ON_STRING(DEF_ARRAY_AND_TYPE, _F_NT) +ON_VOID(DEF_TYPE, _F_NT) + +#undef DEF_ARRAY_LLVM_TYPE +#undef DEF_TYPE +#undef DEF_ARRAY_AND_TYPE -VMClass* MSCorlib::pVoid = 0; -VMClass* MSCorlib::pBoolean= 0; -VMClass* MSCorlib::pChar = 0; -VMClass* MSCorlib::pSInt8 = 0; -VMClass* MSCorlib::pUInt8 = 0; -VMClass* MSCorlib::pSInt16 = 0; -VMClass* MSCorlib::pUInt16 = 0; -VMClass* MSCorlib::pSInt32 = 0; -VMClass* MSCorlib::pUInt32 = 0; -VMClass* MSCorlib::pSInt64 = 0; -VMClass* MSCorlib::pUInt64 = 0; -VMClass* MSCorlib::pFloat = 0; -VMClass* MSCorlib::pDouble = 0; -VMClass* MSCorlib::pIntPtr = 0; -VMClass* MSCorlib::pUIntPtr = 0; -VMClass* MSCorlib::pObject = 0; -VMClass* MSCorlib::pString = 0; VMClass* MSCorlib::pValue = 0; VMClass* MSCorlib::pEnum = 0; VMClass* MSCorlib::pArray = 0; VMClass* MSCorlib::pDelegate = 0; VMClass* MSCorlib::pException = 0; -VMClassArray* MSCorlib::arrayChar = 0; -VMClassArray* MSCorlib::arrayString = 0; -VMClassArray* MSCorlib::arrayObject = 0; -VMClassArray* MSCorlib::arrayByte = 0; + + +const llvm::Type* VMArray::llvmType; +const llvm::Type* VMObject::llvmType; +const llvm::Type* Enveloppe::llvmType; +const llvm::Type* CacheNode::llvmType; + VMMethod* MSCorlib::ctorPropertyType; VMMethod* MSCorlib::ctorMethodType; VMMethod* MSCorlib::ctorClrType; -VMClass* MSCorlib::clrType; -VMField* MSCorlib::typeClrType; -VMField* MSCorlib::propertyPropertyType; -VMField* MSCorlib::methodMethodType; +VMClass* MSCorlib::clrType; +VMField* MSCorlib::typeClrType; +VMField* MSCorlib::propertyPropertyType; +VMField* MSCorlib::methodMethodType; VMMethod* MSCorlib::ctorAssemblyReflection; -VMClass* MSCorlib::assemblyReflection; -VMClass* MSCorlib::typedReference; -VMField* MSCorlib::assemblyAssemblyReflection; -VMClass* MSCorlib::propertyType; -VMClass* MSCorlib::methodType; -VMClass* MSCorlib::resourceStreamType; +VMClass* MSCorlib::assemblyReflection; +VMClass* MSCorlib::typedReference; +VMField* MSCorlib::assemblyAssemblyReflection; +VMClass* MSCorlib::propertyType; +VMClass* MSCorlib::methodType; +VMClass* MSCorlib::resourceStreamType; VMMethod* MSCorlib::ctorResourceStreamType; -VMField* MSCorlib::ctorBoolean; -VMField* MSCorlib::ctorUInt8; -VMField* MSCorlib::ctorSInt8; -VMField* MSCorlib::ctorChar; -VMField* MSCorlib::ctorSInt16; -VMField* MSCorlib::ctorUInt16; -VMField* MSCorlib::ctorSInt32; -VMField* MSCorlib::ctorUInt32; -VMField* MSCorlib::ctorSInt64; -VMField* MSCorlib::ctorUInt64; -VMField* MSCorlib::ctorIntPtr; -VMField* MSCorlib::ctorUIntPtr; -VMField* MSCorlib::ctorDouble; -VMField* MSCorlib::ctorFloat; - const UTF8* N3::clinitName = 0; const UTF8* N3::ctorName = 0; const UTF8* N3::invokeName = 0; @@ -116,11 +107,6 @@ const UTF8* N3::doubleName = 0; const UTF8* N3::testInfinity = 0; -const llvm::Type* VMArray::llvmType; -const llvm::Type* VMObject::llvmType; -const llvm::Type* Enveloppe::llvmType; -const llvm::Type* CacheNode::llvmType; - llvm::Function* CLIJit::printExecutionLLVM; llvm::Function* CLIJit::indexOutOfBoundsExceptionLLVM; llvm::Function* CLIJit::nullPointerExceptionLLVM; @@ -146,13 +132,6 @@ llvm::Function* CLIJit::getCppExceptionLLVM; llvm::Function* CLIJit::newStringLLVM; -#define DEFINE_ARRAY_LLVM_TYPE(name, elmt, size, printer, pre, sep, post) \ - const llvm::Type* Array##name::llvmType = 0; - -ON_ARRAY_CLASSES(DEFINE_ARRAY_LLVM_TYPE) - -#undef DEFINE_ARRAY_LLVM_TYPE - static void initialiseVT() { } @@ -187,27 +166,29 @@ var->virtualType = type; \ }} - INIT(MSCorlib::pObject, "System", "Object", VMObject::llvmType, false); + assert(VMObject::llvmType); + + INIT(MSCorlib::pObject, "System", "Object", VMObject::llvmType, false); INIT(MSCorlib::pValue, "System", "ValueType", 0, false); - INIT(MSCorlib::pVoid, "System", "Void", llvm::Type::getVoidTy(getGlobalContext()), true); - INIT(MSCorlib::pBoolean, "System", "Boolean", llvm::Type::getInt1Ty(getGlobalContext()), true); - INIT(MSCorlib::pUInt8, "System", "Byte", llvm::Type::getInt8Ty(getGlobalContext()), true); - INIT(MSCorlib::pSInt8, "System", "SByte", llvm::Type::getInt8Ty(getGlobalContext()), true); - INIT(MSCorlib::pChar, "System", "Char", llvm::Type::getInt16Ty(getGlobalContext()), true); - INIT(MSCorlib::pSInt16, "System", "Int16", llvm::Type::getInt16Ty(getGlobalContext()), true); - INIT(MSCorlib::pUInt16, "System", "UInt16", llvm::Type::getInt16Ty(getGlobalContext()), true); - INIT(MSCorlib::pSInt32, "System", "Int32", llvm::Type::getInt32Ty(getGlobalContext()), true); - INIT(MSCorlib::pUInt32, "System", "UInt32", llvm::Type::getInt32Ty(getGlobalContext()), true); - INIT(MSCorlib::pSInt64, "System", "Int64", llvm::Type::getInt64Ty(getGlobalContext()), true); - INIT(MSCorlib::pUInt64, "System", "UInt64", llvm::Type::getInt64Ty(getGlobalContext()), true); - INIT(MSCorlib::pIntPtr, "System", "IntPtr", llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(getGlobalContext())), true); - INIT(MSCorlib::pUIntPtr, "System", "UIntPtr", llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(getGlobalContext())), true); - INIT(MSCorlib::pDouble, "System", "Double", llvm::Type::getDoubleTy(getGlobalContext()), true); - INIT(MSCorlib::pFloat, "System", "Single", llvm::Type::getFloatTy(getGlobalContext()), true); - INIT(MSCorlib::pEnum, "System", "Enum", llvm::Type::getInt32Ty(getGlobalContext()), true); - INIT(MSCorlib::pArray, "System", "Array", 0, true); + INIT(MSCorlib::pVoid, "System", "Void", llvm::Type::getVoidTy(getGlobalContext()), true); + INIT(MSCorlib::pBoolean, "System", "Boolean", llvm::Type::getInt1Ty(getGlobalContext()), true); + INIT(MSCorlib::pUInt8, "System", "Byte", llvm::Type::getInt8Ty(getGlobalContext()), true); + INIT(MSCorlib::pSInt8, "System", "SByte", llvm::Type::getInt8Ty(getGlobalContext()), true); + INIT(MSCorlib::pChar, "System", "Char", llvm::Type::getInt16Ty(getGlobalContext()), true); + INIT(MSCorlib::pSInt16, "System", "Int16", llvm::Type::getInt16Ty(getGlobalContext()), true); + INIT(MSCorlib::pUInt16, "System", "UInt16", llvm::Type::getInt16Ty(getGlobalContext()), true); + INIT(MSCorlib::pSInt32, "System", "Int32", llvm::Type::getInt32Ty(getGlobalContext()), true); + INIT(MSCorlib::pUInt32, "System", "UInt32", llvm::Type::getInt32Ty(getGlobalContext()), true); + INIT(MSCorlib::pSInt64, "System", "Int64", llvm::Type::getInt64Ty(getGlobalContext()), true); + INIT(MSCorlib::pUInt64, "System", "UInt64", llvm::Type::getInt64Ty(getGlobalContext()), true); + INIT(MSCorlib::pIntPtr, "System", "IntPtr", llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(getGlobalContext())), true); + INIT(MSCorlib::pUIntPtr, "System", "UIntPtr", llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(getGlobalContext())), true); + INIT(MSCorlib::pDouble, "System", "Double", llvm::Type::getDoubleTy(getGlobalContext()), true); + INIT(MSCorlib::pFloat, "System", "Single", llvm::Type::getFloatTy(getGlobalContext()), true); + INIT(MSCorlib::pEnum, "System", "Enum", llvm::Type::getInt32Ty(getGlobalContext()), true); + INIT(MSCorlib::pArray, "System", "Array", 0, true); INIT(MSCorlib::pException,"System", "Exception", 0, false); - INIT(MSCorlib::pDelegate, "System", "Delegate", 0, false); + INIT(MSCorlib::pDelegate, "System", "Delegate", 0, false); #undef INIT @@ -215,10 +196,11 @@ MSCorlib::loadStringClass(vm); - MSCorlib::arrayChar = ass->constructArray(MSCorlib::pChar, 1); - MSCorlib::arrayString = ass->constructArray(MSCorlib::pString, 1); - MSCorlib::arrayByte = ass->constructArray(MSCorlib::pUInt8, 1); - MSCorlib::arrayObject = ass->constructArray(MSCorlib::pObject, 1); +#define BUILD_ARRAY(name, type) \ + MSCorlib::array##name = ass->constructArray(MSCorlib::p##name, 1); + + ON_TYPES(BUILD_ARRAY, _F_NT); + ON_STRING(BUILD_ARRAY, _F_NT); N3::clinitName = vm->asciizToUTF8(".cctor"); N3::ctorName = vm->asciizToUTF8(".ctor"); Added: vmkit/trunk/lib/N3/VMCore/N3MetaType.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3MetaType.h?rev=84331&view=auto ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3MetaType.h (added) +++ vmkit/trunk/lib/N3/VMCore/N3MetaType.h Sat Oct 17 08:01:15 2009 @@ -0,0 +1,44 @@ +#ifndef _N3_META_TYPE_H_ +#define _N3_META_TYPE_H_ + +#define do_nothing(obj, val) + +#define _APP(A, B) A(B) + +#define ON_PRIMITIVES(_, _F) \ + _APP(_, _F(Boolean, bool, IntVal.getBoolValue(), do_nothing, writeBool, "Array<", " ", ">")) \ + _APP(_, _F(UInt8, uint8, IntVal.getZExtValue(), do_nothing, writeS4, "Array<", " ", ">")) \ + _APP(_, _F(SInt8, sint8, IntVal.getSExtValue(), do_nothing, writeS4, "Array<", " ", ">")) \ + _APP(_, _F(Char, uint16, IntVal.getZExtValue(), do_nothing, writeChar, "", "", "")) \ + _APP(_, _F(UInt16, uint16, IntVal.getZExtValue(), do_nothing, writeS4, "Array<", " ", ">")) \ + _APP(_, _F(SInt16, sint16, IntVal.getSExtValue(), do_nothing, writeS4, "Array<", " ", ">")) \ + _APP(_, _F(UInt32, uint32, IntVal.getZExtValue(), do_nothing, writeS4, "Array<", " ", ">")) \ + _APP(_, _F(SInt32, sint32, IntVal.getSExtValue(), do_nothing, writeS4, "Array<", " ", ">")) \ + _APP(_, _F(UInt64, uint64, IntVal.getZExtValue(), do_nothing, writeS8, "Array<", " ", ">")) \ + _APP(_, _F(SInt64, sint64, IntVal.getSExtValue(), do_nothing, writeS8, "Array<", " ", ">")) \ + _APP(_, _F(UIntPtr, uint*, PointerVal, do_nothing, writePtr, "Array<", " ", ">")) \ + _APP(_, _F(IntPtr, int*, PointerVal, do_nothing, writePtr, "Array<", " ", ">")) \ + _APP(_, _F(Float, float, FloatVal, do_nothing, writeFP, "Array<", " ", ">")) \ + _APP(_, _F(Double, double, DoubleVal, do_nothing, writeFP, "Array<", " ", ">")) + +#define ON_VOID(_, _F) \ + _APP(_, _F(Void, void, abort(), do_nothing, abort(), "", "", "")) + +#define ON_OBJECT(_, _F) \ + _APP(_, _F(Object, VMObject*, PointerVal, llvm_gcroot, writeObj, "Array<", " ", ">")) + +#define ON_STRING(_, _F) \ + _APP(_, _F(String, uint16*, PointerVal, llvm_gcroot, writeObj, "", "", "")) + +#define ON_TYPES(_, _F) \ + ON_PRIMITIVES(_, _F) \ + ON_OBJECT(_, _F) + +#define _F_NT( name, type, gv_extractor, do_root, writer, pre, sep, post) name, type +#define _F_NTR( name, type, gv_extractor, do_root, writer, pre, sep, post) name, type, do_root +#define _F_NTE( name, type, gv_extractor, do_root, writer, pre, sep, post) name, type, gv_extractor +#define _F_NTRW(name, type, gv_extractor, do_root, writer, pre, sep, post) name, type, do_root, writer, pre, sep, post +#define _F_ALL( name, type, gv_extractor, do_root, writer, pre, sep, post) name, type, gv_extractor, writer, do_root, pre, sep, post + + +#endif Modified: vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3ModuleProvider.cpp Sat Oct 17 08:01:15 2009 @@ -26,26 +26,12 @@ bool N3ModuleProvider::materializeFunction(Function *F, std::string *ErrInfo) { if (!F->empty()) return false; VMMethod* meth = functions->lookup(F); + if (!meth) { // VT methods return false; } else { - void* res = - mvm::MvmModule::executionEngine->getPointerToGlobalIfAvailable(meth->methPtr); - if (res == 0) { - meth->classDef->aquire(); - res = - mvm::MvmModule::executionEngine->getPointerToGlobalIfAvailable(meth->methPtr); - if (res == 0) { - CLIJit::compile(meth->classDef, meth); - void* res = mvm::MvmModule::executionEngine->getPointerToGlobal(meth->methPtr); - meth->code = res; - N3* vm = VMThread::get()->getVM(); - vm->addMethodInFunctionMap(meth, res); - } - meth->classDef->release(); - meth->classDef->resolveStatic(true, NULL); - } + meth->compileToNative(); return false; } } Modified: vmkit/trunk/lib/N3/VMCore/VMArray.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.cpp Sat Oct 17 08:01:15 2009 @@ -20,30 +20,21 @@ const sint32 VMArray::MaxArraySize = 268435455; -#define DEFINE_ARRAY_PRINT(name, elmt, nbb, printer, pre, sep, post) \ +#define DEFINE_ARRAY_PRINT(name, type, do_root, printer, pre, sep, post) \ void Array##name::do_print(const Array##name *self, mvm::PrintBuffer *buf) { \ llvm_gcroot(self, 0); \ buf->write(pre); \ for(int i=0; isize; i++) { \ if(i) \ buf->write(sep); \ - buf->printer(self->elements[i]); \ + type cur; \ + do_root(cur, 0); \ + cur = self->elements[i]; \ + buf->printer(cur); \ } \ buf->write(post); \ } -ON_ARRAY_PRIMITIVE_CLASSES(DEFINE_ARRAY_PRINT) - -void ArrayObject::do_print(const ArrayObject *self, mvm::PrintBuffer *buf) { - llvm_gcroot(self, 0); - buf->write("Array<"); - for(int i=0; isize; i++) { - if(i) - buf->write(" "); - declare_gcroot(VMObject*, cur) = self->elements[i]; - buf->writeObj(cur); - } - buf->write(">"); -} +ON_TYPES(DEFINE_ARRAY_PRINT, _F_NTRW) #undef DEFINE_ARRAY_PRINT Modified: vmkit/trunk/lib/N3/VMCore/VMArray.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMArray.h?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMArray.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMArray.h Sat Oct 17 08:01:15 2009 @@ -41,36 +41,18 @@ static llvm::Constant* elementsOffset(); }; -#define ON_ARRAY_PRIMITIVE_CLASSES(_) \ - _(UInt8, uint8, 1, writeS4, "Array<", " ", ">") \ - _(SInt8, sint8, 1, writeS4, "Array<", " ", ">") \ - _(Char, uint16, 2, writeChar, "", "", "") \ - _(UInt16, uint16, 2, writeS4, "Array<", " ", ">") \ - _(SInt16, sint16, 2, writeS4, "Array<", " ", ">") \ - _(UInt32, uint32, 4, writeS4, "Array<", " ", ">") \ - _(SInt32, sint32, 4, writeS4, "Array<", " ", ">") \ - _(UInt64, uint64, 8, writeS8, "Array<", " ", ">") \ - _(SInt64, sint64, 8, writeS8, "Array<", " ", ">") \ - _(Float, float, 4, writeFP, "Array<", " ", ">") \ - _(Double, double, 8, writeFP, "Array<", " ", ">") - -#define ON_ARRAY_CLASSES(_) \ - ON_ARRAY_PRIMITIVE_CLASSES(_) \ - _(Object, VMObject*, 4, writeObj, "Array<", " ", ">") - - // never allocate a VMArray, it is just a C++ type to access N3 object -#define DEFINE_ARRAY_CLASS(name, elmt, nbb, printer, pre, sep, post) \ +#define DEFINE_ARRAY_CLASS(name, type) \ class Array##name : public VMObject { \ void *operator new(size_t n) { return VMObject::operator new(n, 0); } \ public: \ static const llvm::Type* llvmType; \ sint32 size; \ - elmt elements[1]; \ + type elements[1]; \ static void do_print(const Array##name *self, mvm::PrintBuffer* buf); \ }; -ON_ARRAY_CLASSES(DEFINE_ARRAY_CLASS) +ON_TYPES(DEFINE_ARRAY_CLASS, _F_NT) #undef DEFINE_ARRAY_CLASS Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Sat Oct 17 08:01:15 2009 @@ -790,6 +790,31 @@ } } +VMMethod *VMMethod::compileToNative(VMGenericMethod* genMethod) { + if(!code) { + if (classDef->status < ready) + classDef->resolveType(true, true, NULL); + + llvm::Function *methPtr = compiledPtr(genMethod); + void* res = + mvm::MvmModule::executionEngine->getPointerToGlobalIfAvailable(methPtr); + if (res == 0) { + classDef->aquire(); + res = + mvm::MvmModule::executionEngine->getPointerToGlobalIfAvailable(methPtr); + if (res == 0) { + CLIJit::compile(classDef, this); + void* res = mvm::MvmModule::executionEngine->getPointerToGlobal(methPtr); + code = res; + N3* vm = VMThread::get()->getVM(); + vm->addMethodInFunctionMap(this, res); + } + classDef->release(); + classDef->resolveStatic(true, NULL); + } + } + return this; +} bool VMMethod::signatureEquals(std::vector& args) { bool stat = isStatic(flags); Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Sat Oct 17 08:01:15 2009 @@ -21,6 +21,8 @@ #include "llvm/Function.h" #include "llvm/Type.h" +#include "N3MetaType.h" + #include namespace mvm { @@ -224,12 +226,19 @@ bool canBeInlined; void* code; - - llvm::GenericValue operator()(...); - llvm::GenericValue operator()(va_list ap); - llvm::GenericValue operator()(VMObject* obj, va_list ap); - llvm::GenericValue operator()(std::vector& args); - llvm::GenericValue run(...); + + VMMethod *compileToNative(VMGenericMethod* genMethod=0); + + llvm::GenericValue invokeGeneric(std::vector& args); + llvm::GenericValue invokeGeneric(va_list ap); + +#define DEFINE_CALLER(name, type) \ + type invoke##name(...); + + ON_TYPES(DEFINE_CALLER, _F_NT) + ON_VOID(DEFINE_CALLER, _F_NT) + +#undef DEFINE_CALLER const llvm::FunctionType* getSignature(VMGenericMethod* genMethod); static const llvm::FunctionType* resolveSignature( @@ -265,18 +274,13 @@ void initField(VMObject* obj); - llvm::GenericValue operator()(VMObject* obj = 0); - void operator()(VMObject* obj, bool val); - void operator()(VMObject* obj, float val); - void operator()(VMObject* obj, double val); - void operator()(VMObject* obj, sint32 val); - void operator()(VMObject* obj, sint64 val); - void operator()(VMObject* obj, VMObject* val); - void operator()(bool val); - void operator()(float val); - void operator()(double val); - void operator()(sint32 val); - void operator()(sint64 val); +#define DEF_VMFIELD_ASSESSORS(name, type) \ + void set##name(VMObject *obj, type value); \ + type get##name(VMObject *obj); + + ON_TYPES(DEF_VMFIELD_ASSESSORS, _F_NT) + +#undef DEF_VMFIELD_ASSESSORS llvm::GlobalVariable* llvmVar(); llvm::GlobalVariable* _llvmVar; Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=84331&r1=84330&r2=84331&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMObject.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMObject.h Sat Oct 17 08:01:15 2009 @@ -12,6 +12,8 @@ #include +#include "N3MetaType.h" + #include "llvm/Constants.h" #include "llvm/Type.h" #include "llvm/ExecutionEngine/GenericValue.h" @@ -98,14 +100,6 @@ #define verifyNull(obj) \ if (obj == 0) VMThread::get()->getVM()->nullPointerException(""); #endif - - llvm::GenericValue operator()(VMField* field); - void operator()(VMField* field, float val); - void operator()(VMField* field, double val); - void operator()(VMField* field, sint64 val); - void operator()(VMField* field, sint32 val); - void operator()(VMField* field, VMObject* val); - void operator()(VMField* field, bool val); }; From gael.thomas at lip6.fr Sat Oct 17 06:54:20 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 17 Oct 2009 13:54:20 -0000 Subject: [vmkit-commits] [vmkit] r84332 - in /vmkit/trunk/lib/N3: Mono/Mono.cpp Mono/MonoMSCorlib.cpp Mono/MonoString.cpp PNetLib/PNetLib.cpp PNetLib/PNetMSCorlib.cpp PNetLib/PNetString.cpp VMCore/Assembly.cpp VMCore/CLIJitMeta.cpp VMCore/CLIRuntimeJIT.cpp VMCore/N3.cpp VMCore/Opcodes.cpp VMCore/VMClass.cpp VMCore/VMClass.h VMCore/VirtualTables.cpp Message-ID: <200910171354.n9HDsLBW007926@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 17 08:54:19 2009 New Revision: 84332 URL: http://llvm.org/viewvc/llvm-project?rev=84332&view=rev Log: All objects of VMCore are now marked with gcroot Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/Mono/MonoString.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.cpp vmkit/trunk/lib/N3/VMCore/Assembly.cpp vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp vmkit/trunk/lib/N3/VMCore/N3.cpp vmkit/trunk/lib/N3/VMCore/Opcodes.cpp vmkit/trunk/lib/N3/VMCore/VMClass.cpp vmkit/trunk/lib/N3/VMCore/VMClass.h vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Sat Oct 17 08:54:19 2009 @@ -112,7 +112,9 @@ if (want_name && *int_code_page == -1) { N3 *vm = (N3*)VMThread::get()->getVM(); - return (MonoString*)(vm->arrayToString(vm->asciizToArray(cset))); + declare_gcroot(ArrayChar*, array_res) = vm->asciizToArray(cset); + declare_gcroot(MonoString*, res) = (MonoString*)(vm->arrayToString(array_res)); + return res; } else return NULL; } @@ -160,10 +162,13 @@ { N3 *vm = (N3*)VMThread::get()->getVM(); #if defined (PLATFORM_WIN32) - return (MonoString*)(vm->arrayToString(vm->asciizToArray("\r\n"))); + declare_gcroot(ArrayChar*, array) = vm->asciizToArray("\r\n"); #else - return (MonoString*)(vm->arrayToString(vm->asciizToArray("\n"))); + declare_gcroot(ArrayChar*, array) = vm->asciizToArray("\n"); #endif + + declare_gcroot(MonoString*, res) = (MonoString*)vm->arrayToString(array); + return res; } extern "C" void @@ -262,7 +267,7 @@ extern "C" VMObject* System_Object_MemberwiseClone(VMObject* obj) { uint64 size = obj->objectSize(); - VMObject* res = ((VMClass*)obj->classOf)->doNew(); + declare_gcroot(VMObject*, res) = ((VMClass*)obj->classOf)->doNew(); memcpy(res, obj, size); res->lockObj = 0; return res; @@ -282,7 +287,7 @@ extern "C" void System_String__ctor(MonoString* str, ArrayChar* array, sint32 startIndex, sint32 count) { N3* vm = VMThread::get()->getVM(); - const ArrayChar* value = vm->bufToArray(&(array->elements[startIndex]), count); + declare_gcroot(const ArrayChar*, value) = vm->bufToArray(&(array->elements[startIndex]), count); str->length = count; str->startChar = array->elements[startIndex]; str->value = value; @@ -334,14 +339,15 @@ } N3* vm = (N3*)VMThread::get()->getVM(); - const ArrayChar* array = vm->bufToArray(dest, length); - return (MonoString*)vm->arrayToString(array); + declare_gcroot(const ArrayChar*, array) = vm->bufToArray(dest, length); + declare_gcroot(MonoString*, res) = (MonoString*)vm->arrayToString(array); + return res; } extern "C" MonoString * System_String_InternalAllocateStr (sint32 length) { - MonoString* str = (MonoString*)(MSCorlib::pString->doNew()); + declare_gcroot(MonoString*, str) = (MonoString*)MSCorlib::pString->doNew(); str->length = length; return str; } Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Sat Oct 17 08:54:19 2009 @@ -150,7 +150,7 @@ VMObject* VMCommonClass::getClassDelegatee() { declare_gcroot(VMObject*, delegatee) = ooo_delegatee; if (!delegatee) { - ooo_delegatee = delegatee = (*MSCorlib::clrType)(); + ooo_delegatee = delegatee = MSCorlib::clrType->doNew(); MSCorlib::typeClrType->setIntPtr(delegatee, (int*)this); } return delegatee; @@ -169,6 +169,6 @@ vm->asciizToUTF8("Thread"), vm->asciizToUTF8("System.Threading"), true, true, true, true); - declare_gcroot(VMObject*, appThread) = (*cl)(); + declare_gcroot(VMObject*, appThread) = cl->doNew(); VMThread::get()->ooo_appThread = appThread; } Modified: vmkit/trunk/lib/N3/Mono/MonoString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.cpp Sat Oct 17 08:54:19 2009 @@ -26,7 +26,7 @@ CLIString* CLIString::stringDup(const ArrayChar*& array, N3* vm) { - MonoString* obj = (MonoString*)(*MSCorlib::pString)(); + declare_gcroot(MonoString*, obj) = (MonoString*)MSCorlib::pString->doNew(); obj->length = array->size; if (array->size == 0) { obj->startChar = 0; @@ -38,7 +38,8 @@ } const ArrayChar* CLIString::strToArray(N3* vm) const { - return ((MonoString *)this)->value; + declare_gcroot(const ArrayChar*, res) = ((MonoString *)this)->value; + return res; } GlobalVariable* CLIString::llvmVar() { Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 17 08:54:19 2009 @@ -164,14 +164,16 @@ extern "C" VMObject* System_Globalization_CultureInfo_InternalCultureName() { char* val = ILGetCultureName(); N3* vm = (N3*)(VMThread::get()->getVM()); + declare_gcroot(ArrayChar*, array) = 0; + if (val) { - VMObject* ret = vm->arrayToString(vm->asciizToArray(val)); + array = vm->asciizToArray(val); free(val); - return ret; } else { - VMObject* ret = vm->arrayToString(vm->asciizToArray("iv")); - return ret; + array = vm->asciizToArray("iv"); } + declare_gcroot(VMObject*, res) = vm->arrayToString(array); + return res; } static const ArrayChar* newBuilder(N3* vm, PNetString* value, uint32 length) { @@ -191,19 +193,22 @@ } } - return vm->bufToArray(buf, strLength); + declare_gcroot(ArrayChar*, array_res) = vm->bufToArray(buf, strLength); + return array_res; } extern "C" VMObject* System_String_NewBuilder(PNetString* value, uint32 length) { N3* vm = (N3*)(VMThread::get()->getVM()); - PNetString* str = (PNetString*)vm->arrayToString(newBuilder(vm, value, length)); + declare_gcroot(PNetString*, str) = (PNetString*)vm->arrayToString(newBuilder(vm, value, length)); return str; } extern "C" VMObject* Platform_SysCharInfo_GetNewLine() { N3* vm = (N3*)(VMThread::get()->getVM()); - return vm->arrayToString(vm->asciizToArray("\n")); + declare_gcroot(ArrayChar*, array) = vm->asciizToArray("\n"); + declare_gcroot(VMObject*, res) = vm->arrayToString(array); + return res; } extern "C" void System_String_CopyToChecked(PNetString* str, sint32 sstart, @@ -258,14 +263,14 @@ } extern "C" PNetString* System_String_NewString(uint32 size) { - PNetString* str = (PNetString*)(MSCorlib::pString->doNew()); + declare_gcroot(PNetString*, str) = (PNetString*)MSCorlib::pString->doNew(); str->length = size; return str; } extern "C" void System_String_Copy_3(PNetString* dest, sint32 pos, PNetString* src) { - ArrayChar* arr = (ArrayChar*)MSCorlib::arrayChar->doNew(pos + src->value->size); + declare_gcroot(ArrayChar*, arr) = (ArrayChar*)MSCorlib::arrayChar->doNew(pos + src->value->size); for (sint32 i = 0; i < pos; ++i) { arr->elements[i] = dest->value->elements[i]; @@ -303,7 +308,8 @@ else dest->length = top; - dest->value = VMThread::get()->getVM()->bufToArray(buf, dest->length); + declare_gcroot(ArrayChar*, array) = VMThread::get()->getVM()->bufToArray(buf, dest->length); + dest->value = array; } // printf("---> %s\n", mvm::PrintBuffer(VMThread::get()->getVM()->arrayToUTF8(dest->value)).cString()); } @@ -379,7 +385,8 @@ } buf[index] = value; - PNetString* str = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length)); + declare_gcroot(ArrayChar*, array_res) = vm->bufToArray(buf, length); + declare_gcroot(PNetString*, str) = (PNetString*)vm->arrayToString(array_res); obj->buildString = str; return obj; @@ -411,7 +418,8 @@ (buildLength - index) * sizeof(uint16)); } - PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length)); + declare_gcroot(ArrayChar*, array_res) = vm->bufToArray(buf, length); + declare_gcroot(PNetString*, val) = (PNetString*)vm->arrayToString(array_res); obj->buildString = val; return obj; @@ -429,7 +437,8 @@ memcpy(buf, array->elements, length * sizeof(uint16)); buf[length] = value; - PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length + 1)); + declare_gcroot(ArrayChar*, array_res) = vm->bufToArray(buf, length + 1); + declare_gcroot(PNetString*, val) = (PNetString*)vm->arrayToString(array_res); obj->buildString = val; return obj; } @@ -450,7 +459,8 @@ memcpy(buf, buildArray->elements, buildLength * sizeof(uint16)); memcpy(&(buf[buildLength]), strArray->elements, strLength * sizeof(uint16)); - PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, length)); + declare_gcroot(ArrayChar*, array_res) = vm->bufToArray(buf, length); + declare_gcroot(PNetString*, val) = (PNetString*)vm->arrayToString(array_res); obj->buildString = val; return obj; } @@ -530,7 +540,8 @@ memcpy(buf, a1->elements, len1 * sizeof(uint16)); memcpy(&(buf[len1]), a2->elements, len2 * sizeof(uint16)); - PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, len1 + len2)); + declare_gcroot(ArrayChar*, array_res) = vm->bufToArray(buf, len1 + len2); + declare_gcroot(PNetString*, val) = (PNetString*)vm->arrayToString(array_res); return val; } @@ -549,7 +560,8 @@ memcpy(&(buf[len1]), a2->elements, len2 * sizeof(uint16)); memcpy(&(buf[len1 + len2]), a3->elements, len3 * sizeof(uint16)); - PNetString* val = (PNetString*)vm->arrayToString(vm->bufToArray(buf, len1 + len2 + len3)); + declare_gcroot(ArrayChar*, array_res) = vm->bufToArray(buf, len1 + len2 + len3); + declare_gcroot(PNetString*, val) = (PNetString*)vm->arrayToString(array_res); return val; } @@ -578,13 +590,13 @@ memcpy(&(buf[j]), &(array->elements[index + length]), (strLength - (index + length)) * sizeof(uint16)); } - const ArrayChar* res = VMThread::get()->getVM()->bufToArray(buf, j); + declare_gcroot(const ArrayChar*, res) = VMThread::get()->getVM()->bufToArray(buf, j); str->value = res; str->length = j; } extern "C" void System_String__ctor_3(PNetString* str, uint16 ch, sint32 count) { - ArrayChar* array = (ArrayChar*)MSCorlib::arrayChar->doNew(count); + declare_gcroot(ArrayChar*, array) = (ArrayChar*)MSCorlib::arrayChar->doNew(count); for (sint32 i = 0; i < count; ++i) { array->elements[i] = ch; } @@ -778,12 +790,12 @@ llvm::GenericValue gv; try{ - gv = (*meth)(gvargs); + gv = meth->compileToNative()->invokeGeneric(gvargs); }catch(...) { assert(0); } - VMObject* res = 0; + declare_gcroot(VMObject*, res) = 0; VMCommonClass* retType = meth->parameters[0]; #define CONSTRUCT_RES(name, type, gv_extractor) \ @@ -793,7 +805,7 @@ } if (retType == MSCorlib::pVoid) { - res = (*MSCorlib::pVoid)(); + res = MSCorlib::pVoid->doNew(); } ON_PRIMITIVES(CONSTRUCT_RES, _F_NTE) else { if (retType->super == MSCorlib::pValue || retType->super == MSCorlib::pEnum) VMThread::get()->getVM()->error("implement me"); @@ -839,8 +851,8 @@ length = reader->readU4(); if (length > (sectionLen - 4)) return 0; - VMObject* res = (*MSCorlib::resourceStreamType)(); - (*MSCorlib::ctorResourceStreamType)(res, ass, (uint64)start, (uint64)length); + declare_gcroot(VMObject*, res) = MSCorlib::resourceStreamType->doNew(); + MSCorlib::ctorResourceStreamType->compileToNative()->invokeVoid(res, ass, (uint64)start, (uint64)length); return res; } @@ -890,8 +902,9 @@ memcpy(buf, array->elements, length * sizeof(uint16)); ILUnicodeStringToLower((void*)buf, (void*)array->elements, length); - const ArrayChar* res = vm->bufToArray(buf, length); - return ((N3*)vm)->arrayToString(res); + declare_gcroot(const ArrayChar*, res) = vm->bufToArray(buf, length); + declare_gcroot(VMObject*, res_str) = vm->arrayToString(res); + return res_str; } extern "C" VMObject* System_String_Replace(PNetString* str, uint16 c1, uint16 c2) { @@ -906,8 +919,9 @@ } N3* vm = (N3*)VMThread::get()->getVM(); - const ArrayChar* res = vm->bufToArray(buf, length); - return vm->arrayToString(res); + declare_gcroot(const ArrayChar*, res) = vm->bufToArray(buf, length); + declare_gcroot(VMObject*, res_str) = vm->arrayToString(res); + return res_str; } extern "C" uint32 System_Reflection_ClrResourceStream_ResourceRead(Assembly* assembly, uint64 position, ArrayUInt8* buffer, uint32 offset, uint32 count) { @@ -966,7 +980,7 @@ } N3* vm = VMThread::get()->getVM(); - const ArrayChar* val = vm->bufToArray(buf, length); + declare_gcroot(const ArrayChar*, val) = vm->bufToArray(buf, length); str->value = val; str->length = length; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetMSCorlib.cpp Sat Oct 17 08:54:19 2009 @@ -132,20 +132,26 @@ } VMObject* Property::getPropertyDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { - delegatee = (*MSCorlib::propertyType)(); - (*MSCorlib::ctorPropertyType)(delegatee); + ooo_delegatee = delegatee = MSCorlib::propertyType->doNew(); + MSCorlib::ctorPropertyType->compileToNative()->invokeVoid(delegatee); MSCorlib::propertyPropertyType->setIntPtr(delegatee, (int*)this); } + return delegatee; } VMObject* VMMethod::getMethodDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { - delegatee = (*MSCorlib::methodType)(); - (*MSCorlib::ctorMethodType)(delegatee); + ooo_delegatee = delegatee = MSCorlib::methodType->doNew(); + MSCorlib::ctorMethodType->compileToNative()->invokeVoid(delegatee); MSCorlib::methodMethodType->setIntPtr(delegatee, (int*)this); } + return delegatee; } @@ -153,10 +159,11 @@ declare_gcroot(VMObject*, delegatee) = ooo_delegatee; if (!delegatee) { - ooo_delegatee = delegatee = (*MSCorlib::clrType)(); - (*MSCorlib::ctorClrType)(delegatee); + ooo_delegatee = delegatee = MSCorlib::clrType->doNew(); + MSCorlib::ctorClrType->compileToNative()->invokeVoid(delegatee); MSCorlib::typeClrType->setIntPtr(delegatee, (int*)this); } + return delegatee; } @@ -164,10 +171,11 @@ declare_gcroot(VMObject*, delegatee) = ooo_delegatee; if (!delegatee) { - ooo_delegatee = delegatee = (*MSCorlib::assemblyReflection)(); - (*MSCorlib::ctorAssemblyReflection)(delegatee); + ooo_delegatee = delegatee = MSCorlib::assemblyReflection->doNew(); + MSCorlib::ctorAssemblyReflection->compileToNative()->invokeVoid(delegatee); MSCorlib::assemblyAssemblyReflection->setIntPtr(delegatee, (int*)this); } + return delegatee; } @@ -176,15 +184,16 @@ vm->asciizToUTF8("Thread"), vm->asciizToUTF8("System.Threading"), true, true, true, true); - declare_gcroot(VMObject*, appThread) = (*cl)(); + declare_gcroot(VMObject*, appThread) = cl->doNew(); + std::vector args; args.push_back(MSCorlib::pVoid); args.push_back(cl); args.push_back(MSCorlib::pIntPtr); - VMMethod* meth = cl->lookupMethod(vm->asciizToUTF8(".ctor"), args, + VMMethod* ctor = cl->lookupMethod(vm->asciizToUTF8(".ctor"), args, false, false); VMThread* myth = VMThread::get(); - (*meth)(appThread, myth); + ctor->compileToNative()->invokeVoid(appThread, myth); myth->ooo_appThread = appThread; } Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.cpp Sat Oct 17 08:54:19 2009 @@ -25,7 +25,7 @@ CLIString* CLIString::stringDup(const ArrayChar*& array, N3* vm) { - PNetString* obj = (PNetString*)(*MSCorlib::pString)(); + declare_gcroot(PNetString*, obj) = (PNetString*)MSCorlib::pString->doNew(); obj->capacity = array->size; obj->length = array->size; if (array->size == 0) { @@ -38,7 +38,8 @@ } const ArrayChar* CLIString::strToArray(N3* vm) const { - return ((PNetString*)this)->value; + declare_gcroot(const ArrayChar*, res) = ((PNetString*)this)->value; + return res; } GlobalVariable* CLIString::llvmVar() { Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sat Oct 17 08:54:19 2009 @@ -705,7 +705,8 @@ const ArrayChar* Assembly::readUTF16(N3* vm, uint32 len, Reader* reader) { - return readUTF16(vm, len, reader->bytes, reader->cursor); + declare_gcroot(const ArrayChar*, res) = readUTF16(vm, len, reader->bytes, reader->cursor); + return res; } const ArrayChar* Assembly::readUTF16(N3* vm, uint32 len, @@ -718,7 +719,8 @@ buf[i] = cur; ++i; } - return vm->bufToArray(buf, realLen); + declare_gcroot(ArrayChar*, res) = vm->bufToArray(buf, realLen); + return res; } const UTF8* Assembly::readUTF8(N3* vm, uint32 len, Reader* reader) { @@ -1289,7 +1291,7 @@ if (cl == cons->classDef) { uint32 blobOffset = CLIHeader->blobStream->realOffset; std::vector args; - VMObject* obj = (*cons->classDef)(); + declare_gcroot(VMObject*, obj) = cons->classDef->doNew(); args.push_back(llvm::GenericValue(obj)); readCustomAttributes(blobOffset + attrArray[CONSTANT_CUSTOM_ATTRIBUTE_VALUE], args, cons); @@ -1298,7 +1300,7 @@ } } - ArrayObject* res = (ArrayObject*)MSCorlib::arrayObject->doNew(vec.size()); + declare_gcroot(ArrayObject*, res) = (ArrayObject*)MSCorlib::arrayObject->doNew(vec.size()); for (uint32 i = 0; i < vec.size(); ++i) res->elements[i] = vec[i]; @@ -1897,7 +1899,8 @@ } } - return readUTF16((N3*)(VMThread::get()->getVM()), size, bytes, offset); + declare_gcroot(const ArrayChar*, res) = readUTF16((N3*)(VMThread::get()->getVM()), size, bytes, offset); + return res; } uint32 Assembly::getRVAFromField(uint32 token) { Modified: vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIJitMeta.cpp Sat Oct 17 08:54:19 2009 @@ -27,12 +27,6 @@ using namespace n3; using namespace llvm; -VMObject* VMClass::operator()() { - if (status < ready) - resolveType(true, true, NULL); - return doNew(); -} - // TODO: MUST CHECK the type! // if (llvm::isa(signature->naturalType)) { // if (signature->naturalType == Type::getFloatTy(getGlobalContext())) { @@ -66,13 +60,13 @@ #undef IMPLEMENTS_VMFIELD_ASSESSORS GenericValue VMMethod::invokeGeneric(std::vector& args) { - assert(code); + // at this step, we must not launch the gc because objects arguments are somewhere in the stack a copying collector + // can not know where they are + assert(code); // compiling a method can trigger a gc return mvm::MvmModule::executionEngine->runFunction(methPtr, args); } GenericValue VMMethod::invokeGeneric(va_list ap) { - assert(code); - Function* func = methPtr; std::vector args; for (Function::arg_iterator i = func->arg_begin(), e = func->arg_end(); @@ -111,6 +105,13 @@ return invokeGeneric(args); } +GenericValue VMMethod::invokeGeneric(...) { + va_list ap; + va_start(ap, this); + GenericValue res = invokeGeneric(ap); + va_end(ap); + return res; +} #define DEFINE_INVOKE(name, type, extractor) \ type VMMethod::invoke##name(...) { \ @@ -138,124 +139,124 @@ #undef DEFINE_INVOKE_VOID -// mettre en param un Function * -// materializeFunction avant -GenericValue VMMethod::operator()(va_list ap) { +// // mettre en param un Function * +// // materializeFunction avant +// GenericValue VMMethod::operator()(va_list ap) { - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); +// if (classDef->status < ready) +// classDef->resolveType(true, true, NULL); - Function* func = compiledPtr(NULL); +// Function* func = compiledPtr(NULL); - std::vector args; - for (Function::arg_iterator i = func->arg_begin(), e = func->arg_end(); - i != e; ++i) { - const Type* type = i->getType(); - if (type == Type::getInt8Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(8, va_arg(ap, int)); - args.push_back(gv); - } else if (type == Type::getInt16Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(16, va_arg(ap, int)); - args.push_back(gv); - } else if (type == Type::getInt32Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(32, va_arg(ap, int)); - args.push_back(gv); - } else if (type == Type::getInt64Ty(getGlobalContext())) { - GenericValue gv1; - gv1.IntVal = APInt(64, va_arg(ap, uint64)); - args.push_back(gv1); - } else if (type == Type::getDoubleTy(getGlobalContext())) { - GenericValue gv1; - gv1.DoubleVal = va_arg(ap, double); - args.push_back(gv1); - } else if (type == Type::getFloatTy(getGlobalContext())) { - GenericValue gv; - gv.FloatVal = (float)(va_arg(ap, double)); - args.push_back(gv); - } else { - GenericValue gv(va_arg(ap, VMObject*)); - args.push_back(gv); - } - } +// std::vector args; +// for (Function::arg_iterator i = func->arg_begin(), e = func->arg_end(); +// i != e; ++i) { +// const Type* type = i->getType(); +// if (type == Type::getInt8Ty(getGlobalContext())) { +// GenericValue gv; +// gv.IntVal = APInt(8, va_arg(ap, int)); +// args.push_back(gv); +// } else if (type == Type::getInt16Ty(getGlobalContext())) { +// GenericValue gv; +// gv.IntVal = APInt(16, va_arg(ap, int)); +// args.push_back(gv); +// } else if (type == Type::getInt32Ty(getGlobalContext())) { +// GenericValue gv; +// gv.IntVal = APInt(32, va_arg(ap, int)); +// args.push_back(gv); +// } else if (type == Type::getInt64Ty(getGlobalContext())) { +// GenericValue gv1; +// gv1.IntVal = APInt(64, va_arg(ap, uint64)); +// args.push_back(gv1); +// } else if (type == Type::getDoubleTy(getGlobalContext())) { +// GenericValue gv1; +// gv1.DoubleVal = va_arg(ap, double); +// args.push_back(gv1); +// } else if (type == Type::getFloatTy(getGlobalContext())) { +// GenericValue gv; +// gv.FloatVal = (float)(va_arg(ap, double)); +// args.push_back(gv); +// } else { +// GenericValue gv(va_arg(ap, VMObject*)); +// args.push_back(gv); +// } +// } - return mvm::MvmModule::executionEngine->runFunction(func, args); -} +// return mvm::MvmModule::executionEngine->runFunction(func, args); +// } -GenericValue VMMethod::operator()(VMObject* obj, va_list ap) { +// GenericValue VMMethod::operator()(VMObject* obj, va_list ap) { - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); +// if (classDef->status < ready) +// classDef->resolveType(true, true, NULL); - Function* func = compiledPtr(NULL); +// Function* func = compiledPtr(NULL); - std::vector args; - GenericValue object(obj); - args.push_back(object); - - for (Function::arg_iterator i = ++(func->arg_begin()), e = func->arg_end(); - i != e; ++i) { - const Type* type = i->getType(); - if (type == Type::getInt8Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(8, va_arg(ap, int)); - args.push_back(gv); - } else if (type == Type::getInt16Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(16, va_arg(ap, int)); - args.push_back(gv); - } else if (type == Type::getInt32Ty(getGlobalContext())) { - GenericValue gv; - gv.IntVal = APInt(32, va_arg(ap, int)); - args.push_back(gv); - } else if (type == Type::getInt64Ty(getGlobalContext())) { - GenericValue gv1; - gv1.IntVal = APInt(64, va_arg(ap, uint64)); - args.push_back(gv1); - } else if (type == Type::getDoubleTy(getGlobalContext())) { - GenericValue gv1; - gv1.DoubleVal = va_arg(ap, double); - args.push_back(gv1); - } else if (type == Type::getFloatTy(getGlobalContext())) { - GenericValue gv; - gv.FloatVal = (float)(va_arg(ap, double)); - args.push_back(gv); - } else { - GenericValue gv(va_arg(ap, VMObject*)); - args.push_back(gv); - } - } +// std::vector args; +// GenericValue object(obj); +// args.push_back(object); + +// for (Function::arg_iterator i = ++(func->arg_begin()), e = func->arg_end(); +// i != e; ++i) { +// const Type* type = i->getType(); +// if (type == Type::getInt8Ty(getGlobalContext())) { +// GenericValue gv; +// gv.IntVal = APInt(8, va_arg(ap, int)); +// args.push_back(gv); +// } else if (type == Type::getInt16Ty(getGlobalContext())) { +// GenericValue gv; +// gv.IntVal = APInt(16, va_arg(ap, int)); +// args.push_back(gv); +// } else if (type == Type::getInt32Ty(getGlobalContext())) { +// GenericValue gv; +// gv.IntVal = APInt(32, va_arg(ap, int)); +// args.push_back(gv); +// } else if (type == Type::getInt64Ty(getGlobalContext())) { +// GenericValue gv1; +// gv1.IntVal = APInt(64, va_arg(ap, uint64)); +// args.push_back(gv1); +// } else if (type == Type::getDoubleTy(getGlobalContext())) { +// GenericValue gv1; +// gv1.DoubleVal = va_arg(ap, double); +// args.push_back(gv1); +// } else if (type == Type::getFloatTy(getGlobalContext())) { +// GenericValue gv; +// gv.FloatVal = (float)(va_arg(ap, double)); +// args.push_back(gv); +// } else { +// GenericValue gv(va_arg(ap, VMObject*)); +// args.push_back(gv); +// } +// } - return mvm::MvmModule::executionEngine->runFunction(func, args); -} +// return mvm::MvmModule::executionEngine->runFunction(func, args); +// } -GenericValue VMMethod::operator()(...) { - va_list ap; - va_start(ap, this); - GenericValue ret = (*this)(ap); - va_end(ap); - return ret; -} +// GenericValue VMMethod::operator()(...) { +// va_list ap; +// va_start(ap, this); +// GenericValue ret = (*this)(ap); +// va_end(ap); +// return ret; +// } + +// GenericValue VMMethod::run(...) { +// va_list ap; +// va_start(ap, this); +// GenericValue ret = (*this)(ap); +// va_end(ap); +// return ret; +// } -GenericValue VMMethod::run(...) { - va_list ap; - va_start(ap, this); - GenericValue ret = (*this)(ap); - va_end(ap); - return ret; -} - -GenericValue VMMethod::operator()(std::vector& args) { +// GenericValue VMMethod::operator()(std::vector& args) { - if (classDef->status < ready) - classDef->resolveType(true, true, NULL); +// if (classDef->status < ready) +// classDef->resolveType(true, true, NULL); - Function* func = compiledPtr(NULL); - return mvm::MvmModule::executionEngine->runFunction(func, args); -} +// Function* func = compiledPtr(NULL); +// return mvm::MvmModule::executionEngine->runFunction(func, args); +// } GlobalVariable* VMCommonClass::llvmVar() { if (!_llvmVar) { Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Sat Oct 17 08:54:19 2009 @@ -29,6 +29,8 @@ #include "VMThread.h" #include "Assembly.h" +#include "mvm/GC/GC.h" + #include using namespace n3; @@ -56,7 +58,8 @@ extern "C" VMObject* newString(const ArrayChar* utf8) { N3 *vm = (N3*)VMThread::get()->getVM(); - return vm->arrayToString(utf8); + declare_gcroot(VMObject*, res) = vm->arrayToString(utf8); + return res; } extern "C" bool n3InstanceOf(VMObject* obj, VMCommonClass* cl) { @@ -89,7 +92,7 @@ sint32 n = buf[0]; if (n < 0) VMThread::get()->getVM()->negativeArraySizeException(n); - VMArray* res = (VMArray*)cl->doNew(n); + declare_gcroot(VMArray*, res) = (VMArray*)cl->doNew(n); if (dim > 1) { VMCommonClass* base = cl->baseClass; if (n > 0) { @@ -182,9 +185,11 @@ } extern "C" VMObject* newObject(VMClass* cl) { - return cl->doNew(); + declare_gcroot(VMObject*, res) = cl->doNew(); + return res; } extern "C" VMObject* newArray(VMClassArray* cl, sint32 nb) { - return cl->doNew(nb); + declare_gcroot(VMObject*, res) = cl->doNew(nb); + return res; } Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/N3.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/N3.cpp Sat Oct 17 08:54:19 2009 @@ -291,7 +291,7 @@ uint32 typeToken = assembly->getTypeDefTokenFromMethod(entryPoint); assembly->loadType(this, typeToken, true, true, true ,true, NULL, NULL); VMMethod* mainMeth = assembly->lookupMethodFromToken(entryPoint); - (*mainMeth)(args); + mainMeth->compileToNative()->invokeGeneric(args); } } } @@ -319,9 +319,11 @@ MSCorlib::loadBootstrap(vm); ClArgumentsInfo& info = vm->argumentsInfo; - ArrayObject* args = (ArrayObject*)MSCorlib::arrayString->doNew(info.argc-2); + declare_gcroot(ArrayObject*, args) = (ArrayObject*)MSCorlib::arrayString->doNew(info.argc-2); for (int i = 2; i < info.argc; ++i) { - args->elements[i - 2] = (VMObject*)vm->arrayToString(vm->asciizToArray(info.argv[i])); + declare_gcroot(ArrayChar*, arg_array) = vm->asciizToArray(info.argv[i]); + declare_gcroot(VMObject*, arg) = vm->arrayToString(arg_array); + args->elements[i - 2] = arg; } try{ @@ -342,20 +344,21 @@ ArrayChar* N3::asciizToArray(const char* asciiz) { uint32 len = strlen(asciiz); - ArrayChar *res = (ArrayChar*)MSCorlib::arrayChar->doNew(len); + declare_gcroot(ArrayChar*, res) = (ArrayChar*)MSCorlib::arrayChar->doNew(len); for(uint32 i=0; ielements[i] = asciiz[i]; return res; } ArrayChar* N3::bufToArray(const uint16* buf, uint32 size) { - ArrayChar *res = (ArrayChar*)MSCorlib::arrayChar->doNew(size); + declare_gcroot(ArrayChar*, res) = (ArrayChar*)MSCorlib::arrayChar->doNew(size); memcpy(res->elements, buf, size<<1); return res; } ArrayChar* N3::UTF8ToArray(const UTF8 *utf8) { - return bufToArray(utf8->elements, utf8->size); + declare_gcroot(ArrayChar*, res) = bufToArray(utf8->elements, utf8->size); + return res; } const UTF8* N3::asciizToUTF8(const char* asciiz) { @@ -371,7 +374,8 @@ } CLIString *N3::arrayToString(const ArrayChar *array) { - return (CLIString*)CLIString::stringDup(array, this); + declare_gcroot(CLIString*, res) = (CLIString*)CLIString::stringDup(array, this); + return res; } #include "MSCorlib.inc" Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Sat Oct 17 08:54:19 2009 @@ -1573,7 +1573,8 @@ case LDSTR : { uint32 value = readU4(bytecodes, i); uint32 index = value & 0xfffffff; - const ArrayChar* array = compilingClass->assembly->readUserString(index); + // must modify this opcode + declare_gcroot(const ArrayChar*, array) = compilingClass->assembly->readUserString(index); Value* val = ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), (int64_t)array), module->ptrType); Value* res = CallInst::Create(newStringLLVM, val, "", currentBlock); Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Sat Oct 17 08:54:19 2009 @@ -642,8 +642,7 @@ VMObject* VMClass::doNew() { if (status < inClinit) resolveType(true, true, NULL); uint64 size = mvm::MvmModule::getTypeSize(virtualType->getContainedType(0)); - VMObject* res = (VMObject*) - gc::operator new(size, VMObject::getN3VirtualTable(virtualInstance)); + declare_gcroot(VMObject*, res) = (VMObject*)gc::operator new(size, VMObject::getN3VirtualTable(virtualInstance)); memcpy(res, virtualInstance, size); return res; } @@ -651,8 +650,7 @@ VMObject* VMClassArray::doNew(uint32 nb) { if (status < inClinit) resolveType(true, true, NULL); uint64 size = mvm::MvmModule::getTypeSize(baseClass->naturalType); - VMArray* res = (VMArray*) - gc::operator new(size * nb + sizeof(VMObject) + sizeof(sint32), arrayVT); + declare_gcroot(VMArray*, res) = (VMArray*)gc::operator new(size * nb + sizeof(VMObject) + sizeof(sint32), arrayVT); memset(res->elements, 0, size * nb); VMObject::initialise(res, this); res->size = nb; Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VMClass.h (original) +++ vmkit/trunk/lib/N3/VMCore/VMClass.h Sat Oct 17 08:54:19 2009 @@ -151,7 +151,6 @@ std::vector genericMethods; uint32 vtSize; // in number of methods - VMObject* operator()(); VMObject* doNew(); VMObject* initialiseObject(VMObject*); @@ -211,7 +210,7 @@ uint32 implFlags; uint32 token; - VMObject* delegatee; + VMObject* ooo_delegatee; VMObject* getMethodDelegatee(); std::vector > params; std::vector > caches; @@ -231,6 +230,7 @@ llvm::GenericValue invokeGeneric(std::vector& args); llvm::GenericValue invokeGeneric(va_list ap); + llvm::GenericValue invokeGeneric(...); #define DEFINE_CALLER(name, type) \ type invoke##name(...); @@ -307,7 +307,7 @@ const llvm::FunctionType* getSignature(VMGenericMethod* genMethod); bool virt; const UTF8* name; - VMObject* delegatee; + VMObject* ooo_delegatee; uint32 flags; VMObject* getPropertyDelegatee(); }; Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=84332&r1=84331&r2=84332&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 17 08:54:19 2009 @@ -92,7 +92,7 @@ } void VMMethod::TRACER { - delegatee->MARK_AND_TRACE; + ooo_delegatee->MARK_AND_TRACE; } void VMGenericMethod::TRACER { @@ -100,7 +100,7 @@ } void Property::TRACER { - delegatee->MARK_AND_TRACE; + ooo_delegatee->MARK_AND_TRACE; } // useless (never called or used) but it simplifies the definition of LockedMap From gael.thomas at lip6.fr Sat Oct 17 07:37:47 2009 From: gael.thomas at lip6.fr (Gael Thomas) Date: Sat, 17 Oct 2009 14:37:47 -0000 Subject: [vmkit-commits] [vmkit] r84333 - in /vmkit/trunk/lib/N3: Mono/Mono.cpp Mono/MonoMSCorlib.cpp Mono/MonoString.cpp PNetLib/PNetLib.cpp PNetLib/PNetString.cpp VMCore/CLIString.h Message-ID: <200910171437.n9HEbnZu009345@zion.cs.uiuc.edu> Author: gthomas Date: Sat Oct 17 09:37:44 2009 New Revision: 84333 URL: http://llvm.org/viewvc/llvm-project?rev=84333&view=rev Log: Add llvm_gcroot for all managed objects. I hope that everything is ok :) Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp vmkit/trunk/lib/N3/Mono/MonoString.cpp vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp vmkit/trunk/lib/N3/PNetLib/PNetString.cpp vmkit/trunk/lib/N3/VMCore/CLIString.h Modified: vmkit/trunk/lib/N3/Mono/Mono.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/Mono.cpp?rev=84333&r1=84332&r2=84333&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/Mono.cpp (original) +++ vmkit/trunk/lib/N3/Mono/Mono.cpp Sat Oct 17 09:37:44 2009 @@ -121,10 +121,12 @@ extern "C" void System_Threading_Monitor_Monitor_exit(VMObject* obj) { // TODO: There's a bug in the bootstrap, see why + llvm_gcroot(obj, 0); if (LockObj::owner(obj->lockObj)) VMObject::unlock(obj); } extern "C" bool System_Threading_Monitor_Monitor_try_enter(VMObject* obj, int ms) { + llvm_gcroot(obj, 0); VMObject::aquire(obj); return true; } @@ -173,15 +175,19 @@ extern "C" void System_String_InternalCopyTo(MonoString* str, sint32 sindex, VMArray* dest, sint32 destIndex, sint32 count) { - const ArrayChar* contents = str->value; + llvm_gcroot(str, 0); + llvm_gcroot(dest, 0); + declare_gcroot(const ArrayChar*, contents) = str->value; memcpy(&dest->elements[destIndex], &contents->elements[sindex], count * sizeof(uint16)); } extern "C" uint16 System_String_get_Chars(MonoString* str, sint32 offset) { + llvm_gcroot(str, 0); return str->value->elements[offset]; } static sint32 byteLength(VMArray* array) { + llvm_gcroot(array, 0); VMClassArray* cl = (VMClassArray*)array->classOf; VMCommonClass* base = cl->baseClass; uint32 size = base->naturalType->getPrimitiveSizeInBits() / 8; @@ -189,6 +195,8 @@ } extern "C" bool System_Buffer_BlockCopyInternal (VMArray* src, int src_offset, VMArray* dest, int dest_offset, int count) { + llvm_gcroot(src, 0); + llvm_gcroot(dest, 0); uint8 *src_buf, *dest_buf; /* watch out for integer overflow */ @@ -208,6 +216,7 @@ } extern "C" sint32 System_Buffer_ByteLengthInternal(VMArray* array) { + llvm_gcroot(array, 0); return byteLength(array); } @@ -216,6 +225,7 @@ sint32 src_offset, sint32 count, sint32 *error) { + llvm_gcroot(src, 0); char* buffer = (char*)alloca( 1024);//(count + 8) * sizeof(uint16)); uint32 n = 0; @@ -256,16 +266,19 @@ extern "C" VMObject* System_Threading_Thread_GetCachedCurrentCulture (VMObject *obj) { + llvm_gcroot(obj, 0); return 0; } extern "C" VMObject* System_Threading_Thread_GetSerializedCurrentCulture (VMObject *obj) { + llvm_gcroot(obj, 0); return 0; } extern "C" VMObject* System_Object_MemberwiseClone(VMObject* obj) { + llvm_gcroot(obj, 0); uint64 size = obj->objectSize(); declare_gcroot(VMObject*, res) = ((VMClass*)obj->classOf)->doNew(); memcpy(res, obj, size); @@ -276,16 +289,21 @@ extern "C" bool System_Globalization_CultureInfo_construct_internal_locale_from_current_locale (VMObject *ci) { + llvm_gcroot(ci, 0); return false; } extern "C" void System_Threading_Thread_SetCachedCurrentCulture (VMObject* thread, VMObject *culture) { + llvm_gcroot(thread, 0); + llvm_gcroot(culture, 0); } extern "C" void System_String__ctor(MonoString* str, ArrayChar* array, sint32 startIndex, sint32 count) { + llvm_gcroot(str, 0); + llvm_gcroot(array, 0); N3* vm = VMThread::get()->getVM(); declare_gcroot(const ArrayChar*, value) = vm->bufToArray(&(array->elements[startIndex]), count); str->length = count; @@ -296,7 +314,9 @@ extern "C" MonoString * System_String_InternalJoin (MonoString *separator, VMArray * value, sint32 sindex, sint32 count) { - MonoString *current; + llvm_gcroot(separator, 0); + llvm_gcroot(value, 0); + declare_gcroot(MonoString*, current) = 0; sint32 length; sint32 pos; sint32 insertlen; Modified: vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp?rev=84333&r1=84332&r2=84333&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoMSCorlib.cpp Sat Oct 17 09:37:44 2009 @@ -134,33 +134,43 @@ } VMObject* Property::getPropertyDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { VMThread::get()->getVM()->error("implement me"); } + return delegatee; } VMObject* VMMethod::getMethodDelegatee() { + declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { VMThread::get()->getVM()->error("implement me"); } + return delegatee; } VMObject* VMCommonClass::getClassDelegatee() { declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { ooo_delegatee = delegatee = MSCorlib::clrType->doNew(); MSCorlib::typeClrType->setIntPtr(delegatee, (int*)this); } + return delegatee; } VMObject* Assembly::getAssemblyDelegatee() { declare_gcroot(VMObject*, delegatee) = ooo_delegatee; + if (!delegatee) { VMThread::get()->getVM()->error("implement me"); } + return delegatee; } Modified: vmkit/trunk/lib/N3/Mono/MonoString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.cpp?rev=84333&r1=84332&r2=84333&view=diff ============================================================================== --- vmkit/trunk/lib/N3/Mono/MonoString.cpp (original) +++ vmkit/trunk/lib/N3/Mono/MonoString.cpp Sat Oct 17 09:37:44 2009 @@ -25,7 +25,8 @@ using namespace llvm; -CLIString* CLIString::stringDup(const ArrayChar*& array, N3* vm) { +CLIString* CLIString::stringDup(const ArrayChar* array, N3* vm) { + llvm_gcroot(array, 0); declare_gcroot(MonoString*, obj) = (MonoString*)MSCorlib::pString->doNew(); obj->length = array->size; if (array->size == 0) { @@ -37,20 +38,16 @@ return obj; } -const ArrayChar* CLIString::strToArray(N3* vm) const { - declare_gcroot(const ArrayChar*, res) = ((MonoString *)this)->value; - return res; -} - -GlobalVariable* CLIString::llvmVar() { - MonoString* str = (MonoString*)this; +GlobalVariable* CLIString::llvmVar(CLIString *self) { + llvm_gcroot(self, 0); + declare_gcroot(MonoString*, str) = (MonoString*)self; if (!str->_llvmVar) { N3* vm = VMThread::get()->getVM(); if (!str->_llvmVar) { const Type* pty = mvm::MvmModule::ptrType; Module* Mod = vm->getLLVMModule(); Constant* cons = - ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (this)), + ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (self)), pty); str->_llvmVar = new GlobalVariable(*Mod, pty, true, GlobalValue::ExternalLinkage, Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=84333&r1=84332&r2=84333&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 17 09:37:44 2009 @@ -177,8 +177,9 @@ } static const ArrayChar* newBuilder(N3* vm, PNetString* value, uint32 length) { + llvm_gcroot(value, 0); uint32 valueLength = value ? value->length : 0; - const ArrayChar* array = value ? value->value : 0; + declare_gcroot(const ArrayChar*, array) = value ? value->value : 0; uint32 roundLength = (7 + length) & 0xfffffff8; uint16* buf = (uint16*)alloca(roundLength * sizeof(uint16)); uint32 strLength = 0; @@ -199,6 +200,7 @@ extern "C" VMObject* System_String_NewBuilder(PNetString* value, uint32 length) { + llvm_gcroot(value, 0); N3* vm = (N3*)(VMThread::get()->getVM()); declare_gcroot(PNetString*, str) = (PNetString*)vm->arrayToString(newBuilder(vm, value, length)); return str; @@ -214,7 +216,9 @@ extern "C" void System_String_CopyToChecked(PNetString* str, sint32 sstart, ArrayChar* dest, sint32 dstart, sint32 count) { - const ArrayChar* value = str->value; + llvm_gcroot(str, 0); + llvm_gcroot(dest, 0); + declare_gcroot(const ArrayChar*, value) = str->value; memcpy(&dest->elements[dstart], &value->elements[sstart], count << 1); } @@ -224,6 +228,7 @@ extern "C" void Platform_Stdio_StdWrite(sint32 fd, ArrayUInt8* value, sint32 index, sint32 count) { + llvm_gcroot(value, 0); if (fd == 1) { if (ILConsoleGetMode() == IL_CONSOLE_NORMAL) { fwrite(&value->elements[index], 1, count, stdout); @@ -243,7 +248,8 @@ extern "C" sint32 System_Text_DefaultEncoding_InternalGetBytes(ArrayChar* chars, sint32 charIndex, sint32 charCount, ArrayUInt8* bytes, sint32 byteIndex) { - + llvm_gcroot(chars, 0); + llvm_gcroot(bytes, 0); return ILAnsiGetBytes(&chars->elements[charIndex], charCount, &bytes->elements[byteIndex], bytes->size - byteIndex); } @@ -252,6 +258,7 @@ } extern "C" VMObject* System_Reflection_ClrType_GetElementType(VMObject* Klass) { + llvm_gcroot(Klass, 0); VMCommonClass* cl = (VMCommonClass*)MSCorlib::typeClrType->getIntPtr(Klass); if (!cl->isArray) { VMThread::get()->getVM()->error("implement me"); @@ -270,6 +277,8 @@ extern "C" void System_String_Copy_3(PNetString* dest, sint32 pos, PNetString* src) { + llvm_gcroot(dest, 0); + llvm_gcroot(src, 0); declare_gcroot(ArrayChar*, arr) = (ArrayChar*)MSCorlib::arrayChar->doNew(pos + src->value->size); for (sint32 i = 0; i < pos; ++i) { @@ -287,7 +296,9 @@ extern "C" void System_String_Copy_5(PNetString* dest, sint32 destPos, PNetString* src, sint32 srcPos, sint32 length) { - const ArrayChar *arraySrc = src->value; + llvm_gcroot(dest, 0); + llvm_gcroot(src, 0); + declare_gcroot(const ArrayChar*, arraySrc) = src->value; // printf("Copy %p %p %d %d %d (%p %d)\n", (void *)dest, (void *)src, destPos, srcPos, length, (void *)dest->value, dest->length); @@ -315,16 +326,22 @@ } extern "C" void System_Threading_Monitor_Enter(VMObject* obj) { + llvm_gcroot(obj, 0); // obj->aquire(); } extern "C" void System_Threading_Monitor_Exit(VMObject* obj) { + llvm_gcroot(obj, 0); // obj->unlock(); } extern "C" bool System_String_Equals(PNetString* str1, PNetString* str2) { - return str1->value == str2->value; + llvm_gcroot(str1, 0); + llvm_gcroot(str2, 0); + declare_gcroot(const ArrayChar*, a1) = str1->value; + declare_gcroot(const ArrayChar*, a2) = str2->value; + return a1 == a2; } extern "C" sint32 Platform_SysCharInfo_GetUnicodeCategory(char c) { @@ -332,11 +349,13 @@ } extern "C" uint16 System_String_GetChar(PNetString* str, sint32 index) { + llvm_gcroot(str, 0); return str->value->elements[index]; } extern "C" sint32 System_String_IndexOf(PNetString* str, uint16 value, sint32 startIndex, sint32 count) { + llvm_gcroot(str, 0); if (startIndex < 0) { VMThread::get()->getVM()->error("shoud throw arg range"); } @@ -346,7 +365,7 @@ } sint32 i = startIndex; - const ArrayChar* array = str->value; + declare_gcroot(const ArrayChar*, array) = str->value; while (i < startIndex + count) { if (array->elements[i] == value) return i; else ++i; @@ -356,8 +375,9 @@ } extern "C" sint32 System_String_GetHashCode(PNetString* str) { + llvm_gcroot(str, 0); sint32 hash = 0; - const ArrayChar* array = str->value; + declare_gcroot(const ArrayChar*, array) = str->value; for (sint32 i = 0; i < array->size; ++i) { hash += ((hash << 5) + array->elements[i]); } @@ -368,9 +388,10 @@ StringBuilder* obj, sint32 index, uint16 value) { + llvm_gcroot(obj, 0); N3* vm = (N3*)(VMThread::get()->getVM()); - PNetString* buildString = obj->buildString; - const ArrayChar* array = buildString->value; + declare_gcroot(PNetString*, buildString) = obj->buildString; + declare_gcroot(const ArrayChar*, array) = buildString->value; sint32 strLength = buildString->length; sint32 length = (index + 1) > strLength ? index + 1 : strLength + 1; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); @@ -396,10 +417,12 @@ StringBuilder* obj, sint32 index, PNetString* str) { + llvm_gcroot(obj, 0); + llvm_gcroot(str, 0); N3* vm = (N3*)(VMThread::get()->getVM()); - PNetString* buildString = obj->buildString; - const ArrayChar* strArray = str->value; - const ArrayChar* buildArray = buildString->value; + declare_gcroot(PNetString*, buildString) = obj->buildString; + declare_gcroot(const ArrayChar*, strArray) = str->value; + declare_gcroot(const ArrayChar*, buildArray) = buildString->value; sint32 strLength = str->length; sint32 buildLength = buildString->length; sint32 length = strLength + buildLength; @@ -428,9 +451,10 @@ extern "C" VMObject* System_Text_StringBuilder_Append_System_Text_StringBuilder_System_Char( StringBuilder* obj, uint16 value) { + llvm_gcroot(obj, 0); N3* vm = (N3*)(VMThread::get()->getVM()); - PNetString* buildString = obj->buildString; - const ArrayChar* array = buildString->value; + declare_gcroot(PNetString*, buildString) = obj->buildString; + declare_gcroot(const ArrayChar*, array) = buildString->value; sint32 length = buildString->length; uint16* buf = (uint16*)alloca((length + 1) * sizeof(uint16)); @@ -447,10 +471,12 @@ extern "C" VMObject* System_Text_StringBuilder_Append_System_Text_StringBuilder_System_String( StringBuilder* obj, PNetString* str) { + llvm_gcroot(obj, 0); + llvm_gcroot(str, 0); N3* vm = (N3*)(VMThread::get()->getVM()); - PNetString* buildString = obj->buildString; - const ArrayChar* buildArray = buildString->value; - const ArrayChar* strArray = str->value; + declare_gcroot(PNetString*, buildString) = obj->buildString; + declare_gcroot(const ArrayChar*, buildArray) = buildString->value; + declare_gcroot(const ArrayChar*, strArray) = str->value; sint32 buildLength = buildString->length; sint32 strLength = str->length; sint32 length = buildLength + strLength; @@ -468,6 +494,8 @@ extern "C" sint32 System_String_FindInRange(PNetString* obj, sint32 srcFirst, sint32 srcLast, sint32 step, PNetString* dest) { + llvm_gcroot(obj, 0); + llvm_gcroot(dest, 0); uint16* buf1 = (uint16*)&(obj->value->elements[srcFirst]); uint16* buf2 = (uint16*)(dest->value->elements); sint32 destLength = dest->length; @@ -518,11 +546,14 @@ } extern "C" VMObject* System_Reflection_Assembly_LoadFromName(PNetString* str, sint32 & error, VMObject* parent) { + llvm_gcroot(str, 0); + llvm_gcroot(parent, 0); N3* vm = (N3*)(VMThread::get()->getVM()); - Assembly* ass = vm->constructAssembly(vm->arrayToUTF8(str->value)); + declare_gcroot(const ArrayChar*, value) = str->value; + Assembly* ass = vm->constructAssembly(vm->arrayToUTF8(value)); if(!ass->resolve(1, "dll")) - vm->error("unfound assembly %s\n", mvm::PrintBuffer(str->value).cString()); + vm->error("unfound assembly %s\n", mvm::PrintBuffer(value).cString()); error = 0; declare_gcroot(VMObject*, delegatee) = ass->getAssemblyDelegatee(); @@ -530,9 +561,11 @@ } extern "C" PNetString* System_String_Concat_2(PNetString* str1, PNetString* str2) { + llvm_gcroot(str1, 0); + llvm_gcroot(str2, 0); N3* vm = (N3*)(VMThread::get()->getVM()); - const ArrayChar* a1 = str1->value; - const ArrayChar* a2 = str2->value; + declare_gcroot(const ArrayChar*, a1) = str1->value; + declare_gcroot(const ArrayChar*, a2) = str2->value; sint32 len1 = str1->length; sint32 len2 = str2->length; uint16* buf = (uint16*)alloca((len1 + len2) * sizeof(uint16)); @@ -547,10 +580,13 @@ } extern "C" PNetString* System_String_Concat_3(PNetString* str1, PNetString* str2, PNetString* str3) { - N3* vm = (N3*)(VMThread::get()->getVM()); - const ArrayChar* a1 = str1->value; - const ArrayChar* a2 = str2->value; - const ArrayChar* a3 = str3->value; + llvm_gcroot(str1, 0); + llvm_gcroot(str2, 0); + llvm_gcroot(str3, 0); + N3* vm = (N3*)(VMThread::get()->getVM()); + declare_gcroot(const ArrayChar*, a1) = str1->value; + declare_gcroot(const ArrayChar*, a2) = str2->value; + declare_gcroot(const ArrayChar*, a3) = str3->value; sint32 len1 = str1->length; sint32 len2 = str2->length; sint32 len3 = str3->length; @@ -567,7 +603,8 @@ } extern "C" void System_String_RemoveSpace(PNetString* str, sint32 index, sint32 length) { - const ArrayChar* array = str->value; + llvm_gcroot(str, 0); + declare_gcroot(const ArrayChar*, array) = str->value; sint32 strLength = str->length; uint16* buf = (uint16*)alloca(strLength * sizeof(uint16)); sint32 j = index; @@ -596,6 +633,7 @@ } extern "C" void System_String__ctor_3(PNetString* str, uint16 ch, sint32 count) { + llvm_gcroot(str, 0); declare_gcroot(ArrayChar*, array) = (ArrayChar*)MSCorlib::arrayChar->doNew(count); for (sint32 i = 0; i < count; ++i) { array->elements[i] = ch; @@ -621,8 +659,10 @@ } extern "C" VMObject* System_Reflection_Assembly_GetType(VMObject* obj, PNetString* str, bool onError, bool ignoreCase) { + llvm_gcroot(obj, 0); + llvm_gcroot(str, 0); Assembly* ass = ASSEMBLY_VALUE(obj); - const ArrayChar* array = str->value; + declare_gcroot(const ArrayChar*, array) = str->value; mvm::PrintBuffer pb(array); char* asciiz = pb.cString(); char* index = (char*)sys_memrchr(asciiz, '.', strlen(asciiz)); @@ -637,6 +677,7 @@ } static bool parameterMatch(std::vector params, ArrayObject* types, bool virt) { + llvm_gcroot(types, 0); uint32 v = virt ? 1 : 0; if (types->size + v + 1 != params.size()) return false; for (sint32 i = 0; i < types->size; ++i) { @@ -648,6 +689,11 @@ extern "C" VMObject* System_Reflection_ClrType_GetMemberImpl(VMObject* Type, PNetString* str, sint32 memberTypes, sint32 bindingFlags, VMObject* binder, sint32 callingConventions, ArrayObject* types, VMObject* modifiers) { + llvm_gcroot(Type, 0); + llvm_gcroot(str, 0); + llvm_gcroot(binder, 0); + llvm_gcroot(types, 0); + llvm_gcroot(modifiers, 0); VMCommonClass* type = (VMCommonClass*)MSCorlib::typeClrType->getIntPtr(Type); N3* vm = (N3*)(VMThread::get()->getVM()); const UTF8* name = vm->arrayToUTF8(str->value); @@ -663,7 +709,8 @@ } } if (res == 0) VMThread::get()->getVM()->error("implement me"); - return res->getPropertyDelegatee(); + declare_gcroot(VMObject*, prop_res) = res->getPropertyDelegatee(); + return prop_res; } else if (memberTypes == MEMBER_TYPES_METHOD) { std::vector virtualMethods = type->virtualMethods; std::vector staticMethods = type->staticMethods; @@ -673,7 +720,8 @@ VMMethod* meth = *i; if (meth->name == name) { if (parameterMatch(meth->parameters, types, true)) { - return meth->getMethodDelegatee(); + declare_gcroot(VMObject*, meth_res) = meth->getMethodDelegatee(); + return meth_res; } } } @@ -683,7 +731,8 @@ VMMethod* meth = *i; if (meth->name == name) { if (parameterMatch(meth->parameters, types, false)) { - return meth->getMethodDelegatee(); + declare_gcroot(VMObject*, meth_res) = meth->getMethodDelegatee(); + return meth_res; } } } @@ -704,7 +753,8 @@ N3* vm = VMThread::get()->getVM(); VMMethod* meth = prop->type->lookupMethod(vm->asciizToUTF8(buf), prop->parameters, true, false); assert(meth); - return meth->getMethodDelegatee(); + declare_gcroot(VMObject*, res) = meth->getMethodDelegatee(); + return res; } else { VMThread::get()->getVM()->error("implement me: GetSemantics: %d", attributes); return 0; @@ -712,6 +762,8 @@ } static void decapsulePrimitive(VMObject* arg, const llvm::Type* type, std::vector& args) { + llvm_gcroot(arg, 0); + if (type == llvm::Type::getInt1Ty(llvm::getGlobalContext())) { llvm::GenericValue gv; gv.IntVal = llvm::APInt(1, (bool)((uint32*)arg)[VALUE_OFFSET]); @@ -752,6 +804,12 @@ } extern "C" VMObject* System_Reflection_ClrMethod_Invoke(VMObject* Method, VMObject* obj, sint32 invokeAttr, VMObject* binder, ArrayObject* args, VMObject* culture) { + llvm_gcroot(Method, 0); + llvm_gcroot(obj, 0); + llvm_gcroot(binder, 0); + llvm_gcroot(args, 0); + llvm_gcroot(culture, 0); + VMMethod* meth = (VMMethod*)MSCorlib::methodMethodType->getIntPtr(Method); meth->getSignature(NULL); meth->compiledPtr(NULL); @@ -858,9 +916,12 @@ } extern "C" VMObject* System_Reflection_Assembly_GetManifestResourceStream(VMObject* Ass, PNetString* str) { + llvm_gcroot(Ass, 0); + llvm_gcroot(str, 0); Assembly* ass = (Assembly*)MSCorlib::assemblyAssemblyReflection->getIntPtr(Ass); N3* vm = (N3*)(VMThread::get()->getVM()); - const UTF8* id = vm->arrayToUTF8(str->value); + declare_gcroot(const ArrayChar*, array) = str->value; + const UTF8* id = vm->arrayToUTF8(array); Header* header = ass->CLIHeader; uint32 stringOffset = header->stringStream->realOffset; Table* manTable = header->tables[CONSTANT_ManifestResource]; @@ -880,7 +941,8 @@ } if (pos != -1) { - return createResourceStream(ass, pos); + declare_gcroot(VMObject*, res) = createResourceStream(ass, pos); + return res; } else { return 0; } @@ -888,12 +950,15 @@ extern "C" ArrayObject* System_Reflection_ClrHelpers_GetCustomAttributes(Assembly* ass, VMCommonClass* clrTypePrivate, bool inherit) { - return ass->getCustomAttributes(clrTypePrivate->token, clrTypePrivate); + declare_gcroot(ArrayObject*, res) = ass->getCustomAttributes(clrTypePrivate->token, clrTypePrivate); + return res; } extern "C" VMObject* System_Globalization_TextInfo_ToLower(VMObject* obj, PNetString* str) { + llvm_gcroot(obj, 0); + llvm_gcroot(str, 0); verifyNull(str); - const ArrayChar* array = str->value; + declare_gcroot(const ArrayChar*, array) = str->value; uint32 length = str->length; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); @@ -908,7 +973,8 @@ } extern "C" VMObject* System_String_Replace(PNetString* str, uint16 c1, uint16 c2) { - const ArrayChar* array = str->value; + llvm_gcroot(str, 0); + declare_gcroot(const ArrayChar*, array) = str->value; uint32 length = str->length; if ((c1 == c2) || length == 0) return str; @@ -925,6 +991,7 @@ } extern "C" uint32 System_Reflection_ClrResourceStream_ResourceRead(Assembly* assembly, uint64 position, ArrayUInt8* buffer, uint32 offset, uint32 count) { + llvm_gcroot(buffer, 0); uint32 resRva = assembly->resRva; ByteCode* bytes = assembly->bytes; Section* textSection = assembly->textSection; @@ -937,6 +1004,9 @@ } extern "C" sint32 System_String_CompareInternal(PNetString* strA, sint32 indexA, sint32 lengthA, PNetString* strB, sint32 indexB, sint32 lengthB, bool ignoreCase) { + llvm_gcroot(strA, 0); + llvm_gcroot(strB, 0); + if (strA == 0) { if (strB == 0) { return 0; @@ -970,7 +1040,8 @@ } extern "C" void System_String_CharFill(PNetString* str, sint32 start, sint32 count, char ch) { - const ArrayChar* array = str->value; + llvm_gcroot(str, 0); + declare_gcroot(const ArrayChar*, array) = str->value; sint32 length = start + count; uint16* buf = (uint16*)alloca(length * sizeof(uint16)); @@ -988,6 +1059,8 @@ extern "C" sint32 System_String_InternalOrdinal(PNetString *strA, sint32 indexA, sint32 lengthA, PNetString *strB, sint32 indexB, sint32 lengthB) { + llvm_gcroot(strA, 0); + llvm_gcroot(strB, 0); const uint16 *bufA; const uint16 *bufB; Modified: vmkit/trunk/lib/N3/PNetLib/PNetString.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetString.cpp?rev=84333&r1=84332&r2=84333&view=diff ============================================================================== --- vmkit/trunk/lib/N3/PNetLib/PNetString.cpp (original) +++ vmkit/trunk/lib/N3/PNetLib/PNetString.cpp Sat Oct 17 09:37:44 2009 @@ -24,7 +24,8 @@ using namespace llvm; -CLIString* CLIString::stringDup(const ArrayChar*& array, N3* vm) { +CLIString* CLIString::stringDup(const ArrayChar* array, N3* vm) { + llvm_gcroot(array, 0); declare_gcroot(PNetString*, obj) = (PNetString*)MSCorlib::pString->doNew(); obj->capacity = array->size; obj->length = array->size; @@ -37,19 +38,15 @@ return obj; } -const ArrayChar* CLIString::strToArray(N3* vm) const { - declare_gcroot(const ArrayChar*, res) = ((PNetString*)this)->value; - return res; -} - -GlobalVariable* CLIString::llvmVar() { - PNetString* str = (PNetString*)this; +GlobalVariable* CLIString::llvmVar(CLIString *self) { + llvm_gcroot(self, 0); + declare_gcroot(PNetString*, str) = (PNetString*)self; if (!str->_llvmVar) { N3* vm = VMThread::get()->getVM(); if (!str->_llvmVar) { const Type* pty = mvm::MvmModule::ptrType; Constant* cons = - ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (this)), + ConstantExpr::getIntToPtr(ConstantInt::get(Type::getInt64Ty(getGlobalContext()), uint64_t (self)), pty); str->_llvmVar = new GlobalVariable(*(vm->getLLVMModule()), pty, true, GlobalValue::ExternalLinkage, Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=84333&r1=84332&r2=84333&view=diff ============================================================================== --- vmkit/trunk/lib/N3/VMCore/CLIString.h (original) +++ vmkit/trunk/lib/N3/VMCore/CLIString.h Sat Oct 17 09:37:44 2009 @@ -29,11 +29,10 @@ buf->write("CLI string"); } - llvm::GlobalVariable* llvmVar(); + static llvm::GlobalVariable* llvmVar(CLIString *self); - static CLIString* stringDup(const ArrayChar*& array, N3* vm); - const ArrayChar *strToArray(N3 *vm) const; + static CLIString* stringDup(const ArrayChar* array, N3* vm); }; } // end namespace jnjvm From nicolas.geoffray at lip6.fr Sun Oct 18 12:50:29 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Oct 2009 19:50:29 -0000 Subject: [vmkit-commits] [vmkit] r84429 - /vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Message-ID: <200910181950.n9IJoTlS009665@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 18 14:50:28 2009 New Revision: 84429 URL: http://llvm.org/viewvc/llvm-project?rev=84429&view=rev Log: Add a checkAllocator alias. Change calls to rt.jar to mmtk-j3 runtime. Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerJavaRT.cpp?rev=84429&r1=84428&r2=84429&view=diff ============================================================================== --- vmkit/trunk/mmtk/magic/LowerJavaRT.cpp (original) +++ vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Sun Oct 18 14:50:28 2009 @@ -41,11 +41,25 @@ bool Changed = true; for (Module::iterator I = M.begin(), E = M.end(); I != E;) { - GlobalValue& GV = *I; + Function& GV = *I; ++I; if (!strncmp(GV.getName().data(), "JnJVM_java", 10) || !strncmp(GV.getName().data(), "java", 4)) { - GV.replaceAllUsesWith(Constant::getNullValue(GV.getType())); + if (!strcmp(GV.getName().data(), "JnJVM_java_lang_String_charAt__I")) { + Function* F = M.getFunction("MMTkCharAt"); + if (!F) + F = Function::Create(GV.getFunctionType(), + GlobalValue::ExternalLinkage, "MMTkCharAt", &M); + GV.replaceAllUsesWith(F); + } else if (!strcmp(GV.getName().data(), "JnJVM_java_lang_Object_getClass__")) { + Function* F = M.getFunction("MMTkGetClass"); + if (!F) + F = Function::Create(GV.getFunctionType(), + GlobalValue::ExternalLinkage, "MMTkGetClass", &M); + GV.replaceAllUsesWith(F); + } else { + GV.replaceAllUsesWith(Constant::getNullValue(GV.getType())); + } GV.eraseFromParent(); } } @@ -95,8 +109,10 @@ Function* Alloc = M.getFunction("JnJVM_org_mmtk_plan_MutatorContext_alloc__IIIII"); Function* PostAlloc = M.getFunction("JnJVM_org_mmtk_plan_MutatorContext_postAlloc__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2II"); + Function* CheckAlloc = M.getFunction("JnJVM_org_mmtk_plan_MutatorContext_checkAllocator__III"); uint32_t AllocIndex = 0; uint32_t PostAllocIndex = 0; + uint32_t CheckAllocIndex = 0; for (uint32_t i = 0; i < CA->getNumOperands(); ++i) { ConstantExpr* CE = dyn_cast(CA->getOperand(i)); if (CE) { @@ -105,6 +121,8 @@ AllocIndex = i; } else if (C == PostAlloc) { PostAllocIndex = i; + } else if (C == CheckAlloc) { + CheckAllocIndex = i; } } } @@ -121,6 +139,12 @@ C = C->getOperand(0); new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, "MMTkPostAlloc", C, &M); + + C = CA->getOperand(CheckAllocIndex); + C = C->getOperand(0); + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, "MMTkCheckAllocator", + C, &M); + return Changed; } From nicolas.geoffray at lip6.fr Sun Oct 18 12:53:25 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Oct 2009 19:53:25 -0000 Subject: [vmkit-commits] [vmkit] r84430 - /vmkit/trunk/tools/vmkit/Launcher.cpp Message-ID: <200910181953.n9IJrPbc009776@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 18 14:53:24 2009 New Revision: 84430 URL: http://llvm.org/viewvc/llvm-project?rev=84430&view=rev Log: Add the possibility to load .so files from command line. Modified: vmkit/trunk/tools/vmkit/Launcher.cpp Modified: vmkit/trunk/tools/vmkit/Launcher.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmkit/Launcher.cpp?rev=84430&r1=84429&r2=84430&view=diff ============================================================================== --- vmkit/trunk/tools/vmkit/Launcher.cpp (original) +++ vmkit/trunk/tools/vmkit/Launcher.cpp Sun Oct 18 14:53:24 2009 @@ -14,6 +14,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/PassNameParser.h" +#include "llvm/Support/PluginLoader.h" #include "llvm/Target/TargetData.h" From nicolas.geoffray at lip6.fr Sun Oct 18 13:53:30 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Oct 2009 20:53:30 -0000 Subject: [vmkit-commits] [vmkit] r84440 - in /vmkit/trunk/lib/Mvm: Compiler/JIT.cpp MMTk/MvmGC.cpp MMTk/MvmGC.h Message-ID: <200910182053.n9IKrUw7011898@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 18 15:53:30 2009 New Revision: 84440 URL: http://llvm.org/viewvc/llvm-project?rev=84440&view=rev Log: Add calls to checkAllocator and postAlloc. Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=84440&r1=84439&r2=84440&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Sun Oct 18 15:53:30 2009 @@ -158,6 +158,12 @@ F = dyn_cast(GA->getAliasee()); gc::MMTkGCPostAllocator = (gc::MMTkPostAllocType) (uintptr_t)executionEngine->getPointerToFunction(F); + + GA = dyn_cast(globalModule->getNamedValue("MMTkCheckAllocator")); + assert(GA && "Could not find MMTkCheckAllocator alias"); + F = dyn_cast(GA->getAliasee()); + gc::MMTkCheckAllocator = (gc::MMTkCheckAllocatorType) + (uintptr_t)executionEngine->getPointerToFunction(F); } #endif } Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp?rev=84440&r1=84439&r2=84440&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp Sun Oct 18 15:53:30 2009 @@ -17,14 +17,15 @@ gc::MMTkAllocType gc::MMTkGCAllocator = 0; gc::MMTkPostAllocType gc::MMTkGCPostAllocator = 0; +gc::MMTkCheckAllocatorType gc::MMTkCheckAllocator = 0; static std::set Set; static mvm::SpinLock lock; -extern "C" gc* internalMalloc(uintptr_t Mutator, uint32_t sz, uint32_t align, - uint32_t offset, uint32_t allocator, - uint32_t site) { +extern "C" gc* internalMalloc(uintptr_t Mutator, int32_t sz, int32_t align, + int32_t offset, int32_t allocator, + int32_t site) { gc* res = (gc*)malloc(sz); @@ -37,6 +38,11 @@ return res; } +extern "C" int internalCheckAllocator(uintptr_t Mutator, int32_t sz, + int32_t align, int32_t alloc) { + return 0; +} + void* Collector::begOf(gc* obj) { if (gc::MMTkGCAllocator == internalMalloc) { lock.acquire(); @@ -57,6 +63,7 @@ void Collector::initialise() { if (!gc::MMTkGCAllocator) { gc::MMTkGCAllocator = internalMalloc; + gc::MMTkCheckAllocator = internalCheckAllocator; MutatorThread::MMTkMutatorSize = 0; MutatorThread::MMTkCollectorSize = 0; MutatorThread::MutatorInit = fakeInit; Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.h?rev=84440&r1=84439&r2=84440&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Sun Oct 18 15:53:30 2009 @@ -15,6 +15,9 @@ #include "mvm/VirtualMachine.h" #include "mvm/GC/GC.h" +#include "llvm/Support/MathExtras.h" + + #define gc_allocator std::allocator #define gc_new(Class) __gc_new(Class::VT) Class #define __gc_new new @@ -40,23 +43,31 @@ return 0; } - typedef gc* (*MMTkAllocType)(uintptr_t Mutator, uint32_t sz, uint32_t align, - uint32_t offset, uint32_t allocator, - uint32_t site); + typedef gc* (*MMTkAllocType)(uintptr_t Mutator, int32_t sz, int32_t align, + int32_t offset, int32_t allocator, + int32_t site); typedef gc* (*MMTkPostAllocType)(uintptr_t Mutator, uintptr_t ref, - uintptr_t typeref, uint32_t bytes, - uint32_t allocator); + uintptr_t typeref, int32_t bytes, + int32_t allocator); + + typedef int (*MMTkCheckAllocatorType)(uintptr_t Mutator, int32_t bytes, + int32_t align, int32_t allocator); static MMTkAllocType MMTkGCAllocator; static MMTkPostAllocType MMTkGCPostAllocator; + + static MMTkCheckAllocatorType MMTkCheckAllocator; void* operator new(size_t sz, VirtualTable *VT) { - gc* res = (gc*)MMTkGCAllocator(mvm::MutatorThread::get()->MutatorContext, - sz, 0, 0, 0, 0); + sz = llvm::RoundUpToAlignment(sz, sizeof(void*)); + uintptr_t Mutator = mvm::MutatorThread::get()->MutatorContext; + int allocator = MMTkCheckAllocator(Mutator, sz, 0, 0); + gc* res = (gc*)MMTkGCAllocator(Mutator, sz, 0, 0, allocator, 0); res->setVirtualTable(VT); + MMTkGCPostAllocator(Mutator, (uintptr_t)res, (uintptr_t)VT, sz, allocator); if (VT->destructor) { mvm::Thread::get()->MyVM->addFinalizationCandidate(res); From nicolas.geoffray at lip6.fr Sun Oct 18 13:55:00 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Oct 2009 20:55:00 -0000 Subject: [vmkit-commits] [vmkit] r84441 - /vmkit/trunk/lib/JnJVM/VMCore/JavaString.h Message-ID: <200910182055.n9IKt0jG011944@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 18 15:55:00 2009 New Revision: 84441 URL: http://llvm.org/viewvc/llvm-project?rev=84441&view=rev Log: Add include. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaString.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaString.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaString.h?rev=84441&r1=84440&r2=84441&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaString.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaString.h Sun Oct 18 15:55:00 2009 @@ -13,6 +13,7 @@ #include "types.h" #include "JavaObject.h" +#include "UTF8.h" namespace jnjvm { From nicolas.geoffray at lip6.fr Sun Oct 18 13:58:34 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Oct 2009 20:58:34 -0000 Subject: [vmkit-commits] [vmkit] r84442 - /vmkit/trunk/lib/JnJVM/VMCore/Reader.cpp Message-ID: <200910182058.n9IKwYYb012044@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 18 15:58:34 2009 New Revision: 84442 URL: http://llvm.org/viewvc/llvm-project?rev=84442&view=rev Log: Remove warning. Modified: vmkit/trunk/lib/JnJVM/VMCore/Reader.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/Reader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Reader.cpp?rev=84442&r1=84441&r2=84442&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Reader.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Reader.cpp Sun Oct 18 15:58:34 2009 @@ -35,7 +35,10 @@ fseek(fp, 0, SeekSet); UserClassArray* array = loader->upcalls->ArrayOfByte; res = (ArrayUInt8*)array->doNew((sint32)nbb, loader->allocator, temp); - fread(res->elements, nbb, 1, fp); + if (fread(res->elements, nbb, 1, fp) == 0) { + fprintf(stderr, "fread error\n"); + abort(); + } fclose(fp); } return res; From nicolas.geoffray at lip6.fr Sun Oct 18 13:59:23 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Sun, 18 Oct 2009 20:59:23 -0000 Subject: [vmkit-commits] [vmkit] r84444 - /vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Message-ID: <200910182059.n9IKxNsG012093@zion.cs.uiuc.edu> Author: geoffray Date: Sun Oct 18 15:59:22 2009 New Revision: 84444 URL: http://llvm.org/viewvc/llvm-project?rev=84444&view=rev Log: When looking at java.lang.Class objects, also look at final objects. Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp?rev=84444&r1=84443&r2=84444&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaAOTCompiler.cpp Sun Oct 18 15:59:22 2009 @@ -194,21 +194,28 @@ java_class_iterator End = javaClasses.end(); java_class_iterator I = javaClasses.find(cl); if (I == End) { - Class* javaClass = cl->classLoader->bootstrapLoader->upcalls->newClass; - LLVMClassInfo* LCI = getClassInfo(javaClass); - const llvm::Type* Ty = LCI->getVirtualType(); - Module& Mod = *getLLVMModule(); + final_object_iterator End = finalObjects.end(); + final_object_iterator I = finalObjects.find(cl->delegatee[0]); + if (I == End) { - GlobalVariable* varGV = - new GlobalVariable(Mod, Ty->getContainedType(0), false, - GlobalValue::InternalLinkage, 0, ""); + Class* javaClass = cl->classLoader->bootstrapLoader->upcalls->newClass; + LLVMClassInfo* LCI = getClassInfo(javaClass); + const llvm::Type* Ty = LCI->getVirtualType(); + Module& Mod = *getLLVMModule(); - Constant* res = ConstantExpr::getCast(Instruction::BitCast, varGV, - JnjvmModule::JavaObjectType); + GlobalVariable* varGV = + new GlobalVariable(Mod, Ty->getContainedType(0), false, + GlobalValue::InternalLinkage, 0, ""); + + Constant* res = ConstantExpr::getCast(Instruction::BitCast, varGV, + JnjvmModule::JavaObjectType); - javaClasses.insert(std::make_pair(cl, res)); - varGV->setInitializer(CreateConstantFromJavaClass(cl)); - return res; + javaClasses.insert(std::make_pair(cl, res)); + varGV->setInitializer(CreateConstantFromJavaClass(cl)); + return res; + } else { + return I->second; + } } else { return I->second; } From nicolas.geoffray at lip6.fr Sun Oct 18 23:59:21 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Oct 2009 06:59:21 -0000 Subject: [vmkit-commits] [vmkit] r84467 - in /vmkit/trunk/lib/JnJVM: Classpath/ClasspathReflect.h Classpath/ClasspathVMThread.inc Compiler/JavaJITOpcodes.cpp VMCore/JavaLocks.h VMCore/JavaObject.cpp VMCore/JavaObject.h VMCore/JavaThread.h VMCore/Jnjvm.cpp VMCore/VirtualTables.cpp Message-ID: <200910190659.n9J6xLko031866@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 19 01:59:21 2009 New Revision: 84467 URL: http://llvm.org/viewvc/llvm-project?rev=84467&view=rev Log: Get rid of LockObj to create a JavaLock that will be permanently allocated and recycled across JavaObjects. Added: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathReflect.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathReflect.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathReflect.h?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathReflect.h (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathReflect.h Mon Oct 19 01:59:21 2009 @@ -35,7 +35,6 @@ } static void staticTracer(JavaObjectClass* obj) { - obj->traceLock(); obj->pd->markAndTrace(); obj->signers->markAndTrace(); obj->constructor->markAndTrace(); @@ -56,7 +55,6 @@ public: static void staticTracer(JavaObjectField* obj) { - obj->traceLock(); obj->name->markAndTrace(); obj->declaringClass->markAndTrace(); } @@ -81,7 +79,6 @@ public: static void staticTracer(JavaObjectMethod* obj) { - obj->traceLock(); obj->name->markAndTrace(); obj->declaringClass->markAndTrace(); } @@ -104,7 +101,6 @@ public: static void staticTracer(JavaObjectConstructor* obj) { - obj->traceLock(); obj->clazz->markAndTrace(); } Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc Mon Oct 19 01:59:21 2009 @@ -120,7 +120,7 @@ JavaThread* th = (JavaThread*)field->getObjectField(vmthread); th->interruptFlag = 1; - LockObj* lock = th->waitsOn; + JavaLock* lock = th->waitsOn; // If the thread is blocked on a wait. We also verify nextWaiting in case // the thread has been notified. Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp Mon Oct 19 01:59:21 2009 @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// -#define DEBUG 0 +#define DEBUG 2 #define JNJVM_COMPILE 0 -#define JNJVM_EXECUTE 0 +#define JNJVM_EXECUTE 2 #include Added: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h?rev=84467&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h (added) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Mon Oct 19 01:59:21 2009 @@ -0,0 +1,92 @@ +//===--------------- JavaLocks.h - Fat lock management --------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef JAVA_LOCKS_H +#define JAVA_LOCKS_H + +#include "mvm/Allocator.h" +#include "mvm/Threads/Locks.h" + +namespace mvm { + class Thread; +} + +namespace jnjvm { + +class JavaObject; +class JavaThread; + +class JavaLock : public mvm::PermanentObject { + +friend class JavaObject; + +private: + mvm::LockRecursive internalLock; + mvm::Thread* waitingThread; + JavaThread* firstThread; + JavaObject* associatedObject; + uint32_t index; + +public: + + /// acquire - Acquires the internalLock. + /// + void acquire() { + waitingThread = mvm::Thread::get(); + internalLock.lock(); + waitingThread = 0; + } + + /// tryAcquire - Tries to acquire the lock. + /// + int tryAcquire() { + return internalLock.tryLock(); + } + + + /// acquireAll - Acquires the lock nb times. + void acquireAll(uint32 nb) { + waitingThread = mvm::Thread::get(); + internalLock.lockAll(nb); + waitingThread = 0; + } + + /// release - Releases the internalLock. + /// + void release() { + internalLock.unlock(); + } + + /// owner - Returns if the current thread owns this internalLock. + /// + bool owner() { + return internalLock.selfOwner(); + } + + /// getOwner - Get the owner of this internalLock. + /// + mvm::Thread* getOwner() { + return internalLock.getOwner(); + } + + /// JavaLock - Empty constructor. + JavaLock(uint32_t i) { + firstThread = 0; + index = i; + associatedObject = 0; + waitingThread = 0; + } + + static JavaLock* allocate(JavaObject*); + +}; + +} + +#endif Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp Mon Oct 19 01:59:21 2009 @@ -18,27 +18,10 @@ using namespace jnjvm; -LockObj* LockObj::allocate(JavaObject* owner) { - llvm_gcroot(owner, 0); -#ifdef USE_GC_BOEHM - LockObj* res = new LockObj(); -#else - LockObj* res = new(&VT) LockObj(); - // Set the virtual table to change what C++ did: by using the new operator - // C++ after the allocation will set its own VT. Since we want to call - // the C++ constructor (because it initializes the native data structures - // such as LockRecursive), we have to change the VT of this object. - res->setVirtualTable(&VT); -#endif - assert(!res->firstThread && "Error in constructor"); - return res; -} - void JavaObject::waitIntern(struct timeval* info, bool timed) { - LockObj* l = 0; + JavaLock* l = 0; JavaObject* self = this; llvm_gcroot(self, 0); - llvm_gcroot(l, 0); if (owner()) { l = self->lock.changeToFatlock(self); @@ -76,10 +59,10 @@ while (!thread->interruptFlag && thread->nextWaiting) { if (timed) { - timeout = varcondThread.timedWait(&l->lock, info); + timeout = varcondThread.timedWait(&l->internalLock, info); if (timeout) break; } else { - varcondThread.wait(&l->lock); + varcondThread.wait(&l->internalLock); } } @@ -145,10 +128,9 @@ } void JavaObject::notify() { - LockObj* l = 0; + JavaLock* l = 0; JavaObject* self = this; llvm_gcroot(self, 0); - llvm_gcroot(l, 0); if (owner()) { l = self->lock.getFatLock(); @@ -191,10 +173,9 @@ } void JavaObject::notifyAll() { - LockObj* l = 0; + JavaLock* l = 0; JavaObject* self = this; llvm_gcroot(self, 0); - llvm_gcroot(l, 0); if (owner()) { l = self->lock.getFatLock(); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Mon Oct 19 01:59:21 2009 @@ -16,6 +16,7 @@ #include "types.h" +#include "JavaLocks.h" #include "JnjvmConfig.h" namespace jnjvm { @@ -26,79 +27,6 @@ class Typedef; class UserCommonClass; -/// LockObj - This class represents a Java monitor. -/// -class LockObj : public gc { - friend class JavaObject; -private: - - - /// lock - The internal lock of this object lock. - /// - mvm::LockRecursive lock; - - /// firstThread - The first thread doing a wait. - /// - JavaThread* firstThread; - -public: - /// allocate - Allocates a lock object. Only the internal lock is allocated. - /// - static LockObj* allocate(JavaObject*); - - /// acquire - Acquires the lock. - /// - void acquire() { - LockObj* self = this; - llvm_gcroot(self, 0); - self->lock.lock(); - } - - /// tryAcquire - Tries to acquire the lock. - /// - int tryAcquire() { - return lock.tryLock(); - } - - /// acquireAll - Acquires the lock nb times. - void acquireAll(uint32 nb) { - LockObj* self = this; - llvm_gcroot(self, 0); - self->lock.lockAll(nb); - } - - /// release - Releases the lock. - /// - void release() { - lock.unlock(); - } - - /// owner - Returns if the current thread owns this lock. - /// - bool owner() { - return lock.selfOwner(); - } - - /// getOwner - Get the owner of this lock. - /// - mvm::Thread* getOwner() { - return lock.getOwner(); - } - - /// VT - LockObj is GC-allocated, so we must make the VT explicit. - /// - static VirtualTable VT; - - /// staticDestructor - The destructor of this LockObj, called by the GC. - /// - static void staticDestructor(LockObj* obj) { - obj->lock.~LockRecursive(); - } - - /// LockObj - Empty constructor. - LockObj() { firstThread = 0; } -}; - /// JavaVirtualTable - This class is the virtual table of instances of /// Java classes. Besides holding function pointers for virtual calls, /// it contains a bunch of information useful for fast dynamic type checking. @@ -270,7 +198,7 @@ /// lock - The monitor of this object. Most of the time null. /// - mvm::ThinLock lock; + mvm::ThinLock lock; /// wait - Java wait. Makes the current thread waiting on a monitor. /// @@ -327,7 +255,7 @@ #endif /// lockObj - Get the LockObj if the lock is a fat lock. - LockObj* lockObj() { + JavaLock* lockObj() { return lock.getFatLock(); } @@ -336,10 +264,6 @@ /// void decapsulePrimitive(Jnjvm* vm, uintptr_t &buf, const Typedef* signature); - void traceLock() { - LockObj* l = lockObj(); - if (l) l->markAndTrace(); - } }; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaThread.h Mon Oct 19 01:59:21 2009 @@ -29,7 +29,6 @@ class JavaMethod; class JavaObject; class Jnjvm; -class LockObj; #define BEGIN_NATIVE_EXCEPTION(level) \ @@ -119,7 +118,7 @@ /// waitsOn - The monitor on which the thread is waiting on. /// - LockObj* waitsOn; + JavaLock* waitsOn; static const unsigned int StateRunning; static const unsigned int StateWaiting; Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Mon Oct 19 01:59:21 2009 @@ -1389,3 +1389,11 @@ return 0; } + + +JavaLock* JavaLock::allocate(JavaObject* obj) { + Jnjvm* vm = JavaThread::get()->getJVM(); + JavaLock* res = new(vm->allocator, "Lock") JavaLock(0); + res->associatedObject = obj; + return res; +} Modified: vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp?rev=84467&r1=84466&r2=84467&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Mon Oct 19 01:59:21 2009 @@ -59,10 +59,6 @@ (uintptr_t)VMClassLoader::staticDestructor, (uintptr_t)VMClassLoader::staticTracer); -VirtualTable LockObj::VT((uintptr_t)LockObj::staticDestructor, - (uintptr_t)LockObj::staticDestructor, - (uintptr_t)VirtualTable::emptyTracer); - //===----------------------------------------------------------------------===// // Empty tracer for static tracers of classes that do not declare static // variables. @@ -85,8 +81,6 @@ /// Method for scanning the root of an object. extern "C" void JavaObjectTracer(JavaObject* obj) { - obj->traceLock(); - CommonClass* cl = obj->getClass(); assert(cl && "No class"); cl->classLoader->getJavaClassLoader()->markAndTrace(); @@ -95,8 +89,6 @@ /// 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) { - obj->traceLock(); - CommonClass* cl = obj->getClass(); assert(cl && "No class"); cl->classLoader->getJavaClassLoader()->markAndTrace(); @@ -111,13 +103,10 @@ /// the class is the bootstrap loader and therefore does not need to be /// scanned here. extern "C" void JavaArrayTracer(JavaArray* obj) { - obj->traceLock(); } /// Method for scanning regular objects. extern "C" void RegularObjectTracer(JavaObject* obj) { - obj->traceLock(); - Class* cl = obj->getClass()->asClass(); assert(cl && "Not a class in regular tracer"); cl->classLoader->getJavaClassLoader()->markAndTrace(); @@ -222,9 +211,6 @@ for (uint32 i = 0; i < end->length; ++i) { JavaObject* obj = end->strings[i]; obj->markAndTrace(); - // If the string was static allocated, we want to trace its lock. - LockObj* l = obj->lockObj(); - if (l) l->markAndTrace(); } end = end->prev; } From nicolas.geoffray at lip6.fr Mon Oct 19 00:00:48 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Oct 2009 07:00:48 -0000 Subject: [vmkit-commits] [vmkit] r84468 - in /vmkit/trunk/tools: jnjvm/Makefile vmjc/Makefile vmkit/Makefile Message-ID: <200910190700.n9J70m1i031918@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 19 02:00:48 2009 New Revision: 84468 URL: http://llvm.org/viewvc/llvm-project?rev=84468&view=rev Log: Makefile and linker workaround for building Java frontends. Modified: vmkit/trunk/tools/jnjvm/Makefile vmkit/trunk/tools/vmjc/Makefile vmkit/trunk/tools/vmkit/Makefile Modified: vmkit/trunk/tools/jnjvm/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/jnjvm/Makefile?rev=84468&r1=84467&r2=84468&view=diff ============================================================================== --- vmkit/trunk/tools/jnjvm/Makefile (original) +++ vmkit/trunk/tools/jnjvm/Makefile Mon Oct 19 02:00:48 2009 @@ -27,7 +27,7 @@ else -USEDLIBS = JnJVM.a Classpath.a JnjvmCompiler.a Allocator.a CommonThread.a \ +USEDLIBS = JnJVM.a Classpath.a JnJVM.a JnjvmCompiler.a Allocator.a CommonThread.a \ Mvm.a MvmCompiler.a $(GCLIB).a ifeq ($(ISOLATE_SHARING_BUILD), 1) Modified: vmkit/trunk/tools/vmjc/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/Makefile?rev=84468&r1=84467&r2=84468&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/Makefile (original) +++ vmkit/trunk/tools/vmjc/Makefile Mon Oct 19 02:00:48 2009 @@ -25,7 +25,7 @@ else - USEDLIBS = JnJVM.a Classpath.a JnjvmCompiler.a Allocator.a CommonThread.a \ + USEDLIBS = JnJVM.a Classpath.a JnJVM.a JnjvmCompiler.a Allocator.a CommonThread.a \ Mvm.a MvmCompiler.a $(GCLIB).a endif Modified: vmkit/trunk/tools/vmkit/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmkit/Makefile?rev=84468&r1=84467&r2=84468&view=diff ============================================================================== --- vmkit/trunk/tools/vmkit/Makefile (original) +++ vmkit/trunk/tools/vmkit/Makefile Mon Oct 19 02:00:48 2009 @@ -38,7 +38,7 @@ else ifeq ($(WITH_JNJVM), 1) - USEDLIBS += JnJVM.a Classpath.a JnjvmCompiler.a + USEDLIBS += JnJVM.a Classpath.a JnJVM.a JnjvmCompiler.a endif ifeq ($(ISOLATE_SHARING_BUILD), 1) From nicolas.geoffray at lip6.fr Mon Oct 19 00:03:15 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Oct 2009 07:03:15 -0000 Subject: [vmkit-commits] [vmkit] r84470 - /vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp Message-ID: <200910190703.n9J73Fe3032009@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 19 02:03:15 2009 New Revision: 84470 URL: http://llvm.org/viewvc/llvm-project?rev=84470&view=rev Log: Revert accidental commit. Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp Modified: vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp?rev=84470&r1=84469&r2=84470&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/JnJVM/Compiler/JavaJITOpcodes.cpp Mon Oct 19 02:03:15 2009 @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// -#define DEBUG 2 +#define DEBUG 0 #define JNJVM_COMPILE 0 -#define JNJVM_EXECUTE 2 +#define JNJVM_EXECUTE 0 #include From nicolas.geoffray at lip6.fr Mon Oct 19 01:07:04 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Oct 2009 08:07:04 -0000 Subject: [vmkit-commits] [vmkit] r84472 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaLocks.h Jnjvm.cpp Jnjvm.h Message-ID: <200910190807.n9J875qK015722@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 19 03:07:02 2009 New Revision: 84472 URL: http://llvm.org/viewvc/llvm-project?rev=84472&view=rev Log: Add a LockSystem to implement JavaLock allocations. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h?rev=84472&r1=84471&r2=84472&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Mon Oct 19 03:07:02 2009 @@ -21,6 +21,7 @@ class JavaObject; class JavaThread; +class Jnjvm; class JavaLock : public mvm::PermanentObject { @@ -75,11 +76,11 @@ return internalLock.getOwner(); } - /// JavaLock - Empty constructor. - JavaLock(uint32_t i) { + /// JavaLock - Default constructor. + JavaLock(uint32_t i, JavaObject* a) { firstThread = 0; index = i; - associatedObject = 0; + associatedObject = a; waitingThread = 0; } @@ -87,6 +88,47 @@ }; +/// LockSystem - This class manages all Java locks used by the applications. +/// Each JVM must own an instance of this class and allocate Java locks +/// with it. +/// +class LockSystem { +public: + static const uint32_t GlobalSize = 128; + static const uint32_t BitIndex = 11; + static const uint32_t IndexSize = 1 << BitIndex; + static const uint32_t BitMask = IndexSize - 1; + static const uint32_t MaxLocks = GlobalSize * IndexSize; + + /// LockTable - The global table that will hold the locks. The table is + /// a two-dimensional array, and only one entry is created, so that + /// the lock system does not eat up all memory on startup. + /// + JavaLock* ** LockTable; + + /// currentIndex - The current index in the tables. Always incremented, + /// never decremented. + /// + uint32_t currentIndex; + + /// threadLock - Spin lock to protect the currentIndex field. + /// + mvm::SpinLock threadLock; + + /// associatedVM - The JVM associated with this lock system. + /// + Jnjvm* associatedVM; + + /// allocate - Allocate a JavaLock. + /// + JavaLock* allocate(JavaObject* obj); + + /// LockSystem - Default constructor. Initialize the table. + /// + LockSystem(Jnjvm* vm); + +}; + } #endif Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=84472&r1=84471&r2=84472&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Mon Oct 19 03:07:02 2009 @@ -1269,7 +1269,7 @@ } Jnjvm::Jnjvm(mvm::BumpPtrAllocator& Alloc, JnjvmBootstrapLoader* loader) : - VirtualMachine(Alloc) { + VirtualMachine(Alloc), lockSystem(this) { classpath = getenv("CLASSPATH"); if (!classpath) classpath = "."; @@ -1393,7 +1393,44 @@ JavaLock* JavaLock::allocate(JavaObject* obj) { Jnjvm* vm = JavaThread::get()->getJVM(); - JavaLock* res = new(vm->allocator, "Lock") JavaLock(0); - res->associatedObject = obj; + JavaLock* res = vm->lockSystem.allocate(obj); return res; } + +JavaLock* LockSystem::allocate(JavaObject* obj) { + +// Get an index. + threadLock.lock(); + + uint32_t index = currentIndex++; + if (index == MaxLocks) { + fprintf(stderr, "Ran out of space for allocating locks"); + abort(); + } + + JavaLock** tab = LockTable[index >> BitIndex]; + + if (tab == NULL) + tab = (JavaLock**)associatedVM->allocator.Allocate(IndexSize, + "Index LockTable"); + threadLock.unlock(); + + // Allocate the lock. + JavaLock* res = new(associatedVM->allocator, "Lock") JavaLock(index, obj); + + // Add the lock to the table. + uint32_t internalIndex = index & BitMask; + tab[internalIndex] = res; + + // Return the lock. + return res; +} + +LockSystem::LockSystem(Jnjvm* vm) { + associatedVM = vm; + LockTable = (JavaLock* **) + vm->allocator.Allocate(GlobalSize, "Global LockTable"); + LockTable[0] = (JavaLock**) + vm->allocator.Allocate(IndexSize, "Index LockTable"); + currentIndex = 0; +} Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h?rev=84472&r1=84471&r2=84472&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.h Mon Oct 19 03:07:02 2009 @@ -20,6 +20,7 @@ #include "mvm/Threads/Cond.h" #include "mvm/Threads/Locks.h" +#include "JavaLocks.h" #include "JnjvmConfig.h" #include "JNIReferences.h" #include "LockedMap.h" @@ -191,6 +192,10 @@ /// ThreadSystem threadSystem; + /// lockSystem - The lock system to allocate and manage Java locks. + /// + LockSystem lockSystem; + /// argumentsInfo - The command line arguments given to the vm /// ClArgumentsInfo argumentsInfo; From nicolas.geoffray at lip6.fr Mon Oct 19 01:46:42 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Oct 2009 08:46:42 -0000 Subject: [vmkit-commits] [vmkit] r84473 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaClass.h JavaLocks.h Jnjvm.cpp Message-ID: <200910190846.n9J8kgiK016990@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 19 03:46:41 2009 New Revision: 84473 URL: http://llvm.org/viewvc/llvm-project?rev=84473&view=rev Log: Add a freelist cache for allocating JavaLocks. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=84473&r1=84472&r2=84473&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Mon Oct 19 03:46:41 2009 @@ -412,6 +412,10 @@ static FatLock* allocate(UserCommonClass* cl) { return new(cl->classLoader->allocator, "Class fat lock") FatLock(); } + + void deallocate() { + // Too bad, I can't deallocate it because it is in permanent memory. + } void acquire() { lockVar.lock(); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h?rev=84473&r1=84472&r2=84473&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Mon Oct 19 03:46:41 2009 @@ -26,6 +26,7 @@ class JavaLock : public mvm::PermanentObject { friend class JavaObject; +friend class LockSystem; private: mvm::LockRecursive internalLock; @@ -33,6 +34,7 @@ JavaThread* firstThread; JavaObject* associatedObject; uint32_t index; + JavaLock* nextFreeLock; public: @@ -85,6 +87,7 @@ } static JavaLock* allocate(JavaObject*); + void deallocate(); }; @@ -94,6 +97,8 @@ /// class LockSystem { public: + + // Fixed values. With these values, an index is on 18 bits. static const uint32_t GlobalSize = 128; static const uint32_t BitIndex = 11; static const uint32_t IndexSize = 1 << BitIndex; @@ -110,7 +115,11 @@ /// never decremented. /// uint32_t currentIndex; - + + /// freeLock - The list of locks that are allocated and available. + /// + JavaLock* freeLock; + /// threadLock - Spin lock to protect the currentIndex field. /// mvm::SpinLock threadLock; @@ -122,11 +131,26 @@ /// allocate - Allocate a JavaLock. /// JavaLock* allocate(JavaObject* obj); - + + /// deallocate - Put a lock in the free list lock. + /// + void deallocate(JavaLock* lock) { + lock->associatedObject = 0; + threadLock.lock(); + lock->nextFreeLock = freeLock; + freeLock = lock; + threadLock.unlock(); + } + /// LockSystem - Default constructor. Initialize the table. /// LockSystem(Jnjvm* vm); + /// getLock - Get a lock from an index in the table. + /// + JavaLock* getLock(uint32_t index) { + return LockTable[index >> BitIndex][index & BitMask]; + } }; } Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=84473&r1=84472&r2=84473&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Mon Oct 19 03:46:41 2009 @@ -1397,30 +1397,45 @@ return res; } +void JavaLock::deallocate() { + Jnjvm* vm = JavaThread::get()->getJVM(); + vm->lockSystem.deallocate(this); +} + JavaLock* LockSystem::allocate(JavaObject* obj) { -// Get an index. + JavaLock* res = 0; threadLock.lock(); + + // Try the freeLock list. + if (freeLock) { + res = freeLock; + freeLock = res->nextFreeLock; + res->nextFreeLock = 0; + threadLock.unlock(); + res->associatedObject = obj; + } else { + // Get an index. + uint32_t index = currentIndex++; + if (index == MaxLocks) { + fprintf(stderr, "Ran out of space for allocating locks"); + abort(); + } - uint32_t index = currentIndex++; - if (index == MaxLocks) { - fprintf(stderr, "Ran out of space for allocating locks"); - abort(); - } - - JavaLock** tab = LockTable[index >> BitIndex]; + JavaLock** tab = LockTable[index >> BitIndex]; - if (tab == NULL) - tab = (JavaLock**)associatedVM->allocator.Allocate(IndexSize, - "Index LockTable"); - threadLock.unlock(); + if (tab == NULL) + tab = (JavaLock**)associatedVM->allocator.Allocate(IndexSize, + "Index LockTable"); + threadLock.unlock(); - // Allocate the lock. - JavaLock* res = new(associatedVM->allocator, "Lock") JavaLock(index, obj); + // Allocate the lock. + res = new(associatedVM->allocator, "Lock") JavaLock(index, obj); - // Add the lock to the table. - uint32_t internalIndex = index & BitMask; - tab[internalIndex] = res; + // Add the lock to the table. + uint32_t internalIndex = index & BitMask; + tab[internalIndex] = res; + } // Return the lock. return res; From nicolas.geoffray at lip6.fr Mon Oct 19 01:47:31 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Oct 2009 08:47:31 -0000 Subject: [vmkit-commits] [vmkit] r84474 - /vmkit/trunk/include/mvm/Threads/Locks.h Message-ID: <200910190847.n9J8lVKo017023@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 19 03:47:30 2009 New Revision: 84474 URL: http://llvm.org/viewvc/llvm-project?rev=84474&view=rev Log: Deallocate the lock if someone else has created one. Modified: vmkit/trunk/include/mvm/Threads/Locks.h Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=84474&r1=84473&r2=84474&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Mon Oct 19 03:47:30 2009 @@ -280,9 +280,7 @@ loop: while (lock) { if (lock & FatMask) { -#ifdef USE_GC_BOEHM - delete obj; -#endif + obj->deallocate(); goto end; } else mvm::Thread::yield(); From nicolas.geoffray at lip6.fr Mon Oct 19 02:29:28 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Mon, 19 Oct 2009 09:29:28 -0000 Subject: [vmkit-commits] [vmkit] r84483 - in /vmkit/trunk: include/mvm/Threads/Locks.h lib/JnJVM/VMCore/JavaClass.h lib/JnJVM/VMCore/JavaLocks.h lib/JnJVM/VMCore/Jnjvm.cpp Message-ID: <200910190929.n9J9TTpV018989@zion.cs.uiuc.edu> Author: geoffray Date: Mon Oct 19 04:29:28 2009 New Revision: 84483 URL: http://llvm.org/viewvc/llvm-project?rev=84483&view=rev Log: Put indexes instead of pointers into the thin lock word. Modified: vmkit/trunk/include/mvm/Threads/Locks.h vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=84483&r1=84482&r2=84483&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Mon Oct 19 04:29:28 2009 @@ -227,7 +227,7 @@ TFatLock* obj = TFatLock::allocate(O); IsGC::gcroot(obj, 0); obj->acquireAll(257); - lock = ((uintptr_t)obj >> 1) | FatMask; + lock = obj->getID(); } /// initialise - Initialise the value of the lock to the thread ID that is @@ -249,13 +249,12 @@ if (!(lock & FatMask)) { TFatLock* obj = TFatLock::allocate(O); IsGC::gcroot(obj, 0); - size_t val = (((size_t) obj) >> 1) | FatMask; uint32 count = lock & ThinCountMask; obj->acquireAll(count + 1); - lock = val; + lock = obj->getID(); return obj; } else { - return (TFatLock*)(lock << 1); + return TFatLock::getFromID(lock); } } @@ -276,7 +275,7 @@ } else { TFatLock* obj = TFatLock::allocate(O); IsGC::gcroot(obj, 0); - uintptr_t val = ((uintptr_t)obj >> 1) | FatMask; + uintptr_t val = obj->getID(); loop: while (lock) { if (lock & FatMask) { @@ -293,7 +292,7 @@ } else { end: - TFatLock* obj = (TFatLock*)(lock << 1); + TFatLock* obj = TFatLock::getFromID(lock); obj->acquire(); } } @@ -308,7 +307,7 @@ if (lock == id) { lock = 0; } else if (lock & FatMask) { - TFatLock* obj = (TFatLock*)(lock << 1); + TFatLock* obj = TFatLock::getFromID(lock); IsGC::gcroot(obj, 0); obj->release(); } else { @@ -320,7 +319,7 @@ /// void broadcast() { if (lock & FatMask) { - TFatLock* obj = (TFatLock*)(lock << 1); + TFatLock* obj = TFatLock::getFromID(lock); IsGC::gcroot(obj, 0); obj->broadcast(); } @@ -329,7 +328,7 @@ /// signal - Wakes up one thread waiting for this lock. void signal() { if (lock & FatMask) { - TFatLock* obj = (TFatLock*)(lock << 1); + TFatLock* obj = TFatLock::getFromID(lock); IsGC::gcroot(obj, 0); obj->signal(); } @@ -342,7 +341,7 @@ if (id == lock) return true; if ((lock & ThinMask) == id) return true; if (lock & FatMask) { - TFatLock* obj = (TFatLock*)(lock << 1); + TFatLock* obj = TFatLock::getFromID(lock); IsGC::gcroot(obj, 0); return obj->owner(); } @@ -351,7 +350,7 @@ mvm::Thread* getOwner() { if (lock & FatMask) { - TFatLock* obj = (TFatLock*)(lock << 1); + TFatLock* obj = TFatLock::getFromID(lock); IsGC::gcroot(obj, 0); return obj->getOwner(); } else { @@ -362,7 +361,7 @@ /// getFatLock - Get the fat lock is the lock is a fat lock, 0 otherwise. TFatLock* getFatLock() { if (lock & FatMask) { - return (TFatLock*)(lock << 1); + return TFatLock::getFromID(lock); } else { return 0; } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=84483&r1=84482&r2=84483&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Mon Oct 19 04:29:28 2009 @@ -412,6 +412,14 @@ static FatLock* allocate(UserCommonClass* cl) { return new(cl->classLoader->allocator, "Class fat lock") FatLock(); } + + uintptr_t getID() { + return (((uintptr_t)this) >> 1) | mvm::FatMask; + } + + static FatLock* getFromID(uintptr_t id) { + return (FatLock*)(id << 1); + } void deallocate() { // Too bad, I can't deallocate it because it is in permanent memory. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h?rev=84483&r1=84482&r2=84483&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Mon Oct 19 04:29:28 2009 @@ -89,6 +89,8 @@ static JavaLock* allocate(JavaObject*); void deallocate(); + uintptr_t getID(); + static JavaLock* getFromID(uintptr_t val); }; /// LockSystem - This class manages all Java locks used by the applications. @@ -96,6 +98,7 @@ /// with it. /// class LockSystem { + friend class JavaLock; public: // Fixed values. With these values, an index is on 18 bits. Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=84483&r1=84482&r2=84483&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Mon Oct 19 04:29:28 2009 @@ -1449,3 +1449,13 @@ vm->allocator.Allocate(IndexSize, "Index LockTable"); currentIndex = 0; } + +uintptr_t JavaLock::getID() { + return index | mvm::FatMask; +} + +JavaLock* JavaLock::getFromID(uintptr_t ID) { + Jnjvm* vm = JavaThread::get()->getJVM(); + JavaLock* res = vm->lockSystem.getLock(ID & ~mvm::FatMask); + return res; +} From nicolas.geoffray at lip6.fr Tue Oct 20 01:58:38 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 08:58:38 -0000 Subject: [vmkit-commits] [vmkit] r84625 - in /vmkit/trunk: include/mvm/Threads/Locks.h lib/JnJVM/Classpath/ClasspathVMThread.inc lib/JnJVM/VMCore/JavaClass.h lib/JnJVM/VMCore/JavaLocks.h lib/JnJVM/VMCore/JavaObject.cpp lib/JnJVM/VMCore/JavaObject.h lib/JnJVM/VMCore/Jnjvm.cpp Message-ID: <200910200858.n9K8wd1b022524@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 03:58:38 2009 New Revision: 84625 URL: http://llvm.org/viewvc/llvm-project?rev=84625&view=rev Log: Internally recycle JavaLocks when they are released and no-one is waiting on them. Modified: vmkit/trunk/include/mvm/Threads/Locks.h vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Modified: vmkit/trunk/include/mvm/Threads/Locks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Locks.h?rev=84625&r1=84624&r2=84625&view=diff ============================================================================== --- vmkit/trunk/include/mvm/Threads/Locks.h (original) +++ vmkit/trunk/include/mvm/Threads/Locks.h Tue Oct 20 03:58:38 2009 @@ -215,17 +215,17 @@ /// template class ThinLock { +public: uintptr_t lock; -public: /// overflowThinlock - Change the lock of this object to a fat lock because /// we have reached 0xFF locks. void overflowThinLock(Owner* O = 0) { + IsGC::gcroot(O, 0); TFatLock* obj = TFatLock::allocate(O); - IsGC::gcroot(obj, 0); obj->acquireAll(257); lock = obj->getID(); } @@ -246,20 +246,24 @@ /// 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) { + IsGC::gcroot(O, 0); if (!(lock & FatMask)) { TFatLock* obj = TFatLock::allocate(O); - IsGC::gcroot(obj, 0); uint32 count = lock & ThinCountMask; obj->acquireAll(count + 1); lock = obj->getID(); return obj; } else { - return TFatLock::getFromID(lock); + TFatLock* res = TFatLock::getFromID(lock); + assert(res && "Lock deallocated while held."); + return res; } } /// acquire - Acquire the lock. - void acquire(Owner* O = 0) { + void acquire(Owner* O) { + IsGC::gcroot(O, 0); +start: uint64_t id = mvm::Thread::get()->getThreadID(); uintptr_t val = __sync_val_compare_and_swap(&lock, 0, id); @@ -274,7 +278,6 @@ } } else { TFatLock* obj = TFatLock::allocate(O); - IsGC::gcroot(obj, 0); uintptr_t val = obj->getID(); loop: while (lock) { @@ -287,13 +290,17 @@ uintptr_t test = __sync_val_compare_and_swap((uintptr_t*)&lock, 0, val); if (test) goto loop; - obj->acquire(); + if (!obj->acquire(O)) goto start; } } else { end: TFatLock* obj = TFatLock::getFromID(lock); - obj->acquire(); + if (obj) { + if (!obj->acquire(O)) goto start; + } else { + goto start; + } } } @@ -301,15 +308,16 @@ } /// release - Release the lock. - void release() { + void release(Owner* O) { + IsGC::gcroot(O, 0); assert(owner() && "Not owner when entering release!"); uint64 id = mvm::Thread::get()->getThreadID(); if (lock == id) { lock = 0; } else if (lock & FatMask) { TFatLock* obj = TFatLock::getFromID(lock); - IsGC::gcroot(obj, 0); - obj->release(); + assert(obj && "Lock deallocated while held."); + obj->release(O); } else { lock--; } @@ -320,7 +328,7 @@ void broadcast() { if (lock & FatMask) { TFatLock* obj = TFatLock::getFromID(lock); - IsGC::gcroot(obj, 0); + assert(obj && "Lock deallocated while held."); obj->broadcast(); } } @@ -329,7 +337,7 @@ void signal() { if (lock & FatMask) { TFatLock* obj = TFatLock::getFromID(lock); - IsGC::gcroot(obj, 0); + assert(obj && "Lock deallocated while held."); obj->signal(); } } @@ -342,8 +350,7 @@ if ((lock & ThinMask) == id) return true; if (lock & FatMask) { TFatLock* obj = TFatLock::getFromID(lock); - IsGC::gcroot(obj, 0); - return obj->owner(); + if (obj) return obj->owner(); } return false; } @@ -351,8 +358,8 @@ mvm::Thread* getOwner() { if (lock & FatMask) { TFatLock* obj = TFatLock::getFromID(lock); - IsGC::gcroot(obj, 0); - return obj->getOwner(); + if (obj) return obj->getOwner(); + return 0; } else { return (mvm::Thread*)(lock & ThinMask); } Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc?rev=84625&r1=84624&r2=84625&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc (original) +++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMThread.inc Tue Oct 20 03:58:38 2009 @@ -140,7 +140,7 @@ th->varcond.signal(); // Release the lock if we acquired it. - if (locked) lock->release(); + if (locked) lock->release(lock->getAssociatedObject()); } // Here we could also raise a signal for interrupting I/O Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=84625&r1=84624&r2=84625&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Tue Oct 20 03:58:38 2009 @@ -425,15 +425,16 @@ // Too bad, I can't deallocate it because it is in permanent memory. } - void acquire() { + bool acquire(CommonClass* cl) { lockVar.lock(); + return true; } void acquireAll(uint32 nb) { lockVar.lockAll(nb); } - void release() { + void release(CommonClass* cl) { lockVar.unlock(); } @@ -746,7 +747,7 @@ /// release - Release this class lock. /// void release() { - lock.release(); + lock.release(this); } /// waitClass - Wait for the class to be loaded/initialized/resolved. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h?rev=84625&r1=84624&r2=84625&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Tue Oct 20 03:58:38 2009 @@ -30,7 +30,9 @@ private: mvm::LockRecursive internalLock; - mvm::Thread* waitingThread; + mvm::SpinLock spinLock; + uint32_t waitingThreads; + uint32_t lockingThreads; JavaThread* firstThread; JavaObject* associatedObject; uint32_t index; @@ -38,12 +40,30 @@ public: + JavaObject* getAssociatedObject() { + return associatedObject; + } + /// acquire - Acquires the internalLock. /// - void acquire() { - waitingThread = mvm::Thread::get(); + bool acquire(JavaObject* obj) { + llvm_gcroot(obj, 0); + + spinLock.lock(); + lockingThreads++; + spinLock.unlock(); + internalLock.lock(); - waitingThread = 0; + + spinLock.lock(); + lockingThreads--; + spinLock.unlock(); + + if (associatedObject != obj) { + internalLock.unlock(); + return false; + } + return true; } /// tryAcquire - Tries to acquire the lock. @@ -55,16 +75,12 @@ /// acquireAll - Acquires the lock nb times. void acquireAll(uint32 nb) { - waitingThread = mvm::Thread::get(); internalLock.lockAll(nb); - waitingThread = 0; } /// release - Releases the internalLock. /// - void release() { - internalLock.unlock(); - } + void release(JavaObject* obj); /// owner - Returns if the current thread owns this internalLock. /// @@ -80,10 +96,12 @@ /// JavaLock - Default constructor. JavaLock(uint32_t i, JavaObject* a) { + llvm_gcroot(a, 0); firstThread = 0; index = i; associatedObject = a; - waitingThread = 0; + waitingThreads = 0; + lockingThreads = 0; } static JavaLock* allocate(JavaObject*); Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp?rev=84625&r1=84624&r2=84625&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.cpp Tue Oct 20 03:58:38 2009 @@ -57,6 +57,10 @@ bool timeout = false; + l->spinLock.lock(); + l->waitingThreads++; + l->spinLock.unlock(); + while (!thread->interruptFlag && thread->nextWaiting) { if (timed) { timeout = varcondThread.timedWait(&l->internalLock, info); @@ -65,6 +69,10 @@ varcondThread.wait(&l->internalLock); } } + + l->spinLock.lock(); + l->waitingThreads--; + l->spinLock.unlock(); assert((!l->firstThread || (l->firstThread->prevWaiting && l->firstThread->nextWaiting)) && "Inconsistent list"); @@ -112,6 +120,7 @@ } else { JavaThread::get()->getJVM()->illegalMonitorStateException(self); } + assert(owner() && "Not owner after wait"); } Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h?rev=84625&r1=84624&r2=84625&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaObject.h Tue Oct 20 03:58:38 2009 @@ -198,7 +198,7 @@ /// lock - The monitor of this object. Most of the time null. /// - mvm::ThinLock lock; + mvm::ThinLock lock; /// wait - Java wait. Makes the current thread waiting on a monitor. /// @@ -233,12 +233,14 @@ void acquire() { JavaObject* self = this; llvm_gcroot(self, 0); - self->lock.acquire(); + self->lock.acquire(self); } /// release - Release the lock on this object void release() { - lock.release(); + JavaObject* self = this; + llvm_gcroot(self, 0); + lock.release(self); } /// owner - Returns true if the current thread is the owner of this object's Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=84625&r1=84624&r2=84625&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue Oct 20 03:58:38 2009 @@ -1456,6 +1456,22 @@ JavaLock* JavaLock::getFromID(uintptr_t ID) { Jnjvm* vm = JavaThread::get()->getJVM(); - JavaLock* res = vm->lockSystem.getLock(ID & ~mvm::FatMask); - return res; + if (ID & mvm::FatMask) { + JavaLock* res = vm->lockSystem.getLock(ID & ~mvm::FatMask); + return res; + } else { + return 0; + } +} + +void JavaLock::release(JavaObject* obj) { + assert(associatedObject == obj && "Mismatch object in lock"); + llvm_gcroot(obj, 0); + if (!waitingThreads && !lockingThreads && + internalLock.recursionCount() == 1) { + assert(associatedObject && "No associated object when releasing"); + associatedObject->lock.initialise(); + deallocate(); + } + internalLock.unlock(); } From nicolas.geoffray at lip6.fr Tue Oct 20 02:00:52 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 09:00:52 -0000 Subject: [vmkit-commits] [vmkit] r84626 - /vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Message-ID: <200910200900.n9K90qjU022590@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 04:00:52 2009 New Revision: 84626 URL: http://llvm.org/viewvc/llvm-project?rev=84626&view=rev Log: Remove trailing whitespace. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h?rev=84626&r1=84625&r2=84626&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaClass.h Tue Oct 20 04:00:52 2009 @@ -747,7 +747,7 @@ /// release - Release this class lock. /// void release() { - lock.release(this); + lock.release(this); } /// waitClass - Wait for the class to be loaded/initialized/resolved. From nicolas.geoffray at lip6.fr Tue Oct 20 02:33:21 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 09:33:21 -0000 Subject: [vmkit-commits] [vmkit] r84630 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaLocks.cpp Jnjvm.cpp Message-ID: <200910200933.n9K9XLTb024132@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 04:33:19 2009 New Revision: 84630 URL: http://llvm.org/viewvc/llvm-project?rev=84630&view=rev Log: Modularize. Added: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Added: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp?rev=84630&view=auto ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp (added) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp Tue Oct 20 04:33:19 2009 @@ -0,0 +1,99 @@ +//===------------- JavaLocks.cpp - Fat lock management --------------------===// +// +// The VMKit project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "JavaLocks.h" +#include "JavaThread.h" +#include "Jnjvm.h" + +using namespace jnjvm; + +JavaLock* JavaLock::allocate(JavaObject* obj) { + Jnjvm* vm = JavaThread::get()->getJVM(); + JavaLock* res = vm->lockSystem.allocate(obj); + return res; +} + +void JavaLock::deallocate() { + Jnjvm* vm = JavaThread::get()->getJVM(); + vm->lockSystem.deallocate(this); +} + +JavaLock* LockSystem::allocate(JavaObject* obj) { + + JavaLock* res = 0; + threadLock.lock(); + + // Try the freeLock list. + if (freeLock) { + res = freeLock; + freeLock = res->nextFreeLock; + res->nextFreeLock = 0; + threadLock.unlock(); + res->associatedObject = obj; + } else { + // Get an index. + uint32_t index = currentIndex++; + if (index == MaxLocks) { + fprintf(stderr, "Ran out of space for allocating locks"); + abort(); + } + + JavaLock** tab = LockTable[index >> BitIndex]; + + if (tab == NULL) + tab = (JavaLock**)associatedVM->allocator.Allocate(IndexSize, + "Index LockTable"); + threadLock.unlock(); + + // Allocate the lock. + res = new(associatedVM->allocator, "Lock") JavaLock(index, obj); + + // Add the lock to the table. + uint32_t internalIndex = index & BitMask; + tab[internalIndex] = res; + } + + // Return the lock. + return res; +} + +LockSystem::LockSystem(Jnjvm* vm) { + associatedVM = vm; + LockTable = (JavaLock* **) + vm->allocator.Allocate(GlobalSize, "Global LockTable"); + LockTable[0] = (JavaLock**) + vm->allocator.Allocate(IndexSize, "Index LockTable"); + currentIndex = 0; +} + +uintptr_t JavaLock::getID() { + return index | mvm::FatMask; +} + +JavaLock* JavaLock::getFromID(uintptr_t ID) { + Jnjvm* vm = JavaThread::get()->getJVM(); + if (ID & mvm::FatMask) { + JavaLock* res = vm->lockSystem.getLock(ID & ~mvm::FatMask); + return res; + } else { + return 0; + } +} + +void JavaLock::release(JavaObject* obj) { + assert(associatedObject == obj && "Mismatch object in lock"); + llvm_gcroot(obj, 0); + if (!waitingThreads && !lockingThreads && + internalLock.recursionCount() == 1) { + assert(associatedObject && "No associated object when releasing"); + associatedObject->lock.initialise(); + deallocate(); + } + internalLock.unlock(); +} Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=84630&r1=84629&r2=84630&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue Oct 20 04:33:19 2009 @@ -1389,89 +1389,3 @@ return 0; } - - -JavaLock* JavaLock::allocate(JavaObject* obj) { - Jnjvm* vm = JavaThread::get()->getJVM(); - JavaLock* res = vm->lockSystem.allocate(obj); - return res; -} - -void JavaLock::deallocate() { - Jnjvm* vm = JavaThread::get()->getJVM(); - vm->lockSystem.deallocate(this); -} - -JavaLock* LockSystem::allocate(JavaObject* obj) { - - JavaLock* res = 0; - threadLock.lock(); - - // Try the freeLock list. - if (freeLock) { - res = freeLock; - freeLock = res->nextFreeLock; - res->nextFreeLock = 0; - threadLock.unlock(); - res->associatedObject = obj; - } else { - // Get an index. - uint32_t index = currentIndex++; - if (index == MaxLocks) { - fprintf(stderr, "Ran out of space for allocating locks"); - abort(); - } - - JavaLock** tab = LockTable[index >> BitIndex]; - - if (tab == NULL) - tab = (JavaLock**)associatedVM->allocator.Allocate(IndexSize, - "Index LockTable"); - threadLock.unlock(); - - // Allocate the lock. - res = new(associatedVM->allocator, "Lock") JavaLock(index, obj); - - // Add the lock to the table. - uint32_t internalIndex = index & BitMask; - tab[internalIndex] = res; - } - - // Return the lock. - return res; -} - -LockSystem::LockSystem(Jnjvm* vm) { - associatedVM = vm; - LockTable = (JavaLock* **) - vm->allocator.Allocate(GlobalSize, "Global LockTable"); - LockTable[0] = (JavaLock**) - vm->allocator.Allocate(IndexSize, "Index LockTable"); - currentIndex = 0; -} - -uintptr_t JavaLock::getID() { - return index | mvm::FatMask; -} - -JavaLock* JavaLock::getFromID(uintptr_t ID) { - Jnjvm* vm = JavaThread::get()->getJVM(); - if (ID & mvm::FatMask) { - JavaLock* res = vm->lockSystem.getLock(ID & ~mvm::FatMask); - return res; - } else { - return 0; - } -} - -void JavaLock::release(JavaObject* obj) { - assert(associatedObject == obj && "Mismatch object in lock"); - llvm_gcroot(obj, 0); - if (!waitingThreads && !lockingThreads && - internalLock.recursionCount() == 1) { - assert(associatedObject && "No associated object when releasing"); - associatedObject->lock.initialise(); - deallocate(); - } - internalLock.unlock(); -} From nicolas.geoffray at lip6.fr Tue Oct 20 04:30:41 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 11:30:41 -0000 Subject: [vmkit-commits] [vmkit] r84631 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaLocks.cpp JavaLocks.h Message-ID: <200910201130.n9KBUfti028063@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 06:30:40 2009 New Revision: 84631 URL: http://llvm.org/viewvc/llvm-project?rev=84631&view=rev Log: Reserve two bits in status word for GC. Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp?rev=84631&r1=84630&r2=84631&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.cpp Tue Oct 20 06:30:40 2009 @@ -73,13 +73,14 @@ } uintptr_t JavaLock::getID() { - return index | mvm::FatMask; + return (index << LockSystem::BitGC) | mvm::FatMask; } JavaLock* JavaLock::getFromID(uintptr_t ID) { Jnjvm* vm = JavaThread::get()->getJVM(); if (ID & mvm::FatMask) { - JavaLock* res = vm->lockSystem.getLock(ID & ~mvm::FatMask); + uint32_t index = (ID & ~mvm::FatMask) >> LockSystem::BitGC; + JavaLock* res = vm->lockSystem.getLock(index); return res; } else { return 0; Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h?rev=84631&r1=84630&r2=84631&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h (original) +++ vmkit/trunk/lib/JnJVM/VMCore/JavaLocks.h Tue Oct 20 06:30:40 2009 @@ -125,6 +125,7 @@ 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; /// LockTable - The global table that will hold the locks. The table is /// a two-dimensional array, and only one entry is created, so that From nicolas.geoffray at lip6.fr Tue Oct 20 05:02:59 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 12:02:59 -0000 Subject: [vmkit-commits] [vmkit] r84633 - in /vmkit/trunk/lib/Mvm/MMTk: MvmGC.cpp MvmGC.h Message-ID: <200910201202.n9KC2xpX029063@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 07:02:58 2009 New Revision: 84633 URL: http://llvm.org/viewvc/llvm-project?rev=84633&view=rev Log: Fix type of postAlloc and put a default one when MMTk is not yet compiled. Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp?rev=84633&r1=84632&r2=84633&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.cpp Tue Oct 20 07:02:58 2009 @@ -43,6 +43,11 @@ return 0; } +extern "C" void internalPostMalloc(uintptr_t Mutator, uintptr_t ref, + uintptr_t typeref, int32_t bytes, + int32_t allocator) { +} + void* Collector::begOf(gc* obj) { if (gc::MMTkGCAllocator == internalMalloc) { lock.acquire(); @@ -63,6 +68,7 @@ void Collector::initialise() { if (!gc::MMTkGCAllocator) { gc::MMTkGCAllocator = internalMalloc; + gc::MMTkGCPostAllocator = internalPostMalloc; gc::MMTkCheckAllocator = internalCheckAllocator; MutatorThread::MMTkMutatorSize = 0; MutatorThread::MMTkCollectorSize = 0; Modified: vmkit/trunk/lib/Mvm/MMTk/MvmGC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/MMTk/MvmGC.h?rev=84633&r1=84632&r2=84633&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/MMTk/MvmGC.h (original) +++ vmkit/trunk/lib/Mvm/MMTk/MvmGC.h Tue Oct 20 07:02:58 2009 @@ -47,9 +47,9 @@ int32_t offset, int32_t allocator, int32_t site); - typedef gc* (*MMTkPostAllocType)(uintptr_t Mutator, uintptr_t ref, - uintptr_t typeref, int32_t bytes, - int32_t allocator); + typedef void (*MMTkPostAllocType)(uintptr_t Mutator, uintptr_t ref, + uintptr_t typeref, int32_t bytes, + int32_t allocator); typedef int (*MMTkCheckAllocatorType)(uintptr_t Mutator, int32_t bytes, int32_t align, int32_t allocator); From nicolas.geoffray at lip6.fr Tue Oct 20 07:54:43 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 14:54:43 -0000 Subject: [vmkit-commits] [vmkit] r84635 - /vmkit/trunk/Makefile.rules Message-ID: <200910201454.n9KEsh53003236@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 09:54:42 2009 New Revision: 84635 URL: http://llvm.org/viewvc/llvm-project?rev=84635&view=rev Log: Use MMTKRuntime.so if LLVM_GCC is not present. Modified: vmkit/trunk/Makefile.rules Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=84635&r1=84634&r2=84635&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Tue Oct 20 09:54:42 2009 @@ -1,5 +1,6 @@ ifdef VMKIT_RUNTIME + .PRECIOUS: LLVMRuntime.inc # All of these files depend on tblgen and the .td files. @@ -123,15 +124,19 @@ endif endif -ifeq ($(WITH_LLVM_GCC), 1) ifdef RUN_ANT ifdef ANT +ifeq ($(WITH_LLVM_GCC), 1) +ADDITIONAL_ARGS := -load-bc=$(LibDir)/MMTKRuntime.bc +else +ADDITIONAL_ARGS := -load=$(LibDir)/MMTKRuntime$(SHLIBEXT) +endif all:: $(Verb) $(ANT) $(Echo) Building $(BuildMode) $(JARNAME).jar $(notdir $@) - $(Verb) $(VMJC) -std-compile-opts -load-bc=$(LibDir)/MMTKRuntime.bc -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=vmkit.properties -disable-stubs -assume-compiled + $(Verb) $(VMJC) -std-compile-opts $(ADDITIONAL_ARGS) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -LowerMagic -verify $(JARNAME).jar -disable-exceptions -disable-cooperativegc -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory -o $(JARNAME).bc -Dmmtk.properties=vmkit.properties -disable-stubs -assume-compiled $(Verb) $(LOPT) -load=$(LibDir)/MMTKMagic$(SHLIBEXT) -std-compile-opts -LowerJavaRT -f $(JARNAME).bc -o $(JARNAME)-optimized.bc @@ -139,4 +144,3 @@ clean-local:: $(Verb) $(RM) -rf classes $(JARNAME).jar $(JARNAME).bc $(JARNAME)-optimized.bc endif -endif From nicolas.geoffray at lip6.fr Tue Oct 20 07:55:21 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 14:55:21 -0000 Subject: [vmkit-commits] [vmkit] r84636 - /vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Message-ID: <200910201455.n9KEtLdQ003267@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 09:55:21 2009 New Revision: 84636 URL: http://llvm.org/viewvc/llvm-project?rev=84636&view=rev Log: Implement some functions. Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Modified: vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp?rev=84636&r1=84635&r2=84636&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/ObjectModel.cpp Tue Oct 20 09:55:21 2009 @@ -20,15 +20,17 @@ } extern "C" uintptr_t Java_org_j3_mmtk_ObjectModel_readAvailableBitsWord__Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* OM, JavaObject* obj) { - abort(); 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) { - abort(); ((uintptr_t*)obj)[1] = val; } +extern "C" JavaObject* Java_org_j3_mmtk_ObjectModel_objectStartRef__Lorg_vmmagic_unboxed_ObjectReference_2 (JavaObject* OM, JavaObject* obj) { + return obj; +} + extern "C" void Java_org_j3_mmtk_ObjectModel_copy__Lorg_vmmagic_unboxed_ObjectReference_2I () { abort(); } extern "C" void Java_org_j3_mmtk_ObjectModel_copyTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { abort(); } extern "C" void Java_org_j3_mmtk_ObjectModel_getReferenceWhenCopiedTo__Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2 () { abort(); } @@ -47,7 +49,6 @@ extern "C" void Java_org_j3_mmtk_ObjectModel_prepareAvailableBits__Lorg_vmmagic_unboxed_ObjectReference_2 () { abort(); } extern "C" void Java_org_j3_mmtk_ObjectModel_writeAvailableByte__Lorg_vmmagic_unboxed_ObjectReference_2B () { abort(); } extern "C" void Java_org_j3_mmtk_ObjectModel_readAvailableByte__Lorg_vmmagic_unboxed_ObjectReference_2 () { abort(); } -extern "C" void Java_org_j3_mmtk_ObjectModel_objectStartRef__Lorg_vmmagic_unboxed_ObjectReference_2 () { abort(); } extern "C" void Java_org_j3_mmtk_ObjectModel_refToAddress__Lorg_vmmagic_unboxed_ObjectReference_2 () { abort(); } extern "C" void Java_org_j3_mmtk_ObjectModel_isAcyclic__Lorg_vmmagic_unboxed_ObjectReference_2 () { abort(); } extern "C" void Java_org_j3_mmtk_ObjectModel_dumpObject__Lorg_vmmagic_unboxed_ObjectReference_2 () { abort(); } From nicolas.geoffray at lip6.fr Tue Oct 20 09:07:33 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Tue, 20 Oct 2009 16:07:33 -0000 Subject: [vmkit-commits] [vmkit] r84639 - /vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Message-ID: <200910201607.n9KG7XRE006242@zion.cs.uiuc.edu> Author: geoffray Date: Tue Oct 20 11:07:31 2009 New Revision: 84639 URL: http://llvm.org/viewvc/llvm-project?rev=84639&view=rev Log: Allocate arrays with malloc on boot. Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Modified: vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp?rev=84639&r1=84638&r2=84639&view=diff ============================================================================== --- vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/JnJVM/VMCore/Jnjvm.cpp Tue Oct 20 11:07:31 2009 @@ -761,7 +761,8 @@ ZipFile* file = archive.getFile(PATH_MANIFEST); if (file) { UserClassArray* array = vm->bootstrapLoader->upcalls->ArrayOfByte; - ArrayUInt8* res = (ArrayUInt8*)array->doNew(file->ucsize, vm); + ArrayUInt8* res = (ArrayUInt8*)array->doNew(file->ucsize, vm->allocator, + true); int ok = archive.readFile(res, file); if (ok) { char* mainClass = findInformation(vm, res, MAIN_CLASS, @@ -777,6 +778,7 @@ } else { printf("Can't extract Manifest file from archive %s\n", jarFile); } + free(res); } else { printf("Can't find Manifest file in archive %s\n", jarFile); } From nicolas.geoffray at lip6.fr Wed Oct 21 04:35:26 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 21 Oct 2009 11:35:26 -0000 Subject: [vmkit-commits] [vmkit] r84755 - in /vmkit/trunk: lib/Mvm/Compiler/JIT.cpp mmtk/magic/LowerJavaRT.cpp Message-ID: <200910211135.n9LBZRUb013046@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 21 06:35:26 2009 New Revision: 84755 URL: http://llvm.org/viewvc/llvm-project?rev=84755&view=rev Log: Add MMTk boot operations. Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=84755&r1=84754&r2=84755&view=diff ============================================================================== --- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Wed Oct 21 06:35:26 2009 @@ -73,6 +73,8 @@ } } +typedef void (*BootType)(uintptr_t Plan); + void MvmModule::initialise(CodeGenOpt::Level level, Module* M, TargetMachine* T) { mvm::linkVmkitGC(); @@ -164,6 +166,30 @@ F = dyn_cast(GA->getAliasee()); gc::MMTkCheckAllocator = (gc::MMTkCheckAllocatorType) (uintptr_t)executionEngine->getPointerToFunction(F); + + GV = globalModule->getGlobalVariable("org_j3_config_Selected_4Plan_static", false); + assert(GV && "No global plan."); + uintptr_t Plan = *((uintptr_t*)executionEngine->getPointerToGlobal(GV)); + + GA = dyn_cast(globalModule->getNamedValue("MMTkPlanBoot")); + assert(GA && "Could not find MMTkPlanBoot alias"); + F = dyn_cast(GA->getAliasee()); + BootType Boot = (BootType) + (uintptr_t)executionEngine->getPointerToFunction(F); + Boot(Plan); + + GA = dyn_cast(globalModule->getNamedValue("MMTkPlanPostBoot")); + assert(GA && "Could not find MMTkPlanPostBoot alias"); + F = dyn_cast(GA->getAliasee()); + Boot = (BootType)(uintptr_t)executionEngine->getPointerToFunction(F); + Boot(Plan); + + GA = dyn_cast(globalModule->getNamedValue("MMTkPlanFullBoot")); + assert(GA && "Could not find MMTkPlanFullBoot alias"); + F = dyn_cast(GA->getAliasee()); + Boot = (BootType)(uintptr_t)executionEngine->getPointerToFunction(F); + Boot(Plan); + } #endif } Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerJavaRT.cpp?rev=84755&r1=84754&r2=84755&view=diff ============================================================================== --- vmkit/trunk/mmtk/magic/LowerJavaRT.cpp (original) +++ vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Wed Oct 21 06:35:26 2009 @@ -142,8 +142,62 @@ C = CA->getOperand(CheckAllocIndex); C = C->getOperand(0); - new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, "MMTkCheckAllocator", + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, + "MMTkCheckAllocator", C, &M); + + + + GV = M.getGlobalVariable("org_mmtk_plan_Plan_VT", false); + CA = dyn_cast(GV->getInitializer()); + + Function* Boot = M.getFunction("JnJVM_org_mmtk_plan_Plan_boot__"); + Function* PostBoot = M.getFunction("JnJVM_org_mmtk_plan_Plan_postBoot__"); + Function* FullBoot = M.getFunction("JnJVM_org_mmtk_plan_Plan_fullyBooted__"); + Function* Exit = M.getFunction("JnJVM_org_mmtk_plan_Plan_notifyExit__I"); + uint32_t BootIndex = 0; + uint32_t PostBootIndex = 0; + uint32_t FullBootIndex = 0; + uint32_t ExitIndex = 0; + for (uint32_t i = 0; i < CA->getNumOperands(); ++i) { + ConstantExpr* CE = dyn_cast(CA->getOperand(i)); + if (CE) { + C = CE->getOperand(0); + if (C == Boot) { + BootIndex = i; + } else if (C == PostBoot) { + PostBootIndex = i; + } else if (C == FullBoot) { + FullBootIndex = i; + } else if (C == Exit) { + ExitIndex = i; + } + } + } + + GV = M.getGlobalVariable("org_j3_config_Selected_4Plan_VT", false); + assert(GV && "No Plan"); + CA = dyn_cast(GV->getInitializer()); + + C = CA->getOperand(BootIndex); + C = C->getOperand(0); + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, "MMTkPlanBoot", C, &M); + + C = CA->getOperand(PostBootIndex); + C = C->getOperand(0); + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, + "MMTkPlanPostBoot", C, &M); + + C = CA->getOperand(FullBootIndex); + C = C->getOperand(0); + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, + "MMTkPlanFullBoot", C, &M); + + C = CA->getOperand(ExitIndex); + C = C->getOperand(0); + new GlobalAlias(C->getType(), GlobalValue::ExternalLinkage, "MMTkPlanExit", + C, &M); + return Changed; From nicolas.geoffray at lip6.fr Wed Oct 21 04:35:54 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Wed, 21 Oct 2009 11:35:54 -0000 Subject: [vmkit-commits] [vmkit] r84756 - /vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Message-ID: <200910211135.n9LBZsNS013101@zion.cs.uiuc.edu> Author: geoffray Date: Wed Oct 21 06:35:54 2009 New Revision: 84756 URL: http://llvm.org/viewvc/llvm-project?rev=84756&view=rev Log: Implement some functions. Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=84756&r1=84755&r2=84756&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Wed Oct 21 06:35:54 2009 @@ -19,16 +19,16 @@ extern "C" bool Java_org_j3_mmtk_Collection_isEmergencyAllocation__ (JavaObject* C) { - abort(); + // TODO: emergency when OOM. + return false; } extern "C" void Java_org_j3_mmtk_Collection_reportAllocationSuccess__ (JavaObject* C) { - abort(); + // TODO: clear internal data. } extern "C" void Java_org_j3_mmtk_Collection_triggerCollection__I (JavaObject* C, int why) { - abort(); JnJVM_org_mmtk_plan_Plan_setCollectionTriggered__(); JnJVM_org_j3_config_Selected_00024Collector_staticCollect__(); JnJVM_org_mmtk_plan_Plan_collectionComplete__(); From nicolas.geoffray at lip6.fr Fri Oct 23 15:04:37 2009 From: nicolas.geoffray at lip6.fr (Nicolas Geoffray) Date: Fri, 23 Oct 2009 22:04:37 -0000 Subject: [vmkit-commits] [vmkit] r84972 - /vmkit/trunk/www/releases/index.html Message-ID: <200910232204.n9NM4btX030188@zion.cs.uiuc.edu> Author: geoffray Date: Fri Oct 23 17:04:37 2009 New Revision: 84972 URL: http://llvm.org/viewvc/llvm-project?rev=84972&view=rev Log: Add to-be released vmkit 0.26. Modified: vmkit/trunk/www/releases/index.html Modified: vmkit/trunk/www/releases/index.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/releases/index.html?rev=84972&r1=84971&r2=84972&view=diff ============================================================================== --- vmkit/trunk/www/releases/index.html (original) +++ vmkit/trunk/www/releases/index.html Fri Oct 23 17:04:37 2009 @@ -52,6 +52,11 @@