From aph at redhat.com Mon Jun 1 07:59:03 2009 From: aph at redhat.com (Andrew Haley) Date: Mon, 01 Jun 2009 15:59:03 +0100 Subject: Releases, releases, releases In-Reply-To: <17c6771e0905301712r1537a591gc77c0d8ad6c52883@mail.gmail.com> References: <17c6771e0905301712r1537a591gc77c0d8ad6c52883@mail.gmail.com> Message-ID: <4A23ECB7.70601@redhat.com> Andrew John Hughes wrote: > This is clearly a long and tedious list for testing on every change so > we need to narrow down which ones are most release-critical and which > features really need to be tested, which are useful but not critical. > For the IcedTea7 release, we decided not to make the CACAO build > release-critical due to a bug > (http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=128) > that at least myself and one of the CACAO devs (Ringding on > #cacao at FreeNode) have reproduced. I think something like that needs > regular testing, especially for 7, and support from upstream. Yes. Cacao is really the Cacao maintainers' job to keep working: others are in no position to debug it when it breaks. At a minimum we need to test Zero, x86/32, and x86/64. We may not need to test Zero on a wide range of architectures; that's up for discussion. Re in-tree/out-of-tree builds: I'm not sure that we need to support (and therefore test) both. I think we should stick as close as possible to the way Sun work upstream, which AFAIK is in-tree. I am quite aware of the advantages of building otside the source tree, but IMO the disadvantages of building in a way that's not commonly used upstream outweigh them. What do other people think? > As to JTReg, I don't think either 6 or 7 yet have a clean run (i.e. > 100% pass). I've tended to give less regards to results for 7 after > finding some tests wouldn't even compile, having been broken by API > changes (see https://bugs.openjdk.java.net/show_bug.cgi?id=100012 for > example). If we're going to run this before releases, we need a clear > baseline so we can identify regressions, and ideally continuous > testing so we can spot regressions as soon as they happen. OK. > As to the actual release process, I think we cleared most of it up but > for clarity, we now propose a release at least a week in advance and a > branch is created for release work once tip is considered stable > enough to undergo pre-release testing. This branch can then also be > used for minor releases, while tip remains open for new major release > features. That is standard practice in most of the free software projects I know about. We need to ask whether a week's notice is enough, though. There are a great many Debian platforms that take a long time to build and test. > If we have a clear release procedure, I think it will be easier for > everyone to collaborate on future releases and ensure a smoother and > more hassle-free process. Clear goals for a release and easy > delineation of work are thus the order of the day. I think the basic release process is now pretty good, but it would be better if it were described online. A Wiki page detailing the process can be discussed and edited by all IcedTea stakeholders. So, if someone thinks that testing on a particular platform in a particular way is needed, they can propose it on the list and add it to the Wiki page when agreed. I must emphasize that anyone insisting that Platform X must be tested is in effect promising to do the testing. The Wiki page should also detail all known JTreg failures. Andrew. From omajid at redhat.com Mon Jun 1 08:36:08 2009 From: omajid at redhat.com (Omair Majid) Date: Mon, 01 Jun 2009 11:36:08 -0400 Subject: RFC: Fix --enable-hg in IcedTea6 Message-ID: <4A23F568.4040900@redhat.com> Hi, Trying to build IcedTea6 with "--enable-hg --with-hg-revision=jdk6-b16" fails when applying the patches, even though jdk6-b16 is a known good build. The issues appears to be that the Makefile removes the old hotspot only if the openjdk directory doesn't already exist. The attached patch checks USE_HG and then removes the hotspot directory so it can be replaced with HS14. ChangeLog: 2009-06-01 Omair Majid * Makefile.am (stamps/extract.stamp): Remove hotspot if using --enable-hg and an alternate hotspot build. Can someone please review the patch? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-jdk6-hg.patch Type: text/x-patch Size: 371 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090601/54289512/attachment.bin From gnu_andrew at member.fsf.org Mon Jun 1 08:51:24 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 1 Jun 2009 16:51:24 +0100 Subject: RFC: Fix --enable-hg in IcedTea6 In-Reply-To: <4A23F568.4040900@redhat.com> References: <4A23F568.4040900@redhat.com> Message-ID: <17c6771e0906010851r22114970xdb3ed983f186799c@mail.gmail.com> 2009/6/1 Omair Majid : > Hi, > > Trying to build IcedTea6 with "--enable-hg --with-hg-revision=jdk6-b16" > fails when applying the patches, even though jdk6-b16 is a known good build. > The issues appears to be that the Makefile removes the old hotspot only if > the openjdk directory doesn't already exist. > > The attached patch checks USE_HG and then removes the hotspot directory so > it can be replaced with HS14. > > ChangeLog: > 2009-06-01 ?Omair Majid ? > > ? ?* Makefile.am (stamps/extract.stamp): Remove hotspot if using > ? ?--enable-hg and an alternate hotspot build. > > Can someone please review the patch? > > Cheers, > Omair > The presumption was that anyone wanting to use Mercurial as a source wanted the whole thing. I don't see how the attached patch can work. This would stop the hotspot directory not being removed when Mercurial is disabled, and doesn't do anything about the if block which checks for the openjdk directory. stamps/extract.stamp: stamps/download.stamp if OPENJDK_SRC_DIR_FOUND cp -a $(OPENJDK_SRC_DIR) openjdk else if ! test -d openjdk ; \ then \ mkdir openjdk ; \ $(TAR) xf $(OPENJDK_SRC_ZIP) -C openjdk; \ chmod -R ug+w openjdk ; \ if test "x${HSBUILD}" != "xoriginal"; then \ rm -rf openjdk/hotspot ; \ fi ; \ sh $(abs_top_srcdir)/fsg.sh ; \ fi if WITH_ALT_HSBUILD if test -e ${HOTSPOT_SRC_ZIP} ; \ then \ if ! test -d openjdk/hotspot ; \ then \ $(TAR) xf $(HOTSPOT_SRC_ZIP) ; \ chmod -R ug+w master-* ; \ mv master-$$($(AWK) 'version==$$1 {print $$2}' version=$(HSBUILD) \ $(abs_top_srcdir)/hotspot.map) openjdk/hotspot ; \ fi ; \ fi endif endif The simplest solution is probably to add an additional target for the HotSpot replacement so it isn't so tightly related to extraction. -- 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 gnu_andrew at member.fsf.org Mon Jun 1 09:02:41 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 1 Jun 2009 17:02:41 +0100 Subject: Releases, releases, releases In-Reply-To: <4A23ECB7.70601@redhat.com> References: <17c6771e0905301712r1537a591gc77c0d8ad6c52883@mail.gmail.com> <4A23ECB7.70601@redhat.com> Message-ID: <17c6771e0906010902w1172b1b8g4fcf74fea0d92f40@mail.gmail.com> 2009/6/1 Andrew Haley : > Andrew John Hughes wrote: > >> This is clearly a long and tedious list for testing on every change so >> we need to narrow down which ones are most release-critical and which >> features really need to be tested, which are useful but not critical. >> For the IcedTea7 release, we decided not to make the CACAO build >> release-critical due to a bug >> (http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=128) >> that at least myself and one of the CACAO devs (Ringding on >> #cacao at FreeNode) have reproduced. ?I think something like that needs >> regular testing, especially for 7, and support from upstream. > > Yes. ?Cacao is really the Cacao maintainers' job to keep working: others > are in no position to debug it when it breaks. > Indeed. We also don't want to start accumulating a patch queue for that as well. The good news is it looks like there may be a fix for the CACAO issue: http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=128 > At a minimum we need to test Zero, x86/32, and x86/64. ?We may not > need to test Zero on a wide range of architectures; that's up for > discussion. > I think having two is already a clear case for needing work distribution; I know I don't have the means to do 32-bit builds. > Re in-tree/out-of-tree builds: I'm not sure that we need to support > (and therefore test) both. ?I think we should stick as close as possible > to the way Sun work upstream, which AFAIK is in-tree. ?I am quite > aware of the advantages of building otside the source tree, but IMO > the disadvantages of building in a way that's not commonly used > upstream outweigh them. ?What do other people think? > To clarify, OpenJDK is always extracted in the build directory and built using the normal OpenJDK make process. This is always (sort of) out-of-tree. The results are all in the build directory, and I presume there is some funky variable that will allow this to be placed elsewhere than the default. What I'm referring to is separating the build of IcedTea (including the entire OpenJDK tree that is extracted and built) from the Mercurial IcedTea checkout being hacked on. >> As to JTReg, I don't think either 6 or 7 yet have a clean run (i.e. >> 100% pass). I've tended to give less regards to results for 7 after >> finding some tests wouldn't even compile, having been broken by API >> changes (see https://bugs.openjdk.java.net/show_bug.cgi?id=100012 for >> example). ?If we're going to run this before releases, we need a clear >> baseline so we can identify regressions, and ideally continuous >> testing so we can spot regressions as soon as they happen. > > OK. > >> As to the actual release process, I think we cleared most of it up but >> for clarity, we now propose a release at least a week in advance and a >> branch is created for release work once tip is considered stable >> enough to undergo pre-release testing. ?This branch can then also be >> used for minor releases, while tip remains open for new major release >> features. > > That is standard practice in most of the free software projects I know > about. ?We need to ask whether a week's notice is enough, though. ?There > are a great many Debian platforms that take a long time to build and test. > Yes, I was querying a week myself as I wrote it. >> If we have a clear release procedure, I think it will be easier for >> everyone to collaborate on future releases and ensure a smoother and >> more hassle-free process. ? Clear goals for a release and easy >> delineation of work are thus the order of the day. > > I think the basic release process is now pretty good, but it would be > better if it were described online. ?A Wiki page detailing the process > can be discussed and edited by all IcedTea stakeholders. ?So, if someone > thinks that testing on a particular platform in a particular way is > needed, they can propose it on the list and add it to the Wiki page > when agreed. ?I must emphasize that anyone insisting that Platform X > must be tested is in effect promising to do the testing. > > The Wiki page should also detail all known JTreg failures. > The process is good. We still don't have clear requirements as to when a release should be regarded as 'ready'. A wiki page sounds good. > Andrew. > -- 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 omajid at redhat.com Mon Jun 1 09:31:36 2009 From: omajid at redhat.com (Omair Majid) Date: Mon, 01 Jun 2009 12:31:36 -0400 Subject: RFC: Fix --enable-hg in IcedTea6 In-Reply-To: <17c6771e0906010851r22114970xdb3ed983f186799c@mail.gmail.com> References: <4A23F568.4040900@redhat.com> <17c6771e0906010851r22114970xdb3ed983f186799c@mail.gmail.com> Message-ID: <4A240268.5020002@redhat.com> Andrew John Hughes wrote: > 2009/6/1 Omair Majid : >> Hi, >> >> Trying to build IcedTea6 with "--enable-hg --with-hg-revision=jdk6-b16" >> fails when applying the patches, even though jdk6-b16 is a known good build. >> The issues appears to be that the Makefile removes the old hotspot only if >> the openjdk directory doesn't already exist. >> >> The attached patch checks USE_HG and then removes the hotspot directory so >> it can be replaced with HS14. >> >> ChangeLog: >> 2009-06-01 Omair Majid >> >> * Makefile.am (stamps/extract.stamp): Remove hotspot if using >> --enable-hg and an alternate hotspot build. >> >> Can someone please review the patch? >> >> Cheers, >> Omair >> > > The presumption was that anyone wanting to use Mercurial as a source > wanted the whole thing. I see. What about the patches then? Should we apply patches from the original hotspot? Or leave out the hotspot patches completely? > > I don't see how the attached patch can work. This would stop the > hotspot directory not being removed when Mercurial is disabled, and > doesn't do anything about the if block which checks for the openjdk > directory. Err...too many negatives in that sentence, so apologies if I misunderstand something. The patch works (as in I can do a 'make patch' with this change applied and everything works). If mercurial is disabled, it does nothing - it only comes into play if --enable-hg is used. In that case, it deletes the hotspot directory so the alternate hotspot tarball is used. Currently hotspot is only replaced if there is no openjdk directory. In case of --enable-hg, there is, so hotspot wasnt being replaced. The patch explicitly rm -rf's the old hotspot direcotry so it is replaced with HS14. Anyway, the entire point is moot if the purpose of --enable-hg is to provide the unmodified hotspot. > > stamps/extract.stamp: stamps/download.stamp > if OPENJDK_SRC_DIR_FOUND > cp -a $(OPENJDK_SRC_DIR) openjdk > else > if ! test -d openjdk ; \ > then \ > mkdir openjdk ; \ > $(TAR) xf $(OPENJDK_SRC_ZIP) -C openjdk; \ > chmod -R ug+w openjdk ; \ > if test "x${HSBUILD}" != "xoriginal"; then \ > rm -rf openjdk/hotspot ; \ > fi ; \ > sh $(abs_top_srcdir)/fsg.sh ; \ > fi > if WITH_ALT_HSBUILD > if test -e ${HOTSPOT_SRC_ZIP} ; \ > then \ > if ! test -d openjdk/hotspot ; \ > then \ > $(TAR) xf $(HOTSPOT_SRC_ZIP) ; \ > chmod -R ug+w master-* ; \ > mv master-$$($(AWK) 'version==$$1 {print $$2}' > version=$(HSBUILD) \ > $(abs_top_srcdir)/hotspot.map) openjdk/hotspot ; \ > fi ; \ > fi > endif > endif > > The simplest solution is probably to add an additional target for the > HotSpot replacement so it isn't so tightly related to extraction. That makes sense, I will see what I can do. Cheers, Omair From gnu_andrew at member.fsf.org Mon Jun 1 10:18:36 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 1 Jun 2009 18:18:36 +0100 Subject: RFC: Fix --enable-hg in IcedTea6 In-Reply-To: <4A240268.5020002@redhat.com> References: <4A23F568.4040900@redhat.com> <17c6771e0906010851r22114970xdb3ed983f186799c@mail.gmail.com> <4A240268.5020002@redhat.com> Message-ID: <17c6771e0906011018v127a02e1pf0b0ed03f593091e@mail.gmail.com> 2009/6/1 Omair Majid : > Andrew John Hughes wrote: >> >> 2009/6/1 Omair Majid : >>> >>> Hi, >>> >>> Trying to build IcedTea6 with "--enable-hg --with-hg-revision=jdk6-b16" >>> fails when applying the patches, even though jdk6-b16 is a known good >>> build. >>> The issues appears to be that the Makefile removes the old hotspot only >>> if >>> the openjdk directory doesn't already exist. >>> >>> The attached patch checks USE_HG and then removes the hotspot directory >>> so >>> it can be replaced with HS14. >>> >>> ChangeLog: >>> 2009-06-01 ?Omair Majid ? >>> >>> ? * Makefile.am (stamps/extract.stamp): Remove hotspot if using >>> ? --enable-hg and an alternate hotspot build. >>> >>> Can someone please review the patch? >>> >>> Cheers, >>> Omair >>> >> >> The presumption was that anyone wanting to use Mercurial as a source >> wanted the whole thing. > > I see. What about the patches then? Should we apply patches from the > original hotspot? Or leave out the hotspot patches completely? > Sorry, I should have been more clear. I was just explaining why the current status quo is as it is. Changing it as you say is the right thing to do. Things are different in 7 (we don't replace HotSpot, there are a heck of a lot more forests) so it makes more sense to use a pristine checkout. BTW, I wouldn't worry too much about --enable-hg not building. It's really there for people who want to live life on the edge i.e. if you want to use live Mercurial sources to build, you should know what you're letting yourself in for :) Again, it's a lot more useful with 7 because there are lots of rapidly changing upstream forests. >> >> I don't see how the attached patch can work. ?This would stop the >> hotspot directory not being removed when Mercurial is disabled, and >> doesn't do anything about the if block which checks for the openjdk >> directory. > > Err...too many negatives in that sentence, so apologies if I misunderstand > something. Sorry on my part :) The patch works (as in I can do a 'make patch' with this change > applied and everything works) With what configuration options? Do both non-hg and hg builds still work? Does a full build work? . If mercurial is disabled, it does nothing - > it only comes into play if --enable-hg is used. In that case, it deletes the > hotspot directory so the alternate hotspot tarball is used. This is my point; we should always delete the hotspot directory and use an alternate tarball if alternate HotSpot is turned on (which it is by default). Looking at this, it will stop HotSpot being replaced for a normal build and we'll end up with hs11 and broken patches... > Currently > hotspot is only replaced if there is no openjdk directory. In case of > --enable-hg, there is, so hotspot wasnt being replaced. > The patch explicitly > rm -rf's the old hotspot direcotry so it is replaced with HS14. Right, but that should happen, hg or no hg. With your patch, it's only with hg. > Anyway, the > entire point is moot if the purpose of --enable-hg is to provide the > unmodified hotspot. In the case of 6, I think we should still replace HotSpot. > >> >> stamps/extract.stamp: stamps/download.stamp >> if OPENJDK_SRC_DIR_FOUND >> ? ? ? ?cp -a $(OPENJDK_SRC_DIR) openjdk >> else >> ? ? ? ?if ! test -d openjdk ; \ >> ? ? ? ?then \ >> ? ? ? ? ?mkdir openjdk ; \ >> ? ? ? ? ?$(TAR) xf $(OPENJDK_SRC_ZIP) -C openjdk; \ >> ? ? ? ? ?chmod -R ug+w openjdk ; \ >> ? ? ? ? ?if test "x${HSBUILD}" != "xoriginal"; then \ >> ? ? ? ? ? ?rm -rf openjdk/hotspot ; \ >> ? ? ? ? ?fi ; \ >> ? ? ? ? ?sh $(abs_top_srcdir)/fsg.sh ; \ >> ? ? ? ?fi >> if WITH_ALT_HSBUILD >> ? ? ? ?if test -e ${HOTSPOT_SRC_ZIP} ; \ >> ? ? ? ?then \ >> ? ? ? ? ?if ! test -d openjdk/hotspot ; \ >> ? ? ? ? ?then \ >> ? ? ? ? ? ?$(TAR) xf $(HOTSPOT_SRC_ZIP) ; \ >> ? ? ? ? ? ?chmod -R ug+w master-* ; \ >> ? ? ? ? ? ?mv master-$$($(AWK) 'version==$$1 {print $$2}' >> version=$(HSBUILD) \ >> ? ? ? ? ? ? ?$(abs_top_srcdir)/hotspot.map) openjdk/hotspot ; \ >> ? ? ? ? ?fi ; \ >> ? ? ? ?fi >> endif >> endif >> >> The simplest solution is probably to add an additional target for the >> HotSpot replacement so it isn't so tightly related to extraction. > > That makes sense, I will see what I can do. > I think it would make the whole thing less confusing and easier to work on. Thanks. > Cheers, > Omair > -- 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 omajid at redhat.com Mon Jun 1 14:03:08 2009 From: omajid at redhat.com (Omair Majid) Date: Mon, 01 Jun 2009 17:03:08 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file Message-ID: <4A24420C.4030401@redhat.com> Hi, The attached patch allows Netx to use the JVM arguments specified in the JNLP file. Currently only 'initial-heap-size', 'max-heap-size' and 'java-vm-args' are used. The first instance of the JVM parses the JNLP file and creates a new JVM with the required arguments if the JNLP file requires it. The option '-Xnofork' is passed to Netx to indicate it shouldnt fork any more JVMs. This also makes it possible to revert to the old behaviour by passing -Xnofork to the first instance of Netx. ChangeLog: 2009-06-01 Omair Majid * rt/net/sourceforge/jnlp/JNLPFile.java (needsNewJVM): New function. Returns true if the JNLP file requires creating a new JVM. (getNewVMArgs): New function. Returns arguments to pass to the new JVM. * rt/net/sourceforge/jnlp/Launcher.java (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to the Java program. (launchExternal): Likewise. Launch Netx with the with the appropriate arguments. (launchApplication): If needed, launch a new JVM. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add BXnofork. * rt/net/sourceforge/jnlp/runtime/Boot/java: Add -Xnofork to helpMessage (main): Check for '-Xnofork'. * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add forksAllowed to store whether creating a new JVM is allowed. (getForksAllowed): New function. Check if creating a new JVM is allowed. (setForksAllowed): New function. Set whether creating a JVM is allowed. * rt/net/sourceforge/jnlp/services/XBasicService.java (showDocument): Fix call to launchExternal to match the new semantics. Any comments? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jvm-args.patch Type: text/x-patch Size: 10848 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090601/94a6276b/attachment.bin From ekrichardson at gmail.com Mon Jun 1 15:56:36 2009 From: ekrichardson at gmail.com (Eric Richardson) Date: Mon, 1 Jun 2009 15:56:36 -0700 Subject: Mac OS X - Power PC Build Progress Message-ID: <860cb0120906011556o5f7c48c7n36c8224380858173@mail.gmail.com> Hi All, I made another try at building Icedtea-1.10 yesterday. I have been able to work through all the patches. Some files are being worked on by multiple patches. I have kept track but need to go through my notes before I report my findings and diffs. The basic problem I am having now is that MacOSX on PowerPC reports as "Power Macintosh" so the default configure comes out to be bsd-Power Macintosh. I use ALT_OUTPUTDIR to get the make started. This machine has a ppc970 processor so should it be as defaulted(ARCH_DATA_MODEL=64)? Note: ZERO_ARCHFLAG=-m32 shown below. The core build is defaulting back to 'Power Macintosh' and the spaces seem to be causing problems. Here are the possible offending vars from the output below: ARCH = Power Macintosh\n LIBARCH = Power Macintosh\n ARCH_FAMILY = Power Macintosh\n Error follows. >>>Recursively making core build @ Mon Jun 1 00:26:52 PDT 2009 ... ../../../common/Rules.gmk:263: warning: overriding commands for target `Macintosh' ../../../common/Rules.gmk:49: warning: ignoring old commands for target `Macintosh' ../../../common/Library.gmk:67: *** target file `/Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/lib/Power' has both : and :: entries. Stop. make[5]: *** [build] Error 1 make[4]: *** [build] Error 1 make[3]: *** [build] Error 1 make[2]: *** [corba-build] Error 2 make[1]: *** [build_product_image] Error 2 make: *** [stamps/icedtea-ecj.stamp] Error 2 I have no idea how far I made it but it is much better than before. Any pointers to the appropriate place to adjust the build is appreciated. Eric Commands and some Output follows - may be a bit out of order as it was late ------------------------------ ./autogen.sh ./configure --enable-zero=yes --with-project=bsd --with-gcj-home=/Users/eric/jdk1.5 --with-ecj-jar=/opt/local/share/java/eclipse-ecj.jar --with-xalan2-jar=/opt/local/share/java/xalan.jar --with-xalan2-serializer-jar=/opt/local/share/java/serializer.jar --with-xerces2-jar=/opt/local/share/java/xercesImpl.jar --without-rhino --disable-plugin --disable-xrender make ALT_OUTPUTDIR=`pwd`/build/bsd-macosx ALT_FREETYPE_LIB_PATH=/opt/local/lib ALT_FREETYPE_HEADERS_PATH=/opt/local/include ALT_JIBX_LIBS_PATH=/Users/eric/java/jibx-1.2.1/lib /usr/bin/make \ "ALT_JDK_IMPORT_PATH=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0" "ANT_HOME=/usr/share/ant" "BUILD_NUMBER=b59" "JDK_UPDATE_VERSION=0" "JRE_RELEASE_VERSION=1.7.0_0-b59" "MILESTONE=fcs" "LANG=C" "PATH=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin::$PATH" "ALT_BOOTDIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0" "BUILD_ARCH_DIR=ppc" "ICEDTEA_RT=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar" "ICEDTEA_BUILD_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/" "ICEDTEA_CLS_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes" "ICEDTEA_ENDORSED_DIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/lib/endorsed" "ENDORSED=-Djava.endorsed.dirs=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/lib/endorsed" "BOOTCLASSPATH_CLS_RT=-bootclasspath /Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes:/Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar" "BOOTCLASSPATH_CLS=-bootclasspath /Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes" "BOOTCLASSPATH_RT_LIBGCJ=-bootclasspath /Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar:/Users/eric/jdk1.5/jre/lib/rt.jar" "CLASSPATH=" "LD_LIBRARY_PATH=" "GENSRCDIR=/Users/eric/java/icedtea-1.10/generated" "ICEDTEA_CORE_BUILD=yes" "ICEDTEA_ZERO_BUILD=yes" "ICEDTEA_SHARK_BUILD=" "ZERO_LIBARCH=ppc" "ZERO_BITSPERWORD=32" "ZERO_ENDIANNESS=big" "ZERO_ARCHDEF=PPC" "ZERO_ARCHFLAG=-m32" "LIBFFI_CFLAGS=-I/opt/local/lib/libffi-3.0.6/include " "LIBFFI_LIBS=-L/opt/local/lib -lffi " "LLVM_CFLAGS=" "LLVM_LDFLAGS=" "LLVM_LIBS=" "FREETYPE2_HEADERS=-I/opt/local/include/freetype2 -I/opt/local/include " "FT2_LIB=-L/opt/local/lib -lfreetype -lz " "ALT_PARALLEL_COMPILE_JOBS=2" "HOTSPOT_BUILD_JOBS=2" "JAVAC=" "RHINO_JAR=no" "JAR_KNOWS_ATFILE=1" "JAR_KNOWS_J_OPTIONS=1" "JAR_ACCEPTS_STDIN_LIST=" "DISABLE_NIMBUS=true" "ALT_NETX_DIST=/Users/eric/java/icedtea-1.10/netx.build" "ALT_LIVECONNECT_DIST=/Users/eric/java/icedtea-1.10" \ -C openjdk-ecj \ Control bsd Power Macintosh 1.7.0_0-bsd all build started: ( cd ./jdk/make && \ /usr/bin/make sanity HOTSPOT_IMPORT_CHECK=false JDK_TOPDIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk JDK_MAKE_SHARED_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk/make/common/shared EXTERNALSANITYCONTROL=true TARGET_CLASS_VERSION=5 MILESTONE=fcs BUILD_NUMBER=b59 JDK_BUILD_NUMBER=b59 FULL_VERSION=1.7.0_0-bsd-b59 PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0_0 JDK_MKTG_VERSION=7u JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 ARCH_DATA_MODEL=64 COOKED_JDK_UPDATE_VERSION=0 COOKED_BUILD_NUMBER=59 ANT_HOME="/usr/share/ant" ALT_OUTPUTDIR=/Users/eric/java/icedtea-1.10/build/bsd-macosx ALT_LANGTOOLS_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist ALT_CORBA_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/dist ALT_JAXP_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxp/dist ALT_JAXWS_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxws/dist ALT_HOTSPOT_IMPORT_PATH=/Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import BUILD_HOTSPOT=true ; ) Build Machine Information: build machine = new-host.home Build Directory Structure: CWD = /Users/eric/java/icedtea-1.10/openjdk-ecj TOPDIR = . CONTROL_TOPDIR = . LANGTOOLS_TOPDIR = ./langtools JAXP_TOPDIR = ./jaxp JAXWS_TOPDIR = ./jaxws CORBA_TOPDIR = ./corba HOTSPOT_TOPDIR = ./hotspot JDK_TOPDIR = ./jdk Build Directives: BUILD_LANGTOOLS = true BUILD_JAXP = true BUILD_JAXWS = true BUILD_CORBA = true BUILD_HOTSPOT = true BUILD_JDK = true Hotspot Settings: \n HOTSPOT_BUILD_JOBS = 2 \n HOTSPOT_OUTPUTDIR = /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/outputdir \n HOTSPOT_EXPORT_PATH = /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import \n \n \nBootstrap Settings:\n BOOTDIR = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n ALT_BOOTDIR = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n BOOT_VER = 1.5.0 [requires at least 1.5]\n OUTPUTDIR = /Users/eric/java/icedtea-1.10/build/bsd-macosx\n ALT_OUTPUTDIR = /Users/eric/java/icedtea-1.10/build/bsd-macosx\n ABS_OUTPUTDIR = /Users/eric/java/icedtea-1.10/build/bsd-macosx\n \nBuild Tool Settings:\n SLASH_JAVA = /NOT-SET\n ALT_SLASH_JAVA = \n VARIANT = OPT\n JDK_DEVTOOLS_DIR = /NOT-SET/devtools\n ALT_JDK_DEVTOOLS_DIR = \n ANT_HOME = /usr/share/ant\n UNIXCOMMAND_PATH = /bin/\n ALT_UNIXCOMMAND_PATH = \n COMPILER_PATH = /usr/bin/\n ALT_COMPILER_PATH = \n DEVTOOLS_PATH = /opt/local/bin/\n ALT_DEVTOOLS_PATH = \n COMPILER_NAME = GCC4\n COMPILER_VERSION = GCC4\n CC_VER = 4.0.1 [requires at least 3.2]\n ZIP_VER = 2.32 [requires at least 2.2]\n UNZIP_VER = 5.52 [requires at least 5.12]\n ANT_VER = 1.7.0 [requires at least 1.6.3]\n TEMPDIR = /Users/eric/java/icedtea-1.10/build/bsd-macosx/tmp\n \nBuild Directives:\n OPENJDK = true\n USE_HOTSPOT_INTERPRETER_MODE = \n PEDANTIC = \n DEV_ONLY = \n NO_DOCS = \n NO_IMAGES = \n TOOLS_ONLY = \n INSANE = \n COMPILE_APPROACH = parallel\n PARALLEL_COMPILE_JOBS = 2\n ALT_PARALLEL_COMPILE_JOBS = 2\n FASTDEBUG = \n COMPILER_WARNINGS_FATAL = false\n COMPILER_WARNING_LEVEL = \n INCREMENTAL_BUILD = false\n CC_HIGHEST_OPT = \n CC_HIGHER_OPT = \n CC_LOWER_OPT = \n CXXFLAGS = -O2 -fPIC -DCC_NOEX -W -Wall -Wno-unused -Wno-parentheses \n CFLAGS = -O2 -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses \n BOOT_JAVA_CMD = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx896m -Xms128m -XX:PermSize=32m -XX:MaxPermSize=160m\n BOOT_JAVAC_CMD = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/javac -J-XX:ThreadStackSize=1536 -J-XX:-PrintVMOptions -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput -J-Xmx896m -J-Xms128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii -XDignore.symbol.file=true\n BOOT_JAR_CMD = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/jar\n BOOT_JARSIGNER_CMD = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/jarsigner\n JAVAC_CMD = \n JAVAH_CMD = \n JAVADOC_CMD = \n \nBuild Platform Settings:\n USER = eric\n PLATFORM = bsd\n ARCH = Power Macintosh\n LIBARCH = Power Macintosh\n ARCH_FAMILY = Power Macintosh\n ARCH_DATA_MODEL = 64\n ARCHPROP = Power Macintosh\n OS_VERSION = 9.6.0 [requires at least 8.0]\n OS_VARIANT_NAME = \n OS_VARIANT_VERSION = \n TEMP_FREE_SPACE = 312319584\n FREE_SPACE = 312319584\n MB_OF_MEMORY = 1024\n \nGNU Make Settings:\n MAKE = /usr/bin/make\n MAKE_VER = 3.81 [requires at least 3.78]\n MAKECMDGOALS = sanity\n MAKEFLAGS = \n SHELL = /bin/sh\n \nTarget Build Versions:\n JDK_VERSION = 1.7.0_0\n MILESTONE = fcs\n RELEASE = 1.7.0_0-bsd\n FULL_VERSION = 1.7.0_0-bsd-b59\n BUILD_NUMBER = b59\n \nExternal File/Binary Locations:\n USRJDKINSTANCES_PATH = /opt/local\n BUILD_JDK_IMPORT_PATH = /NOT-SET/re/jdk/1.7.0_0/promoted/latest/binaries\n ALT_BUILD_JDK_IMPORT_PATH = \n JDK_IMPORT_PATH = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n ALT_JDK_IMPORT_PATH = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n LANGTOOLS_DIST = \n ALT_LANGTOOLS_DIST = /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist\n CORBA_DIST = \n ALT_CORBA_DIST = /Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/dist\n JAXP_DIST = \n ALT_JAXP_DIST = /Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxp/dist\n JAXWS_DIST = \n ALT_JAXWS_DIST = /Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxws/dist\n HOTSPOT_DOCS_IMPORT_PATH = /NO_DOCS_DIR\n ALT_HOTSPOT_DOCS_IMPORT_PATH = \n HOTSPOT_IMPORT_PATH = /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import\n ALT_HOTSPOT_IMPORT_PATH = /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import\n HOTSPOT_SERVER_PATH = /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import/jre/lib/Power Macintosh/server\n ALT_HOTSPOT_SERVER_PATH = \n CACERTS_FILE = ./../src/share/lib/security/cacerts\n ALT_CACERTS_FILE = \n JIBX_LIBS_PATH = /Users/eric/java/jibx-1.2.1/lib\n ALT_JIBX_LIBS_PATH = /Users/eric/java/jibx-1.2.1/lib\n CUPS_HEADERS_PATH = /usr/include\n ALT_CUPS_HEADERS_PATH = \n \nOpenJDK-specific settings:\n FREETYPE_HEADERS_PATH = /opt/local/include\n ALT_FREETYPE_HEADERS_PATH = /opt/local/include\n FREETYPE_LIB_PATH = /opt/local/lib\n ALT_FREETYPE_LIB_PATH = /opt/local/lib\n X11_PATH = /usr/X11R6\n ALT_X11_PATH = \n \nOPENJDK Import Binary Plug Settings:\n IMPORT_BINARY_PLUGS = \n BINARY_PLUGS_JARFILE = /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs/bsd-Power Macintosh/jre/lib/rt-closed.jar\n ALT_BINARY_PLUGS_JARFILE = \n BINARY_PLUGS_PATH = /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs/bsd-Power Macintosh\n ALT_BINARY_PLUGS_PATH = \n BUILD_BINARY_PLUGS_PATH = /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs\n ALT_BUILD_BINARY_PLUGS_PATH = \n PLUG_LIBRARY_NAMES = \n \nPrevious JDK Settings:\n PREVIOUS_RELEASE_PATH = USING-PREVIOUS_RELEASE_IMAGE\n ALT_PREVIOUS_RELEASE_PATH = \n PREVIOUS_JDK_VERSION = 1.6.0\n ALT_PREVIOUS_JDK_VERSION = \n PREVIOUS_JDK_FILE = \n ALT_PREVIOUS_JDK_FILE = \n PREVIOUS_JRE_FILE = \n ALT_PREVIOUS_JRE_FILE = \n PREVIOUS_RELEASE_IMAGE = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n ALT_PREVIOUS_RELEASE_IMAGE = \n Sanity check passed. Control bsd Power Macintosh 1.7.0_0-bsd all_product_build build started: Control bsd Power Macintosh 1.7.0_0-bsd build_product_image build started: /usr/bin/make \ SKIP_FASTDEBUG_BUILD=true \ SKIP_DEBUG_BUILD=true \ \ generic_build_repo_series /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx/j2sdk-image /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools (cd ./langtools/make && \ /usr/bin/make JDK_TOPDIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk JDK_MAKE_SHARED_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk/make/common/shared EXTERNALSANITYCONTROL=true TARGET_CLASS_VERSION=5 MILESTONE=fcs BUILD_NUMBER=b59 JDK_BUILD_NUMBER=b59 FULL_VERSION=1.7.0_0-bsd-b59 PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0_0 JDK_MKTG_VERSION=7u JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 ARCH_DATA_MODEL=64 COOKED_JDK_UPDATE_VERSION=0 COOKED_BUILD_NUMBER=59 ANT_HOME="/usr/share/ant" ALT_OUTPUTDIR=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools ALT_BOOTDIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0 all) ANT_OPTS=-Djava.io.tmpdir='/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-tmp' ant -diagnostics > /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-diagnostics.log ANT_OPTS=-Djava.io.tmpdir='/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-tmp' ant -Djdk.version=1.7.0_0 -Dfull.version='1.7.0_0-bsd-b59' -Drelease=1.7.0_0 -Dbuild.number=b59 -Djavac.target=5 -Dboot.java.home=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0 -Djavac.executable=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/javac -Dbuild.dir=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build -Ddist.dir=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist build Buildfile: build.xml -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090601/e01dd6de/attachment.html From gbenson at redhat.com Tue Jun 2 07:12:59 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 02 Jun 2009 14:12:59 +0000 Subject: changeset in /hg/icedtea6: 2009-06-02 Gary Benson changeset b7825ac40fd9 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=b7825ac40fd9 description: 2009-06-02 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::ExceptionAction): Replaced with... (SharkTopLevelBlock::ExceptionActionMask): New enum. (SharkTopLevelBlock::check_pending_exception): Changed type of action argument from ExceptionAction to int. (SharkTopLevelBlock::handle_exception): Likewise. (SharkTopLevelBlock::call_vm): Likewise. (SharkTopLevelBlock::acquire_lock): Likewise. (SharkTopLevelBlock::release_lock): Likewise. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::check_pending_exception): Changed type of action argument from ExceptionAction to int, and added monitor-fudging support. (SharkTopLevelBlock::handle_exception): Changed type of action argument from ExceptionAction to int. (SharkTopLevelBlock::acquire_lock): Changed type of action argument from ExceptionAction to int, and added monitor- fudging to the VM call. (SharkTopLevelBlock::release_lock): Likewise. diffstat: 3 files changed, 71 insertions(+), 32 deletions(-) ChangeLog | 22 +++++++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 35 +++++++---- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 46 ++++++++------- diffs (213 lines): diff -r 6b95c888541f -r b7825ac40fd9 ChangeLog --- a/ChangeLog Fri May 29 12:13:53 2009 -0400 +++ b/ChangeLog Tue Jun 02 15:14:15 2009 +0100 @@ -1,3 +1,25 @@ 2009-05-29 Omair Majid + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::ExceptionAction): Replaced with... + (SharkTopLevelBlock::ExceptionActionMask): New enum. + (SharkTopLevelBlock::check_pending_exception): Changed type + of action argument from ExceptionAction to int. + (SharkTopLevelBlock::handle_exception): Likewise. + (SharkTopLevelBlock::call_vm): Likewise. + (SharkTopLevelBlock::acquire_lock): Likewise. + (SharkTopLevelBlock::release_lock): Likewise. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::check_pending_exception): Changed type + of action argument from ExceptionAction to int, and added + monitor-fudging support. + (SharkTopLevelBlock::handle_exception): Changed type of + action argument from ExceptionAction to int. + (SharkTopLevelBlock::acquire_lock): Changed type of action + argument from ExceptionAction to int, and added monitor- + fudging to the VM call. + (SharkTopLevelBlock::release_lock): Likewise. + 2009-05-29 Omair Majid * rt/net/sourceforge/jnlp/JREDesc.java: diff -r 6b95c888541f -r b7825ac40fd9 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri May 29 12:13:53 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 02 15:14:15 2009 +0100 @@ -331,9 +331,9 @@ void SharkTopLevelBlock::check_bounds(Sh builder()->SetInsertPoint(in_bounds); } -void SharkTopLevelBlock::check_pending_exception(ExceptionAction action) -{ - assert(action != EX_CHECK_NONE, "shouldn't be"); +void SharkTopLevelBlock::check_pending_exception(int action) +{ + assert(action & EAM_CHECK, "should be"); BasicBlock *exception = function()->CreateBlock("exception"); BasicBlock *no_exception = function()->CreateBlock("no_exception"); @@ -349,16 +349,23 @@ void SharkTopLevelBlock::check_pending_e builder()->SetInsertPoint(exception); builder()->CreateStore(LLVMValue::null(), pending_exception_addr); SharkState *saved_state = current_state()->copy(); - handle_exception(pending_exception, action); + if (action & EAM_MONITOR_FUDGE) { + // The top monitor is marked live, but the exception was thrown + // while setting it up or tearing it down. We need to mark it + // dead before we enter any exception handlers as they will not + // expect it to be there. + set_num_monitors(num_monitors() - 1); + action ^= EAM_MONITOR_FUDGE; + } + handle_exception(pending_exception, action); set_current_state(saved_state); builder()->SetInsertPoint(no_exception); } -void SharkTopLevelBlock::handle_exception(Value* exception, - ExceptionAction action) -{ - if (action == EX_CHECK_FULL && num_exceptions() != 0) { +void SharkTopLevelBlock::handle_exception(Value* exception, int action) +{ + if (action & EAM_HANDLE && num_exceptions() != 0) { // Clear the stack and push the exception onto it. // We do this now to protect it across the VM call // we may be about to make. @@ -1631,7 +1638,7 @@ void SharkTopLevelBlock::do_monitorexit( release_lock(EX_CHECK_FULL); } -void SharkTopLevelBlock::acquire_lock(Value *lockee, ExceptionAction ea) +void SharkTopLevelBlock::acquire_lock(Value *lockee, int exception_action) { BasicBlock *try_recursive = function()->CreateBlock("try_recursive"); BasicBlock *got_recursive = function()->CreateBlock("got_recursive"); @@ -1705,7 +1712,9 @@ void SharkTopLevelBlock::acquire_lock(Va // It's not a recursive case so we need to drop into the runtime builder()->SetInsertPoint(not_recursive); - call_vm(SharkRuntime::monitorenter(), monitor_addr, ea); + call_vm( + SharkRuntime::monitorenter(), monitor_addr, + exception_action | EAM_MONITOR_FUDGE); BasicBlock *acquired_slow = builder()->GetInsertBlock(); builder()->CreateBr(lock_acquired); @@ -1714,7 +1723,7 @@ void SharkTopLevelBlock::acquire_lock(Va current_state()->merge(fast_state, acquired_fast, acquired_slow); } -void SharkTopLevelBlock::release_lock(ExceptionAction ea) +void SharkTopLevelBlock::release_lock(int exception_action) { BasicBlock *not_recursive = function()->CreateBlock("not_recursive"); BasicBlock *released_fast = function()->CreateBlock("released_fast"); @@ -1757,7 +1766,9 @@ void SharkTopLevelBlock::release_lock(Ex // Need to drop into the runtime to release this one builder()->SetInsertPoint(slow_path); - call_vm(SharkRuntime::monitorexit(), monitor_addr, ea); + call_vm( + SharkRuntime::monitorexit(), monitor_addr, + exception_action | EAM_MONITOR_FUDGE); BasicBlock *released_slow = builder()->GetInsertBlock(); builder()->CreateBr(lock_released); diff -r 6b95c888541f -r b7825ac40fd9 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri May 29 12:13:53 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Tue Jun 02 15:14:15 2009 +0100 @@ -237,28 +237,34 @@ class SharkTopLevelBlock : public SharkB SharkState* saved_state, llvm::BasicBlock* continue_block); // Exceptions - enum ExceptionAction { - EX_CHECK_NONE, // don't check for pending exceptions - EX_CHECK_NO_CATCH, // if there is a pending exception then throw it - EX_CHECK_FULL // if there is a pending exception then catch it - }; // if it has a handler or throw it otherwise - void check_pending_exception(ExceptionAction action); - void handle_exception(llvm::Value* exception, ExceptionAction action); + enum ExceptionActionMask { + // The actual bitmasks that things test against + EAM_CHECK = 1, // whether to check for pending exceptions + EAM_HANDLE = 2, // whether to attempt to handle pending exceptions + EAM_MONITOR_FUDGE = 4, // whether the monitor count needs adjusting + + // More convenient values for passing + EX_CHECK_NONE = 0, + EX_CHECK_NO_CATCH = EAM_CHECK, + EX_CHECK_FULL = EAM_CHECK | EAM_HANDLE + }; + void check_pending_exception(int action); + void handle_exception(llvm::Value* exception, int action); // VM calls private: llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value** args_start, llvm::Value** args_end, - ExceptionAction ea) + int exception_action) { current_state()->decache_for_VM_call(); function()->set_last_Java_frame(); llvm::CallInst *res = builder()->CreateCall(callee, args_start, args_end); function()->reset_last_Java_frame(); current_state()->cache_after_VM_call(); - if (ea != EX_CHECK_NONE) { - check_pending_exception(ea); + if (exception_action) { + check_pending_exception(exception_action); current_state()->set_has_safepointed(true); } return res; @@ -266,40 +272,40 @@ class SharkTopLevelBlock : public SharkB public: llvm::CallInst* call_vm(llvm::Constant* callee, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread()}; - return call_vm(callee, args, args + 1, ea); + return call_vm(callee, args, args + 1, exception_action); } llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value* arg1, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread(), arg1}; - return call_vm(callee, args, args + 2, ea); + return call_vm(callee, args, args + 2, exception_action); } llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value* arg1, llvm::Value* arg2, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread(), arg1, arg2}; - return call_vm(callee, args, args + 3, ea); + return call_vm(callee, args, args + 3, exception_action); } llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value* arg1, llvm::Value* arg2, llvm::Value* arg3, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread(), arg1, arg2, arg3}; - return call_vm(callee, args, args + 4, ea); + return call_vm(callee, args, args + 4, exception_action); } // Synchronization private: - void acquire_lock(llvm::Value* lockee, ExceptionAction ea); - void release_lock(ExceptionAction ea); + void acquire_lock(llvm::Value* lockee, int exception_action); + void release_lock(int exception_action); public: void acquire_method_lock(); From gbenson at redhat.com Tue Jun 2 07:17:56 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 2 Jun 2009 15:17:56 +0100 Subject: Shark exception processing improvements (part 2) Message-ID: <20090602141756.GB3173@redhat.com> Hi all, This commit fixes a bug where if exceptions thrown during monitor setup and teardown were caught, the handler they entered would be entered as if the monitor that failed were live. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 6b95c888541f -r b7825ac40fd9 ChangeLog --- a/ChangeLog Fri May 29 12:13:53 2009 -0400 +++ b/ChangeLog Tue Jun 02 15:14:15 2009 +0100 @@ -1,3 +1,25 @@ +2009-06-02 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::ExceptionAction): Replaced with... + (SharkTopLevelBlock::ExceptionActionMask): New enum. + (SharkTopLevelBlock::check_pending_exception): Changed type + of action argument from ExceptionAction to int. + (SharkTopLevelBlock::handle_exception): Likewise. + (SharkTopLevelBlock::call_vm): Likewise. + (SharkTopLevelBlock::acquire_lock): Likewise. + (SharkTopLevelBlock::release_lock): Likewise. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::check_pending_exception): Changed type + of action argument from ExceptionAction to int, and added + monitor-fudging support. + (SharkTopLevelBlock::handle_exception): Changed type of + action argument from ExceptionAction to int. + (SharkTopLevelBlock::acquire_lock): Changed type of action + argument from ExceptionAction to int, and added monitor- + fudging to the VM call. + (SharkTopLevelBlock::release_lock): Likewise. + 2009-05-29 Omair Majid * rt/net/sourceforge/jnlp/JREDesc.java: diff -r 6b95c888541f -r b7825ac40fd9 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri May 29 12:13:53 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 02 15:14:15 2009 +0100 @@ -331,9 +331,9 @@ builder()->SetInsertPoint(in_bounds); } -void SharkTopLevelBlock::check_pending_exception(ExceptionAction action) +void SharkTopLevelBlock::check_pending_exception(int action) { - assert(action != EX_CHECK_NONE, "shouldn't be"); + assert(action & EAM_CHECK, "should be"); BasicBlock *exception = function()->CreateBlock("exception"); BasicBlock *no_exception = function()->CreateBlock("no_exception"); @@ -349,16 +349,23 @@ builder()->SetInsertPoint(exception); builder()->CreateStore(LLVMValue::null(), pending_exception_addr); SharkState *saved_state = current_state()->copy(); - handle_exception(pending_exception, action); + if (action & EAM_MONITOR_FUDGE) { + // The top monitor is marked live, but the exception was thrown + // while setting it up or tearing it down. We need to mark it + // dead before we enter any exception handlers as they will not + // expect it to be there. + set_num_monitors(num_monitors() - 1); + action ^= EAM_MONITOR_FUDGE; + } + handle_exception(pending_exception, action); set_current_state(saved_state); builder()->SetInsertPoint(no_exception); } -void SharkTopLevelBlock::handle_exception(Value* exception, - ExceptionAction action) +void SharkTopLevelBlock::handle_exception(Value* exception, int action) { - if (action == EX_CHECK_FULL && num_exceptions() != 0) { + if (action & EAM_HANDLE && num_exceptions() != 0) { // Clear the stack and push the exception onto it. // We do this now to protect it across the VM call // we may be about to make. @@ -1631,7 +1638,7 @@ release_lock(EX_CHECK_FULL); } -void SharkTopLevelBlock::acquire_lock(Value *lockee, ExceptionAction ea) +void SharkTopLevelBlock::acquire_lock(Value *lockee, int exception_action) { BasicBlock *try_recursive = function()->CreateBlock("try_recursive"); BasicBlock *got_recursive = function()->CreateBlock("got_recursive"); @@ -1705,7 +1712,9 @@ // It's not a recursive case so we need to drop into the runtime builder()->SetInsertPoint(not_recursive); - call_vm(SharkRuntime::monitorenter(), monitor_addr, ea); + call_vm( + SharkRuntime::monitorenter(), monitor_addr, + exception_action | EAM_MONITOR_FUDGE); BasicBlock *acquired_slow = builder()->GetInsertBlock(); builder()->CreateBr(lock_acquired); @@ -1714,7 +1723,7 @@ current_state()->merge(fast_state, acquired_fast, acquired_slow); } -void SharkTopLevelBlock::release_lock(ExceptionAction ea) +void SharkTopLevelBlock::release_lock(int exception_action) { BasicBlock *not_recursive = function()->CreateBlock("not_recursive"); BasicBlock *released_fast = function()->CreateBlock("released_fast"); @@ -1757,7 +1766,9 @@ // Need to drop into the runtime to release this one builder()->SetInsertPoint(slow_path); - call_vm(SharkRuntime::monitorexit(), monitor_addr, ea); + call_vm( + SharkRuntime::monitorexit(), monitor_addr, + exception_action | EAM_MONITOR_FUDGE); BasicBlock *released_slow = builder()->GetInsertBlock(); builder()->CreateBr(lock_released); diff -r 6b95c888541f -r b7825ac40fd9 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri May 29 12:13:53 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Tue Jun 02 15:14:15 2009 +0100 @@ -237,28 +237,34 @@ SharkState* saved_state, llvm::BasicBlock* continue_block); // Exceptions - enum ExceptionAction { - EX_CHECK_NONE, // don't check for pending exceptions - EX_CHECK_NO_CATCH, // if there is a pending exception then throw it - EX_CHECK_FULL // if there is a pending exception then catch it - }; // if it has a handler or throw it otherwise - void check_pending_exception(ExceptionAction action); - void handle_exception(llvm::Value* exception, ExceptionAction action); + enum ExceptionActionMask { + // The actual bitmasks that things test against + EAM_CHECK = 1, // whether to check for pending exceptions + EAM_HANDLE = 2, // whether to attempt to handle pending exceptions + EAM_MONITOR_FUDGE = 4, // whether the monitor count needs adjusting + + // More convenient values for passing + EX_CHECK_NONE = 0, + EX_CHECK_NO_CATCH = EAM_CHECK, + EX_CHECK_FULL = EAM_CHECK | EAM_HANDLE + }; + void check_pending_exception(int action); + void handle_exception(llvm::Value* exception, int action); // VM calls private: llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value** args_start, llvm::Value** args_end, - ExceptionAction ea) + int exception_action) { current_state()->decache_for_VM_call(); function()->set_last_Java_frame(); llvm::CallInst *res = builder()->CreateCall(callee, args_start, args_end); function()->reset_last_Java_frame(); current_state()->cache_after_VM_call(); - if (ea != EX_CHECK_NONE) { - check_pending_exception(ea); + if (exception_action) { + check_pending_exception(exception_action); current_state()->set_has_safepointed(true); } return res; @@ -266,40 +272,40 @@ public: llvm::CallInst* call_vm(llvm::Constant* callee, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread()}; - return call_vm(callee, args, args + 1, ea); + return call_vm(callee, args, args + 1, exception_action); } llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value* arg1, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread(), arg1}; - return call_vm(callee, args, args + 2, ea); + return call_vm(callee, args, args + 2, exception_action); } llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value* arg1, llvm::Value* arg2, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread(), arg1, arg2}; - return call_vm(callee, args, args + 3, ea); + return call_vm(callee, args, args + 3, exception_action); } llvm::CallInst* call_vm(llvm::Constant* callee, llvm::Value* arg1, llvm::Value* arg2, llvm::Value* arg3, - ExceptionAction ea) + int exception_action) { llvm::Value *args[] = {thread(), arg1, arg2, arg3}; - return call_vm(callee, args, args + 4, ea); + return call_vm(callee, args, args + 4, exception_action); } // Synchronization private: - void acquire_lock(llvm::Value* lockee, ExceptionAction ea); - void release_lock(ExceptionAction ea); + void acquire_lock(llvm::Value* lockee, int exception_action); + void release_lock(int exception_action); public: void acquire_method_lock(); From gbenson at redhat.com Tue Jun 2 07:29:13 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 02 Jun 2009 14:29:13 +0000 Subject: changeset in /hg/icedtea6: 2009-06-02 Gary Benson changeset 44cd62d979db in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=44cd62d979db description: 2009-06-02 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::call_vm): Bugfix. diffstat: 2 files changed, 6 insertions(+), 1 deletion(-) ChangeLog | 5 +++++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 2 +- diffs (24 lines): diff -r b7825ac40fd9 -r 44cd62d979db ChangeLog --- a/ChangeLog Tue Jun 02 15:14:15 2009 +0100 +++ b/ChangeLog Tue Jun 02 15:30:30 2009 +0100 @@ -1,3 +1,8 @@ 2009-06-02 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::call_vm): Bugfix. + 2009-06-02 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r b7825ac40fd9 -r 44cd62d979db ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Tue Jun 02 15:14:15 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Tue Jun 02 15:30:30 2009 +0100 @@ -263,7 +263,7 @@ class SharkTopLevelBlock : public SharkB llvm::CallInst *res = builder()->CreateCall(callee, args_start, args_end); function()->reset_last_Java_frame(); current_state()->cache_after_VM_call(); - if (exception_action) { + if (exception_action & EAM_CHECK) { check_pending_exception(exception_action); current_state()->set_has_safepointed(true); } From gbenson at redhat.com Tue Jun 2 07:40:27 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 02 Jun 2009 14:40:27 +0000 Subject: changeset in /hg/icedtea6: 2009-06-02 Gary Benson changeset e01a6da1a425 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=e01a6da1a425 description: 2009-06-02 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::release_lock): Bugfix. (SharkTopLevelBlock::check_pending_exception): Updated comment to account for the above. diffstat: 2 files changed, 10 insertions(+), 6 deletions(-) ChangeLog | 7 +++++++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 9 +++------ diffs (40 lines): diff -r 44cd62d979db -r e01a6da1a425 ChangeLog --- a/ChangeLog Tue Jun 02 15:30:30 2009 +0100 +++ b/ChangeLog Tue Jun 02 15:41:45 2009 +0100 @@ -1,3 +1,10 @@ 2009-06-02 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::release_lock): Bugfix. + (SharkTopLevelBlock::check_pending_exception): Updated + comment to account for the above. + 2009-06-02 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r 44cd62d979db -r e01a6da1a425 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 02 15:30:30 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 02 15:41:45 2009 +0100 @@ -351,9 +351,8 @@ void SharkTopLevelBlock::check_pending_e SharkState *saved_state = current_state()->copy(); if (action & EAM_MONITOR_FUDGE) { // The top monitor is marked live, but the exception was thrown - // while setting it up or tearing it down. We need to mark it - // dead before we enter any exception handlers as they will not - // expect it to be there. + // while setting it up so we need to mark it dead before we enter + // any exception handlers as they will not expect it to be there. set_num_monitors(num_monitors() - 1); action ^= EAM_MONITOR_FUDGE; } @@ -1766,9 +1765,7 @@ void SharkTopLevelBlock::release_lock(in // Need to drop into the runtime to release this one builder()->SetInsertPoint(slow_path); - call_vm( - SharkRuntime::monitorexit(), monitor_addr, - exception_action | EAM_MONITOR_FUDGE); + call_vm(SharkRuntime::monitorexit(), monitor_addr, exception_action); BasicBlock *released_slow = builder()->GetInsertBlock(); builder()->CreateBr(lock_released); From dbhole at redhat.com Tue Jun 2 11:43:29 2009 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 2 Jun 2009 14:43:29 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <4A24420C.4030401@redhat.com> References: <4A24420C.4030401@redhat.com> Message-ID: <20090602184329.GA18297@redhat.com> * Omair Majid [2009-06-01 17:03]: > Hi, > > The attached patch allows Netx to use the JVM arguments specified in the > JNLP file. Currently only 'initial-heap-size', 'max-heap-size' and > 'java-vm-args' are used. > > The first instance of the JVM parses the JNLP file and creates a new JVM > with the required arguments if the JNLP file requires it. The option > '-Xnofork' is passed to Netx to indicate it shouldnt fork any more JVMs. > This also makes it possible to revert to the old behaviour by passing > -Xnofork to the first instance of Netx. > Xnofork is fine, but it doesn't look like the other args (that javaws accepts) will get passed to the new vm instance... those should be inherited as well. Deepak > ChangeLog: > 2009-06-01 Omair Majid > > * rt/net/sourceforge/jnlp/JNLPFile.java > (needsNewJVM): New function. Returns true if the JNLP file requires > creating a new JVM. > (getNewVMArgs): New function. Returns arguments to pass to the new > JVM. > * rt/net/sourceforge/jnlp/Launcher.java > (launchExternal): Modify to take in arguments to pass to the JVM and > arguments to pass to the Java program. > (launchExternal): Likewise. Launch Netx with the with the > appropriate arguments. > (launchApplication): If needed, launch a new JVM. > * rt/net/sourceforge/jnlp/resources/Messages.properties: > Add BXnofork. > * rt/net/sourceforge/jnlp/runtime/Boot/java: > Add -Xnofork to helpMessage > (main): Check for '-Xnofork'. > * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: > Add forksAllowed to store whether creating a new JVM is allowed. > (getForksAllowed): New function. Check if creating a new JVM is > allowed. > (setForksAllowed): New function. Set whether creating a JVM is > allowed. > * rt/net/sourceforge/jnlp/services/XBasicService.java > (showDocument): Fix call to launchExternal to match the new > semantics. > > Any comments? > > Cheers, > Omair From gnu_andrew at member.fsf.org Tue Jun 2 14:29:55 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Tue, 2 Jun 2009 22:29:55 +0100 Subject: changeset in /hg/icedtea: Fix build of Zero VM. In-Reply-To: <20090522145144.GC14260@redhat.com> References: <20090522080057.GA3182@redhat.com> <17c6771e0905220732h15954c98w8beb2dc90ccbcf1e@mail.gmail.com> <20090522145144.GC14260@redhat.com> Message-ID: <17c6771e0906021429u6fc08bc4wa176ba818da1b12a@mail.gmail.com> 2009/5/22 Gary Benson : > Andrew John Hughes wrote: >> Does this look ok for 6? ?It would be nice to keep the two in sync, >> especially if we're going to try and push it upstream (this is >> needed to build with current HotSpot) and I don't see anything that >> would break the build on 6, just stubs that are superfluous on hs14. > > I was meaning to ask you about that. ?Yes, commit away :) > > Cheers, > Gary > > -- > http://gbenson.net/ > Just tried backporting the changeset and it fails miserably. It's possible to get round the Register/RegisterOrConstant issue but not having method_handle is also an issue; I don't want to start patching OpenJDK6 HotSpot with random bits of 7's just so it will compile. Looks like they're going to have to remain different :( When it comes to doing the big push, the version in 7 is probably going to be the one to use so feel free to sync across any changesets. hg export/import does most of the job, but the ChangeLog tends to get in the way. -- 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 Wed Jun 3 04:58:03 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Wed, 03 Jun 2009 13:58:03 +0200 Subject: [patch] icedtea7 cacao fixes Message-ID: <4A26654B.3040003@zafena.se> The two patches enables Icedtea 7b59 to build and run with cacao as vm. by applying the patches from cacao bugzilla http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=128 cacao-native-resolve.patch cacao-xxoption-warnings.patch Cheers Xerxes -------------- next part -------------- A non-text attachment was scrubbed... Name: cacao-native-resolve.patch Type: text/x-patch Size: 4179 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/c8bebd40/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: cacao-xxoption-warning.patch Type: text/x-patch Size: 1104 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/c8bebd40/attachment-0001.bin From xerxes at zafena.se Wed Jun 3 05:36:30 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Wed, 03 Jun 2009 14:36:30 +0200 Subject: [patch] icedtea7 cacao fixes In-Reply-To: <4A26654B.3040003@zafena.se> References: <4A26654B.3040003@zafena.se> Message-ID: <4A266E4E.4090307@zafena.se> Xerxes R?nby skrev: > The two patches enables Icedtea 7b59 to build and run with cacao as vm. > by applying the patches from cacao bugzilla > http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=128 > > cacao-native-resolve.patch > cacao-xxoption-warnings.patch > > Cheers > Xerxes > Attached an combined patch of the above with updated HACKING and ChangeLog. Xerxes -------------- next part -------------- A non-text attachment was scrubbed... Name: 3jun_icedtea7_cacao.patch Type: text/x-patch Size: 6013 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/3a336be2/attachment.bin From gbenson at redhat.com Wed Jun 3 06:31:35 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 03 Jun 2009 13:31:35 +0000 Subject: changeset in /hg/icedtea6: 2009-06-03 Gary Benson changeset 6bbac4cbc210 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=6bbac4cbc210 description: 2009-06-03 Gary Benson * ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp (MacroAssembler::store_oop): New method. * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp (MacroAssembler::store_oop): Likewise. * ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp (Relocation::pd_address_in_code): Implement. * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp (SharkCompiler::compile_method): Create CodeBuffer with space for relocations. * ports/hotspot/src/share/vm/shark/sharkFunction.hpp (SharkFunction::code_offset): Renamed as... (SharkFunction::create_unique_pc_offset): New method. (SharkFunction::CreateAddressOfCodeBufferEntry): Likewise. (SharkFunction::CreateAddressOfOopInCodeBuffer): Likewise. * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp (SharkDecacher::start_frame): Updated to use new offset code. (SharkDecacher::start_stack): Likewise. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::scan_for_traps): Direct calls need no checking. (SharkTopLevelBlock::get_direct_callee): Replace constant pool lookup with oop load from CodeBuffer. diffstat: 8 files changed, 85 insertions(+), 47 deletions(-) ChangeLog | 30 ++++++++++ ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp | 6 ++ ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp | 4 + ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp | 3 - ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp | 5 - ports/hotspot/src/share/vm/shark/sharkCompiler.cpp | 6 -- ports/hotspot/src/share/vm/shark/sharkFunction.hpp | 33 +++++++---- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 45 ++++++--------- diffs (249 lines): diff -r e01a6da1a425 -r 6bbac4cbc210 ChangeLog --- a/ChangeLog Tue Jun 02 15:41:45 2009 +0100 +++ b/ChangeLog Wed Jun 03 14:32:52 2009 +0100 @@ -1,3 +1,33 @@ 2009-06-02 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp + (MacroAssembler::store_oop): New method. + * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp + (MacroAssembler::store_oop): Likewise. + + * ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp + (Relocation::pd_address_in_code): Implement. + + * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp + (SharkCompiler::compile_method): Create CodeBuffer + with space for relocations. + + * ports/hotspot/src/share/vm/shark/sharkFunction.hpp + (SharkFunction::code_offset): Renamed as... + (SharkFunction::create_unique_pc_offset): New method. + (SharkFunction::CreateAddressOfCodeBufferEntry): Likewise. + (SharkFunction::CreateAddressOfOopInCodeBuffer): Likewise. + + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp + (SharkDecacher::start_frame): Updated to use new offset code. + (SharkDecacher::start_stack): Likewise. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Direct calls need no + checking. + (SharkTopLevelBlock::get_direct_callee): Replace constant + pool lookup with oop load from CodeBuffer. + 2009-06-02 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -60,6 +60,12 @@ void MacroAssembler::advance(int bytes) sync(); } +void MacroAssembler::store_oop(jobject obj) +{ + code_section()->relocate(pc(), oop_Relocation::spec_for_immediate()); + emit_address((address) obj); +} + static void _UnimplementedStub() { report_unimplemented(__FILE__, __LINE__); diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp Wed Jun 03 14:32:52 2009 +0100 @@ -1,6 +1,6 @@ /* * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,8 +45,10 @@ class MacroAssembler : public Assembler void align(int modulus); void bang_stack_with_offset(int offset); bool needs_explicit_null_check(intptr_t offset); + public: void advance(int bytes); + void store_oop(jobject obj); }; #ifdef ASSERT diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -48,7 +48,8 @@ address Relocation::pd_get_address_from_ address* Relocation::pd_address_in_code() { - Unimplemented(); + // Relocations in Shark are just stored directly + return (address *) addr(); } int Relocation::pd_breakpoint_size() diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -31,7 +31,7 @@ void SharkDecacher::start_frame() void SharkDecacher::start_frame() { // Start recording the debug information - _pc_offset = function()->code_offset(); + _pc_offset = function()->create_unique_pc_offset(); _oopmap = new OopMap( oopmap_slot_munge(function()->oopmap_frame_size()), oopmap_slot_munge(function()->arg_size())); @@ -119,8 +119,7 @@ void SharkDecacher::process_pc_slot(int { // Record the PC builder()->CreateStore( - builder()->CreateAdd( - function()->base_pc(), LLVMValue::intptr_constant(pc_offset())), + function()->CreateAddressOfCodeBufferEntry(pc_offset()), function()->CreateAddressOfFrameEntry(offset)); } diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -116,8 +116,7 @@ void SharkCompiler::compile_method(ciEnv env->set_dependencies(new Dependencies(env)); // Create the CodeBuffer and MacroAssembler - BufferBlob *bb = BufferBlob::create("shark_temp", 256 * K); - CodeBuffer cb(bb->instructions_begin(), bb->instructions_size()); + CodeBuffer cb("Shark", 256 * K, 64 * K); cb.initialize_oop_recorder(env->oop_recorder()); MacroAssembler *masm = new MacroAssembler(&cb); @@ -148,9 +147,6 @@ void SharkCompiler::compile_method(ciEnv env->comp_level(), false, false); - - // Free the BufferBlob - BufferBlob::free(bb); } diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkFunction.hpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Wed Jun 03 14:32:52 2009 +0100 @@ -137,6 +137,28 @@ class SharkFunction : public StackObj { return flow()->method(); } + // CodeBuffer interface + public: + int create_unique_pc_offset() const + { + int offset = masm()->offset(); + masm()->advance(1); + return offset; + } + llvm::Value* CreateAddressOfCodeBufferEntry(int offset) const + { + return builder()->CreateAdd(base_pc(), LLVMValue::intptr_constant(offset)); + } + llvm::Value* CreateAddressOfOopInCodeBuffer(ciObject* object) const + { + masm()->align(BytesPerWord); + int offset = masm()->offset(); + masm()->store_oop(object->encoding()); + return builder()->CreateIntToPtr( + CreateAddressOfCodeBufferEntry(offset), + llvm::PointerType::getUnqual(SharkType::jobject_type())); + } + // Block management private: llvm::BasicBlock* _block_insertion_point; @@ -216,17 +238,6 @@ class SharkFunction : public StackObj { const char* name = "") const; private: llvm::Value* CreateBuildFrame(); - - // OopMap support - public: - // Every time a new, distinct pc is required, an extra byte is - // emitted into the codebuffer - int code_offset() const - { - int offset = masm()->offset(); - masm()->advance(1); // keeps PCs unique - return offset; - } private: int _extended_frame_size; diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -91,27 +91,25 @@ void SharkTopLevelBlock::scan_for_traps( index = iter()->get_field_index(); break; - case Bytecodes::_invokespecial: - case Bytecodes::_invokestatic: case Bytecodes::_invokevirtual: + method = iter()->get_method(will_link); + assert(will_link, "typeflow responsibility"); + + // If this is a non-final invokevirtual then we need to + // check that its holder is linked, because its vtable + // won't have been set up otherwise. + if (!method->is_final_method() && !method->holder()->is_linked()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_uninitialized, + Deoptimization::Action_reinterpret), bci()); + return; + } + break; + case Bytecodes::_invokeinterface: method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); - - // If this is a non-final invokevirtual then there won't - // be a pool access. We do need to check that its holder - // is linked, however, because its vtable won't have been - // set up otherwise. - if (bc() == Bytecodes::_invokevirtual && !method->is_final_method()) { - if (!method->holder()->is_linked()) { - set_trap( - Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret), bci()); - return; - } - break; - } // Continue to the check index = iter()->get_method_index(); @@ -897,15 +895,10 @@ Value *SharkTopLevelBlock::get_callee(Ca // invokevirtual is direct in some circumstances. Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) { - SharkConstantPool constants(this); - Value *cache = constants.cache_entry_at(iter()->get_method_index()); - return builder()->CreateValueOfStructEntry( - cache, - bc() == Bytecodes::_invokevirtual ? - ConstantPoolCacheEntry::f2_offset() : - ConstantPoolCacheEntry::f1_offset(), - SharkType::methodOop_type(), - "callee"); + return builder()->CreateLoad( + builder()->CreateBitCast( + function()->CreateAddressOfOopInCodeBuffer(method), + PointerType::getUnqual(SharkType::methodOop_type())), "callee"); } // Non-direct virtual calls are handled here From gbenson at redhat.com Wed Jun 3 06:36:04 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 3 Jun 2009 14:36:04 +0100 Subject: Shark direct call improvements Message-ID: <20090603133603.GA19979@redhat.com> Hi all, This commit replaces the interpreter-style lookup of the callee in the constant pool with a server-JIT-style callee inlined in the code buffer for direct calls (ie invokestatic, invokespecial, and final invokevirtual). This gives a small speedup in itself, but opens the door to a ton of other optimizations. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r e01a6da1a425 -r 6bbac4cbc210 ChangeLog --- a/ChangeLog Tue Jun 02 15:41:45 2009 +0100 +++ b/ChangeLog Wed Jun 03 14:32:52 2009 +0100 @@ -1,3 +1,33 @@ +2009-06-03 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp + (MacroAssembler::store_oop): New method. + * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp + (MacroAssembler::store_oop): Likewise. + + * ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp + (Relocation::pd_address_in_code): Implement. + + * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp + (SharkCompiler::compile_method): Create CodeBuffer + with space for relocations. + + * ports/hotspot/src/share/vm/shark/sharkFunction.hpp + (SharkFunction::code_offset): Renamed as... + (SharkFunction::create_unique_pc_offset): New method. + (SharkFunction::CreateAddressOfCodeBufferEntry): Likewise. + (SharkFunction::CreateAddressOfOopInCodeBuffer): Likewise. + + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp + (SharkDecacher::start_frame): Updated to use new offset code. + (SharkDecacher::start_stack): Likewise. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Direct calls need no + checking. + (SharkTopLevelBlock::get_direct_callee): Replace constant + pool lookup with oop load from CodeBuffer. + 2009-06-02 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -60,6 +60,12 @@ sync(); } +void MacroAssembler::store_oop(jobject obj) +{ + code_section()->relocate(pc(), oop_Relocation::spec_for_immediate()); + emit_address((address) obj); +} + static void _UnimplementedStub() { report_unimplemented(__FILE__, __LINE__); diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp Wed Jun 03 14:32:52 2009 +0100 @@ -1,6 +1,6 @@ /* * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,8 +45,10 @@ void align(int modulus); void bang_stack_with_offset(int offset); bool needs_explicit_null_check(intptr_t offset); + public: void advance(int bytes); + void store_oop(jobject obj); }; #ifdef ASSERT diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -48,7 +48,8 @@ address* Relocation::pd_address_in_code() { - Unimplemented(); + // Relocations in Shark are just stored directly + return (address *) addr(); } int Relocation::pd_breakpoint_size() diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -31,7 +31,7 @@ void SharkDecacher::start_frame() { // Start recording the debug information - _pc_offset = function()->code_offset(); + _pc_offset = function()->create_unique_pc_offset(); _oopmap = new OopMap( oopmap_slot_munge(function()->oopmap_frame_size()), oopmap_slot_munge(function()->arg_size())); @@ -119,8 +119,7 @@ { // Record the PC builder()->CreateStore( - builder()->CreateAdd( - function()->base_pc(), LLVMValue::intptr_constant(pc_offset())), + function()->CreateAddressOfCodeBufferEntry(pc_offset()), function()->CreateAddressOfFrameEntry(offset)); } diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -116,8 +116,7 @@ env->set_dependencies(new Dependencies(env)); // Create the CodeBuffer and MacroAssembler - BufferBlob *bb = BufferBlob::create("shark_temp", 256 * K); - CodeBuffer cb(bb->instructions_begin(), bb->instructions_size()); + CodeBuffer cb("Shark", 256 * K, 64 * K); cb.initialize_oop_recorder(env->oop_recorder()); MacroAssembler *masm = new MacroAssembler(&cb); @@ -148,9 +147,6 @@ env->comp_level(), false, false); - - // Free the BufferBlob - BufferBlob::free(bb); } diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkFunction.hpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Wed Jun 03 14:32:52 2009 +0100 @@ -137,6 +137,28 @@ return flow()->method(); } + // CodeBuffer interface + public: + int create_unique_pc_offset() const + { + int offset = masm()->offset(); + masm()->advance(1); + return offset; + } + llvm::Value* CreateAddressOfCodeBufferEntry(int offset) const + { + return builder()->CreateAdd(base_pc(), LLVMValue::intptr_constant(offset)); + } + llvm::Value* CreateAddressOfOopInCodeBuffer(ciObject* object) const + { + masm()->align(BytesPerWord); + int offset = masm()->offset(); + masm()->store_oop(object->encoding()); + return builder()->CreateIntToPtr( + CreateAddressOfCodeBufferEntry(offset), + llvm::PointerType::getUnqual(SharkType::jobject_type())); + } + // Block management private: llvm::BasicBlock* _block_insertion_point; @@ -217,17 +239,6 @@ private: llvm::Value* CreateBuildFrame(); - // OopMap support - public: - // Every time a new, distinct pc is required, an extra byte is - // emitted into the codebuffer - int code_offset() const - { - int offset = masm()->offset(); - masm()->advance(1); // keeps PCs unique - return offset; - } - private: int _extended_frame_size; int _stack_slots_offset; diff -r e01a6da1a425 -r 6bbac4cbc210 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 02 15:41:45 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 14:32:52 2009 +0100 @@ -91,28 +91,26 @@ index = iter()->get_field_index(); break; - case Bytecodes::_invokespecial: - case Bytecodes::_invokestatic: case Bytecodes::_invokevirtual: + method = iter()->get_method(will_link); + assert(will_link, "typeflow responsibility"); + + // If this is a non-final invokevirtual then we need to + // check that its holder is linked, because its vtable + // won't have been set up otherwise. + if (!method->is_final_method() && !method->holder()->is_linked()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_uninitialized, + Deoptimization::Action_reinterpret), bci()); + return; + } + break; + case Bytecodes::_invokeinterface: method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); - // If this is a non-final invokevirtual then there won't - // be a pool access. We do need to check that its holder - // is linked, however, because its vtable won't have been - // set up otherwise. - if (bc() == Bytecodes::_invokevirtual && !method->is_final_method()) { - if (!method->holder()->is_linked()) { - set_trap( - Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret), bci()); - return; - } - break; - } - // Continue to the check index = iter()->get_method_index(); break; @@ -897,15 +895,10 @@ // invokevirtual is direct in some circumstances. Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) { - SharkConstantPool constants(this); - Value *cache = constants.cache_entry_at(iter()->get_method_index()); - return builder()->CreateValueOfStructEntry( - cache, - bc() == Bytecodes::_invokevirtual ? - ConstantPoolCacheEntry::f2_offset() : - ConstantPoolCacheEntry::f1_offset(), - SharkType::methodOop_type(), - "callee"); + return builder()->CreateLoad( + builder()->CreateBitCast( + function()->CreateAddressOfOopInCodeBuffer(method), + PointerType::getUnqual(SharkType::methodOop_type())), "callee"); } // Non-direct virtual calls are handled here From gbenson at redhat.com Wed Jun 3 06:39:14 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 03 Jun 2009 13:39:14 +0000 Subject: changeset in /hg/icedtea6: 2009-06-03 Gary Benson changeset d50608f15874 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=d50608f15874 description: 2009-06-03 Gary Benson * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp: Updated copyright year. * ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp: Likewise. diffstat: 3 files changed, 9 insertions(+), 2 deletions(-) ChangeLog | 7 +++++++ ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp | 2 +- ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp | 2 +- diffs (36 lines): diff -r 6bbac4cbc210 -r d50608f15874 ChangeLog --- a/ChangeLog Wed Jun 03 14:32:52 2009 +0100 +++ b/ChangeLog Wed Jun 03 09:37:51 2009 -0400 @@ -1,3 +1,10 @@ 2009-06-03 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp: + Updated copyright year. + * ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp: + Likewise. + 2009-06-03 Gary Benson * ports/hotspot/src/cpu/zero/vm/assembler_zero.hpp diff -r 6bbac4cbc210 -r d50608f15874 ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp Wed Jun 03 14:32:52 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp Wed Jun 03 09:37:51 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -r 6bbac4cbc210 -r d50608f15874 ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Wed Jun 03 14:32:52 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp Wed Jun 03 09:37:51 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007 Red Hat, Inc. + * Copyright 2007, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it From omajid at redhat.com Wed Jun 3 06:32:34 2009 From: omajid at redhat.com (Omair Majid) Date: Wed, 03 Jun 2009 09:32:34 -0400 Subject: RFC: Fix --enable-hg in IcedTea6 In-Reply-To: <17c6771e0906011018v127a02e1pf0b0ed03f593091e@mail.gmail.com> References: <4A23F568.4040900@redhat.com> <17c6771e0906010851r22114970xdb3ed983f186799c@mail.gmail.com> <4A240268.5020002@redhat.com> <17c6771e0906011018v127a02e1pf0b0ed03f593091e@mail.gmail.com> Message-ID: <4A267B72.8040806@redhat.com> Andrew John Hughes wrote: > 2009/6/1 Omair Majid : >> Andrew John Hughes wrote: >>> 2009/6/1 Omair Majid : >>>> Hi, >>>> >>>> Trying to build IcedTea6 with "--enable-hg --with-hg-revision=jdk6-b16" >>>> fails when applying the patches, even though jdk6-b16 is a known good >>>> build. >>>> The issues appears to be that the Makefile removes the old hotspot only >>>> if >>>> the openjdk directory doesn't already exist. >>>> >>>> The attached patch checks USE_HG and then removes the hotspot directory >>>> so >>>> it can be replaced with HS14. >>>> >>>> ChangeLog: >>>> 2009-06-01 Omair Majid >>>> >>>> * Makefile.am (stamps/extract.stamp): Remove hotspot if using >>>> --enable-hg and an alternate hotspot build. >>>> >>>> Can someone please review the patch? >>>> >>>> Cheers, >>>> Omair >>>> >>> The presumption was that anyone wanting to use Mercurial as a source >>> wanted the whole thing. >> I see. What about the patches then? Should we apply patches from the >> original hotspot? Or leave out the hotspot patches completely? >> > > Sorry, I should have been more clear. I was just explaining why the > current status quo is as it is. Changing it as you say is the right > thing to do. Things are different in 7 (we don't replace HotSpot, > there are a heck of a lot more forests) so it makes more sense to use > a pristine checkout. > > BTW, I wouldn't worry too much about --enable-hg not building. It's > really there for people who want to live life on the edge i.e. if you > want to use live Mercurial sources to build, you should know what > you're letting yourself in for :) Yeah, that's true. I would expect occasional bugs and IcedTea lagging behind patches. But failing to build completely with a known good revision? > Again, it's a lot more useful with 7 because there are lots of rapidly > changing upstream forests. > Oh. That makes a lot of sense. Should we remove --enable-hg from 6? >>> I don't see how the attached patch can work. This would stop the >>> hotspot directory not being removed when Mercurial is disabled, and >>> doesn't do anything about the if block which checks for the openjdk >>> directory. >> Err...too many negatives in that sentence, so apologies if I misunderstand >> something. > > Sorry on my part :) > No worries. > The patch works (as in I can do a 'make patch' with this change >> applied and everything works) > > With what configuration options? Do both non-hg and hg builds still work? > Does a full build work? I did try those options with the old patch. See blow for the new list. > > . If mercurial is disabled, it does nothing - >> it only comes into play if --enable-hg is used. In that case, it deletes the >> hotspot directory so the alternate hotspot tarball is used. > > This is my point; we should always delete the hotspot directory and > use an alternate tarball if alternate HotSpot is turned on (which it > is by default). Looking at this, it will stop HotSpot being replaced > for a normal build and we'll end up with hs11 and broken patches... > >> Currently >> hotspot is only replaced if there is no openjdk directory. In case of >> --enable-hg, there is, so hotspot wasnt being replaced. >> The patch explicitly >> rm -rf's the old hotspot direcotry so it is replaced with HS14. > > Right, but that should happen, hg or no hg. With your patch, it's only with hg. > >> Anyway, the >> entire point is moot if the purpose of --enable-hg is to provide the >> unmodified hotspot. > > In the case of 6, I think we should still replace HotSpot. > >>> stamps/extract.stamp: stamps/download.stamp >>> if OPENJDK_SRC_DIR_FOUND >>> cp -a $(OPENJDK_SRC_DIR) openjdk >>> else >>> if ! test -d openjdk ; \ >>> then \ >>> mkdir openjdk ; \ >>> $(TAR) xf $(OPENJDK_SRC_ZIP) -C openjdk; \ >>> chmod -R ug+w openjdk ; \ >>> if test "x${HSBUILD}" != "xoriginal"; then \ >>> rm -rf openjdk/hotspot ; \ >>> fi ; \ >>> sh $(abs_top_srcdir)/fsg.sh ; \ >>> fi >>> if WITH_ALT_HSBUILD >>> if test -e ${HOTSPOT_SRC_ZIP} ; \ >>> then \ >>> if ! test -d openjdk/hotspot ; \ >>> then \ >>> $(TAR) xf $(HOTSPOT_SRC_ZIP) ; \ >>> chmod -R ug+w master-* ; \ >>> mv master-$$($(AWK) 'version==$$1 {print $$2}' >>> version=$(HSBUILD) \ >>> $(abs_top_srcdir)/hotspot.map) openjdk/hotspot ; \ >>> fi ; \ >>> fi >>> endif >>> endif >>> >>> The simplest solution is probably to add an additional target for the >>> HotSpot replacement so it isn't so tightly related to extraction. >> That makes sense, I will see what I can do. >> > > I think it would make the whole thing less confusing and easier to work on. > Thanks. I got a patch that I *think* works. Here are the configurations I tested: Just 'make patch' ./autogen.sh && ./configure && make patch ./autogen.sh && ./configure --enable-hg --with-hg-revision=jdk6-b16 && make patch ./autogen.sh && ./configure --with-openjdk && make patch ./autogen.sh && ./configure --with-openjdk && make replace-hotspot ./autogen.sh && ./configure --with-openjdk --disable-docs && make patch ./autogen.sh && ./configure --enable-hg --with-hg-revision=jdk6-b16 --with-openjdk --disable-docs && make patch ./autogen.sh && ./configure --enable-zero && make patch ./autogen.sh && ./configure --enable-zero --enable-shark && make patch ./autogen.sh && ./configure --enable-plugin --enable-pulse-java --enable-visualvm --enable-openjdk-cross-compilation --enable-zero --enable-shark --enable-systemtap --enable-cacao && make patch Full Build: ./autogen.sh && ./configure && make ./autogen.sh && ./configure --with-openjdk --disable-docs && make ./autogen.sh && ./configure --with-hotspot-build=original && make patch failed just like it does with the current Makefile.am (trying to apply icedtea-shark.patch) ChangeLog: 2009-06-03 Omair Majid * Makefile.am (stamps/ports.stamp): Depend on stamps/replace-hotspot.stamp instead of stamps/extract.stamp. (stamps/extract.stamp): Dont replace hotspot. (stamps/replace-hotspot.stamp): New target. Replace hotspot without assuming anything about the build. (clean-replace-hotspot): New target. (stamps/patch-fsg.stamp): Depend on stamps/replace-hotspot.stamp instead of stamps/extract.stamp. (stamps/hotspot-tools-source-files.txt): Likewise. (rt-source-files.txt): Likewise. (stamps/cacao.stamp): Likewise. (stamps/visualvm.stamp): Likewise. (stamps/nbplatform.stamp): Likewise. (replace-hotspot): New alias for stamps/replace-hotspot.stamp. Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-enable-hg.patch Type: text/x-patch Size: 3943 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/4fab1795/attachment.bin From xerxes at zafena.se Wed Jun 3 07:07:16 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Wed, 03 Jun 2009 16:07:16 +0200 Subject: [patch] icedtea7 cacao fixes - rfc In-Reply-To: <4A266E4E.4090307@zafena.se> References: <4A26654B.3040003@zafena.se> <4A266E4E.4090307@zafena.se> Message-ID: <4A268394.2020902@zafena.se> Xerxes R?nby skrev: > Xerxes R?nby skrev: >> The two patches enables Icedtea 7b59 to build and run with cacao as vm. >> by applying the patches from cacao bugzilla >> http://server.complang.tuwien.ac.at/cgi-bin/bugzilla/show_bug.cgi?id=128 >> >> cacao-native-resolve.patch >> cacao-xxoption-warnings.patch >> >> Cheers >> Xerxes >> > > Attached an combined patch of the above with updated HACKING and > ChangeLog. > > Xerxes > > > Sorry for the fuzz, but i realized I had included the wrong patch. This attached patch includes the patches from cacao hg. Suggestions are welcome. Xerxes -------------- next part -------------- A non-text attachment was scrubbed... Name: 3jun1520_icedtea7_cacao_pr128.patch Type: text/x-patch Size: 6875 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/54532466/attachment.bin From xerxes at zafena.se Wed Jun 3 07:42:28 2009 From: xerxes at zafena.se (Xerxes R?nby) Date: Wed, 03 Jun 2009 14:42:28 +0000 Subject: changeset in /hg/icedtea: 2009-06-03 Xerxes R?nby changeset 123d98a5d278 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=123d98a5d278 description: 2009-06-03 Xerxes R?nby Stefan Ring * patches/cacao/native-resolve.patch: New. * patches/cacao/xxoption-warning.patch: Likewise. * Makefile.am (ICEDTEA_PATCHES): Apply above patches. * HACKING: Update. diffstat: 5 files changed, 178 insertions(+), 2 deletions(-) ChangeLog | 8 + HACKING | 4 Makefile.am | 4 patches/cacao/native-resolve.patch | 143 ++++++++++++++++++++++++++++++++++ patches/cacao/xxoption-warning.patch | 21 ++++ diffs (215 lines): diff -r e9bd43d303d1 -r 123d98a5d278 ChangeLog --- a/ChangeLog Sun May 31 15:29:57 2009 +0200 +++ b/ChangeLog Wed Jun 03 16:41:46 2009 +0200 @@ -1,3 +1,11 @@ 2009-05-30 Mark Wielaard + Stefan Ring + + * patches/cacao/native-resolve.patch: New. + * patches/cacao/xxoption-warning.patch: Likewise. + * Makefile.am (ICEDTEA_PATCHES): Apply above patches. + * HACKING: Update. + 2009-05-30 Mark Wielaard * configure.ac (enable-nio2): Removed. diff -r e9bd43d303d1 -r 123d98a5d278 HACKING --- a/HACKING Sun May 31 15:29:57 2009 +0200 +++ b/HACKING Wed Jun 03 16:41:46 2009 +0200 @@ -72,7 +72,9 @@ The following patches are currently appl * icedtea-includedb.patch: Add missing include files. (S6793825, mostly applied in b47) * icedtea-xml-encodinginfo.patch: Fix possible StackOverflowError in EncodingInfo (PR295). * cacao/launcher.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-mmap-first-page.patch: Don't mmap the first memory page. +* cacao/native-resolve.patch: Changes CACAO resolution order for native methods. (cacao PR128). +* cacao/xxoption-warning.patch: Makes CACAO print warnings to stderr (cacao PR128). The following patches are only applied to OpenJDK6 in IcedTea6: diff -r e9bd43d303d1 -r 123d98a5d278 Makefile.am --- a/Makefile.am Sun May 31 15:29:57 2009 +0200 +++ b/Makefile.am Wed Jun 03 16:41:46 2009 +0200 @@ -2087,7 +2087,9 @@ if BUILD_CACAO if BUILD_CACAO ICEDTEA_PATCHES += \ patches/cacao/launcher.patch \ - patches/cacao/no-mmap-first-page.patch + patches/cacao/no-mmap-first-page.patch \ + patches/cacao/native-resolve.patch \ + patches/cacao/xxoption-warning.patch endif if WITH_CACAO diff -r e9bd43d303d1 -r 123d98a5d278 patches/cacao/native-resolve.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/cacao/native-resolve.patch Wed Jun 03 16:41:46 2009 +0200 @@ -0,0 +1,143 @@ + +# HG changeset patch +# User Stefan Ring +# Date 1244023392 -7200 +# Node ID 8e8a38453f6c1e11e057457daf979a1acb40d9bf +# Parent 5fdb98095047abf89f3d3298417499c2c06f8d56 +Fixes PR128 (changed resolution order for native methods). +* src/native/native.c (native_method_resolve): Consider internal +methods before descending into java.lang.ClassLoader. + +--- cacao/cacao/src/native/native.c Wed Jun 03 01:35:48 2009 +0200 ++++ cacao/cacao/src/native/native.c Wed Jun 03 12:03:12 2009 +0200 +@@ -1,6 +1,6 @@ + /* src/native/native.c - native library support + +- Copyright (C) 1996-2005, 2006, 2007, 2008 ++ Copyright (C) 1996-2005, 2006, 2007, 2008, 2009 + CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO + + This file is part of CACAO. +@@ -529,39 +529,47 @@ + + newname = native_make_overloaded_function(name, m->descriptor); + ++ /* Try to find the native function symbol in the main program. */ ++ ++ f = native_method_find(m); ++ ++ if (f != NULL) ++ if (opt_verbosejni) ++ printf("internal ]\n"); ++ ++#if defined(ENABLE_DL) + /* check the library hash entries of the classloader of the + methods's class */ + +- f = NULL; ++ if (f == NULL) { ++ /* Get the classloader. */ + +-#if defined(ENABLE_DL) +- /* Get the classloader. */ ++ cl = class_get_classloader(m->clazz); + +- cl = class_get_classloader(m->clazz); ++ /* normally addresses are aligned to 4, 8 or 16 bytes */ + +- /* normally addresses are aligned to 4, 8 or 16 bytes */ ++ key = ((u4) (ptrint) cl) >> 4; /* align to 16-byte */ ++ slot = key & (hashtable_library->size - 1); ++ le = hashtable_library->ptr[slot]; + +- key = ((u4) (ptrint) cl) >> 4; /* align to 16-byte */ +- slot = key & (hashtable_library->size - 1); +- le = hashtable_library->ptr[slot]; ++ /* iterate through loaders in this hash slot */ + +- /* iterate through loaders in this hash slot */ ++ while ((le != NULL) && (f == NULL)) { ++ /* iterate through names in this loader */ + +- while ((le != NULL) && (f == NULL)) { +- /* iterate through names in this loader */ ++ ne = le->namelink; + +- ne = le->namelink; +- +- while ((ne != NULL) && (f == NULL)) { +- f = (functionptr) (ptrint) system_dlsym(ne->handle, name->text); ++ while ((ne != NULL) && (f == NULL)) { ++ f = (functionptr) (ptrint) system_dlsym(ne->handle, name->text); + +- if (f == NULL) +- f = (functionptr) (ptrint) system_dlsym(ne->handle, newname->text); ++ if (f == NULL) ++ f = (functionptr) (ptrint) system_dlsym(ne->handle, newname->text); + +- ne = ne->hashlink; ++ ne = ne->hashlink; ++ } ++ ++ le = le->hashlink; + } +- +- le = le->hashlink; + } + + # if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK) +@@ -577,23 +585,22 @@ + class_java_lang_ClassLoader, + true); + +- if (method_findNative == NULL) +- return NULL; ++ if (method_findNative != NULL) { ++ /* try the normal name */ + +- /* try the normal name */ +- +- s = javastring_new(name); +- +- f = (functionptr) (intptr_t) vm_call_method_long(method_findNative, +- NULL, cl, s); +- +- /* if not found, try the mangled name */ +- +- if (f == NULL) { +- s = javastring_new(newname); ++ s = javastring_new(name); + + f = (functionptr) (intptr_t) vm_call_method_long(method_findNative, + NULL, cl, s); ++ ++ /* if not found, try the mangled name */ ++ ++ if (f == NULL) { ++ s = javastring_new(newname); ++ ++ f = (functionptr) (intptr_t) vm_call_method_long(method_findNative, ++ NULL, cl, s); ++ } + } + } + # endif +@@ -602,17 +609,6 @@ + if (opt_verbosejni) + printf("JNI ]\n"); + #endif +- +- /* If not found, try to find the native function symbol in the +- main program. */ +- +- if (f == NULL) { +- f = native_method_find(m); +- +- if (f != NULL) +- if (opt_verbosejni) +- printf("internal ]\n"); +- } + + #if defined(ENABLE_JVMTI) + /* fire Native Method Bind event */ + diff -r e9bd43d303d1 -r 123d98a5d278 patches/cacao/xxoption-warning.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/cacao/xxoption-warning.patch Wed Jun 03 16:41:46 2009 +0200 @@ -0,0 +1,21 @@ + +# HG changeset patch +# User Stefan Ring +# Date 1243985748 -7200 +# Node ID 5fdb98095047abf89f3d3298417499c2c06f8d56 +# Parent 2d848ae770f5b7bfc59cf007ceae36f97adccc03 +* src/vm/options.c (options_xx): Don't clutter output with warning (print to +stderr instead). + +--- cacao/cacao/src/vmcore/options.c Wed Apr 22 11:20:27 2009 +0200 ++++ cacao/cacao/src/vmcore/options.c Wed Jun 03 01:35:48 2009 +0200 +@@ -816,7 +816,7 @@ + #endif + + default: +- printf("Unknown -XX option: %s\n", name); ++ fprintf(stderr, "Unknown -XX option: %s\n", name); + break; + } + } + From gbenson at redhat.com Wed Jun 3 08:17:05 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 03 Jun 2009 15:17:05 +0000 Subject: changeset in /hg/icedtea6: 2009-06-03 Gary Benson changeset 724f230eea38 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=724f230eea38 description: 2009-06-03 Gary Benson * ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp: New file. * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp (SharkBuilder::_code_buffer): New field. (SharkBuilder::code_buffer): New method. (SharkBuilder::set_code_buffer): Likewise. (SharkBuilder::code_buffer_address): Likewise. (SharkBuilder::CreateInlineOop): Likewise. * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp (SharkCompiler::compile_method): Use a SharkCodeBuffer instead of a normal CodeBuffer and MacroAssembler, and hook it into the SharkBuilder. * ports/hotspot/src/share/vm/shark/sharkFunction.hpp (SharkFunction::SharkFunction): Removed masm argument and initialization. (SharkFunction::_masm): Removed. (SharkFunction::_base_pc): Likewise. (SharkFunction::masm): Likewise. (SharkFunction::base_pc): Likewise. (SharkFunction::create_unique_pc_offset): Likewise. (SharkFunction::CreateAddressOfCodeBufferEntry): Likewise. (SharkFunction::CreateAddressOfOopInCodeBuffer): Likewise. * ports/hotspot/src/share/vm/shark/sharkFunction.cpp (SharkFunction::initialize): Use the new code to allocate the SharkEntry, and set the base_pc for the SharkCodeBuffer. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::get_direct_callee): Use new code. * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp (SharkDecacher::start_frame): Use new code. (SharkDecacher::start_stack): Likewise. * ports/hotspot/src/share/vm/includeDB_shark: Updated. diffstat: 9 files changed, 194 insertions(+), 55 deletions(-) ChangeLog | 40 ++++++ ports/hotspot/src/share/vm/includeDB_shark | 7 - ports/hotspot/src/share/vm/shark/sharkBuilder.hpp | 31 ++++ ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp | 4 ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp | 94 +++++++++++++++ ports/hotspot/src/share/vm/shark/sharkCompiler.cpp | 18 +- ports/hotspot/src/share/vm/shark/sharkFunction.cpp | 9 - ports/hotspot/src/share/vm/shark/sharkFunction.hpp | 38 ------ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 8 - diffs (400 lines): diff -r d50608f15874 -r 724f230eea38 ChangeLog --- a/ChangeLog Wed Jun 03 09:37:51 2009 -0400 +++ b/ChangeLog Wed Jun 03 11:15:36 2009 -0400 @@ -1,3 +1,43 @@ 2009-06-03 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp: + New file. + + * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp + (SharkBuilder::_code_buffer): New field. + (SharkBuilder::code_buffer): New method. + (SharkBuilder::set_code_buffer): Likewise. + (SharkBuilder::code_buffer_address): Likewise. + (SharkBuilder::CreateInlineOop): Likewise. + + * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp + (SharkCompiler::compile_method): Use a SharkCodeBuffer + instead of a normal CodeBuffer and MacroAssembler, and + hook it into the SharkBuilder. + + * ports/hotspot/src/share/vm/shark/sharkFunction.hpp + (SharkFunction::SharkFunction): Removed masm argument + and initialization. + (SharkFunction::_masm): Removed. + (SharkFunction::_base_pc): Likewise. + (SharkFunction::masm): Likewise. + (SharkFunction::base_pc): Likewise. + (SharkFunction::create_unique_pc_offset): Likewise. + (SharkFunction::CreateAddressOfCodeBufferEntry): Likewise. + (SharkFunction::CreateAddressOfOopInCodeBuffer): Likewise. + * ports/hotspot/src/share/vm/shark/sharkFunction.cpp + (SharkFunction::initialize): Use the new code to allocate + the SharkEntry, and set the base_pc for the SharkCodeBuffer. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::get_direct_callee): Use new code. + + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp + (SharkDecacher::start_frame): Use new code. + (SharkDecacher::start_stack): Likewise. + + * ports/hotspot/src/share/vm/includeDB_shark: Updated. + 2009-06-03 Gary Benson * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp: diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/includeDB_shark --- a/ports/hotspot/src/share/vm/includeDB_shark Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Wed Jun 03 11:15:36 2009 -0400 @@ -107,6 +107,7 @@ sharkBuilder.hpp sharkBuilder.hpp llvmHeaders.hpp sharkBuilder.hpp llvmValue.hpp sharkBuilder.hpp sizes.hpp +sharkBuilder.hpp sharkCodeBuffer.hpp sharkBuilder.hpp sharkCompiler.hpp sharkBuilder.hpp sharkType.hpp sharkBuilder.hpp sharkValue.hpp @@ -128,10 +129,13 @@ sharkCacheDecache.hpp sharkCacheDecache.hpp sharkFunction.hpp sharkCacheDecache.hpp sharkStateScanner.hpp +sharkCodeBuffer.hpp allocation.hpp +sharkCodeBuffer.hpp codeBuffer.hpp +sharkCodeBuffer.hpp llvmHeaders.hpp + sharkCompiler.cpp abstractCompiler.hpp sharkCompiler.cpp ciEnv.hpp sharkCompiler.cpp ciMethod.hpp -sharkCompiler.cpp codeBuffer.hpp sharkCompiler.cpp debug.hpp sharkCompiler.cpp debugInfoRec.hpp sharkCompiler.cpp dependencies.hpp @@ -141,6 +145,7 @@ sharkCompiler.cpp sharkCompiler.cpp oopRecorder.hpp sharkCompiler.cpp shark_globals.hpp sharkCompiler.cpp sharkBuilder.hpp +sharkCompiler.cpp sharkCodeBuffer.hpp sharkCompiler.cpp sharkCompiler.hpp sharkCompiler.cpp sharkEntry.hpp sharkCompiler.cpp sharkFunction.hpp diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkBuilder.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp Wed Jun 03 11:15:36 2009 -0400 @@ -360,4 +360,35 @@ class SharkBuilder : public llvm::IRBuil LLVMValue::intptr_constant(~(s - 1)), name); } + + // CodeBuffer interface + private: + SharkCodeBuffer* _code_buffer; + + public: + SharkCodeBuffer* code_buffer() const + { + return _code_buffer; + } + void set_code_buffer(SharkCodeBuffer* code_buffer) + { + _code_buffer = code_buffer; + } + + public: + llvm::Value* code_buffer_address(int offset) + { + return CreateAdd( + code_buffer()->base_pc(), LLVMValue::intptr_constant(offset)); + } + + public: + llvm::Value* CreateInlineOop(ciObject* object, const char* name = "") + { + return CreateLoad( + CreateIntToPtr( + code_buffer_address(code_buffer()->inline_oop(object)), + llvm::PointerType::getUnqual(SharkType::jobject_type())), + name); + } }; diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -31,7 +31,7 @@ void SharkDecacher::start_frame() void SharkDecacher::start_frame() { // Start recording the debug information - _pc_offset = function()->create_unique_pc_offset(); + _pc_offset = builder()->code_buffer()->create_unique_offset(); _oopmap = new OopMap( oopmap_slot_munge(function()->oopmap_frame_size()), oopmap_slot_munge(function()->arg_size())); @@ -119,7 +119,7 @@ void SharkDecacher::process_pc_slot(int { // Record the PC builder()->CreateStore( - function()->CreateAddressOfCodeBufferEntry(pc_offset()), + builder()->code_buffer_address(pc_offset()), function()->CreateAddressOfFrameEntry(offset)); } diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp Wed Jun 03 11:15:36 2009 -0400 @@ -0,0 +1,94 @@ +/* + * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +class SharkCodeBuffer : public StackObj { + public: + SharkCodeBuffer(OopRecorder* oop_recorder) + : _cb("Shark", 256 * K, 64 * K), + _masm(new MacroAssembler(&_cb)), + _base_pc(NULL) + { + cb()->initialize_oop_recorder(oop_recorder); + } + + private: + CodeBuffer _cb; + MacroAssembler* _masm; + llvm::Value* _base_pc; + + public: + CodeBuffer* cb() + { + return &_cb; + } + + private: + MacroAssembler* masm() const + { + return _masm; + } + + public: + llvm::Value* base_pc() const + { + return _base_pc; + } + void set_base_pc(llvm::Value* base_pc) + { + assert(_base_pc == NULL, "only do this once"); + _base_pc = base_pc; + } + + // Allocate some space in the buffer and return its address. + // This buffer will have been relocated by the time the method + // is installed, so you can't inline the result in code. + public: + void* malloc(size_t size) const + { + masm()->align(BytesPerWord); + void *result = masm()->pc(); + masm()->advance(size); + return result; + } + + // Create a unique offset in the buffer. + public: + int create_unique_offset() const + { + int offset = masm()->offset(); + masm()->advance(1); + return offset; + } + + // Inline an oop into the buffer and return its offset. + public: + int inline_oop(ciObject* object) const + { + masm()->align(BytesPerWord); + int offset = masm()->offset(); + masm()->store_oop(object->encoding()); + return offset; + } +}; diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -115,14 +115,16 @@ void SharkCompiler::compile_method(ciEnv env->debug_info()->set_oopmaps(&oopmaps); env->set_dependencies(new Dependencies(env)); - // Create the CodeBuffer and MacroAssembler - CodeBuffer cb("Shark", 256 * K, 64 * K); - cb.initialize_oop_recorder(env->oop_recorder()); - MacroAssembler *masm = new MacroAssembler(&cb); - - // Compile the method into the CodeBuffer + // Create the code buffer and hook it into the builder + SharkCodeBuffer cb(env->oop_recorder()); + builder()->set_code_buffer(&cb); + + // Compile the method ciBytecodeStream iter(target); - SharkFunction function(this, name, flow, &iter, masm); + SharkFunction function(this, name, flow, &iter); + + // Unhook the code buffer + builder()->set_code_buffer(NULL); // Install the method into the VM CodeOffsets offsets; @@ -138,7 +140,7 @@ void SharkCompiler::compile_method(ciEnv entry_bci, &offsets, 0, - &cb, + cb.cb(), 0, &oopmaps, &handler_table, diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkFunction.cpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -33,8 +33,8 @@ void SharkFunction::initialize() void SharkFunction::initialize() { // Emit the entry point - SharkEntry *entry = (SharkEntry *) masm()->pc(); - masm()->advance(sizeof(SharkEntry)); + SharkEntry *entry = + (SharkEntry *) builder()->code_buffer()->malloc(sizeof(SharkEntry)); // Create the function _function = builder()->CreateFunction(name()); @@ -45,8 +45,9 @@ void SharkFunction::initialize() Function::arg_iterator ai = function()->arg_begin(); Argument *method = ai++; method->setName("method"); - _base_pc = ai++; - _base_pc->setName("base_pc"); + Argument *base_pc = ai++; + base_pc->setName("base_pc"); + builder()->code_buffer()->set_base_pc(base_pc); _thread = ai++; _thread->setName("thread"); diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkFunction.hpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Wed Jun 03 11:15:36 2009 -0400 @@ -32,13 +32,11 @@ class SharkFunction : public StackObj { SharkFunction(SharkCompiler* compiler, const char* name, ciTypeFlow* flow, - ciBytecodeStream* iter, - MacroAssembler* masm) + ciBytecodeStream* iter) : _compiler(compiler), _name(name), _flow(flow), - _iter(iter), - _masm(masm) + _iter(iter) { initialize(); } private: @@ -49,10 +47,8 @@ class SharkFunction : public StackObj { const char* _name; ciTypeFlow* _flow; ciBytecodeStream* _iter; - MacroAssembler* _masm; llvm::Function* _function; SharkTopLevelBlock** _blocks; - llvm::Value* _base_pc; llvm::Value* _thread; int _max_monitors; GrowableArray _deferred_zero_checks; @@ -74,10 +70,6 @@ class SharkFunction : public StackObj { { return _iter; } - MacroAssembler* masm() const - { - return _masm; - } llvm::Function* function() const { return _function; @@ -86,10 +78,6 @@ class SharkFunction : public StackObj { { return _blocks[i]; } - llvm::Value* base_pc() const - { - return _base_pc; - } llvm::Value* thread() const { return _thread; @@ -135,28 +123,6 @@ class SharkFunction : public StackObj { ciMethod* target() const { return flow()->method(); - } - - // CodeBuffer interface - public: - int create_unique_pc_offset() const - { - int offset = masm()->offset(); - masm()->advance(1); - return offset; - } - llvm::Value* CreateAddressOfCodeBufferEntry(int offset) const - { - return builder()->CreateAdd(base_pc(), LLVMValue::intptr_constant(offset)); - } - llvm::Value* CreateAddressOfOopInCodeBuffer(ciObject* object) const - { - masm()->align(BytesPerWord); - int offset = masm()->offset(); - masm()->store_oop(object->encoding()); - return builder()->CreateIntToPtr( - CreateAddressOfCodeBufferEntry(offset), - llvm::PointerType::getUnqual(SharkType::jobject_type())); } // Block management diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -895,10 +895,10 @@ Value *SharkTopLevelBlock::get_callee(Ca // invokevirtual is direct in some circumstances. Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) { - return builder()->CreateLoad( - builder()->CreateBitCast( - function()->CreateAddressOfOopInCodeBuffer(method), - PointerType::getUnqual(SharkType::methodOop_type())), "callee"); + return builder()->CreateBitCast( + builder()->CreateInlineOop(method), + SharkType::methodOop_type(), + "callee"); } // Non-direct virtual calls are handled here From gbenson at redhat.com Wed Jun 3 08:22:16 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 3 Jun 2009 16:22:16 +0100 Subject: Shark codebuffer refactoring Message-ID: <20090603152216.GD19979@redhat.com> Hi all, This commit moves the interface to the CodeBuffer from SharkFunction into a new class, SharkCodeBuffer, accessed through the SharkBuilder. This makes the oop-inlining code I wrote this morning accessible from anywhere in Shark. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r d50608f15874 -r 724f230eea38 ChangeLog --- a/ChangeLog Wed Jun 03 09:37:51 2009 -0400 +++ b/ChangeLog Wed Jun 03 11:15:36 2009 -0400 @@ -1,3 +1,43 @@ +2009-06-03 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp: + New file. + + * ports/hotspot/src/share/vm/shark/sharkBuilder.hpp + (SharkBuilder::_code_buffer): New field. + (SharkBuilder::code_buffer): New method. + (SharkBuilder::set_code_buffer): Likewise. + (SharkBuilder::code_buffer_address): Likewise. + (SharkBuilder::CreateInlineOop): Likewise. + + * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp + (SharkCompiler::compile_method): Use a SharkCodeBuffer + instead of a normal CodeBuffer and MacroAssembler, and + hook it into the SharkBuilder. + + * ports/hotspot/src/share/vm/shark/sharkFunction.hpp + (SharkFunction::SharkFunction): Removed masm argument + and initialization. + (SharkFunction::_masm): Removed. + (SharkFunction::_base_pc): Likewise. + (SharkFunction::masm): Likewise. + (SharkFunction::base_pc): Likewise. + (SharkFunction::create_unique_pc_offset): Likewise. + (SharkFunction::CreateAddressOfCodeBufferEntry): Likewise. + (SharkFunction::CreateAddressOfOopInCodeBuffer): Likewise. + * ports/hotspot/src/share/vm/shark/sharkFunction.cpp + (SharkFunction::initialize): Use the new code to allocate + the SharkEntry, and set the base_pc for the SharkCodeBuffer. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::get_direct_callee): Use new code. + + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp + (SharkDecacher::start_frame): Use new code. + (SharkDecacher::start_stack): Likewise. + + * ports/hotspot/src/share/vm/includeDB_shark: Updated. + 2009-06-03 Gary Benson * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp: diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/includeDB_shark --- a/ports/hotspot/src/share/vm/includeDB_shark Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Wed Jun 03 11:15:36 2009 -0400 @@ -107,6 +107,7 @@ sharkBuilder.hpp llvmHeaders.hpp sharkBuilder.hpp llvmValue.hpp sharkBuilder.hpp sizes.hpp +sharkBuilder.hpp sharkCodeBuffer.hpp sharkBuilder.hpp sharkCompiler.hpp sharkBuilder.hpp sharkType.hpp sharkBuilder.hpp sharkValue.hpp @@ -128,10 +129,13 @@ sharkCacheDecache.hpp sharkFunction.hpp sharkCacheDecache.hpp sharkStateScanner.hpp +sharkCodeBuffer.hpp allocation.hpp +sharkCodeBuffer.hpp codeBuffer.hpp +sharkCodeBuffer.hpp llvmHeaders.hpp + sharkCompiler.cpp abstractCompiler.hpp sharkCompiler.cpp ciEnv.hpp sharkCompiler.cpp ciMethod.hpp -sharkCompiler.cpp codeBuffer.hpp sharkCompiler.cpp debug.hpp sharkCompiler.cpp debugInfoRec.hpp sharkCompiler.cpp dependencies.hpp @@ -141,6 +145,7 @@ sharkCompiler.cpp oopRecorder.hpp sharkCompiler.cpp shark_globals.hpp sharkCompiler.cpp sharkBuilder.hpp +sharkCompiler.cpp sharkCodeBuffer.hpp sharkCompiler.cpp sharkCompiler.hpp sharkCompiler.cpp sharkEntry.hpp sharkCompiler.cpp sharkFunction.hpp diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkBuilder.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp Wed Jun 03 11:15:36 2009 -0400 @@ -360,4 +360,35 @@ LLVMValue::intptr_constant(~(s - 1)), name); } + + // CodeBuffer interface + private: + SharkCodeBuffer* _code_buffer; + + public: + SharkCodeBuffer* code_buffer() const + { + return _code_buffer; + } + void set_code_buffer(SharkCodeBuffer* code_buffer) + { + _code_buffer = code_buffer; + } + + public: + llvm::Value* code_buffer_address(int offset) + { + return CreateAdd( + code_buffer()->base_pc(), LLVMValue::intptr_constant(offset)); + } + + public: + llvm::Value* CreateInlineOop(ciObject* object, const char* name = "") + { + return CreateLoad( + CreateIntToPtr( + code_buffer_address(code_buffer()->inline_oop(object)), + llvm::PointerType::getUnqual(SharkType::jobject_type())), + name); + } }; diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkCacheDecache.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -31,7 +31,7 @@ void SharkDecacher::start_frame() { // Start recording the debug information - _pc_offset = function()->create_unique_pc_offset(); + _pc_offset = builder()->code_buffer()->create_unique_offset(); _oopmap = new OopMap( oopmap_slot_munge(function()->oopmap_frame_size()), oopmap_slot_munge(function()->arg_size())); @@ -119,7 +119,7 @@ { // Record the PC builder()->CreateStore( - function()->CreateAddressOfCodeBufferEntry(pc_offset()), + builder()->code_buffer_address(pc_offset()), function()->CreateAddressOfFrameEntry(offset)); } diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp Wed Jun 03 11:15:36 2009 -0400 @@ -0,0 +1,94 @@ +/* + * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +class SharkCodeBuffer : public StackObj { + public: + SharkCodeBuffer(OopRecorder* oop_recorder) + : _cb("Shark", 256 * K, 64 * K), + _masm(new MacroAssembler(&_cb)), + _base_pc(NULL) + { + cb()->initialize_oop_recorder(oop_recorder); + } + + private: + CodeBuffer _cb; + MacroAssembler* _masm; + llvm::Value* _base_pc; + + public: + CodeBuffer* cb() + { + return &_cb; + } + + private: + MacroAssembler* masm() const + { + return _masm; + } + + public: + llvm::Value* base_pc() const + { + return _base_pc; + } + void set_base_pc(llvm::Value* base_pc) + { + assert(_base_pc == NULL, "only do this once"); + _base_pc = base_pc; + } + + // Allocate some space in the buffer and return its address. + // This buffer will have been relocated by the time the method + // is installed, so you can't inline the result in code. + public: + void* malloc(size_t size) const + { + masm()->align(BytesPerWord); + void *result = masm()->pc(); + masm()->advance(size); + return result; + } + + // Create a unique offset in the buffer. + public: + int create_unique_offset() const + { + int offset = masm()->offset(); + masm()->advance(1); + return offset; + } + + // Inline an oop into the buffer and return its offset. + public: + int inline_oop(ciObject* object) const + { + masm()->align(BytesPerWord); + int offset = masm()->offset(); + masm()->store_oop(object->encoding()); + return offset; + } +}; diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -115,14 +115,16 @@ env->debug_info()->set_oopmaps(&oopmaps); env->set_dependencies(new Dependencies(env)); - // Create the CodeBuffer and MacroAssembler - CodeBuffer cb("Shark", 256 * K, 64 * K); - cb.initialize_oop_recorder(env->oop_recorder()); - MacroAssembler *masm = new MacroAssembler(&cb); + // Create the code buffer and hook it into the builder + SharkCodeBuffer cb(env->oop_recorder()); + builder()->set_code_buffer(&cb); - // Compile the method into the CodeBuffer + // Compile the method ciBytecodeStream iter(target); - SharkFunction function(this, name, flow, &iter, masm); + SharkFunction function(this, name, flow, &iter); + + // Unhook the code buffer + builder()->set_code_buffer(NULL); // Install the method into the VM CodeOffsets offsets; @@ -138,7 +140,7 @@ entry_bci, &offsets, 0, - &cb, + cb.cb(), 0, &oopmaps, &handler_table, diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkFunction.cpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -33,8 +33,8 @@ void SharkFunction::initialize() { // Emit the entry point - SharkEntry *entry = (SharkEntry *) masm()->pc(); - masm()->advance(sizeof(SharkEntry)); + SharkEntry *entry = + (SharkEntry *) builder()->code_buffer()->malloc(sizeof(SharkEntry)); // Create the function _function = builder()->CreateFunction(name()); @@ -45,8 +45,9 @@ Function::arg_iterator ai = function()->arg_begin(); Argument *method = ai++; method->setName("method"); - _base_pc = ai++; - _base_pc->setName("base_pc"); + Argument *base_pc = ai++; + base_pc->setName("base_pc"); + builder()->code_buffer()->set_base_pc(base_pc); _thread = ai++; _thread->setName("thread"); diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkFunction.hpp --- a/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkFunction.hpp Wed Jun 03 11:15:36 2009 -0400 @@ -32,13 +32,11 @@ SharkFunction(SharkCompiler* compiler, const char* name, ciTypeFlow* flow, - ciBytecodeStream* iter, - MacroAssembler* masm) + ciBytecodeStream* iter) : _compiler(compiler), _name(name), _flow(flow), - _iter(iter), - _masm(masm) + _iter(iter) { initialize(); } private: @@ -49,10 +47,8 @@ const char* _name; ciTypeFlow* _flow; ciBytecodeStream* _iter; - MacroAssembler* _masm; llvm::Function* _function; SharkTopLevelBlock** _blocks; - llvm::Value* _base_pc; llvm::Value* _thread; int _max_monitors; GrowableArray _deferred_zero_checks; @@ -74,10 +70,6 @@ { return _iter; } - MacroAssembler* masm() const - { - return _masm; - } llvm::Function* function() const { return _function; @@ -85,10 +77,6 @@ SharkTopLevelBlock* block(int i) const { return _blocks[i]; - } - llvm::Value* base_pc() const - { - return _base_pc; } llvm::Value* thread() const { @@ -135,28 +123,6 @@ ciMethod* target() const { return flow()->method(); - } - - // CodeBuffer interface - public: - int create_unique_pc_offset() const - { - int offset = masm()->offset(); - masm()->advance(1); - return offset; - } - llvm::Value* CreateAddressOfCodeBufferEntry(int offset) const - { - return builder()->CreateAdd(base_pc(), LLVMValue::intptr_constant(offset)); - } - llvm::Value* CreateAddressOfOopInCodeBuffer(ciObject* object) const - { - masm()->align(BytesPerWord); - int offset = masm()->offset(); - masm()->store_oop(object->encoding()); - return builder()->CreateIntToPtr( - CreateAddressOfCodeBufferEntry(offset), - llvm::PointerType::getUnqual(SharkType::jobject_type())); } // Block management diff -r d50608f15874 -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 09:37:51 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 11:15:36 2009 -0400 @@ -895,10 +895,10 @@ // invokevirtual is direct in some circumstances. Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) { - return builder()->CreateLoad( - builder()->CreateBitCast( - function()->CreateAddressOfOopInCodeBuffer(method), - PointerType::getUnqual(SharkType::methodOop_type())), "callee"); + return builder()->CreateBitCast( + builder()->CreateInlineOop(method), + SharkType::methodOop_type(), + "callee"); } // Non-direct virtual calls are handled here From omajid at redhat.com Wed Jun 3 10:41:03 2009 From: omajid at redhat.com (Omair Majid) Date: Wed, 03 Jun 2009 13:41:03 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <20090602184329.GA18297@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> Message-ID: <4A26B5AF.605@redhat.com> Deepak Bhole wrote: > * Omair Majid [2009-06-01 17:03]: >> Hi, >> >> The attached patch allows Netx to use the JVM arguments specified in the >> JNLP file. Currently only 'initial-heap-size', 'max-heap-size' and >> 'java-vm-args' are used. >> >> The first instance of the JVM parses the JNLP file and creates a new JVM >> with the required arguments if the JNLP file requires it. The option >> '-Xnofork' is passed to Netx to indicate it shouldnt fork any more JVMs. >> This also makes it possible to revert to the old behaviour by passing >> -Xnofork to the first instance of Netx. >> > > Xnofork is fine, but it doesn't look like the other args (that javaws > accepts) will get passed to the new vm instance... those should be > inherited as well. Doh. Updated patch attached. ChangeLog: 2009-06-03 Omair Majid * rt/net/sourceforge/jnlp/JNLPFile.java (needsNewJVM): New function. Returns true if the JNLP file requires creating a new JVM. (getNewVMArgs): New function. Returns arguments to pass to the new JVM. * rt/net/sourceforge/jnlp/Launcher.java (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to the Java program. Use the local file used to launch this instance if possible. (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to the Java program. Launch Netx with the with the appropriate arguments. (launchApplication): If needed, launch a new JVM and pass along the Netx arguments. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add BXnofork. * rt/net/sourceforge/jnlp/runtime/Boot/java: Add -Xnofork to helpMessage (main): Check for '-Xnofork'. Set initial arguments. * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add forksAllowed to store whether creating a new JVM is allowed. Add initialArguments to store the arguments to Netx. (getForksAllowed): New function. Check if creating a new JVM is allowed. (setForksAllowed): New function. Set whether creating a JVM is allowed. (setInitialArguments): New function. Store the arguments to Netx. (getInitialArguments): New function. Return the arguments passed to Netx. * rt/net/sourceforge/jnlp/services/XBasicService.java (showDocument): Fix call to launchExternal to match the new semantics. Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jvm-args.patch Type: text/x-patch Size: 11870 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/034ebc47/attachment.bin From dbhole at redhat.com Wed Jun 3 11:07:52 2009 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 3 Jun 2009 14:07:52 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <4A26B5AF.605@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> Message-ID: <20090603180752.GB21904@redhat.com> * Omair Majid [2009-06-03 13:41]: Looks good. Couple of things though: 1. getForksAlowed() is spelled incorrectly.. 2. There is a lot of unnecessary wrapping/unwrapping going on with the whole convert array to list, add to list, convert list to array and iterate over array. Why not just change initialArgs to be a list, and then just use that list everywhere and iterate over it when launching the new vm? Cheers, Deepak -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jvm-args.patch Type: text/x-patch Size: 11903 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/9c6634d9/attachment.bin From ekrichardson at gmail.com Wed Jun 3 12:29:31 2009 From: ekrichardson at gmail.com (Eric Richardson) Date: Wed, 3 Jun 2009 12:29:31 -0700 Subject: JAXWS build problem - Darwin/PowerPC/Zero Message-ID: <860cb0120906031229of68779fw2ad329ce2d7e60f6@mail.gmail.com> Hi, I get the following error. In the release notes in says JIBX is not needed. ERROR: You do not have access to valid JIBX library files. \n Please check your access to \n /NOT-SET/devtools/share/jibx/lib/jibx-run.jar \n and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_JIBX_LIBS_PATH \n Exiting because of the above error(s). \n make[1]: *** [post-sanity] Error 1 make: *** [stamps/icedtea-ecj.stamp] Error 2 I tried this which will at least get me to the jaxws build - jaxp compiles. make ALT_OUTPUTDIR=`pwd`/build/bsd-ppc ALT_FREETYPE_LIB_PATH=/opt/local/lib ALT_FREETYPE_HEADERS_PATH=/opt/local/include ALT_JIBX_LIBS_PATH=/Users/eric/java/jibx-1.2.1/lib LIBARCH=ppc ARCH=ppc ARCH_FAMILY=ppc ARCH_DATA_MODEL=32 It fails like this below and the appropriate class is in the stax-api.jar in the jibx lib dir. build-classes: [javac] Compiling 2425 source files to /Users/eric/java/icedtea-1.10/build/bsd-ppc/jaxws/build/classes [javac] /Users/eric/java/icedtea-1.10/openjdk-ecj/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java:27: package javax.xml.stream does not exist [javac] import javax.xml.stream.XMLStreamException; I looked at both the Makefile which calls the Ant build.xml and neither refer to any classpath so I assume that the missing classes need to somehow be in the bootclasspath for the jvm/javac. I also try the configure option --with-jibx with no luck. ./configure --enable-zero=yes --with-project=bsd --with-gcj-home=/Users/eric/jdk1.5 --with-ecj-jar=/opt/local/share/java/eclipse-ecj.jar --with-xalan2-jar=/opt/local/share/java/xalan.jar --with-xalan2-serializer-jar=/opt/local/share/java/serializer.jar --with-xerces2-jar=/opt/local/share/java/xercesImpl.jar --with-jibx=/Users/eric/java/jibx-1.2.1 --without-rhino --disable-plugin --disable-xrender Any help appreciated, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/f3df2983/attachment.html From mvfranz at gmail.com Wed Jun 3 15:51:43 2009 From: mvfranz at gmail.com (Michael Franz) Date: Wed, 3 Jun 2009 18:51:43 -0400 Subject: Mac OS X - Power PC Build Progress In-Reply-To: <860cb0120906011556o5f7c48c7n36c8224380858173@mail.gmail.com> References: <860cb0120906011556o5f7c48c7n36c8224380858173@mail.gmail.com> Message-ID: Eric, Were you able to work through all the patches? Michael On Mon, Jun 1, 2009 at 6:56 PM, Eric Richardson wrote: > Hi All, > > I made another try at building Icedtea-1.10 yesterday. I have been able to > work through all the patches. Some files are being worked on by multiple > patches. I have kept track but need to go through my notes before I report > my findings and diffs. > > The basic problem I am having now is that MacOSX on PowerPC reports as > "Power Macintosh" so the default configure comes out to be bsd-Power > Macintosh. I use ALT_OUTPUTDIR to get the make started. > > This machine has a ppc970 processor so should it be as > defaulted(ARCH_DATA_MODEL=64)? Note: ZERO_ARCHFLAG=-m32 shown below. > > The core build is defaulting back to 'Power Macintosh' and the spaces seem > to be causing problems. Here are the possible offending vars from the output > below: ARCH = Power Macintosh\n LIBARCH = Power Macintosh\n ARCH_FAMILY = > Power Macintosh\n > Error follows. > > >>>Recursively making core build @ Mon Jun 1 00:26:52 PDT 2009 ... > ../../../common/Rules.gmk:263: warning: overriding commands for target > `Macintosh' > ../../../common/Rules.gmk:49: warning: ignoring old commands for target > `Macintosh' > ../../../common/Library.gmk:67: *** target file > `/Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/lib/Power' has both : > and :: entries. Stop. > make[5]: *** [build] Error 1 > make[4]: *** [build] Error 1 > make[3]: *** [build] Error 1 > make[2]: *** [corba-build] Error 2 > make[1]: *** [build_product_image] Error 2 > make: *** [stamps/icedtea-ecj.stamp] Error 2 > > I have no idea how far I made it but it is much better than before. Any > pointers to the appropriate place to adjust the build is appreciated. > > Eric > > > Commands and some Output follows - may be a bit out of order as it was late > ------------------------------ > > ./autogen.sh > > ./configure --enable-zero=yes --with-project=bsd > --with-gcj-home=/Users/eric/jdk1.5 > --with-ecj-jar=/opt/local/share/java/eclipse-ecj.jar > --with-xalan2-jar=/opt/local/share/java/xalan.jar > --with-xalan2-serializer-jar=/opt/local/share/java/serializer.jar > --with-xerces2-jar=/opt/local/share/java/xercesImpl.jar --without-rhino > --disable-plugin --disable-xrender > > make ALT_OUTPUTDIR=`pwd`/build/bsd-macosx > ALT_FREETYPE_LIB_PATH=/opt/local/lib > ALT_FREETYPE_HEADERS_PATH=/opt/local/include > ALT_JIBX_LIBS_PATH=/Users/eric/java/jibx-1.2.1/lib > > > > /usr/bin/make \ > > "ALT_JDK_IMPORT_PATH=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0" > "ANT_HOME=/usr/share/ant" "BUILD_NUMBER=b59" "JDK_UPDATE_VERSION=0" > "JRE_RELEASE_VERSION=1.7.0_0-b59" "MILESTONE=fcs" "LANG=C" > "PATH=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin::$PATH" > "ALT_BOOTDIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0" > "BUILD_ARCH_DIR=ppc" > "ICEDTEA_RT=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar" > "ICEDTEA_BUILD_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/" > "ICEDTEA_CLS_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes" > "ICEDTEA_ENDORSED_DIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/lib/endorsed" > "ENDORSED=-Djava.endorsed.dirs=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/lib/endorsed" > "BOOTCLASSPATH_CLS_RT=-bootclasspath > /Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes:/Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar" > "BOOTCLASSPATH_CLS=-bootclasspath > /Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes" > "BOOTCLASSPATH_RT_LIBGCJ=-bootclasspath > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar:/Users/eric/jdk1.5/jre/lib/rt.jar" > "CLASSPATH=" "LD_LIBRARY_PATH=" > "GENSRCDIR=/Users/eric/java/icedtea-1.10/generated" "ICEDTEA_CORE_BUILD=yes" > "ICEDTEA_ZERO_BUILD=yes" "ICEDTEA_SHARK_BUILD=" "ZERO_LIBARCH=ppc" > "ZERO_BITSPERWORD=32" "ZERO_ENDIANNESS=big" "ZERO_ARCHDEF=PPC" > "ZERO_ARCHFLAG=-m32" "LIBFFI_CFLAGS=-I/opt/local/lib/libffi-3.0.6/include " > "LIBFFI_LIBS=-L/opt/local/lib -lffi " "LLVM_CFLAGS=" "LLVM_LDFLAGS=" > "LLVM_LIBS=" "FREETYPE2_HEADERS=-I/opt/local/include/freetype2 > -I/opt/local/include " "FT2_LIB=-L/opt/local/lib -lfreetype -lz " > "ALT_PARALLEL_COMPILE_JOBS=2" "HOTSPOT_BUILD_JOBS=2" "JAVAC=" "RHINO_JAR=no" > "JAR_KNOWS_ATFILE=1" "JAR_KNOWS_J_OPTIONS=1" "JAR_ACCEPTS_STDIN_LIST=" > "DISABLE_NIMBUS=true" > "ALT_NETX_DIST=/Users/eric/java/icedtea-1.10/netx.build" > "ALT_LIVECONNECT_DIST=/Users/eric/java/icedtea-1.10" \ > -C openjdk-ecj \ > > Control bsd Power Macintosh 1.7.0_0-bsd all build started: > ( cd ./jdk/make && \ > /usr/bin/make sanity HOTSPOT_IMPORT_CHECK=false > JDK_TOPDIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk > JDK_MAKE_SHARED_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk/make/common/shared > EXTERNALSANITYCONTROL=true TARGET_CLASS_VERSION=5 MILESTONE=fcs > BUILD_NUMBER=b59 JDK_BUILD_NUMBER=b59 FULL_VERSION=1.7.0_0-bsd-b59 > PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0_0 JDK_MKTG_VERSION=7u > JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 > PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 > ARCH_DATA_MODEL=64 COOKED_JDK_UPDATE_VERSION=0 COOKED_BUILD_NUMBER=59 > ANT_HOME="/usr/share/ant" > ALT_OUTPUTDIR=/Users/eric/java/icedtea-1.10/build/bsd-macosx > ALT_LANGTOOLS_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist > ALT_CORBA_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/dist > ALT_JAXP_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxp/dist > ALT_JAXWS_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxws/dist > ALT_HOTSPOT_IMPORT_PATH=/Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import > BUILD_HOTSPOT=true ; ) > > Build Machine Information: > build machine = new-host.home > > Build Directory Structure: > CWD = /Users/eric/java/icedtea-1.10/openjdk-ecj > TOPDIR = . > CONTROL_TOPDIR = . > LANGTOOLS_TOPDIR = ./langtools > JAXP_TOPDIR = ./jaxp > JAXWS_TOPDIR = ./jaxws > CORBA_TOPDIR = ./corba > HOTSPOT_TOPDIR = ./hotspot > JDK_TOPDIR = ./jdk > > Build Directives: > BUILD_LANGTOOLS = true > BUILD_JAXP = true > BUILD_JAXWS = true > BUILD_CORBA = true > BUILD_HOTSPOT = true > BUILD_JDK = true > > Hotspot Settings: \n HOTSPOT_BUILD_JOBS = 2 \n > HOTSPOT_OUTPUTDIR = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/outputdir \n > HOTSPOT_EXPORT_PATH = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import \n \n > > \nBootstrap Settings:\n BOOTDIR = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n ALT_BOOTDIR = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n BOOT_VER = 1.5.0 > [requires at least 1.5]\n OUTPUTDIR = > /Users/eric/java/icedtea-1.10/build/bsd-macosx\n ALT_OUTPUTDIR = > /Users/eric/java/icedtea-1.10/build/bsd-macosx\n ABS_OUTPUTDIR = > /Users/eric/java/icedtea-1.10/build/bsd-macosx\n \nBuild Tool Settings:\n > SLASH_JAVA = /NOT-SET\n ALT_SLASH_JAVA = \n VARIANT = OPT\n > JDK_DEVTOOLS_DIR = /NOT-SET/devtools\n ALT_JDK_DEVTOOLS_DIR = \n > ANT_HOME = /usr/share/ant\n UNIXCOMMAND_PATH = /bin/\n > ALT_UNIXCOMMAND_PATH = \n COMPILER_PATH = /usr/bin/\n ALT_COMPILER_PATH > = \n DEVTOOLS_PATH = /opt/local/bin/\n ALT_DEVTOOLS_PATH = \n > COMPILER_NAME = GCC4\n COMPILER_VERSION = GCC4\n CC_VER = 4.0.1 [requires > at least 3.2]\n ZIP_VER = 2.32 [requires at least 2.2]\n UNZIP_VER = 5.52 > [requires at least 5.12]\n ANT_VER = 1.7.0 [requires at least 1.6.3]\n > TEMPDIR = /Users/eric/java/icedtea-1.10/build/bsd-macosx/tmp\n \nBuild > Directives:\n OPENJDK = true\n USE_HOTSPOT_INTERPRETER_MODE = \n PEDANTIC > = \n DEV_ONLY = \n NO_DOCS = \n NO_IMAGES = \n TOOLS_ONLY = \n INSANE = > \n COMPILE_APPROACH = parallel\n PARALLEL_COMPILE_JOBS = 2\n > ALT_PARALLEL_COMPILE_JOBS = 2\n FASTDEBUG = \n COMPILER_WARNINGS_FATAL = > false\n COMPILER_WARNING_LEVEL = \n INCREMENTAL_BUILD = false\n > CC_HIGHEST_OPT = \n CC_HIGHER_OPT = \n CC_LOWER_OPT = \n CXXFLAGS = -O2 > -fPIC -DCC_NOEX -W -Wall -Wno-unused -Wno-parentheses \n CFLAGS = -O2 > -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses \n > BOOT_JAVA_CMD = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/java > -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx896m > -Xms128m -XX:PermSize=32m -XX:MaxPermSize=160m\n BOOT_JAVAC_CMD = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/javac > -J-XX:ThreadStackSize=1536 -J-XX:-PrintVMOptions > -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput -J-Xmx896m -J-Xms128m > -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii > -XDignore.symbol.file=true\n BOOT_JAR_CMD = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/jar\n > BOOT_JARSIGNER_CMD = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/jarsigner\n JAVAC_CMD > = \n JAVAH_CMD = \n JAVADOC_CMD = \n \nBuild Platform Settings:\n USER = > eric\n PLATFORM = bsd\n ARCH = Power Macintosh\n LIBARCH = Power > Macintosh\n ARCH_FAMILY = Power Macintosh\n ARCH_DATA_MODEL = 64\n > ARCHPROP = Power Macintosh\n OS_VERSION = 9.6.0 [requires at least 8.0]\n > OS_VARIANT_NAME = \n OS_VARIANT_VERSION = \n TEMP_FREE_SPACE = > 312319584\n FREE_SPACE = 312319584\n MB_OF_MEMORY = 1024\n \nGNU Make > Settings:\n MAKE = /usr/bin/make\n MAKE_VER = 3.81 [requires at least > 3.78]\n MAKECMDGOALS = sanity\n MAKEFLAGS = \n SHELL = /bin/sh\n \nTarget > Build Versions:\n JDK_VERSION = 1.7.0_0\n MILESTONE = fcs\n RELEASE = > 1.7.0_0-bsd\n FULL_VERSION = 1.7.0_0-bsd-b59\n BUILD_NUMBER = b59\n > \nExternal File/Binary Locations:\n USRJDKINSTANCES_PATH = /opt/local\n > BUILD_JDK_IMPORT_PATH = > /NOT-SET/re/jdk/1.7.0_0/promoted/latest/binaries\n > ALT_BUILD_JDK_IMPORT_PATH = \n JDK_IMPORT_PATH = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n ALT_JDK_IMPORT_PATH = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n LANGTOOLS_DIST = \n > ALT_LANGTOOLS_DIST = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist\n CORBA_DIST > = \n ALT_CORBA_DIST = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/dist\n JAXP_DIST = > \n ALT_JAXP_DIST = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxp/dist\n JAXWS_DIST = > \n ALT_JAXWS_DIST = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxws/dist\n > HOTSPOT_DOCS_IMPORT_PATH = /NO_DOCS_DIR\n ALT_HOTSPOT_DOCS_IMPORT_PATH = > \n HOTSPOT_IMPORT_PATH = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import\n > ALT_HOTSPOT_IMPORT_PATH = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import\n > HOTSPOT_SERVER_PATH = > /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import/jre/lib/Power > Macintosh/server\n ALT_HOTSPOT_SERVER_PATH = \n CACERTS_FILE = > ./../src/share/lib/security/cacerts\n ALT_CACERTS_FILE = \n > JIBX_LIBS_PATH = /Users/eric/java/jibx-1.2.1/lib\n ALT_JIBX_LIBS_PATH = > /Users/eric/java/jibx-1.2.1/lib\n CUPS_HEADERS_PATH = /usr/include\n > ALT_CUPS_HEADERS_PATH = \n \nOpenJDK-specific settings:\n > FREETYPE_HEADERS_PATH = /opt/local/include\n ALT_FREETYPE_HEADERS_PATH = > /opt/local/include\n FREETYPE_LIB_PATH = /opt/local/lib\n > ALT_FREETYPE_LIB_PATH = /opt/local/lib\n X11_PATH = /usr/X11R6\n > ALT_X11_PATH = \n \nOPENJDK Import Binary Plug Settings:\n > IMPORT_BINARY_PLUGS = \n BINARY_PLUGS_JARFILE = > /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs/bsd-Power > Macintosh/jre/lib/rt-closed.jar\n ALT_BINARY_PLUGS_JARFILE = \n > BINARY_PLUGS_PATH = > /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs/bsd-Power > Macintosh\n ALT_BINARY_PLUGS_PATH = \n BUILD_BINARY_PLUGS_PATH = > /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs\n > ALT_BUILD_BINARY_PLUGS_PATH = \n PLUG_LIBRARY_NAMES = \n \nPrevious JDK > Settings:\n PREVIOUS_RELEASE_PATH = USING-PREVIOUS_RELEASE_IMAGE\n > ALT_PREVIOUS_RELEASE_PATH = \n PREVIOUS_JDK_VERSION = 1.6.0\n > ALT_PREVIOUS_JDK_VERSION = \n PREVIOUS_JDK_FILE = \n > ALT_PREVIOUS_JDK_FILE = \n PREVIOUS_JRE_FILE = \n ALT_PREVIOUS_JRE_FILE > = \n PREVIOUS_RELEASE_IMAGE = > /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n > ALT_PREVIOUS_RELEASE_IMAGE = \n > > Sanity check passed. > Control bsd Power Macintosh 1.7.0_0-bsd all_product_build build started: > Control bsd Power Macintosh 1.7.0_0-bsd build_product_image build started: > /usr/bin/make \ > SKIP_FASTDEBUG_BUILD=true \ > SKIP_DEBUG_BUILD=true \ > \ > generic_build_repo_series > /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx > /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx/j2sdk-image > /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools > (cd ./langtools/make && \ > /usr/bin/make JDK_TOPDIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk > JDK_MAKE_SHARED_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk/make/common/shared > EXTERNALSANITYCONTROL=true TARGET_CLASS_VERSION=5 MILESTONE=fcs > BUILD_NUMBER=b59 JDK_BUILD_NUMBER=b59 FULL_VERSION=1.7.0_0-bsd-b59 > PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0_0 JDK_MKTG_VERSION=7u > JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 > PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 > ARCH_DATA_MODEL=64 COOKED_JDK_UPDATE_VERSION=0 COOKED_BUILD_NUMBER=59 > ANT_HOME="/usr/share/ant" > ALT_OUTPUTDIR=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools > ALT_BOOTDIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0 all) > ANT_OPTS=-Djava.io.tmpdir='/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-tmp' > ant -diagnostics > > /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-diagnostics.log > ANT_OPTS=-Djava.io.tmpdir='/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-tmp' > ant -Djdk.version=1.7.0_0 -Dfull.version='1.7.0_0-bsd-b59' > -Drelease=1.7.0_0 -Dbuild.number=b59 -Djavac.target=5 > -Dboot.java.home=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0 > -Djavac.executable=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/javac > -Dbuild.dir=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build > -Ddist.dir=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist > build > Buildfile: build.xml > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090603/5ba97db9/attachment.html From ptisnovs at redhat.com Thu Jun 4 03:21:39 2009 From: ptisnovs at redhat.com (Pavel Tisnovsky) Date: Thu, 4 Jun 2009 06:21:39 -0400 (EDT) Subject: New member of Open Source Java team in RedHat Message-ID: <41480188.1182291244110899736.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Hi, Let me introduce myself: I'm new member of Open Source Java team in RedHat, my position is QA Engineer for OpenJDK project. My IcedTea wiki login name is PavelTisnovsky, so don't be suprised, when you see this name in edit history :-) My contact information: e-mail: ptisnovs at redhat.com or Jabber: tisnik at jabber.cz I'm looking forward for our cooperation, Pavel Tisnovsky From mjw at redhat.com Thu Jun 4 04:34:03 2009 From: mjw at redhat.com (Mark Wielaard) Date: Thu, 04 Jun 2009 13:34:03 +0200 Subject: [OpenJDK 2D-Dev] freetype version check (2.3.0 -> 2.2.1) In-Reply-To: <1241467043.26874.12.camel@hermans.wildebeest.org> References: <1241444279.2359.56.camel@fedora.wildebeest.org> <49FF4337.9000502@sun.com> <1241467043.26874.12.camel@hermans.wildebeest.org> Message-ID: <1244115243.3575.20.camel@hermans.wildebeest.org> Hi Phil, Hi Igor, On Mon, 2009-05-04 at 21:57 +0200, Mark Wielaard wrote: > On Mon, 2009-05-04 at 12:34 -0700, Phil Race wrote: > > Igor did the freetype work and in he commented in email on 23rd July 2007 : > > > > > - Changed required freetype version from 2.3.4 to 2.3.0 > > > (it did compile with 2.2.1 too for me but Font2DTest was showing garbage > > > and i had no chance to investigate why this happens) > > > > So I don't think we want to move it down without knowing what that was about. > > It may have been platform-specific. Igor - can you remember two years back ? > > Interesting, to make sure everything was fine I did also check with that > Font2DTest (and some others) and the fact that everything looked just > fine was the reason to push it. > > > I also recall there was a nasty bug where having fonts with embedded > > bitmaps on your system caused an infinite loop inside freetype. > > I think we needed to update the freetype lib because of that, but > > I can't remember the details to be sure. > > The freetype 2.2.1 package on RHEL and CentOS 5 do have some fixes > applied to them. And the java-1.6.0-openjdk package has been deployed on > those platforms for some time. So I assume if there were any real bugs > they will have been backported at least on those platforms. > > Ideally of course we would have a autoconf test for the features that > the backend relies on. The problem with the hard version check is that > it prevents compilation for everybody, even when they really just want > to compile against an earlier (patched/fixed) version that might just be > what is available for the platform. > > Let me know if I can help with coming up with a feature test for any > issues. For now to not forget this patch it has been filed at: https://bugs.openjdk.java.net/show_bug.cgi?id=100061 Please do let me know if you find out anything about your earlier concerns and what I can do to help move this forward. Thanks, Mark From mjw at redhat.com Thu Jun 4 05:19:08 2009 From: mjw at redhat.com (Mark Wielaard) Date: Thu, 04 Jun 2009 14:19:08 +0200 Subject: Cleaning up crypto support] In-Reply-To: <1227203691.3306.51.camel@dijkstra.wildebeest.org> References: <49133910.2050609@sun.com> <1227203691.3306.51.camel@dijkstra.wildebeest.org> Message-ID: <1244117949.3575.40.camel@hermans.wildebeest.org> Hi Brad, On Thu, 2008-11-20 at 18:54 +0100, Mark Wielaard wrote: > On Thu, 2008-11-06 at 10:36 -0800, Brad Wetmore wrote: > > Mark Wielaard wrote: > >> It seems this is working out good for the GNU/Linux distros based > >> on the latest IcedTea6 releases, so getting this upstream would > >> be nice. Anything I can do to help with that? > > > > I got brought into a high priority escalation for the last couple weeks, > > I'm think I'm finally coming to the end and will respond then. I owe > > several responses. > > Thanks, take your time. And if there is anything I can do to provide > more info on the idea behind the patch to ease reviewing, please let me > know. Just to make sure this doesn't get forgotten I also filed it as: https://bugs.openjdk.java.net/show_bug.cgi?id=100062 Thanks, Mark From mjw at redhat.com Thu Jun 4 05:29:24 2009 From: mjw at redhat.com (Mark Wielaard) Date: Thu, 04 Jun 2009 14:29:24 +0200 Subject: [OpenJDK 2D-Dev] Bug in pisces Renderer (uninitialized crossings) In-Reply-To: <1227202342.3306.33.camel@dijkstra.wildebeest.org> References: <1225119212.3329.29.camel@dijkstra.wildebeest.org> <1225791009.3320.4.camel@dijkstra.wildebeest.org> <1226579411.4563.17.camel@dijkstra.wildebeest.org> <491C64FE.4070408@sun.com> <1227202342.3306.33.camel@dijkstra.wildebeest.org> Message-ID: <1244118565.3575.47.camel@hermans.wildebeest.org> Hi Igor and Alexey, On Thu, 2008-11-20 at 18:32 +0100, Mark Wielaard wrote: > On Thu, 2008-11-13 at 20:33 +0300, Igor Nekrestyanov wrote: > > your patch looks ok to me but i am not expert in pisces. > > > > Alexey Ushakov, who is our expert in pisces should have returned from > > vacation today > > and i think he will review this soon. > > Thanks for looking at it. If I can help with any review, by clarifying > anything, please let me know. To make sure this doesn't get forgotten I also filed it as: https://bugs.openjdk.java.net/show_bug.cgi?id=100063 Thanks, Mark From mjw at redhat.com Thu Jun 4 05:50:19 2009 From: mjw at redhat.com (Mark Wielaard) Date: Thu, 04 Jun 2009 14:50:19 +0200 Subject: Bug in pisces Stroker (div by zero) In-Reply-To: <1227304315.9475.12.camel@hermans.wildebeest.org> References: <1227304315.9475.12.camel@hermans.wildebeest.org> Message-ID: <1244119819.3565.6.camel@hermans.wildebeest.org> Hi, On Fri, 2008-11-21 at 22:51 +0100, Mark Wielaard wrote: > There is a bug in the pisces Stroker in finish(). When ldx and ldy are > so small (zero) that lineLength() will return zero, then you will get a > div by zero exception. > > You can see this with for example this webstart application (you will > need to have IcedTeaWebstart [netx] installed): > http://linuxhippy.blogspot.com/2008/11/jgears2-rendermark.html > > java.lang.ArithmeticException: / by zero > at sun.java2d.pisces.Stroker.finish(Stroker.java:698) > at sun.java2d.pisces.Stroker.close(Stroker.java:592) > [...] To make sure that the patch isn't forgotten I also filed this as: https://bugs.openjdk.java.net/show_bug.cgi?id=100064 Thanks, Mark From mark at klomp.org Thu Jun 4 06:19:58 2009 From: mark at klomp.org (Mark Wielaard) Date: Thu, 04 Jun 2009 15:19:58 +0200 Subject: Setting public TestEnv defaults for net/nio tests needing hosts In-Reply-To: <1226790321.3805.12.camel@dijkstra.wildebeest.org> References: <1226790321.3805.12.camel@dijkstra.wildebeest.org> Message-ID: <1244121598.3565.21.camel@hermans.wildebeest.org> Hi, On Sun, 2008-11-16 at 00:05 +0100, Mark Wielaard wrote: > I made sure all needed services are enabled on > icedtea.classpath.org/developer.classpath.org and set those as defaults > in TestEnv for the net/nio tests that need to contact hosts. Using > icedtea for remote_host and developer for far_host is somewhat > arbitrary, but at least these hosts are public. > > I also made sure the cname.sh test uses the far_host to do its tests > instead of a hardcoded one. And I changed the SocketChannel LocalAddress > and Shutdown tests to use the echo service. Since the echo service > already has to be enabled for other tests and I didn't want to open up a > telnet port. > [...] > All the tests using TestEnv in make check-jdk target now PASS for me. > > Note that TestEnv hasn't been forward ported from jdk6 to jdk7. So I > haven't yet pushed this patch upstream to the jdk7 net/nio lists. The jdk6 and jdk7 environments are still somewhat dissimilar, but thanks to Andrew Hughes the patches have been ported to make sure they also work on jdk7 out of the box by default using just public hosts without the need to change anything in your test environment locally. Attached is the patch against jdk7. I also filed (the jdk6 version) in bugzilla so it doesn't get forgotten: https://bugs.openjdk.java.net/show_bug.cgi?id=100066 Thanks, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea-testenv.patch Type: text/x-patch Size: 3185 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090604/b81d04af/attachment.bin From gbenson at redhat.com Thu Jun 4 06:49:48 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 04 Jun 2009 13:49:48 +0000 Subject: changeset in /hg/icedtea6: 2009-06-04 Gary Benson changeset 89bd8e0f38c5 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=89bd8e0f38c5 description: 2009-06-04 Gary Benson * ports/hotspot/src/share/vm/shark/sharkConstant.hpp: New file. * ports/hotspot/src/share/vm/shark/sharkConstant.cpp: Likewise. * ports/hotspot/src/share/vm/shark/sharkBlock.hpp (SharkBlock::lookup_for_ldc): Removed. (SharkBlock::do_ldc): Likewise. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp (SharkBlock::parse_bytecode): Use new code for ldc and friends. (SharkBlock::do_field_access): Use new code for constant fields. (SharkBlock::lookup_for_ldc): Removed. * ports/hotspot/src/share/vm/shark/sharkInliner.cpp (SharkInlinerHelper::is_inlinable): Use new code for ldc and friends. (SharkInlinerHelper::do_field_access): Use new code for constant fields. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::lookup_for_ldc): Removed. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::scan_for_traps): Use new code to for ldc and constant field traps. (SharkTopLevelBlock::lookup_for_ldc): Removed. * ports/hotspot/src/share/vm/shark/sharkValue.hpp (SharkValue::from_ciConstant): Removed. * ports/hotspot/src/share/vm/includeDB_shark: Updated. diffstat: 10 files changed, 247 insertions(+), 101 deletions(-) ChangeLog | 29 +++ ports/hotspot/src/share/vm/includeDB_shark | 14 + ports/hotspot/src/share/vm/shark/sharkBlock.cpp | 11 - ports/hotspot/src/share/vm/shark/sharkBlock.hpp | 11 - ports/hotspot/src/share/vm/shark/sharkConstant.cpp | 121 +++++++++++++++ ports/hotspot/src/share/vm/shark/sharkConstant.hpp | 68 ++++++++ ports/hotspot/src/share/vm/shark/sharkInliner.cpp | 16 - ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 38 ---- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 1 ports/hotspot/src/share/vm/shark/sharkValue.hpp | 39 ---- diffs (truncated from 512 to 500 lines): diff -r 724f230eea38 -r 89bd8e0f38c5 ChangeLog --- a/ChangeLog Wed Jun 03 11:15:36 2009 -0400 +++ b/ChangeLog Thu Jun 04 09:48:19 2009 -0400 @@ -1,3 +1,32 @@ 2009-06-03 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkConstant.hpp: New file. + * ports/hotspot/src/share/vm/shark/sharkConstant.cpp: Likewise. + + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp + (SharkBlock::lookup_for_ldc): Removed. + (SharkBlock::do_ldc): Likewise. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp + (SharkBlock::parse_bytecode): Use new code for ldc and friends. + (SharkBlock::do_field_access): Use new code for constant fields. + (SharkBlock::lookup_for_ldc): Removed. + + * ports/hotspot/src/share/vm/shark/sharkInliner.cpp + (SharkInlinerHelper::is_inlinable): Use new code for ldc and friends. + (SharkInlinerHelper::do_field_access): Use new code for constant fields. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::lookup_for_ldc): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Use new code to for ldc and + constant field traps. + (SharkTopLevelBlock::lookup_for_ldc): Removed. + + * ports/hotspot/src/share/vm/shark/sharkValue.hpp + (SharkValue::from_ciConstant): Removed. + + * ports/hotspot/src/share/vm/includeDB_shark: Updated. + 2009-06-03 Gary Benson * ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp: diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/includeDB_shark --- a/ports/hotspot/src/share/vm/includeDB_shark Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Thu Jun 04 09:48:19 2009 -0400 @@ -73,6 +73,7 @@ sharkBlock.cpp sharkBlock.cpp shark_globals.hpp sharkBlock.cpp sharkBlock.hpp sharkBlock.cpp sharkBuilder.hpp +sharkBlock.cpp sharkConstant.hpp sharkBlock.cpp sharkRuntime.hpp sharkBlock.cpp sharkState.inline.hpp sharkBlock.cpp sharkValue.hpp @@ -83,6 +84,7 @@ sharkBlock.hpp sharkBlock.hpp debug.hpp sharkBlock.hpp llvmHeaders.hpp sharkBlock.hpp sharkBuilder.hpp +sharkBlock.hpp sharkConstant.hpp sharkBlock.hpp sharkState.hpp sharkBlock.hpp sharkValue.hpp @@ -158,6 +160,16 @@ sharkCompiler.hpp sharkCompiler.hpp llvmHeaders.hpp sharkCompiler.hpp sharkMemoryManager.hpp +sharkConstant.cpp ciStreams.hpp +sharkConstant.cpp sharkBuilder.hpp +sharkConstant.cpp sharkConstant.hpp +sharkConstant.cpp sharkValue.hpp + +sharkConstant.hpp allocation.hpp +sharkConstant.hpp ciStreams.hpp +sharkConstant.hpp sharkBuilder.hpp +sharkConstant.hpp sharkValue.hpp + sharkConstantPool.cpp allocation.hpp sharkConstantPool.cpp constantPoolOop.hpp sharkConstantPool.cpp cpCacheOop.hpp @@ -215,6 +227,7 @@ sharkInliner.cpp sharkInliner.cpp ciMethod.hpp sharkInliner.cpp ciStreams.hpp sharkInliner.cpp shark_globals.hpp +sharkInliner.cpp sharkConstant.hpp sharkInliner.cpp sharkInliner.hpp sharkInliner.cpp sharkIntrinsics.hpp sharkInliner.cpp sharkState.inline.hpp @@ -302,6 +315,7 @@ sharkTopLevelBlock.cpp sharkTopLevelBlock.cpp shark_globals.hpp sharkTopLevelBlock.cpp sharkTopLevelBlock.hpp sharkTopLevelBlock.cpp sharkBuilder.hpp +sharkTopLevelBlock.cpp sharkConstant.hpp sharkTopLevelBlock.cpp sharkConstantPool.hpp sharkTopLevelBlock.cpp sharkInliner.hpp sharkTopLevelBlock.cpp sharkRuntime.hpp diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Thu Jun 04 09:48:19 2009 -0400 @@ -163,7 +163,7 @@ void SharkBlock::parse_bytecode(int star case Bytecodes::_ldc: case Bytecodes::_ldc_w: case Bytecodes::_ldc2_w: - do_ldc(); + push(SharkConstant::for_ldc(iter())->value(builder())); break; case Bytecodes::_iload_0: @@ -996,7 +996,9 @@ void SharkBlock::do_field_access(bool is object = value->generic_value(); } if (is_get && field->is_constant()) { - value = SharkValue::from_ciConstant(field->constant_value()); + SharkConstant *constant = SharkConstant::for_field(iter()); + if (constant->is_loaded()) + value = constant->value(builder()); } if (!is_get || value == NULL) { if (!is_field) @@ -1163,11 +1165,6 @@ void SharkBlock::do_trap(int trap_reques ShouldNotCallThis(); } -Value* SharkBlock::lookup_for_ldc() -{ - ShouldNotCallThis(); -} - Value* SharkBlock::lookup_for_field_access() { ShouldNotCallThis(); diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Thu Jun 04 09:48:19 2009 -0400 @@ -202,7 +202,6 @@ class SharkBlock : public ResourceObj { // Helpers protected: virtual void do_zero_check(SharkValue* value); - virtual llvm::Value* lookup_for_ldc(); virtual llvm::Value* lookup_for_field_access(); // Leaf calls @@ -240,16 +239,6 @@ class SharkBlock : public ResourceObj { virtual int trap_bci(); virtual void do_trap(int trap_request); - // ldc* - private: - void do_ldc() - { - SharkValue *value = SharkValue::from_ciConstant(iter()->get_constant()); - if (value == NULL) - value = SharkValue::create_jobject(lookup_for_ldc(), true); - push(value); - } - // arraylength protected: virtual void do_arraylength(); diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkConstant.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkConstant.cpp Thu Jun 04 09:48:19 2009 -0400 @@ -0,0 +1,121 @@ +/* + * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +#include "incls/_precompiled.incl" +#include "incls/_sharkConstant.cpp.incl" + +using namespace llvm; + +SharkConstant* SharkConstant::for_ldc(ciBytecodeStream *iter) +{ + return new SharkConstant(iter->get_constant(), NULL); +} + +SharkConstant* SharkConstant::for_field(ciBytecodeStream *iter) +{ + bool will_link; + ciField *field = iter->get_field(will_link); + assert(will_link, "typeflow responsibility"); + + return new SharkConstant(field->constant_value(), field->type()); +} + +SharkConstant::SharkConstant(ciConstant constant, ciType *type) +{ + SharkValue *value = NULL; + + switch (constant.basic_type()) { + case T_BOOLEAN: + case T_BYTE: + case T_CHAR: + case T_SHORT: + case T_INT: + value = SharkValue::jint_constant(constant.as_int()); + break; + + case T_LONG: + value = SharkValue::jlong_constant(constant.as_long()); + break; + + case T_FLOAT: + value = SharkValue::jfloat_constant(constant.as_float()); + break; + + case T_DOUBLE: + value = SharkValue::jdouble_constant(constant.as_double()); + break; + + case T_OBJECT: + case T_ARRAY: + break; + + case T_ILLEGAL: + // out of memory + _is_loaded = false; + return; + + default: + tty->print_cr("Unhandled type %s", type2name(constant.basic_type())); + ShouldNotReachHere(); + } + + // Handle primitive types. We create SharkValues for these + // now; doing so doesn't emit any code, and it allows us to + // delegate a bunch of stuff to the SharkValue code. + if (value) { + _value = value; + _is_loaded = true; + _is_nonzero = value->zero_checked(); + _is_two_word = value->is_two_word(); + return; + } + + // Handle reference types. This is tricky because some + // ciObjects are psuedo-objects that refer to oops which + // have yet to be created. We need to spot the unloaded + // objects (which differ between ldc* and get*, thanks!) + ciObject *object = constant.as_object(); + if (object->is_klass()) { + // The constant returned for a klass is the ciKlass + // for the entry, but we want the java_mirror. + ciKlass *klass = object->as_klass(); + if (!klass->is_loaded()) { + _is_loaded = false; + return; + } + object = klass->java_mirror(); + } + if (object->is_null_object() || !object->has_encoding()) { + _is_loaded = false; + return; + } + + _value = NULL; + _object = object; + _type = type ? type : ciType::make(T_OBJECT); + _is_loaded = true; + _is_nonzero = true; + _is_two_word = false; +} diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkConstant.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkConstant.hpp Thu Jun 04 09:48:19 2009 -0400 @@ -0,0 +1,68 @@ +/* + * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +class SharkConstant : public ResourceObj { + public: + static SharkConstant* for_ldc(ciBytecodeStream* iter); + static SharkConstant* for_field(ciBytecodeStream* iter); + + private: + SharkConstant(ciConstant constant, ciType* type); + + private: + SharkValue* _value; + ciObject* _object; + ciType* _type; + bool _is_loaded; + bool _is_nonzero; + bool _is_two_word; + + public: + bool is_loaded() const + { + return _is_loaded; + } + bool is_nonzero() const + { + assert(is_loaded(), "should be"); + return _is_nonzero; + } + bool is_two_word() const + { + assert(is_loaded(), "should be"); + return _is_two_word; + } + + public: + SharkValue* value(SharkBuilder* builder) + { + assert(is_loaded(), "should be"); + if (_value == NULL) { + _value = SharkValue::create_generic( + _type, builder->CreateInlineOop(_object), _is_nonzero); + } + return _value; + } +}; diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkInliner.cpp --- a/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Thu Jun 04 09:48:19 2009 -0400 @@ -267,7 +267,7 @@ bool SharkInlinerHelper::is_inlinable() ResourceMark rm; initialize_for_check(); - SharkValue *sv; + SharkConstant *sc; bool a, b, c, d; iter()->reset_to_bci(0); @@ -323,11 +323,11 @@ bool SharkInlinerHelper::is_inlinable() case Bytecodes::_ldc: case Bytecodes::_ldc_w: case Bytecodes::_ldc2_w: - sv = SharkValue::from_ciConstant(iter()->get_constant()); - if (sv == NULL) + sc = SharkConstant::for_ldc(iter()); + if (!sc->is_loaded()) return false; - push(sv->zero_checked()); - if (sv->is_two_word()) + push(sc->is_nonzero()); + if (sc->is_two_word()) push(false); break; @@ -753,9 +753,9 @@ bool SharkInlinerHelper::do_field_access if (is_get) { bool result_pushed = false; if (field->is_constant()) { - SharkValue *value = SharkValue::from_ciConstant(field->constant_value()); - if (value != NULL) { - push(value->zero_checked()); + SharkConstant *sc = SharkConstant::for_field(iter()); + if (sc->is_loaded()) { + push(sc->is_nonzero()); result_pushed = true; } } diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 09:48:19 2009 -0400 @@ -48,7 +48,7 @@ void SharkTopLevelBlock::scan_for_traps( switch (bc()) { case Bytecodes::_ldc: case Bytecodes::_ldc_w: - if (iter()->is_unresolved_string() || iter()->is_unresolved_klass()) { + if (!SharkConstant::for_ldc(iter())->is_loaded()) { set_trap( Deoptimization::make_trap_request( Deoptimization::Reason_uninitialized, @@ -80,10 +80,9 @@ void SharkTopLevelBlock::scan_for_traps( if (is_field) break; - // There won't be a pool access if this is a getstatic that - // resolves to a handled constant either + // There won't be a pool access if this is a constant getstatic if (bc() == Bytecodes::_getstatic && field->is_constant()) { - if (SharkValue::from_ciConstant(field->constant_value())) + if (SharkConstant::for_field(iter())->is_loaded()) break; } @@ -609,37 +608,6 @@ void SharkTopLevelBlock::handle_return(B builder()->CreateRetVoid(); } -Value *SharkTopLevelBlock::lookup_for_ldc() -{ - int index = iter()->get_constant_index(); - constantTag tag = target()->holder()->constant_pool_tag_at(index); - - SharkConstantPool constants(this); - Value *entry = constants.object_at(index); - - Value *klass_part; - switch (tag.value()) { - case JVM_CONSTANT_String: - return entry; - - case JVM_CONSTANT_Class: - klass_part = builder()->CreateAddressOfStructEntry( - entry, - in_ByteSize(klassOopDesc::klass_part_offset_in_bytes()), - SharkType::klass_type(), - "klass_part"); - // XXX FIXME: We need a memory barrier before this load - return builder()->CreateValueOfStructEntry( - klass_part, - in_ByteSize(Klass::java_mirror_offset_in_bytes()), - SharkType::oop_type(), - "java_mirror"); - - default: - ShouldNotReachHere(); - } -} - Value* SharkTopLevelBlock::lookup_for_field_access() { SharkConstantPool constants(this); diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu Jun 04 09:48:19 2009 -0400 @@ -222,7 +222,6 @@ class SharkTopLevelBlock : public SharkB // Helpers private: - llvm::Value* lookup_for_ldc(); llvm::Value* lookup_for_field_access(); void do_branch(int successor_index); diff -r 724f230eea38 -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkValue.hpp --- a/ports/hotspot/src/share/vm/shark/sharkValue.hpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkValue.hpp Thu Jun 04 09:48:19 2009 -0400 @@ -146,45 +146,6 @@ class SharkValue : public ResourceObj { } static inline SharkValue* address_constant(int bci); - // Typed conversion from HotSpot ciConstants - public: - static SharkValue* from_ciConstant(ciConstant value) - { - switch (value.basic_type()) { - case T_BOOLEAN: - return SharkValue::jint_constant(value.as_boolean()); - - case T_BYTE: - return SharkValue::jint_constant(value.as_byte()); - - case T_CHAR: - return SharkValue::jint_constant(value.as_char()); - - case T_SHORT: - return SharkValue::jint_constant(value.as_short()); - - case T_INT: - return SharkValue::jint_constant(value.as_int()); - - case T_LONG: - return SharkValue::jlong_constant(value.as_long()); - - case T_FLOAT: - return SharkValue::jfloat_constant(value.as_float()); - - case T_DOUBLE: - return SharkValue::jdouble_constant(value.as_double()); - - case T_OBJECT: From gbenson at redhat.com Thu Jun 4 06:55:14 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 4 Jun 2009 14:55:14 +0100 Subject: Shark ldc improvements Message-ID: <20090604135514.GC3156@redhat.com> Hi all, This commit replaced the interpreter-style lookup of class and string constants in ldc and friends with inlined oops using the code I wrote yesterday. getfield and getstatic also use the code, for constant fields, so they've been altered too, although the way HotSpot lays things out means that getfield and getstatic never inline constants (they get loaded from the object instead...) Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 724f230eea38 ChangeLog --- a/ChangeLog Wed Jun 03 11:15:36 2009 -0400 +++ b/ChangeLog Thu Jun 04 09:47:24 2009 -0400 @@ -1,3 +1,32 @@ +2009-06-04 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkConstant.hpp: New file. + * ports/hotspot/src/share/vm/shark/sharkConstant.cpp: Likewise. + + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp + (SharkBlock::lookup_for_ldc): Removed. + (SharkBlock::do_ldc): Likewise. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp + (SharkBlock::parse_bytecode): Use new code for ldc and friends. + (SharkBlock::do_field_access): Use new code for constant fields. + (SharkBlock::lookup_for_ldc): Removed. + + * ports/hotspot/src/share/vm/shark/sharkInliner.cpp + (SharkInlinerHelper::is_inlinable): Use new code for ldc and friends. + (SharkInlinerHelper::do_field_access): Use new code for constant fields. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::lookup_for_ldc): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Use new code to for ldc and + constant field traps. + (SharkTopLevelBlock::lookup_for_ldc): Removed. + + * ports/hotspot/src/share/vm/shark/sharkValue.hpp + (SharkValue::from_ciConstant): Removed. + + * ports/hotspot/src/share/vm/includeDB_shark: Updated. + 2009-06-03 Gary Benson * ports/hotspot/src/share/vm/shark/sharkCodeBuffer.hpp: diff -r 724f230eea38 ports/hotspot/src/share/vm/includeDB_shark --- a/ports/hotspot/src/share/vm/includeDB_shark Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Thu Jun 04 09:47:24 2009 -0400 @@ -73,6 +73,7 @@ sharkBlock.cpp shark_globals.hpp sharkBlock.cpp sharkBlock.hpp sharkBlock.cpp sharkBuilder.hpp +sharkBlock.cpp sharkConstant.hpp sharkBlock.cpp sharkRuntime.hpp sharkBlock.cpp sharkState.inline.hpp sharkBlock.cpp sharkValue.hpp @@ -83,6 +84,7 @@ sharkBlock.hpp debug.hpp sharkBlock.hpp llvmHeaders.hpp sharkBlock.hpp sharkBuilder.hpp +sharkBlock.hpp sharkConstant.hpp sharkBlock.hpp sharkState.hpp sharkBlock.hpp sharkValue.hpp @@ -158,6 +160,16 @@ sharkCompiler.hpp llvmHeaders.hpp sharkCompiler.hpp sharkMemoryManager.hpp +sharkConstant.cpp ciStreams.hpp +sharkConstant.cpp sharkBuilder.hpp +sharkConstant.cpp sharkConstant.hpp +sharkConstant.cpp sharkValue.hpp + +sharkConstant.hpp allocation.hpp +sharkConstant.hpp ciStreams.hpp +sharkConstant.hpp sharkBuilder.hpp +sharkConstant.hpp sharkValue.hpp + sharkConstantPool.cpp allocation.hpp sharkConstantPool.cpp constantPoolOop.hpp sharkConstantPool.cpp cpCacheOop.hpp @@ -215,6 +227,7 @@ sharkInliner.cpp ciMethod.hpp sharkInliner.cpp ciStreams.hpp sharkInliner.cpp shark_globals.hpp +sharkInliner.cpp sharkConstant.hpp sharkInliner.cpp sharkInliner.hpp sharkInliner.cpp sharkIntrinsics.hpp sharkInliner.cpp sharkState.inline.hpp @@ -302,6 +315,7 @@ sharkTopLevelBlock.cpp shark_globals.hpp sharkTopLevelBlock.cpp sharkTopLevelBlock.hpp sharkTopLevelBlock.cpp sharkBuilder.hpp +sharkTopLevelBlock.cpp sharkConstant.hpp sharkTopLevelBlock.cpp sharkConstantPool.hpp sharkTopLevelBlock.cpp sharkInliner.hpp sharkTopLevelBlock.cpp sharkRuntime.hpp diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Thu Jun 04 09:47:24 2009 -0400 @@ -163,7 +163,7 @@ case Bytecodes::_ldc: case Bytecodes::_ldc_w: case Bytecodes::_ldc2_w: - do_ldc(); + push(SharkConstant::for_ldc(iter())->value(builder())); break; case Bytecodes::_iload_0: @@ -996,7 +996,9 @@ object = value->generic_value(); } if (is_get && field->is_constant()) { - value = SharkValue::from_ciConstant(field->constant_value()); + SharkConstant *constant = SharkConstant::for_field(iter()); + if (constant->is_loaded()) + value = constant->value(builder()); } if (!is_get || value == NULL) { if (!is_field) @@ -1163,11 +1165,6 @@ ShouldNotCallThis(); } -Value* SharkBlock::lookup_for_ldc() -{ - ShouldNotCallThis(); -} - Value* SharkBlock::lookup_for_field_access() { ShouldNotCallThis(); diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Thu Jun 04 09:47:24 2009 -0400 @@ -202,7 +202,6 @@ // Helpers protected: virtual void do_zero_check(SharkValue* value); - virtual llvm::Value* lookup_for_ldc(); virtual llvm::Value* lookup_for_field_access(); // Leaf calls @@ -239,16 +238,6 @@ virtual int trap_request(); virtual int trap_bci(); virtual void do_trap(int trap_request); - - // ldc* - private: - void do_ldc() - { - SharkValue *value = SharkValue::from_ciConstant(iter()->get_constant()); - if (value == NULL) - value = SharkValue::create_jobject(lookup_for_ldc(), true); - push(value); - } // arraylength protected: diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkConstant.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkConstant.cpp Thu Jun 04 09:47:24 2009 -0400 @@ -0,0 +1,121 @@ +/* + * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +#include "incls/_precompiled.incl" +#include "incls/_sharkConstant.cpp.incl" + +using namespace llvm; + +SharkConstant* SharkConstant::for_ldc(ciBytecodeStream *iter) +{ + return new SharkConstant(iter->get_constant(), NULL); +} + +SharkConstant* SharkConstant::for_field(ciBytecodeStream *iter) +{ + bool will_link; + ciField *field = iter->get_field(will_link); + assert(will_link, "typeflow responsibility"); + + return new SharkConstant(field->constant_value(), field->type()); +} + +SharkConstant::SharkConstant(ciConstant constant, ciType *type) +{ + SharkValue *value = NULL; + + switch (constant.basic_type()) { + case T_BOOLEAN: + case T_BYTE: + case T_CHAR: + case T_SHORT: + case T_INT: + value = SharkValue::jint_constant(constant.as_int()); + break; + + case T_LONG: + value = SharkValue::jlong_constant(constant.as_long()); + break; + + case T_FLOAT: + value = SharkValue::jfloat_constant(constant.as_float()); + break; + + case T_DOUBLE: + value = SharkValue::jdouble_constant(constant.as_double()); + break; + + case T_OBJECT: + case T_ARRAY: + break; + + case T_ILLEGAL: + // out of memory + _is_loaded = false; + return; + + default: + tty->print_cr("Unhandled type %s", type2name(constant.basic_type())); + ShouldNotReachHere(); + } + + // Handle primitive types. We create SharkValues for these + // now; doing so doesn't emit any code, and it allows us to + // delegate a bunch of stuff to the SharkValue code. + if (value) { + _value = value; + _is_loaded = true; + _is_nonzero = value->zero_checked(); + _is_two_word = value->is_two_word(); + return; + } + + // Handle reference types. This is tricky because some + // ciObjects are psuedo-objects that refer to oops which + // have yet to be created. We need to spot the unloaded + // objects (which differ between ldc* and get*, thanks!) + ciObject *object = constant.as_object(); + if (object->is_klass()) { + // The constant returned for a klass is the ciKlass + // for the entry, but we want the java_mirror. + ciKlass *klass = object->as_klass(); + if (!klass->is_loaded()) { + _is_loaded = false; + return; + } + object = klass->java_mirror(); + } + if (object->is_null_object() || !object->has_encoding()) { + _is_loaded = false; + return; + } + + _value = NULL; + _object = object; + _type = type ? type : ciType::make(T_OBJECT); + _is_loaded = true; + _is_nonzero = true; + _is_two_word = false; +} diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkConstant.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ports/hotspot/src/share/vm/shark/sharkConstant.hpp Thu Jun 04 09:47:24 2009 -0400 @@ -0,0 +1,68 @@ +/* + * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +class SharkConstant : public ResourceObj { + public: + static SharkConstant* for_ldc(ciBytecodeStream* iter); + static SharkConstant* for_field(ciBytecodeStream* iter); + + private: + SharkConstant(ciConstant constant, ciType* type); + + private: + SharkValue* _value; + ciObject* _object; + ciType* _type; + bool _is_loaded; + bool _is_nonzero; + bool _is_two_word; + + public: + bool is_loaded() const + { + return _is_loaded; + } + bool is_nonzero() const + { + assert(is_loaded(), "should be"); + return _is_nonzero; + } + bool is_two_word() const + { + assert(is_loaded(), "should be"); + return _is_two_word; + } + + public: + SharkValue* value(SharkBuilder* builder) + { + assert(is_loaded(), "should be"); + if (_value == NULL) { + _value = SharkValue::create_generic( + _type, builder->CreateInlineOop(_object), _is_nonzero); + } + return _value; + } +}; diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkInliner.cpp --- a/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Thu Jun 04 09:47:24 2009 -0400 @@ -267,7 +267,7 @@ ResourceMark rm; initialize_for_check(); - SharkValue *sv; + SharkConstant *sc; bool a, b, c, d; iter()->reset_to_bci(0); @@ -323,11 +323,11 @@ case Bytecodes::_ldc: case Bytecodes::_ldc_w: case Bytecodes::_ldc2_w: - sv = SharkValue::from_ciConstant(iter()->get_constant()); - if (sv == NULL) + sc = SharkConstant::for_ldc(iter()); + if (!sc->is_loaded()) return false; - push(sv->zero_checked()); - if (sv->is_two_word()) + push(sc->is_nonzero()); + if (sc->is_two_word()) push(false); break; @@ -753,9 +753,9 @@ if (is_get) { bool result_pushed = false; if (field->is_constant()) { - SharkValue *value = SharkValue::from_ciConstant(field->constant_value()); - if (value != NULL) { - push(value->zero_checked()); + SharkConstant *sc = SharkConstant::for_field(iter()); + if (sc->is_loaded()) { + push(sc->is_nonzero()); result_pushed = true; } } diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 09:47:24 2009 -0400 @@ -48,7 +48,7 @@ switch (bc()) { case Bytecodes::_ldc: case Bytecodes::_ldc_w: - if (iter()->is_unresolved_string() || iter()->is_unresolved_klass()) { + if (!SharkConstant::for_ldc(iter())->is_loaded()) { set_trap( Deoptimization::make_trap_request( Deoptimization::Reason_uninitialized, @@ -80,10 +80,9 @@ if (is_field) break; - // There won't be a pool access if this is a getstatic that - // resolves to a handled constant either + // There won't be a pool access if this is a constant getstatic if (bc() == Bytecodes::_getstatic && field->is_constant()) { - if (SharkValue::from_ciConstant(field->constant_value())) + if (SharkConstant::for_field(iter())->is_loaded()) break; } @@ -607,37 +606,6 @@ } builder()->CreateRetVoid(); -} - -Value *SharkTopLevelBlock::lookup_for_ldc() -{ - int index = iter()->get_constant_index(); - constantTag tag = target()->holder()->constant_pool_tag_at(index); - - SharkConstantPool constants(this); - Value *entry = constants.object_at(index); - - Value *klass_part; - switch (tag.value()) { - case JVM_CONSTANT_String: - return entry; - - case JVM_CONSTANT_Class: - klass_part = builder()->CreateAddressOfStructEntry( - entry, - in_ByteSize(klassOopDesc::klass_part_offset_in_bytes()), - SharkType::klass_type(), - "klass_part"); - // XXX FIXME: We need a memory barrier before this load - return builder()->CreateValueOfStructEntry( - klass_part, - in_ByteSize(Klass::java_mirror_offset_in_bytes()), - SharkType::oop_type(), - "java_mirror"); - - default: - ShouldNotReachHere(); - } } Value* SharkTopLevelBlock::lookup_for_field_access() diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu Jun 04 09:47:24 2009 -0400 @@ -222,7 +222,6 @@ // Helpers private: - llvm::Value* lookup_for_ldc(); llvm::Value* lookup_for_field_access(); void do_branch(int successor_index); diff -r 724f230eea38 ports/hotspot/src/share/vm/shark/sharkValue.hpp --- a/ports/hotspot/src/share/vm/shark/sharkValue.hpp Wed Jun 03 11:15:36 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkValue.hpp Thu Jun 04 09:47:24 2009 -0400 @@ -145,45 +145,6 @@ return create_jobject(LLVMValue::null(), false); } static inline SharkValue* address_constant(int bci); - - // Typed conversion from HotSpot ciConstants - public: - static SharkValue* from_ciConstant(ciConstant value) - { - switch (value.basic_type()) { - case T_BOOLEAN: - return SharkValue::jint_constant(value.as_boolean()); - - case T_BYTE: - return SharkValue::jint_constant(value.as_byte()); - - case T_CHAR: - return SharkValue::jint_constant(value.as_char()); - - case T_SHORT: - return SharkValue::jint_constant(value.as_short()); - - case T_INT: - return SharkValue::jint_constant(value.as_int()); - - case T_LONG: - return SharkValue::jlong_constant(value.as_long()); - - case T_FLOAT: - return SharkValue::jfloat_constant(value.as_float()); - - case T_DOUBLE: - return SharkValue::jdouble_constant(value.as_double()); - - case T_OBJECT: - case T_ARRAY: - return NULL; - - default: - tty->print_cr("Unhandled type %s", type2name(value.basic_type())); - ShouldNotReachHere(); - } - } // Type-losing conversions -- use with care! public: From omajid at redhat.com Thu Jun 4 07:37:04 2009 From: omajid at redhat.com (Omair Majid) Date: Thu, 04 Jun 2009 10:37:04 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <20090603180752.GB21904@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> <20090603180752.GB21904@redhat.com> Message-ID: <4A27DC10.9070600@redhat.com> Deepak Bhole wrote: > * Omair Majid [2009-06-03 13:41]: > > Looks good. Couple of things though: > > 1. getForksAlowed() is spelled incorrectly.. Fixed. > 2. There is a lot of unnecessary wrapping/unwrapping going on with the > whole convert array to list, add to list, convert list to array and > iterate over array. Why not just change initialArgs to be a list, and > then just use that list everywhere and iterate over it when launching the > new vm? Does the new patch look ok? ChangeLog: 2009-06-04 Omair Majid * rt/net/sourceforge/jnlp/JNLPFile.java (needsNewJVM): New function. Returns true if the JNLP file requires creating a new JVM. (getNewVMArgs): New function. Returns arguments to pass to the new JVM. * rt/net/sourceforge/jnlp/Launcher.java (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to the Java program. Try to use the local file to launch this instance if possible. (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to the Java program. Launch Netx with the with the appropriate arguments. (launchApplication): If needed, launch a new JVM and pass along the Netx arguments. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add BXnofork. * rt/net/sourceforge/jnlp/runtime/Boot/java: Add -Xnofork to helpMessage (main): Check for '-Xnofork'. Set initial arguments. * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add forksAllowed to store whether creating a new JVM is allowed. Add initialArguments to store the arguments to Netx. (getForksAllowed): New function. Check if creating a new JVM is allowed. (setForksAllowed): New function. Set whether creating a JVM is allowed. (setInitialArguments): New function. Store the arguments to Netx. (getInitialArguments): New function. Return the arguments passed to Netx. * rt/net/sourceforge/jnlp/services/XBasicService.java (showDocument): Fix call to launchExternal to match the new semantics. Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jvm-args.patch Type: text/x-patch Size: 12869 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090604/236aad18/attachment.bin From gbenson at redhat.com Thu Jun 4 08:09:20 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 04 Jun 2009 15:09:20 +0000 Subject: changeset in /hg/icedtea6: 2009-06-04 Gary Benson changeset 2a14fec2301f in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=2a14fec2301f description: 2009-06-04 Gary Benson * ports/hotspot/src/share/vm/shark/sharkBlock.hpp (SharkBlock::lookup_for_field_access): Removed. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp (SharkBlock::do_field_access): Inline receiver for static fields. (SharkBlock::lookup_for_field_access): Removed. * ports/hotspot/src/share/vm/shark/sharkInliner.cpp (SharkInlinerHelper::do_field_access): Allow static fields. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkBlock::lookup_for_field_access): Removed. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::scan_for_traps): Removed static field traps. (SharkBlock::lookup_for_field_access): Removed. diffstat: 6 files changed, 22 insertions(+), 41 deletions(-) ChangeLog | 17 ++++++++++ ports/hotspot/src/share/vm/shark/sharkBlock.cpp | 7 ---- ports/hotspot/src/share/vm/shark/sharkBlock.hpp | 1 ports/hotspot/src/share/vm/shark/sharkInliner.cpp | 8 +--- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 25 --------------- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 5 +-- diffs (134 lines): diff -r 89bd8e0f38c5 -r 2a14fec2301f ChangeLog --- a/ChangeLog Thu Jun 04 09:48:19 2009 -0400 +++ b/ChangeLog Thu Jun 04 11:07:53 2009 -0400 @@ -1,3 +1,20 @@ 2009-06-04 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp + (SharkBlock::lookup_for_field_access): Removed. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp + (SharkBlock::do_field_access): Inline receiver for static fields. + (SharkBlock::lookup_for_field_access): Removed. + + * ports/hotspot/src/share/vm/shark/sharkInliner.cpp + (SharkInlinerHelper::do_field_access): Allow static fields. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkBlock::lookup_for_field_access): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Removed static field traps. + (SharkBlock::lookup_for_field_access): Removed. + 2009-06-04 Gary Benson * ports/hotspot/src/share/vm/shark/sharkConstant.hpp: New file. diff -r 89bd8e0f38c5 -r 2a14fec2301f ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Thu Jun 04 11:07:53 2009 -0400 @@ -1002,7 +1002,7 @@ void SharkBlock::do_field_access(bool is } if (!is_get || value == NULL) { if (!is_field) - object = lookup_for_field_access(); + object = builder()->CreateInlineOop(field->holder()); BasicType basic_type = field->type()->basic_type(); const Type *stack_type = SharkType::to_stackType(basic_type); @@ -1165,11 +1165,6 @@ void SharkBlock::do_trap(int trap_reques ShouldNotCallThis(); } -Value* SharkBlock::lookup_for_field_access() -{ - ShouldNotCallThis(); -} - void SharkBlock::do_arraylength() { ShouldNotCallThis(); diff -r 89bd8e0f38c5 -r 2a14fec2301f ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Thu Jun 04 11:07:53 2009 -0400 @@ -202,7 +202,6 @@ class SharkBlock : public ResourceObj { // Helpers protected: virtual void do_zero_check(SharkValue* value); - virtual llvm::Value* lookup_for_field_access(); // Leaf calls protected: diff -r 89bd8e0f38c5 -r 2a14fec2301f ports/hotspot/src/share/vm/shark/sharkInliner.cpp --- a/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Thu Jun 04 11:07:53 2009 -0400 @@ -760,12 +760,8 @@ bool SharkInlinerHelper::do_field_access } } - if (!result_pushed) { - if (!is_field) - return false; - - push(false); - } + if (!result_pushed) + push(false); if (field->type()->is_two_word()) push(false); diff -r 89bd8e0f38c5 -r 2a14fec2301f ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 11:07:53 2009 -0400 @@ -74,20 +74,6 @@ void SharkTopLevelBlock::scan_for_traps( Deoptimization::Action_none), bci()); return; } - - // If this is a getfield or putfield then there won't be a - // pool access and we're done - if (is_field) - break; - - // There won't be a pool access if this is a constant getstatic - if (bc() == Bytecodes::_getstatic && field->is_constant()) { - if (SharkConstant::for_field(iter())->is_loaded()) - break; - } - - // Continue to the check - index = iter()->get_field_index(); break; case Bytecodes::_invokevirtual: @@ -608,17 +594,6 @@ void SharkTopLevelBlock::handle_return(B builder()->CreateRetVoid(); } -Value* SharkTopLevelBlock::lookup_for_field_access() -{ - SharkConstantPool constants(this); - Value *cache = constants.cache_entry_at(iter()->get_field_index()); - - return builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f1_offset(), - SharkType::jobject_type(), - "object"); -} - void SharkTopLevelBlock::do_arraylength() { SharkValue *array = pop(); diff -r 89bd8e0f38c5 -r 2a14fec2301f ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu Jun 04 11:07:53 2009 -0400 @@ -220,9 +220,8 @@ class SharkTopLevelBlock : public SharkB public: void emit_IR(); - // Helpers - private: - llvm::Value* lookup_for_field_access(); + // Branch helpers + private: void do_branch(int successor_index); // Zero checks From gbenson at redhat.com Thu Jun 4 08:13:35 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 4 Jun 2009 16:13:35 +0100 Subject: Shark getstatic and putstatic improvements Message-ID: <20090604151335.GD3156@redhat.com> Hi all, This commit replaced the interpreter-style constant pool lookup of the receiving class for getstatic and putstatic with inlined oops. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 89bd8e0f38c5 ChangeLog --- a/ChangeLog Thu Jun 04 09:48:19 2009 -0400 +++ b/ChangeLog Thu Jun 04 11:07:23 2009 -0400 @@ -1,3 +1,20 @@ +2009-06-04 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp + (SharkBlock::lookup_for_field_access): Removed. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp + (SharkBlock::do_field_access): Inline receiver for static fields. + (SharkBlock::lookup_for_field_access): Removed. + + * ports/hotspot/src/share/vm/shark/sharkInliner.cpp + (SharkInlinerHelper::do_field_access): Allow static fields. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkBlock::lookup_for_field_access): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Removed static field traps. + (SharkBlock::lookup_for_field_access): Removed. + 2009-06-04 Gary Benson * ports/hotspot/src/share/vm/shark/sharkConstant.hpp: New file. diff -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Thu Jun 04 11:07:23 2009 -0400 @@ -1002,7 +1002,7 @@ } if (!is_get || value == NULL) { if (!is_field) - object = lookup_for_field_access(); + object = builder()->CreateInlineOop(field->holder()); BasicType basic_type = field->type()->basic_type(); const Type *stack_type = SharkType::to_stackType(basic_type); @@ -1165,11 +1165,6 @@ ShouldNotCallThis(); } -Value* SharkBlock::lookup_for_field_access() -{ - ShouldNotCallThis(); -} - void SharkBlock::do_arraylength() { ShouldNotCallThis(); diff -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Thu Jun 04 11:07:23 2009 -0400 @@ -202,7 +202,6 @@ // Helpers protected: virtual void do_zero_check(SharkValue* value); - virtual llvm::Value* lookup_for_field_access(); // Leaf calls protected: diff -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkInliner.cpp --- a/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkInliner.cpp Thu Jun 04 11:07:23 2009 -0400 @@ -760,12 +760,8 @@ } } - if (!result_pushed) { - if (!is_field) - return false; - + if (!result_pushed) push(false); - } if (field->type()->is_two_word()) push(false); diff -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 11:07:23 2009 -0400 @@ -74,20 +74,6 @@ Deoptimization::Action_none), bci()); return; } - - // If this is a getfield or putfield then there won't be a - // pool access and we're done - if (is_field) - break; - - // There won't be a pool access if this is a constant getstatic - if (bc() == Bytecodes::_getstatic && field->is_constant()) { - if (SharkConstant::for_field(iter())->is_loaded()) - break; - } - - // Continue to the check - index = iter()->get_field_index(); break; case Bytecodes::_invokevirtual: @@ -606,17 +592,6 @@ } builder()->CreateRetVoid(); -} - -Value* SharkTopLevelBlock::lookup_for_field_access() -{ - SharkConstantPool constants(this); - Value *cache = constants.cache_entry_at(iter()->get_field_index()); - - return builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f1_offset(), - SharkType::jobject_type(), - "object"); } void SharkTopLevelBlock::do_arraylength() diff -r 89bd8e0f38c5 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu Jun 04 09:48:19 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Thu Jun 04 11:07:23 2009 -0400 @@ -220,9 +220,8 @@ public: void emit_IR(); - // Helpers + // Branch helpers private: - llvm::Value* lookup_for_field_access(); void do_branch(int successor_index); // Zero checks From gnu_andrew at member.fsf.org Thu Jun 4 09:10:29 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Thu, 4 Jun 2009 17:10:29 +0100 Subject: JAXWS build problem - Darwin/PowerPC/Zero In-Reply-To: <860cb0120906031229of68779fw2ad329ce2d7e60f6@mail.gmail.com> References: <860cb0120906031229of68779fw2ad329ce2d7e60f6@mail.gmail.com> Message-ID: <17c6771e0906040910l12dbab3ave661f8f5417dbaab@mail.gmail.com> 2009/6/3 Eric Richardson : > Hi, > > I get the following error. In the release notes in says JIBX is not needed. > > ERROR: You do not have access to valid JIBX library files. \n?????? Please > check your access to \n > /NOT-SET/devtools/share/jibx/lib/jibx-run.jar \n?????? and/or check your > value of ALT_JDK_DEVTOOLS_DIR, ALT_JIBX_LIBS_PATH \n > Exiting because of the above error(s). \n > make[1]: *** [post-sanity] Error 1 > make: *** [stamps/icedtea-ecj.stamp] Error 2 > > I tried this which will at least get me to the jaxws build - jaxp compiles. > > > make ALT_OUTPUTDIR=`pwd`/build/bsd-ppc ALT_FREETYPE_LIB_PATH=/opt/local/lib > ALT_FREETYPE_HEADERS_PATH=/opt/local/include > ALT_JIBX_LIBS_PATH=/Users/eric/java/jibx-1.2.1/lib LIBARCH=ppc ARCH=ppc > ARCH_FAMILY=ppc ARCH_DATA_MODEL=32 > > It fails like this below and the appropriate class is in the stax-api.jar in > the jibx lib dir. > > build-classes: > ??? [javac] Compiling 2425 source files to > /Users/eric/java/icedtea-1.10/build/bsd-ppc/jaxws/build/classes > ??? [javac] > /Users/eric/java/icedtea-1.10/openjdk-ecj/jaxws/src/share/classes/com/sun/istack/internal/XMLStreamException2.java:27: > package javax.xml.stream does not exist > ??? [javac] import javax.xml.stream.XMLStreamException; > > I looked at both the Makefile which calls the Ant build.xml and neither > refer to any classpath so I assume that the missing classes need to somehow > be in the bootclasspath for the jvm/javac. I also try the configure option > --with-jibx with no luck. > > ./configure --enable-zero=yes --with-project=bsd > --with-gcj-home=/Users/eric/jdk1.5 > --with-ecj-jar=/opt/local/share/java/eclipse-ecj.jar > --with-xalan2-jar=/opt/local/share/java/xalan.jar > --with-xalan2-serializer-jar=/opt/local/share/java/serializer.jar > --with-xerces2-jar=/opt/local/share/java/xercesImpl.jar > --with-jibx=/Users/eric/java/jibx-1.2.1? --without-rhino --disable-plugin > --disable-xrender > > Any help appreciated, > Eric > > > > Disabling it in IcedTea relies on the DISABLE_NIMBUS changeset which is only so far in the IcedTea and build forests. The BSD folks are welcome to pull it into their repo, and it will appear in 7 itself once things start to move forward. Basically, if you're using a different tree (via --with-project or some other mechanism), all bets are off as to how things will work as they are based on the default tree and options :) I expect the local Nimbus patch will have broken too prior to this as it removes a DISABLE_NIMBUS block to give Nimbus (via the generated files in IcedTea) without JIBX (the tool build and generation is still disabled). Your JIBX is too new. You need 1.1.5. It can be downloaded via jibx.sourceforge.net. If you do --disable-nimbus-generation (which is what you're getting with the broken patch anyway), the IcedTea configure will check for the JAR files and make available the directory OpenJDK needs. IcedTea takes paths to the three needed jars and passes OpenJDK $(top_builddir)/jibx which contains bcel.jar, xpp3.jar, jibx-run.jar and jibx-bind.jar. You shouldn't have a stax-api.jar. That's already part of the JDK. If you let IcedTea do the directory from wherever you or your distro installed JIBX, then it will do a clean directory with only the needed JAR files. Long term, most IcedTea stuff will be going upstream, including Zero so it may just appear in the BSD tree anyway at some point :) -- 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 Alan.Bateman at Sun.COM Thu Jun 4 09:58:20 2009 From: Alan.Bateman at Sun.COM (Alan Bateman) Date: Thu, 04 Jun 2009 17:58:20 +0100 Subject: Setting public TestEnv defaults for net/nio tests needing hosts In-Reply-To: <1244121598.3565.21.camel@hermans.wildebeest.org> References: <1226790321.3805.12.camel@dijkstra.wildebeest.org> <1244121598.3565.21.camel@hermans.wildebeest.org> Message-ID: <4A27FD2C.7030804@sun.com> Mark Wielaard wrote: > : > The jdk6 and jdk7 environments are still somewhat dissimilar, but thanks > to Andrew Hughes the patches have been ported to make sure they also > work on jdk7 out of the box by default using just public hosts without > the need to change anything in your test environment locally. Attached > is the patch against jdk7. > > I also filed (the jdk6 version) in bugzilla so it doesn't get forgotten: > https://bugs.openjdk.java.net/show_bug.cgi?id=100066 > > Thanks, > > Mark > It's been on my list to forward-port the TestEnv and test updates to jdk7 (just haven't got to it yet). The idea with that was that jtreg would be run with a properties file that listed the hosts that the tests depend on (eg: jtreg -e JTREG_TESTENV=openjdk-hosts.properties). We (meaning Joe and I) kinda hoped that would be preferable to patching TestEnv but maybe this isn't the case. Changing these tests to not depend on the telnet port is a good idea as it is hard to find systems with that legacy service enabled. Changing the defaults to hosts outside of Sun is reasonable in principle but this is going to cause disruption for our test teams when running on test systems that will not be able to connect to these systems. I need to check into this and also to see if openjdk.java.net systems could be used, or maybe just re-visit these tests to not depend on other hosts. -Alan. From mark at klomp.org Thu Jun 4 10:27:50 2009 From: mark at klomp.org (Mark Wielaard) Date: Thu, 04 Jun 2009 19:27:50 +0200 Subject: Setting public TestEnv defaults for net/nio tests needing hosts In-Reply-To: <4A27FD2C.7030804@sun.com> References: <1226790321.3805.12.camel@dijkstra.wildebeest.org> <1244121598.3565.21.camel@hermans.wildebeest.org> <4A27FD2C.7030804@sun.com> Message-ID: <1244136471.3565.29.camel@hermans.wildebeest.org> Hi Alan, On Thu, 2009-06-04 at 17:58 +0100, Alan Bateman wrote: > It's been on my list to forward-port the TestEnv and test updates to > jdk7 (just haven't got to it yet). Thanks. > The idea with that was that jtreg > would be run with a properties file that listed the hosts that the tests > depend on (eg: jtreg -e JTREG_TESTENV=openjdk-hosts.properties). We > (meaning Joe and I) kinda hoped that would be preferable to patching > TestEnv but maybe this isn't the case. That is preferable. That is actually why I made the change. So that no editing or setting or properties was needed by default, unless you needed a set different from the public defaults. > Changing these tests to not > depend on the telnet port is a good idea as it is hard to find systems > with that legacy service enabled. Changing the defaults to hosts outside > of Sun is reasonable in principle but this is going to cause disruption > for our test teams when running on test systems that will not be able to > connect to these systems. I need to check into this and also to see if > openjdk.java.net systems could be used, or maybe just re-visit these > tests to not depend on other hosts. Yes, making this as easy as possible for anybody running the tests, so in principle you don't have to changed or edited anything was the goal. So the real changes are just to use one standard (echo) port to make it easier to switch hosts. Make cname.sh not use a hardcoded host. And then set the defaults so that they work for everybody out of the box against a set of publicly available machines. Then only people needing to do tests against non-public machines have to change any settings. Cheers, Mark From omajid at redhat.com Thu Jun 4 11:51:15 2009 From: omajid at redhat.com (Omair Majid) Date: Thu, 04 Jun 2009 14:51:15 -0400 Subject: RFC: Make javax.jnlp package visible to javac Message-ID: <4A2817A3.2070807@redhat.com> Hi, Sun's documentation states that javac should be able to compile code that uses javax.jnlp once jnlp.jar is added to the classpath [1]. IcedTea6, however, has no jnlp.jar, and javax.jnlp.* classes are already in rt.jar. It turns out that you have to use 'javac -XDignore.symbol.file OnlineTest.java' for this to work [2]. The attached patch adds javax.jnlp to NON_CORE_PKGS list, making it visible to javac. ChangeLog: 2009-06-04 Omair Majid * patches/icedtea-webstart.patch: Make javax.jnlp classes visible. Ok to commit? Cheers, Omair [1] http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/examples.html#Introduction [2] http://andrew-haley.livejournal.com/695.html -------------- next part -------------- A non-text attachment was scrubbed... Name: icedtea6-make-javax-jnlp-visible.patch Type: text/x-patch Size: 947 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090604/7db6dc81/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: OnlineTest.java Type: text/x-java Size: 402 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090604/7db6dc81/attachment-0001.bin From dbhole at redhat.com Thu Jun 4 14:47:22 2009 From: dbhole at redhat.com (Deepak Bhole) Date: Thu, 4 Jun 2009 17:47:22 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <4A27DC10.9070600@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> <20090603180752.GB21904@redhat.com> <4A27DC10.9070600@redhat.com> Message-ID: <20090604214722.GA29542@redhat.com> * Omair Majid [2009-06-04 10:37]: > Deepak Bhole wrote: >> * Omair Majid [2009-06-03 13:41]: >> >> Looks good. Couple of things though: >> >> 1. getForksAlowed() is spelled incorrectly.. > Fixed. > >> 2. There is a lot of unnecessary wrapping/unwrapping going on with the >> whole convert array to list, add to list, convert list to array and >> iterate over array. Why not just change initialArgs to be a list, and >> then just use that list everywhere and iterate over it when launching the >> new vm? > Does the new patch look ok? > Yep, looks good. Please go ahead and apply. One minor thing you may want to consider btw... put a securitymanager AllPermissions() check inside setInitialArguments(). Only trusted code would have all perms. The reason for this is that initialArgs are used to launch another process, and one could in theory perhaps mangle them. Again though, this is totally optional because I honestly cannot come up with any way to exploit it, given how the code is laid out. So I leave it upto you. Thanks! Deepak > ChangeLog: > 2009-06-04 Omair Majid > > * rt/net/sourceforge/jnlp/JNLPFile.java > (needsNewJVM): New function. Returns true if the JNLP file requires > creating a new JVM. > (getNewVMArgs): New function. Returns arguments to pass to the new > JVM. > * rt/net/sourceforge/jnlp/Launcher.java > (launchExternal): Modify to take in arguments to pass to the JVM and > arguments to pass to the Java program. Try to use the local file to > launch this instance if possible. > (launchExternal): Modify to take in arguments to pass to the JVM and > arguments to pass to the Java program. Launch Netx with the with the > appropriate arguments. > (launchApplication): If needed, launch a new JVM and pass along the > Netx arguments. > * rt/net/sourceforge/jnlp/resources/Messages.properties: > Add BXnofork. > * rt/net/sourceforge/jnlp/runtime/Boot/java: > Add -Xnofork to helpMessage > (main): Check for '-Xnofork'. Set initial arguments. > * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: > Add forksAllowed to store whether creating a new JVM is allowed. Add > initialArguments to store the arguments to Netx. > (getForksAllowed): New function. Check if creating a new JVM is > allowed. > (setForksAllowed): New function. Set whether creating a JVM is > allowed. > (setInitialArguments): New function. Store the arguments to Netx. > (getInitialArguments): New function. Return the arguments passed to > Netx. > * rt/net/sourceforge/jnlp/services/XBasicService.java > (showDocument): Fix call to launchExternal to match the new > semantics. > > > Cheers, > Omair From ekrichardson at gmail.com Thu Jun 4 17:08:51 2009 From: ekrichardson at gmail.com (Eric Richardson) Date: Thu, 4 Jun 2009 17:08:51 -0700 Subject: Mac OS X - Power PC Build Progress In-Reply-To: References: <860cb0120906011556o5f7c48c7n36c8224380858173@mail.gmail.com> Message-ID: <860cb0120906041708s67004300k8c92f02f43e67969@mail.gmail.com> Michael, Yes, there were only a couple of patches that patch the same file and less than half the number of patches compared to your experience. The patch cleanup effort has made the distro significantly easier as well as the effort to push patches upstream. Eric On Wed, Jun 3, 2009 at 3:51 PM, Michael Franz wrote: > Eric, > > Were you able to work through all the patches? > > Michael > > > On Mon, Jun 1, 2009 at 6:56 PM, Eric Richardson wrote: > >> Hi All, >> >> I made another try at building Icedtea-1.10 yesterday. I have been able to >> work through all the patches. Some files are being worked on by multiple >> patches. I have kept track but need to go through my notes before I report >> my findings and diffs. >> >> The basic problem I am having now is that MacOSX on PowerPC reports as >> "Power Macintosh" so the default configure comes out to be bsd-Power >> Macintosh. I use ALT_OUTPUTDIR to get the make started. >> >> This machine has a ppc970 processor so should it be as >> defaulted(ARCH_DATA_MODEL=64)? Note: ZERO_ARCHFLAG=-m32 shown below. >> >> The core build is defaulting back to 'Power Macintosh' and the spaces seem >> to be causing problems. Here are the possible offending vars from the output >> below: ARCH = Power Macintosh\n LIBARCH = Power Macintosh\n ARCH_FAMILY = >> Power Macintosh\n >> Error follows. >> >> >>>Recursively making core build @ Mon Jun 1 00:26:52 PDT 2009 ... >> ../../../common/Rules.gmk:263: warning: overriding commands for target >> `Macintosh' >> ../../../common/Rules.gmk:49: warning: ignoring old commands for target >> `Macintosh' >> ../../../common/Library.gmk:67: *** target file >> `/Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/lib/Power' has both : >> and :: entries. Stop. >> make[5]: *** [build] Error 1 >> make[4]: *** [build] Error 1 >> make[3]: *** [build] Error 1 >> make[2]: *** [corba-build] Error 2 >> make[1]: *** [build_product_image] Error 2 >> make: *** [stamps/icedtea-ecj.stamp] Error 2 >> >> I have no idea how far I made it but it is much better than before. Any >> pointers to the appropriate place to adjust the build is appreciated. >> >> Eric >> >> >> Commands and some Output follows - may be a bit out of order as it was >> late ------------------------------ >> >> ./autogen.sh >> >> ./configure --enable-zero=yes --with-project=bsd >> --with-gcj-home=/Users/eric/jdk1.5 >> --with-ecj-jar=/opt/local/share/java/eclipse-ecj.jar >> --with-xalan2-jar=/opt/local/share/java/xalan.jar >> --with-xalan2-serializer-jar=/opt/local/share/java/serializer.jar >> --with-xerces2-jar=/opt/local/share/java/xercesImpl.jar --without-rhino >> --disable-plugin --disable-xrender >> >> make ALT_OUTPUTDIR=`pwd`/build/bsd-macosx >> ALT_FREETYPE_LIB_PATH=/opt/local/lib >> ALT_FREETYPE_HEADERS_PATH=/opt/local/include >> ALT_JIBX_LIBS_PATH=/Users/eric/java/jibx-1.2.1/lib >> >> >> >> /usr/bin/make \ >> >> "ALT_JDK_IMPORT_PATH=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0" >> "ANT_HOME=/usr/share/ant" "BUILD_NUMBER=b59" "JDK_UPDATE_VERSION=0" >> "JRE_RELEASE_VERSION=1.7.0_0-b59" "MILESTONE=fcs" "LANG=C" >> "PATH=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin::$PATH" >> "ALT_BOOTDIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0" >> "BUILD_ARCH_DIR=ppc" >> "ICEDTEA_RT=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar" >> "ICEDTEA_BUILD_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/" >> "ICEDTEA_CLS_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes" >> "ICEDTEA_ENDORSED_DIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/lib/endorsed" >> "ENDORSED=-Djava.endorsed.dirs=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/lib/endorsed" >> "BOOTCLASSPATH_CLS_RT=-bootclasspath >> /Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes:/Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar" >> "BOOTCLASSPATH_CLS=-bootclasspath >> /Users/eric/java/icedtea-1.10/openjdk-ecj/build/bsd-ppc/classes" >> "BOOTCLASSPATH_RT_LIBGCJ=-bootclasspath >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.7.0/jre/lib/rt-closed.jar:/Users/eric/jdk1.5/jre/lib/rt.jar" >> "CLASSPATH=" "LD_LIBRARY_PATH=" >> "GENSRCDIR=/Users/eric/java/icedtea-1.10/generated" "ICEDTEA_CORE_BUILD=yes" >> "ICEDTEA_ZERO_BUILD=yes" "ICEDTEA_SHARK_BUILD=" "ZERO_LIBARCH=ppc" >> "ZERO_BITSPERWORD=32" "ZERO_ENDIANNESS=big" "ZERO_ARCHDEF=PPC" >> "ZERO_ARCHFLAG=-m32" "LIBFFI_CFLAGS=-I/opt/local/lib/libffi-3.0.6/include " >> "LIBFFI_LIBS=-L/opt/local/lib -lffi " "LLVM_CFLAGS=" "LLVM_LDFLAGS=" >> "LLVM_LIBS=" "FREETYPE2_HEADERS=-I/opt/local/include/freetype2 >> -I/opt/local/include " "FT2_LIB=-L/opt/local/lib -lfreetype -lz " >> "ALT_PARALLEL_COMPILE_JOBS=2" "HOTSPOT_BUILD_JOBS=2" "JAVAC=" "RHINO_JAR=no" >> "JAR_KNOWS_ATFILE=1" "JAR_KNOWS_J_OPTIONS=1" "JAR_ACCEPTS_STDIN_LIST=" >> "DISABLE_NIMBUS=true" >> "ALT_NETX_DIST=/Users/eric/java/icedtea-1.10/netx.build" >> "ALT_LIVECONNECT_DIST=/Users/eric/java/icedtea-1.10" \ >> -C openjdk-ecj \ >> >> Control bsd Power Macintosh 1.7.0_0-bsd all build started: >> ( cd ./jdk/make && \ >> /usr/bin/make sanity HOTSPOT_IMPORT_CHECK=false >> JDK_TOPDIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk >> JDK_MAKE_SHARED_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk/make/common/shared >> EXTERNALSANITYCONTROL=true TARGET_CLASS_VERSION=5 MILESTONE=fcs >> BUILD_NUMBER=b59 JDK_BUILD_NUMBER=b59 FULL_VERSION=1.7.0_0-bsd-b59 >> PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0_0 JDK_MKTG_VERSION=7u >> JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 >> PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 >> ARCH_DATA_MODEL=64 COOKED_JDK_UPDATE_VERSION=0 COOKED_BUILD_NUMBER=59 >> ANT_HOME="/usr/share/ant" >> ALT_OUTPUTDIR=/Users/eric/java/icedtea-1.10/build/bsd-macosx >> ALT_LANGTOOLS_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist >> ALT_CORBA_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/dist >> ALT_JAXP_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxp/dist >> ALT_JAXWS_DIST=/Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxws/dist >> ALT_HOTSPOT_IMPORT_PATH=/Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import >> BUILD_HOTSPOT=true ; ) >> >> Build Machine Information: >> build machine = new-host.home >> >> Build Directory Structure: >> CWD = /Users/eric/java/icedtea-1.10/openjdk-ecj >> TOPDIR = . >> CONTROL_TOPDIR = . >> LANGTOOLS_TOPDIR = ./langtools >> JAXP_TOPDIR = ./jaxp >> JAXWS_TOPDIR = ./jaxws >> CORBA_TOPDIR = ./corba >> HOTSPOT_TOPDIR = ./hotspot >> JDK_TOPDIR = ./jdk >> >> Build Directives: >> BUILD_LANGTOOLS = true >> BUILD_JAXP = true >> BUILD_JAXWS = true >> BUILD_CORBA = true >> BUILD_HOTSPOT = true >> BUILD_JDK = true >> >> Hotspot Settings: \n HOTSPOT_BUILD_JOBS = 2 \n >> HOTSPOT_OUTPUTDIR = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/outputdir \n >> HOTSPOT_EXPORT_PATH = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import \n \n >> >> \nBootstrap Settings:\n BOOTDIR = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n ALT_BOOTDIR = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n BOOT_VER = 1.5.0 >> [requires at least 1.5]\n OUTPUTDIR = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx\n ALT_OUTPUTDIR = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx\n ABS_OUTPUTDIR = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx\n \nBuild Tool Settings:\n >> SLASH_JAVA = /NOT-SET\n ALT_SLASH_JAVA = \n VARIANT = OPT\n >> JDK_DEVTOOLS_DIR = /NOT-SET/devtools\n ALT_JDK_DEVTOOLS_DIR = \n >> ANT_HOME = /usr/share/ant\n UNIXCOMMAND_PATH = /bin/\n >> ALT_UNIXCOMMAND_PATH = \n COMPILER_PATH = /usr/bin/\n ALT_COMPILER_PATH >> = \n DEVTOOLS_PATH = /opt/local/bin/\n ALT_DEVTOOLS_PATH = \n >> COMPILER_NAME = GCC4\n COMPILER_VERSION = GCC4\n CC_VER = 4.0.1 [requires >> at least 3.2]\n ZIP_VER = 2.32 [requires at least 2.2]\n UNZIP_VER = 5.52 >> [requires at least 5.12]\n ANT_VER = 1.7.0 [requires at least 1.6.3]\n >> TEMPDIR = /Users/eric/java/icedtea-1.10/build/bsd-macosx/tmp\n \nBuild >> Directives:\n OPENJDK = true\n USE_HOTSPOT_INTERPRETER_MODE = \n PEDANTIC >> = \n DEV_ONLY = \n NO_DOCS = \n NO_IMAGES = \n TOOLS_ONLY = \n INSANE = >> \n COMPILE_APPROACH = parallel\n PARALLEL_COMPILE_JOBS = 2\n >> ALT_PARALLEL_COMPILE_JOBS = 2\n FASTDEBUG = \n COMPILER_WARNINGS_FATAL = >> false\n COMPILER_WARNING_LEVEL = \n INCREMENTAL_BUILD = false\n >> CC_HIGHEST_OPT = \n CC_HIGHER_OPT = \n CC_LOWER_OPT = \n CXXFLAGS = -O2 >> -fPIC -DCC_NOEX -W -Wall -Wno-unused -Wno-parentheses \n CFLAGS = -O2 >> -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses \n >> BOOT_JAVA_CMD = /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/java >> -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx896m >> -Xms128m -XX:PermSize=32m -XX:MaxPermSize=160m\n BOOT_JAVAC_CMD = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/javac >> -J-XX:ThreadStackSize=1536 -J-XX:-PrintVMOptions >> -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput -J-Xmx896m -J-Xms128m >> -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii >> -XDignore.symbol.file=true\n BOOT_JAR_CMD = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/jar\n >> BOOT_JARSIGNER_CMD = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/jarsigner\n JAVAC_CMD >> = \n JAVAH_CMD = \n JAVADOC_CMD = \n \nBuild Platform Settings:\n USER = >> eric\n PLATFORM = bsd\n ARCH = Power Macintosh\n LIBARCH = Power >> Macintosh\n ARCH_FAMILY = Power Macintosh\n ARCH_DATA_MODEL = 64\n >> ARCHPROP = Power Macintosh\n OS_VERSION = 9.6.0 [requires at least 8.0]\n >> OS_VARIANT_NAME = \n OS_VARIANT_VERSION = \n TEMP_FREE_SPACE = >> 312319584\n FREE_SPACE = 312319584\n MB_OF_MEMORY = 1024\n \nGNU Make >> Settings:\n MAKE = /usr/bin/make\n MAKE_VER = 3.81 [requires at least >> 3.78]\n MAKECMDGOALS = sanity\n MAKEFLAGS = \n SHELL = /bin/sh\n \nTarget >> Build Versions:\n JDK_VERSION = 1.7.0_0\n MILESTONE = fcs\n RELEASE = >> 1.7.0_0-bsd\n FULL_VERSION = 1.7.0_0-bsd-b59\n BUILD_NUMBER = b59\n >> \nExternal File/Binary Locations:\n USRJDKINSTANCES_PATH = /opt/local\n >> BUILD_JDK_IMPORT_PATH = >> /NOT-SET/re/jdk/1.7.0_0/promoted/latest/binaries\n >> ALT_BUILD_JDK_IMPORT_PATH = \n JDK_IMPORT_PATH = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n ALT_JDK_IMPORT_PATH = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n LANGTOOLS_DIST = \n >> ALT_LANGTOOLS_DIST = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist\n CORBA_DIST >> = \n ALT_CORBA_DIST = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/corba/dist\n JAXP_DIST = >> \n ALT_JAXP_DIST = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxp/dist\n JAXWS_DIST = >> \n ALT_JAXWS_DIST = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/jaxws/dist\n >> HOTSPOT_DOCS_IMPORT_PATH = /NO_DOCS_DIR\n ALT_HOTSPOT_DOCS_IMPORT_PATH = >> \n HOTSPOT_IMPORT_PATH = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import\n >> ALT_HOTSPOT_IMPORT_PATH = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import\n >> HOTSPOT_SERVER_PATH = >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/hotspot/import/jre/lib/Power >> Macintosh/server\n ALT_HOTSPOT_SERVER_PATH = \n CACERTS_FILE = >> ./../src/share/lib/security/cacerts\n ALT_CACERTS_FILE = \n >> JIBX_LIBS_PATH = /Users/eric/java/jibx-1.2.1/lib\n ALT_JIBX_LIBS_PATH = >> /Users/eric/java/jibx-1.2.1/lib\n CUPS_HEADERS_PATH = /usr/include\n >> ALT_CUPS_HEADERS_PATH = \n \nOpenJDK-specific settings:\n >> FREETYPE_HEADERS_PATH = /opt/local/include\n ALT_FREETYPE_HEADERS_PATH = >> /opt/local/include\n FREETYPE_LIB_PATH = /opt/local/lib\n >> ALT_FREETYPE_LIB_PATH = /opt/local/lib\n X11_PATH = /usr/X11R6\n >> ALT_X11_PATH = \n \nOPENJDK Import Binary Plug Settings:\n >> IMPORT_BINARY_PLUGS = \n BINARY_PLUGS_JARFILE = >> /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs/bsd-Power >> Macintosh/jre/lib/rt-closed.jar\n ALT_BINARY_PLUGS_JARFILE = \n >> BINARY_PLUGS_PATH = >> /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs/bsd-Power >> Macintosh\n ALT_BINARY_PLUGS_PATH = \n BUILD_BINARY_PLUGS_PATH = >> /NOT-SET/re/jdk/1.7.0_0/promoted/latest/openjdk/binaryplugs\n >> ALT_BUILD_BINARY_PLUGS_PATH = \n PLUG_LIBRARY_NAMES = \n \nPrevious JDK >> Settings:\n PREVIOUS_RELEASE_PATH = USING-PREVIOUS_RELEASE_IMAGE\n >> ALT_PREVIOUS_RELEASE_PATH = \n PREVIOUS_JDK_VERSION = 1.6.0\n >> ALT_PREVIOUS_JDK_VERSION = \n PREVIOUS_JDK_FILE = \n >> ALT_PREVIOUS_JDK_FILE = \n PREVIOUS_JRE_FILE = \n ALT_PREVIOUS_JRE_FILE >> = \n PREVIOUS_RELEASE_IMAGE = >> /Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0\n >> ALT_PREVIOUS_RELEASE_IMAGE = \n >> >> Sanity check passed. >> Control bsd Power Macintosh 1.7.0_0-bsd all_product_build build started: >> Control bsd Power Macintosh 1.7.0_0-bsd build_product_image build started: >> >> /usr/bin/make \ >> SKIP_FASTDEBUG_BUILD=true \ >> SKIP_DEBUG_BUILD=true \ >> \ >> generic_build_repo_series >> /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx >> /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx/j2sdk-image >> /bin/mkdir -p /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools >> (cd ./langtools/make && \ >> /usr/bin/make >> JDK_TOPDIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk >> JDK_MAKE_SHARED_DIR=/Users/eric/java/icedtea-1.10/openjdk-ecj/jdk/make/common/shared >> EXTERNALSANITYCONTROL=true TARGET_CLASS_VERSION=5 MILESTONE=fcs >> BUILD_NUMBER=b59 JDK_BUILD_NUMBER=b59 FULL_VERSION=1.7.0_0-bsd-b59 >> PREVIOUS_JDK_VERSION=1.6.0 JDK_VERSION=1.7.0_0 JDK_MKTG_VERSION=7u >> JDK_MAJOR_VERSION=1 JDK_MINOR_VERSION=7 JDK_MICRO_VERSION=0 >> PREVIOUS_MAJOR_VERSION=1 PREVIOUS_MINOR_VERSION=6 PREVIOUS_MICRO_VERSION=0 >> ARCH_DATA_MODEL=64 COOKED_JDK_UPDATE_VERSION=0 COOKED_BUILD_NUMBER=59 >> ANT_HOME="/usr/share/ant" >> ALT_OUTPUTDIR=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools >> ALT_BOOTDIR=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0 all) >> ANT_OPTS=-Djava.io.tmpdir='/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-tmp' >> ant -diagnostics > >> /Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-diagnostics.log >> ANT_OPTS=-Djava.io.tmpdir='/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build/ant-tmp' >> ant -Djdk.version=1.7.0_0 -Dfull.version='1.7.0_0-bsd-b59' >> -Drelease=1.7.0_0 -Dbuild.number=b59 -Djavac.target=5 >> -Dboot.java.home=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0 >> -Djavac.executable=/Users/eric/java/icedtea-1.10/bootstrap/jdk1.6.0/bin/javac >> -Dbuild.dir=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/build >> -Ddist.dir=/Users/eric/java/icedtea-1.10/build/bsd-macosx/langtools/dist >> build >> Buildfile: build.xml >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090604/0810581d/attachment.html From gnu_andrew at member.fsf.org Thu Jun 4 17:49:34 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 5 Jun 2009 01:49:34 +0100 Subject: RFC: Make javax.jnlp package visible to javac In-Reply-To: <4A2817A3.2070807@redhat.com> References: <4A2817A3.2070807@redhat.com> Message-ID: <17c6771e0906041749u5e01ae27u27e8261c9717d42c@mail.gmail.com> 2009/6/4 Omair Majid : > Hi, > > Sun's documentation states that javac should be able to compile code that > uses javax.jnlp once jnlp.jar is added to the classpath [1]. IcedTea6, > however, has no jnlp.jar, and javax.jnlp.* classes are already in rt.jar. It > turns out that you have to use 'javac -XDignore.symbol.file OnlineTest.java' > for this to work [2]. > > The attached patch adds javax.jnlp to NON_CORE_PKGS list, making it visible > to javac. > > ChangeLog: > 2009-06-04 ?Omair Majid ? > > ? ?* patches/icedtea-webstart.patch: Make javax.jnlp classes visible. > > Ok to commit? > > Cheers, > Omair > > > [1] > http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/examples.html#Introduction > [2] http://andrew-haley.livejournal.com/695.html > Looks good to me (though seems strange the Makefile is under docs...). Did we ever work out if there was a good reason for keeping this symbol mapping stuff? -- 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 gbenson at redhat.com Fri Jun 5 03:48:45 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 05 Jun 2009 10:48:45 +0000 Subject: changeset in /hg/icedtea6: 2009-06-05 Gary Benson changeset 4dbf479c5609 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=4dbf479c5609 description: 2009-06-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::do_new): Removed constant pool lookup. (SharkTopLevelBlock::scan_for_traps): Add traps for new. diffstat: 2 files changed, 35 insertions(+), 16 deletions(-) ChangeLog | 6 ++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 45 +++++++++------ diffs (121 lines): diff -r 2a14fec2301f -r 4dbf479c5609 ChangeLog --- a/ChangeLog Thu Jun 04 11:07:53 2009 -0400 +++ b/ChangeLog Fri Jun 05 06:47:14 2009 -0400 @@ -1,3 +1,9 @@ 2009-06-04 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::do_new): Removed constant pool lookup. + (SharkTopLevelBlock::scan_for_traps): Add traps for new. + 2009-06-04 Gary Benson * ports/hotspot/src/share/vm/shark/sharkBlock.hpp diff -r 2a14fec2301f -r 4dbf479c5609 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 11:07:53 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 06:47:14 2009 -0400 @@ -40,6 +40,7 @@ void SharkTopLevelBlock::scan_for_traps( ciField *field; ciMethod *method; + ciInstanceKlass *klass; bool will_link; bool is_field; @@ -98,6 +99,30 @@ void SharkTopLevelBlock::scan_for_traps( // Continue to the check index = iter()->get_method_index(); + break; + + case Bytecodes::_new: + klass = iter()->get_klass(will_link)->as_instance_klass(); + assert(will_link, "typeflow responsibility"); + + // Bail out if the class is unloaded + if (iter()->is_unresolved_klass() || !klass->is_initialized()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_uninitialized, + Deoptimization::Action_reinterpret), bci()); + return; + } + + // Bail out if the class cannot be instantiated + if (klass->is_abstract() || klass->is_interface() || + klass->name() == ciSymbol::java_lang_Class()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_unhandled, + Deoptimization::Action_reinterpret), bci()); + return; + } break; } @@ -1291,7 +1316,6 @@ void SharkTopLevelBlock::do_new() ciInstanceKlass* klass = iter()->get_klass(will_link)->as_instance_klass(); assert(will_link, "typeflow responsibility"); - BasicBlock *tlab_alloc = NULL; BasicBlock *got_tlab = NULL; BasicBlock *heap_alloc = NULL; BasicBlock *retry = NULL; @@ -1310,33 +1334,22 @@ void SharkTopLevelBlock::do_new() Value *slow_object = NULL; Value *object = NULL; - SharkConstantPool constants(this); - // The fast path if (!Klass::layout_helper_needs_slow_path(klass->layout_helper())) { if (UseTLAB) { - tlab_alloc = function()->CreateBlock("tlab_alloc"); got_tlab = function()->CreateBlock("got_tlab"); + heap_alloc = function()->CreateBlock("heap_alloc"); } - heap_alloc = function()->CreateBlock("heap_alloc"); retry = function()->CreateBlock("retry"); got_heap = function()->CreateBlock("got_heap"); initialize = function()->CreateBlock("initialize"); slow_alloc_and_init = function()->CreateBlock("slow_alloc_and_init"); push_object = function()->CreateBlock("push_object"); - builder()->CreateCondBr( - builder()->CreateICmpEQ( - constants.tag_at(iter()->get_klass_index()), - LLVMValue::jbyte_constant(JVM_CONSTANT_Class)), - UseTLAB ? tlab_alloc : heap_alloc, slow_alloc_and_init); - size_t size_in_bytes = klass->size_helper() << LogHeapWordSize; // Thread local allocation if (UseTLAB) { - builder()->SetInsertPoint(tlab_alloc); - Value *top_addr = builder()->CreateAddressOfStructEntry( thread(), Thread::tlab_top_offset(), PointerType::getUnqual(SharkType::intptr_type()), @@ -1361,11 +1374,11 @@ void SharkTopLevelBlock::do_new() builder()->CreateStore(new_top, top_addr); builder()->CreateBr(initialize); + + builder()->SetInsertPoint(heap_alloc); } // Heap allocation - builder()->SetInsertPoint(heap_alloc); - Value *top_addr = builder()->CreateIntToPtr( builder()->pointer_constant(Universe::heap()->top_addr()), PointerType::getUnqual(SharkType::intptr_type()), @@ -1438,7 +1451,7 @@ void SharkTopLevelBlock::do_new() builder()->CreateStore(LLVMValue::intptr_constant(mark), mark_addr); // Set the class - Value *rtklass = constants.object_at(iter()->get_klass_index()); + Value *rtklass = builder()->CreateInlineOop(klass); builder()->CreateStore(rtklass, klass_addr); got_fast = builder()->GetInsertBlock(); From gbenson at redhat.com Fri Jun 5 03:53:24 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 5 Jun 2009 11:53:24 +0100 Subject: Shark new improvements Message-ID: <20090605105323.GA3171@redhat.com> Hi all, This commit replaces the interpreter-style constant pool lookup of class to be instantiated in the "new" bytecode with an inlined oop. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 2a14fec2301f -r 4dbf479c5609 ChangeLog --- a/ChangeLog Thu Jun 04 11:07:53 2009 -0400 +++ b/ChangeLog Fri Jun 05 06:47:14 2009 -0400 @@ -1,3 +1,9 @@ +2009-06-05 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::do_new): Removed constant pool lookup. + (SharkTopLevelBlock::scan_for_traps): Add traps for new. + 2009-06-04 Gary Benson * ports/hotspot/src/share/vm/shark/sharkBlock.hpp diff -r 2a14fec2301f -r 4dbf479c5609 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Thu Jun 04 11:07:53 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 06:47:14 2009 -0400 @@ -40,6 +40,7 @@ ciField *field; ciMethod *method; + ciInstanceKlass *klass; bool will_link; bool is_field; @@ -98,6 +99,30 @@ // Continue to the check index = iter()->get_method_index(); + break; + + case Bytecodes::_new: + klass = iter()->get_klass(will_link)->as_instance_klass(); + assert(will_link, "typeflow responsibility"); + + // Bail out if the class is unloaded + if (iter()->is_unresolved_klass() || !klass->is_initialized()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_uninitialized, + Deoptimization::Action_reinterpret), bci()); + return; + } + + // Bail out if the class cannot be instantiated + if (klass->is_abstract() || klass->is_interface() || + klass->name() == ciSymbol::java_lang_Class()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_unhandled, + Deoptimization::Action_reinterpret), bci()); + return; + } break; } @@ -1291,7 +1316,6 @@ ciInstanceKlass* klass = iter()->get_klass(will_link)->as_instance_klass(); assert(will_link, "typeflow responsibility"); - BasicBlock *tlab_alloc = NULL; BasicBlock *got_tlab = NULL; BasicBlock *heap_alloc = NULL; BasicBlock *retry = NULL; @@ -1310,33 +1334,22 @@ Value *slow_object = NULL; Value *object = NULL; - SharkConstantPool constants(this); - // The fast path if (!Klass::layout_helper_needs_slow_path(klass->layout_helper())) { if (UseTLAB) { - tlab_alloc = function()->CreateBlock("tlab_alloc"); got_tlab = function()->CreateBlock("got_tlab"); + heap_alloc = function()->CreateBlock("heap_alloc"); } - heap_alloc = function()->CreateBlock("heap_alloc"); retry = function()->CreateBlock("retry"); got_heap = function()->CreateBlock("got_heap"); initialize = function()->CreateBlock("initialize"); slow_alloc_and_init = function()->CreateBlock("slow_alloc_and_init"); push_object = function()->CreateBlock("push_object"); - builder()->CreateCondBr( - builder()->CreateICmpEQ( - constants.tag_at(iter()->get_klass_index()), - LLVMValue::jbyte_constant(JVM_CONSTANT_Class)), - UseTLAB ? tlab_alloc : heap_alloc, slow_alloc_and_init); - size_t size_in_bytes = klass->size_helper() << LogHeapWordSize; // Thread local allocation if (UseTLAB) { - builder()->SetInsertPoint(tlab_alloc); - Value *top_addr = builder()->CreateAddressOfStructEntry( thread(), Thread::tlab_top_offset(), PointerType::getUnqual(SharkType::intptr_type()), @@ -1361,11 +1374,11 @@ builder()->CreateStore(new_top, top_addr); builder()->CreateBr(initialize); + + builder()->SetInsertPoint(heap_alloc); } // Heap allocation - builder()->SetInsertPoint(heap_alloc); - Value *top_addr = builder()->CreateIntToPtr( builder()->pointer_constant(Universe::heap()->top_addr()), PointerType::getUnqual(SharkType::intptr_type()), @@ -1438,7 +1451,7 @@ builder()->CreateStore(LLVMValue::intptr_constant(mark), mark_addr); // Set the class - Value *rtklass = constants.object_at(iter()->get_klass_index()); + Value *rtklass = builder()->CreateInlineOop(klass); builder()->CreateStore(rtklass, klass_addr); got_fast = builder()->GetInsertBlock(); From gbenson at redhat.com Fri Jun 5 04:10:38 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 05 Jun 2009 11:10:38 +0000 Subject: changeset in /hg/icedtea6: 2009-06-05 Gary Benson changeset 20de96630f3a in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=20de96630f3a description: 2009-06-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::acquire_method_lock): Removed constant pool lookup. diffstat: 2 files changed, 13 insertions(+), 7 deletions(-) ChangeLog | 6 ++++++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 14 +++++++------- diffs (38 lines): diff -r 4dbf479c5609 -r 20de96630f3a ChangeLog --- a/ChangeLog Fri Jun 05 06:47:14 2009 -0400 +++ b/ChangeLog Fri Jun 05 12:12:00 2009 +0100 @@ -1,3 +1,9 @@ 2009-06-05 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::acquire_method_lock): Removed constant + pool lookup. + 2009-06-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp diff -r 4dbf479c5609 -r 20de96630f3a ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 06:47:14 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 12:12:00 2009 +0100 @@ -1563,14 +1563,14 @@ void SharkTopLevelBlock::do_multianewarr void SharkTopLevelBlock::acquire_method_lock() { + Value *lockee; + if (target()->is_static()) + lockee = builder()->CreateInlineOop(target()->holder()->java_mirror()); + else + lockee = local(0)->jobject_value(); + iter()->force_bci(start()); // for the decache in acquire_lock - if (target()->is_static()) { - SharkConstantPool constants(this); - acquire_lock(constants.java_mirror(), EX_CHECK_NO_CATCH); - } - else { - acquire_lock(local(0)->jobject_value(), EX_CHECK_NO_CATCH); - } + acquire_lock(lockee, EX_CHECK_NO_CATCH); } void SharkTopLevelBlock::do_monitorenter() From gbenson at redhat.com Fri Jun 5 05:18:51 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 05 Jun 2009 12:18:51 +0000 Subject: changeset in /hg/icedtea6: 2009-06-05 Gary Benson changeset 26ddf03b22c3 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=26ddf03b22c3 description: 2009-06-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::do_full_instance_check): Add class argument. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::do_instance_check): Removed constant pool check. (SharkTopLevelBlock::do_full_instance_check): Removed constant pool lookup. diffstat: 3 files changed, 20 insertions(+), 18 deletions(-) ChangeLog | 9 +++++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 27 +++++---------- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 2 - diffs (74 lines): diff -r 20de96630f3a -r 26ddf03b22c3 ChangeLog --- a/ChangeLog Fri Jun 05 12:12:00 2009 +0100 +++ b/ChangeLog Fri Jun 05 08:17:22 2009 -0400 @@ -1,3 +1,12 @@ 2009-06-05 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::do_full_instance_check): Add class argument. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::do_instance_check): Removed constant pool check. + (SharkTopLevelBlock::do_full_instance_check): Removed constant + pool lookup. + 2009-06-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp diff -r 20de96630f3a -r 26ddf03b22c3 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 12:12:00 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 08:17:22 2009 -0400 @@ -1166,23 +1166,17 @@ void SharkTopLevelBlock::do_call() void SharkTopLevelBlock::do_instance_check() { - constantTag tag = - target()->holder()->constant_pool_tag_at(iter()->get_klass_index()); - if (!tag.is_klass()) { - assert(tag.is_unresolved_klass(), "should be"); - do_trapping_instance_check(); - } - else { - do_full_instance_check(); - } -} - -void SharkTopLevelBlock::do_full_instance_check() -{ bool will_link; ciKlass *klass = iter()->get_klass(will_link); - assert(will_link, "should do"); - + + if (will_link) + do_full_instance_check(klass); + else + do_trapping_instance_check(); +} + +void SharkTopLevelBlock::do_full_instance_check(ciKlass* klass) +{ BasicBlock *not_null = function()->CreateBlock("not_null"); BasicBlock *subtype_check = function()->CreateBlock("subtype_check"); BasicBlock *is_instance = function()->CreateBlock("is_instance"); @@ -1208,8 +1202,7 @@ void SharkTopLevelBlock::do_full_instanc // Get the class we're checking against builder()->SetInsertPoint(not_null); - SharkConstantPool constants(this); - Value *check_klass = constants.object_at(iter()->get_klass_index()); + Value *check_klass = builder()->CreateInlineOop(klass); // Get the class of the object being tested Value *object_klass = builder()->CreateValueOfStructEntry( diff -r 20de96630f3a -r 26ddf03b22c3 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 12:12:00 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 08:17:22 2009 -0400 @@ -386,7 +386,7 @@ class SharkTopLevelBlock : public SharkB // checkcast and instanceof private: - void do_full_instance_check(); + void do_full_instance_check(ciKlass* klass); void do_trapping_instance_check(); void do_instance_check(); From gbenson at redhat.com Fri Jun 5 05:22:47 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 5 Jun 2009 13:22:47 +0100 Subject: Shark checkcast and instanceof improvements (part 1) Message-ID: <20090605122247.GB3171@redhat.com> Hi all, This commit replaces the interpreter-style constant pool lookup of the class to be checked against in the instanceof and checkcast bytecodes with an inlined oop. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r a2125c262913 ChangeLog --- a/ChangeLog Fri Jun 05 12:12:47 2009 +0100 +++ b/ChangeLog Fri Jun 05 13:21:26 2009 +0100 @@ -1,3 +1,12 @@ +2009-06-05 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::do_full_instance_check): Add class argument. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::do_instance_check): Removed constant pool check. + (SharkTopLevelBlock::do_full_instance_check): Removed constant + pool lookup. + 2009-06-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp diff -r a2125c262913 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 12:12:47 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 13:21:26 2009 +0100 @@ -1166,23 +1166,17 @@ void SharkTopLevelBlock::do_instance_check() { - constantTag tag = - target()->holder()->constant_pool_tag_at(iter()->get_klass_index()); - if (!tag.is_klass()) { - assert(tag.is_unresolved_klass(), "should be"); + bool will_link; + ciKlass *klass = iter()->get_klass(will_link); + + if (will_link) + do_full_instance_check(klass); + else do_trapping_instance_check(); - } - else { - do_full_instance_check(); - } } -void SharkTopLevelBlock::do_full_instance_check() +void SharkTopLevelBlock::do_full_instance_check(ciKlass* klass) { - bool will_link; - ciKlass *klass = iter()->get_klass(will_link); - assert(will_link, "should do"); - BasicBlock *not_null = function()->CreateBlock("not_null"); BasicBlock *subtype_check = function()->CreateBlock("subtype_check"); BasicBlock *is_instance = function()->CreateBlock("is_instance"); @@ -1208,8 +1202,7 @@ // Get the class we're checking against builder()->SetInsertPoint(not_null); - SharkConstantPool constants(this); - Value *check_klass = constants.object_at(iter()->get_klass_index()); + Value *check_klass = builder()->CreateInlineOop(klass); // Get the class of the object being tested Value *object_klass = builder()->CreateValueOfStructEntry( diff -r a2125c262913 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 12:12:47 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 13:21:26 2009 +0100 @@ -386,7 +386,7 @@ // checkcast and instanceof private: - void do_full_instance_check(); + void do_full_instance_check(ciKlass* klass); void do_trapping_instance_check(); void do_instance_check(); From omajid at redhat.com Fri Jun 5 06:40:18 2009 From: omajid at redhat.com (Omair Majid) Date: Fri, 05 Jun 2009 09:40:18 -0400 Subject: RFC: Make javax.jnlp package visible to javac In-Reply-To: <17c6771e0906041749u5e01ae27u27e8261c9717d42c@mail.gmail.com> References: <4A2817A3.2070807@redhat.com> <17c6771e0906041749u5e01ae27u27e8261c9717d42c@mail.gmail.com> Message-ID: <4A292042.50908@redhat.com> Andrew John Hughes wrote: > 2009/6/4 Omair Majid : >> Hi, >> >> Sun's documentation states that javac should be able to compile code that >> uses javax.jnlp once jnlp.jar is added to the classpath [1]. IcedTea6, >> however, has no jnlp.jar, and javax.jnlp.* classes are already in rt.jar. It >> turns out that you have to use 'javac -XDignore.symbol.file OnlineTest.java' >> for this to work [2]. >> >> The attached patch adds javax.jnlp to NON_CORE_PKGS list, making it visible >> to javac. >> >> ChangeLog: >> 2009-06-04 Omair Majid >> >> * patches/icedtea-webstart.patch: Make javax.jnlp classes visible. >> >> Ok to commit? >> >> Cheers, >> Omair >> >> >> [1] >> http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/examples.html#Introduction >> [2] http://andrew-haley.livejournal.com/695.html >> > > Looks good to me (though seems strange the Makefile is under docs...). I could move the Makefile in the patch ;) > > Did we ever work out if there was a good reason for keeping this > symbol mapping stuff? Nothing formally. If I recall correctly, Andrew Haley mentioned that it might make javac faster. Presumably anything not visible to javac is not really part of the Java API and there should be no need for programmers to use those classes (but this doesnt hold true for some parts of IcedTea). Cheers, Omair From gbenson at redhat.com Fri Jun 5 06:45:09 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 05 Jun 2009 13:45:09 +0000 Subject: changeset in /hg/icedtea6: 2009-06-06 Gary Benson changeset 2f2bbe3b693d in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=2f2bbe3b693d description: 2009-06-06 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::do_optimized_instance_check): New method. (SharkTopLevelBlock::do_full_instance_check): Add class argument. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::do_instance_check): Add compile time type checks. (SharkTopLevelBlock::do_optimized_instance_check): New method. (SharkTopLevelBlock::do_trapping_instance_check): Update the object with the new class if its a checkcast that passes. diffstat: 3 files changed, 65 insertions(+), 9 deletions(-) ChangeLog | 12 +++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 59 ++++++++++++--- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 3 diffs (119 lines): diff -r 26ddf03b22c3 -r 2f2bbe3b693d ChangeLog --- a/ChangeLog Fri Jun 05 08:17:22 2009 -0400 +++ b/ChangeLog Fri Jun 05 14:46:31 2009 +0100 @@ -1,3 +1,15 @@ 2009-06-05 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::do_optimized_instance_check): New method. + (SharkTopLevelBlock::do_full_instance_check): Add class argument. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::do_instance_check): Add compile time type + checks. + (SharkTopLevelBlock::do_optimized_instance_check): New method. + (SharkTopLevelBlock::do_trapping_instance_check): Update the + object with the new class if its a checkcast that passes. + 2009-06-05 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r 26ddf03b22c3 -r 2f2bbe3b693d ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 08:17:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 14:46:31 2009 +0100 @@ -1166,15 +1166,55 @@ void SharkTopLevelBlock::do_call() void SharkTopLevelBlock::do_instance_check() { + // Get the class we're checking against bool will_link; - ciKlass *klass = iter()->get_klass(will_link); - + ciKlass *check_klass = iter()->get_klass(will_link); + + // If the class we're checking against is java.lang.Object + // then this is a no brainer. Apparently this can happen + // in reflective code... + if (check_klass == function()->env()->Object_klass()) { + do_optimized_instance_check(); + return; + } + + // Get the class of the object we're checking + ciKlass *object_klass = xstack(0)->type()->as_klass(); + + // If the classes are defined enough now then we + // don't need a runtime check. NB opto's code for + // this (GraphKit::static_subtype_check) says we + // cannot trust static interface types yet, hence + // the extra check + if (!object_klass->is_interface()) { + if (object_klass == check_klass) { + do_optimized_instance_check(); + return; + } + + if (object_klass->is_loaded() && check_klass->is_loaded()) { + if (object_klass->is_subtype_of(check_klass)) { + do_optimized_instance_check(); + return; + } + } + } + + // Need to check this one at runtime if (will_link) - do_full_instance_check(klass); + do_full_instance_check(check_klass); else - do_trapping_instance_check(); -} - + do_trapping_instance_check(check_klass); +} + +void SharkTopLevelBlock::do_optimized_instance_check() +{ + if (bc() == Bytecodes::_instanceof) { + pop(); + push(SharkValue::jint_constant(1)); + } +} + void SharkTopLevelBlock::do_full_instance_check(ciKlass* klass) { BasicBlock *not_null = function()->CreateBlock("not_null"); @@ -1275,7 +1315,7 @@ void SharkTopLevelBlock::do_full_instanc } } -void SharkTopLevelBlock::do_trapping_instance_check() +void SharkTopLevelBlock::do_trapping_instance_check(ciKlass* klass) { BasicBlock *not_null = function()->CreateBlock("not_null"); BasicBlock *is_null = function()->CreateBlock("null"); @@ -1297,7 +1337,10 @@ void SharkTopLevelBlock::do_trapping_ins // If it's null then we're ok builder()->SetInsertPoint(is_null); set_current_state(saved_state); - if (bc() == Bytecodes::_instanceof) { + if (bc() == Bytecodes::_checkcast) { + push(SharkValue::create_generic(klass, pop()->jobject_value(), false)); + } + else { pop(); push(SharkValue::jint_constant(0)); } diff -r 26ddf03b22c3 -r 2f2bbe3b693d ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 08:17:22 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 14:46:31 2009 +0100 @@ -386,8 +386,9 @@ class SharkTopLevelBlock : public SharkB // checkcast and instanceof private: + void do_optimized_instance_check(); void do_full_instance_check(ciKlass* klass); - void do_trapping_instance_check(); + void do_trapping_instance_check(ciKlass* klass); void do_instance_check(); From gbenson at redhat.com Fri Jun 5 06:48:49 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 5 Jun 2009 14:48:49 +0100 Subject: Shark checkcast and instanceof improvements (part 2) Message-ID: <20090605134849.GC3171@redhat.com> Hi all, This commit adds some compile-time type checking to the instanceof and checkcast bytecodes. It doesn't actually do anything at the moment because of the way Shark handles state (see PR IcedTea/346) but hopefully I can change that soon. Cheers, Gary -- http://gbenson.net/ From omajid at redhat.com Fri Jun 5 07:37:13 2009 From: omajid at redhat.com (Omair Majid) Date: Fri, 05 Jun 2009 14:37:13 +0000 Subject: changeset in /hg/icedtea6: 2009-06-05 Omair Majid changeset 8ba2783ba3b0 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=8ba2783ba3b0 description: 2009-06-05 Omair Majid * patches/icedtea-webstart.patch: Make javax.jnlp package visible to javac. diffstat: 2 files changed, 23 insertions(+) ChangeLog | 5 +++++ patches/icedtea-webstart.patch | 18 ++++++++++++++++++ diffs (37 lines): diff -r 2f2bbe3b693d -r 8ba2783ba3b0 ChangeLog --- a/ChangeLog Fri Jun 05 14:46:31 2009 +0100 +++ b/ChangeLog Fri Jun 05 10:25:13 2009 -0400 @@ -1,3 +1,8 @@ 2009-06-06 Gary Benson + + * patches/icedtea-webstart.patch: Make javax.jnlp package visible to + javac. + 2009-06-06 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r 2f2bbe3b693d -r 8ba2783ba3b0 patches/icedtea-webstart.patch --- a/patches/icedtea-webstart.patch Fri Jun 05 14:46:31 2009 +0100 +++ b/patches/icedtea-webstart.patch Fri Jun 05 10:25:13 2009 -0400 @@ -117,3 +117,21 @@ diff -urN openjdk.orig/jdk/src/share/cla if (status != APPLET_DISPOSE) { showAppletStatus("notdisposed"); return; +--- openjdk/jdk/make/docs/NON_CORE_PKGS.gmk.orig 2009-06-04 11:02:18.000000000 -0400 ++++ openjdk/jdk/make/docs/NON_CORE_PKGS.gmk 2009-06-04 11:02:45.000000000 -0400 +@@ -84,6 +84,8 @@ + + SMARTCARDIO_PKGS = javax.smartcardio + ++JNLP_PKGS = javax.jnlp ++ + # non-core packages in rt.jar + NON_CORE_PKGS = $(DOMAPI_PKGS) \ + $(MGMT_PKGS) \ +@@ -91,4 +93,5 @@ + $(JGSS_PKGS) \ + $(OLD_JSSE_PKGS) \ + $(HTTPSERVER_PKGS) \ +- $(SMARTCARDIO_PKGS) ++ $(SMARTCARDIO_PKGS) \ ++ $(JNLP_PKGS) From ahughes at redhat.com Fri Jun 5 10:36:55 2009 From: ahughes at redhat.com (Andrew John Hughes) Date: Fri, 05 Jun 2009 17:36:55 +0000 Subject: changeset in /hg/icedtea: Fix CACAO build with GCC 4.4. Message-ID: changeset a5e05eb00fc3 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=a5e05eb00fc3 description: Fix CACAO build with GCC 4.4. 2009-05-27 Andrew John Hughes * HACKING: Updated. * Makefile.am: Add new patch, move openjdk7 patch to be with others. * patches/cacao/no-strict-aliasing.patch: New patch to fix CACAO build on GCC 4.4 (see PR129). * patches/cacao/openjdk7.patch: Fixed paths to match other patches. diffstat: 5 files changed, 35 insertions(+), 8 deletions(-) ChangeLog | 11 +++++++++++ HACKING | 11 +++++++---- Makefile.am | 5 +++-- patches/cacao/no-strict-aliasing.patch | 12 ++++++++++++ patches/cacao/openjdk7.patch | 4 ++-- diffs (96 lines): diff -r 123d98a5d278 -r a5e05eb00fc3 ChangeLog --- a/ChangeLog Wed Jun 03 16:41:46 2009 +0200 +++ b/ChangeLog Fri Jun 05 18:38:11 2009 +0100 @@ -1,3 +1,14 @@ 2009-06-03 Xerxes R??nby + + * HACKING: Updated. + * Makefile.am: + Add new patch, move openjdk7 patch to be + with others. + * patches/cacao/no-strict-aliasing.patch: + New patch to fix CACAO build on GCC 4.4 (see PR129). + * patches/cacao/openjdk7.patch: + Fixed paths to match other patches. + 2009-06-03 Xerxes R??nby Stefan Ring diff -r 123d98a5d278 -r a5e05eb00fc3 HACKING --- a/HACKING Wed Jun 03 16:41:46 2009 +0200 +++ b/HACKING Fri Jun 05 18:38:11 2009 +0100 @@ -71,10 +71,6 @@ The following patches are currently appl * icedtea-cc-interp-backedge.patch: Remove some duplicated code in DO_BACKEDGE_CHECKS. * icedtea-includedb.patch: Add missing include files. (S6793825, mostly applied in b47) * icedtea-xml-encodinginfo.patch: Fix possible StackOverflowError in EncodingInfo (PR295). -* cacao/launcher.patch: For the 'java' command, create new thread depending on the current VM. -* cacao/no-mmap-first-page.patch: Don't mmap the first memory page. -* cacao/native-resolve.patch: Changes CACAO resolution order for native methods. (cacao PR128). -* cacao/xxoption-warning.patch: Makes CACAO print warnings to stderr (cacao PR128). The following patches are only applied to OpenJDK6 in IcedTea6: @@ -141,6 +137,13 @@ The following patches are only applied w The following patches are only applied when building with the CACAO virtual machine: * cacao/ignore-tests.patch: Ignore tests known to fail on CACAO. +* cacao/launcher.patch: For the 'java' command, create new thread depending on the current VM. +* cacao/no-mmap-first-page.patch: Don't mmap the first memory page. +* cacao/native-resolve.patch: Changes CACAO resolution order for native methods. (cacao PR128). +* cacao/xxoption-warning.patch: Makes CACAO print warnings to stderr (cacao PR128). +* cacao/openjdk7.patch: Turn on java.c functions for OpenJDK7. +* cacao/no-strict-aliasing.patch: Turn off strict aliasing which causes an issue with the verifier + when building with GCC 4.4 (cacao PR129). The following patches are to support Xrender pipeline (-Dsun.java2d.xrender): diff -r 123d98a5d278 -r a5e05eb00fc3 Makefile.am --- a/Makefile.am Wed Jun 03 16:41:46 2009 +0200 +++ b/Makefile.am Fri Jun 05 18:38:11 2009 +0100 @@ -2089,7 +2089,9 @@ ICEDTEA_PATCHES += \ patches/cacao/launcher.patch \ patches/cacao/no-mmap-first-page.patch \ patches/cacao/native-resolve.patch \ - patches/cacao/xxoption-warning.patch + patches/cacao/xxoption-warning.patch \ + patches/cacao/no-strict-aliasing.patch \ + patches/cacao/openjdk7.patch endif if WITH_CACAO @@ -2248,7 +2250,6 @@ if !USE_SYSTEM_CACAO dir=$$(basename cacao/cacao-*) ; \ ln -s $$dir cacao/cacao ; \ cd cacao/cacao ; \ - $(PATCH) -l -p0 < $(abs_top_srcdir)/patches/cacao/openjdk7.patch ; \ cd .. ; \ fi endif diff -r 123d98a5d278 -r a5e05eb00fc3 patches/cacao/no-strict-aliasing.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/cacao/no-strict-aliasing.patch Fri Jun 05 18:38:11 2009 +0100 @@ -0,0 +1,12 @@ +diff -ur cacao-0.99.4.orig/configure cacao-0.99.4/configure +--- cacao.orig/cacao/configure 2009-03-16 12:44:25.000000000 +0100 ++++ cacao/cacao/configure 2009-06-05 17:58:48.000000000 +0200 +@@ -2825,7 +2825,7 @@ + + + if test x"$CFLAGS" = "x"; then +- OPT_CFLAGS="-g -O2" ++ OPT_CFLAGS="-g -O2 -fno-strict-aliasing" + else + OPT_CFLAGS=$CFLAGS + fi diff -r 123d98a5d278 -r a5e05eb00fc3 patches/cacao/openjdk7.patch --- a/patches/cacao/openjdk7.patch Wed Jun 03 16:41:46 2009 +0200 +++ b/patches/cacao/openjdk7.patch Fri Jun 05 18:38:11 2009 +0100 @@ -1,6 +1,6 @@ diff -Nru src.orig/native/vm/sun_misc_Un diff -Nru src.orig/native/vm/sun_misc_Unsafe.c src/native/vm/sun_misc_Unsafe.c ---- src.orig/native/vm/sun_misc_Unsafe.c 2009-03-19 17:31:38.000000000 +0000 -+++ src/native/vm/sun_misc_Unsafe.c 2009-03-19 17:34:57.000000000 +0000 +--- cacao/cacao/src.orig/native/vm/sun_misc_Unsafe.c 2009-03-19 17:31:38.000000000 +0000 ++++ cacao/cacao/src/native/vm/sun_misc_Unsafe.c 2009-03-19 17:34:57.000000000 +0000 @@ -104,14 +104,8 @@ { "putDouble", "(JD)V", (void *) (intptr_t) &Java_sun_misc_Unsafe_putDouble__JD }, { "objectFieldOffset", "(Ljava/lang/reflect/Field;)J", (void *) (intptr_t) &Java_sun_misc_Unsafe_objectFieldOffset }, From gbenson at redhat.com Fri Jun 5 11:10:06 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 05 Jun 2009 18:10:06 +0000 Subject: changeset in /hg/icedtea6: 2009-06-06 Gary Benson changeset afa643fbffde in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=afa643fbffde description: 2009-06-06 Gary Benson * ports/hotspot/src/share/vm/shark/sharkBlock.hpp (SharkBlock::maybe_do_instanceof_if): New method. * ports/hotspot/src/share/vm/shark/sharkBlock.cpp (SharkBlock::maybe_do_instanceof_if): New method. (SharkBlock::parse_bytecode): Use the above for instanceof immediately followed by ifeq or ifne. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::do_if_helper): New method. (SharkTopLevelBlock::static_subtype_check): Likewise. (SharkTopLevelBlock::maybe_do_instanceof_if): Likewise. (SharkTopLevelBlock::do_optimized_instance_check): Removed. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::do_if_helper): New method. (SharkTopLevelBlock::do_if): Use the above. (SharkTopLevelBlock::static_subtype_check): New method. (SharkTopLevelBlock::do_instance_check): Use the above. (SharkTopLevelBlock::maybe_do_instanceof_if): New method. (SharkTopLevelBlock::do_optimized_instance_check): Removed. (SharkTopLevelBlock::do_full_instance_check): Removed now-unnecessary state copy and merge. * ports/hotspot/src/share/vm/shark/sharkState.hpp (SharkState::replace_all): New method. * ports/hotspot/src/share/vm/shark/sharkState.cpp (SharkState::replace_all): Likewise. diffstat: 7 files changed, 205 insertions(+), 43 deletions(-) ChangeLog | 31 ++- ports/hotspot/src/share/vm/shark/sharkBlock.cpp | 37 +++ ports/hotspot/src/share/vm/shark/sharkBlock.hpp | 1 ports/hotspot/src/share/vm/shark/sharkState.cpp | 15 + ports/hotspot/src/share/vm/shark/sharkState.hpp | 4 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 152 +++++++++++---- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 8 diffs (385 lines): diff -r 8ba2783ba3b0 -r afa643fbffde ChangeLog --- a/ChangeLog Fri Jun 05 10:25:13 2009 -0400 +++ b/ChangeLog Fri Jun 05 19:11:26 2009 +0100 @@ -1,4 +1,33 @@ 2009-06-05 Omair Majid +2009-06-06 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp + (SharkBlock::maybe_do_instanceof_if): New method. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp + (SharkBlock::maybe_do_instanceof_if): New method. + (SharkBlock::parse_bytecode): Use the above for + instanceof immediately followed by ifeq or ifne. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::do_if_helper): New method. + (SharkTopLevelBlock::static_subtype_check): Likewise. + (SharkTopLevelBlock::maybe_do_instanceof_if): Likewise. + (SharkTopLevelBlock::do_optimized_instance_check): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::do_if_helper): New method. + (SharkTopLevelBlock::do_if): Use the above. + (SharkTopLevelBlock::static_subtype_check): New method. + (SharkTopLevelBlock::do_instance_check): Use the above. + (SharkTopLevelBlock::maybe_do_instanceof_if): New method. + (SharkTopLevelBlock::do_optimized_instance_check): Removed. + (SharkTopLevelBlock::do_full_instance_check): Removed + now-unnecessary state copy and merge. + + * ports/hotspot/src/share/vm/shark/sharkState.hpp + (SharkState::replace_all): New method. + * ports/hotspot/src/share/vm/shark/sharkState.cpp + (SharkState::replace_all): Likewise. + +2009-06-06 Omair Majid * patches/icedtea-webstart.patch: Make javax.jnlp package visible to javac. diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri Jun 05 19:11:26 2009 +0100 @@ -825,8 +825,38 @@ void SharkBlock::parse_bytecode(int star do_call(); break; + case Bytecodes::_instanceof: + // This is a very common construct: + // + // if (object instanceof Klass) { + // something = (Klass) object; + // ... + // } + // + // which gets compiled to something like this: + // + // 28: aload 9 + // 30: instanceof + // 33: ifeq 52 + // 36: aload 9 + // 38: checkcast + // + // Handling both bytecodes at once allows us + // to eliminate the checkcast. + if (iter()->next_bci() < limit && + (iter()->next_bc() == Bytecodes::_ifeq || + iter()->next_bc() == Bytecodes::_ifne) && + (!UseLoopSafepoints || + iter()->next_get_dest() > iter()->next_bci())) { + if (maybe_do_instanceof_if()) { + iter()->next(); + if (SharkTraceBytecodes) + tty->print_cr("%4d: %s", bci(), Bytecodes::name(bc())); + break; + } + } + // fall through case Bytecodes::_checkcast: - case Bytecodes::_instanceof: do_instance_check(); break; @@ -1225,6 +1255,11 @@ void SharkBlock::do_instance_check() ShouldNotCallThis(); } +bool SharkBlock::maybe_do_instanceof_if() +{ + ShouldNotCallThis(); +} + void SharkBlock::do_new() { ShouldNotCallThis(); diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri Jun 05 19:11:26 2009 +0100 @@ -326,6 +326,7 @@ class SharkBlock : public ResourceObj { // checkcast and instanceof protected: virtual void do_instance_check(); + virtual bool maybe_do_instanceof_if(); // new and *newarray protected: diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkState.cpp --- a/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri Jun 05 19:11:26 2009 +0100 @@ -223,6 +223,21 @@ void SharkState::merge(SharkState* other // Safepointed status set_has_safepointed(this->has_safepointed() && other->has_safepointed()); +} + +void SharkState::replace_all(SharkValue* old_value, SharkValue* new_value) +{ + // Local variables + for (int i = 0; i < max_locals(); i++) { + if (local(i) == old_value) + set_local(i, new_value); + } + + // Expression stack + for (int i = 0; i < stack_depth(); i++) { + if (stack(i) == old_value) + set_stack(i, new_value); + } } void SharkState::decache_for_Java_call(ciMethod* callee) diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkState.hpp --- a/ports/hotspot/src/share/vm/shark/sharkState.hpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkState.hpp Fri Jun 05 19:11:26 2009 +0100 @@ -187,6 +187,10 @@ class SharkState : public ResourceObj { llvm::BasicBlock* other_block, llvm::BasicBlock* this_block); + // Value replacement + public: + void replace_all(SharkValue* old_value, SharkValue* new_value); + // Cache and decache public: void decache_for_Java_call(ciMethod* callee); diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 19:11:26 2009 +0100 @@ -772,8 +772,11 @@ void SharkTopLevelBlock::do_ret() } // All propagation of state from one block to the next (via -// dest->add_incoming) is handled by the next three methods -// (do_branch, do_if and do_switch) and by handle_exception. +// dest->add_incoming) is handled by these methods: +// do_branch +// do_if_helper +// do_switch +// handle_exception void SharkTopLevelBlock::do_branch(int successor_index) { @@ -795,16 +798,24 @@ void SharkTopLevelBlock::do_if(ICmpInst: llvm_a = a->jint_value(); llvm_b = b->jint_value(); } - + do_if_helper(p, llvm_b, llvm_a, current_state(), current_state()); +} + +void SharkTopLevelBlock::do_if_helper(ICmpInst::Predicate p, + Value* b, + Value* a, + SharkState* if_taken_state, + SharkState* not_taken_state) +{ SharkTopLevelBlock *if_taken = successor(ciTypeFlow::IF_TAKEN); SharkTopLevelBlock *not_taken = successor(ciTypeFlow::IF_NOT_TAKEN); builder()->CreateCondBr( - builder()->CreateICmp(p, llvm_a, llvm_b), + builder()->CreateICmp(p, a, b), if_taken->entry_block(), not_taken->entry_block()); - if_taken->add_incoming(current_state()); - not_taken->add_incoming(current_state()); + if_taken->add_incoming(if_taken_state); + not_taken->add_incoming(not_taken_state); } void SharkTopLevelBlock::do_switch() @@ -1164,40 +1175,48 @@ void SharkTopLevelBlock::do_call() current_state()->set_has_safepointed(true); } +bool SharkTopLevelBlock::static_subtype_check(ciKlass* check_klass, + ciKlass* object_klass) +{ + // If the class we're checking against is java.lang.Object + // then this is a no brainer. Apparently this can happen + // in reflective code... + if (check_klass == function()->env()->Object_klass()) + return true; + + // Perform a subtype check. NB in opto's code for this + // (GraphKit::static_subtype_check) it says that static + // interface types cannot be trusted, and if opto can't + // trust them then I assume we can't either. + if (!object_klass->is_interface()) { + if (object_klass == check_klass) + return true; + + if (object_klass->is_loaded() && check_klass->is_loaded()) { + if (object_klass->is_subtype_of(check_klass)) + return true; + } + } + + return false; +} + void SharkTopLevelBlock::do_instance_check() { // Get the class we're checking against bool will_link; ciKlass *check_klass = iter()->get_klass(will_link); - // If the class we're checking against is java.lang.Object - // then this is a no brainer. Apparently this can happen - // in reflective code... - if (check_klass == function()->env()->Object_klass()) { - do_optimized_instance_check(); - return; - } - // Get the class of the object we're checking ciKlass *object_klass = xstack(0)->type()->as_klass(); - // If the classes are defined enough now then we - // don't need a runtime check. NB opto's code for - // this (GraphKit::static_subtype_check) says we - // cannot trust static interface types yet, hence - // the extra check - if (!object_klass->is_interface()) { - if (object_klass == check_klass) { - do_optimized_instance_check(); - return; + // Can we optimize this check away? + if (static_subtype_check(check_klass, object_klass)) { + if (bc() == Bytecodes::_instanceof) { + pop(); + push(SharkValue::jint_constant(1)); } - - if (object_klass->is_loaded() && check_klass->is_loaded()) { - if (object_klass->is_subtype_of(check_klass)) { - do_optimized_instance_check(); - return; - } - } + return; } // Need to check this one at runtime @@ -1207,14 +1226,69 @@ void SharkTopLevelBlock::do_instance_che do_trapping_instance_check(check_klass); } -void SharkTopLevelBlock::do_optimized_instance_check() -{ - if (bc() == Bytecodes::_instanceof) { - pop(); - push(SharkValue::jint_constant(1)); - } -} - +bool SharkTopLevelBlock::maybe_do_instanceof_if() +{ + // Get the class we're checking against + bool will_link; + ciKlass *check_klass = iter()->get_klass(will_link); + + // If the class is unloaded then the instanceof + // cannot possibly succeed. + if (!will_link) + return false; + + // Keep a copy of the object we're checking + SharkValue *old_object = xstack(0); + + // Get the class of the object we're checking + ciKlass *object_klass = old_object->type()->as_klass(); + + // If the instanceof can be optimized away at compile time + // then any subsequent checkcasts will be too so we handle + // it normally. + if (static_subtype_check(check_klass, object_klass)) + return false; + + // Perform the instance check + do_full_instance_check(check_klass); + Value *result = pop()->jint_value(); + + // Create the casted object + SharkValue *new_object = SharkValue::create_generic( + check_klass, old_object->jobject_value(), old_object->zero_checked()); + + // Create two copies of the current state, one with the + // original object and one with all instances of the + // original object replaced with the new, casted object. + SharkState *new_state = current_state(); + SharkState *old_state = new_state->copy(); + new_state->replace_all(old_object, new_object); + + // Perform the check-and-branch + switch (iter()->next_bc()) { + case Bytecodes::_ifeq: + // branch if not an instance + do_if_helper( + ICmpInst::ICMP_EQ, + LLVMValue::jint_constant(0), result, + old_state, new_state); + break; + + case Bytecodes::_ifne: + // branch if an instance + do_if_helper( + ICmpInst::ICMP_NE, + LLVMValue::jint_constant(0), result, + new_state, old_state); + break; + + default: + ShouldNotReachHere(); + } + + return true; +} + void SharkTopLevelBlock::do_full_instance_check(ciKlass* klass) { BasicBlock *not_null = function()->CreateBlock("not_null"); @@ -1238,7 +1312,6 @@ void SharkTopLevelBlock::do_full_instanc builder()->CreateICmpEQ(object, LLVMValue::null()), merge2, not_null); BasicBlock *null_block = builder()->GetInsertBlock(); - SharkState *null_state = current_state()->copy(); // Get the class we're checking against builder()->SetInsertPoint(not_null); @@ -1282,7 +1355,6 @@ void SharkTopLevelBlock::do_full_instanc // Second merge builder()->SetInsertPoint(merge2); - current_state()->merge(null_state, null_block, nonnull_block); PHINode *result = builder()->CreatePHI( SharkType::jint_type(), "result"); result->addIncoming(LLVMValue::jint_constant(IC_IS_NULL), null_block); diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 19:11:26 2009 +0100 @@ -358,6 +358,11 @@ class SharkTopLevelBlock : public SharkB // if* private: + void do_if_helper(llvm::ICmpInst::Predicate p, + llvm::Value* b, + llvm::Value* a, + SharkState* if_taken_state, + SharkState* not_taken_state); void do_if(llvm::ICmpInst::Predicate p, SharkValue* b, SharkValue* a); // tableswitch and lookupswitch @@ -386,11 +391,12 @@ class SharkTopLevelBlock : public SharkB // checkcast and instanceof private: - void do_optimized_instance_check(); + bool static_subtype_check(ciKlass* check_klass, ciKlass* object_klass); void do_full_instance_check(ciKlass* klass); void do_trapping_instance_check(ciKlass* klass); void do_instance_check(); + bool maybe_do_instanceof_if(); // new and *newarray private: From gbenson at redhat.com Fri Jun 5 11:15:35 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 5 Jun 2009 19:15:35 +0100 Subject: Shark checkcast and instanceof improvements (part 3) Message-ID: <20090605181535.GA10309@redhat.com> Hi all, This commit adds special handling to instanceof instructions that are immediately followed by an ifeq or an ifne. The instructions are compiled as a pair, with the value checked by the instanceof annotated with updated type information in the branch of the if corresponding to the instanceof returning 1. This means that if the branch then contains a checkcast then that checkcast will be eliminated with a static check. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 8ba2783ba3b0 -r afa643fbffde ChangeLog --- a/ChangeLog Fri Jun 05 10:25:13 2009 -0400 +++ b/ChangeLog Fri Jun 05 19:11:26 2009 +0100 @@ -1,4 +1,33 @@ -2009-06-05 Omair Majid +2009-06-06 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkBlock.hpp + (SharkBlock::maybe_do_instanceof_if): New method. + * ports/hotspot/src/share/vm/shark/sharkBlock.cpp + (SharkBlock::maybe_do_instanceof_if): New method. + (SharkBlock::parse_bytecode): Use the above for + instanceof immediately followed by ifeq or ifne. + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::do_if_helper): New method. + (SharkTopLevelBlock::static_subtype_check): Likewise. + (SharkTopLevelBlock::maybe_do_instanceof_if): Likewise. + (SharkTopLevelBlock::do_optimized_instance_check): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::do_if_helper): New method. + (SharkTopLevelBlock::do_if): Use the above. + (SharkTopLevelBlock::static_subtype_check): New method. + (SharkTopLevelBlock::do_instance_check): Use the above. + (SharkTopLevelBlock::maybe_do_instanceof_if): New method. + (SharkTopLevelBlock::do_optimized_instance_check): Removed. + (SharkTopLevelBlock::do_full_instance_check): Removed + now-unnecessary state copy and merge. + + * ports/hotspot/src/share/vm/shark/sharkState.hpp + (SharkState::replace_all): New method. + * ports/hotspot/src/share/vm/shark/sharkState.cpp + (SharkState::replace_all): Likewise. + +2009-06-06 Omair Majid * patches/icedtea-webstart.patch: Make javax.jnlp package visible to javac. diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.cpp Fri Jun 05 19:11:26 2009 +0100 @@ -825,8 +825,38 @@ do_call(); break; + case Bytecodes::_instanceof: + // This is a very common construct: + // + // if (object instanceof Klass) { + // something = (Klass) object; + // ... + // } + // + // which gets compiled to something like this: + // + // 28: aload 9 + // 30: instanceof + // 33: ifeq 52 + // 36: aload 9 + // 38: checkcast + // + // Handling both bytecodes at once allows us + // to eliminate the checkcast. + if (iter()->next_bci() < limit && + (iter()->next_bc() == Bytecodes::_ifeq || + iter()->next_bc() == Bytecodes::_ifne) && + (!UseLoopSafepoints || + iter()->next_get_dest() > iter()->next_bci())) { + if (maybe_do_instanceof_if()) { + iter()->next(); + if (SharkTraceBytecodes) + tty->print_cr("%4d: %s", bci(), Bytecodes::name(bc())); + break; + } + } + // fall through case Bytecodes::_checkcast: - case Bytecodes::_instanceof: do_instance_check(); break; @@ -1225,6 +1255,11 @@ ShouldNotCallThis(); } +bool SharkBlock::maybe_do_instanceof_if() +{ + ShouldNotCallThis(); +} + void SharkBlock::do_new() { ShouldNotCallThis(); diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkBlock.hpp Fri Jun 05 19:11:26 2009 +0100 @@ -326,6 +326,7 @@ // checkcast and instanceof protected: virtual void do_instance_check(); + virtual bool maybe_do_instanceof_if(); // new and *newarray protected: diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkState.cpp --- a/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkState.cpp Fri Jun 05 19:11:26 2009 +0100 @@ -225,6 +225,21 @@ set_has_safepointed(this->has_safepointed() && other->has_safepointed()); } +void SharkState::replace_all(SharkValue* old_value, SharkValue* new_value) +{ + // Local variables + for (int i = 0; i < max_locals(); i++) { + if (local(i) == old_value) + set_local(i, new_value); + } + + // Expression stack + for (int i = 0; i < stack_depth(); i++) { + if (stack(i) == old_value) + set_stack(i, new_value); + } +} + void SharkState::decache_for_Java_call(ciMethod* callee) { assert(function() && method(), "you cannot decache here"); diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkState.hpp --- a/ports/hotspot/src/share/vm/shark/sharkState.hpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkState.hpp Fri Jun 05 19:11:26 2009 +0100 @@ -187,6 +187,10 @@ llvm::BasicBlock* other_block, llvm::BasicBlock* this_block); + // Value replacement + public: + void replace_all(SharkValue* old_value, SharkValue* new_value); + // Cache and decache public: void decache_for_Java_call(ciMethod* callee); diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 19:11:26 2009 +0100 @@ -772,8 +772,11 @@ } // All propagation of state from one block to the next (via -// dest->add_incoming) is handled by the next three methods -// (do_branch, do_if and do_switch) and by handle_exception. +// dest->add_incoming) is handled by these methods: +// do_branch +// do_if_helper +// do_switch +// handle_exception void SharkTopLevelBlock::do_branch(int successor_index) { @@ -795,16 +798,24 @@ llvm_a = a->jint_value(); llvm_b = b->jint_value(); } + do_if_helper(p, llvm_b, llvm_a, current_state(), current_state()); +} +void SharkTopLevelBlock::do_if_helper(ICmpInst::Predicate p, + Value* b, + Value* a, + SharkState* if_taken_state, + SharkState* not_taken_state) +{ SharkTopLevelBlock *if_taken = successor(ciTypeFlow::IF_TAKEN); SharkTopLevelBlock *not_taken = successor(ciTypeFlow::IF_NOT_TAKEN); builder()->CreateCondBr( - builder()->CreateICmp(p, llvm_a, llvm_b), + builder()->CreateICmp(p, a, b), if_taken->entry_block(), not_taken->entry_block()); - if_taken->add_incoming(current_state()); - not_taken->add_incoming(current_state()); + if_taken->add_incoming(if_taken_state); + not_taken->add_incoming(not_taken_state); } void SharkTopLevelBlock::do_switch() @@ -1164,40 +1175,48 @@ current_state()->set_has_safepointed(true); } +bool SharkTopLevelBlock::static_subtype_check(ciKlass* check_klass, + ciKlass* object_klass) +{ + // If the class we're checking against is java.lang.Object + // then this is a no brainer. Apparently this can happen + // in reflective code... + if (check_klass == function()->env()->Object_klass()) + return true; + + // Perform a subtype check. NB in opto's code for this + // (GraphKit::static_subtype_check) it says that static + // interface types cannot be trusted, and if opto can't + // trust them then I assume we can't either. + if (!object_klass->is_interface()) { + if (object_klass == check_klass) + return true; + + if (object_klass->is_loaded() && check_klass->is_loaded()) { + if (object_klass->is_subtype_of(check_klass)) + return true; + } + } + + return false; +} + void SharkTopLevelBlock::do_instance_check() { // Get the class we're checking against bool will_link; ciKlass *check_klass = iter()->get_klass(will_link); - // If the class we're checking against is java.lang.Object - // then this is a no brainer. Apparently this can happen - // in reflective code... - if (check_klass == function()->env()->Object_klass()) { - do_optimized_instance_check(); - return; - } - // Get the class of the object we're checking ciKlass *object_klass = xstack(0)->type()->as_klass(); - // If the classes are defined enough now then we - // don't need a runtime check. NB opto's code for - // this (GraphKit::static_subtype_check) says we - // cannot trust static interface types yet, hence - // the extra check - if (!object_klass->is_interface()) { - if (object_klass == check_klass) { - do_optimized_instance_check(); - return; + // Can we optimize this check away? + if (static_subtype_check(check_klass, object_klass)) { + if (bc() == Bytecodes::_instanceof) { + pop(); + push(SharkValue::jint_constant(1)); } - - if (object_klass->is_loaded() && check_klass->is_loaded()) { - if (object_klass->is_subtype_of(check_klass)) { - do_optimized_instance_check(); - return; - } - } + return; } // Need to check this one at runtime @@ -1207,14 +1226,69 @@ do_trapping_instance_check(check_klass); } -void SharkTopLevelBlock::do_optimized_instance_check() +bool SharkTopLevelBlock::maybe_do_instanceof_if() { - if (bc() == Bytecodes::_instanceof) { - pop(); - push(SharkValue::jint_constant(1)); + // Get the class we're checking against + bool will_link; + ciKlass *check_klass = iter()->get_klass(will_link); + + // If the class is unloaded then the instanceof + // cannot possibly succeed. + if (!will_link) + return false; + + // Keep a copy of the object we're checking + SharkValue *old_object = xstack(0); + + // Get the class of the object we're checking + ciKlass *object_klass = old_object->type()->as_klass(); + + // If the instanceof can be optimized away at compile time + // then any subsequent checkcasts will be too so we handle + // it normally. + if (static_subtype_check(check_klass, object_klass)) + return false; + + // Perform the instance check + do_full_instance_check(check_klass); + Value *result = pop()->jint_value(); + + // Create the casted object + SharkValue *new_object = SharkValue::create_generic( + check_klass, old_object->jobject_value(), old_object->zero_checked()); + + // Create two copies of the current state, one with the + // original object and one with all instances of the + // original object replaced with the new, casted object. + SharkState *new_state = current_state(); + SharkState *old_state = new_state->copy(); + new_state->replace_all(old_object, new_object); + + // Perform the check-and-branch + switch (iter()->next_bc()) { + case Bytecodes::_ifeq: + // branch if not an instance + do_if_helper( + ICmpInst::ICMP_EQ, + LLVMValue::jint_constant(0), result, + old_state, new_state); + break; + + case Bytecodes::_ifne: + // branch if an instance + do_if_helper( + ICmpInst::ICMP_NE, + LLVMValue::jint_constant(0), result, + new_state, old_state); + break; + + default: + ShouldNotReachHere(); } + + return true; } - + void SharkTopLevelBlock::do_full_instance_check(ciKlass* klass) { BasicBlock *not_null = function()->CreateBlock("not_null"); @@ -1238,7 +1312,6 @@ builder()->CreateICmpEQ(object, LLVMValue::null()), merge2, not_null); BasicBlock *null_block = builder()->GetInsertBlock(); - SharkState *null_state = current_state()->copy(); // Get the class we're checking against builder()->SetInsertPoint(not_null); @@ -1282,7 +1355,6 @@ // Second merge builder()->SetInsertPoint(merge2); - current_state()->merge(null_state, null_block, nonnull_block); PHINode *result = builder()->CreatePHI( SharkType::jint_type(), "result"); result->addIncoming(LLVMValue::jint_constant(IC_IS_NULL), null_block); diff -r 8ba2783ba3b0 -r afa643fbffde ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 10:25:13 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 19:11:26 2009 +0100 @@ -358,6 +358,11 @@ // if* private: + void do_if_helper(llvm::ICmpInst::Predicate p, + llvm::Value* b, + llvm::Value* a, + SharkState* if_taken_state, + SharkState* not_taken_state); void do_if(llvm::ICmpInst::Predicate p, SharkValue* b, SharkValue* a); // tableswitch and lookupswitch @@ -386,11 +391,12 @@ // checkcast and instanceof private: - void do_optimized_instance_check(); + bool static_subtype_check(ciKlass* check_klass, ciKlass* object_klass); void do_full_instance_check(ciKlass* klass); void do_trapping_instance_check(ciKlass* klass); void do_instance_check(); + bool maybe_do_instanceof_if(); // new and *newarray private: From omajid at redhat.com Fri Jun 5 12:20:21 2009 From: omajid at redhat.com (Omair Majid) Date: Fri, 05 Jun 2009 15:20:21 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <20090604214722.GA29542@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> <20090603180752.GB21904@redhat.com> <4A27DC10.9070600@redhat.com> <20090604214722.GA29542@redhat.com> Message-ID: <4A296FF5.2020703@redhat.com> Deepak Bhole wrote: > > Yep, looks good. Please go ahead and apply. One minor thing you may want > to consider btw... put a securitymanager AllPermissions() check inside > setInitialArguments(). Only trusted code would have all perms. The > reason for this is that initialArgs are used to launch another process, > and one could in theory perhaps mangle them. Again though, this is > totally optional because I honestly cannot come up with any way to > exploit it, given how the code is laid out. So I leave it upto you. > Updated version attached. A couple of changes. I added the security manager check. I also added a check for the arguments being passed to the java process (based on the list at [1]). I also noticed that the file name was being passed to Netx twice (didnt cause any issues, just seemed strange) and fixed that. Thanks again for taking the time to review the patch! ChangeLog: 2009-06-04 Omair Majid * rt/net/sourceforge/jnlp/JNLPFile.java (needsNewJVM): New function. Returns true if the JNLP file requires creating a new JVM. (getNewVMArgs): New function. Returns arguments to pass to the new JVM. * rt/net/sourceforge/jnlp/JREDesc.java (getVMArgs): Fix javadoc to reflect that return value can be null. * rt/net/sourceforge/jnlp/Launcher.java (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to Netx. Try to use the local file to launch this instance if possible. (launchExternal): Delegate to new launchExternal. (launchExternal): New method. Take in arguments to pass to the JVM and arguments to pass to Netx. Launch Netx with the with the appropriate arguments. (launchApplication): If needed, launch a new JVM and pass along the Netx arguments. * rt/net/sourceforge/jnlp/Parser.java: (getJRE): Call checkVMArgs to check 'java-vm-args' for security. If that fails, assume 'java-vm-args' is null. (checkVMArgs): New method. Check that the vmArgs variable contains safe arguments only. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add BXnofork. * rt/net/sourceforge/jnlp/runtime/Boot/java: Add -Xnofork to helpMessage (main): Check for '-Xnofork'. Set initial arguments. * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add forksAllowed to store whether creating a new JVM is allowed. Add initialArguments to store the arguments to Netx. (getForksAllowed): New function. Check if creating a new JVM is allowed. (setForksAllowed): New function. Set whether creating a JVM is allowed. (setInitialArguments): New function. Store the arguments passed to Netx. (getInitialArguments): New function. Return the arguments passed to Netx. Cheers, Omair [1] http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html#resources -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jvm-args.patch Type: text/x-patch Size: 16903 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090605/ec161351/attachment.bin From bugzilla-daemon at icedtea.classpath.org Sat Jun 6 14:20:46 2009 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 06 Jun 2009 21:20:46 +0000 Subject: [Bug 324] Shark assert(is_jarray(), "should be") during Java2Demo demos.Mix.JavaMedia Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=324 ------- Comment #2 from xerxes at zafena.se 2009-06-06 21:20 ------- When running on a more recent shar? without assertions the error log seems to indicate problems for shark to compile gervill. The demos.Mix.JavaMedia are the only demo in Java2Demo that plays sound. java version "1.6.0_0" OpenJDK Runtime Environment (IcedTea6 1.5-rafa643fbffde) (build 1.6.0_0-b16) OpenJDK Shark VM (build 14.0-b15, mixed mode) llvm used are 26svn # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (ciObjectFactory.cpp:335), pid=27871, tid=2478779248 # Error: ShouldNotReachHere() # # JRE version: 6.0-b16 # Java VM: OpenJDK Shark VM (14.0-b15 mixed mode linux-i386 ) # If you would like to submit a bug report, please include # instructions how to reproduce the bug and visit: # http://icedtea.classpath.org/bugzilla # --------------- T H R E A D --------------- Current thread (0xb7e8cfe0): JavaThread "CompilerThread0" daemon [_thread_in_vm, id=27877, stack(0x93b73000,0x93bf3000)] Java stack: stack not set up Current CompileTask: shark:587 ! com.sun.media.sound.SoftMainMixer.processAudioBuffers()V (1611 bytes) -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Sat Jun 6 14:28:25 2009 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sat, 06 Jun 2009 21:28:25 +0000 Subject: [Bug 300] shark fails to build Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=300 xerxes at zafena.se changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED ------- Comment #22 from xerxes at zafena.se 2009-06-06 21:28 ------- Shark have been updated to compile against llvm 2.4 2.5 2.6 and future llvm versions. http://icedtea.classpath.org/hg/icedtea6/rev/c7860ca7b19e bug closed! -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at icedtea.classpath.org Sun Jun 7 06:27:26 2009 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Sun, 07 Jun 2009 13:27:26 +0000 Subject: [Bug 347] New: IcedTea plugin, JS function can't converted to JSObject Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=347 Summary: IcedTea plugin, JS function can't converted to JSObject Product: IcedTea Version: unspecified Platform: PC URL: http://dev.gumboo.com:8880/demo2/index.html OS/Version: Linux Status: NEW Severity: blocker Priority: P2 Component: IcedTea AssignedTo: unassigned at icedtea.classpath.org ReportedBy: georgopoulos.georgios at gmail.com I can't pass a JS function to a Java applet. The error message says that the function can converted to JSObject. The code is: function openFileChooser() { var desktop = document.getElementById('webgears').getDesktop(); desktop.openFiles( function(files) { for(var i = 0; i < files.length; i++) { uploadFile(files[i]); } }, null, false); } Demo: http://dev.gumboo.com:8880/demo2/index.html (please view source to see the JS code). It works with: Java(TM) Plug-in 1.6.0_14 File name: libnpjp2.so The next generation Java plug-in for Mozilla browsers. OS Linux (Fedoa 10), Firefox 3.0.10, Iced Tea: [ggeorg at localhost ~]$ java -version java version "1.6.0_0" OpenJDK Runtime Environment (IcedTea6 1.5) (fedora-18.b16.fc10-i386) OpenJDK Server VM (build 14.0-b15, mixed mode) Thanks, George. -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From gbenson at redhat.com Mon Jun 8 03:01:18 2009 From: gbenson at redhat.com (Gary Benson) Date: Mon, 08 Jun 2009 10:01:18 +0000 Subject: changeset in /hg/icedtea6: 2009-06-08 Gary Benson changeset 4a81a23f1da6 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=4a81a23f1da6 description: 2009-06-08 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::get_virtual_callee): Removed. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::scan_for_traps): Catch invokeinterface edge case. (SharkTopLevelBlock::get_interface_callee): Removed code to handle invokeinterface edge case. (SharkTopLevelBlock::get_virtual_callee): Removed. diffstat: 3 files changed, 26 insertions(+), 104 deletions(-) ChangeLog | 11 + ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 117 +-------------- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 2 diffs (201 lines): diff -r afa643fbffde -r 4a81a23f1da6 ChangeLog --- a/ChangeLog Fri Jun 05 19:11:26 2009 +0100 +++ b/ChangeLog Mon Jun 08 05:59:35 2009 -0400 @@ -1,3 +1,14 @@ 2009-06-06 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::get_virtual_callee): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Catch invokeinterface + edge case. + (SharkTopLevelBlock::get_interface_callee): Removed code to + handle invokeinterface edge case. + (SharkTopLevelBlock::get_virtual_callee): Removed. + 2009-06-06 Gary Benson * ports/hotspot/src/share/vm/shark/sharkBlock.hpp diff -r afa643fbffde -r 4a81a23f1da6 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 19:11:26 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Mon Jun 08 05:59:35 2009 -0400 @@ -97,6 +97,16 @@ void SharkTopLevelBlock::scan_for_traps( method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); + // Handle the case where we encounter an invokeinterface but + // should really have an invokevirtual since the resolved + // method is a virtual method in java.lang.Object. This is + // a legal corner case in the spec, and while javac does not + // generate this code there's no reason a compliant Java + // compiler should not. See cpCacheOop.cpp and + // interpreterRuntime.cpp for more details. + if (method->holder() == function()->env()->Object_klass()) + Unimplemented(); + // Continue to the check index = iter()->get_method_index(); break; @@ -900,107 +910,19 @@ Value *SharkTopLevelBlock::get_virtual_c "callee"); } -// Interpreter-style virtual call lookup -Value* SharkTopLevelBlock::get_virtual_callee(Value *cache, - SharkValue *receiver) -{ - BasicBlock *final = function()->CreateBlock("final"); - BasicBlock *not_final = function()->CreateBlock("not_final"); - BasicBlock *got_callee = function()->CreateBlock("got_callee"); - - Value *flags = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::flags_offset(), - SharkType::intptr_type(), - "flags"); - - const int mask = 1 << ConstantPoolCacheEntry::vfinalMethod; - builder()->CreateCondBr( - builder()->CreateICmpNE( - builder()->CreateAnd(flags, LLVMValue::intptr_constant(mask)), - LLVMValue::intptr_constant(0)), - final, not_final); - - // For final methods f2 is the actual address of the method - builder()->SetInsertPoint(final); - Value *final_callee = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f2_offset(), - SharkType::methodOop_type(), - "final_callee"); - builder()->CreateBr(got_callee); - - // For non-final methods f2 is the index into the vtable - builder()->SetInsertPoint(not_final); - Value *klass = builder()->CreateValueOfStructEntry( - receiver->jobject_value(), - in_ByteSize(oopDesc::klass_offset_in_bytes()), - SharkType::jobject_type(), - "klass"); - - Value *index = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f2_offset(), - SharkType::intptr_type(), - "index"); - - Value *nonfinal_callee = builder()->CreateLoad( - builder()->CreateArrayAddress( - klass, - SharkType::methodOop_type(), - vtableEntry::size() * wordSize, - in_ByteSize(instanceKlass::vtable_start_offset() * wordSize), - index), - "nonfinal_callee"); - builder()->CreateBr(got_callee); - - builder()->SetInsertPoint(got_callee); - PHINode *callee = builder()->CreatePHI( - SharkType::methodOop_type(), "callee"); - callee->addIncoming(final_callee, final); - callee->addIncoming(nonfinal_callee, not_final); - - return callee; -} - -// Interpreter-style interface call lookup +// Interface calls are handled here Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver) { SharkConstantPool constants(this); Value *cache = constants.cache_entry_at(iter()->get_method_index()); - BasicBlock *hacky = function()->CreateBlock("hacky"); - BasicBlock *normal = function()->CreateBlock("normal"); BasicBlock *loop = function()->CreateBlock("loop"); BasicBlock *got_null = function()->CreateBlock("got_null"); BasicBlock *not_null = function()->CreateBlock("not_null"); BasicBlock *next = function()->CreateBlock("next"); BasicBlock *got_entry = function()->CreateBlock("got_entry"); - BasicBlock *got_callee = function()->CreateBlock("got_callee"); - - Value *flags = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::flags_offset(), - SharkType::intptr_type(), - "flags"); - - const int mask = 1 << ConstantPoolCacheEntry::methodInterface; - builder()->CreateCondBr( - builder()->CreateICmpNE( - builder()->CreateAnd(flags, LLVMValue::intptr_constant(mask)), - LLVMValue::intptr_constant(0)), - hacky, normal); - - // Workaround for the case where we encounter an invokeinterface, - // but should really have an invokevirtual since the resolved - // method is a virtual method in java.lang.Object. This is a - // corner case in the spec but is presumably legal, and while - // javac does not generate this code there's no reason it could - // not be produced by a compliant java compiler. See - // cpCacheOop.cpp for more details. - builder()->SetInsertPoint(hacky); - Value *hacky_callee = get_virtual_callee(cache, receiver); - BasicBlock *got_hacky = builder()->GetInsertBlock(); - builder()->CreateBr(got_callee); // Locate the receiver's itable - builder()->SetInsertPoint(normal); Value *object_klass = builder()->CreateValueOfStructEntry( receiver->jobject_value(), in_ByteSize(oopDesc::klass_offset_in_bytes()), SharkType::jobject_type(), @@ -1038,11 +960,12 @@ Value* SharkTopLevelBlock::get_interface SharkType::jobject_type(), "iklass"); + BasicBlock *loop_entry = builder()->GetInsertBlock(); builder()->CreateBr(loop); builder()->SetInsertPoint(loop); PHINode *itable_entry_addr = builder()->CreatePHI( SharkType::intptr_type(), "itable_entry_addr"); - itable_entry_addr->addIncoming(itable_start, normal); + itable_entry_addr->addIncoming(itable_start, loop_entry); Value *itable_entry = builder()->CreateIntToPtr( itable_entry_addr, SharkType::itableOffsetEntry_type(), "itable_entry"); @@ -1091,7 +1014,7 @@ Value* SharkTopLevelBlock::get_interface SharkType::intptr_type(), "index"); - Value *normal_callee = builder()->CreateLoad( + return builder()->CreateLoad( builder()->CreateIntToPtr( builder()->CreateAdd( builder()->CreateAdd( @@ -1106,17 +1029,7 @@ Value* SharkTopLevelBlock::get_interface LLVMValue::intptr_constant( itableMethodEntry::method_offset_in_bytes())), PointerType::getUnqual(SharkType::methodOop_type())), - "normal_callee"); - BasicBlock *got_normal = builder()->GetInsertBlock(); - builder()->CreateBr(got_callee); - - builder()->SetInsertPoint(got_callee); - PHINode *callee = builder()->CreatePHI( - SharkType::methodOop_type(), "callee"); - callee->addIncoming(hacky_callee, got_hacky); - callee->addIncoming(normal_callee, got_normal); - - return callee; + "callee"); } void SharkTopLevelBlock::do_call() diff -r afa643fbffde -r 4a81a23f1da6 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 19:11:26 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Mon Jun 08 05:59:35 2009 -0400 @@ -383,8 +383,6 @@ class SharkTopLevelBlock : public SharkB llvm::Value* get_direct_callee(ciMethod* method); llvm::Value* get_virtual_callee(SharkValue* receiver, ciMethod* method); - - llvm::Value* get_virtual_callee(llvm::Value* cache, SharkValue* receiver); llvm::Value* get_interface_callee(SharkValue* receiver); void do_call(); From gbenson at redhat.com Mon Jun 8 03:08:17 2009 From: gbenson at redhat.com (Gary Benson) Date: Mon, 8 Jun 2009 11:08:17 +0100 Subject: Shark invokeinterface improvements (part 1) Message-ID: <20090608100817.GA5081@redhat.com> Hi all, This commit removes a huge amount of code that handles an edge case for invokeinterface that only occurs with broken (IMO) but spec-compliant bytecode. I want to refactor invokeinterface and this code was making it a pain in the ass. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r a4f54a28260b ChangeLog --- a/ChangeLog Fri Jun 05 19:19:36 2009 +0100 +++ b/ChangeLog Mon Jun 08 11:04:42 2009 +0100 @@ -1,3 +1,14 @@ +2009-06-08 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::get_virtual_callee): Removed. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Catch invokeinterface + edge case. + (SharkTopLevelBlock::get_interface_callee): Removed code to + handle invokeinterface edge case. + (SharkTopLevelBlock::get_virtual_callee): Removed. + 2009-06-06 Gary Benson * ports/hotspot/src/share/vm/shark/sharkBlock.hpp diff -r a4f54a28260b ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Fri Jun 05 19:19:36 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Mon Jun 08 11:04:42 2009 +0100 @@ -97,6 +97,16 @@ method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); + // Handle the case where we encounter an invokeinterface but + // should really have an invokevirtual since the resolved + // method is a virtual method in java.lang.Object. This is + // a legal corner case in the spec, and while javac does not + // generate this code there's no reason a compliant Java + // compiler should not. See cpCacheOop.cpp and + // interpreterRuntime.cpp for more details. + if (method->holder() == function()->env()->Object_klass()) + Unimplemented(); + // Continue to the check index = iter()->get_method_index(); break; @@ -900,107 +910,19 @@ "callee"); } -// Interpreter-style virtual call lookup -Value* SharkTopLevelBlock::get_virtual_callee(Value *cache, - SharkValue *receiver) -{ - BasicBlock *final = function()->CreateBlock("final"); - BasicBlock *not_final = function()->CreateBlock("not_final"); - BasicBlock *got_callee = function()->CreateBlock("got_callee"); - - Value *flags = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::flags_offset(), - SharkType::intptr_type(), - "flags"); - - const int mask = 1 << ConstantPoolCacheEntry::vfinalMethod; - builder()->CreateCondBr( - builder()->CreateICmpNE( - builder()->CreateAnd(flags, LLVMValue::intptr_constant(mask)), - LLVMValue::intptr_constant(0)), - final, not_final); - - // For final methods f2 is the actual address of the method - builder()->SetInsertPoint(final); - Value *final_callee = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f2_offset(), - SharkType::methodOop_type(), - "final_callee"); - builder()->CreateBr(got_callee); - - // For non-final methods f2 is the index into the vtable - builder()->SetInsertPoint(not_final); - Value *klass = builder()->CreateValueOfStructEntry( - receiver->jobject_value(), - in_ByteSize(oopDesc::klass_offset_in_bytes()), - SharkType::jobject_type(), - "klass"); - - Value *index = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f2_offset(), - SharkType::intptr_type(), - "index"); - - Value *nonfinal_callee = builder()->CreateLoad( - builder()->CreateArrayAddress( - klass, - SharkType::methodOop_type(), - vtableEntry::size() * wordSize, - in_ByteSize(instanceKlass::vtable_start_offset() * wordSize), - index), - "nonfinal_callee"); - builder()->CreateBr(got_callee); - - builder()->SetInsertPoint(got_callee); - PHINode *callee = builder()->CreatePHI( - SharkType::methodOop_type(), "callee"); - callee->addIncoming(final_callee, final); - callee->addIncoming(nonfinal_callee, not_final); - - return callee; -} - -// Interpreter-style interface call lookup +// Interface calls are handled here Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver) { SharkConstantPool constants(this); Value *cache = constants.cache_entry_at(iter()->get_method_index()); - BasicBlock *hacky = function()->CreateBlock("hacky"); - BasicBlock *normal = function()->CreateBlock("normal"); BasicBlock *loop = function()->CreateBlock("loop"); BasicBlock *got_null = function()->CreateBlock("got_null"); BasicBlock *not_null = function()->CreateBlock("not_null"); BasicBlock *next = function()->CreateBlock("next"); BasicBlock *got_entry = function()->CreateBlock("got_entry"); - BasicBlock *got_callee = function()->CreateBlock("got_callee"); - - Value *flags = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::flags_offset(), - SharkType::intptr_type(), - "flags"); - - const int mask = 1 << ConstantPoolCacheEntry::methodInterface; - builder()->CreateCondBr( - builder()->CreateICmpNE( - builder()->CreateAnd(flags, LLVMValue::intptr_constant(mask)), - LLVMValue::intptr_constant(0)), - hacky, normal); - - // Workaround for the case where we encounter an invokeinterface, - // but should really have an invokevirtual since the resolved - // method is a virtual method in java.lang.Object. This is a - // corner case in the spec but is presumably legal, and while - // javac does not generate this code there's no reason it could - // not be produced by a compliant java compiler. See - // cpCacheOop.cpp for more details. - builder()->SetInsertPoint(hacky); - Value *hacky_callee = get_virtual_callee(cache, receiver); - BasicBlock *got_hacky = builder()->GetInsertBlock(); - builder()->CreateBr(got_callee); // Locate the receiver's itable - builder()->SetInsertPoint(normal); Value *object_klass = builder()->CreateValueOfStructEntry( receiver->jobject_value(), in_ByteSize(oopDesc::klass_offset_in_bytes()), SharkType::jobject_type(), @@ -1038,11 +960,12 @@ SharkType::jobject_type(), "iklass"); + BasicBlock *loop_entry = builder()->GetInsertBlock(); builder()->CreateBr(loop); builder()->SetInsertPoint(loop); PHINode *itable_entry_addr = builder()->CreatePHI( SharkType::intptr_type(), "itable_entry_addr"); - itable_entry_addr->addIncoming(itable_start, normal); + itable_entry_addr->addIncoming(itable_start, loop_entry); Value *itable_entry = builder()->CreateIntToPtr( itable_entry_addr, SharkType::itableOffsetEntry_type(), "itable_entry"); @@ -1091,7 +1014,7 @@ SharkType::intptr_type(), "index"); - Value *normal_callee = builder()->CreateLoad( + return builder()->CreateLoad( builder()->CreateIntToPtr( builder()->CreateAdd( builder()->CreateAdd( @@ -1106,17 +1029,7 @@ LLVMValue::intptr_constant( itableMethodEntry::method_offset_in_bytes())), PointerType::getUnqual(SharkType::methodOop_type())), - "normal_callee"); - BasicBlock *got_normal = builder()->GetInsertBlock(); - builder()->CreateBr(got_callee); - - builder()->SetInsertPoint(got_callee); - PHINode *callee = builder()->CreatePHI( - SharkType::methodOop_type(), "callee"); - callee->addIncoming(hacky_callee, got_hacky); - callee->addIncoming(normal_callee, got_normal); - - return callee; + "callee"); } void SharkTopLevelBlock::do_call() diff -r a4f54a28260b ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Fri Jun 05 19:19:36 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Mon Jun 08 11:04:42 2009 +0100 @@ -383,8 +383,6 @@ llvm::Value* get_direct_callee(ciMethod* method); llvm::Value* get_virtual_callee(SharkValue* receiver, ciMethod* method); - - llvm::Value* get_virtual_callee(llvm::Value* cache, SharkValue* receiver); llvm::Value* get_interface_callee(SharkValue* receiver); void do_call(); From gnu_andrew at member.fsf.org Mon Jun 8 09:13:24 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 8 Jun 2009 17:13:24 +0100 Subject: RFC: Fix --enable-hg in IcedTea6 In-Reply-To: <4A267B72.8040806@redhat.com> References: <4A23F568.4040900@redhat.com> <17c6771e0906010851r22114970xdb3ed983f186799c@mail.gmail.com> <4A240268.5020002@redhat.com> <17c6771e0906011018v127a02e1pf0b0ed03f593091e@mail.gmail.com> <4A267B72.8040806@redhat.com> Message-ID: <17c6771e0906080913j45ac74cah78d7ead827bb4c2f@mail.gmail.com> 2009/6/3 Omair Majid : > Andrew John Hughes wrote: >> >> 2009/6/1 Omair Majid : >>> >>> Andrew John Hughes wrote: >>>> >>>> 2009/6/1 Omair Majid : >>>>> >>>>> Hi, >>>>> >>>>> Trying to build IcedTea6 with "--enable-hg --with-hg-revision=jdk6-b16" >>>>> fails when applying the patches, even though jdk6-b16 is a known good >>>>> build. >>>>> The issues appears to be that the Makefile removes the old hotspot only >>>>> if >>>>> the openjdk directory doesn't already exist. >>>>> >>>>> The attached patch checks USE_HG and then removes the hotspot directory >>>>> so >>>>> it can be replaced with HS14. >>>>> >>>>> ChangeLog: >>>>> 2009-06-01 ?Omair Majid ? >>>>> >>>>> ?* Makefile.am (stamps/extract.stamp): Remove hotspot if using >>>>> ?--enable-hg and an alternate hotspot build. >>>>> >>>>> Can someone please review the patch? >>>>> >>>>> Cheers, >>>>> Omair >>>>> >>>> The presumption was that anyone wanting to use Mercurial as a source >>>> wanted the whole thing. >>> >>> I see. What about the patches then? Should we apply patches from the >>> original hotspot? Or leave out the hotspot patches completely? >>> >> >> Sorry, I should have been more clear. ?I was just explaining why the >> current status quo is as it is. ?Changing it as you say is the right >> thing to do. ?Things are different in 7 (we don't replace HotSpot, >> there are a heck of a lot more forests) so it makes more sense to use >> a pristine checkout. >> >> BTW, I wouldn't worry too much about --enable-hg not building. ?It's >> really there for people who want to live life on the edge i.e. if you >> want to use live Mercurial sources to build, you should know what >> you're letting yourself in for :) > > Yeah, that's true. I would expect occasional bugs and IcedTea lagging behind > patches. But failing to build completely with a known good revision? > >> Again, it's a lot more useful with 7 because there are lots of rapidly >> changing upstream forests. >> > Oh. That makes a lot of sense. Should we remove --enable-hg from 6? > No. While the only real value in --enable-hg --with-hg-revision=jdk6-b16 is testing, the more general default of using tip is useful for testing stuff in hg but not yet in a tarball. >>>> I don't see how the attached patch can work. ?This would stop the >>>> hotspot directory not being removed when Mercurial is disabled, and >>>> doesn't do anything about the if block which checks for the openjdk >>>> directory. >>> >>> Err...too many negatives in that sentence, so apologies if I >>> misunderstand >>> something. >> >> Sorry on my part :) >> > No worries. > >> The patch works (as in I can do a 'make patch' with this change >>> >>> applied and everything works) >> >> With what configuration options? Do both non-hg and hg builds still work? >> Does a full build work? > > I did try those options with the old patch. See blow for the new list. > >> >> . If mercurial is disabled, it does nothing - >>> >>> it only comes into play if --enable-hg is used. In that case, it deletes >>> the >>> hotspot directory so the alternate hotspot tarball is used. >> >> This is my point; we should always delete the hotspot directory and >> use an alternate tarball if alternate HotSpot is turned on (which it >> is by default). ?Looking at this, it will stop HotSpot being replaced >> for a normal build and we'll end up with hs11 and broken patches... >> >>> Currently >>> hotspot is only replaced if there is no openjdk directory. In case of >>> --enable-hg, there is, so hotspot wasnt being replaced. >>> The patch explicitly >>> rm -rf's the old hotspot direcotry so it is replaced with HS14. >> >> Right, but that should happen, hg or no hg. ?With your patch, it's only >> with hg. >> >>> Anyway, the >>> entire point is moot if the purpose of --enable-hg is to provide the >>> unmodified hotspot. >> >> In the case of 6, I think we should still replace HotSpot. >> >>>> stamps/extract.stamp: stamps/download.stamp >>>> if OPENJDK_SRC_DIR_FOUND >>>> ? ? ? cp -a $(OPENJDK_SRC_DIR) openjdk >>>> else >>>> ? ? ? if ! test -d openjdk ; \ >>>> ? ? ? then \ >>>> ? ? ? ? mkdir openjdk ; \ >>>> ? ? ? ? $(TAR) xf $(OPENJDK_SRC_ZIP) -C openjdk; \ >>>> ? ? ? ? chmod -R ug+w openjdk ; \ >>>> ? ? ? ? if test "x${HSBUILD}" != "xoriginal"; then \ >>>> ? ? ? ? ? rm -rf openjdk/hotspot ; \ >>>> ? ? ? ? fi ; \ >>>> ? ? ? ? sh $(abs_top_srcdir)/fsg.sh ; \ >>>> ? ? ? fi >>>> if WITH_ALT_HSBUILD >>>> ? ? ? if test -e ${HOTSPOT_SRC_ZIP} ; \ >>>> ? ? ? then \ >>>> ? ? ? ? if ! test -d openjdk/hotspot ; \ >>>> ? ? ? ? then \ >>>> ? ? ? ? ? $(TAR) xf $(HOTSPOT_SRC_ZIP) ; \ >>>> ? ? ? ? ? chmod -R ug+w master-* ; \ >>>> ? ? ? ? ? mv master-$$($(AWK) 'version==$$1 {print $$2}' >>>> version=$(HSBUILD) \ >>>> ? ? ? ? ? ? $(abs_top_srcdir)/hotspot.map) openjdk/hotspot ; \ >>>> ? ? ? ? fi ; \ >>>> ? ? ? fi >>>> endif >>>> endif >>>> >>>> The simplest solution is probably to add an additional target for the >>>> HotSpot replacement so it isn't so tightly related to extraction. >>> >>> That makes sense, I will see what I can do. >>> >> >> I think it would make the whole thing less confusing and easier to work >> on. >> Thanks. > > I got a patch that I *think* works. Here are the configurations I tested: > > Just 'make patch' > ./autogen.sh && ./configure && make patch > ./autogen.sh && ./configure --enable-hg --with-hg-revision=jdk6-b16 && make > patch > ./autogen.sh && ./configure --with-openjdk ?&& make patch > ./autogen.sh && ./configure --with-openjdk && make replace-hotspot > ./autogen.sh && ./configure --with-openjdk --disable-docs && make patch > ./autogen.sh && ./configure --enable-hg --with-hg-revision=jdk6-b16 > --with-openjdk --disable-docs && make patch > ./autogen.sh && ./configure --enable-zero && make patch > ./autogen.sh && ./configure --enable-zero --enable-shark && make patch > ./autogen.sh && ./configure --enable-plugin --enable-pulse-java > --enable-visualvm --enable-openjdk-cross-compilation --enable-zero > --enable-shark --enable-systemtap --enable-cacao ?&& make patch > > Full Build: > ./autogen.sh && ./configure && make > ./autogen.sh && ./configure --with-openjdk --disable-docs && make > > > ./autogen.sh && ./configure --with-hotspot-build=original && make patch > failed just like it does with the current Makefile.am (trying to apply > icedtea-shark.patch) > > > ChangeLog: > 2009-06-03 ?Omair Majid ? > > ? ?* Makefile.am > ? ?(stamps/ports.stamp): Depend on stamps/replace-hotspot.stamp instead > ? ?of stamps/extract.stamp. > ? ?(stamps/extract.stamp): Dont replace hotspot. > ? ?(stamps/replace-hotspot.stamp): New target. Replace hotspot without > ? ?assuming anything about the build. > ? ?(clean-replace-hotspot): New target. > ? ?(stamps/patch-fsg.stamp): Depend on stamps/replace-hotspot.stamp > ? ?instead of stamps/extract.stamp. > ? ?(stamps/hotspot-tools-source-files.txt): Likewise. > ? ?(rt-source-files.txt): Likewise. > ? ?(stamps/cacao.stamp): Likewise. > ? ?(stamps/visualvm.stamp): Likewise. > ? ?(stamps/nbplatform.stamp): Likewise. > ? ?(replace-hotspot): New alias for stamps/replace-hotspot.stamp. > Looks ok. Please commit. > Cheers, > Omair > Thanks, -- 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 omajid at redhat.com Mon Jun 8 09:54:02 2009 From: omajid at redhat.com (Omair Majid) Date: Mon, 08 Jun 2009 12:54:02 -0400 Subject: RFC: Netx - Parser support for shortcut, association and related-content elements Message-ID: <4A2D422A.8090202@redhat.com> Hi, The attached patch adds support to the JNLP parser for parsing association, shortcut and related-content elements from the JNLP file. ChangeLog: 2009-06-08 Omair Majid * rt/net/sourceforge/jnlp/AssociationDesc.java: New file. (AssociationDesc): New function. Create an association descriptor. (getExtensions): New function. Get the extensions for this association. (getMimeType): New function. Get the mimetype for this association. (checkMimeType): New function. * rt/net/sourceforge/jnlp/InformationDesc.java (getAssociations): New function. Get the associations. (getShortcut): New function. Get the shortcut. (getRelatedContents): New function. Get the related-contents. * rt/net/sourceforge/jnlp/MenuDesc.java: New file. (MenuDesc): New function. (getSubMenu): New function. Get the submenu for this menu descriptor. * rt/net/sourceforge/jnlp/Parser.java (getInformationDesc): Parse "assocation", "shortcut" and "related-content" elements. (getAssociation): New function. Parse the association node to create a AssociationDesc. (getShortcut): New function. Parse the shortcut node to create a ShortcutDesc. (getMenu): New function. Parse a menu node to create a MenuDesc. (getRelatedContent): New function. Parse a related-content node to create a RelatedContentDesc. * rt/net/sourceforge/jnlp/RelatedContentDesc.java (RelatedContentDesc): New function. (setTitle): New function. Set the title of this content. (getTitle): New function. Get the title of this content. (setDescription): New function. Set the description of this content. (getDescription): New function. Get the description of this content. (getLocation): New function. Get the location of this content. (setIconDesc): New function. Set the icon descriptor for this content. (getIcon): Get the icon descriptor for this content. * rt/net/sourceforge/jnlp/ShortcutDesc.java (ShortcutDesc): New function. (ShortcutDesc): New function. Initialize requiresOnline and onDesktop. (isOnline): New function. Return true if the shortcut is online only. (onDesktop): New function. Return true if the shortcut should be placed on the desktop. (addMenu): New function. Add a menu descriptor for this shortcut. (getMenu): New function. Return the menu descriptor for this shortcut. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add PTwoDesktops, PTwoMenus, PTwoTitle and PTwoIcons. Any comments? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-parser-shortcut-association-related-content.patch Type: text/x-patch Size: 11348 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090608/fb6ae461/attachment.bin From omajid at redhat.com Mon Jun 8 11:25:50 2009 From: omajid at redhat.com (Omair Majid) Date: Mon, 08 Jun 2009 18:25:50 +0000 Subject: changeset in /hg/icedtea6: 2009-06-08 Omair Majid changeset 0be8e3334758 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=0be8e3334758 description: 2009-06-08 Omair Majid * Makefile.am (stamps/ports.stamp): Depend on stamps/replace-hotspot.stamp instead of stamps/extract.stamp. (stamps/extract.stamp): Dont replace hotspot. (stamps/replace-hotspot.stamp): New target. Replace hotspot without assuming anything about the build. (clean-replace-hotspot): New target. (stamps/patch-fsg.stamp): Depend on stamps/replace-hotspot.stamp instead of stamps/extract.stamp. (stamps/hotspot-tools-source-files.txt): Likewise. (rt-source-files.txt): Likewise. (stamps/cacao.stamp): Likewise. (stamps/visualvm.stamp): Likewise. (stamps/nbplatform.stamp): Likewise. (replace-hotspot): New alias for stamps/replace-hotspot.stamp. diffstat: 2 files changed, 72 insertions(+), 49 deletions(-) ChangeLog | 18 ++++++++++ Makefile.am | 103 ++++++++++++++++++++++++++++++----------------------------- diffs (203 lines): diff -r 4a81a23f1da6 -r 0be8e3334758 ChangeLog --- a/ChangeLog Mon Jun 08 05:59:35 2009 -0400 +++ b/ChangeLog Mon Jun 08 14:26:32 2009 -0400 @@ -1,3 +1,21 @@ 2009-06-08 Gary Benson + + * Makefile.am + (stamps/ports.stamp): Depend on stamps/replace-hotspot.stamp instead + of stamps/extract.stamp. + (stamps/extract.stamp): Dont replace hotspot. + (stamps/replace-hotspot.stamp): New target. Replace hotspot without + assuming anything about the build. + (clean-replace-hotspot): New target. + (stamps/patch-fsg.stamp): Depend on stamps/replace-hotspot.stamp + instead of stamps/extract.stamp. + (stamps/hotspot-tools-source-files.txt): Likewise. + (rt-source-files.txt): Likewise. + (stamps/cacao.stamp): Likewise. + (stamps/visualvm.stamp): Likewise. + (stamps/nbplatform.stamp): Likewise. + (replace-hotspot): New alias for stamps/replace-hotspot.stamp. + 2009-06-08 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r 4a81a23f1da6 -r 0be8e3334758 Makefile.am --- a/Makefile.am Mon Jun 08 05:59:35 2009 -0400 +++ b/Makefile.am Mon Jun 08 14:26:32 2009 -0400 @@ -455,7 +455,7 @@ endif endif # Link ports sources into tree -stamps/ports.stamp: stamps/extract.stamp +stamps/ports.stamp: stamps/replace-hotspot.stamp for target in $(abs_top_srcdir)/ports/hotspot/build/*/makefiles/* \ $(abs_top_srcdir)/ports/hotspot/src/*cpu/* \ $(abs_top_srcdir)/ports/hotspot/src/share/vm/*; do \ @@ -675,57 +675,60 @@ else mkdir openjdk ; \ $(TAR) xf $(OPENJDK_SRC_ZIP) -C openjdk; \ chmod -R ug+w openjdk ; \ - if test "x${HSBUILD}" != "xoriginal"; then \ - rm -rf openjdk/hotspot ; \ - fi ; \ sh $(abs_top_srcdir)/fsg.sh ; \ fi +endif +if BUILD_CACAO +if !USE_SYSTEM_CACAO + if ! test -d cacao ; \ + then \ + mkdir cacao ; \ + $(TAR) xf $(CACAO_SRC_ZIP) -C cacao ; \ + dir=$$(basename cacao/cacao-*) ; \ + ln -s $$dir cacao/cacao ; \ + fi +endif +endif +if WITH_VISUALVM + if ! test -d netbeans ; \ + then \ + mkdir netbeans ; \ + $(TAR) xf $(NETBEANS_PROFILER_SRC_ZIP) -C netbeans ; \ + fi + + if ! test -d visualvm ; \ + then \ + $(TAR) xf $(VISUALVM_SRC_ZIP) ; \ + fi +endif + if [ ! -e $(abs_top_builddir)/generated ]; then \ + cp -a $(abs_top_srcdir)/generated $(abs_top_builddir); \ + find $(abs_top_builddir)/generated -type f -exec chmod 640 '{}' ';' \ + -o -type d -exec chmod 750 '{}' ';'; \ + fi + mkdir -p stamps + touch stamps/extract.stamp + +clean-extract: + rm -f stamps/extract.stamp + +stamps/replace-hotspot.stamp: stamps/extract.stamp if WITH_ALT_HSBUILD - if test -e ${HOTSPOT_SRC_ZIP} ; \ - then \ - if ! test -d openjdk/hotspot ; \ + if test "x${HSBUILD}" != "xoriginal"; then \ + rm -rf openjdk/hotspot ; \ + if test -e ${HOTSPOT_SRC_ZIP} ; \ then \ $(TAR) xf $(HOTSPOT_SRC_ZIP) ; \ chmod -R ug+w master-* ; \ mv master-$$($(AWK) 'version==$$1 {print $$2}' version=$(HSBUILD) \ $(abs_top_srcdir)/hotspot.map) openjdk/hotspot ; \ fi ; \ - fi -endif -endif -if BUILD_CACAO -if !USE_SYSTEM_CACAO - if ! test -d cacao ; \ - then \ - mkdir cacao ; \ - $(TAR) xf $(CACAO_SRC_ZIP) -C cacao ; \ - dir=$$(basename cacao/cacao-*) ; \ - ln -s $$dir cacao/cacao ; \ - fi -endif -endif -if WITH_VISUALVM - if ! test -d netbeans ; \ - then \ - mkdir netbeans ; \ - $(TAR) xf $(NETBEANS_PROFILER_SRC_ZIP) -C netbeans ; \ - fi - - if ! test -d visualvm ; \ - then \ - $(TAR) xf $(VISUALVM_SRC_ZIP) ; \ - fi -endif - if [ ! -e $(abs_top_builddir)/generated ]; then \ - cp -a $(abs_top_srcdir)/generated $(abs_top_builddir); \ - find $(abs_top_builddir)/generated -type f -exec chmod 640 '{}' ';' \ - -o -type d -exec chmod 750 '{}' ';'; \ - fi - mkdir -p stamps - touch stamps/extract.stamp - -clean-extract: - rm -f stamps/extract.stamp + fi ; +endif + touch stamps/replace-hotspot.stamp + +clean-replace-hotspot: + rm -rf stamps/replace-hotspot.stamp stamps/patch.stamp: stamps/patch-fsg.stamp mkdir -p stamps ; \ @@ -812,7 +815,7 @@ clean-patch: rm -f openjdk/jdk/src/share/classes/sun/applet/`basename $file` ; \ done ; -stamps/patch-fsg.stamp: stamps/extract.stamp +stamps/patch-fsg.stamp: stamps/replace-hotspot.stamp mkdir -p stamps ; \ rm -f stamps/patch-fsg.stamp.tmp ; \ touch stamps/patch-fsg.stamp.tmp ; \ @@ -1445,7 +1448,7 @@ stamps/hotspot-tools-copy-source-files.s mkdir -p stamps touch stamps/hotspot-tools-copy-source-files.stamp -hotspot-tools-source-files.txt: stamps/extract.stamp \ +hotspot-tools-source-files.txt: stamps/replace-hotspot.stamp \ stamps/hotspot-tools-copy-source-files.stamp find hotspot-tools -name '*.java' | sort > $@ mkdir -p lib/hotspot-tools @@ -1498,7 +1501,7 @@ bootstrap/jdk1.7.0/jre/lib/tools.jar: st fi # rt-closed.jar class files. -rt-source-files.txt: stamps/extract.stamp stamps/copy-source-files.stamp +rt-source-files.txt: stamps/replace-hotspot.stamp stamps/copy-source-files.stamp find $(abs_top_srcdir)/rt $(abs_top_builddir)/rt -name '*.java' \ | sort -u > $@ @@ -1582,7 +1585,7 @@ extra-lib/about.jar: stamps/extra-class- $(ICEDTEA_BOOT_DIR)/bin/jar cf $@ -C extra-lib net ; \ fi -stamps/cacao.stamp: stamps/extract.stamp stamps/rt-class-files.stamp +stamps/cacao.stamp: stamps/replace-hotspot.stamp stamps/rt-class-files.stamp if BUILD_CACAO if !USE_SYSTEM_CACAO cd cacao/cacao && \ @@ -1956,7 +1959,7 @@ check-local: jtregcheck # VisualVM stamps/visualvm.stamp: $(BOOTSTRAP_DIRECTORY_STAMP) stamps/download.stamp \ - stamps/extract.stamp stamps/nbplatform.stamp + stamps/replace-hotspot.stamp stamps/nbplatform.stamp if WITH_VISUALVM cd visualvm ; \ ln -s $(abs_top_srcdir)/netbeans/nbbuild/netbeans_visualvm netbeans ; \ @@ -1969,7 +1972,7 @@ clean-visualvm: rm -rf visualvm rm -f stamps/visualvm.stamp -stamps/nbplatform.stamp: $(BOOTSTRAP_DIRECTORY_STAMP) stamps/extract.stamp \ +stamps/nbplatform.stamp: $(BOOTSTRAP_DIRECTORY_STAMP) stamps/replace-hotspot.stamp \ stamps/download.stamp if WITH_VISUALVM cd netbeans ; \ @@ -2059,6 +2062,8 @@ plugs: stamps/plugs.stamp rt-class-files: stamps/rt-class-files.stamp +replace-hotspot: stamps/replace-hotspot.stamp + hotspot-tools-class-files: stamps/hotspot-tools-class-files.stamp hotspot-tools-copy-source-files: stamps/hotspot-tools-copy-source-files.stamp From omajid at redhat.com Mon Jun 8 14:24:45 2009 From: omajid at redhat.com (Omair Majid) Date: Mon, 08 Jun 2009 17:24:45 -0400 Subject: RFC: Netx - Fix BasicService.isOffline() Message-ID: <4A2D819D.9060604@redhat.com> Hi, The attached patch implements XBasicService.isOffline(). ChangeLog 2009-06-08 Omair Majid * rt/net/sourceforge/jnlp/services/XBasicService.java (isOffline): Check if the system is offline by retrieving data from a URL. (findFirstURLFromJNLPFile): New function. Obtain a URL from the JNLP file. As a last resort, return an arbitrary known URL. Any comments? Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-basicservice-isoffline.patch Type: text/x-patch Size: 3035 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090608/3b5e0d55/attachment.bin From rupertlssmith at googlemail.com Mon Jun 8 14:48:07 2009 From: rupertlssmith at googlemail.com (Rupert Smith) Date: Mon, 8 Jun 2009 22:48:07 +0100 Subject: Icedtea - NIO2 Linux Asynchronous File IO. Message-ID: Hi, I have been checking out icedtea6 today, in order to examine its support for nio2. Looking through the source, I cannot find an implementation of asynchronous file IO for Linux, but I just wanted to check with someone in the know if that is the case, as the code base is quite large, maybe I overlooked it? I think 'SimpleAsynchronousFileChannelImpl.java' is the one that a Linux build will use, which implements it by handing off IO events to a thread pool, which is a portable solution not taking advantage of OS specific asynchronous IO support. I have a partial implementation of asynchronous file IO, built on top of libaio. If I wanted to contribute this to the project, would the correct place to do so be as part of icedtea, or upstream as part of openjdk? Thanks for your answers. Rupert -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090608/7d5d31e8/attachment.html From gnu_andrew at member.fsf.org Mon Jun 8 15:00:19 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Mon, 8 Jun 2009 23:00:19 +0100 Subject: Icedtea - NIO2 Linux Asynchronous File IO. In-Reply-To: References: Message-ID: <17c6771e0906081500hc3b5ffah9c0c8765f726ba17@mail.gmail.com> 2009/6/8 Rupert Smith : > Hi, > > I have been checking out icedtea6 today, in order to examine its support for > nio2. Looking through the source, I cannot find an implementation of > asynchronous file IO for Linux, but I just wanted to check with someone in > the know if that is the case, as the code base is quite large, maybe I > overlooked it? > > I think 'SimpleAsynchronousFileChannelImpl.java' is the one that a Linux > build will use, which implements it by handing off IO events to a thread > pool, which is a portable solution not taking advantage of OS specific > asynchronous IO support. > > I have a partial implementation of asynchronous file IO, built on top of > libaio. If I wanted to contribute this to the project, would the correct > place to do so be as part of icedtea, or upstream as part of openjdk? > > Thanks for your answers. > > Rupert > Upstream OpenJDK is the place to contribute (specifically http://openjdk.java.net/projects/nio), but I think you'll find there is a GNU/Linux implementation in overlays/nio2/openjdk/jdk/src/solaris/native/sun/nio/ch/EPollPort.c -- 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 dbhole at redhat.com Mon Jun 8 15:56:21 2009 From: dbhole at redhat.com (Deepak Bhole) Date: Mon, 8 Jun 2009 18:56:21 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <4A296FF5.2020703@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> <20090603180752.GB21904@redhat.com> <4A27DC10.9070600@redhat.com> <20090604214722.GA29542@redhat.com> <4A296FF5.2020703@redhat.com> Message-ID: <20090608225621.GB21227@redhat.com> * Omair Majid [2009-06-05 15:20]: I can create an exploit with this patch == BEGIN == 1. Unzip the attached zip file in a location accessible via a web server Note: You *must* copy it to a server accessible location since the attack relies on cache, which kicks in only when loading via a server. 2. Edit exploit-poc.jnlp and replace instances of "http://example.org/" with http://// 3. Clear your cache files (/tmp/cache and ~/.icedteaplugin/cache) 4. Run: javaws http:////test.jnlp This will throw an access exception: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read) 3. Now edit exploit-poc.jnlp and change the resource element from: to: where "$LOCATION" is the location where exploit.jar is cached. Older versions cached it in /tmp/cache//
/patch/jarname while the newer ones do it in ~/.icedteaplugin/cache/.../ . If you are unsure, just run 'find ~/.icedteaplugin/ /tmp/cache/ -name Exploit.jar' 4. Save exploit-poc.jnlp and re-load it via javaws You will see a list of items in your home directory. This implies that the unsigned code is running with full privileges. == END == You can fix this by adding a check for -jar like others, but rather than excluding specific items, it would be better to check for allowed items. java-vm-args accepts only certain args: http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html (scroll to resources element). This covers any future arguments that might get added to java that allow classpath specification. Cheers, Deepak -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jnlpvmargs-exploit-poc.zip Type: application/zip Size: 3084 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090608/ae5fbc1f/attachment.zip From rupertlssmith at googlemail.com Mon Jun 8 18:03:07 2009 From: rupertlssmith at googlemail.com (Rupert Smith) Date: Tue, 9 Jun 2009 02:03:07 +0100 Subject: Icedtea - NIO2 Linux Asynchronous File IO. In-Reply-To: <17c6771e0906081500hc3b5ffah9c0c8765f726ba17@mail.gmail.com> References: <17c6771e0906081500hc3b5ffah9c0c8765f726ba17@mail.gmail.com> Message-ID: Thanks. I thought that EPollPort.c was just for sockets and not files? I'll look into it a bit more, see if can understand how it all fits together. Rupert 2009/6/8 Andrew John Hughes > 2009/6/8 Rupert Smith : > > Hi, > > > > I have been checking out icedtea6 today, in order to examine its support > for > > nio2. Looking through the source, I cannot find an implementation of > > asynchronous file IO for Linux, but I just wanted to check with someone > in > > the know if that is the case, as the code base is quite large, maybe I > > overlooked it? > > > > I think 'SimpleAsynchronousFileChannelImpl.java' is the one that a Linux > > build will use, which implements it by handing off IO events to a thread > > pool, which is a portable solution not taking advantage of OS specific > > asynchronous IO support. > > > > I have a partial implementation of asynchronous file IO, built on top of > > libaio. If I wanted to contribute this to the project, would the correct > > place to do so be as part of icedtea, or upstream as part of openjdk? > > > > Thanks for your answers. > > > > Rupert > > > > Upstream OpenJDK is the place to contribute (specifically > http://openjdk.java.net/projects/nio), but I think you'll find there > is a GNU/Linux implementation in > overlays/nio2/openjdk/jdk/src/solaris/native/sun/nio/ch/EPollPort.c > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090609/44f79e46/attachment.html From gbenson at redhat.com Tue Jun 9 03:23:51 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 09 Jun 2009 10:23:51 +0000 Subject: changeset in /hg/icedtea6: 2009-06-09 Gary Benson changeset d55dfba8404f in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=d55dfba8404f description: 2009-06-09 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::get_interface_callee): New argument. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::scan_for_traps): Update traps for invokeinterface. (SharkTopLevelBlock::get_callee): Pass method to get_interface_callee. (SharkTopLevelBlock::get_interface_callee): Removed constant pool lookup. * patches/hotspot/default/icedtea-shark.patch (ciMethod::itable_index): New method. diffstat: 3 files changed, 31 insertions(+), 23 deletions(-) ChangeLog | 15 ++++++ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 37 ++++++--------- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 2 diffs (116 lines): diff -r 0be8e3334758 -r d55dfba8404f ChangeLog --- a/ChangeLog Mon Jun 08 14:26:32 2009 -0400 +++ b/ChangeLog Tue Jun 09 06:22:07 2009 -0400 @@ -1,3 +1,18 @@ 2009-06-08 Omair Majid + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::get_interface_callee): New argument. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Update traps for + invokeinterface. + (SharkTopLevelBlock::get_callee): Pass method to + get_interface_callee. + (SharkTopLevelBlock::get_interface_callee): Removed constant + pool lookup. + + * patches/hotspot/default/icedtea-shark.patch + (ciMethod::itable_index): New method. + 2009-06-08 Omair Majid * Makefile.am diff -r 0be8e3334758 -r d55dfba8404f ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Mon Jun 08 14:26:32 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 09 06:22:07 2009 -0400 @@ -107,8 +107,14 @@ void SharkTopLevelBlock::scan_for_traps( if (method->holder() == function()->env()->Object_klass()) Unimplemented(); - // Continue to the check - index = iter()->get_method_index(); + // Bail out if the holder is unloaded + if (!method->holder()->is_linked()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_uninitialized, + Deoptimization::Action_reinterpret), bci()); + return; + } break; case Bytecodes::_new: @@ -873,7 +879,7 @@ Value *SharkTopLevelBlock::get_callee(Ca case CALL_VIRTUAL: return get_virtual_callee(receiver, method); case CALL_INTERFACE: - return get_interface_callee(receiver); + return get_interface_callee(receiver, method); default: ShouldNotReachHere(); } @@ -911,11 +917,9 @@ Value *SharkTopLevelBlock::get_virtual_c } // Interface calls are handled here -Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver) -{ - SharkConstantPool constants(this); - Value *cache = constants.cache_entry_at(iter()->get_method_index()); - +Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver, + ciMethod* method) +{ BasicBlock *loop = function()->CreateBlock("loop"); BasicBlock *got_null = function()->CreateBlock("got_null"); BasicBlock *not_null = function()->CreateBlock("not_null"); @@ -955,11 +959,7 @@ Value* SharkTopLevelBlock::get_interface itable_start, BytesPerLong, itable_start_name); // Locate this interface's entry in the table - Value *iklass = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f1_offset(), - SharkType::jobject_type(), - "iklass"); - + Value *iklass = builder()->CreateInlineOop(method->holder()); BasicBlock *loop_entry = builder()->GetInsertBlock(); builder()->CreateBr(loop); builder()->SetInsertPoint(loop); @@ -1009,11 +1009,6 @@ Value* SharkTopLevelBlock::get_interface offset = builder()->CreateIntCast(offset, SharkType::intptr_type(), false); - Value *index = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f2_offset(), - SharkType::intptr_type(), - "index"); - return builder()->CreateLoad( builder()->CreateIntToPtr( builder()->CreateAdd( @@ -1022,10 +1017,8 @@ Value* SharkTopLevelBlock::get_interface builder()->CreatePtrToInt( object_klass, SharkType::intptr_type()), offset), - builder()->CreateShl( - index, - LLVMValue::intptr_constant( - exact_log2(itableMethodEntry::size() * wordSize)))), + LLVMValue::intptr_constant( + method->itable_index() * itableMethodEntry::size() * wordSize)), LLVMValue::intptr_constant( itableMethodEntry::method_offset_in_bytes())), PointerType::getUnqual(SharkType::methodOop_type())), diff -r 0be8e3334758 -r d55dfba8404f ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Mon Jun 08 14:26:32 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Tue Jun 09 06:22:07 2009 -0400 @@ -383,7 +383,7 @@ class SharkTopLevelBlock : public SharkB llvm::Value* get_direct_callee(ciMethod* method); llvm::Value* get_virtual_callee(SharkValue* receiver, ciMethod* method); - llvm::Value* get_interface_callee(SharkValue* receiver); + llvm::Value* get_interface_callee(SharkValue* receiver, ciMethod* method); void do_call(); From gbenson at redhat.com Tue Jun 9 04:09:11 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 9 Jun 2009 12:09:11 +0100 Subject: Shark invokeinterface improvements (part 2) Message-ID: <20090609110911.GE3177@redhat.com> Hi all, This commit replaces the interpreter-style constant pool lookup of the method and itable index with compile time lookups. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 0be8e3334758 -r d55dfba8404f ChangeLog --- a/ChangeLog Mon Jun 08 14:26:32 2009 -0400 +++ b/ChangeLog Tue Jun 09 06:22:07 2009 -0400 @@ -1,3 +1,18 @@ +2009-06-09 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::get_interface_callee): New argument. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Update traps for + invokeinterface. + (SharkTopLevelBlock::get_callee): Pass method to + get_interface_callee. + (SharkTopLevelBlock::get_interface_callee): Removed constant + pool lookup. + + * patches/hotspot/default/icedtea-shark.patch + (ciMethod::itable_index): New method. + 2009-06-08 Omair Majid * Makefile.am diff -r 0be8e3334758 -r d55dfba8404f ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Mon Jun 08 14:26:32 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 09 06:22:07 2009 -0400 @@ -107,8 +107,14 @@ if (method->holder() == function()->env()->Object_klass()) Unimplemented(); - // Continue to the check - index = iter()->get_method_index(); + // Bail out if the holder is unloaded + if (!method->holder()->is_linked()) { + set_trap( + Deoptimization::make_trap_request( + Deoptimization::Reason_uninitialized, + Deoptimization::Action_reinterpret), bci()); + return; + } break; case Bytecodes::_new: @@ -873,7 +879,7 @@ case CALL_VIRTUAL: return get_virtual_callee(receiver, method); case CALL_INTERFACE: - return get_interface_callee(receiver); + return get_interface_callee(receiver, method); default: ShouldNotReachHere(); } @@ -911,11 +917,9 @@ } // Interface calls are handled here -Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver) +Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver, + ciMethod* method) { - SharkConstantPool constants(this); - Value *cache = constants.cache_entry_at(iter()->get_method_index()); - BasicBlock *loop = function()->CreateBlock("loop"); BasicBlock *got_null = function()->CreateBlock("got_null"); BasicBlock *not_null = function()->CreateBlock("not_null"); @@ -955,11 +959,7 @@ itable_start, BytesPerLong, itable_start_name); // Locate this interface's entry in the table - Value *iklass = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f1_offset(), - SharkType::jobject_type(), - "iklass"); - + Value *iklass = builder()->CreateInlineOop(method->holder()); BasicBlock *loop_entry = builder()->GetInsertBlock(); builder()->CreateBr(loop); builder()->SetInsertPoint(loop); @@ -1009,11 +1009,6 @@ offset = builder()->CreateIntCast(offset, SharkType::intptr_type(), false); - Value *index = builder()->CreateValueOfStructEntry( - cache, ConstantPoolCacheEntry::f2_offset(), - SharkType::intptr_type(), - "index"); - return builder()->CreateLoad( builder()->CreateIntToPtr( builder()->CreateAdd( @@ -1022,10 +1017,8 @@ builder()->CreatePtrToInt( object_klass, SharkType::intptr_type()), offset), - builder()->CreateShl( - index, - LLVMValue::intptr_constant( - exact_log2(itableMethodEntry::size() * wordSize)))), + LLVMValue::intptr_constant( + method->itable_index() * itableMethodEntry::size() * wordSize)), LLVMValue::intptr_constant( itableMethodEntry::method_offset_in_bytes())), PointerType::getUnqual(SharkType::methodOop_type())), diff -r 0be8e3334758 -r d55dfba8404f ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Mon Jun 08 14:26:32 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Tue Jun 09 06:22:07 2009 -0400 @@ -383,7 +383,7 @@ llvm::Value* get_direct_callee(ciMethod* method); llvm::Value* get_virtual_callee(SharkValue* receiver, ciMethod* method); - llvm::Value* get_interface_callee(SharkValue* receiver); + llvm::Value* get_interface_callee(SharkValue* receiver, ciMethod* method); void do_call(); From gbenson at redhat.com Tue Jun 9 05:55:58 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 09 Jun 2009 12:55:58 +0000 Subject: changeset in /hg/icedtea6: 2009-06-09 Gary Benson changeset ff13b7d6e330 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=ff13b7d6e330 description: 2009-06-09 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::scan_for_traps): Removed unused code. * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: Removed. * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp: Likewise. * patches/hotspot/default/icedtea-shark.patch (ciInstanceKlass::is_cache_entry_resolved): Removed. (ciInstanceKlass::constant_pool_tag_at): Likewise. * ports/hotspot/src/share/vm/includeDB_shark: Updated. diffstat: 6 files changed, 49 insertions(+), 274 deletions(-) ChangeLog | 14 + patches/hotspot/default/icedtea-shark.patch | 76 ++++----- ports/hotspot/src/share/vm/includeDB_shark | 19 -- ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp | 125 --------------- ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp | 75 --------- ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 14 - diffs (381 lines): diff -r d55dfba8404f -r ff13b7d6e330 ChangeLog --- a/ChangeLog Tue Jun 09 06:22:07 2009 -0400 +++ b/ChangeLog Tue Jun 09 08:53:57 2009 -0400 @@ -1,3 +1,17 @@ 2009-06-09 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Removed unused code. + + * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: Removed. + * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp: Likewise. + + * patches/hotspot/default/icedtea-shark.patch + (ciInstanceKlass::is_cache_entry_resolved): Removed. + (ciInstanceKlass::constant_pool_tag_at): Likewise. + + * ports/hotspot/src/share/vm/includeDB_shark: Updated. + 2009-06-09 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r d55dfba8404f -r ff13b7d6e330 patches/hotspot/default/icedtea-shark.patch --- a/patches/hotspot/default/icedtea-shark.patch Tue Jun 09 06:22:07 2009 -0400 +++ b/patches/hotspot/default/icedtea-shark.patch Tue Jun 09 08:53:57 2009 -0400 @@ -337,46 +337,40 @@ } // ------------------------------------------------------------------ -diff -r 5297ff20101d openjdk-ecj/hotspot/src/share/vm/ci/ciInstanceKlass.cpp ---- openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Mon Dec 15 15:32:37 2008 +0000 -+++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Tue Apr 21 09:47:27 2009 +0100 -@@ -548,3 +548,23 @@ - } - return impl; - } +diff -r 12c97e7e55eb -r e6fef2ef2fea openjdk/hotspot/src/share/vm/ci/ciMethod.cpp +--- openjdk/hotspot/src/share/vm/ci/ciMethod.cpp Tue Jun 09 09:17:11 2009 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciMethod.cpp Tue Jun 09 10:04:02 2009 +0100 +@@ -229,6 +229,20 @@ + } + + ++#ifdef SHARK ++// ------------------------------------------------------------------ ++// ciMethod::itable_index ++// ++// Get the position of this method's entry in the itable, if any. ++int ciMethod::itable_index() { ++ check_is_loaded(); ++ assert(holder()->is_linked(), "must be linked"); ++ VM_ENTRY_MARK; ++ return klassItable::compute_itable_index(get_methodOop()); ++} ++#endif // SHARK + -+#ifdef SHARK -+// ------------------------------------------------------------------ -+// ciInstanceKlass::constant_pool_tag_at -+// -+// What is in this constant pool slot? -+constantTag ciInstanceKlass::constant_pool_tag_at(int index) { -+ VM_ENTRY_MARK; -+ return get_instanceKlass()->constants()->tag_at(index); -+} + -+// ------------------------------------------------------------------ -+// ciInstanceKlass::is_cache_entry_resolved -+// -+// Is this entry in the constant pool cache resolved? -+bool ciInstanceKlass::is_cache_entry_resolved(int index, Bytecodes::Code opcode) { -+ VM_ENTRY_MARK; -+ return get_instanceKlass()->constants()->cache()->entry_at(index)->is_resolved(opcode); -+} -+#endif // SHARK -diff -r 5297ff20101d openjdk-ecj/hotspot/src/share/vm/ci/ciInstanceKlass.hpp ---- openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Mon Dec 15 15:32:37 2008 +0000 -+++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Tue Apr 21 09:47:27 2009 +0100 -@@ -198,4 +198,12 @@ - // What kind of ciObject is this? - bool is_instance_klass() { return true; } - bool is_java_klass() { return true; } -+ -+#ifdef SHARK -+ // What is in this constant pool slot? -+ constantTag constant_pool_tag_at(int index); -+ -+ // Is this entry in the constant pool cache resolved? -+ bool is_cache_entry_resolved(int index, Bytecodes::Code opcode); -+#endif // SHARK - }; + // ------------------------------------------------------------------ + // ciMethod::native_entry + // +diff -r 12c97e7e55eb -r e6fef2ef2fea openjdk/hotspot/src/share/vm/ci/ciMethod.hpp +--- openjdk/hotspot/src/share/vm/ci/ciMethod.hpp Tue Jun 09 09:17:11 2009 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciMethod.hpp Tue Jun 09 10:04:02 2009 +0100 +@@ -139,6 +139,9 @@ + + // Runtime information. + int vtable_index(); ++#ifdef SHARK ++ int itable_index(); ++#endif // SHARK + address native_entry(); + address interpreter_entry(); + diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/includeDB_shark --- a/ports/hotspot/src/share/vm/includeDB_shark Tue Jun 09 06:22:07 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Tue Jun 09 08:53:57 2009 -0400 @@ -170,24 +170,6 @@ sharkConstant.hpp sharkConstant.hpp sharkBuilder.hpp sharkConstant.hpp sharkValue.hpp -sharkConstantPool.cpp allocation.hpp -sharkConstantPool.cpp constantPoolOop.hpp -sharkConstantPool.cpp cpCacheOop.hpp -sharkConstantPool.cpp debug.hpp -sharkConstantPool.cpp llvmHeaders.hpp -sharkConstantPool.cpp llvmValue.hpp -sharkConstantPool.cpp methodOop.hpp -sharkConstantPool.cpp sharkBuilder.hpp -sharkConstantPool.cpp sharkConstantPool.hpp -sharkConstantPool.cpp sharkState.inline.hpp -sharkConstantPool.cpp sharkType.hpp -sharkConstantPool.cpp sharkValue.hpp - -sharkConstantPool.hpp allocation.hpp -sharkConstantPool.hpp llvmHeaders.hpp -sharkConstantPool.hpp sharkBuilder.hpp -sharkConstantPool.hpp sharkTopLevelBlock.hpp - sharkEntry.cpp sharkEntry.hpp sharkEntry.hpp llvmHeaders.hpp @@ -316,7 +298,6 @@ sharkTopLevelBlock.cpp sharkTopLevelBlock.cpp sharkTopLevelBlock.hpp sharkTopLevelBlock.cpp sharkBuilder.hpp sharkTopLevelBlock.cpp sharkConstant.hpp -sharkTopLevelBlock.cpp sharkConstantPool.hpp sharkTopLevelBlock.cpp sharkInliner.hpp sharkTopLevelBlock.cpp sharkRuntime.hpp sharkTopLevelBlock.cpp sharkState.inline.hpp diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp --- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp Tue Jun 09 06:22:07 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008, 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - -#include "incls/_precompiled.incl" -#include "incls/_sharkConstantPool.cpp.incl" - -using namespace llvm; - -Value *SharkConstantPool::constants() -{ - Value *m = method(); - if (m != _constants_method) { - _constants = builder()->CreateValueOfStructEntry( - m, methodOopDesc::constants_offset(), - SharkType::oop_type(), "constants"); - _constants_method = m; - } - return _constants; -} - -Value *SharkConstantPool::tags() -{ - Value *cp = constants(); - if (cp != _tags_constants) { - _tags = builder()->CreateValueOfStructEntry( - cp, in_ByteSize(constantPoolOopDesc::tags_offset_in_bytes()), - SharkType::oop_type(), "tags"); - _tags_constants = cp; - } - return _tags; -} - -Value *SharkConstantPool::cache() -{ - Value *cp = constants(); - if (cp != _cache_constants) { - _cache = builder()->CreateValueOfStructEntry( - cp, in_ByteSize(constantPoolOopDesc::cache_offset_in_bytes()), - SharkType::oop_type(), "cache"); - _cache_constants = cp; - } - return _cache; -} - -Value *SharkConstantPool::object_at(int which) -{ - return builder()->CreateLoad( - builder()->CreateArrayAddress( - constants(), - T_OBJECT, in_ByteSize(sizeof(constantPoolOopDesc)), - LLVMValue::jint_constant(which))); -} - -Value *SharkConstantPool::tag_at(int which) -{ - return builder()->CreateLoad( - builder()->CreateArrayAddress( - tags(), T_BYTE, LLVMValue::jint_constant(which))); -} - -Value *SharkConstantPool::cache_entry_at(int which) -{ - // Takes a constant pool cache index in byte-swapped byte order - // (which comes from the bytecodes after rewriting). This is a - // bizarre hack but it's the same as - // constantPoolOopDesc::field_or_method_at(). - which = Bytes::swap_u2(which); - assert(target()->holder()->is_cache_entry_resolved(which, block()->bc()), - "should be"); - - return builder()->CreateIntToPtr( - builder()->CreateAdd( - builder()->CreatePtrToInt( - cache(), SharkType::intptr_type()), - LLVMValue::intptr_constant( - in_bytes(constantPoolCacheOopDesc::base_offset()) + - which * sizeof(ConstantPoolCacheEntry))), - SharkType::cpCacheEntry_type()); -} - -Value *SharkConstantPool::java_mirror() -{ - Value *cp = constants(); - - Value *pool_holder = builder()->CreateValueOfStructEntry( - cp, - in_ByteSize(constantPoolOopDesc::pool_holder_offset_in_bytes()), - SharkType::oop_type(), - "pool_holder"); - - Value *klass_part = builder()->CreateAddressOfStructEntry( - pool_holder, - in_ByteSize(klassOopDesc::klass_part_offset_in_bytes()), - SharkType::klass_type(), - "klass_part"); - - // XXX should there be a memory barrier before this load? - return builder()->CreateValueOfStructEntry( - klass_part, - in_ByteSize(Klass::java_mirror_offset_in_bytes()), - SharkType::oop_type(), - "java_mirror"); -} diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp --- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp Tue Jun 09 06:22:07 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008, 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - -class SharkConstantPool : public StackObj { - public: - SharkConstantPool(SharkTopLevelBlock* block) - : _block(block), - _constants_method(NULL), - _tags_constants(NULL), - _cache_constants(NULL) {} - - private: - SharkTopLevelBlock* _block; - - private: - SharkTopLevelBlock* block() const - { - return _block; - } - SharkBuilder* builder() const - { - return block()->builder(); - } - ciMethod* target() const - { - return block()->target(); - } - llvm::Value* method() const - { - return block()->method(); - } - - private: - llvm::Value* _constants; // The constant pool, a constantPoolOop - llvm::Value* _constants_method; // The method _constants was loaded from - - llvm::Value* _tags; // The tags array, a typeArrayOop - llvm::Value* _tags_constants; // The constantPoolOop _tags is in - - llvm::Value* _cache; // The cache, a constantPoolCacheOop - llvm::Value* _cache_constants; // The constantPoolCacheOop _cache is in - - private: - llvm::Value* constants(); - llvm::Value* tags(); - llvm::Value* cache(); - - public: - llvm::Value* object_at(int which); - llvm::Value* tag_at(int which); - llvm::Value* cache_entry_at(int which); - llvm::Value* java_mirror(); -}; diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 09 06:22:07 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 09 08:53:57 2009 -0400 @@ -44,8 +44,6 @@ void SharkTopLevelBlock::scan_for_traps( bool will_link; bool is_field; - int index = -1; - switch (bc()) { case Bytecodes::_ldc: case Bytecodes::_ldc_w: @@ -140,18 +138,6 @@ void SharkTopLevelBlock::scan_for_traps( return; } break; - } - - // If we found a constant pool access on this bytecode then check it - if (index != -1) { - if (!target()->holder()->is_cache_entry_resolved( - Bytes::swap_u2(index), bc())) { - set_trap( - Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret), bci()); - return; - } } } From gbenson at redhat.com Tue Jun 9 05:59:36 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 9 Jun 2009 13:59:36 +0100 Subject: Shark clearout Message-ID: <20090609125936.GH3177@redhat.com> Hi all, My commits over the past week have replaced all constant pool accesses in Shark. This commit removes the constant pool access code itself, and some hacks that were required to support it. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r d55dfba8404f -r ff13b7d6e330 ChangeLog --- a/ChangeLog Tue Jun 09 06:22:07 2009 -0400 +++ b/ChangeLog Tue Jun 09 08:53:57 2009 -0400 @@ -1,3 +1,17 @@ +2009-06-09 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Removed unused code. + + * ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp: Removed. + * ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp: Likewise. + + * patches/hotspot/default/icedtea-shark.patch + (ciInstanceKlass::is_cache_entry_resolved): Removed. + (ciInstanceKlass::constant_pool_tag_at): Likewise. + + * ports/hotspot/src/share/vm/includeDB_shark: Updated. + 2009-06-09 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r d55dfba8404f -r ff13b7d6e330 patches/hotspot/default/icedtea-shark.patch --- a/patches/hotspot/default/icedtea-shark.patch Tue Jun 09 06:22:07 2009 -0400 +++ b/patches/hotspot/default/icedtea-shark.patch Tue Jun 09 08:53:57 2009 -0400 @@ -337,46 +337,40 @@ } // ------------------------------------------------------------------ -diff -r 5297ff20101d openjdk-ecj/hotspot/src/share/vm/ci/ciInstanceKlass.cpp ---- openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Mon Dec 15 15:32:37 2008 +0000 -+++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.cpp Tue Apr 21 09:47:27 2009 +0100 -@@ -548,3 +548,23 @@ - } - return impl; +diff -r 12c97e7e55eb -r e6fef2ef2fea openjdk/hotspot/src/share/vm/ci/ciMethod.cpp +--- openjdk/hotspot/src/share/vm/ci/ciMethod.cpp Tue Jun 09 09:17:11 2009 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciMethod.cpp Tue Jun 09 10:04:02 2009 +0100 +@@ -229,6 +229,20 @@ } -+ + + +#ifdef SHARK +// ------------------------------------------------------------------ -+// ciInstanceKlass::constant_pool_tag_at ++// ciMethod::itable_index +// -+// What is in this constant pool slot? -+constantTag ciInstanceKlass::constant_pool_tag_at(int index) { ++// Get the position of this method's entry in the itable, if any. ++int ciMethod::itable_index() { ++ check_is_loaded(); ++ assert(holder()->is_linked(), "must be linked"); + VM_ENTRY_MARK; -+ return get_instanceKlass()->constants()->tag_at(index); -+} -+ -+// ------------------------------------------------------------------ -+// ciInstanceKlass::is_cache_entry_resolved -+// -+// Is this entry in the constant pool cache resolved? -+bool ciInstanceKlass::is_cache_entry_resolved(int index, Bytecodes::Code opcode) { -+ VM_ENTRY_MARK; -+ return get_instanceKlass()->constants()->cache()->entry_at(index)->is_resolved(opcode); ++ return klassItable::compute_itable_index(get_methodOop()); +} +#endif // SHARK -diff -r 5297ff20101d openjdk-ecj/hotspot/src/share/vm/ci/ciInstanceKlass.hpp ---- openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Mon Dec 15 15:32:37 2008 +0000 -+++ openjdk/hotspot/src/share/vm/ci/ciInstanceKlass.hpp Tue Apr 21 09:47:27 2009 +0100 -@@ -198,4 +198,12 @@ - // What kind of ciObject is this? - bool is_instance_klass() { return true; } - bool is_java_klass() { return true; } + ++ + // ------------------------------------------------------------------ + // ciMethod::native_entry + // +diff -r 12c97e7e55eb -r e6fef2ef2fea openjdk/hotspot/src/share/vm/ci/ciMethod.hpp +--- openjdk/hotspot/src/share/vm/ci/ciMethod.hpp Tue Jun 09 09:17:11 2009 +0100 ++++ openjdk/hotspot/src/share/vm/ci/ciMethod.hpp Tue Jun 09 10:04:02 2009 +0100 +@@ -139,6 +139,9 @@ + + // Runtime information. + int vtable_index(); +#ifdef SHARK -+ // What is in this constant pool slot? -+ constantTag constant_pool_tag_at(int index); -+ -+ // Is this entry in the constant pool cache resolved? -+ bool is_cache_entry_resolved(int index, Bytecodes::Code opcode); ++ int itable_index(); +#endif // SHARK - }; + address native_entry(); + address interpreter_entry(); + diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/includeDB_shark --- a/ports/hotspot/src/share/vm/includeDB_shark Tue Jun 09 06:22:07 2009 -0400 +++ b/ports/hotspot/src/share/vm/includeDB_shark Tue Jun 09 08:53:57 2009 -0400 @@ -170,24 +170,6 @@ sharkConstant.hpp sharkBuilder.hpp sharkConstant.hpp sharkValue.hpp -sharkConstantPool.cpp allocation.hpp -sharkConstantPool.cpp constantPoolOop.hpp -sharkConstantPool.cpp cpCacheOop.hpp -sharkConstantPool.cpp debug.hpp -sharkConstantPool.cpp llvmHeaders.hpp -sharkConstantPool.cpp llvmValue.hpp -sharkConstantPool.cpp methodOop.hpp -sharkConstantPool.cpp sharkBuilder.hpp -sharkConstantPool.cpp sharkConstantPool.hpp -sharkConstantPool.cpp sharkState.inline.hpp -sharkConstantPool.cpp sharkType.hpp -sharkConstantPool.cpp sharkValue.hpp - -sharkConstantPool.hpp allocation.hpp -sharkConstantPool.hpp llvmHeaders.hpp -sharkConstantPool.hpp sharkBuilder.hpp -sharkConstantPool.hpp sharkTopLevelBlock.hpp - sharkEntry.cpp sharkEntry.hpp sharkEntry.hpp llvmHeaders.hpp @@ -316,7 +298,6 @@ sharkTopLevelBlock.cpp sharkTopLevelBlock.hpp sharkTopLevelBlock.cpp sharkBuilder.hpp sharkTopLevelBlock.cpp sharkConstant.hpp -sharkTopLevelBlock.cpp sharkConstantPool.hpp sharkTopLevelBlock.cpp sharkInliner.hpp sharkTopLevelBlock.cpp sharkRuntime.hpp sharkTopLevelBlock.cpp sharkState.inline.hpp diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp --- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.cpp Tue Jun 09 06:22:07 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008, 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - -#include "incls/_precompiled.incl" -#include "incls/_sharkConstantPool.cpp.incl" - -using namespace llvm; - -Value *SharkConstantPool::constants() -{ - Value *m = method(); - if (m != _constants_method) { - _constants = builder()->CreateValueOfStructEntry( - m, methodOopDesc::constants_offset(), - SharkType::oop_type(), "constants"); - _constants_method = m; - } - return _constants; -} - -Value *SharkConstantPool::tags() -{ - Value *cp = constants(); - if (cp != _tags_constants) { - _tags = builder()->CreateValueOfStructEntry( - cp, in_ByteSize(constantPoolOopDesc::tags_offset_in_bytes()), - SharkType::oop_type(), "tags"); - _tags_constants = cp; - } - return _tags; -} - -Value *SharkConstantPool::cache() -{ - Value *cp = constants(); - if (cp != _cache_constants) { - _cache = builder()->CreateValueOfStructEntry( - cp, in_ByteSize(constantPoolOopDesc::cache_offset_in_bytes()), - SharkType::oop_type(), "cache"); - _cache_constants = cp; - } - return _cache; -} - -Value *SharkConstantPool::object_at(int which) -{ - return builder()->CreateLoad( - builder()->CreateArrayAddress( - constants(), - T_OBJECT, in_ByteSize(sizeof(constantPoolOopDesc)), - LLVMValue::jint_constant(which))); -} - -Value *SharkConstantPool::tag_at(int which) -{ - return builder()->CreateLoad( - builder()->CreateArrayAddress( - tags(), T_BYTE, LLVMValue::jint_constant(which))); -} - -Value *SharkConstantPool::cache_entry_at(int which) -{ - // Takes a constant pool cache index in byte-swapped byte order - // (which comes from the bytecodes after rewriting). This is a - // bizarre hack but it's the same as - // constantPoolOopDesc::field_or_method_at(). - which = Bytes::swap_u2(which); - assert(target()->holder()->is_cache_entry_resolved(which, block()->bc()), - "should be"); - - return builder()->CreateIntToPtr( - builder()->CreateAdd( - builder()->CreatePtrToInt( - cache(), SharkType::intptr_type()), - LLVMValue::intptr_constant( - in_bytes(constantPoolCacheOopDesc::base_offset()) + - which * sizeof(ConstantPoolCacheEntry))), - SharkType::cpCacheEntry_type()); -} - -Value *SharkConstantPool::java_mirror() -{ - Value *cp = constants(); - - Value *pool_holder = builder()->CreateValueOfStructEntry( - cp, - in_ByteSize(constantPoolOopDesc::pool_holder_offset_in_bytes()), - SharkType::oop_type(), - "pool_holder"); - - Value *klass_part = builder()->CreateAddressOfStructEntry( - pool_holder, - in_ByteSize(klassOopDesc::klass_part_offset_in_bytes()), - SharkType::klass_type(), - "klass_part"); - - // XXX should there be a memory barrier before this load? - return builder()->CreateValueOfStructEntry( - klass_part, - in_ByteSize(Klass::java_mirror_offset_in_bytes()), - SharkType::oop_type(), - "java_mirror"); -} diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp --- a/ports/hotspot/src/share/vm/shark/sharkConstantPool.hpp Tue Jun 09 06:22:07 2009 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008, 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - -class SharkConstantPool : public StackObj { - public: - SharkConstantPool(SharkTopLevelBlock* block) - : _block(block), - _constants_method(NULL), - _tags_constants(NULL), - _cache_constants(NULL) {} - - private: - SharkTopLevelBlock* _block; - - private: - SharkTopLevelBlock* block() const - { - return _block; - } - SharkBuilder* builder() const - { - return block()->builder(); - } - ciMethod* target() const - { - return block()->target(); - } - llvm::Value* method() const - { - return block()->method(); - } - - private: - llvm::Value* _constants; // The constant pool, a constantPoolOop - llvm::Value* _constants_method; // The method _constants was loaded from - - llvm::Value* _tags; // The tags array, a typeArrayOop - llvm::Value* _tags_constants; // The constantPoolOop _tags is in - - llvm::Value* _cache; // The cache, a constantPoolCacheOop - llvm::Value* _cache_constants; // The constantPoolCacheOop _cache is in - - private: - llvm::Value* constants(); - llvm::Value* tags(); - llvm::Value* cache(); - - public: - llvm::Value* object_at(int which); - llvm::Value* tag_at(int which); - llvm::Value* cache_entry_at(int which); - llvm::Value* java_mirror(); -}; diff -r d55dfba8404f -r ff13b7d6e330 ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 09 06:22:07 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Tue Jun 09 08:53:57 2009 -0400 @@ -43,8 +43,6 @@ ciInstanceKlass *klass; bool will_link; bool is_field; - - int index = -1; switch (bc()) { case Bytecodes::_ldc: @@ -140,18 +138,6 @@ return; } break; - } - - // If we found a constant pool access on this bytecode then check it - if (index != -1) { - if (!target()->holder()->is_cache_entry_resolved( - Bytes::swap_u2(index), bc())) { - set_trap( - Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret), bci()); - return; - } } } From dbhole at redhat.com Tue Jun 9 09:02:15 2009 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 9 Jun 2009 12:02:15 -0400 Subject: RFC: Netx - Parser support for shortcut, association and related-content elements In-Reply-To: <4A2D422A.8090202@redhat.com> References: <4A2D422A.8090202@redhat.com> Message-ID: <20090609160215.GA17330@redhat.com> * Omair Majid [2009-06-08 12:55]: > Hi, > > The attached patch adds support to the JNLP parser for parsing > association, shortcut and related-content elements from the JNLP file. > Looks fine. New files are missing headers though. Please add them before committing. Deepak > ChangeLog: > 2009-06-08 Omair Majid > > * rt/net/sourceforge/jnlp/AssociationDesc.java: New file. > (AssociationDesc): New function. Create an association descriptor. > (getExtensions): New function. Get the extensions for this > association. > (getMimeType): New function. Get the mimetype for this association. > (checkMimeType): New function. > * rt/net/sourceforge/jnlp/InformationDesc.java > (getAssociations): New function. Get the associations. > (getShortcut): New function. Get the shortcut. > (getRelatedContents): New function. Get the related-contents. > * rt/net/sourceforge/jnlp/MenuDesc.java: New file. > (MenuDesc): New function. > (getSubMenu): New function. Get the submenu for this menu > descriptor. > * rt/net/sourceforge/jnlp/Parser.java > (getInformationDesc): Parse "assocation", "shortcut" and > "related-content" elements. > (getAssociation): New function. Parse the association node to create > a AssociationDesc. > (getShortcut): New function. Parse the shortcut node to create a > ShortcutDesc. > (getMenu): New function. Parse a menu node to create a MenuDesc. > (getRelatedContent): New function. Parse a related-content node to > create a RelatedContentDesc. > * rt/net/sourceforge/jnlp/RelatedContentDesc.java > (RelatedContentDesc): New function. > (setTitle): New function. Set the title of this content. > (getTitle): New function. Get the title of this content. > (setDescription): New function. Set the description of this content. > (getDescription): New function. Get the description of this content. > (getLocation): New function. Get the location of this content. > (setIconDesc): New function. Set the icon descriptor for this > content. > (getIcon): Get the icon descriptor for this content. > * rt/net/sourceforge/jnlp/ShortcutDesc.java > (ShortcutDesc): New function. > (ShortcutDesc): New function. Initialize requiresOnline and > onDesktop. > (isOnline): New function. Return true if the shortcut is online > only. > (onDesktop): New function. Return true if the shortcut should be > placed on the desktop. > (addMenu): New function. Add a menu descriptor for this shortcut. > (getMenu): New function. Return the menu descriptor for this > shortcut. > * rt/net/sourceforge/jnlp/resources/Messages.properties: > Add PTwoDesktops, PTwoMenus, PTwoTitle and PTwoIcons. > > Any comments? > > > Cheers, > Omair From dbhole at redhat.com Tue Jun 9 11:00:37 2009 From: dbhole at redhat.com (Deepak Bhole) Date: Tue, 9 Jun 2009 14:00:37 -0400 Subject: RFC: Netx - Fix BasicService.isOffline() In-Reply-To: <4A2D819D.9060604@redhat.com> References: <4A2D819D.9060604@redhat.com> Message-ID: <20090609180037.GA3528@redhat.com> * Omair Majid [2009-06-08 17:25]: > Hi, > > The attached patch implements XBasicService.isOffline(). > > ChangeLog > 2009-06-08 Omair Majid > > * rt/net/sourceforge/jnlp/services/XBasicService.java > (isOffline): Check if the system is offline by retrieving data from > a URL. > (findFirstURLFromJNLPFile): New function. Obtain a URL from the JNLP > file. As a last resort, return an arbitrary known URL. > > Any comments? > Looks good to me! Deepak > Cheers, > Omair From omajid at redhat.com Tue Jun 9 11:11:45 2009 From: omajid at redhat.com (Omair Majid) Date: Tue, 09 Jun 2009 18:11:45 +0000 Subject: changeset in /hg/icedtea6: 2009-06-09 Omair Majid changeset 852af6e8bf0e in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=852af6e8bf0e description: 2009-06-09 Omair Majid * rt/net/sourceforge/jnlp/AssociationDesc.java: New file. (AssociationDesc): New function. Create an association descriptor. (getExtensions): New function. Get the extensions for this association. (getMimeType): New function. Get the mimetype for this association. (checkMimeType): New function. * rt/net/sourceforge/jnlp/InformationDesc.java (getAssociations): New function. Get the associations. (getShortcut): New function. Get the shortcut. (getRelatedContents): New function. Get the related-contents. * rt/net/sourceforge/jnlp/MenuDesc.java: New file. (MenuDesc): New function. (getSubMenu): New function. Get the submenu for this menu descriptor. * rt/net/sourceforge/jnlp/Parser.java (getInformationDesc): Parse "assocation", "shortcut" and "related-content" elements. (getAssociation): New function. Parse the association node to create a AssociationDesc. (getShortcut): New function. Parse the shortcut node to create a ShortcutDesc. (getMenu): New function. Parse a menu node to create a MenuDesc. (getRelatedContent): New function. Parse a related-content node to create a RelatedContentDesc. * rt/net/sourceforge/jnlp/RelatedContentDesc.java (RelatedContentDesc): New function. (setTitle): New function. Set the title of this content. (getTitle): New function. Get the title of this content. (setDescription): New function. Set the description of this content. (getDescription): New function. Get the description of this content. (getLocation): New function. Get the location of this content. (setIconDesc): New function. Set the icon descriptor for this content. (getIcon): Get the icon descriptor for this content. * rt/net/sourceforge/jnlp/ShortcutDesc.java (ShortcutDesc): New function. Initialize requiresOnline and onDesktop. (isOnline): New function. Return true if the shortcut is online only. (onDesktop): New function. Return true if the shortcut should be placed on the desktop. (addMenu): New function. Add a menu descriptor for this shortcut. (getMenu): New function. Return the menu descriptor for this shortcut. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add PTwoDesktops, PTwoMenus, PTwoTitle and PTwoIcons. diffstat: 8 files changed, 445 insertions(+) ChangeLog | 43 ++++++ rt/net/sourceforge/jnlp/AssociationDesc.java | 56 ++++++++ rt/net/sourceforge/jnlp/InformationDesc.java | 27 ++++ rt/net/sourceforge/jnlp/MenuDesc.java | 38 +++++ rt/net/sourceforge/jnlp/Parser.java | 114 +++++++++++++++++ rt/net/sourceforge/jnlp/RelatedContentDesc.java | 93 +++++++++++++ rt/net/sourceforge/jnlp/ShortcutDesc.java | 70 ++++++++++ rt/net/sourceforge/jnlp/resources/Messages.properties | 4 diffs (truncated from 515 to 500 lines): diff -r ff13b7d6e330 -r 852af6e8bf0e ChangeLog --- a/ChangeLog Tue Jun 09 08:53:57 2009 -0400 +++ b/ChangeLog Tue Jun 09 14:08:52 2009 -0400 @@ -1,3 +1,46 @@ 2009-06-09 Gary Benson + + * rt/net/sourceforge/jnlp/AssociationDesc.java: New file. + (AssociationDesc): New function. Create an association descriptor. + (getExtensions): New function. Get the extensions for this association. + (getMimeType): New function. Get the mimetype for this association. + (checkMimeType): New function. + * rt/net/sourceforge/jnlp/InformationDesc.java + (getAssociations): New function. Get the associations. + (getShortcut): New function. Get the shortcut. + (getRelatedContents): New function. Get the related-contents. + * rt/net/sourceforge/jnlp/MenuDesc.java: New file. + (MenuDesc): New function. + (getSubMenu): New function. Get the submenu for this menu descriptor. + * rt/net/sourceforge/jnlp/Parser.java + (getInformationDesc): Parse "assocation", "shortcut" and + "related-content" elements. + (getAssociation): New function. Parse the association node to create a + AssociationDesc. + (getShortcut): New function. Parse the shortcut node to create a + ShortcutDesc. + (getMenu): New function. Parse a menu node to create a MenuDesc. + (getRelatedContent): New function. Parse a related-content node to create a + RelatedContentDesc. + * rt/net/sourceforge/jnlp/RelatedContentDesc.java + (RelatedContentDesc): New function. + (setTitle): New function. Set the title of this content. + (getTitle): New function. Get the title of this content. + (setDescription): New function. Set the description of this content. + (getDescription): New function. Get the description of this content. + (getLocation): New function. Get the location of this content. + (setIconDesc): New function. Set the icon descriptor for this content. + (getIcon): Get the icon descriptor for this content. + * rt/net/sourceforge/jnlp/ShortcutDesc.java + (ShortcutDesc): New function. Initialize requiresOnline and onDesktop. + (isOnline): New function. Return true if the shortcut is online only. + (onDesktop): New function. Return true if the shortcut should be placed on + the desktop. + (addMenu): New function. Add a menu descriptor for this shortcut. + (getMenu): New function. Return the menu descriptor for this shortcut. + * rt/net/sourceforge/jnlp/resources/Messages.properties: + Add PTwoDesktops, PTwoMenus, PTwoTitle and PTwoIcons. + 2009-06-09 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp diff -r ff13b7d6e330 -r 852af6e8bf0e rt/net/sourceforge/jnlp/AssociationDesc.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rt/net/sourceforge/jnlp/AssociationDesc.java Tue Jun 09 14:08:52 2009 -0400 @@ -0,0 +1,56 @@ +// Copyright (C) 2009 Red Hat, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +package net.sourceforge.jnlp; + +public final class AssociationDesc { + + /** the extensions this application wants to register with */ + private String[] extensions; + + /** the mime type for the association */ + private String mimeType; + + public AssociationDesc(String mimeType, String[] extensions) throws ParseException { + checkMimeType(mimeType); + this.mimeType = mimeType; + this.extensions = extensions; + } + + /** + * Return the extensions for this association + */ + public String[] getExtensions() { + return extensions; + } + + /** + * Return the mimetype for this association + */ + public String getMimeType() { + return mimeType; + } + + /** + * Check for valid mimeType + * @param mimeType a mime type + * @throws ParseException if mimeType is an invalid MIME type + */ + private void checkMimeType(String mimeType) throws ParseException { + // TODO check that mime type is valid + } + +} diff -r ff13b7d6e330 -r 852af6e8bf0e rt/net/sourceforge/jnlp/InformationDesc.java --- a/rt/net/sourceforge/jnlp/InformationDesc.java Tue Jun 09 08:53:57 2009 -0400 +++ b/rt/net/sourceforge/jnlp/InformationDesc.java Tue Jun 09 14:08:52 2009 -0400 @@ -1,4 +1,5 @@ // Copyright (C) 2001-2003 Jon A. Maxwell (JAM) +// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -200,6 +201,32 @@ public class InformationDesc { } /** + * Returns the associations specified in the JNLP file + */ + public AssociationDesc[] getAssociations() { + List associations = getItems("association"); + + return (AssociationDesc[]) associations.toArray(new AssociationDesc[associations.size()]); + } + + /** + * Returns the shortcut specified by this JNLP file + */ + public ShortcutDesc getShortcut() { + return (ShortcutDesc) getItem("shortcut"); + } + + /** + * Returns the related-contents specified by this JNLP file + */ + public RelatedContentDesc[] getRelatedContents() { + List relatedContents = getItems("related-content"); + + return (RelatedContentDesc[]) relatedContents.toArray( + new RelatedContentDesc[relatedContents.size()]); + } + + /** * Returns the last item matching the specified key. */ protected Object getItem(Object key) { diff -r ff13b7d6e330 -r 852af6e8bf0e rt/net/sourceforge/jnlp/MenuDesc.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rt/net/sourceforge/jnlp/MenuDesc.java Tue Jun 09 14:08:52 2009 -0400 @@ -0,0 +1,38 @@ +// Copyright (C) 2009 Red Hat, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +package net.sourceforge.jnlp; + +public class MenuDesc { + + /** the submenu for this menu entry */ + private String subMenu; + + /** + * Create a new menu descriptor + */ + public MenuDesc(String subMenu) { + this.subMenu = subMenu; + } + + /** + * Returns the submenu for this menu entry. + */ + public String getSubMenu() { + return subMenu; + } + +} diff -r ff13b7d6e330 -r 852af6e8bf0e rt/net/sourceforge/jnlp/Parser.java --- a/rt/net/sourceforge/jnlp/Parser.java Tue Jun 09 08:53:57 2009 -0400 +++ b/rt/net/sourceforge/jnlp/Parser.java Tue Jun 09 14:08:52 2009 -0400 @@ -1,4 +1,5 @@ // Copyright (C) 2001-2003 Jon A. Maxwell (JAM) +// Copyright (C) 2009 Red Hat, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -435,6 +436,15 @@ class Parser { throw new ParseException(R("PSharing")); addInfo(info, child, null, Boolean.TRUE); } + if ("association".equals(name)) { + addInfo(info, child, null, getAssociation(child)); + } + if ("shortcut".equals(name)) { + addInfo(info, child, null, getShortcut(child)); + } + if ("related-content".equals(name)) { + addInfo(info, child, null, getRelatedContent(child)); + } child = child.getNextSibling(); } @@ -643,6 +653,110 @@ class Parser { return new InstallerDesc(main); } + /** + * Returns the association descriptor. + */ + public AssociationDesc getAssociation(Node node) throws ParseException { + String[] extensions = getRequiredAttribute(node, "extensions", null).split(" "); + String mimeType = getRequiredAttribute(node, "mime-type", null); + + return new AssociationDesc(mimeType, extensions); + } + + /** + * Returns the shortcut descriptor. + */ + public ShortcutDesc getShortcut(Node node) throws ParseException { + + String online = getAttribute(node, "online", "true"); + boolean shortcutIsOnline = Boolean.valueOf(online); + + boolean showOnDesktop = false; + MenuDesc menu = null; + + // step through the elements + Node child = node.getFirstChild(); + while (child != null) { + String name = child.getNodeName(); + + if ("desktop".equals(name)) { + if (showOnDesktop && strict) { + throw new ParseException(R("PTwoDesktops")); + } + showOnDesktop = true; + } else if ("menu".equals(name)){ + if (menu != null && strict) { + throw new ParseException(R("PTwoMenus")); + } + menu = getMenu(child); + } + + child = child.getNextSibling(); + } + + ShortcutDesc shortcut = new ShortcutDesc(shortcutIsOnline, showOnDesktop); + if (menu != null) { + shortcut.addMenu(menu); + } + return shortcut; + } + + /** + * Returns the menu descriptor. + */ + public MenuDesc getMenu(Node node) { + String subMenu = getAttribute(node, "submenu", null); + + return new MenuDesc(subMenu); + } + + + /** + * Returns the related-content descriptor. + */ + public RelatedContentDesc getRelatedContent(Node node) throws ParseException { + + getRequiredAttribute(node, "href", null); + URL location = getURL(node, "href", base); + + String title = null; + String description = null; + IconDesc icon = null; + + // step through the elements + Node child = node.getFirstChild(); + while (child != null) { + String name = child.getNodeName(); + + if ("title".equals(name)) { + if (title != null && strict) { + throw new ParseException(R("PTwoTitles")); + } + title = getSpanText(child); + } else if ("description".equals(name)) { + if (description != null && strict) { + throw new ParseException(R("PTwoDescriptions")); + } + description = getSpanText(child); + } else if ("icon".equals(name)) { + if (icon != null && strict) { + throw new ParseException(R("PTwoIcons")); + } + icon = getIcon(child); + } + + child = child.getNextSibling(); + } + + RelatedContentDesc relatedContent = new RelatedContentDesc(location); + relatedContent.setDescription(description); + relatedContent.setIconDesc(icon); + relatedContent.setTitle(title); + + return relatedContent; + + } + // other methods /** diff -r ff13b7d6e330 -r 852af6e8bf0e rt/net/sourceforge/jnlp/RelatedContentDesc.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rt/net/sourceforge/jnlp/RelatedContentDesc.java Tue Jun 09 14:08:52 2009 -0400 @@ -0,0 +1,93 @@ +// Copyright (C) 2009 Red Hat, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +package net.sourceforge.jnlp; + +import java.net.URL; + +public class RelatedContentDesc { + + /** title of the content */ + private String title = null;; + + /** the description of the content */ + private String description = null; + + /** the location of the content */ + private URL location = null; + + /** the icon for this related content */ + private IconDesc icon = null; + + /** + * Create a related-content descriptor + * @param href the url of the related content + */ + public RelatedContentDesc(URL href) { + this.location = href; + } + + /** + * Set the title of this content + * @param title the title of this content + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * Returns the title of this content.. + */ + public String getTitle() { + return title; + } + + /** + * Set the description of this related content + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * Returns the description of the related content + */ + public String getDescription() { + return description; + } + + /** + * Returns the location of the related content. Not null + */ + public URL getLocation() { + return location; + } + + /** + * Set the icon for this related content + */ + public void setIconDesc(IconDesc icon) { + this.icon = icon; + } + + /** + * Returns the icon descriptor for the realted content + */ + public IconDesc getIcon() { + return icon; + } + +} diff -r ff13b7d6e330 -r 852af6e8bf0e rt/net/sourceforge/jnlp/ShortcutDesc.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rt/net/sourceforge/jnlp/ShortcutDesc.java Tue Jun 09 14:08:52 2009 -0400 @@ -0,0 +1,70 @@ +// Copyright (C) 2009 Red Hat, Inc. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +package net.sourceforge.jnlp; + +public final class ShortcutDesc { + + /** the application wants to be placed on the desktop */ + private boolean onDesktop = false; + + /** the application needs to be launched online */ + private boolean requiresOnline = true; + + /** the menu descriptor */ + private MenuDesc menu = null; + + /** + * Create a new Shortcut descriptor + * @param requiresOnline whether the shortcut requires connectivity + * @param onDesktop whether the shortcut wants to be placed on the desktop + */ + public ShortcutDesc(boolean requiresOnline, boolean onDesktop) { + this.requiresOnline = requiresOnline; + this.onDesktop = onDesktop; + } + + /** + * Returns whether the shortcut requires being online + */ + public boolean isOnline() { + return requiresOnline; + } + + /** + * Return whether the shortcut should be placed on the desktop + */ + public boolean onDesktop() { + return onDesktop; + } + + /** + * Add a shortcut to the 'start menu' + * (whatever that means on gnome/kde/other ...) + * @param menu if/what menu this shortcut should be added to + */ + public void addMenu(MenuDesc menu) { + this.menu = menu; + } + + /** + * Returns the menu this shortcut should be added to + */ + public MenuDesc getMenu() { + return menu; + } + From omajid at redhat.com Tue Jun 9 11:15:18 2009 From: omajid at redhat.com (Omair Majid) Date: Tue, 09 Jun 2009 14:15:18 -0400 Subject: RFC: Netx - Parser support for shortcut, association and related-content elements In-Reply-To: <20090609160215.GA17330@redhat.com> References: <4A2D422A.8090202@redhat.com> <20090609160215.GA17330@redhat.com> Message-ID: <4A2EA6B6.60600@redhat.com> Deepak Bhole wrote: > * Omair Majid [2009-06-08 12:55]: >> Hi, >> >> The attached patch adds support to the JNLP parser for parsing >> association, shortcut and related-content elements from the JNLP file. >> > > Looks fine. New files are missing headers though. Please add them before > committing. > Done. Pushed as changeset 852af6e8bf0e in icedtea6. Thanks, Omair From bugzilla-daemon at icedtea.classpath.org Tue Jun 9 13:10:13 2009 From: bugzilla-daemon at icedtea.classpath.org (bugzilla-daemon at icedtea.classpath.org) Date: Tue, 09 Jun 2009 20:10:13 +0000 Subject: [Bug 347] IcedTea plugin, JS function can't converted to JSObject Message-ID: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=347 dbhole at redhat.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at icedtea.classpath|dbhole at redhat.com |.org | ------- Comment #1 from dbhole at redhat.com 2009-06-09 20:10 ------- Is it possible to see the source code of this? Or at the very least, the source of webgears.applet.Main? I fixed the security exception, but am running into another exception now. getDesktop() (called via reflection from the plugin code) is returning an object of type webgears.applet.Main$1 instead of webgears.desktop.Desktop .. and that further cascades into a failure. I want to see why it is not retuning an object ot type webgears.desktop.Desktop ... -- Configure bugmail: http://icedtea.classpath.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. You are the assignee for the bug, or are watching the assignee. From omajid at redhat.com Tue Jun 9 14:08:29 2009 From: omajid at redhat.com (Omair Majid) Date: Tue, 09 Jun 2009 17:08:29 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <20090608225621.GB21227@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> <20090603180752.GB21904@redhat.com> <4A27DC10.9070600@redhat.com> <20090604214722.GA29542@redhat.com> <4A296FF5.2020703@redhat.com> <20090608225621.GB21227@redhat.com> Message-ID: <4A2ECF4D.3050608@redhat.com> Deepak Bhole wrote: > You can fix this by adding a check for -jar like others, but rather than > excluding specific items, it would be better to check for allowed > items. java-vm-args accepts only certain args: > > http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/syntax.html > > (scroll to resources element). > > This covers any future arguments that might get added to java that allow > classpath specification. > Fixed checkVMArgs(). It now compares the arguments to the list of supported arguments. Also switched from invoking java directly to relying on the javaws launcher (and pasing the arguments through -J-Xms format) to reset the classpath. 2009-06-09 Omair Majid * rt/net/sourceforge/jnlp/JNLPFile.java (needsNewJVM): New function. Returns true if the JNLP file requires creating a new JVM. (getNewVMArgs): New function. Returns arguments to pass to the new JVM. * rt/net/sourceforge/jnlp/JREDesc.java (getVMArgs): Fix javadoc to reflect that return value can be null. * rt/net/sourceforge/jnlp/Launcher.java (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to Netx. Try to use the local file to launch this instance if possible. (launchExternal): Delegate to new launchExternal. (launchExternal): New method. Take in arguments to pass to the JVM and arguments to pass to Netx. Launch Netx with the with the appropriate arguments. (launchApplication): If needed, launch a new JVM and pass along the Netx arguments. * rt/net/sourceforge/jnlp/Parser.java: (getJRE): Call checkVMArgs to check 'java-vm-args' for security. If that fails, assume 'java-vm-args' is null. (checkVMArgs): New method. Check that the vmArgs variable contains safe arguments only. (getValidVMArguments): New method. (getValidStartingVMArguments): New method. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add BXnofork. * rt/net/sourceforge/jnlp/runtime/Boot/java: Add -Xnofork to helpMessage (main): Check for '-Xnofork'. Set initial arguments. * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add forksAllowed to store whether creating a new JVM is allowed. Add initialArguments to store the arguments to Netx. (getForksAllowed): New function. Check if creating a new JVM is allowed. (setForksAllowed): New function. Set whether creating a JVM is allowed. (setInitialArguments): New function. Store the arguments passed to Netx. (getInitialArguments): New function. Return the arguments passed to Netx. Cheers, Omair -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jvm-args.patch Type: text/x-patch Size: 20173 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090609/c441e070/attachment.bin From xerxes at zafena.se Wed Jun 10 04:59:52 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Wed, 10 Jun 2009 13:59:52 +0200 Subject: RFC: [patch] Zero/Shark -Xcheck:jni fix for pr 323 Message-ID: <4A2FA038.8040503@zafena.se> The attached patch fixes icedtea pr 323 http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=323 2009-06-10 Xerxes R?nby PR icedtea/323 * patches/icedtea-zero.patch (JNIHandles::is_frame_handle) Changed stack boundary during compare to include the whole zero stack. Cheers Xerxes -------------- next part -------------- A non-text attachment was scrubbed... Name: pr323.patch Type: text/x-patch Size: 847 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090610/8ec52436/attachment.bin From xerxes at zafena.se Wed Jun 10 05:13:15 2009 From: xerxes at zafena.se (Xerxes R?nby) Date: Wed, 10 Jun 2009 12:13:15 +0000 Subject: changeset in /hg/icedtea6: PR icedtea/323 Message-ID: changeset 188882817ac2 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=188882817ac2 description: PR icedtea/323 * patches/icedtea-zero.patch (JNIHandles::is_frame_handle) Changed stack boundary during compare to include the whole zero stack. diffstat: 2 files changed, 23 insertions(+) ChangeLog | 7 +++++++ patches/icedtea-zero.patch | 16 ++++++++++++++++ diffs (37 lines): diff -r 852af6e8bf0e -r 188882817ac2 ChangeLog --- a/ChangeLog Tue Jun 09 14:08:52 2009 -0400 +++ b/ChangeLog Wed Jun 10 14:13:59 2009 +0200 @@ -1,3 +1,10 @@ 2009-06-09 Omair Majid + + PR icedtea/323 + * patches/icedtea-zero.patch + (JNIHandles::is_frame_handle) Changed stack boundary + during compare to include the whole zero stack. + 2009-06-09 Omair Majid * rt/net/sourceforge/jnlp/AssociationDesc.java: New file. diff -r 852af6e8bf0e -r 188882817ac2 patches/icedtea-zero.patch --- a/patches/icedtea-zero.patch Tue Jun 09 14:08:52 2009 -0400 +++ b/patches/icedtea-zero.patch Wed Jun 10 14:13:59 2009 +0200 @@ -221,3 +221,19 @@ } } +Index: openjdk/hotspot/src/share/vm/runtime/jniHandles.cpp +=================================================================== +--- openjdk/hotspot/src/share/vm/runtime/jniHandles.cpp.orig 2009-06-10 11:30:46.000000000 +0200 ++++ openjdk/hotspot/src/share/vm/runtime/jniHandles.cpp 2009-06-10 11:37:07.000000000 +0200 +@@ -173,7 +173,11 @@ + // is not permitted. + return (thr->has_last_Java_frame() && + (void*)obj < (void*)thr->stack_base() && ++#ifdef ZERO ++ (void*)obj >= (void*)os::current_stack_pointer()); ++#else + (void*)obj >= (void*)thr->last_Java_sp()); ++#endif // ZERO + } + + From gbenson at redhat.com Wed Jun 10 05:20:57 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 10 Jun 2009 12:20:57 +0000 Subject: changeset in /hg/icedtea6: 2009-06-10 Gary Benson changeset ce70ed27635c in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=ce70ed27635c description: 2009-06-10 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp (SharkTopLevelBlock::CallType): Removed. (SharkTopLevelBlock::get_call_type): Likewise. (SharkTopLevelBlock::get_callee): Likewise. (SharkTopLevelBlock::improve_virtual_call): New method. (SharkTopLevelBlock::get_virtual_callee): Updated. * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp (SharkTopLevelBlock::scan_for_traps): Updated call traps. (SharkTopLevelBlock::get_call_type): Removed. (SharkTopLevelBlock::get_callee): Likewise. (SharkTopLevelBlock::improve_virtual_call): New method. (SharkTopLevelBlock::get_virtual_callee): Updated. (SharkTopLevelBlock::do_call): Replaced callee selection. diffstat: 3 files changed, 155 insertions(+), 85 deletions(-) ChangeLog | 16 + ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp | 208 +++++++++------ ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp | 16 - diffs (329 lines): diff -r 188882817ac2 -r ce70ed27635c ChangeLog --- a/ChangeLog Wed Jun 10 14:13:59 2009 +0200 +++ b/ChangeLog Wed Jun 10 13:22:21 2009 +0100 @@ -1,3 +1,19 @@ 2009-06-10 Xerxes R??nby + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::CallType): Removed. + (SharkTopLevelBlock::get_call_type): Likewise. + (SharkTopLevelBlock::get_callee): Likewise. + (SharkTopLevelBlock::improve_virtual_call): New method. + (SharkTopLevelBlock::get_virtual_callee): Updated. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Updated call traps. + (SharkTopLevelBlock::get_call_type): Removed. + (SharkTopLevelBlock::get_callee): Likewise. + (SharkTopLevelBlock::improve_virtual_call): New method. + (SharkTopLevelBlock::get_virtual_callee): Updated. + (SharkTopLevelBlock::do_call): Replaced callee selection. + 2009-06-10 Xerxes R??nby PR icedtea/323 diff -r 188882817ac2 -r ce70ed27635c ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 10 14:13:59 2009 +0200 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 10 13:22:21 2009 +0100 @@ -75,37 +75,13 @@ void SharkTopLevelBlock::scan_for_traps( } break; + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: case Bytecodes::_invokevirtual: - method = iter()->get_method(will_link); - assert(will_link, "typeflow responsibility"); - - // If this is a non-final invokevirtual then we need to - // check that its holder is linked, because its vtable - // won't have been set up otherwise. - if (!method->is_final_method() && !method->holder()->is_linked()) { - set_trap( - Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret), bci()); - return; - } - break; - case Bytecodes::_invokeinterface: method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); - // Handle the case where we encounter an invokeinterface but - // should really have an invokevirtual since the resolved - // method is a virtual method in java.lang.Object. This is - // a legal corner case in the spec, and while javac does not - // generate this code there's no reason a compliant Java - // compiler should not. See cpCacheOop.cpp and - // interpreterRuntime.cpp for more details. - if (method->holder() == function()->env()->Object_klass()) - Unimplemented(); - - // Bail out if the holder is unloaded if (!method->holder()->is_linked()) { set_trap( Deoptimization::make_trap_request( @@ -841,39 +817,78 @@ void SharkTopLevelBlock::do_switch() } } -// Figure out what type of call this is. -// - Direct calls are where the callee is fixed. -// - Interface and Virtual calls require lookup at runtime. -// NB some invokevirtuals can be resolved to direct calls. -SharkTopLevelBlock::CallType SharkTopLevelBlock::get_call_type(ciMethod* method) -{ - if (bc() == Bytecodes::_invokeinterface) - return CALL_INTERFACE; - else if (bc() == Bytecodes::_invokevirtual && !method->is_final_method()) - return CALL_VIRTUAL; - else - return CALL_DIRECT; -} - -Value *SharkTopLevelBlock::get_callee(CallType call_type, - ciMethod* method, - SharkValue* receiver) -{ - switch (call_type) { - case CALL_DIRECT: - return get_direct_callee(method); - case CALL_VIRTUAL: - return get_virtual_callee(receiver, method); - case CALL_INTERFACE: - return get_interface_callee(receiver, method); - default: - ShouldNotReachHere(); - } -} - -// Direct calls can be made when the callee is fixed. -// invokestatic and invokespecial are always direct; -// invokevirtual is direct in some circumstances. +ciMethod* SharkTopLevelBlock::improve_virtual_call(ciMethod* caller, + ciInstanceKlass* klass, + ciMethod* dest_method, + ciType* receiver_type) +{ + // If the method is obviously final then we are already done + if (dest_method->can_be_statically_bound()) + return dest_method; + + // Array methods are all inherited from Object and are monomorphic + if (receiver_type->is_array_klass() && + dest_method->holder() == function()->env()->Object_klass()) + return dest_method; + + // All other interesting cases are instance classes + if (!receiver_type->is_instance_klass()) + return NULL; + + // Attempt to improve the receiver + ciInstanceKlass* actual_receiver = klass; + ciInstanceKlass *improved_receiver = receiver_type->as_instance_klass(); + if (improved_receiver->is_loaded() && + improved_receiver->is_initialized() && + !improved_receiver->is_interface() && + improved_receiver->is_subtype_of(actual_receiver)) { + actual_receiver = improved_receiver; + } + + // Attempt to find a monomorphic target for this call using + // class heirachy analysis. + ciInstanceKlass *calling_klass = caller->holder(); + ciMethod* monomorphic_target = + dest_method->find_monomorphic_target(calling_klass, klass, actual_receiver); + if (monomorphic_target != NULL) { + assert(!monomorphic_target->is_abstract(), "shouldn't be"); + + // Opto has a bunch of type checking here that I don't + // understand. It's to inhibit casting in one direction, + // possibly because objects in Opto can have inexact + // types, but I can't even tell which direction it + // doesn't like. For now I'm going to block *any* cast. + if (monomorphic_target != dest_method) { +#ifndef PRODUCT + tty->print_cr("found monomorphic target, but inhibited cast:"); + tty->print(" dest_method = "); + dest_method->print_short_name(tty); + tty->cr(); + tty->print(" monomorphic_target = "); + monomorphic_target->print_short_name(tty); + tty->cr(); +#endif // !PRODUCT + monomorphic_target = NULL; + } + } + + // Replace the virtual call with a direct one. This makes + // us dependent on that target method not getting overridden + // by dynamic class loading. + if (monomorphic_target != NULL) { + function()->env()->dependencies()->assert_unique_concrete_method( + actual_receiver, monomorphic_target); + return monomorphic_target; + } + + // Because Opto distinguishes exact types from inexact ones + // it can perform a further optimization to replace calls + // with non-monomorphic targets if the receiver has an exact + // type. We don't mark types this way, so we can't do this. + + return NULL; +} + Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) { return builder()->CreateBitCast( @@ -882,9 +897,8 @@ Value *SharkTopLevelBlock::get_direct_ca "callee"); } -// Non-direct virtual calls are handled here Value *SharkTopLevelBlock::get_virtual_callee(SharkValue* receiver, - ciMethod* method) + int vtable_index) { Value *klass = builder()->CreateValueOfStructEntry( receiver->jobject_value(), @@ -898,11 +912,10 @@ Value *SharkTopLevelBlock::get_virtual_c SharkType::methodOop_type(), vtableEntry::size() * wordSize, in_ByteSize(instanceKlass::vtable_start_offset() * wordSize), - LLVMValue::intptr_constant(method->vtable_index())), + LLVMValue::intptr_constant(vtable_index)), "callee"); } -// Interface calls are handled here Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver, ciMethod* method) { @@ -1013,31 +1026,78 @@ Value* SharkTopLevelBlock::get_interface void SharkTopLevelBlock::do_call() { + // Set frequently used booleans + bool is_static = bc() == Bytecodes::_invokestatic; + bool is_virtual = bc() == Bytecodes::_invokevirtual; + bool is_interface = bc() == Bytecodes::_invokeinterface; + + // Find the method being called bool will_link; - ciMethod *method = iter()->get_method(will_link); + ciMethod *dest_method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); - - // Figure out what type of call this is - CallType call_type = get_call_type(method); + assert(dest_method->is_static() == is_static, "must match bc"); + + // Find the class of the method being called. Note + // that the superclass check in the second assertion + // is to cope with a hole in the spec that allows for + // invokeinterface instructions where the resolved + // method is a virtual method in java.lang.Object. + // javac doesn't generate code like that, but there's + // no reason a compliant Java compiler might not. + ciInstanceKlass *holder_klass = dest_method->holder(); + assert(holder_klass->is_loaded(), "scan_for_traps responsibility"); + assert(holder_klass->is_interface() || + holder_klass->super() == NULL || + !is_interface, "must match bc"); + ciKlass *holder = iter()->get_declared_method_holder(); + ciInstanceKlass *klass = + ciEnv::get_instance_klass_for_declared_method_holder(holder); // Find the receiver in the stack. We do this before // trying to inline because the inliner can only use // zero-checked values, not being able to perform the // check itself. SharkValue *receiver = NULL; - if (bc() != Bytecodes::_invokestatic) { - receiver = xstack(method->arg_size() - 1); + if (!is_static) { + receiver = xstack(dest_method->arg_size() - 1); check_null(receiver); } + // Try to improve non-direct calls + bool call_is_virtual = is_virtual || is_interface; + ciMethod *call_method = dest_method; + if (call_is_virtual) { + ciMethod *optimized_method = improve_virtual_call( + target(), klass, dest_method, receiver->type()); + if (optimized_method) { + call_method = optimized_method; + call_is_virtual = false; + } + } + // Try to inline the call - if (call_type == CALL_DIRECT) { - if (SharkInliner::attempt_inline(method, current_state(), thread())) + if (!call_is_virtual) { + if (SharkInliner::attempt_inline(call_method, current_state(), thread())) return; } // Find the method we are calling - Value *callee = get_callee(call_type, method, receiver); + Value *callee; + if (call_is_virtual) { + if (is_virtual) { + int vtable_index = call_method->resolve_vtable_index( + target()->holder(), klass); + assert(vtable_index >= 0, "should be"); + callee = get_virtual_callee(receiver, vtable_index); + } + else { + assert(is_interface, "should be"); + callee = get_interface_callee(receiver, call_method); + } + } + else { + callee = get_direct_callee(call_method); + } // Load the SharkEntry from the callee Value *base_pc = builder()->CreateValueOfStructEntry( @@ -1056,9 +1116,9 @@ void SharkTopLevelBlock::do_call() "entry_point"); // Make the call - current_state()->decache_for_Java_call(method); + current_state()->decache_for_Java_call(call_method); builder()->CreateCall3(entry_point, callee, base_pc, thread()); - current_state()->cache_after_Java_call(method); + current_state()->cache_after_Java_call(call_method); // Check for pending exceptions check_pending_exception(EX_CHECK_FULL); diff -r 188882817ac2 -r ce70ed27635c ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Wed Jun 10 14:13:59 2009 +0200 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Wed Jun 10 13:22:21 2009 +0100 @@ -371,18 +371,12 @@ class SharkTopLevelBlock : public SharkB // invoke* private: - enum CallType { - CALL_DIRECT, - CALL_VIRTUAL, - CALL_INTERFACE - }; - CallType get_call_type(ciMethod* method); - llvm::Value* get_callee(CallType call_type, - ciMethod* method, - SharkValue* receiver); - + ciMethod* improve_virtual_call(ciMethod* caller, + ciInstanceKlass* klass, + ciMethod* dest_method, + ciType* receiver_type); llvm::Value* get_direct_callee(ciMethod* method); - llvm::Value* get_virtual_callee(SharkValue* receiver, ciMethod* method); + llvm::Value* get_virtual_callee(SharkValue* receiver, int vtable_index); llvm::Value* get_interface_callee(SharkValue* receiver, ciMethod* method); void do_call(); From gbenson at redhat.com Wed Jun 10 05:30:47 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 10 Jun 2009 13:30:47 +0100 Subject: Shark invoke* improvements Message-ID: <20090610123047.GA26952@redhat.com> Hi all, The work I've done over the past week has made the callee-fetching part of Shark's invoke* bytecodes a lot less like the interpreter's and a lot more like the Server compiler's. This has allowed me to drop in a block of code from Server that uses class heirachy analysis to convert virtual calls to direct ones. Now, the difference here is fairly small (callee-fetching is just two loads for a virtual call against one for a direct) but direct calls can be inlined -- and an inlined call is a vast performance boost on Shark where calls are expensive. I ran SPECjvm98 on this one. Most of the benchmarks improved slightly, except the mtrt one which improved by 120%! Turns out it has an awful lot of inlinable virtual calls :) Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 188882817ac2 -r ce70ed27635c ChangeLog --- a/ChangeLog Wed Jun 10 14:13:59 2009 +0200 +++ b/ChangeLog Wed Jun 10 13:22:21 2009 +0100 @@ -1,3 +1,19 @@ +2009-06-10 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp + (SharkTopLevelBlock::CallType): Removed. + (SharkTopLevelBlock::get_call_type): Likewise. + (SharkTopLevelBlock::get_callee): Likewise. + (SharkTopLevelBlock::improve_virtual_call): New method. + (SharkTopLevelBlock::get_virtual_callee): Updated. + * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp + (SharkTopLevelBlock::scan_for_traps): Updated call traps. + (SharkTopLevelBlock::get_call_type): Removed. + (SharkTopLevelBlock::get_callee): Likewise. + (SharkTopLevelBlock::improve_virtual_call): New method. + (SharkTopLevelBlock::get_virtual_callee): Updated. + (SharkTopLevelBlock::do_call): Replaced callee selection. + 2009-06-10 Xerxes R?nby PR icedtea/323 diff -r 188882817ac2 -r ce70ed27635c ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 10 14:13:59 2009 +0200 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp Wed Jun 10 13:22:21 2009 +0100 @@ -75,37 +75,13 @@ } break; + case Bytecodes::_invokestatic: + case Bytecodes::_invokespecial: case Bytecodes::_invokevirtual: - method = iter()->get_method(will_link); - assert(will_link, "typeflow responsibility"); - - // If this is a non-final invokevirtual then we need to - // check that its holder is linked, because its vtable - // won't have been set up otherwise. - if (!method->is_final_method() && !method->holder()->is_linked()) { - set_trap( - Deoptimization::make_trap_request( - Deoptimization::Reason_uninitialized, - Deoptimization::Action_reinterpret), bci()); - return; - } - break; - case Bytecodes::_invokeinterface: method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); - // Handle the case where we encounter an invokeinterface but - // should really have an invokevirtual since the resolved - // method is a virtual method in java.lang.Object. This is - // a legal corner case in the spec, and while javac does not - // generate this code there's no reason a compliant Java - // compiler should not. See cpCacheOop.cpp and - // interpreterRuntime.cpp for more details. - if (method->holder() == function()->env()->Object_klass()) - Unimplemented(); - - // Bail out if the holder is unloaded if (!method->holder()->is_linked()) { set_trap( Deoptimization::make_trap_request( @@ -841,39 +817,78 @@ } } -// Figure out what type of call this is. -// - Direct calls are where the callee is fixed. -// - Interface and Virtual calls require lookup at runtime. -// NB some invokevirtuals can be resolved to direct calls. -SharkTopLevelBlock::CallType SharkTopLevelBlock::get_call_type(ciMethod* method) +ciMethod* SharkTopLevelBlock::improve_virtual_call(ciMethod* caller, + ciInstanceKlass* klass, + ciMethod* dest_method, + ciType* receiver_type) { - if (bc() == Bytecodes::_invokeinterface) - return CALL_INTERFACE; - else if (bc() == Bytecodes::_invokevirtual && !method->is_final_method()) - return CALL_VIRTUAL; - else - return CALL_DIRECT; + // If the method is obviously final then we are already done + if (dest_method->can_be_statically_bound()) + return dest_method; + + // Array methods are all inherited from Object and are monomorphic + if (receiver_type->is_array_klass() && + dest_method->holder() == function()->env()->Object_klass()) + return dest_method; + + // All other interesting cases are instance classes + if (!receiver_type->is_instance_klass()) + return NULL; + + // Attempt to improve the receiver + ciInstanceKlass* actual_receiver = klass; + ciInstanceKlass *improved_receiver = receiver_type->as_instance_klass(); + if (improved_receiver->is_loaded() && + improved_receiver->is_initialized() && + !improved_receiver->is_interface() && + improved_receiver->is_subtype_of(actual_receiver)) { + actual_receiver = improved_receiver; + } + + // Attempt to find a monomorphic target for this call using + // class heirachy analysis. + ciInstanceKlass *calling_klass = caller->holder(); + ciMethod* monomorphic_target = + dest_method->find_monomorphic_target(calling_klass, klass, actual_receiver); + if (monomorphic_target != NULL) { + assert(!monomorphic_target->is_abstract(), "shouldn't be"); + + // Opto has a bunch of type checking here that I don't + // understand. It's to inhibit casting in one direction, + // possibly because objects in Opto can have inexact + // types, but I can't even tell which direction it + // doesn't like. For now I'm going to block *any* cast. + if (monomorphic_target != dest_method) { +#ifndef PRODUCT + tty->print_cr("found monomorphic target, but inhibited cast:"); + tty->print(" dest_method = "); + dest_method->print_short_name(tty); + tty->cr(); + tty->print(" monomorphic_target = "); + monomorphic_target->print_short_name(tty); + tty->cr(); +#endif // !PRODUCT + monomorphic_target = NULL; + } + } + + // Replace the virtual call with a direct one. This makes + // us dependent on that target method not getting overridden + // by dynamic class loading. + if (monomorphic_target != NULL) { + function()->env()->dependencies()->assert_unique_concrete_method( + actual_receiver, monomorphic_target); + return monomorphic_target; + } + + // Because Opto distinguishes exact types from inexact ones + // it can perform a further optimization to replace calls + // with non-monomorphic targets if the receiver has an exact + // type. We don't mark types this way, so we can't do this. + + return NULL; } -Value *SharkTopLevelBlock::get_callee(CallType call_type, - ciMethod* method, - SharkValue* receiver) -{ - switch (call_type) { - case CALL_DIRECT: - return get_direct_callee(method); - case CALL_VIRTUAL: - return get_virtual_callee(receiver, method); - case CALL_INTERFACE: - return get_interface_callee(receiver, method); - default: - ShouldNotReachHere(); - } -} - -// Direct calls can be made when the callee is fixed. -// invokestatic and invokespecial are always direct; -// invokevirtual is direct in some circumstances. Value *SharkTopLevelBlock::get_direct_callee(ciMethod* method) { return builder()->CreateBitCast( @@ -882,9 +897,8 @@ "callee"); } -// Non-direct virtual calls are handled here Value *SharkTopLevelBlock::get_virtual_callee(SharkValue* receiver, - ciMethod* method) + int vtable_index) { Value *klass = builder()->CreateValueOfStructEntry( receiver->jobject_value(), @@ -898,11 +912,10 @@ SharkType::methodOop_type(), vtableEntry::size() * wordSize, in_ByteSize(instanceKlass::vtable_start_offset() * wordSize), - LLVMValue::intptr_constant(method->vtable_index())), + LLVMValue::intptr_constant(vtable_index)), "callee"); } -// Interface calls are handled here Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver, ciMethod* method) { @@ -1013,31 +1026,78 @@ void SharkTopLevelBlock::do_call() { + // Set frequently used booleans + bool is_static = bc() == Bytecodes::_invokestatic; + bool is_virtual = bc() == Bytecodes::_invokevirtual; + bool is_interface = bc() == Bytecodes::_invokeinterface; + + // Find the method being called bool will_link; - ciMethod *method = iter()->get_method(will_link); + ciMethod *dest_method = iter()->get_method(will_link); assert(will_link, "typeflow responsibility"); + assert(dest_method->is_static() == is_static, "must match bc"); - // Figure out what type of call this is - CallType call_type = get_call_type(method); + // Find the class of the method being called. Note + // that the superclass check in the second assertion + // is to cope with a hole in the spec that allows for + // invokeinterface instructions where the resolved + // method is a virtual method in java.lang.Object. + // javac doesn't generate code like that, but there's + // no reason a compliant Java compiler might not. + ciInstanceKlass *holder_klass = dest_method->holder(); + assert(holder_klass->is_loaded(), "scan_for_traps responsibility"); + assert(holder_klass->is_interface() || + holder_klass->super() == NULL || + !is_interface, "must match bc"); + ciKlass *holder = iter()->get_declared_method_holder(); + ciInstanceKlass *klass = + ciEnv::get_instance_klass_for_declared_method_holder(holder); // Find the receiver in the stack. We do this before // trying to inline because the inliner can only use // zero-checked values, not being able to perform the // check itself. SharkValue *receiver = NULL; - if (bc() != Bytecodes::_invokestatic) { - receiver = xstack(method->arg_size() - 1); + if (!is_static) { + receiver = xstack(dest_method->arg_size() - 1); check_null(receiver); } + // Try to improve non-direct calls + bool call_is_virtual = is_virtual || is_interface; + ciMethod *call_method = dest_method; + if (call_is_virtual) { + ciMethod *optimized_method = improve_virtual_call( + target(), klass, dest_method, receiver->type()); + if (optimized_method) { + call_method = optimized_method; + call_is_virtual = false; + } + } + // Try to inline the call - if (call_type == CALL_DIRECT) { - if (SharkInliner::attempt_inline(method, current_state(), thread())) + if (!call_is_virtual) { + if (SharkInliner::attempt_inline(call_method, current_state(), thread())) return; } // Find the method we are calling - Value *callee = get_callee(call_type, method, receiver); + Value *callee; + if (call_is_virtual) { + if (is_virtual) { + int vtable_index = call_method->resolve_vtable_index( + target()->holder(), klass); + assert(vtable_index >= 0, "should be"); + callee = get_virtual_callee(receiver, vtable_index); + } + else { + assert(is_interface, "should be"); + callee = get_interface_callee(receiver, call_method); + } + } + else { + callee = get_direct_callee(call_method); + } // Load the SharkEntry from the callee Value *base_pc = builder()->CreateValueOfStructEntry( @@ -1056,9 +1116,9 @@ "entry_point"); // Make the call - current_state()->decache_for_Java_call(method); + current_state()->decache_for_Java_call(call_method); builder()->CreateCall3(entry_point, callee, base_pc, thread()); - current_state()->cache_after_Java_call(method); + current_state()->cache_after_Java_call(call_method); // Check for pending exceptions check_pending_exception(EX_CHECK_FULL); diff -r 188882817ac2 -r ce70ed27635c ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp --- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Wed Jun 10 14:13:59 2009 +0200 +++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp Wed Jun 10 13:22:21 2009 +0100 @@ -371,18 +371,12 @@ // invoke* private: - enum CallType { - CALL_DIRECT, - CALL_VIRTUAL, - CALL_INTERFACE - }; - CallType get_call_type(ciMethod* method); - llvm::Value* get_callee(CallType call_type, - ciMethod* method, - SharkValue* receiver); - + ciMethod* improve_virtual_call(ciMethod* caller, + ciInstanceKlass* klass, + ciMethod* dest_method, + ciType* receiver_type); llvm::Value* get_direct_callee(ciMethod* method); - llvm::Value* get_virtual_callee(SharkValue* receiver, ciMethod* method); + llvm::Value* get_virtual_callee(SharkValue* receiver, int vtable_index); llvm::Value* get_interface_callee(SharkValue* receiver, ciMethod* method); void do_call(); From xerxes at zafena.se Wed Jun 10 06:10:13 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Wed, 10 Jun 2009 15:10:13 +0200 Subject: RFC: [patch] Zero/Shark -Xcheck:jni fix for pr 323 In-Reply-To: <4A2FA038.8040503@zafena.se> References: <4A2FA038.8040503@zafena.se> Message-ID: <4A2FB0B5.8000603@zafena.se> Xerxes R?nby skrev: > The attached patch fixes icedtea pr 323 > http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=323 > > 2009-06-10 Xerxes R?nby > > PR icedtea/323 > * patches/icedtea-zero.patch > (JNIHandles::is_frame_handle) Changed stack boundary > during compare to include the whole zero stack. > > > Cheers > Xerxes Some quotes from IRC to clarify why this patch got almost /instantly /committed after the RFC request: #classpath / irc.freenode.net (14.33.28) xranby: gbenson: hi, i posted a patch for you to review on the mailinglist a minute ago (14.33.56) gbenson: xranby: ah, was it for review, commit away :) (14.34.25) xranby: gbenson: thanks, commiting. (14.35.03) xranby: pushed Have a great day! Xerxes From dbhole at redhat.com Wed Jun 10 06:54:22 2009 From: dbhole at redhat.com (Deepak Bhole) Date: Wed, 10 Jun 2009 09:54:22 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <4A2ECF4D.3050608@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> <20090603180752.GB21904@redhat.com> <4A27DC10.9070600@redhat.com> <20090604214722.GA29542@redhat.com> <4A296FF5.2020703@redhat.com> <20090608225621.GB21227@redhat.com> <4A2ECF4D.3050608@redhat.com> Message-ID: <20090610135422.GA11916@redhat.com> * Omair Majid [2009-06-09 17:08]: Looks good. You may want to print a warning on stderr stating that vmargs are being dropped to null and why (instead of just setting them null and proceeding). But that's your call. Either way, good to commit. Cheers, Deepak -------------- next part -------------- A non-text attachment was scrubbed... Name: netx-jvm-args.patch Type: text/x-patch Size: 20220 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090610/b3b6a51c/attachment.bin From omajid at redhat.com Wed Jun 10 07:54:10 2009 From: omajid at redhat.com (Omair Majid) Date: Wed, 10 Jun 2009 14:54:10 +0000 Subject: changeset in /hg/icedtea6: 2009-06-10 Omair Majid changeset c68aaf028ad2 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=c68aaf028ad2 description: 2009-06-10 Omair Majid * rt/net/sourceforge/jnlp/services/XBasicService.java (isOffline): Check if the system is offline by retrieving data from a URL. (findFirstURLFromJNLPFile): New function. Obtain a URL from the JNLP file. As a last resort, return an arbitrary known URL. diffstat: 2 files changed, 76 insertions(+), 9 deletions(-) ChangeLog | 7 + rt/net/sourceforge/jnlp/services/XBasicService.java | 78 ++++++++++++++++--- diffs (109 lines): diff -r ce70ed27635c -r c68aaf028ad2 ChangeLog --- a/ChangeLog Wed Jun 10 13:22:21 2009 +0100 +++ b/ChangeLog Wed Jun 10 10:53:03 2009 -0400 @@ -1,3 +1,10 @@ 2009-06-10 Gary Benson + + * rt/net/sourceforge/jnlp/services/XBasicService.java + (isOffline): Check if the system is offline by retrieving data from a URL. + (findFirstURLFromJNLPFile): New function. Obtain a URL from the JNLP file. + As a last resort, return an arbitrary known URL. + 2009-06-10 Gary Benson * ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.hpp diff -r ce70ed27635c -r c68aaf028ad2 rt/net/sourceforge/jnlp/services/XBasicService.java --- a/rt/net/sourceforge/jnlp/services/XBasicService.java Wed Jun 10 13:22:21 2009 +0100 +++ b/rt/net/sourceforge/jnlp/services/XBasicService.java Wed Jun 10 10:53:03 2009 -0400 @@ -17,14 +17,21 @@ package net.sourceforge.jnlp.services; -import java.io.*; -import java.net.*; -import javax.jnlp.*; -import javax.swing.*; - -import net.sourceforge.jnlp.*; -import net.sourceforge.jnlp.runtime.*; -import net.sourceforge.jnlp.util.*; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; + +import javax.jnlp.BasicService; +import javax.swing.JOptionPane; +import javax.swing.JPanel; + +import net.sourceforge.jnlp.InformationDesc; +import net.sourceforge.jnlp.JARDesc; +import net.sourceforge.jnlp.JNLPFile; +import net.sourceforge.jnlp.Launcher; +import net.sourceforge.jnlp.runtime.ApplicationInstance; +import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.util.PropertiesFile; /** * The BasicService JNLP service. @@ -81,7 +88,60 @@ class XBasicService implements BasicServ * Return true if the Environment is Offline */ public boolean isOffline() { - return false; + + URL url = findFirstURLFromJNLPFile(); + + try { + url.openConnection().getInputStream().close(); + return false; + } catch (IOException exception) { + return true; + } + } + + /** + * Return the first URL from the jnlp file + * Or a default URL if no url found in JNLP file + */ + private URL findFirstURLFromJNLPFile() { + + ApplicationInstance app = JNLPRuntime.getApplication(); + + if (app != null) { + JNLPFile jnlpFile = app.getJNLPFile(); + + URL sourceURL = jnlpFile.getSourceLocation(); + if (sourceURL != null) { + return sourceURL; + } + + URL codeBaseURL = jnlpFile.getCodeBase(); + if (codeBaseURL != null) { + return codeBaseURL; + } + + InformationDesc informationDesc = jnlpFile.getInformation(); + URL homePage = informationDesc.getHomepage(); + if (homePage != null) { + return homePage; + } + + JARDesc[] jarDescs = jnlpFile.getResources().getJARs(); + for (JARDesc jarDesc: jarDescs) { + return jarDesc.getLocation(); + } + } + + // this section is only reached if the jnlp file has no jars. + // that doesnt seem very likely. + URL arbitraryURL; + try { + arbitraryURL = new URL("http://icedtea.classpath.org"); + } catch (MalformedURLException malformedURL) { + throw new RuntimeException(malformedURL); + } + + return arbitraryURL; } /** From omajid at redhat.com Wed Jun 10 08:30:56 2009 From: omajid at redhat.com (Omair Majid) Date: Wed, 10 Jun 2009 11:30:56 -0400 Subject: RFC: Netx - Fix BasicService.isOffline() In-Reply-To: <20090609180037.GA3528@redhat.com> References: <4A2D819D.9060604@redhat.com> <20090609180037.GA3528@redhat.com> Message-ID: <4A2FD1B0.1010406@redhat.com> Deepak Bhole wrote: > * Omair Majid [2009-06-08 17:25]: >> Hi, >> >> The attached patch implements XBasicService.isOffline(). >> >> ChangeLog >> 2009-06-08 Omair Majid >> >> * rt/net/sourceforge/jnlp/services/XBasicService.java >> (isOffline): Check if the system is offline by retrieving data from >> a URL. >> (findFirstURLFromJNLPFile): New function. Obtain a URL from the JNLP >> file. As a last resort, return an arbitrary known URL. >> >> Any comments? >> > > Looks good to me! > Committed and pushed. changeset c68aaf028ad2 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=c68aaf028ad2 description: 2009-06-10 Omair Majid * rt/net/sourceforge/jnlp/services/XBasicService.java (isOffline): Check if the system is offline by retrieving data from a URL. (findFirstURLFromJNLPFile): New function. Obtain a URL from the JNLP file. As a last resort, return an arbitrary known URL. Thanks, Omair From omajid at redhat.com Wed Jun 10 09:00:00 2009 From: omajid at redhat.com (Omair Majid) Date: Wed, 10 Jun 2009 16:00:00 +0000 Subject: changeset in /hg/icedtea6: 2009-06-10 Omair Majid changeset 0b4d2e77cf97 in /hg/icedtea6 details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=0b4d2e77cf97 description: 2009-06-10 Omair Majid * rt/net/sourceforge/jnlp/JNLPFile.java (needsNewJVM): New function. Returns true if the JNLP file requires creating a new JVM. (getNewVMArgs): New function. Returns arguments to pass to the new JVM. * rt/net/sourceforge/jnlp/JREDesc.java (getVMArgs): Fix javadoc to reflect that return value can be null. * rt/net/sourceforge/jnlp/Launcher.java (launchExternal): Modify to take in arguments to pass to the JVM and arguments to pass to Netx. Try to use the local file to launch this instance if possible. (launchExternal): Delegate to new launchExternal. (launchExternal): New method. Take in arguments to pass to the JVM and arguments to pass to Netx. Launch Netx with the with the appropriate arguments. (launchApplication): If needed, launch a new JVM and pass along the Netx arguments. * rt/net/sourceforge/jnlp/Parser.java: (getJRE): Call checkVMArgs to check 'java-vm-args' for security. If that fails, assume 'java-vm-args' is null. (checkVMArgs): New method. Check that the vmArgs variable contains safe arguments only. (getValidVMArguments): New method. (getValidStartingVMArguments): New method. * rt/net/sourceforge/jnlp/resources/Messages.properties: Add BXnofork. * rt/net/sourceforge/jnlp/runtime/Boot/java: Add -Xnofork to helpMessage (main): Check for '-Xnofork'. Set initial arguments. * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: Add forksAllowed to store whether creating a new JVM is allowed. Add initialArguments to store the arguments to Netx. (getForksAllowed): New function. Check if creating a new JVM is allowed. (setForksAllowed): New function. Set whether creating a JVM is allowed. (setInitialArguments): New function. Store the arguments passed to Netx. (getInitialArguments): New function. Return the arguments passed to Netx. diffstat: 8 files changed, 326 insertions(+), 41 deletions(-) ChangeLog | 37 +++++ rt/net/sourceforge/jnlp/JNLPFile.java | 63 ++++++++- rt/net/sourceforge/jnlp/JREDesc.java | 1 rt/net/sourceforge/jnlp/Launcher.java | 109 +++++++++++----- rt/net/sourceforge/jnlp/Parser.java | 112 +++++++++++++++++ rt/net/sourceforge/jnlp/resources/Messages.properties | 1 rt/net/sourceforge/jnlp/runtime/Boot.java | 9 + rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java | 35 +++++ diffs (truncated from 539 to 500 lines): diff -r c68aaf028ad2 -r 0b4d2e77cf97 ChangeLog --- a/ChangeLog Wed Jun 10 10:53:03 2009 -0400 +++ b/ChangeLog Wed Jun 10 12:00:53 2009 -0400 @@ -1,3 +1,40 @@ 2009-06-10 Omair Majid + + * rt/net/sourceforge/jnlp/JNLPFile.java + (needsNewJVM): New function. Returns true if the JNLP file requires + creating a new JVM. + (getNewVMArgs): New function. Returns arguments to pass to the new JVM. + * rt/net/sourceforge/jnlp/JREDesc.java + (getVMArgs): Fix javadoc to reflect that return value can be null. + * rt/net/sourceforge/jnlp/Launcher.java + (launchExternal): Modify to take in arguments to pass to the JVM and + arguments to pass to Netx. Try to use the local file to launch this + instance if possible. + (launchExternal): Delegate to new launchExternal. + (launchExternal): New method. Take in arguments to pass to the JVM and + arguments to pass to Netx. Launch Netx with the with the appropriate + arguments. + (launchApplication): If needed, launch a new JVM and pass along the Netx + arguments. + * rt/net/sourceforge/jnlp/Parser.java: + (getJRE): Call checkVMArgs to check 'java-vm-args' for security. If that + fails, assume 'java-vm-args' is null. + (checkVMArgs): New method. Check that the vmArgs variable contains safe + arguments only. + (getValidVMArguments): New method. + (getValidStartingVMArguments): New method. + * rt/net/sourceforge/jnlp/resources/Messages.properties: Add BXnofork. + * rt/net/sourceforge/jnlp/runtime/Boot/java: + Add -Xnofork to helpMessage + (main): Check for '-Xnofork'. Set initial arguments. + * rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java: + Add forksAllowed to store whether creating a new JVM is allowed. Add + initialArguments to store the arguments to Netx. + (getForksAllowed): New function. Check if creating a new JVM is allowed. + (setForksAllowed): New function. Set whether creating a JVM is allowed. + (setInitialArguments): New function. Store the arguments passed to Netx. + (getInitialArguments): New function. Return the arguments passed to Netx. + 2009-06-10 Omair Majid * rt/net/sourceforge/jnlp/services/XBasicService.java diff -r c68aaf028ad2 -r 0b4d2e77cf97 rt/net/sourceforge/jnlp/JNLPFile.java --- a/rt/net/sourceforge/jnlp/JNLPFile.java Wed Jun 10 10:53:03 2009 -0400 +++ b/rt/net/sourceforge/jnlp/JNLPFile.java Wed Jun 10 12:00:53 2009 -0400 @@ -17,12 +17,19 @@ package net.sourceforge.jnlp; -import java.io.*; -import java.net.*; -import java.util.*; - -import net.sourceforge.jnlp.cache.*; -import net.sourceforge.jnlp.runtime.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; + +import net.sourceforge.jnlp.cache.ResourceTracker; +import net.sourceforge.jnlp.cache.UpdatePolicy; +import net.sourceforge.jnlp.runtime.JNLPRuntime; /** * Provides methods to access the information in a Java Network @@ -520,4 +527,48 @@ public class JNLPFile { } } + /** + * + * @return true if the JNLP file specifies things that can only be + * applied on a new vm (eg: different max heap memory) + */ + public boolean needsNewVM() { + + if (getNewVMArgs().size() == 0) { + return false; + } else { + return true; + } + } + + /** + * @return a list of args to pass to the new + * JVM based on this JNLP file + */ + public List getNewVMArgs() { + + List newVMArgs = new LinkedList(); + + JREDesc[] jres = getResources().getJREs(); + for (int jreIndex = 0; jreIndex < jres.length; jreIndex++) { + String initialHeapSize = jres[jreIndex].getInitialHeapSize(); + if (initialHeapSize != null) { + newVMArgs.add("-Xms" + initialHeapSize); + } + + String maxHeapSize = jres[jreIndex].getMaximumHeapSize(); + if (maxHeapSize != null) { + newVMArgs.add("-Xmx" + maxHeapSize); + } + + String vmArgsFromJre = jres[jreIndex].getVMArgs(); + if (vmArgsFromJre != null) { + String[] args = vmArgsFromJre.split(" "); + newVMArgs.addAll(Arrays.asList(args)); + } + } + + return newVMArgs; + } + } diff -r c68aaf028ad2 -r 0b4d2e77cf97 rt/net/sourceforge/jnlp/JREDesc.java --- a/rt/net/sourceforge/jnlp/JREDesc.java Wed Jun 10 10:53:03 2009 -0400 +++ b/rt/net/sourceforge/jnlp/JREDesc.java Wed Jun 10 12:00:53 2009 -0400 @@ -121,6 +121,7 @@ public class JREDesc { /** * Returns the additional arguments to pass to the Java VM + * Can be null */ public String getVMArgs() { return vmArgs; diff -r c68aaf028ad2 -r 0b4d2e77cf97 rt/net/sourceforge/jnlp/Launcher.java --- a/rt/net/sourceforge/jnlp/Launcher.java Wed Jun 10 10:53:03 2009 -0400 +++ b/rt/net/sourceforge/jnlp/Launcher.java Wed Jun 10 12:00:53 2009 -0400 @@ -17,16 +17,27 @@ package net.sourceforge.jnlp; -import java.applet.*; +import java.applet.Applet; import java.awt.Container; -import java.io.*; -import java.net.*; +import java.io.BufferedInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Method; +import java.net.URL; +import java.util.LinkedList; +import java.util.List; import java.util.jar.JarFile; -import java.lang.reflect.*; - -import net.sourceforge.jnlp.cache.*; -import net.sourceforge.jnlp.runtime.*; -import net.sourceforge.jnlp.util.*; + +import net.sourceforge.jnlp.cache.CacheUtil; +import net.sourceforge.jnlp.cache.ResourceTracker; +import net.sourceforge.jnlp.cache.UpdatePolicy; +import net.sourceforge.jnlp.runtime.AppThreadGroup; +import net.sourceforge.jnlp.runtime.AppletInstance; +import net.sourceforge.jnlp.runtime.ApplicationInstance; +import net.sourceforge.jnlp.runtime.JNLPClassLoader; +import net.sourceforge.jnlp.runtime.JNLPRuntime; +import net.sourceforge.jnlp.util.Reflect; /** * Launches JNLPFiles either in the foreground or background.

@@ -238,44 +249,67 @@ public class Launcher { * application's output is sent to the system out and it's * standard input channel is closed. * + * @param vmArgs the arguments to pass to the new JVM. Can be empty but + * must not be null. * @param file the JNLP file to launch + * @param javawsArgs the arguments to pass to the javaws command. Can be + * an empty list but must not be null. * @throws LaunchException if there was an exception */ - public void launchExternal(JNLPFile file) throws LaunchException { - if (file.getSourceLocation() != null) - launchExternal(file.getSourceLocation()); - else if (file.getFileLocation() != null) - launchExternal(file.getFileLocation()); + public void launchExternal(List vmArgs, JNLPFile file, List javawsArgs) throws LaunchException { + List updatedArgs = new LinkedList(javawsArgs); + + if (file.getFileLocation() != null) + updatedArgs.add(file.getFileLocation().toString()); + else if (file.getSourceLocation() != null) + updatedArgs.add(file.getFileLocation().toString()); else launchError(new LaunchException(file, null, R("LSFatal"), R("LCExternalLaunch"), R("LNullLocation"), R("LNullLocationInfo"))); + + launchExternal(vmArgs, updatedArgs); + + } + + /** + * Launches the JNLP file in a new JVM instance. The launched + * application's output is sent to the system out and it's + * standard input channel is closed. + * + * @param url the URL of the JNLP file to launch + * @throws LaunchException if there was an exception + */ + public void launchExternal(URL url) throws LaunchException { + List javawsArgs = new LinkedList(); + javawsArgs.add(url.toString()); + launchExternal(new LinkedList(), javawsArgs); } /** * Launches the JNLP file at the specified location in a new JVM * instance. The launched application's output is sent to the * system out and it's standard input channel is closed. - * - * @param location the URL of the JNLP file to launch + * @param vmArgs the arguments to pass to the jvm + * @param javawsArgs the arguments to pass to javaws (aka Netx) * @throws LaunchException if there was an exception */ - public void launchExternal(URL location) throws LaunchException { - try { - URL cs = Launcher.class.getProtectionDomain().getCodeSource().getLocation(); - if (JNLPRuntime.isDebug()) - System.out.println("netx.jar path: "+cs.getPath()); - - File netxFile = new File(cs.getPath()); - if (!netxFile.exists()) - throw launchError(new LaunchException(null, null, R("LSFatal"), R("LCExternalLaunch"), R("LNetxJarMissing"), R("LNetxJarMissingInfo"))); - - String command[] = { - "javaw", - "-jar", - netxFile.toString(), - "-jnlp", - location.toString(), - "-verbose", - }; + public void launchExternal(List vmArgs, List javawsArgs) throws LaunchException { + try { + + List commands = new LinkedList(); + + String pathToWebstartBinary = System.getProperty("java.home") + + File.separatorChar + + "bin" + + File.separatorChar + + "javaws"; + commands.add(pathToWebstartBinary); + // use -Jargument format to pass arguments to the JVM through the launcher + for (String arg: vmArgs) { + commands.add("-J" + arg); + } + commands.addAll(javawsArgs); + + String[] command = commands.toArray(new String[] {}); Process p = Runtime.getRuntime().exec(command); new StreamEater(p.getErrorStream()).start(); @@ -331,6 +365,15 @@ public class Launcher { throw launchError(new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LNotApplication"), R("LNotApplicationInfo"))); try { + + if (JNLPRuntime.getForksAllowed() && file.needsNewVM()) { + List netxArguments = new LinkedList(); + netxArguments.add("-Xnofork"); + netxArguments.addAll(JNLPRuntime.getInitialArguments()); + launchExternal(file.getNewVMArgs(), netxArguments); + return null; + } + final int preferredWidth = 500; final int preferredHeight = 400; JNLPSplashScreen splashScreen = null; diff -r c68aaf028ad2 -r 0b4d2e77cf97 rt/net/sourceforge/jnlp/Parser.java --- a/rt/net/sourceforge/jnlp/Parser.java Wed Jun 10 10:53:03 2009 -0400 +++ b/rt/net/sourceforge/jnlp/Parser.java Wed Jun 10 12:00:53 2009 -0400 @@ -281,6 +281,11 @@ class Parser { Version version = getVersion(node, "version", null); URL location = getURL(node, "href", base); String vmArgs = getAttribute(node, "java-vm-args",null); + try { + checkVMArgs(vmArgs); + } catch (IllegalArgumentException argumentException) { + vmArgs = null; + } String initialHeap = getAttribute(node, "initial-heap-size", null); String maxHeap = getAttribute(node, "max-heap-size", null); List resources = getResources(node, true); @@ -290,6 +295,8 @@ class Parser { return new JREDesc(version, location, vmArgs, initialHeap, maxHeap, resources); } + + /** * Returns the JAR element at the specified node. @@ -992,6 +999,111 @@ class Parser { return null; else return new Version(version); + } + + /** + * Check that the VM args are valid and safe + * @param vmArgs a string containing the args + * @throws ParseException if the VM arguments are invalid or dangerous + */ + private void checkVMArgs(String vmArgs) throws IllegalArgumentException { + if (vmArgs == null) { + return; + } + + List validArguments = Arrays.asList(getValidVMArguments()); + List validStartingArguments = Arrays.asList(getValidStartingVMArguments()); + + String[] arguments = vmArgs.split(" "); + boolean argumentIsValid = false; + for (String argument: arguments) { + argumentIsValid = false; + + if (validArguments.contains(argument)) { + argumentIsValid = true; + } else { + for (String validStartingArgument: validStartingArguments) { + if (argument.startsWith(validStartingArgument)) { + argumentIsValid = true; + break; + } + } + } + + if (!argumentIsValid) { + throw new IllegalArgumentException(argument); + } + } + + } + + /** + * Returns an array of valid (ie safe and supported) arguments for the JVM + * + * Based on http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html + */ + private String[] getValidVMArguments() { + return new String[] { + "-d32", /* use a 32-bit data model if available */ + "-client", /* to select the client VM */ + "-server", /* to select the server VM */ + "-verbose", /* enable verbose output */ + "-version", /* print product version and exit */ + "-showversion", /* print product version and continue */ + "-help", /* print this help message */ + "-X", /* print help on non-standard options */ + "-ea", /* enable assertions */ + "-enableassertions", /* enable assertions */ + "-da", /* disable assertions */ + "-disableassertions", /* disable assertions */ + "-esa", /* enable system assertions */ + "-enablesystemassertions", /* enable system assertions */ + "-dsa", /* disable system assertione */ + "-disablesystemassertions", /* disable system assertione */ + "-Xmixed", /* mixed mode execution (default) */ + "-Xint", /* interpreted mode execution only */ + "-Xnoclassgc", /* disable class garbage collection */ + "-Xincgc", /* enable incremental garbage collection */ + "-Xbatch", /* disable background compilation */ + "-Xprof", /* output cpu profiling data */ + "-Xdebug", /* enable remote debugging */ + "-Xfuture", /* enable strictest checks, anticipating future default */ + "-Xrs", /* reduce use of OS signals by Java/VM (see documentation) */ + "-XX:+ForceTimeHighResolution", /* use high resolution timer */ + "-XX:-ForceTimeHighResolution", /* use low resolution (default) */ + }; + } + + /** + * Returns an array containing the starts of valid (ie safe and supported) + * arguments for the JVM + * + * Based on http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html + */ + private String[] getValidStartingVMArguments() { + return new String[] { + "-ea", /* enable assertions for classes */ + "-enableassertions", /* enable assertions for classes */ + "-da", /* disable assertions for classes */ + "-disableassertions", /* disable assertions for classes */ + "-verbose", /* enable verbose output */ + "-Xms", /* set initial Java heap size */ + "-Xmx", /* set maximum Java heap size */ + "-Xss", /* set java thread stack size */ + "-XX:NewRatio", /* set Ratio of new/old gen sizes */ + "-XX:NewSize", /* set initial size of new generation */ + "-XX:MaxNewSize", /* set max size of new generation */ + "-XX:PermSize", /* set initial size of permanent gen */ + "-XX:MaxPermSize", /* set max size of permanent gen */ + "-XX:MaxHeapFreeRatio", /* heap free percentage (default 70) */ + "-XX:MinHeapFreeRatio", /* heap free percentage (default 40) */ + "-XX:UseSerialGC", /* use serial garbage collection */ + "-XX:ThreadStackSize", /* thread stack size (in KB) */ + "-XX:MaxInlineSize", /* set max num of bytecodes to inline */ + "-XX:ReservedCodeCacheSize", /* Reserved code cache size (bytes) */ + "-XX:MaxDirectMemorySize", + + }; } /** diff -r c68aaf028ad2 -r 0b4d2e77cf97 rt/net/sourceforge/jnlp/resources/Messages.properties --- a/rt/net/sourceforge/jnlp/resources/Messages.properties Wed Jun 10 10:53:03 2009 -0400 +++ b/rt/net/sourceforge/jnlp/resources/Messages.properties Wed Jun 10 12:00:53 2009 -0400 @@ -130,6 +130,7 @@ BOStrict = Enables strict checking of BOStrict = Enables strict checking of JNLP file format. BOViewer = Shows the trusted certificate viewer. BOUmask = Sets the umask for files created by an application. +BXnofork = Do not create another JVM. BOHelp = Print this message and exit. # Cache diff -r c68aaf028ad2 -r 0b4d2e77cf97 rt/net/sourceforge/jnlp/runtime/Boot.java --- a/rt/net/sourceforge/jnlp/runtime/Boot.java Wed Jun 10 10:53:03 2009 -0400 +++ b/rt/net/sourceforge/jnlp/runtime/Boot.java Wed Jun 10 12:00:53 2009 -0400 @@ -24,6 +24,7 @@ import java.security.AccessController; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import javax.net.ssl.HttpsURLConnection; @@ -116,6 +117,7 @@ public final class Boot implements Privi + " -headless "+R("BOHeadless")+"\n" + " -strict "+R("BOStrict")+"\n" + " -umask=value "+R("BOUmask")+"\n" + + " -Xnofork "+R("BXnofork")+"\n" + " -help "+R("BOHelp")+"\n"; private static final String doubleArgs = "-basedir -jnlp -arg -param -property -update"; @@ -168,6 +170,10 @@ public final class Boot implements Privi if (null != getOption("-noupdate")) JNLPRuntime.setDefaultUpdatePolicy(UpdatePolicy.NEVER); + + if (null != getOption("-Xnofork")) { + JNLPRuntime.setForksAllowed(false); + } // wire in custom authenticator try { @@ -183,12 +189,13 @@ public final class Boot implements Privi e.printStackTrace(); } + JNLPRuntime.setInitialArgments(Arrays.asList(argsIn)); + // do in a privileged action to clear the security context of // the Boot13 class, which doesn't have any privileges in // JRE1.3; JRE1.4 works without Boot13 or this PrivilegedAction. AccessController.doPrivileged(new Boot()); - args = null; // might save a couple bytes... } /** diff -r c68aaf028ad2 -r 0b4d2e77cf97 rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java --- a/rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java Wed Jun 10 10:53:03 2009 -0400 +++ b/rt/net/sourceforge/jnlp/runtime/JNLPRuntime.java Wed Jun 10 12:00:53 2009 -0400 @@ -21,6 +21,7 @@ import java.awt.*; import java.awt.*; import java.text.*; import java.util.*; +import java.util.List; import java.security.*; import javax.jnlp.*; @@ -96,7 +97,14 @@ public class JNLPRuntime { /** set to true if this is a webstart application. */ private static boolean isWebstartApplication; - + + /** set to false to indicate another JVM should not be spawned, even if necessary */ + private static boolean forksAllowed = true; + + /** contains the arguments passed to the jnlp runtime */ + private static List initialArguments; + + /** * Returns whether the JNLP runtime environment has been * initialized. Once initialized, some properties such as the From omajid at redhat.com Wed Jun 10 09:09:08 2009 From: omajid at redhat.com (Omair Majid) Date: Wed, 10 Jun 2009 12:09:08 -0400 Subject: RFC: Netx - Support VM arguments specified in the JNLP file In-Reply-To: <20090610135422.GA11916@redhat.com> References: <4A24420C.4030401@redhat.com> <20090602184329.GA18297@redhat.com> <4A26B5AF.605@redhat.com> <20090603180752.GB21904@redhat.com> <4A27DC10.9070600@redhat.com> <20090604214722.GA29542@redhat.com> <4A296FF5.2020703@redhat.com> <20090608225621.GB21227@redhat.com> <4A2ECF4D.3050608@redhat.com> <20090610135422.GA11916@redhat.com> Message-ID: <4A2FDAA4.8030005@redhat.com> Deepak Bhole wrote: > * Omair Majid [2009-06-09 17:08]: > > Looks good. You may want to print a warning on stderr stating that > vmargs are being dropped to null and why (instead of just setting > them null and proceeding). But that's your call. Either way, good to > commit. > > Cheers, > Deepak > Thanks for the extensive review! Pushed as changeset 0b4d2e77cf97 in icedtea6 Cheers, Omair From gbenson at redhat.com Wed Jun 10 13:45:29 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 10 Jun 2009 20:45:29 +0000 Subject: changeset in /hg/icedtea: 2009-05-21 Gary Benson changeset 6909d3942630 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=6909d3942630 description: 2009-05-21 Gary Benson * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp: Fix for x86 debug builds. diffstat: 2 files changed, 7 insertions(+) ChangeLog | 5 +++++ ports/hotspot/src/share/vm/shark/sharkCompiler.cpp | 2 ++ diffs (24 lines): diff -r a5e05eb00fc3 -r 6909d3942630 ChangeLog --- a/ChangeLog Fri Jun 05 18:38:11 2009 +0100 +++ b/ChangeLog Thu May 21 14:26:47 2009 +0100 @@ -1,3 +1,8 @@ 2009-05-27 Andrew John Hughes + + * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp: + Fix for x86 debug builds. + 2009-05-27 Andrew John Hughes * HACKING: Updated. diff -r a5e05eb00fc3 -r 6909d3942630 ports/hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Fri Jun 05 18:38:11 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Thu May 21 14:26:47 2009 +0100 @@ -25,6 +25,8 @@ #include "incls/_precompiled.incl" #include "incls/_sharkCompiler.cpp.incl" + +#include using namespace llvm; From ahughes at redhat.com Wed Jun 10 13:45:30 2009 From: ahughes at redhat.com (Andrew John Hughes) Date: Wed, 10 Jun 2009 20:45:30 +0000 Subject: changeset in /hg/icedtea: Forwardport Shark. Message-ID: changeset bdb3cd6099a9 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=bdb3cd6099a9 description: Forwardport Shark. 2009-05-22 Gary Benson * patches/icedtea-zero.patch (vmError.cpp): Don't include interpreterRuntime.hpp here. * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Include interpreterRuntime.hpp and scopeDesc.hpp. (ZeroStackPrinter::print_word): Decode pc to get bci. diffstat: 3 files changed, 25 insertions(+), 4 deletions(-) ChangeLog | 8 ++++++++ patches/icedtea-zero.patch | 5 ++--- ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp | 16 +++++++++++++++- diffs (76 lines): diff -r 6909d3942630 -r bdb3cd6099a9 ChangeLog --- a/ChangeLog Thu May 21 14:26:47 2009 +0100 +++ b/ChangeLog Wed Jun 10 16:59:23 2009 +0100 @@ -1,3 +1,11 @@ 2009-05-21 Gary Benson + + * patches/icedtea-zero.patch + (vmError.cpp): Don't include interpreterRuntime.hpp here. + * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp + Include interpreterRuntime.hpp and scopeDesc.hpp. + (ZeroStackPrinter::print_word): Decode pc to get bci. + 2009-05-21 Gary Benson * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp: diff -r 6909d3942630 -r bdb3cd6099a9 patches/icedtea-zero.patch --- a/patches/icedtea-zero.patch Thu May 21 14:26:47 2009 +0100 +++ b/patches/icedtea-zero.patch Wed Jun 10 16:59:23 2009 +0100 @@ -151,14 +151,13 @@ class ParkEvent ; --- openjdk/hotspot/src/share/vm/utilities/vmError.cpp.orig 2008-12-03 19:33:25.000000000 +0000 +++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp 2008-12-03 19:40:11.000000000 +0000 -@@ -25,6 +25,11 @@ +@@ -25,6 +25,10 @@ # include "incls/_precompiled.incl" # include "incls/_vmError.cpp.incl" +# ifdef ZERO -+# include +# include -+# endif // ++# endif // ZERO + // List of environment variables that should be reported in error log file. const char *env_list[] = { diff -r 6909d3942630 -r bdb3cd6099a9 ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Thu May 21 14:26:47 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Wed Jun 10 16:59:23 2009 +0100 @@ -22,6 +22,9 @@ * have any questions. * */ + +#include +#include class ZeroStackPrinter { private: @@ -190,15 +193,26 @@ class ZeroStackPrinter { } } if (frame->is_shark_frame()) { + SharkFrame *sf = frame->as_shark_frame(); + methodOop method = sf->method(); + if (word == SharkFrame::pc_off) { field = "pc"; + if (method->is_oop()) { + nmethod *code = method->code(); + address pc = sf->pc(); + if (code->pc_desc_at(pc)) { + SimpleScopeDesc ssd(code, pc); + snprintf(_buf, _buflen, PTR_FORMAT " (bci %d)", pc, ssd.bci()); + value = _buf; + } + } } else if (word == SharkFrame::unextended_sp_off) { field = "unextended_sp"; } else if (word == SharkFrame::method_off) { field = "method"; - methodOop method = ((SharkFrame *) frame)->method(); if (method->is_oop()) value = method->name_and_sig_as_C_string(_buf, _buflen); } From gbenson at redhat.com Wed Jun 10 13:45:31 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 10 Jun 2009 20:45:31 +0000 Subject: changeset in /hg/icedtea: 2009-05-27 Gary Benson changeset 57f11ade2a35 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=57f11ade2a35 description: 2009-05-27 Gary Benson * ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp (SharkDecacher::location_type): New method. (SharkDecacher::stack_location_type): Use the above. (SharkDecacher::local_location_type): Use the above. diffstat: 2 files changed, 49 insertions(+), 10 deletions(-) ChangeLog | 7 ++ ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp | 52 ++++++++++++---- diffs (90 lines): diff -r 49646e89d0ce -r 57f11ade2a35 ChangeLog --- a/ChangeLog Fri May 22 15:18:17 2009 +0100 +++ b/ChangeLog Wed May 27 13:47:05 2009 +0100 @@ -1,3 +1,10 @@ 2009-05-22 Gary Benson + + * ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp + (SharkDecacher::location_type): New method. + (SharkDecacher::stack_location_type): Use the above. + (SharkDecacher::local_location_type): Use the above. + 2009-05-22 Gary Benson * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp diff -r 49646e89d0ce -r 57f11ade2a35 ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp --- a/ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp Fri May 22 15:18:17 2009 +0100 +++ b/ports/hotspot/src/share/vm/shark/sharkCacheDecache.hpp Wed May 27 13:47:05 2009 +0100 @@ -151,6 +151,46 @@ class SharkDecacher : public SharkCacher { return new LocationValue(slot2loc(offset, type)); } + static Location::Type location_type(SharkValue** addr, bool maybe_two_word) + { + // low addresses this end + // Type 32-bit 64-bit + // ---------------------------------------------------- + // stack[0] local[3] jobject oop oop + // stack[1] local[2] NULL normal lng + // stack[2] local[1] jlong normal invalid + // stack[3] local[0] jint normal normal + // + // high addresses this end + + SharkValue *value = *addr; + if (value) { + if (value->is_jobject()) + return Location::oop; +#ifdef _LP64 + if (value->is_two_word()) + return Location::invalid; +#endif // _LP64 + return Location::normal; + } + else { + if (maybe_two_word) { + value = *(addr - 1); + if (value && value->is_two_word()) { +#ifdef _LP64 + if (value->is_jlong()) + return Location::lng; + if (value->is_jdouble()) + return Location::dbl; + ShouldNotReachHere(); +#else + return Location::normal; +#endif // _LP64 + } + } + return Location::invalid; + } + } // Stack slot helpers protected: @@ -160,9 +200,7 @@ class SharkDecacher : public SharkCacher static Location::Type stack_location_type(int index, SharkValue** addr) { - if (addr[0] && addr[0]->is_jobject()) - return Location::oop; - return Location::normal; + return location_type(addr, *addr == NULL); } // Local slot helpers @@ -173,13 +211,7 @@ class SharkDecacher : public SharkCacher static Location::Type local_location_type(int index, SharkValue** addr) { - if (addr[0] && addr[0]->is_jobject()) - return Location::oop; - if (addr[0]) - return Location::normal; - if (index > 0 && addr[-1] && addr[-1]->is_two_word()) - return Location::normal; - return Location::invalid; + return location_type(addr, index > 0); } // Writer helper From gbenson at redhat.com Wed Jun 10 13:45:30 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 10 Jun 2009 20:45:30 +0000 Subject: changeset in /hg/icedtea: 2009-05-22 Gary Benson changeset 49646e89d0ce in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=49646e89d0ce description: 2009-05-22 Gary Benson * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Include interpreterRuntime.hpp and scopeDesc.hpp. (ZeroStackPrinter::print_word): Decode bcx to get bci. diffstat: 2 files changed, 12 insertions(+) ChangeLog | 6 ++++++ ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp | 6 ++++++ diffs (29 lines): diff -r bdb3cd6099a9 -r 49646e89d0ce ChangeLog --- a/ChangeLog Wed Jun 10 16:59:23 2009 +0100 +++ b/ChangeLog Fri May 22 15:18:17 2009 +0100 @@ -1,3 +1,9 @@ 2009-05-22 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp + Include interpreterRuntime.hpp and scopeDesc.hpp. + (ZeroStackPrinter::print_word): Decode bcx to get bci. + 2009-05-22 Gary Benson * patches/icedtea-zero.patch diff -r bdb3cd6099a9 -r 49646e89d0ce ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Wed Jun 10 16:59:23 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Fri May 22 15:18:17 2009 +0100 @@ -115,6 +115,12 @@ class ZeroStackPrinter { if (is_valid && !strcmp(field, "_method")) { value = istate->method()->name_and_sig_as_C_string(_buf,_buflen); field = "istate->_method"; + } + else if (is_valid && !strcmp(field, "_bcp") && istate->bcp()) { + snprintf(_buf, _buflen, PTR_FORMAT " (bci %d)", istate->bcp(), + istate->method()->bci_from(istate->bcp())); + value = _buf; + field = "istate->_bcp"; } else { snprintf(_buf, _buflen, "%sistate->%s", From gbenson at redhat.com Wed Jun 10 13:45:31 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 10 Jun 2009 20:45:31 +0000 Subject: changeset in /hg/icedtea: ChangeLog fix Message-ID: changeset b49274854fdc in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=b49274854fdc description: ChangeLog fix diffstat: 1 file changed, 1 insertion(+), 1 deletion(-) ChangeLog | 2 +- diffs (12 lines): diff -r 57f11ade2a35 -r b49274854fdc ChangeLog --- a/ChangeLog Wed May 27 13:47:05 2009 +0100 +++ b/ChangeLog Wed May 27 13:49:38 2009 +0100 @@ -3,7 +3,7 @@ 2009-05-27 Gary Benson From ahughes at redhat.com Wed Jun 10 13:45:31 2009 From: ahughes at redhat.com (Andrew John Hughes) Date: Wed, 10 Jun 2009 20:45:31 +0000 Subject: changeset in /hg/icedtea: Forwardport Shark. Message-ID: changeset 348b533726b1 in /hg/icedtea details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=348b533726b1 description: Forwardport Shark. 2009-05-27 Gary Benson * ports/hotspot/src/share/vm/shark/sharkFunction.hpp (SharkFunction::_monitor_count): Removed. (SharkFunction::_max_monitors): New field. (SharkFunction::monitor_count): Removed. (SharkFunction::max_monitors): New method. (SharkFunction::_exception_slot_offset): Removed. (SharkFunction::exception_slot): Likewise. (SharkFunction::_oop_tmp_slot_offset): New field. (SharkFunction::oop_tmp_slot_offset): New method. (SharkFunction::monitors_slots): Removed. (SharkFunction::monitors_slots_offs