23.03.2013 Views

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

§ 2.10 Portable St<strong>and</strong>ard <strong>Lisp</strong> 67<br />

The PSL compiler has a number <strong>of</strong> passes, some <strong>of</strong> which were introduced to<br />

aid in the portability:<br />

1. <strong>Lisp</strong> macros exp<strong>and</strong>ed, <strong>and</strong> the <strong>Lisp</strong> source decorated with<br />

type information.<br />

2. Compilation <strong>of</strong> <strong>Lisp</strong> to an ‘abstract’ register machine whose<br />

instructions are called ‘cmacros.’ Redundant loads <strong>and</strong><br />

stores are avoided by tracking register contents.<br />

3. Essentially machine-independent optimization <strong>of</strong> the<br />

‘cmacro’ form (jump optimizations, peephole, etc).<br />

4. Exp<strong>and</strong>ing ‘cmacros’ into LAP for the target machine by<br />

using pattern-driven tables.<br />

5. Some peephole optimization <strong>of</strong> the target machine LAP.<br />

6. Output <strong>of</strong> LAP in a number <strong>of</strong> different forms: a) in-core<br />

assembly for direct execution, b) output as a FASL file for<br />

later fast loading, or c) output as symbolic assembly code<br />

for target machine assembler for bootstrapping.<br />

A PSL implementation for a new machine consists <strong>of</strong> the following:<br />

1. Choosing memory layout <strong>and</strong> tagging<br />

2. Writing code generators <strong>and</strong> linkage routines to the sys-<br />

tems language<br />

3. Writing some IO primitives in assembly code or some other<br />

systems language (C, PASCAL, <strong>and</strong> FORTRAN have been<br />

used)<br />

4. Testing primitives <strong>and</strong> code generators<br />

5. Selecting an appropriate garbage collector<br />

6. Cross-compiling a kernel (‘mini-<strong>Lisp</strong>’) to assembly code,<br />

assembling, <strong>and</strong> linking on the target machine

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!