X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fcross-misc.lisp;h=1753e34996c685c11bca39a1d83ec6878ada3f72;hb=d720bc359f03734ccb9baf66cb45dc01d623f369;hp=a2545b0a4c8413014b37687350f69d86c90aaab7;hpb=0aecc2b20142e08068c3434273500131cb13fe2d;p=sbcl.git diff --git a/src/code/cross-misc.lisp b/src/code/cross-misc.lisp index a2545b0..1753e34 100644 --- a/src/code/cross-misc.lisp +++ b/src/code/cross-misc.lisp @@ -29,7 +29,27 @@ ;;; use address-dependent (and thus GC-dependent) hashes, and we only ;;; have a single thread of control. (defmacro without-interrupts (&rest forms) - `(progn ,@forms)) + `(macrolet ((allow-with-interrupts (&body body) + `(progn ,@body)) + (with-local-interrupts (&body body) + `(progn ,@body))) + ,@forms)) + +(defmacro with-locked-hash-table ((table) &body body) + (declare (ignore table)) + `(progn ,@body)) + +(defmacro with-locked-system-table ((table) &body body) + (declare (ignore table)) + `(progn ,@body)) + +(defmacro defglobal (name value &rest doc) + `(eval-when (:compile-toplevel :load-toplevel :execute) + (defparameter ,name + (if (boundp ',name) + (symbol-value ',name) + ,value) + ,@doc))) ;;; The GENESIS function works with fasl code which would, in the ;;; target SBCL, work on ANSI-STREAMs (streams which aren't extended @@ -106,7 +126,8 @@ ;;; the host Lisp, this is only used at cold load time, and we don't ;;; care as much about efficiency, so it's fine to treat the host ;;; Lisp's INTERN as primitive and implement INTERN* in terms of it. -(defun intern* (nameoid length package) +(defun intern* (nameoid length package &key no-copy) + (declare (ignore no-copy)) (intern (replace (make-string length) nameoid :end2 length) package)) ;;; In the target Lisp this is implemented by reading a fixed slot in @@ -117,6 +138,15 @@ (declare (type symbol symbol)) (sxhash symbol)) +(defvar sb!xc:*gensym-counter* 0) + +(defun sb!xc:gensym (&optional (thing "G")) + (declare (type string thing)) + (let ((n sb!xc:*gensym-counter*)) + (prog1 + (make-symbol (concatenate 'string thing (write-to-string n :base 10 :radix nil :pretty nil))) + (incf sb!xc:*gensym-counter*)))) + ;;; These functions are needed for constant-folding. (defun sb!kernel:simple-array-nil-p (object) (when (typep object 'array) @@ -142,6 +172,10 @@ (assert (typep array '(simple-array * (*)))) (values array start end 0)) +(defun sb!kernel:%with-array-data/fp (array start end) + (assert (typep array '(simple-array * (*)))) + (values array start end 0)) + (defun sb!kernel:signed-byte-32-p (number) (typep number '(signed-byte 32))) @@ -155,8 +189,8 @@ (declare (ignore kind thing format)) `(progn ,@body)) -(defun compiler-assert-symbol-home-package-unlocked (symbol control) - (declare (ignore control)) +(defun program-assert-symbol-home-package-unlocked (context symbol control) + (declare (ignore context control)) symbol) (defun assert-package-unlocked (package &optional control &rest args) @@ -168,3 +202,9 @@ name) (declaim (declaration enable-package-locks disable-package-locks)) + +;;; printing structures + +(defun sb!kernel::default-structure-print (structure stream depth) + (declare (ignore depth)) + (write structure :stream stream :circle t))