From h.bakiras at gmail.com Mon Jul 1 09:03:18 2013 From: h.bakiras at gmail.com (Harris Bakiras) Date: Mon, 01 Jul 2013 16:03:18 -0000 Subject: [vmkit-commits] [vmkit] r185341 - Implemented Unsafe arrayBaseOffset and arrayIndexScale. Message-ID: <20130701160318.71B662A6C029@llvm.org> Author: harris Date: Mon Jul 1 11:03:17 2013 New Revision: 185341 URL: http://llvm.org/viewvc/llvm-project?rev=185341&view=rev Log: Implemented Unsafe arrayBaseOffset and arrayIndexScale. Modified: vmkit/trunk/lib/j3/ClassLib/Unsafe.inc Modified: vmkit/trunk/lib/j3/ClassLib/Unsafe.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/ClassLib/Unsafe.inc?rev=185341&r1=185340&r2=185341&view=diff ============================================================================== --- vmkit/trunk/lib/j3/ClassLib/Unsafe.inc (original) +++ vmkit/trunk/lib/j3/ClassLib/Unsafe.inc Mon Jul 1 11:03:17 2013 @@ -80,8 +80,10 @@ JavaObject* unsafe, JavaObjectField* _fi /// JNIEXPORT jlong JNICALL Java_sun_misc_Unsafe_arrayBaseOffset( JavaObject* unsafe, JavaObject* clazz) { - // Array starts at beginning of object - return 0; + llvm_gcroot(clazz, 0); + llvm_gcroot(unsafe, 0); + // See JavaArray.h for arrays layout + return sizeof(JavaObject) + sizeof(ssize_t); } /// arrayIndexScale - Indexing scale for the element type in @@ -92,9 +94,23 @@ JavaObject* unsafe, JavaObject* clazz) { /// JNIEXPORT jlong JNICALL Java_sun_misc_Unsafe_arrayIndexScale( JavaObject* unsafe, JavaObject* clazz) { - // For now, just return '0', indicating we don't support this indexing. - // TODO: Implement this for the array types we /do/ support this way. - return 0; + JavaObjectClass* jcl = 0; + llvm_gcroot(clazz, 0); + llvm_gcroot(unsafe, 0); + llvm_gcroot(jcl, 0); + ClassArray* clArray = 0; + int size = 0; + + UserCommonClass* cl = JavaObjectClass::getClass(jcl = (JavaObjectClass*)clazz); + if (cl->isArray()) { + clArray = cl->asArrayClass(); + if(clArray->_baseClass->isPrimitive()) { + size = 1 << clArray->_baseClass->asPrimitiveClass()->logSize; + } else { + size = sizeof(JavaObject*); + } + } + return size; } From peter.senna at gmail.com Mon Jul 8 05:18:44 2013 From: peter.senna at gmail.com (Peter Senna Tschudin) Date: Mon, 08 Jul 2013 12:18:44 -0000 Subject: [vmkit-commits] [vmkit] r185812 - Updated www/get_started.html to LLVM 3.3 Message-ID: <20130708121844.9D57C2A6C029@llvm.org> Author: peter.senna Date: Mon Jul 8 07:18:44 2013 New Revision: 185812 URL: http://llvm.org/viewvc/llvm-project?rev=185812&view=rev Log: Updated www/get_started.html to LLVM 3.3 Modified: vmkit/trunk/www/get_started.html Modified: vmkit/trunk/www/get_started.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/get_started.html?rev=185812&r1=185811&r2=185812&view=diff ============================================================================== --- vmkit/trunk/www/get_started.html (original) +++ vmkit/trunk/www/get_started.html Mon Jul 8 07:18:44 2013 @@ -31,20 +31,23 @@ You will have to install a C++ compiler compile vmkit2

    -
  1. Download - LLVM 3.2 and - Clang 3.2 +
  2. Download + LLVM 3.3 and + Clang 3.3 source code.
  3. +
    To compile LLVM and VMKit with RTTI enabled, one can pass the parameter +REQUIRES_RTTI=1 to make. Passing this argument removes the flag -fno-rtti from +the compiler options. Ex: $ make REQUIRES_RTTI=1

    Skip the Classpath steps if you plan to use OpenJDK.

  4. Download From peter.senna at gmail.com Mon Jul 8 05:19:47 2013 From: peter.senna at gmail.com (Peter Senna Tschudin) Date: Mon, 08 Jul 2013 12:19:47 -0000 Subject: [vmkit-commits] [vmkit] r185813 - www/get_started.html minor fix Message-ID: <20130708121947.9178F2A6C029@llvm.org> Author: peter.senna Date: Mon Jul 8 07:19:47 2013 New Revision: 185813 URL: http://llvm.org/viewvc/llvm-project?rev=185813&view=rev Log: www/get_started.html minor fix Modified: vmkit/trunk/www/get_started.html Modified: vmkit/trunk/www/get_started.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/get_started.html?rev=185813&r1=185812&r2=185813&view=diff ============================================================================== --- vmkit/trunk/www/get_started.html (original) +++ vmkit/trunk/www/get_started.html Mon Jul 8 07:19:47 2013 @@ -45,9 +45,9 @@ compile vmkit2

  5. cd ..
  6. ./configure --enable-optimized; make
  7. -
    To compile LLVM and VMKit with RTTI enabled, one can pass the parameter +
    Note: To compile LLVM and VMKit with RTTI enabled, one can pass the parameter REQUIRES_RTTI=1 to make. Passing this argument removes the flag -fno-rtti from -the compiler options. Ex: $ make REQUIRES_RTTI=1
    +the compiler options. Ex: $ make REQUIRES_RTTI=1

    Skip the Classpath steps if you plan to use OpenJDK.

  8. Download From peter.senna at gmail.com Mon Jul 8 06:19:12 2013 From: peter.senna at gmail.com (Peter Senna Tschudin) Date: Mon, 08 Jul 2013 13:19:12 -0000 Subject: [vmkit-commits] [vmkit] r185816 - minor fix at www/get_started.html Message-ID: <20130708131912.6CDEA2A6C029@llvm.org> Author: peter.senna Date: Mon Jul 8 08:19:11 2013 New Revision: 185816 URL: http://llvm.org/viewvc/llvm-project?rev=185816&view=rev Log: minor fix at www/get_started.html Modified: vmkit/trunk/www/get_started.html Modified: vmkit/trunk/www/get_started.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/get_started.html?rev=185816&r1=185815&r2=185816&view=diff ============================================================================== --- vmkit/trunk/www/get_started.html (original) +++ vmkit/trunk/www/get_started.html Mon Jul 8 08:19:11 2013 @@ -41,7 +41,7 @@ compile vmkit2

  9. tar zxvf llvm-3.3.src.tar.gz
  10. cd llvm-3.2.src/tools
  11. tar zxvf ../../cfe-3.3.src.tar.gz
  12. -
  13. mv cfe-3.3.src cfe
  14. +
  15. mv cfe-3.3.src clang
  16. cd ..
  17. ./configure --enable-optimized; make
  18. From h.bakiras at gmail.com Tue Jul 16 02:48:09 2013 From: h.bakiras at gmail.com (Harris Bakiras) Date: Tue, 16 Jul 2013 09:48:09 -0000 Subject: [vmkit-commits] [vmkit] r186395 - Improved Java runtime JIT debug Message-ID: <20130716094809.844142A6C029@llvm.org> Author: harris Date: Tue Jul 16 04:48:09 2013 New Revision: 186395 URL: http://llvm.org/viewvc/llvm-project?rev=186395&view=rev Log: Improved Java runtime JIT debug Modified: vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp Modified: vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp?rev=186395&r1=186394&r2=186395&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp Tue Jul 16 04:48:09 2013 @@ -22,6 +22,7 @@ #include "j3/OpcodeNames.def" #include +#include using namespace j3; @@ -530,16 +531,62 @@ extern "C" void* j3ResolveInterface(Java return (void*)result; } +#if JNJVM_EXECUTE > 0 +std::map debugTabulations; +std::map::iterator last = debugTabulations.end(); +#endif + extern "C" void j3PrintMethodStart(JavaMethod* meth) { - fprintf(stderr, "[%p] executing %s.%s\n", (void*)vmkit::Thread::get(), - UTF8Buffer(meth->classDef->name).cString(), - UTF8Buffer(meth->name).cString()); + vmkit::Thread* th = vmkit::Thread::get(); + +#if JNJVM_EXECUTE > 0 + if(last->first != th) { + last = debugTabulations.find(th); + if(last == debugTabulations.end()) { + last = debugTabulations.insert(std::make_pair(th, 2)).first; + } + } + int sizeTab = last->second; + last->second++; + char tabs [sizeTab]; + for(int i = 0; i < sizeTab-1; i++) + tabs[i] = '-'; + tabs[sizeTab-1] = '\0'; + + fprintf(stderr, "[%p] |%sexecuting %s.%s\n", (void*)th, tabs, + UTF8Buffer(meth->classDef->name).cString(), + UTF8Buffer(meth->name).cString()); +#else + fprintf(stderr, "[%p] executing %s.%s\n", (void*)th, + UTF8Buffer(meth->classDef->name).cString(), + UTF8Buffer(meth->name).cString()); +#endif + } extern "C" void j3PrintMethodEnd(JavaMethod* meth) { - fprintf(stderr, "[%p] return from %s.%s\n", (void*)vmkit::Thread::get(), - UTF8Buffer(meth->classDef->name).cString(), - UTF8Buffer(meth->name).cString()); + vmkit::Thread* th = vmkit::Thread::get(); + +#if JNJVM_EXECUTE > 0 + if(last->first != th) { + last = debugTabulations.find(th); + } + last->second--; + int sizeTab = last->second; + char tabs [sizeTab]; + for(int i = 0; i < sizeTab-1; i++) + tabs[i] = '-'; + tabs[sizeTab-1] = '\0'; + + fprintf(stderr, "[%p] |%sreturn from %s.%s\n", (void*)th, tabs, + UTF8Buffer(meth->classDef->name).cString(), + UTF8Buffer(meth->name).cString()); +#else + fprintf(stderr, "[%p] return from %s.%s\n", (void*)th, + UTF8Buffer(meth->classDef->name).cString(), + UTF8Buffer(meth->name).cString()); +#endif + } extern "C" void j3PrintExecution(uint32 opcode, uint32 index, From h.bakiras at gmail.com Mon Jul 22 06:10:44 2013 From: h.bakiras at gmail.com (Harris Bakiras) Date: Mon, 22 Jul 2013 13:10:44 -0000 Subject: [vmkit-commits] [vmkit] r186827 - Updated tutorial code for llvm 3.3 release. Message-ID: <20130722131044.D07242A6C030@llvm.org> Author: harris Date: Mon Jul 22 08:10:44 2013 New Revision: 186827 URL: http://llvm.org/viewvc/llvm-project?rev=186827&view=rev Log: Updated tutorial code for llvm 3.3 release. Modified: vmkit/trunk/www/tuto/VMKit_tutorial.tar.gz vmkit/trunk/www/tuto/toy-vm-base.tar.gz Modified: vmkit/trunk/www/tuto/VMKit_tutorial.tar.gz URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/tuto/VMKit_tutorial.tar.gz?rev=186827&r1=186826&r2=186827&view=diff ============================================================================== Binary files vmkit/trunk/www/tuto/VMKit_tutorial.tar.gz (original) and vmkit/trunk/www/tuto/VMKit_tutorial.tar.gz Mon Jul 22 08:10:44 2013 differ Modified: vmkit/trunk/www/tuto/toy-vm-base.tar.gz URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/tuto/toy-vm-base.tar.gz?rev=186827&r1=186826&r2=186827&view=diff ============================================================================== Binary files vmkit/trunk/www/tuto/toy-vm-base.tar.gz (original) and vmkit/trunk/www/tuto/toy-vm-base.tar.gz Mon Jul 22 08:10:44 2013 differ From koutheir at gmail.com Mon Jul 22 08:45:35 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 22 Jul 2013 15:45:35 -0000 Subject: [vmkit-commits] [vmkit] r186830 - Added AOT/JIT switch to indicate when we are compiling the garbage collector itself. Message-ID: <20130722154536.95506312800A@llvm.org> Author: koutheir Date: Mon Jul 22 10:45:34 2013 New Revision: 186830 URL: http://llvm.org/viewvc/llvm-project?rev=186830&view=rev Log: Added AOT/JIT switch to indicate when we are compiling the garbage collector itself. Updated DaCapo benchmark scripts. Some code factorization. Added: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp (with props) vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h (with props) Removed: vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp Modified: vmkit/branches/incinerator/.cproject vmkit/branches/incinerator/incinerator/knopflerfish.patch vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java vmkit/branches/incinerator/include/j3/J3Intrinsics.h vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h vmkit/branches/incinerator/include/j3/JavaCompiler.h vmkit/branches/incinerator/include/j3/JavaJITCompiler.h vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h vmkit/branches/incinerator/include/vmkit/GC.h vmkit/branches/incinerator/include/vmkit/System.h vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile vmkit/branches/incinerator/tests/dacapo/Makefile.inc vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv vmkit/branches/incinerator/tests/dacapo/run-all.sh vmkit/branches/incinerator/tests/dacapo/run-bench.sh vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv vmkit/branches/incinerator/tools/vmjc/vmjc.cpp Modified: vmkit/branches/incinerator/.cproject URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/.cproject?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/.cproject (original) +++ vmkit/branches/incinerator/.cproject Mon Jul 22 10:45:34 2013 @@ -30,13 +30,13 @@ Modified: vmkit/branches/incinerator/incinerator/knopflerfish.patch URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/knopflerfish.patch?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/incinerator/knopflerfish.patch (original) +++ vmkit/branches/incinerator/incinerator/knopflerfish.patch Mon Jul 22 10:45:34 2013 @@ -1,29 +1,33 @@ -Index: knopflerfish/osgi/framework/src/j3/vm/OSGi.java -=================================================================== ---- knopflerfish/osgi/framework/src/j3/vm/OSGi.java 1970-01-01 01:00:00.000000000 +0100 -+++ knopflerfish/osgi/framework/src/j3/vm/OSGi.java 2012-10-27 00:08:43.000000000 +0200 +diff -U 4 -H -d -p -r -N -- a/osgi/framework/src/j3/vm/OSGi.java b/osgi/framework/src/j3/vm/OSGi.java +--- a/osgi/framework/src/j3/vm/OSGi.java 1970-01-01 01:00:00.000000000 +0100 ++++ b/osgi/framework/src/j3/vm/OSGi.java 2013-07-03 17:15:27.382558975 +0200 @@ -0,0 +1,6 @@ +package j3.vm; + +public class OSGi +{ -+ public static native void associateBundleClass(long bundleID, Class classObject); ++ public static native void setBundleClassLoader(long bundleID, ClassLoader loaderObject); +} -Index: knopflerfish/osgi/framework/src/org/knopflerfish/framework/BundleClassLoader.java -=================================================================== ---- knopflerfish/osgi/framework/src/org/knopflerfish/framework/BundleClassLoader.java 2012-10-27 02:29:49.852807353 +0200 -+++ knopflerfish/osgi/framework/src/org/knopflerfish/framework/BundleClassLoader.java 2012-10-27 02:36:22.287024825 +0200 -@@ -821,9 +821,12 @@ - } - Vector av = classPath.componentExists(path, onlyFirst); - if (av != null) { - try { -- return action.get(av, path, name, pkg, this); -+ Object cl = action.get(av, path, name, pkg, this); -+ if (cl instanceof Class) -+ j3.vm.OSGi.associateBundleClass(getBundle().getBundleId(), (Class)cl); -+ return cl; - } catch (IOException ioe) { - fwCtx.listeners.frameworkError(bpkgs.bg.bundle, ioe); - return null; +diff -U 4 -H -d -p -r -N -- a/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java b/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java +--- a/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java 2013-07-03 17:24:51.446553603 +0200 ++++ b/osgi/framework/src/org/knopflerfish/framework/BundleGeneration.java 2013-07-03 17:17:48.950557625 +0200 +@@ -162,8 +162,9 @@ public class BundleGeneration implements + lazyExcludes = null; + timeStamp = System.currentTimeMillis(); + bpkgs = new BundlePackages(this, exportStr); + classLoader = b.getClassLoader(); ++ j3.vm.OSGi.setBundleClassLoader(bundle.getBundleId(), classLoader); + } + + + /** +@@ -440,8 +441,9 @@ public class BundleGeneration implements + } + } + } + classLoader = bundle.secure.newBundleClassLoader(this); ++ j3.vm.OSGi.setBundleClassLoader(bundle.getBundleId(), classLoader); + + return true; } + if (fragments != null) { Modified: vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java (original) +++ vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java Mon Jul 22 10:45:34 2013 @@ -3,7 +3,7 @@ package j3.vm; public class OSGi { // OSGi hooks and information gathering - public static native void associateBundleClass(long bundleID, Class classObject); + public static native void setBundleClassLoader(long bundleID, ClassLoader loaderObject); public static native void notifyBundleUninstalled(long bundleID); // Commands Modified: vmkit/branches/incinerator/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/J3Intrinsics.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/include/j3/J3Intrinsics.h (original) +++ vmkit/branches/incinerator/include/j3/J3Intrinsics.h Mon Jul 22 10:45:34 2013 @@ -127,10 +127,10 @@ public: llvm::Constant* OffsetDoYieldInThreadConstant; llvm::Constant* OffsetIsolateIDInThreadConstant; llvm::Constant* OffsetVMInThreadConstant; - llvm::Constant* OffsetThreadInMutatorThreadConstant; + llvm::Constant* OffsetThreadInMutatorThreadConstant; llvm::Constant* OffsetJNIInJavaThreadConstant; llvm::Constant* OffsetJavaExceptionInJavaThreadConstant; - + llvm::Constant* OffsetClassInVTConstant; llvm::Constant* OffsetDepthInVTConstant; llvm::Constant* OffsetDisplayInVTConstant; Modified: vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h (original) +++ vmkit/branches/incinerator/include/j3/JavaAOTCompiler.h Mon Jul 22 10:45:34 2013 @@ -28,7 +28,8 @@ using vmkit::UTF8; class JavaAOTCompiler : public JavaLLVMCompiler { public: - JavaAOTCompiler(const std::string &ModuleID); + JavaAOTCompiler( + const std::string &ModuleID, bool compiling_garbage_collector = false); virtual bool isStaticCompiling() { return true; @@ -38,8 +39,10 @@ public: return true; } - virtual JavaCompiler* Create(const std::string& ModuleID) { - return new JavaAOTCompiler(ModuleID); + virtual JavaCompiler* Create( + const std::string& ModuleID, bool compiling_garbage_collector = false) + { + return new JavaAOTCompiler(ModuleID, compiling_garbage_collector); } virtual void* materializeFunction(JavaMethod* meth, Class* customizeFor) { Modified: vmkit/branches/incinerator/include/j3/JavaCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaCompiler.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/include/j3/JavaCompiler.h (original) +++ vmkit/branches/incinerator/include/j3/JavaCompiler.h Mon Jul 22 10:45:34 2013 @@ -35,8 +35,14 @@ class JavaCompiler { public: vmkit::BumpPtrAllocator allocator; + bool compilingGarbageCollector; - virtual JavaCompiler* Create(const std::string&) { + JavaCompiler(bool compiling_garbage_collector = false) : + compilingGarbageCollector(compiling_garbage_collector) {} + + virtual JavaCompiler* Create( + const std::string&, bool compiling_garbage_collector = false) + { return this; } @@ -50,6 +56,10 @@ public: return false; } + virtual bool isCompilingGarbageCollector() { + return compilingGarbageCollector; + } + virtual bool emitFunctionName() { return false; } Modified: vmkit/branches/incinerator/include/j3/JavaJITCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaJITCompiler.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/include/j3/JavaJITCompiler.h (original) +++ vmkit/branches/incinerator/include/j3/JavaJITCompiler.h Mon Jul 22 10:45:34 2013 @@ -41,7 +41,8 @@ public: llvm::ExecutionEngine* executionEngine; llvm::GCModuleInfo* GCInfo; - JavaJITCompiler(const std::string &ModuleID); + JavaJITCompiler( + const std::string &ModuleID, bool compiling_garbage_collector = false); ~JavaJITCompiler(); virtual bool isStaticCompiling() { @@ -79,7 +80,8 @@ public: bool stat, llvm::BasicBlock* insert) = 0; virtual word_t getPointerOrStub(JavaMethod& meth, int type) = 0; - static JavaJITCompiler* CreateCompiler(const std::string& ModuleID); + static JavaJITCompiler* CreateCompiler( + const std::string& ModuleID, bool compiling_garbage_collector = false); }; class JavaJ3LazyJITCompiler : public JavaJITCompiler { @@ -89,11 +91,14 @@ public: bool stat, llvm::BasicBlock* insert); virtual word_t getPointerOrStub(JavaMethod& meth, int side); - virtual JavaCompiler* Create(const std::string& ModuleID) { - return new JavaJ3LazyJITCompiler(ModuleID); + virtual JavaCompiler* Create( + const std::string& ModuleID, bool compiling_garbage_collector = false) + { + return new JavaJ3LazyJITCompiler(ModuleID, compiling_garbage_collector); } - JavaJ3LazyJITCompiler(const std::string& ModuleID); + JavaJ3LazyJITCompiler( + const std::string& ModuleID, bool compiling_garbage_collector = false); }; } // end namespace j3 Modified: vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h Mon Jul 22 10:45:34 2013 @@ -84,7 +84,8 @@ private: llvm::DenseMap staticAPs; public: - JavaLLVMCompiler(const std::string &ModuleID); + JavaLLVMCompiler( + const std::string &ModuleID, bool compiling_garbage_collector = false); virtual bool isStaticCompiling() = 0; virtual bool emitFunctionName() = 0; @@ -123,7 +124,7 @@ public: cooperativeGC = false; } - virtual JavaCompiler* Create(const std::string& ModuleID) = 0; + virtual JavaCompiler* Create(const std::string& ModuleID, bool compiling_garbage_collector = false) = 0; virtual ~JavaLLVMCompiler(); Modified: vmkit/branches/incinerator/include/vmkit/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/vmkit/GC.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/include/vmkit/GC.h (original) +++ vmkit/branches/incinerator/include/vmkit/GC.h Mon Jul 22 10:45:34 2013 @@ -24,7 +24,6 @@ public: }; class gcRoot { - private: public: word_t& header(){return toHeader()->_header; } inline gcHeader* toHeader() { return (gcHeader*)((uintptr_t)this - gcHeader::hiddenHeaderSize()); } Modified: vmkit/branches/incinerator/include/vmkit/System.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/vmkit/System.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/include/vmkit/System.h (original) +++ vmkit/branches/incinerator/include/vmkit/System.h Mon Jul 22 10:45:34 2013 @@ -17,7 +17,6 @@ #include #include - #if defined(__linux__) || defined(__FreeBSD__) #define LINUX_OS 1 #elif defined(__APPLE__) @@ -93,7 +92,7 @@ const word_t kVmkitThreadMask = 0xF00000 const word_t kGCMemoryStart = 0x50000000; #endif -const word_t kGCMemorySize = 0x30000000; +const word_t kGCMemorySize = 0x30000000; #define TRY { vmkit::ExceptionBuffer __buffer__; if (!SETJMP(__buffer__.buffer)) #define CATCH else Modified: vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp Mon Jul 22 10:45:34 2013 @@ -162,10 +162,10 @@ void J3Intrinsics::init(llvm::Module* mo OffsetIsolateIDInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); OffsetVMInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); OffsetDoYieldInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 4); - OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); + OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); OffsetJNIInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); OffsetJavaExceptionInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); - + ClassReadyConstant = ConstantInt::get(Type::getInt8Ty(Context), ready); InterfaceLookupFunction = module->getFunction("j3InterfaceLookup"); Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp Mon Jul 22 10:45:34 2013 @@ -1832,8 +1832,9 @@ Constant* JavaAOTCompiler::CreateConstan return Array; } -JavaAOTCompiler::JavaAOTCompiler(const std::string& ModuleID) : - JavaLLVMCompiler(ModuleID) { +JavaAOTCompiler::JavaAOTCompiler( + const std::string& ModuleID, bool compiling_garbage_collector) : + JavaLLVMCompiler(ModuleID, compiling_garbage_collector) { std::string Error; const Target* TheTarget(TargetRegistry::lookupTarget( Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp Mon Jul 22 10:45:34 2013 @@ -81,10 +81,10 @@ void JavaJIT::checkYieldPoint() { if (!TheCompiler->useCooperativeGC()) return; Value* YieldPtr = getDoYieldPtr(getMutatorThreadPtr()); - Value* Yield = new LoadInst(YieldPtr, "", currentBlock); + Value* Yield = new LoadInst(YieldPtr, "yield", currentBlock); - BasicBlock* continueBlock = createBasicBlock("After safe point"); - BasicBlock* yieldBlock = createBasicBlock("In safe point"); + BasicBlock* continueBlock = createBasicBlock("afterSafePoint"); + BasicBlock* yieldBlock = createBasicBlock("inSafePoint"); BranchInst::Create(yieldBlock, continueBlock, Yield, currentBlock); currentBlock = yieldBlock; @@ -1140,7 +1140,7 @@ llvm::Function* JavaJIT::javaCompile() { jmpBuffer = new AllocaInst(ArrayType::get(Type::getInt8Ty(*llvmContext), sizeof(vmkit::ExceptionBuffer)), "", currentBlock); jmpBuffer = new BitCastInst(jmpBuffer, intrinsics->ptrType, "exceptionSavePoint", currentBlock); } - + reader.cursor = start; exploreOpcodes(reader, codeLen); @@ -1213,7 +1213,7 @@ llvm::Function* JavaJIT::javaCompile() { if (returnValue != NULL) { new StoreInst(endNode, returnValue, currentBlock); } - + if (isSynchro(compilingMethod->access)) { endSynchronize(); } @@ -1680,7 +1680,7 @@ void JavaJIT::invokeSpecial(uint16 index } else { val = invoke(func, args, "", currentBlock); } - + Type* retType = virtualType->getReturnType(); if (retType != Type::getVoidTy(*llvmContext)) { if (retType == intrinsics->JavaObjectType) { Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp Mon Jul 22 10:45:34 2013 @@ -152,8 +152,9 @@ Constant* JavaJITCompiler::getNativeFunc return ConstantExpr::getIntToPtr(CI, valPtrType); } -JavaJITCompiler::JavaJITCompiler(const std::string &ModuleID) : - JavaLLVMCompiler(ModuleID), listener(this) { +JavaJITCompiler::JavaJITCompiler( + const std::string &ModuleID, bool compiling_garbage_collector) : + JavaLLVMCompiler(ModuleID, compiling_garbage_collector), listener(this) { EmitFunctionName = false; GCInfo = NULL; @@ -440,10 +441,13 @@ bool JavaJ3LazyJITCompiler::needsCallbac getMethod(meth, customizeFor)->hasExternalWeakLinkage()); } -JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler(const std::string& ModuleID) - : JavaJITCompiler(ModuleID) {} +JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler( + const std::string& ModuleID, bool compiling_garbage_collector) : + JavaJITCompiler(ModuleID, compiling_garbage_collector) {} -JavaJITCompiler* JavaJITCompiler::CreateCompiler(const std::string& ModuleID) { - return new JavaJ3LazyJITCompiler(ModuleID); +JavaJITCompiler* JavaJITCompiler::CreateCompiler( + const std::string& ModuleID, bool compiling_garbage_collector) +{ + return new JavaJ3LazyJITCompiler(ModuleID, compiling_garbage_collector); } Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp Mon Jul 22 10:45:34 2013 @@ -25,7 +25,9 @@ using namespace llvm; namespace j3 { -JavaLLVMCompiler::JavaLLVMCompiler(const std::string& str) : +JavaLLVMCompiler::JavaLLVMCompiler( + const std::string& str, bool compiling_garbage_collector) : + JavaCompiler(compiling_garbage_collector), TheModule(new llvm::Module(str, *(new LLVMContext()))), DebugFactory(new DIBuilder(*TheModule)) { Modified: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp Mon Jul 22 10:45:34 2013 @@ -1,10 +1,13 @@ +#include "Incinerator.h" + #include "VmkitGC.h" #include "Jnjvm.h" +#include "JnjvmClassLoader.h" +#include "JavaThread.h" +#include "JavaClass.h" #include "VMStaticInstance.h" -#include "JavaReferenceQueue.h" -#include #include #if RESET_STALE_REFERENCES @@ -37,12 +40,9 @@ Incinerator* Incinerator::get() void Incinerator::dumpClassLoaderBundles() const { - vmkit::LockGuard lg(bundleClassLoadersLock); - bundleClassLoadersType::const_iterator - i = bundleClassLoaders.begin(), e = bundleClassLoaders.end(); + vm->osgi_gateway.dumpClassLoaderBundles(); - for (; i != e; ++i) - cerr << "bundleID=" << i->first << " classLoader=" << i->second << endl; + vmkit::LockGuard lg(lock); staleBundleClassLoadersType::const_iterator si = staleBundleClassLoaders.begin(), se = staleBundleClassLoaders.end(); @@ -56,9 +56,9 @@ void Incinerator::dumpClassLoaderBundles } } -void Incinerator::setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected) +void Incinerator::setBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID, bool corrected) { - JnjvmClassLoader * loader = this->getBundleClassLoader(bundleID); + JnjvmClassLoader * loader = vm->osgi_gateway.getBundleClassLoader(bundleID); if (!loader) { vm->illegalArgumentException("Invalid bundle ID"); return;} @@ -73,32 +73,15 @@ void Incinerator::setBundleStaleReferenc loader->setStaleReferencesCorrectionEnabled(corrected); } -bool Incinerator::isBundleStaleReferenceCorrected(int64_t bundleID) const +bool Incinerator::isBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID) const { - JnjvmClassLoader const* loader = this->getBundleClassLoader(bundleID); + JnjvmClassLoader const* loader = vm->osgi_gateway.getBundleClassLoader(bundleID); if (!loader) { vm->illegalArgumentException("Invalid bundle ID"); return false;} return loader->isStaleReferencesCorrectionEnabled(); } -JnjvmClassLoader * Incinerator::getBundleClassLoader(int64_t bundleID) const -{ - if (bundleID == -1) return NULL; - - vmkit::LockGuard lg(bundleClassLoadersLock); - - bundleClassLoadersType::const_iterator - i = bundleClassLoaders.find(bundleID), e = bundleClassLoaders.end(); - return (i == e) ? NULL : i->second; -} - -bool Incinerator::InstalledBundles_finder::operator() ( - const bundleClassLoadersType::value_type& pair) const -{ - return (loader == pair.second); -} - bool Incinerator::UninstalledBundles_finder::operator() ( const staleBundleClassLoadersType::value_type& pair) const { @@ -109,18 +92,14 @@ bool Incinerator::UninstalledBundles_fin return (i != e); } -int64_t Incinerator::getClassLoaderBundleID(JnjvmClassLoader const * loader) const +OSGiGateway::bundle_id_t Incinerator::getClassLoaderBundleID(JnjvmClassLoader const * loader) const { - if (loader == NULL) return -1; - vmkit::LockGuard lg(bundleClassLoadersLock); + if (loader == NULL) return OSGiGateway::invalidBundleID; - bundleClassLoadersType::const_iterator - b = bundleClassLoaders.begin(), - e = bundleClassLoaders.end(); - bundleClassLoadersType::const_iterator - i = find_if(b, e, InstalledBundles_finder(loader)); + OSGiGateway::bundle_id_t r = vm->osgi_gateway.getClassLoaderBundleID(loader); + if (r != OSGiGateway::invalidBundleID) return r; - if (i != e) return i->first; + vmkit::LockGuard lg(lock); // Look up in stale bundles list staleBundleClassLoadersType::const_iterator @@ -129,61 +108,41 @@ int64_t Incinerator::getClassLoaderBundl staleBundleClassLoadersType::const_iterator si = find_if(sb, se, UninstalledBundles_finder(loader)); - return (si == se) ? -1 : si->first; + return (si == se) ? OSGiGateway::invalidBundleID : si->first; } // Link a bundle ID (OSGi world) to a class loader (Java world). -void Incinerator::setBundleClassLoader(int64_t bundleID, JnjvmClassLoader* loader) +void Incinerator::setBundleClassLoader(OSGiGateway::bundle_id_t bundleID, JnjvmClassLoader* loader) { - if (bundleID == -1) return; - vmkit::LockGuard lg(bundleClassLoadersLock); - - JnjvmClassLoader * previous_loader = bundleClassLoaders[bundleID]; + if (bundleID == OSGiGateway::invalidBundleID) return; - if (!loader) { - // Unloaded bundle - bundleClassLoaders.erase(bundleID); + JnjvmClassLoader * previous_loader = + vm->osgi_gateway.getBundleClassLoader(bundleID); -#if DEBUG_VERBOSE_STALE_REF - cerr << "Bundle uninstalled: bundleID=" << bundleID - << " classLoader=" << previous_loader << endl; -#endif - } else { - // Installed/Updated bundle - if (previous_loader == loader) - return; // Same class loader already associated with the bundle, do nothing + bool bundleUpdated = + (previous_loader != NULL) && (loader != NULL) && + (previous_loader != loader); - // Associate the class loader with the bundle - bundleClassLoaders[bundleID] = loader; + vmkit::LockGuard lg(lock); + if (bundleUpdated) { // Propagate the stale reference correction setting to the new // class loader if a previous one exists. - if (previous_loader != NULL) { - loader->setStaleReferencesCorrectionEnabled( - previous_loader->isStaleReferencesCorrectionEnabled()); - } - -#if DEBUG_VERBOSE_STALE_REF - if (!previous_loader) { - cerr << "Bundle installed: bundleID=" << bundleID - << " classLoader=" << loader << endl; - } else { - cerr << "Bundle updated: bundleID=" << bundleID - << " classLoader=" << loader - << " previousClassLoader=" << previous_loader << endl; - } -#endif + loader->setStaleReferencesCorrectionEnabled( + previous_loader->isStaleReferencesCorrectionEnabled()); } - if (!previous_loader) - return; // No previous class loader, nothing to clean up + // Either bundle uninstalled, or bundle updated with a different class loader + if (bundleUpdated || ((previous_loader != NULL) && !loader)) { + // Mark the previous class loader as stale + staleBundleClassLoaders[bundleID].push_front(previous_loader); + previous_loader->markStale(true); - // Mark the previous class loader as stale - staleBundleClassLoaders[bundleID].push_front(previous_loader); - previous_loader->markStale(true); + // Enable stale references scanning + setScanningInclusive(); + } - // Enable stale references scanning - setScanningInclusive(); + vm->osgi_gateway.setBundleClassLoader(bundleID, loader); } IncineratorManagedClassLoader::~IncineratorManagedClassLoader() @@ -194,8 +153,8 @@ IncineratorManagedClassLoader::~Incinera void Incinerator::classLoaderUnloaded(JnjvmClassLoader const * loader) { - int64_t bundleID = getClassLoaderBundleID(loader); - if (bundleID == -1) { + OSGiGateway::bundle_id_t bundleID = getClassLoaderBundleID(loader); + if (bundleID == OSGiGateway::invalidBundleID) { #if DEBUG_VERBOSE_STALE_REF cerr << "Class loader unloaded: " << loader << endl; #endif @@ -455,4 +414,34 @@ void Incinerator::eliminateStaleRef(cons } +extern "C" void Java_j3_vm_OSGi_setBundleStaleReferenceCorrected(jlong bundleID, jboolean corrected) +{ +#if RESET_STALE_REFERENCES + j3::Incinerator::get()->setBundleStaleReferenceCorrected(bundleID, corrected); +#endif +} + +extern "C" jboolean Java_j3_vm_OSGi_isBundleStaleReferenceCorrected(jlong bundleID) +{ +#if RESET_STALE_REFERENCES + return j3::Incinerator::get()->isBundleStaleReferenceCorrected(bundleID); +#else + return false; +#endif +} + +extern "C" void Java_j3_vm_OSGi_dumpReferencesToObject(jlong obj) +{ +#if RESET_STALE_REFERENCES + j3::Incinerator::get()->dumpReferencesToObject(reinterpret_cast(obj)); +#endif +} + +extern "C" void Java_j3_vm_OSGi_forceStaleReferenceScanning() +{ +#if RESET_STALE_REFERENCES + j3::Incinerator::get()->forceStaleReferenceScanning(); +#endif +} + #endif Modified: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h Mon Jul 22 10:45:34 2013 @@ -2,11 +2,12 @@ #ifndef INCINERATOR_H #define INCINERATOR_H +#include "OSGiGateway.h" #include "vmkit/Locks.h" +#include "j3/jni.h" -#include #include -#include +#include #include #include @@ -26,15 +27,14 @@ public: Incinerator(j3::Jnjvm* j3vm); virtual ~Incinerator(); - void setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected); - bool isBundleStaleReferenceCorrected(int64_t bundleID) const; + void setBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID, bool corrected); + bool isBundleStaleReferenceCorrected(OSGiGateway::bundle_id_t bundleID) const; void dumpClassLoaderBundles() const; void dumpReferencesToObject(JavaObject* object) const; void forceStaleReferenceScanning(); - JnjvmClassLoader * getBundleClassLoader(int64_t bundleID) const; - int64_t getClassLoaderBundleID(JnjvmClassLoader const * loader) const; - void setBundleClassLoader(int64_t bundleID, JnjvmClassLoader* loader); + OSGiGateway::bundle_id_t getClassLoaderBundleID(JnjvmClassLoader const * loader) const; + void setBundleClassLoader(OSGiGateway::bundle_id_t bundleID, JnjvmClassLoader* loader); void beforeCollection(); void markingFinalizersDone(); @@ -53,9 +53,8 @@ public: volatile scanStackRefFunc scanStackRef; protected: - typedef std::map > + typedef std::map > staleBundleClassLoadersType; - typedef std::map bundleClassLoadersType; typedef std::map StaleRefListType; // (ref, source) @@ -81,13 +80,6 @@ protected: static bool scanStackRef_Exclusive( Incinerator& incinerator, const JavaMethod* method, JavaObject** ref); - class InstalledBundles_finder { - JnjvmClassLoader const * loader; - public: - InstalledBundles_finder(JnjvmClassLoader const * l) : loader(l) {} - bool operator() (const bundleClassLoadersType::value_type& pair) const; - }; - class UninstalledBundles_finder { JnjvmClassLoader const * loader; public: @@ -98,8 +90,7 @@ protected: j3::Jnjvm* vm; - mutable vmkit::LockRecursive bundleClassLoadersLock; - bundleClassLoadersType bundleClassLoaders; + mutable vmkit::LockRecursive lock; staleBundleClassLoadersType staleBundleClassLoaders; StaleRefListType staleRefList; @@ -109,7 +100,6 @@ protected: std::vector foundReferencerObjects; }; - class IncineratorManagedClassLoader { protected: @@ -142,4 +132,9 @@ public: } +extern "C" void Java_j3_vm_OSGi_setBundleStaleReferenceCorrected(jlong bundleID, jboolean corrected); +extern "C" jboolean Java_j3_vm_OSGi_isBundleStaleReferenceCorrected(jlong bundleID); +extern "C" void Java_j3_vm_OSGi_dumpReferencesToObject(jlong obj); +extern "C" void Java_j3_vm_OSGi_forceStaleReferenceScanning(); + #endif Removed: vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp?rev=186829&view=auto ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp (removed) @@ -1,80 +0,0 @@ - -#include "Incinerator.h" -#include "ClasspathReflect.h" -#include "j3/jni.h" - - -using namespace j3; - -/* - This Java native method must be called by the framework in order to link bundles (given - by bundle identifiers) to objects (thus, class loaders). This allows the VM to perform - operations on bundles without actually having to know the precise structure of these. -*/ -extern "C" void Java_j3_vm_OSGi_associateBundleClass(jlong bundleID, JavaObjectClass* classObject) -{ - llvm_gcroot(classObject, 0); - -#if RESET_STALE_REFERENCES - - CommonClass* ccl = JavaObjectClass::getClass(classObject); - Incinerator::get()->setBundleClassLoader(bundleID, ccl->classLoader); - -#endif -} - -extern "C" void Java_j3_vm_OSGi_notifyBundleUninstalled(jlong bundleID) -{ -#if RESET_STALE_REFERENCES - - Incinerator::get()->setBundleClassLoader(bundleID, NULL); - -#endif -} - -extern "C" void Java_j3_vm_OSGi_setBundleStaleReferenceCorrected(jlong bundleID, jboolean corrected) -{ -#if RESET_STALE_REFERENCES - - Incinerator::get()->setBundleStaleReferenceCorrected(bundleID, corrected); - -#endif -} - -extern "C" jboolean Java_j3_vm_OSGi_isBundleStaleReferenceCorrected(jlong bundleID) -{ -#if RESET_STALE_REFERENCES - - return Incinerator::get()->isBundleStaleReferenceCorrected(bundleID); - -#else - return false; -#endif -} - -extern "C" void Java_j3_vm_OSGi_dumpClassLoaderBundles() -{ -#if RESET_STALE_REFERENCES - - Incinerator::get()->dumpClassLoaderBundles(); - -#endif -} - -extern "C" void Java_j3_vm_OSGi_dumpReferencesToObject(jlong obj) -{ -#if RESET_STALE_REFERENCES - - Incinerator::get()->dumpReferencesToObject(reinterpret_cast(obj)); - -#endif -} - -extern "C" void Java_j3_vm_OSGi_forceStaleReferenceScanning() -{ -#if RESET_STALE_REFERENCES - - Incinerator::get()->forceStaleReferenceScanning(); - -#endif -} Modified: vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/JavaClass.h Mon Jul 22 10:45:34 2013 @@ -1009,7 +1009,6 @@ public: /// with the given class loader. /// JavaObject* getReturnType(JnjvmClassLoader* loader); - //===----------------------------------------------------------------------===// // @@ -1046,7 +1045,6 @@ private: template TYPE invokeVirtualBuf(Jnjvm* vm, UserClass* cl, JavaObject* obj, void* buf) __attribute__((noinline)) { llvm_gcroot(obj, 0); - verifyNull(obj); UserCommonClass* theClass = JavaObject::getClass(obj); UserClass* objCl = theClass->isArray() ? theClass->super : theClass->asClass(); Modified: vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp Mon Jul 22 10:45:34 2013 @@ -1354,7 +1354,6 @@ Jnjvm::Jnjvm(vmkit::BumpPtrAllocator& Al , incinerator(this) #endif { - classpath = getenv("CLASSPATH"); if (classpath == NULL) classpath = "."; Modified: vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h Mon Jul 22 10:45:34 2013 @@ -23,6 +23,7 @@ #include "JNIReferences.h" #include "LockedMap.h" #include "Incinerator.h" +#include "OSGiGateway.h" namespace j3 { @@ -363,6 +364,8 @@ public: static void printBacktrace() __attribute__((noinline)); + OSGiGateway osgi_gateway; + #if RESET_STALE_REFERENCES public: Incinerator incinerator; Modified: vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp Mon Jul 22 10:45:34 2013 @@ -44,6 +44,8 @@ #include "Reader.h" #include "Zip.h" +#include "OSGiGateway.h" +#include "Incinerator.h" using namespace j3; using namespace std; @@ -217,15 +219,17 @@ JnjvmClassLoader::JnjvmClassLoader(vmkit { } -JnjvmClassLoader::JnjvmClassLoader(vmkit::BumpPtrAllocator& Alloc, - JnjvmClassLoader& JCL, JavaObject* loader, - VMClassLoader* vmdata, - Jnjvm* VM) : allocator(Alloc) +JnjvmClassLoader::JnjvmClassLoader( + vmkit::BumpPtrAllocator& Alloc, JnjvmClassLoader& JCL, JavaObject* loader, + VMClassLoader* vmdata, Jnjvm* VM) : + allocator(Alloc) { llvm_gcroot(loader, 0); llvm_gcroot(vmdata, 0); bootstrapLoader = JCL.bootstrapLoader; - TheCompiler = bootstrapLoader->getCompiler()->Create("Applicative loader"); + TheCompiler = bootstrapLoader->getCompiler()->Create( + "Applicative loader", + bootstrapLoader->getCompiler()->isCompilingGarbageCollector()); hashUTF8 = new(allocator, "UTF8Map") UTF8Map(allocator); classes = new(allocator, "ClassMap") ClassMap(); @@ -809,6 +813,21 @@ Signdef* JnjvmClassLoader::constructSign return res; } +JnjvmClassLoader* JnjvmClassLoader::createForJavaObject( + Jnjvm* vm, JavaObject* loader, VMClassLoader**vmdata) +{ + llvm_gcroot(loader, 0); + + *vmdata = VMClassLoader::allocate(); + vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator(); + + JnjvmClassLoader* JCL = new(*A, "Class loader") + JnjvmClassLoader(*A, *vm->bootstrapLoader, loader, *vmdata, vm); + + Classpath* upcalls = vm->bootstrapLoader->upcalls; + upcalls->vmdataClassLoader->setInstanceObjectField(loader, *vmdata); + return JCL; +} JnjvmClassLoader* JnjvmClassLoader::getJnjvmLoaderFromJavaObject(JavaObject* loader, Jnjvm* vm) { @@ -834,29 +853,23 @@ JnjvmClassLoader::getJnjvmLoaderFromJava vmdata = (VMClassLoader*)(upcalls->vmdataClassLoader->getInstanceObjectField(loader)); if (!vmdata || !VMClassLoader::isVMClassLoader(vmdata)) { - vmdata = VMClassLoader::allocate(); - vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator(); - JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader, - loader, vmdata, vm); - upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata); + JCL = JnjvmClassLoader::createForJavaObject(vm, loader, &vmdata); } JavaObject::release(loader); } else if (!VMClassLoader::isVMClassLoader(vmdata)) { JavaObject::acquire(loader); - vmdata = VMClassLoader::allocate(); - vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator(); - JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader, - loader, vmdata, vm); - upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata); + JCL = JnjvmClassLoader::createForJavaObject(vm, loader, &vmdata); JavaObject::release(loader); } else { JCL = vmdata->getClassLoader(); assert(JCL->javaLoader == loader); } + if (!JCL) { assert( vmdata->getClassLoader() == JCL && "Loader is not equal to stored value"); - fprintf(stderr, "Error in method %s, %d because condition 1: %d\n", __FILE__, __LINE__, (vmdata == NULL || !VMClassLoader::isVMClassLoader(vmdata))); + fprintf(stderr, "Error in method %s, %d because condition 1: %d\n", + __FILE__, __LINE__, (vmdata == NULL || !VMClassLoader::isVMClassLoader(vmdata))); } return JCL; } Modified: vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h Mon Jul 22 10:45:34 2013 @@ -26,6 +26,7 @@ #include "JnjvmConfig.h" #include "UTF8.h" #include "Incinerator.h" +#include "OSGiGateway.h" namespace j3 { @@ -179,6 +180,8 @@ public: /// of the given class loader. /// static JnjvmClassLoader* getJnjvmLoaderFromJavaObject(JavaObject*, Jnjvm *vm); + static JnjvmClassLoader* createForJavaObject( + Jnjvm* vm, JavaObject* loader, VMClassLoader**vmdata); /// getJavaClassLoader - Return the Java representation of this class loader. /// Added: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp?rev=186830&view=auto ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp (added) +++ vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp Mon Jul 22 10:45:34 2013 @@ -0,0 +1,136 @@ + +#include "OSGiGateway.h" +#include "ClasspathReflect.h" +#include "Jnjvm.h" +#include "Incinerator.h" + +#include +#include + +#define DEBUG_VERBOSE_OSGI_GATEWAY 0 + +using namespace std; + +namespace j3 { + +OSGiGateway* OSGiGateway::get() +{ + vmkit::Thread* th = vmkit::Thread::get(); + assert(th && "Invalid current thread."); + if (!th) return NULL; + + return &static_cast(th->MyVM)->osgi_gateway; +} + +void OSGiGateway::dumpClassLoaderBundles() const +{ + vmkit::LockGuard lg(lock); + bundleClassLoadersType::const_iterator + i = bundleClassLoaders.begin(), e = bundleClassLoaders.end(); + + for (; i != e; ++i) + cerr << "bundleID=" << i->first << " classLoader=" << i->second << endl; +} + +JnjvmClassLoader * OSGiGateway::getBundleClassLoader(bundle_id_t bundleID) const +{ + if (bundleID == invalidBundleID) return NULL; + + vmkit::LockGuard lg(lock); + + bundleClassLoadersType::const_iterator + i = bundleClassLoaders.find(bundleID), e = bundleClassLoaders.end(); + return (i == e) ? NULL : i->second; +} + +OSGiGateway::bundle_id_t OSGiGateway::getClassLoaderBundleID( + JnjvmClassLoader const * loader) const +{ + if (loader == NULL) return invalidBundleID; + vmkit::LockGuard lg(lock); + + bundleClassLoadersType::const_iterator + b = bundleClassLoaders.begin(), + e = bundleClassLoaders.end(); + bundleClassLoadersType::const_iterator + i = find_if(b, e, BundlesFinder(loader)); + + return (i == e) ? invalidBundleID : i->first; +} + +void OSGiGateway::setBundleClassLoader(bundle_id_t bundleID, JnjvmClassLoader* loader) +{ + if (bundleID == invalidBundleID) return; + vmkit::LockGuard lg(lock); + + JnjvmClassLoader * previous_loader = bundleClassLoaders[bundleID]; + + if (!loader) { + // Unloaded bundle + bundleClassLoaders.erase(bundleID); + +#if DEBUG_VERBOSE_OSGI_GATEWAY + cerr << "Bundle uninstalled: bundleID=" << bundleID + << " classLoader=" << previous_loader << endl; +#endif + } else { + // Installed/Updated bundle + if (previous_loader == loader) + return; // Same class loader already associated with the bundle, do nothing + + // Associate the class loader with the bundle + bundleClassLoaders[bundleID] = loader; + +#if DEBUG_VERBOSE_OSGI_GATEWAY + if (!previous_loader) { + cerr << "Bundle installed: bundleID=" << bundleID + << " classLoader=" << loader << endl; + } else { + cerr << "Bundle updated: bundleID=" << bundleID + << " classLoader=" << loader + << " previousClassLoader=" << previous_loader << endl; + } +#endif + } +} + +} + +extern "C" void Java_j3_vm_OSGi_setBundleClassLoader( + jlong bundleID, j3::JavaObject* loaderObject) +{ + llvm_gcroot(loaderObject, 0); + + j3::Jnjvm* vm = j3::JavaThread::get()->getJVM(); + j3::JnjvmClassLoader* loader = + j3::JnjvmClassLoader::getJnjvmLoaderFromJavaObject(loaderObject, vm); + + assert((loader != NULL) && "Invalid class loader"); + +#if RESET_STALE_REFERENCES + j3::Incinerator::get()-> +#else + j3::OSGiGateway::get()-> +#endif + setBundleClassLoader(bundleID, loader); +} + +extern "C" void Java_j3_vm_OSGi_notifyBundleUninstalled(jlong bundleID) +{ +#if RESET_STALE_REFERENCES + j3::Incinerator::get()-> +#else + j3::OSGiGateway::get()-> +#endif + setBundleClassLoader(bundleID, NULL); +} + +extern "C" void Java_j3_vm_OSGi_dumpClassLoaderBundles() +{ +#if RESET_STALE_REFERENCES + j3::Incinerator::get()-> +#else + j3::OSGiGateway::get()-> +#endif + dumpClassLoaderBundles(); +} Propchange: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.cpp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h?rev=186830&view=auto ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h (added) +++ vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h Mon Jul 22 10:45:34 2013 @@ -0,0 +1,58 @@ + +#ifndef OSGIGATEWAY_H_ +#define OSGIGATEWAY_H_ + +#include "vmkit/Locks.h" +#include "j3/jni.h" + +#include +#include + +namespace j3 { + +class JnjvmClassLoader; +class JavaObjectClass; +class JavaObject; + +class OSGiGateway +{ +public: + typedef int64_t bundle_id_t; + + static const bundle_id_t invalidBundleID = (bundle_id_t)-1; + +protected: + typedef std::map bundleClassLoadersType; + + class BundlesFinder { + j3::JnjvmClassLoader const * loader; + public: + BundlesFinder(j3::JnjvmClassLoader const * l) : loader(l) {} + bool operator() (const bundleClassLoadersType::value_type& pair) const + {return (loader == pair.second);} + }; + + mutable vmkit::LockRecursive lock; + bundleClassLoadersType bundleClassLoaders; + +public: + OSGiGateway() {} + virtual ~OSGiGateway() {} + + static OSGiGateway* get(); + + j3::JnjvmClassLoader * getBundleClassLoader(bundle_id_t bundleID) const; + bundle_id_t getClassLoaderBundleID(j3::JnjvmClassLoader const * loader) const; + void setBundleClassLoader(bundle_id_t bundleID, j3::JnjvmClassLoader* loader); + + void dumpClassLoaderBundles() const; +}; + +} + +extern "C" void Java_j3_vm_OSGi_setBundleClassLoader( + jlong bundleID, j3::JavaObject* loaderObject); +extern "C" void Java_j3_vm_OSGi_notifyBundleUninstalled(jlong bundleID); +extern "C" void Java_j3_vm_OSGi_dumpClassLoaderBundles(); + +#endif Propchange: vmkit/branches/incinerator/lib/j3/VMCore/OSGiGateway.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp (original) +++ vmkit/branches/incinerator/lib/vmkit/CommonThread/ctthread.cpp Mon Jul 22 10:45:34 2013 @@ -282,7 +282,7 @@ public: word_t ptr = kThreadStart; uint32 flags = MAP_PRIVATE | MAP_ANON | MAP_FIXED; - baseAddr = (word_t)mmap((void*)ptr, STACK_SIZE * NR_THREADS, + baseAddr = (word_t)mmap((void*)ptr, STACK_SIZE * NR_THREADS, PROT_READ | PROT_WRITE, flags, -1, 0); if (baseAddr == (word_t) MAP_FAILED) { Modified: vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile (original) +++ vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile Mon Jul 22 10:45:34 2013 @@ -1,7 +1,6 @@ LEVEL := .. DACAPO_VERSION := 2006-10-MR2 DACAPO_ARGS := -s default -DECAPO_BENCHMARKS := hsqldb -# DECAPO_BENCHMARKS := antlr bloat chart eclipse fop hsqldb jython luindex lusearch pmd xalan +DECAPO_BENCHMARKS := antlr bloat chart eclipse fop hsqldb jython luindex lusearch pmd xalan include ../Makefile.inc Modified: vmkit/branches/incinerator/tests/dacapo/Makefile.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/Makefile.inc?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/Makefile.inc (original) +++ vmkit/branches/incinerator/tests/dacapo/Makefile.inc Mon Jul 22 10:45:34 2013 @@ -7,10 +7,10 @@ endif TEMP_LEVEL := ../.. RUN_BENCH := $(PWD)/$(LEVEL)/run-bench.sh DACAPO := $(PWD)/$(LEVEL)/jars/dacapo-$(DACAPO_VERSION).jar -TMP_DIR := $(LEVEL)/tmp -LOG_DIR := $(LEVEL)/logs -JVM1_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)_NoIncinerator/bin/j3 -JVM2_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)/bin/j3 +JVM1_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)/bin/j3 +JVM2_PATH := $(PWD)/../$(TEMP_LEVEL)/$(LEVEL)/incinerator/$(BUILD_MODE)_NoIncinerator/bin/j3 +#WORK_DIR := $(LEVEL) +WORK_DIR := $(HOME)/dacapo_benchmarks ifndef ENABLE_JVM1 ENABLE_JVM1 := 1 @@ -20,11 +20,18 @@ ifndef ENABLE_JVM2 ENABLE_JVM2 := 1 endif -all: $(VM) $(DECAPO_BENCHMARKS) +ifndef VERBOSE + QUIET := @ +endif + +TMP_DIR := $(shell mktemp -d --suffix=.$(DACAPO_VERSION) --tmpdir=$(WORK_DIR)) + +all: $(DECAPO_BENCHMARKS) $(DECAPO_BENCHMARKS): $(DACAPO) - @-$(RUN_BENCH) "$(ENABLE_JVM1)" "jvm1" "$(DACAPO_VERSION)" "$(JVM1_PATH)" "$(DACAPO)" "$(DACAPO_ARGS)" "$@" - @-$(RUN_BENCH) "$(ENABLE_JVM2)" "jvm2" "$(DACAPO_VERSION)" "$(JVM2_PATH)" "$(DACAPO)" "$(DACAPO_ARGS)" "$@" + $(QUIET) mkdir -p "$(TMP_DIR)/$@" 2>/dev/null + $(QUIET) if [ 1 -eq $(ENABLE_JVM1) ] ; then cd "$(TMP_DIR)/$@" && "$(JVM1_PATH)" -jar "$(DACAPO)" $(DACAPO_ARGS) "$@" > "$(TMP_DIR).$@.log" 2>&1 ; else true ; fi + $(QUIET) if [ 1 -eq $(ENABLE_JVM2) ] ; then cd "$(TMP_DIR)/$@" && "$(JVM2_PATH)" -jar "$(DACAPO)" $(DACAPO_ARGS) "$@" > "$(TMP_DIR).$@.log" 2>&1 ; else true ; fi clean: - @-rm -rf "$(TMP_DIR)" "$(LOG_DIR)" 2>/dev/null + @-rm -rf $(WORK_DIR)/tmp.* $(WORK_DIR)/*.log 2>/dev/null Modified: vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv (original) +++ vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv Mon Jul 22 10:45:34 2013 @@ -1,12 +1,10 @@ #bench_suite,benchmark,vm,avg_overhead -2006-10-MR2,antlr,j3,20.81 -2006-10-MR2,bloat,j3,6.44 -2006-10-MR2,chart,j3,7.42 -2006-10-MR2,eclipse,j3,-4.30 -2006-10-MR2,fop,j3,5.36 -2006-10-MR2,hsqldb,j3,7.44 -2006-10-MR2,jython,j3,2.78 -2006-10-MR2,luindex,j3,-9.91 -2006-10-MR2,lusearch,j3,-30.56 -2006-10-MR2,pmd,j3,-10.74 -2006-10-MR2,xalan,j3,9.06 +2006-10-MR2,antlr,j3,-1.55 +2006-10-MR2,bloat,j3,0.72 +2006-10-MR2,eclipse,j3,-0.24 +2006-10-MR2,fop,j3,-0.35 +2006-10-MR2,hsqldb,j3,3.25 +2006-10-MR2,jython,j3,-0.12 +2006-10-MR2,luindex,j3,2.60 +2006-10-MR2,lusearch,j3,1.86 +2006-10-MR2,xalan,j3,-0.85 Modified: vmkit/branches/incinerator/tests/dacapo/run-all.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/run-all.sh?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/run-all.sh (original) +++ vmkit/branches/incinerator/tests/dacapo/run-all.sh Mon Jul 22 10:45:34 2013 @@ -4,9 +4,13 @@ # ./run-all.sh 40 12 2006-10-MR2 'sleep $(($RANDOM / 7276))s ; echo Hello' times=$1 -jn=$2 -dir=$3 -cmd=$4 +# jn=$2 +dir=$2 +cmd=$3 cd "$dir" +$cmd + +exit + seq $times | parallel -n0 -j "$jn" -- $cmd Modified: vmkit/branches/incinerator/tests/dacapo/run-bench.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/run-bench.sh?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/run-bench.sh (original) +++ vmkit/branches/incinerator/tests/dacapo/run-bench.sh Mon Jul 22 10:45:34 2013 @@ -26,7 +26,9 @@ log_file=$(mktemp --suffix=${suffix}.log curdir=$(pwd) cd "$scratch_dir" -"$jvm" -jar "$jar" $vmargs "$bench_name" > $log_file 2>&1 +echo "$jvm" -jar "$jar" $vmargs "$bench_name" +"$jvm" -jar "$jar" $vmargs "$bench_name" +# "$jvm" -jar "$jar" $vmargs "$bench_name" > $log_file 2>&1 r=$? cd "$curdir" Modified: vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv (original) +++ vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv Mon Jul 22 10:45:34 2013 @@ -1,12 +1,10 @@ #bench_suite,benchmark,vm,avg_duration_ms,min_duration_ms,max_duration_ms,std_dev_duration_ms -2006-10-MR2,antlr,j3,23844.12,21628.00,30792.00,2089.37 -2006-10-MR2,bloat,j3,44784.18,41862.00,51632.00,1888.43 -2006-10-MR2,chart,j3,127983.77,93646.00,153582.00,14994.01 -2006-10-MR2,eclipse,j3,153188.67,134362.00,165685.00,6405.52 -2006-10-MR2,fop,j3,104318.48,79760.00,116871.00,9762.53 -2006-10-MR2,hsqldb,j3,31109.70,26858.00,33444.00,1640.83 -2006-10-MR2,jython,j3,57968.65,53826.00,63947.00,1865.41 -2006-10-MR2,luindex,j3,33129.62,28667.00,38861.00,2626.92 -2006-10-MR2,lusearch,j3,12023.73,9457.00,15939.00,1380.69 -2006-10-MR2,pmd,j3,39026.12,33250.00,45380.00,3067.13 -2006-10-MR2,xalan,j3,17262.50,12479.00,20394.00,2136.92 +2006-10-MR2,antlr,j3,14323.25,14114.00,14807.00,157.61 +2006-10-MR2,bloat,j3,36136.65,35377.00,36804.00,346.64 +2006-10-MR2,eclipse,j3,110993.75,108194.00,114120.00,1300.44 +2006-10-MR2,fop,j3,25823.90,25277.00,26336.00,276.04 +2006-10-MR2,hsqldb,j3,24406.10,24015.00,25004.00,334.35 +2006-10-MR2,jython,j3,38839.15,38225.00,39285.00,318.74 +2006-10-MR2,luindex,j3,29578.00,28258.00,30758.00,673.48 +2006-10-MR2,lusearch,j3,9537.80,8787.00,10618.00,520.29 +2006-10-MR2,xalan,j3,10398.80,9782.00,11546.00,534.50 Modified: vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv (original) +++ vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv Mon Jul 22 10:45:34 2013 @@ -1,12 +1,10 @@ #bench_suite,benchmark,vm,avg_duration_ms,min_duration_ms,max_duration_ms,std_dev_duration_ms -2006-10-MR2,antlr,j3,19735.97,17593.00,30859.00,2801.75 -2006-10-MR2,bloat,j3,42072.12,40035.00,47651.00,1491.42 -2006-10-MR2,chart,j3,119134.68,95089.00,140917.00,11348.92 -2006-10-MR2,eclipse,j3,160059.03,137516.00,207306.00,18388.06 -2006-10-MR2,fop,j3,99011.45,77498.00,119261.00,11201.14 -2006-10-MR2,hsqldb,j3,28953.33,26835.00,30806.00,1068.32 -2006-10-MR2,jython,j3,56398.65,52766.00,58694.00,1249.38 -2006-10-MR2,luindex,j3,36773.30,30243.00,43885.00,4531.07 -2006-10-MR2,lusearch,j3,17314.83,12121.00,27206.00,3245.44 -2006-10-MR2,pmd,j3,43720.15,37125.00,53931.00,5370.74 -2006-10-MR2,xalan,j3,15828.10,11996.00,18063.00,1656.58 +2006-10-MR2,antlr,j3,14547.90,14141.00,15454.00,401.94 +2006-10-MR2,bloat,j3,35877.90,35315.00,36286.00,249.70 +2006-10-MR2,eclipse,j3,111249.95,108443.00,113827.00,1546.82 +2006-10-MR2,fop,j3,25913.50,25523.00,26523.00,274.12 +2006-10-MR2,hsqldb,j3,23636.60,23029.00,24592.00,387.67 +2006-10-MR2,jython,j3,38885.45,38284.00,39456.00,314.49 +2006-10-MR2,luindex,j3,28826.80,27860.00,30031.00,544.18 +2006-10-MR2,lusearch,j3,9363.35,8698.00,10562.00,485.42 +2006-10-MR2,xalan,j3,10487.00,9711.00,12008.00,731.92 Modified: vmkit/branches/incinerator/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tools/vmjc/vmjc.cpp?rev=186830&r1=186829&r2=186830&view=diff ============================================================================== --- vmkit/branches/incinerator/tools/vmjc/vmjc.cpp (original) +++ vmkit/branches/incinerator/tools/vmjc/vmjc.cpp Mon Jul 22 10:45:34 2013 @@ -125,7 +125,15 @@ int main(int argc, char **argv) { vmkit::VmkitModule::initialise(argc, argv); vmkit::Collector::initialise(argc, argv); - JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT"); + // WARNING: This is a silly method to discover that we are compiling MMTk. + // Please change to anything more deterministic. + bool compilingMMTk = ( + DisableExceptions && + DisableCooperativeGC && + DisableStubs && + AssumeCompiled); + + JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT", compilingMMTk); vmkit::BumpPtrAllocator allocator; JnjvmBootstrapLoader* loader = new(allocator, "Bootstrap loader") From koutheir at gmail.com Mon Jul 22 08:55:21 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 22 Jul 2013 15:55:21 -0000 Subject: [vmkit-commits] [vmkit] r186832 - Bug fixed: Implicit assumption of the Bash Shell. Made the AutoRegen.sh script more portable across shells. Message-ID: <20130722155521.5ED032A6C030@llvm.org> Author: koutheir Date: Mon Jul 22 10:55:21 2013 New Revision: 186832 URL: http://llvm.org/viewvc/llvm-project?rev=186832&view=rev Log: Bug fixed: Implicit assumption of the Bash Shell. Made the AutoRegen.sh script more portable across shells. Modified: vmkit/trunk/autoconf/AutoRegen.sh Modified: vmkit/trunk/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/AutoRegen.sh?rev=186832&r1=186831&r2=186832&view=diff ============================================================================== --- vmkit/trunk/autoconf/AutoRegen.sh (original) +++ vmkit/trunk/autoconf/AutoRegen.sh Mon Jul 22 10:55:21 2013 @@ -25,11 +25,11 @@ elif test -d ../../llvm/autoconf/m4 ; th else while true ; do echo "LLVM source root not found." - read -p "Enter full path to LLVM source:" + read -p "Enter full path to LLVM source:" -r REPLY if test -d "$REPLY/autoconf/m4" ; then llvm_src_root="$REPLY" llvm_m4="$REPLY/autoconf/m4" - read -p "Enter full path to LLVM objects (empty for same as source):" + read -p "Enter full path to LLVM objects (empty for same as source):" -r REPLY if test -d "$REPLY" ; then llvm_obj_root="$REPLY" else From koutheir at gmail.com Mon Jul 22 09:09:43 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 22 Jul 2013 16:09:43 -0000 Subject: [vmkit-commits] [vmkit] r186835 - Added AOT/JIT switch to indicate when we are compiling the garbage collector itself. Message-ID: <20130722160943.80BB52A6C030@llvm.org> Author: koutheir Date: Mon Jul 22 11:09:42 2013 New Revision: 186835 URL: http://llvm.org/viewvc/llvm-project?rev=186835&view=rev Log: Added AOT/JIT switch to indicate when we are compiling the garbage collector itself. Modified: vmkit/trunk/include/j3/J3Intrinsics.h vmkit/trunk/include/j3/JavaAOTCompiler.h vmkit/trunk/include/j3/JavaCompiler.h vmkit/trunk/include/j3/JavaJITCompiler.h vmkit/trunk/include/j3/JavaLLVMCompiler.h vmkit/trunk/include/vmkit/GC.h vmkit/trunk/include/vmkit/System.h vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp vmkit/trunk/lib/j3/VMCore/JavaClass.h vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h vmkit/trunk/lib/vmkit/CommonThread/ctthread.cpp vmkit/trunk/tools/vmjc/vmjc.cpp Modified: vmkit/trunk/include/j3/J3Intrinsics.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/J3Intrinsics.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/include/j3/J3Intrinsics.h (original) +++ vmkit/trunk/include/j3/J3Intrinsics.h Mon Jul 22 11:09:42 2013 @@ -127,10 +127,10 @@ public: llvm::Constant* OffsetDoYieldInThreadConstant; llvm::Constant* OffsetIsolateIDInThreadConstant; llvm::Constant* OffsetVMInThreadConstant; - llvm::Constant* OffsetThreadInMutatorThreadConstant; + llvm::Constant* OffsetThreadInMutatorThreadConstant; llvm::Constant* OffsetJNIInJavaThreadConstant; llvm::Constant* OffsetJavaExceptionInJavaThreadConstant; - + llvm::Constant* OffsetClassInVTConstant; llvm::Constant* OffsetDepthInVTConstant; llvm::Constant* OffsetDisplayInVTConstant; Modified: vmkit/trunk/include/j3/JavaAOTCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaAOTCompiler.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaAOTCompiler.h (original) +++ vmkit/trunk/include/j3/JavaAOTCompiler.h Mon Jul 22 11:09:42 2013 @@ -28,7 +28,8 @@ using vmkit::UTF8; class JavaAOTCompiler : public JavaLLVMCompiler { public: - JavaAOTCompiler(const std::string &ModuleID); + JavaAOTCompiler( + const std::string &ModuleID, bool compiling_garbage_collector = false); virtual bool isStaticCompiling() { return true; @@ -38,8 +39,10 @@ public: return true; } - virtual JavaCompiler* Create(const std::string& ModuleID) { - return new JavaAOTCompiler(ModuleID); + virtual JavaCompiler* Create( + const std::string& ModuleID, bool compiling_garbage_collector = false) + { + return new JavaAOTCompiler(ModuleID, compiling_garbage_collector); } virtual void* materializeFunction(JavaMethod* meth, Class* customizeFor) { Modified: vmkit/trunk/include/j3/JavaCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaCompiler.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaCompiler.h (original) +++ vmkit/trunk/include/j3/JavaCompiler.h Mon Jul 22 11:09:42 2013 @@ -35,8 +35,14 @@ class JavaCompiler { public: vmkit::BumpPtrAllocator allocator; + bool compilingGarbageCollector; - virtual JavaCompiler* Create(const std::string&) { + JavaCompiler(bool compiling_garbage_collector = false) : + compilingGarbageCollector(compiling_garbage_collector) {} + + virtual JavaCompiler* Create( + const std::string&, bool compiling_garbage_collector = false) + { return this; } @@ -50,6 +56,10 @@ public: return false; } + virtual bool isCompilingGarbageCollector() { + return compilingGarbageCollector; + } + virtual bool emitFunctionName() { return false; } Modified: vmkit/trunk/include/j3/JavaJITCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaJITCompiler.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaJITCompiler.h (original) +++ vmkit/trunk/include/j3/JavaJITCompiler.h Mon Jul 22 11:09:42 2013 @@ -41,7 +41,8 @@ public: llvm::ExecutionEngine* executionEngine; llvm::GCModuleInfo* GCInfo; - JavaJITCompiler(const std::string &ModuleID); + JavaJITCompiler( + const std::string &ModuleID, bool compiling_garbage_collector = false); ~JavaJITCompiler(); virtual bool isStaticCompiling() { @@ -79,7 +80,8 @@ public: bool stat, llvm::BasicBlock* insert) = 0; virtual word_t getPointerOrStub(JavaMethod& meth, int type) = 0; - static JavaJITCompiler* CreateCompiler(const std::string& ModuleID); + static JavaJITCompiler* CreateCompiler( + const std::string& ModuleID, bool compiling_garbage_collector = false); }; class JavaJ3LazyJITCompiler : public JavaJITCompiler { @@ -89,11 +91,14 @@ public: bool stat, llvm::BasicBlock* insert); virtual word_t getPointerOrStub(JavaMethod& meth, int side); - virtual JavaCompiler* Create(const std::string& ModuleID) { - return new JavaJ3LazyJITCompiler(ModuleID); + virtual JavaCompiler* Create( + const std::string& ModuleID, bool compiling_garbage_collector = false) + { + return new JavaJ3LazyJITCompiler(ModuleID, compiling_garbage_collector); } - JavaJ3LazyJITCompiler(const std::string& ModuleID); + JavaJ3LazyJITCompiler( + const std::string& ModuleID, bool compiling_garbage_collector = false); }; } // end namespace j3 Modified: vmkit/trunk/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaLLVMCompiler.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/trunk/include/j3/JavaLLVMCompiler.h Mon Jul 22 11:09:42 2013 @@ -84,7 +84,8 @@ private: llvm::DenseMap staticAPs; public: - JavaLLVMCompiler(const std::string &ModuleID); + JavaLLVMCompiler( + const std::string &ModuleID, bool compiling_garbage_collector = false); virtual bool isStaticCompiling() = 0; virtual bool emitFunctionName() = 0; @@ -123,7 +124,7 @@ public: cooperativeGC = false; } - virtual JavaCompiler* Create(const std::string& ModuleID) = 0; + virtual JavaCompiler* Create(const std::string& ModuleID, bool compiling_garbage_collector = false) = 0; virtual ~JavaLLVMCompiler(); Modified: vmkit/trunk/include/vmkit/GC.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/GC.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/include/vmkit/GC.h (original) +++ vmkit/trunk/include/vmkit/GC.h Mon Jul 22 11:09:42 2013 @@ -24,7 +24,6 @@ public: }; class gcRoot { - private: public: word_t& header(){return toHeader()->_header; } inline gcHeader* toHeader() { return (gcHeader*)((uintptr_t)this - gcHeader::hiddenHeaderSize()); } Modified: vmkit/trunk/include/vmkit/System.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/System.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/include/vmkit/System.h (original) +++ vmkit/trunk/include/vmkit/System.h Mon Jul 22 11:09:42 2013 @@ -17,7 +17,6 @@ #include #include - #if defined(__linux__) || defined(__FreeBSD__) #define LINUX_OS 1 #elif defined(__APPLE__) @@ -93,7 +92,7 @@ const word_t kVmkitThreadMask = 0xF00000 const word_t kGCMemoryStart = 0x50000000; #endif -const word_t kGCMemorySize = 0x30000000; +const word_t kGCMemorySize = 0x30000000; #define TRY { vmkit::ExceptionBuffer __buffer__; if (!SETJMP(__buffer__.buffer)) #define CATCH else Modified: vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp Mon Jul 22 11:09:42 2013 @@ -162,10 +162,10 @@ void J3Intrinsics::init(llvm::Module* mo OffsetIsolateIDInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); OffsetVMInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); OffsetDoYieldInThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 4); - OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); + OffsetThreadInMutatorThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 0); OffsetJNIInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 1); OffsetJavaExceptionInJavaThreadConstant = ConstantInt::get(Type::getInt32Ty(Context), 2); - + ClassReadyConstant = ConstantInt::get(Type::getInt8Ty(Context), ready); InterfaceLookupFunction = module->getFunction("j3InterfaceLookup"); Modified: vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp Mon Jul 22 11:09:42 2013 @@ -1832,8 +1832,9 @@ Constant* JavaAOTCompiler::CreateConstan return Array; } -JavaAOTCompiler::JavaAOTCompiler(const std::string& ModuleID) : - JavaLLVMCompiler(ModuleID) { +JavaAOTCompiler::JavaAOTCompiler( + const std::string& ModuleID, bool compiling_garbage_collector) : + JavaLLVMCompiler(ModuleID, compiling_garbage_collector) { std::string Error; const Target* TheTarget(TargetRegistry::lookupTarget( Modified: vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp Mon Jul 22 11:09:42 2013 @@ -81,10 +81,10 @@ void JavaJIT::checkYieldPoint() { if (!TheCompiler->useCooperativeGC()) return; Value* YieldPtr = getDoYieldPtr(getMutatorThreadPtr()); - Value* Yield = new LoadInst(YieldPtr, "", currentBlock); + Value* Yield = new LoadInst(YieldPtr, "yield", currentBlock); - BasicBlock* continueBlock = createBasicBlock("After safe point"); - BasicBlock* yieldBlock = createBasicBlock("In safe point"); + BasicBlock* continueBlock = createBasicBlock("afterSafePoint"); + BasicBlock* yieldBlock = createBasicBlock("inSafePoint"); BranchInst::Create(yieldBlock, continueBlock, Yield, currentBlock); currentBlock = yieldBlock; @@ -1134,7 +1134,7 @@ llvm::Function* JavaJIT::javaCompile() { jmpBuffer = new AllocaInst(ArrayType::get(Type::getInt8Ty(*llvmContext), sizeof(vmkit::ExceptionBuffer)), "", currentBlock); jmpBuffer = new BitCastInst(jmpBuffer, intrinsics->ptrType, "exceptionSavePoint", currentBlock); } - + reader.cursor = start; exploreOpcodes(reader, codeLen); @@ -1207,7 +1207,7 @@ llvm::Function* JavaJIT::javaCompile() { if (returnValue != NULL) { new StoreInst(endNode, returnValue, currentBlock); } - + if (isSynchro(compilingMethod->access)) { endSynchronize(); } @@ -1674,7 +1674,7 @@ void JavaJIT::invokeSpecial(uint16 index } else { val = invoke(func, args, "", currentBlock); } - + Type* retType = virtualType->getReturnType(); if (retType != Type::getVoidTy(*llvmContext)) { if (retType == intrinsics->JavaObjectType) { Modified: vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp Mon Jul 22 11:09:42 2013 @@ -152,8 +152,9 @@ Constant* JavaJITCompiler::getNativeFunc return ConstantExpr::getIntToPtr(CI, valPtrType); } -JavaJITCompiler::JavaJITCompiler(const std::string &ModuleID) : - JavaLLVMCompiler(ModuleID), listener(this) { +JavaJITCompiler::JavaJITCompiler( + const std::string &ModuleID, bool compiling_garbage_collector) : + JavaLLVMCompiler(ModuleID, compiling_garbage_collector), listener(this) { EmitFunctionName = false; GCInfo = NULL; @@ -440,10 +441,13 @@ bool JavaJ3LazyJITCompiler::needsCallbac getMethod(meth, customizeFor)->hasExternalWeakLinkage()); } -JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler(const std::string& ModuleID) - : JavaJITCompiler(ModuleID) {} +JavaJ3LazyJITCompiler::JavaJ3LazyJITCompiler( + const std::string& ModuleID, bool compiling_garbage_collector) : + JavaJITCompiler(ModuleID, compiling_garbage_collector) {} -JavaJITCompiler* JavaJITCompiler::CreateCompiler(const std::string& ModuleID) { - return new JavaJ3LazyJITCompiler(ModuleID); +JavaJITCompiler* JavaJITCompiler::CreateCompiler( + const std::string& ModuleID, bool compiling_garbage_collector) +{ + return new JavaJ3LazyJITCompiler(ModuleID, compiling_garbage_collector); } Modified: vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp Mon Jul 22 11:09:42 2013 @@ -25,7 +25,9 @@ using namespace llvm; namespace j3 { -JavaLLVMCompiler::JavaLLVMCompiler(const std::string& str) : +JavaLLVMCompiler::JavaLLVMCompiler( + const std::string& str, bool compiling_garbage_collector) : + JavaCompiler(compiling_garbage_collector), TheModule(new llvm::Module(str, *(new LLVMContext()))), DebugFactory(new DIBuilder(*TheModule)) { Modified: vmkit/trunk/lib/j3/VMCore/JavaClass.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JavaClass.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JavaClass.h (original) +++ vmkit/trunk/lib/j3/VMCore/JavaClass.h Mon Jul 22 11:09:42 2013 @@ -1009,7 +1009,6 @@ public: /// with the given class loader. /// JavaObject* getReturnType(JnjvmClassLoader* loader); - //===----------------------------------------------------------------------===// // @@ -1046,7 +1045,6 @@ private: template TYPE invokeVirtualBuf(Jnjvm* vm, UserClass* cl, JavaObject* obj, void* buf) __attribute__((noinline)) { llvm_gcroot(obj, 0); - verifyNull(obj); UserCommonClass* theClass = JavaObject::getClass(obj); UserClass* objCl = theClass->isArray() ? theClass->super : theClass->asClass(); Modified: vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp Mon Jul 22 11:09:42 2013 @@ -1351,7 +1351,6 @@ Jnjvm::Jnjvm(vmkit::BumpPtrAllocator& Al JnjvmBootstrapLoader* loader) : VirtualMachine(Alloc, frames), lockSystem(Alloc) { - classpath = getenv("CLASSPATH"); if (classpath == NULL) classpath = "."; @@ -1381,13 +1380,6 @@ ArrayUInt16* Jnjvm::asciizToArray(const } void Jnjvm::startCollection() { - -#if DEBUG > 0 - printf("Start Collection\n"); - vmkit::Thread::get()->printBacktrace(); - fflush(stdout); -#endif - finalizerThread->FinalizationQueueLock.acquire(); referenceThread->ToEnqueueLock.acquire(); referenceThread->SoftReferencesQueue.acquire(); @@ -1403,12 +1395,6 @@ void Jnjvm::endCollection() { referenceThread->PhantomReferencesQueue.release(); finalizerThread->FinalizationCond.broadcast(); referenceThread->EnqueueCond.broadcast(); - -#if DEBUG > 0 - printf("End Collection\n"); - vmkit::Thread::get()->printBacktrace(); - fflush(stdout); -#endif } void Jnjvm::scanWeakReferencesQueue(word_t closure) { Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp Mon Jul 22 11:09:42 2013 @@ -217,15 +217,17 @@ JnjvmClassLoader::JnjvmClassLoader(vmkit { } -JnjvmClassLoader::JnjvmClassLoader(vmkit::BumpPtrAllocator& Alloc, - JnjvmClassLoader& JCL, JavaObject* loader, - VMClassLoader* vmdata, - Jnjvm* VM) : allocator(Alloc) +JnjvmClassLoader::JnjvmClassLoader( + vmkit::BumpPtrAllocator& Alloc, JnjvmClassLoader& JCL, JavaObject* loader, + VMClassLoader* vmdata, Jnjvm* VM) : + allocator(Alloc) { llvm_gcroot(loader, 0); llvm_gcroot(vmdata, 0); bootstrapLoader = JCL.bootstrapLoader; - TheCompiler = bootstrapLoader->getCompiler()->Create("Applicative loader"); + TheCompiler = bootstrapLoader->getCompiler()->Create( + "Applicative loader", + bootstrapLoader->getCompiler()->isCompilingGarbageCollector()); hashUTF8 = new(allocator, "UTF8Map") UTF8Map(allocator); classes = new(allocator, "ClassMap") ClassMap(); @@ -809,6 +811,21 @@ Signdef* JnjvmClassLoader::constructSign return res; } +JnjvmClassLoader* JnjvmClassLoader::createForJavaObject( + Jnjvm* vm, JavaObject* loader, VMClassLoader**vmdata) +{ + llvm_gcroot(loader, 0); + + *vmdata = VMClassLoader::allocate(); + vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator(); + + JnjvmClassLoader* JCL = new(*A, "Class loader") + JnjvmClassLoader(*A, *vm->bootstrapLoader, loader, *vmdata, vm); + + Classpath* upcalls = vm->bootstrapLoader->upcalls; + upcalls->vmdataClassLoader->setInstanceObjectField(loader, *vmdata); + return JCL; +} JnjvmClassLoader* JnjvmClassLoader::getJnjvmLoaderFromJavaObject(JavaObject* loader, Jnjvm* vm) { @@ -834,29 +851,23 @@ JnjvmClassLoader::getJnjvmLoaderFromJava vmdata = (VMClassLoader*)(upcalls->vmdataClassLoader->getInstanceObjectField(loader)); if (!vmdata || !VMClassLoader::isVMClassLoader(vmdata)) { - vmdata = VMClassLoader::allocate(); - vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator(); - JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader, - loader, vmdata, vm); - upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata); + JCL = JnjvmClassLoader::createForJavaObject(vm, loader, &vmdata); } JavaObject::release(loader); } else if (!VMClassLoader::isVMClassLoader(vmdata)) { JavaObject::acquire(loader); - vmdata = VMClassLoader::allocate(); - vmkit::BumpPtrAllocator* A = new vmkit::BumpPtrAllocator(); - JCL = new(*A, "Class loader") JnjvmClassLoader(*A, *vm->bootstrapLoader, - loader, vmdata, vm); - upcalls->vmdataClassLoader->setInstanceObjectField(loader, (JavaObject*)vmdata); + JCL = JnjvmClassLoader::createForJavaObject(vm, loader, &vmdata); JavaObject::release(loader); } else { JCL = vmdata->getClassLoader(); assert(JCL->javaLoader == loader); } + if (!JCL) { assert( vmdata->getClassLoader() == JCL && "Loader is not equal to stored value"); - fprintf(stderr, "Error in method %s, %d because condition 1: %d\n", __FILE__, __LINE__, (vmdata == NULL || !VMClassLoader::isVMClassLoader(vmdata))); + fprintf(stderr, "Error in method %s, %d because condition 1: %d\n", + __FILE__, __LINE__, (vmdata == NULL || !VMClassLoader::isVMClassLoader(vmdata))); } return JCL; } Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h Mon Jul 22 11:09:42 2013 @@ -56,7 +56,9 @@ typedef TJavaArray ArrayObj /// its own tables (signatures, UTF8, types) which are mapped to a single /// table for non-isolate environments. /// -class JnjvmClassLoader : public vmkit::PermanentObject { +class JnjvmClassLoader : + public vmkit::PermanentObject +{ private: /// isolate - Which isolate defined me? Null for the bootstrap class loader. @@ -173,6 +175,8 @@ public: /// of the given class loader. /// static JnjvmClassLoader* getJnjvmLoaderFromJavaObject(JavaObject*, Jnjvm *vm); + static JnjvmClassLoader* createForJavaObject( + Jnjvm* vm, JavaObject* loader, VMClassLoader**vmdata); /// getJavaClassLoader - Return the Java representation of this class loader. /// Modified: vmkit/trunk/lib/vmkit/CommonThread/ctthread.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/CommonThread/ctthread.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/lib/vmkit/CommonThread/ctthread.cpp (original) +++ vmkit/trunk/lib/vmkit/CommonThread/ctthread.cpp Mon Jul 22 11:09:42 2013 @@ -282,7 +282,7 @@ public: word_t ptr = kThreadStart; uint32 flags = MAP_PRIVATE | MAP_ANON | MAP_FIXED; - baseAddr = (word_t)mmap((void*)ptr, STACK_SIZE * NR_THREADS, + baseAddr = (word_t)mmap((void*)ptr, STACK_SIZE * NR_THREADS, PROT_READ | PROT_WRITE, flags, -1, 0); if (baseAddr == (word_t) MAP_FAILED) { Modified: vmkit/trunk/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=186835&r1=186834&r2=186835&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/vmjc.cpp (original) +++ vmkit/trunk/tools/vmjc/vmjc.cpp Mon Jul 22 11:09:42 2013 @@ -125,7 +125,15 @@ int main(int argc, char **argv) { vmkit::VmkitModule::initialise(argc, argv); vmkit::Collector::initialise(argc, argv); - JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT"); + // WARNING: This is a silly method to discover that we are compiling MMTk. + // Please change to anything more deterministic. + bool compilingMMTk = ( + DisableExceptions && + DisableCooperativeGC && + DisableStubs && + AssumeCompiled); + + JavaAOTCompiler* Comp = new JavaAOTCompiler("AOT", compilingMMTk); vmkit::BumpPtrAllocator allocator; JnjvmBootstrapLoader* loader = new(allocator, "Bootstrap loader") From koutheir at gmail.com Mon Jul 22 09:21:32 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 22 Jul 2013 16:21:32 -0000 Subject: [vmkit-commits] [vmkit] r186839 - Minor fixes and cleanup of OSGi-related stuff. Message-ID: <20130722162132.7C20A2A6C030@llvm.org> Author: koutheir Date: Mon Jul 22 11:21:32 2013 New Revision: 186839 URL: http://llvm.org/viewvc/llvm-project?rev=186839&view=rev Log: Minor fixes and cleanup of OSGi-related stuff. Removed: vmkit/trunk/osgi/ Modified: vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp Modified: vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp?rev=186839&r1=186838&r2=186839&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JavaRuntimeJIT.cpp Mon Jul 22 11:21:32 2013 @@ -22,7 +22,6 @@ #include "j3/OpcodeNames.def" #include -#include using namespace j3; From koutheir at gmail.com Mon Jul 22 09:23:13 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 22 Jul 2013 16:23:13 -0000 Subject: [vmkit-commits] [vmkit] r186841 - Merging changes from trunk. Message-ID: <20130722162314.33DB72A6C030@llvm.org> Author: koutheir Date: Mon Jul 22 11:23:13 2013 New Revision: 186841 URL: http://llvm.org/viewvc/llvm-project?rev=186841&view=rev Log: Merging changes from trunk. Modified: vmkit/branches/incinerator/autoconf/configure.ac vmkit/branches/incinerator/configure vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp vmkit/branches/incinerator/www/get_started.html vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz Modified: vmkit/branches/incinerator/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/autoconf/configure.ac?rev=186841&r1=186840&r2=186841&view=diff ============================================================================== --- vmkit/branches/incinerator/autoconf/configure.ac (original) +++ vmkit/branches/incinerator/autoconf/configure.ac Mon Jul 22 11:23:13 2013 @@ -386,6 +386,10 @@ if test -z ${ANT}; then AC_MSG_ERROR([Unable to find ant, please put ant tool in your path]) fi +if test -z ${ZIP}; then + AC_MSG_ERROR([Unable to find zip, please put zip in your path]) +fi + if test -z ${LLVM_CONFIG}; then AC_MSG_ERROR([Unable to find llvm-config, please specify its path]) fi Modified: vmkit/branches/incinerator/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/configure?rev=186841&r1=186840&r2=186841&view=diff ============================================================================== --- vmkit/branches/incinerator/configure (original) +++ vmkit/branches/incinerator/configure Mon Jul 22 11:23:13 2013 @@ -3636,6 +3636,10 @@ if test -z ${ANT}; then as_fn_error $? "Unable to find ant, please put ant tool in your path" "$LINENO" 5 fi +if test -z ${ZIP}; then + as_fn_error $? "Unable to find zip, please put zip in your path" "$LINENO" 5 +fi + if test -z ${LLVM_CONFIG}; then as_fn_error $? "Unable to find llvm-config, please specify its path" "$LINENO" 5 fi Modified: vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc?rev=186841&r1=186840&r2=186841&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc (original) +++ vmkit/branches/incinerator/lib/j3/ClassLib/Unsafe.inc Mon Jul 22 11:23:13 2013 @@ -80,8 +80,10 @@ JavaObject* unsafe, JavaObjectField* _fi /// JNIEXPORT jlong JNICALL Java_sun_misc_Unsafe_arrayBaseOffset( JavaObject* unsafe, JavaObject* clazz) { - // Array starts at beginning of object - return 0; + llvm_gcroot(clazz, 0); + llvm_gcroot(unsafe, 0); + // See JavaArray.h for arrays layout + return sizeof(JavaObject) + sizeof(ssize_t); } /// arrayIndexScale - Indexing scale for the element type in @@ -92,9 +94,23 @@ JavaObject* unsafe, JavaObject* clazz) { /// JNIEXPORT jlong JNICALL Java_sun_misc_Unsafe_arrayIndexScale( JavaObject* unsafe, JavaObject* clazz) { - // For now, just return '0', indicating we don't support this indexing. - // TODO: Implement this for the array types we /do/ support this way. - return 0; + JavaObjectClass* jcl = 0; + llvm_gcroot(clazz, 0); + llvm_gcroot(unsafe, 0); + llvm_gcroot(jcl, 0); + ClassArray* clArray = 0; + int size = 0; + + UserCommonClass* cl = JavaObjectClass::getClass(jcl = (JavaObjectClass*)clazz); + if (cl->isArray()) { + clArray = cl->asArrayClass(); + if(clArray->_baseClass->isPrimitive()) { + size = 1 << clArray->_baseClass->asPrimitiveClass()->logSize; + } else { + size = sizeof(JavaObject*); + } + } + return size; } Modified: vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp?rev=186841&r1=186840&r2=186841&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp Mon Jul 22 11:23:13 2013 @@ -1383,13 +1383,6 @@ ArrayUInt16* Jnjvm::asciizToArray(const } void Jnjvm::startCollection() { - -#if DEBUG > 0 - printf("Start Collection\n"); - vmkit::Thread::get()->printBacktrace(); - fflush(stdout); -#endif - #if RESET_STALE_REFERENCES incinerator.beforeCollection(); #endif @@ -1413,12 +1406,6 @@ void Jnjvm::endCollection() { #if RESET_STALE_REFERENCES incinerator.afterCollection(); #endif - -#if DEBUG > 0 - printf("End Collection\n"); - vmkit::Thread::get()->printBacktrace(); - fflush(stdout); -#endif } void Jnjvm::scanWeakReferencesQueue(word_t closure) { Modified: vmkit/branches/incinerator/www/get_started.html URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/www/get_started.html?rev=186841&r1=186840&r2=186841&view=diff ============================================================================== --- vmkit/branches/incinerator/www/get_started.html (original) +++ vmkit/branches/incinerator/www/get_started.html Mon Jul 22 11:23:13 2013 @@ -31,20 +31,23 @@ You will have to install a C++ compiler compile vmkit2

      -
    1. Download - LLVM 3.2 and - Clang 3.2 +
    2. Download + LLVM 3.3 and + Clang 3.3 source code.
    3. +
      Note: To compile LLVM and VMKit with RTTI enabled, one can pass the parameter +REQUIRES_RTTI=1 to make. Passing this argument removes the flag -fno-rtti from +the compiler options. Ex: $ make REQUIRES_RTTI=1

      Skip the Classpath steps if you plan to use OpenJDK.

    4. Download Modified: vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz?rev=186841&r1=186840&r2=186841&view=diff ============================================================================== Binary files vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz (original) and vmkit/branches/incinerator/www/tuto/VMKit_tutorial.tar.gz Mon Jul 22 11:23:13 2013 differ Modified: vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz?rev=186841&r1=186840&r2=186841&view=diff ============================================================================== Binary files vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz (original) and vmkit/branches/incinerator/www/tuto/toy-vm-base.tar.gz Mon Jul 22 11:23:13 2013 differ From peter.senna at gmail.com Tue Jul 23 07:46:13 2013 From: peter.senna at gmail.com (Peter Senna Tschudin) Date: Tue, 23 Jul 2013 14:46:13 -0000 Subject: [vmkit-commits] [vmkit] r186941 - Fixed a typo at get_started.html. Fixed note about RTTI Message-ID: <20130723144613.C35582A6C029@llvm.org> Author: peter.senna Date: Tue Jul 23 09:46:13 2013 New Revision: 186941 URL: http://llvm.org/viewvc/llvm-project?rev=186941&view=rev Log: Fixed a typo at get_started.html. Fixed note about RTTI Modified: vmkit/trunk/www/get_started.html Modified: vmkit/trunk/www/get_started.html URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/www/get_started.html?rev=186941&r1=186940&r2=186941&view=diff ============================================================================== --- vmkit/trunk/www/get_started.html (original) +++ vmkit/trunk/www/get_started.html Tue Jul 23 09:46:13 2013 @@ -39,14 +39,14 @@ compile vmkit2

      • tar zxvf llvm-3.3.src.tar.gz
      • -
      • cd llvm-3.2.src/tools
      • +
      • cd llvm-3.3.src/tools
      • tar zxvf ../../cfe-3.3.src.tar.gz
      • mv cfe-3.3.src clang
      • cd ..
      • ./configure --enable-optimized; make

      Note: To compile LLVM and VMKit with RTTI enabled, one can pass the parameter -REQUIRES_RTTI=1 to make. Passing this argument removes the flag -fno-rtti from +REQUIRES_RTTI=1 to llvm make. Passing this argument removes the flag -fno-rtti from the compiler options. Ex: $ make REQUIRES_RTTI=1

      Skip the Classpath steps if you plan to use OpenJDK.
      From sylvestre at debian.org Tue Jul 2 06:55:42 2013 From: sylvestre at debian.org (Sylvestre Ledru) Date: Tue, 02 Jul 2013 13:55:42 -0000 Subject: [vmkit-commits] [vmkit] r185426 - Fail the configure if zip is not found. It is necessary to the build process Message-ID: <20130702135425.7C8DD2A6C029@llvm.org> Author: sylvestre Date: Tue Jul 2 08:54:25 2013 New Revision: 185426 URL: http://llvm.org/viewvc/llvm-project?rev=185426&view=rev Log: Fail the configure if zip is not found. It is necessary to the build process 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=185426&r1=185425&r2=185426&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Tue Jul 2 08:54:25 2013 @@ -372,6 +372,10 @@ if test -z ${ANT}; then AC_MSG_ERROR([Unable to find ant, please put ant tool in your path]) fi +if test -z ${ZIP}; then + AC_MSG_ERROR([Unable to find zip, please put zip in your path]) +fi + if test -z ${LLVM_CONFIG}; then AC_MSG_ERROR([Unable to find llvm-config, please specify its path]) fi From sylvestre at debian.org Tue Jul 2 06:56:35 2013 From: sylvestre at debian.org (Sylvestre Ledru) Date: Tue, 02 Jul 2013 13:56:35 -0000 Subject: [vmkit-commits] [vmkit] r185427 - Take in account the zip change introduced by r185426 + regenerate with autoconf 2.69 Message-ID: <20130702135517.ADEF82A6C029@llvm.org> Author: sylvestre Date: Tue Jul 2 08:55:17 2013 New Revision: 185427 URL: http://llvm.org/viewvc/llvm-project?rev=185427&view=rev Log: Take in account the zip change introduced by r185426 + regenerate with autoconf 2.69 Modified: vmkit/trunk/configure Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=185427&r1=185426&r2=185427&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Tue Jul 2 08:55:17 2013 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for vmkit 0.32svn. +# Generated by GNU Autoconf 2.69 for vmkit 0.32svn. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -138,6 +136,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -171,7 +194,8 @@ if ( set x; as_fn_ret_success y && test else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -216,21 +240,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -333,6 +361,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -454,6 +490,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -488,16 +528,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -509,28 +549,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -1182,8 +1202,6 @@ target=$target_alias 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. - 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 fi @@ -1444,9 +1462,9 @@ test -n "$ac_init_help" && exit $ac_stat if $ac_init_version; then cat <<\_ACEOF vmkit configure 0.32svn -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -1524,7 +1542,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1869,7 +1887,7 @@ This file contains any messages produced running configure, to aid debugging if configure makes a mistake. It was created by vmkit $as_me 0.32svn, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2908,6 +2926,8 @@ esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD-compatible nm" >&5 $as_echo_n "checking for BSD-compatible nm... " >&6; } if ${lt_cv_path_NM+:} false; then : @@ -2981,7 +3001,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3022,7 +3042,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3061,7 +3081,7 @@ do 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 + as_fn_executable_p "$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 @@ -3121,7 +3141,7 @@ do test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -3168,7 +3188,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3209,7 +3229,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3250,7 +3270,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3291,7 +3311,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_TOUCH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3331,7 +3351,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3371,7 +3391,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3425,7 +3445,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3465,7 +3485,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3506,7 +3526,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3571,7 +3591,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LLVM_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3598,6 +3618,10 @@ if test -z ${ANT}; then as_fn_error $? "Unable to find ant, please put ant tool in your path" "$LINENO" 5 fi +if test -z ${ZIP}; then + as_fn_error $? "Unable to find zip, please put zip in your path" "$LINENO" 5 +fi + if test -z ${LLVM_CONFIG}; then as_fn_error $? "Unable to find llvm-config, please specify its path" "$LINENO" 5 fi @@ -3644,7 +3668,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -3724,7 +3748,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3764,7 +3788,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3817,7 +3841,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3858,7 +3882,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3916,7 +3940,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3960,7 +3984,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4406,8 +4430,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -4702,7 +4725,7 @@ do 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 + as_fn_executable_p "$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 @@ -5427,16 +5450,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... 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'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -5496,28 +5519,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -5539,7 +5550,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # values after options handling. ac_log=" This file was extended by vmkit $as_me 0.32svn, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5601,10 +5612,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_writ ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ vmkit config.status 0.32svn -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -5694,7 +5705,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + 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'