[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Info MCL Digest V1 #161



>From: JCMA@ai.mit.edu (John C. Mallery)
>Date: Sat, 13 May 1995 20:12:30 -0400
>Subject: Array Register Analog in MCL?
>
>Is there something in MCL that is analogous to array registers on the Lisp
>Machine?
>
>What is needed is a aref that works on one dimensional arrays and does not
>perform
>bounds each reference.  This provides an optimization when the calling code has
>already determined the array length.

FYI:
The thing you propose is only vaguely related to Lisp Machine array
registers.  Lisp machine array registers *did* do bounds checking on each
reference.  They were faster than ordinary array references in that they
pre-decoded the array dimension information into some stack slots so that
the checking on each reference could be much faster.  Other microcode and
software ensured that the decoded thing was updated if the dimension
information was changed (especially important in the Lisp machine's
multi-process environment).

So array registers were still completely safe.  They were effective in
speeding things up only when there were several references to the same
array, and the array length (or indirection, etc.) was not changed between
references.  So the programmer had to declare their use since the compiler
couldn't determine when it would be effective.

The thing you are proposing (aref without a check) is a fine thing to want
and to use.  But it is risky where array registers weren't.