The feature was checked-in without being completed and it's already
bitrotted. Wrapper is folded back into layout name-wise for the most
part now because that's how it's been effectively functioning. There
are still probably more cleanups to be done, related to this, but this
takes care of most of the dead code and unnecessary layers of
alternate names/indirection.
Our contrib build graph was already expressed in contrib/Makefile,
so ASDF wasn't doing anything to determine an execution schedule.
The new make-contrib.lisp script can parse '.asd' files more-or-less as-is,
removing ASDF from the critical path. With blocklist=sb-simd, this change
decreased the time in parallelized make-target-contrib to under 5 seconds
for me (down from >10) when run on as many cores as there are contrib dirs.
All defsystems are treated as if containing ":serial t", and there are
two invented keywords to bind/assign special variables around compilation.
We still install '.asd' files in $SBCL_HOME/contrib, and build uiop and asdf
so there should be no observable difference to users.
Most build systems distinguish a failed build from a failed test run,
but make.sh has a hard time doing that because of the conflation of the two.
The whole regression suite should be run if you want to ensure a good build,
so that would be a good time to test contribs. Not only that, with ASDF
we obscured a ton of style-warnings, we lost sandboxing of input files,
the ability to use --evaluator-mode, automatic generation and cleanup of
scratch pathnames, and automatic sb-sprof profiling.
So convert contrib tests to use WITH-TEST except some that gave me trouble.
This makes the output a ton more readable, and makes bisection on seldom-used
configurations quicker, not to mention that SB-RT is very lame anyway.
And there is quite literally less code to maintain now. Go figure.
Otherwise, with the fopcompiler turned off, we were seeing some bad
behavior as constants became eligible for coalescing. (The fopcompiler
does not coalesce constants due to the way it does dumping.)
Literal data must not be modified!
The rationale and mechanics of this change have been adequately hashed
out on sbcl-devel, so nothing further to add here other than that a few
renamings of local variables from LAYOUT to WRAPPER may be worthwhile
depending on how other maintainers feel about the current state.
There are no user-observable differences in the normal configuration.
Aside from bogusly reimplementing bignum-ref, it printed nonsense
for double-floats on 64-bit machines:
CL-USER(1): (sb-kernel:make-double-float #x7fee0123 #x44556677)
1.6855869899497833d308
CL-USER(2): :i *
double-float 1.6855869899497833d308 [#00000010 01615BAF] at #x0000001001615BA0
I didn't care to figure out why, so just delete REF32 and do things right.
This is a further enhancement to the full-call detector.
Among the inlining failures that won't be signaled:
- (MAPfoo #'FN x) or a quantifier (SOME, etc) in which, had the
function been defined earlier, the compiler could have inlined,
whereas since #'FN is a reference and not onstensibly a call,
it does not get counted as a missed opportunity to inline.
- almost anything in build systems that enforce dependencies by not
giving you visibility to any file except explicitly stated requisites
*and* that create a fresh Lisp image for each step.
At least two build systems isolate compilations as such,
one being Fare's XCVB, the other an in-house complicated beast.
False negatives result from the fact that the file which performs
DECLAIM INLINE is (usually) the one that should warn, but if you
neither compile nor load that file, then nothing knows simultaneously
that there should not have been a full call and that there was.
To remedy this would mean propagating codegen status across Lisp images
by either a hideous hack involving cfasls, or a new artifact file.
But good ol' ASDF should not exhibit many false negatives.
INLINING-DEPENDENCY-FAILURE is the new condition class, the message
for which appears in a few variants (see new tests). It isn't yet
exported from SB-EXT as this code is still slightly experimental.
Meta-compile of SBCL is now expectedly much more warning-prone :-(
Deprecate QUIT. It occupies an uncomfortable niche between processes
and threads, and doesn't actually do what it says on the tin unless
you call it from the main thread.
SIGTERM now uses EXIT, and doesn't depend on sessions.
WITH-DEADLINE (:SECONDS NIL :OVERRIDE T) can now be used to ignore
deadlines.
JOIN-THREAD on the main thread now blocks indefinitely instead of
claiming the thread did not exit normally.
New functions:
* SB-EXT:EXIT. Always exits the process. Takes keywords :CODE,
:ABORT, and :TIMEOUT. Code is the exit status. Abort controls if
the exit is clean (unwind, exit-hooks, terminate other threads) or
dirty. Timeout controls how long to wait for other threads to
finish.
* SB-THREAD:RETURN-FROM-THREAD. Normal termination for current
thread -- equivalent to return from the thread function with the
specified values. Takes keyword :ALLOW-EXIT, which determines if
returning from the main thread is an error, or equivalent to
calling EXIT :CODE 0.
* SB-THREAD:ABORT-THREAD. Abnormal termination for current thread --
equivalent to invoking the initial ABORT restart estabilished by
MAKE-THREAD (previously known as TERMINATE-THREAD, but ANSI
recommends there to always be an ABORT restart.) Takes keyword
:ALLOW-EXIT, which determines if aborting the main thread is an
error, or equivalent to calling EXIT :CODE 1.
* SB-THREAD:MAIN-THREAD-P. Let's you determine if a given thread is
the main thread of the process. This is important for some
functions on some operating systems -- and RETURN-FROM-THREAD and
ABORT-THREAD also need it.
* SB-THREAD:MAIN-THREAD. Returns the main thread object. Convenient
for when you need to eg. load a foreign library in the main
thread.
* In arith.pure.lisp, some test cases were defined in terms of
n-lowtag-bits instead of n-fixnum-tag-bits.
* In sb-aclrepl, the bignum used for testing fit within an
(signed-byte 63), the largest possible fixnum type on a 64-bit system.
* Thanks to Paul Khuong for finding and fixing the arith.pure.lisp
tests.
* Reorganize things a bit between kernel.lisp and target-misc.lisp for
clarity, ditto for the package-data-lisp.expr.
* Define SIMPLE-FUN, CLOSURE, and FUNCALLABLE-INSTANCE types, and use
them instead of manually checking for widetags in various places.
* Implement (SETF %FUN-LAMBDA-LIST), and make it work on interpreted
functions as well by giving them an DEBUG-LAMBDA-LIST. Use in
DEFMACRO and DEFINE-COMPILER-MACRO instead of looking at the widetags.
* Make (SETF %FUN-NAME) to work: on closures just change the name of
the underlying function and let the callers beware. On interpreted
functions change the new DEBUG-NAME slot instead of NAME. Use in
DEFMACRO and DEFINE-COMPILER-MACRO.
* Implement and use DO-CLOSURE-VALUES to walk over closure environment
instead of manually iterating over indexes.
* Use %FUN-FUN in FUN-DEBUG-FUN, and %FUN-LAMBDA-LIST in the
SB-ACLREPL::INSPECTED-PARTS.
* Remove the commented out (SETF %FUN-NAME) from DEFUN: the compiler
does the right thing, and for the debugger to have a useful name it
has to be on the SIMPLE-FUN at any rate, so...
* Slightly nicer DESCRIBE of interpreted functions.
* When converting dead references to global variables, convert using
SYMBOL-VALUE. Results in the same code, but prevents dead unbound
variable references from being flushed.
* Collect XREF information for constant SYMBOL-VALUE cases.
* Fix one dead reference to *LEXENV* in SBCL codebase.
* Fix other undefined variables in contribs.
* Test-case.
Declassification of INSTANCE and FUNCALLABLE-INSTANCE.
It turns out that the classes INSTANCE and
FUNCALLABLE-INSTANCE, as expressed in instance-pointer-lowtag
and funcallable-instance-widetag, are incompatible with the
MOP's notion of classes: the types INSTANCE and
FUNCALLABLE-INSTANCE are necessarily disjoint (no instance can
have a widetag of anything other than instance-header-widetag),
but FUNCALLABLE-STANDARD-OBJECT is required to be a subclass of
STANDARD-OBJECT, and must therefore have the superclasses of
STANDARD-OBJECT among its superclasses. If INSTANCE is one of
those, FUNCALLABLE-INSTANCE cannot be, so F-S-Os would not be of
type FUNCALLABLE-INSTANCE (which is wrong); if it is not one of
those, then ordinary S-Os would not be of type INSTANCE (which
is wrong). CMUCL, at the time of writing, exhibits type system
confusion in this area, as demonstrated by CSR cmucl-imp
2005-09-0x).
So, we need to do something else; probably most straightforward
to make INSTANCE and FUNCALLABLE-INSTANCE named types, as they
are of the same order of specialness as e.g. T -- not quite as
special, but almost. Some hacking later...
... the usual type system dance. Play whack-a-mole with test
failures and compilation failures until they all go
away. Primtype, class, typetran, and so on are
fiddled with.
... somewhat hacky code for determining when a class is subtypep
instance / funcallable-instance.
... different hard-coded constants for genesis; don't make a
special instance-layout, because the instance class is
gone.
... just to prove we've achieved something, make STANDARD-OBJECT
a superclass of FUNCALLABLE-STANDARD-OBJECT.
(Supporting METAOBJECT should be straightforward now)
... many many new tests, both of the before-xc variety (it's
amazing in how many ways I can get the type system
wrong) and of the regular form. Also add some
ctor tests that aren't exercised yet.
* Public interface changes
** proper thread objects instead of thread ids
** (MAKE-THREAD FN &KEY NAME) => THREAD
** (THREAD-NAME THREAD): threads have names (useful for debugging,
logging)
** (THREAD-ALIVE-P THREAD)
** *CURRENT-THREAD* special is bound in each thread
** (LIST-ALL-THREADS) returns a list of all active threads
* Notes
** thread-init moved earlier in cold-init and reinit
** the lisp side does not ever use os_thread_t (it was problematic due
to pthread_t being opaque) but struct thread *
** threads are reaped (i.e. the thread is pthread_joined and struct
thread* is freed) by the thread object's finalizer. This makes
it easy to implement resetting threads. Running threads are kept
in sb-thread::*all-threads*.
** threads block all blockable signals when going down:
interrupt-thread and others cannot catch it at an inappropriate
moment, for instance calling quit outside the catch %end-of-the-world
** target-thread.lisp renamed target-multithread.lisp,
target-thread.lisp now contains the generic thread support
** new file early-thread.lisp: define *current-thread*
** removed thread state STOPPING that was only used for assertions and
complicated matters
** renumbered thread states
** sb-thread::release-spinlock now releases the locks with
non-fixnum value, but is no longer safe to call multiple times
** much simplified locking for threads and gc
** fixed deadlocking bugs introduced by the pthread merge
merged most of the pthreads stuff from amd64-pthread-branch except
the amd64 part, plus:
* in the runtime thread_kill, thread_sigmask, thread_self
stand for pthread_kill or kill, sigprocmaks or
pthread_sigmask, and pthread_self or getpid respectively
controlled by the sb-thread feature
* fixed recursive get on session-lock that happened when a gc
interrupting get-foreground reaped a thread
* fixed sigint handling: removed broken (by pthread signal
handling semantics) sigint enable/disable machinery in favor
of sigint-%break looking up the foreground thread and
interrupting it, which is itself racy :-(.
* numerous fixes for interrupt-thread
* threads block signals until they are set up properly
* removed suspend-thread, resume-thread
* destroy-thread is now equivalent to terminate-thread.
Patch by Simon Alexander on sbcl-devel 2005-02-19.
Note to self: it seems that we don't currently have
_any_ tests for the inspector. Make it not so, someday
soon for preference.
Maybe speed up PCL a tiny bit more
... make the slot positioning a little less confusing, so that
the 'same' slot tends to be in the same location;
... this should help the clever DFUN mechanism to keep neat ones
like ONE-INDEX around;
... (also this puts slots in objects in the 'expected' order --
frob sb-aclrepl's dealing with the unexpected
Backend renaming of various BASE-CHAR things to CHARACTER things
... BASE-CHAR-REG -> CHARACTER-REG
... BASE-CHAR-STACK -> CHARACTER-STACK
... BASE-CHAR-SC-NUMBER -> CHARACTER-SC-NUMBER
... etc.
... as a somewhat unexpected side effect, the BASE-CHAR class
gets deleted, essentially because of the note containing
"BOGGLE" in src/compiler/generic/primtype.lisp: array
specializations are converted to primitive types by
testing the specifier of the specialization against a list
with EQUAL, and the BASE-CHAR/CHARACTER ambiguity hurts.
Just as in June 2003, this looks too hard to solve right now.
This patch was brought to you by character_branch and M-%
* Merge the new intrumentation based single stepper,
excise stale breakpoint code for STEP; TRACE breakpoints
should be unaffected.
* A dash of documentation.