Tail Call Optimization

Cristian Esquivias cristian.esquivias at gmail.com
Tue Jan 13 22:25:54 UTC 2015


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

But when I run it I get an optimization error:

   [truffle] opt fail         [(define n ReadArgumentNode at 49139829),
IfNode at 9597028]      |Reason java.lang.AssertionError: Method argument for
method 'HotSpotMethod<OptimizedCallTarget.callDirect(Object[])>' is not
constant.

I'm not sure what's causing this problem. All the arguments are evaluated
before I throw the flow exception so nothing should've changed with the
arguments. Does this come from calling DirectCallNode.call from outside of
the original node?

Thanks,
Cristian


More information about the graal-dev mailing list