Tail call optimisation
"Stephen R. van den Berg" <[email protected]> Wed, 12 Jun 2019 20:24:59 +0200
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
When I have code like this:
int bar() {
// Something
}
int foo() {
return bar();
}
I understand that Pike 8.0 and 8.1 optimise the call to bar() away and turn
it into a jump?
What do Pike 8.0 and Pike 8.1 currently do with this:
void bar() {
// Something
}
void foo() {
bar();
}
Does it optimise the call to bar() out similarly but substituting it with
a jump?
Or do we need to write it explicitly as:
void foo() {
return bar();
}
to get that optimisation?
--
Stephen.