Commit graph

14877 commits

Author SHA1 Message Date
Stas Boukarev 1a9a1c8140 Change the name of the "abort building SBCL" restart.
To ABORT-BUILD, as there will be other ABORT restarts.
2019-01-30 17:51:01 +03:00
Kieran Grant 84e5bd46b6 make-config: Remove obsolete references to DEVNULL 2019-01-29 22:09:00 -05:00
Douglas Katzman 5ff969fb44 Fix bitrot in LAMBDA-WITH-LEXENV
It used to be: (lambda-with-lexenv () () () (lambda-list) . body)
where the first three things after lambda-with-lexenv held macros,
symbol-macros, and declarations, not necessarily in that order.
Now it is: (lambda-with-lexenv (env) (lambda-list) . body)

I don't know when this changed, but obviously we don't care too too much
if get-defined-fun is called with an incorrect lambda list of NIL.
2019-01-29 22:07:04 -05:00
Douglas Katzman 1bacec5c5a Remove the handrolled definition of MAKE-LAYOUT for x86-64 2019-01-29 18:14:33 -05:00
Douglas Katzman f91a811205 Replace all remaining "#![-+]" with "#[-+]" 2019-01-29 14:13:37 -05:00
Douglas Katzman 22eed99c2d Add remark about importing into keyword package 2019-01-29 13:49:49 -05:00
Stas Boukarev eb720fdaa7 Catch macroexpansion errors in a FUNCALL transform.
Fixes lp#1749253
2019-01-29 21:29:04 +03:00
Douglas Katzman 41486a1638 Rearrange SB-C::PROCESS-TOPLEVEL-FORM
I finally figured out why the code was so confused/confusing:

* The comment that "The only sensible thing" is the target compiler's macro
  was the direct opposite of reality. The code of course did the right thing.

* The comment that "we can uncross everything" was very disingenuous,
  considering that we don't uncross more than one atom per level of recursion.

* We don't _need_ to do something different for atoms when cross-compiling
  - they rarely occur - however we must not compute the "slightly uncrossed"
  form as (NIL) if the original was NIL, by accidentally taking car/cdr of NIL.

* After cleaning up that mess, it became evident that the non-macro case
  for both + and - sb-xc-host were really nearly identical.

* Inadvertently or purposely we did not bind *TOP-LEVEL-FORM-P* to NIL for
  non-toplevel code in the cross-compiler. When fixed, this bug revealed that
  we expected to treat *all* DEFUNs as if toplevel, because we correctly emit
  "undefined" warnings for the ones inside toplevel FLETs. make-host-1 would
  resolve the warnings by loading each fasl, thus having an actual definition.
  Cross-compiling can't do that, but we can whitelist those functions.
2019-01-29 12:18:37 -05:00
Douglas Katzman c78dfcd103 Slightly enlarge the set of tests that can run concurrently
:FAILS-ON inhibits concurrency, but only if we think it will really fail.
(Because the concurrent test runner isn't so great at showing failures)
2019-01-29 11:23:05 -05:00
Douglas Katzman ad038dbd9b Prevent SELF-EVALUATING-P => T for non-self-evaluating keywords
and use it in MAKE-LOAD-FORM-SAVING-SLOTS
2019-01-29 11:17:12 -05:00
Jan Moringen 6afedce507 pcl: Deduplicate initargs when computing effective slots 2019-01-29 14:33:43 +01:00
Stas Boukarev a5224c55c6 Fix substitute-single-use-lvar around unknown value exits.
(almost-immediately-used-p lvar cast) ceases to be immediate when the
cast is deleted, add a new function, LVAR-ALMOST-IMMEDIATELY-USED-P,
which looks through casts.

Fixes lp#1811251, lp#1813036
2019-01-29 15:57:32 +03:00
Stas Boukarev bb5ab4d21e Remove clocc-ansi.test.sh. 2019-01-29 02:02:48 +03:00
Douglas Katzman cc8f1e5fb3 Replace more feature expressions with standard reader syntax
Just: perl -pi -e 's/#\!([-+])sb-dynamic-core/#$1sb-dynamic-core/g' **/*lisp
and similarly sb-{thread, unicode, fluid, simd-pack, show}, gencgc, cheneygc,
win32, linux, darwin, {little,big}-endian, 64-bit, immobile-space.

About 1200 lines involving bang feature expressions remain at this point.
2019-01-28 17:58:41 -05:00
Douglas Katzman c270f65ca9 Change all #!+long-float to #+long-float
For a feature that has not worked since forever ago, this was probably
the biggest offender in terms of lines needing conditionalization.
2019-01-28 16:43:40 -05:00
Douglas Katzman 54265c81a1 Remove #! from package-data-list 2019-01-28 16:25:17 -05:00
Stas Boukarev 7430fe6fd9 Run ansi-tests on the CI. 2019-01-28 23:52:55 +03:00
Stas Boukarev bb4ef3b2c2 Warn about incompatible COERCE types at compile-time.
E.g. (coerce (the number x) 'array)
2019-01-28 22:44:58 +03:00
Stas Boukarev d35b1ebe50 Transform (complex rational zero)
To rational.
2019-01-28 22:44:58 +03:00
Douglas Katzman 3e0d58969a Remove hack for use of SBCL internals by external library 2019-01-28 12:56:20 -05:00
Douglas Katzman 5aec1ee8fa Do a better job with mutually referential defstruct constructors
Given:
 (defstruct foo (a nil :type (or null bar))
 (defstruct bar (a nil :type (or null foo))
there was no way to efficiently compile the type-check of BAR in the FOO
constructor, so it fell back to using cached-typep. Flipping the order of those
definitions doesn't help, since they're symmetric.

This change batches up forms produced by consecutive defstructs, compiling them
after digesting all the compiler metadata. It's sort of "block compilation lite"
though it's unclear if block compilation would have handled forward references
to undefined types any better than this. i.e. we might have needed this anyway,
though we pretty much gave up on block compilation, so it's irrelevant.

At the moment, no unrecognized forms may appear in between dependent defstructs;
however I think we can improve this to queue up any PROCLAIM or arbitrary DEFUN
as long as the order of compilation is preserved.
2019-01-28 11:46:37 -05:00
Douglas Katzman 825d4d0070 Really prevent #!+ vs #+ confusion now
Files which are part of the build framework, namely "make-*.lisp" and anything
under src/cold except for src/cold/warm always interpret #+/- as host features,
which is obvious. In those files, the reader can't parse target feature sexprs,
but the value of SB-XC:*FEATURES* may be tested with code.

Files which are sources, namely everything else, can _only_ refer to target
features in "#+"/"#-" (sans #\!) expressions, unless within a #+(host-feature)
escape. Thus it is identical, for the time being, to using #!+ or #!-.

As far as implementation, the default *READTABLE* never has its macros changed,
so you can't just slurp a file containing target feature conditionals -
instead *READTABLE* must be bound from *XC-READTABLE*. You may continue to use
the features named :sb-xc-host and :sb-xc with either the bang or non-bang
conditional syntax. So ultimately, "#!" syntax serves no purpose at all,
and we can replace every occurrence with normal syntax.

Note also that DO-STEMS-AND-FLAGS requires a third argument to indicate whether
the flags pertain to make-host-1 or -2 which avoid erroneous injection of
the :IGNORE-FAILURE-P flag when it is intended for the host. I don't love it,
but lacking proof that the CMUCL workaround isn't needed, I preserved the
behavior while improving upon it as well.
2019-01-28 00:52:12 -05:00
Douglas Katzman 7b86aa031c Put undefined fun whitelist in package-data-list
This is a precursor to a change that will render it difficult if not impossible
to misuse "#+" or "#-" when "#!+" (resp "#!-") was intended and vice-versa.

Files that themselves are read in host mode (such as "compile-cold-sbcl") won't
have access to the target features as read suppression conditions. The features
will be present in SB-XC:*FEATURES* but without the char macros having been set.

Conversely, host features won't be testable with "#+/-" when building or running
the cross-compiler except by using the "(host-feature x)" escape syntax of the
target feature reader. In practice, such syntax is rarely called for any more.
2019-01-28 00:05:57 -05:00
Douglas Katzman ed5f1538f4 Change *ALL-THREADS* to an AVL tree
Use a single source of truth for stack addresses and set of running threads.
The AVL tree is of the pure functional variety, and the root node is swapped
out for any insert or delete. The STACK-ALLOCATED-P function becomes safer -
at worst it sees a stale tree but never one that violates any invariants.

I do not know whether this fixes the duplicate insertion problem observed
in https://sourceforge.net/p/sbcl/mailman/message/36517264/
but it should allow us to figure out whether the problem pre-dated use of a
tree structure in the sense that tree insertion failure would happen only if
*ALL-THREADS* itself would have contained zombie threads.
I believe that to be the case, as the code for tree insert and delete were
guarded by the same critical section that guarded *ALL-THREADS*.
Therefore if deletion failed to happen in the tree for a previous thread
death, then it ought to have failed to happen in the list representations too.

Of course it's also possible that the treap code was buggy, and/or the
AVL code, but they were/are regression tested by a random tester. Another
scenario would be the code inserting a new thread somehow running before
the code deleting the old, but I don't understand in that case how you would
get a stack address that is the same, because the deletion runs on the stack
of the very thread that is dying. i.e. a physical stack is freeable only
after having removed yourself from *all-threads*. Therefore no new thread can
lay claim to that address space. I really think that if a thread died a
hard (horrible) death, it could fail to remove itself from any lists.

A final note - it seem that the "portable-threads" library directly uses
SB-THREAD::*ALL-THREADS* which is obviously wrong. If we can't find someone
to shoot, then we could rename the global var to something different,
and then (DEFINE-SYMBOL-MACRO *ALL-THREADS* (LIST-ALL-THREADS))
which restores the look-and-feel of the sb-thread internals.
2019-01-27 23:08:20 -05:00
Douglas Katzman c59c5ea2cb Declare all printer control vars in the same place
Also, since they're all proclaimed as always-bound, take precautions
in CALL-WITH-SANE-IO-SYNTAX to suppress elision of the BOUNDP check.
2019-01-27 21:45:51 -05:00
Douglas Katzman 1244df99c9 Add source-transform for DEFSTRUCT copiers
Check instance type at call site, and produce style-warning about failure
to inline, and/or clobbering an ordinary defun if pertinent.
2019-01-27 21:03:28 -05:00
Stas Boukarev 429c7f57ec Don't output anything when running sb-sprof tests. 2019-01-28 02:57:59 +03:00
Stas Boukarev 5090286027 make.sh: remove the remark about tests.
It's really stale.
2019-01-28 02:53:37 +03:00
Douglas Katzman 4db757266f Use fewer toplevel #-sb-xc-host conditionals 2019-01-27 18:41:26 -05:00
Douglas Katzman 895573ad13 Remove some noise from cross-misc 2019-01-27 16:17:04 -05:00
Douglas Katzman 7f9e4f4ed5 Push :SB-XC-HOST in SB-XC:*FEATURES* during make-host-1
Eliminate use of "#!+(host-feature sb-xc-host)" pattern.
2019-01-27 15:56:10 -05:00
Douglas Katzman 71aca61580 Do not test types unsuitable for discrimination
(DECLAIM (TYPE (FUNCTION (T) T) *VAR*)) should allow *VAR* to be assigned
any function, though the compiler could warn if it detected something that
would definitely fail. ABOUT-TO-MODIFY-SYMBOL-VALUE was too strict, which
affected compiled PROGV and full calls to SET, and the interpreters as they
necessarily use both of those to bind or assign special variables.

Also remove spurious use of #[-+]sb-xc-host from :not-host file.
2019-01-27 15:44:20 -05:00
Douglas Katzman a04147b0fb Push :SB-ASSEMBLING on SB-XC:*FEATURES* in assemfile 2019-01-27 15:38:57 -05:00
Douglas Katzman 03832f33e1 Move some target-only things to target files 2019-01-27 15:24:52 -05:00
Douglas Katzman 5163c8216a Move some interpreter stubs 2019-01-27 15:17:54 -05:00
Douglas Katzman c05f7215be Remove bogus "#!+cmu (:pure nil)"
There might have been some point to having ":PURE NIL" in the past,
but it's clearly wrong, since obviously #!+cmu is and always has been false.

It would have been correct if a HAIRY-TYPE could reference mutable objects,
which it should not, nor can I see how it ever could. NEGATION-TYPE which came
from rev 58ff25d134 just borrowed the existing wrong conditional.

Incidentally, the two remaining uses of ":pure nil" to override the inherited
value of T from CTYPE seem ok or at least not wrong. MEMBER-TYPE is not
supposed to be mutable, but in the interest of safety, we might assume that
users could mutate the objects in a member-type.
2019-01-27 15:05:03 -05:00
Douglas Katzman 273da14696 Remove needless reader conditional 2019-01-27 15:04:45 -05:00
Stas Boukarev 1c2f35c008 Increase a test timeout. 2019-01-27 22:53:40 +03:00
Douglas Katzman 53a2a14e18 Allow building without sb-simd-pack 2019-01-27 12:23:32 -05:00
Stas Boukarev 9f0d12e7ab Transform ARRAY-ELEMENT-TYPE.
The type deriver is not enough because compound element types are not
treated as constants.

Closes lp#1813356
2019-01-27 15:55:27 +03:00
Stas Boukarev 2ff704e27e Add azure-piplines.yml 2019-01-27 15:49:04 +03:00
Paul Khuong 0f14c4a4e1 contrib/sb-cover: detect and emulate IN-PACKAGE when recording source maps
Standard code can be read independently of the current package.
However, our local package nickname extension (or some reader macros,
in theory) makes it necessary to be in the correct package for
SB-IMPL::READ-MAYBE-NOTHING to do the right thing.

Implement the same logic as SWANK: we scan each line of code as a
string, ook for lines that start with "(in-package " or
"(cl:in-package ", read that line, and find the package that
corresponds to the second element in the resulting list.

Tested with a new case in sb-cover/tests.lisp.
2019-01-27 02:57:52 +00:00
Christophe Rhodes 7ab79e3271 1.4.16: will be tagged as "sbcl-1.4.16" 2019-01-26 20:47:06 +00:00
Stas Boukarev a111230c45 Disable an optimization temporarily.
Don't optimize m-v-bind with unused values and unknown value
producers, mv-combination needs to handle replacing unused lambda-vars
with NIL before that can e done, otherwise it can lead to type
mismatch or duplicate work.

Fixes lp#1813338
2019-01-26 01:51:31 +03:00
Douglas Katzman 85bdd7687f Invert a wrong comment, remove an obsolete one 2019-01-24 17:57:18 -05:00
Stas Boukarev 7c85159371 insert-debug-catch: better default on -unwind-to-frame-and-call-vop
Don't make it go to 3 with debug==2.
2019-01-20 18:54:01 +03:00
Stas Boukarev ab12051017 set-up-cold-packages: sb-kernel:closurep not exported on older SBCLs. 2019-01-20 18:14:45 +03:00
Stas Boukarev 7dbc076340 Stop caching LVAR-EXTERNALLY-CHECKABLE-TYPE.
It's used at most once per LVAR and invalidating it doesn't seem to be
all that consistent.
2019-01-20 15:31:11 +03:00
Stas Boukarev 2aaa84d7f5 Adjusts tests for -x86-64. 2019-01-19 19:10:01 +03:00
Stas Boukarev bfd1f44509 remove-unused-vars-in-mv-bind: handle unknown-valued uses.
i.e. convert
(multiple-value-bind (unused y) (if c unknown (values 3 4)))
to
(multiple-value-bind (unused y) (if c unknown (values nil 4)))
2019-01-19 17:33:43 +03:00