Migration to generics opens up exciting optimization opportunities from annotations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I believe there are some interesting optimization opportunities that flow from the move to generics that enables the proper use of annotations. For example a code sequence such as:

static final int specialValue = 123;
void foo() {
  Integer bar1 = Integer.valueOf(specialValue);
  ....
  invoke some methods
  ...
  Integer bar2 = Integer.valueOf(specialValue);
  ...
}

could be optimized to:

static final int specialValue = 123;
void foo() {
  Integer bar1 = Integer.valueOf(specialValue);
  ....
  invoke some methods
  ...
  Integer bar2 = bar1;
  ...
}

if we knew that the intCache were holding an immutable value. Actually there are more exciting optimizations discussed in this paper by Igor Pechtchanski and Vivek Sarkar, in particular because of the immutability of Strings:

http://citeseer.ist.psu.edu/pechtchanski02immutability.html

I'm interested in adding these optimization to the Jikes RVM, but clearly the annotations need adding to Classpath. I was wondering what kind of response this would get? I can imagine a gnu.pragma or gnu.compilerhint package containing such annotations. It could also contain similar compiler hints to those found in GCC attributes. The Jikes RVM uses a package called org.vmmagic.pragma for some other compiler tricks.

Interested in your responses, thanks,

Ian Rogers
--
http://www.cs.man.ac.uk/~irogers


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux