tail call optimisation question
benjamin.john.evans at googlemail.com
Mon Mar 16 07:27:45 PDT 2009
I've been doing some reading about how TCO is intended to be implemented.
As I understand it, the bytecode for a optimised tail call would look
something like this:
0x00 // high byte of index of method to call
0x03 // low byte of index of method to call
The idea being that the wide opcode indicates that this call should be
optimised as a tail call, and that the interpreter part of HotSpot will then
(if allowed by protection restrictions) rewrite the current native stack
frame rather than create a new one.
My question is, what about non-HotSpot implementations?
Is the intention that the definition of the wide bytecode (as per
will change, so that we additionally have a "Form 3", which looks a bit like
the above, and that any JVM which is fully compatible with version 7
bytecode is required to implement TCO (or at the very least, tolerate Form
3, and just execute the embedded invoke* instruction as normal, growing the
Or is the intent that the new form of wide will never appear in .class
files, but only in code which has been generate dynamically, ie so that this
is a private implementation detail to HotSpot and can't cause problems to
Or something else entirely?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mlvm-dev