From peter.senna at gmail.com Fri Jun 7 04:42:31 2013 From: peter.senna at gmail.com (Peter Senna Tschudin) Date: Fri, 07 Jun 2013 11:42:31 -0000 Subject: [vmkit-commits] [vmkit] r183515 - Fixed issue on Makefile.common.in related to location detection of clang binary Message-ID: <20130607114231.4C3D52A6C029@llvm.org> Author: peter.senna Date: Fri Jun 7 06:42:31 2013 New Revision: 183515 URL: http://llvm.org/viewvc/llvm-project?rev=183515&view=rev Log: Fixed issue on Makefile.common.in related to location detection of clang binary files. Modified: vmkit/trunk/Makefile.common.in Modified: vmkit/trunk/Makefile.common.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.common.in?rev=183515&r1=183514&r2=183515&view=diff ============================================================================== --- vmkit/trunk/Makefile.common.in (original) +++ vmkit/trunk/Makefile.common.in Fri Jun 7 06:42:31 2013 @@ -46,8 +46,8 @@ WITH_64 = @WITH_64@ ############################################################################### LLVM_CONFIG=@LLVM_CONFIG@ LLVM_BIN=$(shell $(LLVM_CONFIG) --bindir) -CLANG=$(LLVM_BIN)/clang -CLANGXX=$(LLVM_BIN)/clang++ +CLANG=@CLANG_PATH@/clang +CLANGXX=@CLANG_PATH@/clang++ LLVMAS=$(LLVM_BIN)/llvm-as LLC=$(LLVM_BIN)/llc LOPT=$(LLVM_BIN)/opt From peter.senna at gmail.com Fri Jun 7 04:59:55 2013 From: peter.senna at gmail.com (Peter Senna Tschudin) Date: Fri, 07 Jun 2013 11:59:55 -0000 Subject: [vmkit-commits] [vmkit] r183516 - For compiling VMKit, it is required to have complete LLVM source code. This Message-ID: <20130607115956.24DF82A6C029@llvm.org> Author: peter.senna Date: Fri Jun 7 06:59:55 2013 New Revision: 183516 URL: http://llvm.org/viewvc/llvm-project?rev=183516&view=rev Log: For compiling VMKit, it is required to have complete LLVM source code. This patch adds the LLVM source dir as -I compilation option. The LLVM source code location is found by calling llvm-config --src-root. Modified: vmkit/trunk/Makefile.rules vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp vmkit/trunk/lib/vmkit/Compiler/JIT.cpp Modified: vmkit/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/Makefile.rules?rev=183516&r1=183515&r2=183516&view=diff ============================================================================== --- vmkit/trunk/Makefile.rules (original) +++ vmkit/trunk/Makefile.rules Fri Jun 7 06:59:55 2013 @@ -36,7 +36,7 @@ LLC_FLAGS+=-disable-cfi -disable-fp-elim OPT_FLAGS+=-disable-cfi -disable-fp-elim INCLUDES+=-I$(PROJ_SRC_CWD) -I$(PROJ_SRC_ROOT)/include -I$(PROJ_SRC_ROOT)/lib/vmkit/MMTk -I$(BUILD_DIR) \ - -I$(shell $(LLVM_CONFIG) --includedir) + -I$(shell $(LLVM_CONFIG) --includedir) -I$(shell $(LLVM_CONFIG) --src-root) WARN_CFLAGS= -Wall -Wno-long-long -Wno-variadic-macros -Wno-unused-private-field -Wno-unused-variable COMMON_CFLAGS+= $(INCLUDES) -ansi -pedantic $(WARN_CFLAGS) -fPIC \ Modified: vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp?rev=183516&r1=183515&r2=183516&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp Fri Jun 7 06:59:55 2013 @@ -23,7 +23,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/DataLayout.h" -#include <../lib/ExecutionEngine/JIT/JIT.h> +#include #include "VmkitGC.h" #include "vmkit/VirtualMachine.h" Modified: vmkit/trunk/lib/vmkit/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/Compiler/JIT.cpp?rev=183516&r1=183515&r2=183516&view=diff ============================================================================== --- vmkit/trunk/lib/vmkit/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/vmkit/Compiler/JIT.cpp Fri Jun 7 06:59:55 2013 @@ -35,7 +35,7 @@ #include #include #include -#include <../lib/ExecutionEngine/JIT/JIT.h> +#include #include "vmkit/JIT.h" #include "vmkit/Locks.h" From koutheir at gmail.com Sat Jun 8 11:03:54 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Sat, 08 Jun 2013 18:03:54 -0000 Subject: [vmkit-commits] [vmkit] r183615 - Test commit. Please ignore this. Message-ID: <20130608180354.351A43128076@llvm.org> Author: koutheir Date: Sat Jun 8 13:03:53 2013 New Revision: 183615 URL: http://llvm.org/viewvc/llvm-project?rev=183615&view=rev Log: Test commit. Please ignore this. Modified: vmkit/trunk/README.TXT Modified: vmkit/trunk/README.TXT URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/README.TXT?rev=183615&r1=183614&r2=183615&view=diff ============================================================================== --- vmkit/trunk/README.TXT (original) +++ vmkit/trunk/README.TXT Sat Jun 8 13:03:53 2013 @@ -118,3 +118,4 @@ git clone git+ssh://YOUR_USER_NAME at scm.g * Build it: make -j12 + From koutheir at gmail.com Mon Jun 10 07:26:30 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 14:26:30 -0000 Subject: [vmkit-commits] [vmkit] r183658 - Excluded Debug+Asserts folders. Message-ID: <20130610142630.AB1E72A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 09:26:30 2013 New Revision: 183658 URL: http://llvm.org/viewvc/llvm-project?rev=183658&view=rev Log: Excluded Debug+Asserts folders. Modified: vmkit/trunk/ (props changed) vmkit/trunk/lib/j3/ClassLib/GNUClasspath/ (props changed) vmkit/trunk/lib/j3/Compiler/ (props changed) vmkit/trunk/lib/j3/LLVMRuntime/ (props changed) vmkit/trunk/lib/j3/VMCore/ (props changed) vmkit/trunk/lib/static-gc-pass/ (props changed) vmkit/trunk/lib/static-gc-printer/ (props changed) vmkit/trunk/lib/vmkit/CommonThread/ (props changed) vmkit/trunk/lib/vmkit/Compiler/ (props changed) vmkit/trunk/lib/vmkit/JITGCPass/ (props changed) vmkit/trunk/lib/vmkit/MMTk/ (props changed) vmkit/trunk/lib/vmkit/Runtime/ (props changed) vmkit/trunk/mmtk/java/ (props changed) vmkit/trunk/mmtk/magic/ (props changed) vmkit/trunk/mmtk/mmtk-alloc/ (props changed) vmkit/trunk/mmtk/mmtk-j3/ (props changed) vmkit/trunk/tools/j3/ (props changed) vmkit/trunk/tools/llcj/ (props changed) vmkit/trunk/tools/precompiler/ (props changed) vmkit/trunk/tools/trainer/ (props changed) vmkit/trunk/tools/vmjc/ (props changed) Propchange: vmkit/trunk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -11,5 +11,7 @@ config.status Makefile.common Release-Asserts Release+Asserts +Debug+Asserts Debug +.project Propchange: vmkit/trunk/lib/j3/ClassLib/GNUClasspath/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1 +1,2 @@ +Debug+Asserts Release Propchange: vmkit/trunk/lib/j3/Compiler/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ Debug +Debug+Asserts Release Release+Asserts Propchange: vmkit/trunk/lib/j3/LLVMRuntime/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ +Debug+Asserts Release LLVMRuntime.inc LLVMRuntime.gen.ll Propchange: vmkit/trunk/lib/j3/VMCore/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ Debug +Debug+Asserts Release Release+Asserts Propchange: vmkit/trunk/lib/static-gc-pass/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -0,0 +1 @@ +Debug+Asserts Propchange: vmkit/trunk/lib/static-gc-printer/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -0,0 +1 @@ +Debug+Asserts Propchange: vmkit/trunk/lib/vmkit/CommonThread/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ Debug Release Release+Asserts +Debug+Asserts Propchange: vmkit/trunk/lib/vmkit/Compiler/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,4 +1,5 @@ Release Release+Asserts +Debug+Asserts LLVMRuntime.inc LLVMRuntime.gen.ll Propchange: vmkit/trunk/lib/vmkit/JITGCPass/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,2 +1,3 @@ Release Release+Asserts +Debug+Asserts Propchange: vmkit/trunk/lib/vmkit/MMTk/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ +Debug+Asserts Release+Asserts Release Propchange: vmkit/trunk/lib/vmkit/Runtime/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ Debug Release Release+Asserts +Debug+Asserts Propchange: vmkit/trunk/mmtk/java/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,4 +1,5 @@ build.xml +Debug+Asserts Release+Asserts Release mmtk-vmkit.bc Propchange: vmkit/trunk/mmtk/magic/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,2 +1,3 @@ Release Release+Asserts +Debug+Asserts Propchange: vmkit/trunk/mmtk/mmtk-alloc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ +Debug+Asserts Release+Asserts Release Propchange: vmkit/trunk/mmtk/mmtk-j3/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,2 +1,3 @@ Release Release+Asserts +Debug+Asserts Propchange: vmkit/trunk/tools/j3/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,5 +1,6 @@ Release Release+Asserts +Debug+Asserts vmkitoptimized.bc vmkit.s vmkit.bc Propchange: vmkit/trunk/tools/llcj/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ Release Release+Asserts +Debug+Asserts LinkPaths.h Propchange: vmkit/trunk/tools/precompiler/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,3 +1,4 @@ +Debug+Asserts Release+Asserts Release *.inc Propchange: vmkit/trunk/tools/trainer/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -0,0 +1,2 @@ +Debug+Asserts + Propchange: vmkit/trunk/tools/vmjc/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Mon Jun 10 09:26:30 2013 @@ -1,5 +1,6 @@ Release Release+Asserts +Debug+Asserts vmkitoptimized.bc vmkit.s vmkit.bc From koutheir at gmail.com Mon Jun 10 07:28:18 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 14:28:18 -0000 Subject: [vmkit-commits] [vmkit] r183660 - Incinerator feature removed from the main JVM. Incinerator shall be available in a separate branch. Message-ID: <20130610142818.DF44E2A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 09:28:18 2013 New Revision: 183660 URL: http://llvm.org/viewvc/llvm-project?rev=183660&view=rev Log: Incinerator feature removed from the main JVM. Incinerator shall be available in a separate branch. Removed: vmkit/trunk/lib/j3/VMCore/JnjvmIntOSGi.cpp vmkit/trunk/lib/j3/VMCore/JnjvmStaleRef.cpp Modified: vmkit/trunk/autoconf/configure.ac vmkit/trunk/configure vmkit/trunk/include/vmkit/VirtualMachine.h vmkit/trunk/include/vmkit/config.h.in vmkit/trunk/include/vmkit/config.h.in.orig vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp vmkit/trunk/lib/j3/VMCore/Jnjvm.h vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Modified: vmkit/trunk/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/autoconf/configure.ac?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/autoconf/configure.ac (original) +++ vmkit/trunk/autoconf/configure.ac Mon Jun 10 09:28:18 2013 @@ -340,20 +340,6 @@ esac AC_SUBST(classpathimpl) -dnl ************************************************************************** -dnl Kill stale references -dnl ************************************************************************** -AC_ARG_ENABLE(incinerator, - AS_HELP_STRING([--enable-incinerator], - [Use incinerator to kill stale references in OSGi (default is NO)]),, - enable_incinerator=no) -case "$enable_incinerator" in - yes) AC_DEFINE(RESET_STALE_REFERENCES,[1]) ;; - no) ;; #AC_DEFINE(RESET_STALE_REFERENCES,[0]) ;; - *) AC_MSG_ERROR([Invalid setting for --enable-incinerator. Use "yes" or "no"]) ;; -esac - - dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 4: Check for programs we need and that they are the right version Modified: vmkit/trunk/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/configure?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/configure (original) +++ vmkit/trunk/configure Mon Jun 10 09:28:18 2013 @@ -717,7 +717,6 @@ with_gnu_classpath_libs with_gnu_classpath_glibj with_openjdk_path with_classpath_impl -enable_incinerator ' ac_precious_vars='build_alias host_alias @@ -1348,8 +1347,6 @@ Optional Features: yes) --enable-debug Build with debug flags (default is no) --enable-assert Build with assert flags (default is yes) - --enable-incinerator Use incinerator to kill stale references in OSGi - (default is NO) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2911,23 +2908,6 @@ esac -# Check whether --enable-incinerator was given. -if test "${enable_incinerator+set}" = set; then : - enableval=$enable_incinerator; -else - enable_incinerator=no -fi - -case "$enable_incinerator" in - yes) $as_echo "#define RESET_STALE_REFERENCES 1" >>confdefs.h - ;; - no) ;; #AC_DEFINE(RESET_STALE_REFERENCES,[0]) ;; - *) as_fn_error $? "Invalid setting for --enable-incinerator. Use \"yes\" or \"no\"" "$LINENO" 5 ;; -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 : Modified: vmkit/trunk/include/vmkit/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/VirtualMachine.h?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/include/vmkit/VirtualMachine.h (original) +++ vmkit/trunk/include/vmkit/VirtualMachine.h Mon Jun 10 09:28:18 2013 @@ -161,7 +161,6 @@ public: /// endCollection - Code after running a GC. /// - virtual void endCollectionBeforeUnlockingWorld() {} virtual void endCollection() {} /// scanWeakReferencesQueue - Scan all weak references. Called by the GC @@ -224,10 +223,6 @@ public: /// CooperativeCollectionRV rendezvous; -#if RESET_STALE_REFERENCES - virtual void resetReferenceIfStale(const void* source, void** ref) {} -#endif - //===----------------------------------------------------------------------===// // (2.5) GC-DEBUG-related methods. //===----------------------------------------------------------------------===// Modified: vmkit/trunk/include/vmkit/config.h.in URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/config.h.in?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/include/vmkit/config.h.in (original) +++ vmkit/trunk/include/vmkit/config.h.in Mon Jun 10 09:28:18 2013 @@ -1,2 +0,0 @@ -/* Kill stale references */ -#undef RESET_STALE_REFERENCES Modified: vmkit/trunk/include/vmkit/config.h.in.orig URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/config.h.in.orig?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/include/vmkit/config.h.in.orig (original) +++ vmkit/trunk/include/vmkit/config.h.in.orig Mon Jun 10 09:28:18 2013 @@ -77,6 +77,3 @@ /* Define to `unsigned int' if does not define. */ #undef size_t - -/* Kill stale references -#undef RESET_STALE_REFERENCES Modified: vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/Jnjvm.cpp Mon Jun 10 09:28:18 2013 @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #define JNJVM_LOAD 1 -#define DEBUG_VERBOSE_STALE_REF 1 #include #include @@ -1351,9 +1350,6 @@ Jnjvm::Jnjvm(vmkit::BumpPtrAllocator& Al vmkit::CompiledFrames** frames, JnjvmBootstrapLoader* loader) : VirtualMachine(Alloc, frames), lockSystem(Alloc) -#if RESET_STALE_REFERENCES - , scanStaleReferences(false) //, findReferencesToObject(NULL) -#endif { classpath = getenv("CLASSPATH"); @@ -1392,43 +1388,12 @@ void Jnjvm::startCollection() { fflush(stdout); #endif -#if RESET_STALE_REFERENCES - -#if DEBUG_VERBOSE_STALE_REF - - if (scanStaleReferences) - std::cerr << "Looking for stale references..." << std::endl; - -#endif - -// if (findReferencesToObject != NULL) -// foundReferencerObjects.clear(); - -#endif - finalizerThread->FinalizationQueueLock.acquire(); referenceThread->ToEnqueueLock.acquire(); referenceThread->SoftReferencesQueue.acquire(); referenceThread->WeakReferencesQueue.acquire(); referenceThread->PhantomReferencesQueue.acquire(); } - -void Jnjvm::endCollectionBeforeUnlockingWorld() -{ -#if RESET_STALE_REFERENCES -#if DEBUG_VERBOSE_STALE_REF - - if (scanStaleReferences) - std::cerr << "Looking for stale references done." << std::endl; - -#endif - - // Stale references can no more exist, until a bundle is uninstalled later. - scanStaleReferences = false; -// findReferencesToObject = NULL; - -#endif -} void Jnjvm::endCollection() { finalizerThread->FinalizationQueueLock.release(); Modified: vmkit/trunk/lib/j3/VMCore/Jnjvm.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/Jnjvm.h?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/Jnjvm.h (original) +++ vmkit/trunk/lib/j3/VMCore/Jnjvm.h Mon Jun 10 09:28:18 2013 @@ -127,7 +127,6 @@ private: JavaReferenceThread* referenceThread; virtual void startCollection(); - virtual void endCollectionBeforeUnlockingWorld(); virtual void endCollection(); virtual void scanWeakReferencesQueue(word_t closure); virtual void scanSoftReferencesQueue(word_t closure); @@ -366,36 +365,6 @@ public: void loadBootstrap(); static void printBacktrace() __attribute__((noinline)); - -#if RESET_STALE_REFERENCES - -public: - typedef std::map > staleBundleClassLoadersType; - typedef std::map bundleClassLoadersType; - - void setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected); - bool isBundleStaleReferenceCorrected(int64_t bundleID); - void dumpClassLoaderBundles(); - - JnjvmClassLoader* getBundleClassLoader(int64_t bundleID); - int64_t getClassLoaderBundleID(JnjvmClassLoader* loader); - void setBundleClassLoader(int64_t bundleID, JnjvmClassLoader* loader); - void classLoaderUnloaded(JnjvmClassLoader* loader); - - virtual void resetReferenceIfStale(const void* source, void** ref); - -protected: - void resetReferenceIfStale(const JavaObject *source, class VMClassLoader** ref); - void resetReferenceIfStale(const JavaObject *source, class VMStaticInstance** ref); - void resetReferenceIfStale(const JavaObject *source, class JavaObject** ref); - - // Link between OSGi (bundle ID) and Java (class loaders). - vmkit::LockRecursive bundleClassLoadersLock; - bundleClassLoadersType bundleClassLoaders; - staleBundleClassLoadersType staleBundleClassLoaders; - volatile bool scanStaleReferences; - -#endif }; } // end namespace j3 Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp Mon Jun 10 09:28:18 2013 @@ -214,9 +214,6 @@ JnjvmBootstrapLoader::JnjvmBootstrapLoad JnjvmClassLoader::JnjvmClassLoader(vmkit::BumpPtrAllocator& Alloc) : allocator(Alloc) -#if RESET_STALE_REFERENCES - ,staleRefFlags(CLASS_LOADER_STALE_REF_CORRECTED) -#endif { } @@ -224,9 +221,6 @@ JnjvmClassLoader::JnjvmClassLoader(vmkit JnjvmClassLoader& JCL, JavaObject* loader, VMClassLoader* vmdata, Jnjvm* VM) : allocator(Alloc) -#if RESET_STALE_REFERENCES - ,staleRefFlags(CLASS_LOADER_STALE_REF_CORRECTED) -#endif { llvm_gcroot(loader, 0); llvm_gcroot(vmdata, 0); @@ -878,10 +872,6 @@ const UTF8* JnjvmClassLoader::readerCons JnjvmClassLoader::~JnjvmClassLoader() { -#if RESET_STALE_REFERENCES - vm->classLoaderUnloaded(this); -#endif - if (vm) { vm->removeFrameInfos(TheCompiler); } @@ -1141,33 +1131,3 @@ ArrayObject* JnjvmBootstrapLoader::getBo return res; } - -#if RESET_STALE_REFERENCES - -bool JnjvmClassLoader::isStale() const -{ - return (staleRefFlags & CLASS_LOADER_STALE_REF_STALE) != 0; -} - -void JnjvmClassLoader::markStale(bool stale) -{ - if (stale) - staleRefFlags |= CLASS_LOADER_STALE_REF_STALE; - else - staleRefFlags &= ~CLASS_LOADER_STALE_REF_STALE; -} - -bool JnjvmClassLoader::isStaleReferencesCorrectionEnabled() const -{ - return (staleRefFlags & CLASS_LOADER_STALE_REF_CORRECTED) != 0; -} - -void JnjvmClassLoader::setStaleReferencesCorrectionEnabled(bool enable) -{ - if (enable) - staleRefFlags |= CLASS_LOADER_STALE_REF_CORRECTED; - else - staleRefFlags &= ~CLASS_LOADER_STALE_REF_CORRECTED; -} - -#endif Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h Mon Jun 10 09:28:18 2013 @@ -52,9 +52,6 @@ class ZipArchive; template class TJavaArray; typedef TJavaArray ArrayObject; -#define CLASS_LOADER_STALE_REF_CORRECTED 0x1 -#define CLASS_LOADER_STALE_REF_STALE 0x2 - /// JnjvmClassLoader - Runtime representation of a class loader. It contains /// its own tables (signatures, UTF8, types) which are mapped to a single /// table for non-isolate environments. @@ -346,19 +343,6 @@ public: /// word_t getRegisteredNative(const JavaMethod * meth); -#if RESET_STALE_REFERENCES - -protected: - uint8_t staleRefFlags; - -public: - bool isStale() const; - void markStale(bool stale = true); - bool isStaleReferencesCorrectionEnabled() const; - void setStaleReferencesCorrectionEnabled(bool enable); - -#endif - friend class Class; friend class CommonClass; friend class StringList; Removed: vmkit/trunk/lib/j3/VMCore/JnjvmIntOSGi.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmIntOSGi.cpp?rev=183659&view=auto ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmIntOSGi.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmIntOSGi.cpp (removed) @@ -1,262 +0,0 @@ - -#include -#include -#include - -#include "VmkitGC.h" -#include "Jnjvm.h" -#include "ClasspathReflect.h" -#include "JavaUpcalls.h" -#include "j3/jni.h" -#include "JavaArray.h" - - -using namespace std; - -#if RESET_STALE_REFERENCES - -#define DEBUG_VERBOSE_STALE_REF 1 - -namespace j3 { - -void Jnjvm::dumpClassLoaderBundles() -{ - vmkit::LockGuard lg(bundleClassLoadersLock); - Jnjvm::bundleClassLoadersType::const_iterator - i = bundleClassLoaders.begin(), e = bundleClassLoaders.end(); - - for (; i != e; ++i) - cerr << "bundleID=" << i->first << " classLoader=" << i->second << endl; - - staleBundleClassLoadersType::const_iterator - si = staleBundleClassLoaders.begin(), se = staleBundleClassLoaders.end(); - staleBundleClassLoadersType::mapped_type::const_iterator li, le; - for (; si != se; ++si) { - cerr << "stale bundleID=" << si->first << " classLoaders={"; - le = si->second.end(); - li = si->second.begin(); - for (; li != le; ++li) cerr << " " << *li; - cerr << "}" << endl; - } -} - -void Jnjvm::setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected) -{ - JnjvmClassLoader* loader = this->getBundleClassLoader(bundleID); - if (!loader) { - this->illegalArgumentException("Invalid bundle ID"); return;} - -#if DEBUG_VERBOSE_STALE_REF - cerr << "Stale references to bundleID=" << bundleID << " are "; - if (corrected) - cerr << "corrected." << endl; - else - cerr << "no more corrected." << endl; -#endif - - loader->setStaleReferencesCorrectionEnabled(corrected); -} - -bool Jnjvm::isBundleStaleReferenceCorrected(int64_t bundleID) -{ - JnjvmClassLoader* loader = this->getBundleClassLoader(bundleID); - if (!loader) { - this->illegalArgumentException("Invalid bundle ID"); return false;} - - return loader->isStaleReferencesCorrectionEnabled(); -} - -JnjvmClassLoader* Jnjvm::getBundleClassLoader(int64_t bundleID) -{ - 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; -} - -struct Jnjvm_getClassLoaderBundleID_InstalledBundles_finder { - JnjvmClassLoader* loader; - Jnjvm_getClassLoaderBundleID_InstalledBundles_finder( - JnjvmClassLoader* l) : loader(l) {} - - bool operator() (const Jnjvm::bundleClassLoadersType::value_type& pair) { - return (loader == pair.second); - } -}; - -struct Jnjvm_getClassLoaderBundleID_UninstalledBundles_finder { - JnjvmClassLoader* loader; - Jnjvm_getClassLoaderBundleID_UninstalledBundles_finder( - JnjvmClassLoader* l) : loader(l) {} - - bool operator() (const Jnjvm::staleBundleClassLoadersType::value_type& pair) { - Jnjvm::staleBundleClassLoadersType::mapped_type::const_iterator - b = pair.second.begin(), e = pair.second.end(); - Jnjvm::staleBundleClassLoadersType::mapped_type::const_iterator - i = std::find(b, e, loader); - return (i != e); - } -}; - -int64_t Jnjvm::getClassLoaderBundleID(JnjvmClassLoader* loader) -{ - if (loader == NULL) return -1; - vmkit::LockGuard lg(bundleClassLoadersLock); - - bundleClassLoadersType::const_iterator - b = bundleClassLoaders.begin(), - e = bundleClassLoaders.end(); - bundleClassLoadersType::const_iterator - i = std::find_if(b, e, - Jnjvm_getClassLoaderBundleID_InstalledBundles_finder(loader)); - - if (i != e) return i->first; - - // Look up in stale bundles list - staleBundleClassLoadersType::const_iterator - sb = staleBundleClassLoaders.begin(), - se = staleBundleClassLoaders.end(); - staleBundleClassLoadersType::const_iterator - si = std::find_if(sb, se, - Jnjvm_getClassLoaderBundleID_UninstalledBundles_finder(loader)); - - return (si == se) ? -1 : si->first; -} - -// Link a bundle ID (OSGi world) to a class loader (Java world). -void Jnjvm::setBundleClassLoader(int64_t bundleID, JnjvmClassLoader* loader) -{ - if (bundleID == -1) return; - vmkit::LockGuard lg(bundleClassLoadersLock); - - JnjvmClassLoader* previous_loader = bundleClassLoaders[bundleID]; - - if (!loader) { - // Unloaded bundle - bundleClassLoaders.erase(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 - - // Associate the class loader with the bundle - bundleClassLoaders[bundleID] = loader; - -#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 - } - - if (previous_loader != NULL) { - // Mark the previous class loader as stale - if (previous_loader->isStaleReferencesCorrectionEnabled()) { - previous_loader->markStale(true); - staleBundleClassLoaders[bundleID].push_front(previous_loader); - } - - // Enable stale references scanning - scanStaleReferences = true; - - // Start a garbage collection now - //vmkit::Collector::collect(); - } -} - -void Jnjvm::classLoaderUnloaded(JnjvmClassLoader* loader) -{ - int64_t bundleID = getClassLoaderBundleID(loader); - if (bundleID == -1) { - cerr << "Class loader unloaded: " << loader << endl; - return; - } - - staleBundleClassLoaders[bundleID].remove(loader); - if (staleBundleClassLoaders[bundleID].size() == 0) - staleBundleClassLoaders.erase(bundleID); - -#if DEBUG_VERBOSE_STALE_REF - cerr << "Class loader unloaded: " << loader - << " bundleID=" << bundleID << endl; -#endif -} - -} - -#endif - -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 - - Jnjvm* vm = JavaThread::get()->getJVM(); - CommonClass* ccl = JavaObjectClass::getClass(classObject); - vm->setBundleClassLoader(bundleID, ccl->classLoader); - -#endif -} - -extern "C" void Java_j3_vm_OSGi_notifyBundleUninstalled(jlong bundleID) -{ -#if RESET_STALE_REFERENCES - - Jnjvm* vm = JavaThread::get()->getJVM(); - vm->setBundleClassLoader(bundleID, NULL); - -#endif -} - -extern "C" void Java_j3_vm_OSGi_setBundleStaleReferenceCorrected(jlong bundleID, jboolean corrected) -{ -#if RESET_STALE_REFERENCES - - Jnjvm* vm = JavaThread::get()->getJVM(); - vm->setBundleStaleReferenceCorrected(bundleID, corrected); - -#endif -} - -extern "C" jboolean Java_j3_vm_OSGi_isBundleStaleReferenceCorrected(jlong bundleID) -{ -#if RESET_STALE_REFERENCES - - Jnjvm* vm = JavaThread::get()->getJVM(); - return vm->isBundleStaleReferenceCorrected(bundleID); - -#else - return false; -#endif -} - -extern "C" void Java_j3_vm_OSGi_dumpClassLoaderBundles() -{ -#if RESET_STALE_REFERENCES - - Jnjvm* vm = JavaThread::get()->getJVM(); - vm->dumpClassLoaderBundles(); - -#endif -} Removed: vmkit/trunk/lib/j3/VMCore/JnjvmStaleRef.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmStaleRef.cpp?rev=183659&view=auto ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmStaleRef.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmStaleRef.cpp (removed) @@ -1,122 +0,0 @@ - -#include "VmkitGC.h" -#include "Jnjvm.h" -#include "VMStaticInstance.h" - -#include - -#if RESET_STALE_REFERENCES - -#define DEBUG_VERBOSE_STALE_REF 1 - -using namespace std; - -namespace j3 { - -void Jnjvm::resetReferenceIfStale(const void* source, void** ref) -{ - JavaObject *src = NULL; - llvm_gcroot(src, 0); - - if (!ref || !(*ref)) return; // Invalid or null reference - src = const_cast(reinterpret_cast(source)); - JavaObject **objRef = reinterpret_cast(ref); - -// if (findReferencesToObject == *objRef) -// foundReferencerObjects.push_back(src); - - if (!scanStaleReferences) return; // Stale references scanning disabled - - // Check the type of Java object. Some Java objects are not real object, but - // are bridges between Java and the VM objects. - if (VMClassLoader::isVMClassLoader(*objRef)) - resetReferenceIfStale(src, reinterpret_cast(ref)); - else if (VMStaticInstance::isVMStaticInstance(*objRef)) - resetReferenceIfStale(src, reinterpret_cast(ref)); - else - resetReferenceIfStale(src, objRef); -} - -void Jnjvm::resetReferenceIfStale(const JavaObject *source, VMClassLoader** ref) -{ - llvm_gcroot(source, 0); - - // Don't touch fake Java objects that exist only as bridges between the - // Java object model and the C++ object model. - -#if DEBUG_VERBOSE_STALE_REF - - JnjvmClassLoader* loader = (**ref).getClassLoader(); - if (!loader->isStale()) return; -/* - cerr << "WARNING: Ignored stale reference ref=" << ref << " obj=" << **ref; - if (source) cerr << " source=" << *source; - cerr << endl; -*/ -#endif -} - -void Jnjvm::resetReferenceIfStale(const JavaObject *source, VMStaticInstance** ref) -{ - llvm_gcroot(source, 0); - - // Don't touch fake Java objects that exist only as bridges between the - // Java object model and the C++ object model. - -#if DEBUG_VERBOSE_STALE_REF - - JnjvmClassLoader* loader = (**ref).getOwningClass()->classLoader; - if (!loader->isStale()) return; -/* - cerr << "WARNING: Ignored stale reference ref=" << ref << " obj=" << **ref; - if (source) cerr << " source=" << *source; - cerr << endl; -*/ -#endif -} - -void Jnjvm::resetReferenceIfStale(const JavaObject *source, JavaObject** ref) -{ - llvm_gcroot(source, 0); - -#if DEBUG_VERBOSE_STALE_REF - - if (source) { - CommonClass* ccl = JavaObject::getClass(source); - if (ccl->classLoader->isStale()) - cerr << "WARNING: Source object is stale source=" << *source << endl; - } - -#endif - - CommonClass* ccl = JavaObject::getClass(*ref); - assert (ccl && "Object Class is not null."); - - if (!ccl->classLoader->isStale()) return; - -#if DEBUG_VERBOSE_STALE_REF - - cerr << "Resetting ref=" << ref << " obj=" << **ref; - if (source) cerr << " source=" << *source; - cerr << endl; - -#endif - - if (JavaThread* ownerThread = (JavaThread*)vmkit::ThinLock::getOwner(*ref, this->lockSystem)) { - if (vmkit::FatLock* lock = vmkit::ThinLock::getFatLock(*ref, this->lockSystem)) - lock->markAssociatedObjectAsDead(); - - // Notify all threads waiting on this object - ownerThread->lockingThread.notifyAll(*ref, this->lockSystem, ownerThread); - - // Release this object - while (vmkit::ThinLock::getOwner(*ref, this->lockSystem) == ownerThread) - vmkit::ThinLock::release(*ref, this->lockSystem, ownerThread); - } - - *ref = NULL; // Reset the reference -} - -} - -#endif Modified: vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/trunk/mmtk/mmtk-alloc/Selected.cpp Mon Jun 10 09:28:18 2013 @@ -184,10 +184,6 @@ void Collector::scanObject(FrameInfo* FI if ((*ptr) != NULL) { assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*ptr))); } -#if RESET_STALE_REFERENCES - // Allow the VM to reset references if needed - vmkit::Thread::get()->MyVM->resetReferenceIfStale(NULL, ptr); -#endif JnJVM_org_j3_bindings_Bindings_reportDelayedRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2(closure, ptr); } @@ -198,10 +194,6 @@ void Collector::markAndTrace(void* sourc assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*ptr_))); } if ((*(void**)ptr) != NULL) assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*(void**)ptr))); -#if RESET_STALE_REFERENCES - // Allow the VM to reset references if needed - vmkit::Thread::get()->MyVM->resetReferenceIfStale(source, ptr_); -#endif JnJVM_org_j3_bindings_Bindings_processEdge__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2(closure, source, ptr); } @@ -211,10 +203,6 @@ void Collector::markAndTraceRoot(void* s if ((*ptr_) != NULL) { assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*ptr_))); } -#if RESET_STALE_REFERENCES - // Allow the VM to reset references if needed - vmkit::Thread::get()->MyVM->resetReferenceIfStale(source, ptr_); -#endif JnJVM_org_j3_bindings_Bindings_processRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2Z(closure, ptr, true); } Modified: vmkit/trunk/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Collection.cpp?rev=183660&r1=183659&r2=183660&view=diff ============================================================================== --- vmkit/trunk/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/trunk/mmtk/mmtk-j3/Collection.cpp Mon Jun 10 09:28:18 2013 @@ -41,7 +41,6 @@ extern "C" void Java_org_j3_mmtk_Collect JnJVM_org_j3_bindings_Bindings_collect__I(why); - th->MyVM->endCollectionBeforeUnlockingWorld(); th->MyVM->rendezvous.finishRV(); th->MyVM->endCollection(); } From koutheir at gmail.com Mon Jun 10 07:38:51 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 14:38:51 -0000 Subject: [vmkit-commits] [vmkit] r183661 - Incinerator feature removed from the main JVM. Incinerator shall be available in a separate branch. Message-ID: <20130610143851.4CD9B2A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 09:38:51 2013 New Revision: 183661 URL: http://llvm.org/viewvc/llvm-project?rev=183661&view=rev Log: Incinerator feature removed from the main JVM. Incinerator shall be available in a separate branch. Removed: vmkit/trunk/incinerator/ From koutheir at gmail.com Mon Jun 10 07:53:15 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 14:53:15 -0000 Subject: [vmkit-commits] [vmkit] r183663 - Incinerator feature implemented in J3. Incinerator is an extension to the JVM and to the GC that detects and eliminates stale references in OSGi. Message-ID: <20130610145315.506132A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 09:53:15 2013 New Revision: 183663 URL: http://llvm.org/viewvc/llvm-project?rev=183663&view=rev Log: Incinerator feature implemented in J3. Incinerator is an extension to the JVM and to the GC that detects and eliminates stale references in OSGi. Added: vmkit/branches/incinerator/ (props changed) - copied from r183662, vmkit/trunk/ Propchange: vmkit/branches/incinerator/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jun 10 09:53:15 2013 @@ -0,0 +1,17 @@ +do-find +Makefile.config +Makefile.llvmbuild +replace.sh +config.log +*.tmp +Release +do-conf +configure.out +config.status +Makefile.common +Release-Asserts +Release+Asserts +Debug+Asserts +Debug +.project + Propchange: vmkit/branches/incinerator/ ------------------------------------------------------------------------------ --- svn:mergeinfo (added) +++ svn:mergeinfo Mon Jun 10 09:53:15 2013 @@ -0,0 +1,2 @@ +/vmkit/branches/precise:112509-120199 +/vmkit/branches/release_028:115466-116298 From koutheir at gmail.com Mon Jun 10 08:09:02 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 15:09:02 -0000 Subject: [vmkit-commits] [vmkit] r183665 - Restore MONITOREXIT behavior to conform to the Java specifications, i.e., MONITOREXIT throws an exception if given a null reference. Message-ID: <20130610150902.8C2832A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 10:09:02 2013 New Revision: 183665 URL: http://llvm.org/viewvc/llvm-project?rev=183665&view=rev Log: Restore MONITOREXIT behavior to conform to the Java specifications, i.e., MONITOREXIT throws an exception if given a null reference. Modified: vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp Modified: vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp?rev=183665&r1=183664&r2=183665&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp Mon Jun 10 10:09:02 2013 @@ -695,13 +695,7 @@ void JavaJIT::monitorEnter(Value* obj) { } void JavaJIT::monitorExit(Value* obj) { - /* - obj should not be null if we are here. - If obj was null when monitorEnter() was run, then monitorEnter() should have - thrown an exception. If it was not null then, and it is null now, it must have - been reset by the GC (it became a stale reference) between monitorEnter() and - monitorExit(). In this case, just get out of the synchronize block silently. - */ + // obj should not be null if we are here. BasicBlock* nonNullObjBlock = createBasicBlock("monitorExit_nonNullObj"); BasicBlock* EndBlock = createBasicBlock("monitorExit_End"); Modified: vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp?rev=183665&r1=183664&r2=183665&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp Mon Jun 10 10:09:02 2013 @@ -2566,11 +2566,9 @@ void JavaJIT::compileOpcodes(Reader& rea } case MONITOREXIT : { - // NOTE: monitorExit() should NOT throw an exception if object is null. - // See monitorExit() implementation. - //bool thisReference = isThisReference(currentStackIndex - 1); + bool thisReference = isThisReference(currentStackIndex - 1); Value* obj = pop(); - // if (!thisReference) JITVerifyNull(obj); + if (!thisReference) JITVerifyNull(obj); monitorExit(obj); break; } From koutheir at gmail.com Mon Jun 10 08:22:36 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 15:22:36 -0000 Subject: [vmkit-commits] [vmkit] r183667 - Setting class loader internal references to NULL pointers once they are no more usable. Class loaders reused after their destruction would be discovered earlier now. NOTICE: J3 does NOT correctly support Java object resurrection now. Message-ID: <20130610152236.8DDF22A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 10:22:36 2013 New Revision: 183667 URL: http://llvm.org/viewvc/llvm-project?rev=183667&view=rev Log: Setting class loader internal references to NULL pointers once they are no more usable. Class loaders reused after their destruction would be discovered earlier now. NOTICE: J3 does NOT correctly support Java object resurrection now. Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp?rev=183667&r1=183666&r2=183667&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp Mon Jun 10 10:22:36 2013 @@ -879,29 +879,38 @@ JnjvmClassLoader::~JnjvmClassLoader() { if (classes) { classes->~ClassMap(); allocator.Deallocate(classes); + classes = NULL; } if (hashUTF8) { hashUTF8->~UTF8Map(); allocator.Deallocate(hashUTF8); + hashUTF8 = NULL; } if (javaTypes) { javaTypes->~TypeMap(); allocator.Deallocate(javaTypes); + javaTypes = NULL; } if (javaSignatures) { javaSignatures->~SignMap(); allocator.Deallocate(javaSignatures); + javaSignatures = NULL; } - for (std::vector::iterator i = nativeLibs.begin(); - i < nativeLibs.end(); ++i) { + for (std::vector::iterator + i = nativeLibs.begin(), e = nativeLibs.end(); i != e; ++i) + { dlclose(*i); } + nativeLibs.clear(); + + vm = NULL; delete TheCompiler; + TheCompiler = NULL; // Don't delete the allocator. The caller of this method must // delete it after the current object is deleted. From koutheir at gmail.com Mon Jun 10 09:11:39 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:11:39 -0000 Subject: [vmkit-commits] [vmkit] r183675 - Adding Incinerator feature to J3. Moving tests. Message-ID: <20130610161140.047282A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:11:39 2013 New Revision: 183675 URL: http://llvm.org/viewvc/llvm-project?rev=183675&view=rev Log: Adding Incinerator feature to J3. Moving tests. Added: vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile (with props) vmkit/branches/incinerator/tests/dacapo/2006-10/Makefile (with props) vmkit/branches/incinerator/tests/dacapo/9.12-bach/Makefile (with props) vmkit/branches/incinerator/tests/dacapo/Makefile (with props) vmkit/branches/incinerator/tests/dacapo/Makefile.inc (with props) vmkit/branches/incinerator/tests/dacapo/README (with props) vmkit/branches/incinerator/tests/dacapo/augment-dacapo-data.sh (with props) vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv (with props) vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on-overhead.plot (with props) vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on.plot (with props) vmkit/branches/incinerator/tests/dacapo/dacapo-tablet-avg-overhead.csv (with props) vmkit/branches/incinerator/tests/dacapo/float.sh (with props) vmkit/branches/incinerator/tests/dacapo/jars/download.sh (with props) vmkit/branches/incinerator/tests/dacapo/reduce-logs.sh (with props) vmkit/branches/incinerator/tests/dacapo/run-all.sh (with props) vmkit/branches/incinerator/tests/dacapo/run-bench.sh (with props) vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv (with props) vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv (with props) vmkit/branches/incinerator/tests/dacapo/stats-tablet-incinerator-dacapo-2006-10-MR2.csv (with props) vmkit/branches/incinerator/tests/dacapo/stats-tablet-j3-dacapo-2006-10-MR2.csv (with props) vmkit/branches/incinerator/tests/dacapo/synth-avg-overhead.sh (with props) vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-min-max-avg.awk (with props) vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-std-dev.awk (with props) vmkit/branches/incinerator/tests/dacapo/synth-logs.sh (with props) Removed: vmkit/branches/incinerator/tests/dacapo/tablet-incinerator-dacapo-2006-10-MR2.logs/ vmkit/branches/incinerator/tests/dacapo/tablet-j3-dacapo-2006-10-MR2.logs/ vmkit/branches/incinerator/tests/ijvm.isolate.IsolateManager/ vmkit/branches/incinerator/tests/ijvm.tests.A/ vmkit/branches/incinerator/tests/ijvm.tests.AImpl/ vmkit/branches/incinerator/tests/ijvm.tests.BImpl/ vmkit/branches/incinerator/tests/ijvm.tests.BundleMgmtStress/ vmkit/branches/incinerator/tests/ijvm.tests.C/ vmkit/branches/incinerator/tests/ijvm.tests.CImpl/ vmkit/branches/incinerator/tests/ijvm.tests.DImpl/ vmkit/branches/incinerator/tests/ijvm.tests.Runner/ vmkit/branches/incinerator/tests/ijvm.tests.StaticClient/ vmkit/branches/incinerator/tests/ijvm.tests.StaticExposer/ vmkit/branches/incinerator/tests/ijvm.tests.loopClient/ vmkit/branches/incinerator/tests/ijvm.tests.looper/ vmkit/branches/incinerator/tests/ijvm.tests.tier/ vmkit/branches/incinerator/tests/ijvm.tests.tierImpl/ Added: 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=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile (added) +++ vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile Mon Jun 10 11:11:39 2013 @@ -0,0 +1,7 @@ +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 + +include ../Makefile.inc Propchange: vmkit/branches/incinerator/tests/dacapo/2006-10-MR2/Makefile ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/2006-10/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/2006-10/Makefile?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/2006-10/Makefile (added) +++ vmkit/branches/incinerator/tests/dacapo/2006-10/Makefile Mon Jun 10 11:11:39 2013 @@ -0,0 +1,6 @@ +LEVEL := .. +DACAPO_VERSION := 2006-10 +DACAPO_ARGS := -s default +DECAPO_BENCHMARKS := antlr bloat chart eclipse fop hsqldb jython luindex lusearch pmd xalan + +include ../Makefile.inc Propchange: vmkit/branches/incinerator/tests/dacapo/2006-10/Makefile ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/9.12-bach/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/9.12-bach/Makefile?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/9.12-bach/Makefile (added) +++ vmkit/branches/incinerator/tests/dacapo/9.12-bach/Makefile Mon Jun 10 11:11:39 2013 @@ -0,0 +1,6 @@ +LEVEL := .. +DACAPO_VERSION := 9.12-bach +DACAPO_ARGS := -s default +DECAPO_BENCHMARKS := avrora batik eclipse fop h2 jython luindex lusearch pmd sunflow tomcat tradebeans tradesoap xalan + +include ../Makefile.inc Propchange: vmkit/branches/incinerator/tests/dacapo/9.12-bach/Makefile ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/Makefile URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/Makefile?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/Makefile (added) +++ vmkit/branches/incinerator/tests/dacapo/Makefile Mon Jun 10 11:11:39 2013 @@ -0,0 +1,9 @@ +LEVEL := . +DIRS := 2006-10 2006-10-MR2 9.12-bach + +default: all + +$(DIRS):: + $(MAKE) -C $@ $(MAKECMDGOALS) + +all clean: $(DIRS) Propchange: vmkit/branches/incinerator/tests/dacapo/Makefile ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/Makefile.inc URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/Makefile.inc?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/Makefile.inc (added) +++ vmkit/branches/incinerator/tests/dacapo/Makefile.inc Mon Jun 10 11:11:39 2013 @@ -0,0 +1,30 @@ +ifdef DEBUG + BUILD_MODE := Debug+Asserts +else + BUILD_MODE := Release+Asserts +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 + +ifndef ENABLE_JVM1 + ENABLE_JVM1 := 1 +endif + +ifndef ENABLE_JVM2 + ENABLE_JVM2 := 1 +endif + +all: $(VM) $(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)" "$@" + +clean: + @-rm -rf "$(TMP_DIR)" "$(LOG_DIR)" 2>/dev/null Propchange: vmkit/branches/incinerator/tests/dacapo/Makefile.inc ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/README URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/README?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/README (added) +++ vmkit/branches/incinerator/tests/dacapo/README Mon Jun 10 11:11:39 2013 @@ -0,0 +1,12 @@ +* Run benchmarks: + ./run-all.sh 40 12 2006-10-MR2 'make ENABLE_IJVM=0' +* The log files describing benchmarks results are in "logs" directory, rename it if desired to keep it for later. +* Synthesize the logs, augment their statistical data and remove useless data: + ./reduce-logs.sh logs > stats-logs.csv +* Modify the file "dacapo-incinerator-off-on.plot" to reflect you new stats file name, then plot charts: + ./dacapo-incinerator-off-on.plot + +* If you have another engine to compare to the first, do the same as above, then generate overhead data: + ./synth-avg-overhead.sh stats-ref-engine.csv stats-new-engine.csv > dacapo-new-feature-avg-overhead.csv +* Then plot the results after altering "dacapo-incinerator-off-on-overhead.plot": + ./dacapo-incinerator-off-on-overhead.plot Propchange: vmkit/branches/incinerator/tests/dacapo/README ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/augment-dacapo-data.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/augment-dacapo-data.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/augment-dacapo-data.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/augment-dacapo-data.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,39 @@ +#!/bin/bash + +# Augment input data with statistical data about them: min, max, average, standard deviation + +# Augment statistical data with min, max and average +data=$(awk -f synth-dacapo-data-min-max-avg.awk) +header=$(echo "$data" | head -1) + +# Integrate augmented information into given input +data=$(echo "$data" | tail -n $(( $(echo "$data" | wc -l) - 1)) ) +added_data=$(echo "$data" | grep -v ',-,-,-,-') + +augmented_data=$header + +for i in $added_data ; do + key=$(echo "$i" | cut -d ',' -f 1-3) + added_value=$(echo "$i" | cut -d ',' -f 5-) + augmented_data+=$'\n' + augmented_data+=$(echo "$data" | grep "^$key,[^-]" | sed "s/-,-,-,-/$added_value/g") +done + +# Augment statistical data with standard deviation +data=$(echo "$augmented_data" | awk -f synth-dacapo-data-std-dev.awk) + +# Integrate augmented information into given input +data=$(echo "$data" | tail -n $(( $(echo "$data" | wc -l) - 1)) ) +added_data=$(echo "$data" | grep -v ',-$') + +augmented_data=$header + +for i in $added_data ; do + key=$(echo "$i" | cut -d ',' -f 1-3) + added_value=$(echo "$i" | cut -d ',' -f 8) + + augmented_data+=$'\n' + augmented_data+=$(echo "$data" | grep "^$key,[^-]" | sed "s/,-/,$added_value/g") +done + +echo "$augmented_data" Propchange: vmkit/branches/incinerator/tests/dacapo/augment-dacapo-data.sh ------------------------------------------------------------------------------ svn:executable = * Added: 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=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv (added) +++ vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv Mon Jun 10 11:11:39 2013 @@ -0,0 +1,12 @@ +#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 Propchange: vmkit/branches/incinerator/tests/dacapo/dacapo-avg-overhead.csv ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on-overhead.plot URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on-overhead.plot?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on-overhead.plot (added) +++ vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on-overhead.plot Mon Jun 10 11:11:39 2013 @@ -0,0 +1,31 @@ +#!/usr/bin/gnuplot -p + +set datafile separator "," +set datafile missing '_' +set datafile commentschars "#" + +set ylabel "Average relative overhead (lower is better)" +set ytics border nomirror +set grid ytics +set format y "%.0f %%" + +set style data histogram +set style histogram clustered gap 1 +set bars fullwidth +set style fill solid border 0 +set boxwidth 1 + +# set title "Incinerator overhead in Dacapo benchmarks" + +set xtics axis nomirror rotate by 20 offset -2,graph -0.5 +set border 3 + +#set term svg +#set term postscript clip 12 +#set term latex +set term wxt 1 +plot \ + 'dacapo-avg-overhead.csv' using 4:xtic(2) title "Powerful computer" linecolor rgb "orange" +# 'dacapo-tablet-avg-overhead.csv' using 4:xtic(2) title "Resource-constrained computer" linecolor rgb "grey" + +#set xtics axis nomirror rotate by 20 offset 0,graph 0 Propchange: vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on-overhead.plot ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on.plot URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on.plot?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on.plot (added) +++ vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on.plot Mon Jun 10 11:11:39 2013 @@ -0,0 +1,37 @@ +#!/usr/bin/gnuplot -p + +set datafile separator "," +set datafile missing '_' +set datafile commentschars "#" + +set ylabel "Duration (lower is better)" +set ytics border nomirror +set grid ytics +set yrange [0:*] +set ydata time +set timefmt "%S" +set format y "%M:%S" + +set xtics axis nomirror rotate by -20 offset -2 +set border 3 + +set style data histogram +set style histogram errorbars gap 1 lw 1 +set bars fullwidth +set style fill solid border 0 +set boxwidth 1 + +# set title "Incinerator overhead in Dacapo benchmarks" + +#set term svg +#set term postscript clip 12 +#set term latex +set term epslatex +#set term wxt 0 +#set output "dacapo-incinerator-off-on.tex" +set output "dacapo-incinerator-off-on.eps" +plot \ + 'stats-j3-dacapo-2006-10-MR2.csv' using (column(4)/1000.0):(column(7)/1000.0):xtic(2) linecolor rgb "grey" title "J3, powerful computer", \ + 'stats-incinerator-dacapo-2006-10-MR2.csv' using (column(4)/1000.0):(column(7)/1000.0):xtic(2) linecolor rgb "orange" title "Incinerator, powerful computer" +# 'stats-tablet-j3-dacapo-2006-10-MR2.csv' using (column(4)/1000.0):(column(7)/1000.0):xtic(2) linecolor rgb "white" title "J3, resource-constrained computer", \ +# 'stats-tablet-incinerator-dacapo-2006-10-MR2.csv' using (column(4)/1000.0):(column(7)/1000.0):xtic(2) linecolor rgb "red" title "Incinerator, resource-constrained computer" Propchange: vmkit/branches/incinerator/tests/dacapo/dacapo-incinerator-off-on.plot ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/dacapo-tablet-avg-overhead.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/dacapo-tablet-avg-overhead.csv?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/dacapo-tablet-avg-overhead.csv (added) +++ vmkit/branches/incinerator/tests/dacapo/dacapo-tablet-avg-overhead.csv Mon Jun 10 11:11:39 2013 @@ -0,0 +1,12 @@ +#bench_suite,benchmark,vm,avg_overhead +2006-10-MR2,antlr,j3,1.23 +2006-10-MR2,bloat,j3,0.53 +2006-10-MR2,chart,j3,0 +2006-10-MR2,eclipse,j3,6.90 +2006-10-MR2,fop,j3,0.08 +2006-10-MR2,hsqldb,j3,16.91 +2006-10-MR2,jython,j3,-0.04 +2006-10-MR2,luindex,j3,3.20 +2006-10-MR2,lusearch,j3,13.78 +2006-10-MR2,pmd,j3,2.61 +2006-10-MR2,xalan,j3,0.54 Propchange: vmkit/branches/incinerator/tests/dacapo/dacapo-tablet-avg-overhead.csv ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/float.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/float.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/float.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/float.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,36 @@ +#/bin/bash + +float_scale=2 + +# Evaluate then output an equation into a float number with $float_scale precision. +function float_eval() +{ + local stat=0 + local result=0.0 + + if [[ $# -gt 0 ]]; then + result=$(echo "scale=$float_scale; $*"|bc -q 2>/dev/null) + stat=$? + + if [[ "$stat" -eq 0 && -z "$result" ]]; then stat=1; fi + fi + + echo -n $result + return $stat +} + +# Evaluate an equation into a condition. +function float_cond() +{ + local cond=0 + + if [[ $# -gt 0 ]]; then + cond=$(echo "$*"|bc -q 2>/dev/null) + + if [[ -z "$cond" ]]; then cond=0; fi + if [[ "$cond" != 0 && "$cond" != 1 ]]; then cond=0; fi + fi + + local stat=$(($cond == 0)) + return $stat +} Propchange: vmkit/branches/incinerator/tests/dacapo/float.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/jars/download.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/jars/download.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/jars/download.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/jars/download.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,5 @@ +#!/bin/sh + +wget http://sourceforge.net/projects/dacapobench/files/archive/2006-10-MR2/dacapo-2006-10-MR2.jar/download -O dacapo-2006-10-MR2.jar +wget http://sourceforge.net/projects/dacapobench/files/archive/2006-10/dacapo-2006-10.jar/download -O dacapo-2006-10.jar +wget http://sourceforge.net/projects/dacapobench/files/9.12-bach/dacapo-9.12-bach.jar/download -O dacapo-9.12-bach.jar Propchange: vmkit/branches/incinerator/tests/dacapo/jars/download.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/reduce-logs.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/reduce-logs.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/reduce-logs.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/reduce-logs.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,7 @@ +#!/bin/bash + +# Removes elementary data and only leave satistical data (min, max, average, standard deviation) + +log_dir=$1 + +./synth-logs.sh "$log_dir" | sed 's/^\([^,]*,[^,]*,[^,]*\),[^,]*/\1/g' | uniq Propchange: vmkit/branches/incinerator/tests/dacapo/reduce-logs.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/run-all.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/run-all.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/run-all.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/run-all.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,12 @@ +#!/bin/bash + +# Run all Dacapo tests muliples times, logging their results +# ./run-all.sh 40 12 2006-10-MR2 'sleep $(($RANDOM / 7276))s ; echo Hello' + +times=$1 +jn=$2 +dir=$3 +cmd=$4 + +cd "$dir" +seq $times | parallel -n0 -j "$jn" -- $cmd Propchange: vmkit/branches/incinerator/tests/dacapo/run-all.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/run-bench.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/run-bench.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/run-bench.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/run-bench.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,34 @@ +#!/bin/bash + +# Run a Dacapo benchmark, logging its results + +enable=$1 + +if [ "$enable" -ne "1" ]; then exit 0; fi + +vm_name=$2 +bench_version=$3 +jvm=$4 +jar=$5 +vmargs=$6 +bench_name=$7 + +#dacapo_dir=/home/koutheir/PhD/VMKit/vmkit/tests/dacapo +dacapo_dir=$HOME/dacapo_benchmarks +tmp_dir=$dacapo_dir/tmp +log_dir=$dacapo_dir/logs + +suffix=_${bench_version}_${bench_name}_${vm_name} + +mkdir -p "$tmp_dir" "$log_dir" 2>/dev/null +scratch_dir=$(mktemp -d --suffix=$suffix --tmpdir=$tmp_dir) +log_file=$(mktemp --suffix=${suffix}.log --tmpdir=$log_dir) + +curdir=$(pwd) +cd "$scratch_dir" +"$jvm" -jar "$jar" $vmargs "$bench_name" > $log_file 2>&1 +r=$? + +cd "$curdir" +rm -rf "$scratch_dir" +exit $r Propchange: vmkit/branches/incinerator/tests/dacapo/run-bench.sh ------------------------------------------------------------------------------ svn:executable = * Added: 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=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv (added) +++ vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv Mon Jun 10 11:11:39 2013 @@ -0,0 +1,12 @@ +#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 Propchange: vmkit/branches/incinerator/tests/dacapo/stats-incinerator-dacapo-2006-10-MR2.csv ------------------------------------------------------------------------------ svn:executable = * Added: 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=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv (added) +++ vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv Mon Jun 10 11:11:39 2013 @@ -0,0 +1,12 @@ +#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 Propchange: vmkit/branches/incinerator/tests/dacapo/stats-j3-dacapo-2006-10-MR2.csv ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/stats-tablet-incinerator-dacapo-2006-10-MR2.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/stats-tablet-incinerator-dacapo-2006-10-MR2.csv?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/stats-tablet-incinerator-dacapo-2006-10-MR2.csv (added) +++ vmkit/branches/incinerator/tests/dacapo/stats-tablet-incinerator-dacapo-2006-10-MR2.csv Mon Jun 10 11:11:39 2013 @@ -0,0 +1,11 @@ +#bench_suite,benchmark,vm,avg_duration_ms,min_duration_ms,max_duration_ms,std_dev_duration_ms +2006-10-MR2,antlr,j3,95133.00,94023.00,98082.00,1704.82 +2006-10-MR2,bloat,j3,224196.25,222923.00,225075.00,800.50 +2006-10-MR2,eclipse,j3,1522943.75,1483855.00,1556229.00,26265.37 +2006-10-MR2,fop,j3,447227.25,446070.00,448941.00,1136.92 +2006-10-MR2,hsqldb,j3,214365.00,157261.00,272852.00,57093.12 +2006-10-MR2,jython,j3,414262.00,360557.00,437043.00,31345.40 +2006-10-MR2,luindex,j3,184606.75,184160.00,185261.00,431.08 +2006-10-MR2,lusearch,j3,366294.00,366294.00,366294.00,0.00 +2006-10-MR2,pmd,j3,227032.75,225972.00,227952.00,752.53 +2006-10-MR2,xalan,j3,142695.75,140495.00,145385.00,1814.56 Propchange: vmkit/branches/incinerator/tests/dacapo/stats-tablet-incinerator-dacapo-2006-10-MR2.csv ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/stats-tablet-j3-dacapo-2006-10-MR2.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/stats-tablet-j3-dacapo-2006-10-MR2.csv?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/stats-tablet-j3-dacapo-2006-10-MR2.csv (added) +++ vmkit/branches/incinerator/tests/dacapo/stats-tablet-j3-dacapo-2006-10-MR2.csv Mon Jun 10 11:11:39 2013 @@ -0,0 +1,11 @@ +#bench_suite,benchmark,vm,avg_duration_ms,min_duration_ms,max_duration_ms,std_dev_duration_ms +2006-10-MR2,antlr,j3,93974.75,93557.00,94328.00,346.48 +2006-10-MR2,bloat,j3,223013.25,221894.00,223472.00,654.47 +2006-10-MR2,eclipse,j3,1424598.50,1394331.00,1470880.00,31836.07 +2006-10-MR2,fop,j3,446827.25,445081.00,450343.00,2061.94 +2006-10-MR2,hsqldb,j3,183353.75,153504.00,271824.00,51078.81 +2006-10-MR2,jython,j3,414416.25,387536.00,441991.00,20936.20 +2006-10-MR2,luindex,j3,178879.50,178687.00,179173.00,179.30 +2006-10-MR2,lusearch,j3,321922.00,286055.00,357789.00,35867.00 +2006-10-MR2,pmd,j3,221250.25,220221.00,223051.00,1129.01 +2006-10-MR2,xalan,j3,141915.50,141309.00,143200.00,749.60 Propchange: vmkit/branches/incinerator/tests/dacapo/stats-tablet-j3-dacapo-2006-10-MR2.csv ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/synth-avg-overhead.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/synth-avg-overhead.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/synth-avg-overhead.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/synth-avg-overhead.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,22 @@ +#!/bin/bash + +# Generate overhead between a reference engine (e.g. reference VM stats) and another engine (e.g. feature-enabled VM stats). +# Gets in input two synthesized and reduced stats data. + +. ./float.sh +float_scale=4 + +ref_stats=$1 +new_stats=$2 + +ref_header=$(head -1 "$ref_stats") + +echo "$(head -1 "$ref_stats" | cut -d ',' -f 1-3),avg_overhead" + +for i in $(grep -v '^#' "$ref_stats") ; do + key=$(echo "$i" | cut -d ',' -f 1-3) + ref_val=$(echo "$i" | cut -d ',' -f 4) + new_val=$(grep "^$key," "$new_stats" | cut -d ',' -f 4) + overhead=$(float_eval "100.0 * ( $new_val / $ref_val - 1.0 )" ) + printf "%s,%.2f\n" "$key" "$overhead" +done Propchange: vmkit/branches/incinerator/tests/dacapo/synth-avg-overhead.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-min-max-avg.awk URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-min-max-avg.awk?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-min-max-avg.awk (added) +++ vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-min-max-avg.awk Mon Jun 10 11:11:39 2013 @@ -0,0 +1,48 @@ +BEGIN { + FS = ","; + + getline; + printf($1 FS $2 FS $3 FS $4 FS "avg_" $4 FS "min_" $4 FS "max_" $4 FS "std_dev_" $4 RS); + + getline; + + bench_suite = $1; + benchmark = $2; + vm = $3; + avg_duration_ms = $4; + min_duration_ms = $4; + max_duration_ms = $4; + count = 1; + + printf("%s" FS "-" FS "-" FS "-" FS "-" RS, $0); +} +/^$/ {} +{ + if ($1 == bench_suite && $2 == benchmark && $3 == vm) { + avg_duration_ms += $4; + if ($4 < min_duration_ms) min_duration_ms = $4; + if ($4 > max_duration_ms) max_duration_ms = $4; + count++; + } else { + avg_duration_ms /= count; + printf("%s" FS "%s" FS "%s" FS "-" FS "%.2f" FS "%.2f" FS "%.2f" FS "-" RS, + bench_suite, benchmark, vm, + avg_duration_ms, min_duration_ms, max_duration_ms); + + bench_suite = $1; + benchmark = $2; + vm = $3; + avg_duration_ms = $4; + min_duration_ms = $4; + max_duration_ms = $4; + count = 1; + } + + printf("%s" FS "-" FS "-" FS "-" FS "-" RS, $0); +} +END { + avg_duration_ms /= count; + printf("%s" FS "%s" FS "%s" FS "-" FS "%.2f" FS "%.2f" FS "%.2f" FS "-" RS, + bench_suite, benchmark, vm, + avg_duration_ms, min_duration_ms, max_duration_ms); +} Propchange: vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-min-max-avg.awk ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-std-dev.awk URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-std-dev.awk?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-std-dev.awk (added) +++ vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-std-dev.awk Mon Jun 10 11:11:39 2013 @@ -0,0 +1,50 @@ +BEGIN { + FS = ","; + + getline; + print $0; + + getline; + + bench_suite = $1; + benchmark = $2; + vm = $3; + duration_ms = $4; + avg_duration_ms = $5; + min_duration_ms = $6; + max_duration_ms = $7; + std_dev_duration_ms = (duration_ms - avg_duration_ms)^2; + count = 1; + + print $0; +} +/^$/ {} +{ + if ($1 == bench_suite && $2 == benchmark && $3 == vm) { + std_dev_duration_ms += ($4 - $5)^2; + count++; + } else { + std_dev_duration_ms = sqrt(std_dev_duration_ms / count); + printf("%s" FS "%s" FS "%s" FS "-" FS "%.2f" FS "%.2f" FS "%.2f" FS "%.2f" RS, + bench_suite, benchmark, vm, + avg_duration_ms, min_duration_ms, max_duration_ms, std_dev_duration_ms); + + bench_suite = $1; + benchmark = $2; + vm = $3; + duration_ms = $4; + avg_duration_ms = $5; + min_duration_ms = $6; + max_duration_ms = $7; + std_dev_duration_ms = (duration_ms - avg_duration_ms)^2; + count = 1; + } + + print $0; +} +END { + std_dev_duration_ms = sqrt(std_dev_duration_ms / count); + printf("%s" FS "%s" FS "%s" FS "-" FS "%.2f" FS "%.2f" FS "%.2f" FS "%.2f" RS, + bench_suite, benchmark, vm, + avg_duration_ms, min_duration_ms, max_duration_ms, std_dev_duration_ms); +} Propchange: vmkit/branches/incinerator/tests/dacapo/synth-dacapo-data-std-dev.awk ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/tests/dacapo/synth-logs.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tests/dacapo/synth-logs.sh?rev=183675&view=auto ============================================================================== --- vmkit/branches/incinerator/tests/dacapo/synth-logs.sh (added) +++ vmkit/branches/incinerator/tests/dacapo/synth-logs.sh Mon Jun 10 11:11:39 2013 @@ -0,0 +1,13 @@ +#!/bin/bash + +# Collect results from benchmarks logs, then synthesize them, producing statistical data about them. + +log_dir=$1 + +log_files=$(find "$log_dir" -name tmp.*) + +data=$(echo '#bench_suite,benchmark,vm,duration_ms') +data+=$'\n' +data+=$(grep '^===== DaCapo [A-Za-z]\+ PASSED' $log_files | sed 's/^.*\/tmp[^_]\+_//g' | sed 's/ msec =====//g' | sed 's/\.log:===== DaCapo [a-z]\+ PASSED in /_/g' | tr '_' ',' | sort) + +echo "$data" | ./augment-dacapo-data.sh Propchange: vmkit/branches/incinerator/tests/dacapo/synth-logs.sh ------------------------------------------------------------------------------ svn:executable = * From koutheir at gmail.com Mon Jun 10 09:15:23 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:15:23 -0000 Subject: [vmkit-commits] [vmkit] r183676 - Adding Incinerator feature to J3. Factorizing most Incinerator changes into a main directory. Message-ID: <20130610161525.295DE2A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:15:21 2013 New Revision: 183676 URL: http://llvm.org/viewvc/llvm-project?rev=183676&view=rev Log: Adding Incinerator feature to J3. Factorizing most Incinerator changes into a main directory. Added: vmkit/branches/incinerator/incinerator/ vmkit/branches/incinerator/incinerator/README.TXT (with props) vmkit/branches/incinerator/incinerator/knopflerfish.patch (with props) vmkit/branches/incinerator/incinerator/osgi/ vmkit/branches/incinerator/incinerator/osgi/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/osgi/.classpath (with props) vmkit/branches/incinerator/incinerator/osgi/.project (with props) vmkit/branches/incinerator/incinerator/osgi/bin/ vmkit/branches/incinerator/incinerator/osgi/bin/j3/ vmkit/branches/incinerator/incinerator/osgi/bin/j3/vm/ vmkit/branches/incinerator/incinerator/osgi/bin/j3mgr/ vmkit/branches/incinerator/incinerator/osgi/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/osgi/out/ vmkit/branches/incinerator/incinerator/osgi/out/j3/ vmkit/branches/incinerator/incinerator/osgi/out/j3/vm/ vmkit/branches/incinerator/incinerator/osgi/out/j3mgr/ vmkit/branches/incinerator/incinerator/osgi/src/ vmkit/branches/incinerator/incinerator/osgi/src/j3/ vmkit/branches/incinerator/incinerator/osgi/src/j3/J3Mgr.java (with props) vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/ vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java (with props) vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/ vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/Activator.java (with props) vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/J3MgrImpl.java (with props) vmkit/branches/incinerator/incinerator/tests/ vmkit/branches/incinerator/incinerator/tests/AnnotationClassTest.java (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/.project (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/out/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/out/BundleReloader/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/out/j3/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/out/j3/vm/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/BundleReloader.java (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/SameBundleReloader.java (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ScanningBundleReloader.java (with props) vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/OSGi.java (with props) vmkit/branches/incinerator/incinerator/tests/FieldWriteTest.java (with props) vmkit/branches/incinerator/incinerator/tests/InstanceOfThisTest.java (with props) vmkit/branches/incinerator/incinerator/tests/InvokeFinalizerTest.java (with props) vmkit/branches/incinerator/incinerator/tests/LshlTest.java (with props) vmkit/branches/incinerator/incinerator/tests/LshrTest.java (with props) vmkit/branches/incinerator/incinerator/tests/MyAnnotation.java (with props) vmkit/branches/incinerator/incinerator/tests/ThisReferenceTest.java (with props) vmkit/branches/incinerator/incinerator/tests/ThreadTest.java (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/ vmkit/branches/incinerator/incinerator/tests/benchmarks/benchmarks.odt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/bytes.sh (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-demo.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-sol.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-demo.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-sol.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-demo.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-sol.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-demo.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-sol.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/float.sh (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref-corrected.csv (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.csv (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.plot (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/mon-process.sh (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/old/ vmkit/branches/incinerator/incinerator/tests/benchmarks/old/monitor_process.sh (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/reinstall-count.txt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/run-dacapo.sh (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/run-mon-process.sh (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/scenarios.odt (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/statistics.sh (with props) vmkit/branches/incinerator/incinerator/tests/benchmarks/std-deviation.sh (with props) vmkit/branches/incinerator/incinerator/tests/debug.txt (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bin/ijvm/tests/A/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/out/ijvm/tests/A/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/A.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/Token.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bin/ijvm/tests/AImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/out/ijvm/tests/AImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/AImpl.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/InfiniteResurrecter.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/TokenImpl.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/out/ijvm/tests/Alarm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/Alarm.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/out/ijvm/tests/AlarmController/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/AlarmWatchDog.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/out/ijvm/tests/AlarmImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v1.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v1.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/out/ijvm/tests/AlarmImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v2.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v2.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bin/ijvm/tests/B/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bin/ijvm/tests/BImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/out/ijvm/tests/B/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/out/ijvm/tests/BImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/B.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/BImpl.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bin/ijvm/tests/BundleMgmtStress/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/out/ijvm/tests/BundleMgmtStress/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bin/ijvm/tests/C/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/out/ijvm/tests/C/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/C.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bin/ijvm/tests/CImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/out/ijvm/tests/CImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/CImpl.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bin/ijvm/tests/D/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bin/ijvm/tests/DImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/out/ijvm/tests/D/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/out/ijvm/tests/DImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/D.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/DImpl.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.bundle-pack (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.project (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bin/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bin/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bin/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bin/ijvm/tests/Runner/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bundle.manifest (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/out/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/out/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/out/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/out/ijvm/tests/Runner/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Activator.java (with props) vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Runner.java (with props) vmkit/branches/incinerator/incinerator/tests/java-grant-all.policy (with props) vmkit/branches/incinerator/incinerator/tests/minimal.bug.xargs (with props) vmkit/branches/incinerator/incinerator/tests/minimal.http.xargs (with props) vmkit/branches/incinerator/incinerator/tests/minimal.xargs (with props) vmkit/branches/incinerator/incinerator/tests/resurrection/ vmkit/branches/incinerator/incinerator/tests/resurrection/.classpath (with props) vmkit/branches/incinerator/incinerator/tests/resurrection/.project (with props) vmkit/branches/incinerator/incinerator/tests/resurrection/bin/ vmkit/branches/incinerator/incinerator/tests/resurrection/bin/resurrection/ vmkit/branches/incinerator/incinerator/tests/resurrection/src/ vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/ vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrect.java (with props) vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrected.java (with props) Added: vmkit/branches/incinerator/incinerator/README.TXT URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/README.TXT?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/README.TXT (added) +++ vmkit/branches/incinerator/incinerator/README.TXT Mon Jun 10 11:15:21 2013 @@ -0,0 +1,115 @@ +============= +Requirements: +============= + +* Install required packages (Debian): +apt-get install ant antlr libgconf2-dev libgtk2.0-dev sharutils + +* Install required packages (SUSE): +zypper install ant gconf2-devel gtk2-devel + +* If you want to use OpenJDK: +apt-get install default-jre default-jdk + +============== +GNU Classpath: +============== + +wget http://ftp.gnu.org/gnu/classpath/classpath-0.99.tar.gz +tar zxf classpath-0.99.tar.gz +ln -s classpath-0.99 classpath +cd classpath +./configure --disable-plugin --disable-examples --disable-Werror +make -j12 +cd lib +ln -sf ../native/jni/gtk-peer/.libs/libgtkpeer.so +ln -sf ../native/jni/gconf-peer/.libs/libgconfpeer.so +ln -sf ../native/jni/java-io/.libs/libjavaio.so +ln -sf ../native/jni/java-lang/.libs/libjavalangreflect.so +ln -sf ../native/jni/java-lang/.libs/libjavalang.so +ln -sf ../native/jni/java-net/.libs/libjavanet.so +ln -sf ../native/jni/java-nio/.libs/libjavanio.so +ln -sf ../native/jni/java-util/.libs/libjavautil.so + +* Go root +cd classpath +sudo make install +sudo ldconfig + +===== +LLVM: +===== + +* Get it (git): + +git clone http://llvm.org/git/llvm.git +cd llvm/tools +git clone http://llvm.org/git/clang.git +cd ../projects +git clone http://llvm.org/git/compiler-rt.git +cd compiler-rt +git config branch.master.rebase true +cd ../../tools/clang +git config branch.master.rebase true +cd ../.. +git config branch.master.rebase true + +* You can also get it via svn: + +svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm +cd llvm/tools +svn co http://llvm.org/svn/llvm-project/cfe/trunk clang +cd ../projects +svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt +cd .. + +* Patch it: + +cd llvm +patch -p1 < ../ijvm/patches/llvm.patch + +* Make it (release mode): + +./configure --enable-optimized --enable-assertions --enable-jit --enable-threads --enable-pthreads --enable-pic --enable-targets=host,cpp --disable-docs --disable-doxygen +make -j12 ENABLE_OPTIMIZED=1 BUILD_EXAMPLES=0 ENABLE_DOCS=0 +ln -s Release+Asserts Debug+Asserts + +* You can also make it in debug mode, but this is is not necessary to debug compiled programs: + +./configure --disable-optimized --enable-assertions --enable-debug-runtime --enable-debug-symbols --enable-keep-symbols --enable-jit --enable-threads --enable-pthreads --enable-pic --enable-targets=x86,cpp --disable-docs --disable-doxygen +make -j12 ENABLE_OPTIMIZED=0 BUILD_EXAMPLES=0 ENABLE_DOCS=0 + +====== +VMKit: +====== + +* Get it (git): + +git clone git://scm.gforge.inria.fr/vmkit2/vmkit2.git -b ijvm ijvm +or: +git clone git+ssh://YOUR_USER_NAME at scm.gforge.inria.fr//gitroot/vmkit2/vmkit2.git -b ijvm ijvm +* You can also get it via svn: + +svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit + +* Make it (debug mode): + +./configure --enable-incinerator --with-mmtk-plan=org.mmtk.plan.marksweep.MS --with-llvmsrc=/home/koutheir/PhD/VMKit/llvm --with-llvmobj=/home/koutheir/PhD/VMKit/llvm --with-gnu-classpath-libs=/home/koutheir/PhD/VMKit/classpath/lib --with-gnu-classpath-glibj=/home/koutheir/PhD/VMKit/classpath/lib/glibj.zip +./configure --enable-incinerator --with-mmtk-plan=org.mmtk.plan.immix.Immix --with-llvmsrc=/home/koutheir/PhD/VMKit/llvm --with-llvmobj=/home/koutheir/PhD/VMKit/llvm --with-gnu-classpath-libs=/home/koutheir/PhD/VMKit/classpath/lib --with-gnu-classpath-glibj=/home/koutheir/PhD/VMKit/classpath/lib/glibj.zip +make -j12 ENABLE_OPTIMIZED=0 REQUIRES_FRAME_POINTER=1 KEEP_SYMBOLS=1 DEBUG_RUNTIME=1 DEBUG_SYMBOLS=1 + +./configure --with-mmtk-plan=org.mmtk.plan.marksweep.MS --with-llvmsrc=/home/koutheir/PhD/VMKit/llvm --with-llvmobj=/home/koutheir/PhD/VMKit/llvm/build.x86 --with-gnu-classpath-libs=/home/koutheir/PhD/VMKit/classpath-0.99/build.x86/lib --with-gnu-classpath-glibj=/home/koutheir/PhD/VMKit/classpath-0.99/build.x86/lib/glibj.zip +./configure --enable-incinerator --with-mmtk-plan=org.mmtk.plan.marksweep.MS --with-llvmsrc=/home/koutheir/PhD/VMKit/llvm --with-llvmobj=/home/koutheir/PhD/VMKit/llvm/build.x86 --with-gnu-classpath-libs=/home/koutheir/PhD/VMKit/classpath-0.99/build.x86/lib --with-gnu-classpath-glibj=/home/koutheir/PhD/VMKit/classpath-0.99/build.x86/lib/glibj.zip + +============= +Knopflerfish: +============= + +* Apply patch: +cd knopflerfish +patch -p1 < ../ijvm/knopflerfish.patch +cd .. + +* Recompile Knopflerfish: +cd knopflerfish/osgi +ant default Propchange: vmkit/branches/incinerator/incinerator/README.TXT ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/knopflerfish.patch URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/knopflerfish.patch?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/knopflerfish.patch (added) +++ vmkit/branches/incinerator/incinerator/knopflerfish.patch Mon Jun 10 11:15:21 2013 @@ -0,0 +1,29 @@ +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 +@@ -0,0 +1,6 @@ ++package j3.vm; ++ ++public class OSGi ++{ ++ public static native void associateBundleClass(long bundleID, Class classObject); ++} +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; + } Propchange: vmkit/branches/incinerator/incinerator/knopflerfish.patch ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/osgi/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/osgi/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/osgi/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/osgi/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/.classpath (added) +++ vmkit/branches/incinerator/incinerator/osgi/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/osgi/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/osgi/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/osgi/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/.project (added) +++ vmkit/branches/incinerator/incinerator/osgi/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + j3mgr + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/osgi/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/osgi/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/osgi/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/osgi/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-Vendor: Koutheir Attouchi +Bundle-Version: 1.0.0 +Bundle-Name: J3 Virtual Machine Manager +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: j3mgr +Bundle-Activator: j3mgr.Activator +Export-Package: j3 +Import-Package: org.osgi.framework, org.osgi.service.packageadmin + Propchange: vmkit/branches/incinerator/incinerator/osgi/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/osgi/src/j3/J3Mgr.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/src/j3/J3Mgr.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/src/j3/J3Mgr.java (added) +++ vmkit/branches/incinerator/incinerator/osgi/src/j3/J3Mgr.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,20 @@ +package j3; + +public interface J3Mgr +{ + public void setBundleStaleReferenceCorrected( + long bundleID, boolean corrected) throws Throwable; + public boolean isBundleStaleReferenceCorrected( + long bundleID) throws Throwable; + + // THE FOLLOWING METHODS ARE DEBUGGING HELPERS + // THEY SHOULD BE REMOVED IN PRODUCTION + + public void dumpClassLoaderBundles() throws Throwable; + public void dumpReferencesToObject(String obj_address) throws Throwable; + public void setBundleStaleReferenceCorrected( + String bundleNameOrID, String corrected) throws Throwable; + public void isBundleStaleReferenceCorrected( + String bundleNameOrID) throws Throwable; + public void forceStaleReferenceScanning() throws Throwable; +} Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3/J3Mgr.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3/J3Mgr.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: 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=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java (added) +++ vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,15 @@ +package j3.vm; + +public class OSGi +{ + // OSGi hooks and information gathering + public static native void associateBundleClass(long bundleID, Class classObject); + public static native void notifyBundleUninstalled(long bundleID); + + // Commands + public static native void setBundleStaleReferenceCorrected(long bundleID, boolean corrected); + public static native boolean isBundleStaleReferenceCorrected(long bundleID); + public static native void dumpClassLoaderBundles(); + public static native void dumpReferencesToObject(long obj); + public static native void forceStaleReferenceScanning(); +} Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3/vm/OSGi.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,28 @@ +package j3mgr; + +import j3.J3Mgr; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator + implements BundleActivator +{ + J3MgrImpl mgr; + + public void start(BundleContext bundleContext) throws Exception + { + mgr = new J3MgrImpl(); + mgr.open(bundleContext); + + bundleContext.registerService(J3Mgr.class.getName(), mgr, null); + } + + public void stop(BundleContext bundleContext) throws Exception + { + if (mgr != null) { + mgr.close(); + mgr = null; + } + } +} Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/J3MgrImpl.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/J3MgrImpl.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/J3MgrImpl.java (added) +++ vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/J3MgrImpl.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,137 @@ +package j3mgr; + +import j3.J3Mgr; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleEvent; +import org.osgi.framework.BundleListener; +import org.osgi.framework.ServiceReference; +import org.osgi.service.packageadmin.PackageAdmin; + +public class J3MgrImpl + implements J3Mgr, BundleListener +{ + BundleContext context; + + public void open(BundleContext bundleContext) + { + context = bundleContext; + + context.addBundleListener(this); + } + + public void close() + { + context.removeBundleListener(this); + context = null; + } + + public void setBundleStaleReferenceCorrected( + long bundleID, boolean corrected) throws Throwable + { + j3.vm.OSGi.setBundleStaleReferenceCorrected(bundleID, corrected); + + if (!corrected || (context.getBundle(bundleID) != null)) + return; // Bundle ignored, or still installed + + // Inexistent bundle to be corrected, probably uninstalled, + // Notify the VM now. + j3.vm.OSGi.notifyBundleUninstalled(bundleID); + refreshFramework(); + } + + public boolean isBundleStaleReferenceCorrected( + long bundleID) throws Throwable + { + return j3.vm.OSGi.isBundleStaleReferenceCorrected(bundleID); + } + + public void bundleChanged(BundleEvent event) + { + if (event.getType() != BundleEvent.UNINSTALLED) return; + + try { + refreshFramework(); + j3.vm.OSGi.notifyBundleUninstalled(event.getBundle().getBundleId()); + } catch (Throwable e) {} + } + + void refreshFramework() + { + ServiceReference pkgAdminRef = + (ServiceReference)context.getServiceReference( + "org.osgi.service.packageadmin.PackageAdmin"); + PackageAdmin pkgAdmin = (PackageAdmin)context.getService(pkgAdminRef); + pkgAdmin.refreshPackages(null); + context.ungetService(pkgAdminRef); + } + + // THE FOLLOWING METHODS ARE DEBUGGING HELPERS + // THEY SHOULD BE REMOVED IN PRODUCTION + + public void setBundleStaleReferenceCorrected( + String bundleNameOrID, String corrected) throws Throwable + { + long bundleID = getBundleID(bundleNameOrID); + if (bundleID == -1) throw new IllegalArgumentException(bundleNameOrID); + + setBundleStaleReferenceCorrected(bundleID, corrected.equals("yes")); + } + + public void isBundleStaleReferenceCorrected( + String bundleNameOrID) throws Throwable + { + long bundleID = getBundleID(bundleNameOrID); + if (bundleID == -1) throw new IllegalArgumentException(bundleNameOrID); + + boolean value = isBundleStaleReferenceCorrected(bundleID); + System.out.println( + "isBundleStaleReferenceCorrected(bundleID=" + bundleID + ") = " + + (value ? "yes" : "no")); + } + + long getBundleID(String symbolicNameOrID) + { + try { + long bundleID = Long.parseLong(symbolicNameOrID); + + if (context.getBundle(bundleID) == null) { + System.out.println( + "WARNING: bundleID=" + bundleID + + " is invalid, probably already uninstalled."); + } + + return (bundleID < 0) ? -1 : bundleID; + } catch (NumberFormatException e) { + // This is not a bundle ID, it must be a symbolic name + } + + Bundle[] bundles = context.getBundles(); + for (int i=0; i < bundles.length; ++i) { + if (symbolicNameOrID.equals(bundles[i].getSymbolicName())) + return bundles[i].getBundleId(); + } + return -1; + } + + public void dumpClassLoaderBundles() throws Throwable + { + j3.vm.OSGi.dumpClassLoaderBundles(); + } + + public void dumpReferencesToObject(String obj_address) throws Throwable + { + long obj = 0; + if (obj_address.startsWith("0x")) + obj_address = obj_address.substring(2); + obj = Long.parseLong(obj_address, 16); + + j3.vm.OSGi.dumpReferencesToObject(obj); + } + + public void forceStaleReferenceScanning() throws Throwable + { + j3.vm.OSGi.forceStaleReferenceScanning(); + } +} Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/J3MgrImpl.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/osgi/src/j3mgr/J3MgrImpl.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/AnnotationClassTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/AnnotationClassTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/AnnotationClassTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/AnnotationClassTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,51 @@ +import java.lang.Deprecated; +import java.lang.annotation.Annotation; +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * Created with IntelliJ IDEA. + * User: inti + * Date: 11/14/12 + * Time: 11:08 PM + * To change this template use File | Settings | File Templates. + */ +public class AnnotationClassTest { + + static class Sample { + @Deprecated + @MyAnnotation (property=5) + public int x; + + @MyAnnotation (property=5) + public int y() { + return x*x; + } + } + + public static void main(String[] args) throws Exception { + Field f = Sample.class.getField("x"); + Method m = Sample.class.getMethod("y"); + Sample sample = new Sample(); + sample.x = 14; + + f.getDeclaredAnnotations(); + + MyAnnotation xx = (MyAnnotation)f.getAnnotation(MyAnnotation.class); + MyAnnotation yy = (MyAnnotation)f.getAnnotation(MyAnnotation.class); + + + + check(f.getInt(sample) == 14); + f.setInt(sample, 17); + check(f.getInt(sample) == 17); + check(xx != null); + check(yy != null); + //int s = yy.property(); + //check(s == 5); + } + + private static void check(boolean b) throws Exception { + if (!b) throw new Exception("Test failed!!!"); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/AnnotationClassTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/AnnotationClassTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + BundleReloader + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-Vendor: Koutheir Attouchi +Bundle-Version: 1.0.0 +Bundle-Name: BundleReloader +Bundle-ManifestVersion: 2 +Bundle-Activator: BundleReloader.Activator +Import-Package: org.osgi.framework, org.osgi.service.packageadmin +Bundle-SymbolicName: BundleReloader +Bundle-RequiredExecutionEnvironment: OSGi/Minimum-1.0 + Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,33 @@ +package BundleReloader; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator + implements BundleActivator +{ + static final String target_bundle = "file:///home/koutheir/PhD/VMKit/knopflerfish/osgi/jars/http/http_all-3.1.2.jar"; + static final boolean reinstall_is_update = true; + static final boolean stale_ref_elimination = false; + + BundleContext context; + SameBundleReloader reloader; + //ScanningBundleReloader reloader; + + public void start(BundleContext context) throws Exception + { + this.context = context; + + reloader = new SameBundleReloader(context, reinstall_is_update, stale_ref_elimination, target_bundle); + //reloader = new ScanningBundleReloader(context); + reloader.start(); + } + + public void stop(BundleContext context) throws Exception + { + reloader.stop(); + reloader = null; + + this.context = null; + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/BundleReloader.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/BundleReloader.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/BundleReloader.java (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/BundleReloader.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,119 @@ +package BundleReloader; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.osgi.service.packageadmin.PackageAdmin; + +public class BundleReloader +{ + final BundleContext context; + final boolean on_incinerator, stale_ref_elimination, reinstall_is_update; + + ServiceReference pkg_admin_ref; + PackageAdmin pkg_admin; + + public BundleReloader(BundleContext context, boolean reinstall_is_update, boolean stale_ref_elimination) + { + this.context = context; + this.reinstall_is_update = reinstall_is_update; + this.stale_ref_elimination = stale_ref_elimination; + + pkg_admin_ref = context.getServiceReference( + "org.osgi.service.packageadmin.PackageAdmin"); + pkg_admin = (PackageAdmin)context.getService(pkg_admin_ref); + + on_incinerator = isRunningOnIncinerator(); + System.out.println("Running on Incinerator: " + (on_incinerator ? "yes" : "no")); + } + + protected void finalize() + { + context.ungetService(pkg_admin_ref); + } + + public void reinstallBundle(String bundle_location) throws Throwable + { + Bundle[] bundles = new Bundle[] { + context.installBundle(bundle_location) + }; + + long bundleID = bundles[0].getBundleId(); + try { + bundles[0].start(); + Thread.sleep(100); + + if (on_incinerator) + j3.vm.OSGi.setBundleStaleReferenceCorrected(bundleID, stale_ref_elimination); + + bundles[0].stop(); + bundles[0].uninstall(); + + pkg_admin.refreshPackages(bundles); + System.gc(); + + if (on_incinerator) + j3.vm.OSGi.notifyBundleUninstalled(bundleID); + } catch (Throwable e) { + try { + bundles[0].uninstall(); + pkg_admin.refreshPackages(bundles); + } catch (Exception ignore) {} + + throw e; + } + } + + public Bundle startBundleUpdating(String bundle_location) throws Exception + { + Bundle bundle = context.installBundle(bundle_location); + bundle.start(); + Thread.sleep(300); + + if (on_incinerator) + j3.vm.OSGi.setBundleStaleReferenceCorrected(bundle.getBundleId(), stale_ref_elimination); + + return bundle; + } + + public void updateBundle(Bundle[] bundles) throws Throwable + { + Throwable updateException = null; + for (int retry = 10; retry > 0; --retry) { + try { + bundles[0].update(); + + updateException = null; + retry = 0; + } catch (IllegalStateException e) { + updateException = e; + Thread.sleep(500); + } + } + + if (updateException != null) + throw updateException; + + pkg_admin.refreshPackages(bundles); + Thread.sleep(200); + System.gc(); + } + + public void installBundle(String bundle_location) throws Exception + { + context.installBundle(bundle_location); + } + + boolean isRunningOnIncinerator() + { + boolean r = false; + try { + j3.vm.OSGi.isBundleStaleReferenceCorrected( + context.getBundle().getBundleId()); + r = true; + } + catch (UnsatisfiedLinkError ignore) {} + catch (Throwable ignore) {r = true;} + return r; + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/BundleReloader.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/BundleReloader.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/SameBundleReloader.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/SameBundleReloader.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/SameBundleReloader.java (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/SameBundleReloader.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,105 @@ +package BundleReloader; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; + +public class SameBundleReloader + implements Runnable +{ + final BundleContext context; + final Thread worker; + final boolean reinstall_is_update; + final String bundle_path; + + BundleReloader reloader; + + volatile boolean cancelWork; + volatile long loopCount; + + public SameBundleReloader(BundleContext context, boolean reinstall_is_update, boolean stale_ref_elimination, String bundle_path) + { + this.context = context; + this.reinstall_is_update = reinstall_is_update; + this.bundle_path = bundle_path; + + reloader = new BundleReloader(context, reinstall_is_update, stale_ref_elimination); + + cancelWork = true; + worker = new Thread(this, "SameBundleReloader"); + } + + public void start() + { + cancelWork = false; + worker.start(); + } + + public void stop() throws Exception + { + if (cancelWork) return; + + cancelWork = true; + worker.join(); + } + + public void run() + { + if (runInit()) + runTask(); + runTerm(); + } + + boolean runInit() + { + System.out.println(reinstall_is_update ? + "Bundle update running..." : + "Bundle reinstallation running..."); + + try {Thread.sleep(5000);} + catch (Exception e) {} + + return !cancelWork; + } + + void runTask() + { + if (reinstall_is_update) + runTaskUpdate(); + else + runTaskReinstall(); + } + + void runTerm() + { + cancelWork = true; + System.out.println("Bundle reinstallation done. Count: " + loopCount); + } + + void runTaskUpdate() + { + Bundle[] bundles = new Bundle[1]; + try { + bundles[0] = reloader.startBundleUpdating(bundle_path); + + for (loopCount = 0; !cancelWork; ++loopCount) + reloader.updateBundle(bundles); + } catch (Throwable e) { + e.printStackTrace(); + } + + if (bundles[0] != null) { + //try {bundles[0].uninstall();} + //catch (Throwable e) {e.printStackTrace();} + } + } + + void runTaskReinstall() + { + try { + for (loopCount = 0; !cancelWork; ++loopCount) + reloader.reinstallBundle(bundle_path); + } catch (Throwable e) { + e.printStackTrace(); + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/SameBundleReloader.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/SameBundleReloader.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ScanningBundleReloader.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ScanningBundleReloader.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ScanningBundleReloader.java (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ScanningBundleReloader.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,86 @@ +package BundleReloader; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; + +public class ScanningBundleReloader + implements Runnable +{ + final BundleContext context; + final Thread worker; + + BundleReloader reloader; + + volatile boolean cancelWork; + volatile long currentBundleID; + + public ScanningBundleReloader(BundleContext context) + { + this.context = context; + currentBundleID = context.getBundle().getBundleId(); + + reloader = new BundleReloader(context, true, true); + + cancelWork = true; + worker = new Thread(this, "ScanningBundleReloader"); + } + + public void start() + { + cancelWork = false; + worker.start(); + } + + public void stop() throws Exception + { + if (cancelWork) return; + + cancelWork = true; + worker.join(); + } + + public void run() + { + if (runInit()) + runTask(); + runTerm(); + } + + boolean runInit() + { + System.out.println("Bundle update running..."); + + try {Thread.sleep(1000);} + catch (Exception e) {} + + return !cancelWork; + } + + void runTask() + { + Bundle[] bundles = new Bundle[1]; + try { + for (bundles[0] = getNextBundle(); + (bundles[0] != null) && (!cancelWork); + bundles[0] = getNextBundle()) + { + System.out.println("Bundle update: #" + currentBundleID + " (" + bundles[0].getSymbolicName() + ")"); + reloader.updateBundle(bundles); + Thread.sleep(4000); + } + } catch (Throwable e) { + e.printStackTrace(); + } + } + + void runTerm() + { + cancelWork = true; + System.out.println("Bundle reinstallation done."); + } + + Bundle getNextBundle() + { + return context.getBundle(++currentBundleID); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ScanningBundleReloader.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/BundleReloader/ScanningBundleReloader.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/OSGi.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/OSGi.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/OSGi.java (added) +++ vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/OSGi.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,13 @@ +package j3.vm; + +public class OSGi +{ + // OSGi hooks and information gathering + public static native void associateBundleClass(long bundleID, Class classObject); + public static native void notifyBundleUninstalled(long bundleID); + + // Commands + public static native void setBundleStaleReferenceCorrected(long bundleID, boolean corrected); + public static native boolean isBundleStaleReferenceCorrected(long bundleID); + public static native void dumpClassLoaderBundles(); +} Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/OSGi.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/BundleReloader/src/j3/vm/OSGi.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/FieldWriteTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/FieldWriteTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/FieldWriteTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/FieldWriteTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,28 @@ +import java.lang.Thread; + +public class FieldWriteTest { + static class FieldWriterThread extends Thread { + boolean val = false; + + FieldWriterThread() { super(); } + + public void run() { + val = true; + } + } + + public static void check(boolean b) throws Exception { + if (!b) throw new Exception("Check failed!"); + } + + public static void main(String[] args) throws Exception { + for (int i = 0; i < 100; ++i) { + FieldWriterThread t = new FieldWriterThread(); + t.start(); + check(t.isAlive()); + t.join(); // Synchronization point! + check(!t.isAlive()); + check(t.val); + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/FieldWriteTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/FieldWriteTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/InstanceOfThisTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/InstanceOfThisTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/InstanceOfThisTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/InstanceOfThisTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,27 @@ +public class InstanceOfThisTest { + public static void main(String[] args) { + new A().maybeFoo(); + new B().maybeFoo(); + new C().maybeFoo(); + } + + static class A { + void maybeFoo() { + if (this instanceof B) + ((B)this).foo(); + } + } + + static class B extends A { + void foo() { + System.out.println("B!"); + } + } + + static class C extends B { + void foo() { + System.out.println("C!"); + } + } +} + Propchange: vmkit/branches/incinerator/incinerator/tests/InstanceOfThisTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/InstanceOfThisTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/InvokeFinalizerTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/InvokeFinalizerTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/InvokeFinalizerTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/InvokeFinalizerTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,5 @@ +public class InvokeFinalizerTest { + public static void main(String[] args) throws Throwable { + new InvokeFinalizerTest().finalize(); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/InvokeFinalizerTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/InvokeFinalizerTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/LshlTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/LshlTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/LshlTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/LshlTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,15 @@ +class LshlTest { + public static void check(boolean b) throws Exception { + if (!b) throw new Exception("Check failed!"); + } + + public static void main(String[] args) throws Exception { + long l = 1; + check(l == 1); + check(l << 10 == 1024); + check(l << 32 == 4294967296L); + check(l << 64 == 1); + check(l << 128 == 1); + check(l << -10 == 18014398509481984L); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/LshlTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/LshlTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/LshrTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/LshrTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/LshrTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/LshrTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,15 @@ +class LshrTest { + public static void check(boolean b) throws Exception { + if (!b) throw new Exception("Check failed!"); + } + + public static void main(String[] args) throws Exception { + long l = 1; + check(l == 1); + check(l >> 10 == 0); + check(l >> 32 == 0); + check(l >> 64 == 1); + check(l >> 128 == 1); + check(l >> -10 == 0); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/LshrTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/LshrTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/MyAnnotation.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/MyAnnotation.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/MyAnnotation.java (added) +++ vmkit/branches/incinerator/incinerator/tests/MyAnnotation.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,6 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + at Retention(RetentionPolicy.RUNTIME) +public @interface MyAnnotation { + int property(); +} Propchange: vmkit/branches/incinerator/incinerator/tests/MyAnnotation.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/MyAnnotation.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ThisReferenceTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ThisReferenceTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ThisReferenceTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ThisReferenceTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,18 @@ +public class ThisReferenceTest { + public static void main(String[] args) { + try { + new ThisReferenceTest().foo(); + } catch (NullPointerException e) { + } + } + + public void foo() { + Nested other = null; + other.bar(this, 2L); + } + + public static class Nested { + public void bar(ThisReferenceTest other, long l) { + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ThisReferenceTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ThisReferenceTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ThreadTest.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ThreadTest.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ThreadTest.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ThreadTest.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ +public class ThreadTest extends Thread { + public void run() { + // Nothing + } + + public static void main(String[] args) throws InterruptedException { + int count = 10000; + try { + count = Integer.parseInt(args[0]); + } + catch (Exception e) { + } + for(int i = 0; i < count ; ++i) { + Thread t1 = new ThreadTest(); + Thread t2 = new ThreadTest(); + t1.start(); + t2.start(); + + t1.join(); + t2.join(); + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ThreadTest.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ThreadTest.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/benchmarks.odt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/benchmarks.odt?rev=183676&view=auto ============================================================================== Binary file - no diff available. Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/benchmarks.odt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/benchmarks.odt ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/bytes.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/bytes.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/bytes.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/bytes.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,22 @@ +#!/bin/bash + +. ./float.sh + +# Converts size from some size unit to bytes unit. +function get_size_in_bytes() +{ + local size=$1 + local number=$(echo "$size" | cut -d ' ' -f 1) + local unit=$(echo "$size" | cut -d ' ' -f 2) + local factor=1 + + case $unit in + B ) factor=1 ;; + kB ) factor=1024 ;; + mB ) factor=1048576 ;; + gB ) factor=1073741824 ;; + tB ) factor=1099511627776 ;; + esac + + float_eval "$number * $factor" +} Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/bytes.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-demo.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-demo.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-demo.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-demo.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,70 @@ +Framework launched +AImpl provides A +BImpl exports and provides B +BImpl got A @ startup +BImpl got Token from A +CImpl exports and provides C +CImpl got B @ startup +AImpl got C +DImpl exports and provides D +DImpl got C @ startup +> bundles + id level/state name + -------------------- + 11 1/active A 13 1/active A Implementation + 14 1/active B Implementation 10 1/active J3 Virtual Machine Manager + 12 1/active C 15 1/active C Implementation + 16 1/active D Implementation + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb4e53e98 bundleID=11 +classLoader=0xb50b5ac0 bundleID=12 +classLoader=0xb5056070 bundleID=13 +classLoader=0xb4e13a68 bundleID=14 +classLoader=0xb4b06f38 bundleID=15 +classLoader=0xb4bcd178 bundleID=16 +> stop 13 +AImpl no more provides A +AImpl lost C but keeps a stale reference to it +BImpl lost A but keeps a stale reference to it +Stopped: A Implementation (#13) +> framework uninstall 13 +Uninstalled: A Implementation (#13) +> framework refresh +> framework meminfo -gc +Total: 0 Free: 0 Max: 0 (kB) +> stop 14 +BImpl no more provides B +BImpl lost A but keeps a stale reference to it +CImpl lost B but keeps a stale reference to it +Stopped: B Implementation (#14) +> framework uninstall 14 +Uninstalled: B Implementation (#14) +> framework refresh +CImpl no more provides C +CImpl lost B but keeps a stale reference to it +DImpl lost C but keeps a stale reference to it +> framework meminfo -gc +Total: 0 Free: 0 Max: 0 (kB) +> stop 15 +Stopped: C Implementation (#15) +> framework uninstall 15 +Uninstalled: C Implementation (#15) +> framework refresh +> framework meminfo -gc +Total: 0 Free: 0 Max: 0 (kB) +> bundles + id level/state name + -------------------- + 11 1/active A 10 1/active J3 Virtual Machine Manager + 12 1/active C 16 1/active D Implementation + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb4e53e98 bundleID=11 +classLoader=0xb50b5ac0 bundleID=12 +classLoader=0xb5056070 bundleID=13 +classLoader=0xb4e13a68 bundleID=14 +classLoader=0xb4b06f38 bundleID=15 +classLoader=0xb4bcd178 bundleID=16 \ No newline at end of file Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-demo.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-demo.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-sol.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-sol.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-sol.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-sol.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,86 @@ +Framework launched +AImpl provides A +BImpl exports and provides B +BImpl got A @ startup +BImpl got Token from A +CImpl exports and provides C +CImpl got B @ startup +AImpl got C +DImpl exports and provides D +DImpl got C @ startup +> bundles + id level/state name + -------------------- + 11 1/active A 13 1/active A Implementation + 14 1/active B Implementation 10 1/active J3 Virtual Machine Manager + 12 1/active C 15 1/active C Implementation + 16 1/active D Implementation + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb60cc280 bundleID=11 +classLoader=0xb6389478 bundleID=12 +classLoader=0xb63bd550 bundleID=13 +classLoader=0xb63709a0 bundleID=14 +classLoader=0xb61558d8 bundleID=15 +classLoader=0xb5e1c120 bundleID=16 +> framework call j3.J3Mgr resetReferencesToBundle ijvm.tests.AImpl +resetReferencesToBundle: #13 ijvm.tests.AImpl +Stopping bundle: ijvm.tests.AImpl +AImpl no more provides A +AImpl lost C but keeps a stale reference to it +BImpl lost A but keeps a stale reference to it +Uninstalling bundle: ijvm.tests.AImpl +Refreshing framework... +Result: null +Resetting stale references to bundle #13 +Resetting ref=0x50bebfa4 obj=0x514a57f4(class=ijvm/tests/AImpl/Activator) source=0x50bebf9c(class=[Ljava/lang/Object;) +Resetting ref=0x50beb888 obj=0x50370c74(class=ijvm/tests/AImpl/TokenImpl) source=0x50beb880(class=[Ljava/lang/Object;) +Resetting ref=0x50beb854 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) source=0x50beb84c(class=[Ljava/lang/Object;) +WARNING: Source object is stale source=0x50370c74(class=ijvm/tests/AImpl/TokenImpl) +WARNING: Source object is stale source=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x515d2ef4 obj=0x514a57f4(class=ijvm/tests/AImpl/Activator) source=0x515d2eec(class=org/knopflerfish/framework/ServiceListenerEntry) +WARNING: Ignored stale reference ref=0x5158139c obj=0x503709a4(class=j3::VMClassLoader,loader=0xb691d798,javaLoader=0x51581384,javaClass=org/knopflerfish/framework/BundleClassLoader) source=0x51581384(class=org/knopflerfish/framework/BundleClassLoader) +Bundle class loader unloaded, bundleID=13 +> framework call j3.J3Mgr resetReferencesToBundle ijvm.tests.BImpl +resetReferencesToBundle: #14 ijvm.tests.BImpl +Stopping bundle: ijvm.tests.BImpl +BImpl no more provides B +BImpl lost A but keeps a stale reference to it +CImpl lost B but keeps a stale reference to it +Uninstalling bundle: ijvm.tests.BImpl +Refreshing framework... +Result: null +CImpl no more provides C +CImpl lost B but keeps a stale reference to it +DImpl lost C but keeps a stale reference to it +Resetting stale references to bundle #14 +WARNING: Ignored stale reference ref=0x5158145c obj=0x50370b6c(class=j3::VMClassLoader,loader=0xb6a79a30,javaLoader=0x51581444,javaClass=org/knopflerfish/framework/BundleClassLoader) source=0x51581444(class=org/knopflerfish/framework/BundleClassLoader) +Resetting ref=0x50bebd34 obj=0x50006194(class=ijvm/tests/BImpl/BImpl) source=0x50bebd2c(class=[Ljava/lang/Object;) +WARNING: Source object is stale source=0x50006194(class=ijvm/tests/BImpl/BImpl) +Resetting ref=0x5160358c obj=0x5160331c(class=ijvm/tests/BImpl/Activator) source=0x51603584(class=org/knopflerfish/framework/ServiceListenerEntry) +> framework call j3.J3Mgr resetReferencesToBundle ijvm.tests.CImpl +resetReferencesToBundle: #15 ijvm.tests.CImpl +Stopping bundle: ijvm.tests.CImpl +Uninstalling bundle: ijvm.tests.CImpl +Refreshing framework... +Result: null +Resetting stale references to bundle #15 +Resetting ref=0x50013f70 obj=0x50370e54(class=ijvm/tests/CImpl/CImpl) source=0x50013f68(class=[Ljava/lang/Object;) +WARNING: Source object is stale source=0x50370e54(class=ijvm/tests/CImpl/CImpl) +WARNING: Source object is stale source=0x50370e54(class=ijvm/tests/CImpl/CImpl) +WARNING: Ignored stale reference ref=0x5158151c obj=0x50370d58(class=j3::VMClassLoader,loader=0xb61558d8,javaLoader=0x51581504,javaClass=org/knopflerfish/framework/BundleClassLoader) source=0x51581504(class=org/knopflerfish/framework/BundleClassLoader) +WARNING: Ignored stale reference ref=0x5158145c obj=0x50370b6c(class=j3::VMClassLoader,loader=0xb63709a0,javaLoader=0x51581444,javaClass=org/knopflerfish/framework/BundleClassLoader) source=0x51581444(class=org/knopflerfish/framework/BundleClassLoader) +Bundle class loader unloaded, bundleID=15 +Bundle class loader unloaded, bundleID=14 +> bundles + id level/state name + -------------------- + 11 1/active A 10 1/active J3 Virtual Machine Manager + 12 1/active C 16 1/active D Implementation + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb60cc280 bundleID=11 +classLoader=0xb6389478 bundleID=12 +classLoader=0xb5e1c120 bundleID=16 \ No newline at end of file Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-sol.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-cascaded-leak-sol.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-demo.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-demo.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-demo.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-demo.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,36 @@ +Framework launched +AImpl provides A +CImpl exports and provides C +AImpl got C +> bundles + id level/state name + -------------------- + 12 1/active C 13 1/active A Implementation + 15 1/active C Implementation 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb4c803c8 bundleID=12 +classLoader=0xb4c7a780 bundleID=13 +... +classLoader=0xb4c71868 bundleID=15 +> stop 13 +AImpl no more provides A +AImpl lost C but keeps a stale reference to it +Stopped: A Implementation (#13) +> framework uninstall 13 +Uninstalled: A Implementation (#13) +> framework refresh +> framework meminfo -gc +Total: 0 Free: 0 Max: 0 (kB) +> bundles + id level/state name + -------------------- + 12 1/active C 15 1/active C Implementation + 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +classLoader=0xb4c803c8 bundleID=12 +classLoader=0xb4c7a780 bundleID=13 +... +classLoader=0xb4c71868 bundleID=15 Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-demo.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-demo.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-sol.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-sol.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-sol.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-sol.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,40 @@ +Framework launched +AImpl provides A +CImpl exports and provides C +AImpl got C +> bundles + id level/state name + -------------------- + 12 1/active C 13 1/active A Implementation + 15 1/active C Implementation 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb56330b8 bundleID=12 +classLoader=0xb58afe78 bundleID=13 +... +classLoader=0xb5a4d8c8 bundleID=15 +> framework call j3.J3Mgr resetReferencesToBundle ijvm.tests.AImpl +resetReferencesToBundle: #13 ijvm.tests.AImpl +Stopping bundle: ijvm.tests.AImpl +AImpl no more provides A +AImpl lost C but keeps a stale reference to it +Uninstalling bundle: ijvm.tests.AImpl +Refreshing framework... +Result: null +Resetting stale references to bundle #13 +Resetting ref=0x5144e034 obj=0x514a50ec(class=ijvm/tests/AImpl/Activator) source=0x5144e02c(class=[Ljava/lang/Object;) +WARNING: Source object is stale source=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x515f420c obj=0x514a50ec(class=ijvm/tests/AImpl/Activator) source=0x515f4204(class=org/knopflerfish/framework/ServiceListenerEntry) +WARNING: Ignored stale reference ref=0x5158339c obj=0x503719ec(class=j3::VMClassLoader,loader=0xb58afe78,javaLoader=0x51583384,javaClass=org/knopflerfish/framework/BundleClassLoader) source=0x51583384(class=org/knopflerfish/framework/BundleClassLoader) +Bundle class loader unloaded, bundleID=13 +> bundles + id level/state name + -------------------- + 12 1/active C 15 1/active C Implementation + 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +classLoader=0xb56330b8 bundleID=12 +... +classLoader=0xb5a4d8c8 bundleID=15 \ No newline at end of file Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-sol.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-registration-leak-sol.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-demo.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-demo.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-demo.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-demo.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,38 @@ +Framework launched +AImpl provides A +BImpl exports and provides B +BImpl got A @ startup +BImpl got Token from A +> bundles + id level/state name + -------------------- + 11 1/active A 13 1/active A Implementation + 14 1/active B Implementation 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb6621458 bundleID=11 +... +classLoader=0xb6f42b68 bundleID=13 +classLoader=0xb654e3b8 bundleID=14 +... +> stop 13 +AImpl no more provides A +... +BImpl lost A but keeps a stale reference to it +Stopped: A Implementation (#13) +> framework uninstall 13 +Uninstalled: A Implementation (#13) +> framework refresh +> framework meminfo -gc +Total: 0 Free: 0 Max: 0 (kB) +> bundles + id level/state name + -------------------- + 11 1/active A 14 1/active B Implementation + 10 1/active J3 Virtual Machine Manager +> framework call j3.J3Mgr dumpClassLoaderBundles +classLoader=0xb6621458 bundleID=11 +... +classLoader=0xb6f42b68 bundleID=13 +classLoader=0xb654e3b8 bundleID=14 \ No newline at end of file Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-demo.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-demo.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-sol.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-sol.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-sol.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-sol.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,45 @@ +Framework launched +AImpl provides A +BImpl exports and provides B +BImpl got A @ startup +BImpl got Token from A +> bundles + id level/state name + -------------------- + 11 1/active A 13 1/active A Implementation + 14 1/active B Implementation 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb4391f0 bundleID=11 +... +classLoader=0xb413318 bundleID=13 +classLoader=0xb503a30 bundleID=14 +... +> framework call j3.J3Mgr resetReferencesToBundle ijvm.tests.AImpl +resetReferencesToBundle: #13 ijvm.tests.AImpl +Stopping bundle: ijvm.tests.AImpl +AImpl no more provides A +... +BImpl lost A but keeps a stale reference to it +Uninstalling bundle: ijvm.tests.AImpl +Refreshing framework... +... +Resetting stale references to bundle #13 +Resetting ref=0x502a7d9c obj=0x50372cb0(class=ijvm/tests/AImpl/TokenImpl) source=0x502a7d94(class=[Ljava/lang/Object;) +Resetting ref=0x502a7d68 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) source=0x502a7d60(class=[Ljava/lang/Object;) +WARNING: Source object is stale source=0x50372cb0(class=ijvm/tests/AImpl/TokenImpl) +WARNING: Source object is stale source=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x515f420c obj=0x514a50a4(class=ijvm/tests/AImpl/Activator) source=0x515f4204(class=org/knopflerfish/framework/ServiceListenerEntry) +WARNING: Ignored stale reference ref=0x5158339c obj=0x503729e0(class=j3::VMClassLoader,loader=0xb413318,javaLoader=0x51583384,javaClass=org/knopflerfish/framework/BundleClassLoader) source=0x51583384(class=org/knopflerfish/framework/BundleClassLoader) +Bundle class loader unloaded, bundleID=13 +> bundles + id level/state name + -------------------- + 11 1/active A 14 1/active B Implementation + 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +classLoader=0xb4391f0 bundleID=11 +... +classLoader=0xb503a30 bundleID=14 \ No newline at end of file Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-sol.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-simple-leak-sol.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-demo.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-demo.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-demo.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-demo.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,48 @@ +Framework launched +AImpl provides A +Started runner bundle. +Runner bundle got A @ startup. +Started runner thread: Runner 2 +Started runner thread: Runner 1 +Runner 2: sleeping for 2792 +Runner 2: woke up +Runner 1: sleeping for 2580 +Runner 1: woke up +Runner 2: sleeping for 2704 +... +> bundles + id level/state name + -------------------- + 11 1/active A 13 1/active A Implementation + 17 1/active Runner 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb4939af0 bundleID=11 +... +classLoader=0xb4b4adf0 bundleID=13 +classLoader=0xb4bfdb08 bundleID=17 +> stop 13 +AImpl no more provides A +... +Stopped: A Implementation (#13) +> framework uninstall 13 +Uninstalled: A Implementation (#13) +> framework refresh +> framework meminfo -gc +Total: 0 Free: 0 Max: 0 (kB) +> bundles + id level/state name + -------------------- + 11 1/active A 14 1/installed B Implementation + 17 1/active Runner 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +classLoader=0xb4939af0 bundleID=11 +... +classLoader=0xb4b4adf0 bundleID=13 +classLoader=0xb4bfdb08 bundleID=17 +Runner 1: sleeping for 2398 +Runner 1: woke up +Runner 2: sleeping for 2627 +... \ No newline at end of file Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-demo.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-demo.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-sol.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-sol.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-sol.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-sol.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,70 @@ +Framework launched +AImpl provides A +Started runner bundle. +Runner bundle got A @ startup. +Started runner thread: Runner 2 +Started runner thread: Runner 1 +Runner 2: sleeping for 2792 +Runner 2: woke up +Runner 1: sleeping for 2580 +Runner 1: woke up +Runner 2: sleeping for 2704 +... +> bundles + id level/state name + -------------------- + 11 1/active A 13 1/active A Implementation + 17 1/active Runner 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb16fdb8 bundleID=11 +... +classLoader=0xc563de8 bundleID=13 +classLoader=0xc80f440 bundleID=17 +> framework call j3.J3Mgr resetReferencesToBundle ijvm.tests.AImpl +resetReferencesToBundle: #13 ijvm.tests.AImpl +Stopping bundle: ijvm.tests.AImpl +AImpl no more provides A +AImpl lost C but keeps a stale reference to it +Uninstalling bundle: ijvm.tests.AImpl +Refreshing framework... +Result: null +Resetting stale references to bundle #13 +Resetting ref=0x109fef04 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x108febe4 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x108fece8 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x108fee00 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x108fee14 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x108fef04 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x108fef00 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x108feefc obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0xb6812160 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x50016228 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) source=0x5001621c(class=ijvm/tests/Runner/Activator) +Resetting ref=0x50009518 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) source=0x50009514(class=ijvm/tests/Runner/Runner) +Resetting ref=0x50009478 obj=0x50006184(class=ijvm/tests/AImpl/AImpl) source=0x50009474(class=ijvm/tests/Runner/Runner) +WARNING: Source object is stale source=0x50006184(class=ijvm/tests/AImpl/AImpl) +Resetting ref=0x515f420c obj=0x514a502c(class=ijvm/tests/AImpl/Activator) source=0x515f4204(class=org/knopflerfish/framework/ServiceListenerEntry) +WARNING: Ignored stale reference ref=0x5158339c obj=0x503709d4(class=j3::VMClassLoader,loader=0xc563de8,javaLoader=0x51583384,javaClass=org/knopflerfish/framework/BundleClassLoader) source=0x51583384(class=org/knopflerfish/framework/BundleClassLoader) +Runner 2: woke up +Bundle class loader unloaded, bundleID=13 +Exception in thread "Runner 1" java.lang.NullPointerException + at ijvm.tests.Runner.Runner.run(Runner.java:44) + at java.lang.Thread.run(Thread.java:745) + at java.lang.VMThread.run(VMThread.java:120) +Stopped runner thread: Runner 2 +java.lang.NullPointerException + at ijvm.tests.Runner.Runner.run(Runner.java:28) + at java.lang.Thread.run(Thread.java:745) + at java.lang.VMThread.run(VMThread.java:120) +> bundles + id level/state name + -------------------- + 11 1/active A 17 1/active Runner + 10 1/active J3 Virtual Machine Manager + ... +> framework call j3.J3Mgr dumpClassLoaderBundles +... +classLoader=0xb16fdb8 bundleID=11 +... +classLoader=0xc80f440 bundleID=17 Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-sol.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/demo/console-thread-leak-sol.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/float.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/float.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/float.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/float.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,36 @@ +#/bin/bash + +float_scale=2 + +# Evaluate then output an equation into a float number with $float_scale precision. +function float_eval() +{ + local stat=0 + local result=0.0 + + if [[ $# -gt 0 ]]; then + result=$(echo "scale=$float_scale; $*"|bc -q 2>/dev/null) + stat=$? + + if [[ "$stat" -eq 0 && -z "$result" ]]; then stat=1; fi + fi + + echo -n $result + return $stat +} + +# Evaluate an equation into a condition. +function float_cond() +{ + local cond=0 + + if [[ $# -gt 0 ]]; then + cond=$(echo "$*"|bc -q 2>/dev/null) + + if [[ -z "$cond" ]]; then cond=0; fi + if [[ "$cond" != 0 && "$cond" != 1 ]]; then cond=0; fi + fi + + local stat=$(($cond == 0)) + return $stat +} Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/float.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref-corrected.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref-corrected.csv?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref-corrected.csv (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref-corrected.csv Mon Jun 10 11:15:21 2013 @@ -0,0 +1,107 @@ +#Time,PID,%usr,%system,%guest,%CPU,CPU,minflt/s,majflt/s,VSZ,RSS,%MEM,Command +00:00,17993,0.00,0.00,0.00,0.00,7,0.00,0.00,1156292,99424,0.80,j3 +00:01,17993,0.00,0.00,0.00,0.00,7,0.00,0.00,1156292,99424,0.80,j3 +00:02,17993,0.00,0.00,0.00,0.00,7,0.00,0.00,1156292,99424,0.80,j3 +00:03,17993,0.00,0.00,0.00,0.00,7,0.00,0.00,1156292,99424,0.80,j3 +00:04,17993,0.00,0.00,0.00,0.00,7,0.00,0.00,1156292,99424,0.80,j3 +00:05,17993,26.00,0.00,0.00,26.00,10,223.00,0.00,1157012,100020,0.80,j3 +00:06,17993,99.00,0.00,0.00,99.00,10,151.00,0.00,1157428,100548,0.81,j3 +00:07,17993,89.00,1.00,0.00,90.00,11,1202.00,0.00,1159168,102484,0.82,j3 +00:08,17993,78.00,1.00,0.00,79.00,11,1168.00,0.00,1159168,102592,0.82,j3 +00:09,17993,78.00,3.00,0.00,81.00,11,1168.00,0.00,1159168,102440,0.82,j3 +00:10,17993,77.00,2.00,0.00,79.00,11,1168.00,0.00,1159168,102552,0.82,j3 +00:11,17993,78.00,1.00,0.00,79.00,11,1168.00,0.00,1159168,102400,0.82,j3 +00:12,17993,78.00,2.00,0.00,80.00,11,1040.00,0.00,1158656,101984,0.82,j3 +00:13,17993,79.00,1.00,0.00,80.00,11,1168.00,0.00,1158656,101832,0.82,j3 +00:14,17993,78.00,2.00,0.00,80.00,11,1295.00,0.00,1159168,102504,0.82,j3 +00:15,17993,78.00,1.00,0.00,79.00,11,1167.00,0.00,1159168,102352,0.82,j3 +00:16,17993,79.00,1.00,0.00,80.00,11,1167.00,0.00,1159168,102728,0.82,j3 +00:17,17993,78.00,2.00,0.00,80.00,11,1168.00,0.00,1159168,102576,0.82,j3 +00:18,17993,78.00,2.00,0.00,80.00,11,1168.00,0.00,1159168,102688,0.82,j3 +00:19,17993,79.00,1.00,0.00,80.00,11,1184.00,0.00,1159232,102536,0.82,j3 +00:20,17993,77.00,3.00,0.00,80.00,11,1168.00,0.00,1159232,102648,0.82,j3 +00:21,17993,78.00,1.00,0.00,79.00,11,1168.00,0.00,1159232,102496,0.82,j3 +00:22,17993,34.00,2.00,0.00,36.00,11,440.00,0.00,1158656,102024,0.82,j3 +00:23,17993,74.00,2.00,0.00,76.00,11,1166.00,0.00,1159232,102452,0.82,j3 +00:24,17993,77.00,2.00,0.00,79.00,11,1167.00,0.00,1159232,102564,0.82,j3 +00:25,17993,77.00,2.00,0.00,79.00,11,1167.00,0.00,1159232,102676,0.82,j3 +00:26,17993,78.00,2.00,0.00,80.00,11,1168.00,0.00,1159232,102788,0.82,j3 +00:27,17993,78.00,2.00,0.00,80.00,10,1167.00,0.00,1159232,102636,0.82,j3 +00:28,17993,78.00,2.00,0.00,80.00,10,1168.00,0.00,1159232,102484,0.82,j3 +00:29,17993,78.00,2.00,0.00,80.00,10,1168.00,0.00,1159232,102596,0.82,j3 +00:30,17993,78.00,1.00,0.00,79.00,10,1152.00,0.00,1159168,102444,0.82,j3 +00:31,17993,77.00,2.00,0.00,79.00,10,1178.00,0.00,1159300,102580,0.82,j3 +00:32,17993,76.00,3.00,0.00,79.00,11,1187.00,0.00,1159300,102476,0.82,j3 +00:33,17993,78.00,2.00,0.00,80.00,11,1188.00,0.00,1159432,102636,0.82,j3 +00:34,17993,79.00,1.00,0.00,80.00,11,1188.00,0.00,1159564,102796,0.82,j3 +00:35,17993,77.00,2.00,0.00,79.00,11,1188.00,0.00,1159564,102692,0.82,j3 +00:36,17993,79.00,1.00,0.00,80.00,11,1060.00,0.00,1159760,103164,0.83,j3 +00:37,17993,77.00,2.00,0.00,79.00,11,1186.00,0.00,1159760,103056,0.83,j3 +00:38,17993,77.00,2.00,0.00,79.00,11,1188.00,0.00,1159896,103216,0.83,j3 +00:39,17993,76.00,3.00,0.00,79.00,11,1186.00,0.00,1160028,103112,0.83,j3 +00:40,17993,79.00,1.00,0.00,80.00,8,1188.00,0.00,1160028,103272,0.83,j3 +00:41,17993,77.00,2.00,0.00,79.00,8,1187.00,0.00,1160160,103168,0.83,j3 +00:42,17993,78.00,2.00,0.00,80.00,8,1188.00,0.00,1160160,103592,0.83,j3 +00:43,17993,78.00,2.00,0.00,80.00,9,1188.00,0.00,1160292,103488,0.83,j3 +00:44,17993,77.00,2.00,0.00,79.00,9,1188.00,0.00,1160424,103912,0.83,j3 +00:45,17993,78.00,2.00,0.00,80.00,9,1188.00,0.00,1160424,103808,0.83,j3 +00:46,17993,77.00,2.00,0.00,79.00,9,1188.00,0.00,1160556,103704,0.83,j3 +00:47,17993,79.00,1.00,0.00,80.00,9,1186.00,0.00,1160556,103860,0.83,j3 +00:48,17993,79.00,1.00,0.00,80.00,9,1187.00,0.00,1160688,103756,0.83,j3 +00:49,17993,76.00,3.00,0.00,79.00,9,1188.00,0.00,1160820,103916,0.83,j3 +00:50,17993,77.00,2.00,0.00,79.00,9,1188.00,0.00,1160820,104076,0.83,j3 +00:51,17993,78.00,3.00,0.00,81.00,9,1188.00,0.00,1160952,104236,0.84,j3 +00:52,17993,77.00,2.00,0.00,79.00,9,1187.00,0.00,1160952,104396,0.84,j3 +00:53,17993,62.00,2.00,0.00,64.00,9,893.00,0.00,1160508,103808,0.83,j3 +00:54,17993,50.00,2.00,0.00,52.00,9,870.00,0.00,1161020,104368,0.84,j3 +00:55,17993,78.00,1.00,0.00,79.00,9,1060.00,0.00,1160644,104000,0.83,j3 +00:56,17993,77.00,1.00,0.00,78.00,10,1188.00,0.00,1161220,104472,0.84,j3 +00:57,17993,77.00,2.00,0.00,79.00,10,1186.00,0.00,1161352,104632,0.84,j3 +00:58,17993,78.00,2.00,0.00,80.00,10,1186.00,0.00,1161484,104528,0.84,j3 +00:59,17993,77.00,3.00,0.00,80.00,10,1187.00,0.00,1161484,104684,0.84,j3 +01:00,17993,79.00,1.00,0.00,80.00,10,1187.00,0.00,1161616,104844,0.84,j3 +01:01,17993,77.00,2.00,0.00,79.00,10,1172.00,0.00,1161552,105004,0.84,j3 +01:02,17993,77.00,2.00,0.00,79.00,10,1187.00,0.00,1161684,105164,0.84,j3 +01:03,17993,77.00,3.00,0.00,80.00,10,1059.00,0.00,1161880,105108,0.84,j3 +01:04,17993,76.00,3.00,0.00,79.00,10,1187.00,0.00,1161880,105268,0.84,j3 +01:05,17993,76.00,2.00,0.00,78.00,10,1187.00,0.00,1162016,105160,0.84,j3 +01:06,17993,78.00,2.00,0.00,80.00,10,1185.00,0.00,1162016,105056,0.84,j3 +01:07,17993,78.00,2.00,0.00,80.00,11,1188.00,0.00,1162148,105480,0.85,j3 +01:08,17993,76.00,4.00,0.00,80.00,11,1172.00,0.00,1162084,105376,0.84,j3 +01:09,17993,75.00,4.00,0.00,79.00,11,1188.00,0.00,1162216,105800,0.85,j3 +01:10,17993,78.00,1.00,0.00,79.00,11,1060.00,0.00,1162412,105744,0.85,j3 +01:11,17993,77.00,1.00,0.00,78.00,11,1186.00,0.00,1162412,105900,0.85,j3 +01:12,17993,78.00,1.00,0.00,79.00,11,1188.00,0.00,1162544,105796,0.85,j3 +01:13,17993,78.00,2.00,0.00,80.00,11,1185.00,0.00,1162544,105692,0.85,j3 +01:14,17993,78.00,3.00,0.00,81.00,11,1188.00,0.00,1162676,105852,0.85,j3 +01:15,17993,78.00,2.00,0.00,80.00,11,1188.00,0.00,1162808,105748,0.85,j3 +01:16,17993,77.00,2.00,0.00,79.00,11,1172.00,0.00,1162744,106172,0.85,j3 +01:17,17993,78.00,1.00,0.00,79.00,11,1060.00,0.00,1162364,105540,0.85,j3 +01:18,17993,77.00,2.00,0.00,79.00,11,1188.00,0.00,1162940,106540,0.85,j3 +01:19,17993,76.00,3.00,0.00,79.00,11,1186.00,0.00,1163072,106432,0.85,j3 +01:20,17993,80.00,1.00,0.00,81.00,11,1188.00,0.00,1163204,106328,0.85,j3 +01:21,17993,78.00,2.00,0.00,80.00,11,1187.00,0.00,1163204,106488,0.85,j3 +01:22,17993,76.00,3.00,0.00,79.00,11,1188.00,0.00,1163340,106384,0.85,j3 +01:23,17993,79.00,1.00,0.00,80.00,11,1186.00,0.00,1163340,106544,0.85,j3 +01:24,17993,78.00,2.00,0.00,80.00,11,1188.00,0.00,1163472,106704,0.86,j3 +01:25,17993,78.00,2.00,0.00,80.00,11,1188.00,0.00,1163604,106864,0.86,j3 +01:26,17993,78.00,3.00,0.00,81.00,11,1186.00,0.00,1163604,107020,0.86,j3 +01:27,17993,78.00,2.00,0.00,80.00,11,1188.00,0.00,1163736,107180,0.86,j3 +01:28,17993,78.00,2.00,0.00,80.00,11,1185.00,0.00,1163736,107076,0.86,j3 +01:29,17993,77.00,2.00,0.00,79.00,10,1187.00,0.00,1163868,107236,0.86,j3 +01:30,17993,32.00,0.00,0.00,32.00,10,446.00,0.00,1163868,107100,0.86,j3 +01:31,17993,76.00,4.00,0.00,80.00,10,1171.00,0.00,1163936,106996,0.86,j3 +01:32,17993,77.00,1.00,0.00,78.00,10,1186.00,0.00,1163936,107152,0.86,j3 +01:33,17993,77.00,2.00,0.00,79.00,10,1059.00,0.00,1164136,107360,0.86,j3 +01:34,17993,79.00,1.00,0.00,80.00,10,1188.00,0.00,1164268,107520,0.86,j3 +01:35,17993,78.00,1.00,0.00,79.00,10,1186.00,0.00,1164268,107680,0.86,j3 +01:36,17993,76.00,3.00,0.00,79.00,10,1185.00,0.00,1164400,107840,0.86,j3 +01:37,17993,80.00,1.00,0.00,81.00,10,1188.00,0.00,1164400,107736,0.86,j3 +01:38,17993,78.00,2.00,0.00,80.00,10,1186.00,0.00,1164532,107892,0.87,j3 +01:39,17993,77.00,2.00,0.00,79.00,10,1172.00,0.00,1164468,107788,0.86,j3 +01:40,17993,77.00,3.00,0.00,80.00,11,1188.00,0.00,1164600,107684,0.86,j3 +01:41,17993,77.00,2.00,0.00,79.00,11,1059.00,0.00,1164796,108156,0.87,j3 +01:42,17993,77.00,2.00,0.00,79.00,11,1188.00,0.00,1164796,108052,0.87,j3 +01:43,17993,78.00,2.00,0.00,80.00,11,1186.00,0.00,1164928,108208,0.87,j3 +01:44,17993,77.00,2.00,0.00,79.00,9,1188.00,0.00,1164928,108368,0.87,j3 +01:45,17993,78.00,2.00,0.00,80.00,9,1185.00,0.00,1165060,108528,0.87,j3 Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref-corrected.csv ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.csv URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.csv?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.csv (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.csv Mon Jun 10 11:15:21 2013 @@ -0,0 +1,107 @@ +#Time,PID,%usr,%system,%guest,%CPU,CPU,minflt/s,majflt/s,VSZ,RSS,%MEM,Command +00:00,16914,0.00,0.00,0.00,0.00,1,0.00,0.00,1158780,102464,0.82,j3 +00:01,16914,0.00,0.00,0.00,0.00,1,0.00,0.00,1158780,102464,0.82,j3 +00:02,16914,34.00,0.00,0.00,34.00,1,216.00,0.00,1159356,103068,0.83,j3 +00:03,16914,95.00,0.00,0.00,95.00,1,298.00,0.00,1160508,104388,0.84,j3 +00:04,16914,73.00,2.00,0.00,75.00,1,2968.00,0.00,1172468,116000,0.93,j3 +00:05,16914,75.00,0.00,0.00,75.00,1,3006.00,0.00,1184476,128144,1.03,j3 +00:06,16914,75.00,1.00,0.00,76.00,1,3009.00,0.00,1196580,140024,1.12,j3 +00:07,16914,74.00,2.00,0.00,76.00,1,3009.00,0.00,1208544,152168,1.22,j3 +00:08,16914,75.00,1.00,0.00,76.00,1,3008.00,0.00,1220632,164048,1.32,j3 +00:09,16914,74.00,2.00,0.00,76.00,1,3006.00,0.00,1232592,176188,1.41,j3 +00:10,16914,75.00,2.00,0.00,77.00,1,3008.00,0.00,1244708,188064,1.51,j3 +00:11,16914,75.00,0.00,0.00,75.00,1,2910.00,0.00,1256504,199680,1.60,j3 +00:12,16914,73.00,2.00,0.00,75.00,1,2810.00,0.00,1267896,211292,1.69,j3 +00:13,16914,75.00,2.00,0.00,77.00,1,3005.00,0.00,1279800,223168,1.79,j3 +00:14,16914,76.00,1.00,0.00,77.00,1,2940.00,0.00,1291640,235048,1.88,j3 +00:15,16914,74.00,1.00,0.00,75.00,1,2780.00,0.00,1303032,246132,1.97,j3 +00:16,16914,77.00,2.00,0.00,79.00,1,3006.00,0.00,1314936,258008,2.07,j3 +00:17,16914,74.00,1.00,0.00,75.00,1,2713.00,0.00,1326264,268832,2.16,j3 +00:18,16914,75.00,3.00,0.00,78.00,1,3007.00,0.00,1338168,280976,2.25,j3 +00:19,16914,73.00,2.00,0.00,75.00,1,2727.00,0.00,1348472,291800,2.34,j3 +00:20,16914,77.00,1.00,0.00,78.00,1,2944.00,0.00,1360312,303680,2.44,j3 +00:21,16914,76.00,1.00,0.00,77.00,1,2770.00,0.00,1371704,314768,2.52,j3 +00:22,16914,77.00,0.00,0.00,77.00,1,2711.00,0.00,1383032,325588,2.61,j3 +00:23,16914,75.00,2.00,0.00,77.00,1,2710.00,0.00,1393336,336408,2.70,j3 +00:24,16914,28.00,1.00,0.00,29.00,1,1201.00,0.00,1398712,341156,2.74,j3 +00:25,16914,73.00,3.00,0.00,76.00,1,2711.00,0.00,1409016,351980,2.82,j3 +00:26,16914,77.00,0.00,0.00,77.00,1,2707.00,0.00,1420344,362804,2.91,j3 +00:27,16914,76.00,2.00,0.00,78.00,1,2709.00,0.00,1430648,373628,3.00,j3 +00:28,16914,75.00,2.00,0.00,77.00,1,2710.00,0.00,1441976,384448,3.08,j3 +00:29,16914,77.00,1.00,0.00,78.00,1,2710.00,0.00,1452280,395536,3.17,j3 +00:30,16914,76.00,1.00,0.00,77.00,1,2706.00,0.00,1463608,406360,3.26,j3 +00:31,16914,73.00,5.00,0.00,78.00,1,2706.00,0.00,1473912,417184,3.35,j3 +00:32,16914,75.00,2.00,0.00,77.00,1,2703.00,0.00,1485240,428004,3.43,j3 +00:33,16914,77.00,3.00,0.00,80.00,1,2729.00,0.00,1495544,438824,3.52,j3 +00:34,16914,75.00,2.00,0.00,77.00,1,2728.00,0.00,1506872,449648,3.61,j3 +00:35,16914,76.00,2.00,0.00,78.00,1,2583.00,0.00,1517112,459944,3.69,j3 +00:36,16914,76.00,1.00,0.00,77.00,1,2594.00,0.00,1526904,470504,3.77,j3 +00:37,16914,77.00,2.00,0.00,79.00,1,2731.00,0.00,1538232,481328,3.86,j3 +00:38,16914,78.00,1.00,0.00,79.00,1,2689.00,0.00,1548472,492152,3.95,j3 +00:39,16914,76.00,1.00,0.00,77.00,1,2490.00,0.00,1558264,501916,4.02,j3 +00:40,16914,76.00,3.00,0.00,79.00,1,2735.00,0.00,1569592,512740,4.11,j3 +00:41,16914,76.00,2.00,0.00,78.00,1,2436.00,0.00,1579320,522772,4.19,j3 +00:42,16914,76.00,2.00,0.00,78.00,1,2723.00,0.00,1589624,533596,4.28,j3 +00:43,16914,78.00,2.00,0.00,80.00,1,2635.00,0.00,1600888,544156,4.36,j3 +00:44,16914,75.00,3.00,0.00,78.00,1,2531.00,0.00,1610680,554188,4.44,j3 +00:45,16914,78.00,1.00,0.00,79.00,1,2571.00,0.00,1620920,564484,4.53,j3 +00:46,16914,78.00,1.00,0.00,79.00,1,2602.00,0.00,1630712,575040,4.61,j3 +00:47,16914,77.00,1.00,0.00,78.00,1,2413.00,0.00,1640440,584544,4.69,j3 +00:48,16914,78.00,2.00,0.00,80.00,1,2653.00,0.00,1651704,595100,4.77,j3 +00:49,16914,76.00,2.00,0.00,78.00,1,2458.00,0.00,1661496,605132,4.85,j3 +00:50,16914,78.00,2.00,0.00,80.00,1,2408.00,0.00,1671224,614636,4.93,j3 +00:51,16914,75.00,4.00,0.00,79.00,1,2412.00,0.00,1680952,624140,5.00,j3 +00:52,16914,79.00,0.00,0.00,79.00,1,2610.00,0.00,1691192,634700,5.09,j3 +00:53,16914,79.00,1.00,0.00,80.00,1,2441.00,0.00,1700920,644468,5.17,j3 +00:54,16914,78.00,2.00,0.00,80.00,1,2416.00,0.00,1710648,653964,5.24,j3 +00:55,16914,78.00,1.00,0.00,79.00,1,2427.00,0.00,1720376,663728,5.32,j3 +00:56,16914,79.00,0.00,0.00,79.00,1,2394.00,0.00,1730104,673232,5.40,j3 +00:57,16914,78.00,2.00,0.00,80.00,1,2376.00,0.00,1738808,682736,5.47,j3 +00:58,16914,78.00,2.00,0.00,80.00,1,2211.00,0.00,1748024,691712,5.55,j3 +00:59,16914,77.00,0.00,0.00,77.00,1,2405.00,0.00,1757752,701216,5.62,j3 +01:00,16914,79.00,1.00,0.00,80.00,1,2406.00,0.00,1767480,710984,5.70,j3 +01:01,16914,41.00,0.00,0.00,41.00,1,1203.00,0.00,1771832,715736,5.74,j3 +01:02,16914,80.00,1.00,0.00,81.00,1,2401.00,0.00,1781560,725504,5.82,j3 +01:03,16914,78.00,2.00,0.00,80.00,1,2408.00,0.00,1791288,735272,5.90,j3 +01:04,16914,78.00,2.00,0.00,80.00,1,2110.00,0.00,1799416,743452,5.96,j3 +01:05,16914,77.00,2.00,0.00,79.00,1,2406.00,0.00,1809144,753220,6.04,j3 +01:06,16914,78.00,2.00,0.00,80.00,1,2404.00,0.00,1818872,762720,6.12,j3 +01:07,16914,80.00,1.00,0.00,81.00,1,2355.00,0.00,1828536,772224,6.19,j3 +01:08,16914,77.00,3.00,0.00,80.00,1,2161.00,0.00,1837752,780932,6.26,j3 +01:09,16914,78.00,2.00,0.00,80.00,1,2404.00,0.00,1846456,790436,6.34,j3 +01:10,16914,81.00,0.00,0.00,81.00,1,2306.00,0.00,1856120,799668,6.41,j3 +01:11,16914,79.00,0.00,0.00,79.00,1,2213.00,0.00,1865336,808376,6.48,j3 +01:12,16914,79.00,3.00,0.00,82.00,1,2400.00,0.00,1875064,818144,6.56,j3 +01:13,16914,78.00,1.00,0.00,79.00,1,2110.00,0.00,1883192,826592,6.63,j3 +01:14,16914,81.00,1.00,0.00,82.00,1,2405.00,0.00,1892920,836096,6.70,j3 +01:15,16914,79.00,1.00,0.00,80.00,1,2106.00,0.00,1901048,844544,6.77,j3 +01:16,16914,81.00,0.00,0.00,81.00,1,2405.00,0.00,1910776,854048,6.85,j3 +01:17,16914,77.00,2.00,0.00,79.00,1,2109.00,0.00,1918904,862496,6.92,j3 +01:18,16914,79.00,4.00,0.00,83.00,1,2333.00,0.00,1928568,871736,6.99,j3 +01:19,16914,78.00,1.00,0.00,79.00,1,2175.00,0.00,1937784,880448,7.06,j3 +01:20,16914,80.00,2.00,0.00,82.00,1,2113.00,0.00,1945912,888896,7.13,j3 +01:21,16914,81.00,1.00,0.00,82.00,1,2339.00,0.00,1955576,898400,7.20,j3 +01:22,16914,78.00,2.00,0.00,80.00,1,2163.00,0.00,1963768,907112,7.27,j3 +01:23,16914,81.00,0.00,0.00,81.00,1,2112.00,0.00,1971896,915560,7.34,j3 +01:24,16914,81.00,2.00,0.00,83.00,1,2303.00,0.00,1981560,924796,7.42,j3 +01:25,16914,80.00,1.00,0.00,81.00,1,2205.00,0.00,1990776,933508,7.49,j3 +01:26,16914,78.00,2.00,0.00,80.00,1,2113.00,0.00,1998904,941952,7.55,j3 +01:27,16914,81.00,1.00,0.00,82.00,1,2110.00,0.00,2007032,950400,7.62,j3 +01:28,16914,81.00,2.00,0.00,83.00,1,2104.00,0.00,2016184,958848,7.69,j3 +01:29,16914,80.00,1.00,0.00,81.00,1,2345.00,0.00,2024824,968352,7.76,j3 +01:30,16914,81.00,1.00,0.00,82.00,1,2164.00,0.00,2034040,976800,7.83,j3 +01:31,16914,81.00,0.00,0.00,81.00,1,2108.00,0.00,2042168,985248,7.90,j3 +01:32,16914,41.00,1.00,0.00,42.00,1,905.00,0.00,2045944,988944,7.93,j3 +01:33,16914,78.00,1.00,0.00,79.00,1,2105.00,0.00,2054072,997392,8.00,j3 +01:34,16914,81.00,1.00,0.00,82.00,1,2387.00,0.00,2063736,1006896,8.07,j3 +01:35,16914,81.00,1.00,0.00,82.00,1,2174.00,0.00,2071928,1015604,8.14,j3 +01:36,16914,80.00,0.00,0.00,80.00,1,2123.00,0.00,2081080,1024052,8.21,j3 +01:37,16914,81.00,2.00,0.00,83.00,1,2145.00,0.00,2089208,1032764,8.28,j3 +01:38,16914,79.00,4.00,0.00,83.00,1,2138.00,0.00,2097336,1041204,8.35,j3 +01:39,16914,80.00,1.00,0.00,81.00,1,2129.00,0.00,2106488,1049648,8.42,j3 +01:40,16914,80.00,3.00,0.00,83.00,1,2334.00,0.00,2115128,1059144,8.49,j3 +01:41,16914,81.00,1.00,0.00,82.00,1,2175.00,0.00,2124280,1067856,8.56,j3 +01:42,16914,81.00,1.00,0.00,82.00,1,2185.00,0.00,2132472,1076304,8.63,j3 +01:43,16914,82.00,2.00,0.00,84.00,1,2102.00,0.00,2140536,1084752,8.70,j3 +01:44,16914,80.00,1.00,0.00,81.00,1,2118.00,0.00,2149688,1093464,8.77,j3 +01:45,16914,81.00,2.00,0.00,83.00,1,2176.00,0.00,2157880,1102176,8.84,j3 Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.csv ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.plot URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.plot?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.plot (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.plot Mon Jun 10 11:15:21 2013 @@ -0,0 +1,27 @@ +#!/usr/bin/gnuplot -p + +set datafile separator "," +set datafile missing '_' +set datafile commentschars "#" + +set ylabel "Memory usage (lower is better)" +set ytics border nomirror +set grid ytics +set yrange [0:*] +set format y "%.1s %cB" + +set xtics 15 axis nomirror +set border 3 +set xdata time +set format x "%M:%S" +set timefmt "%M:%S" + +# set title "Stale reference memory leaks in J3 and Incinerator" + +#set term svg +#set term postscript clip 12 +#set term latex +set term wxt 0 +plot \ + 'j3-stale-ref.csv' using 1:(column(11)*1024) linecolor rgb "grey" linewidth "2pt" title "J3" with lines, \ + 'j3-stale-ref-corrected.csv' using 1:(column(11)*1024) linecolor rgb "orange" linewidth "2pt" title "Incinerator" with lines Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/j3-stale-ref.plot ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/mon-process.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/mon-process.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/mon-process.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/mon-process.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,36 @@ +#/bin/bash + +# program & ./mon-process.sh $! + +. ./statistics.sh + +input=$1 +duration=$2 + +if [ 0 -ne "$input" ] 2>/dev/null ; then + # Input is a PID + input_type='-p' +else + # Input is a command name + input_type='-C' +fi + +# Collect statistics data +rawdata="$(sudo nice -n -10 pidstat "$input_type" "$input" -hru 1 $duration)" + +rawdata="$(echo "$rawdata" | grep '^[# 0-9]' | sed 's/^#//g' | sed 's/^ \+//g' | tr -s ' ' ',')" +head="$(echo "$rawdata" | head -1)" +data="$(echo "$rawdata" | grep -v '^[^0-9]')" + +# Rebase time +base_time=$(echo "$data" | head -1 | cut -d ',' -f 1) +timefmt=%M:%S + +echo "#$head" +for i in $data ; do + old_time=$(echo "$i" | cut -d ',' -f 1) + new_time=$(rebase_time_then_format $base_time $timefmt $old_time) + + remaining_data=$(echo "$i" | cut -d ',' -f 2-) + echo "$new_time,$remaining_data" +done Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/mon-process.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/old/monitor_process.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/old/monitor_process.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/old/monitor_process.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/old/monitor_process.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,172 @@ +#/bin/bash + +# ps -ww -o etime:1,pid:1,time:1,%cpu,%mem,rss -C "$1" # |tr -s ' ' ',' + +float_scale=2 +page_size=$(getconf PAGESIZE) +clock_tick=$(getconf CLK_TCK) + +# Evaluate then output an equation into a float number with $float_scale precision. +function float_eval() +{ + local stat=0 + local result=0.0 + + if [[ $# -gt 0 ]]; then + result=$(echo "scale=$float_scale; $*"|bc -q 2>/dev/null) + stat=$? + + if [[ "$stat" -eq 0 && -z "$result" ]]; then stat=1; fi + fi + + echo -n $result + return $stat +} + +# Evaluate an equation into a condition. +function float_cond() +{ + local cond=0 + + if [[ $# -gt 0 ]]; then + cond=$(echo "$*"|bc -q 2>/dev/null) + + if [[ -z "$cond" ]]; then cond=0; fi + if [[ "$cond" != 0 && "$cond" != 1 ]]; then cond=0; fi + fi + + local stat=$(($cond == 0)) + return $stat +} + +# Outputs a PID given a process name. +# If multiple processes of the same program exist, only one PID will be output. +function get_pid_from_name() +{ + local process_name=$1 + + ps --no-headers -ww -o pid:1 -C "$process_name"|head -n 1 + return $? +} + +# Returns the memory data usage in bytes for a PID +function get_memory_data_usage() +{ + local pid=$1 + if [ -z "$pid" ]; then return 1; fi; + + local memory_data_pages=$(cat /proc/$pid/statm 2>/dev/null|cut -d ' ' -f 6) + if [ -z "$memory_data_pages" ]; then return 1; fi; + + float_eval "$memory_data_pages * $page_size" +} + +# Converts size from some size unit to bytes unit. +function get_size_in_bytes() +{ + local size=$1 + local number=$(echo "$size"|cut -d ' ' -f 1) + local unit=$(echo "$size"|cut -d ' ' -f 2) + local factor=1 + + case $unit in + B ) factor=1 ;; + kB ) factor=1024 ;; + mB ) factor=1048576 ;; + gB ) factor=1073741824 ;; + esac + + float_eval "$number * $factor" +} + +# Returns writable memory usage, given a PID. +function get_writable_memory_usage() +{ + local pid=$1 + if [ -z "$pid" ]; then return 1; fi; + + local sum=0 + local oldIFS=$IFS +IFS=' +' + for entry in $(cat /proc/$pid/smaps|tr -s ' '|grep '^Private_Dirty: [^0]'|cut -d ' ' -f '2,3'); do + sum=$(float_eval "$sum + $(get_size_in_bytes $entry)") + done + IFS=oldIFS + + echo $sum +} + +# Returns the CPU time (user+kernel) in seconds, given a PID. +function get_cpu_time() +{ + local pid=$1 + if [ -z "$pid" ]; then return 1; fi; + + local user_time=$(cat /proc/$pid/stat 2>/dev/null|cut -d ' ' -f 14) + if [ -z "$user_time" ]; then return 1; fi; + + local kernel_time=$(cat /proc/$pid/stat 2>/dev/null|cut -d ' ' -f 15) + if [ -z "$kernel_time" ]; then return 1; fi; + + float_eval "($user_time + $kernel_time) / $clock_tick" +} + +# Outputs the CPU average usage, given a PID. +function get_cpu_avg_usage() +{ + local pid=$1 + local avg_period=$2 + local _cpu_avg_usage=$3 + local _last_cpu_time=$4 + local last_cpu_time + + eval last_cpu_time='$'$_last_cpu_time'' + + if [ -z "$pid" ]; then return 1; fi; + + if [ -z "$last_cpu_time" ]; then + last_cpu_time=$(get_cpu_time $pid) + if [ -z "$last_cpu_time" ]; then return 1; fi; + fi; + + local cpu_time=$(get_cpu_time $pid) + if [ -z "$cpu_time" ]; then return 1; fi; + + local cpu_avg_usage=$(float_eval "100 * ( $cpu_time - $last_cpu_time ) / $avg_period") +# local cpu_avg_usage=$(float_eval "$cpu_time - $last_cpu_time"),$(float_eval "100 * ( $cpu_time - $last_cpu_time ) / $avg_period") + + eval $_cpu_avg_usage="'$cpu_avg_usage'" + eval $_last_cpu_time="'$cpu_time'" + return 0 +} + +period= +the_date= +the_last_date=$(date '+%s') +the_last_cpu_time= +the_cpu_avg_usage= + +sleep 1 + +echo "PID,DATE,MEM_DATA,CPU_USAGE" +#echo "DATE,PID,MEM_DATA,CPU_TIME,CPU_TIME_DIFF,CPU_USAGE" + +while true +do + pid=$(get_pid_from_name "$1") + + if [ ! -z "$pid" ]; then + the_date=$(date '+%s') + period=$(($the_date - $the_last_date)) + the_last_date=$the_date + + if [ "$period" -gt "0" ]; then + get_cpu_avg_usage $pid $period the_cpu_avg_usage the_last_cpu_time + +# echo "$(date '+%F %T'),$pid,$(get_writable_memory_usage $pid),$(get_cpu_time $pid),$the_cpu_avg_usage" +# echo "$(date -d "@$the_date" '+%F %T'),$pid,$(get_writable_memory_usage $pid),$the_cpu_avg_usage" + echo "$pid,$the_date,$(get_writable_memory_usage $pid),$the_cpu_avg_usage" + fi; + fi; +done Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/old/monitor_process.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/reinstall-count.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/reinstall-count.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/reinstall-count.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/reinstall-count.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,5 @@ +j3 bundle reinstallation count: 1120 +(1449024-99204)/1120=1205 bytes=1.18 Kilobytes + +Incinerator bundle reinstallation count: 875 +(109096-103240)/875=7 bytes Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/reinstall-count.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/reinstall-count.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/run-dacapo.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/run-dacapo.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/run-dacapo.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/run-dacapo.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,6 @@ +#!/bin/bash + +dacapo_dir=/home/koutheir/PhD/VMKit/vmkit/tests/dacapo/2006-10-MR2 + +cd $dacapo_dir +make ENABLE_IJVM=0 -j12 Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/run-dacapo.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/run-mon-process.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/run-mon-process.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/run-mon-process.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/run-mon-process.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ +#!/bin/bash + +$* & +./mon-process.sh $! Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/run-mon-process.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/scenarios.odt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/scenarios.odt?rev=183676&view=auto ============================================================================== Binary file - no diff available. Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/scenarios.odt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/scenarios.odt ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/statistics.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/statistics.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/statistics.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/statistics.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,68 @@ +#/bin/bash + +. ./float.sh + +# calc_count +# stdin holds one number per line +function calc_count() +{ + local count=0 + + while read i ; do + count=$(($count + 1)) + done + + echo -n $count +} + +# calc_average +# stdin holds one number per line +function calc_average() +{ + local average=0 + local count=0 + + while read i ; do + count=$(($count + 1)) + average=$(float_eval $average + $i) + done + + average=$(float_eval $average / $count) + echo -n $average +} + +# calc_variance $average +# stdin holds one number per line +function calc_variance() +{ + local average=$1 + local count=0 + local variance=0 + + while read i ; do + count=$(($count + 1)) + variance=$(float_eval $variance + '(' $i - $average ')^2' ) + done + + variance=$(float_eval $variance / $count) + echo -n $variance +} + +# calc_standard_deviation $average +# stdin holds one number per line +function calc_standard_deviation() +{ + local average=$1 + float_eval 'sqrt(' $(calc_variance $average) ')' +} + +# rebase_time_then_format $base_time_in_seconds $timefmt $current_time_in_seconds +function rebase_time_then_format() +{ + local base_time=$1 + local timefmt=$2 + local current_time=$3 + + local diff_sec=$(($current_time - $base_time)) + date "+$timefmt" -d "2000-01-01 00:00:00 CET + $diff_sec seconds" +} Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/statistics.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/benchmarks/std-deviation.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/benchmarks/std-deviation.sh?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/benchmarks/std-deviation.sh (added) +++ vmkit/branches/incinerator/incinerator/tests/benchmarks/std-deviation.sh Mon Jun 10 11:15:21 2013 @@ -0,0 +1,17 @@ +#!/bin/bash + +# Compute average, variance, and standard deviation given a list of numbers. + +. ./statistics.sh + +data="$(tr -s ' ' '\n' | tr -s '\n')" + +average=$(echo "$data" | calc_average) +count=$(echo "$data" | calc_count $average) +variance=$(echo "$data" | calc_variance $average) +std_dev=$(echo "$data" | calc_standard_deviation $average) + +echo "count=$count" +echo "average=$average" +echo "variance=$variance" +echo "standard deviation=$std_dev" Propchange: vmkit/branches/incinerator/incinerator/tests/benchmarks/std-deviation.sh ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/debug.txt URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/debug.txt?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/debug.txt (added) +++ vmkit/branches/incinerator/incinerator/tests/debug.txt Mon Jun 10 11:15:21 2013 @@ -0,0 +1,43 @@ +framework call j3.J3Mgr setBundleStaleReferenceCorrected ijvm.tests.AImpl yes +framework call j3.J3Mgr setBundleStaleReferenceCorrected ijvm.tests.BImpl yes +framework call j3.J3Mgr setBundleStaleReferenceCorrected ijvm.tests.CImpl yes +stop 12 +stop 13 +stop 14 + +start 12 13 14 +stop 12 + +framework call j3.J3Mgr isBundleStaleReferenceCorrected 39 +framework call j3.J3Mgr setBundleStaleReferenceCorrected 8 yes + +enter framework +call j3.J3Mgr isBundleStaleReferenceCorrected 14 +call j3.J3Mgr setBundleStaleReferenceCorrected 14 yes +update 14 + +framework call j3.J3Mgr dumpClassLoaderBundles + +stop 8 +uninstall 8 +refresh +meminfo -gc +call j3.J3Mgr setBundleStaleReferenceCorrected 14 yes +call j3.J3Mgr dumpReferencesToObject 0x51934ab4 + +refresh +meminfo -gc + + +enter framework +call j3.J3Mgr setBundleStaleReferenceCorrected 11 no +meminfo -gc +update 11 +refresh +meminfo -gc + +STALE = {http/http_all-3.1.2.jar, useradmin/useradmin_all-3.0.3.jar, device/device_all-3.0.0.jar, kxml/kxml-2.3.0.kf3.jar} + +call j3.J3Mgr forceStaleReferenceScanning + +fromupdate 15 file:/media/Data/Documents/PhD/VMKit/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/out/ijvm.tests.Alarm_v2.0-2.0.0.jar Propchange: vmkit/branches/incinerator/incinerator/tests/debug.txt ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/debug.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,11 @@ + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.A + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: A +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.A +Export-Package: ijvm.tests.A + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/A.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/A.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/A.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/A.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,7 @@ +package ijvm.tests.A; + +public interface A +{ + public void performA(); + public Token getToken(); +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/A.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/A.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/Token.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/Token.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/Token.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/Token.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,6 @@ +package ijvm.tests.A; + +public interface Token +{ + public int getValue(); +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/Token.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.A/src/ijvm/tests/A/Token.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.AImpl + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: AImpl +Bundle-Activator: ijvm.tests.AImpl.Activator +Bundle-ManifestVersion: 2 +Import-Package: ijvm.tests.A, ijvm.tests.C, org.osgi.util.tracker, org + .osgi.framework +Bundle-SymbolicName: ijvm.tests.AImpl + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/AImpl.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/AImpl.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/AImpl.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/AImpl.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,28 @@ +package ijvm.tests.AImpl; + +import java.util.ArrayList; + +import ijvm.tests.A.A; +import ijvm.tests.A.Token; +import ijvm.tests.C.C; + +public class AImpl + implements A +{ + public ArrayList c; + + public AImpl() + { + c = new ArrayList(); + } + + public void performA() + { + System.out.println("AImpl.performA"); + } + + public Token getToken() + { + return new TokenImpl((int)(Math.random() * 100.0)); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/AImpl.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/AImpl.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,97 @@ +package ijvm.tests.AImpl; + +import ijvm.tests.A.A; +import ijvm.tests.C.C; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator + implements BundleActivator, ServiceListener +{ + private BundleContext context; + private ServiceTracker cST; + private AImpl a; + private C c; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println("AImpl provides A"); + context = bundleContext; + + a = new AImpl(); + + cST = new ServiceTracker(context, C.class.getName(), null); + cST.open(); + + C service = (C)cST.getService(); + if (service != null) { + System.out.println("AImpl got C @ startup"); + + a.c.add(service); + this.registerMyself(); + } + + InfiniteResurrecter.class.getName(); + + context.addServiceListener(this, "(objectclass=" + C.class.getName() + ")"); + context.registerService(A.class.getName(), a, null); + } + + public void stop(BundleContext bundleContext) throws Exception + { + System.out.println("AImpl no more provides A"); + + context.removeServiceListener(this); + context = null; + + System.out.println("AImpl lost C but keeps a stale reference to it"); + cST.close(); + cST = null; + + //a = null; + } + + public void serviceChanged(ServiceEvent event) + { + Object service = context.getService(event.getServiceReference()); + + switch(event.getType()) { + case ServiceEvent.REGISTERED: + if (C.class.isInstance(service)) { + System.out.println("AImpl got C"); + a.c.add((C)service); + + this.registerMyself(); + } + break; + + case ServiceEvent.UNREGISTERING: + if (C.class.isInstance(service)) { + System.out.println("AImpl lost C but keeps a stale reference to it"); + } + break; + } + } + + private void registerMyself() + { + C oneC = a.c.get(a.c.size() - 1); + c = oneC; + + oneC.registerObject(this); + } + + protected void finalize() + { + try { + System.out.println(getClass().getName() + ".finalize()"); + new InfiniteResurrecter(c, this); + } catch (Throwable e) { + e.printStackTrace(); + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/InfiniteResurrecter.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/InfiniteResurrecter.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/InfiniteResurrecter.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/InfiniteResurrecter.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,24 @@ +package ijvm.tests.AImpl; + +import ijvm.tests.C.C; + +public class InfiniteResurrecter +{ + C c; + Object target; + + public InfiniteResurrecter(C c, Object o) + { + System.out.println(getClass().getName() + ": resurrecting " + o); + + this.c = c; + this.target = o; + + c.registerObject(this); + } + + protected void finalize() + { + new InfiniteResurrecter(this.c, target); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/InfiniteResurrecter.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/InfiniteResurrecter.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/TokenImpl.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/TokenImpl.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/TokenImpl.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AImpl/src/ijvm/tests/AImpl/TokenImpl.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,34 @@ +package ijvm.tests.AImpl; + +import java.util.ArrayList; + +import ijvm.tests.A.Token; + +public class TokenImpl + implements Token +{ + static final int ChunkSize = 2 * 1024; + static final int ChunkCount = 64; + + ArrayList BigData; + + public TokenImpl(int value) + { + BigData = new ArrayList(); + + for (int i=0; i + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,11 @@ + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.Alarm + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-Vendor: Koutheir Attouchi +Bundle-Version: 1.0.0 +Bundle-Name: ijvm.tests.Alarm +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.Alarm +Export-Package: ijvm.tests.Alarm + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/Alarm.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/Alarm.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/Alarm.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/Alarm.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,18 @@ +package ijvm.tests.Alarm; + +public interface Alarm +{ + public void setState(boolean on); + public boolean state(); + + public void setMinTemperatureThreshold(double value) throws Exception; + public double minTemperatureThreshold(); + + public void setMaxTemperatureThreshold(double value) throws Exception; + public double maxTemperatureThreshold(); + + public void setMaxGazThreshold(double value) throws Exception; + public double maxGazThreshold(); + + public void saveConfig() throws Exception; +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/Alarm.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm/src/ijvm/tests/Alarm/Alarm.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.AlarmController + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-Vendor: Koutheir Attouchi +Bundle-Version: 1.0.0 +Bundle-Name: ijvm.tests.AlarmController +Bundle-ManifestVersion: 2 +Bundle-Activator: ijvm.tests.AlarmController.Activator +Import-Package: ijvm.tests.Alarm, org.osgi.util.tracker, org.osgi.fram + ework +Bundle-SymbolicName: ijvm.tests.AlarmController + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,92 @@ +package ijvm.tests.AlarmController; + +import ijvm.tests.Alarm.Alarm; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator + implements BundleActivator, ServiceListener +{ + BundleContext context; + volatile Alarm alarm; + ServiceTracker alarmServiceTracker; + AlarmWatchDog watchdog; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println(getClass().getName() + " consumes " + Alarm.class.getName()); + context = bundleContext; + + alarmServiceTracker = new ServiceTracker(context, Alarm.class.getName(), null); + alarmServiceTracker.open(); + + alarm = (Alarm)alarmServiceTracker.getService(); + updateWatchDog(); + + context.addServiceListener(this, "(objectclass=" + Alarm.class.getName() + ")"); + } + + public void stop(BundleContext bundleContext) throws Exception + { + if (alarm != null) { + alarm.saveConfig(); + alarm = null; + } + updateWatchDog(); + + context.removeServiceListener(this); + alarmServiceTracker.close(); + + System.out.println(getClass().getName() + " no more consumes " + Alarm.class.getName()); + } + + public void serviceChanged(ServiceEvent event) + { + Object service = context.getService(event.getServiceReference()); + + switch(event.getType()) { + case ServiceEvent.REGISTERED: + if (Alarm.class.isInstance(service)) { + if (alarm == null) + alarm = (Alarm)service; + updateWatchDog(); + System.out.println(getClass().getName() + " got a new " + Alarm.class.getName()); + } + break; + + case ServiceEvent.UNREGISTERING: + if (Alarm.class.isInstance(service)) { + //alarm = null; + updateWatchDog(); + System.out.println(getClass().getName() + " lost " + Alarm.class.getName()); + } + break; + } + } + + void updateWatchDog() + { + try { + if (alarm == null && watchdog != null) { + // Stop the watch dog + watchdog.stop(); + watchdog = null; + } else if (alarm != null && watchdog == null) { + // Start a new watch dog + watchdog = new AlarmWatchDog(alarm); + watchdog.start(); + } else if (alarm != null && watchdog != null && watchdog.alarm() != alarm) { + // Modify the watch dog + watchdog.stop(); + watchdog = new AlarmWatchDog(alarm); + watchdog.start(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/AlarmWatchDog.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/AlarmWatchDog.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/AlarmWatchDog.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/AlarmWatchDog.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,53 @@ +package ijvm.tests.AlarmController; + +import ijvm.tests.Alarm.Alarm; + +class AlarmWatchDog + implements Runnable +{ + volatile boolean cancel; + volatile Thread thread; + final Alarm alarm; + + public AlarmWatchDog(Alarm alarm) + { + this.alarm = alarm; + } + + public Alarm alarm() + { + return alarm; + } + + public void start() throws Exception + { + while (thread != null && thread.isAlive()) + stop(); + + cancel = false; + thread = new Thread(this, getClass().getName()); + thread.start(); + } + + public void stop() throws Exception + { + if (thread == null || !thread.isAlive()) return; + + cancel = true; + thread.join(); + } + + public void run() + { + System.out.println(getClass().getName() + ": monitoring..."); + + while (!cancel) { + try {Thread.sleep(1000);} catch (Exception ignored) {} + if (alarm.state() == false) continue; + + System.out.println("ALARM! ALARM! ALARM! ALARM!"); + } + + System.out.println(getClass().getName() + ": stopped."); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/AlarmWatchDog.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.AlarmController/src/ijvm/tests/AlarmController/AlarmWatchDog.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.Alarm_v1.0 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-Vendor: Koutheir Attouchi +Bundle-Version: 1.0.0 +Bundle-Name: ijvm.tests.AlarmImpl +Bundle-ManifestVersion: 2 +Bundle-Activator: ijvm.tests.AlarmImpl.Activator +Import-Package: org.osgi.framework, ijvm.tests.Alarm +Bundle-SymbolicName: ijvm.tests.AlarmImpl + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,34 @@ +package ijvm.tests.AlarmImpl; + +import ijvm.tests.Alarm.Alarm; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + +public class Activator + implements BundleActivator +{ + BundleContext context; + AlarmImpl_v1 alarm; + ServiceRegistration alarmServiceReg; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println(getClass().getName() + " provides " + Alarm.class.getName()); + context = bundleContext; + + alarm = new AlarmImpl_v1(); + alarm.open(context); + + alarmServiceReg = context.registerService(Alarm.class.getName(), alarm, null); + } + + public void stop(BundleContext bundleContext) throws Exception + { + alarmServiceReg.unregister(); + alarm.close(); + + System.out.println(getClass().getName() + " no more provides " + Alarm.class.getName()); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v1.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v1.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v1.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v1.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,126 @@ +package ijvm.tests.AlarmImpl; + +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.util.Scanner; + +import org.osgi.framework.BundleContext; + +class AlarmConfig_v1 +{ + File config_file; + double min_temperature; + double max_temperature; + double max_gaz; + + public void open(BundleContext bundleContext) throws Exception + { + config_file = bundleContext.getDataFile("alarm.conf"); + loadConfig(); + } + + public void close() throws Exception + { + saveConfig(); + } + + void loadConfig() throws Exception + { + initConfig(); + + if (!config_file.exists()) { + saveConfig(); + return; + } + + loadSimpleConfig(); + } + + void loadSimpleConfig() throws Exception + { + FileReader fr = new FileReader(config_file); + Scanner s = new Scanner(fr); + + try { + while (s.hasNextLine()) { + if (s.hasNext("min_temperature")) { + s.next("min_temperature"); + min_temperature = s.nextDouble(); + } else if (s.hasNext("max_temperature")) { + s.next("max_temperature"); + max_temperature = s.nextDouble(); + } else if (s.hasNext("max_gaz")) { + s.next("max_gaz"); + max_gaz = s.nextDouble(); + } else + s.nextLine(); + } + } finally { + s.close(); + } + + System.out.println(getClass().getName() + ": Simple config loaded"); + } + + void initConfig() + { + min_temperature = -40.0; + max_temperature = 60.0; + max_gaz = 10.0; + + System.out.println(getClass().getName() + ": Simple config initialized"); + } + + void saveConfig() throws Exception + { + FileWriter fw = new FileWriter(config_file); + + try { + fw.write( + "min_temperature " + min_temperature + "\n" + + "max_temperature " + max_temperature + "\n" + + "max_gaz " + max_gaz + "\n"); + + fw.flush(); + } finally { + fw.close(); + } + + System.out.println(getClass().getName() + ": Simple config saved"); + } + + public void setMinTemperatureThreshold(double value) throws Exception + { + min_temperature = value; + saveConfig(); + } + + public double minTemperatureThreshold() + { + return min_temperature; + } + + public void setMaxTemperatureThreshold(double value) throws Exception + { + max_temperature = value; + saveConfig(); + } + + public double maxTemperatureThreshold() + { + return max_temperature; + } + + public void setMaxGazThreshold(double value) throws Exception + { + max_gaz = value; + saveConfig(); + } + + public double maxGazThreshold() + { + return max_gaz; + } + +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v1.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v1.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v1.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v1.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v1.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v1.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,80 @@ +package ijvm.tests.AlarmImpl; + +import org.osgi.framework.BundleContext; + +import ijvm.tests.Alarm.Alarm; + +public class AlarmImpl_v1 + implements Alarm +{ + boolean state; + AlarmConfig_v1 config; + + AlarmImpl_v1() + { + System.out.println(getClass().getName() + " loaded"); + + state = false; + } + + protected void finalize() + { + System.out.println(getClass().getName() + " unloaded"); + } + + public void open(BundleContext bundleContext) throws Exception + { + config = new AlarmConfig_v1(); + config.open(bundleContext); + } + + public void close() throws Exception + { + config.close(); + } + + public void setState(boolean on) + { + state = on; + } + + public boolean state() + { + return state; + } + + public void setMinTemperatureThreshold(double value) throws Exception + { + config.setMinTemperatureThreshold(value); + } + + public double minTemperatureThreshold() + { + return config.minTemperatureThreshold(); + } + + public void setMaxTemperatureThreshold(double value) throws Exception + { + config.setMaxTemperatureThreshold(value); + } + + public double maxTemperatureThreshold() + { + return config.maxTemperatureThreshold(); + } + + public void setMaxGazThreshold(double value) throws Exception + { + config.setMaxGazThreshold(value); + } + + public double maxGazThreshold() + { + return config.maxGazThreshold(); + } + + public void saveConfig() throws Exception + { + config.saveConfig(); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v1.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v1.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v1.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.Alarm_v2.0 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-Vendor: Koutheir Attouchi +Bundle-Version: 2.0.0 +Bundle-Name: ijvm.tests.AlarmImpl +Bundle-ManifestVersion: 2 +Bundle-Activator: ijvm.tests.AlarmImpl.Activator +Import-Package: org.osgi.framework, ijvm.tests.Alarm, org.xml.sax, jav + ax.xml.parsers, org.xml.sax.helpers +Bundle-SymbolicName: ijvm.tests.AlarmImpl + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,34 @@ +package ijvm.tests.AlarmImpl; + +import ijvm.tests.Alarm.Alarm; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + +public class Activator + implements BundleActivator +{ + BundleContext context; + AlarmImpl_v2 alarm; + ServiceRegistration alarmServiceReg; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println(getClass().getName() + " provides " + Alarm.class.getName()); + context = bundleContext; + + alarm = new AlarmImpl_v2(); + alarm.open(context); + + alarmServiceReg = context.registerService(Alarm.class.getName(), alarm, null); + } + + public void stop(BundleContext bundleContext) throws Exception + { + alarmServiceReg.unregister(); + alarm.close(); + + System.out.println(getClass().getName() + " no more provides " + Alarm.class.getName()); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v2.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v2.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v2.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v2.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,221 @@ +package ijvm.tests.AlarmImpl; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Scanner; + +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.osgi.framework.BundleContext; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +class AlarmConfig_v2 +{ + File config_file; + double min_temperature; + double max_temperature; + double max_gaz; + + public void open(BundleContext bundleContext) throws Exception + { + config_file = bundleContext.getDataFile("alarm.conf"); + loadConfig(); + } + + public void close() throws Exception + { + saveConfig(); + } + + void loadConfig() throws Exception + { + initConfig(); + + if (!config_file.exists()) { + saveConfig(); + return; + } + + loadXMLConfig(); + } + + void loadXMLConfig() throws Exception + { + if (!configIsXML()) + migrateConfig(); + + InputSource is = new InputSource( + new InputStreamReader( + new FileInputStream(config_file), "UTF-8")); + is.setEncoding("UTF-8"); + + DefaultHandler xmlHandler = new DefaultHandler() { + boolean config = false, temperature = false, gaz = false, min = false, max = false; + + public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { + if (!config && qName.equalsIgnoreCase("config")) + config = true; + else if (config && !temperature && qName.equalsIgnoreCase("temperature")) + temperature = true; + else if (temperature && !min && qName.equalsIgnoreCase("min")) + min = true; + else if (temperature && !max && qName.equalsIgnoreCase("max")) + max = true; + else if (config && !gaz && qName.equalsIgnoreCase("gaz")) + gaz = true; + else if (gaz && !max && qName.equalsIgnoreCase("max")) + max = true; + } + + public void endElement (String uri, String localName, String qName) throws SAXException { + if (config && qName.equalsIgnoreCase("config")) + config = false; + else if (temperature && qName.equalsIgnoreCase("temperature")) + temperature = false; + else if (gaz && qName.equalsIgnoreCase("gaz")) + gaz = false; + else if (min && qName.equalsIgnoreCase("min")) + min = false; + else if (max && qName.equalsIgnoreCase("max")) + max = false; + } + + public void characters (char ch[], int start, int length) throws SAXException { + if (temperature && min) + min_temperature = Double.parseDouble(new String(ch, start, length)); + else if (temperature && max) + max_temperature = Double.parseDouble(new String(ch, start, length)); + else if (gaz && max) + max_gaz = Double.parseDouble(new String(ch, start, length)); + } + }; + + SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); + parser.parse(is, xmlHandler); + + System.out.println(getClass().getName() + ": XML config loaded"); + } + + boolean configIsXML() throws IOException + { + FileReader fr = null; + boolean r = false; + + try { + fr = new FileReader(config_file); + r = (fr.read() == '<'); + } finally { + fr.close(); + } + return r; + } + + void loadSimpleConfig() throws Exception + { + FileReader fr = new FileReader(config_file); + Scanner s = new Scanner(fr); + + try { + while (s.hasNextLine()) { + if (s.hasNext("min_temperature")) { + s.next("min_temperature"); + min_temperature = s.nextDouble(); + } else if (s.hasNext("max_temperature")) { + s.next("max_temperature"); + max_temperature = s.nextDouble(); + } else if (s.hasNext("max_gaz")) { + s.next("max_gaz"); + max_gaz = s.nextDouble(); + } else + s.nextLine(); + } + } finally { + s.close(); + } + + System.out.println(getClass().getName() + ": Simple config loaded"); + } + + void initConfig() + { + min_temperature = -40.0; + max_temperature = 60.0; + max_gaz = 10.0; + + System.out.println(getClass().getName() + ": XML config initialized"); + } + + void saveConfig() throws Exception + { + FileWriter fw = new FileWriter(config_file); + + try { + fw.write( + "\n" + + " \n" + + " " + min_temperature + "\n" + + " " + max_temperature + "\n" + + " \n" + + " \n" + + " " + max_gaz + "\n" + + " \n" + + "\n"); + + fw.flush(); + } finally { + fw.close(); + } + + System.out.println(getClass().getName() + ": XML config saved"); + } + + void migrateConfig() throws Exception + { + System.out.println(getClass().getName() + ": Migrating config from simple to XML"); + + loadSimpleConfig(); + saveConfig(); + } + + public void setMinTemperatureThreshold(double value) throws Exception + { + min_temperature = value; + saveConfig(); + } + + public double minTemperatureThreshold() + { + return min_temperature; + } + + public void setMaxTemperatureThreshold(double value) throws Exception + { + max_temperature = value; + saveConfig(); + } + + public double maxTemperatureThreshold() + { + return max_temperature; + } + + public void setMaxGazThreshold(double value) throws Exception + { + max_gaz = value; + saveConfig(); + } + + public double maxGazThreshold() + { + return max_gaz; + } + +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v2.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmConfig_v2.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v2.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v2.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v2.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v2.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,78 @@ +package ijvm.tests.AlarmImpl; + +import org.osgi.framework.BundleContext; + +import ijvm.tests.Alarm.Alarm; + +public class AlarmImpl_v2 + implements Alarm +{ + boolean state; + AlarmConfig_v2 config; + + AlarmImpl_v2() + { + System.out.println(getClass().getName() + " loaded"); + + state = false; + } + + protected void finalize() + { + System.out.println(getClass().getName() + " unloaded"); + } + + public void open(BundleContext bundleContext) throws Exception + { + config = new AlarmConfig_v2(); + config.open(bundleContext); + } + + public void close() throws Exception + { + config.close(); + } + + public void setState(boolean on) + { + state = on; + } + + public boolean state() + { + setState(Math.random() >= 0.5); + return state; + } + + public void setMinTemperatureThreshold(double value) throws Exception + { + } + + public double minTemperatureThreshold() + { + return 0.0; + } + + public void setMaxTemperatureThreshold(double value) throws Exception + { + } + + public double maxTemperatureThreshold() + { + return 0.0; + } + + public void setMaxGazThreshold(double value) throws Exception + { + } + + public double maxGazThreshold() + { + return 0.0; + } + + public void saveConfig() throws Exception + { + config.saveConfig(); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v2.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Alarm_v2.0/src/ijvm/tests/AlarmImpl/AlarmImpl_v2.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.BImpl + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: BImpl +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.BImpl +Export-Package: ijvm.tests.B +Bundle-Activator: ijvm.tests.BImpl.Activator +Import-Package: ijvm.tests.A, org.osgi.framework, org.osgi.util.tracke + r + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/B.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/B.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/B.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/B.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,6 @@ +package ijvm.tests.B; + +public interface B +{ + public void performB(); +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/B.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/B/B.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,90 @@ +package ijvm.tests.BImpl; + +import ijvm.tests.A.A; +import ijvm.tests.A.Token; +import ijvm.tests.B.B; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator + implements BundleActivator, ServiceListener +{ + private BundleContext context; + + private ServiceTracker aST; + private BImpl b; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println("BImpl exports and provides B"); + context = bundleContext; + + b = new BImpl(); + + aST = new ServiceTracker(context, A.class.getName(), null); + aST.open(); + + A service = (A)aST.getService(); + if (service != null) { + System.out.println("BImpl got A @ startup"); + + b.a.add(service); + this.useA(); + } + + context.addServiceListener(this, "(objectclass=" + A.class.getName() + ")"); + context.registerService(B.class.getName(), b, null); + } + + public void stop(BundleContext bundleContext) throws Exception + { + System.out.println("BImpl no more provides B"); + + context.removeServiceListener(this); + context = null; + + System.out.println("BImpl lost A but keeps a stale reference to it"); + aST.close(); + aST = null; + // a = null; + + b = null; + } + + public void serviceChanged(ServiceEvent event) + { + Object service = context.getService(event.getServiceReference()); + + switch(event.getType()) { + case ServiceEvent.REGISTERED: + if (A.class.isInstance(service)) { + System.out.println("BImpl got A"); + b.a.add((A)service); + + this.useA(); + } + break; + + case ServiceEvent.UNREGISTERING: + if (A.class.isInstance(service)) { + System.out.println("BImpl lost A but keeps a stale reference to it"); + } + break; + } + } + + private void useA() + { + A oneA = b.a.get(b.a.size() - 1); + Token token = oneA.getToken(); + token.getValue(); + + b.tokens.add(token); + + System.out.println("BImpl got Token from A"); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/BImpl.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/BImpl.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/BImpl.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/BImpl.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,25 @@ +package ijvm.tests.BImpl; + +import java.util.ArrayList; + +import ijvm.tests.A.A; +import ijvm.tests.A.Token; +import ijvm.tests.B.B; + +public class BImpl + implements B +{ + public ArrayList a; + public ArrayList tokens; + + public BImpl() + { + a = new ArrayList(); + tokens = new ArrayList(); + } + + public void performB() + { + System.out.println("BImpl.performB"); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/BImpl.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BImpl/src/ijvm/tests/BImpl/BImpl.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.BundleMgmtStress + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: BundleMgmtStress +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.BundleMgmtStress +Bundle-Activator: ijvm.tests.BundleMgmtStress.Activator +Import-Package: j3, org.osgi.framework, org.osgi.util.tracker + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,118 @@ +package ijvm.tests.BundleMgmtStress; + +import j3.J3Mgr; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator + implements BundleActivator, Runnable +{ + static final boolean correctStaleReferences = false; + static final String targetBundle = "file:///home/koutheir/PhD/VMKit/knopflerfish/osgi/jars/http/http_all-3.1.2.jar"; + static final long firstBundleID = 8; + + BundleContext context; + Thread worker; + volatile boolean cancelWork; + ServiceTracker j3mgrST; + J3Mgr j3mgr; + long loopCount; + + public void start(BundleContext bundleContext) throws Exception + { + context = bundleContext; + + j3mgrST = new ServiceTracker(context, J3Mgr.class.getName(), null); + j3mgrST.open(); + j3mgr = (J3Mgr)j3mgrST.getService(); + if (j3mgr == null) { + throw new BundleException( + "J3 Management service must be started before this service."); + } + + loopCount = 0; + + cancelWork = false; + worker = new Thread(this, "Stresser"); + worker.start(); + } + + public void stop(BundleContext bundleContext) throws Exception + { + if (!cancelWork) { + cancelWork = true; + + if (worker != null) { + worker.join(); + worker = null; + } + } + + System.out.println("Bundle reinstallation count: " + loopCount); + context = null; + } + + public void run() + { + System.out.println("Bundle management stress running..."); + try { + Thread.sleep(2000); + } catch (Exception e) {} + + try { + uninstallBundle(context.getBundle(firstBundleID)); + + while (!cancelWork) { + Bundle bundle = context.installBundle(targetBundle); + bundle.start(); + Thread.sleep(100); + + uninstallBundle(bundle); + } + } catch (Throwable e) { + cancelWork = true; + e.printStackTrace(); + } + + System.out.println("Bundle management stress done."); + + try { + cancelWork = true; + Bundle thisBundle = context.getBundle(); + int currentState = thisBundle.getState(); + + if (currentState == Bundle.ACTIVE || + currentState == Bundle.STARTING) { + thisBundle.stop(); + } + worker = null; + } catch (BundleException e) { + e.printStackTrace(); + } + } + + void uninstallBundle(Bundle bundle) throws Throwable + { + if (bundle == null) return; + + try { + j3mgr.setBundleStaleReferenceCorrected( + bundle.getBundleId(), correctStaleReferences); + } catch (UnsatisfiedLinkError e) { + if (correctStaleReferences) + throw e; + } + + bundle.stop(); + bundle.uninstall(); + System.out.println("Uninstalled: bundleID=" + bundle.getBundleId()); + + loopCount++; + + System.gc(); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.BundleMgmtStress/src/ijvm/tests/BundleMgmtStress/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,11 @@ + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.C + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: C +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.C +Export-Package: ijvm.tests.C + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/C.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/C.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/C.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/C.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,7 @@ +package ijvm.tests.C; + +public interface C +{ + public void performC(); + public void registerObject(Object o); +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/C.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.C/src/ijvm/tests/C/C.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.CImpl + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: CImpl +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.CImpl +Bundle-Activator: ijvm.tests.CImpl.Activator +Import-Package: ijvm.tests.B, ijvm.tests.C, org.osgi.framework, org.os + gi.util.tracker + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,75 @@ +package ijvm.tests.CImpl; + +import ijvm.tests.B.B; +import ijvm.tests.C.C; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator + implements BundleActivator, ServiceListener +{ + private BundleContext context; + + private ServiceTracker bST; + private CImpl c; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println("CImpl exports and provides C"); + context = bundleContext; + + c = new CImpl(); + + bST = new ServiceTracker(context, B.class.getName(), null); + bST.open(); + + B service = (B)bST.getService(); + if (service != null) { + System.out.println("CImpl got B @ startup"); + + c.b.add(service); + } + + context.addServiceListener(this, "(objectclass=" + B.class.getName() + ")"); + context.registerService(C.class.getName(), c, null); + } + + public void stop(BundleContext bundleContext) throws Exception + { + System.out.println("CImpl no more provides C"); + + context.removeServiceListener(this); + context = null; + + System.out.println("CImpl lost B but keeps a stale reference to it"); + bST.close(); + bST = null; + // b = null; + + c = null; + } + + public void serviceChanged(ServiceEvent event) + { + Object service = context.getService(event.getServiceReference()); + + switch(event.getType()) { + case ServiceEvent.REGISTERED: + if (B.class.isInstance(service)) { + System.out.println("CImpl got B"); + c.b.add((B)service); + } + break; + + case ServiceEvent.UNREGISTERING: + if (B.class.isInstance(service)) { + System.out.println("CImpl lost B but keeps a stale reference to it"); + } + break; + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/CImpl.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/CImpl.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/CImpl.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/CImpl.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,29 @@ +package ijvm.tests.CImpl; + +import java.util.ArrayList; + +import ijvm.tests.B.B; +import ijvm.tests.C.C; + +public class CImpl + implements C +{ + ArrayList registeredObjects; + public ArrayList b; + + CImpl() + { + b = new ArrayList(); + registeredObjects = new ArrayList(); + } + + public void performC() + { + System.out.println("CImpl.performC"); + } + + public void registerObject(Object o) + { + registeredObjects.add(o); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/CImpl.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.CImpl/src/ijvm/tests/CImpl/CImpl.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.DImpl + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,10 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: DImpl +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.DImpl +Export-Package: ijvm.tests.D +Bundle-Activator: ijvm.tests.DImpl.Activator +Import-Package: ijvm.tests.C, org.osgi.framework, org.osgi.util.tracke + r + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/D.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/D.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/D.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/D.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,6 @@ +package ijvm.tests.D; + +public interface D +{ + public void performD(); +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/D.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/D/D.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,75 @@ +package ijvm.tests.DImpl; + +import ijvm.tests.C.C; +import ijvm.tests.D.D; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceEvent; +import org.osgi.framework.ServiceListener; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator + implements BundleActivator, ServiceListener +{ + private BundleContext context; + + private ServiceTracker cST; + private DImpl d; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println("DImpl exports and provides D"); + context = bundleContext; + + d = new DImpl(); + + cST = new ServiceTracker(context, C.class.getName(), null); + cST.open(); + + C service = (C)cST.getService(); + if (service != null) { + System.out.println("DImpl got C @ startup"); + + d.c.add(service); + } + + context.addServiceListener(this, "(objectclass=" + C.class.getName() + ")"); + context.registerService(D.class.getName(), d, null); + } + + public void stop(BundleContext bundleContext) throws Exception + { + System.out.println("DImpl no more provides D"); + + context.removeServiceListener(this); + context = null; + + System.out.println("DImpl lost C but keeps a stale reference to it"); + cST.close(); + cST = null; + // c = null; + + d = null; + } + + public void serviceChanged(ServiceEvent event) + { + Object service = context.getService(event.getServiceReference()); + + switch(event.getType()) { + case ServiceEvent.REGISTERED: + if (C.class.isInstance(service)) { + System.out.println("DImpl got C"); + d.c.add((C)service); + } + break; + + case ServiceEvent.UNREGISTERING: + if (C.class.isInstance(service)) { + System.out.println("DImpl lost C but keeps a stale reference to it"); + } + break; + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/DImpl.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/DImpl.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/DImpl.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/DImpl.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,22 @@ +package ijvm.tests.DImpl; + +import java.util.ArrayList; + +import ijvm.tests.C.C; +import ijvm.tests.D.D; + +public class DImpl + implements D +{ + public ArrayList c; + + public DImpl() + { + c = new ArrayList(); + } + + public void performD() + { + System.out.println("DImpl.performB"); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/DImpl.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.DImpl/src/ijvm/tests/DImpl/DImpl.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.bundle-pack URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.bundle-pack?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.bundle-pack (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.bundle-pack Mon Jun 10 11:15:21 2013 @@ -0,0 +1,4 @@ + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.bundle-pack ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,23 @@ + + + ijvm.tests.Runner + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.knopflerfish.eclipse.core.bundlebuilder + + + + + + org.knopflerfish.eclipse.core.bundlenature + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bundle.manifest URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bundle.manifest?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bundle.manifest (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bundle.manifest Mon Jun 10 11:15:21 2013 @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-Version: 1.0.0 +Bundle-Name: Runner +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: ijvm.tests.Runner +Bundle-Activator: ijvm.tests.Runner.Activator +Import-Package: ijvm.tests.A, org.osgi.framework, org.osgi.util.tracke + r + Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/bundle.manifest ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Activator.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Activator.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Activator.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Activator.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,71 @@ +package ijvm.tests.Runner; + +import ijvm.tests.A.A; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; +import org.osgi.util.tracker.ServiceTracker; + +public class Activator + implements BundleActivator, Runnable +{ + private BundleContext context; + private ServiceTracker aST; + private A a; + private Runner runner1, runner2; + private Thread runnerThread1, runnerThread2, cancellerThread; + + public void start(BundleContext bundleContext) throws Exception + { + System.out.println("Started runner bundle."); + context = bundleContext; + + aST = new ServiceTracker(context, A.class.getName(), null); + aST.open(); + + a = (A)aST.getService(); + if (a == null) { + aST.close(); + aST = null; + + throw new BundleException("Runner bundle could not get A @ startup"); + } + System.out.println("Runner bundle got A @ startup."); + + runnerThread1 = new Thread(runner1 = new Runner(a), "Runner 1"); + runnerThread2 = new Thread(runner2 = new Runner(a), "Runner 2"); + runnerThread1.start(); + runnerThread2.start(); + +// cancellerThread = new Thread(this, "Runner Canceller"); +// cancellerThread.start(); + } + + public void stop(BundleContext bundleContext) throws Exception + { + System.out.println("Stopped runner bundle."); + + context = null; + + System.out.println("Runner bundle lost A but keeps a stale reference to it"); + aST.close(); + aST = null; + // a = null; + +// runner1.cancel(); +// runner2.cancel(); +// runnerThread1.join(); +// runnerThread2.join(); + } + + public void run() + { + try { + Thread.sleep(5000); + runner1.cancel(); + } catch (Exception e) { + e.printStackTrace(); + } + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Activator.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Activator.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Runner.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Runner.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Runner.java (added) +++ vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Runner.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,55 @@ +package ijvm.tests.Runner; + +public class Runner + implements Runnable +{ + private Object obj; + private static boolean sleeping; + private boolean cancelRunning; + + { + sleeping = false; + } + + public Runner(Object o) + { + cancelRunning = false; + obj = o; + } + + public void cancel() + { + System.out.println("Cancelling runner thread: " + Thread.currentThread().getName()); + cancelRunning = true; + } + + public void run() + { + System.out.println("Started runner thread: " + Thread.currentThread().getName()); + + try { + while (!cancelRunning) { + long delay = 2000 + (long)(Math.random() * 1000.0); + + synchronized(obj) { + while (sleeping) + obj.wait(); + sleeping = true; + + System.out.println(Thread.currentThread().getName() + ": sleeping for " + delay); + Thread.sleep(delay); + System.out.println(Thread.currentThread().getName() + ": woke up"); + + sleeping = false; + obj.notifyAll(); + } + + Thread.sleep(200); + } + } catch (Exception e) { + e.printStackTrace(); + } + + System.out.println("Stopped runner thread: " + Thread.currentThread().getName()); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Runner.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/ijvm.tests.Runner/src/ijvm/tests/Runner/Runner.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/java-grant-all.policy URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/java-grant-all.policy?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/java-grant-all.policy (added) +++ vmkit/branches/incinerator/incinerator/tests/java-grant-all.policy Mon Jun 10 11:15:21 2013 @@ -0,0 +1 @@ +grant { permission java.security.AllPermission; }; Propchange: vmkit/branches/incinerator/incinerator/tests/java-grant-all.policy ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/minimal.bug.xargs URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/minimal.bug.xargs?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/minimal.bug.xargs (added) +++ vmkit/branches/incinerator/incinerator/tests/minimal.bug.xargs Mon Jun 10 11:15:21 2013 @@ -0,0 +1,42 @@ +-Dorg.knopflerfish.framework.system.export.all_13=false +-Dorg.knopflerfish.framework.verbosity=0 + +-Forg.knopflerfish.framework.debug.errors=true +-Forg.knopflerfish.framework.debug.packages=false +-Forg.knopflerfish.framework.debug.classloader=false + +-Forg.knopflerfish.http.dnslookup=true +-Forg.osgi.service.http.port=8080 + +-Dorg.knopflerfish.gosg.jars=file:///home/koutheir/PhD/VMKit/knopflerfish/osgi/jars/;file:///home/koutheir/PhD/VMKit/incinerator/incinerator/osgi/out/;file:///home/koutheir/PhD/VMKit/incinerator/incinerator/tests/ + +-Forg.knopflerfish.startlevel.use=true + +-init + +-istart j3mgr-1.0.0.jar + +-istart log/log_all-3.1.3.jar +-istart cm/cm_all-3.0.4.jar +-istart util/util-2.0.1.jar +-istart console/console_all-3.0.4.jar +-istart frameworkcommands/frameworkcommands-3.2.0.jar +-istart logcommands/logcommands-3.1.1.jar +-istart cm_cmd/cm_cmd-3.0.2.jar +-istart consoletty/consoletty-3.0.1.jar +-istart useradmin/useradmin_api-3.0.3.jar +-istart util/util-2.0.1.jar + +-launch + +#-install BundleReloader/out/BundleReloader-1.0.0.jar + +#-istart event/event_all-3.0.8.jar +#-istart useradmin/useradmin_all-3.0.3.jar + +-istart ijvm.tests.A/out/ijvm.tests.A-1.0.0.jar +-istart ijvm.tests.C/out/ijvm.tests.C-1.0.0.jar +-istart ijvm.tests.AImpl/out/ijvm.tests.AImpl-1.0.0.jar +-istart ijvm.tests.BImpl/out/ijvm.tests.BImpl-1.0.0.jar +-istart ijvm.tests.CImpl/out/ijvm.tests.CImpl-1.0.0.jar +-istart ijvm.tests.DImpl/out/ijvm.tests.DImpl-1.0.0.jar Propchange: vmkit/branches/incinerator/incinerator/tests/minimal.bug.xargs ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/minimal.http.xargs URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/minimal.http.xargs?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/minimal.http.xargs (added) +++ vmkit/branches/incinerator/incinerator/tests/minimal.http.xargs Mon Jun 10 11:15:21 2013 @@ -0,0 +1,44 @@ +-Dorg.knopflerfish.framework.system.export.all_13=false +-Dorg.knopflerfish.framework.verbosity=0 + +-Forg.knopflerfish.framework.debug.errors=true +-Forg.knopflerfish.framework.debug.packages=false +-Forg.knopflerfish.framework.debug.classloader=false +#-Forg.knopflerfish.framework.debug.permissions=false + +-Forg.knopflerfish.http.dnslookup=true +-Forg.osgi.service.http.port=8080 + +-Dhttp.proxyHost=proxy +-Dhttp.proxyPort=3128 + +#-Forg.knopflerfish.framework.all_signed=false + +-Dorg.knopflerfish.gosg.jars=file:///home/koutheir/PhD/VMKit/knopflerfish/osgi/jars/;file:///home/koutheir/PhD/VMKit/incinerator/incinerator/osgi/out/;file:///home/koutheir/PhD/VMKit/incinerator/incinerator/tests/ + +-Forg.knopflerfish.startlevel.use=true + +-init + +-istart j3mgr-1.0.0.jar + +-install log/log_all-3.1.3.jar +-install cm/cm_all-3.0.4.jar +-install util/util-2.0.1.jar +-istart console/console_all-3.0.4.jar +-istart frameworkcommands/frameworkcommands-3.2.0.jar +-istart logcommands/logcommands-3.1.1.jar +-istart cm_cmd/cm_cmd-3.0.2.jar +-istart consoletty/consoletty-3.0.1.jar +-istart useradmin/useradmin_api-3.0.3.jar +-istart util/util-2.0.1.jar + +-launch + +-install BundleReloader/out/BundleReloader-1.0.0.jar + +-install jsdk/jsdk_api-2.5.0.kf3-2.jar + +#-istart http/http_all-3.1.2.jar +#-istart httpconsole/httpconsole_all-3.0.2.jar +#-istart httproot/httproot-3.0.1.jar Propchange: vmkit/branches/incinerator/incinerator/tests/minimal.http.xargs ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/minimal.xargs URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/minimal.xargs?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/minimal.xargs (added) +++ vmkit/branches/incinerator/incinerator/tests/minimal.xargs Mon Jun 10 11:15:21 2013 @@ -0,0 +1,87 @@ +#-Dorg.knopflerfish.framework.bundlestorage=memory +-Dorg.knopflerfish.framework.system.export.all_13=false +-Dorg.knopflerfish.framework.verbosity=0 + +-Forg.knopflerfish.framework.debug.errors=true +-Forg.knopflerfish.framework.debug.packages=false +-Forg.knopflerfish.framework.debug.classloader=false +#-Forg.knopflerfish.framework.debug.permissions=false + +#-Forg.osgi.framework.system.packages.extra= + +-Forg.knopflerfish.http.dnslookup=true +-Forg.osgi.service.http.port=8080 + +#-Dhttp.proxyHost=proxy +#-Dhttp.proxyPort=3128 + +#-Forg.knopflerfish.framework.all_signed=false + +-Dorg.knopflerfish.gosg.jars=file:///home/koutheir/PhD/VMKit/knopflerfish/osgi/jars/;file:///home/koutheir/PhD/VMKit/incinerator/incinerator/tests/plugins/ + +-Forg.knopflerfish.startlevel.use=true + +-init + +-install log/log_all-3.1.3.jar +-install cm/cm_all-3.0.4.jar +-install util/util-2.0.1.jar +-istart console/console_all-3.0.4.jar +-istart frameworkcommands/frameworkcommands-3.2.0.jar +-istart logcommands/logcommands-3.1.1.jar +-istart cm_cmd/cm_cmd-3.0.2.jar +-istart consoletty/consoletty-3.0.1.jar +-istart useradmin/useradmin_api-3.0.3.jar +-istart util/util-2.0.1.jar + +-launch + +-istart j3mgr-1.0.0.jar + +#-istart ijvm.tests.A-1.0.0.jar +#-istart ijvm.tests.C-1.0.0.jar +#-istart ijvm.tests.AImpl-1.0.0.jar +#-istart ijvm.tests.BImpl-1.0.0.jar +#-istart ijvm.tests.CImpl-1.0.0.jar +#-istart ijvm.tests.DImpl-1.0.0.jar +#-install ijvm.tests.Runner-1.0.0.jar +-install BundleReloader-1.0.0.jar + +-install desktop/desktop_all-3.2.5.jar +-install comm-linux/comm-linux_all-2.0.0.jar +-install command/command_all-0.1.jar +-install jsdk/jsdk_api-2.5.0.kf3-2.jar + +-istart kxml/kxml-2.3.0.kf3.jar +-istart metatype/metatype-3.0.0.jar +-istart kf_metatype/kf_metatype_all-3.0.2.jar +-istart component/component_all-3.1.14.jar +-istart event/event_all-3.0.8.jar +-istart cm_desktop/cm_desktop_all-3.0.0.jar +-istart threadio/threadio_all-0.1.0.jar +-istart consoletcp/consoletcp_all-2.0.0.jar +-istart soapobject/soapobject_all-0.0.2.jar +-istart crimson/crimson-2.1.0.kf3.jar +-istart measurement/measurement-3.0.1.jar +-istart position/position-3.0.1.jar +-istart sslj2sp/sslj2sp-2.0.0.jar +-istart xerces/xerces-2.10.1.kf3.jar +-istart xml/xml-3.0.1.jar +-istart cm/cm_all-3.0.4.jar +-istart commons-logging/commons-logging_all-2.0.0.kf3.jar +-istart console/console_all-3.0.4.jar +-istart prefs/prefs_all-3.0.1.jar +-istart io/io_all-3.0.1.jar +-istart device/device_all-3.0.0.jar +-istart xalan/xalan-2.7.1.kf3_01.jar +-istart basicdriverlocator/basicdriverlocator_all-3.0.0.jar +-istart connectors/connectors_all-2.0.1.jar +#-istart http/http_all-3.1.2.jar +#-istart httpconsole/httpconsole_all-3.0.2.jar +#-istart httproot/httproot-3.0.1.jar +-istart useradmin/useradmin_all-3.0.3.jar +-istart scrcommands/scrcommands-1.1.0.jar +-istart serialportdevice/serialportdevice_all-2.0.1.jar +-istart bundlerepository/bundlerepository_all-3.1.2.jar +-istart commandtty/commandtty-2.0.0.jar +-istart console2command/console2command-1.0.0.jar Propchange: vmkit/branches/incinerator/incinerator/tests/minimal.xargs ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/incinerator/tests/resurrection/.classpath URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/resurrection/.classpath?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/resurrection/.classpath (added) +++ vmkit/branches/incinerator/incinerator/tests/resurrection/.classpath Mon Jun 10 11:15:21 2013 @@ -0,0 +1,6 @@ + + + + + + Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/.classpath ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/.classpath ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/resurrection/.project URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/resurrection/.project?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/resurrection/.project (added) +++ vmkit/branches/incinerator/incinerator/tests/resurrection/.project Mon Jun 10 11:15:21 2013 @@ -0,0 +1,17 @@ + + + resurrection + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/.project ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/.project ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrect.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrect.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrect.java (added) +++ vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrect.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,40 @@ +package resurrection; + +public class resurrect +{ + public static volatile resurrected objRef = null; + + public static void main(String args[]) + { + newUnreachable(); + for (int i=0; i < 2; ++i) + makeUnreachable(i); + } + + static void newUnreachable() + { + new resurrected(); + } + + static void makeUnreachable(int i) + { + System.out.println("Making objRef unreachable, round " + (i + 1)); + + objRef = null; + collectObject(); + } + + static void collectObject() + { + System.out.println("objRef = " + objRef); + + try { + System.out.println("Run GC..."); + System.gc(); + Thread.sleep(2000); + } catch (Exception ignored) {} + + System.out.println("After GC..."); + System.out.println("objRef = " + objRef); + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrect.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrect.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrected.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrected.java?rev=183676&view=auto ============================================================================== --- vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrected.java (added) +++ vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrected.java Mon Jun 10 11:15:21 2013 @@ -0,0 +1,11 @@ +package resurrection; + +public class resurrected +{ + protected void finalize() + { + System.out.println("Finalize invoked, resurrect this object."); + + resurrect.objRef = this; + } +} Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrected.java ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/incinerator/tests/resurrection/src/resurrection/resurrected.java ------------------------------------------------------------------------------ svn:mime-type = text/plain From koutheir at gmail.com Mon Jun 10 09:18:42 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:18:42 -0000 Subject: [vmkit-commits] [vmkit] r183677 - Adding Incinerator feature to J3. Removed precompiler trainer. Message-ID: <20130610161842.D33C52A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:18:42 2013 New Revision: 183677 URL: http://llvm.org/viewvc/llvm-project?rev=183677&view=rev Log: Adding Incinerator feature to J3. Removed precompiler trainer. Removed: vmkit/branches/incinerator/tools/precompiler/trainer/ From koutheir at gmail.com Mon Jun 10 09:19:17 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:19:17 -0000 Subject: [vmkit-commits] [vmkit] r183678 - Adding Incinerator feature to J3. Updating configuration. Message-ID: <20130610161917.9CE412A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:19:17 2013 New Revision: 183678 URL: http://llvm.org/viewvc/llvm-project?rev=183678&view=rev Log: Adding Incinerator feature to J3. Updating configuration. Removed: vmkit/branches/incinerator/autoconf/.gitignore Modified: vmkit/branches/incinerator/autoconf/AutoRegen.sh vmkit/branches/incinerator/autoconf/configure.ac Removed: vmkit/branches/incinerator/autoconf/.gitignore URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/autoconf/.gitignore?rev=183677&view=auto ============================================================================== --- vmkit/branches/incinerator/autoconf/.gitignore (original) +++ vmkit/branches/incinerator/autoconf/.gitignore (removed) @@ -1,3 +0,0 @@ -aclocal.m4 -autom4te.cache/ -configure.bak Modified: vmkit/branches/incinerator/autoconf/AutoRegen.sh URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/autoconf/AutoRegen.sh?rev=183678&r1=183677&r2=183678&view=diff ============================================================================== --- vmkit/branches/incinerator/autoconf/AutoRegen.sh (original) +++ vmkit/branches/incinerator/autoconf/AutoRegen.sh Mon Jun 10 11:19:17 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 Modified: vmkit/branches/incinerator/autoconf/configure.ac URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/autoconf/configure.ac?rev=183678&r1=183677&r2=183678&view=diff ============================================================================== --- vmkit/branches/incinerator/autoconf/configure.ac (original) +++ vmkit/branches/incinerator/autoconf/configure.ac Mon Jun 10 11:19:17 2013 @@ -340,6 +340,20 @@ esac AC_SUBST(classpathimpl) +dnl ************************************************************************** +dnl Kill stale references +dnl ************************************************************************** +AC_ARG_ENABLE(incinerator, + AS_HELP_STRING([--enable-incinerator], + [Use incinerator to kill stale references in OSGi (default is NO)]),, + enable_incinerator=no) +case "$enable_incinerator" in + yes) AC_DEFINE(RESET_STALE_REFERENCES,[1]) ;; + no) ;; #AC_DEFINE(RESET_STALE_REFERENCES,[0]) ;; + *) AC_MSG_ERROR([Invalid setting for --enable-incinerator. Use "yes" or "no"]) ;; +esac + + dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 4: Check for programs we need and that they are the right version From koutheir at gmail.com Mon Jun 10 09:20:59 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:20:59 -0000 Subject: [vmkit-commits] [vmkit] r183679 - Adding Incinerator feature to J3. Added core implementation. Message-ID: <20130610162059.ED4BB2A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:20:59 2013 New Revision: 183679 URL: http://llvm.org/viewvc/llvm-project?rev=183679&view=rev Log: Adding Incinerator feature to J3. Added core implementation. Added: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp (with props) vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h (with props) vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp (with props) Modified: vmkit/branches/incinerator/include/vmkit/VirtualMachine.h vmkit/branches/incinerator/include/vmkit/config.h.in vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp 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/mmtk/java/src/org/j3/mmtk/Collection.java vmkit/branches/incinerator/mmtk/java/src/org/mmtk/plan/SimpleCollector.java vmkit/branches/incinerator/mmtk/java/src/org/mmtk/vm/Collection.java vmkit/branches/incinerator/mmtk/mmtk-alloc/Selected.cpp vmkit/branches/incinerator/mmtk/mmtk-j3/Collection.cpp vmkit/branches/incinerator/mmtk/mmtk-j3/FinalizableProcessor.cpp Modified: vmkit/branches/incinerator/include/vmkit/VirtualMachine.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/vmkit/VirtualMachine.h?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/include/vmkit/VirtualMachine.h (original) +++ vmkit/branches/incinerator/include/vmkit/VirtualMachine.h Mon Jun 10 11:20:59 2013 @@ -223,6 +223,13 @@ public: /// CooperativeCollectionRV rendezvous; +#if RESET_STALE_REFERENCES + virtual bool beforeMarkingReference(const void* source, void** ref) = 0; + virtual bool beforeMarkingStackReference(const void* frameInfo, void** ref) = 0; + virtual void collectorPhaseComplete() = 0; + virtual void markingFinalizersDone() = 0; +#endif + //===----------------------------------------------------------------------===// // (2.5) GC-DEBUG-related methods. //===----------------------------------------------------------------------===// Modified: vmkit/branches/incinerator/include/vmkit/config.h.in URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/vmkit/config.h.in?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/include/vmkit/config.h.in (original) +++ vmkit/branches/incinerator/include/vmkit/config.h.in Mon Jun 10 11:20:59 2013 @@ -0,0 +1,2 @@ +/* Kill stale references */ +#undef RESET_STALE_REFERENCES Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp Mon Jun 10 11:20:59 2013 @@ -2566,11 +2566,15 @@ void JavaJIT::compileOpcodes(Reader& rea } case MONITOREXIT : { +#if RESET_STALE_REFERENCES // NOTE: monitorExit() should NOT throw an exception if object is null. // See monitorExit() implementation. - //bool thisReference = isThisReference(currentStackIndex - 1); Value* obj = pop(); - // if (!thisReference) JITVerifyNull(obj); +#else + bool thisReference = isThisReference(currentStackIndex - 1); + Value* obj = pop(); + if (!thisReference) JITVerifyNull(obj); +#endif monitorExit(obj); break; } Added: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp?rev=183679&view=auto ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp (added) +++ vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp Mon Jun 10 11:20:59 2013 @@ -0,0 +1,458 @@ + +#include "VmkitGC.h" +#include "Jnjvm.h" +#include "VMStaticInstance.h" +#include "JavaReferenceQueue.h" + +#include +#include + +#if RESET_STALE_REFERENCES + +#define DEBUG_VERBOSE_STALE_REF 0 + +using namespace std; + +namespace j3 { + +Incinerator::Incinerator(Jnjvm* j3vm) : + scanRef(Incinerator::scanRef_Disabled), + scanStackRef(Incinerator::scanStackRef_Disabled), + vm(j3vm), + needsStaleRefRescan(false), + findReferencesToObject(NULL) {} + +Incinerator::~Incinerator() +{ +} + +Incinerator* Incinerator::get() +{ + vmkit::Thread* th = vmkit::Thread::get(); + assert(th && "Invalid current thread."); + if (!th) return NULL; + + return &static_cast(th->MyVM)->incinerator; +} + +void Incinerator::dumpClassLoaderBundles() const +{ + vmkit::LockGuard lg(bundleClassLoadersLock); + bundleClassLoadersType::const_iterator + i = bundleClassLoaders.begin(), e = bundleClassLoaders.end(); + + for (; i != e; ++i) + cerr << "bundleID=" << i->first << " classLoader=" << i->second << endl; + + staleBundleClassLoadersType::const_iterator + si = staleBundleClassLoaders.begin(), se = staleBundleClassLoaders.end(); + staleBundleClassLoadersType::mapped_type::const_iterator li, le; + for (; si != se; ++si) { + cerr << "stale bundleID=" << si->first << " classLoaders={"; + le = si->second.end(); + li = si->second.begin(); + for (; li != le; ++li) cerr << " " << *li; + cerr << "}" << endl; + } +} + +void Incinerator::setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected) +{ + JnjvmClassLoader * loader = this->getBundleClassLoader(bundleID); + if (!loader) { + vm->illegalArgumentException("Invalid bundle ID"); return;} + +#if DEBUG_VERBOSE_STALE_REF + cerr << "Stale references to bundleID=" << bundleID << " are "; + if (corrected) + cerr << "corrected." << endl; + else + cerr << "no more corrected." << endl; +#endif + + loader->setStaleReferencesCorrectionEnabled(corrected); +} + +bool Incinerator::isBundleStaleReferenceCorrected(int64_t bundleID) const +{ + JnjvmClassLoader const* loader = this->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 +{ + staleBundleClassLoadersType::mapped_type::const_iterator + b = pair.second.begin(), e = pair.second.end(); + staleBundleClassLoadersType::mapped_type::const_iterator + i = find(b, e, loader); + return (i != e); +} + +int64_t Incinerator::getClassLoaderBundleID(JnjvmClassLoader const * loader) const +{ + if (loader == NULL) return -1; + vmkit::LockGuard lg(bundleClassLoadersLock); + + bundleClassLoadersType::const_iterator + b = bundleClassLoaders.begin(), + e = bundleClassLoaders.end(); + bundleClassLoadersType::const_iterator + i = find_if(b, e, InstalledBundles_finder(loader)); + + if (i != e) return i->first; + + // Look up in stale bundles list + staleBundleClassLoadersType::const_iterator + sb = staleBundleClassLoaders.begin(), + se = staleBundleClassLoaders.end(); + staleBundleClassLoadersType::const_iterator + si = find_if(sb, se, UninstalledBundles_finder(loader)); + + return (si == se) ? -1 : si->first; +} + +// Link a bundle ID (OSGi world) to a class loader (Java world). +void Incinerator::setBundleClassLoader(int64_t bundleID, JnjvmClassLoader* loader) +{ + if (bundleID == -1) return; + vmkit::LockGuard lg(bundleClassLoadersLock); + + JnjvmClassLoader * previous_loader = bundleClassLoaders[bundleID]; + + if (!loader) { + // Unloaded bundle + bundleClassLoaders.erase(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 + + // Associate the class loader with the bundle + bundleClassLoaders[bundleID] = loader; + + // 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 + } + + if (!previous_loader) + return; // No previous class loader, nothing to clean up + + // Mark the previous class loader as stale + staleBundleClassLoaders[bundleID].push_front(previous_loader); + previous_loader->markStale(true); + + // Enable stale references scanning + setScanningInclusive(); +} + +IncineratorManagedClassLoader::~IncineratorManagedClassLoader() +{ + Incinerator& incinerator = JavaThread::get()->getJVM()->incinerator; + incinerator.classLoaderUnloaded(static_cast(this)); +} + +void Incinerator::classLoaderUnloaded(JnjvmClassLoader const * loader) +{ + int64_t bundleID = getClassLoaderBundleID(loader); + if (bundleID == -1) { +#if DEBUG_VERBOSE_STALE_REF + cerr << "Class loader unloaded: " << loader << endl; +#endif + return; + } + + staleBundleClassLoaders[bundleID].remove(loader); + if (staleBundleClassLoaders[bundleID].size() == 0) + staleBundleClassLoaders.erase(bundleID); + +#if DEBUG_VERBOSE_STALE_REF + cerr << "Class loader unloaded: " << loader + << " bundleID=" << bundleID << endl; +#endif +} + +void Incinerator::dumpReferencesToObject(JavaObject* object) const +{ + findReferencesToObject = object; + vmkit::Collector::collect(); +} + +void Incinerator::forceStaleReferenceScanning() +{ + setScanningInclusive(); + vmkit::Collector::collect(); +} + +bool Incinerator::isScanningEnabled() +{ + return scanRef != Incinerator::scanRef_Disabled; +} + +void Incinerator::setScanningDisabled() +{ + scanRef = Incinerator::scanRef_Disabled; + scanStackRef = Incinerator::scanStackRef_Disabled; + +#if DEBUG_VERBOSE_STALE_REF + cerr << "Looking for stale references done." << endl; +#endif +} + +void Incinerator::setScanningInclusive() +{ + scanRef = Incinerator::scanRef_Inclusive; + scanStackRef = Incinerator::scanStackRef_Inclusive; + +#if DEBUG_VERBOSE_STALE_REF + cerr << "Looking for stale references..." << endl; +#endif +} + +void Incinerator::setScanningExclusive() +{ + scanRef = Incinerator::scanRef_Exclusive; + scanStackRef = Incinerator::scanStackRef_Exclusive; + +#if DEBUG_VERBOSE_STALE_REF + cerr << "Excluding stale references..." << endl; +#endif +} + +void Incinerator::beforeCollection() +{ + if (findReferencesToObject != NULL) + foundReferencerObjects.clear(); + +#if DEBUG_VERBOSE_STALE_REF + if (needsStaleRefRescan) { + cerr << "Some stale references were previously ignored due to" + " finalizable stale objects." + " Scanning for stale references enabled." << endl; + } +#endif + + if (!needsStaleRefRescan && !isScanningEnabled()) return; + + needsStaleRefRescan = false; + setScanningInclusive(); +} + +void Incinerator::markingFinalizersDone() +{ + if (!isScanningEnabled()) return; + setScanningExclusive(); +} + +void Incinerator::collectorPhaseComplete() +{ + for (StaleRefListType::const_iterator + i = staleRefList.begin(), e = staleRefList.end(); i != e; ++i) + { + eliminateStaleRef(i->second, i->first); + } + + staleRefList.clear(); +} + +void Incinerator::afterCollection() +{ + findReferencesToObject = NULL; + + if (!isScanningEnabled()) return; + +#if DEBUG_VERBOSE_STALE_REF + if (needsStaleRefRescan) { + cerr << "Some stale references were ignored due to finalizable" + " stale objects. Another garbage collection is needed." << endl; + } +#endif + + setScanningDisabled(); +} + +bool Incinerator::isStaleObject(const JavaObject* obj) +{ + llvm_gcroot(obj, 0); + if (!obj || isVMObject(obj)) return false; + + CommonClass* ccl = JavaObject::getClass(obj); + assert (ccl && "Object Class is not null."); + + JnjvmClassLoader* loader = ccl->classLoader; + return loader->isStale() && loader->isStaleReferencesCorrectionEnabled(); +} + +bool Incinerator::isVMObject(const JavaObject* obj) +{ + llvm_gcroot(obj, 0); + + // Check the type of Java object. + // Some Java objects are not real object, but are bridges between Java + // and the VM C++ objects. + return (obj != NULL) && ( + VMClassLoader::isVMClassLoader(obj) + || VMStaticInstance::isVMStaticInstance(obj)); +} + +bool Incinerator::scanRef_Disabled(Incinerator&, const JavaObject* source, JavaObject** ref) +{ + llvm_gcroot(source, 0); +#if DEBUG_VERBOSE_STALE_REF + if (!ref || !(*ref)) return true; + if (JavaObject::getClass(*ref)->name->elements[0] == 'i') + cout << ref << " ==> " << **ref << endl; +#endif + return true; +} + +bool Incinerator::scanStackRef_Disabled(Incinerator&, const JavaMethod* method, JavaObject** ref) +{ +#if DEBUG_VERBOSE_STALE_REF + if (!ref || !(*ref)) return true; + if (method && method->classDef->name->elements[0] == 'i') + cout << *method << ": " << ref << " ==> " << **ref << endl; +#endif + return true; +} + +bool Incinerator::scanRef_Inclusive(Incinerator& incinerator, const JavaObject* source, JavaObject** ref) +{ + llvm_gcroot(source, 0); + + if (!ref || !isStaleObject(*ref)) return true; + +#if DEBUG_VERBOSE_STALE_REF + cerr << "Stale ref: " << ref << "==>" << **ref << endl; +#endif + + // Queue the stale reference to be eliminated. + incinerator.staleRefList[ref] = source; + + // Skip this reference and don't trace it. + return false; +} + +bool Incinerator::scanStackRef_Inclusive(Incinerator& incinerator, const JavaMethod* method, JavaObject** ref) +{ +#if DEBUG_VERBOSE_STALE_REF + if (!ref || !(*ref)) return true; + if (method && method->classDef->name->elements[0] == 'i') + cout << *method << ": " << ref << " ==> " << **ref << endl; +#endif + + return Incinerator::scanRef_Inclusive(incinerator, NULL, ref); +} + +bool Incinerator::scanRef_Exclusive(Incinerator& incinerator, const JavaObject* source, JavaObject** ref) +{ + llvm_gcroot(source, 0); + + // Do not eliminate any stale references traced via finalizable objects. + if ((ref != NULL) && isStaleObject(*ref)) { +#if DEBUG_VERBOSE_STALE_REF + size_t removed = +#endif + + incinerator.staleRefList.erase(ref); + incinerator.needsStaleRefRescan = true; + +#if DEBUG_VERBOSE_STALE_REF + if (!removed) + cerr << "Stale ref (ignored): " << ref << "==>" << **ref << endl; + else + cerr << "Excluded stale ref: " << ref << "==>" << **ref << endl; +#endif + } + return true; // Trace this reference. +} + +bool Incinerator::scanStackRef_Exclusive(Incinerator& incinerator, const JavaMethod* method, JavaObject** ref) +{ +#if DEBUG_VERBOSE_STALE_REF + if (!ref || !(*ref)) return true; + if (method && method->classDef->name->elements[0] == 'i') + cout << *method << ": " << ref << " ==> " << **ref << endl; +#endif + + return Incinerator::scanRef_Exclusive(incinerator, NULL, ref); +} + +void Incinerator::eliminateStaleRef(const JavaObject *source, JavaObject** ref) +{ + CommonClass* ccl = JavaObject::getClass(*ref); + assert (ccl && "Object Class is not null."); + +#if DEBUG_VERBOSE_STALE_REF + cerr << "Resetting stale ref=" << ref << " obj=" << **ref << " classLoader=" << ccl->classLoader; + if (source) cerr << " source=" << *source; + cerr << endl; +#endif + + if (!ccl->classLoader->isStaleReferencesCorrectionEnabled()) { +#if DEBUG_VERBOSE_STALE_REF + cerr << "WARNING: Ignoring stale ref=" << ref << " obj=" << **ref << " classLoader=" << ccl->classLoader; + if (source) cerr << " source=" << *source; + cerr << endl; +#endif + return; + } + + if (JavaThread* ownerThread = (JavaThread*)vmkit::ThinLock::getOwner(*ref, vm->lockSystem)) { + if (vmkit::FatLock* lock = vmkit::ThinLock::getFatLock(*ref, vm->lockSystem)) + lock->markAssociatedObjectAsDead(); + + // Notify all threads waiting on this object + ownerThread->lockingThread.notifyAll(*ref, vm->lockSystem, ownerThread); + + // Release this object + while (vmkit::ThinLock::getOwner(*ref, vm->lockSystem) == ownerThread) + vmkit::ThinLock::release(*ref, vm->lockSystem, ownerThread); + } + + *ref = NULL; // Reset the reference +} + +} + +#endif Propchange: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.cpp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h?rev=183679&view=auto ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h (added) +++ vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h Mon Jun 10 11:20:59 2013 @@ -0,0 +1,145 @@ + +#ifndef INCINERATOR_H +#define INCINERATOR_H + +#include "vmkit/Locks.h" + +#include +#include +#include +#include +#include + +namespace j3 { + +class Jnjvm; +class JnjvmClassLoader; +class VMClassLoader; +class VMStaticInstance; +class JavaObject; +class JavaMethod; + + +class Incinerator +{ +public: + Incinerator(j3::Jnjvm* j3vm); + virtual ~Incinerator(); + + void setBundleStaleReferenceCorrected(int64_t bundleID, bool corrected); + bool isBundleStaleReferenceCorrected(int64_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); + + void beforeCollection(); + void markingFinalizersDone(); + void collectorPhaseComplete(); + void afterCollection(); + void classLoaderUnloaded(JnjvmClassLoader const * loader); + + static Incinerator* get(); + + typedef bool (*scanRefFunc)( + Incinerator& incinerator, const JavaObject* source, JavaObject** ref); + typedef bool (*scanStackRefFunc)( + Incinerator& incinerator, const JavaMethod* method, JavaObject** ref); + + volatile scanRefFunc scanRef; + volatile scanStackRefFunc scanStackRef; + +protected: + typedef std::map > + staleBundleClassLoadersType; + typedef std::map bundleClassLoadersType; + typedef std::map + StaleRefListType; // (ref, source) + + inline static bool isStaleObject(const JavaObject* obj); + inline static bool isVMObject(const JavaObject* obj); + void eliminateStaleRef(const JavaObject *source, JavaObject** ref); + + bool isScanningEnabled(); + void setScanningDisabled(); + void setScanningInclusive(); + void setScanningExclusive(); + + static bool scanRef_Disabled( + Incinerator& incinerator, const JavaObject* source, JavaObject** ref); + static bool scanRef_Inclusive( + Incinerator& incinerator, const JavaObject* source, JavaObject** ref); + static bool scanRef_Exclusive( + Incinerator& incinerator, const JavaObject* source, JavaObject** ref); + static bool scanStackRef_Disabled( + Incinerator& incinerator, const JavaMethod* method, JavaObject** ref); + static bool scanStackRef_Inclusive( + Incinerator& incinerator, const JavaMethod* method, JavaObject** ref); + 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: + UninstalledBundles_finder(JnjvmClassLoader const * l) : loader(l) {} + bool operator() ( + const staleBundleClassLoadersType::value_type& pair) const; + }; + + j3::Jnjvm* vm; + + mutable vmkit::LockRecursive bundleClassLoadersLock; + bundleClassLoadersType bundleClassLoaders; + staleBundleClassLoadersType staleBundleClassLoaders; + + StaleRefListType staleRefList; + bool needsStaleRefRescan; + + mutable JavaObject* findReferencesToObject; + std::vector foundReferencerObjects; +}; + + +class IncineratorManagedClassLoader +{ +protected: + enum StaleTags { + CorrectStaleRef = 0x1, + RefIsStale = 0x2 + }; + + uint8_t staleRefFlags; + + IncineratorManagedClassLoader() : staleRefFlags(CorrectStaleRef) {} + virtual ~IncineratorManagedClassLoader(); + +public: + bool isStale() const {return (staleRefFlags & RefIsStale) != 0;} + + void markStale(bool stale = true) { + if (stale) staleRefFlags |= RefIsStale; + else staleRefFlags &= ~RefIsStale; + } + + bool isStaleReferencesCorrectionEnabled() const { + return (staleRefFlags & CorrectStaleRef) != 0;} + + void setStaleReferencesCorrectionEnabled(bool enable) { + if (enable) staleRefFlags |= CorrectStaleRef; + else staleRefFlags &= ~CorrectStaleRef; + } +}; + +} + +#endif Propchange: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/lib/j3/VMCore/Incinerator.h ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp?rev=183679&view=auto ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp (added) +++ vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp Mon Jun 10 11:20:59 2013 @@ -0,0 +1,80 @@ + +#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 +} Propchange: vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/lib/j3/VMCore/IncineratorOSGi.cpp ------------------------------------------------------------------------------ svn:mime-type = text/plain 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=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.cpp Mon Jun 10 11:20:59 2013 @@ -1350,6 +1350,9 @@ Jnjvm::Jnjvm(vmkit::BumpPtrAllocator& Al vmkit::CompiledFrames** frames, JnjvmBootstrapLoader* loader) : VirtualMachine(Alloc, frames), lockSystem(Alloc) +#if RESET_STALE_REFERENCES +, incinerator(this) +#endif { classpath = getenv("CLASSPATH"); @@ -1388,6 +1391,10 @@ void Jnjvm::startCollection() { fflush(stdout); #endif +#if RESET_STALE_REFERENCES + incinerator.beforeCollection(); +#endif + finalizerThread->FinalizationQueueLock.acquire(); referenceThread->ToEnqueueLock.acquire(); referenceThread->SoftReferencesQueue.acquire(); @@ -1404,6 +1411,10 @@ void Jnjvm::endCollection() { finalizerThread->FinalizationCond.broadcast(); referenceThread->EnqueueCond.broadcast(); +#if RESET_STALE_REFERENCES + incinerator.afterCollection(); +#endif + #if DEBUG > 0 printf("End Collection\n"); vmkit::Thread::get()->printBacktrace(); 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=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/Jnjvm.h Mon Jun 10 11:20:59 2013 @@ -10,10 +10,6 @@ #ifndef JNJVM_JAVA_VM_H #define JNJVM_JAVA_VM_H -#include -#include -#include - #include "types.h" #include "vmkit/Allocator.h" @@ -26,6 +22,7 @@ #include "JnjvmConfig.h" #include "JNIReferences.h" #include "LockedMap.h" +#include "Incinerator.h" namespace j3 { @@ -365,6 +362,33 @@ public: void loadBootstrap(); static void printBacktrace() __attribute__((noinline)); + +#if RESET_STALE_REFERENCES +public: + Incinerator incinerator; + + virtual void markingFinalizersDone() { + incinerator.markingFinalizersDone(); + } + + virtual void collectorPhaseComplete() { + return incinerator.collectorPhaseComplete(); + } + + virtual bool beforeMarkingStackReference(const void* frameInfo, void** ref) { + const JavaMethod* method = (!frameInfo) ? NULL : + reinterpret_cast( + reinterpret_cast(frameInfo)->Metadata); + + return incinerator.scanStackRef(incinerator, method, + reinterpret_cast(ref)); + } + virtual bool beforeMarkingReference(const void* source, void** ref) { + return incinerator.scanRef(incinerator, + reinterpret_cast(source), + reinterpret_cast(ref)); + } +#endif }; } // end namespace j3 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=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.cpp Mon Jun 10 11:20:59 2013 @@ -879,29 +879,38 @@ JnjvmClassLoader::~JnjvmClassLoader() { if (classes) { classes->~ClassMap(); allocator.Deallocate(classes); + classes = NULL; } if (hashUTF8) { hashUTF8->~UTF8Map(); allocator.Deallocate(hashUTF8); + hashUTF8 = NULL; } if (javaTypes) { javaTypes->~TypeMap(); allocator.Deallocate(javaTypes); + javaTypes = NULL; } if (javaSignatures) { javaSignatures->~SignMap(); allocator.Deallocate(javaSignatures); + javaSignatures = NULL; } - for (std::vector::iterator i = nativeLibs.begin(); - i < nativeLibs.end(); ++i) { + for (std::vector::iterator + i = nativeLibs.begin(), e = nativeLibs.end(); i != e; ++i) + { dlclose(*i); } + nativeLibs.clear(); + + vm = NULL; delete TheCompiler; + TheCompiler = NULL; // Don't delete the allocator. The caller of this method must // delete it after the current object is deleted. 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=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/branches/incinerator/lib/j3/VMCore/JnjvmClassLoader.h Mon Jun 10 11:20:59 2013 @@ -25,6 +25,7 @@ #include "JavaArray.h" #include "JnjvmConfig.h" #include "UTF8.h" +#include "Incinerator.h" namespace j3 { @@ -56,7 +57,12 @@ 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 +#if RESET_STALE_REFERENCES + , public IncineratorManagedClassLoader +#endif +{ private: /// isolate - Which isolate defined me? Null for the bootstrap class loader. Modified: vmkit/branches/incinerator/mmtk/java/src/org/j3/mmtk/Collection.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/java/src/org/j3/mmtk/Collection.java?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/java/src/org/j3/mmtk/Collection.java (original) +++ vmkit/branches/incinerator/mmtk/java/src/org/j3/mmtk/Collection.java Mon Jun 10 11:20:59 2013 @@ -91,6 +91,7 @@ public final class Collection extends or * @param c the collector to prepare */ public native final void prepareCollector(CollectorContext c); + public native final void collectorPhaseComplete(CollectorContext c); /** * Rendezvous with all other processors, returning the rank Modified: vmkit/branches/incinerator/mmtk/java/src/org/mmtk/plan/SimpleCollector.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/java/src/org/mmtk/plan/SimpleCollector.java?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/java/src/org/mmtk/plan/SimpleCollector.java (original) +++ vmkit/branches/incinerator/mmtk/java/src/org/mmtk/plan/SimpleCollector.java Mon Jun 10 11:20:59 2013 @@ -143,7 +143,7 @@ public abstract class SimpleCollector ex } if (phaseId == Simple.COMPLETE) { - // Nothing to do + VM.collection.collectorPhaseComplete(this); return; } Modified: vmkit/branches/incinerator/mmtk/java/src/org/mmtk/vm/Collection.java URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/java/src/org/mmtk/vm/Collection.java?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/java/src/org/mmtk/vm/Collection.java (original) +++ vmkit/branches/incinerator/mmtk/java/src/org/mmtk/vm/Collection.java Mon Jun 10 11:20:59 2013 @@ -135,6 +135,7 @@ import org.vmmagic.pragma.*; * @param c the collector to prepare */ public abstract void prepareCollector(CollectorContext c); + public abstract void collectorPhaseComplete(CollectorContext c); /** * Rendezvous with all other processors, returning the rank Modified: vmkit/branches/incinerator/mmtk/mmtk-alloc/Selected.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/mmtk-alloc/Selected.cpp?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/mmtk-alloc/Selected.cpp (original) +++ vmkit/branches/incinerator/mmtk/mmtk-alloc/Selected.cpp Mon Jun 10 11:20:59 2013 @@ -184,6 +184,9 @@ void Collector::scanObject(FrameInfo* FI if ((*ptr) != NULL) { assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*ptr))); } +#if RESET_STALE_REFERENCES + if (!vmkit::Thread::get()->MyVM->beforeMarkingStackReference(FI, ptr)) return; +#endif JnJVM_org_j3_bindings_Bindings_reportDelayedRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2(closure, ptr); } @@ -194,6 +197,9 @@ void Collector::markAndTrace(void* sourc assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*ptr_))); } if ((*(void**)ptr) != NULL) assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*(void**)ptr))); +#if RESET_STALE_REFERENCES + if (!vmkit::Thread::get()->MyVM->beforeMarkingReference(source, ptr_)) return; +#endif JnJVM_org_j3_bindings_Bindings_processEdge__Lorg_mmtk_plan_TransitiveClosure_2Lorg_vmmagic_unboxed_ObjectReference_2Lorg_vmmagic_unboxed_Address_2(closure, source, ptr); } @@ -203,6 +209,9 @@ void Collector::markAndTraceRoot(void* s if ((*ptr_) != NULL) { assert(vmkit::Thread::get()->MyVM->isCorruptedType((gc*)(*ptr_))); } +#if RESET_STALE_REFERENCES + if (!vmkit::Thread::get()->MyVM->beforeMarkingReference(source, ptr_)) return; +#endif JnJVM_org_j3_bindings_Bindings_processRootEdge__Lorg_mmtk_plan_TraceLocal_2Lorg_vmmagic_unboxed_Address_2Z(closure, ptr, true); } Modified: vmkit/branches/incinerator/mmtk/mmtk-j3/Collection.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/mmtk-j3/Collection.cpp?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/mmtk-j3/Collection.cpp (original) +++ vmkit/branches/incinerator/mmtk/mmtk-j3/Collection.cpp Mon Jun 10 11:20:59 2013 @@ -76,6 +76,14 @@ extern "C" void Java_org_j3_mmtk_Collect // Nothing to do. } +extern "C" void Java_org_j3_mmtk_Collection_collectorPhaseComplete__Lorg_mmtk_plan_CollectorContext_2 (MMTkObject* C, MMTkObject* CC) +{ +#if RESET_STALE_REFERENCES + vmkit::MutatorThread* th = vmkit::MutatorThread::get(); + th->MyVM->collectorPhaseComplete(); +#endif +} + extern "C" void Java_org_j3_mmtk_Collection_prepareMutator__Lorg_mmtk_plan_MutatorContext_2 (MMTkObject* C, MMTkObject* MC) { } Modified: vmkit/branches/incinerator/mmtk/mmtk-j3/FinalizableProcessor.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/mmtk-j3/FinalizableProcessor.cpp?rev=183679&r1=183678&r2=183679&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/mmtk-j3/FinalizableProcessor.cpp (original) +++ vmkit/branches/incinerator/mmtk/mmtk-j3/FinalizableProcessor.cpp Mon Jun 10 11:20:59 2013 @@ -27,6 +27,9 @@ extern "C" void Java_org_j3_mmtk_FinalizableProcessor_scan__Lorg_mmtk_plan_TraceLocal_2Z (MMTkObject* FP, MMTkObject* TL, uint8_t nursery) { vmkit::Thread* th = vmkit::Thread::get(); th->MyVM->scanFinalizationQueue(reinterpret_cast(TL)); +#if RESET_STALE_REFERENCES + th->MyVM->markingFinalizersDone(); +#endif } } From koutheir at gmail.com Mon Jun 10 09:21:31 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:21:31 -0000 Subject: [vmkit-commits] [vmkit] r183680 - Adding Incinerator feature to J3. Updating configuration. Message-ID: <20130610162131.561DF2A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:21:30 2013 New Revision: 183680 URL: http://llvm.org/viewvc/llvm-project?rev=183680&view=rev Log: Adding Incinerator feature to J3. Updating configuration. Modified: vmkit/branches/incinerator/configure Modified: vmkit/branches/incinerator/configure URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/configure?rev=183680&r1=183679&r2=183680&view=diff ============================================================================== --- vmkit/branches/incinerator/configure (original) +++ vmkit/branches/incinerator/configure Mon Jun 10 11:21:30 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'" @@ -717,6 +737,7 @@ with_gnu_classpath_libs with_gnu_classpath_glibj with_openjdk_path with_classpath_impl +enable_incinerator ' ac_precious_vars='build_alias host_alias @@ -1182,8 +1203,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 @@ -1347,6 +1366,8 @@ Optional Features: yes) --enable-debug Build with debug flags (default is no) --enable-assert Build with assert flags (default is yes) + --enable-incinerator Use incinerator to kill stale references in OSGi + (default is NO) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1444,9 +1465,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 +1545,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 +1890,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 +2929,23 @@ esac +# Check whether --enable-incinerator was given. +if test "${enable_incinerator+set}" = set; then : + enableval=$enable_incinerator; +else + enable_incinerator=no +fi + +case "$enable_incinerator" in + yes) $as_echo "#define RESET_STALE_REFERENCES 1" >>confdefs.h + ;; + no) ;; #AC_DEFINE(RESET_STALE_REFERENCES,[0]) ;; + *) as_fn_error $? "Invalid setting for --enable-incinerator. Use \"yes\" or \"no\"" "$LINENO" 5 ;; +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 +3019,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 +3060,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 +3099,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 +3159,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 +3206,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 +3247,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 +3288,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 +3329,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 +3369,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 +3409,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 +3463,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 +3503,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 +3544,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 +3609,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 @@ -3644,7 +3682,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 +3762,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 +3802,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 +3855,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 +3896,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 +3954,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 +3998,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 +4444,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 +4739,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 +5464,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 +5533,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 +5564,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 +5626,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 +5719,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' From koutheir at gmail.com Mon Jun 10 09:32:56 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:32:56 -0000 Subject: [vmkit-commits] [vmkit] r183681 - Adding Incinerator feature to J3. Added project files. Message-ID: <20130610163257.0CF252A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:32:56 2013 New Revision: 183681 URL: http://llvm.org/viewvc/llvm-project?rev=183681&view=rev Log: Adding Incinerator feature to J3. Added project files. Added: vmkit/branches/incinerator/.autotools (with props) vmkit/branches/incinerator/.cproject (with props) Added: vmkit/branches/incinerator/.autotools URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/.autotools?rev=183681&view=auto ============================================================================== --- vmkit/branches/incinerator/.autotools (added) +++ vmkit/branches/incinerator/.autotools Mon Jun 10 11:32:56 2013 @@ -0,0 +1,42 @@ + + + + + Propchange: vmkit/branches/incinerator/.autotools ------------------------------------------------------------------------------ svn:executable = * Added: vmkit/branches/incinerator/.cproject URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/.cproject?rev=183681&view=auto ============================================================================== --- vmkit/branches/incinerator/.cproject (added) +++ vmkit/branches/incinerator/.cproject Mon Jun 10 11:32:56 2013 @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Propchange: vmkit/branches/incinerator/.cproject ------------------------------------------------------------------------------ svn:executable = * Propchange: vmkit/branches/incinerator/.cproject ------------------------------------------------------------------------------ svn:mime-type = text/plain From koutheir at gmail.com Mon Jun 10 09:46:08 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:46:08 -0000 Subject: [vmkit-commits] [vmkit] r183683 - Cleaning up. Message-ID: <20130610164608.9A82A2A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:46:08 2013 New Revision: 183683 URL: http://llvm.org/viewvc/llvm-project?rev=183683&view=rev Log: Cleaning up. Removed: vmkit/branches/incinerator/osgi/ From koutheir at gmail.com Mon Jun 10 09:47:40 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Mon, 10 Jun 2013 16:47:40 -0000 Subject: [vmkit-commits] [vmkit] r183684 - Cleaning up. Message-ID: <20130610164740.BC77E2A6C029@llvm.org> Author: koutheir Date: Mon Jun 10 11:47:40 2013 New Revision: 183684 URL: http://llvm.org/viewvc/llvm-project?rev=183684&view=rev Log: Cleaning up. Removed: vmkit/branches/incinerator/tests/benchmarks/ From koutheir at gmail.com Thu Jun 20 05:38:37 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Thu, 20 Jun 2013 12:38:37 -0000 Subject: [vmkit-commits] [vmkit] r184414 - Migrating to LLVM version 3.3 release. Message-ID: <20130620123838.588812A6C029@llvm.org> Author: koutheir Date: Thu Jun 20 07:38:37 2013 New Revision: 184414 URL: http://llvm.org/viewvc/llvm-project?rev=184414&view=rev Log: Migrating to LLVM version 3.3 release. Modified: vmkit/branches/incinerator/README.TXT vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h vmkit/branches/incinerator/include/vmkit/InlineCommon.h vmkit/branches/incinerator/lib/j3/Compiler/EscapeAnalysis.cpp 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/JavaJIT.h vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp vmkit/branches/incinerator/lib/j3/Compiler/LLVMInfo.cpp vmkit/branches/incinerator/lib/j3/Compiler/LowerConstantCalls.cpp vmkit/branches/incinerator/lib/static-gc-pass/StaticGCPass.cpp vmkit/branches/incinerator/lib/static-gc-printer/VmkitGCPrinter.cpp vmkit/branches/incinerator/lib/vmkit/Compiler/InlineMalloc.cpp vmkit/branches/incinerator/lib/vmkit/Compiler/JIT.cpp vmkit/branches/incinerator/lib/vmkit/JITGCPass/JITGCPass.cpp vmkit/branches/incinerator/mmtk/magic/LowerJavaRT.cpp vmkit/branches/incinerator/mmtk/magic/LowerMagic.cpp vmkit/branches/incinerator/patches/llvm.patch vmkit/branches/incinerator/tools/vmjc/vmjc.cpp Modified: vmkit/branches/incinerator/README.TXT URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/README.TXT?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/README.TXT (original) +++ vmkit/branches/incinerator/README.TXT Thu Jun 20 07:38:37 2013 @@ -53,24 +53,24 @@ ln -sf ../native/jni/java-util/.libs/lib LLVM: ===== -* Get the compatible release LLVM 3.2: +* Get the compatible release LLVM 3.3: -wget http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz -tar zxf llvm-3.2.src.tar.gz -cd llvm-3.2.src/tools -wget http://llvm.org/releases/3.2/clang-3.2.src.tar.gz -tar zxf clang-3.2.src.tar.gz -mv clang-3.2.src clang +wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz +tar zxf llvm-3.3.src.tar.gz +cd llvm-3.3.src/tools +wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz +tar zxf cfe-3.3.src.tar.gz +mv cfe-3.3.src clang cd ../projects -wget http://llvm.org/releases/3.2/compiler-rt-3.2.src.tar.gz -tar zxf compiler-rt-3.2.src.tar.gz -mv compiler-rt-3.2.src compiler-rt +wget http://llvm.org/releases/3.3/compiler-rt-3.3.src.tar.gz +tar zxf compiler-rt-3.3.src.tar.gz +mv compiler-rt-3.3.src compiler-rt cd ../.. * Patch LLVM if you want to have a better debug support for VMKit: You will have to get VMKit (see the next section) to find the patch. -cd llvm-3.2.src +cd llvm-3.3.src patch -p1 < ../vmkit2/patches/llvm.patch NOTICE: @@ -80,12 +80,12 @@ NOTICE: * Make it (release mode): -./configure --enable-optimized --enable-assertions --enable-jit --enable-threads --enable-pthreads --enable-pic --enable-targets=x86,cpp --disable-docs --disable-doxygen +./configure --enable-optimized --enable-assertions --enable-jit --enable-cxx11 --enable-threads --enable-pthreads --enable-pic --enable-targets=host,cpp --enable-zlib --disable-docs --disable-doxygen make -j12 BUILD_EXAMPLES=0 ENABLE_DOCS=0 * You can also make it in debug mode, but this is is not necessary to debug compiled programs: -./configure --disable-optimized --enable-assertions --enable-debug-runtime --enable-debug-symbols --enable-keep-symbols --enable-jit --enable-threads --enable-pthreads --enable-pic --enable-targets=x86,cpp --disable-docs --disable-doxygen +./configure --disable-optimized --enable-debug-runtime --enable-debug-symbols --enable-keep-symbols --enable-assertions --enable-jit --enable-cxx11 --enable-threads --enable-pthreads --enable-pic --enable-targets=host,cpp --enable-zlib --disable-docs --disable-doxygen * Build it: @@ -95,13 +95,13 @@ make -j12 BUILD_EXAMPLES=0 ENABLE_DOCS=0 VMKit: ====== -* Get it anonymously (git): +* Get it anonymously: -git clone git://scm.gforge.inria.fr/vmkit2/vmkit2.git +svn co http://llvm.org/svn/llvm-project/vmkit/trunk -* or get as an official developer (Git): +* or get as an official developer: -git clone git+ssh://YOUR_USER_NAME at scm.gforge.inria.fr//gitroot/vmkit2/vmkit2.git +svn co https://YOUR_USER_NAME at llvm.org/svn/llvm-project/vmkit/trunk * Make it (release mode): @@ -118,4 +118,3 @@ git clone git+ssh://YOUR_USER_NAME at scm.g * Build it: make -j12 - Modified: vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/branches/incinerator/include/j3/JavaLLVMCompiler.h Thu Jun 20 07:38:37 2013 @@ -15,8 +15,8 @@ #include "j3/LLVMInfo.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include Modified: vmkit/branches/incinerator/include/vmkit/InlineCommon.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/include/vmkit/InlineCommon.h?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/include/vmkit/InlineCommon.h (original) +++ vmkit/branches/incinerator/include/vmkit/InlineCommon.h Thu Jun 20 07:38:37 2013 @@ -1,13 +1,13 @@ #ifndef _INLINE_COMMON_H_ #define _INLINE_COMMON_H_ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace vmkit { extern "C" void makeLLVMFunctions_FinalMMTk(llvm::Module*); Modified: vmkit/branches/incinerator/lib/j3/Compiler/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/EscapeAnalysis.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/EscapeAnalysis.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/EscapeAnalysis.cpp Thu Jun 20 07:38:37 2013 @@ -8,12 +8,12 @@ //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/GlobalVariable.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" -#include "llvm/Instructions.h" +#include "llvm/IR/Instructions.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" @@ -127,7 +127,7 @@ static bool escapes(Value* Ins, std::map CallSite::arg_iterator B = CS.arg_begin(), E = CS.arg_end(); for (CallSite::arg_iterator A = B; A != E; ++A) { if (A->get() == Ins && - !CS.paramHasAttr(A - B + 1, Attributes::NoCapture)) { + !CS.paramHasAttr(A - B + 1, Attribute::NoCapture)) { return true; } } 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=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/J3Intrinsics.cpp Thu Jun 20 07:38:37 2013 @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "vmkit/JIT.h" 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=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaAOTCompiler.cpp Thu Jun 20 07:38:37 2013 @@ -7,15 +7,15 @@ // //===----------------------------------------------------------------------===// -#include "llvm/BasicBlock.h" -#include "llvm/Constants.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/PassManager.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/TargetRegistry.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "vmkit/UTF8.h" #include "vmkit/Thread.h" 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=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.cpp Thu Jun 20 07:38:37 2013 @@ -16,12 +16,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "vmkit/JIT.h" @@ -1003,7 +1003,10 @@ llvm::Function* JavaJIT::javaCompile() { string methName, methNameLink; DbgSubprogram = TheCompiler->getDebugFactory()->createFunction( - DIDescriptor(), compilingMethod->getName(methName, false), compilingMethod->getName(methNameLink, true), DIFile(), 0, DIType(), false, false, 0); + DIDescriptor(), compilingMethod->getName(methName, false), + compilingMethod->getName(methNameLink, true), DIFile(), 0, + TheCompiler->getDebugFactory()->createSubroutineType(DIFile(), DIArray()), + false, false, 0); JavaAttribute* codeAtt = compilingMethod->lookupAttribute(JavaAttribute::codeAttribute); @@ -1290,11 +1293,12 @@ llvm::Function* JavaJIT::javaCompile() { const UTF8* name = compilingClass->ctpInfo->UTF8At(AR.AnnotationNameIndex); if (name->equals(TheCompiler->InlinePragma)) { - llvmFunction->removeFnAttr( - Attributes::get(*llvmContext, llvm::Attributes::NoInline)); - llvmFunction->addFnAttr(llvm::Attributes::AlwaysInline); + llvmFunction->removeAttributes(llvm::AttributeSet::FunctionIndex, + llvm::AttributeSet::get(*llvmContext, + llvm::AttributeSet::FunctionIndex, llvm::Attribute::NoInline)); + llvmFunction->addFnAttr(llvm::Attribute::AlwaysInline); } else if (name->equals(TheCompiler->NoInlinePragma)) { - llvmFunction->addFnAttr(llvm::Attributes::NoInline); + llvmFunction->addFnAttr(llvm::Attribute::NoInline); } } } Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.h?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.h (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJIT.h Thu Jun 20 07:38:37 2013 @@ -13,13 +13,13 @@ #include #include -#include "llvm/BasicBlock.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Metadata.h" -#include "llvm/Type.h" -#include "llvm/Value.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Metadata.h" +#include "llvm/IR/Type.h" +#include "llvm/IR/Value.h" #include "llvm/DIBuilder.h" #include "llvm/DebugInfo.h" #include "llvm/Support/DebugLoc.h" 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=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJITCompiler.cpp Thu Jun 20 07:38:37 2013 @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/DebugInfo.h" #include "llvm/CodeGen/GCStrategy.h" #include @@ -22,7 +22,7 @@ #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include #include "VmkitGC.h" Modified: vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaJITOpcodes.cpp Thu Jun 20 07:38:37 2013 @@ -14,12 +14,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "vmkit/JIT.h" 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=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/JavaLLVMCompiler.cpp Thu Jun 20 07:38:37 2013 @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/PassManager.h" #include "llvm/DIBuilder.h" #include "llvm/Analysis/LoopPass.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "vmkit/JIT.h" Modified: vmkit/branches/incinerator/lib/j3/Compiler/LLVMInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/LLVMInfo.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/LLVMInfo.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/LLVMInfo.cpp Thu Jun 20 07:38:37 2013 @@ -7,14 +7,14 @@ // //===----------------------------------------------------------------------===// -#include "llvm/BasicBlock.h" -#include "llvm/CallingConv.h" -#include "llvm/Constants.h" -#include "llvm/Instructions.h" -#include "llvm/Module.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/CallingConv.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/Module.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/MutexGuard.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "vmkit/JIT.h" @@ -191,9 +191,9 @@ Function* LLVMMethodInfo::getMethod(Clas result->setGC("vmkit"); if (Compiler->useCooperativeGC()) { - result->addFnAttr(Attributes::NoInline); + result->addFnAttr(Attribute::NoInline); } - result->addFnAttr(Attributes::NoUnwind); + result->addFnAttr(Attribute::NoUnwind); Compiler->functions.insert(std::make_pair(result, methodDef)); if (!Compiler->isStaticCompiling() && !customizing && methodDef->code) { @@ -460,8 +460,8 @@ Function* LLVMSignatureInfo::createFunct } res->setGC("vmkit"); - res->addFnAttr(Attributes::NoInline); - res->addFnAttr(Attributes::NoUnwind); + res->addFnAttr(Attribute::NoInline); + res->addFnAttr(Attribute::NoUnwind); if (virt) { Compiler->virtualBufs[FTy] = res; @@ -550,8 +550,8 @@ Function* LLVMSignatureInfo::createFunct } res->setGC("vmkit"); - res->addFnAttr(Attributes::NoInline); - res->addFnAttr(Attributes::NoUnwind); + res->addFnAttr(Attribute::NoInline); + res->addFnAttr(Attribute::NoUnwind); if (virt) { Compiler->virtualAPs[FTy] = res; @@ -671,8 +671,8 @@ Function* LLVMSignatureInfo::createFunct } stub->setGC("vmkit"); - stub->addFnAttr(Attributes::NoInline); - stub->addFnAttr(Attributes::NoUnwind); + stub->addFnAttr(Attribute::NoInline); + stub->addFnAttr(Attribute::NoUnwind); if (virt) { Compiler->virtualStubs[FTy] = stub; Modified: vmkit/branches/incinerator/lib/j3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/j3/Compiler/LowerConstantCalls.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/j3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/branches/incinerator/lib/j3/Compiler/LowerConstantCalls.cpp Thu Jun 20 07:38:37 2013 @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/GlobalVariable.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/GlobalVariable.h" #include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" Modified: vmkit/branches/incinerator/lib/static-gc-pass/StaticGCPass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/static-gc-pass/StaticGCPass.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/static-gc-pass/StaticGCPass.cpp (original) +++ vmkit/branches/incinerator/lib/static-gc-pass/StaticGCPass.cpp Thu Jun 20 07:38:37 2013 @@ -9,8 +9,8 @@ //===----------------------------------------------------------------------===// -#include "llvm/Intrinsics.h" -#include "llvm/Module.h" +#include "llvm/IR/Intrinsics.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/raw_ostream.h" Modified: vmkit/branches/incinerator/lib/static-gc-printer/VmkitGCPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/static-gc-printer/VmkitGCPrinter.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/static-gc-printer/VmkitGCPrinter.cpp (original) +++ vmkit/branches/incinerator/lib/static-gc-printer/VmkitGCPrinter.cpp Thu Jun 20 07:38:37 2013 @@ -7,23 +7,23 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Type.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Type.h" #include "llvm/CodeGen/GCs.h" #include "llvm/CodeGen/GCStrategy.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/GCMetadataPrinter.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/Module.h" +#include "llvm/IR/Module.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCStreamer.h" #include "llvm/Target/Mangler.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" Modified: vmkit/branches/incinerator/lib/vmkit/Compiler/InlineMalloc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/vmkit/Compiler/InlineMalloc.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/vmkit/Compiler/InlineMalloc.cpp (original) +++ vmkit/branches/incinerator/lib/vmkit/Compiler/InlineMalloc.cpp Thu Jun 20 07:38:37 2013 @@ -7,16 +7,16 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/GlobalVariable.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "llvm/Transforms/Utils/Cloning.h" #include "vmkit/JIT.h" Modified: vmkit/branches/incinerator/lib/vmkit/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/vmkit/Compiler/JIT.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/vmkit/Compiler/JIT.cpp (original) +++ vmkit/branches/incinerator/lib/vmkit/Compiler/JIT.cpp Thu Jun 20 07:38:37 2013 @@ -7,16 +7,16 @@ // //===----------------------------------------------------------------------===// -#include -#include +#include +#include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include -#include +#include #include #include #include @@ -27,12 +27,12 @@ #include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/Support/CommandLine.h" #include -#include +#include #include #include #include #include -#include +#include #include #include #include Modified: vmkit/branches/incinerator/lib/vmkit/JITGCPass/JITGCPass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/lib/vmkit/JITGCPass/JITGCPass.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/lib/vmkit/JITGCPass/JITGCPass.cpp (original) +++ vmkit/branches/incinerator/lib/vmkit/JITGCPass/JITGCPass.cpp Thu Jun 20 07:38:37 2013 @@ -9,8 +9,8 @@ //===----------------------------------------------------------------------===// -#include "llvm/Intrinsics.h" -#include "llvm/Module.h" +#include "llvm/IR/Intrinsics.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/raw_ostream.h" Modified: vmkit/branches/incinerator/mmtk/magic/LowerJavaRT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/magic/LowerJavaRT.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/magic/LowerJavaRT.cpp (original) +++ vmkit/branches/incinerator/mmtk/magic/LowerJavaRT.cpp Thu Jun 20 07:38:37 2013 @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" Modified: vmkit/branches/incinerator/mmtk/magic/LowerMagic.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/mmtk/magic/LowerMagic.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/mmtk/magic/LowerMagic.cpp (original) +++ vmkit/branches/incinerator/mmtk/magic/LowerMagic.cpp Thu Jun 20 07:38:37 2013 @@ -8,11 +8,11 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" Modified: vmkit/branches/incinerator/patches/llvm.patch URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/patches/llvm.patch?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/patches/llvm.patch (original) +++ vmkit/branches/incinerator/patches/llvm.patch Thu Jun 20 07:38:37 2013 @@ -1,57 +1,6 @@ ---- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 2012-11-01 10:14:31.000000000 +0100 -+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 2013-03-28 17:37:24.297848000 +0100 -@@ -174,22 +174,22 @@ bool AsmPrinter::doInitialization(Module - - GCModuleInfo *MI = getAnalysisIfAvailable(); - assert(MI && "AsmPrinter didn't require GCModuleInfo?"); - for (GCModuleInfo::iterator I = MI->begin(), E = MI->end(); I != E; ++I) - if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*I)) - MP->beginAssembly(*this); -- -+/* - // Emit module-level inline asm if it exists. - if (!M.getModuleInlineAsm().empty()) { - OutStreamer.AddComment("Start of file scope inline assembly"); - OutStreamer.AddBlankLine(); - EmitInlineAsm(M.getModuleInlineAsm()+"\n"); - OutStreamer.AddComment("End of file scope inline assembly"); - OutStreamer.AddBlankLine(); - } -- -+*/ - if (MAI->doesSupportDebugInformation()) - DD = new DwarfDebug(this, &M); - - switch (MAI->getExceptionHandlingType()) { - case ExceptionHandling::None: - return false; -@@ -925,12 +925,21 @@ bool AsmPrinter::doFinalization(Module & - GCModuleInfo *MI = getAnalysisIfAvailable(); - assert(MI && "AsmPrinter didn't require GCModuleInfo?"); - for (GCModuleInfo::iterator I = MI->end(), E = MI->begin(); I != E; ) - if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*--I)) - MP->finishAssembly(*this); - -+ // Emit module-level inline asm if it exists. -+ if (!M.getModuleInlineAsm().empty()) { -+ OutStreamer.AddComment("Start of file scope inline assembly"); -+ OutStreamer.AddBlankLine(); -+ EmitInlineAsm(M.getModuleInlineAsm()+"\n"); -+ OutStreamer.AddComment("End of file scope inline assembly"); -+ OutStreamer.AddBlankLine(); -+ } -+ - // If we don't have any trampolines, then we don't require stack memory - // to be executable. Some targets have a directive to declare this. - Function *InitTrampolineIntrinsic = M.getFunction("llvm.init.trampoline"); - if (!InitTrampolineIntrinsic || InitTrampolineIntrinsic->use_empty()) - if (const MCSection *S = MAI->getNonexecutableStackSection(OutContext)) - OutStreamer.SwitchSection(S); ---- a/lib/Target/CppBackend/CPPBackend.cpp 2012-11-23 20:56:57.000000000 +0100 -+++ b/lib/Target/CppBackend/CPPBackend.cpp 2013-03-28 17:37:24.302140000 +0100 -@@ -372,12 +372,13 @@ std::string CppWriter::getCppName(Type* - } - case Type::X86_FP80TyID: return "Type::getX86_FP80Ty(mod->getContext())"; +--- a/lib/Target/CppBackend/CPPBackend.cpp 2013-03-25 18:42:20.000000000 +0100 ++++ a/lib/Target/CppBackend/CPPBackend.cpp 2013-06-20 10:57:56.348917453 +0200 +@@ -374,8 +374,9 @@ std::string CppWriter::getCppName(Type* case Type::FloatTyID: return "Type::getFloatTy(mod->getContext())"; case Type::DoubleTyID: return "Type::getDoubleTy(mod->getContext())"; case Type::LabelTyID: return "Type::getLabelTy(mod->getContext())"; @@ -61,98 +10,28 @@ error("Invalid primitive type"); break; } - // shouldn't be returned, but make it sensible - return "Type::getVoidTy(mod->getContext())"; -@@ -442,12 +443,14 @@ std::string CppWriter::getCppName(const - name += std::string("_") + utostr(uniqueNum++); - UsedNames.insert(name); +@@ -444,8 +445,10 @@ std::string CppWriter::getCppName(const return ValueNames[val] = name; } else { name = getTypePrefix(val->getType()); } -+ } else if (dyn_cast(val)) { -+ name = std::string("metadata_"); ++ } else if (isa(val)) { ++ name = std::string("metadata_"); } else { name = getTypePrefix(val->getType()); } if (val->hasName()) - name += val->getName(); - else -@@ -1408,12 +1411,16 @@ void CppWriter::printInstruction(const I - << getCppName(ila->getFunctionType()) << ", \"" - << ila->getAsmString() << "\", \"" +@@ -1420,8 +1423,13 @@ void CppWriter::printInstruction(const I << ila->getConstraintString() << "\"," << (ila->hasSideEffects() ? "true" : "false") << ");"; nl(Out); } + if (const Function* F = dyn_cast(call->getCalledValue())) { -+ if ((F->getName().compare("llvm.dbg.value") == 0) || (F->getName().compare("llvm.dbg.declare") == 0)) -+ break; //Generate nothing ++ // Do not generate anything for debugging symbols intrinsics ++ if (F->getName().compare("llvm.dbg.value" ) == 0) break; ++ if (F->getName().compare("llvm.dbg.declare") == 0) break; + } if (call->getNumArgOperands() > 1) { Out << "std::vector " << iName << "_params;"; nl(Out); for (unsigned i = 0; i < call->getNumArgOperands(); ++i) { - Out << iName << "_params.push_back(" << opNames[i] << ");"; - nl(Out); ---- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp 2012-11-07 06:19:04.000000000 +0100 -+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp 2013-03-30 01:20:19.820477000 +0100 -@@ -1149,21 +1149,22 @@ const MCSymbol *DwarfDebug::getLabelAfte - /// beginInstruction - Process beginning of an instruction. - void DwarfDebug::beginInstruction(const MachineInstr *MI) { - // Check if source location changes, but ignore DBG_VALUE locations. - if (!MI->isDebugValue()) { - DebugLoc DL = MI->getDebugLoc(); - if (DL != PrevInstLoc && (!DL.isUnknown() || UnknownLocations)) { -- unsigned Flags = 0; -+ unsigned Flags = DWARF2_FLAG_IS_STMT; - PrevInstLoc = DL; - if (DL == PrologEndLoc) { - Flags |= DWARF2_FLAG_PROLOGUE_END; - PrologEndLoc = DebugLoc(); - } -+/* - if (PrologEndLoc.isUnknown()) - Flags |= DWARF2_FLAG_IS_STMT; -- -+*/ - if (!DL.isUnknown()) { - const MDNode *Scope = DL.getScope(Asm->MF->getFunction()->getContext()); - recordSourceLine(DL.getLine(), DL.getCol(), Scope, Flags); - } else - recordSourceLine(0, 0, 0, 0); - } -@@ -1439,13 +1440,13 @@ void DwarfDebug::beginFunction(const Mac - // Record beginning of function. - if (!PrologEndLoc.isUnknown()) { - DebugLoc FnStartDL = getFnDebugLoc(PrologEndLoc, - MF->getFunction()->getContext()); - recordSourceLine(FnStartDL.getLine(), FnStartDL.getCol(), - FnStartDL.getScope(MF->getFunction()->getContext()), -- 0); -+ DWARF2_FLAG_IS_STMT); - } - } - - void DwarfDebug::addScopeVariable(LexicalScope *LS, DbgVariable *Var) { - // SmallVector &Vars = ScopeVariables.lookup(LS); - ScopeVariables[LS].push_back(Var); ---- a/test/DebugInfo/X86/ending-run.ll 2012-04-05 22:39:05.000000000 +0200 -+++ b/test/DebugInfo/X86/ending-run.ll 2013-03-30 01:25:51.458268000 +0100 -@@ -1,14 +1,12 @@ - ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj - ; RUN: llvm-dwarfdump %t | FileCheck %s - --; Check that the line table starts at 7, not 4, but that the first --; statement isn't until line 8. -+; Check that the line table starts at 7, not 4. - --; CHECK-NOT: 0x0000000000000000 7 0 1 0 is_stmt --; CHECK: 0x0000000000000000 7 0 1 0 -+; CHECK: 0x0000000000000000 7 0 1 0 is_stmt - ; CHECK: 0x0000000000000004 8 18 1 0 is_stmt prologue_end - - define i32 @callee(i32 %x) nounwind uwtable ssp { - entry: - %x.addr = alloca i32, align 4 - %y = alloca i32, align 4 Modified: vmkit/branches/incinerator/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/incinerator/tools/vmjc/vmjc.cpp?rev=184414&r1=184413&r2=184414&view=diff ============================================================================== --- vmkit/branches/incinerator/tools/vmjc/vmjc.cpp (original) +++ vmkit/branches/incinerator/tools/vmjc/vmjc.cpp Thu Jun 20 07:38:37 2013 @@ -17,15 +17,15 @@ #include #include "llvm/LinkAllPasses.h" -#include "llvm/LinkAllVMCore.h" -#include "llvm/Module.h" +#include "llvm/LinkAllIR.h" +#include "llvm/IR/Module.h" #include "llvm/PassManager.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/IRReader.h" +#include "llvm/IRReader/IRReader.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PassNameParser.h" @@ -34,7 +34,7 @@ #include "llvm/Support/SystemUtils.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Signals.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "llvm/Target/TargetMachine.h" From koutheir at gmail.com Fri Jun 21 01:02:30 2013 From: koutheir at gmail.com (Koutheir Attouchi) Date: Fri, 21 Jun 2013 08:02:30 -0000 Subject: [vmkit-commits] [vmkit] r184537 - Migrating to LLVM version 3.3 release. Message-ID: <20130621080231.289092A6C029@llvm.org> Author: koutheir Date: Fri Jun 21 03:02:29 2013 New Revision: 184537 URL: http://llvm.org/viewvc/llvm-project?rev=184537&view=rev Log: Migrating to LLVM version 3.3 release. Modified: vmkit/trunk/README.TXT vmkit/trunk/include/j3/JavaLLVMCompiler.h vmkit/trunk/include/vmkit/InlineCommon.h vmkit/trunk/lib/j3/Compiler/EscapeAnalysis.cpp vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp vmkit/trunk/lib/j3/Compiler/JavaJIT.h vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp vmkit/trunk/lib/j3/Compiler/LLVMInfo.cpp vmkit/trunk/lib/j3/Compiler/LowerConstantCalls.cpp vmkit/trunk/lib/static-gc-pass/StaticGCPass.cpp vmkit/trunk/lib/static-gc-printer/VmkitGCPrinter.cpp vmkit/trunk/lib/vmkit/Compiler/InlineMalloc.cpp vmkit/trunk/lib/vmkit/Compiler/JIT.cpp vmkit/trunk/lib/vmkit/JITGCPass/JITGCPass.cpp vmkit/trunk/mmtk/magic/LowerJavaRT.cpp vmkit/trunk/mmtk/magic/LowerMagic.cpp vmkit/trunk/patches/llvm.patch vmkit/trunk/tools/vmjc/vmjc.cpp Modified: vmkit/trunk/README.TXT URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/README.TXT?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/README.TXT (original) +++ vmkit/trunk/README.TXT Fri Jun 21 03:02:29 2013 @@ -53,24 +53,24 @@ ln -sf ../native/jni/java-util/.libs/lib LLVM: ===== -* Get the compatible release LLVM 3.2: +* Get the compatible release LLVM 3.3: -wget http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz -tar zxf llvm-3.2.src.tar.gz -cd llvm-3.2.src/tools -wget http://llvm.org/releases/3.2/clang-3.2.src.tar.gz -tar zxf clang-3.2.src.tar.gz -mv clang-3.2.src clang +wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz +tar zxf llvm-3.3.src.tar.gz +cd llvm-3.3.src/tools +wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz +tar zxf cfe-3.3.src.tar.gz +mv cfe-3.3.src clang cd ../projects -wget http://llvm.org/releases/3.2/compiler-rt-3.2.src.tar.gz -tar zxf compiler-rt-3.2.src.tar.gz -mv compiler-rt-3.2.src compiler-rt +wget http://llvm.org/releases/3.3/compiler-rt-3.3.src.tar.gz +tar zxf compiler-rt-3.3.src.tar.gz +mv compiler-rt-3.3.src compiler-rt cd ../.. * Patch LLVM if you want to have a better debug support for VMKit: You will have to get VMKit (see the next section) to find the patch. -cd llvm-3.2.src +cd llvm-3.3.src patch -p1 < ../vmkit2/patches/llvm.patch NOTICE: @@ -80,12 +80,12 @@ NOTICE: * Make it (release mode): -./configure --enable-optimized --enable-assertions --enable-jit --enable-threads --enable-pthreads --enable-pic --enable-targets=x86,cpp --disable-docs --disable-doxygen +./configure --enable-optimized --enable-assertions --enable-jit --enable-cxx11 --enable-threads --enable-pthreads --enable-pic --enable-targets=host,cpp --enable-zlib --disable-docs --disable-doxygen make -j12 BUILD_EXAMPLES=0 ENABLE_DOCS=0 * You can also make it in debug mode, but this is is not necessary to debug compiled programs: -./configure --disable-optimized --enable-assertions --enable-debug-runtime --enable-debug-symbols --enable-keep-symbols --enable-jit --enable-threads --enable-pthreads --enable-pic --enable-targets=x86,cpp --disable-docs --disable-doxygen +./configure --disable-optimized --enable-debug-runtime --enable-debug-symbols --enable-keep-symbols --enable-assertions --enable-jit --enable-cxx11 --enable-threads --enable-pthreads --enable-pic --enable-targets=host,cpp --enable-zlib --disable-docs --disable-doxygen * Build it: @@ -95,13 +95,13 @@ make -j12 BUILD_EXAMPLES=0 ENABLE_DOCS=0 VMKit: ====== -* Get it anonymously (git): +* Get it anonymously: -git clone git://scm.gforge.inria.fr/vmkit2/vmkit2.git +svn co http://llvm.org/svn/llvm-project/vmkit/trunk -* or get as an official developer (Git): +* or get as an official developer: -git clone git+ssh://YOUR_USER_NAME at scm.gforge.inria.fr//gitroot/vmkit2/vmkit2.git +svn co https://YOUR_USER_NAME at llvm.org/svn/llvm-project/vmkit/trunk * Make it (release mode): @@ -118,4 +118,3 @@ git clone git+ssh://YOUR_USER_NAME at scm.g * Build it: make -j12 - Modified: vmkit/trunk/include/j3/JavaLLVMCompiler.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/j3/JavaLLVMCompiler.h?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/include/j3/JavaLLVMCompiler.h (original) +++ vmkit/trunk/include/j3/JavaLLVMCompiler.h Fri Jun 21 03:02:29 2013 @@ -15,8 +15,8 @@ #include "j3/LLVMInfo.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include Modified: vmkit/trunk/include/vmkit/InlineCommon.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/vmkit/InlineCommon.h?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/include/vmkit/InlineCommon.h (original) +++ vmkit/trunk/include/vmkit/InlineCommon.h Fri Jun 21 03:02:29 2013 @@ -1,13 +1,13 @@ #ifndef _INLINE_COMMON_H_ #define _INLINE_COMMON_H_ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace vmkit { extern "C" void makeLLVMFunctions_FinalMMTk(llvm::Module*); Modified: vmkit/trunk/lib/j3/Compiler/EscapeAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/EscapeAnalysis.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/EscapeAnalysis.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/EscapeAnalysis.cpp Fri Jun 21 03:02:29 2013 @@ -8,12 +8,12 @@ //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/GlobalVariable.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" -#include "llvm/Instructions.h" +#include "llvm/IR/Instructions.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" @@ -127,7 +127,7 @@ static bool escapes(Value* Ins, std::map CallSite::arg_iterator B = CS.arg_begin(), E = CS.arg_end(); for (CallSite::arg_iterator A = B; A != E; ++A) { if (A->get() == Ins && - !CS.paramHasAttr(A - B + 1, Attributes::NoCapture)) { + !CS.paramHasAttr(A - B + 1, Attribute::NoCapture)) { return true; } } Modified: vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/J3Intrinsics.cpp Fri Jun 21 03:02:29 2013 @@ -7,10 +7,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "vmkit/JIT.h" Modified: vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaAOTCompiler.cpp Fri Jun 21 03:02:29 2013 @@ -7,15 +7,15 @@ // //===----------------------------------------------------------------------===// -#include "llvm/BasicBlock.h" -#include "llvm/Constants.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/PassManager.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/TargetRegistry.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "vmkit/UTF8.h" #include "vmkit/Thread.h" Modified: vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJIT.cpp Fri Jun 21 03:02:29 2013 @@ -16,12 +16,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "vmkit/JIT.h" @@ -997,7 +997,10 @@ llvm::Function* JavaJIT::javaCompile() { string methName, methNameLink; DbgSubprogram = TheCompiler->getDebugFactory()->createFunction( - DIDescriptor(), compilingMethod->getName(methName, false), compilingMethod->getName(methNameLink, true), DIFile(), 0, DIType(), false, false, 0); + DIDescriptor(), compilingMethod->getName(methName, false), + compilingMethod->getName(methNameLink, true), DIFile(), 0, + TheCompiler->getDebugFactory()->createSubroutineType(DIFile(), DIArray()), + false, false, 0); JavaAttribute* codeAtt = compilingMethod->lookupAttribute(JavaAttribute::codeAttribute); @@ -1284,11 +1287,12 @@ llvm::Function* JavaJIT::javaCompile() { const UTF8* name = compilingClass->ctpInfo->UTF8At(AR.AnnotationNameIndex); if (name->equals(TheCompiler->InlinePragma)) { - llvmFunction->removeFnAttr( - Attributes::get(*llvmContext, llvm::Attributes::NoInline)); - llvmFunction->addFnAttr(llvm::Attributes::AlwaysInline); + llvmFunction->removeAttributes(llvm::AttributeSet::FunctionIndex, + llvm::AttributeSet::get(*llvmContext, + llvm::AttributeSet::FunctionIndex, llvm::Attribute::NoInline)); + llvmFunction->addFnAttr(llvm::Attribute::AlwaysInline); } else if (name->equals(TheCompiler->NoInlinePragma)) { - llvmFunction->addFnAttr(llvm::Attributes::NoInline); + llvmFunction->addFnAttr(llvm::Attribute::NoInline); } } } Modified: vmkit/trunk/lib/j3/Compiler/JavaJIT.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJIT.h?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJIT.h (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJIT.h Fri Jun 21 03:02:29 2013 @@ -13,13 +13,13 @@ #include #include -#include "llvm/BasicBlock.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Metadata.h" -#include "llvm/Type.h" -#include "llvm/Value.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Metadata.h" +#include "llvm/IR/Type.h" +#include "llvm/IR/Value.h" #include "llvm/DIBuilder.h" #include "llvm/DebugInfo.h" #include "llvm/Support/DebugLoc.h" Modified: vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJITCompiler.cpp Fri Jun 21 03:02:29 2013 @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/DebugInfo.h" #include "llvm/CodeGen/GCStrategy.h" #include @@ -22,7 +22,7 @@ #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include #include "VmkitGC.h" Modified: vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaJITOpcodes.cpp Fri Jun 21 03:02:29 2013 @@ -14,12 +14,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "vmkit/JIT.h" Modified: vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/JavaLLVMCompiler.cpp Fri Jun 21 03:02:29 2013 @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/PassManager.h" #include "llvm/DIBuilder.h" #include "llvm/Analysis/LoopPass.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "vmkit/JIT.h" Modified: vmkit/trunk/lib/j3/Compiler/LLVMInfo.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/LLVMInfo.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/LLVMInfo.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/LLVMInfo.cpp Fri Jun 21 03:02:29 2013 @@ -7,14 +7,14 @@ // //===----------------------------------------------------------------------===// -#include "llvm/BasicBlock.h" -#include "llvm/CallingConv.h" -#include "llvm/Constants.h" -#include "llvm/Instructions.h" -#include "llvm/Module.h" +#include "llvm/IR/BasicBlock.h" +#include "llvm/IR/CallingConv.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/Module.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/MutexGuard.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "vmkit/JIT.h" @@ -191,9 +191,9 @@ Function* LLVMMethodInfo::getMethod(Clas result->setGC("vmkit"); if (Compiler->useCooperativeGC()) { - result->addFnAttr(Attributes::NoInline); + result->addFnAttr(Attribute::NoInline); } - result->addFnAttr(Attributes::NoUnwind); + result->addFnAttr(Attribute::NoUnwind); Compiler->functions.insert(std::make_pair(result, methodDef)); if (!Compiler->isStaticCompiling() && !customizing && methodDef->code) { @@ -460,8 +460,8 @@ Function* LLVMSignatureInfo::createFunct } res->setGC("vmkit"); - res->addFnAttr(Attributes::NoInline); - res->addFnAttr(Attributes::NoUnwind); + res->addFnAttr(Attribute::NoInline); + res->addFnAttr(Attribute::NoUnwind); if (virt) { Compiler->virtualBufs[FTy] = res; @@ -550,8 +550,8 @@ Function* LLVMSignatureInfo::createFunct } res->setGC("vmkit"); - res->addFnAttr(Attributes::NoInline); - res->addFnAttr(Attributes::NoUnwind); + res->addFnAttr(Attribute::NoInline); + res->addFnAttr(Attribute::NoUnwind); if (virt) { Compiler->virtualAPs[FTy] = res; @@ -671,8 +671,8 @@ Function* LLVMSignatureInfo::createFunct } stub->setGC("vmkit"); - stub->addFnAttr(Attributes::NoInline); - stub->addFnAttr(Attributes::NoUnwind); + stub->addFnAttr(Attribute::NoInline); + stub->addFnAttr(Attribute::NoUnwind); if (virt) { Compiler->virtualStubs[FTy] = stub; Modified: vmkit/trunk/lib/j3/Compiler/LowerConstantCalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/Compiler/LowerConstantCalls.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/j3/Compiler/LowerConstantCalls.cpp (original) +++ vmkit/trunk/lib/j3/Compiler/LowerConstantCalls.cpp Fri Jun 21 03:02:29 2013 @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/GlobalVariable.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/GlobalVariable.h" #include "llvm/Pass.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" Modified: vmkit/trunk/lib/static-gc-pass/StaticGCPass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/static-gc-pass/StaticGCPass.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/static-gc-pass/StaticGCPass.cpp (original) +++ vmkit/trunk/lib/static-gc-pass/StaticGCPass.cpp Fri Jun 21 03:02:29 2013 @@ -9,8 +9,8 @@ //===----------------------------------------------------------------------===// -#include "llvm/Intrinsics.h" -#include "llvm/Module.h" +#include "llvm/IR/Intrinsics.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/raw_ostream.h" Modified: vmkit/trunk/lib/static-gc-printer/VmkitGCPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/static-gc-printer/VmkitGCPrinter.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/static-gc-printer/VmkitGCPrinter.cpp (original) +++ vmkit/trunk/lib/static-gc-printer/VmkitGCPrinter.cpp Fri Jun 21 03:02:29 2013 @@ -7,23 +7,23 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/Type.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Type.h" #include "llvm/CodeGen/GCs.h" #include "llvm/CodeGen/GCStrategy.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/GCMetadataPrinter.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/Module.h" +#include "llvm/IR/Module.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCStreamer.h" #include "llvm/Target/Mangler.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" Modified: vmkit/trunk/lib/vmkit/Compiler/InlineMalloc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/Compiler/InlineMalloc.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/vmkit/Compiler/InlineMalloc.cpp (original) +++ vmkit/trunk/lib/vmkit/Compiler/InlineMalloc.cpp Fri Jun 21 03:02:29 2013 @@ -7,16 +7,16 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/GlobalVariable.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/GlobalVariable.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "llvm/Transforms/Utils/Cloning.h" #include "vmkit/JIT.h" Modified: vmkit/trunk/lib/vmkit/Compiler/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/Compiler/JIT.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/vmkit/Compiler/JIT.cpp (original) +++ vmkit/trunk/lib/vmkit/Compiler/JIT.cpp Fri Jun 21 03:02:29 2013 @@ -7,16 +7,16 @@ // //===----------------------------------------------------------------------===// -#include -#include +#include +#include #include -#include -#include +#include +#include #include -#include -#include +#include +#include #include -#include +#include #include #include #include @@ -27,12 +27,12 @@ #include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/Support/CommandLine.h" #include -#include +#include #include #include #include #include -#include +#include #include #include #include Modified: vmkit/trunk/lib/vmkit/JITGCPass/JITGCPass.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/vmkit/JITGCPass/JITGCPass.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/lib/vmkit/JITGCPass/JITGCPass.cpp (original) +++ vmkit/trunk/lib/vmkit/JITGCPass/JITGCPass.cpp Fri Jun 21 03:02:29 2013 @@ -9,8 +9,8 @@ //===----------------------------------------------------------------------===// -#include "llvm/Intrinsics.h" -#include "llvm/Module.h" +#include "llvm/IR/Intrinsics.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/raw_ostream.h" Modified: vmkit/trunk/mmtk/magic/LowerJavaRT.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerJavaRT.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/mmtk/magic/LowerJavaRT.cpp (original) +++ vmkit/trunk/mmtk/magic/LowerJavaRT.cpp Fri Jun 21 03:02:29 2013 @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" Modified: vmkit/trunk/mmtk/magic/LowerMagic.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerMagic.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/mmtk/magic/LowerMagic.cpp (original) +++ vmkit/trunk/mmtk/magic/LowerMagic.cpp Fri Jun 21 03:02:29 2013 @@ -8,11 +8,11 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/SmallPtrSet.h" -#include "llvm/Constants.h" -#include "llvm/Function.h" -#include "llvm/Instructions.h" -#include "llvm/LLVMContext.h" -#include "llvm/Module.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Function.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/Pass.h" #include "llvm/Support/CallSite.h" #include "llvm/Support/Compiler.h" Modified: vmkit/trunk/patches/llvm.patch URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/patches/llvm.patch?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/patches/llvm.patch (original) +++ vmkit/trunk/patches/llvm.patch Fri Jun 21 03:02:29 2013 @@ -1,57 +1,6 @@ ---- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 2012-11-01 10:14:31.000000000 +0100 -+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp 2013-03-28 17:37:24.297848000 +0100 -@@ -174,22 +174,22 @@ bool AsmPrinter::doInitialization(Module - - GCModuleInfo *MI = getAnalysisIfAvailable(); - assert(MI && "AsmPrinter didn't require GCModuleInfo?"); - for (GCModuleInfo::iterator I = MI->begin(), E = MI->end(); I != E; ++I) - if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*I)) - MP->beginAssembly(*this); -- -+/* - // Emit module-level inline asm if it exists. - if (!M.getModuleInlineAsm().empty()) { - OutStreamer.AddComment("Start of file scope inline assembly"); - OutStreamer.AddBlankLine(); - EmitInlineAsm(M.getModuleInlineAsm()+"\n"); - OutStreamer.AddComment("End of file scope inline assembly"); - OutStreamer.AddBlankLine(); - } -- -+*/ - if (MAI->doesSupportDebugInformation()) - DD = new DwarfDebug(this, &M); - - switch (MAI->getExceptionHandlingType()) { - case ExceptionHandling::None: - return false; -@@ -925,12 +925,21 @@ bool AsmPrinter::doFinalization(Module & - GCModuleInfo *MI = getAnalysisIfAvailable(); - assert(MI && "AsmPrinter didn't require GCModuleInfo?"); - for (GCModuleInfo::iterator I = MI->end(), E = MI->begin(); I != E; ) - if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*--I)) - MP->finishAssembly(*this); - -+ // Emit module-level inline asm if it exists. -+ if (!M.getModuleInlineAsm().empty()) { -+ OutStreamer.AddComment("Start of file scope inline assembly"); -+ OutStreamer.AddBlankLine(); -+ EmitInlineAsm(M.getModuleInlineAsm()+"\n"); -+ OutStreamer.AddComment("End of file scope inline assembly"); -+ OutStreamer.AddBlankLine(); -+ } -+ - // If we don't have any trampolines, then we don't require stack memory - // to be executable. Some targets have a directive to declare this. - Function *InitTrampolineIntrinsic = M.getFunction("llvm.init.trampoline"); - if (!InitTrampolineIntrinsic || InitTrampolineIntrinsic->use_empty()) - if (const MCSection *S = MAI->getNonexecutableStackSection(OutContext)) - OutStreamer.SwitchSection(S); ---- a/lib/Target/CppBackend/CPPBackend.cpp 2012-11-23 20:56:57.000000000 +0100 -+++ b/lib/Target/CppBackend/CPPBackend.cpp 2013-03-28 17:37:24.302140000 +0100 -@@ -372,12 +372,13 @@ std::string CppWriter::getCppName(Type* - } - case Type::X86_FP80TyID: return "Type::getX86_FP80Ty(mod->getContext())"; +--- a/lib/Target/CppBackend/CPPBackend.cpp 2013-03-25 18:42:20.000000000 +0100 ++++ a/lib/Target/CppBackend/CPPBackend.cpp 2013-06-20 10:57:56.348917453 +0200 +@@ -374,8 +374,9 @@ std::string CppWriter::getCppName(Type* case Type::FloatTyID: return "Type::getFloatTy(mod->getContext())"; case Type::DoubleTyID: return "Type::getDoubleTy(mod->getContext())"; case Type::LabelTyID: return "Type::getLabelTy(mod->getContext())"; @@ -61,98 +10,28 @@ error("Invalid primitive type"); break; } - // shouldn't be returned, but make it sensible - return "Type::getVoidTy(mod->getContext())"; -@@ -442,12 +443,14 @@ std::string CppWriter::getCppName(const - name += std::string("_") + utostr(uniqueNum++); - UsedNames.insert(name); +@@ -444,8 +445,10 @@ std::string CppWriter::getCppName(const return ValueNames[val] = name; } else { name = getTypePrefix(val->getType()); } -+ } else if (dyn_cast(val)) { -+ name = std::string("metadata_"); ++ } else if (isa(val)) { ++ name = std::string("metadata_"); } else { name = getTypePrefix(val->getType()); } if (val->hasName()) - name += val->getName(); - else -@@ -1408,12 +1411,16 @@ void CppWriter::printInstruction(const I - << getCppName(ila->getFunctionType()) << ", \"" - << ila->getAsmString() << "\", \"" +@@ -1420,8 +1423,13 @@ void CppWriter::printInstruction(const I << ila->getConstraintString() << "\"," << (ila->hasSideEffects() ? "true" : "false") << ");"; nl(Out); } + if (const Function* F = dyn_cast(call->getCalledValue())) { -+ if ((F->getName().compare("llvm.dbg.value") == 0) || (F->getName().compare("llvm.dbg.declare") == 0)) -+ break; //Generate nothing ++ // Do not generate anything for debugging symbols intrinsics ++ if (F->getName().compare("llvm.dbg.value" ) == 0) break; ++ if (F->getName().compare("llvm.dbg.declare") == 0) break; + } if (call->getNumArgOperands() > 1) { Out << "std::vector " << iName << "_params;"; nl(Out); for (unsigned i = 0; i < call->getNumArgOperands(); ++i) { - Out << iName << "_params.push_back(" << opNames[i] << ");"; - nl(Out); ---- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp 2012-11-07 06:19:04.000000000 +0100 -+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp 2013-03-30 01:20:19.820477000 +0100 -@@ -1149,21 +1149,22 @@ const MCSymbol *DwarfDebug::getLabelAfte - /// beginInstruction - Process beginning of an instruction. - void DwarfDebug::beginInstruction(const MachineInstr *MI) { - // Check if source location changes, but ignore DBG_VALUE locations. - if (!MI->isDebugValue()) { - DebugLoc DL = MI->getDebugLoc(); - if (DL != PrevInstLoc && (!DL.isUnknown() || UnknownLocations)) { -- unsigned Flags = 0; -+ unsigned Flags = DWARF2_FLAG_IS_STMT; - PrevInstLoc = DL; - if (DL == PrologEndLoc) { - Flags |= DWARF2_FLAG_PROLOGUE_END; - PrologEndLoc = DebugLoc(); - } -+/* - if (PrologEndLoc.isUnknown()) - Flags |= DWARF2_FLAG_IS_STMT; -- -+*/ - if (!DL.isUnknown()) { - const MDNode *Scope = DL.getScope(Asm->MF->getFunction()->getContext()); - recordSourceLine(DL.getLine(), DL.getCol(), Scope, Flags); - } else - recordSourceLine(0, 0, 0, 0); - } -@@ -1439,13 +1440,13 @@ void DwarfDebug::beginFunction(const Mac - // Record beginning of function. - if (!PrologEndLoc.isUnknown()) { - DebugLoc FnStartDL = getFnDebugLoc(PrologEndLoc, - MF->getFunction()->getContext()); - recordSourceLine(FnStartDL.getLine(), FnStartDL.getCol(), - FnStartDL.getScope(MF->getFunction()->getContext()), -- 0); -+ DWARF2_FLAG_IS_STMT); - } - } - - void DwarfDebug::addScopeVariable(LexicalScope *LS, DbgVariable *Var) { - // SmallVector &Vars = ScopeVariables.lookup(LS); - ScopeVariables[LS].push_back(Var); ---- a/test/DebugInfo/X86/ending-run.ll 2012-04-05 22:39:05.000000000 +0200 -+++ b/test/DebugInfo/X86/ending-run.ll 2013-03-30 01:25:51.458268000 +0100 -@@ -1,14 +1,12 @@ - ; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj - ; RUN: llvm-dwarfdump %t | FileCheck %s - --; Check that the line table starts at 7, not 4, but that the first --; statement isn't until line 8. -+; Check that the line table starts at 7, not 4. - --; CHECK-NOT: 0x0000000000000000 7 0 1 0 is_stmt --; CHECK: 0x0000000000000000 7 0 1 0 -+; CHECK: 0x0000000000000000 7 0 1 0 is_stmt - ; CHECK: 0x0000000000000004 8 18 1 0 is_stmt prologue_end - - define i32 @callee(i32 %x) nounwind uwtable ssp { - entry: - %x.addr = alloca i32, align 4 - %y = alloca i32, align 4 Modified: vmkit/trunk/tools/vmjc/vmjc.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/tools/vmjc/vmjc.cpp?rev=184537&r1=184536&r2=184537&view=diff ============================================================================== --- vmkit/trunk/tools/vmjc/vmjc.cpp (original) +++ vmkit/trunk/tools/vmjc/vmjc.cpp Fri Jun 21 03:02:29 2013 @@ -17,15 +17,15 @@ #include #include "llvm/LinkAllPasses.h" -#include "llvm/LinkAllVMCore.h" -#include "llvm/Module.h" +#include "llvm/LinkAllIR.h" +#include "llvm/IR/Module.h" #include "llvm/PassManager.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/IRReader.h" +#include "llvm/IRReader/IRReader.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PassNameParser.h" @@ -34,7 +34,7 @@ #include "llvm/Support/SystemUtils.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Signals.h" -#include "llvm/DataLayout.h" +#include "llvm/IR/DataLayout.h" #include "llvm/Target/TargetMachine.h" From sylvestre at debian.org Fri Jun 7 07:04:57 2013 From: sylvestre at debian.org (Sylvestre Ledru) Date: Fri, 07 Jun 2013 14:04:57 -0000 Subject: [vmkit-commits] [vmkit] r183519 - add a new method in the classloader to return the error message in case of loader error Message-ID: <20130607140400.71AAB2A6C029@llvm.org> Author: sylvestre Date: Fri Jun 7 09:04:00 2013 New Revision: 183519 URL: http://llvm.org/viewvc/llvm-project?rev=183519&view=rev Log: add a new method in the classloader to return the error message in case of loader error Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp?rev=183519&r1=183518&r2=183519&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.cpp Fri Jun 7 09:04:00 2013 @@ -1058,6 +1058,10 @@ void* JnjvmClassLoader::loadLib(const ch return handle; } +char* JnjvmClassLoader::getErrorMessage() { + return dlerror(); +} + word_t JnjvmClassLoader::loadInLib(const char* name, void* handle) { return (word_t)TheCompiler->loadMethod(handle, name); } Modified: vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h?rev=183519&r1=183518&r2=183519&view=diff ============================================================================== --- vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h (original) +++ vmkit/trunk/lib/j3/VMCore/JnjvmClassLoader.h Fri Jun 7 09:04:00 2013 @@ -309,6 +309,10 @@ public: /// void* loadLib(const char* buf); + /// getErrorMessage - Returns the error message in case of failure + /// + char* getErrorMessage(); + /// nativeLookup - Lookup in the class loader a function pointer for the /// method. Also set in the j3 parameter is the function is defined in /// JnJVM. From sylvestre at debian.org Fri Jun 7 07:05:32 2013 From: sylvestre at debian.org (Sylvestre Ledru) Date: Fri, 07 Jun 2013 14:05:32 -0000 Subject: [vmkit-commits] [vmkit] r183520 - When the load of Java is failing, shows the error message from the linker Message-ID: <20130607140443.4E13E2A6C029@llvm.org> Author: sylvestre Date: Fri Jun 7 09:04:43 2013 New Revision: 183520 URL: http://llvm.org/viewvc/llvm-project?rev=183520&view=rev Log: When the load of Java is failing, shows the error message from the linker Modified: vmkit/trunk/lib/j3/ClassLib/OpenJDK/JavaUpcalls.cpp Modified: vmkit/trunk/lib/j3/ClassLib/OpenJDK/JavaUpcalls.cpp URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/j3/ClassLib/OpenJDK/JavaUpcalls.cpp?rev=183520&r1=183519&r2=183520&view=diff ============================================================================== --- vmkit/trunk/lib/j3/ClassLib/OpenJDK/JavaUpcalls.cpp (original) +++ vmkit/trunk/lib/j3/ClassLib/OpenJDK/JavaUpcalls.cpp Fri Jun 7 09:04:43 2013 @@ -511,7 +511,7 @@ void Classpath::initialiseClasspath(Jnjv // Load OpenJDK's libjava.so void * handle = loader->loadLib(OpenJDKLibJava); if (handle == NULL) { - fprintf(stderr, "Failed to load %s, cannot proceed!\n", OpenJDKLibJava); + fprintf(stderr, "Failed to load %s, cannot proceed:\n%s\n", OpenJDKLibJava, loader->getErrorMessage()); abort(); }