Changeset 11637
- Timestamp:
- 02/06/09 23:22:51 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r11636 r11637 413 413 414 414 (defknown emit-dup (symbol) t) 415 (defun emit-dup (representation) 416 (ecase (representation-size representation) 417 (1 (emit 'dup)) 418 (2 (emit 'dup2)))) 415 (defun emit-dup (representation &key (past nil past-supplied-p)) 416 "Emits the 'dup' instruction required to duplicate `representation'. 417 418 If `past' is specified, the newly duplicated value is inserted on the 419 stack past the top-most value, which is assumed to be of the representation 420 passed in `past'." 421 (emit 422 (nth (if past-supplied-p 423 (representation-size past) 0) 424 (ecase (representation-size representation) 425 (1 '(dup dup_x1 dup_x2)) 426 (2 '(dup2 dup2_x1 dup2_x2)))))) 419 427 420 428 (defknown emit-swap (symbol symbol) t) … … 4965 4973 (compile-form (%cadr args) 'stack nil) 4966 4974 (when target 4967 (emit 'dup_x1))4975 (emit-dup nil :past nil)) 4968 4976 (emit-invokevirtual +lisp-object-class+ 4969 4977 (if (eq op 'sys:set-car) "setCar" "setCdr") … … 5631 5639 position-arg 'stack :int 5632 5640 arg3 'stack nil) 5633 (emit 'dup_x2) 5641 (emit 'dup_x2) ;; use not supported by emit-dup: 3 values involved 5634 5642 (emit 'pop) 5635 5643 (emit-invokevirtual +lisp-object-class+ "LDB" '("I" "I") +lisp-object+) … … 6768 6776 (emit-dup common-rep) 6769 6777 (compile-form arg2 'stack common-rep) 6770 (emit (if (eq common-rep :long) 6771 'dup2_x2 'dup_x1)) 6778 (emit-dup common-rep :past common-rep) 6772 6779 (emit-numeric-comparison (if (eq op 'max) '<= '>=) 6773 6780 common-rep LABEL1) … … 6779 6786 (t 6780 6787 (compile-form arg1 'stack nil) 6781 (emit 'dup)6788 (emit-dup nil) 6782 6789 (compile-form arg2 'stack nil) 6783 (emit 'dup_x1)6790 (emit-dup nil :past nil) 6784 6791 (emit-invokevirtual +lisp-object-class+ 6785 6792 (if (eq op 'max)
Note: See TracChangeset
for help on using the changeset viewer.