Changeset 11504


Ignore:
Timestamp:
12/29/08 16:36:06 (12 years ago)
Author:
vvoutilainen
Message:

Further combine car/cdr.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11503 r11504  
    45874587      (emit-move-from-stack target))))
    45884588
    4589 (defun emit-cast/getfield-for-car/cdr (arg target representation field)
    4590   (compile-form arg 'stack nil)
    4591   (emit 'checkcast +lisp-cons-class+)
    4592   (emit 'getfield +lisp-cons-class+ field +lisp-object+)
    4593   (fix-boxing representation nil)
    4594   (emit-move-from-stack target representation))
     4589(defun emit-car/cdr (arg target representation field)
     4590  (cond ((eq (derive-type arg) 'CONS)
     4591   (compile-form arg 'stack nil)
     4592   (emit 'checkcast +lisp-cons-class+)
     4593   (emit 'getfield +lisp-cons-class+ field +lisp-object+)
     4594   (fix-boxing representation nil)
     4595   (emit-move-from-stack target representation))
     4596  (t
     4597   (compile-forms-and-maybe-emit-clear-values arg 'stack nil)
     4598   (emit-invoke-method field target representation))))
    45954599
    45964600(defun p2-car (form target representation)
     
    46044608     (compile-forms-and-maybe-emit-clear-values (second arg) 'stack nil)
    46054609           (emit-invoke-method "cadr" target representation))
    4606           ((eq (derive-type arg) 'CONS)
    4607      (emit-cast/getfield-for-car/cdr arg target representation "car"))
    46084610          (t
    4609      (compile-forms-and-maybe-emit-clear-values arg 'stack nil)
    4610            (emit-invoke-method "car" target representation)))))
     4611     (emit-car/cdr arg target representation "car")))))
    46114612
    46124613(defun p2-cdr (form target representation)
     
    46154616    (return-from p2-cdr))
    46164617  (let ((arg (%cadr form)))
    4617     (cond ((eq (derive-type arg) 'CONS)
    4618      (emit-cast/getfield-for-car/cdr arg target representation "cdr"))
    4619           (t
    4620      (compile-forms-and-maybe-emit-clear-values arg 'stack nil)
    4621            (emit-invoke-method "cdr" target representation)))))
     4618    (emit-car/cdr arg target representation "cdr")))
    46224619
    46234620(defun p2-cons (form target representation)
Note: See TracChangeset for help on using the changeset viewer.