Changeset 11793


Ignore:
Timestamp:
04/28/09 20:24:10 (13 years ago)
Author:
vvoutilainen
Message:

Combine load/store resolvers.

File:
1 edited

Legend:

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

    r11792 r11793  
    11541154        `(setf (gethash ,opcodes +resolvers+) (symbol-function ',name)))))))
    11551155
    1156 ;; aload
    1157 (define-resolver 25 (instruction)
     1156(defun load/store-resolver (instruction inst-index inst-index2 error-text)
    11581157 (let* ((args (instruction-args instruction))
    11591158        (index (car args)))
    11601159   (declare (type (unsigned-byte 16) index))
    11611160   (cond ((<= 0 index 3)
    1162           (inst (+ index 42)))
     1161          (inst (+ index inst-index)))
    11631162         ((<= 0 index 255)
    1164           (inst 25 index))
     1163          (inst inst-index2 index))
    11651164         (t
    1166           (error "ALOAD unsupported case")))))
     1165          (error error-text)))))
     1166
     1167;; aload
     1168(define-resolver 25 (instruction)
     1169  (load/store-resolver instruction 42 25 "ALOAD unsupported case"))
    11671170
    11681171;; astore
    11691172(define-resolver 58 (instruction)
    1170   (let* ((args (instruction-args instruction))
    1171          (index (car args)))
    1172     (declare (type (unsigned-byte 16) index))
    1173     (cond ((<= 0 index 3)
    1174            (inst (+ index 75)))
    1175           ((<= 0 index 255)
    1176            (inst 58 index))
    1177           (t
    1178            (error "ASTORE unsupported case")))))
     1173  (load/store-resolver instruction 75 58 "ASTORE unsupported case"))
    11791174
    11801175;; iload
    11811176(define-resolver 21 (instruction)
    1182   (let* ((args (instruction-args instruction))
    1183          (index (car args)))
    1184     (declare (type (unsigned-byte 16) index))
    1185     (cond ((<= 0 index 3)
    1186            (inst (+ index 26)))
    1187           ((<= 0 index 255)
    1188            (inst 21 index))
    1189           (t
    1190            (error "ILOAD unsupported case")))))
     1177  (load/store-resolver instruction 26 21 "ILOAD unsupported case"))
    11911178
    11921179;; istore
    11931180(define-resolver 54 (instruction)
    1194   (let* ((args (instruction-args instruction))
    1195          (index (car args)))
    1196     (declare (type (unsigned-byte 16) index))
    1197     (cond ((<= 0 index 3)
    1198            (inst (+ index 59)))
    1199           ((<= 0 index 255)
    1200            (inst 54 index))
    1201           (t
    1202            (error "ASTORE unsupported case")))))
     1181  (load/store-resolver instruction 59 54 "ISTORE unsupported case"))
    12031182
    12041183;; lload
    12051184(define-resolver 22 (instruction)
    1206   (let* ((args (instruction-args instruction))
    1207          (index (car args)))
    1208     (declare (type (unsigned-byte 16) index))
    1209     (cond ((<= 0 index 3)
    1210            (inst (+ index 30)))
    1211           ((<= 0 index 255)
    1212            (inst 22 index))
    1213           (t
    1214            (error "LLOAD unsupported case")))))
     1185  (load/store-resolver instruction 30 22 "LLOAD unsupported case"))
    12151186
    12161187;; lstore
    12171188(define-resolver 55 (instruction)
    1218   (let* ((args (instruction-args instruction))
    1219          (index (car args)))
    1220     (declare (type (unsigned-byte 16) index))
    1221     (cond ((<= 0 index 3)
    1222            (inst (+ index 63)))
    1223           ((<= 0 index 255)
    1224            (inst 55 index))
    1225           (t
    1226            (error "ASTORE unsupported case")))))
     1189  (load/store-resolver instruction 63 55 "LSTORE unsupported case"))
    12271190
    12281191;; getstatic, putstatic
Note: See TracChangeset for help on using the changeset viewer.