From gbenson at redhat.com Thu Dec 3 07:30:57 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 3 Dec 2009 15:30:57 +0000 Subject: Remove dead patch Message-ID: <20091203153057.GD3573@redhat.com> Hi all, The commit I just made to IcedTea6 and 7 removes a dead patch that was no longer necessary. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 1d33b4733b4b -r 8c38c97e3ce8 ChangeLog --- a/ChangeLog Thu Dec 03 09:16:00 2009 +0000 +++ b/ChangeLog Thu Dec 03 13:49:45 2009 +0000 @@ -1,3 +1,9 @@ +2009-12-03 Gary Benson + + * patches/icedtea-bytecodeInterpreter.patch: Removed. + * Makefile.am (ICEDTEA_PATCHES): Don't apply the above. + * HACKING: Document the above. + 2009-12-03 Gary Benson * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/: diff -r 1d33b4733b4b -r 8c38c97e3ce8 HACKING --- a/HACKING Thu Dec 03 09:16:00 2009 +0000 +++ b/HACKING Thu Dec 03 13:49:45 2009 +0000 @@ -99,8 +99,6 @@ * icedtea-cacao.patch: For the 'java' command, create new thread depending on the current VM. * icedtea-cacao-no-mmap-first-page.patch: Don't mmap the first memory page. * cacao/no-strict-aliasing.patch: Turn off strict aliasing which causes an issue with the verifier when building with GCC 4.4 (cacao PR129). - -* icedtea-bytecodeInterpreter.patch: Replace fast opcodes with opc_default. * icedtea-ia64-bugfix.patch: Remove workaround for IA64 GCC bug. * icedtea-signature-iterator.patch: Add zero-specific signature handling. * icedtea-test-atomic-operations.patch: Add check to see if GCC's sync_lock_test works. @@ -177,3 +175,4 @@ * icedtea-core-zero-build.patch: Not required with HS14. * icedtea-bytecodeInterpreterWithChecks.patch: Same as icedtea-xslfix.patch (OpenJDK6 only, S6707485); not required with HS14. * icedtea-eclipse-hotspot-6614100-7b24.patch: Fix Eclipse crash (S6614100). Fixed in OpenJDK7 b29/hs13. Not required with HS14. +* icedtea-bytecodeInterpreter.patch: Replace fast opcodes with opc_default. Not required with HS14. diff -r 1d33b4733b4b -r 8c38c97e3ce8 Makefile.am --- a/Makefile.am Thu Dec 03 09:16:00 2009 +0000 +++ b/Makefile.am Thu Dec 03 13:49:45 2009 +0000 @@ -516,7 +516,6 @@ ICEDTEA_PATCHES = \ patches/icedtea-notice-safepoints.patch \ - patches/icedtea-bytecodeInterpreter.patch \ patches/icedtea-signature-iterator.patch \ patches/icedtea-test-atomic-operations.patch \ patches/icedtea-zero.patch \ diff -r 1d33b4733b4b -r 8c38c97e3ce8 patches/icedtea-bytecodeInterpreter.patch --- a/patches/icedtea-bytecodeInterpreter.patch Thu Dec 03 09:16:00 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -diff -Nru openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp ---- openjdk.orig/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp 2008-10-23 08:41:04.000000000 +0100 -+++ openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp 2008-10-30 15:48:48.000000000 +0000 -@@ -60,7 +60,6 @@ - }; - - class BytecodeInterpreter : StackObj { --friend class SharedRuntime; - friend class AbstractInterpreterGenerator; - friend class CppInterpreterGenerator; - friend class InterpreterGenerator; From gbenson at redhat.com Thu Dec 3 08:06:00 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 3 Dec 2009 16:06:00 +0000 Subject: Remove ancient workaround Message-ID: <20091203160600.GA9977@redhat.com> Hi all, This commit removes a workaround for building against versions of Zero from April 2008 and earlier (or against the PowerPC interpreter -- remember that?) Please don't anybody tell me they have a build that old they need to support... Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 8c38c97e3ce8 -r bc6d4b57cacf ChangeLog --- a/ChangeLog Thu Dec 03 13:49:45 2009 +0000 +++ b/ChangeLog Thu Dec 03 15:58:48 2009 +0000 @@ -1,3 +1,7 @@ +2009-12-03 Gary Benson + + * patches/icedtea-core-build.patch: Remove a very old workaround. + 2009-12-03 Gary Benson * patches/icedtea-bytecodeInterpreter.patch: Removed. diff -r 8c38c97e3ce8 -r bc6d4b57cacf patches/icedtea-core-build.patch --- a/patches/icedtea-core-build.patch Thu Dec 03 13:49:45 2009 +0000 +++ b/patches/icedtea-core-build.patch Thu Dec 03 15:58:48 2009 +0000 @@ -44,38 +44,3 @@ # NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows -diff -ru openjdk.orig/jdk/make/common/Defs-linux.gmk openjdk/jdk/make/common/Defs-linux.gmk ---- openjdk.orig/jdk/make/common/Defs-linux.gmk 2007-11-08 11:35:35.000000000 +0000 -+++ openjdk/jdk/make/common/Defs-linux.gmk 2007-11-08 11:36:15.000000000 +0000 -@@ -258,7 +258,12 @@ endif - # -L to the -ljvm, this is because -ljava depends on -ljvm, whereas - # the library itself should not. - # --VM_NAME = server -+VM_NAME = $(shell for dir in server client core; do \ -+ if [ -d $(LIBDIR)/$(LIBARCH)/$$dir ]; then \ -+ echo $$dir; \ -+ break; \ -+ fi; \ -+ done) - JVMLIB = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm - JAVALIB = -ljava $(JVMLIB) - -diff -ru openjdk.orig/corba/make/common/Defs-linux.gmk openjdk/corba/make/common/Defs-linux.gmk ---- openjdk.orig/corba/make/common/Defs-linux.gmk Tue Feb 05 15:52:33 2008 +0000 -+++ openjdk/corba/make/common/Defs-linux.gmk Mon Feb 11 10:01:46 2008 +0000 -@@ -250,7 +254,12 @@ endif - # -L to the -ljvm, this is because -ljava depends on -ljvm, whereas - # the library itself should not. - # --VM_NAME = server -+VM_NAME = $(shell for dir in server client core; do \ -+ if [ -d $(BOOTDIR)/jre/lib/$(LIBARCH)/$$dir ]; then \ -+ echo $$dir; \ -+ break; \ -+ fi; \ -+ done) - JVMLIB = -L$(BOOTDIR)/jre/lib/$(LIBARCH)/$(VM_NAME) -ljvm - JAVALIB = -L$(BOOTDIR)/jre/lib/$(LIBARCH) -ljava $(JVMLIB) - - From gbenson at redhat.com Thu Dec 3 08:41:46 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 3 Dec 2009 16:41:46 +0000 Subject: Remove more dead patches Message-ID: <20091203164146.GB9977@redhat.com> Hi all, This commit removes the ancient workaround I mentioned before from IcedTea7, and another dead patch that is not required to build Zero. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 21376f9eed89 -r 2deccfc8b64f ChangeLog --- a/ChangeLog Thu Dec 03 13:53:28 2009 +0000 +++ b/ChangeLog Thu Dec 03 16:39:28 2009 +0000 @@ -1,3 +1,10 @@ +2009-12-03 Gary Benson + + * patches/icedtea-core-build.patch: Removed. + * patches/icedtea-zero-build.patch: Likewise. + * Makefile.am (ICEDTEA_PATCHES): Don't apply the above. + * HACKING: Document the above. + 2009-12-03 Gary Benson * patches/hotspot/icedtea-bytecodeInterpreter.patch: Removed. diff -r 21376f9eed89 -r 2deccfc8b64f HACKING --- a/HACKING Thu Dec 03 13:53:28 2009 +0000 +++ b/HACKING Thu Dec 03 16:39:28 2009 +0000 @@ -15,7 +15,6 @@ Partially fixed by addition of discardMark() in OpenJDK7. * icedtea-copy-plugs.patch: Add IcedTea's 'plugs' for Java WebStart support, add cast to getAnnotation and trapAuthenticationFailure variable to com.sun.jmx.snmp.SnmpPduTrap. -* icedtea-core-build.patch: Add support for building IcedTea core VM. * icedtea-debuginfo.patch: Add -g option to build to generate debugging information. * icedtea-demos.patch: Fix building of JVMTI demo. * icedtea-float-double-trailing-zeros.patch: Remove trailing zeros from Double/Float (PR29/30) @@ -49,7 +48,6 @@ * icedtea-use-system-tzdata.patch: Use timezone data from the system (PR70/S6593486). * icedtea-version.patch: Replace name and bug URL with IcedTea versions. * icedtea-webservices.patch: Add applet support. -* icedtea-zero-build.patch: Add support for the zero assembler build. * icedtea-shark-build.patch: Add support for building the Shark JIT. * icedtea-alpha-fixes.patch: Fix build issues on alpha-linux. * icedtea-arch.patch: Add support for additional architectures. @@ -198,3 +196,5 @@ * icedtea-bytecodeInterpreterWithChecks.patch: Same as icedtea-xslfix.patch (OpenJDK6 only, S6707485). * icedtea-eclipse-hotspot-6614100-7b24.patch: Fix Eclipse crash (S6614100). Fixed in OpenJDK7 b29/hs13. * icedtea-bytecodeInterpreter.patch: Replace fast opcodes with opc_default. +* icedtea-core-build.patch: Add support for building IcedTea core VM. +* icedtea-zero-build.patch: Add support for the zero assembler build. diff -r 21376f9eed89 -r 2deccfc8b64f Makefile.am --- a/Makefile.am Thu Dec 03 13:53:28 2009 +0000 +++ b/Makefile.am Thu Dec 03 16:39:28 2009 +0000 @@ -254,8 +254,6 @@ patches/hotspot/$(HSBUILD)/icedtea-memory-limits.patch \ patches/icedtea-sunsrc.patch \ patches/icedtea-libraries.patch \ - patches/icedtea-core-build.patch \ - patches/icedtea-zero-build.patch \ patches/icedtea-print-lsb-release.patch \ patches/icedtea-jpegclasses.patch \ patches/icedtea-uname.patch \ diff -r 21376f9eed89 -r 2deccfc8b64f patches/icedtea-core-build.patch --- a/patches/icedtea-core-build.patch Thu Dec 03 13:53:28 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -diff -Nru openjdk.orig/corba/make/common/Defs-linux.gmk openjdk/corba/make/common/Defs-linux.gmk ---- openjdk.orig/corba/make/common/Defs-linux.gmk 2009-07-15 17:35:01.000000000 +0100 -+++ openjdk/corba/make/common/Defs-linux.gmk 2009-07-23 17:41:01.000000000 +0100 -@@ -258,7 +258,12 @@ - # -L to the -ljvm, this is because -ljava depends on -ljvm, whereas - # the library itself should not. - # --VM_NAME = server -+VM_NAME = $(shell for dir in server client core; do \ -+ if [ -d $(BOOTDIR)/jre/lib/$(LIBARCH)/$$dir ]; then \ -+ echo $$dir; \ -+ break; \ -+ fi; \ -+ done) - JVMLIB = -L$(BOOTDIR)/jre/lib/$(LIBARCH)/$(VM_NAME) -ljvm - JAVALIB = -L$(BOOTDIR)/jre/lib/$(LIBARCH) -ljava $(JVMLIB) - -diff -Nru openjdk.orig/jdk/make/common/Defs-linux.gmk openjdk/jdk/make/common/Defs-linux.gmk ---- openjdk.orig/jdk/make/common/Defs-linux.gmk 2009-07-15 17:35:01.000000000 +0100 -+++ openjdk/jdk/make/common/Defs-linux.gmk 2009-07-23 17:41:01.000000000 +0100 -@@ -282,7 +282,12 @@ - # -L to the -ljvm, this is because -ljava depends on -ljvm, whereas - # the library itself should not. - # --VM_NAME = server -+VM_NAME = $(shell for dir in server client core; do \ -+ if [ -d $(LIBDIR)/$(LIBARCH)/$$dir ]; then \ -+ echo $$dir; \ -+ break; \ -+ fi; \ -+ done) - JVMLIB = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm - JAVALIB = -ljava $(JVMLIB) - diff -r 21376f9eed89 -r 2deccfc8b64f patches/icedtea-zero-build.patch --- a/patches/icedtea-zero-build.patch Thu Dec 03 13:53:28 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -diff -Nru openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk openjdk/jdk/make/common/shared/Compiler-gcc.gmk ---- openjdk.orig/jdk/make/common/shared/Compiler-gcc.gmk 2009-04-14 18:31:09.000000000 +0100 -+++ openjdk/jdk/make/common/shared/Compiler-gcc.gmk 2009-04-14 20:32:47.000000000 +0100 -@@ -66,6 +66,11 @@ - else - CXX = $(COMPILER_PATH)g++$(GCC_SUFFIX) - endif -+ ifdef ZERO_BUILD -+ # zero -+ REQUIRED_CC_VER = 3.2 -+ REQUIRED_GCC_VER = 3.2.* -+ endif - # Option used to create a shared library - SHARED_LIBRARY_FLAG = -shared -mimpure-text - SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 ) From gbenson at redhat.com Fri Dec 4 10:33:03 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 4 Dec 2009 18:33:03 +0000 Subject: Zero patch rearrangement in icedtea6 Message-ID: <20091204183302.GB17799@redhat.com> Hi all, At some point Zero is going to end up in a HSX tarball, and no doubt shortly afterwards in icedtea6. I've been working on a refactoring that will make the transition easier to manage. The attached patch replaces the various individual Zero patches with larger patches numbered with the Sun bug id that they were committed to OpenJDK7 with. This means that, once that bug's code ends up in an HSX tarball, we can simply remove one patch to fix IcedTea. It also means that, if OpenJDK 6 is about to rebase on a new HotSpot, we have patches ready made for the non-HotSpot Zero stuff that needs to be in that tarball. As well as the above, the attached patch upgrades icedtea6's Zero from the original, IcedTea way of building Zero to the new, much nicer OpenJDK7 way of doing it. This means that dependencies between header files are better tracked, thanks to the new includeDB, and also that there are now no differences between icedtea6's Zero and OpenJDK7's except for Ed's interpreter and the odd little bit here and there that's required for the newer HotSpot. I'm currently testing this with a bunch of different configurations (amd64/zero, ppc/shark, ppc64/hs16/zero and s390x/zero). Could people please test this patch on the configurations they care about, to make sure I didn't break anything. Thanks (and have a good weekend!) Gary -- http://gbenson.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-zero-upgrade.patch.gz Type: application/x-gzip Size: 24552 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/zero-dev/attachments/20091204/848a3eec/attachment-0001.bin From gbenson at redhat.com Tue Dec 8 03:19:27 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 8 Dec 2009 11:19:27 +0000 Subject: Zero patch consolidation Message-ID: <20091208111927.GB3422@redhat.com> Hi all, So the Zero patch consolidation I've been working on is now complete. As of now, the only patches relating to Zero in icedtea6 are in the patches/zero/ directory. Each one is numbered with the Sun bug ID with which it was pushed to OpenJDK7, and each one is generated from the OpenJDK7 forest into which it was initially pushed. The rationale behind this is that at some point in the future changesets relating to Zero may appear in OpenJDK6 or HotSpot Express tarballs. When this happens, patches will fail to apply. By grouping the patches in this way, only one patch needs removing for each changeset. At some further point in the future Zero itself may appear in an OpenJDK6 or HotSpot Express tarball; when this happens the relevant files under ports/ will be removed (the ARM interpreter will need turning into a patch) and changes to Zero itself will be handled in this way. Please don't use patches/zero for other files. I haven't mirrored this change in IcedTea7; that has very few Zero patches left, and after b78 (or maybe b77) they will all be gone, so it's not like it's something I'll have to keep track of long term like I do for IcedTea6. Cheers, Gary -- http://gbenson.net/ From gnu_andrew at member.fsf.org Tue Dec 8 05:42:43 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Tue, 8 Dec 2009 13:42:43 +0000 Subject: Zero patch consolidation In-Reply-To: <20091208111927.GB3422@redhat.com> References: <20091208111927.GB3422@redhat.com> Message-ID: <17c6771e0912080542x134f3b2eoea8d284ae2a2cada@mail.gmail.com> 2009/12/8 Gary Benson : > Hi all, > > So the Zero patch consolidation I've been working on is now complete. > > As of now, the only patches relating to Zero in icedtea6 are in the > patches/zero/ directory. ?Each one is numbered with the Sun bug ID > with which it was pushed to OpenJDK7, and each one is generated from > the OpenJDK7 forest into which it was initially pushed. > > The rationale behind this is that at some point in the future > changesets relating to Zero may appear in OpenJDK6 or HotSpot Express > tarballs. ?When this happens, patches will fail to apply. ?By grouping > the patches in this way, only one patch needs removing for each > changeset. ?At some further point in the future Zero itself may appear > in an OpenJDK6 or HotSpot Express tarball; when this happens the > relevant files under ports/ will be removed (the ARM interpreter will > need turning into a patch) and changes to Zero itself will be handled > in this way. > > Please don't use patches/zero for other files. > I like this. Anything that makes working out which patches have been merged and removing them easier gets a big smile from me. I'm also strongly in favour of organising the patches directory a bit better, especially if it makes it clearer which stuff is going to end up in OpenJDK6 eventually and which stuff we'll be maintaining for life. > I haven't mirrored this change in IcedTea7; that has very few Zero > patches left, and after b78 (or maybe b77) they will all be gone, > so it's not like it's something I'll have to keep track of long term > like I do for IcedTea6. > b77 is already out, so I just need to get round to updating IcedTea7 to build against it, dropping the ia64 patch and part of the uname patch (the rest I'll stick in a Debian subdir as it's specific to that platform). I hope b78 will see a HotSpot promotion and IcedTea7 will be clear of zero patches for the new year. > Cheers, > Gary > > -- > http://gbenson.net/ > -- Andrew :-) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From xerxes at zafena.se Thu Dec 10 06:00:33 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Thu, 10 Dec 2009 15:00:33 +0100 Subject: Native method wrapper generation In-Reply-To: <20091111163839.GL3256@redhat.com> References: <20091111163839.GL3256@redhat.com> Message-ID: <4B20FF01.5060108@zafena.se> Gary Benson wrote: > Hi all, > > This commit adds native wrapper generation to Shark. It also removes > support for LLVM < 2.6, because the new code requires it. I'll write > this up in more detail tomorrow with some benchmarks. > > Cheers, > Gary > > Hi +void SharkCompiler::generate_native_code(SharkEntry* entry, ... +#if SHARK_LLVM_VERSION >= 27 + if (!fnmatch(SharkPrintAsmOf, name, 0)) { + llvm::SetCurrentDebugType(X86_ONLY("x86-emitter") NOT_X86("jit")); + llvm::DebugFlag = true; + } + else { + llvm::SetCurrentDebugType(""); + llvm::DebugFlag = false; + } +#else This part of the code dont work with llvm 2.7svn *release* builds since llvm::DebugFlag and llvm::SetCurrentDebugType are only defined in the llvm headers for llvm debug builds. This was only a minor issue before the shark rewrite since the code then where only included in non product hotspot builds, now it fail on product builds as well in combination with a llvm 2.7svn release build. One way to fix this would be to introduce a new debug flag based on the info from llvm-config --build-mode that are set to true when llvm-config --build-mode spits out "Debug" , and then conditionalise the code block to be compiled if the new debug flag are percent. Cheers Xerxes From aph at redhat.com Thu Dec 10 06:20:05 2009 From: aph at redhat.com (Andrew Haley) Date: Thu, 10 Dec 2009 14:20:05 +0000 Subject: Native method wrapper generation In-Reply-To: <4B20FF01.5060108@zafena.se> References: <20091111163839.GL3256@redhat.com> <4B20FF01.5060108@zafena.se> Message-ID: <4B210395.5050804@redhat.com> Xerxes R?nby wrote: > Gary Benson wrote: >> Hi all, >> >> This commit adds native wrapper generation to Shark. It also removes >> support for LLVM < 2.6, because the new code requires it. I'll write >> this up in more detail tomorrow with some benchmarks. > > +void SharkCompiler::generate_native_code(SharkEntry* entry, > ... > +#if SHARK_LLVM_VERSION >= 27 > + if (!fnmatch(SharkPrintAsmOf, name, 0)) { > + llvm::SetCurrentDebugType(X86_ONLY("x86-emitter") NOT_X86("jit")); > + llvm::DebugFlag = true; > + } > + else { > + llvm::SetCurrentDebugType(""); > + llvm::DebugFlag = false; > + } > +#else > > This part of the code dont work with llvm 2.7svn *release* builds since > > llvm::DebugFlag > > and > > llvm::SetCurrentDebugType > > are only defined in the llvm headers for llvm debug builds. > > This was only a minor issue before the shark rewrite since the code then > where only included in non product hotspot builds, now it fail on > product builds as well in combination with a llvm 2.7svn release build. > One way to fix this would be to introduce a new debug flag based on the > info from > llvm-config --build-mode > that are set to true when llvm-config --build-mode spits out "Debug" , > and then conditionalise the code block to be compiled if the new debug > flag are percent. But the debug dumps aren't just for people who build their own OpenJDK, they're useful for debugging the installed OpenJDK and for people who are just writing apps and want to look at the generated code. This is a bad decision on the part of LLVM, but I guess we can live with it as long as the LLVM packages we use are build with debugging. Andrew. From gbenson at redhat.com Tue Dec 22 02:49:46 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 22 Dec 2009 10:49:46 +0000 Subject: Command line options tester Message-ID: <20091222104946.GB3312@redhat.com> Hi all, This commit adds a command line options tester I've been working on. It won't run on IcedTea or OpenJDK as is; it requires a patch which I mailed to hotspot-dev that doesn't look like anyone's going to look at before next year. But I'm committing this now so I don't lose it :) Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 40a336c2526b -r d48415f1ab6f ChangeLog --- a/ChangeLog Sat Dec 19 13:55:02 2009 +0100 +++ b/ChangeLog Tue Dec 22 11:42:03 2009 +0100 @@ -1,3 +1,8 @@ +2009-12-22 Gary Benson + + * contrib/checkopts/checkopts: New file. + * contrib/checkopts/Test.java: Likewise. + 2009-12-19 Matthias Klose * patches/icedtea-parisc.patch: Fix sanity check for parisc. diff -r 40a336c2526b -r d48415f1ab6f contrib/checkopts/Test.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/checkopts/Test.java Tue Dec 22 11:42:03 2009 +0100 @@ -0,0 +1,5 @@ +class Test { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff -r 40a336c2526b -r d48415f1ab6f contrib/checkopts/checkopts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contrib/checkopts/checkopts Tue Dec 22 11:42:03 2009 +0100 @@ -0,0 +1,146 @@ +#!/usr/bin/env python + +import os +import subprocess +import sys + +class Flag: + def __init__(self, line): + line = line.split() + self.type = line.pop(0) + self.name = line.pop(0) + assert line[0] in ("=", ":=") + line = " ".join(line[1:]) + self.is_diagnostic = False + if line.endswith("}"): + index = line.rfind("{") + if index != -1: + self.is_diagnostic = "diagnostic" in line[index + 1:-1].split() + line = line[:index] + self.value = line.strip() + + @property + def test_values(self): + if self.type == "bool": + if self.name in ( + "ExtendedDTraceProbes", # Solaris only + "RequireSharedSpaces", # Not set up + "PauseAtStartup"): # Just don't... + return (False,) + return (False, True) + return () + + def option(self, value): + if self.type == "bool": + return "-XX:%s%s" % (value and "+" or "-", self.name) + elif self.type.endswith("intx"): + return "-XX:%s=%d" % (self.name, value) + raise ValueError, self.type + +class TestFailure(Exception): + pass + +class Main: + def __init__(self, java): + self.java = os.path.realpath(java) + self.base = os.path.dirname(os.path.realpath(sys.argv[0])) + if not os.path.exists(os.path.join(self.base, "Test.class")): + out, err = subprocess.Popen( + [self.java + "c", "Test.java"], + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + cwd = self.base).communicate() + if out or err: + sys.stdout.write(out) + sys.stderr.write(err) + sys.exit(1) + self.passes = self.fails = 0 + for flag in self.read_flags(): + for value in flag.test_values: + self.test(flag, value) + print "%d passes, %d fails" % (self.passes, self.fails) + + def read_flags(self): + out, err = subprocess.Popen( + [self.java, "-XX:+UnlockDiagnosticVMOptions", "-Xprintflags"], + stdout = subprocess.PIPE, + stderr = subprocess.PIPE).communicate() + if err: + sys.stderr.write(err) + sys.exit(1) + lines = out.rstrip().split("\n") + line = lines.pop(0) + if line != "[Global flags]": + print >>sys.stderr, "error: unexpected output %s" % repr(line) + sys.exit(1) + flags = {} + for line in lines: + flag = Flag(line) + assert not flags.has_key(flag.name) + flags[flag.name] = flag + flags = flags.items() + flags.sort() + return [flag for name, flag in flags] + + def test(self, flag, value): + for dir in xrange(1000): + dir = os.path.join(self.base, "results", flag.name, "%03d" % dir) + if not os.path.isdir(dir): + break + os.makedirs(dir) + cmd = [self.java] + if flag.is_diagnostic: + cmd.append("-XX:+UnlockDiagnosticVMOptions") + if flag.name.startswith("CMS"): + cmd.append("-XX:+UseConcMarkSweepGC") + flag = flag.option(value) + cmd.append(flag) + cmd.extend(("-cp", self.base, "Test")) + print "%-56s %s" % (flag, dir[len(self.base + os.sep):]) + print >>open(os.path.join(dir, "cmd"), "w"), " ".join(cmd) + out, err = subprocess.Popen( + cmd, + stdout = subprocess.PIPE, + stderr = subprocess.PIPE, + cwd = dir).communicate() + open(os.path.join(dir, "out"), "w").write(out) + open(os.path.join(dir, "err"), "w").write(err) + try: + self.check(dir, out, err) + self.passes += 1 + except TestFailure, failure: + print "\x1B[1;31m FAIL: %s\x1B[0m" % failure + self.fails += 1 + + def fail(self, msg): + raise TestFailure(msg) + + def check(self, dir, out, err): + name = os.path.basename(os.path.dirname(dir)) + expect = ["cmd", "err", "out"] + actual = os.listdir(dir) + if name in ("LogCompilation", "LogVMOutput"): + if "hotspot.log" in actual: + expect.append("hotspot.log") + if name == "PerfDataSaveToFile": + for item in actual: + if item.startswith("hsperfdata_"): + expect.append(item) + break + expect.sort() + actual.sort() + while expect != actual: + for item in actual: + if item not in expect: + self.fail("found %s" % item) + self.fail("directory contents not as expected") + if err: + self.fail("err not as expected") + if not "Hello world" in out.split("\n"): + self.fail("out not as expected") + +if __name__ == "__main__": + if len(sys.argv) != 2: + print >>sys.stderr, "usage: %s /path/to/jdk/bin/java" % sys.argv[0] + sys.exit(1) + Main(sys.argv[1])