Changeset 12234


Ignore:
Timestamp:
10/29/09 22:31:31 (12 years ago)
Author:
ehuelsmann
Message:

Don't create 2 fields to store/retrieve a single (cached!) value.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r12224 r12234  
    21302130          new Hashtable<String,LispObject>();
    21312131
     2132  public static final LispObject recall(String key)
     2133  {
     2134    return objectTable.remove(key);
     2135  }
     2136
    21322137  public static final LispObject recall(SimpleString key)
    21332138  {
    2134     return (LispObject) objectTable.remove(key.getStringValue());
     2139    return objectTable.remove(key.getStringValue());
    21352140  }
    21362141
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r12233 r12234  
    22722272
    22732273The field type of the object is specified by OBJ-REF."
    2274   (let ((key (symbol-name (gensym "OBJ"))))
     2274  (let ((g (symbol-name (gensym "OBJ"))))
    22752275    ;; fixme *declare-inline*?
    2276     (remember key obj)
    2277     (let* ((g1 (declare-string key))
    2278            (g2 (symbol-name (gensym "O2BJ"))))
    2279       (let* ((*code* *static-code*))
    2280         (declare-field g2 obj-ref +field-access-private+)
    2281         (emit 'getstatic *this-class* g1 +lisp-simple-string+)
    2282         (emit-invokestatic +lisp-class+ "recall"
    2283                            (list +lisp-simple-string+) +lisp-object+)
    2284         (when (and obj-class (string/= obj-class +lisp-object-class+))
    2285           (emit 'checkcast obj-class))
    2286         (emit 'putstatic *this-class* g2 obj-ref)
    2287         (setf *static-code* *code*)
    2288         g2))))
     2276    (remember g obj)
     2277    (let* ((*code* *static-code*))
     2278      (declare-field g obj-ref +field-access-private+)
     2279      (emit 'ldc (pool-string g))
     2280      (emit-invokestatic +lisp-class+ "recall"
     2281                         (list +java-string+) +lisp-object+)
     2282      (when (and obj-class (string/= obj-class +lisp-object-class+))
     2283        (emit 'checkcast obj-class))
     2284      (emit 'putstatic *this-class* g obj-ref)
     2285      (setf *static-code* *code*)
     2286      g)))
    22892287
    22902288(defun declare-lambda (obj)
Note: See TracChangeset for help on using the changeset viewer.