Hacker News new | past | comments | ask | show | jobs | submit login
Eliminating the call stack to save RAM (acm.org)
16 points by fogus on Oct 7, 2009 | hide | past | favorite | 8 comments



This technique is as old as handwritten assembly and anyone who has done significant assembly coding has probably done it at some point whether they realize it or not.

What's interesting and new (and presented in this paper) is automating this concept in a compiler.


Not really. The flattening part is old hat in functional languages, though this particular formulation is restricted to the special case of "non-recursive" functions. I don't know about the particular optimizations they apply to the flattened code.


A compiler I worked on actually did this for all function calls. With recursion impossible (and whole-program compilation mandatory), huge gains can be made. And that compiler is used for pretty significant applications. Odds are many posters here have its microcode in their pocket.


Maybe we should pass parameters in registers... :-)


He he. When I read 'jump' I tend to think of that "G-word" that people argue about so much.

Then I think of the old saw, "Rules are made to be broken."


How is this different then the concept of "inline" in C/C++?


from the 3rd line of the abstract: "Unlike inlining, flattening does not duplicate the bodies of functions that have multiple callsites. "


Thanks, sorry will read more carefully in the future.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: