Changeset 14002


Ignore:
Timestamp:
07/12/12 09:25:37 (8 years ago)
Author:
Mark Evenson
Message:

dmiles: SYS:*COMPILE-FILE-CLASS-EXTENSION* contains PATHNAME TYPE of compiled JVM artifacts.

The default "cls" of compiled JVM artifacts was chosen to easily
differentiate bewtween JVM artifacts not produced by ABCL and those
which are the JVM bytecode of the ABCL Java 5.0 compiler. During the
bootstrapping and subsequent debugging of the current compiler, this
distinction has proven more useful than giving ABCL produced artifacts
the default "class" CL:PATHNAME TYPE.

This change facilitates the bootstrapping of [running ABCL on the MSFT
.NET CLR underway by dmiles][abcl-ikvm]

[abcl-ikvm]: http://code.google.com/r/logicmoo-abcl-ikvm

dmiles: Implementation of ticket #34.

dmiles: It makes no change at first but makes implmentation satisfactory to my
initial request.

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

Legend:

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

    r13605 r14002  
    112112
    113113    public byte[] getFunctionClassBytes(String name) {
    114         Pathname pathname = new Pathname(name.substring("org/armedbear/lisp/".length()) + ".cls");
     114        Pathname pathname = new Pathname(name.substring("org/armedbear/lisp/".length()) + "." + Lisp._COMPILE_FILE_CLASS_EXTENSION_.symbolValue().getStringValue());
    115115        return readFunctionBytes(pathname);
    116116    }
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r13967 r14002  
    24832483
    24842484  // ### *compile-file-type*
    2485   public static final String COMPILE_FILE_TYPE = "abcl";
    24862485  public static final Symbol _COMPILE_FILE_TYPE_ =
    2487     internConstant("*COMPILE-FILE-TYPE*", PACKAGE_SYS,
    2488                    new SimpleString(COMPILE_FILE_TYPE));
     2486   exportSpecial("*COMPILE-FILE-TYPE*", PACKAGE_SYS, new SimpleString("abcl"));   
     2487 
     2488  // ### *compile-file-class-extension*
     2489  public static final Symbol _COMPILE_FILE_CLASS_EXTENSION_ =
     2490   exportSpecial("*COMPILE-FILE-CLASS-EXTENSION*", PACKAGE_SYS, new SimpleString("cls"));
    24892491
    24902492  // ### *compile-file-zip*
  • trunk/abcl/src/org/armedbear/lisp/Load.java

    r13851 r14002  
    7474            }
    7575        }
     76        final String COMPILE_FILE_TYPE = Lisp._COMPILE_FILE_TYPE_.symbolValue().getStringValue();
    7677        if (name.type == NIL
    7778            && (name.name != NIL || name.name != null)) {
     
    8182            LispObject lisp = Pathname.truename(lispPathname, false);
    8283            Pathname abclPathname = new Pathname(name);
    83             abclPathname.type = new SimpleString("abcl");
     84            abclPathname.type = new SimpleString(COMPILE_FILE_TYPE);
    8485            abclPathname.invalidateNamestring();
    8586            LispObject abcl = Pathname.truename(abclPathname, false);
     
    263264        URL url = null;
    264265        truename = findLoadableFile(mergedPathname);
     266        final String COMPILE_FILE_TYPE = Lisp._COMPILE_FILE_TYPE_.symbolValue().getStringValue();
    265267        if (truename == null || truename.equals(NIL) || bootPath.equals(NIL)) {
    266268            // Make an attempt to use the boot classpath
    267269            String path = pathname.asEntryPath();
    268             url = Lisp.class.getResource(path);
     270            url = Lisp.class.getResource(path);           
    269271            if (url == null || url.toString().endsWith("/")) {
    270                 url = Lisp.class.getResource(path.replace('-', '_') + ".abcl");
     272                url = Lisp.class.getResource(path.replace('-', '_') + "." + COMPILE_FILE_TYPE);
    271273                if (url == null) {
    272274                    url = Lisp.class.getResource(path + ".lisp");
     
    477479                truePathname = new Pathname(((Pathname)truename).getNamestring());
    478480                String type = truePathname.type.getStringValue();
    479                 if (type.equals(COMPILE_FILE_TYPE)
     481                if (type.equals(Lisp._COMPILE_FILE_TYPE_.symbolValue(thread).getStringValue())
    480482                    || type.equals(COMPILE_FILE_INIT_FASL_TYPE.toString())) {
    481483                    Pathname truenameFasl = new Pathname(truePathname);
  • trunk/abcl/src/org/armedbear/lisp/compile-file.lisp

    r13948 r14002  
    5454         (sanitize-class-name
    5555    (%format nil "~A_~D" (pathname-name output-file-pathname) n))))
    56     (namestring (merge-pathnames (make-pathname :name name :type "cls")
     56    (namestring (merge-pathnames (make-pathname :name name :type *compile-file-class-extension*)
    5757                                 output-file-pathname))))
    5858
     
    617617         (fasl-loader (namestring (merge-pathnames
    618618                                   (make-pathname :name (fasl-loader-classname)
    619                                                   :type "cls")
     619                                                  :type *compile-file-class-extension*)
    620620                                   output-file))))
    621621    (when (probe-file fasl-loader)
  • trunk/abcl/src/org/armedbear/lisp/compile-system.lisp

    r13710 r14002  
    8787      (setf output-path *default-pathname-defaults*))
    8888    (flet ((do-compile (file)
    89              (let ((out (make-pathname :type "abcl"
     89             (let ((out (make-pathname :type *compile-file-type*
    9090                                       :defaults (merge-pathnames
    9191                                                  file output-path))))
     
    274274    t))
    275275
    276 (defun compile-system (&key quit (zip t) output-path)
    277   (let ((status -1))
     276(defun compile-system (&key quit (zip t) (cls-ext *compile-file-class-extension*) (abcl-ext *compile-file-type*) output-path)
     277  (let ((status -1)
     278  (*compile-file-class-extension* cls-ext)
     279  (*compile-file-type* abcl-ext))
    278280    (check-lisp-home)
    279281    (time
  • trunk/abcl/src/org/armedbear/lisp/scripting/AbclScriptEngine.java

    r13101 r14002  
    137137
    138138  public static boolean isCompiled(String filespec) {
    139     if (filespec.endsWith(".abcl")) {
     139    final String compiledExt = "." + Lisp._COMPILE_FILE_TYPE_.symbolValue().getStringValue();
     140    if (filespec.endsWith(compiledExt)) {
    140141      return true;
    141142    }
     
    145146      source = new File(filespec);
    146147      compiled = new File(filespec.substring(0, filespec.length() - 5)
    147           + ".abcl");
     148          + compiledExt);
    148149    } else {
    149150      source = new File(filespec + ".lisp");
    150       compiled = new File(filespec + ".abcl");
     151      compiled = new File(filespec + compiledExt);
    151152    }
    152153    if (!source.exists()) {
Note: See TracChangeset for help on using the changeset viewer.