Changeset 12711
- Timestamp:
- 05/19/10 22:29:03 (13 years ago)
- 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 214 214 (defconstant +lisp-thread-class+ "org/armedbear/lisp/LispThread") 215 215 (defconstant +lisp-thread+ "Lorg/armedbear/lisp/LispThread;") 216 (defconstant +lisp-load-class+ "org/armedbear/lisp/Load") 216 217 (defconstant +lisp-cons-class+ "org/armedbear/lisp/Cons") 217 218 (defconstant +lisp-cons+ "Lorg/armedbear/lisp/Cons;") … … 2151 2152 (emit 'getstatic class name +lisp-symbol+)) 2152 2153 ((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+) 2160 2157 (emit 'checkcast +lisp-symbol-class+)) 2161 2158 ((keywordp symbol) -
trunk/abcl/src/org/armedbear/lisp/dump-form.lisp
r12650 r12711 32 32 (in-package "SYSTEM") 33 33 34 (export ' dump-form)34 (export '(dump-form dump-uninterned-symbol-index)) 35 35 36 36 (declaim (ftype (function (cons stream) t) dump-cons)) … … 90 90 (dump-object creation-form stream)))) 91 91 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 92 101 (declaim (ftype (function (t stream) t) dump-object)) 93 102 (defun dump-object (object stream) … … 106 115 ((and (symbolp object) ;; uninterned symbol 107 116 (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)) 116 120 (t 117 121 (%stream-output-object object stream))))
Note: See TracChangeset
for help on using the changeset viewer.