Nikodemus Siivola [Tue, 12 May 2009 11:00:13 +0000 (11:00 +0000)]
1.0.28.43: QUIT related work
* SAVE-LISP-AND-DIE :TOPLEVEL can return, just call QUIT if it does.
* --script should not override QUIT called by user with its own exit status.
(reported by Hubert Kauker)
Nikodemus Siivola [Tue, 12 May 2009 09:58:45 +0000 (09:58 +0000)]
1.0.28.42: pretty-printing LOOP forms
Thanks to Tobias Ritterweiler.
Update NEWS a bit while at it.
Nikodemus Siivola [Tue, 12 May 2009 09:11:39 +0000 (09:11 +0000)]
1.0.28.41: make MAKE-ARRAY transforms co-operate with FILL better
When the transform for FILL fires, and the type of initial-element
has not yet been propagated, so VECTOR-FILL* fires instead of a more
specific transform (which currently exist only for
SIMPLE-BASE-STRINGs and SIMPLE-BIT-VECTORs.)
Annotate the type with THE and the SAETP-SPECIFIER so the most
specific transform can fire.
Reported by Stas Boukarev.
Nikodemus Siivola [Tue, 12 May 2009 08:21:12 +0000 (08:21 +0000)]
1.0.28.40: hopefully fix Win32 build
* Broken by 1.0.28.37.
Nikodemus Siivola [Mon, 11 May 2009 19:41:48 +0000 (19:41 +0000)]
1.0.28.39: more error reporting tweakery
* Now that *CURRENT-PATH* is bound first by PROCESS-TOPLEVEL-FORM
make FIND-ERROR-CONTEXT prefer NODE-SOURCE-PATH *CURRENT-PATH* --
otherwise the more accurate source path in the node is never used.
(Experimentally it seems that *CURRENT-PATH* is never more
accurate.)
Everything seems OK, but the whole source path mechanism could
probably us an audit, and possibly some refactoring.
* ADD-TEST-CONSTRAINTS should bind *COMPILER-ERROR-CONTEXT* around
the call to SPECIALIZER-TYPE in case of undefined types. (Left out
from last patch by accident.)
Nikodemus Siivola [Mon, 11 May 2009 15:44:11 +0000 (15:44 +0000)]
1.0.28.38: undefined warning and compilation unit summary tweaking
* Signal a full warning for undefined types when the name is in the
COMMON-LISP package.
* Explain probable source of error when the name of an undefined type
is a quoted object.
* When same original source form is responsible for multiple
undefined warnings, only signal the first: otherwise we may signal
a boatload of identical warnings for a single source form just
because the compiler tries so very hard to make sense of it.
* Don't summarize the names of undefined things by signalling new
warnings for them, instead include the names in the compilation
unit summary.
Gabor Melis [Mon, 11 May 2009 13:24:34 +0000 (13:24 +0000)]
1.0.28.37: resignal signals received in foreign threads
Signals delivered to threads started from foreign land (read: directly
by pthread_create, not by MAKE-THREAD) are redirected to a Lisp thread
by blocking all signals and resignalling.
Nikodemus Siivola [Mon, 11 May 2009 11:17:51 +0000 (11:17 +0000)]
1.0.28.36: better logic for failure-to-stack-allocate notes
* Elide if the use is a REF, not if the source form is a symbol.
* Tests.
Nikodemus Siivola [Mon, 11 May 2009 10:21:20 +0000 (10:21 +0000)]
1.0.28.35: compiler notes for failure to stack allocate
* Emit a compiler note when stack allocation was requested, but could
not be provided.
Nathan Froyd [Sat, 9 May 2009 13:00:29 +0000 (13:00 +0000)]
1.0.28.34: convert once-used DEFMACROs to EVAL-WHEN'd SB!XC:DEFMACROs
There were a couple FIXMEs lurking about this. Fixing themm is easy enough
and reduces the core size slightly.
Nikodemus Siivola [Sat, 9 May 2009 09:27:07 +0000 (09:27 +0000)]
1.0.28.33: minor post-DEFGLOBAL cleanups
* Call array-accessor dispatch tables %%foo%% instead of **foo** to
warn off the unwary.
* Set their size to (1+ widetag-mask) -- this should not really matter
since we check for other-pointer-lowtag before stripping the widetag,
as widetag are always immediate objects, so the low bit is zero.
...but this is more obviously correct, and costs us, what 4 words
of storage.
* Mark one FIXME/KLUDGE more, since people have been so busy getting
rid of them...
* Restore the imperative tone in DEFVAR docstring.
* Oops, left one FLUSHABLE too many in last commit.
Nikodemus Siivola [Sat, 9 May 2009 08:58:21 +0000 (08:58 +0000)]
1.0.28.32: move FLUSHABLE back to SB!ASSEM
* Broke Sparc build, and maybe others.
Nathan Froyd [Fri, 8 May 2009 20:58:23 +0000 (20:58 +0000)]
1.0.28.31: remove :PREFIX/:SUFFIX from DEFENUM for MORE GREPPABILITY
Searching for useful things like even-fixnum-lowtag in the source won't
find the actual definition due to cleverness with DEFENUM. This cleverness
is the source of several FIXMEs throughout the code. I can personally
remember being baffled at the magic of even-fixnum-lowtag and friends
magically springing into existence when I could not easily grep for their
definitions. In the interest of clarity, remove the cleverness and update
all relevent DEFENUMs.
In the interest of OAOO, move TRACE-TABLE-* constants to generic code while
we're at it, too. Doing the same thing for the *-TRAP constants is left
as an exercise for another day.
Nikodemus Siivola [Fri, 8 May 2009 19:08:07 +0000 (19:08 +0000)]
1.0.28.30: DEFGLOBAL, ALWAYS-BOUND, GLOBAL, SYMBOL-GLOBAL-VALUE
* ALWAYS-BOUND allows the compiler to elide boundness checks
for symbol value access, and prohibits MAKUNBOUND. This is
handled via a new globaldb entry.
GLOBAL makes the compiler elide TLS checking for symbol
values access, and prohibits rebinding. This is handled via
new globaldb :variable :type, namely :global.
DEFGLOBAL is build on top of these. Global variables are mainly an
efficiency measure on threaded builds, but can also express
intention as they prohibit rebinding.
* Add %SET-SYMBOL-GLOBAL-VALUE, FAST-SYMBOL-GLOBAL-VALUE, and
SYMBOL-GLOBAL-VALUE VOPs to all backends. On unithreaded
builds these are trivial copies of the non-global versions.
* Tell SB-CLTL2 about both GLOBAL and ALWAYS-BOUND declarations too.
* Document in the Efficiency chapter of the manual.
* Prohibit declaring constants special.
* Tests.
Later: use these new features inside SBCL itself. For now there is
only a single DEFGLOBAL used, but more could well be.
Nikodemus Siivola [Fri, 8 May 2009 09:32:28 +0000 (09:32 +0000)]
1.0.28.29: some manual love
Updates, light reorganization and a touch of prettification.
Also warn about the dangers of dynamic environment as it pertains to
timers.
Nathan Froyd [Fri, 8 May 2009 03:00:25 +0000 (03:00 +0000)]
1.0.28.28: delete %RAW-BITS and %SET-RAW-BITS
%VECTOR-RAW-BITS and %SET-VECTOR-RAW-BITS are exactly the same functionality
without the weird dancing with SB!VM:VECTOR-DATA-OFFSET.
Nikodemus Siivola [Thu, 7 May 2009 18:06:12 +0000 (18:06 +0000)]
1.0.28.27: move FLUSHABLE to SB-C, export UNSAFELY-FLUSHABLE for consistency
EOM
Nikodemus Siivola [Thu, 7 May 2009 17:44:09 +0000 (17:44 +0000)]
1.0.28.26: Mr. ATOMIC-INCF/SYMBOL, meet Mr. AX
Given the chop as as dangerous if the symbol-value happens to be
anything else but a fixnum. If this are still desired, ATOMIC-INCF
can be extended to support symbols proclaimed FIXNUM -- but that too
will lose on unbound symbols.
Was only used in a single test, replace with a structure and
ATOMIC-INCF there.
Nikodemus Siivola [Thu, 7 May 2009 16:48:04 +0000 (16:48 +0000)]
1.0.28.25: document CLOS slot type checking policy
...especially since given our normal declarations-are-assertions
policy it is somewhat surprising.
Nikodemus Siivola [Thu, 7 May 2009 11:11:05 +0000 (11:11 +0000)]
1.0.28.24: better %ARRAY-DISPLACED-FROM handling
James Knight pointed out that signalling an error at ADJUST-ARRAY
time is not quite right, since the other array may be otherwise
unreachable already -- we're following a weak pointer after all.
Oops. Enter the twilight zone between clever by half and slightly
horrible:
When a potentially bogus ADJUST-ARRAY is detected, walk the chain
of backpointers, and set FILL-POINTER, AVAILABLE-ELEMENTS, and
all dimensions of the too-large displaced-from arrays to zero.
This in turn causes any typecheck involving the array dimensions
to trap, as well as any bounds-checked access.
To make these errors more understandable, save the original
dimensions of the array, punning them to the ARRAY-DISPLACED-P
slot, and identify the bogus arrays in INVALID-ARRAY-INDEX-ERROR
function, and the OBJECT-NOT-TYPE-ERROR internal error handler;
signal an INVALID-ARRAY-ERROR instead, which explains what is going
on.
Whew.
Oh, and a BIG THREAD SAFETY NOTE regarding the fundamental nature
of our ADJUST-ARRAY implementation. It is not thread safe in
parallel with accesses to the array being adjusted. Tentative
idea is to add one more level of indirection to array headers,
so that we can get atomic updates without locking.
Alastair Bridgewater [Thu, 7 May 2009 02:12:58 +0000 (02:12 +0000)]
1.0.28.23: Fix value of CL:- in inspector
The inspector was the last holdout against using INTERACTIVE-EVAL.
...take one down, commit the fix, 97 FIXMEs left in the source... (with
apologies to Nathan Froyd, per 1.0.28.7)
Alastair Bridgewater [Wed, 6 May 2009 21:12:08 +0000 (21:12 +0000)]
1.0.28.22: Fix deref of (alien (* t)) values
When attempting to deref a value known to the compiler as an (alien
(* t)) issue a compiler note rather than attempting to open-code (the
type may be better known at run-time).
Update NEWS with mention of the changes from 1.0.28.11 (oops).
Nikodemus Siivola [Wed, 6 May 2009 18:39:49 +0000 (18:39 +0000)]
1.0.28.21: further array typechecking optimization
(really, this time. contents accidentally left out from 1.0.28.20)
* Eliminate extra lowtag checking from the array element type check:
since we know we are dealing with an array, we can use the same
fast widetag extraction code that array type dispatching used --
factoring it out into %OTHER-POINTER-WIDETAG.
* If we know after checking the dimensions that the array must have
a header, and we know that the array is simple, we can deduce that
there is exactly one level of indirection.
* Similarly, if we know that the array has a header, we can
immediately pull out the data vector to check if it too has a
header instead of doing an extra test.
Nikodemus Siivola [Wed, 6 May 2009 18:35:41 +0000 (18:35 +0000)]
1.0.28.20: further array typechecking optimization
* Eliminate extra lowtag checking from the array element type check:
since we know we are dealing with an array, we can use the same
fast widetag extraction code that array type dispatching used --
factoring it out into %OTHER-POINTER-WIDETAG.
* If we know after checking the dimensions that the array must have
a header, and we know that the array is simple, we can deduce that
there is exactly one level of indirection.
* Similarly, if we know that the array has a header, we can
immediately pull out the data vector to check if it too has a
header instead of doing an extra test.
Nikodemus Siivola [Wed, 6 May 2009 16:28:03 +0000 (16:28 +0000)]
1.0.28.19: faster ARRAY-DIMENSION for non-vectors
Previously each ARRAY-DIMENSION call for a non-vector resulted in
checking (1) if the array was a displaced array (2) if the array it
was displaced to was still big enough for it.
This sucks pretty badly, because we use ARRAY-DIMENSION in bounds
checking -- especially given how rare it is to have an array
displaced to an adjustable array.
Add a new slot, ARRAY-DISPLACED-FROM, to array-headers, and store a
list of weak backpointers to arrays displaced to the array in
question there. SET-ARRAY-HEADER (as part of ADJUST-ARRAY) now
checks this list, and signals an error if any of the displaced-from
arrays is larger than the new size.
This also allows us to open code ARRAY-DIMENSION as long as the
array rank is known.
Nikodemus Siivola [Wed, 6 May 2009 15:50:19 +0000 (15:50 +0000)]
1.0.28.18: better TRULY-DYNAMIC-EXTENT handling
Since RECHECK-DYNAMIC-EXTENT-LVARS passes T as the DX type,
TRULY-DYNAMIC-EXTENT did not unconditionally allow DX allocation
regardless of policy, as was the intention.
Save the LVARs initially along with the DX type (T or :TRULY),
so that R-D-E-L can use the correct DX type when rechecking.
Test case.
Nikodemus Siivola [Wed, 6 May 2009 13:27:52 +0000 (13:27 +0000)]
1.0.28.17: tn packing issues in ALLOCATE-VECTOR-ON-STACK on x86oids
* If WORDS and LENGTH were packed in the same TN all manner of
badness arose. Adjust lifetimes to make sure it doesn't happen,
and try to pack LENGTH into EAX while at it.
Gabor Melis and Paul Khuong did the figuring out what's wrong.
Alastair Bridgewater [Tue, 5 May 2009 20:02:11 +0000 (20:02 +0000)]
1.0.28.16: Fix a mistake in 1.0.28.15
In host-load-stem, the flags argument was declared ignore while
actually being used. Fixed.
Alastair Bridgewater [Tue, 5 May 2009 17:11:18 +0000 (17:11 +0000)]
1.0.28.15: Build desymlinkification
Changed the object filename computation function to use a different
suffix for files in target-compile mode with the :assem flag.
Changed the src/compiler/assembly/ paths in build-order.lisp-expr to
refer to src/assembly/ instead.
Changed the duplicate-stem check in src/cold/shared.lisp to operate
in terms of target-compile object file names.
Changed both the source and object filename computation functions to
call a new function to remap stem path segments matching "/target/" to
the appropriate per-arch directory.
Removed the code for creating the compiler/assembly/ and target/
symlinks from make-config.sh.
With this, source-location information in SBCL is now correct even
when used against an unbuilt source tree.
Alastair Bridgewater [Tue, 5 May 2009 17:10:29 +0000 (17:10 +0000)]
1.0.28.14: Build system refactoring
Moved flag processing as far "inward" as possible when dealing with
compile-stem, reducing the amount of redundant code for parsing out and
passing along boolean keywords based on the presence or absence of a
flag and eliminating some of the keyword arguments to compile-stem.
Added a "mode" parameter to compile-stem to enable determining the
correct compile-file function based on the combination of mode and
flags, further simplifying the interface.
Added new functions for determining the source and object pathnames
for a stem, fixing a longstanding KLUDGE in host-load-stem,
consolidating the three instances of code to compute an object pathname
and the two instances of code to compute a source pathname and
eliminating the rest of the keyword arguments to compile-stem.
Nikodemus Siivola [Tue, 5 May 2009 10:53:16 +0000 (10:53 +0000)]
1.0.28.13: quiet WITH-TIMEOUT when used with constant EXPIRES argument
* Don't copy the body so as to avoid the compiler note for deleting
either leg, which happens when EXPIRES is a constant.
Nikodemus Siivola [Tue, 5 May 2009 09:41:24 +0000 (09:41 +0000)]
1.0.28.12: preserve non-toplevelness of macro subforms
* As per CLHS 3.2.3.1.2. At least AND, OR, and COND where affected by
this. Reported by James Knight.
Alastair Bridgewater [Mon, 4 May 2009 23:09:02 +0000 (23:09 +0000)]
1.0.28.11: Fix bug 316325 (x86oid alien integer result truncation)
Change the parameters for :alien-rep alien-type-methods to include a
"CONTEXT" parameter to indicate if the type being sought is for a
function result representation. Ignore the new parameter on all
:alien-rep methods except for (integer :alien-rep).
Change (integer :alien-rep) to return an integer type the full width
of a machine register when asked for the function result
representation.
Condition out the (integer :naturalize-gen) method in
src/code/host-alieneval.lisp on x86oids (it's defined in
src/compiler/x86{,-64}/c-call.lisp).
Change the type deriver for %alien-funcall to request the result
representation for the declared function result type.
In src/compiler/x86{,-64}/c-call.lisp, change the (integer
:naturalize-gen) alien-type-method to do field masking of unsigned
fields when needed.
Also in src/compiler/x86{,-64}/c-call.lisp, fix SIGN-EXTEND to not
lie to the compiler quite so badly about its argument types and add a
comment about a possible future optimization.
Add a test to tests/alien.impure.lisp, for completeness sake.
Nikodemus Siivola [Mon, 4 May 2009 20:43:04 +0000 (20:43 +0000)]
1.0.28.10: faster array dimension typechecking code
* Put in an explicit ARRAY-HEADER-P, and short-circuit on its result
when possible, otherwise use the known presence or lack of header
to get dimensions more efficiently: using either %ARRAY-DIMENSION
or VECTOR-LENGTH.
Nikodemus Siivola [Mon, 4 May 2009 19:28:44 +0000 (19:28 +0000)]
1.0.28.9: open code ARRAY-RANK
* Faster multidimensional AREF if the array rank is not known
at compile-time.
Nathan Froyd [Fri, 1 May 2009 21:01:57 +0000 (21:01 +0000)]
1.0.28.8: micro-optimize OUCH-READ-BUFFER
Remove an array bounds check and a couple of BOUNDP checks.
Nathan Froyd [Fri, 1 May 2009 20:29:39 +0000 (20:29 +0000)]
1.0.28.7: eliminate *READ-BUFFER-LENGTH*
...take one down, commit the fix, 98 FIXMEs left in the source...
Nikodemus Siivola [Fri, 1 May 2009 20:22:52 +0000 (20:22 +0000)]
1.0.28.6: move the new PROGV tests to the right part of the file
* Oops.
Nathan Froyd [Fri, 1 May 2009 18:17:46 +0000 (18:17 +0000)]
1.0.28.5: delete MERGE-BITS
Wasn't used anywhere; probably intended for bignum operations.
Nikodemus Siivola [Fri, 1 May 2009 12:03:54 +0000 (12:03 +0000)]
1.0.28.4: various macro source locations were off-by-one due to #-sb-xc
* Thanks to Tobias Rittweiler -- now M-. DEFTRANSFORM, etc. work
better in Slime.
Nikodemus Siivola [Fri, 1 May 2009 10:54:28 +0000 (10:54 +0000)]
1.0.28.3: ABOUT-TO-MODIFY-SYMBOL-VALUE doesn't choke on FUNCTION subtypes
* Evaluating eg. a SET when the type of the variable as been
proclaimed to be a subtype of FUNCTION used to break, since
ABOUT-TO-MODIFY-SYMBOL-VALUE uses %%TYPEP to check the type, and
function subtypes are not normally acceptable type specifiers to
TYPEP.
SBCL is, however, able to reason about such types, so we add an
optional STRICT argument to %%TYPEP defaulting to T, which
A-T-M-S-V give as NIL to allow checking of function subtypes.
Reported by Lorenz Mösenlechner.
Nikodemus Siivola [Fri, 1 May 2009 10:35:43 +0000 (10:35 +0000)]
1.0.28.2: fix bug 201, Incautious type inference from compound types
* Define LVAR-CONSERVATIVE-TYPE &co, which take into accound that a
function call can change the type of a cons or a non-simple array
without changing it's identity. Use this instead of LVAR-TYPE in
derive-type optimizers for CAR and CDR, and in the ARRAY-DIMENSIONS
transform. (There may be other places where it should be used as
well, but I could not find anything else just now.)
Nikodemus Siivola [Fri, 1 May 2009 10:30:50 +0000 (10:30 +0000)]
1.0.28.1: disable address space randomization on Linux/x86-64
* At least some Red Hat versions do randomization on x86-64 as well,
whereas we used to assume only x86 had this "feature".
Christophe Rhodes [Thu, 30 Apr 2009 16:48:26 +0000 (16:48 +0000)]
1.0.28: release, will be tagged as sbcl_1_0_28
Gabor Melis [Thu, 30 Apr 2009 07:34:53 +0000 (07:34 +0000)]
1.0.27.49: update platform table, credit me
Alastair Bridgewater [Tue, 28 Apr 2009 16:02:13 +0000 (16:02 +0000)]
1.0.27.48: Win32/Cygwin contrib build fix.
Recentish cygwin likes to have gcc as a symlink. SBCL can't handle
that, so, for cygwin only, fully dereference gcc if it's a symlink when
building contribs.
Gabor Melis [Mon, 27 Apr 2009 20:26:10 +0000 (20:26 +0000)]
1.0.27.47: fix RUN-PROGRAM on windows
Hopefully. There are mixed reports from users.
Alastair Bridgewater [Sat, 25 Apr 2009 03:12:13 +0000 (03:12 +0000)]
1.0.27.46: Fix build on systems with "src" in the path.
1.0.27.31 introduced an actual check that the path for all source
files is correctly externalized as an LPN at cold-init time. Due to a
longstanding bug in MAKE-FILE-INFO-NAMESTRING, not fixed with
1.0.27.31, it is possible for the system to create a pathname such as
"SYS:SRC;LISP;SBCL;SBCL-GIT;OUTPUT;STUFF-GROVELED-FROM-HEADERS.LISP".
Once the SYS: logical pathname translations are set up, this path is
not valid, causing a build failure. Fixed, at the cost of disallowing
paths in SYS:SRC that have a final directory of OUTPUT, not likely to
be an issue in practice.
Richard M Kreuter [Fri, 24 Apr 2009 19:49:15 +0000 (19:49 +0000)]
1.0.27.45: Fix the error signaled in bogus recursive READs.
* CHECK-FOR-RECURSIVE-READ signaled a READER-ERROR without supplying a
stream initarg.
Christophe Rhodes [Fri, 24 Apr 2009 15:56:10 +0000 (15:56 +0000)]
1.0.27.44: genesis fixes
make genesis of identical fasls produce identical cold cores.
4 messages follow:
documentation handling
CLISP supports documentation for packages now, so remove the read-time
conditional. However, don't try to use the documentation for the CL or
KEYWORD packages (as they come from the host directly)
LAYOUT clos hash values
Set them in cold-init using the target's RANDOM rather than in genesis
using the host's.
hash table traversal in genesis
MAPHASH will not give repeatable results in general, and certainly won't
between distinct implementations of hash tables. Sort the contents of
hash tables according to a predicate which completely orders the
contents. (This is mildly tricky for FDEFN names: we have to assume
that we are only dealing with names of the forms SYMBOL and (SETF
SYMBOL)).
give smallvecs an initial element
Whoops. The smallvecs (representing the memory image of the core being
constructed) were being constructed without an initial-element. For the
most part this wouldn't matter, because it will (almost) all be
overwritten by the genesis process itself. The crux is in that
(almost), though; in some cases it matters, such as producing bogus
values for symbol tls slots. Mostly implementations seem to zero-fill
newly-constructed (unsigned-byte 8) arrays, but there seem to be some
circumstances under which CLISP will produce one with random data in
it...
Christophe Rhodes [Fri, 24 Apr 2009 15:37:46 +0000 (15:37 +0000)]
1.0.27.43: constant coalescing agreement fixes
Constant coalescing decisions, legitimately differing between different
hosts, can if not very careful propagate into the target, often through
vop-parse structures. Be explicit in which constants can be shared and
which shouldn't.
5 messages follow:
constant coalescing KLUDGE, part 1 [(any)]
The constant initforms for the vop-parse structure are evaluated on the
host; therefore, their coalescing is at the host's discretion. This
wouldn't matter except that (why?) vop-parse structures get dumped
at each vop definition. Make the coalescedness explicit.
constant coalescing KLUDGE, part 2: [(fixnumize n)]
The static function template for at least LENGTH (in subprim.lisp)
contains two instances of (FIXNUMIZE 2), which are coaelesced
differently on different host lisps. We can KLUDGE around this problem
(and gain a millimetric amount of efficiency, too!) by evaluating the
FIXNUMIZE calls at expansion time.
remove confusing code structure sharing from DEF-MOVE-IF
I can't actually see exactly where the code structure sharing happens
nor why it causes xc fasl contents to differ between hosts, but since
it makes the code clearer to rewrite the macro...
fix two separate issues in compiler/globaldb
One is a hash-table traversal issue; the other is coalescing of
constants. I *think* what's going on in the latter case is that there
are two separate ways that shared constants can happen. One is in the
dumping of objects which are EQUAL, where the compiler can dump a
reference to a previous object instead; the other is the dumping of a
single object with circularities, where a nil is dumped along with a
later instruction to backpatch the circularity in. We need to ensure a
deterministic cold-init-form, so that means we need to control the
coalescing in the _host_ compiler (because the cold-init-form is
generated from introspection), but of course we can't, so we COPY-TREE
instead, which will allow the xc to coalesce and will prevent the form
as compiled from sharing structure.
Static function template vop macro has a common subexpression, factored
out as new-ebp-ea.
Christophe Rhodes [Fri, 24 Apr 2009 15:08:28 +0000 (15:08 +0000)]
1.0.27.42: explicit determinism in the compiler
2 messages follow:
stable-sort the time specifications
Dunno if this is actually necessary for anything.
make unpacking and repacking happen in a determined order
The unpacked blocks were stuffed into a hash table and then maphashed
over; as in other cases, this is host-dependent. Use a list and pushnew
instead.
Christophe Rhodes [Fri, 24 Apr 2009 14:41:54 +0000 (14:41 +0000)]
1.0.27.41: floating point implementation smoothing
To get floating point stuff exactly right, we should build a complete
IEEE float implementation to do calculations in for the cross-compiler.
Since that's not going to happen this millennium, instead try to be
careful when writing code that looks constant-foldable. Some other
fixups on the way...
6 messages follow:
fix load-time tests in src/code/pred
It turns out that #c(1.1 0) is not portable: it's a REAL in clisp and a
COMPLEX in sbcl.
begin work on floats
Floats Are Hard. The issue is that the host's float implementation,
even if it agrees with SBCL that SINGLE-FLOAT is IEEE single and
DOUBLE-FLOAT is IEEE double, may not match sbcl idiosyncracy for
idiosyncracy. For example, clisp doesn't support denormals, so its
LEAST-FOOATIVE-QUUXLE-FLOAT constants are very different from sbcl's:
and sbcl's can't even be represented within the host. Ugh.
Defining the print-related MIN-E constants is, however, easy enough.
comment (well, #!+long-float) out some floating point constants
The clauses in question were never taken absent #!+long-float anyway.
-0.0 is not portable: many lisps don't respect negative zeros
Use make-unportable-float instead, and hope that this doesn't matter
during cross-compilation...
host floating point differences
Not all lisps think (log 2d0 10d0) is the same. Compute it accurately
and use LOAD-TIME-VALUE.
tentative attempt at smoothing over host floating point differences
Compute all the necessary constants as double-float bit patterns using
LOAD-TIME-VALUE.
Christophe Rhodes [Fri, 24 Apr 2009 14:26:30 +0000 (14:26 +0000)]
1.0.27.40: host-invariant string constant coalescing
It took a little time to get right, but here's (I hope) invariant
constant string coalescing in the cross-file-compiler.
3 commit messages follow:
more invariant constant string coalescing
When dumping strings in cross-compilation, we always end up dumping as
base-string. That means we need to compare all strings of whatever
underlying array type for content equality, not just strings of the same
type. This shows up when dumping in the same file "BLOCK" and the value
of (symbol-name 'block) under CLISP, which dumps two separate values.
dumping string constants, the other half
Not only do we have to enter entries into the hash table with a known
element-type, we also have to retrieve them... bogosity finally picked
up by use of a CL symbol name (AND) in src/compiler/x86/insts.lisp...
further refinement on constant coalescing
Not only must we coalesce all kinds of strings at fasl dump time, we
must coalesce the constants in our TN representation while we're
compiling, otherwise we will get different lengths of constant vectors
for the same function depending on how many different string
representations there are in the host compiler.
Gabor Melis [Fri, 24 Apr 2009 13:32:41 +0000 (13:32 +0000)]
1.0.27.39: SIGCHLD related fixes
- WITH-ACTIVE-PROCESSES-LOCK does not allow WITH-INTERRUPTS because
that can lead to recursive lock attempts upon receiving a SIGCHLD.
- if fork() in RUN-PROGRAM fails, signal the error outside the lock.
- the SIGCHLD handler only reaps processes started by RUN-PROGRAM in
order not to interfere with SB-POSIX:WAIT, SB-POSIX:WAITPID and
their C equivalents (thanks to James Y Knight).
- the SIGCHLD handler is installed once at startup, because on Darwin
sigaction() seems to do unexpected things to the current sigmask.
Christophe Rhodes [Fri, 24 Apr 2009 13:27:57 +0000 (13:27 +0000)]
1.0.27.38: make FAILED-AVER use a list form of code
Previously, we constructed a printed version of the code and used that,
but it seems remarkably hard to get identical printed contents from identical
list structure in three different implementations: indentation,
line breaks, QUOTE and FUNCTION, and so on all seem to vary.
2 previous commit messages follow:
bind printer control variables in FAILED-AVER
FAILED-AVER prints source code with ~A. If printer control variables
are different in different implementations, then the error message will
be different.
Actually at the moment the binding (of *PRINT-PRETTY* to T) is probably
a no-op. We tried binding *PRINT-PRETTY* to NIL to get the same output
as XCL, but apparently, other implementations (CLISP, reportedly ECL)
don't obey CLHS 22.1.3.5 for printing conses when the pretty printer is
off.
another attempt to tame AVER
binding printer control variables is all well and good, but linebreaks
cause problems. We could probably deal with that with a suitable value
for *pprint-right-margin*, but... instead, just save the form, not its
printed representation.
Christophe Rhodes [Fri, 24 Apr 2009 13:11:22 +0000 (13:11 +0000)]
1.0.27.37: fix host constant leaks
Various ways in which a host constant can leak through the
cross-compiler into the target are plugged.
5 commit messages follow:
fix host most-positive-fixnum leak in declaration
Found by comparing object code for SORT-VECTOR between clisp and sbcl xc
hosts.
Fix most-fooative-fixnum leak in number-psxhash
Gah, floats. Most cases will be more complicated to fix than this one.
(Fixing things absolutely properly would be hugely difficult; this fix
should do for now...)
more careful cross-compiler constant-form-value
We need to take values from the xc info database in preference to using
SYMBOL-VALUE, otherwise we'll leak from the host. (In particular, this
one was for function in debug.lisp with lambda lists of the
form (&optional (n most-positive-fixnum))
deal with another host fixnum-related constant leak
This time it's in the definition of the integer constants which are both
fixnums and exactly representable as floats. Amazingly, just above
these definitions are the ones for SB!XC:MOST-POSITIVE-FIXNUM and
friends; no alarm bells were ringing...
fix a fixnum leak in unix-fd type
This mistake [ (deftype foo () `(integer 0 ,most-positive-fixnum)) ]
seems distressingly easy to make. Not easy to guard against, either.
(Aside: is it sensible to define FDs as positive fixnums?)
Christophe Rhodes [Fri, 24 Apr 2009 12:46:38 +0000 (12:46 +0000)]
1.0.27.36: host CL symbols with other home packages
Genesis already knew about the case of a symbol exported from the CL
package with a different home package. For repeatable FASLs, the dumper
and the xref internals detector also need to know.
2 commit messages follow:
special case dumping of CL symbols with other home packages
Just like in genesis, we need to deal with CL symbols which are
permitted to have a home package that's not CL. SBCL doesn't do that,
but other implementations legitimately can and do; nevertheless, dump
as though it were a CL symbol.
xref cross-compilation consistency fixes
Treat as internal symbols (a) symbols with home package being "SB-XC",
and (b) symbols which are external in the CL package but whose home
package is elsewhere.
Christophe Rhodes [Fri, 24 Apr 2009 11:57:13 +0000 (11:57 +0000)]
1.0.27.35: minimize the potential for presenting hosts with choices
By having minimal debug names for toplevel forms and component names, we
avoid having arbitrary gensyms or, horror of horror, QUOTE: which is
printed differently in different implementations...
2 commit messages follow:
minimal debug names for cross-compiled top-level forms
Otherwise we run the risk of getting arbitrary gensyms dumped as part of
the debug name.
bandage for ' vs QUOTE in two files
Make FIND-COMPONENT-NAME in the XC (which names components, whose names
are dumped in xc fasls) use only the first symbol in the context. That
will be generally lame but avoids any current instances of QUOTE, which
prints differently in different implementations when pretty-printing is
off.
Christophe Rhodes [Fri, 24 Apr 2009 11:38:10 +0000 (11:38 +0000)]
1.0.27.34: various trivial fixups for portability / repeatability
The only one that is potentially controversial is the use of
READ-PRESERVING-WHITESPACE...
3 commit messages follow:
don't print array SB!KERNEL:TYPE in internal error strings
Use the specifier instead. (This is a long-standing bug; FIXME: try to
find a test case).
Use read-preserving-whitespace rather than just read in the compiler
With just CL:READ, at least CLISP and SBCL differ on the source
locations dumped in the fasls; with READ-PRESERVING-WHITESPACE, things
are consistent.
disassembler / printer names.
The compiler wants to generate names based on all sorts of information,
including byte specs, and attempts to make those names by printing all
that information into one big string. Unfortunately, that allows the
host to insert line breaks, which it will do with maximal perversity.
Bind *PRINT-RIGHT-MARGIN* around the printing call in an attempt to
minimize this problem.
Christophe Rhodes [Fri, 24 Apr 2009 11:11:17 +0000 (11:11 +0000)]
1.0.27.33: make various form orders deterministic
Usually involves sorting the output of a hash-table loop or set
operation.
3 commit messages follow:
make the order of (setf cl:foo) defining forms deterministic
alphabetize the automated out-of-line definitions of modular functions
Otherwise we go in hash-table order, which is not noticeably the same
between clisp and sbcl hosts.
UNION can return entries in arbitrary order
So SORT [a copy of: don't mutate the source code!] the UNION of
signed-num and unsigned-num by symbol name.
Christophe Rhodes [Fri, 24 Apr 2009 10:44:08 +0000 (10:44 +0000)]
1.0.27.32: implement and use SB!XC:GENSYM
We need a gensym variant that doesn't share state with *GENSYM-COUNTER*,
so that host macroexpansions don't affect us. (We also need to bind our
counter variant in the INFO compiler macro, because compiler macros
might or might not be expanded...)
11 individual commit messages follow:
Implement SB!XC:GENSYM
Host implementations can, even during cross-compilation, expand macros
(including arbitrary host macros such as CL:DEFUN) in :compile-toplevel
function definitions different numbers of times. This is a problem
because some gensyms end up in function arglists (e.g. from
MULTIPLE-VALUE-BIND as well as from explicit FLETs or LAMBDAs in macro
expansions). Our own SB!XC:GENSYM allows us to control the gensym
counter we use and hence the symbol names that are dumped.
Use SB!XC:GENSYM in BLOCK-GENSYM
remove a needless gensym
Nothing wrong with a regular symbol here.
Bind SB!XC:*GENSYM-COUNTER* in DEFINE-COMPILER-MACRO INFO
The compiler-macro for INFO now uses SB!XC:GENSYM, which is OK except
that the compiler macro gets used during cross-compilation; some
implementations expand compiler macros, while others (e.g. clisp)
interpret the relevant code and so don't. Binding the counter
variable renders the effect of the compiler macro on the counter
invariant.
various reworks of macros to use SB!XC:GENSYM
In some cases radically decrease vertical space use by judicious use of
MAKE-GENSYM-LIST or WITH-UNIQUE-NAMES, both of which go through
BLOCK-GENSYM.
more reworks of macros to use SB!XC:GENSYM
Nothing vastly interesting here.
yet more reworks of macros to use SB!XC:GENSYM
Nothing much of interest.
even more reworks of macros to use SB!XC:GENSYM
more reworks of macros for SB!XC:GENSYM goodness.
one more SB!XC:GENSYM fix
Use WITH-UNIQUE-NAMES in FD-FOO macros.
One more gensym
Christophe Rhodes [Fri, 24 Apr 2009 10:06:20 +0000 (10:06 +0000)]
1.0.27.31: repeatable fasl header and debug-source
The fasl header is easy to deal with; writing "at cross-compile time"
instead of something depending on the host is easy. The debug-source is
harder; we set the structure slots to 0 in the cross-compiler, and
arrange for cold-init to patch sensible values in (by inventing a new
FOP to note the debug-source's arrival).
made up of 5 commits, whose individual messages follow:
deal with trivial volatile contents of fasl files
Don't try to preserve, even in the header, information about which
implementation or machine was used for the compilation.
Similarly, don't emit the timestamps in the debug-source into the fasls.
comments: delete a FIXME and explain a bare `2'
consistent source pathname for output/stuff-groveled-from-headers.lisp
At the moment it's the only compiled file not in src/; code defensively
around that fact.
fix a longstanding KLUDGE
Find the index of the source slot by introspection rather than using a
baffling literal `2'. Unfortunately, in doing so we run into bug #117.
patch in the source created/compiled information in cold-init
We can't do it before without making our fasls or cold-sbcl.core
dependent on filesystem timestamps or current time. The way we do it is
perhaps overcomplicated, compared with simply assuming that the file
timestamps are right, but has the advantage that it's demonstrably
correct: we implement a new FOP specifically for noting our
DEBUG-SOURCE, dumped only during cross-compilation, and in genesis we
interpret that FOP to build a list of debug-sources, which we can frob
in cold-init.
Everything should now be restored to its previous functionality.
Nathan Froyd [Thu, 23 Apr 2009 23:37:43 +0000 (23:37 +0000)]
1.0.27.30: minor octets.lisp cleanup
* fix typo to inline result of DEFINE-LATIN->STRING;
* manually inline and remove VARIMAP, since it only had only caller.
Should result in faster code, although the disassembly on x86 looks
fairly ugly...
Nikodemus Siivola [Thu, 23 Apr 2009 15:03:28 +0000 (15:03 +0000)]
1.0.27.29: funcallable instance source locations
* Thanks to Paul Khuong.
Nikodemus Siivola [Thu, 23 Apr 2009 14:19:09 +0000 (14:19 +0000)]
1.0.27.28: better source paths for malformed declaration errors
* For Slime and their ilk, thanks to Tobias Rittweiler.
* Sort NEWS with "more important" items on top.
Nathan Froyd [Thu, 23 Apr 2009 13:28:55 +0000 (13:28 +0000)]
1.0.27.27: micro-optimize COERCE *->vector and vector->list
* sprinkle type declarations around to avoid checking for general SEQUENCEs;
* use >= in loop exit tests to avoid checks for overflow.
Nikodemus Siivola [Thu, 23 Apr 2009 12:26:56 +0000 (12:26 +0000)]
1.0.27.26: fix invalid array index reporting for compiled code
* Index and bound were swapped around.
* Also fix the name in the type declamation for INVALID-ARRAY-INDEX-ERROR.
Thanks to Stas Boukarev.
Nikodemus Siivola [Thu, 23 Apr 2009 11:59:23 +0000 (11:59 +0000)]
1.0.27.25: clean up stray close paren
* Reported by Robin 'Hawkeye' Powell.
Nikodemus Siivola [Thu, 23 Apr 2009 11:21:16 +0000 (11:21 +0000)]
1.0.27.24: robustify DEFPACKAGE form pretty-printing
* Thanks to Sidney Markowitz.
* A few missing NEWS entries.
Nikodemus Siivola [Wed, 22 Apr 2009 20:14:09 +0000 (20:14 +0000)]
1.0.27.23: fix bashism in sbcl-pwd.sh
* OSTYPE might not be set in a non-bash shell.
Nikodemus Siivola [Wed, 22 Apr 2009 20:11:05 +0000 (20:11 +0000)]
1.0.27.22: better signaling from MAKE-STATIC-VECTOR
* Patch by Daniel Lowe.
Nikodemus Siivola [Wed, 22 Apr 2009 19:15:06 +0000 (19:15 +0000)]
1.0.27.21: more careful (SETF DOCUMENTATION) for functions
* Use VALID-FUNCTION-NAME-P to check if we should store the docstring:
previously we stored docstrings for anonymous functions under names
like (LAMBDA (X)) -- Not Good.
Nikodemus Siivola [Wed, 22 Apr 2009 19:09:30 +0000 (19:09 +0000)]
1.0.27.20: lutex-wait don't yet support deadlines
* One test depends that, skip it for now on lutex builds to avoid a
hang.
Richard M Kreuter [Wed, 22 Apr 2009 18:51:21 +0000 (18:51 +0000)]
1.0.27.19: Restore variable access in debugger REPL.
* Contributed by Alex Plotnick <plotnick@cs.brandeis.edu>
Richard M Kreuter [Wed, 22 Apr 2009 15:42:41 +0000 (15:42 +0000)]
1.0.27.18: Changes to ECHO-STREAMs
* Bugfix: PEEK-CHAR always popped the unread-stuff, leading to
spurious duplicate echos in some cases.
* Minor incompatible change: UNREAD-CHAR on an ECHO-STREAM now unreads
onto the echo-stream's input stream. This is unspecified in the
CLHS, but makes SBCL compatible with most implementations (AFAICT,
everybody but CMUCL).
* Minor incompatible change: echo-streams used to buffer arbitrarily
many characters in UNREAD-CHAR. Conforming programs can't have
relied on this, but non-conforming ones might have; users who need
the old CMUCL/SBCL behavior can do it easily and de-facto-portably
with Gray Streams.
* Possible bugfix that nobody cares about: ECHO-N-BIN (which
implements a path through READ-SEQUENCE) can never have worked after
an UNREAD-CHAR, because it tried to store characters into an octet
buffer.
Gabor Melis [Tue, 21 Apr 2009 11:33:38 +0000 (11:33 +0000)]
1.0.27.17: faster local calls on x86/x86-64
Instead of JMPing to TARGET, CALL a trampoline that saves the return
pc and jumps. Although this is an incredibly stupid trick, the paired
CALL/RET instructions are a big win.
Gabor Melis [Tue, 21 Apr 2009 11:30:38 +0000 (11:30 +0000)]
1.0.27.16: slightly smaller LISTIFY-REST-ARGS on x86/x86-64
Gabor Melis [Tue, 21 Apr 2009 11:28:46 +0000 (11:28 +0000)]
1.0.27.15: optimize multiple values recievers on x86/x86-64
... by not emitting unreachable instructions.
Gabor Melis [Tue, 21 Apr 2009 11:25:51 +0000 (11:25 +0000)]
1.0.27.14: bias x86oid frame pointer
Forward port of Alastair Bridgewater's patch.
Duplicate it on x86-64.
Make it so that fp points to ocfp just as if the call had been made by
CALL to a function with the standard prologue "PUSH EBP; MOV ESP,
EBP".
Fix the debugger.
Gabor Melis [Tue, 21 Apr 2009 10:26:05 +0000 (10:26 +0000)]
1.0.27.13: more RET on x86oids
With 0, 2 or 3 values return with idiomatic "POP EBP; RET".
Gabor Melis [Tue, 21 Apr 2009 10:25:04 +0000 (10:25 +0000)]
1.0.27.12: x86/x86-64 calling convention comments, refactoring
Gabor Melis [Tue, 21 Apr 2009 10:24:15 +0000 (10:24 +0000)]
1.0.27.11: swap ocfp and return-pc slots in x86oid call frames
Forward port of Alastair Bridgewater's patch. Also, port it to x86-64.
Bring x86 and x86-64 sources closer in the process.
Plus cleanups, indentation, remove dead code, comments, more checks.
Gabor Melis [Tue, 21 Apr 2009 07:33:10 +0000 (07:33 +0000)]
1.0.27.10: fix call_into_lisp return value on x86-64
Christophe Rhodes [Mon, 13 Apr 2009 21:24:31 +0000 (21:24 +0000)]
1.0.27.9: fix print-object cache handling
1.0.25.50 exposed a bug in the print-object discriminating
function: we need to have the methods for critical printing at
all times, but the implementation allowed other methods into
that initial cache, which was wrong if those methods
were subsequently invalidated. The fix is to keep the initial
cache pristine and to use only copies in the print-object
generic function itself.
Gabor Melis [Mon, 13 Apr 2009 20:00:21 +0000 (20:00 +0000)]
1.0.27.8: slightly faster x86oid pseudo atomic with {e,r}bp
Trusting that within SBCL ebp is even and that it doesn't change
within a pseudo atomic section it's possible to use it to set and
clear pseudo atomic bits. It is ever so slightly faster (about 0.5%
overall on cl-bench on a P4).
Alastair Bridgewater [Sun, 12 Apr 2009 14:03:08 +0000 (14:03 +0000)]
1.0.27.7: Win32 build fix
On Win32, the default cross-compilation host is SBCL with a --sysinit
NUL --userinit NUL. Unfortunately, SBCL itself doesn't recognize NUL
as a valid filename as it's actually a DOS device name and there's a
separate API to check for them. The least losing workaround is to use
a real file with known-harmless content for userinit and sysinit, and
the simplest choice is version.lisp-expr. This changes makes it
possible to build on Win32 without specifying a host lisp.
Alastair Bridgewater [Sat, 11 Apr 2009 18:19:08 +0000 (18:19 +0000)]
1.0.27.6: Make alien-type-class definition work from outside sb-alien.
Added a slot to the alien-type-class structure to hold the name of
the structure for the class.
Added the class structure name as a parameter to
create-alien-type-class-if-necessary in order to populate the slot in
the new alien-type-class structure.
Changed define-alien-type-class to look up included alien type
defstruct names in the alien-type-class for the included type rather
than construct it via SYMBOLICATE (thus breaking the requirement that
all uses of define-alien-type-class be in the sb-alien package).
Gabor Melis [Wed, 8 Apr 2009 16:04:02 +0000 (16:04 +0000)]
1.0.27.5: fix compilation on windows
Thanks to Bart Botta.
Gabor Melis [Tue, 7 Apr 2009 13:04:14 +0000 (13:04 +0000)]
1.0.27.4: x86/x86-64 REP prefix has the same code as REPE (not REPNE)
... although it seems to work either way.
Gabor Melis [Tue, 7 Apr 2009 13:00:35 +0000 (13:00 +0000)]
1.0.27.3: fix UNWIND-TO-FRAME-AND-CALL
Gabor Melis [Mon, 6 Apr 2009 08:54:27 +0000 (08:54 +0000)]
1.0.27.2: fix bug in heap implementation
... used by timers.
Thanks to Ole Arndt for the patch.
Richard M Kreuter [Sat, 4 Apr 2009 01:05:52 +0000 (01:05 +0000)]
1.0.27.1: Fix binary input after UNREAD-CHAR on bivalent streams.
* After an UNREAD-CHAR, READ-BYTE returned a character, and
READ-SEQUENCE with an octet buffer failed when trying to store a
character into the buffer.
Richard M Kreuter [Thu, 2 Apr 2009 21:46:34 +0000 (21:46 +0000)]
release, will be tagged as sbcl_1_0_27
Juho Snellman [Fri, 27 Mar 2009 00:39:39 +0000 (00:39 +0000)]
1.0.26.22: Revert 1.0.26.12
* And add testcase showing why the revert was needed.
Gabor Melis [Tue, 24 Mar 2009 14:44:09 +0000 (14:44 +0000)]
1.0.26.21: fix ERROR leaking memory
Make *COMPILED-DEBUG-FUNS* a weak keyed hash table. Add test.
Christophe Rhodes [Mon, 23 Mar 2009 11:59:48 +0000 (11:59 +0000)]
1.0.26.20: tighter VECTOR-PUSH-EXTEND argument type
The optional extension parameter must be a positive integer.
... declare this in fndb;
... fix the erroneous use in constraints (not only ensuring
positivity, but also it's an extension not a new-length
parameter).
Issue brought to light by Peter Graves' XCL.
Gabor Melis [Mon, 23 Mar 2009 11:26:51 +0000 (11:26 +0000)]
1.0.26.19: more stack safety
Add another guard page to the control, binding and alien stacks that
will lose() whenever it's touched so that if the handler manages to
recover from stack exhaustion then we can be sure that image is not
corrupted.
Juho Snellman [Sun, 22 Mar 2009 22:34:58 +0000 (22:34 +0000)]
1.0.26.18: Solaris x86-64 support
* Patch by Alex Viskovatoff
Gabor Melis [Sun, 22 Mar 2009 22:06:03 +0000 (22:06 +0000)]
1.0.26.17: fix GC/SIG_STOP_FOR_GC race
Consider this: in a PA section GC is requested: GC_PENDING,
pseudo_atomic_interrupted and gc_blocked_deferrables are set,
deferrables are blocked then pseudo_atomic_atomic is cleared, but a
SIG_STOP_FOR_GC arrives before trapping to interrupt_handle_pending.
In sig_stop_for_gc_handler, GC_PENDING is cleared but
pseudo_atomic_interrupted is not and we go on running with
pseudo_atomic_interrupted but without a pending interrupt or GC.
GC_BLOCKED_DEFERRABLES is also left at 1.
Add more checks, fix comments.