You want function [inlining][1], and most ([optimizing][2]) compilers are doing that.

Notice that **you don't need to have any [call stack][3]**. You could use only the heap (then you need an efficient [garbage collector][4]). 

So, take a look at [continuations][5] and read more about [continuation passing style][6] (CPS) and [CPS transformation][7]. (intuitively, you could use continuation closures as reified "call frames" allocated in the heap). Then you need an efficient garbage collector.

Andrew Appel wrote a book [*Compiling with Continuations*][8] and an old paper [*garbage collection can be faster than stack allocation*][9]. See also A.Kennedy's paper (ICFP2007) [*Compiling with Continuations, Continued*][10]


 [1]: http://en.wikipedia.org/wiki/Inline_expansion
 [2]: http://en.wikipedia.org/wiki/Optimizing_compiler
 [3]: http://en.wikipedia.org/wiki/Call_stack
 [4]: http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29
 [5]: http://en.wikipedia.org/wiki/Continuation
 [6]: http://en.wikipedia.org/wiki/Continuation-passing_style
 [7]: http://matt.might.net/articles/cps-conversion/
 [8]: http://www.cambridge.org/us/academic/subjects/computer-science/programming-languages-and-applied-logic/compiling-continuations
 [9]: https://www.cs.princeton.edu/~appel/papers/45.ps
 [10]: http://dl.acm.org/citation.cfm?id=1291179