3 ms·
No, because you can't optimize tail-calls made to virtual methods.
by bad_user 17y ago
No, because you can't optimize tail-calls made to virtual methods.
- slava_pestov 17y agoThere's no theoretical difficulty with compiling tail calls to virtual methods; of course perhaps you meant that the JVM doesn't expose a bytecode for doing so, which is absolutely correct.
- didroe 17y agoWhy not? The TCO is done on the caller end and is completely transparent to the callee. You just don't bother pushing your return address when calling a function, so it'll return to the previous one instead.