Paul Khuong [Thu, 14 Nov 2013 20:15:38 +0000 (15:15 -0500)]
More meaningful error message for OPEN :IF-EXISTS :NEW-VERSION
We don't try to simulate versioned filesystems on top of standard
UNIX operations, because that would be lossy. Now explained more
explicitly.
Based on a patch by Philip Munksgaard, fixes lp#455381.
Paul Khuong [Thu, 14 Nov 2013 22:12:57 +0000 (17:12 -0500)]
More reliable test for asynchronous aborts in semaphore operations
Test case by Andreas Franke (lp#1038034, comment #17). We'll see
about committing the somewhat hairy fix for CONDITION-WAIT in #16
some other time.
Paul Khuong [Thu, 14 Nov 2013 21:51:18 +0000 (16:51 -0500)]
New function SB-EXT:ASSERT-VERSION->=
Executing (sb-ext:assert-version->= 1 1 13) signals a continuable
error if the running SBCL is older than 1.1.13 (and an undefined
function error before that).
Based on a patch by Philip Munksgaard.
Closes lp#674372.
Paul Khuong [Thu, 14 Nov 2013 19:22:47 +0000 (14:22 -0500)]
Tail call (exec) at the end of run-sbcl.sh
exec-ing into the runtime executable doesn't hurt and helps rlwrap.
Suggested by William Cushing (lp#1249183).
Stas Boukarev [Wed, 13 Nov 2013 11:34:58 +0000 (15:34 +0400)]
sb-sprof: Move tests into test.lisp.
Instead of having tests in sb-sprof.lisp and running them from
test.lisp, move everything into test.lisp.
Cyrus Harmon [Tue, 12 Nov 2013 22:10:59 +0000 (14:10 -0800)]
remove asdf-install contrib
Stas Boukarev [Tue, 12 Nov 2013 14:40:23 +0000 (18:40 +0400)]
Fix typos in docstrings and function names.
Includes an incompatibility change, sb-thread:thread-eMphemeral-p has
a typo, but it doesn't appear to be used anywhere outside of SBCL.
Douglas Katzman [Mon, 11 Nov 2013 22:53:37 +0000 (17:53 -0500)]
Add test for my commit 0e8649... of last week
Stas Boukarev [Mon, 11 Nov 2013 11:13:51 +0000 (15:13 +0400)]
win32: provide error messages when loading foreign libraries.
Decode the error codes into messages.
Stas Boukarev [Sun, 10 Nov 2013 18:26:17 +0000 (22:26 +0400)]
More robust homedir detection on Windows.
After consulting HOME, try USERPROFILE, then HOMEDRIVE+HOMEPATH.
Fixes lp#922117.
Stas Boukarev [Sun, 10 Nov 2013 15:59:35 +0000 (19:59 +0400)]
Fix merging of ~/ pathnames.
Don't merge the device component if the resulting pathname starts with
:absolute :home. The expansion of ~ may contain it's own device,
causing problems, especially on Windows, where
(merge-pathnames "~/") => c:C:\Users\user.
Douglas Katzman [Fri, 8 Nov 2013 21:08:46 +0000 (16:08 -0500)]
Eliminate "unused variable" warning from ARRAY-ROW-MAJOR-INDEX
Stas Boukarev [Fri, 8 Nov 2013 20:26:44 +0000 (00:26 +0400)]
Don't warn when #'(setf fun) is used in the presence of a setf-macro.
Warn only when defining such a function, not when using it.
Reported by Douglas Katzman.
Stas Boukarev [Thu, 7 Nov 2013 22:47:41 +0000 (02:47 +0400)]
Optimize testing of sealed structures.
Don't check for the layout validity, redefining structures is
undefined, and the non-sealed case doesn't check for it already.
Stas Boukarev [Thu, 7 Nov 2013 22:45:12 +0000 (02:45 +0400)]
Optimize RESTART-BIND.
Change MAKE-RESTART lambda-list to
(name function
&optional report-function interactive-function test-function)
instead of using the default structure constructor with keywords.
MAKE-RESTART is only used in RESTART-BIND, and this allows for more
compact calls and not having to parse keyword parameters should
make the code slightly faster.
Stas Boukarev [Thu, 7 Nov 2013 22:26:47 +0000 (02:26 +0400)]
Optimize RESTART-CASE.
Optimize a case when restart handlers have zero or one arguments:
instead of saving a &rest list and then applying a function, don't
save anything, or save one argument and use FUNCALL.
Based on a patch by Jan Moringen.
Closes lp#1249055.
Stas Boukarev [Thu, 7 Nov 2013 20:02:16 +0000 (00:02 +0400)]
sbcl-pwd.sh: Fix when $OSTYPE is not set.
Stas Boukarev [Wed, 6 Nov 2013 18:39:31 +0000 (22:39 +0400)]
Fix equality between #p"~" and (user-homedir-pathname) on Win32.
Don't use user-homedir-namestring on the windows version of
native-namestring, since the home directory can be specified as
C:/User/user, use (native-namestring (user-homedir-pathname)), which
will get C:\\User\\user\\ instead, making (native-namestring "~/") and
(native-namestring (user-homedir-pathname)) equal.
Stas Boukarev [Wed, 6 Nov 2013 17:20:21 +0000 (21:20 +0400)]
Disable win32 pathnames routines on -win32 and vice versa.
#-win32 has all the win32 pathname code enabled, but it's not used
anywhere and not exported. Even if using pathnames of a different OS
may be a good idea, it's currently not presented in any usable way and
only wastes space.
Stas Boukarev [Wed, 6 Nov 2013 17:11:53 +0000 (21:11 +0400)]
Fix contrib building on mingw.
The current directory has to be found out using pwd -W, to avoid any
conversion into unix-looking pathnames.
Stas Boukarev [Wed, 6 Nov 2013 00:46:26 +0000 (04:46 +0400)]
Remove get2 variant of get.
(get x y [z]) was expand into (get3 x y z) or (get2 x y), and get2
called (get3 x y nil), just expand into (get3 x y nil) directly.
Stas Boukarev [Tue, 5 Nov 2013 15:56:00 +0000 (19:56 +0400)]
Optimize raw-instance-slots-equalp for #-complex-float-vops.
The comparer function for COMPLEX types wasn't properly optimized
during cross-compilation because the types of REALPART and IMAGPART
weren't derived by the cross-compiler on account of
CROSS-FLOAT-INFINITY-KLUDGE, but the derivers do not actually perform
any mathematical derivation, just
(complex (double-float 10d0)) => (double-float 10d0).
Enabling them during cross-compilation allows = on complex floats be
optimized and avoids consing.
Stas Boukarev [Tue, 5 Nov 2013 13:48:03 +0000 (17:48 +0400)]
Fix lose() invocation inside sparc-arch.c
Stas Boukarev [Mon, 4 Nov 2013 22:52:37 +0000 (02:52 +0400)]
Optimize EQUALP on structures with raw slots.
Add a comparer slot to raw-slot-data, which is defined as
(lambda (index x y)
(= (%raw-instance-ref/double x index)
(%raw-instance-ref/double y index)))
Which is both faster than calling %raw-instance-ref/double out of
line and does not cons.
Paul Khuong [Mon, 4 Nov 2013 18:55:10 +0000 (13:55 -0500)]
[N]BUTLAST perform a single pass over the list
The old code would first count the number of conses, and then
SUBSEQ/(RPLACD/NTHCDR). Instead traverse the list with two offset
pointers that advance in lockstep.
Based on a patch by Johan Andersson, on lp#1245697.
Paul Khuong [Thu, 24 Oct 2013 02:36:17 +0000 (22:36 -0400)]
More complicated TYPEP tests are marginally transparent to type propagation
Expansions for TYPEP are wrapped in %typep-wrapper, a fancy identity. The
additional arguments track what value is being tested for what type, which
helps inform constraint propagation, as well as detecting redundant type
tests.
Such a wrapper is a hindrance to lower level control flow rewriting that are
essential for decent code generation. After a single pass of constraint
propagation, the wrapper evaporates and the TYPEP expansion becomes as opaque
as it is now.
Paul Khuong [Thu, 24 Oct 2013 02:34:37 +0000 (22:34 -0400)]
Two new optimizer types for flow-sensitive type propagation
CONSTRAINT-PROPAGATE optimizers can add new information about the
state of the world after/if the function has returned. Function
type declarations/propagation suffice for simple patterns (e.g.
return types, or unconditional type requirements on arguments),
but this optimizer is more general.
Such optimizers receive two arguments, the combination node and the
current set of constraints, and return a sequence of constraints.
Constraints are lists of three or four values:
1. a constraint kind (either TYPEP, <, >, or EQL);
2, 3. two arguments, either LVARs, LAMBDA-VARs or a CTYPE;
4. optionally, whether the meaning of the constraint must be
flipped.
This mimics the (defstruct (constraint ...)) in constraint.lisp.
If any of the argument is NIL, the constraint is skipped; otherwise,
it is added to current set of constraints. Optimizers have access
to that set, and can thus map LVARs to LAMBDA-VARs thanks to
OK-LVAR-LAMBDA-VAR.
CONSTRAINT-PROPAGATE-IF optimizers can instead hook into the
interpretation of functions as predicate, when their result feeds
into an IF node. They also receive the node and the current set
of constraints as arguments, and return four values. The first two
values are an LVAR and a CTYPE: if they are non-NIL, that LVAR is
of that CTYPE iff the combination returns true. The two remaining
values are sequences of constraints (see previous paragraph) for
the consequent (if-true) and alternative (if-false) branches,
respectively. These are useful for more complex tests, but also
to represent partial information, e.g., if an EQUAL test fails,
the two values are not EQL either.
Stas Boukarev [Mon, 4 Nov 2013 12:41:59 +0000 (16:41 +0400)]
Fix foreign-stack-alignment test on SPARC.
Stas Boukarev [Sun, 3 Nov 2013 21:18:01 +0000 (01:18 +0400)]
Fix raw-instance-slots-equalp on SPARC.
Some slots have to be aligned or they will cause a bus error. Take
alignment into account on #-(or x86 x86-64 ppc).
Stas Boukarev [Sun, 3 Nov 2013 19:32:09 +0000 (23:32 +0400)]
Fix EQUALP on structures with raw slots.
It always incremented the index by 1, even if slot takes up more than
one word. Increment by raw-slot-data-n-words.
Christophe Rhodes [Sun, 3 Nov 2013 16:32:49 +0000 (16:32 +0000)]
fix LET* environment semantics in sexp-based evaluator
Stas Boukarev [Sun, 3 Nov 2013 15:09:04 +0000 (19:09 +0400)]
Fix undefined function error on SPARC.
Adjust the register encoding in sparc-assem.S.
Thanks to John Long for providing access to a SPARC machine.
Stas Boukarev [Sun, 3 Nov 2013 10:57:06 +0000 (14:57 +0400)]
Fix run-tests.sh on Solaris.
Stas Boukarev [Sat, 2 Nov 2013 13:39:50 +0000 (17:39 +0400)]
Adjust the recent defmethod change.
(compile-or-load-defgeneric name) doesn't need the full eval-when
repertoire, only :compile-toplevel and :execute. :compile-toplevel for
subsequent forms and :execute for references within the body of
defmethod to itself. :load-toplevel is not needed since when the FASLs
are loaded no further processing is performed, this avoids the size
increase of the resulting FASLs.
Stas Boukarev [Fri, 1 Nov 2013 12:47:38 +0000 (16:47 +0400)]
Add --help to run-tests.sh.
Stas Boukarev [Fri, 1 Nov 2013 12:34:27 +0000 (16:34 +0400)]
tests: better reports when /bin/ed is not present.
When /bin/ed is not present the test failed with a confusing "unhandled
error".
* Wrap the whole run-program-ed test into with-test, renaming it to run-program-/bin/ed.
* Add before it a test named :is-/bin/ed-installed?.
Making the report more self-describing:
Failure: run-program.impure.lisp / IS-/BIN/ED-INSTALLED?
Failure: run-program.impure.lisp / RUN-PROGRAM-/BIN/ED
Stas Boukarev [Fri, 1 Nov 2013 11:50:55 +0000 (15:50 +0400)]
defmethod: make the function known at compile time.
(defmethod gf ())
(defun f () (gf))
Produced a warning about an undefined function, even though it would
be implicitly created by defmethod.
Fixes lp#503095.
Stas Boukarev [Thu, 31 Oct 2013 18:57:24 +0000 (22:57 +0400)]
Remove *static-foreign-symbols* from #+sb-dynamic-core builds.
Stas Boukarev [Thu, 31 Oct 2013 14:47:09 +0000 (18:47 +0400)]
Fix defmethod arglists leaking into make-method-lambda.
defmethod communicates to make-method-lambda using special variables,
but make-method-lambda then performs code-walking which expands
macros, and if a macro calls another make-method-lambda directly, this
make-method-lambda will receive incorrect information which may cause
problems with wrong lambda lists.
Reported and diagnosed by Attila Lendvai.
Stas Boukarev [Thu, 31 Oct 2013 14:44:55 +0000 (18:44 +0400)]
describe: show the same information about functions for 'x and #'x.
Declared type and information about inlining were not shown when used
as #'function.
Christophe Rhodes [Thu, 31 Oct 2013 14:44:00 +0000 (14:44 +0000)]
Fix install/binary-distribution scripts for new contrib arrangements
Everything has moved, which led the binary-distribution script not to
include test-passed files, and the install script to look for them in
the wrong place anyway.
Christophe Rhodes [Thu, 31 Oct 2013 10:42:43 +0000 (10:42 +0000)]
1.1.13: will be tagged as "sbcl-1.1.13"
Paul Khuong [Sat, 26 Oct 2013 17:18:23 +0000 (13:18 -0400)]
Make sure quantifiers don't cons
Quantifiers like SOME and EVERY are implemented in terms of (MAP NIL)
of a wrapper function with early RETURN. If type information does not
enable MAP to be open coded, declarations are necessary to avoid
consing up a closure and a value cell for the return.
DX functions really shouldn't cause value cells for return blocks.
Also, revert
d0f65b07a30adc989e36a82ddc0ed54d135d638e which is
now mostly redundant.
Stas Boukarev [Sat, 26 Oct 2013 14:42:22 +0000 (18:42 +0400)]
Reduce consing during SUBTYPEP on classes.
sb-pcl::class-has-a-forward-referenced-superclass-p, used in the
implementation of subtypep on classes, conses because SOME can't
perform the required inlining when used on the sequences of unknown
type. (See lp#1070635)
Jan Moringen [Fri, 20 Sep 2013 20:49:11 +0000 (22:49 +0200)]
Use new MAP-RESTARTS in FIND-RESTART, COMPUTE-RESTARTS; fix FIND-RESTART
* Both FIND-RESTART and COMPUTE-RESTARTS traverse, filter and select
active restarts, potentially for a particular condition and
potentially calling restart test functions. This common behavior has
been factored into the new function MAP-RESTARTS.
* Remove *CONDITION-RESTARTS*; use new slot ASSOCIATED-CONDITIONS in
RESTART structure instead.
* As stated in bug 774410, when given a RESTART instance, FIND-RESTART
did not test whether the restart was still active and whether the
restart had been associated to a different condition in the
meantime. This behavior has been changed by calling MAP-RESTARTS which
checks activity and association to conditions (sadly, making
(find-restart RESTART-INSTANCE CONDITION-OBJECT)
a bit slower than before).
* INVOKE-RESTART is also affected by the changes for bug
774410. However, it does not respect restart test functions when
called with a RESTART instance (This is underspecified in CLHS and
other implementations behave in various ways. However, behaving
differently would make some restarts un-invokable).
* As suggested in bug 769615, (find-restart SYMBOL ...) now calls
MAP-RESTARTS instead of COMPUTE-RESTARTS, consing less and executing
faster in many cases.
* New (find-restart :recheck-conditions-and-tests :bug-774410) test from
Jean-Philippe Paradis from original bug report in
tests/condition.impure.lisp checks the new behavior.
Fixes lp#769615, lp#774410
Jan Moringen [Fri, 20 Sep 2013 20:19:30 +0000 (22:19 +0200)]
Make some RESTART slots read-only
The RESTART slots FUNCTION, REPORT-FUNCTION, INTERACTIVE-FUNCTION and
TEST-FUNCTION are never mutated and can thus be read-only.
Jan Moringen [Fri, 20 Sep 2013 20:15:53 +0000 (22:15 +0200)]
Comments and rearrangements in {defboot,target-error}.lisp
Add and/or extend explanatory comments for the special
variables *HANDLER-CLUSTERS*, *RESTART-CLUSTERS*
and *CONDITION-RESTARTS*.
Slightly rearranged RESTART-NAME and RESTART-REPORT.
Jan Moringen [Sat, 23 Mar 2013 12:04:35 +0000 (13:04 +0100)]
Silence some unused variable warnings in tests/condition.[im]pure.lisp
Christophe Rhodes [Mon, 21 Oct 2013 11:41:35 +0000 (12:41 +0100)]
fix symlink handling (generally and on OS X) in run-sbcl.sh
Patch from Stelian Ionescu, lp#1242643
Christophe Rhodes [Mon, 21 Oct 2013 11:15:04 +0000 (12:15 +0100)]
signal errors for bad initialization of slot definitions
In order to get slot definition initialization right, move the
readers/writers slots to direct slot definitions, and write code to
detect all the bad cases documented in the MOP dictionary at
initialization time. Condition slots also need changing, to have
separate initform and initfunction information. Moving the slots
breaks metacircle resolution, naturally, so rewrite that to find the
relevant reader/writer information from the direct slots at runtime.
The irony of having to rewrite metacircle detection and resolution for
a bug tagged "easy" on launchpad is not lost on me.
Originally reported by Bruno Haible at some point in prehistory,
probably around December 2004, lp#309072.
Paul Khuong [Sat, 19 Oct 2013 21:47:47 +0000 (17:47 -0400)]
Warn when wrapping constants with THE of multiple value types
IR1 translation was too eager in eliminating redundant THE forms
when the value is a constant. We now also make sure that the
asserted type accepts single values.
Reported by Nathan Trapuzzano on sbcl-help.
Stas Boukarev [Fri, 18 Oct 2013 11:18:36 +0000 (15:18 +0400)]
Remove duplicate implementations of (setf aref/sbit/bit).
Since (setf aref/sbit/bit) have to work with
(setf (apply #'aref array subscripts)), they had both a setf expander
and a setf-function, but it can be implemented with just a
setf-function. All other accessors are still done using
(defsetf accessor %setaccessor), I haven't found a technical reason to
prefer one to another, other than (setf accessor) being a nicer name.
Fixes lp#1241095.
Stas Boukarev [Thu, 17 Oct 2013 16:53:18 +0000 (20:53 +0400)]
Add some missing FNDB declarations.
Stas Boukarev [Thu, 17 Oct 2013 15:16:41 +0000 (19:16 +0400)]
Stop (describe (make-instance 'generic-function)) from crashing.
All the describy things can be pried out of a generic function only if
it's a standard-generic-function.
Also add an FNDB entry for FUNCTION-LAMBDA-EXPRESSION.
Stas Boukarev [Thu, 17 Oct 2013 15:05:29 +0000 (19:05 +0400)]
function-lambda-expression: Return the name of a generic function.
The third value of
(function-lambda-expression (defgeneric foo ()))
is now FOO, and not
(LAMBDA (&REST SB-PCL::ARGS) :IN SB-PCL::MAKE-INITIAL-DFUN)
Reported by Marco Baringer.
Stas Boukarev [Thu, 17 Oct 2013 07:50:23 +0000 (11:50 +0400)]
tests: don't require ASDF.
With the new scheme, ASDF is not needed at all to load contribs, but
even in the past the contribs which needed it would have loaded it
automatically.
Stas Boukarev [Thu, 17 Oct 2013 07:33:26 +0000 (11:33 +0400)]
Fix where tests are trying to find contribs.
Juho Snellman [Thu, 17 Oct 2013 02:56:46 +0000 (04:56 +0200)]
Fix release-related things
contrib changes need to be reflected in binary-distribution.sh
and documentation building too.
Francois-Rene Rideau [Sat, 23 Feb 2013 12:52:39 +0000 (07:52 -0500)]
Deliver each contrib as a single FASL. Don't implicitly require ASDF or source code at runtime.
Also, move contrib output to obj/sbcl-home/, asdf cache to obj/asdf-cache/
Update sb-grovel and other contribs and their tests for asdf3.
Fixes lp#1132254.
Stas Boukarev [Wed, 16 Oct 2013 16:36:22 +0000 (20:36 +0400)]
run-program: Improve argument escaping on WIN32.
The rules of how #\\ should be escaped depend on whether it's followed
by #\" or not.
Fixes lp#1239242.
Stas Boukarev [Wed, 16 Oct 2013 13:25:58 +0000 (17:25 +0400)]
run-program: Add support for :environment on WIN32.
Stas Boukarev [Wed, 16 Oct 2013 13:10:37 +0000 (17:10 +0400)]
Disable some sb-concurrency tests on win32.
Some mailbox tests are hanging stopping from building other contribs.
Stas Boukarev [Wed, 16 Oct 2013 10:36:34 +0000 (14:36 +0400)]
sb-bsd-sockets: Rearrange how get-host-by-name/address are defined.
#+/-sb-bsd-sockets-addrinfo have different definitions of
get-host-by-name and get-host-by-address. Instead of having
(defun get-host-by-name ()
#+sb-bsd-sockets-addrinfo (call-getaddrinfo-flavour)
#-sb-bsd-sockets-addrinfo
(implementaiton-using gethostbyname))
define
#+sb-bsd-sockets-addrinfo
(defun get-host-by-name ()
(implementaiton-using getaddrinfo))
#-sb-bsd-sockets-addrinfo
(defun get-host-by-name ()
(implementaiton-using gethostbyname))
Stas Boukarev [Tue, 15 Oct 2013 14:29:02 +0000 (18:29 +0400)]
sb-introspect:find-definition-sources-by-name: support globals.
(sb-ext:defglobal x ...) couldn't be found.
Jim Wise [Sun, 13 Oct 2013 21:23:38 +0000 (17:23 -0400)]
For consistency with other shell scripts here, use #!/bin/sh.
This (alone) used #!/bin/bash, but does not seem to depend on it.
Jim Wise [Sun, 13 Oct 2013 21:22:19 +0000 (17:22 -0400)]
Fix on Solaris by accounting for /bin/sh there.
Solaris' /bin/sh does not grok $(...), so use `...` instead.
Note that all recent versions of Solaris have included /bin/bash, but
I'm not sure the impact of using #!/bin/bash instead of #!/bin/sh on
some of our other platforms.
Stas Boukarev [Sun, 13 Oct 2013 17:04:30 +0000 (21:04 +0400)]
Fix (compile '(setf function)).
COMPILE was defined as
(name &optional (definition (or (macro-function name) (fdefinition name))))
The call to macro-function caused an error when called on '(setf x).
Change it to
(or (and (symbolp name) (macro-function name))
(fdefinition name))
Reported by Douglas Katzman.
Stas Boukarev [Sat, 12 Oct 2013 17:45:49 +0000 (21:45 +0400)]
Fix another regression in dumping specialized vectors.
It should read "CEILING", not "*".
Reported by Jan Moringen.
Christophe Rhodes [Wed, 9 Oct 2013 20:41:10 +0000 (21:41 +0100)]
don't consider an interpreted->compiled function change interesting
fix from Douglas Katzman, lp#1042405
Christophe Rhodes [Mon, 7 Oct 2013 12:33:48 +0000 (13:33 +0100)]
hexstr / cold-print fixes from Douglas Katzman
Stas Boukarev [Sat, 5 Oct 2013 16:59:22 +0000 (20:59 +0400)]
Prevent personality setting on Linux from going in circles.
Apparently, setuid causes ADDR_NO_RANDOMIZE to be stripped away.
Stop restarting SBCL itself indefinitely by adding an
SBCL_IS_RESTARTING environment variable and consulting it before
trying to restart again.
Reported by Teemu Likonen.
Stas Boukarev [Thu, 3 Oct 2013 18:55:18 +0000 (22:55 +0400)]
Add a test-case for the previous commit.
Stas Boukarev [Thu, 3 Oct 2013 16:28:05 +0000 (20:28 +0400)]
Forward referenced classoid-cells can now be loaded from FASLs.
When
(defun x (x)
(typep x 'bar))
(defclass bar ()
())
is compiled twice, the typecheck is optimized and a classoid-cell is
dumped into the FASL, but upon load in a new instance it's
reconstructed using FIND-CLASSOID-CELL with :errorp t, resulting in an
error, defeating the stated reason for indirection.
Fixes lp#746132.
stas [Thu, 3 Oct 2013 13:52:46 +0000 (17:52 +0400)]
make-values-type-cached: Hardcode values of (sxhash t/nil)).
To avoid relying on the xc host.
Stas Boukarev [Thu, 3 Oct 2013 00:13:03 +0000 (04:13 +0400)]
Optimize the compiler a bit.
Optimize make-values-type-cached by adding a declaration or two.
Building SBCL sans contribs goes from 1:52 to 1:39.
Stas Boukarev [Tue, 1 Oct 2013 23:10:21 +0000 (03:10 +0400)]
Optimize sb-bsd-sockets::(get-host-by-name get-host-by-address).
Add declarations to reduce SAP consing.
Stas Boukarev [Tue, 1 Oct 2013 17:03:00 +0000 (21:03 +0400)]
Better error when calling an undefined alien function on x86-64.
(sb-alien:alien-funcall
(sb-alien:extern-alien "nnnn" (function sb-alien:void)))
now says "The alien function "nnnn" is undefined." instead of
"Attempt to call an undefined alien function."
This is achieved by storing the address of the linkage table entry in
RBX before the call. Should be trivial to port to other platforms.
Stas Boukarev [Tue, 1 Oct 2013 16:17:00 +0000 (20:17 +0400)]
Optimize RETURN-MULTIPLE on x86-64.
Replace REP MOVS with simple instructions.
RETURN-MULTIPLE is used to copy the multiple value down the stack.
The following code becomes around 5 times faster on a modern CPU,
passing more values is faster as well, but not by as much.
(defun m ()
(declare (optimize speed (safety 0)))
(values 1 2 3 4))
(defun b ()
(declare (optimize speed (safety 0)))
(let (*)
(m)))
Stas Boukarev [Mon, 30 Sep 2013 22:27:23 +0000 (02:27 +0400)]
Fix is_linkage_table_addr in win32-os.c
The aptly misnamed function in_range_p doesn't actually take START and
END of the range as arguments, but START and SIZE.
change
in_range_p(addr, LINKAGE_TABLE_SPACE_START, LINKAGE_TABLE_SPACE_END)
to
in_range_p(addr, LINKAGE_TABLE_SPACE_START, LINKAGE_TABLE_SPACE_SIZE)
Christophe Rhodes [Mon, 30 Sep 2013 16:03:10 +0000 (17:03 +0100)]
alter ftype declarations in genesis.lisp
change (or descriptor symbol) to (or symbol descriptor) to work
around a CCL bug regarding type test elision.
Christophe Rhodes [Mon, 30 Sep 2013 14:46:26 +0000 (15:46 +0100)]
improve SXHASH on fixnums
Remove one redundant LOGAND; also, use the whole of the fixnum
range on 64-bit platforms.
Christophe Rhodes [Mon, 30 Sep 2013 14:43:59 +0000 (15:43 +0100)]
better SB-INT:MIX
Use a large prime multiplier rather than 3 in the linear mix. Potentially
slower, particularly on x86 without :pentium4 where it might get implemented
as a large bunch of LEAs, but better output.
Christophe Rhodes [Mon, 30 Sep 2013 13:15:36 +0000 (14:15 +0100)]
1.1.12: will be tagged as "sbcl-1.1.12"
Nikodemus Siivola [Thu, 26 Sep 2013 08:40:45 +0000 (11:40 +0300)]
windows: fix sb-bsd-sockets build by adding shutdown() support
Stas Boukarev [Wed, 25 Sep 2013 19:42:34 +0000 (23:42 +0400)]
Restore win32 build.
The changes to special binding made binding space to contain
tls-indexes instead of symbols, but on windows WITH-TLS-EA macro
causes the tls-index to be an absolute address, storing which caused
problems when UNBIND performed its own address resolution.
Reported by Elliot Slaughter.
Stas Boukarev [Tue, 24 Sep 2013 18:04:59 +0000 (22:04 +0400)]
Fix OPEN with :io and :if-does-not-exist nil.
No need to call unix-stat, truename is already bound to the result of
PROBE-FILE.
Reported by Eric Marsden.
Stas Boukarev [Mon, 23 Sep 2013 17:25:51 +0000 (21:25 +0400)]
ADJOIN shouldn't constant fold.
ADJOIN creates new lists, so it shouldn't be constant folded. The
problem materialized when more %adjoin-* helper functions received an
fndb entry with foldable attribute copied, causing more cases to be
folded.
Reported by Eric Marsden.
Paul Khuong [Sun, 22 Sep 2013 01:05:14 +0000 (21:05 -0400)]
Test for broken copy-more-arg harder
* It takes 17 fixed arguments for (threaded) PPC to fail. Test
for up to 33 arguments now.
* Also, add some comments to explain why SP shouldn't be set to its
final value eagerly when the stack frame is smaller than the fixed
arguments: accessing slots past SP is a bad idea when interrupts
could hit and overwrite these values. In such cases, leave SP
pointing to the end of the source vector, and only move it back to
the end of the destination vector after the copy loop.
Paul Khuong [Sat, 21 Sep 2013 22:34:30 +0000 (18:34 -0400)]
Smaller initial stack frame size on x86oids
Now that copy-more-arg is fixed, stack frames can be initialised
at 3 slots (some raw constants in the codegen seems to depend on
each frame spanning at least that many slot).
Paul Khuong [Sat, 21 Sep 2013 19:11:49 +0000 (15:11 -0400)]
Fix copy-more-arg on x86 and x86-64
Parsing of non-fixed (&optional, &key and &rest) arguments used to
fail when there were more fixed arguments than slots in the stack
frame. Fix this on x86oids by copying non-fixed arguments in the
correct direction, depending on whether there are more fixed args
or stack frame slots.
This bug is more visible on x86oids since 3b98d3 (Smaller stack
frames on x86oids), but may still plague other platforms. These
platforms still have larger initial stack frame size (8 slots), so
the issue remains as hard to trigger as it's been for more than a
decade.
Reported by Jan Moringen, and reduced by Stas Boukarev.
Also add a test, marked as failing on !x86oids.
Stas Boukarev [Sat, 21 Sep 2013 22:35:47 +0000 (02:35 +0400)]
Fix a regression in binding specials.
Got two lines mixed up, where order is important.
Caught by Paul Khuong.
Stas Boukarev [Thu, 19 Sep 2013 19:30:09 +0000 (23:30 +0400)]
Optimize special variable binding on sb-thread.
Remove a level of indirection when unbinding special bindings, instead
of saving a symbol on the binding stack, and then accessing its
tls-index to unbind it, save the tls-index directly, saving one memory
read.
Stas Boukarev [Thu, 19 Sep 2013 02:24:25 +0000 (06:24 +0400)]
Fix loading specialized vectors from fasls.
Previously vectors were dumped and loaded based on the hand crafted
typecase forms, which was quite fragile.
After the dumping part was rewritten to consult
sb-vm:*specialized-array-element-type-properties*, the loading part
broke down.
Change the way it's done altogether, simplifying things significantly.
Instead of having separate FOPs for signed and unsigned vectors,
writing bit size of elements, just dump the widetag and use just a
single FOP, fop-spec-vector. Floating point dumping routines now use
fop-spec-vector too.
Christophe Rhodes [Wed, 18 Sep 2013 10:20:58 +0000 (11:20 +0100)]
rewrite DUMP-I-VECTOR
Simple, easy-to-understand cross-compiler version with limited
functionality; target version generated from sb-vm:*S-A-E-T-P*
so stands some chance of being correct.
Problem in previous version noted by Douglas Katzman (report
sbcl-devel 2013-09-16)
Stas Boukarev [Mon, 16 Sep 2013 19:56:40 +0000 (23:56 +0400)]
Remove a level of indirection in *linkage-info*.
Don't store the address in a linkage-info structure, only the linkage-info-address
slot was ever used. Store the address directly.
Stas Boukarev [Mon, 16 Sep 2013 19:53:30 +0000 (23:53 +0400)]
Restore building of +sb-unicode with -sb-unicode.
Some host definitions slipped in during cross-compilation.
char-code-limit => sb!xc:char-code-limit.
**character-primary-compositions** was initialized at xc-time, move it to cold init.
Thanks to Christophe Rhodes for the latter.
Christophe Rhodes [Mon, 16 Sep 2013 11:34:49 +0000 (12:34 +0100)]
SET-FUNCALLABLE-INSTANCE-FUNCTION is user interface
It should therefore not trigger AVER failures if the user gets the
order of arguments wrong, but report the problem sanely. The fix
in this commit is only semi-sane; it would be nice to report an
expected-type of SB-MOP:FUNCALLABLE-STANDARD-OBJECT rather than
SB-KERNEL:FUNCALLABLE-INSTANCE, but there are slightly tricky
bootstrap issues to sort out to get that to work.
Christophe Rhodes [Fri, 13 Sep 2013 13:30:13 +0000 (14:30 +0100)]
minor optimization to restart-case
The generated non-local transfer functions go to a tag which will
always be in scope whenever the restart can be invoked, so wrap the
GO in a scary (safety 0) optimization declaration. This fixes
lp#1023721 (but not the issue raised in comment #1, which would be
solved naturally if lp#383078 is addressed).
Include a test which deliberately breaks the normal dynamic-extent
lifetime for restarts; restarts generated by RESTART-CASE and friends
in fact have indefinite extent, even though once they're out of the
dynamic-extent of their creating/binding operator you can't really do
anything with them (INVOKE-RESTART signals a control-error if the
restart given is not active, and there's no way to reactivate a
restart). However, the temptation to make the restart function
have dynamic-extent allocation must be resisted, because of the
indefinite lifetime of the restart object itself.
Christophe Rhodes [Fri, 13 Sep 2013 09:36:37 +0000 (10:36 +0100)]
NEWS update for RESTART-CASE clause parsing
fixes lp#1203585
Jan Moringen [Tue, 16 Jul 2013 21:15:02 +0000 (23:15 +0200)]
Simplify RESTART-BIND and improve documentation string
* Mention syntax in documentation string.
* Simplify implementation using a location function PARSE-BINDING and
DESTRUCTURING-BIND.