This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: Help with performance issues.
- To: "'Anthony Green'" <green at redhat dot com>, wjb at netpd dot com, java at gcc dot gnu dot org
- Subject: RE: Help with performance issues.
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Mon, 30 Jul 2001 08:41:11 -0700
> Sun's JIT is almost certainly inlining Math.abs() and we
> probably aren't.
I checked that we aren't. Things are worsened by the fact that Math.abs()
appears to call _Jv_InitClass. Among other things, I count 4 call
instructions to compute an absolute value:
1) call Math.abs()
2) x86 call to get PC value in register for PIC code.
3) Call _Jv_InitClass
4) x86 call to get PC value in register for PIC code, this time for
_Jv_InitClass
Is there any reason to call _Jv_InitClass on bultin classes like
java.lang.Math?
> Try replacing this with a static final method in your class
> to see if it
> gets inlined (put it before this method in your class definition).
>
> It seems like gcj should be able to replace Math.abs() with
> __builtin_abs in
> this case. Does anybody think otherwise?
>
That would be nice.
Another problem that we've sometimes seen in code like this is that the
array null pointer checks don't completely disappear, at least not on
Itanium. On 32-bit machines this may be hard to avoid. On 64-bit machines,
it might be possible to arrange that there is nothing mapped within the
first 32GB of address space, so that accesses through null array pointers
are also guaranteed to result in an identifiable SIGSEGV. Does this make
sense?
Hans