sbcl.git
12 years agotests: Raw instances shouldn't stack-allocate on most targets.
Alastair Bridgewater [Fri, 28 Oct 2011 23:04:25 +0000 (19:04 -0400)]
tests: Raw instances shouldn't stack-allocate on most targets.

  * We possibly should be testing to make sure that they /do/
cons, but we can live with not having an expected failure
message for a situation that would take a lot of careful work
on the compiler and GC to improve.

12 years agoDX structs with raw slots only allowed on conservative gencgc.
Alastair Bridgewater [Thu, 27 Oct 2011 13:16:08 +0000 (09:16 -0400)]
DX structs with raw slots only allowed on conservative gencgc.

  * Unless the control stack is conservatively scavenged, any
unboxed data could lead the GC to either corrupt the stack,
corrupt the heap, or just die screaming.

  * Thus, all unboxed data must be stored on the number stack
on such systems.  However, the number stack isn't scavenged
for boxed data, so we can't store any object that contains
both boxed and unboxed words if the unboxed words can appear
to the GC as anything other than a FIXNUM (thus, aligned
pointers are safe to store on the control stack).

  * All INSTANCE objects have a boxed slot, the LAYOUT slot.
If an instance also has raw slots then it cannot go on either
stack, and must be heap-allocated.

  * And none of this applies if the stack is conservatively
scavenged, which means (and gencgc c-stack-is-control-stack).
On such targets, we can dump whatever we want to the control
stack, and the GC won't complain at all.

12 years agoFix build on non-GENCGC targets.
Alastair Bridgewater [Wed, 14 Dec 2011 19:43:39 +0000 (14:43 -0500)]
Fix build on non-GENCGC targets.

  * Commit 8ee61a7761181511d15690246eb52d100e233935 introduced a
function with a parameter that is only used on gencgc targets.
Declare it to be ignored on non-gencgc targets.

12 years agox86: Better disassembly of segment-prefixes.
Lutz Euler [Wed, 14 Dec 2011 17:11:53 +0000 (18:11 +0100)]
x86: Better disassembly of segment-prefixes.

Thanks to Alastair Bridgewater who originally provided these changes
(and the headline above). I adapted his work to fit into the prefix
instruction infrastructure now available. Of his original comments
the following three still apply:

  * Establish a SEG prefix for segment overrides similar
to the X66 data-width prefix.

  * Have the SEG prefilter set an instruction property
for the specific segment being used.

  * Alter PRINT-MEM-ACCESS to output a suitable prefix
for memory addresses when the appropriate instruction
property has been set.

I have abstracted out the segment prefix printing into the new function
MAYBE-PRINT-SEGMENT-OVERRIDE, called from PRINT-MEM-ACCESS, not to make
the latter more lengthy.

Here is an example to show the difference in disassembler output:

Old:

;      0E6:       64               FS-SEGMENT-PREFIX
;      0E7:       8910             MOV [EAX], EDX
;      0E9:       64               FS-SEGMENT-PREFIX
;      0EA:       8B0528000000     MOV EAX, [#x28]

New:

;      0E6:       648910           MOV FS:[EAX], EDX
;      0E9:       648B0528000000   MOV EAX, FS:[#x28]

12 years agoImprove handling of x86[-64] prefix instructions in the disassembler.
Lutz Euler [Wed, 14 Dec 2011 17:11:53 +0000 (18:11 +0100)]
Improve handling of x86[-64] prefix instructions in the disassembler.

Make LOCK, REP, REX and #x66 true prefix instructions on x86[-64].
This changes only the disassembler part of the instruction definitions;
with respect to assembly LOCK already was a true prefix instruction and
REP/REPE/REPNE remain instructions in their own right.

Delete the scores of instruction formats and printer clauses that are
made obsolete by this change. Two printer clauses are still needed for
each of those SSE instructions that use the REX prefix in an infix
position.

An example of the changes in the disassembler output (on x86-64):
Old:

;     5FFC:       F0               LOCK
;     5FFD:       480FB171F9       CMPXCHG [RCX-7], RSI

New:

;       4C:       F0480FB171F9     LOCK CMPXCHG [RCX-7], RSI

12 years agoCorrections to disassembly of SHLD, SHRD and LEA on x86[-64].
Lutz Euler [Wed, 14 Dec 2011 17:11:53 +0000 (18:11 +0100)]
Corrections to disassembly of SHLD, SHRD and LEA on x86[-64].

The double shifts were wrongly matching the bit pattern of some CMOV
variants. Corrected by using another instruction format on x86-64 and
by adding a constraint on the WIDTH field on x86. This made it possible
to enable the variant with an immediate shift count. On x86-64, changed
the maximum immediate shift count from 31 to 63.

Also, on x86-64, one of the printers for LEA was missing a WIDTH field
restriction, thus wrongly matching a "MOV to segment register", too.

12 years agoMake some disassembler parameters effectual.
Lutz Euler [Wed, 14 Dec 2011 17:11:53 +0000 (18:11 +0100)]
Make some disassembler parameters effectual.

In the context of changing the treatment of prefix instructions in the
disassembler I came across somewhat broken code to parametrize it.
This might as well be repaired, so:

Correct the calculation of the DSTATE's ARGUMENT-COLUMN which is
intended to set a minimal field width for the opcode column. It needs
to take *DISASSEM-INST-COLUMN-WIDTH* and a few more column separators
into account. So as not to confuse users, restore the previous behaviour
by setting *DISASSEM-OPCODE-COLUMN-WIDTH* to 0.

Don't emit instruction bytes when *DISASSEM-INST-COLUMN-WIDTH* is 0.

Whitespace correction in ALIGNMENT-HOOK.

Playing with these two parameters allows to select different disassembly
formats (example from x86-64):

Current:

;      E11: L7:   4881FB17001020   CMP RBX, 537919511
;      E18:       0F8480000000     JEQ L13

(setf SB-DISASSEM::*DISASSEM-INST-COLUMN-WIDTH* 0)

;      E11: L7:   CMP RBX, 537919511
;      E18:       JEQ L13

(setf SB-DISASSEM:*DISASSEM-OPCODE-COLUMN-WIDTH* 8)

;      E11: L7:   CMP     RBX, 537919511
;      E18:       JEQ     L13

12 years agoMake the disassembler understand instruction prefixes.
Lutz Euler [Wed, 14 Dec 2011 17:11:53 +0000 (18:11 +0100)]
Make the disassembler understand instruction prefixes.

Instructions having NIL as their printer are treated as prefixes,
meaning that they are printed on the same line as the following
instruction. If an instruction's PRINT-NAME is NIL, too, this prefix
is not printed (but prefilters etc. are run). Any number of prefix
instructions can occur in immediate succession before a non-prefix
instruction.

This commit only provides the infrastructure; its impact is currently
limited as there aren't any instructions having NIL as their printer.

The motivation for this change comes from x86[-64]: One goal is to make
instructions using prefixes like LOCK and REP print nicer, the other
to reduce the combinatorial explosion of instruction formats in the
disassembler that is currently needed to deal with the possible
combinations of the REX and the operand size override (#x66) prefixes
and that would become unbearable once the aforementioned and the segment
override prefixes are added.

Extend the existing beginnings of support for prefix instructions in
MAP-SEGMENT-INSTRUCTIONS to collect prefix names and to print them at
the right time, which is at the next non-prefix instruction, when a
non-decodable instruction is encountered or at the end of the segment.
Change the semantics of DSTATE-INST-PROPERTIES: This list is now emptied
only after a non-prefix instruction has been processed.

Abstract out the filling of the column containing the instruction bytes
into the new function PAD-INST-COLUMN and use it in several places.

Clean up whitespace and improve line breaks.

12 years agoFix EQL constraint propagation on constant assigned closure variables
Paul Khuong [Tue, 13 Dec 2011 18:26:05 +0000 (13:26 -0500)]
Fix EQL constraint propagation on constant assigned closure variables

 * Constant lvars can now be references to assigned-to closure-
   converted lambda-vars, which don't have consets.  Just always use
   lvar-value, at the cost of a slight potential slowdown due to more
   calls to find-constant.

   Reported by Eric Marsden on sbcl-devel.

 * Also, canonicalize whitespace in dynamic-extent tests.

 Fixes lp#903838.

12 years ago(NO-CONSING SPECIALIZED-DX-VECTORS) fails on sunos/x86. Mark this.
Jim Wise [Tue, 13 Dec 2011 15:58:49 +0000 (10:58 -0500)]
(NO-CONSING SPECIALIZED-DX-VECTORS) fails on sunos/x86.  Mark this.

12 years agoprotect against read-time package-lock circumvention from LOCKED::(BAR)
Nikodemus Siivola [Mon, 12 Dec 2011 12:42:35 +0000 (14:42 +0200)]
protect against read-time package-lock circumvention from LOCKED::(BAR)

  Instead of binding *PACKAGE*, bind *READER-PACKAGE* which only
  affects the package READ-TOKEN interns into in the absence of a
  prefix.

  lp#902806

12 years agoremove etags as a build-time dependency
Nikodemus Siivola [Mon, 12 Dec 2011 12:34:56 +0000 (14:34 +0200)]
remove etags as a build-time dependency

  Do try to build TAGS by default, but if etags isn't there, don't
  make a fuss.

  lp#903145

12 years agoFix clisp-hosted build.
Joshua Elsasser [Sat, 10 Dec 2011 22:18:01 +0000 (14:18 -0800)]
Fix clisp-hosted build.

12 years agostack-allocatable fill-initialized specialized arrays, take 2
Nikodemus Siivola [Sat, 10 Dec 2011 21:01:19 +0000 (23:01 +0200)]
stack-allocatable fill-initialized specialized arrays, take 2

  Really fix lp#902537.

  Turns out multiple references to the stack allocated vector complicate
  things /just/ sufficiently the that DX machinery can't keep up. (I because
  the code that allocates and initializes the vector isn't substituted at the
  use-site due to multiple references.)

  While it would be nice to make it smart enough to deal with
  non-let-converted WITH-ARRAY-DATA, that looks a bit tricky... so instead
  simplify things in the FILL transform when the vector is a simple-array.

12 years agofaster VECTOR-SUBSEQ*
Nikodemus Siivola [Sat, 10 Dec 2011 17:07:53 +0000 (19:07 +0200)]
faster VECTOR-SUBSEQ*

  Use a WITH-ARRAY-DATA to get to the underlying vector, and use a widetag
  dispatch table to pick the correct SUBSEQ implementation for the underlying
  type.

  This is actually just as fast even for simple strings as STRING-SUBSEQ*, so
  throw it out.

  Also make inlining SUBSEQ conditional on SPEED > SPACE now that the
  out-of-line version doesn't suck so much.

  Fixes lp#902537.

12 years agostack-allocatable fill-initialized specialized arrays
Nikodemus Siivola [Sat, 10 Dec 2011 00:25:51 +0000 (02:25 +0200)]
stack-allocatable fill-initialized specialized arrays

 I *think* we had this working earlier already, but it's been broken at least
 for a while now since there were no tests for it.

 Add a DEFKNOWN to the array byte bashers, providing the RESULT-ARG -- and
 make them return the sequence.

 Replace the unused and bitrotted UNSAFE IR1 attribute with its inverse:
 DX-SAFE, and use that togather with RESULT-ARG to allow multiple refs to
 potentially DX leafs. Still accept UNSAFE in DEFKNOWNs occurring in
 user-code, but ignore it and give a style-warning.

 For now, add DX-SAFE to LENGTH and VECTOR-LENGTH, which is enough for our
 purposes.

 Fixes lp#902351.

12 years agoremove MUFFLE-CONDITION from the FILL transform
Nikodemus Siivola [Fri, 9 Dec 2011 23:12:27 +0000 (01:12 +0200)]
remove MUFFLE-CONDITION from the FILL transform

  It hides failure to stack allocate results of a MAKE-ARRAY with non-zero
  initial-element and non-T element-type.

  Part of lp#902351.

12 years agomake DESCRIBE report IR1 attributes for known functions
Nikodemus Siivola [Sat, 10 Dec 2011 10:27:08 +0000 (12:27 +0200)]
make DESCRIBE report IR1 attributes for known functions

12 years agofix errors from stack allocation compiler notes
Nikodemus Siivola [Fri, 9 Dec 2011 20:51:55 +0000 (22:51 +0200)]
fix errors from stack allocation compiler notes

  AKA, error reporting is hard.

12 years agoWITH-SPINLOCK compatibility layer was broken
Nikodemus Siivola [Fri, 9 Dec 2011 19:00:44 +0000 (21:00 +0200)]
WITH-SPINLOCK compatibility layer was broken

  Copy-paste damage from WITH-RECURSIVE-LOCK, looks like.  We don't have a
  WITH-LOCK and never did, should be WITH-MUTEX.

12 years agorefactor FOP table and stack handling
Nikodemus Siivola [Fri, 9 Dec 2011 18:39:49 +0000 (20:39 +0200)]
refactor FOP table and stack handling

 Just two special variables *FOP-TABLE* and *FOP-STACK*.

 Both hold a simple-vector, whose first index holds the index of the last
 element. These are always freshly allocated -- no more *FREE-FOP-TABLES*
 dirtying up the old generations.

 Define a semi-opaque interface for manipulating the stack and the
 table. (Mainly replacing explicit SVREF's with REF-FOP-TABLE.)

 ...and lo! Our fasl-loading speed sucks 5-10% less.

12 years agodelete *FASL-SYMBOL-BUFFER*
Nikodemus Siivola [Fri, 9 Dec 2011 15:04:52 +0000 (17:04 +0200)]
delete *FASL-SYMBOL-BUFFER*

  Instead allocate the right-sized string every time, and add
  :NO-COPY option to INTERN* and use it in AUX-FOP-INTERN to
  avoid copying when interning.

12 years agorename FOP-INTERN AUX-FOP-INTERN for clarity
Nikodemus Siivola [Fri, 9 Dec 2011 15:00:00 +0000 (17:00 +0200)]
rename FOP-INTERN AUX-FOP-INTERN for clarity

  ...so as not to confuse it with actual FOPs.

12 years agouse FAST-READ-BYTE in LOAD-S-INTEGER
Nikodemus Siivola [Fri, 9 Dec 2011 14:56:10 +0000 (16:56 +0200)]
use FAST-READ-BYTE in LOAD-S-INTEGER

  No reason not to.

12 years agooptimize READ-STRING-AS-[BYTES|UNSIGNED-BYTE-32]
Nikodemus Siivola [Fri, 9 Dec 2011 08:26:00 +0000 (10:26 +0200)]
optimize READ-STRING-AS-[BYTES|UNSIGNED-BYTE-32]

  Use FAST-READ-BYTE / FAST-READ-U-INTEGER, and add a separate
  READ-BASE-STRING-AS-BYTES.

  This actually makes a difference in FASL-loading speed.

12 years agoeasier to read FAST-READ-U-INTEGER expansion
Nikodemus Siivola [Fri, 9 Dec 2011 13:42:04 +0000 (15:42 +0200)]
easier to read FAST-READ-U-INTEGER expansion

12 years agoFAST-READ-BYTE refactoring
Nikodemus Siivola [Fri, 9 Dec 2011 08:23:24 +0000 (10:23 +0200)]
FAST-READ-BYTE refactoring

  Change PREPARE-FOR-FAST-READ-BYTE into WITH-FAST-READ-BYTE.

  DONE-WITH-FAST-READ-BYTE is gone.

  FAST-READ-BYTE is a local inline function instead of a macro.

12 years agoMake COERCE on characters more standard-conforming.
Lutz Euler [Fri, 9 Dec 2011 20:25:08 +0000 (21:25 +0100)]
Make COERCE on characters more standard-conforming.

Characters could be coerced to subtypes of CHARACTER to which they
don't belong. Also, character designators that are not characters
could be coerced to proper subtypes of CHARACTER. Make all of these
instead signal an error as required by CLHS COERCE.

Add test cases, both for unicode-enabled and non-unicode-enabled SBCL.

Fixes lp#841312.

12 years agoAdd tools-for-build/determine-endianness to .gitignore.
Alastair Bridgewater [Fri, 9 Dec 2011 16:23:44 +0000 (11:23 -0500)]
Add tools-for-build/determine-endianness to .gitignore.

  * Nothing more need be said.

12 years agoFix build on CHENEYGC targets.
Alastair Bridgewater [Fri, 9 Dec 2011 16:20:46 +0000 (11:20 -0500)]
Fix build on CHENEYGC targets.

  * Conflicting definitions of alloc_region, both useless.

  * Remove both definitions from visibility in print.c, and add an
explicit error in gencgc-alloc-region.h to help diagnosis if this
ever crops up again.

12 years agotest for bug 308926
Nikodemus Siivola [Fri, 9 Dec 2011 13:06:10 +0000 (15:06 +0200)]
test for bug 308926

  Seems to be good now, let's keep it that way.

12 years agotest for bug 308941
Nikodemus Siivola [Fri, 9 Dec 2011 12:53:54 +0000 (14:53 +0200)]
test for bug 308941

  Has fixed itself at some point, let's keep it from regressing.

12 years agorefactor symbol interning FOPs
Nikodemus Siivola [Fri, 9 Dec 2011 12:35:01 +0000 (14:35 +0200)]
refactor symbol interning FOPs

  Put the shared logic into FOP-INTERN.

12 years agomake DEFINE-FOP use &BODY instead of &REST
Nikodemus Siivola [Fri, 9 Dec 2011 08:11:49 +0000 (10:11 +0200)]
make DEFINE-FOP use &BODY instead of &REST

12 years agobetter "cannot stack allocate" compiler notes
Nikodemus Siivola [Fri, 9 Dec 2011 09:53:18 +0000 (11:53 +0200)]
better "cannot stack allocate" compiler notes

  When the note refers to failure to allocate an argument,
  say so -- instead of claiming to be unable to stack allocate
  the entire function, which is both silly and wrong.

  Also prettier formatting.

12 years agomake TRIVIAL-LAMBDA-VAR-REF-P false for XEPs
Nikodemus Siivola [Fri, 9 Dec 2011 09:49:19 +0000 (11:49 +0200)]
make TRIVIAL-LAMBDA-VAR-REF-P false for XEPs

  Also clean up TRIVIAL-LAMBDA-VAR-REF-LVAR.

  Fixes lp#803508.

12 years agoSilence two style warnings from the test harness.
Lutz Euler [Thu, 8 Dec 2011 22:28:52 +0000 (23:28 +0100)]
Silence two style warnings from the test harness.

Currently running any test emits a warning that REALLY-INVOKE-DEBUGGER
is undefined. Running any test that uses IMPURE-RUNNER additionally
emits a warning that *BREAK-ON-ERROR*'s lexical binding is used despite
its name indicating specialness.

Silence these two by moving the definition of REALLY-INVOKE-DEBUGGER
before its use and by adding a SPECIAL declaration for *BREAK-ON-ERROR*
in RUN-IMPURE-IN-CHILD-SBCL in a form that is executed in the child
SBCL.

12 years agofix tyop in ONLY-ONE-BOXED-CONSTANT-FOR-MULTIPLE-USES that broke it
Nikodemus Siivola [Thu, 8 Dec 2011 18:09:00 +0000 (20:09 +0200)]
fix tyop in ONLY-ONE-BOXED-CONSTANT-FOR-MULTIPLE-USES that broke it

  s/'/`/

12 years agorobustify ONLY-ONE-BOXED-CONSTANT-FOR-MULTIPLE-USES test
Nikodemus Siivola [Thu, 8 Dec 2011 15:54:39 +0000 (17:54 +0200)]
robustify ONLY-ONE-BOXED-CONSTANT-FOR-MULTIPLE-USES test

  Was broken on x86 due to test fragility.

12 years agouse COMPONENT-TOPLEVELISH-P in CHECK-CONSISTENCY
Nikodemus Siivola [Thu, 8 Dec 2011 15:50:58 +0000 (17:50 +0200)]
use COMPONENT-TOPLEVELISH-P in CHECK-CONSISTENCY

 Fixes lp#308921 -- bug was in the consistency checking, not the compiler
 itself.

12 years agoexplicit :BIG-ENDIAN feature
Luis Oliveira [Thu, 8 Dec 2011 14:56:01 +0000 (16:56 +0200)]
explicit :BIG-ENDIAN feature

 Instead of implying big-endianness by lack of the :LITTLE-ENDIAN feature,
 make it explicit.

12 years agoFix transform for SEARCH on vectors with :form-end t.
Stas Boukarev [Thu, 8 Dec 2011 15:22:12 +0000 (19:22 +0400)]
Fix transform for SEARCH on vectors with :form-end t.

When from-end is specified, start2 becomes end2 and the other way
around, so return star2 or end2 accordingly when testing for an empty
subsequence.

12 years agoFix transform for SEARCH on vectors.
Stas Boukarev [Thu, 8 Dec 2011 14:42:20 +0000 (18:42 +0400)]
Fix transform for SEARCH on vectors.

An empty first sequence means that (= start1 end1) and it will match
the second sequence anywhere starting from start2, so return start2
in case of (= start1 end1).

12 years agomissing NEWS for the last few commits
Nikodemus Siivola [Thu, 8 Dec 2011 12:12:48 +0000 (14:12 +0200)]
missing NEWS for the last few commits

12 years agorun-program leaked a pipe per call
Nikodemus Siivola [Wed, 7 Dec 2011 17:48:39 +0000 (19:48 +0200)]
run-program leaked a pipe per call

  exec-failure detection neglected to close the other side of the pipe.

12 years agogencgc: bogus memory fault handling
Nikodemus Siivola [Wed, 7 Dec 2011 10:24:54 +0000 (12:24 +0200)]
gencgc: bogus memory fault handling

 Add more debugging information when a bogus memory fault occurs,
 and two control variables:

  continue_after_memoryfault_on_unprotected_page
  ignore_memoryfaults_on_unprotected_pages

 The first just prevents us from lose()ing. Set it in darwin_init() as we
 genuinely appear to get bogus memory faults in threaded code from the kernel,
 which point to unprotected boxed pages. They are possibly something we could
 filter out in catch_exception_raise... but don't see how. Experimentally
 continuing after such them seems harmless, so let's try that but make it
 noisy.

 The second one silences the debugging output completely. Not set currently at
 all.

12 years agobetter deadlock reporting
Nikodemus Siivola [Wed, 7 Dec 2011 14:21:15 +0000 (16:21 +0200)]
better deadlock reporting

  Print the cycle properly, so it makes sense even after the deadlock is gone,
  which is now case always by the time it is reported.

  Since we now break deadlocks before signaling the error, don't barf to
  stderr anymore.

12 years agodarwin: dladdr can deadlock the GC
Nikodemus Siivola [Wed, 7 Dec 2011 13:41:45 +0000 (15:41 +0200)]
darwin: dladdr can deadlock the GC

  Needs to be always called inside WITHOUT-GCING since it grabs locks, and is
  /sometimes/ called inside WITHOUT-GCING.

12 years agoavoid recursive errors from broken standard streams on debugger entry
Nikodemus Siivola [Wed, 7 Dec 2011 07:06:46 +0000 (09:06 +0200)]
avoid recursive errors from broken standard streams on debugger entry

  Handle STREAM-ERORRS in FLUSH-STANDARD-OUTPUT-STREAMS.

12 years agoDESCRIBE improvements
Nikodemus Siivola [Tue, 6 Dec 2011 00:07:24 +0000 (02:07 +0200)]
DESCRIBE improvements

 * Nicer DESCRIBE for type designators. Use TYPEXPAND-1 to get it done right.

 * Bind *PRINT-CIRCLE* to NIL around lambda-list printing, but compensate with
   *PRINT-LEVEL* and *PRINT-LENGTH* for sanity's sake.

12 years agoDocument --fancy.
Jim Wise [Tue, 6 Dec 2011 16:22:51 +0000 (11:22 -0500)]
Document --fancy.

While here, put list of features set by --fancy into $FANCY_FEATURES,
so documentation doesn't fall out of sync with what option does.

12 years agoAdd :CHENEYGC feature to non-GENCGC targets.
Alastair Bridgewater [Tue, 6 Dec 2011 16:05:53 +0000 (11:05 -0500)]
Add :CHENEYGC feature to non-GENCGC targets.

  * When I wrote 14fd5afbac525e7a2e86903070afa0e94dfa14f7 I was
under the impression that there was a :CHENEYGC feature used on
plaforms that used the cheney collector.  This was logical, but
incorrect.

  * The two ways forward were to back out the use of :CHENEYGC
as a feature when checking compatibility or to move forward and
add :CHENEYGC and use it in preference to (NOT :GENCGC) where
appropriate, opening the door to a third GC option.

  * This is the minimal fix, adding :cheneygc to the non-gencgc
targets in make-config.sh.

12 years agoAdd src/runtime/TAGS to .gitignore.
Alastair Bridgewater [Tue, 6 Dec 2011 16:00:56 +0000 (11:00 -0500)]
Add src/runtime/TAGS to .gitignore.

  * We build TAGS by default now, so make it not show up in git.

12 years agofix ONLY-ONE-BOXED-CONSTANT-FOR-MULTIPLE-USES test
Nikodemus Siivola [Mon, 5 Dec 2011 23:55:30 +0000 (01:55 +0200)]
fix ONLY-ONE-BOXED-CONSTANT-FOR-MULTIPLE-USES test

  Feh.

12 years agodon't stack-allocate specialized vectors on non-conservtive control stacks
Nikodemus Siivola [Mon, 5 Dec 2011 23:14:22 +0000 (01:14 +0200)]
don't stack-allocate specialized vectors on non-conservtive control stacks

  ...cos that would be bad. Currently affects only MIPS.

12 years agofix doubled unboxed constants when there is no immediate representation
Nikodemus Siivola [Mon, 5 Dec 2011 22:36:51 +0000 (00:36 +0200)]
fix doubled unboxed constants when there is no immediate representation

  The recent changes to handling of boxed constants indvertently cause them to
  be duplicated when there was not immediate representation at all, and both an
  unboxed and a boxed representaion would have been desirable.

12 years agoImproved undefined-function backtrace on PPC.
Alastair Bridgewater [Thu, 1 Dec 2011 22:03:26 +0000 (17:03 -0500)]
Improved undefined-function backtrace on PPC.

When there is an existing stack frame (either for a large number
of arguments or for a tail-call), undefined_tramp triggers a
strange case in build_fake_control_stack_frames() that can leave
the OCFP and LRA slots uninitialized, causing a truncated
backtrace.

  * Alter undefined_tramp to always allocate and initialize a
stack frame.

  * While we're here, tighten up the reg_CODE initialization
sequence.

12 years agoImproved undefined-function backtrace on non-x86oids.
Alastair Bridgewater [Wed, 30 Nov 2011 16:41:55 +0000 (11:41 -0500)]
Improved undefined-function backtrace on non-x86oids.

  * Instead of "bogus stack frame", present undefined function
frames as "undefined function".

  * Implement this by checking specifically for the undefined
function trampoline function object (which otherwise fails
pointer validation) in MAKE-LISP-OBJ, and allowing the existing
logic to do what it was always supposed to do.

  * Tested on PPC only, but should work on the other affected
targets.

12 years agoImproved undefined-function backtrace on x86oids.
Alastair Bridgewater [Wed, 30 Nov 2011 15:32:40 +0000 (10:32 -0500)]
Improved undefined-function backtrace on x86oids.

  * Instead of "bogus stack frame", present undefined function
frames as "undefined function".

  * Implement this by checking specifically for escaped frames
with the program counter within the range between the start of
undefined_tramp and the start of whichever function follows it
in $ARCH-assem.S.

12 years agofix make.sh --dynamic-space-size option handling
Manfred Gahr [Mon, 5 Dec 2011 21:37:53 +0000 (23:37 +0200)]
fix make.sh --dynamic-space-size option handling

 !CONFIGURE-DYNAMIC-SPACE-END actually ignored the number it read.

12 years agofix threaded PPC build, refactor new semaphore code
Nikodemus Siivola [Mon, 5 Dec 2011 17:39:57 +0000 (19:39 +0200)]
fix threaded PPC build, refactor new semaphore code

 Refactor the recent semaphore code into nicer shape.

 * No point in having these functions as inline functions.

 * Move shared logic to os-common.c, and conditionalize it on
   CANNOT_USE_POSIX_SEM_T, which platform specific headers can define if they
   implement their own versions. (Darwin now, Windows in the future.)

 * PPC needs genesis/thread.h in assembly, not thread.h.

12 years agofix unthreaded non-x86oid builds
Nikodemus Siivola [Mon, 5 Dec 2011 18:33:08 +0000 (20:33 +0200)]
fix unthreaded non-x86oid builds

 Better representation selection for constants broke things, since it assumed
 that IMMEDIATE is the only immediate boxed SC -- which is true only on
 x86oids: elsewhere there is also NULL and ZERO.

 Add new VM support routine: BOXED-IMMEDIATE-SC-P.

12 years agoenable previously-broken thread tests on Darwin
Nikodemus Siivola [Sun, 4 Dec 2011 17:19:33 +0000 (19:19 +0200)]
enable previously-broken thread tests on Darwin

  WIN!?

  I have not been able to make threaded SBCL on Darwin croak yet with the
  semaphore implementation in the previous commit, so ... maybe.

  I suspect the sb-concurrency tests can now be enabled on SunOS as well, but
  since I don't have a box to test that hypothesis on, leaving them disabled
  for now.

12 years agosemaphores in the runtime
Nikodemus Siivola [Fri, 18 Nov 2011 20:37:22 +0000 (22:37 +0200)]
semaphores in the runtime

  Trivial refactorings:

  * Rename STATE_SUSPENDED STATE_STOPPED for elegance. (Spells with the same
    number of letters as STATE_RUNNING, things line up nicer.)

  * Re-express make_fixnum in terms of MAKE_FIXNUM so that we can use the
    latter to define STATE_* names in a manner acceptable to use in
    switch-statements.

  * Move Mach exception handling initialization to darwin_init from
    create_initial_thread so that current_mach_task gets initialized before
    the first thread struct is initialized.

  The Beef:

    Replace condition variables in the runtime with semaphores.

    On most platforms use sem_t, but on Darwin use semaphore_t. Hide the
    difference behind, os_sem_t, os_sem_init, os_sem_destroy, os_sem_post, and
    os_sem_wait.

    POSIX realtime semaphores are supposedly safe to use in signal handlers,
    unlike condition variables -- and experimentally at least Mach semaphores
    on Darwin are a lot less prone to problems.

    (Our pthread mutex usage isn't quite kosher either, but it's the
    pthread_cond_wait and pthread_cond_broadcast pair that seemed to be
    causing most of the trouble.)

12 years agotests: fix :skipped-on clause for weak hash-table tests.
Alastair Bridgewater [Mon, 5 Dec 2011 14:35:53 +0000 (09:35 -0500)]
tests: fix :skipped-on clause for weak hash-table tests.

  * During the original addition of :skipped-on, the condition for
skipping the weak hash-table tests was changed from "non-threaded
x86oids" to "everything but threaded non-x86oids".  The actual
condition should be "non-threaded conservatively-scavenged-stack".

12 years agotests: Add --report-skipped-tests option to the test runner.
Alastair Bridgewater [Mon, 5 Dec 2011 14:33:43 +0000 (09:33 -0500)]
tests: Add --report-skipped-tests option to the test runner.

  * It is occasionally useful to see precisely which tests are
skipped on a given target, and there was no obvious way to so do.

12 years agoFail early when building with known-incompatible features.
Alastair Bridgewater [Mon, 5 Dec 2011 14:30:09 +0000 (09:30 -0500)]
Fail early when building with known-incompatible features.

  * Essentially, fail as soon as we have the final shebang feature
list available.

  * Only checks a small number of "obvious" cases for now.

12 years agoFix my previous commit on setf expansions.
Stas Boukarev [Mon, 5 Dec 2011 11:47:13 +0000 (15:47 +0400)]
Fix my previous commit on setf expansions.

Fix the case when `default' in (setf (getf x y default) z) isn't provided.

Add tests.

12 years agoadjust the new MALLOC-FAILURE test for 32-bit builds
Nikodemus Siivola [Mon, 5 Dec 2011 11:18:08 +0000 (13:18 +0200)]
adjust the new MALLOC-FAILURE test for 32-bit builds

  ...where malloc of (1- array-total-size-limit) bytes may actually
  succeed initially.

12 years agoRemove unused variable warnings in some setf expansions.
Stas Boukarev [Mon, 5 Dec 2011 11:22:53 +0000 (15:22 +0400)]
Remove unused variable warnings in some setf expansions.

(let (list) (setf (getf list 'x 0) 10)) produced a style-warning on a
temporary variable for holding 0, which is unused.

Fixes lp#492071.

12 years agoallow coercion of large fixnums to floats outside x86
Nikodemus Siivola [Sun, 23 Oct 2011 13:04:36 +0000 (16:04 +0300)]
allow coercion of large fixnums to floats outside x86

 The reason we need guard against this on x86 is due to the FPU there always
 using double-precision internally, which can lead to us deriving an
 inconsistent type unless the fixnum is exactly represented by a single-float.

 However, no such danger exists outside x86.

 (Test-suite already contains tests for this.)

12 years agoadd support for package::form-read-in-package syntax
Nikodemus Siivola [Sat, 3 Dec 2011 09:01:25 +0000 (11:01 +0200)]
add support for package::form-read-in-package syntax

   sb-c::(csubtypep (specifier-type 'fixnum) (specifier-type 'integer))

 Isn't that lovely? The superbly fantasic thing is that this even works
 *right* with package locks:

    (in-package :cl-user)

    sb-c::(defun some-internal-bit ...)

  causes a package lock violation since the current package is back to CL-USER
  by the type the code is executed.

12 years agoprinting specialized arrays readably
Robert Brown [Fri, 2 Dec 2011 15:07:20 +0000 (17:07 +0200)]
printing specialized arrays readably

  When *READ-EVAL* is true, use #. based syntax to print them.

  lp#803665.

12 years agouse *SUPPRESS-PRINT-ERRORS* for backtraces and DESCRIBE
Nikodemus Siivola [Sun, 4 Dec 2011 10:40:07 +0000 (12:40 +0200)]
use *SUPPRESS-PRINT-ERRORS* for backtraces and DESCRIBE

 The suppression mechanism is a bit more informative than the old #<error
 printing object> marker for BACKTRACE, and DESCRIBE didn't really have
 anything before this.

 Also bind *PRINT-CIRCLE* to T for BACKTRACE, and use the PRINT-UNREADABLY
 restart for PRINT-NOT-READABLE errors.

12 years agoadd SB-EXT:*SUPPRESS-PRINT-ERRORS* modelled after *BREAK-ON-SIGNALS*
Attila Lendvai [Fri, 28 Jan 2011 15:09:47 +0000 (16:09 +0100)]
add SB-EXT:*SUPPRESS-PRINT-ERRORS* modelled after *BREAK-ON-SIGNALS*

  When non-NIL, OUTPUT-OBJECT (our main entry to the printer) binds a handler
  that handles conditions of the specified type by printing an error marker
  instead of signaling an error.

  WRITE also accepts :SUPPRESS-ERRORS, and WITH-STANDARD-IO-SYNTAX binds it to
  NIL.

  Calls SIGNAL before handling the condition so outer handlers get a chance to
  use restarts, etc.

12 years agomuffle style-warnings for INFO :FUNCTION :TYPE
Nikodemus Siivola [Fri, 2 Dec 2011 12:20:08 +0000 (14:20 +0200)]
muffle style-warnings for INFO :FUNCTION :TYPE

  Even if the function object's type contains unknown types, this is not the
  right place to complain about them.

  lp#806243

12 years agodefine SB-EXT:PRINT-UNREADABLY as a function
Nikodemus Siivola [Fri, 2 Dec 2011 11:18:00 +0000 (13:18 +0200)]
define SB-EXT:PRINT-UNREADABLY as a function

  So

    (handler-bind ((print-not-readable #'print-unreadably))
       ...)

  works.

12 years agosilent non-toplevel DEFSTRUCT
Nikodemus Siivola [Thu, 1 Dec 2011 18:45:19 +0000 (20:45 +0200)]
silent non-toplevel DEFSTRUCT

  Use TRULY-THE in the constructor inline expansion only if the compiler knows
  the layout: using it for the lazy version doesn't help, and only causes a
  STYLE-WARNING.

12 years agodon't simplify (LET () ..) => (LOCALLY ...) in the simple evalutor
Nikodemus Siivola [Thu, 1 Dec 2011 19:05:43 +0000 (21:05 +0200)]
don't simplify (LET () ..) => (LOCALLY ...) in the simple evalutor

  If LET is at toplevel its subforms are not.

  If LOCALLY is at toplevel its subforms are also at toplevel.

12 years agoless rebindings in defmethods
Nikodemus Siivola [Thu, 1 Dec 2011 09:53:32 +0000 (11:53 +0200)]
less rebindings in defmethods

  PCL needs to rebind DEFMETHOD arguments when they are assigned to:

  * CALL-NEXT-METHOD needs the originals.

  * We apply an implicit declaration to the original from the specializer,
    which an assignment can violate.

  There is, however, no need to bind everything simply because /something/ is
  assigned to.

  Fixed lp#898331.

12 years agomore conservative subtypep test for classoids
Nikodemus Siivola [Wed, 30 Nov 2011 10:21:05 +0000 (12:21 +0200)]
more conservative subtypep test for classoids

 * Give NIL, NIL for invalid classoids with forward-referenced superclasses
   instead of signaling an error during SUBTYPEP.

 * If we can't tell it's a subtype and either has a forward-referenced
   superclass we can't tell for sure it isn't -- meaning NIL, NIL instead of
   NIL, T.

 Fixes the second half of lp#888630.

12 years agoMAKE-ALIEN improvements
Nikodemus Siivola [Mon, 28 Nov 2011 12:15:31 +0000 (14:15 +0200)]
MAKE-ALIEN improvements

 * Move more of the bytes-calculation to macroexpansion time.

 * Change %MAKE-ALIEN to take bytes instead of bits, so that --in theory at
   least-- chunks upto ARRAY-DIMENSION-LIMIT-1 bytes can be allocated.

 * Use ALIEN-FUNCALL-SAVES-FP-AND-PC 0.

 * Detect malloc() failure and signal a storage-condition for it.  Fixes
   lp#891268.

12 years agostricter handling of declarations in DEFGENERIC
Nikodemus Siivola [Mon, 28 Nov 2011 11:59:34 +0000 (13:59 +0200)]
stricter handling of declarations in DEFGENERIC

  Warn about unrecognized declarations.

  lp#894202

12 years agofix style-warnings for condition slot-accessors used in :REPORT
Nikodemus Siivola [Mon, 28 Nov 2011 11:35:54 +0000 (13:35 +0200)]
fix style-warnings for condition slot-accessors used in :REPORT

  Previously condition slot accessors used in :REPORT option signaled
  a style-warning under EVAL and LOAD (as source): the compiler saw
  the lambda before the accessor had been proclaimed as functions.

  Fixes lp#896379.

12 years agouse boxed constants for full calls
Nikodemus Siivola [Mon, 5 Dec 2011 09:06:40 +0000 (11:06 +0200)]
use boxed constants for full calls

 If a constant is being used in a full call, use a boxed representation
 instead of an inline one which must then be boxed at runtime.  Also arrange
 to have both an immediate unboxed and a boxed representation when
 advantageous.

 (There might be other cases besides full calls where we should prefer boxed
 representations, but that's for later.)

12 years agono need for BOOT-MAKE-WRAPPER on target
Nikodemus Siivola [Wed, 30 Nov 2011 10:05:25 +0000 (12:05 +0200)]
no need for BOOT-MAKE-WRAPPER on target

  Rename it !BOOT-MAKE-WRAPPER.

12 years agochange an AVER to CERROR 'bug
Nikodemus Siivola [Sat, 29 Oct 2011 12:35:57 +0000 (15:35 +0300)]
change an AVER to CERROR 'bug

  Hopefully making it easier to debug.

12 years agoimprove the SB-EXT:GC docstring(s)
Nikodemus Siivola [Mon, 28 Nov 2011 10:54:54 +0000 (12:54 +0200)]
improve the SB-EXT:GC docstring(s)

12 years agofix misoptimization of TRUNCATE
Nikodemus Siivola [Thu, 1 Dec 2011 15:43:49 +0000 (17:43 +0200)]
fix misoptimization of TRUNCATE

  Reported by Eric Marsden on sbcl-devel 2011-12-01.

   "illegal instruction on PowerPC"

  We check for result type being a VALUES-TYPE-P when deciding if to compute
  the second value for TRUNCATE or not -- but *WILD-TYPE* isn't a values type.

  Make VALUES-TYPE-P return true for it from now on. What could possibly go
  wrong? Just two other places need to change, it seems.

12 years agofix bug in typechecking calls with non-constant keywords
Nikodemus Siivola [Thu, 1 Dec 2011 11:30:41 +0000 (13:30 +0200)]
fix bug in typechecking calls with non-constant keywords

 Reported by Eric Marsden on sbcl-devel 2011-12-01.

12 years agofix treatment of signed zeroes in INTERVAL-DIV
Nikodemus Siivola [Wed, 30 Nov 2011 13:34:30 +0000 (15:34 +0200)]
fix treatment of signed zeroes in INTERVAL-DIV

 Fixes bug reported by Eric Marsden on sbcl-devel: type derivation going wrong
 due to one signed zeroes: (/ 0.0 -neg) derives correctly as -0.0, but (/ 0
 -neg) derives as 0.0, causing the intersection to be empty causing badness.

 Simply remove special casing of division of zero from INTERVAL-DIV:
 BOUND-BINOP handles signed zeroes correctly, so no sense complicating the
 code by adding handling for them in I-D.

12 years agooops. actually stop when seeing --with-foo and customize-target-features.lisp
Nikodemus Siivola [Mon, 5 Dec 2011 09:25:51 +0000 (11:25 +0200)]
oops. actually stop when seeing --with-foo and customize-target-features.lisp

 ...instead of just complaining to the stdout.

12 years agomore robust deadlock detection
Nikodemus Siivola [Mon, 28 Nov 2011 17:45:16 +0000 (19:45 +0200)]
more robust deadlock detection

 Lock around building the deadlock chain using WITH-CAS-LOCK after the
 tentative deadlock has been detected, and break the deadlock chain before
 signaling the error.

 This means that a single deadlock is reported only in a single thread.

 Fixes occasional failures of deadlock-detection.1 due to a bogus vicious
 metacircle. (Two threads detecting the same deadlock, then racing to report
 the error detected as another deadlock, the reporting of which in turn looked
 like a metacircle to CLOS if PRINT-OBJECT didn't yet have the right method in
 cache.)

12 years agobuild runtime/TAGS by default
Nikodemus Siivola [Wed, 8 Jun 2011 12:22:46 +0000 (15:22 +0300)]
build runtime/TAGS by default

  Getting tired of needing to build it manually all the time.

12 years agoadd --fancy option to make.sh
Nikodemus Siivola [Fri, 2 Dec 2011 12:25:47 +0000 (14:25 +0200)]
add --fancy option to make.sh

  Enables threads, core compression, xref for internals, and
  after-xc-core. (The last one for convenience, even though it's not user
  visible.)

12 years agoadd --with-<feature> and --without-<feature> support to make.sh
Nikodemus Siivola [Thu, 1 Dec 2011 17:33:14 +0000 (19:33 +0200)]
add --with-<feature> and --without-<feature> support to make.sh

  customize-target-features.lisp still works, but the system refuses to mix it
  with --with[out] options to avoid confusion.

12 years agoadd --arch option to make.sh
Nikodemus Siivola [Wed, 30 Nov 2011 16:55:04 +0000 (18:55 +0200)]
add --arch option to make.sh

  Not for full-blown cross compilation, though.

12 years agomake make.sh run clean.sh
Nikodemus Siivola [Sun, 4 Dec 2011 08:32:47 +0000 (10:32 +0200)]
make make.sh run clean.sh

  Since eg. trying to build for different arches without cleaning
  in the middle will just break things.

  slam.sh is for those in a hurry.

12 years ago1.0.54: will be tagged as "sbcl-1.0.54"
Juho Snellman [Sun, 4 Dec 2011 23:09:00 +0000 (00:09 +0100)]
1.0.54: will be tagged as "sbcl-1.0.54"

12 years ago:backtrace-interrupted-condition-wait fails on x86 Linux
Juho Snellman [Sun, 4 Dec 2011 19:42:04 +0000 (20:42 +0100)]
:backtrace-interrupted-condition-wait fails on x86 Linux