From aph at redhat.com Mon Nov 2 09:32:05 2009 From: aph at redhat.com (Andrew Haley) Date: Mon, 02 Nov 2009 09:32:05 +0000 Subject: Howto implement configure/makefile checking for JNI headers? In-Reply-To: <194f62550910311045v73e9e1c2g94c1135ea6064992@mail.gmail.com> References: <194f62550910311045v73e9e1c2g94c1135ea6064992@mail.gmail.com> Message-ID: <4AEEA715.2050502@redhat.com> Clemens Eisserer wrote: > I would like to add a Java binding to an existing project written in > C, however I am totally unexperienced with make/configure. > Any hints, or even better snippits, how I could search for JNI headers > during configure, allow the variable to be configureable with a saned > efault value? It's hard to tell from this what you're trying to do. Andrew. From dennis at dbyrne.net Mon Nov 9 23:38:55 2009 From: dennis at dbyrne.net (Dennis Byrne) Date: Mon, 9 Nov 2009 17:38:55 -0600 Subject: Getting PrintAssembly to work ... Message-ID: <446564320911091538s535d01d0k89e29db209b4b0b6@mail.gmail.com> http://wikis.sun.com/display/HotSpotInternals/PrintAssembly reads "The following HotSpot options ... require OpenJDK 7". If I cannot use OpenJDK 6, what are my options for obtaining 7? The install instructions all appear to be for version 6 http://openjdk.java.net/install/ . Thanks in advance, -- Dennis Byrne From volker.simonis at gmail.com Tue Nov 10 09:09:14 2009 From: volker.simonis at gmail.com (Volker Simonis) Date: Tue, 10 Nov 2009 10:09:14 +0100 Subject: Getting PrintAssembly to work ... In-Reply-To: <446564320911091538s535d01d0k89e29db209b4b0b6@mail.gmail.com> References: <446564320911091538s535d01d0k89e29db209b4b0b6@mail.gmail.com> Message-ID: The documentation is somewhat outdated. It should read "..require at least HotSpot 14". So JDK 6u14 and higher or the latest OpenJDK6 release should be ok. Regards, Volker On 11/10/09, Dennis Byrne wrote: > http://wikis.sun.com/display/HotSpotInternals/PrintAssembly reads "The > following HotSpot options ... require OpenJDK 7". If I cannot use > OpenJDK 6, what are my options for obtaining 7? The install > instructions all appear to be for version 6 > http://openjdk.java.net/install/ . Thanks in advance, > > -- > > Dennis Byrne > From dennis at dbyrne.net Wed Nov 11 17:33:31 2009 From: dennis at dbyrne.net (Dennis Byrne) Date: Wed, 11 Nov 2009 11:33:31 -0600 Subject: Getting PrintAssembly to work ... In-Reply-To: References: <446564320911091538s535d01d0k89e29db209b4b0b6@mail.gmail.com> Message-ID: <446564320911110933n7535a789jba7fc40f43f2d1b4@mail.gmail.com> Thanks for your reply Volker. Got it. byrne at wud-nbyrne01:~$ java -version java version "1.6.0_0" OpenJDK Runtime Environment (IcedTea6 1.6.1) (6b16-1.6.1-1ubuntu3) OpenJDK Client VM (build 14.0-b16, mixed mode, sharing) I am now trying to build the plugin with the following error. Two questions, the README reads "BINTUILS" rather than "BINUTILS". I get the following error regardless of which flag I use. Also, what should I be telling make in order to keep it from looking for /java/re/j2se/1.6.0/latest/binaries/linux-i586/bin/java (which does not exist) ? dbyrne at wud-nbyrne01:~/print_assembly/hotspot-2f1ec89b9995/make$ make BINTUILS=/home/dbyrne/print_assembly/binutils-2.19.1 cd: 1: can't cd to /java/re/j2se/1.6.0/latest/binaries/linux-i586 cd /home/dbyrne/print_assembly/hotspot-2f1ec89b9995/make; \ make VM_TARGET=product generic_build2 cd: 1: can't cd to /java/re/j2se/1.6.0/latest/binaries/linux-i586 make[1]: Entering directory `/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/make' mkdir -p /home/dbyrne/print_assembly/hotspot-2f1ec89b9995/build/linux cd /home/dbyrne/print_assembly/hotspot-2f1ec89b9995/build/linux; \ make -f /home/dbyrne/print_assembly/hotspot-2f1ec89b9995/make/linux/Makefile \ JAVA_HOME=/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/make OUTPUTDIR=/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/build/linux GAMMADIR=/home/dbyrne/print_assembly/hotspot-2f1ec89b9995 MAKE_VERBOSE=y HOTSPOT_RELEASE_VERSION=17.0-b05 JRE_RELEASE_VERSION="1.7.0" HOTSPOT_BUILD_VERSION=internal product cd: 1: can't cd to /java/re/j2se/1.6.0/latest/binaries/linux-i586 make[2]: Entering directory `/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/build/linux' make -f /home/dbyrne/print_assembly/hotspot-2f1ec89b9995/make/linux/Makefile checks cd: 1: can't cd to /java/re/j2se/1.6.0/latest/binaries/linux-i586 make[3]: Entering directory `/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/build/linux' /java/re/j2se/1.6.0/latest/binaries/linux-i586/bin/javap javax.xml.transform.TransformerFactory > /dev/null 2>&1; \ if [ $? -ne 0 ]; then \ /java/re/j2se/1.6.0/latest/binaries/linux-i586/bin/java -version; \ echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \ "to bootstrap this build" 1>&2; \ exit 1; \ fi /bin/sh: /java/re/j2se/1.6.0/latest/binaries/linux-i586/bin/java: not found *** An XSLT processor (J2SE 1.4.x or newer) is required to bootstrap this build make[3]: *** [check_j2se_version] Error 1 make[3]: Leaving directory `/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/build/linux' make[2]: *** [linux_i486_compiler2/debug] Error 2 make[2]: Leaving directory `/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/build/linux' make[1]: *** [generic_build2] Error 2 make[1]: Leaving directory `/home/dbyrne/print_assembly/hotspot-2f1ec89b9995/make' make: *** [product] Error 2 Dennis On Tue, Nov 10, 2009 at 3:09 AM, Volker Simonis wrote: > The documentation is somewhat outdated. It should read "..require at > least HotSpot 14". So JDK 6u14 and higher or the latest OpenJDK6 > release should be ok. > > Regards, > Volker > > On 11/10/09, Dennis Byrne wrote: >> http://wikis.sun.com/display/HotSpotInternals/PrintAssembly reads "The >> ?following HotSpot options ... require OpenJDK 7". ?If I cannot use >> ?OpenJDK 6, what are my options for obtaining 7? ?The install >> ?instructions all appear to be for version 6 >> ?http://openjdk.java.net/install/ . ?Thanks in advance, >> >> ?-- >> >> Dennis Byrne >> > -- Dennis Byrne From David.Katleman at Sun.COM Fri Nov 13 05:35:05 2009 From: David.Katleman at Sun.COM (David Katleman) Date: Thu, 12 Nov 2009 21:35:05 -0800 Subject: JDK 7 build 76 is available at the openjdk.java.net website Message-ID: <4AFCF009.5060403@sun.com> The OpenJDK source is available at: http://hg.openjdk.java.net/jdk7/jdk7 http://hg.openjdk.java.net/jdk7/jdk7/rev/1f17ca8353ba The OpenJDK source binary plugs for the promoted JDK 7 build YY are available under the openjdk http://openjdk.java.net website under Source Code (direct link to bundles: http://download.java.net/openjdk/jdk7) Summary of changes: http://download.java.net/jdk7/changes/jdk7-b76.html - Dave From David.Katleman at Sun.COM Fri Nov 13 05:33:13 2009 From: David.Katleman at Sun.COM (David Katleman) Date: Thu, 12 Nov 2009 21:33:13 -0800 Subject: JDK 7 build 76 is available at the openjdk.java.net website Message-ID: <4AFCEF99.2090205@sun.com> The OpenJDK source is available at: http://hg.openjdk.java.net/jdk7/jdk7 http://hg.openjdk.java.net/jdk7/jdk7/rev/1f17ca8353ba The OpenJDK source binary plugs for the promoted JDK 7 build YY are available under the openjdk http://openjdk.java.net website under Source Code (direct link to bundles: http://download.java.net/openjdk/jdk7) Summary of changes: http://download.java.net/jdk7/changes/jdk7-b76.html - Dave From gnu_andrew at member.fsf.org Fri Nov 13 16:43:02 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 13 Nov 2009 16:43:02 +0000 Subject: JDK 7 build 76 is available at the openjdk.java.net website In-Reply-To: <4AFCF009.5060403@sun.com> References: <4AFCF009.5060403@sun.com> Message-ID: <17c6771e0911130843w51576631n79e9e1fe78e1d23f@mail.gmail.com> 2009/11/13 David Katleman : > The OpenJDK source is available at: > http://hg.openjdk.java.net/jdk7/jdk7 > http://hg.openjdk.java.net/jdk7/jdk7/rev/1f17ca8353ba > > The OpenJDK source binary plugs for the promoted JDK 7 build YY are > available under the openjdk http://openjdk.java.net website under Source > Code (direct link to bundles: http://download.java.net/openjdk/jdk7) > > Summary of changes: > http://download.java.net/jdk7/changes/jdk7-b76.html > > > - Dave > Anyone know if this is to be milestone 5 yet? -- 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 David.Katleman at Sun.COM Fri Nov 13 16:50:19 2009 From: David.Katleman at Sun.COM (david katleman) Date: Fri, 13 Nov 2009 08:50:19 -0800 Subject: b76 is milestone 5. Re: JDK 7 build 76 is available at the openjdk.java.net website In-Reply-To: <17c6771e0911130843w51576631n79e9e1fe78e1d23f@mail.gmail.com> References: <4AFCF009.5060403@sun.com> <17c6771e0911130843w51576631n79e9e1fe78e1d23f@mail.gmail.com> Message-ID: <4AFD8E4B.4040801@sun.com> Hi Andrew! > Anyone know if this is to be milestone 5 yet? Yes, b76 is milestone 5. Thanks Dave Andrew John Hughes wrote: > 2009/11/13 David Katleman : > >> The OpenJDK source is available at: >> http://hg.openjdk.java.net/jdk7/jdk7 >> http://hg.openjdk.java.net/jdk7/jdk7/rev/1f17ca8353ba >> >> The OpenJDK source binary plugs for the promoted JDK 7 build 76 are >> available under the openjdk http://openjdk.java.net website under Source >> Code (direct link to bundles: http://download.java.net/openjdk/jdk7) >> >> Summary of changes: >> http://download.java.net/jdk7/changes/jdk7-b76.html >> >> >> - Dave >> >> > > Anyone know if this is to be milestone 5 yet? > From neal at gafter.com Fri Nov 13 19:12:51 2009 From: neal at gafter.com (Neal Gafter) Date: Fri, 13 Nov 2009 11:12:51 -0800 Subject: Congrats on openjdk7 feature complete? Message-ID: <15e8b9d20911131112t34569965r79bb2602664156c1@mail.gmail.com> Mark- I think congratulations are in order for reaching the Feature Complete milestone M5 of openjdk7 (delayed, as you previously announced, to the now complete build 76). This leaves me wondering about the state of features previously planned for JDK7, but not now included. It's been nearly three years since the release of SE 6. Will JDK7 slip to await specificaion, implementation, and integrations of further features? Or will yet-incomplete features have to wait for a later release? Cheers, Neal From mthornton at optrak.co.uk Fri Nov 13 19:21:10 2009 From: mthornton at optrak.co.uk (Mark Thornton) Date: Fri, 13 Nov 2009 19:21:10 +0000 Subject: Congrats on openjdk7 feature complete? In-Reply-To: <15e8b9d20911131112t34569965r79bb2602664156c1@mail.gmail.com> References: <15e8b9d20911131112t34569965r79bb2602664156c1@mail.gmail.com> Message-ID: <4AFDB1A6.6040708@optrak.co.uk> Neal Gafter wrote: > Mark- > > I think congratulations are in order for reaching the Feature Complete > milestone M5 of openjdk7 (delayed, as you previously announced, to the now > complete build 76). > Indeed, have a beer. > This leaves me wondering about the state of features previously planned for > JDK7, but not now included. Sadly some of them appear to be in hibernation if not actually dead. Mark From Jonathan.Gibbons at Sun.COM Fri Nov 13 19:29:28 2009 From: Jonathan.Gibbons at Sun.COM (Jonathan Gibbons) Date: Fri, 13 Nov 2009 11:29:28 -0800 Subject: Congrats on openjdk7 feature complete? In-Reply-To: <4AFDB1A6.6040708@optrak.co.uk> References: <15e8b9d20911131112t34569965r79bb2602664156c1@mail.gmail.com> <4AFDB1A6.6040708@optrak.co.uk> Message-ID: <4AFDB398.5050603@sun.com> Mark Thornton wrote: > Neal Gafter wrote: >> Mark- >> >> I think congratulations are in order for reaching the Feature Complete >> milestone M5 of openjdk7 (delayed, as you previously announced, to >> the now >> complete build 76). >> > Indeed, have a beer. >> This leaves me wondering about the state of features previously >> planned for >> JDK7, but not now included. > Sadly some of them appear to be in hibernation if not actually dead. > > Mark Nah, they're pining -- they're just pining for the lost fjords. -- Jon From mthornton at optrak.co.uk Fri Nov 13 19:47:07 2009 From: mthornton at optrak.co.uk (Mark Thornton) Date: Fri, 13 Nov 2009 19:47:07 +0000 Subject: Congrats on openjdk7 feature complete? In-Reply-To: <4AFDB398.5050603@sun.com> References: <15e8b9d20911131112t34569965r79bb2602664156c1@mail.gmail.com> <4AFDB1A6.6040708@optrak.co.uk> <4AFDB398.5050603@sun.com> Message-ID: <4AFDB7BB.1010902@optrak.co.uk> Jonathan Gibbons wrote: > Mark Thornton wrote: >> Neal Gafter wrote: >>> This leaves me wondering about the state of features previously >>> planned for >>> JDK7, but not now included. >> Sadly some of them appear to be in hibernation if not actually dead. >> >> Mark > Nah, they're pining -- they're just pining for the lost fjords. > > -- Jon http://en.wikipedia.org/wiki/Dead_Parrot ;-) Mark From dennisbyrne at apache.org Tue Nov 17 23:28:59 2009 From: dennisbyrne at apache.org (Dennis Byrne) Date: Tue, 17 Nov 2009 17:28:59 -0600 Subject: mfence on i686 with volatile? Message-ID: <446564320911171528y3e27efd7v71b4e36bd394f69f@mail.gmail.com> I am not observing any fences in the output from PrintAssembly. The following java produces the following assembly, regardless of whether or not I make v and v2 volatile. class HelloWorld extends Thread{ public static int v = 0; public static int v2 = 1; public static void main(String[] args){ new HelloWorld().start(); new HelloWorld().start(); } public void run() { for(int i = 0; i < 1000000; i++){ v += 333; v2 += v; } System.out.println(v); System.out.println(v2); } } 0x02e33d30: mov %eax,-0x3000(%esp) ; 0x02e33d37: push %ebp ; 0x02e33d38: mov %esp,%ebp ; 0x02e33d3a: sub $0x28,%esp ; 0x02e33d3d: mov $0x0,%esi ; 0x02e33d42: jmp 0x02e33d7a ; 0x02e33d47: nop ; 0x02e33d48: mov $0x95ba5348,%edx ; 0x02e33d4d: mov 0x1b8(%edx),%ecx ; 0x02e33d53: add $0x14d,%ecx ; v += 333 0x02e33d59: mov %ecx,0x1b8(%edx) ; 0x02e33d5f: mov 0x1bc(%edx),%ecx ; 0x02e33d65: mov 0x1b8(%edx),%edi ; 0x02e33d6b: add %edi,%ecx ; v2 += v 0x02e33d6d: mov %ecx,0x1bc(%edx) ; 0x02e33d73: inc %esi ; i++ ; ; ; - HelloWorld::run at 31 (line 12) -- Dennis Byrne From David.Holmes at Sun.COM Wed Nov 18 01:42:49 2009 From: David.Holmes at Sun.COM (David Holmes - Sun Microsystems) Date: Wed, 18 Nov 2009 11:42:49 +1000 Subject: mfence on i686 with volatile? In-Reply-To: <446564320911171528y3e27efd7v71b4e36bd394f69f@mail.gmail.com> References: <446564320911171528y3e27efd7v71b4e36bd394f69f@mail.gmail.com> Message-ID: <4B035119.6010608@sun.com> Denis, This is OT for the discuss mailing list so I've moved it to hotspot-dev. (discuss-list was bcc'ed). Regards, David Holmes Dennis Byrne said the following on 11/18/09 09:28: > I am not observing any fences in the output from PrintAssembly. The > following java produces the following assembly, regardless of whether > or not I make v and v2 volatile. > > class HelloWorld extends Thread{ > public static int v = 0; > public static int v2 = 1; > public static void main(String[] args){ > new HelloWorld().start(); > new HelloWorld().start(); > } > public void run() { > for(int i = 0; i < 1000000; i++){ > v += 333; > v2 += v; > } > System.out.println(v); > System.out.println(v2); > } > } > > > 0x02e33d30: mov %eax,-0x3000(%esp) ; > 0x02e33d37: push %ebp ; > 0x02e33d38: mov %esp,%ebp ; > 0x02e33d3a: sub $0x28,%esp ; > 0x02e33d3d: mov $0x0,%esi ; > 0x02e33d42: jmp 0x02e33d7a ; > 0x02e33d47: nop ; > 0x02e33d48: mov $0x95ba5348,%edx ; > > 0x02e33d4d: mov 0x1b8(%edx),%ecx ; > 0x02e33d53: add $0x14d,%ecx ; v += 333 > 0x02e33d59: mov %ecx,0x1b8(%edx) ; > 0x02e33d5f: mov 0x1bc(%edx),%ecx ; > 0x02e33d65: mov 0x1b8(%edx),%edi ; > 0x02e33d6b: add %edi,%ecx ; v2 += v > 0x02e33d6d: mov %ecx,0x1bc(%edx) ; > 0x02e33d73: inc %esi ; i++ > ; > ; > ; - HelloWorld::run at 31 (line 12) > > From jonnyt at abpni.co.uk Sat Nov 21 19:43:28 2009 From: jonnyt at abpni.co.uk (Jonathan Tripathy) Date: Sat, 21 Nov 2009 19:43:28 +0000 Subject: Installing openjdk-jre on leased computers Message-ID: <4B0842E0.6010400@abpni.co.uk> Hi Folks, I intend on leasing out 15 computers to a customer of mine. I wish for this customer to run a Java application which we have developed. Legally speaking, is it ok for me to install the openjdk-jre package on these computers to enable this customer to run my Java application? The thing that worries me, is that in the "OpenJDK Binary License", the following line is in it: "You may not rent, lease, lend or encumber Software". Does this prevent me doing what I want to do? I will be taking money for the lease of these computers, and also for my java software. Could I get around the above term by compiling the openjdk-jre myself? Thanks From Dalibor.Topic at Sun.COM Tue Nov 24 13:28:36 2009 From: Dalibor.Topic at Sun.COM (Dalibor Topic) Date: Tue, 24 Nov 2009 14:28:36 +0100 Subject: FOSDEM devroom requested Message-ID: <4B0BDF84.2070508@sun.com> Hi, Following the long standing tradition[1] of using the FOSDEM conference in February in Brussels to meet, hack, debate and learn, I sent in a devroom request for the next edition of FOSDEM [2] after syncing up with Andrew Haley, Andrew Hughes, Mark Reinhold, Mark Wielaard and others. I expect to hear back from the FOSDEM devroom team whether the request was accepted (or denied) sometime next week, according to the published schedule. [3] If the devroom request gets accepted, I'll inform the list, and we'll do what we always do: coordinate schedules, talks and everything else on a public wiki & a mailing list. cheers, dalibor topic [1] http://archive.fosdem.org/2009/schedule/devrooms/freejava http://archive.fosdem.org/2008/schedule/devrooms/freejava http://archive.fosdem.org/2007/schedule/devroom/gnuclasspathopenjdkdevjam [...] http://archive.fosdem.org/2004/2004/index/dev_room_java.html [2] http://fosdem.org - Brussels, Belgium, Feb 6th & 7th [3] http://fosdem.org/2010/call-developer-rooms -- ******************************************************************* Dalibor Topic Tel: (+49 40) 23 646 738 Java F/OSS Ambassador AIM: robiladonaim Sun Microsystems GmbH Mobile: (+49 177) 2664 192 Nagelsweg 55 http://openjdk.java.net D-20097 Hamburg mailto:Dalibor.Topic at sun.com Sitz der Gesellschaft: Sonnenallee 1, D-85551 Kirchheim-Heimstetten Amtsgericht M?nchen: HRB 161028 Gesch?ftsf?hrer: Thomas Schr?der, Wolfgang Engels, Wolf Frenkel Vorsitzender des Aufsichtsrates: Martin H?ring From dennisbyrne at apache.org Fri Nov 27 15:42:15 2009 From: dennisbyrne at apache.org (Dennis Byrne) Date: Fri, 27 Nov 2009 06:42:15 -0900 Subject: A small favor if you can PrintAssembly on non x86? Message-ID: <446564320911270742m14ab75b3k5de269b0ade42e1e@mail.gmail.com> I am writing an article on memory barriers and the only hardware I can get my hands on is x86. The consistency guarantees of the x86 memory model leave me very few examples to write about because the jvm does not have to work so hard. I will gladly put the names of anyone that can help me in the acknowledgments sections of the article when it is published. If you have a recent build of openjdk (or update 14+ of jdk 1.6), and you have the base-hsdis or hsdis plugin installed (in other words, you can PrintAssembly), please run these four simple commands and please send me the output of write.txt and read.txt. $ wget http://people.apache.org/~dennisbyrne/memory/WriterReader.java $ javac WriterReader.java $ java -XX:+UnlockDiagnosticVMOptions -XX:PrintAssemblyOptions=hsdis-print-bytes -XX:CompileCommand=print,WriterReader.write WriterReader > write.txt $ java -XX:+UnlockDiagnosticVMOptions -XX:PrintAssemblyOptions=hsdis-print-bytes -XX:CompileCommand=print,WriterReader.read WriterReader > read.txt Ideal would be Itanium or PPC output. These memory models are much different and would give me more examples to write about. The weaker the better. Sparc would still be interesting also. Getting a hold of a non-x86 system has been more difficult than writing the article itself. Any help you can give me is greatly appreciated. -- Dennis Byrne From dennisbyrne at apache.org Fri Nov 27 18:09:55 2009 From: dennisbyrne at apache.org (Dennis Byrne) Date: Fri, 27 Nov 2009 12:09:55 -0600 Subject: A small favor if you can PrintAssembly on non x86? In-Reply-To: <1259339448.875.125.camel@macbook> References: <446564320911270742m14ab75b3k5de269b0ade42e1e@mail.gmail.com> <1259339448.875.125.camel@macbook> Message-ID: <446564320911271009q6a31b4fal5468e155c3a98b6d@mail.gmail.com> Thank you very much Christian. I find it interesting that you have one full fence for the write method while I get two on an x86. The write method performs two writes, so the VM must separate both writes with a StoreStore barrier. According to the "Here's how these processors support barriers" section in the cookbook [1] these are no ops on both platforms. This explains why your compiler is not putting a fence between both writes, so I am curious why mine still does. Yours w/ one fence (on sparc) 0xfa8eceac: mov 0x2a, %l0 ;...a010202a 0xfa8eceb0: st %l0, [ %l1 + 0x150 ] ;...e0246150 0xfa8eceb4: mov 1, %l2 ;...a4102001 0xfa8eceb8: stb %l2, [ %l1 + 0x154 ] ;...e42c6154 0xfa8ecebc: membar #StoreLoad ;...8143e002 Mine with two fences (on x86) 0x00f7801d: mov $0x95ba53c0,%esi ;...bec053ba 95 ; {oop()} 0x00f78022: mov $0x2a,%edi ;...bf2a0000 00 0x00f78027: mov %edi,0x148(%esi) ;...89be4801 0000 0x00f7802d: mfence ;...0faef0 0x00f78030: mov $0x1,%edi ;...bf010000 00 0x00f78035: mov %edi,%ebx ;...8bdf 0x00f78037: mov %bl,0x14c(%esi) ;...889e4c01 0000 0x00f7803d: mfence ;...0faef0 [1] http://gee.cs.oswego.edu/dl/jmm/cookbook.html Dennis On Fri, Nov 27, 2009 at 10:30 AM, Christian Thalinger wrote: > On Fri, 2009-11-27 at 06:42 -0900, Dennis Byrne wrote: >> $ wget http://people.apache.org/~dennisbyrne/memory/WriterReader.java >> $ javac WriterReader.java >> $ java -XX:+UnlockDiagnosticVMOptions >> -XX:PrintAssemblyOptions=hsdis-print-bytes >> -XX:CompileCommand=print,WriterReader.write WriterReader > write.txt >> $ java -XX:+UnlockDiagnosticVMOptions >> -XX:PrintAssemblyOptions=hsdis-print-bytes >> -XX:CompileCommand=print,WriterReader.read WriterReader > read.txt >> >> Ideal would be Itanium or PPC output. ?These memory models are much >> different and would give me more examples to write about. ?The weaker >> the better. ?Sparc would still be interesting also. >> >> Getting a hold of a non-x86 system has been more difficult than >> writing the article itself. ?Any help you can give me is greatly >> appreciated. > > I did a run on SPARC for you (had to increase the loop length a little). > > -- Christian > -- Dennis Byrne From David.Holmes at Sun.COM Fri Nov 27 22:00:28 2009 From: David.Holmes at Sun.COM (David Holmes - Sun Microsystems) Date: Sat, 28 Nov 2009 08:00:28 +1000 Subject: A small favor if you can PrintAssembly on non x86? In-Reply-To: <446564320911271009q6a31b4fal5468e155c3a98b6d@mail.gmail.com> References: <446564320911270742m14ab75b3k5de269b0ade42e1e@mail.gmail.com> <1259339448.875.125.camel@macbook> <446564320911271009q6a31b4fal5468e155c3a98b6d@mail.gmail.com> Message-ID: <4B104BFC.4080207@sun.com> Dennis, You may both be running different versions of VM - and your version doesn't have the same optimizations to remove unnecessary fences. Also the mfence has fallen out of favour as it's more expensive than alternatives. See Dave Dice's blog on this (and other related topics): http://blogs.sun.com/dave/resource/NHM-Pipeline-Blog-V2.txt Cheers, David Holmes Dennis Byrne said the following on 11/28/09 04:09: > Thank you very much Christian. I find it interesting that you have > one full fence for the write method while I get two on an x86. The > write method performs two writes, so the VM must separate both writes > with a StoreStore barrier. According to the "Here's how these > processors support barriers" section in the cookbook [1] these are no > ops on both platforms. This explains why your compiler is not putting > a fence between both writes, so I am curious why mine still does. > > Yours w/ one fence (on sparc) > > 0xfa8eceac: mov 0x2a, %l0 ;...a010202a > 0xfa8eceb0: st %l0, [ %l1 + 0x150 ] ;...e0246150 > 0xfa8eceb4: mov 1, %l2 ;...a4102001 > 0xfa8eceb8: stb %l2, [ %l1 + 0x154 ] ;...e42c6154 > 0xfa8ecebc: membar #StoreLoad ;...8143e002 > > Mine with two fences (on x86) > > 0x00f7801d: mov $0x95ba53c0,%esi ;...bec053ba 95 > ; {oop()} > 0x00f78022: mov $0x2a,%edi ;...bf2a0000 00 > 0x00f78027: mov %edi,0x148(%esi) ;...89be4801 0000 > 0x00f7802d: mfence ;...0faef0 > 0x00f78030: mov $0x1,%edi ;...bf010000 00 > 0x00f78035: mov %edi,%ebx ;...8bdf > 0x00f78037: mov %bl,0x14c(%esi) ;...889e4c01 0000 > 0x00f7803d: mfence ;...0faef0 > > > > [1] http://gee.cs.oswego.edu/dl/jmm/cookbook.html > > Dennis > > On Fri, Nov 27, 2009 at 10:30 AM, Christian Thalinger > wrote: >> On Fri, 2009-11-27 at 06:42 -0900, Dennis Byrne wrote: >>> $ wget http://people.apache.org/~dennisbyrne/memory/WriterReader.java >>> $ javac WriterReader.java >>> $ java -XX:+UnlockDiagnosticVMOptions >>> -XX:PrintAssemblyOptions=hsdis-print-bytes >>> -XX:CompileCommand=print,WriterReader.write WriterReader > write.txt >>> $ java -XX:+UnlockDiagnosticVMOptions >>> -XX:PrintAssemblyOptions=hsdis-print-bytes >>> -XX:CompileCommand=print,WriterReader.read WriterReader > read.txt >>> >>> Ideal would be Itanium or PPC output. These memory models are much >>> different and would give me more examples to write about. The weaker >>> the better. Sparc would still be interesting also. >>> >>> Getting a hold of a non-x86 system has been more difficult than >>> writing the article itself. Any help you can give me is greatly >>> appreciated. >> I did a run on SPARC for you (had to increase the loop length a little). >> >> -- Christian >> > > > From Christian.Thalinger at Sun.COM Fri Nov 27 16:30:48 2009 From: Christian.Thalinger at Sun.COM (Christian Thalinger) Date: Fri, 27 Nov 2009 17:30:48 +0100 Subject: A small favor if you can PrintAssembly on non x86? In-Reply-To: <446564320911270742m14ab75b3k5de269b0ade42e1e@mail.gmail.com> References: <446564320911270742m14ab75b3k5de269b0ade42e1e@mail.gmail.com> Message-ID: <1259339448.875.125.camel@macbook> On Fri, 2009-11-27 at 06:42 -0900, Dennis Byrne wrote: > $ wget http://people.apache.org/~dennisbyrne/memory/WriterReader.java > $ javac WriterReader.java > $ java -XX:+UnlockDiagnosticVMOptions > -XX:PrintAssemblyOptions=hsdis-print-bytes > -XX:CompileCommand=print,WriterReader.write WriterReader > write.txt > $ java -XX:+UnlockDiagnosticVMOptions > -XX:PrintAssemblyOptions=hsdis-print-bytes > -XX:CompileCommand=print,WriterReader.read WriterReader > read.txt > > Ideal would be Itanium or PPC output. These memory models are much > different and would give me more examples to write about. The weaker > the better. Sparc would still be interesting also. > > Getting a hold of a non-x86 system has been more difficult than > writing the article itself. Any help you can give me is greatly > appreciated. I did a run on SPARC for you (had to increase the loop length a little). -- Christian -------------- next part -------------- CompilerOracle: print WriterReader.read VM option 'PrintAssemblyOptions=hsdis-print-bytes' VM option 'CompileCommand=print,WriterReader.read' Loaded disassembler from hsdis-sparc.so Compiled (c2) 1 nmethod (2) WriterReader::read (14 bytes) total in heap [0xfa8ecd88,0xfa8ecf2c] = 420 relocation [0xfa8ece48,0xfa8ece54] = 12 main code [0xfa8ece60,0xfa8ecea0] = 64 stub code [0xfa8ecea0,0xfa8ecebc] = 28 scopes data [0xfa8ecebc,0xfa8eced0] = 20 scopes pcs [0xfa8eced0,0xfa8ecf20] = 80 dependencies [0xfa8ecf20,0xfa8ecf24] = 4 oops [0xfa8ecf24,0xfa8ecf2c] = 8 Decoding compiled method 0xfa8ecd88: Code: [Disassembling for mach='sparc:v8plusb'] [Entry Point] [Verified Entry Point] 0xfa8ece60: save %sp, -72, %sp ;...9de3bfb8 ;*synchronization entry ; - WriterReader::read at -1 (line 25) 0xfa8ece64: sethi %hi(0xb61f9000), %l1 ;...232d87e4 ; {oop('WriterReader')} 0xfa8ece68: add %l1, 0x3d8, %l1 ! 'WriterReader' ;...a20463d8 ; {oop('WriterReader')} 0xfa8ece6c: ldub [ %l1 + 0x154 ], %l0 ;...e00c6154 ;*getstatic ready ; - WriterReader::read at 0 (line 25) 0xfa8ece70: cmp %l0, 0 ;...80a42000 0xfa8ece74: be,pn %icc, 0xfa8ece8c ;...02400006 0xfa8ece78: ld [ %l1 + 0x150 ], %i0 ;...f0046150 ;*ireturn ; - WriterReader::read at 13 (line 25) 0xfa8ece7c: sethi %hi(0xff3fc000), %l0 ;...213fcff0 0xfa8ece80: ld [ %l0 ], %g0 ;...c0042000 ; {poll_return} 0xfa8ece84: ret ;...81c7e008 0xfa8ece88: restore ;...81e80000 0xfa8ece8c: b %icc, 0xfa8ece7c ;...104ffffc 0xfa8ece90: mov -1, %i0 ;...b0103fff 0xfa8ece94: illtrap 0 ;...00000000 0xfa8ece98: illtrap 0 ;...00000000 0xfa8ece9c: illtrap 0 ;...00000000 [Exception Handler] [Stub Code] 0xfa8ecea0: sethi %hi(0xfa8e5400), %g3 ;...073ea395 0xfa8ecea4: jmp %g3 + 0xc0 ! 0xfa8e54c0 ;...81c0e0c0 0xfa8ecea8: nop ;...01000000 0xfa8eceac: save %sp, -96, %sp ;...9de3bfa0 0xfa8eceb0: sethi %hi(0xfa8bb000), %l0 ;...213ea2ec 0xfa8eceb4: jmp %l0 + 0x3a0 ! 0xfa8bb3a0 ;...81c423a0 0xfa8eceb8: restore ;...81e80000 pc-bytecode offsets: PcDesc(pc=0xfa8ece5f offset=ffffffff): PcDesc(pc=0xfa8ece64 offset=4): WriterReader::read @-1 reexecute=false PcDesc(pc=0xfa8ece70 offset=10): WriterReader::read @0 reexecute=false PcDesc(pc=0xfa8ece7c offset=1c): WriterReader::read @13 reexecute=false PcDesc(pc=0xfa8ecebd offset=5d): OopMapSet contains 0 OopMaps ------------------------------------------------------------------------ static WriterReader.read()I interpreter_invocation_count: 163805 invocation_counter: 8835 backedge_counter: 1 0 getstatic 7 3 ifeq 12 0 bci: 3 BranchData taken(0) displacement(28) not taken(160506) 6 getstatic 8 9 goto 13 16 bci: 9 JumpData taken(160506) displacement(12) 12 iconst_m1 13 ireturn ------------------------------------------------------------------------ -------------- next part -------------- CompilerOracle: print WriterReader.write VM option 'PrintAssemblyOptions=hsdis-print-bytes' VM option 'CompileCommand=print,WriterReader.write' Loaded disassembler from hsdis-sparc.so Compiled (c2) 2 nmethod (2) WriterReader::write (10 bytes) total in heap [0xfa8ecdc8,0xfa8ecf40] = 376 relocation [0xfa8ece88,0xfa8ece94] = 12 main code [0xfa8ecea0,0xfa8ecee0] = 64 stub code [0xfa8ecee0,0xfa8ecefc] = 28 scopes data [0xfa8ecefc,0xfa8ecf04] = 8 scopes pcs [0xfa8ecf04,0xfa8ecf34] = 48 dependencies [0xfa8ecf34,0xfa8ecf38] = 4 oops [0xfa8ecf38,0xfa8ecf40] = 8 Decoding compiled method 0xfa8ecdc8: Code: [Disassembling for mach='sparc:v8plusb'] [Entry Point] [Verified Entry Point] 0xfa8ecea0: save %sp, -72, %sp ;...9de3bfb8 0xfa8ecea4: sethi %hi(0xb61f9000), %l1 ;...232d87e4 ; {oop('WriterReader')} 0xfa8ecea8: add %l1, 0x3d8, %l1 ! 'WriterReader' ;...a20463d8 ; {oop('WriterReader')} 0xfa8eceac: mov 0x2a, %l0 ;...a010202a 0xfa8eceb0: st %l0, [ %l1 + 0x150 ] ;...e0246150 0xfa8eceb4: mov 1, %l2 ;...a4102001 0xfa8eceb8: stb %l2, [ %l1 + 0x154 ] ;...e42c6154 0xfa8ecebc: membar #StoreLoad ;...8143e002 ;*putstatic shared ; - WriterReader::write at 2 (line 29) 0xfa8ecec0: sethi %hi(0xff3fc000), %l0 ;...213fcff0 0xfa8ecec4: ld [ %l0 ], %g0 ;...c0042000 ; {poll_return} 0xfa8ecec8: ret ;...81c7e008 0xfa8ececc: restore ;...81e80000 0xfa8eced0: illtrap 0 ;...00000000 0xfa8eced4: illtrap 0 ;...00000000 0xfa8eced8: illtrap 0 ;...00000000 0xfa8ecedc: illtrap 0 ;...00000000 [Exception Handler] [Stub Code] 0xfa8ecee0: sethi %hi(0xfa8e5400), %g3 ;...073ea395 0xfa8ecee4: jmp %g3 + 0xc0 ! 0xfa8e54c0 ;...81c0e0c0 0xfa8ecee8: nop ;...01000000 0xfa8eceec: save %sp, -96, %sp ;...9de3bfa0 0xfa8ecef0: sethi %hi(0xfa8bb000), %l0 ;...213ea2ec 0xfa8ecef4: jmp %l0 + 0x3a0 ! 0xfa8bb3a0 ;...81c423a0 0xfa8ecef8: restore ;...81e80000 pc-bytecode offsets: PcDesc(pc=0xfa8ece9f offset=ffffffff): PcDesc(pc=0xfa8ecec0 offset=20): WriterReader::write @2 reexecute=false PcDesc(pc=0xfa8ecefd offset=5d): OopMapSet contains 0 OopMaps ------------------------------------------------------------------------ static WriterReader.write()V interpreter_invocation_count: 173478 invocation_counter: 8510 backedge_counter: 1 0 bipush 42 2 putstatic 8 5 iconst_1 6 putstatic 7 9 return ------------------------------------------------------------------------ From Christian.Thalinger at Sun.COM Mon Nov 30 12:54:41 2009 From: Christian.Thalinger at Sun.COM (Christian Thalinger) Date: Mon, 30 Nov 2009 13:54:41 +0100 Subject: A small favor if you can PrintAssembly on non x86? In-Reply-To: <4B104BFC.4080207@sun.com> References: <446564320911270742m14ab75b3k5de269b0ade42e1e@mail.gmail.com> <1259339448.875.125.camel@macbook> <446564320911271009q6a31b4fal5468e155c3a98b6d@mail.gmail.com> <4B104BFC.4080207@sun.com> Message-ID: <1259585681.22671.34.camel@macbook> On Sat, 2009-11-28 at 08:00 +1000, David Holmes - Sun Microsystems wrote: > Dennis, > > You may both be running different versions of VM - and your version > doesn't have the same optimizations to remove unnecessary fences. Yeah, I was using HS17. -- Christian