Changeset 12710


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

Move access to uninterned symbols array to Load.java for
future use by the compiler.

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

Legend:

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

    r12650 r12710  
    287287        public LispObject execute(Stream stream, char c, int n)
    288288        {
    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."));
     289            return Load.getUninternedSymbol(n);
    309290        }
    310291    };
  • trunk/abcl/src/org/armedbear/lisp/Load.java

    r12650 r12710  
    381381        internSpecial("*FASL-UNINTERNED-SYMBOLS*", PACKAGE_SYS, NIL);
    382382
     383    // Function to access the uninterned symbols "array"
     384    public final static LispObject getUninternedSymbol(int n) {
     385        LispThread thread = LispThread.currentThread();
     386        LispObject uninternedSymbols =
     387            Load._FASL_UNINTERNED_SYMBOLS_.symbolValue(thread);
     388
     389        if (! (uninternedSymbols instanceof Cons)) // it must be a vector
     390            return uninternedSymbols.AREF(n);
     391
     392        // During normal loading, we won't get to this bit, however,
     393        // with eval-when processing, we may need to fall back to
     394        // *FASL-UNINTERNED-SYMBOLS* being an alist structure
     395        LispObject label = LispInteger.getInstance(n);
     396        while (uninternedSymbols != NIL)
     397            {
     398                LispObject item = uninternedSymbols.car();
     399                if (label.eql(item.cdr()))
     400                  return item.car();
     401
     402                uninternedSymbols = uninternedSymbols.cdr();
     403            }
     404        return error(new LispError("No entry for uninterned symbol."));
     405    }
     406
     407
    383408    // ### init-fasl &key version
    384409    private static final Primitive INIT_FASL = new init_fasl();
Note: See TracChangeset for help on using the changeset viewer.