Commit graph

3075 commits

Author SHA1 Message Date
Charles Zhang 8fd2eae7f5 Define a foreign callable interface and make libsbcl.so useful.
This change adds many things:
* There is now a proper interface to defining and using foreign
callbacks in Lisp.
* There is now a usable script to build
libsbcl.so ("make-shared-library.sh"), which also slightly adjusts the
runtime to make it more amenable for external use with respect to
signalling.
* There is now a way to use libsbcl.so in conjunction with other
object code to actually initialize Lisp and call Lisp foreign
callables from C directly. (this works, at least on Linux, but support
is not quite complete yet, because we don't have a way to
de-initialize Lisp)
* `save-lisp-and-die' has gained a new argument to support the above.

I guess technically DEFINE-ALIEN-CALLBACK can be removed, since the
DEFINE-ALIEN-CALLABLE interface now supersedes it, but internal stuff
like tests still use it, so that change can wait for now.
2021-09-27 15:25:13 -07:00
Christophe Rhodes 4a1da77f72 2.1.9: will be tagged as "sbcl-2.1.9" 2021-09-27 20:41:56 +01:00
Christophe Rhodes 6b777532b6 NEWS for sbcl-2.1.9 2021-09-27 13:55:29 +01:00
Christophe Rhodes 9fd4c01dd2 2.1.8: will be tagged as "sbcl-2.1.8" 2021-08-30 11:50:21 +01:00
Christophe Rhodes e1d3a12284 NEWS for sbcl-2.1.8 2021-08-30 09:21:40 +01:00
Christophe Rhodes 5fbf7871bd Remove old NEWS
One item was actually two months old.
2021-07-30 12:44:45 +01:00
Christophe Rhodes f3618d28a3 2.1.7: will be tagged as "sbcl-2.1.7" 2021-07-30 09:42:03 +01:00
Christophe Rhodes 3359fe3192 NEWS for sbcl-2.1.7 2021-07-29 20:36:17 +01:00
Douglas Katzman 39abb1f526 Reinstate the non-zero-fill behavior for dynamic-extent arrays 2021-07-22 17:08:25 -04:00
Christophe Rhodes 7c3b7f1b24 Typo fixes 2021-07-02 21:25:31 +01:00
Douglas Katzman 894d5fab13 Change START-PROFILING to always do something; test more
Until I realized why it was ignoring the parameters from WITH-PROFILING in
the new test, it took ages to collect 50,000 (= default *MAX-SAMPLES*) traces
in parallel-exec, which already enables the profiler.
So issue a warning about calling it with unclear intent.
2021-06-29 22:49:36 -04:00
Christophe Rhodes dfcb7ede12 2.1.6: will be tagged as "sbcl-2.1.6" 2021-06-28 21:01:59 +01:00
Christophe Rhodes bf35c84177 NEWS for sbcl-2.1.6 2021-06-28 17:37:05 +01:00
Christophe Rhodes 59195ae573 Fix ~E with no explicit width parameter
If there's no explicit width, print a single trailing zero after the
decimal point if there are no remaining digits to be printed.
2021-06-15 09:25:23 +01:00
Douglas Katzman 105bfc82b9 Improve pathname handling in COMPILE-FILE
This fixes the single biggest problem with
(COMPILE-FILE "dir1/srcfile.lisp" :output-file "dir2/objfile")
by avoiding merging two relative directories into either
dir1/dir/ or dir2/dir1/ (and you don't know which)
Other lisp implementations disagreed with us, with each other,
and even with themselves about this. See the case studies in this
change as to why it's anyone's guess what it was supposed to do,
and how you can't even portably rely on COMPILE-FILE-PATHNAME
to not lie to you.

So, to gives users greater control, if :OUTPUT-FILE has a directory
in it, don't further manipulate it except to merge with *D-P-D*
which could always be bound to #P"". Users who want merging can merge
on their own. (You can't undo merging that was never wanted.)

And since the entire point of COMPILE-FILE-PATHNAME is to tell the
user what our implementation does, it seems fair game to implement
semantics that allow usage on modern content-addressable filesystems,
and make COMPILE-FILE-PATHNAME return the right answer instead of
a random hash based on the fasl file's sha256 sum or whatever.
2021-06-10 00:51:58 -04:00
Christophe Rhodes 5196285419 2.1.5: will be tagged as "sbcl-2.1.5" 2021-05-31 07:38:40 +01:00
Christophe Rhodes 09a2f9662a NEWS for sbcl-2.1.5 2021-05-30 22:52:57 +01:00
Douglas Katzman be1773175f Fixes for release
* Restore 0-fill of DX arrays

* Restore non-merging of pathnames in self-build.
  (Make the code match the comment)

* Unbreak #+msan
2021-05-30 11:28:43 -04:00
Stas Boukarev e3b3c14554 Implement :call-symbol on ARM64. 2021-05-23 06:33:49 +03:00
Charles Zhang eb4aa3d7f7 Dump fops for package literals instead of using MAKE-LOAD-FORM.
Making the fasdumper dump literal package references directly makes
sense because we already have fops to do that. Plus, we no longer need
a MAKE-LOAD-FORM for it. Incidentally, both CLISP and CCL don't have
MAKE-LOAD-FORMs for PACKAGEs either, so they must also dump package
literals directly as well.

This makes both target and cross compiled fasls smaller.

Not only do we not need a special cross-compiler method to dump
package literals, we don't need to teach fop-funcall how to deal with
it anymore, though we do need to explicitly descriptorize the package
like we do for symbols when writing them out.

We also reduce dependence on the fopcompiler for making things work on
the cross-compiler and fasls smaller in the target compiler, which is
good for higher debug.
2021-05-05 14:56:15 -07:00
Douglas Katzman e1dc13537a Rewrite TRANSFORM-MAKE-ARRAY-VECTOR
This change provides a better framework for doing memory allocation using
an allocator that does not assume that heap memory is prezeroed, by
separating allocation from zeroing, and deferring the decision to elide
zeroing until IR2 says it's OK to. It fixes the bug that VECTOR-INITIALIZED-P
failed to recognize some of the ways in which the transform could initialize
the data (and so it would zero-fill and then fill with data.)

Consequently it became possible to elide zeroing of dynamic-extent vectors
whose type is safe for GC without clearing the bits. I rolled that aspect into
this change. If there is any objection, it's simple enough to restore strict
backward-compatibility, though only unportable code should care.
2021-04-29 23:52:52 -04:00
Christophe Rhodes 227a507d1d Add :REMAINING-BYTES to some EMIT-EA calls on x86-64
While some of them may never encode RIP-relative addresses, it's
simpler to have all the calls reflect their local context.  Fixes
lp#1925808.
2021-04-28 22:43:00 +01:00
Christophe Rhodes f8a57bccad 2.1.4: will be tagged as "sbcl-2.1.4" 2021-04-28 21:54:24 +01:00
Christophe Rhodes 6717e490f9 NEWS for sbcl-2.1.4 2021-04-28 21:53:22 +01:00
Christophe Rhodes 937fae8aeb some words in NEWS to fix HTML export 2021-03-29 08:32:11 +01:00
Christophe Rhodes 640030514e 2.1.3: will be tagged as "sbcl-2.1.3" 2021-03-28 19:52:54 +01:00
Christophe Rhodes 6506b6ce99 NEWS for sbcl-2.1.3 2021-03-28 19:51:47 +01:00
Christophe Rhodes 561146c37d Allow TYPEP tests of SB-PCL::SLOT-OBJECT to work
SLOT-OBJECT is a PCL convenience, allowing for shared definitions in
class initialization and slot access on conditions, structure objects
and standard objects.  The non-PCL parts of the system don't place
a layout for SLOT-OBJECT in the layout-inherits of structures, so
TYPEP was reporting NIL always.

Effectively, though, SLOT-OBJECT is the union of STRUCTURE-OBJECT,
STANDARD-OBJECT and CONDITION, so inform the classoids of this.  In
the process delete what must be dead code in CLASS-TEST, because
SYSTEM-CLASSOID has not named a type for quite some time.
2021-03-05 08:58:45 +00:00
Christophe Rhodes 0ba5415fbe 2.1.2: will be tagged as "sbcl-2.1.2" 2021-03-01 20:40:02 +00:00
Christophe Rhodes 80363931fd NEWS for sbcl-2.1.2 2021-03-01 20:39:08 +00:00
Didier Verna 2576188ce2 Add METHOD-COMBINATION-LAMBDA-LIST to sb-introspect
Add a lambda-list slot to the method-combination-info, and use it from
within sb-introspect.
2021-02-09 22:29:44 +00:00
Stas Boukarev 295b7de651 Work around some inexplicable failure in pthread_jit_write_protect_np 2021-02-08 07:04:09 +03:00
Douglas Katzman 31154c9c13 Remove some weird SB-SPROF external functions
The interface to receiving an individual stack trace (MAP-TRACE-SAMPLES)
should have been a list or vector of locations, and I can conceive of no
reason but for the highly specialized usage in 'disassemble' for wanting
to visit each location that had ever been interrupted (MAP-ALL-SAMPLES).

Had these been good APIs with poorly chosen names (or possibly just bad APIs
with well-chosen names) then  maybe it would have made sense to avoid
breaking them. But they're just horrible- not general enough to expose,
and incredibly confusing given that "samples" means not 1, not 2,
but 3 different things simultaneously: all instances of the DEFSTRUCT,
all traces captured, and all locations in a trace.

Well, they said "EXPERIMENTAL: Interface subject to change." so
here we are- Consider it changed.
2021-02-05 22:52:51 -05:00
Douglas Katzman da11c1fd38 Remove SB-SPROF::*SAMPLING*
I'm unsure what the use-case for it was. Sampling in a subset
of threads is best done by selectively blocking SIGPROF.

After this change, WITH-PROFILING is more similar to START-PROFILING-
they both defaults to sampling in all threads.
2021-02-01 23:45:19 -05:00
Christophe Rhodes c642a0bcc7 fix pairwise union of cons types
In the case when the car types of the conses was provably
not-disjoint, we were computing the wrong simplification.  Fixes
lp#1912863.
2021-01-30 12:22:00 +00:00
Christophe Rhodes 7ca966d47c fix old NEWS
Half-edited, not enough coffee.
2021-01-30 12:22:00 +00:00
Christophe Rhodes d968217b2e 2.1.1: will be tagged as "sbcl-2.1.1" 2021-01-30 11:22:31 +00:00
Christophe Rhodes e53abb1635 NEWS for sbcl-2.1.1 2021-01-30 11:19:17 +00:00
Christophe Rhodes 46cb065f06 2.1.0: will be tagged as "sbcl-2.1.0" 2020-12-29 10:05:17 +00:00
Christophe Rhodes b9dce1451d NEWS for sbcl-2.1.0 2020-12-29 10:04:32 +00:00
Christophe Rhodes 58d68fe6b3 2.0.11: will be tagged as "sbcl-2.0.11" 2020-11-29 11:24:17 +00:00
Christophe Rhodes 60fe6d0393 NEWS for sbcl-2.0.11 2020-11-29 11:22:43 +00:00
Stas Boukarev d06782e212 Bump array-rank-limit to 256.
After b6e24cff3c there's no longer other
header words mixed in with the rank and it can occupy the whole byte.
2020-11-07 04:04:45 +03:00
Douglas Katzman 1ba3cfa925 Further reduce array-rank limit to 10
* By suitably restricting rank, it is possible to have every array including
  1-dimensional contain its rank in its 0th word, eliminating an IF from
  ARRAY-RANK. It also makes space for a second widetag in fancy array headers
  so that ARRAY-ELEMENT-TYPE does not need to follow a displacement chain.

* Improve GC by visiting only the slots of a fancy array header
  that possibly contain pointers.

* Fix an omission: simple-array must not call scav_boxed, so the code
  was wrong after the prior change that affected array-rank-limit.
2020-11-02 21:05:12 -05:00
Douglas Katzman 28645c1b71 Reduce array-rank-limit to 100
This will allow use of upper bits in an array header's header word
so that has-fill-pointer-p can become a 1-bit test on _any_ array.
Not to mention it saves an instruction in the array-rank vops.
2020-10-30 23:50:03 -04:00
Douglas Katzman 8a2df46b46 Rip out the (ARRAY NIL (*)) is STRINGP logic
This undoes parts of 902e9373 in the interest of following the spec by its
intent and de-facto correct interpretation versus a theoretical view
that is of little practical value.

As the test file shows, among all other implementations examined, the consensus
is 8-to-2 against treating (VECTOR NIL) as a string even where support for
(ARRAY NIL) as a type exists. And the minority stance is weak- both outliers
upgrade NIL to their widest character type in MAKE-STRING, proving beyond a
doubt that they don't really think that NIL means empty type in that usage.
So now SBCL goes along with that for maximum compatibility with everyone.

I considered a hypothetical build-time #+vector-nil-is-string feature,
but it's not worth cluttering the code for. Nobody would/should use it.
2020-10-29 13:05:59 -04:00
Christophe Rhodes badfc73b9d 2.0.10: will be tagged as "sbcl-2.0.10" 2020-10-27 13:44:43 +00:00
Christophe Rhodes 899402fa31 NEWS for sbcl-2.0.10 2020-10-27 12:50:20 +00:00
Douglas Katzman 5f9d19d4aa Warn more
Implement IGNORE,IGNORABLE more strictly according to the spec.
2020-10-19 15:49:53 -04:00
Stas Boukarev dc90073462 Ignore SIGPIPE again.
Old code inexplicably crashing SBCL is not a good look. Enabling
SIGPIPE should be explicit if it's desired.

Fixes lp#1897624
2020-10-19 18:32:03 +03:00