Changeset 11868


Ignore:
Timestamp:
05/15/09 10:20:09 (12 years ago)
Author:
ehuelsmann
Message:

Replace string literals with constants.

File:
1 edited

Legend:

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

    r11866 r11868  
    200200
    201201(defconstant +java-string+ "Ljava/lang/String;")
     202(defconstant +java-object+ "Ljava/lang/Object;")
    202203(defconstant +lisp-class+ "org/armedbear/lisp/Lisp")
    203204(defconstant +lisp-nil-class+ "org/armedbear/lisp/Nil")
     
    207208(defconstant +lisp-object-array+ "[Lorg/armedbear/lisp/LispObject;")
    208209(defconstant +closure-binding-array+ "[Lorg/armedbear/lisp/ClosureBinding;")
    209 (defconstant +closure-binding+ "Lorg/armedbear/lisp/ClosureBinding;")
    210210(defconstant +closure-binding-class+ "org/armedbear/lisp/ClosureBinding")
    211211(defconstant +lisp-symbol-class+ "org/armedbear/lisp/Symbol")
     
    29992999    (emit-push-constant-int 0)                            ;; srcPos
    30003000    (emit-push-constant-int (length *closure-variables*))
    3001     (emit 'anewarray "org/armedbear/lisp/ClosureBinding")     ;; dest
     3001    (emit 'anewarray +closure-binding-class+)             ;; dest
    30023002    (emit 'dup)
    30033003    (astore register)  ;; save dest value
     
    30053005    (emit-push-constant-int (length *closure-variables*)) ;; length
    30063006    (emit-invokestatic "java/lang/System" "arraycopy"
    3007                        (list "Ljava/lang/Object;" "I"
    3008                              "Ljava/lang/Object;" "I" "I") nil)
     3007                       (list +java-object+ "I"
     3008                             +java-object+ "I" "I") nil)
    30093009    (aload register))) ;; reload dest value
    30103010
     
    38983898                             (list +lisp-symbol+ +lisp-object+) nil))
    38993899        ((variable-closure-index variable)              ;; stack:
    3900          (emit 'new "org/armedbear/lisp/ClosureBinding") ;; value c-b
    3901          (emit 'dup_x1)                                  ;; c-b value c-b
    3902          (emit 'swap)                                    ;; c-b c-b value
    3903          (emit-invokespecial-init "org/armedbear/lisp/ClosureBinding"
    3904                                  (list +lisp-object+))  ;; c-b
     3900         (emit 'new +closure-binding-class+)            ;; value c-b
     3901         (emit 'dup_x1)                                 ;; c-b value c-b
     3902         (emit 'swap)                                   ;; c-b c-b value
     3903         (emit-invokespecial-init +closure-binding-class+
     3904                                  (list +lisp-object+)) ;; c-b
    39053905         (aload (compiland-closure-register *current-compiland*))
    39063906                                                         ;; c-b array
     
    41844184             (emit 'aaload)
    41854185             (emit-swap representation nil)
    4186              (emit 'putfield "org/armedbear/lisp/ClosureBinding" "value"
    4187                    "Lorg/armedbear/lisp/LispObject;"))
     4186             (emit 'putfield +closure-binding-class+ "value" +lisp-object+))
    41884187            (t
    41894188             ;;###FIXME: We might want to address the "temp-register" case too.
     
    42164215           (emit-push-constant-int (variable-closure-index variable))
    42174216           (emit 'aaload)
    4218            (emit 'getfield "org/armedbear/lisp/ClosureBinding" "value"
    4219                  "Lorg/armedbear/lisp/LispObject;"))
     4217           (emit 'getfield +closure-binding-class+ "value" +lisp-object+))
    42204218          (t ;;###FIXME: We might want to address the "temp-register" case too.
    42214219           (assert nil)))))
     
    80908088         ;; if we're the ultimate parent: create the closure array
    80918089         (emit-push-constant-int (length *closure-variables*))
    8092          (emit 'anewarray "org/armedbear/lisp/ClosureBinding"))
     8090         (emit 'anewarray +closure-binding-class+))
    80938091        (local-closure-vars
    80948092         (duplicate-closure-array compiland))))
     
    81118109            (emit 'dup) ; array
    81128110            (emit-push-constant-int i)
    8113             (emit 'new "org/armedbear/lisp/ClosureBinding")
     8111            (emit 'new +closure-binding-class+)
    81148112            (emit 'dup)
    81158113            (cond
     
    81298127              (t
    81308128               (assert (not "Can't happen!!"))))
    8131             (emit-invokespecial-init "org/armedbear/lisp/ClosureBinding"
     8129            (emit-invokespecial-init +closure-binding-class+
    81328130                                     (list +lisp-object+))
    81338131            (emit 'aastore)))))
Note: See TracChangeset for help on using the changeset viewer.