* New variable: *IN-INTERRUPTION* is true IFF we're being called inside
*IN-INTERRUPTION* and there are no intervening WITHOUT-INTERRUPTS.
* INTERRUPT-THREAD calls the interrupt function inside WITH-INTERRUPTS
when interrupting the current thread IFF *IN-INTERRUPTION* is true.
* Remove bogus FIXME by yours truly from INVOKE-INTERRUPTION and
properly explain what is going on -- and add another FIXME in its
place.
This makes nested SIGINTs DTRT.

* Check for blocking / wait for new input before touching the stream.
* Check that the SAP is still there after the wait, in case an interrupt
handler or an FD handler closed the stream from under us.
* Wrap the main action in WITHOUT-INTERRUPTS to prevent asynch unwinds
from leaving the stream in an inconsistent state. (Since the read
is going to be non-blocking it should be over soon enough.)
* Arrange to signal errors outside the WITHOUT-INTERRUPTS.

* when the LOAD-TYPE macros in the various backends hardcoded '3',
they really meant (1- N-WORD-BYTES)--a little reflection on
widetags, lowtags, and endian orderings should make this clear
(we don't have a 64-bit big-endian port to drive it home, though);
* catch the spread of magic constants in code/array.lisp.

* SIMPLE-VECTOR-COMPARE-AND-SWAP, not SAFE-SIMPLE-VECTOR-COMPARE-AND-SWAP.
* Missing tests.
* Whitespace.
* foreign.test.sh jugglery
This path breaks foreign.test.sh on x86/Darwin even without
touching it, indicative of still lingering Darwin issues. Any
number of changes can mask this breakage: adding SAFE- prefix to
SIMPLE-VECTOR-COMPARE-AND-SWAP is enough to make foreign.test.sh
pass again, but so is adding a sneaky --eval nil in there as well
-- among other things.
Pain. Hate. Pain. See commentary in foreign.test.sh
This time the issue doesn't seem to be foreign stack alignment
related, though: forcing the compiler to use the fast call-out path
always doesn't make the "small" case pass.

* Since we have a non-threaded %INSTANCE-COMPARE-AND-SWAP on all
platforms, define DEFINE-STRUCTURE-SLOT-COMPARE-AND-SWAP on
non-threaded builds as well.
* Bounds checking SIMPLE-VECTOR-COMPARE-AND-SWAP, plus tests.

* On all FOREIGN_FUNCTION_CALL_FLAG platforms arch_pseudo_atomic_atomic is
always accompanied by !foreign_function_call_active.
For clarity move checking it to the a_p_a_a definitions on platforms that
need it.
TEST ALERT: This touches all the non-x86oid platforms, but I have
not been able to test on them -- so a thinko/typo build-breakage is
not impossible.
* If we somehow ended up in interrupt_handle_pending in the middle of a PA
section we might GC in the middle of it, or lose PA interrupted flags.
Now we punt straight up if we get there in the middle of PA.
* If we handled a pending interrupt outside GC-INHIBIT, but inside a PA
section, with both GC_PENDING and SIG_STOP_FOR_GC_PENDING was true, we
would be left running with GC_PENDING cleared without actually taking any
action.
The previous item actually fixes this, but for clarity make
sig_stop_for_gc_handler clear the GC_PENDING and SIG_STOP_FOR_GC_PENDING
iff it actually stops the thread.
* The single UWP implementation for WITHOUT-GCING was incorrect: if
we had a GC but no interrupts pending when checking for pending
interrupts and GCs, and caught an asynch unwind at that point we
could be left running with the GC pending (and/or related signals
blocked).
Due to the increased cost of WITHOUT-GCING, check first if GC is
already disabled before taking the UWP code path.

…izers
... the second return value from
COMPUTE-APPLICABLE-METHODS-USING-CLASSES promises that the
first return value can be cached. It doesn't promise that an
arbitrary computation on the specializers will work, so we need
not to go down that codepath.
... so refuse to build dispatch discriminating functions if any
method of the generic function has a non-standard
(non-PCL-native) specializer, as operations such as
SB-PCL::SPECIALIZER-CLASS and SB-PCL::TYPE-FROM-SPECIALIZER
will fail on such specializers
... rework SPECIALIZER-CLASS-OR-NIL to call the new function
STANDARD-SPECIALIZER-P.
... test case.

…ALIZER
... define SPECIALIZER-CLASS-OR-NIL for use in RAISE-METATYPE,
and adjust RAISE-METATYPE to handle NIL return values.
... add commentary around RAISE-METATYPE to explain what all the
metatypes actually mean.
... EMIT-FETCH-WRAPPER was missing a CONDITION-INSTANCE case,
and further drew fine distinctions where there were none...
... so delete BUILT-IN-OR-STRUCTURE-WRAPPER, and call WRAPPER-OF
instead. (But leave in the GC safety bug reported sbcl-devel
2007-05-10.)
... one more fix to PARAMETER-SPECIALIZER-DECLARATION-IN-DEFMETHOD
for CLASS-EQ specializers on built-in-classes.

Many of the dlisp functions took (metatypes applyp) arguments,
when in fact all they were using was the length of the metatypes
argument and the applyp boolean. Make this explicit, to assist
in understanding when the identity of metatypes actually
matters.

* Suppressing of #. in the source location recording read-table was
implemented incorrectly. (Reported by James Knight)
* Don't silently ignore read errors.
* Use a dummy source location map for top level forms for which
an error was signaled, rather than NIL. Otherwise the compiler's
and sb-cover's tlf numbering could get out of sync.

* Add support for deterministically tracking the amount of times
that certain functions were called during a sb-sprof profiling
run.
* The goal is to allow people to easily see whether a lot of time
is spent in function X due to it being called often, or due to
the average call being slow.
* The benefit over using sb-profile is that a) the reporting
of the call counts is integrated into the normal sb-sprof
interface and b) there's a lot less overhead, since we're just
counting calls, not tracking cpu usage / consing.

* Stack alignment cannot be changed after arguments have been pushed
on stack: ALLOCATE-NUMBER-STACK-SPACE is the place to do this, and
nowhere else.
* Use the RESET-STACK-POINTER logic on all x86 platforms for
simplicity.
* Factor out the alignment logic to ALIGN-STACK-POINTER.
* Clear DF unconditionally when calling out, which means that Solaris
doesn't need to switch it back and forth. (Darwin, Solaris, and Win32
all need DF cleared for call-out.)

* redo DEFINE-UNIBYTE-MAPPER to use a lookup table instead of
a big CASE statement (optimizes for the common (?) case of
mostly ASCII characters and gives smaller code);
* STRING->LATIN% now optimistically assumes that there are
no encoding errors in the string and allocates an
appropriately-sized octet vector upfront, falling back to
the slower path if an encoding error is detected;
* do more or less the same thing for UTF-8 encoding, except
that there is no slow path (since UTF-8 can encode all
characters, unlike unibyte encodings)
* we have a ton of external formats; use a hash table for
*EXTERNAL-FORMAT-FUNCTIONS* rather than a list to cut down
on lookup time (this alone is worth ~10% without the other
optimizations above...).
Code cleanups:
* use string package names like every other source file;
* properly separate function names from arglists;
* don't pass END parameters when we don't use them.
End result is ~20-30x speedup for unibyte encodings (depending
on the encoding--LATIN-1 is ~20x, whereas something like CP857
is ~30x) when encoding ASCII strings; smaller but still
significant speedups when encoding non-ASCII strings. UTF-8
encoding is ~5-6x faster, which also means that we're faster
than TRIVIAL-UTF-8 for encoding now (decoding is an entirely
different matter).

Still somewhat experimental, so it might be changed incompatibly once
people start actually using it. Or maybe even removed, if it's not
found to be useful in practice. More documentation on interpreting
the output and on the limitations of the coverage tool will be
committed later.
* Compiler
* Instrument all forms found in the original source code
when the store-coverage-data optimization quality is larger
than 1.
* The instrumentation is fairly lightweight; just literal conses that
are modified when the form is executed.
* This requires hacking the compiler to allow modifying literals
when we know what we're doing.
* Add some extra source location tracking capabilities to handle
non-cons source forms better (though still not perfectly).
* Contrib
* Get the instrumentation data from the compiler, and create
a aggregate report + pretty annotate source code reports
(as html) from it.
* The latter uses a modified version of the source code tracking
read-table from Swank, written by Helmut Eller.