The initial problem is that elt derives types on constant lists
without adding a NIL, which can be returned by NTH.
Always check bounds instead.
There's no performance advantage in not signaling an error.
This wasn't working right, and the assertion in LAYOUT-ID about assigning
only structures an ID was written incorrectly.
* Layout IDs are assigned only when applying a :layout-id fixup or when storing
into a descendant type's ID array, whichever occurs first.
* IDs of non-structure instances like STREAM that have nonzero IDs are
stored at the correct place for their depthoid, and not always at index 0
so that LAYOUT-ID doesn't have to test +structure-layout-flag+.
* LAYOUT-ID returns NIL instead of 0 if no ID is assigned.
machine-dependent files will never see the 0.
* The remark that IDs could do type-based dispatch is no longer hypothetical
Due to getting load delays wrong, we have never correctly run on MIPS I afaict
so don't even try. MIPS II has branch delays and also there are some
coprocessor hazards that still need delays, therefore keep those intact.
Which might cause type conflicts in new refs.
This might make some things opaque, but type-annotations are used only
in very specific cases, and preserving control flow with casts or
combinations will be just as opaque.
The generated texinfo files (e.g. ffi.texinfo) are under version
control only to be able to conveniently track the Markdown-to-Texinfo
output until it's deemed stable enough.
(defun f ()
(declare (optimize speed))
(labels ((phi (index)
(declare (type (integer 0) index))
(if (> index 9)
nil
(rec 0 index)))
(rec (zoot gindex)
(declare (fixnum zoot))
(if (< zoot 5)
(rec (1+ zoot) gindex)
(phi (1+ gindex)))))
(phi 0)))
now no longer produces any notes.
However, we don't have optimistic type propagation in CP itself, so
neither the lower bound nor the integerness of GINDEX or INDEX can be
derived.
When performing successive tests, if all types have the same depthoid, then
rather than emit an instruction to load instance-layout, and then a series
of instructions to compare the layout-id against various numbers (each
entailing a memory load), instead load the layout-id once up front and
compare that against the various IDs under consideration for equality.
If the depthoids are not all the same, fall back to the slightly suboptimal
code that loads a layout-id every time. (Better would be to try to group
comparisons into sequences of tests that can all use the same loaded ID.)
Test cases by Gemini
This accidental omission of ALLOCATING-FOR-HASH-TABLE had catastrophic
consequences if any system table was involved. I discovered the problem
in particular on SB-DI::*COMPILED-DEBUG-FUNS* which meant that you were
crashing while crashing, because you couldn't extract cached debug funs.
Test case by Gemini