Changeset 12711


Ignore:
Timestamp:
05/19/10 22:29:03 (13 years ago)
Author:
ehuelsmann
Message:

No longer use the reader to load "stand alone" uninterned symbols,
instead, inline calls to the array element 'getter'.

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

Legend:

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

    r12709 r12711  
    214214(defconstant +lisp-thread-class+ "org/armedbear/lisp/LispThread")
    215215(defconstant +lisp-thread+ "Lorg/armedbear/lisp/LispThread;")
     216(defconstant +lisp-load-class+ "org/armedbear/lisp/Load")
    216217(defconstant +lisp-cons-class+ "org/armedbear/lisp/Cons")
    217218(defconstant +lisp-cons+ "Lorg/armedbear/lisp/Cons;")
     
    21512152       (emit 'getstatic class name +lisp-symbol+))
    21522153      ((null (symbol-package symbol))
    2153        ;; we need to read the #?<n> syntax for uninterned symbols
    2154 
    2155        ;; TODO: we could use the byte code variant of
    2156        ;; Load._FASL_UNINTERNED_SYMBOLS_.symbolValue(LispThread.currentThread())
    2157        ;;    .aref(<index)
    2158        ;; to eliminate the reader dependency
    2159        (serialize-object symbol)
     2154       (emit-push-constant-int (dump-uninterned-symbol-index symbol))
     2155       (emit-invokestatic +lisp-load-class+ "getUninternedSymbol" '("I")
     2156                          +lisp-object+)
    21602157       (emit 'checkcast +lisp-symbol-class+))
    21612158      ((keywordp symbol)
  • trunk/abcl/src/org/armedbear/lisp/dump-form.lisp

    r12650 r12711  
    3232(in-package "SYSTEM")
    3333
    34 (export 'dump-form)
     34(export '(dump-form dump-uninterned-symbol-index))
    3535
    3636(declaim (ftype (function (cons stream) t) dump-cons))
     
    9090        (dump-object creation-form stream))))
    9191
     92(declaim (ftype (function (symbol) integer) dump-uninterned-symbol-index))
     93(defun dump-uninterned-symbol-index (symbol)
     94  (let ((index (cdr (assoc symbol *fasl-uninterned-symbols*))))
     95    (unless index
     96      (setq index (1+ (or (cdar *fasl-uninterned-symbols*) -1)))
     97      (setq *fasl-uninterned-symbols*
     98            (acons symbol index *fasl-uninterned-symbols*)))
     99    index))
     100
    92101(declaim (ftype (function (t stream) t) dump-object))
    93102(defun dump-object (object stream)
     
    106115        ((and (symbolp object) ;; uninterned symbol
    107116              (null (symbol-package object)))
    108          (let ((index (cdr (assoc object *fasl-uninterned-symbols*))))
    109            (unless index
    110              (setq index (1+ (or (cdar *fasl-uninterned-symbols*) -1)))
    111              (setq *fasl-uninterned-symbols*
    112                    (acons object index *fasl-uninterned-symbols*)))
    113            (write-string "#" stream)
    114            (write index :stream stream)
    115            (write-string "?" stream)))
     117         (write-string "#" stream)
     118         (write (dump-uninterned-symbol-index object) :stream stream)
     119         (write-string "?" stream))
    116120        (t
    117121         (%stream-output-object object stream))))
Note: See TracChangeset for help on using the changeset viewer.