Staged allocation: a compositional technique for specifying and implementing procedure calling conventions

We present staged allocation, a technique for specifying calling conventions by composing tiny allocators called stages. A specification written using staged allocation has a precise, formal semantics, and it can be executed directly inside a compiler. Specifications of nine standard C~calling conventions range in size from 15 to 30 lines each. An implementation of staged allocation takes about 250 lines of ML or 650~lines of C++. Each specification can be used not only to help a compiler implement the calling convention but also to generate a test suite.

[1]  Simon L. Peyton Jones,et al.  A single intermediate language that supports multiple implementations of exceptions , 2000, PLDI '00.

[2]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[3]  Christian Lindig,et al.  Custom Calling Conventions in a Portable Assembly Language , 2002 .

[4]  Roberto Ierusalimschy,et al.  Programming in Lua , 2003 .

[5]  Mads Torgersen,et al.  The c# programming language, third edition , 2008 .

[6]  Jack W. Davidson,et al.  Automatic Detection and Diagnosis of Faults in Generated Code for Procedure Calls , 2003, IEEE Trans. Software Eng..

[7]  Xavier Leroy The objective caml system release 3 , 2001 .

[8]  Ralph E. Griswold,et al.  The Icon programming language , 1983 .

[9]  George H. Mealy,et al.  A method for synthesizing sequential circuits , 1955 .

[10]  David B. Whalley,et al.  Methods for saving and restoring register values across function calls , 1991, Softw. Pract. Exp..

[11]  Graham Hutton,et al.  Higher-order functions for parsing , 1992, Journal of Functional Programming.

[12]  Jack W. Davidson,et al.  Csdl: reusable computing system descriptions for retargetable systems software , 2000 .

[13]  Christian Lindig,et al.  Random testing of C calling conventions , 2005, AADEBUG'05.

[14]  Norman Ramsey,et al.  Declarative Composition of Stack Frames , 2004, CC.

[15]  Christopher W. Fraser,et al.  A Retargetable C Compiler: Design and Implementation , 1995 .

[16]  Ralph E. Griswold,et al.  History of the Icon programming language , 1996 .

[17]  Jack W. Davidson,et al.  Target-sensitive construction of diagnostic programs for procedure calling sequence generators , 1996, PLDI '96.

[18]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[19]  Jack W. Davidson,et al.  A formal model and specification language for procedure calling conventions , 1995, POPL '95.

[20]  Simon L. Peyton Jones,et al.  C--: A Portable Assembly Language that Supports Garbage Collection , 1999, PPDP.

[21]  Norman Ramsey,et al.  Embedding an interpreted language using higher-order functions and types , 2003, IVME '03.

[22]  X. Leroy The Objective Caml system release 3.09 Documentation and user''s manual , 2005 .