Help with performance issues.

Tom Tromey tromey@redhat.com
Mon Jul 30 09:59:00 GMT 2001


>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:

>> I think we could consider doing this for any final method with fixed
>> semantics.  For instance, anything in java.lang.Math (taking strictfp
>> concerns into account, of course).  If other final methods are
>> important for performance, we could inline those too.  For instance,
>> there might be situations where inlining System.arraycopy makes sense.

Andrew> All this falls down, though, when we need to inline a *native*
Andrew> method.  That would be a good trick...

In the above case (final methods with fixed semantics), we can do
this.  That's because we aren't "inlining" -- we are recognizing the
name of the function and replacing the call with a builtin (or with
the equivalent code).  So for instance we could replace Math.cos with
__builtin_cos.  Ditto Math.max(double,double), etc.

Inlining C++ into Java would be hard.  We could either merge the
compilers, or we could do link-time inlining.  These both seem
dauntingly hard.

Inlining Java into C++ can be done much more easily.  We could replace
the trivial decompilation code in gcjh with a real decompiler.

Tom



More information about the Java mailing list