Tail Call Optimization

Cristian Esquivias cristian.esquivias at gmail.com
Tue Jan 13 23:17:33 UTC 2015


Hi Stefan,

Thanks for taking a look. So I would create a linked list of dispatch nodes
like in Simple Language?

http://hg.openjdk.java.net/graal/graal/file/3a59e1411192/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/call/SLDirectDispatchNode.java

Since the function object and the call target don't change, how should I
test for equality between one dispatch node and another? That is, how do I
know to use one dispatch node versus another?

Thanks again,
Cristian

On Tue, Jan 13, 2015 at 3:06 PM, Stefan Marr <java at stefan-marr.de> wrote:

> Hi Cristian:
>
> > On 13 Jan 2015, at 23:25, Cristian Esquivias <
> cristian.esquivias at gmail.com> wrote:
> >
> > I'm trying to add tail call optimization to my test language and have a
> > functional version (no stackoverflows).
> >
> >
> https://github.com/cesquivias/mumbler/commit/3b61f7ccdad7429d2feac6068b0f57edce6a4151
>
> Looking at the diff/code, I think the issue is the call node that you pass
> back in the exception.
> At the point where you handle the exception, you’ll probably need to make
> that node a constant as part of the AST, by using a dispatch node chain/an
> inline cache.
>
> Best regards
> Stefan
>
>
> --
> Stefan Marr
> INRIA Lille - Nord Europe
> http://stefan-marr.de/research/
>
>
>
>


More information about the graal-dev mailing list