Changeset 12650
- Timestamp:
- 05/02/10 19:58:56 (13 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/AutoloadedFunctionProxy.java
r12649 r12650 51 51 { 52 52 AUTOLOADING_CACHE, // allow loading local preloaded functions 53 Load._FASL_ANONYMOUS_PACKAGE_, // package for uninterned symbols54 53 Load._FASL_UNINTERNED_SYMBOLS_, // vector of uninterned symbols 55 54 Symbol._PACKAGE_, // current package -
trunk/abcl/src/org/armedbear/lisp/FaslReader.java
r12604 r12650 142 142 { 143 143 LispThread thread = LispThread.currentThread(); 144 Symbol symbol = (Symbol) stream.readSymbol(FaslReadtable.getInstance()); 145 LispObject pkg = Load._FASL_ANONYMOUS_PACKAGE_.symbolValue(thread); 146 Debug.assertTrue(pkg != NIL); 147 symbol = ((Package)pkg).intern(symbol.getName()); 148 symbol.setPackage(NIL); 149 return symbol; 144 return stream.readSymbol(FaslReadtable.getInstance()); 150 145 } 151 146 }; … … 278 273 @Override 279 274 public LispObject execute(Stream stream, char c, int n) 280 281 275 { 282 276 return stream.readCharacterLiteral(FaslReadtable.getInstance(), … … 284 278 } 285 279 }; 280 281 // ### fasl-sharp-question-mark 282 public static final DispatchMacroFunction FASL_SHARP_QUESTION_MARK = 283 new DispatchMacroFunction("fasl-sharp-question-mark", PACKAGE_SYS, 284 false, "stream sub-char numarg") 285 { 286 @Override 287 public LispObject execute(Stream stream, char c, int n) 288 { 289 LispThread thread = LispThread.currentThread(); 290 LispObject uninternedSymbols = 291 Load._FASL_UNINTERNED_SYMBOLS_.symbolValue(thread); 292 293 if (! (uninternedSymbols instanceof Cons)) // it must be a vector 294 return uninternedSymbols.AREF(n); 295 296 // During normal loading, we won't get to this bit, however, 297 // with eval-when processing, we may need to fall back to 298 // *FASL-UNINTERNED-SYMBOLS* being an alist structure 299 LispObject label = LispInteger.getInstance(n); 300 while (uninternedSymbols != NIL) 301 { 302 LispObject item = uninternedSymbols.car(); 303 if (label.eql(item.cdr())) 304 return item.car(); 305 306 uninternedSymbols = uninternedSymbols.cdr(); 307 } 308 return error(new LispError("No entry for uninterned symbol.")); 309 } 310 }; 311 286 312 } -
trunk/abcl/src/org/armedbear/lisp/FaslReadtable.java
r12591 r12650 101 101 dtfunctions[12] = LispReader.SHARP_ILLEGAL; // page 102 102 dtfunctions[13] = LispReader.SHARP_ILLEGAL; // return 103 dtfunctions['?'] = FaslReader.FASL_SHARP_QUESTION_MARK; 103 104 dispatchTables.constants['#'] = dt; 104 105 -
trunk/abcl/src/org/armedbear/lisp/Load.java
r12649 r12650 362 362 // internal symbol 363 363 static final Symbol _FASL_VERSION_ = 364 exportConstant("*FASL-VERSION*", PACKAGE_SYS, Fixnum.getInstance(3 5));364 exportConstant("*FASL-VERSION*", PACKAGE_SYS, Fixnum.getInstance(36)); 365 365 366 366 // ### *fasl-external-format* … … 369 369 internConstant("*FASL-EXTERNAL-FORMAT*", PACKAGE_SYS, 370 370 new SimpleString("UTF-8")); 371 372 // ### *fasl-anonymous-package*373 // internal symbol374 /**375 * This variable gets bound to a package with no name in which the376 * reader can intern its uninterned symbols.377 *378 */379 public static final Symbol _FASL_ANONYMOUS_PACKAGE_ =380 internSpecial("*FASL-ANONYMOUS-PACKAGE*", PACKAGE_SYS, NIL);381 371 382 372 // ### *fasl-uninterned-symbols* … … 405 395 // OK 406 396 final LispThread thread = LispThread.currentThread(); 407 thread.bindSpecial(_FASL_ANONYMOUS_PACKAGE_, NIL);408 397 thread.bindSpecial(_FASL_UNINTERNED_SYMBOLS_, NIL); 409 398 thread.bindSpecial(_SOURCE_, NIL); … … 596 585 LispObject result = NIL; 597 586 try { 598 thread.bindSpecial(_FASL_ANONYMOUS_PACKAGE_, new Package());599 587 thread.bindSpecial(AUTOLOADING_CACHE, 600 588 AutoloadedFunctionProxy.makePreloadingContext()); -
trunk/abcl/src/org/armedbear/lisp/compile-file.lisp
r12626 r12650 70 70 (declaim (ftype (function (t) t) verify-load)) 71 71 (defun verify-load (classfile) 72 (if (> *safety* 0) 72 (if (> *safety* 0) 73 73 (and classfile 74 74 (let ((*load-truename* *output-file-pathname*)) … … 76 76 (load-compiled-function classfile)))) 77 77 t)) 78 78 79 79 (declaim (ftype (function (t) t) process-defconstant)) 80 80 (defun process-defconstant (form) … … 515 515 (namestring (namestring *compile-file-truename*)) 516 516 (start (get-internal-real-time)) 517 elapsed) 517 elapsed 518 *fasl-uninterned-symbols*) 518 519 (when *compile-verbose* 519 520 (format t "; Compiling ~A ...~%" namestring)) … … 528 529 (jvm::*functions-defined-in-current-file* '()) 529 530 (*fbound-names* '()) 530 (*fasl-anonymous-package* (%make-package))531 531 (*fasl-stream* out) 532 532 *forms-for-output*) … … 566 566 (write "; -*- Mode: Lisp -*-" :escape nil :stream out) 567 567 (%stream-terpri out) 568 (let ((*package* (find-package '#:cl)) 569 (count-sym (gensym))) 568 (let ((*package* (find-package '#:cl))) 570 569 (write (list 'init-fasl :version *fasl-version*) 571 570 :stream out) … … 574 573 :stream out) 575 574 (%stream-terpri out) 576 (dump-form `(dotimes (,count-sym ,*class-number*) 577 (function-preload 578 (%format nil "~A-~D.cls" 579 ,(substitute #\_ #\. (pathname-name output-file)) 580 (1+ ,count-sym)))) out) 575 ;; Note: Beyond this point, you can't use DUMP-FORM, 576 ;; because the list of uninterned symbols has been fixed now. 577 (when *fasl-uninterned-symbols* 578 (write (list 'setq '*fasl-uninterned-symbols* 579 (coerce (mapcar #'car 580 (nreverse *fasl-uninterned-symbols*)) 581 'vector)) 582 :stream out)) 583 (%stream-terpri out) 584 ;; we work with a fixed variable name here to work around the 585 ;; lack of availability of the circle reader in the fasl reader 586 ;; but it's a toplevel form anyway 587 (write `(dotimes (i ,*class-number*) 588 (function-preload 589 (%format nil "~A-~D.cls" 590 ,(substitute #\_ #\. (pathname-name output-file)) 591 (1+ i)))) 592 :stream out 593 :circle t) 581 594 (%stream-terpri out)) 582 595 -
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r12639 r12650 8761 8761 (*local-functions* nil) 8762 8762 (*pathnames-generator* (constantly nil)) 8763 (sys::*fasl-anonymous-package* (sys::%make-package))8764 8763 environment) 8765 8764 (unless (and (consp definition) (eq (car definition) 'LAMBDA)) -
trunk/abcl/src/org/armedbear/lisp/dump-form.lisp
r11566 r12650 104 104 (java:java-object-p object)) 105 105 (dump-instance object stream)) 106 ((and (symbolp object) ;; uninterned symbol 107 (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))) 106 116 (t 107 117 (%stream-output-object object stream))))
Note: See TracChangeset
for help on using the changeset viewer.