Joerg 'Herkules' Plewe wrote:

> BTW, can the Java compiler really optimize away gette/setter overhead like a
> C++-compiler can? I doubt that. But my point is not so much related to
> performance anyway.

Yes, it can (as long as it is final). In fact even sun interpreter was
optimizing this special case - invokespecial is 3 bytes, same as get/put
field. If method were consisting of just aload 0, get/putfield and
xreturn, interpreter was rewriting invokespecial to directly get/put
field.

Now, most java3d accessors are non-final, so they can't be optimized so
easily. But they are also not only just get/set, they perform some
checks and updates - which means that they cannot be just converted to
public field.

Artur

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to