What Brian fails to mention though is the speculative nature of such optimizations in the presence of polymorphism.
Since Point and Component are not declared final/private they could at some point be subclassed to, say, not simply return x from getx() or return a new Point from getLocation(). Obviously if that happens the pseudocode in listing 4 would do 'the wrong thing'. The VM/JIT either has to be conservative, or able to undo such speculative optimizations if the assumptions later prove false. The ability to undo optimizations requires some book-keeping. Regards, Tim [EMAIL PROTECTED] wrote: > http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html - Yummy. > > -- Tim Ellison ([EMAIL PROTECTED]) IBM Java technology centre, UK.