From 75c413d22ccbcc04acded0d60efa80e6579db768 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Fri, 14 Jul 2017 08:13:10 -0400 Subject: [PATCH] Rearrange SYMBOL-VALUE CAS expander a little --- src/code/cas.lisp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/code/cas.lisp b/src/code/cas.lisp index 5799e25b8..f6edb4964 100644 --- a/src/code/cas.lisp +++ b/src/code/cas.lisp @@ -251,17 +251,13 @@ been defined. (See SB-EXT:CAS for more information.) (when val (list val)) old new - (let ((slow - `(progn - (about-to-modify-symbol-value ,symbol 'compare-and-swap ,new) - (%compare-and-swap-symbol-value ,symbol ,old ,new)))) - (if cname - (if (member (info :variable :kind cname) '(:special :global)) + (if (and cname (member (info :variable :kind cname) '(:special :global))) ;; We can generate the type-check reasonably. - `(%compare-and-swap-symbol-value - ',cname ,old (the ,(info :variable :type cname) ,new)) - slow) - slow)) + `(%compare-and-swap-symbol-value + ',cname ,old (the ,(info :variable :type cname) ,new)) + `(progn + (about-to-modify-symbol-value ,symbol 'compare-and-swap ,new) + (%compare-and-swap-symbol-value ,symbol ,old ,new))) `(symbol-value ,symbol)))))) (define-cas-expander svref (vector index) -- 2.11.4.GIT