Changeset 12705


Ignore:
Timestamp:
05/18/10 22:30:53 (14 years ago)
Author:
ehuelsmann
Message:

Eliminate DECLARE-INSTANCE as it has the same effect as
DECLARE-OBJECT-AS-STRING; which is in the process of being
replaced by EMIT-LOAD-EXTERNALIZED-OBJECT.

File:
1 edited

Legend:

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

    r12704 r12705  
    23742374    g))
    23752375
    2376 (defknown declare-instance (t) t)
    2377 (defun declare-instance (obj)
    2378   (aver (not (null *file-compilation*)))
    2379   (aver (or (structure-object-p obj) (standard-object-p obj)
    2380             (java:java-object-p obj)))
    2381   (let ((g (symbol-name (gensym "INSTANCE")))
    2382         saved-code)
    2383     (let* ((s (with-output-to-string (stream) (dump-form obj stream)))
    2384            (*code* (if *declare-inline* *code* *static-code*)))
    2385       ;; The readObjectFromString call may require evaluation of
    2386       ;; lisp code in the string (think #.() syntax), of which the outcome
    2387       ;; may depend on something which was declared inline
    2388       (declare-field g +lisp-object+ +field-access-private+)
    2389       (emit 'ldc (pool-string s))
    2390       (emit-invokestatic +lisp-class+ "readObjectFromString"
    2391                          (list +java-string+) +lisp-object+)
    2392       (emit-invokestatic +lisp-class+ "loadTimeValue"
    2393                          (lisp-object-arg-types 1) +lisp-object+)
    2394       (emit 'putstatic *this-class* g +lisp-object+)
    2395       (if *declare-inline*
    2396           (setf saved-code *code*)
    2397           (setf *static-code* *code*)))
    2398     (when *declare-inline*
    2399       (setf *code* saved-code))
    2400     g))
    2401 
    24022376(declaim (ftype (function (t &optional t) string) declare-object))
    24032377(defun declare-object (obj &optional (obj-ref +lisp-object+)
     
    25242498             (standard-object-p form)
    25252499             (java:java-object-p form))
    2526          (let ((g (if *file-compilation*
    2527                       (declare-instance form)
    2528                       (declare-object form))))
    2529            (emit 'getstatic *this-class* g +lisp-object+)))
     2500         (emit-load-externalized-object form))
    25302501        (t
    25312502         (if *file-compilation*
Note: See TracChangeset for help on using the changeset viewer.