This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: inlining methods



As far as I can tell, GCJ isn't inlining methods at all, which is really
unfortunate. I'm rather surprised, as well, since it should be possible to
do this!

This summer I implemented method inlining inside of a JIT compiler at
Fujitsu Labs in Japan. It is rather straightforward and if someone would
like help on how to do this inside of GCJ I am happy to provide information
on the major issues.

Simply put, "static", "final", and "private" methods can all be inlined
since there is no chance they will be overloaded. Virtual method inlining
can be done as well, but requires either a test for the "correct" method
dispatch or more complex techniques which allow you to directly inline 
without a runtime test (for example, in certain methods where only a 
particular target type is possible). 

I can provide references to some papers about method inlining in Java
if anyone is interested.

Matt Welsh

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