Changeset 13157


Ignore:
Timestamp:
01/19/11 13:09:14 (13 years ago)
Author:
ehuelsmann
Message:

Further transition to unsafety detection in pass2.

Location:
branches/unsafe-p-removal/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r13153 r13157  
    11541154  '(
    11551155
    1156      %ldb
    1157      and
    1158      aset
    11591156     char
    11601157     char-code
     
    11921189     mod
    11931190     not
    1194      nthcdr
    11951191     null
    11961192     or
     
    12211217       vector-push-extend
    12221218       write-8-bits
    1223        with-inline-code)
     1219)
    12241220"The functions named in the list bound to this variable
    12251221need to be rewritten if UNSAFE-P returns non-NIL for their
  • branches/unsafe-p-removal/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r13155 r13157  
    46634663          ((and (fixnum-type-p size-type)
    46644664                (fixnum-type-p position-type))
    4665            (compile-forms-and-maybe-emit-clear-values size-arg 'stack :int
    4666                                                       position-arg 'stack :int
    4667                                                       arg3 'stack nil)
     4665           (with-operand-accumulation
     4666                ((compile-operand size-arg :int)
     4667                 (compile-operand position-arg :int)
     4668                 (compile-operand arg3 nil)
     4669                 (maybe-emit-clear-values size-arg position-arg arg3)))
    46684670           (emit 'dup_x2) ;; use not supported by emit-dup: 3 values involved
    46694671           (emit 'pop)
     
    59755977                (*register* *register*)
    59765978                (value-register (unless (null target) (allocate-register nil))))
     5979           (with-operand-accumulation
     5980               (
    59775981           ;; array
    5978            (compile-form arg1 'stack nil)
     5982                (compile-operand arg1 nil)
    59795983           ;; index
    5980            (compile-form arg2 'stack :int)
     5984                (compile-operand arg2 :int)
    59815985           ;; value
    5982            (cond ((fixnum-type-p type3)
    5983                   (compile-form arg3 'stack :int)
    5984                   (when value-register
    5985                     (emit 'dup)
    5986                     (emit-move-from-stack value-register :int)))
    5987                  (t
    5988                   (compile-form arg3 'stack nil)
    5989                   (when value-register
    5990                     (emit 'dup)
    5991                     (emit-move-from-stack value-register nil))))
     5986                (accumulate-operand
     5987                         ((when (fixnum-type-p type3) :int)
     5988                          :unsafe-p (some-nested-block
     5989                                     #'node-opstack-unsafe-p
     5990                                     (find-enclosed-blocks arg3)))
     5991                   (cond ((fixnum-type-p type3)
     5992                          (compile-form arg3 'stack :int)
     5993                          (when value-register
     5994                            (emit 'dup)
     5995                            (emit-move-from-stack value-register :int)))
     5996                         (t
     5997                          (compile-form arg3 'stack nil)
     5998                          (when value-register
     5999                            (emit 'dup)
     6000                            (emit-move-from-stack value-register nil)))))))
    59926001           (maybe-emit-clear-values arg1 arg2 arg3)
    59936002           (cond ((fixnum-type-p type3)
    59946003                  (emit-invokevirtual +lisp-object+ "aset" '(:int :int) nil))
    59956004                 (t
    5996                   (emit-invokevirtual +lisp-object+ "aset" (list :int +lisp-object+) nil)))
     6005                  (emit-invokevirtual +lisp-object+ "aset"
     6006                                      (list :int +lisp-object+) nil)))
    59976007           (when value-register
    59986008             (cond ((fixnum-type-p type3)
     
    61486158         (arg2 (%cadr args)))
    61496159    (cond ((fixnum-type-p (derive-compiler-type arg1))
    6150            (compile-forms-and-maybe-emit-clear-values arg1 'stack :int
    6151                                                       arg2 'stack nil)
     6160           (with-operand-accumulation
     6161               ((compile-operand arg1 :int)
     6162                (compile-operand arg2 nil)
     6163                (maybe-emit-clear-values arg1 arg2)))
    61526164           (emit 'swap)
    61536165           (emit-invokevirtual +lisp-object+ "nthcdr" '(:int) +lisp-object+)
Note: See TracChangeset for help on using the changeset viewer.