Community
Participate
Working Groups
It would be great to be able to inline getter and/or setter. Why not adding a dialog box containing 2 checkboxes (one for getter, one for setter) asking if to inline.
I assume you mean when generating code ? Inlining getters and setters is a standard VM-JIT optimization, once the entire application code is made available at runtime, and actual receiver runtime types are available (as opposed to compile-time declared ones). When compiling though, this is a risky game, since some getter/setter may get redefined somewhere else in a subclass, defeating all previous optimizations. Performing these optimizations at compile-time isn't safe.
no, i guess he meant ui :-)
from reporter: Ok. You are right. I didn't know it was a VM-JIT optimization. So does this mean that you never need to put the keywork "final" in the signature of a getter/setter, and that any VM is sufficiently clever to know if it can be inlined or not ?
In theory, yes with a good JIT.