From ee3bfc5a989b5c0a1ea5a094e9541169ea2eb4ad Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 22 Apr 2003 14:58:32 +0000 Subject: [PATCH] 0.pre8.90: Make COPY-SYMBOL work on threaded builds ... FAST-SYMBOL-VALUE need not be fast, but must not signal an error on unbound-symbol ... add a smoke test --- NEWS | 3 ++- src/compiler/x86/cell.lisp | 16 +++++++++++++++- tests/smoke.impure.lisp | 7 +++++++ version.lisp-expr | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 2aae548..5b88b78 100644 --- a/NEWS +++ b/NEWS @@ -1666,7 +1666,6 @@ changes in sbcl-0.8.0 relative to sbcl-0.7.14 call to the GC function during WITHOUT-GCING will not do garbage collection until the end of the WITHOUT-GCING. If you were doing this you were probably losing anyway. - * sb-aclrepl module improvements: an integrated inspector, added repl features, and a bug fix to :trace command. * fixed some bugs revealed by Paul Dietz' test suite: @@ -1690,6 +1689,8 @@ changes in sbcl-0.8.0 relative to sbcl-0.7.14 ** RESTART-CASE understands local macros; ** ... and associates exactly its own restarts with a condition; ** ENDP in safe mode checks its argument to be of type LIST; + ** COPY-SYMBOL in a threaded build no longer fails when the symbol + in question is unbound; planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/compiler/x86/cell.lisp b/src/compiler/x86/cell.lisp index 332432f..e35ae15 100644 --- a/src/compiler/x86/cell.lisp +++ b/src/compiler/x86/cell.lisp @@ -122,8 +122,22 @@ #!+sb-thread (define-vop (fast-symbol-value symbol-value) + ;; KLUDGE: not really fast, in fact, because we're going to have to + ;; do a full lookup of the thread-local area anyway. But half of + ;; the meaning of FAST-SYMBOL-VALUE is "do not signal an error if + ;; unbound", which is used in the implementation of COPY-SYMBOL. -- + ;; CSR, 2003-04-22 (:policy :fast) - (:translate symbol-value)) + (:translate symbol-value) + (:generator 8 + (let ((ret-lab (gen-label))) + (loadw value object symbol-tls-index-slot other-pointer-lowtag) + (inst fs-segment-prefix) + (inst mov value (make-ea :dword :index value :scale 1)) + (inst cmp value unbound-marker-widetag) + (inst jmp :ne ret-lab) + (loadw value object symbol-value-slot other-pointer-lowtag) + (emit-label ret-lab)))) #!-sb-thread (define-vop (symbol-value) diff --git a/tests/smoke.impure.lisp b/tests/smoke.impure.lisp index ff7d4d9..37fd03f 100644 --- a/tests/smoke.impure.lisp +++ b/tests/smoke.impure.lisp @@ -29,5 +29,12 @@ (describe '(a list)) (describe #(a vector)) +;;; COPY-SYMBOL should work without signalling an error, even if the +;;; symbol is unbound. +(copy-symbol 'foo) +(copy-symbol 'bar t) +(defvar *baz* nil) +(copy-symbol '*baz* t) + ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 83ef7d0..27dcc26 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre8.89" +"0.pre8.90" -- 1.7.10.4