[3514] in java-interest
Re: Inline methods
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Wed Nov 15 02:50:46 1995
Date: Tue, 14 Nov 1995 22:08:54 -0800
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: flint@nando.net
Cc: java-interest@java.Eng.Sun.COM
Hi Flint,
> I haven't heard anyone mention the lack of inlines in Java.
> The use of inlines can significantly improve execution speed.
>
> I realize one problem is that inlines are non-virtual methods
> by nature. If they are resolved at compile time, you would have
> to recompile when the class changes the inline definition. Java
> has done a lot to fix the "Fragile" base class problem (see the
> White Paper).
>
> One solution is to resolve inlines at load time. This could even
> be a user option (call the methods or patch in the inline code).
>
> The loader could even decide what methods should be inline. The
> criteria could be controlled by the user. For example, force all
> methods that simply return data to be coded inline.
The compiler when invoked with -O already inlines final methods,
private methods, and static methods. The result of this may not
pass the verifier test though.
Anyway, as you point out, a better solution is to inline methods
at runtime. There are a lot of lesson to be learned from the Self
incremental compiler...
Have fun,
Arthur van Hoff
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com