On Thursday 02 April 2009 18:11:17 Per Bothner wrote:
> Kawa supports two calling conventions, selected by a command-line
> switch:
> (1) The "obvious" one where a Scheme function call is translated to
> a plain method call, with the methods return value being the Scheme
> function's result.
> (2) Full tail-call support using an extra hidden method argument
> that points to a CallContext object.  A call is translated thus:
> - The parameters are evaluated, and copied into the CallContext.
> - The function to be called is evaluated and saved in the CallContext.
> - The calling function returns.
> - That function's caller implements a "trampoline" (see
> http://en.wikipedia.org/wiki/Tail_recursion and
> http://en.wikipedia.org/wiki/Trampoline_%28computers%29 )
> which then calls the function saved in the CallContext.
> - The callee methods extracts its arguments from the CallContext.
>
> This is obviously a bit slower, but not so much slower as
> to be unusable.  (The CallContext API isn't as tweaked as
> it should be.)
>
> The two calling conventions can interoperate, in the sense that
> a function compiled with convention (1) can call a function
> compiled with convention (2) and vice versa.

When Java calls back into Kawa, where does Kawa get the current CallContext 
from when it has not been passed in as the first argument?

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com
To unsubscribe from this group, send email to 
jvm-languages+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to