Commit graph

6782 commits

Author SHA1 Message Date
Stas Boukarev 4082dec495 sbcl-pwd.sh: Fix when $OSTYPE is not set. 2013-11-08 00:02:16 +04:00
Stas Boukarev a129450e9b 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.
2013-11-06 22:39:31 +04:00
Stas Boukarev 9de65d498a 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.
2013-11-06 21:20:21 +04:00
Stas Boukarev cf49f2d086 Fix contrib building on mingw.
The current directory has to be found out using pwd -W, to avoid any
conversion into unix-looking pathnames.
2013-11-06 21:11:53 +04:00
Stas Boukarev 8c773ad69a 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.
2013-11-06 04:46:26 +04:00
Stas Boukarev 151fa3c5d8 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.
2013-11-05 19:56:00 +04:00
Stas Boukarev 1cba0af01f Fix lose() invocation inside sparc-arch.c 2013-11-05 17:48:03 +04:00
Stas Boukarev 4c7c37bcc5 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.
2013-11-05 02:52:37 +04:00
Paul Khuong 498ec57f1f [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.
2013-11-04 13:58:10 -05:00
Paul Khuong 8be78b41ac 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.
2013-11-04 12:36:07 -05:00
Paul Khuong ce6c2726bf 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.
2013-11-04 12:32:11 -05:00
Stas Boukarev 2023abc03e Fix foreign-stack-alignment test on SPARC. 2013-11-04 16:41:59 +04:00
Stas Boukarev f192f80212 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).
2013-11-04 01:18:01 +04:00
Stas Boukarev cc67baa307 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.
2013-11-03 23:40:06 +04:00
Christophe Rhodes 9c9d6dbdc2 fix LET* environment semantics in sexp-based evaluator 2013-11-03 16:33:26 +00:00
Stas Boukarev e51821dc33 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.
2013-11-03 19:09:31 +04:00
Stas Boukarev c6bbd001a8 Fix run-tests.sh on Solaris. 2013-11-03 14:57:06 +04:00
Stas Boukarev bd494c3bf5 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.
2013-11-02 17:39:50 +04:00
Stas Boukarev 8e6a4a018f Add --help to run-tests.sh. 2013-11-01 16:47:38 +04:00
Stas Boukarev c0f9314af1 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
2013-11-01 16:34:27 +04:00
Stas Boukarev 5728601f88 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.
2013-11-01 15:50:55 +04:00
Stas Boukarev 5f89179381 Remove *static-foreign-symbols* from #+sb-dynamic-core builds. 2013-10-31 22:57:24 +04:00
Stas Boukarev adcb5a9772 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.
2013-10-31 18:48:26 +04:00
Stas Boukarev 062283b901 describe: show the same information about functions for 'x and #'x.
Declared type and information about inlining were not shown when used
as #'function.
2013-10-31 18:48:26 +04:00
Christophe Rhodes 24e3d887e4 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.
2013-10-31 14:45:17 +00:00
Christophe Rhodes 7f1e94ae96 1.1.13: will be tagged as "sbcl-1.1.13" 2013-10-31 10:42:43 +00:00
Paul Khuong 441dfe5655 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 d0f65b07a3 which is
now mostly redundant.
2013-10-26 13:47:53 -04:00
Stas Boukarev d0f65b07a3 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)
2013-10-26 18:42:22 +04:00
Jan Moringen 69e6aef5e6 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
2013-10-22 20:26:22 +01:00
Jan Moringen 657deda22e 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.
2013-10-22 11:30:20 +01:00
Jan Moringen 2fcf367a1f 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.
2013-10-22 11:30:20 +01:00
Jan Moringen 15cd7569cd Silence some unused variable warnings in tests/condition.[im]pure.lisp 2013-10-22 11:30:20 +01:00
Christophe Rhodes 9d5be5e953 fix symlink handling (generally and on OS X) in run-sbcl.sh
Patch from Stelian Ionescu, lp#1242643
2013-10-21 12:41:35 +01:00
Christophe Rhodes 885a956ae2 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.
2013-10-21 12:15:04 +01:00
Paul Khuong 5193965ff7 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.
2013-10-19 17:47:47 -04:00
Stas Boukarev cee8ef5910 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.
2013-10-18 15:18:36 +04:00
Stas Boukarev c58678f9ae Add some missing FNDB declarations. 2013-10-17 20:53:18 +04:00
Stas Boukarev f0f3805c14 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.
2013-10-17 19:16:41 +04:00
Stas Boukarev dfc9c3a9dd 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.
2013-10-17 19:05:29 +04:00
Stas Boukarev d686552fdb 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.
2013-10-17 11:50:23 +04:00
Stas Boukarev 1f704cd4ff Fix where tests are trying to find contribs. 2013-10-17 11:33:26 +04:00
Juho Snellman ecebde418a Fix release-related things
contrib changes need to be reflected in binary-distribution.sh
and documentation building too.
2013-10-17 04:56:46 +02:00
Francois-Rene Rideau 25c1769e30 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.
2013-10-17 03:10:58 +02:00
Stas Boukarev 9c3a9502bc 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.
2013-10-16 20:36:22 +04:00
Stas Boukarev 911a74c40f run-program: Add support for :environment on WIN32. 2013-10-16 17:29:02 +04:00
Stas Boukarev a7699535aa Disable some sb-concurrency tests on win32.
Some mailbox tests are hanging stopping from building other contribs.
2013-10-16 17:28:57 +04:00
Stas Boukarev 5c2f5c79db 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))
2013-10-16 14:36:34 +04:00
Stas Boukarev 37bf7dd720 sb-introspect:find-definition-sources-by-name: support globals.
(sb-ext:defglobal x ...) couldn't be found.
2013-10-15 18:29:02 +04:00
Jim Wise 9b69e80c82 For consistency with other shell scripts here, use #!/bin/sh.
This (alone) used #!/bin/bash, but does not seem to depend on it.
2013-10-13 17:23:38 -04:00
Jim Wise 4afcad7842 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.
2013-10-13 17:22:19 -04:00