Changeset 13193 for trunk/abcl/src/org


Ignore:
Timestamp:
01/30/11 18:55:48 (11 years ago)
Author:
ehuelsmann
Message:

Revert r13190: Detect loops in autoloads and requires.

Note: This commit broke trunk; reverting restores it.

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

Legend:

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

    r13190 r13193  
    4646    private final Symbol symbol;
    4747
    48     private final static Symbol AUTOLOADS_IN_PROGRESS
    49             = PACKAGE_SYS.addInternalSymbol("*AUTOLOADS-IN-PROGRESS*");
    50     {
    51         AUTOLOADS_IN_PROGRESS.setSymbolValue(NIL);
    52     }
    53 
    5448    protected Autoload(Symbol symbol)
    5549    {
     
    140134    }
    141135
    142     private void detectCircularity(LispThread thread) {
    143         SimpleString val = new SimpleString((getFileName() == null)
    144                 ? className : getFileName());
    145         LispObject autoloads = AUTOLOADS_IN_PROGRESS.symbolValue(thread);
    146         LispObject list = autoloads;
    147         while (list != NIL) {
    148             if (val.equal(list.car()))
    149                 Lisp.error(new SimpleString("Autoloading circularity detected while resolving "
    150                         + symbol.getQualifiedName() + "; autoloads in "
    151                         + "progress: " + autoloads.writeToString()));
    152 
    153             list = list.cdr();
    154         }
    155 
    156         return;
    157     }
    158 
    159136    public void load()
    160137    {
    161138        final LispThread thread = LispThread.currentThread();
    162 
    163         detectCircularity(thread);
    164 
    165139        final SpecialBindingsMark mark = thread.markSpecialBindings();
    166140        int loadDepth = Fixnum.getValue(_LOAD_DEPTH_.symbolValue());
    167141        thread.bindSpecial(_LOAD_DEPTH_, Fixnum.getInstance(++loadDepth));
    168         thread.pushSpecial(AUTOLOADS_IN_PROGRESS,
    169                 new SimpleString((getFileName() == null) ? className : getFileName()));
    170142        try {
    171143            if (_AUTOLOAD_VERBOSE_.symbolValue(thread) != NIL
  • trunk/abcl/src/org/armedbear/lisp/require.lisp

    r13190 r13193  
    3737  t)
    3838
    39 (defun module-provide-system (module)
     39(defun module-provide-system (module) 
    4040  (let ((*readtable* (copy-readtable nil)))
    41     (handler-case
     41    (handler-case 
    4242        (load-system-file (string-downcase (string module)))
    43       (t (e)
     43      (t (e) 
    4444        (unless (and (typep e 'error)
    4545                     (search "Failed to find loadable system file"
    4646                             (format nil "~A" e)))
    47           (format *error-output* "Failed to require  ~A because '~A'~%"
     47          (format *error-output* "Failed to require  ~A because '~A'~%" 
    4848                  module e))
    4949        nil))))
    50 
     50   
    5151(defvar *module-provider-functions* nil)
    52 (defvar *requires-in-progress* nil)
    5352
    5453(defun require (module-name &optional pathnames)
    5554  (unless (member (string module-name) *modules* :test #'string=)
    56     (unless (member (string module-name) *requires-in-progress*
    57                     :test #'string=)
    58       (error "Circularity detected while requiring ~A; ~
    59               nesting list: ~S." module-name *requires-in-progress*))
    60     (let ((saved-modules (copy-list *modules*))
    61           (*requires-in-progress* (cons (string module-name)
    62                                         *requires-in-progress*)))
     55    (let ((saved-modules (copy-list *modules*)))
    6356      (cond (pathnames
    6457             (unless (listp pathnames) (setf pathnames (list pathnames)))
Note: See TracChangeset for help on using the changeset viewer.