Tail Calls

Gilles Duboscq duboscq at ssw.jku.at
Sun Mar 16 15:14:22 UTC 2014


Hello,

I suppose you mean that you expect Graal to transform that code snippet
into a loop?
There is currently no tail recursion optimization in Graal.

-Gilles
On 16 Mar 2014 14:21, "D.Sturm" <D.Sturm42 at gmail.com> wrote:

> I was trying to write a testcase for the aarch64 backend for tail
> recursion, but I can't seem to get Graal to generate the code for it. I
> tried it with the following, but that just causes a normal static call:
>
>         public static int tailCallTest(int n, int total) {
>                 if (n == 0) return total;
>                 return tailCallTest(n - 1, total + 1);
>         }
>
> any ideas?
>
> -- Daniel
>


More information about the graal-dev mailing list