Skip to content

Commit

Permalink
0.6.11.37:
Browse files Browse the repository at this point in the history
	MNA 2001-04-13 CHECK-TYPE/STORE-VALUE patch
	replaced CHECK-TYPE calls with lighter-weight stuff
	rewrote CHECK-TYPE-VAR with lighter-weight stuff
	redid STREAM-ASSOCIATED-WITH-FILE-P
	renamed PARSE-OPERANDS to !PARSE-VOP-OPERANDS, and
		GROVEL-OPERANDS to !GROVEL-VOP-OPERANDS, and
		PARSE-OPERAND-TYPES to !PARSE-VOP-OPERAND-TYPES
		(and queued up various FOO -> !FOO renamings for
		after Alpha port is merged)
	made INVALID-METHOD-ERROR and METHOD-COMBINATION-ERROR
		stop screwing around with DEFVARs
	added *DEBUG-BEGINNER-HELP-P*
  • Loading branch information
William Harold Newman committed Apr 15, 2001
1 parent f0338f6 commit 2c6b90e
Show file tree
Hide file tree
Showing 31 changed files with 391 additions and 416 deletions.
43 changes: 28 additions & 15 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,9 @@ changes in sbcl-0.6.12 relative to sbcl-0.6.11:
half a dozen bug fixes in pretty-printing and the debugger, and
half a dozen others elsewhere
* fixed bug 13: Floating point infinities are now supported again.
* fixed bug 45a: Various internal functions required to support
complex special functions have been merged from CMU CL sources.
(When I was first setting up SBCL, I misunderstood a compile-time
conditional #-OLD-SPECFUN, and so accidentally deleted them.)
They might still be a little bit flaky, but thanks to bug reports
from Nathan Froyd and CMU CL patches from Raymond Toy they're not
as flaky as they were.
* The --noprogrammer command line option is now supported. (Its
behavior is slightly different in detail from what the old man
page claimed it would do, but it's still appropriate under the
Expand All @@ -705,20 +704,34 @@ changes in sbcl-0.6.12 relative to sbcl-0.6.11:
handle many floating point and complex operations much less
inefficiently. (Thus e.g. you can implement a complex FFT
without consing!)
* improved support for type intersection and union, fixing bug 12
(e.g., now (SUBTYPEP 'KEYWORD 'SYMBOL)=>T,T) and some other
more obscure bugs as well
* The compiler now detects type mismatches between DECLAIM FTYPE
and DEFUN better, and implements CHECK-TYPE more correctly, and
SBCL builds under CMU CL again despite its non-ANSI EVAL-WHEN,
thanks to patches from Martin Atzmueller.
* various fixes to make the cross-compiler more portable to
ANSI-conforming-but-different cross-compilation hosts (notably
Lispworks for Windows, following bug reports from Arthur Lemmens)
* a new workaround to make the cross-compiler portable to CMU CL
again despite its non-ANSI EVAL-WHEN, thanks to Martin Atzmueller
* The compiler now detects type mismatches between DECLAIM FTYPE
and DEFUN better, thanks to patches from Martin Atzmueller.
* A bug in READ-SEQUENCE for CONCATENATED-STREAM has been fixed
thanks to Pierre Mai's CMU CL patch.
* new fasl file format version number (because of changes in byte
code opcodes and in internal representation of (OR ..) types)
* A bug in READ-SEQUENCE for CONCATENATED-STREAM, and a gross
ANSI noncompliance in DEFMACRO &KEY argument parsing, have been
fixed thanks to Pierre Mai's CMU CL patches.
* fixes to keep the system from overflowing internal counters when
it tries to use i/o buffers larger than 16M bytes
* fixed bug 45a: Various internal functions required to support
complex special functions have been merged from CMU CL sources.
(When I was first setting up SBCL, I misunderstood a compile-time
conditional #-OLD-SPECFUN, and so accidentally deleted them.)
* improved support for type intersection and union, fixing bug 12
(e.g., now (SUBTYPEP 'KEYWORD 'SYMBOL)=>T,T) and some other
more obscure bugs as well
* Christophe Rhodes has made some debian packages of sbcl at
<http:https://www-jcsu.jesus.cam.ac.uk/ftp/pub/debian/lisp>.
From his sbcl-devel e-mail of 2001-04-08 they're not completely
stable, but are nonetheless usable. When he's ready, I'd be happy
to add them to the SourceForge "File Releases" section. (And if
anyone wants to do RPMs or *BSD packages, they'd be welcome too.)
* new fasl file format version number (because of changes in
internal representation of (OR ..) types to accommodate the new
support for (AND ..) types, among other things)

planned incompatible changes in 0.7.x:
* The debugger prompt sequence now goes "5]", "5[2]", "5[3]", etc.
Expand Down
5 changes: 3 additions & 2 deletions package-data-list.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@
debugger interface mixed with various low-level implementation stuff
like *STACK-TOP-HINT*"
:use ("CL" "SB!EXT" "SB!INT" "SB!SYS")
:export ("*AUTO-EVAL-IN-FRAME*" "*DEBUG-CONDITION*"
:export ("*AUTO-EVAL-IN-FRAME*" "*DEBUG-BEGINNER-HELP-P*"
"*DEBUG-CONDITION*"
"*DEBUG-PRINT-LENGTH*" "*DEBUG-PRINT-LEVEL*"
"*DEBUG-READTABLE*" "*DEBUG-HELP-STRING*"
"*FLUSH-DEBUG-ERRORS*" "*IN-THE-DEBUGGER*"
Expand Down Expand Up @@ -669,7 +670,7 @@ retained, possibly temporariliy, because it might be used internally."
"ONCE-ONLY"
"DEFENUM"
"DEFPRINTER"
"AVER"
"AVER" "AVER-TYPE" "ENFORCE-TYPE"

;; ..and DEFTYPEs..
"INDEX"
Expand Down
8 changes: 3 additions & 5 deletions src/code/coerce.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@
;;; old working version
(defun coerce (object output-type-spec)
#!+sb-doc
"Coerces the Object to an object of type Output-Type-Spec."
"Coerce the Object to an object of type Output-Type-Spec."
(flet ((coerce-error ()
(/show0 "entering COERCE-ERROR")
(error 'simple-type-error
:format-control "~S can't be converted to type ~S."
:format-arguments (list object output-type-spec)))
(check-result (result)
#!+high-security
(check-type-var result output-type-spec)
#!+high-security (aver (typep result output-type-spec))
result))
(let ((type (specifier-type output-type-spec)))
(cond
Expand Down Expand Up @@ -256,8 +255,7 @@
:format-control "~S can't be converted to type ~S."
:format-arguments (list object output-type-spec)))
(check-result (result)
#!+high-security
(check-type-var result output-type-spec)
#!+high-security (aver (typep result output-type-spec))
result))
(let ((type (specifier-type output-type-spec)))
(cond
Expand Down
2 changes: 1 addition & 1 deletion src/code/cold-error.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
(sb!kernel:infinite-error-protect
(let ((condition (coerce-to-condition datum arguments
'simple-warning 'warn)))
(check-type condition warning "a warning condition")
(enforce-type condition warning)
(restart-case (signal condition)
(muffle-warning ()
:report "Skip warning."
Expand Down
68 changes: 34 additions & 34 deletions src/code/debug-int.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
;;; lists of DEBUG-BLOCKs. Then look up our argument IR1-BLOCK to find
;;; its DEBUG-BLOCK since we know we have it now.
(defun make-interpreted-debug-block (ir1-block)
(check-type ir1-block sb!c::cblock)
(declare (type sb!c::cblock ir1-block))
(let ((res (gethash ir1-block *ir1-block-debug-block*)))
(or res
(let ((lambda (sb!c::block-home-lambda ir1-block)))
Expand Down Expand Up @@ -2437,13 +2437,13 @@
invalid. This is SETF'able."
(etypecase debug-var
(compiled-debug-var
(check-type frame compiled-frame)
(aver (typep frame 'compiled-frame))
(let ((res (access-compiled-debug-var-slot debug-var frame)))
(if (indirect-value-cell-p res)
(sb!c:value-cell-ref res)
res)))
(interpreted-debug-var
(check-type frame interpreted-frame)
(aver (typep frame 'interpreted-frame))
(sb!eval::leaf-value-lambda-var
(interpreted-code-location-ir1-node (frame-code-location frame))
(interpreted-debug-var-ir1-var debug-var)
Expand Down Expand Up @@ -2643,13 +2643,13 @@
(defun %set-debug-var-value (debug-var frame value)
(etypecase debug-var
(compiled-debug-var
(check-type frame compiled-frame)
(aver (typep frame 'compiled-frame))
(let ((current-value (access-compiled-debug-var-slot debug-var frame)))
(if (indirect-value-cell-p current-value)
(sb!c:value-cell-set current-value value)
(set-compiled-debug-var-slot debug-var frame value))))
(interpreted-debug-var
(check-type frame interpreted-frame)
(aver (typep frame 'interpreted-frame))
(sb!eval::set-leaf-value-lambda-var
(interpreted-code-location-ir1-node (frame-code-location frame))
(interpreted-debug-var-ir1-var debug-var)
Expand Down Expand Up @@ -2950,7 +2950,7 @@
(compiled-debug-var
(compiled-debug-var-validity debug-var basic-code-location))
(interpreted-debug-var
(check-type basic-code-location interpreted-code-location)
(aver (typep basic-code-location 'interpreted-code-location))
(let ((validp (rassoc (interpreted-debug-var-ir1-var debug-var)
(sb!c::lexenv-variables
(sb!c::node-lexenv
Expand All @@ -2961,7 +2961,7 @@
;;; This is the method for DEBUG-VAR-VALIDITY for COMPILED-DEBUG-VARs.
;;; For safety, make sure basic-code-location is what we think.
(defun compiled-debug-var-validity (debug-var basic-code-location)
(check-type basic-code-location compiled-code-location)
(declare (type compiled-code-location basic-code-location))
(cond ((debug-var-alive-p debug-var)
(let ((debug-fun (code-location-debug-function basic-code-location)))
(if (>= (compiled-code-location-pc basic-code-location)
Expand All @@ -2973,14 +2973,16 @@
(t
(let ((pos (position debug-var
(debug-function-debug-vars
(code-location-debug-function basic-code-location)))))
(code-location-debug-function
basic-code-location)))))
(unless pos
(error 'unknown-debug-var
:debug-var debug-var
:debug-function
(code-location-debug-function basic-code-location)))
;; There must be live-set info since basic-code-location is known.
(if (zerop (sbit (compiled-code-location-live-set basic-code-location)
(if (zerop (sbit (compiled-code-location-live-set
basic-code-location)
pos))
:invalid
:valid)))))
Expand All @@ -3004,21 +3006,21 @@
;;; Given the DEFUN, 3 gets you the LET, 1 gets you the bindings, 0
;;; gets the first binding, and 1 gets the AREF form.

;;; Temporary buffer used to build form-number => source-path translation in
;;; FORM-NUMBER-TRANSLATIONS.
;;; temporary buffer used to build form-number => source-path translation in
;;; FORM-NUMBER-TRANSLATIONS
(defvar *form-number-temp* (make-array 10 :fill-pointer 0 :adjustable t))

;;; Table used to detect CAR circularities in FORM-NUMBER-TRANSLATIONS.
;;; table used to detect CAR circularities in FORM-NUMBER-TRANSLATIONS
(defvar *form-number-circularity-table* (make-hash-table :test 'eq))

;;; This returns a table mapping form numbers to source-paths. A source-path
;;; indicates a descent into the top-level-form form, going directly to the
;;; subform corressponding to the form number.
;;;
;;; The vector elements are in the same format as the compiler's
;;; NODE-SOUCE-PATH; that is, the first element is the form number and the last
;;; is the top-level-form number.
;;; NODE-SOURCE-PATH; that is, the first element is the form number and
;;; the last is the top-level-form number.
(defun form-number-translations (form tlf-number)
#!+sb-doc
"This returns a table mapping form numbers to source-paths. A source-path
indicates a descent into the top-level-form form, going directly to the
subform corressponding to the form number."
(clrhash *form-number-circularity-table*)
(setf (fill-pointer *form-number-temp*) 0)
(sub-translate-form-numbers form (list tlf-number))
Expand Down Expand Up @@ -3046,13 +3048,13 @@
(frob)
(setq trail (cdr trail)))))))

;;; FORM is a top-level form, and path is a source-path into it. This
;;; returns the form indicated by the source-path. Context is the
;;; number of enclosing forms to return instead of directly returning
;;; the source-path form. When context is non-zero, the form returned
;;; contains a marker, #:****HERE****, immediately before the form
;;; indicated by path.
(defun source-path-context (form path context)
#!+sb-doc
"Form is a top-level form, and path is a source-path into it. This returns
the form indicated by the source-path. Context is the number of enclosing
forms to return instead of directly returning the source-path form. When
context is non-zero, the form returned contains a marker, #:****HERE****,
immediately before the form indicated by path."
(declare (type unsigned-byte context))
;; Get to the form indicated by path or the enclosing form indicated
;; by context and path.
Expand Down Expand Up @@ -3084,17 +3086,15 @@

;;;; PREPROCESS-FOR-EVAL and EVAL-IN-FRAME

;;; Create a SYMBOL-MACROLET for each variable valid at the location which
;;; accesses that variable from the frame argument.
;;; Return a function of one argument that evaluates form in the
;;; lexical context of the basic-code-location loc.
;;; PREPROCESS-FOR-EVAL signals a no-debug-vars condition when the
;;; loc's debug-function has no debug-var information available. The
;;; returned function takes the frame to get values from as its
;;; argument, and it returns the values of form. The returned function
;;; signals the following conditions: invalid-value,
;;; ambiguous-variable-name, and frame-function-mismatch.
(defun preprocess-for-eval (form loc)
#!+sb-doc
"Return a function of one argument that evaluates form in the lexical
context of the basic-code-location loc. PREPROCESS-FOR-EVAL signals a
no-debug-vars condition when the loc's debug-function has no
debug-var information available. The returned function takes the frame
to get values from as its argument, and it returns the values of form.
The returned function signals the following conditions: invalid-value,
ambiguous-variable-name, and frame-function-mismatch"
(declare (type code-location loc))
(let ((n-frame (gensym))
(fun (code-location-debug-function loc)))
Expand Down
35 changes: 22 additions & 13 deletions src/code/debug.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,22 @@
;;; nestedness inside debugger command loops
(defvar *debug-command-level* 0)

(defvar *stack-top-hint* nil
#!+sb-doc
"If this is bound before the debugger is invoked, it is used as the stack
top by the debugger.")
;;; If this is bound before the debugger is invoked, it is used as the
;;; stack top by the debugger.
(defvar *stack-top-hint* nil)

(defvar *stack-top* nil)
(defvar *real-stack-top* nil)

(defvar *current-frame* nil)

;;; Beginner-oriented help messages are important because you end up
;;; in the debugger whenever something bad happens, or if you try to
;;; get out of the system with Ctrl-C or (EXIT) or EXIT or whatever.
;;; But after memorizing them the wasted screen space gets annoying..
(defvar *debug-beginner-help-p* t
"Should the debugger display beginner-oriented help messages?")

(defun debug-prompt (stream)

;; old behavior, will probably go away in sbcl-0.7.x
Expand Down Expand Up @@ -673,15 +680,17 @@ reset to ~S."
;; that file, and right to send them to *DEBUG-IO*.
(*error-output* *debug-io*))
(unless (typep condition 'step-condition)
(format *debug-io*
"~%~@<Within the debugger, you can type HELP for help. At ~
any command prompt (within the debugger or not) you can ~
type (SB-EXT:QUIT) to terminate the SBCL executable. ~
The condition which caused the debugger to be entered ~
is bound to ~S.~:@>~2%"
'*debug-condition*)
(show-restarts *debug-restarts* *debug-io*)
(terpri *debug-io*))
(when *debug-beginner-help-p*
(format *debug-io*
"~%~@<Within the debugger, you can type HELP for help. ~
At any command prompt (within the debugger or not) you ~
can type (SB-EXT:QUIT) to terminate the SBCL ~
executable. The condition which caused the debugger to ~
be entered is bound to ~S. You can suppress this ~
message by clearing ~S.~:@>~2%"
'*debug-condition*
'*debug-beginner-help-p*))
(show-restarts *debug-restarts* *debug-io*))
(internal-debug))))))

(defun show-restarts (restarts s)
Expand Down
8 changes: 4 additions & 4 deletions src/code/defbangstruct.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
(defun (setf def!struct-type-make-load-form-fun) (new-value type)
(when #+sb-xc-host t #-sb-xc-host *type-system-initialized*
(aver (subtypep type 'structure!object))
(check-type new-value def!struct-type-make-load-form-fun))
(aver (typep new-value 'def!struct-type-make-load-form-fun)))
(setf (gethash type *def!struct-type-make-load-form-fun*) new-value)))

;;; the simplest, most vanilla MAKE-LOAD-FORM function for DEF!STRUCT
Expand Down Expand Up @@ -146,10 +146,10 @@
#+sb-xc-host
(progn
(defun %instance-length (instance)
(check-type instance structure!object)
(aver (typep instance 'structure!object))
(layout-length (class-layout (sb!xc:find-class (type-of instance)))))
(defun %instance-ref (instance index)
(check-type instance structure!object)
(aver (typep instance 'structure!object))
(let* ((class (sb!xc:find-class (type-of instance)))
(layout (class-layout class)))
(if (zerop index)
Expand All @@ -160,7 +160,7 @@
(declare (type symbol accessor))
(funcall accessor instance)))))
(defun %instance-set (instance index new-value)
(check-type instance structure!object)
(aver (typep instance 'structure!object))
(let* ((class (sb!xc:find-class (type-of instance)))
(layout (class-layout class)))
(if (zerop index)
Expand Down
26 changes: 19 additions & 7 deletions src/code/early-extensions.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -378,19 +378,31 @@
(lambda (x y)
(funcall fun y x)))

;;; like CL:ASSERT, but lighter-weight
;;; like CL:ASSERT and CL:CHECK-TYPE, but lighter-weight
;;;
;;; (As of sbcl-0.6.11.20, we were using some 400 calls to CL:ASSERT
;;; in SBCL. The CL:ASSERT restarts and whatnot expand into a
;;; significant amount of code when you multiply them by 400, so
;;; replacing them with this should reduce the size of the system
;;; by enough to be worthwhile.)
;;; (As of sbcl-0.6.11.20, we were using some 400 calls to CL:ASSERT.
;;; The CL:ASSERT restarts and whatnot expand into a significant
;;; amount of code when you multiply them by 400, so replacing them
;;; with this should reduce the size of the system by enough to be
;;; worthwhile. ENFORCE-TYPE is much less common, but might still be
;;; worthwhile, and since I don't really like CERROR stuff deep in the
;;; guts of complex systems anyway, I replaced it too.)
(defmacro aver (expr)
`(unless ,expr
(%failed-aver ,(let ((*package* (find-package :keyword)))
(format nil "~S" expr)))))
(defun %failed-aver (expr-as-string)
(error "~@<failed AVER: ~2I~_~S~:>" expr-as-string))
(error "~@<internal error, failed AVER: ~2I~_~S~:>" expr-as-string))
(defmacro enforce-type (value type)
(once-only ((value value))
`(unless (typep ,value ',type)
(%failed-aver-type ,value ',type))))
(defun %failed-enforce-type (value type)
(error 'simple-type-error
:value value
:expected-type type
:format-string "~@<~S ~_is not a ~_~S~:>"
:format-arguments (list value type)))

;;; Return the numeric value of a type bound, i.e. an interval bound
;;; more or less in the format of bounds in ANSI's type specifiers,
Expand Down
Loading

0 comments on commit 2c6b90e

Please sign in to comment.