- Timestamp:
- 08/07/10 20:43:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r12872 r12874 919 919 920 920 921 ;; CLEAR-VALUES CLEAR-VALUES => CLEAR-VALUES 922 ;; GETSTATIC POP => nothing 923 (defun optimize-3 () 924 (let* ((code (coerce *code* 'vector)) 921 (defun optimize-instruction-sequences (code) 922 (let* ((code (coerce code 'vector)) 925 923 (changed nil)) 926 924 (dotimes (i (1- (length code))) … … 941 939 (case this-opcode 942 940 (205 ; CLEAR-VALUES 943 (when (eql next-opcode 205) ; CLEAR-VALUES941 (when (eql next-opcode 205) ; CLEAR-VALUES 944 942 (setf (aref code i) nil) 945 943 (setf changed t))) 946 944 (178 ; GETSTATIC 947 (when (and (eql next-opcode 87) ; POP945 (when (and (eql next-opcode 87) ; POP 948 946 (not labels-skipped-p)) 949 947 (setf (aref code i) nil) 950 948 (setf (aref code (1+ i)) nil) 951 949 (setf changed t))) 952 (167 ; GOTO 953 (when (and (eql next-opcode 202) ; LABEL 950 (176 ; ARETURN 951 (when (eql next-opcode 176) ; ARETURN 952 (setf (aref code i) nil) 953 (setf changed t))) 954 ((200 167) ; GOTO GOTO_W 955 (when (and (or (eql next-opcode 202) ; LABEL 956 (eql next-opcode 200) ; GOTO_W 957 (eql next-opcode 167)) ; GOTO 954 958 (eq (car (instruction-args this-instruction)) 955 959 (car (instruction-args next-instruction)))) 956 960 (setf (aref code i) nil) 957 961 (setf changed t)))))) 958 (when changed 959 (setf *code* (delete nil code)) 960 t))) 962 (values (if changed (delete nil code) code) 963 changed))) 961 964 962 965 (defvar *enable-optimization* t) … … 980 983 (mapcar #'handler-code *handlers*)))) 981 984 (if changed-p 985 (setf *code* (optimize-instruction-sequences *code*)) 986 (multiple-value-setq 987 (*code* changed-p) 988 (optimize-instruction-sequences *code*))) 989 (if changed-p 982 990 (setf *code* (optimize-jumps *code*)) 983 991 (multiple-value-setq 984 992 (*code* changed-p) 985 993 (optimize-jumps *code*))) 986 (setf changed-p (or (optimize-3) changed-p))987 994 (if changed-p 988 995 (setf *code* (delete-unreachable-code *code*))
Note: See TracChangeset
for help on using the changeset viewer.