.class code optimization

Adam Megacz gcj@lists.megacz.com
Fri Oct 11 17:36:00 GMT 2002

Jeff Sturm <jsturm@one-point.com> writes:
> ISTR that Sun's javac once performed optimizations, including inlining
> across translation units.  There were problems with it, 

IMHO this is a huge crock. Intra-class inlining is still really useful
for non-HotSpot JVMs (as I've mentioned before, especially the MSJVM).

> like unverifiable bytecode: class A inlines method B.b(), but B.b()
> accesses fields private to B, etc.

AFAIK it was smart enough not to inline if the method accessed private
fields.  Unfortunately, they ran into problems with versioning --
often people would get incredibly hard to debug errors if they changed
class B but did not regenerate A.class.

Hrm, come to think of this, inter-class inlining could be a big
advantage for gcj.  I can't see how a JIT could ever support it.

  - a

"Through your rags I see your vanity"  -- Socrates

More information about the Java mailing list