Changeset 13123


Ignore:
Timestamp:
01/04/11 09:22:57 (11 years ago)
Author:
ehuelsmann
Message:

Remove UNSAFE-P from pass2 by eliminating SETQ rewriting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/unsafe-p-removal/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r13122 r13123  
    61496149         (compile-function-call form target representation))))
    61506150
    6151 (declaim (ftype (function (t) t) rewrite-setq))
    6152 (defun rewrite-setq (form)
    6153   (let ((expr (%caddr form)))
    6154     (if (unsafe-p expr)
    6155         (let ((sym (gensym)))
    6156           (list 'LET (list (list sym expr)) (list 'SETQ (%cadr form) sym)))
    6157         form)))
    6158 
    61596151(defknown p2-setq (t t t) t)
    61606152(defun p2-setq (form target representation)
     
    61656157         (value-form (%caddr form)))
    61666158    (when (or (null variable)
    6167               (variable-special-p variable))
    6168       (let ((new-form (rewrite-setq form)))
    6169         (when (neq new-form form)
    6170           (return-from p2-setq (compile-form (p1 new-form) target representation))))
     6159        (variable-special-p variable))
    61716160      ;; We're setting a special variable.
    61726161      (cond ((and variable
     
    61756164                  (not (enclosed-by-runtime-bindings-creating-block-p
    61766165                        (variable-block variable))))
     6166       ;; ### choose this compilation order to prevent
     6167       ;; with-operand-accumulation
     6168             (compile-forms-and-maybe-emit-clear-values value-form 'stack nil)
     6169       (emit 'dup)
    61776170             (aload (variable-binding-register variable))
    6178              (compile-forms-and-maybe-emit-clear-values value-form 'stack nil)
    6179              (emit 'dup_x1) ;; copy past th
     6171             (emit 'swap)
    61806172             (emit-putfield +lisp-special-binding+ "value"
    61816173                   +lisp-object+))
     
    61846176                  (= (length value-form) 3)
    61856177                  (var-ref-p (third value-form))
    6186                   (eq (variable-name (var-ref-variable (third value-form))) name))
    6187              (emit-push-current-thread)
    6188              (emit-load-externalized-object name)
    6189              (compile-forms-and-maybe-emit-clear-values (second value-form) 'stack nil)
    6190              (emit-invokevirtual +lisp-thread+ "pushSpecial"
    6191                                  (list +lisp-symbol+ +lisp-object+) +lisp-object+))
     6178                  (eq (variable-name (var-ref-variable (third value-form)))
     6179          name))
     6180       (with-operand-accumulation
     6181           ((emit-thread-operand)
     6182      (emit-load-externalized-object-operand name)
     6183      (compile-operand (second value-form) nil)
     6184      (maybe-emit-clear-values (second value-form)))
     6185    (emit-invokevirtual +lisp-thread+ "pushSpecial"
     6186            (list +lisp-symbol+ +lisp-object+)
     6187            +lisp-object+)))
    61926188            (t
    6193              (emit-push-current-thread)
    6194              (emit-load-externalized-object name)
    6195              (compile-forms-and-maybe-emit-clear-values value-form 'stack nil)
    6196              (emit-invokevirtual +lisp-thread+ "setSpecialVariable"
    6197                                  (list +lisp-symbol+ +lisp-object+) +lisp-object+)))
     6189       (with-operand-accumulation
     6190           ((emit-thread-operand)
     6191      (emit-load-externalized-object-operand name)
     6192      (compile-operand value-form nil)
     6193      (maybe-emit-clear-values value-form))
     6194         (emit-invokevirtual +lisp-thread+ "setSpecialVariable"
     6195           (list +lisp-symbol+ +lisp-object+)
     6196           +lisp-object+))))
    61986197      (fix-boxing representation nil)
    61996198      (emit-move-from-stack target representation)
Note: See TracChangeset for help on using the changeset viewer.