This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: interpreter.cc bug patch and performance improvements




Tom,

thanks, attached is the patch.  I'm also posting this to java.

This is a diff -u patch for the 3.0.3 gij interpreter.cc

The bug is fairly simple, no NULLCHECK for insn_arraylength.

The performance improvements fall into two categories:

  1) in array loads and stores, pushing the SAVE_PC into
     the NULLCHECK throw block.
  2) a new macro for array bounds checking, ARRAYBOUNDSCHECK
     it also pushes the SAVE_PC into the throw block.
     the code uses a clever unsigned arithmetic trick
     I read in the PowerPC Compiler Writer's Guide.

The performance improvement on my Pentium III for cm3 is modest
from 644 to 662.

Also, I am having a problem that if anyone could help on, I would be
most thankful.  It appears to be a Pentium cache oddness.
It is easy to duplicate on my Pentium III:

Run the cm3 benchmark on a stock 3.0.3. The performance will be 644.
Comment out the insn_nop block and move the insn_nop label in front of
the first NEXT_INSN. Very simple, very dumb optimization.
Performance goes down to 600.  Attached is a bad.PATCH file for this.

Doing a little research, I saw a note by Anton Ertl on the web
explaining what seems to be a similar problem.

http://www.complang.tuwien.ac.at/misc/pentium-switch/switch-on-pentium

I have some other very simple optimizations, but if I can't get
past this problem, they won't work, at least not on the Pentium.
I may try on the PowerPC.

thanks,

Chris



__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

Attachment: interpret.cc.PATCH
Description: interpret.cc.PATCH

Attachment: bad.PATCH
Description: bad.PATCH


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]