tail calls

John Rose John.Rose at Sun.COM
Fri Jun 12 16:46:23 PDT 2009


On Jun 4, 2009, at 2:58 AM, Arnold Schwaighofer wrote:

> On Wed, Jun 3, 2009 at 10:26 PM, John Rose <John.Rose at sun.com> wrote:
>> Arnold, I'll be happy to take your updated patches ASAP, assuming  
>> they work
>> *apart* from invokedynamic.  (Are you still maintaining parallel  
>> lazy/eager
>> versions?)
> Hi John,
>
> Wish i was at JavaOne to meet you in person. Well another time maybe.

Would it be possible for you to attend this meet-up (also in the N.  
California Bay Area)?
   http://jvmlangsummit.com

There are a lot of people who would like to hear about your work and  
talk with you!  The Scala folks are particularly interested.

> Here you go. Another round of patches. This time against openjdk-b59.

OK, I just pushed your b59 changes.  (I needed a little JavaOne  
recovery time first.)

> Yes i still maintain the two versions. I expect the lazy version to be
> easier integratabtle with the indy/method handle stuff.

I am doing some tricky adapter work, needed to stretch compiled  
argument areas for method handle linkage.

This clearly needs to be unified with your work on tail calls, since  
we want as few adapter types as possible.

I looked over your thesis; it's very good, one of the best expositions  
of Hotspot design I have seen.

Here is a question about tail calls in the server compiler that's been  
bothering me:

Suppose a function A calls B with no arguments, and B implements some  
state transition machine with states implemented as tai-called  
functions B1, B2, ...  (They are all siblings.)  Suppose that each Bn  
takes n arguments, up to (say) B20 with 20 arguments.  The state  
machine terminates when the final Bn (say, B10) decides to return  
instead of tail-call another Bn.  At this point, control goes back to  
A.  It's all compiled in the server compiler, which has no frame  
pointer (in EBP).  In order for A to be able to access its own locals,  
it needs ESP to be restored exactly right (since server compiler uses  
ESP in place of EBP).  But the Bn have been bouncing ESP around all  
over the place to store all their arguments.  How does A get its ESP  
back?  I don't see any treatment of argument area overflow in your  
thesis, other than a sort of reassignment of the argument area to the  
callee.  But that doesn't help A in the server compiler, I don't think.

Best wishes,
-- John




More information about the mlvm-dev mailing list