Eliminating the call stack to save RAM
Xuejun Yang, Nathan Dean Cooprider, John David Regehr · ACM SIGPLAN/SIGBED Conference on Languages, Compilers, and Tools for Embedded Systems (LCTES) · 2009
Most programming languages support a call stack in the programming model and also in the runtime system.We show that for applications targeting low-power embedded microcontrollers (MCUs), RAM usage can be significantly decreased by partially or completely eliminating the runtime callstack. We present flattening, a transformation that absorbs a function into its caller, replacing function invocations and returns with jumps. Unlike inlining, flattening does not duplicate the bodies of functions that have multiple callsites. Applied aggressively, flattening results in stack elimination. Flattening is most useful in conjunction with a lifting transformation that moves global variables into a local scope.
Cited by 18 works. doi:10.1145/1542452.1542461
Authors
References
- The nesC language
- The nesC language
- CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs
- Compiling with Continuations
- Control-flow integrity
- Code injection attacks on harvard-architecture devices
- A methodology for procedure cloning
- Cache-conscious structure definition
- An experiment with inline substitution
- The Art of Designing Embedded Systems