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.7 NIL 55<br />

vector whose unit size is a longword such as a Common <strong>Lisp</strong> simple vector; it need<br />

not be shifted first.<br />

The Vax user address space is loosely segmented into P0 (program) <strong>and</strong> P1<br />

(stack) spaces. (These two make up one half <strong>of</strong> the Vax addressability. The other<br />

half is ‘system’ space.) The address field <strong>of</strong> a NIL pointer permits addressing the<br />

low half <strong>of</strong> P0 space. By selecting the type bits accordingly, one can, however,<br />

represent objects in other parts <strong>of</strong> the address space if the mask used to clear<br />

the type bits is different from the type code <strong>and</strong> if the appropriate high type<br />

bits are present in the type code itself. NIL represents ‘stack vectors,’ which are<br />

simple vectors allocated in the high half <strong>of</strong> P1 space where the NIL stack lives in<br />

the following way. There are two simple-vector type codes—one for heap-allocated<br />

vectors <strong>and</strong> one for stack-allocated vectors. The type code assignments are chosen<br />

so that there is a single mask that clears either one <strong>of</strong> the type codes, producing the<br />

correct address. (Stack vectors are important for a number <strong>of</strong> things, particularly<br />

for doing efficient &REST arguments without CONSing.)<br />

The fact that 5 bits are used for type code means that there are 32 different<br />

primitive types; therefore a single longword mask can be used to represent the<br />

union <strong>of</strong> a number <strong>of</strong> these types. As a result, the computation <strong>of</strong><br />

(typep x ’(or single-float double-float))<br />

is identical to<br />

(typep x ’(or single-float double-float short-float long-float))<br />

except for the mask used.<br />

There is also an extended-number type, which implements BIGNUMs, ratios,<br />

<strong>and</strong> all the complex types.<br />

2.7.2 Function Call<br />

A compiled function is a typed pointer whose address points to a VAX pro-<br />

cedure. It is called using the Vax CALL instructions. Function cells contain only<br />

the address, not the type bits, so getting to the function is done by ‘evaluating’<br />

the function (identical to the way in which special variables are evaluated) <strong>and</strong><br />

doing CALLS on the result. The procedure exits with the RET instruction.

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

Saved successfully!

Ooh no, something went wrong!