Changeset 13123
- Timestamp:
- 01/04/11 09:22:57 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/unsafe-p-removal/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r13122 r13123 6149 6149 (compile-function-call form target representation)))) 6150 6150 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 6159 6151 (defknown p2-setq (t t t) t) 6160 6152 (defun p2-setq (form target representation) … … 6165 6157 (value-form (%caddr form))) 6166 6158 (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)) 6171 6160 ;; We're setting a special variable. 6172 6161 (cond ((and variable … … 6175 6164 (not (enclosed-by-runtime-bindings-creating-block-p 6176 6165 (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) 6177 6170 (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) 6180 6172 (emit-putfield +lisp-special-binding+ "value" 6181 6173 +lisp-object+)) … … 6184 6176 (= (length value-form) 3) 6185 6177 (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+))) 6192 6188 (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+)))) 6198 6197 (fix-boxing representation nil) 6199 6198 (emit-move-from-stack target representation)
Note: See TracChangeset
for help on using the changeset viewer.