Item Details

Print View

Machine-Independent Support for Garbage Collection, Debugging, Exception Handling, and Concurrency (Draft)

Peyton, Jones; Ramsey, Norman
Format
Report
Author
Peyton, Jones
Ramsey, Norman
Abstract
For a compiler writer, generating good machine code for a variety of platforms is hard work. One might try to reuse a retargetable code generator from another compiler, but code generators are complex and difficult to use, and they limit one's choice of implementation language. One might try to use&nbsp;C as a portable assembly language, but C&nbsp;limits the compiler writer's flexibility and the performance of the resulting code. The wide use of&nbsp;C, despite these drawbacks, argues for a portable assembly language. <p> <tt>C--</tt>&nbsp;is a new language designed expressly as a portable assembly language. <tt>C--</tt>&nbsp;eliminates some of the performance problems associated with&nbsp;C, but in its originally-proposed form it does not provide adequate support for garbage collection, exception handling, and debugging. The problem is that neither the high-level compiler nor the <tt>C--</tt> compiler has all of the information needed to support these run-time features. This paper proposes a three-part solution: new language constructs for&nbsp;<tt>C--</tt>, run-time support for <tt>C--</tt>, and restrictions on optimization of <tt>C--</tt>&nbsp;programs. <p> The new <tt>C--</tt> language constructs enable a high-level compiler to associate initialized data with <em>spans</em> of <tt>C--</tt> source ranges and to specify ``alternate continuations'' for calls to procedures that might raise exceptions. The run-time support is an interface (specified in&nbsp;C) that the garbage collector, exception mechanism, and debugger can use to get access to both high-level and low-level information, provided that the <tt>C--</tt> program is suspended at a <em>safe point</em>. High- and low-level information is coordinated by means of the <tt>C--</tt>&nbsp;spans and a common numbering for variables. Finally, the <tt>C--</tt> optimizer operates under the constraints that the debugger or garbage collector can change the values of local variables while execution is suspended, and that a procedure call with alternate continuations can return to more than one location. <p> This three-part solution also provides adequate support for concurrency, so the paper illustrates the problem and the proposed solution with examples from garbage collection, exception handling, debugging, and threads. The paper also includes a model of the dataflow behavior of <tt>C--</tt>&nbsp;calls. <p> A number of open problems remain. The most serious have to do with apparent redundancies among spans and safe points, and with the interaction of debugging support with optimization. <p> <em>This paper is very much work in progress</em>. We are not yet satisfied with the solutions we've come up with. Perhaps you can help improve it.
Language
English
Date Received
2012-10-29
Published
University of Virginia, Department of Computer Science, 1998
Published Date
1998
Collection
Libra Open Repository
In CopyrightIn Copyright
▾See more
▴See less

Availability

Access Online