All 3 entries tagged Java

View all 241 entries tagged Java on Warwick Blogs | View entries tagged Java at Technorati | There are no images tagged Java on this blog

May 15, 2009

Hotspot Print Assembly

Since google fails at providing this information, and I haven’t blogged in a month:

It is possible to print assembly produced by the SUN Hotspot JVM’s JIT Compiler. In order to do so you will need a debug enabled JVM from http://download.java.net/jdk6/binaries/. The magic flag is +PrintOptoAssembly, and since its a JVM flag it needs a -XX: prefix. Additionally, code is only printed out as assembly if it gets JIT’d – so if you want everything printed, then you reduce the compile threshold. Consequently, an example command look like:

java -server -XX:+PrintOptoAssembly -XX:CompileThreshold=1 SomeJavaClass

Hopefully this is helpful to other people


June 09, 2008

Talks

Last week I gave a talk on Virtual Machines (their architecture, intermediate representation and JIT Compiler techniques) at the language club. I’ve finally got round to updating my talks/publications list on my website as a result, which now includes that talk, and past talks at the GNU/Linux user group as well as research related work.


January 19, 2007

Javac

This week’s Xing (I nearly called it bugflug) will probably be trying to fix stuff on the compsoc website. This should be nice and accessible stuff that has obvious benefit to people. But, I am still interesting in running some more ‘exotic’ projects, so I thought I would air some thoughts on the proposed collections operations to be implemented in Javac, which I hope to work on again with Lamby and maybe more people if they are interested.

The essential idea of the for .. do loop is to be a variant of the map higher order function that can be found in both functional languages such as Ocaml and dynamic languages like Python. So the basic idea that was proposed last week was:

for do

Where the expr evaluates to a collections object. For example the following conversion would occur in Javac:

for this.list do m;

becomes

List newList = new Vector ;
for(ListElementType element:this.list) {
newList.add(m(element));
}
this.list = newList;

This conversion happens with the safety condition that the method m takes one parameter of type ‘ListElementType’ and its return type is of the same type, where ListElementType is the type of element’s of this.list. Some implementation effort has gone on with this idea, and I think it would be possible to finish it at the next LAN with some concerted effort and thought.

I was thinking the other day of some extensions to this basic syntax, for example by adding multiple parameters, so that:

for this.list1 this.list2 do m;

becomes

if(this.list1.size() == this.list2.size()) {
List newList = new Vector ;
for(int i = 0;i newList.add(m(this.list1.get(i),this.list2.get(i)));
}
this.list = newList;
}

Obviously this would be implemented for n number expressions, rather than just two. Similar safety conditions apply as the first example. The primary issue that I can think of is that one of the safety conditions has to be checked at runtime, which doesn’t really fit into Java’s paradigm.

There would also be the potential for adding non-list parameters to such a construct, that would be passed to every method call. For example:

for this.list this.variable do m

becomes

List newList = new Vector ;
for(ListElementType element:this.list) {
newList.add(m(element,this.variable));
}
this.list = newList;

Such things obviously add more complexity to java, but I think for very commonly used syntactic forms such as this, it might be a good idea to have such a construct.


November 2021

Mo Tu We Th Fr Sa Su
Oct |  Today  |
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30               

Search this blog

Tags

Galleries

Most recent comments

  • Apart from the plea "can I have your old one?" (the yearning never diminishes) I'd like to leave you… by Sue on this entry
  • Unfortunately I still haven't seen a film for which you have to read up on quantum mechanics as I mi… by Sue on this entry
  • I've never been to watch a film before when it's been recommended that you first read up on quantum … by Sue on this entry
  • Well this is very interesting, i really liked reading this blog, this was very informative and very … by Mio Navman Spirit S300 on this entry
  • I thought it was fascinating. Griffin isn't like any other, media–trained, polished politician, and … by Tim on this entry

Blog archive

Loading…
RSS2.0 Atom

Hello

Not signed in
Sign in

Powered by BlogBuilder
© MMXXI